/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./src/app.ts"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./node_modules/eventemitter3/index.js": /*!*********************************************!*\ !*** ./node_modules/eventemitter3/index.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif (true) {\n module.exports = EventEmitter;\n}\n\n\n//# sourceURL=webpack:///./node_modules/eventemitter3/index.js?"); /***/ }), /***/ "./node_modules/phaser/plugins/camera3d/src/Camera.js": /*!************************************************************!*\ !*** ./node_modules/phaser/plugins/camera3d/src/Camera.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../src/utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Matrix4 = __webpack_require__(/*! ../../../src/math/Matrix4 */ \"./node_modules/phaser/src/math/Matrix4.js\");\r\nvar RandomXYZ = __webpack_require__(/*! ../../../src/math/RandomXYZ */ \"./node_modules/phaser/src/math/RandomXYZ.js\");\r\nvar RandomXYZW = __webpack_require__(/*! ../../../src/math/RandomXYZW */ \"./node_modules/phaser/src/math/RandomXYZW.js\");\r\nvar RotateVec3 = __webpack_require__(/*! ../../../src/math/RotateVec3 */ \"./node_modules/phaser/src/math/RotateVec3.js\");\r\nvar Set = __webpack_require__(/*! ../../../src/structs/Set */ \"./node_modules/phaser/src/structs/Set.js\");\r\nvar Sprite3D = __webpack_require__(/*! ./sprite3d/Sprite3D */ \"./node_modules/phaser/plugins/camera3d/src/sprite3d/Sprite3D.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../../src/math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\nvar Vector3 = __webpack_require__(/*! ../../../src/math/Vector3 */ \"./node_modules/phaser/src/math/Vector3.js\");\r\nvar Vector4 = __webpack_require__(/*! ../../../src/math/Vector4 */ \"./node_modules/phaser/src/math/Vector4.js\");\r\n\r\n// Local cache vars\r\nvar tmpVec3 = new Vector3();\r\nvar tmpVec4 = new Vector4();\r\nvar dirvec = new Vector3();\r\nvar rightvec = new Vector3();\r\nvar billboardMatrix = new Matrix4();\r\n\r\n// @author attribute https://github.com/mattdesl/cam3d/wiki\r\n\r\n/**\r\n * @typedef {object} RayDef\r\n *\r\n * @property {Phaser.Math.Vector3} origin - [description]\r\n * @property {Phaser.Math.Vector3} direction - [description]\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * [description]\r\n *\r\n * @class Camera\r\n * @memberOf Phaser.Cameras.Sprite3D\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - [description]\r\n */\r\nvar Camera = new Class({\r\n\r\n initialize:\r\n\r\n function Camera (scene)\r\n {\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#displayList\r\n * @type {Phaser.GameObjects.DisplayList}\r\n * @since 3.0.0\r\n */\r\n this.displayList = scene.sys.displayList;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#updateList\r\n * @type {Phaser.GameObjects.UpdateList}\r\n * @since 3.0.0\r\n */\r\n this.updateList = scene.sys.updateList;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#name\r\n * @type {string}\r\n * @default ''\r\n * @since 3.0.0\r\n */\r\n this.name = '';\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#direction\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.0.0\r\n */\r\n this.direction = new Vector3(0, 0, -1);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#up\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.0.0\r\n */\r\n this.up = new Vector3(0, 1, 0);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#position\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.0.0\r\n */\r\n this.position = new Vector3();\r\n\r\n\r\n /**\r\n * The mapping from 3D size units to pixels.\r\n * In the default case 1 3D unit = 128 pixels. So a sprite that is\r\n * 256 x 128 px in size will be 2 x 1 units.\r\n * Change to whatever best fits your game assets.\r\n *\r\n * @name Phaser.Cameras.Sprite3D#pixelScale\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.pixelScale = 128;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#projection\r\n * @type {Phaser.Math.Matrix4}\r\n * @since 3.0.0\r\n */\r\n this.projection = new Matrix4();\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#view\r\n * @type {Phaser.Math.Matrix4}\r\n * @since 3.0.0\r\n */\r\n this.view = new Matrix4();\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#combined\r\n * @type {Phaser.Math.Matrix4}\r\n * @since 3.0.0\r\n */\r\n this.combined = new Matrix4();\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#invProjectionView\r\n * @type {Phaser.Math.Matrix4}\r\n * @since 3.0.0\r\n */\r\n this.invProjectionView = new Matrix4();\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#near\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.near = 1;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#far\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.far = 100;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#ray\r\n * @type {RayDef}\r\n * @since 3.0.0\r\n */\r\n this.ray = {\r\n origin: new Vector3(),\r\n direction: new Vector3()\r\n };\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#viewportWidth\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.viewportWidth = 0;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#viewportHeight\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.viewportHeight = 0;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#billboardMatrixDirty\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.billboardMatrixDirty = true;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D#children\r\n * @type {Phaser.Structs.Set.}\r\n * @since 3.0.0\r\n */\r\n this.children = new Set();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#setPosition\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - [description]\r\n * @param {number} y - [description]\r\n * @param {number} z - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n setPosition: function (x, y, z)\r\n {\r\n this.position.set(x, y, z);\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#setScene\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n setScene: function (scene)\r\n {\r\n this.scene = scene;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#setPixelScale\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n setPixelScale: function (value)\r\n {\r\n this.pixelScale = value;\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#add\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Sprite3D} sprite3D - [description]\r\n *\r\n * @return {Phaser.GameObjects.Sprite3D} [description]\r\n */\r\n add: function (sprite3D)\r\n {\r\n this.children.set(sprite3D);\r\n\r\n this.displayList.add(sprite3D.gameObject);\r\n this.updateList.add(sprite3D.gameObject);\r\n\r\n this.updateChildren();\r\n\r\n return sprite3D;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#remove\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n remove: function (child)\r\n {\r\n this.displayList.remove(child.gameObject);\r\n this.updateList.remove(child.gameObject);\r\n\r\n this.children.delete(child);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#clear\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n clear: function ()\r\n {\r\n var children = this.getChildren();\r\n\r\n for (var i = 0; i < children.length; i++)\r\n {\r\n this.remove(children[i]);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#getChildren\r\n * @since 3.0.0\r\n *\r\n * @return {array} [description]\r\n */\r\n getChildren: function ()\r\n {\r\n return this.children.entries;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#create\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - [description]\r\n * @param {number} y - [description]\r\n * @param {number} z - [description]\r\n * @param {string} key - [description]\r\n * @param {(string|number)} frame - [description]\r\n * @param {boolean} [visible=true] - [description]\r\n *\r\n * @return {Phaser.GameObjects.Sprite3D} [description]\r\n */\r\n create: function (x, y, z, key, frame, visible)\r\n {\r\n if (visible === undefined) { visible = true; }\r\n\r\n var child = new Sprite3D(this.scene, x, y, z, key, frame);\r\n\r\n this.displayList.add(child.gameObject);\r\n this.updateList.add(child.gameObject);\r\n\r\n child.visible = visible;\r\n\r\n this.children.set(child);\r\n\r\n this.updateChildren();\r\n\r\n return child;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#createMultiple\r\n * @since 3.0.0\r\n *\r\n * @param {number} quantity - [description]\r\n * @param {string} key - [description]\r\n * @param {(string|number)} frame - [description]\r\n * @param {boolean} [visible=true] - [description]\r\n *\r\n * @return {Phaser.GameObjects.Sprite3D[]} [description]\r\n */\r\n createMultiple: function (quantity, key, frame, visible)\r\n {\r\n if (visible === undefined) { visible = true; }\r\n\r\n var output = [];\r\n\r\n for (var i = 0; i < quantity; i++)\r\n {\r\n var child = new Sprite3D(this.scene, 0, 0, 0, key, frame);\r\n\r\n this.displayList.add(child.gameObject);\r\n this.updateList.add(child.gameObject);\r\n\r\n child.visible = visible;\r\n\r\n this.children.set(child);\r\n\r\n output.push(child);\r\n }\r\n\r\n return output;\r\n },\r\n\r\n // Create a bunch of Sprite3D objects in a rectangle\r\n // size and spacing are Vec3s (or if integers are converted to vec3s)\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#createRect\r\n * @since 3.0.0\r\n *\r\n * @param {(number|{x:number,y:number})} size - [description]\r\n * @param {(number|{x:number,y:number,z:number})} spacing - [description]\r\n * @param {string} key - [description]\r\n * @param {(string|number)} [frame] - [description]\r\n *\r\n * @return {Phaser.GameObjects.Sprite3D[]} [description]\r\n */\r\n createRect: function (size, spacing, key, frame)\r\n {\r\n if (typeof size === 'number') { size = { x: size, y: size, z: size }; }\r\n if (typeof spacing === 'number') { spacing = { x: spacing, y: spacing, z: spacing }; }\r\n\r\n var quantity = size.x * size.y * size.z;\r\n\r\n var sprites = this.createMultiple(quantity, key, frame);\r\n\r\n var i = 0;\r\n\r\n for (var z = 0.5 - (size.z / 2); z < (size.z / 2); z++)\r\n {\r\n for (var y = 0.5 - (size.y / 2); y < (size.y / 2); y++)\r\n {\r\n for (var x = 0.5 - (size.x / 2); x < (size.x / 2); x++)\r\n {\r\n var bx = (x * spacing.x);\r\n var by = (y * spacing.y);\r\n var bz = (z * spacing.z);\r\n\r\n sprites[i].position.set(bx, by, bz);\r\n\r\n i++;\r\n }\r\n }\r\n }\r\n\r\n this.update();\r\n\r\n return sprites;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#randomSphere\r\n * @since 3.0.0\r\n *\r\n * @param {number} [radius=1] - [description]\r\n * @param {Phaser.GameObjects.Sprite3D[]} [sprites] - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n randomSphere: function (radius, sprites)\r\n {\r\n if (sprites === undefined) { sprites = this.getChildren(); }\r\n\r\n for (var i = 0; i < sprites.length; i++)\r\n {\r\n RandomXYZ(sprites[i].position, radius);\r\n }\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#randomCube\r\n * @since 3.0.0\r\n *\r\n * @param {number} [scale=1] - [description]\r\n * @param {Phaser.GameObjects.Sprite3D[]} [sprites] - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n randomCube: function (scale, sprites)\r\n {\r\n if (sprites === undefined) { sprites = this.getChildren(); }\r\n\r\n for (var i = 0; i < sprites.length; i++)\r\n {\r\n RandomXYZW(sprites[i].position, scale);\r\n }\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#translateChildren\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} vec3 - [description]\r\n * @param {Phaser.GameObjects.Sprite3D[]} sprites - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n translateChildren: function (vec3, sprites)\r\n {\r\n if (sprites === undefined) { sprites = this.getChildren(); }\r\n\r\n for (var i = 0; i < sprites.length; i++)\r\n {\r\n sprites[i].position.add(vec3);\r\n }\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#transformChildren\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat4 - [description]\r\n * @param {Phaser.GameObjects.Sprite3D[]} sprites - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n transformChildren: function (mat4, sprites)\r\n {\r\n if (sprites === undefined) { sprites = this.getChildren(); }\r\n\r\n for (var i = 0; i < sprites.length; i++)\r\n {\r\n sprites[i].position.transformMat4(mat4);\r\n }\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * Sets the width and height of the viewport. Does not update any matrices.\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#setViewport\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - [description]\r\n * @param {number} height - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n setViewport: function (width, height)\r\n {\r\n this.viewportWidth = width;\r\n this.viewportHeight = height;\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * Translates this camera by a specified Vector3 object\r\n * or x, y, z parameters. Any undefined x y z values will\r\n * default to zero, leaving that component unaffected.\r\n * If you wish to set the camera position directly call setPosition instead.\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#translate\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} x - [description]\r\n * @param {number} [y] - [description]\r\n * @param {number} [z] - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n translate: function (x, y, z)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.position.x += x.x || 0;\r\n this.position.y += x.y || 0;\r\n this.position.z += x.z || 0;\r\n }\r\n else\r\n {\r\n this.position.x += x || 0;\r\n this.position.y += y || 0;\r\n this.position.z += z || 0;\r\n }\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#lookAt\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} x - [description]\r\n * @param {number} [y] - [description]\r\n * @param {number} [z] - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n lookAt: function (x, y, z)\r\n {\r\n var dir = this.direction;\r\n var up = this.up;\r\n\r\n if (typeof x === 'object')\r\n {\r\n dir.copy(x);\r\n }\r\n else\r\n {\r\n dir.set(x, y, z);\r\n }\r\n\r\n dir.subtract(this.position).normalize();\r\n\r\n // Calculate right vector\r\n tmpVec3.copy(dir).cross(up).normalize();\r\n\r\n // Calculate up vector\r\n up.copy(tmpVec3).cross(dir).normalize();\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} radians - [description]\r\n * @param {Phaser.Math.Vector3} axis - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n rotate: function (radians, axis)\r\n {\r\n RotateVec3(this.direction, axis, radians);\r\n RotateVec3(this.up, axis, radians);\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#rotateAround\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} point - [description]\r\n * @param {number} radians - [description]\r\n * @param {Phaser.Math.Vector3} axis - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n rotateAround: function (point, radians, axis)\r\n {\r\n tmpVec3.copy(point).subtract(this.position);\r\n\r\n this.translate(tmpVec3);\r\n this.rotate(radians, axis);\r\n this.translate(tmpVec3.negate());\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#project\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} vec - [description]\r\n * @param {Phaser.Math.Vector4} out - [description]\r\n *\r\n * @return {Phaser.Math.Vector4} [description]\r\n */\r\n project: function (vec, out)\r\n {\r\n if (out === undefined) { out = new Vector4(); }\r\n\r\n // TODO: support viewport XY\r\n var viewportWidth = this.viewportWidth;\r\n var viewportHeight = this.viewportHeight;\r\n var n = Camera.NEAR_RANGE;\r\n var f = Camera.FAR_RANGE;\r\n\r\n // For useful Z and W values we should do the usual steps: clip space -> NDC -> window coords\r\n\r\n // Implicit 1.0 for w component\r\n tmpVec4.set(vec.x, vec.y, vec.z, 1.0);\r\n\r\n // Transform into clip space\r\n tmpVec4.transformMat4(this.combined);\r\n\r\n // Avoid divide by zero when 0x0x0 camera projects to a 0x0x0 vec3\r\n if (tmpVec4.w === 0)\r\n {\r\n tmpVec4.w = 1;\r\n }\r\n\r\n // Now into NDC\r\n tmpVec4.x = tmpVec4.x / tmpVec4.w;\r\n tmpVec4.y = tmpVec4.y / tmpVec4.w;\r\n tmpVec4.z = tmpVec4.z / tmpVec4.w;\r\n\r\n // And finally into window coordinates\r\n out.x = viewportWidth / 2 * tmpVec4.x + (0 + viewportWidth / 2);\r\n out.y = viewportHeight / 2 * tmpVec4.y + (0 + viewportHeight / 2);\r\n out.z = (f - n) / 2 * tmpVec4.z + (f + n) / 2;\r\n\r\n // If the out vector has a fourth component, we also store (1/clip.w), same idea as gl_FragCoord.w\r\n if (out.w === 0 || out.w)\r\n {\r\n out.w = 1 / tmpVec4.w;\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#unproject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} vec - [description]\r\n * @param {Phaser.Math.Vector3} out - [description]\r\n *\r\n * @return {Phaser.Math.Vector3} [description]\r\n */\r\n unproject: function (vec, out)\r\n {\r\n if (out === undefined) { out = new Vector3(); }\r\n\r\n var viewport = tmpVec4.set(0, 0, this.viewportWidth, this.viewportHeight);\r\n\r\n return out.copy(vec).unproject(viewport, this.invProjectionView);\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#getPickRay\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - [description]\r\n * @param {number} [y] - [description]\r\n *\r\n * @return {RayDef} [description]\r\n */\r\n getPickRay: function (x, y)\r\n {\r\n var origin = this.ray.origin.set(x, y, 0);\r\n var direction = this.ray.direction.set(x, y, 1);\r\n var viewport = tmpVec4.set(0, 0, this.viewportWidth, this.viewportHeight);\r\n var mtx = this.invProjectionView;\r\n\r\n origin.unproject(viewport, mtx);\r\n\r\n direction.unproject(viewport, mtx);\r\n\r\n direction.subtract(origin).normalize();\r\n\r\n return this.ray;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#updateChildren\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n updateChildren: function ()\r\n {\r\n var children = this.children.entries;\r\n\r\n for (var i = 0; i < children.length; i++)\r\n {\r\n children[i].project(this);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n // Overridden by subclasses\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#update\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n update: function ()\r\n {\r\n return this.updateChildren();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#updateBillboardMatrix\r\n * @since 3.0.0\r\n */\r\n updateBillboardMatrix: function ()\r\n {\r\n var dir = dirvec.set(this.direction).negate();\r\n\r\n // Better view-aligned billboards might use this:\r\n // var dir = tmp.set(camera.position).subtract(p).normalize();\r\n\r\n var right = rightvec.set(this.up).cross(dir).normalize();\r\n var up = tmpVec3.set(dir).cross(right).normalize();\r\n\r\n var out = billboardMatrix.val;\r\n\r\n out[0] = right.x;\r\n out[1] = right.y;\r\n out[2] = right.z;\r\n out[3] = 0;\r\n\r\n out[4] = up.x;\r\n out[5] = up.y;\r\n out[6] = up.z;\r\n out[7] = 0;\r\n\r\n out[8] = dir.x;\r\n out[9] = dir.y;\r\n out[10] = dir.z;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n this.billboardMatrixDirty = false;\r\n },\r\n\r\n /**\r\n * This is a utility function for canvas 3D rendering,\r\n * which determines the \"point size\" of a camera-facing\r\n * sprite billboard given its 3D world position\r\n * (origin at center of sprite) and its world width\r\n * and height in x/y.\r\n *\r\n * We place into the output Vector2 the scaled width\r\n * and height. If no `out` is specified, a new Vector2\r\n * will be created for convenience (this should be avoided\r\n * in tight loops).\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#getPointSize\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} vec - The position of the 3D Sprite.\r\n * @param {Phaser.Math.Vector2} size - The x and y dimensions.\r\n * @param {Phaser.Math.Vector2} out - The result, scaled x and y dimensions.\r\n *\r\n * @return {Phaser.Math.Vector2} [description]\r\n */\r\n getPointSize: function (vec, size, out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n // TODO: optimize this with a simple distance calculation:\r\n // https://developer.valvesoftware.com/wiki/Field_of_View\r\n\r\n if (this.billboardMatrixDirty)\r\n {\r\n this.updateBillboardMatrix();\r\n }\r\n\r\n var tmp = tmpVec3;\r\n\r\n var dx = (size.x / this.pixelScale) / 2;\r\n var dy = (size.y / this.pixelScale) / 2;\r\n\r\n tmp.set(-dx, -dy, 0).transformMat4(billboardMatrix).add(vec);\r\n\r\n this.project(tmp, tmp);\r\n\r\n var tlx = tmp.x;\r\n var tly = tmp.y;\r\n\r\n tmp.set(dx, dy, 0).transformMat4(billboardMatrix).add(vec);\r\n\r\n this.project(tmp, tmp);\r\n\r\n var brx = tmp.x;\r\n var bry = tmp.y;\r\n\r\n // var w = Math.abs(brx - tlx);\r\n // var h = Math.abs(bry - tly);\r\n\r\n // Allow the projection to get negative ...\r\n var w = brx - tlx;\r\n var h = bry - tly;\r\n\r\n return out.set(w, h);\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.children.clear();\r\n\r\n this.scene = undefined;\r\n this.children = undefined;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#setX\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n setX: function (value)\r\n {\r\n this.position.x = value;\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#setY\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n setY: function (value)\r\n {\r\n this.position.y = value;\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.Camera#setZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.Camera} This Camera object.\r\n */\r\n setZ: function (value)\r\n {\r\n this.position.z = value;\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D.Camera#x\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n x: {\r\n get: function ()\r\n {\r\n return this.position.x;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.position.x = value;\r\n this.update();\r\n }\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D.Camera#y\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n y: {\r\n get: function ()\r\n {\r\n return this.position.y;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.position.y = value;\r\n this.update();\r\n }\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D.Camera#z\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n z: {\r\n get: function ()\r\n {\r\n return this.position.z;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.position.z = value;\r\n this.update();\r\n }\r\n }\r\n\r\n});\r\n\r\nCamera.FAR_RANGE = 1.0;\r\nCamera.NEAR_RANGE = 0.0;\r\n\r\nmodule.exports = Camera;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/plugins/camera3d/src/Camera.js?"); /***/ }), /***/ "./node_modules/phaser/plugins/camera3d/src/CameraManager.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/plugins/camera3d/src/CameraManager.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../src/utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar OrthographicCamera = __webpack_require__(/*! ./OrthographicCamera */ \"./node_modules/phaser/plugins/camera3d/src/OrthographicCamera.js\");\r\nvar PerspectiveCamera = __webpack_require__(/*! ./PerspectiveCamera */ \"./node_modules/phaser/plugins/camera3d/src/PerspectiveCamera.js\");\r\nvar PluginCache = __webpack_require__(/*! ../../../src/plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\n\r\n/**\r\n * @classdesc\r\n * [description]\r\n *\r\n * @class CameraManager\r\n * @memberOf Phaser.Cameras.Sprite3D\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - [description]\r\n */\r\nvar CameraManager = new Class({\r\n\r\n initialize:\r\n\r\n function CameraManager (scene)\r\n {\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D.CameraManager#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D.CameraManager#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n /**\r\n * An Array of the Camera objects being managed by this Camera Manager.\r\n *\r\n * @name Phaser.Cameras.Sprite3D.CameraManager#cameras\r\n * @type {Phaser.Cameras.Sprite3D.Camera[]}\r\n * @since 3.0.0\r\n */\r\n this.cameras = [];\r\n\r\n scene.sys.events.once('boot', this.boot, this);\r\n scene.sys.events.on('start', this.start, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Cameras.Scene3D.CameraManager#boot\r\n * @private\r\n * @since 3.5.1\r\n */\r\n boot: function ()\r\n {\r\n this.systems.events.once('destroy', this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Cameras.Sprite3D.CameraManager#start\r\n * @private\r\n * @since 3.5.0\r\n */\r\n start: function ()\r\n {\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.on('update', this.update, this);\r\n eventEmitter.once('shutdown', this.shutdown, this);\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.CameraManager#add\r\n * @since 3.0.0\r\n *\r\n * @param {number} [fieldOfView=80] - [description]\r\n * @param {number} [width] - [description]\r\n * @param {number} [height] - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.PerspectiveCamera} [description]\r\n */\r\n add: function (fieldOfView, width, height)\r\n {\r\n return this.addPerspectiveCamera(fieldOfView, width, height);\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.CameraManager#addOrthographicCamera\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - [description]\r\n * @param {number} height - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.OrthographicCamera} [description]\r\n */\r\n addOrthographicCamera: function (width, height)\r\n {\r\n var config = this.scene.sys.game.config;\r\n\r\n if (width === undefined) { width = config.width; }\r\n if (height === undefined) { height = config.height; }\r\n\r\n var camera = new OrthographicCamera(this.scene, width, height);\r\n\r\n this.cameras.push(camera);\r\n\r\n return camera;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.CameraManager#addPerspectiveCamera\r\n * @since 3.0.0\r\n *\r\n * @param {number} [fieldOfView=80] - [description]\r\n * @param {number} [width] - [description]\r\n * @param {number} [height] - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.PerspectiveCamera} [description]\r\n */\r\n addPerspectiveCamera: function (fieldOfView, width, height)\r\n {\r\n var config = this.scene.sys.game.config;\r\n\r\n if (fieldOfView === undefined) { fieldOfView = 80; }\r\n if (width === undefined) { width = config.width; }\r\n if (height === undefined) { height = config.height; }\r\n\r\n var camera = new PerspectiveCamera(this.scene, fieldOfView, width, height);\r\n\r\n this.cameras.push(camera);\r\n\r\n return camera;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.CameraManager#getCamera\r\n * @since 3.0.0\r\n *\r\n * @param {string} name - [description]\r\n *\r\n * @return {(Phaser.Cameras.Sprite3D.OrthographicCamera|Phaser.Cameras.Sprite3D.PerspectiveCamera)} [description]\r\n */\r\n getCamera: function (name)\r\n {\r\n for (var i = 0; i < this.cameras.length; i++)\r\n {\r\n if (this.cameras[i].name === name)\r\n {\r\n return this.cameras[i];\r\n }\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.CameraManager#removeCamera\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Cameras.Sprite3D.OrthographicCamera|Phaser.Cameras.Sprite3D.PerspectiveCamera)} camera - [description]\r\n */\r\n removeCamera: function (camera)\r\n {\r\n var cameraIndex = this.cameras.indexOf(camera);\r\n\r\n if (cameraIndex !== -1)\r\n {\r\n this.cameras.splice(cameraIndex, 1);\r\n }\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.CameraManager#removeAll\r\n * @since 3.0.0\r\n *\r\n * @return {(Phaser.Cameras.Sprite3D.OrthographicCamera|Phaser.Cameras.Sprite3D.PerspectiveCamera)} [description]\r\n */\r\n removeAll: function ()\r\n {\r\n while (this.cameras.length > 0)\r\n {\r\n var camera = this.cameras.pop();\r\n\r\n camera.destroy();\r\n }\r\n\r\n return this.main;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.CameraManager#update\r\n * @since 3.0.0\r\n *\r\n * @param {number} timestep - [description]\r\n * @param {number} delta - [description]\r\n */\r\n update: function (timestep, delta)\r\n {\r\n for (var i = 0, l = this.cameras.length; i < l; ++i)\r\n {\r\n this.cameras[i].update(timestep, delta);\r\n }\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Phaser.Cameras.Sprite3D.CameraManager#shutdown\r\n * @private\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.off('update', this.update, this);\r\n eventEmitter.off('shutdown', this.shutdown, this);\r\n\r\n this.removeAll();\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Phaser.Cameras.Sprite3D.CameraManager#destroy\r\n * @private\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.scene.sys.events.off('start', this.start, this);\r\n\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nPluginCache.register('CameraManager3D', CameraManager, 'cameras3d');\r\n\r\nmodule.exports = CameraManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/plugins/camera3d/src/CameraManager.js?"); /***/ }), /***/ "./node_modules/phaser/plugins/camera3d/src/OrthographicCamera.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/plugins/camera3d/src/OrthographicCamera.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Camera = __webpack_require__(/*! ./Camera */ \"./node_modules/phaser/plugins/camera3d/src/Camera.js\");\r\nvar Class = __webpack_require__(/*! ../../../src/utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Vector3 = __webpack_require__(/*! ../../../src/math/Vector3 */ \"./node_modules/phaser/src/math/Vector3.js\");\r\n\r\n// Local cache vars\r\nvar tmpVec3 = new Vector3();\r\n\r\n/**\r\n * @classdesc\r\n * [description]\r\n *\r\n * @class OrthographicCamera\r\n * @extends Phaser.Cameras.Sprite3D.Camera\r\n * @memberOf Phaser.Cameras.Sprite3D\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - [description]\r\n * @param {integer} [viewportWidth=0] - [description]\r\n * @param {integer} [viewportHeight=0] - [description]\r\n */\r\nvar OrthographicCamera = new Class({\r\n\r\n Extends: Camera,\r\n\r\n initialize:\r\n\r\n function OrthographicCamera (scene, viewportWidth, viewportHeight)\r\n {\r\n if (viewportWidth === undefined) { viewportWidth = 0; }\r\n if (viewportHeight === undefined) { viewportHeight = 0; }\r\n\r\n Camera.call(this, scene);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D.OrthographicCamera#viewportWidth\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.viewportWidth = viewportWidth;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D.OrthographicCamera#viewportHeight\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.viewportHeight = viewportHeight;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D.OrthographicCamera#_zoom\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._zoom = 1.0;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D.OrthographicCamera#near\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.near = 0;\r\n\r\n this.update();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.OrthographicCamera#setToOrtho\r\n * @since 3.0.0\r\n *\r\n * @param {number} yDown - [description]\r\n * @param {number} [viewportWidth] - [description]\r\n * @param {number} [viewportHeight] - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.OrthographicCamera} [description]\r\n */\r\n setToOrtho: function (yDown, viewportWidth, viewportHeight)\r\n {\r\n if (viewportWidth === undefined) { viewportWidth = this.viewportWidth; }\r\n if (viewportHeight === undefined) { viewportHeight = this.viewportHeight; }\r\n\r\n var zoom = this.zoom;\r\n\r\n this.up.set(0, (yDown) ? -1 : 1, 0);\r\n this.direction.set(0, 0, (yDown) ? 1 : -1);\r\n this.position.set(zoom * viewportWidth / 2, zoom * viewportHeight / 2, 0);\r\n\r\n this.viewportWidth = viewportWidth;\r\n this.viewportHeight = viewportHeight;\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.OrthographicCamera#update\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.OrthographicCamera} [description]\r\n */\r\n update: function ()\r\n {\r\n var w = this.viewportWidth;\r\n var h = this.viewportHeight;\r\n var near = Math.abs(this.near);\r\n var far = Math.abs(this.far);\r\n var zoom = this.zoom;\r\n\r\n if (w === 0 || h === 0)\r\n {\r\n // What to do here... hmm?\r\n return this;\r\n }\r\n\r\n this.projection.ortho(\r\n zoom * -w / 2, zoom * w / 2,\r\n zoom * -h / 2, zoom * h / 2,\r\n near,\r\n far\r\n );\r\n\r\n // Build the view matrix\r\n tmpVec3.copy(this.position).add(this.direction);\r\n\r\n this.view.lookAt(this.position, tmpVec3, this.up);\r\n\r\n // Projection * view matrix\r\n this.combined.copy(this.projection).multiply(this.view);\r\n\r\n // Invert combined matrix, used for unproject\r\n this.invProjectionView.copy(this.combined).invert();\r\n\r\n this.billboardMatrixDirty = true;\r\n\r\n this.updateChildren();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D.OrthographicCamera#zoom\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n zoom: {\r\n\r\n get: function ()\r\n {\r\n return this._zoom;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._zoom = value;\r\n this.update();\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = OrthographicCamera;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/plugins/camera3d/src/OrthographicCamera.js?"); /***/ }), /***/ "./node_modules/phaser/plugins/camera3d/src/PerspectiveCamera.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/plugins/camera3d/src/PerspectiveCamera.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Camera = __webpack_require__(/*! ./Camera */ \"./node_modules/phaser/plugins/camera3d/src/Camera.js\");\r\nvar Class = __webpack_require__(/*! ../../../src/utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Vector3 = __webpack_require__(/*! ../../../src/math/Vector3 */ \"./node_modules/phaser/src/math/Vector3.js\");\r\n\r\n// Local cache vars\r\nvar tmpVec3 = new Vector3();\r\n\r\n/**\r\n * @classdesc\r\n * [description]\r\n *\r\n * @class PerspectiveCamera\r\n * @extends Phaser.Cameras.Sprite3D.Camera\r\n * @memberOf Phaser.Cameras.Sprite3D\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - [description]\r\n * @param {integer} [fieldOfView=80] - [description]\r\n * @param {integer} [viewportWidth=0] - [description]\r\n * @param {integer} [viewportHeight=0] - [description]\r\n */\r\nvar PerspectiveCamera = new Class({\r\n\r\n Extends: Camera,\r\n\r\n // FOV is converted to radians automatically\r\n initialize:\r\n\r\n function PerspectiveCamera (scene, fieldOfView, viewportWidth, viewportHeight)\r\n {\r\n if (fieldOfView === undefined) { fieldOfView = 80; }\r\n if (viewportWidth === undefined) { viewportWidth = 0; }\r\n if (viewportHeight === undefined) { viewportHeight = 0; }\r\n\r\n Camera.call(this, scene);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D.PerspectiveCamera#viewportWidth\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.viewportWidth = viewportWidth;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D.PerspectiveCamera#viewportHeight\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.viewportHeight = viewportHeight;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Cameras.Sprite3D.PerspectiveCamera#fieldOfView\r\n * @type {integer}\r\n * @default 80\r\n * @since 3.0.0\r\n */\r\n this.fieldOfView = fieldOfView * Math.PI / 180;\r\n\r\n this.update();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.PerspectiveCamera#setFOV\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - [description]\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.PerspectiveCamera} [description]\r\n */\r\n setFOV: function (value)\r\n {\r\n this.fieldOfView = value * Math.PI / 180;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Cameras.Sprite3D.PerspectiveCamera#update\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Cameras.Sprite3D.PerspectiveCamera} [description]\r\n */\r\n update: function ()\r\n {\r\n var aspect = this.viewportWidth / this.viewportHeight;\r\n\r\n // Create a perspective matrix for our camera\r\n this.projection.perspective(\r\n this.fieldOfView,\r\n aspect,\r\n Math.abs(this.near),\r\n Math.abs(this.far)\r\n );\r\n\r\n // Build the view matrix\r\n tmpVec3.copy(this.position).add(this.direction);\r\n\r\n this.view.lookAt(this.position, tmpVec3, this.up);\r\n\r\n // Projection * view matrix\r\n this.combined.copy(this.projection).multiply(this.view);\r\n\r\n // Invert combined matrix, used for unproject\r\n this.invProjectionView.copy(this.combined).invert();\r\n\r\n this.billboardMatrixDirty = true;\r\n\r\n this.updateChildren();\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = PerspectiveCamera;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/plugins/camera3d/src/PerspectiveCamera.js?"); /***/ }), /***/ "./node_modules/phaser/plugins/camera3d/src/index.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/plugins/camera3d/src/index.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Cameras.Sprite3D\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Camera: __webpack_require__(/*! ./Camera */ \"./node_modules/phaser/plugins/camera3d/src/Camera.js\"),\r\n CameraManager: __webpack_require__(/*! ./CameraManager */ \"./node_modules/phaser/plugins/camera3d/src/CameraManager.js\"),\r\n OrthographicCamera: __webpack_require__(/*! ./OrthographicCamera */ \"./node_modules/phaser/plugins/camera3d/src/OrthographicCamera.js\"),\r\n PerspectiveCamera: __webpack_require__(/*! ./PerspectiveCamera */ \"./node_modules/phaser/plugins/camera3d/src/PerspectiveCamera.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/plugins/camera3d/src/index.js?"); /***/ }), /***/ "./node_modules/phaser/plugins/camera3d/src/sprite3d/Sprite3D.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/plugins/camera3d/src/sprite3d/Sprite3D.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../../src/utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GameObject = __webpack_require__(/*! ../../../../src/gameobjects/GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar Sprite = __webpack_require__(/*! ../../../../src/gameobjects/sprite/Sprite */ \"./node_modules/phaser/src/gameobjects/sprite/Sprite.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../../../src/math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\nvar Vector4 = __webpack_require__(/*! ../../../../src/math/Vector4 */ \"./node_modules/phaser/src/math/Vector4.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Sprite 3D Game Object.\r\n *\r\n * The Sprite 3D object is an encapsulation of a standard Sprite object, with additional methods to allow\r\n * it to be rendered by a 3D Camera. The Sprite can be positioned anywhere within 3D space.\r\n *\r\n * @class Sprite3D\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberOf Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} x - The x position of this Game Object.\r\n * @param {number} y - The y position of this Game Object.\r\n * @param {number} z - The z position of this Game Object.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n */\r\nvar Sprite3D = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n initialize:\r\n\r\n function Sprite3D (scene, x, y, z, texture, frame)\r\n {\r\n GameObject.call(this, scene, 'Sprite3D');\r\n\r\n /**\r\n * The encapsulated Sprite.\r\n *\r\n * @name Phaser.GameObjects.Sprite3D#gameObject\r\n * @type {Phaser.GameObjects.GameObject}\r\n * @since 3.0.0\r\n */\r\n this.gameObject = new Sprite(scene, 0, 0, texture, frame);\r\n\r\n /**\r\n * The position of the Sprite.\r\n *\r\n * @name Phaser.GameObjects.Sprite3D#position\r\n * @type {Phaser.Math.Vector4}\r\n * @since 3.0.0\r\n */\r\n this.position = new Vector4(x, y, z);\r\n\r\n /**\r\n * The 2D size of the Sprite.\r\n *\r\n * @name Phaser.GameObjects.Sprite3D#size\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.size = new Vector2(this.gameObject.width, this.gameObject.height);\r\n\r\n /**\r\n * The 2D scale of the Sprite.\r\n *\r\n * @name Phaser.GameObjects.Sprite3D#scale\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.scale = new Vector2(1, 1);\r\n\r\n /**\r\n * Whether to automatically set the horizontal scale of the encapsulated Sprite.\r\n *\r\n * @name Phaser.GameObjects.Sprite3D#adjustScaleX\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.adjustScaleX = true;\r\n\r\n /**\r\n * Whether to automatically set the vertical scale of the encapsulated Sprite.\r\n *\r\n * @name Phaser.GameObjects.Sprite3D#adjustScaleY\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.adjustScaleY = true;\r\n\r\n /**\r\n * The visible state of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Sprite3D#_visible\r\n * @type {boolean}\r\n * @default true\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._visible = true;\r\n },\r\n\r\n /**\r\n * Project this Sprite onto the given 3D Camera.\r\n *\r\n * @method Phaser.GameObjects.Sprite3D#project\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Sprite3D.Camera} camera - The 3D Camera onto which to project this Sprite.\r\n */\r\n project: function (camera)\r\n {\r\n var pos = this.position;\r\n\r\n var gameObject = this.gameObject;\r\n\r\n camera.project(pos, gameObject);\r\n\r\n camera.getPointSize(pos, this.size, this.scale);\r\n\r\n if (this.scale.x <= 0 || this.scale.y <= 0)\r\n {\r\n gameObject.setVisible(false);\r\n }\r\n else\r\n {\r\n if (!gameObject.visible)\r\n {\r\n gameObject.setVisible(true);\r\n }\r\n\r\n if (this.adjustScaleX)\r\n {\r\n gameObject.scaleX = this.scale.x;\r\n }\r\n\r\n if (this.adjustScaleY)\r\n {\r\n gameObject.scaleY = this.scale.y;\r\n }\r\n\r\n gameObject.setDepth(gameObject.z * -1);\r\n }\r\n },\r\n\r\n /**\r\n * Set the visible state of the Game Object.\r\n *\r\n * @method Phaser.GameObjects.Sprite3D#setVisible\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The visible state of the Game Object.\r\n *\r\n * @return {Phaser.GameObjects.Sprite3D} This Sprite3D Object.\r\n */\r\n setVisible: function (value)\r\n {\r\n this.visible = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The visible state of the Game Object.\r\n *\r\n * An invisible Game Object will skip rendering, but will still process update logic.\r\n *\r\n * @name Phaser.GameObjects.Sprite3D#visible\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n visible: {\r\n\r\n get: function ()\r\n {\r\n return this._visible;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._visible = value;\r\n this.gameObject.visible = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The x position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Sprite3D#x\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n x: {\r\n\r\n get: function ()\r\n {\r\n return this.position.x;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.position.x = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The y position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Sprite3D#y\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n y: {\r\n\r\n get: function ()\r\n {\r\n return this.position.y;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.position.y = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The z position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Sprite3D#z\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n z: {\r\n\r\n get: function ()\r\n {\r\n return this.position.z;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.position.z = value;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Sprite3D;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/plugins/camera3d/src/sprite3d/Sprite3D.js?"); /***/ }), /***/ "./node_modules/phaser/plugins/camera3d/src/sprite3d/Sprite3DCreator.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/plugins/camera3d/src/sprite3d/Sprite3DCreator.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar BuildGameObject = __webpack_require__(/*! ../../../../src/gameobjects/BuildGameObject */ \"./node_modules/phaser/src/gameobjects/BuildGameObject.js\");\r\nvar BuildGameObjectAnimation = __webpack_require__(/*! ../../../../src/gameobjects/BuildGameObjectAnimation */ \"./node_modules/phaser/src/gameobjects/BuildGameObjectAnimation.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../../../../src/gameobjects/GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../../../src/utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar Sprite3D = __webpack_require__(/*! ./Sprite3D */ \"./node_modules/phaser/plugins/camera3d/src/sprite3d/Sprite3D.js\");\r\n\r\n/**\r\n * Creates a new Sprite3D Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Sprite3D Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#sprite3D\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {Phaser.GameObjects.Sprite3D} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('sprite3D', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n var key = GetAdvancedValue(config, 'key', null);\r\n var frame = GetAdvancedValue(config, 'frame', null);\r\n\r\n var sprite = new Sprite3D(this.scene, 0, 0, key, frame);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, sprite, config);\r\n\r\n // Sprite specific config options:\r\n\r\n BuildGameObjectAnimation(sprite, config);\r\n\r\n return sprite;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectCreator context.\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/plugins/camera3d/src/sprite3d/Sprite3DCreator.js?"); /***/ }), /***/ "./node_modules/phaser/plugins/camera3d/src/sprite3d/Sprite3DFactory.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/plugins/camera3d/src/sprite3d/Sprite3DFactory.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Sprite3D = __webpack_require__(/*! ./Sprite3D */ \"./node_modules/phaser/plugins/camera3d/src/sprite3d/Sprite3D.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../../../../src/gameobjects/GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Sprite3D Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Sprite3D Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#sprite3D\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object.\r\n * @param {number} y - The vertical position of this Game Object.\r\n * @param {number} z - The z position of this Game Object.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n *\r\n * @return {Phaser.GameObjects.Sprite3D} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('sprite3D', function (x, y, z, key, frame)\r\n{\r\n var sprite = new Sprite3D(this.scene, x, y, z, key, frame);\r\n\r\n this.displayList.add(sprite.gameObject);\r\n this.updateList.add(sprite.gameObject);\r\n\r\n return sprite;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/plugins/camera3d/src/sprite3d/Sprite3DFactory.js?"); /***/ }), /***/ "./node_modules/phaser/plugins/fbinstant/src/AdInstance.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/plugins/fbinstant/src/AdInstance.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\n/**\r\n * @typedef {object} AdInstance\r\n *\r\n * @property {any} instance - Represents an instance of an ad.\r\n * @property {string} placementID - The Audience Network placement ID of this ad instance.\r\n * @property {boolean} shown - Has this ad already been shown in-game?\r\n * @property {boolean} video - Is this a video ad?\r\n */\r\n\r\nvar AdInstance = function (placementID, instance, video)\r\n{\r\n return {\r\n instance: instance,\r\n placementID: placementID,\r\n shown: false,\r\n video: video\r\n };\r\n};\r\n\r\nmodule.exports = AdInstance;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/plugins/fbinstant/src/AdInstance.js?"); /***/ }), /***/ "./node_modules/phaser/plugins/fbinstant/src/FacebookInstantGamesPlugin.js": /*!*********************************************************************************!*\ !*** ./node_modules/phaser/plugins/fbinstant/src/FacebookInstantGamesPlugin.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* eslint no-console: 0 */\r\n\r\n/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar AdInstance = __webpack_require__(/*! ./AdInstance */ \"./node_modules/phaser/plugins/fbinstant/src/AdInstance.js\");\r\nvar Class = __webpack_require__(/*! ../../../src/utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar DataManager = __webpack_require__(/*! ../../../src/data/DataManager */ \"./node_modules/phaser/src/data/DataManager.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Leaderboard = __webpack_require__(/*! ./Leaderboard */ \"./node_modules/phaser/plugins/fbinstant/src/Leaderboard.js\");\r\nvar Product = __webpack_require__(/*! ./Product */ \"./node_modules/phaser/plugins/fbinstant/src/Product.js\");\r\nvar Purchase = __webpack_require__(/*! ./Purchase */ \"./node_modules/phaser/plugins/fbinstant/src/Purchase.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Facebook Instant Games Plugin for Phaser 3 provides a seamless bridge between Phaser\r\n * and the Facebook Instant Games API version 6.2.\r\n * \r\n * You can access this plugin via the `facebook` property in a Scene, i.e:\r\n * \r\n * ```javascript\r\n * this.facebook.getPlatform();\r\n * ```\r\n * \r\n * If this is unavailable please check to make sure you're using a build of Phaser that has\r\n * this plugin within it. You can quickly check this by looking at the dev tools console\r\n * header - the Phaser version number will have `-FB` after it if this plugin is loaded.\r\n *\r\n * If you are building your own version of Phaser then use this Webpack DefinePlugin flag:\r\n * \r\n * `\"typeof PLUGIN_FBINSTANT\": JSON.stringify(true)`\r\n * \r\n * You will find that every Instant Games API method has a mapping in this plugin.\r\n * For a full list please consult either the plugin documentation, or the 6.2 SDK documentation\r\n * at https://developers.facebook.com/docs/games/instant-games/sdk/fbinstant6.2\r\n * \r\n * Internally this plugin uses its own Data Manager to handle seamless user data updates and provides\r\n * handy functions for advertisement displaying, opening share dialogs, logging, leaderboards, purchase API requests,\r\n * loader integration and more.\r\n * \r\n * To get started with Facebook Instant Games you will need to register on Facebook and create a new Instant\r\n * Game app that has its own unique app ID. Facebook have also provided a dashboard interface for setting up\r\n * various features for your game, including leaderboards, ad requests and the payments API. There are lots\r\n * of guides on the Facebook Developers portal to assist with setting these\r\n * various systems up: https://developers.facebook.com/docs/games/instant-games/guides\r\n * \r\n * For more details follow the Quick Start guide here: https://developers.facebook.com/docs/games/instant-games\r\n *\r\n * @class FacebookInstantGamesPlugin\r\n * @memberOf Phaser\r\n * @constructor\r\n * @extends Phaser.Events.EventEmitter\r\n * @since 3.13.0\r\n *\r\n * @param {Phaser.Game} game - A reference to the Phaser.Game instance.\r\n */\r\nvar FacebookInstantGamesPlugin = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function FacebookInstantGamesPlugin (game)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * A reference to the Phaser.Game instance.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#game\r\n * @type {Phaser.Game}\r\n * @readOnly\r\n * @since 3.13.0\r\n */\r\n this.game = game;\r\n\r\n /**\r\n * A Data Manager instance.\r\n * It allows you to store, query and retrieve any key/value data you may need to store.\r\n * It's also used internally by the plugin to store FBIG API data.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#data\r\n * @type {Phaser.Data.DataManager}\r\n * @since 3.13.0\r\n */\r\n this.data = new DataManager(this);\r\n\r\n this.on('setdata', this.setDataHandler, this);\r\n this.on('changedata', this.changeDataHandler, this);\r\n\r\n /**\r\n * Has the Facebook Instant Games API loaded yet?\r\n * This is set automatically during the boot process.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#hasLoaded\r\n * @type {boolean}\r\n * @since 3.13.0\r\n */\r\n this.hasLoaded = false;\r\n\r\n /**\r\n * Is the Data Manager currently locked?\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#dataLocked\r\n * @type {boolean}\r\n * @since 3.13.0\r\n */\r\n this.dataLocked = false;\r\n\r\n /**\r\n * A list of the Facebook Instant Games APIs that are available,\r\n * based on the given platform, context and user privacy settings.\r\n * This value is populated automatically during boot.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#supportedAPIs\r\n * @type {string[]}\r\n * @since 3.13.0\r\n */\r\n this.supportedAPIs = [];\r\n\r\n /**\r\n * Holds the entry point that the game was launched from.\r\n * This value is populated automatically during boot.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#entryPoint\r\n * @type {string}\r\n * @since 3.13.0\r\n */\r\n this.entryPoint = '';\r\n\r\n /**\r\n * An object that contains any data associated with the entry point that the game was launched from.\r\n * The contents of the object are developer-defined, and can occur from entry points on different platforms.\r\n * This will return null for older mobile clients, as well as when there is no data associated with the particular entry point.\r\n * This value is populated automatically during boot.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#entryPointData\r\n * @type {any}\r\n * @since 3.13.0\r\n */\r\n this.entryPointData = null;\r\n\r\n /**\r\n * A unique identifier for the current game context. This represents a specific context\r\n * that the game is being played in (for example, a particular messenger conversation or facebook post).\r\n * The identifier will be null if game is being played in a solo context.\r\n * This value is populated automatically during boot.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#contextID\r\n * @type {string}\r\n * @since 3.13.0\r\n */\r\n this.contextID = null;\r\n\r\n /**\r\n * The current context in which your game is running. This can be either `null` or\r\n * one of:\r\n * \r\n * `POST` - The game is running inside of a Facebook post.\r\n * `THREAD` - The game is running inside a Facebook Messenger thread.\r\n * `GROUP` - The game is running inside a Facebook Group.\r\n * `SOLO` - This is the default context, the player is the only participant.\r\n * \r\n * This value is populated automatically during boot.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#contextType\r\n * @type {?string}\r\n * @since 3.13.0\r\n */\r\n this.contextType = null;\r\n\r\n /**\r\n * The current locale.\r\n * See https://origincache.facebook.com/developers/resources/?id=FacebookLocales.xml for a complete list of supported locale values.\r\n * Use this to determine what languages the current game should be localized with.\r\n * This value is populated automatically during boot.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#locale\r\n * @type {?string}\r\n * @since 3.13.0\r\n */\r\n this.locale = null;\r\n\r\n /**\r\n * The platform on which the game is currently running, i.e. `IOS`.\r\n * This value is populated automatically during boot.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#platform\r\n * @type {?string}\r\n * @since 3.13.0\r\n */\r\n this.platform = null;\r\n\r\n /**\r\n * The string representation of the Facebook Instant Games SDK version being used.\r\n * This value is populated automatically during boot.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#version\r\n * @type {?string}\r\n * @since 3.13.0\r\n */\r\n this.version = null;\r\n\r\n /**\r\n * Holds the id of the player. This is a string based ID, the same as `FBInstant.player.getID()`.\r\n * This value is populated automatically during boot if the API is supported.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#playerID\r\n * @type {?string}\r\n * @since 3.13.0\r\n */\r\n this.playerID = null;\r\n\r\n /**\r\n * The player's localized display name.\r\n * This value is populated automatically during boot if the API is supported.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#playerName\r\n * @type {?string}\r\n * @since 3.13.0\r\n */\r\n this.playerName = null;\r\n\r\n /**\r\n * A url to the player's public profile photo. The photo will always be a square, and with dimensions\r\n * of at least 200x200. When rendering it in the game, the exact dimensions should never be assumed to be constant.\r\n * It's recommended to always scale the image to a desired size before rendering.\r\n * This value is populated automatically during boot if the API is supported.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#playerPhotoURL\r\n * @type {?string}\r\n * @since 3.13.0\r\n */\r\n this.playerPhotoURL = null;\r\n\r\n /**\r\n * Whether a player can subscribe to the game bot or not.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#playerCanSubscribeBot\r\n * @type {boolean}\r\n * @since 3.13.0\r\n */\r\n this.playerCanSubscribeBot = false;\r\n\r\n /**\r\n * Does the current platform and context allow for use of the payments API?\r\n * Currently this is only available on Facebook.com and Android 6+.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#paymentsReady\r\n * @type {boolean}\r\n * @since 3.13.0\r\n */\r\n this.paymentsReady = false;\r\n\r\n /**\r\n * The set of products that are registered to the game.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#catalog\r\n * @type {Product[]}\r\n * @since 3.13.0\r\n */\r\n this.catalog = [];\r\n\r\n /**\r\n * Contains all of the player's unconsumed purchases.\r\n * The game must fetch the current player's purchases as soon as the client indicates that it is ready to perform payments-related operations,\r\n * i.e. at game start. The game can then process and consume any purchases that are waiting to be consumed.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#purchases\r\n * @type {Purchase[]}\r\n * @since 3.13.0\r\n */\r\n this.purchases = [];\r\n\r\n /**\r\n * Contains all of the leaderboard data, as populated by the `getLeaderboard()` method.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#leaderboards\r\n * @type {Phaser.FacebookInstantGamesLeaderboard[]}\r\n * @since 3.13.0\r\n */\r\n this.leaderboards = {};\r\n\r\n /**\r\n * Contains AdInstance objects, as created by the `preloadAds()` method.\r\n *\r\n * @name Phaser.FacebookInstantGamesPlugin#ads\r\n * @type {AdInstance[]}\r\n * @since 3.13.0\r\n */\r\n this.ads = [];\r\n },\r\n\r\n /**\r\n * Internal set data handler.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#setDataHandler\r\n * @private\r\n * @since 3.13.0\r\n *\r\n * @param {Phaser.Data.DataManager} parent - The parent Data Manager instance.\r\n * @param {string} key - The key of the data.\r\n * @param {any} value - The value of the data.\r\n */\r\n setDataHandler: function (parent, key, value)\r\n {\r\n if (this.dataLocked)\r\n {\r\n return;\r\n }\r\n\r\n var data = {};\r\n\r\n data[key] = value;\r\n\r\n var _this = this;\r\n\r\n FBInstant.player.setDataAsync(data).then(function ()\r\n {\r\n _this.emit('savedata', data);\r\n });\r\n },\r\n\r\n /**\r\n * Internal change data handler.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#changeDataHandler\r\n * @private\r\n * @since 3.13.0\r\n *\r\n * @param {Phaser.Data.DataManager} parent - The parent Data Manager instance.\r\n * @param {string} key - The key of the data.\r\n * @param {any} value - The value of the data.\r\n */\r\n changeDataHandler: function (parent, key, value)\r\n {\r\n if (this.dataLocked)\r\n {\r\n return;\r\n }\r\n\r\n var data = {};\r\n\r\n data[key] = value;\r\n\r\n var _this = this;\r\n\r\n FBInstant.player.setDataAsync(data).then(function ()\r\n {\r\n _this.emit('savedata', data);\r\n });\r\n },\r\n\r\n /**\r\n * Call this method from your `Scene.preload` in order to sync the load progress\r\n * of the Phaser Loader with the Facebook Instant Games loader display, i.e.:\r\n * \r\n * ```javascript\r\n * this.facebook.showLoadProgress(this);\r\n * this.facebook.once('startgame', this.startGame, this);\r\n * ```\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#showLoadProgress\r\n * @since 3.13.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene for which you want to show loader progress for.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n showLoadProgress: function (scene)\r\n {\r\n scene.load.on('progress', function (value)\r\n {\r\n if (!this.hasLoaded)\r\n {\r\n FBInstant.setLoadingProgress(value * 100);\r\n }\r\n\r\n }, this);\r\n\r\n scene.load.on('complete', function ()\r\n {\r\n if (!this.hasLoaded)\r\n {\r\n this.hasLoaded = true;\r\n\r\n FBInstant.startGameAsync().then(this.gameStartedHandler.bind(this));\r\n }\r\n \r\n }, this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * This method is called automatically when the game has finished loading,\r\n * if you used the `showLoadProgress` method. If your game doesn't need to\r\n * load any assets, or you're managing the load yourself, then call this\r\n * method directly to start the API running.\r\n * \r\n * When the API has finished starting this plugin will emit a `startgame` event\r\n * which you should listen for.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#gameStarted\r\n * @since 3.13.0\r\n */\r\n gameStarted: function ()\r\n {\r\n if (!this.hasLoaded)\r\n {\r\n this.hasLoaded = true;\r\n\r\n FBInstant.startGameAsync().then(this.gameStartedHandler.bind(this));\r\n }\r\n else\r\n {\r\n this.gameStartedHandler();\r\n }\r\n },\r\n\r\n /**\r\n * The internal gameStarted handler.\r\n * \r\n * @method Phaser.FacebookInstantGamesPlugin#gameStartedHandler\r\n * @private\r\n * @since 3.20.0\r\n */\r\n gameStartedHandler: function ()\r\n {\r\n var APIs = FBInstant.getSupportedAPIs();\r\n\r\n var supported = {};\r\n\r\n var dotToUpper = function (match)\r\n {\r\n return match[1].toUpperCase();\r\n };\r\n\r\n APIs.forEach(function (api)\r\n {\r\n api = api.replace(/\\../g, dotToUpper);\r\n\r\n supported[api] = true;\r\n });\r\n\r\n this.supportedAPIs = supported;\r\n\r\n this.getID();\r\n this.getType();\r\n this.getLocale();\r\n this.getPlatform();\r\n this.getSDKVersion();\r\n\r\n this.getPlayerID();\r\n this.getPlayerName();\r\n this.getPlayerPhotoURL();\r\n\r\n var _this = this;\r\n\r\n FBInstant.onPause(function ()\r\n {\r\n _this.emit('pause');\r\n });\r\n\r\n FBInstant.getEntryPointAsync().then(function (entrypoint)\r\n {\r\n _this.entryPoint = entrypoint;\r\n _this.entryPointData = FBInstant.getEntryPointData();\r\n\r\n _this.emit('startgame');\r\n\r\n }).catch(function (e)\r\n {\r\n console.warn(e);\r\n });\r\n\r\n // Facebook.com and Android 6 only\r\n if (this.supportedAPIs.paymentsPurchaseAsync)\r\n {\r\n FBInstant.payments.onReady(function ()\r\n {\r\n _this.paymentsReady = true;\r\n\r\n }).catch(function (e)\r\n {\r\n console.warn(e);\r\n });\r\n }\r\n },\r\n\r\n /**\r\n * Checks to see if a given Facebook Instant Games API is available or not.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#checkAPI\r\n * @since 3.13.0\r\n * \r\n * @param {string} api - The API to check for, i.e. `player.getID`.\r\n * \r\n * @return {boolean} `true` if the API is supported, otherwise `false`.\r\n */\r\n checkAPI: function (api)\r\n {\r\n if (!this.supportedAPIs[api])\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n },\r\n\r\n /**\r\n * Returns the unique identifier for the current game context. This represents a specific context\r\n * that the game is being played in (for example, a particular messenger conversation or facebook post).\r\n * The identifier will be null if game is being played in a solo context.\r\n * \r\n * It is only populated if `contextGetID` is in the list of supported APIs.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#getID\r\n * @since 3.13.0\r\n * \r\n * @return {string} The context ID.\r\n */\r\n getID: function ()\r\n {\r\n if (!this.contextID && this.supportedAPIs.contextGetID)\r\n {\r\n this.contextID = FBInstant.context.getID();\r\n }\r\n\r\n return this.contextID;\r\n },\r\n\r\n /**\r\n * Returns the current context in which your game is running. This can be either `null` or one of:\r\n * \r\n * `POST` - The game is running inside of a Facebook post.\r\n * `THREAD` - The game is running inside a Facebook Messenger thread.\r\n * `GROUP` - The game is running inside a Facebook Group.\r\n * `SOLO` - This is the default context, the player is the only participant.\r\n * \r\n * It is only populated if `contextGetType` is in the list of supported APIs.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#getType\r\n * @since 3.13.0\r\n * \r\n * @return {?string} The context type.\r\n */\r\n getType: function ()\r\n {\r\n if (!this.contextType && this.supportedAPIs.contextGetType)\r\n {\r\n this.contextType = FBInstant.context.getType();\r\n }\r\n\r\n return this.contextType;\r\n },\r\n\r\n /**\r\n * Returns the current locale.\r\n * See https://origincache.facebook.com/developers/resources/?id=FacebookLocales.xml for a complete list of supported locale values.\r\n * Use this to determine what languages the current game should be localized with.\r\n * It is only populated if `getLocale` is in the list of supported APIs.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#getLocale\r\n * @since 3.13.0\r\n * \r\n * @return {?string} The current locale.\r\n */\r\n getLocale: function ()\r\n {\r\n if (!this.locale && this.supportedAPIs.getLocale)\r\n {\r\n this.locale = FBInstant.getLocale();\r\n }\r\n\r\n return this.locale;\r\n },\r\n\r\n /**\r\n * Returns the platform on which the game is currently running, i.e. `IOS`.\r\n * It is only populated if `getPlatform` is in the list of supported APIs.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#getPlatform\r\n * @since 3.13.0\r\n * \r\n * @return {?string} The current platform.\r\n */\r\n getPlatform: function ()\r\n {\r\n if (!this.platform && this.supportedAPIs.getPlatform)\r\n {\r\n this.platform = FBInstant.getPlatform();\r\n }\r\n\r\n return this.platform;\r\n },\r\n\r\n /**\r\n * Returns the string representation of the Facebook Instant Games SDK version being used.\r\n * It is only populated if `getSDKVersion` is in the list of supported APIs.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#getSDKVersion\r\n * @since 3.13.0\r\n * \r\n * @return {?string} The sdk version.\r\n */\r\n getSDKVersion: function ()\r\n {\r\n if (!this.version && this.supportedAPIs.getSDKVersion)\r\n {\r\n this.version = FBInstant.getSDKVersion();\r\n }\r\n\r\n return this.version;\r\n },\r\n\r\n /**\r\n * Returns the id of the player. This is a string based ID, the same as `FBInstant.player.getID()`.\r\n * It is only populated if `playerGetID` is in the list of supported APIs.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#getPlayerID\r\n * @since 3.13.0\r\n * \r\n * @return {?string} The player ID.\r\n */\r\n getPlayerID: function ()\r\n {\r\n if (!this.playerID && this.supportedAPIs.playerGetID)\r\n {\r\n this.playerID = FBInstant.player.getID();\r\n }\r\n\r\n return this.playerID;\r\n },\r\n\r\n /**\r\n * Returns the player's localized display name.\r\n * It is only populated if `playerGetName` is in the list of supported APIs.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#getPlayerName\r\n * @since 3.13.0\r\n * \r\n * @return {?string} The player's localized display name.\r\n */\r\n getPlayerName: function ()\r\n {\r\n if (!this.playerName && this.supportedAPIs.playerGetName)\r\n {\r\n this.playerName = FBInstant.player.getName();\r\n }\r\n\r\n return this.playerName;\r\n },\r\n\r\n /**\r\n * Returns the url to the player's public profile photo. The photo will always be a square, and with dimensions\r\n * of at least 200x200. When rendering it in the game, the exact dimensions should never be assumed to be constant.\r\n * It's recommended to always scale the image to a desired size before rendering.\r\n * It is only populated if `playerGetPhoto` is in the list of supported APIs.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#getPlayerPhotoURL\r\n * @since 3.13.0\r\n * \r\n * @return {?string} The player's photo url.\r\n */\r\n getPlayerPhotoURL: function ()\r\n {\r\n if (!this.playerPhotoURL && this.supportedAPIs.playerGetPhoto)\r\n {\r\n this.playerPhotoURL = FBInstant.player.getPhoto();\r\n }\r\n\r\n return this.playerPhotoURL;\r\n },\r\n\r\n /**\r\n * Load the player's photo and store it in the Texture Manager, ready for use in-game.\r\n * \r\n * This method works by using a Scene Loader instance and then asking the Loader to\r\n * retrieve the image.\r\n * \r\n * When complete the plugin will emit a `photocomplete` event, along with the key of the photo.\r\n * \r\n * ```javascript\r\n * this.facebook.loadPlayerPhoto(this, 'player').once('photocomplete', function (key) {\r\n * this.add.image(x, y, 'player');\r\n * }, this);\r\n * ```\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#loadPlayerPhoto\r\n * @since 3.13.0\r\n * \r\n * @param {Phaser.Scene} scene - The Scene that will be responsible for loading this photo.\r\n * @param {string} key - The key to use when storing the photo in the Texture Manager.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n loadPlayerPhoto: function (scene, key)\r\n {\r\n if (this.playerPhotoURL)\r\n {\r\n scene.load.setCORS('anonymous');\r\n \r\n scene.load.image(key, this.playerPhotoURL);\r\n \r\n scene.load.once('filecomplete-image-' + key, function ()\r\n {\r\n this.emit('photocomplete', key);\r\n\r\n }, this);\r\n \r\n scene.load.start();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Checks if the current player can subscribe to the game bot.\r\n * \r\n * It makes an async call to the API, so the result isn't available immediately.\r\n * \r\n * If they can subscribe, the `playerCanSubscribeBot` property is set to `true`\r\n * and this plugin will emit the `cansubscribebot` event.\r\n * \r\n * If they cannot, i.e. it's not in the list of supported APIs, or the request\r\n * was rejected, it will emit a `cansubscribebotfail` event instead.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#canSubscribeBot\r\n * @since 3.13.0\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n canSubscribeBot: function ()\r\n {\r\n if (this.supportedAPIs.playerCanSubscribeBotAsync)\r\n {\r\n var _this = this;\r\n\r\n FBInstant.player.canSubscribeBotAsync().then(function ()\r\n {\r\n _this.playerCanSubscribeBot = true;\r\n\r\n _this.emit('cansubscribebot');\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('cansubscribebotfail', e);\r\n });\r\n }\r\n else\r\n {\r\n this.emit('cansubscribebotfail');\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subscribes the current player to the game bot.\r\n * \r\n * It makes an async call to the API, so the result isn't available immediately.\r\n * \r\n * If they are successfully subscribed this plugin will emit the `subscribebot` event.\r\n * \r\n * If they cannot, i.e. it's not in the list of supported APIs, or the request\r\n * was rejected, it will emit a `subscribebotfail` event instead.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#subscribeBot\r\n * @since 3.13.0\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n subscribeBot: function ()\r\n {\r\n if (this.playerCanSubscribeBot)\r\n {\r\n var _this = this;\r\n\r\n FBInstant.player.subscribeBotAsync().then(function ()\r\n {\r\n _this.emit('subscribebot');\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('subscribebotfail', e);\r\n });\r\n }\r\n else\r\n {\r\n this.emit('subscribebotfail');\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the associated data from the player based on the given key, or array of keys.\r\n * \r\n * The data is requested in an async call, so the result isn't available immediately.\r\n * \r\n * When the call completes the data is set into this plugins Data Manager and the\r\n * `getdata` event will be emitted.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#getData\r\n * @since 3.13.0\r\n * \r\n * @param {(string|string[])} keys - The key/s of the data to retrieve.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n getData: function (keys)\r\n {\r\n if (!this.checkAPI('playerGetDataAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n if (!Array.isArray(keys))\r\n {\r\n keys = [ keys ];\r\n }\r\n\r\n var _this = this;\r\n\r\n FBInstant.player.getDataAsync(keys).then(function (data)\r\n {\r\n _this.dataLocked = true;\r\n\r\n for (var key in data)\r\n {\r\n _this.data.set(key, data[key]);\r\n }\r\n\r\n _this.dataLocked = false;\r\n\r\n _this.emit('getdata', data);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set data to be saved to the designated cloud storage of the current player. The game can store up to 1MB of data for each unique player.\r\n * \r\n * The data save is requested in an async call, so the result isn't available immediately.\r\n * \r\n * Data managed via this plugins Data Manager instance is automatically synced with Facebook. However, you can call this\r\n * method directly if you need to replace the data object directly.\r\n * \r\n * When the APIs `setDataAsync` call resolves it will emit the `savedata` event from this plugin. If the call fails for some\r\n * reason it will emit `savedatafail` instead.\r\n * \r\n * The call resolving does not necessarily mean that the input has already been persisted. Rather, it means that the data was valid and\r\n * has been scheduled to be saved. It also guarantees that all values that were set are now available in `getData`.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#saveData\r\n * @since 3.13.0\r\n * \r\n * @param {object} data - An object containing a set of key-value pairs that should be persisted to cloud storage.\r\n * The object must contain only serializable values - any non-serializable values will cause the entire modification to be rejected.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n saveData: function (data)\r\n {\r\n if (!this.checkAPI('playerSetDataAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n var _this = this;\r\n\r\n FBInstant.player.setDataAsync(data).then(function ()\r\n {\r\n _this.emit('savedata', data);\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('savedatafail', e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Immediately flushes any changes to the player data to the designated cloud storage.\r\n * This function is expensive, and should primarily be used for critical changes where persistence needs to be immediate\r\n * and known by the game. Non-critical changes should rely on the platform to persist them in the background.\r\n * NOTE: Calls to player.setDataAsync will be rejected while this function's result is pending.\r\n * \r\n * Data managed via this plugins Data Manager instance is automatically synced with Facebook. However, you can call this\r\n * method directly if you need to flush the data directly.\r\n * \r\n * When the APIs `flushDataAsync` call resolves it will emit the `flushdata` event from this plugin. If the call fails for some\r\n * reason it will emit `flushdatafail` instead.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#flushData\r\n * @since 3.13.0\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n flushData: function ()\r\n {\r\n if (!this.checkAPI('playerFlushDataAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n var _this = this;\r\n\r\n FBInstant.player.flushDataAsync().then(function ()\r\n {\r\n _this.emit('flushdata');\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('flushdatafail', e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieve stats from the designated cloud storage of the current player.\r\n * \r\n * The data is requested in an async call, so the result isn't available immediately.\r\n * \r\n * When the call completes the `getstats` event will be emitted along with the data object returned.\r\n * \r\n * If the call fails, i.e. it's not in the list of supported APIs, or the request was rejected,\r\n * it will emit a `getstatsfail` event instead.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#getStats\r\n * @since 3.13.0\r\n * \r\n * @param {string[]} [keys] - An optional array of unique keys to retrieve stats for. If the function is called without it, it will fetch all stats.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n getStats: function (keys)\r\n {\r\n if (!this.checkAPI('playerGetStatsAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n var _this = this;\r\n\r\n FBInstant.player.getStatsAsync(keys).then(function (data)\r\n {\r\n _this.emit('getstats', data);\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('getstatsfail', e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Save the stats of the current player to the designated cloud storage.\r\n * \r\n * Stats in the Facebook Instant Games API are purely numerical values paired with a string-based key. Only numbers can be saved as stats,\r\n * all other data types will be ignored.\r\n * \r\n * The data is requested in an async call, so the result isn't available immediately.\r\n * \r\n * When the call completes the `savestats` event will be emitted along with the data object returned.\r\n * \r\n * If the call fails, i.e. it's not in the list of supported APIs, or the request was rejected,\r\n * it will emit a `savestatsfail` event instead.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#saveStats\r\n * @since 3.13.0\r\n * \r\n * @param {object} data - An object containing a set of key-value pairs that should be persisted to cloud storage as stats. Note that only numerical values are stored.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n saveStats: function (data)\r\n {\r\n if (!this.checkAPI('playerSetStatsAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n var output = {};\r\n\r\n for (var key in data)\r\n {\r\n if (typeof data[key] === 'number')\r\n {\r\n output[key] = data[key];\r\n }\r\n }\r\n\r\n var _this = this;\r\n\r\n FBInstant.player.setStatsAsync(output).then(function ()\r\n {\r\n _this.emit('savestats', output);\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('savestatsfail', e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Increment the stats of the current player and save them to the designated cloud storage.\r\n * \r\n * Stats in the Facebook Instant Games API are purely numerical values paired with a string-based key. Only numbers can be saved as stats,\r\n * all other data types will be ignored.\r\n * \r\n * The data object provided for this call should contain offsets for how much to modify the stats by:\r\n * \r\n * ```javascript\r\n * this.facebook.incStats({\r\n * level: 1,\r\n * zombiesSlain: 17,\r\n * rank: -1\r\n * });\r\n * ```\r\n * \r\n * The data is requested in an async call, so the result isn't available immediately.\r\n * \r\n * When the call completes the `incstats` event will be emitted along with the data object returned.\r\n * \r\n * If the call fails, i.e. it's not in the list of supported APIs, or the request was rejected,\r\n * it will emit a `incstatsfail` event instead.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#incStats\r\n * @since 3.13.0\r\n * \r\n * @param {object} data - An object containing a set of key-value pairs indicating how much to increment each stat in cloud storage. Note that only numerical values are processed.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n incStats: function (data)\r\n {\r\n if (!this.checkAPI('playerIncrementStatsAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n var output = {};\r\n\r\n for (var key in data)\r\n {\r\n if (typeof data[key] === 'number')\r\n {\r\n output[key] = data[key];\r\n }\r\n }\r\n\r\n var _this = this;\r\n\r\n FBInstant.player.incrementStatsAsync(output).then(function (stats)\r\n {\r\n _this.emit('incstats', stats);\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('incstatsfail', e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the data associated with the individual gameplay session for the current context.\r\n * \r\n * This function should be called whenever the game would like to update the current session data.\r\n * \r\n * This session data may be used to populate a variety of payloads, such as game play webhooks.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#saveSession\r\n * @since 3.13.0\r\n * \r\n * @param {object} data - An arbitrary data object, which must be less than or equal to 1000 characters when stringified.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n saveSession: function (data)\r\n {\r\n if (!this.checkAPI('setSessionData'))\r\n {\r\n return this;\r\n }\r\n\r\n var test = JSON.stringify(data);\r\n\r\n if (test.length <= 1000)\r\n {\r\n FBInstant.setSessionData(data);\r\n }\r\n else\r\n {\r\n console.warn('Session data too long. Max 1000 chars.');\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * This invokes a dialog to let the user share specified content, either as a message in Messenger or as a post on the user's timeline.\r\n * \r\n * A blob of data can be attached to the share which every game session launched from the share will be able to access via the `this.entryPointData` property.\r\n * \r\n * This data must be less than or equal to 1000 characters when stringified.\r\n * \r\n * When this method is called you should consider your game paused. Listen out for the `resume` event from this plugin to know when the dialog has been closed.\r\n * \r\n * The user may choose to cancel the share action and close the dialog. The resulting `resume` event will be dispatched regardless if the user actually shared the content or not.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#openShare\r\n * @since 3.13.0\r\n * \r\n * @param {string} text - A text message to be shared.\r\n * @param {string} key - The key of the texture to use as the share image.\r\n * @param {string} [frame] - The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data.\r\n * @param {object} [sessionData] - A blob of data to attach to the share.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n openShare: function (text, key, frame, sessionData)\r\n {\r\n return this._share('SHARE', text, key, frame, sessionData);\r\n },\r\n\r\n /**\r\n * This invokes a dialog to let the user invite a friend to play this game, either as a message in Messenger or as a post on the user's timeline.\r\n * \r\n * A blob of data can be attached to the share which every game session launched from the share will be able to access via the `this.entryPointData` property.\r\n * \r\n * This data must be less than or equal to 1000 characters when stringified.\r\n * \r\n * When this method is called you should consider your game paused. Listen out for the `resume` event from this plugin to know when the dialog has been closed.\r\n * \r\n * The user may choose to cancel the share action and close the dialog. The resulting `resume` event will be dispatched regardless if the user actually shared the content or not.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#openInvite\r\n * @since 3.13.0\r\n * \r\n * @param {string} text - A text message to be shared.\r\n * @param {string} key - The key of the texture to use as the share image.\r\n * @param {string} [frame] - The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data.\r\n * @param {object} [sessionData] - A blob of data to attach to the share.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n openInvite: function (text, key, frame, sessionData)\r\n {\r\n return this._share('INVITE', text, key, frame, sessionData);\r\n },\r\n\r\n /**\r\n * This invokes a dialog to let the user share specified content, either as a message in Messenger or as a post on the user's timeline.\r\n * \r\n * A blob of data can be attached to the share which every game session launched from the share will be able to access via the `this.entryPointData` property.\r\n * \r\n * This data must be less than or equal to 1000 characters when stringified.\r\n * \r\n * When this method is called you should consider your game paused. Listen out for the `resume` event from this plugin to know when the dialog has been closed.\r\n * \r\n * The user may choose to cancel the share action and close the dialog. The resulting `resume` event will be dispatched regardless if the user actually shared the content or not.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#openRequest\r\n * @since 3.13.0\r\n * \r\n * @param {string} text - A text message to be shared.\r\n * @param {string} key - The key of the texture to use as the share image.\r\n * @param {string} [frame] - The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data.\r\n * @param {object} [sessionData] - A blob of data to attach to the share.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n openRequest: function (text, key, frame, sessionData)\r\n {\r\n return this._share('REQUEST', text, key, frame, sessionData);\r\n },\r\n\r\n /**\r\n * This invokes a dialog to let the user share specified content, either as a message in Messenger or as a post on the user's timeline.\r\n * \r\n * A blob of data can be attached to the share which every game session launched from the share will be able to access via the `this.entryPointData` property.\r\n * \r\n * This data must be less than or equal to 1000 characters when stringified.\r\n * \r\n * When this method is called you should consider your game paused. Listen out for the `resume` event from this plugin to know when the dialog has been closed.\r\n * \r\n * The user may choose to cancel the share action and close the dialog. The resulting `resume` event will be dispatched regardless if the user actually shared the content or not.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#openChallenge\r\n * @since 3.13.0\r\n * \r\n * @param {string} text - A text message to be shared.\r\n * @param {string} key - The key of the texture to use as the share image.\r\n * @param {string} [frame] - The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data.\r\n * @param {object} [sessionData] - A blob of data to attach to the share.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n openChallenge: function (text, key, frame, sessionData)\r\n {\r\n return this._share('CHALLENGE', text, key, frame, sessionData);\r\n },\r\n\r\n /**\r\n * Internal share handler.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#_share\r\n * @private\r\n * @since 3.13.0\r\n * \r\n * @param {string} intent - (\"INVITE\" | \"REQUEST\" | \"CHALLENGE\" | \"SHARE\") Indicates the intent of the share.\r\n * @param {string} text - A text message to be shared.\r\n * @param {string} key - The key of the texture to use as the share image.\r\n * @param {string} [frame] - The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data.\r\n * @param {object} [sessionData] - A blob of data to attach to the share.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n _share: function (intent, text, key, frame, sessionData)\r\n {\r\n if (!this.checkAPI('shareAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n if (sessionData === undefined) { sessionData = {}; }\r\n\r\n if (key)\r\n {\r\n var imageData = this.game.textures.getBase64(key, frame);\r\n }\r\n\r\n // intent (\"INVITE\" | \"REQUEST\" | \"CHALLENGE\" | \"SHARE\") Indicates the intent of the share.\r\n // image string A base64 encoded image to be shared.\r\n // text string A text message to be shared.\r\n // data Object? A blob of data to attach to the share. All game sessions launched from the share will be able to access this blob through FBInstant.getEntryPointData().\r\n\r\n var payload = {\r\n intent: intent,\r\n image: imageData,\r\n text: text,\r\n data: sessionData\r\n };\r\n\r\n var _this = this;\r\n\r\n FBInstant.shareAsync(payload).then(function ()\r\n {\r\n _this.emit('resume');\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * This function determines whether the number of participants in the current game context is between a given minimum and maximum, inclusive.\r\n * If one of the bounds is null only the other bound will be checked against.\r\n * It will always return the original result for the first call made in a context in a given game play session.\r\n * Subsequent calls, regardless of arguments, will return the answer to the original query until a context change occurs and the query result is reset.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#isSizeBetween\r\n * @since 3.13.0\r\n * \r\n * @param {integer} [min] - The minimum bound of the context size query.\r\n * @param {integer} [max] - The maximum bound of the context size query.\r\n * \r\n * @return {object} The Context Size Response object in the format: `{answer: boolean, minSize: number?, maxSize: number?}`.\r\n */\r\n isSizeBetween: function (min, max)\r\n {\r\n if (!this.checkAPI('contextIsSizeBetween'))\r\n {\r\n return this;\r\n }\r\n\r\n return FBInstant.context.isSizeBetween(min, max);\r\n },\r\n\r\n /**\r\n * Request a switch into a specific context. If the player does not have permission to enter that context,\r\n * or if the player does not provide permission for the game to enter that context, this will emit a `switchfail` event.\r\n * \r\n * Otherwise, the plugin will emit the `switch` event when the game has switched into the specified context.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#switchContext\r\n * @since 3.13.0\r\n * \r\n * @param {string} contextID - The ID of the desired context.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n switchContext: function (contextID)\r\n {\r\n if (!this.checkAPI('contextSwitchAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n if (contextID !== this.contextID)\r\n {\r\n var _this = this;\r\n\r\n FBInstant.context.switchAsync(contextID).then(function ()\r\n {\r\n _this.contextID = FBInstant.context.getID();\r\n\r\n _this.emit('switch', _this.contextID);\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('switchfail', e);\r\n });\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * A filter that may be applied to a Context Choose operation.\r\n * \r\n * 'NEW_CONTEXT_ONLY' - Prefer to only surface contexts the game has not been played in before.\r\n * 'INCLUDE_EXISTING_CHALLENGES' - Include the \"Existing Challenges\" section, which surfaces actively played-in contexts that the player is a part of.\r\n * 'NEW_PLAYERS_ONLY' - In sections containing individuals, prefer people who have not played the game.\r\n * \r\n * @typedef {string} ContextFilter\r\n */\r\n\r\n /**\r\n * A configuration object that may be applied to a Context Choose operation.\r\n * \r\n * @typedef {object} ChooseContextConfig\r\n * @property {ContextFilter[]} [filters] - The set of filters to apply to the context suggestions: 'NEW_CONTEXT_ONLY', 'INCLUDE_EXISTING_CHALLENGES' or 'NEW_PLAYERS_ONLY'.\r\n * @property {number} [maxSize] - The maximum number of participants that a suggested context should ideally have.\r\n * @property {number} [minSize] - The minimum number of participants that a suggested context should ideally have.\r\n */\r\n\r\n /**\r\n * Opens a context selection dialog for the player. If the player selects an available context,\r\n * the client will attempt to switch into that context, and emit the `choose` event if successful.\r\n * Otherwise, if the player exits the menu or the client fails to switch into the new context, the `choosefail` event will be emitted.\r\n * \r\n * @method Phaser.FacebookInstantGamesPlugin#chooseContext\r\n * @since 3.13.0\r\n * \r\n * @param {ChooseContextConfig} [options] - An object specifying conditions on the contexts that should be offered.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n chooseContext: function (options)\r\n {\r\n if (!this.checkAPI('contextChooseAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n var _this = this;\r\n\r\n FBInstant.context.chooseAsync(options).then(function ()\r\n {\r\n _this.contextID = FBInstant.context.getID();\r\n _this.emit('choose', _this.contextID);\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('choosefail', e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Attempts to create or switch into a context between a specified player and the current player.\r\n * This plugin will emit the `create` event once the context switch is completed.\r\n * If the API call fails, such as if the player listed is not a Connected Player of the current player or if the\r\n * player does not provide permission to enter the new context, then the plugin will emit a 'createfail' event.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#createContext\r\n * @since 3.13.0\r\n * \r\n * @param {string} playerID - ID of the player.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n createContext: function (playerID)\r\n {\r\n if (!this.checkAPI('contextCreateAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n var _this = this;\r\n\r\n FBInstant.context.createAsync(playerID).then(function ()\r\n {\r\n _this.contextID = FBInstant.context.getID();\r\n _this.emit('create', _this.contextID);\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('createfail', e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Fetches an array of ConnectedPlayer objects containing information about active players\r\n * (people who played the game in the last 90 days) that are connected to the current player.\r\n * \r\n * It makes an async call to the API, so the result isn't available immediately.\r\n * \r\n * If they are successfully subscribed this plugin will emit the `players` event along\r\n * with the player data.\r\n * \r\n * If they cannot, i.e. it's not in the list of supported APIs, or the request\r\n * was rejected, it will emit a `playersfail` event instead.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#getPlayers\r\n * @since 3.13.0\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n getPlayers: function ()\r\n {\r\n if (!this.checkAPI('playerGetConnectedPlayersAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n var _this = this;\r\n\r\n FBInstant.player.getConnectedPlayersAsync().then(function (players)\r\n {\r\n _this.emit('players', players);\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('playersfail', e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Fetches the game's product catalog.\r\n * \r\n * It makes an async call to the API, so the result isn't available immediately.\r\n * \r\n * If they are successfully subscribed this plugin will emit the `getcatalog` event along\r\n * with the catalog data.\r\n * \r\n * If they cannot, i.e. it's not in the list of supported APIs, or the request\r\n * was rejected, it will emit a `getcatalogfail` event instead.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#getCatalog\r\n * @since 3.13.0\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n getCatalog: function ()\r\n {\r\n if (!this.paymentsReady)\r\n {\r\n return this;\r\n }\r\n\r\n var _this = this;\r\n var catalog = this.catalog;\r\n\r\n FBInstant.payments.getCatalogAsync().then(function (data)\r\n {\r\n catalog = [];\r\n\r\n data.forEach(function (item)\r\n {\r\n catalog.push(Product(item));\r\n });\r\n\r\n _this.emit('getcatalog', catalog);\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('getcatalogfail', e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Fetches a single Product from the game's product catalog.\r\n * \r\n * The product catalog must have been populated using `getCatalog` prior to calling this method.\r\n * \r\n * Use this to look-up product details based on a purchase list.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#getProduct\r\n * @since 3.17.0\r\n * \r\n * @param {string} productID - The Product ID of the item to get from the catalog.\r\n * \r\n * @return {?Product} The Product from the catalog, or `null` if it couldn't be found or the catalog isn't populated.\r\n */\r\n getProduct: function (productID)\r\n {\r\n for (var i = 0; i < this.catalog.length; i++)\r\n {\r\n if (this.catalog[i].productID === productID)\r\n {\r\n return this.catalog[i];\r\n }\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Begins the purchase flow for a specific product.\r\n * \r\n * It makes an async call to the API, so the result isn't available immediately.\r\n * \r\n * If they are successfully subscribed this plugin will emit the `purchase` event along\r\n * with the purchase data.\r\n * \r\n * If they cannot, i.e. it's not in the list of supported APIs, or the request\r\n * was rejected, it will emit a `purchasefail` event instead.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#purchase\r\n * @since 3.13.0\r\n * \r\n * @param {string} productID - The identifier of the product to purchase.\r\n * @param {string} [developerPayload] - An optional developer-specified payload, to be included in the returned purchase's signed request.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n purchase: function (productID, developerPayload)\r\n {\r\n if (!this.paymentsReady)\r\n {\r\n return this;\r\n }\r\n\r\n var config = {productID: productID};\r\n\r\n if (developerPayload)\r\n {\r\n config.developerPayload = developerPayload;\r\n }\r\n\r\n var _this = this;\r\n\r\n FBInstant.payments.purchaseAsync(config).then(function (data)\r\n {\r\n var purchase = Purchase(data);\r\n\r\n _this.emit('purchase', purchase);\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('purchasefail', e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Fetches all of the player's unconsumed purchases. The game must fetch the current player's purchases\r\n * as soon as the client indicates that it is ready to perform payments-related operations,\r\n * i.e. at game start. The game can then process and consume any purchases that are waiting to be consumed.\r\n * \r\n * It makes an async call to the API, so the result isn't available immediately.\r\n * \r\n * If they are successfully subscribed this plugin will emit the `getpurchases` event along\r\n * with the purchase data.\r\n * \r\n * If they cannot, i.e. it's not in the list of supported APIs, or the request\r\n * was rejected, it will emit a `getpurchasesfail` event instead.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#getPurchases\r\n * @since 3.13.0\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n getPurchases: function ()\r\n {\r\n if (!this.paymentsReady)\r\n {\r\n return this;\r\n }\r\n\r\n var _this = this;\r\n var purchases = this.purchases;\r\n\r\n FBInstant.payments.getPurchasesAsync().then(function (data)\r\n {\r\n purchases = [];\r\n\r\n data.forEach(function (item)\r\n {\r\n purchases.push(Purchase(item));\r\n });\r\n\r\n _this.emit('getpurchases', purchases);\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('getpurchasesfail', e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Consumes a specific purchase belonging to the current player. Before provisioning a product's effects to the player,\r\n * the game should request the consumption of the purchased product. Once the purchase is successfully consumed,\r\n * the game should immediately provide the player with the effects of their purchase.\r\n * \r\n * It makes an async call to the API, so the result isn't available immediately.\r\n * \r\n * If they are successfully subscribed this plugin will emit the `consumepurchase` event along\r\n * with the purchase data.\r\n * \r\n * If they cannot, i.e. it's not in the list of supported APIs, or the request\r\n * was rejected, it will emit a `consumepurchasefail` event instead.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#consumePurchase\r\n * @since 3.17.0\r\n * \r\n * @param {string} purchaseToken - The purchase token of the purchase that should be consumed.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n consumePurchase: function (purchaseToken)\r\n {\r\n if (!this.paymentsReady)\r\n {\r\n return this;\r\n }\r\n\r\n var _this = this;\r\n\r\n FBInstant.payments.consumePurchaseAsync(purchaseToken).then(function ()\r\n {\r\n _this.emit('consumepurchase', purchaseToken);\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('consumepurchasefail', e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Informs Facebook of a custom update that occurred in the game.\r\n * This will temporarily yield control to Facebook and Facebook will decide what to do based on what the update is.\r\n * Once Facebook returns control to the game the plugin will emit an `update` or `updatefail` event.\r\n * \r\n * It makes an async call to the API, so the result isn't available immediately.\r\n * \r\n * The `text` parameter is an update payload with the following structure:\r\n * \r\n * ```\r\n * text: {\r\n * default: 'X just invaded Y\\'s village!',\r\n * localizations: {\r\n * ar_AR: 'X \\u0641\\u0642\\u0637 \\u063A\\u0632\\u062A ' +\r\n * '\\u0642\\u0631\\u064A\\u0629 Y!',\r\n * en_US: 'X just invaded Y\\'s village!',\r\n * es_LA: '\\u00A1X acaba de invadir el pueblo de Y!',\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#update\r\n * @since 3.13.0\r\n * \r\n * @param {string} cta - The call to action text.\r\n * @param {object} text - The text object.\r\n * @param {string} key - The key of the texture to use as the share image.\r\n * @param {?(string|integer)} frame - The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data.\r\n * @param {string} template - The update template key.\r\n * @param {object} updateData - The update data object payload.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n update: function (cta, text, key, frame, template, updateData)\r\n {\r\n return this._update('CUSTOM', cta, text, key, frame, template, updateData);\r\n },\r\n\r\n /**\r\n * Informs Facebook of a leaderboard update that occurred in the game.\r\n * This will temporarily yield control to Facebook and Facebook will decide what to do based on what the update is.\r\n * Once Facebook returns control to the game the plugin will emit an `update` or `updatefail` event.\r\n * \r\n * It makes an async call to the API, so the result isn't available immediately.\r\n * \r\n * The `text` parameter is an update payload with the following structure:\r\n * \r\n * ```\r\n * text: {\r\n * default: 'X just invaded Y\\'s village!',\r\n * localizations: {\r\n * ar_AR: 'X \\u0641\\u0642\\u0637 \\u063A\\u0632\\u062A ' +\r\n * '\\u0642\\u0631\\u064A\\u0629 Y!',\r\n * en_US: 'X just invaded Y\\'s village!',\r\n * es_LA: '\\u00A1X acaba de invadir el pueblo de Y!',\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#updateLeaderboard\r\n * @since 3.13.0\r\n * \r\n * @param {string} cta - The call to action text.\r\n * @param {object} text - The text object.\r\n * @param {string} key - The key of the texture to use as the share image.\r\n * @param {?(string|integer)} frame - The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data.\r\n * @param {string} template - The update template key.\r\n * @param {object} updateData - The update data object payload.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n updateLeaderboard: function (cta, text, key, frame, template, updateData)\r\n {\r\n return this._update('LEADERBOARD', cta, text, key, frame, template, updateData);\r\n },\r\n\r\n /**\r\n * Internal update handler.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#_update\r\n * @private\r\n * @since 3.13.0\r\n * \r\n * @param {string} action - The update action.\r\n * @param {string} cta - The call to action text.\r\n * @param {object} text - The text object.\r\n * @param {string} key - The key of the texture to use as the share image.\r\n * @param {?(string|integer)} frame - The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data.\r\n * @param {string} template - The update template key.\r\n * @param {object} updateData - The update data object payload.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n _update: function (action, cta, text, key, frame, template, updateData)\r\n {\r\n if (!this.checkAPI('shareAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n if (cta === undefined) { cta = ''; }\r\n\r\n if (typeof text === 'string')\r\n {\r\n text = {default: text};\r\n }\r\n\r\n if (updateData === undefined) { updateData = {}; }\r\n\r\n if (key)\r\n {\r\n var imageData = this.game.textures.getBase64(key, frame);\r\n }\r\n\r\n var payload = {\r\n action: action,\r\n cta: cta,\r\n image: imageData,\r\n text: text,\r\n template: template,\r\n data: updateData,\r\n strategy: 'IMMEDIATE',\r\n notification: 'NO_PUSH'\r\n };\r\n\r\n var _this = this;\r\n\r\n FBInstant.updateAsync(payload).then(function ()\r\n {\r\n _this.emit('update');\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('updatefail', e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Request that the client switch to a different Instant Game.\r\n * \r\n * It makes an async call to the API, so the result isn't available immediately.\r\n * \r\n * If the game switches successfully this plugin will emit the `switchgame` event and the client will load the new game.\r\n * \r\n * If they cannot, i.e. it's not in the list of supported APIs, or the request\r\n * was rejected, it will emit a `switchgamefail` event instead.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#switchGame\r\n * @since 3.13.0\r\n * \r\n * @param {string} appID - The Application ID of the Instant Game to switch to. The application must be an Instant Game, and must belong to the same business as the current game.\r\n * @param {object} [data] - An optional data payload. This will be set as the entrypoint data for the game being switched to. Must be less than or equal to 1000 characters when stringified.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n switchGame: function (appID, data)\r\n {\r\n if (!this.checkAPI('switchGameAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n if (data)\r\n {\r\n var test = JSON.stringify(data);\r\n\r\n if (test.length > 1000)\r\n {\r\n console.warn('Switch Game data too long. Max 1000 chars.');\r\n return this;\r\n }\r\n }\r\n\r\n var _this = this;\r\n\r\n FBInstant.switchGameAsync(appID, data).then(function ()\r\n {\r\n _this.emit('switchgame', appID);\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('switchgamefail', e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Prompts the user to create a shortcut to the game if they are eligible to.\r\n * Can only be called once per session.\r\n * \r\n * It makes an async call to the API, so the result isn't available immediately.\r\n * \r\n * If the user choose to create a shortcut this plugin will emit the `shortcutcreated` event.\r\n * \r\n * If they cannot, i.e. it's not in the list of supported APIs, or the request\r\n * was rejected, it will emit a `shortcutcreatedfail` event instead.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#createShortcut\r\n * @since 3.13.0\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n createShortcut: function ()\r\n {\r\n var _this = this;\r\n\r\n FBInstant.canCreateShortcutAsync().then(function (canCreateShortcut)\r\n {\r\n if (canCreateShortcut)\r\n {\r\n FBInstant.createShortcutAsync().then(function ()\r\n {\r\n _this.emit('shortcutcreated');\r\n\r\n }).catch(function (e)\r\n {\r\n _this.emit('shortcutfailed', e);\r\n });\r\n }\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Quits the game.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#quit\r\n * @since 3.13.0\r\n */\r\n quit: function ()\r\n {\r\n FBInstant.quit();\r\n },\r\n\r\n /**\r\n * Log an app event with FB Analytics.\r\n * \r\n * See https://developers.facebook.com/docs/javascript/reference/v2.8#app_events for more details about FB Analytics.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#log\r\n * @since 3.13.0\r\n * \r\n * @param {string} name - Name of the event. Must be 2 to 40 characters, and can only contain '_', '-', ' ', and alphanumeric characters.\r\n * @param {number} [value] - An optional numeric value that FB Analytics can calculate a sum with.\r\n * @param {object} [params] - An optional object that can contain up to 25 key-value pairs to be logged with the event. Keys must be 2 to 40 characters, and can only contain '_', '-', ' ', and alphanumeric characters. Values must be less than 100 characters in length.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n log: function (name, value, params)\r\n {\r\n if (!this.checkAPI('logEvent'))\r\n {\r\n return this;\r\n }\r\n\r\n if (params === undefined) { params = {}; }\r\n\r\n if (name.length >= 2 && name.length <= 40)\r\n {\r\n FBInstant.logEvent(name, parseFloat(value), params);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Attempt to create an instance of an interstitial ad.\r\n * \r\n * If the instance is created successfully then the ad is preloaded ready for display in-game via the method `showAd()`.\r\n * \r\n * If the ad loads it will emit the `adloaded` event, passing the AdInstance as the only parameter.\r\n * \r\n * If the ad cannot be displayed because there was no inventory to fill it, it will emit the `adsnofill` event.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#preloadAds\r\n * @since 3.13.0\r\n * \r\n * @param {(string|string[])} placementID - The ad placement ID, or an array of IDs, as created in your Audience Network settings within Facebook.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n preloadAds: function (placementID)\r\n {\r\n if (!this.checkAPI('getInterstitialAdAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n if (!Array.isArray(placementID))\r\n {\r\n placementID = [ placementID ];\r\n }\r\n\r\n var i;\r\n var _this = this;\r\n\r\n var total = 0;\r\n\r\n for (i = 0; i < this.ads.length; i++)\r\n {\r\n if (!this.ads[i].shown)\r\n {\r\n total++;\r\n }\r\n }\r\n\r\n if (total + placementID.length >= 3)\r\n {\r\n console.warn('Too many AdInstances. Show an ad before loading more');\r\n return this;\r\n }\r\n\r\n for (i = 0; i < placementID.length; i++)\r\n {\r\n var id = placementID[i];\r\n var data;\r\n\r\n FBInstant.getInterstitialAdAsync(id).then(function (interstitial)\r\n {\r\n data = interstitial;\r\n\r\n return interstitial.loadAsync();\r\n\r\n }).then(function ()\r\n {\r\n var ad = AdInstance(id, data, false);\r\n\r\n _this.ads.push(ad);\r\n\r\n _this.emit('adloaded', ad);\r\n\r\n }).catch(function (e)\r\n {\r\n if (e.code === 'ADS_NO_FILL')\r\n {\r\n _this.emit('adsnofill', id);\r\n }\r\n else if (e.code === 'ADS_FREQUENT_LOAD')\r\n {\r\n _this.emit('adsfrequentload', id);\r\n }\r\n else\r\n {\r\n console.warn(e);\r\n }\r\n });\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Attempt to create an instance of an rewarded video ad.\r\n * \r\n * If the instance is created successfully then the ad is preloaded ready for display in-game via the method `showVideo()`.\r\n * \r\n * If the ad loads it will emit the `adloaded` event, passing the AdInstance as the only parameter.\r\n * \r\n * If the ad cannot be displayed because there was no inventory to fill it, it will emit the `adsnofill` event.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#preloadVideoAds\r\n * @since 3.13.0\r\n * \r\n * @param {(string|string[])} placementID - The ad placement ID, or an array of IDs, as created in your Audience Network settings within Facebook.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n preloadVideoAds: function (placementID)\r\n {\r\n if (!this.checkAPI('getRewardedVideoAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n if (!Array.isArray(placementID))\r\n {\r\n placementID = [ placementID ];\r\n }\r\n\r\n var i;\r\n var _this = this;\r\n\r\n var total = 0;\r\n\r\n for (i = 0; i < this.ads.length; i++)\r\n {\r\n if (!this.ads[i].shown)\r\n {\r\n total++;\r\n }\r\n }\r\n\r\n if (total + placementID.length >= 3)\r\n {\r\n console.warn('Too many AdInstances. Show an ad before loading more');\r\n return this;\r\n }\r\n\r\n for (i = 0; i < placementID.length; i++)\r\n {\r\n var id = placementID[i];\r\n var data;\r\n\r\n FBInstant.getRewardedVideoAsync(id).then(function (reward)\r\n {\r\n data = reward;\r\n\r\n return reward.loadAsync();\r\n\r\n }).then(function ()\r\n {\r\n var ad = AdInstance(id, data, true);\r\n\r\n _this.ads.push(ad);\r\n\r\n _this.emit('adloaded', ad);\r\n\r\n }).catch(function (e)\r\n {\r\n if (e.code === 'ADS_NO_FILL')\r\n {\r\n _this.emit('adsnofill', id);\r\n }\r\n else if (e.code === 'ADS_FREQUENT_LOAD')\r\n {\r\n _this.emit('adsfrequentload', id);\r\n }\r\n else\r\n {\r\n console.warn(e);\r\n }\r\n });\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Displays a previously loaded interstitial ad.\r\n * \r\n * If the ad is successfully displayed this plugin will emit the `adfinished` event, with the AdInstance object as its parameter.\r\n * \r\n * If the ad cannot be displayed, it will emit the `adsnotloaded` event.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#showAd\r\n * @since 3.13.0\r\n * \r\n * @param {string} placementID - The ad placement ID to display.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n showAd: function (placementID)\r\n {\r\n var _this = this;\r\n\r\n for (var i = 0; i < this.ads.length; i++)\r\n {\r\n var ad = this.ads[i];\r\n\r\n if (ad.placementID === placementID && !ad.shown)\r\n {\r\n ad.instance.showAsync().then(function ()\r\n {\r\n ad.shown = true;\r\n\r\n _this.emit('adfinished', ad);\r\n\r\n }).catch(function (e)\r\n {\r\n if (e.code === 'ADS_NOT_LOADED')\r\n {\r\n _this.emit('adsnotloaded', ad);\r\n }\r\n else if (e.code === 'RATE_LIMITED')\r\n {\r\n _this.emit('adratelimited', ad);\r\n }\r\n \r\n _this.emit('adshowerror', e, ad);\r\n });\r\n\r\n break;\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Displays a previously loaded interstitial video ad.\r\n * \r\n * If the ad is successfully displayed this plugin will emit the `adfinished` event, with the AdInstance object as its parameter.\r\n * \r\n * If the ad cannot be displayed, it will emit the `adsnotloaded` event.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#showVideo\r\n * @since 3.13.0\r\n * \r\n * @param {string} placementID - The ad placement ID to display.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n showVideo: function (placementID)\r\n {\r\n var _this = this;\r\n\r\n for (var i = 0; i < this.ads.length; i++)\r\n {\r\n var ad = this.ads[i];\r\n\r\n if (ad.placementID === placementID && ad.video && !ad.shown)\r\n {\r\n ad.instance.showAsync().then(function ()\r\n {\r\n ad.shown = true;\r\n\r\n _this.emit('adfinished', ad);\r\n\r\n }).catch(function (e)\r\n {\r\n if (e.code === 'ADS_NOT_LOADED')\r\n {\r\n _this.emit('adsnotloaded', ad);\r\n }\r\n else if (e.code === 'RATE_LIMITED')\r\n {\r\n _this.emit('adratelimited', ad);\r\n }\r\n \r\n _this.emit('adshowerror', e, ad);\r\n });\r\n\r\n break;\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Attempts to match the current player with other users looking for people to play with.\r\n * If successful, a new Messenger group thread will be created containing the matched players and the player will\r\n * be context switched to that thread. This plugin will also dispatch the `matchplayer` event, containing the new context ID and Type.\r\n * \r\n * The default minimum and maximum number of players in one matched thread are 2 and 20 respectively,\r\n * depending on how many players are trying to get matched around the same time.\r\n * \r\n * The values can be changed in `fbapp-config.json`. See the Bundle Config documentation for documentation about `fbapp-config.json`.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#matchPlayer\r\n * @since 3.13.0\r\n * \r\n * @param {string} [matchTag] - Optional extra information about the player used to group them with similar players. Players will only be grouped with other players with exactly the same tag. The tag must only include letters, numbers, and underscores and be 100 characters or less in length.\r\n * @param {boolean} [switchImmediately=false] - Optional extra parameter that specifies whether the player should be immediately switched to the new context when a match is found. By default this will be false which will mean the player needs explicitly press play after being matched to switch to the new context.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n matchPlayer: function (matchTag, switchImmediately)\r\n {\r\n if (matchTag === undefined) { matchTag = null; }\r\n if (switchImmediately === undefined) { switchImmediately = false; }\r\n\r\n if (!this.checkAPI('matchPlayerAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n var _this = this;\r\n\r\n FBInstant.matchPlayerAsync(matchTag, switchImmediately).then(function ()\r\n {\r\n _this.getID();\r\n _this.getType();\r\n\r\n _this.emit('matchplayer', _this.contextID, _this.contextType);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Fetch a specific leaderboard belonging to this Instant Game.\r\n * \r\n * The data is requested in an async call, so the result isn't available immediately.\r\n * \r\n * When the call completes the `getleaderboard` event will be emitted along with a Leaderboard object instance.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#getLeaderboard\r\n * @since 3.13.0\r\n * \r\n * @param {string} name - The name of the leaderboard. Each leaderboard for an Instant Game must have its own distinct name.\r\n * \r\n * @return {this} This Facebook Instant Games Plugin instance.\r\n */\r\n getLeaderboard: function (name)\r\n {\r\n if (!this.checkAPI('getLeaderboardAsync'))\r\n {\r\n return this;\r\n }\r\n\r\n var _this = this;\r\n\r\n FBInstant.getLeaderboardAsync(name).then(function (data)\r\n {\r\n var leaderboard = new Leaderboard(_this, data);\r\n\r\n _this.leaderboards[name] = leaderboard;\r\n\r\n _this.emit('getleaderboard', leaderboard);\r\n\r\n }).catch(function (e)\r\n {\r\n console.warn(e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Quits the Facebook API and then destroys this plugin.\r\n *\r\n * @method Phaser.FacebookInstantGamesPlugin#destroy\r\n * @since 3.13.0\r\n */\r\n destroy: function ()\r\n {\r\n FBInstant.quit();\r\n\r\n this.data.destroy();\r\n\r\n this.removeAllListeners();\r\n\r\n this.catalog = [];\r\n this.purchases = [];\r\n this.leaderboards = [];\r\n this.ads = [];\r\n\r\n this.game = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = FacebookInstantGamesPlugin;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/plugins/fbinstant/src/FacebookInstantGamesPlugin.js?"); /***/ }), /***/ "./node_modules/phaser/plugins/fbinstant/src/Leaderboard.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/plugins/fbinstant/src/Leaderboard.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../src/utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar LeaderboardScore = __webpack_require__(/*! ./LeaderboardScore */ \"./node_modules/phaser/plugins/fbinstant/src/LeaderboardScore.js\");\r\n\r\n/**\r\n * @classdesc\r\n * This class represents one single Leaderboard that belongs to a Facebook Instant Game.\r\n * \r\n * You do not need to instantiate this class directly, it will be created when you use the\r\n * `getLeaderboard()` method of the main plugin.\r\n *\r\n * @class FacebookInstantGamesLeaderboard\r\n * @memberOf Phaser\r\n * @constructor\r\n * @extends Phaser.Events.EventEmitter\r\n * @since 3.13.0\r\n * \r\n * @param {Phaser.FacebookInstantGamesPlugin} plugin - A reference to the Facebook Instant Games Plugin.\r\n * @param {any} data - An Instant Game leaderboard instance.\r\n */\r\nvar Leaderboard = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function Leaderboard (plugin, data)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * A reference to the Facebook Instant Games Plugin.\r\n *\r\n * @name Phaser.FacebookInstantGamesLeaderboard#plugin\r\n * @type {Phaser.FacebookInstantGamesPlugin}\r\n * @since 3.13.0\r\n */\r\n this.plugin = plugin;\r\n\r\n /**\r\n * An Instant Game leaderboard instance.\r\n *\r\n * @name Phaser.FacebookInstantGamesLeaderboard#ref\r\n * @type {any}\r\n * @since 3.13.0\r\n */\r\n this.ref = data;\r\n\r\n /**\r\n * The name of the leaderboard.\r\n *\r\n * @name Phaser.FacebookInstantGamesLeaderboard#name\r\n * @type {string}\r\n * @since 3.13.0\r\n */\r\n this.name = data.getName();\r\n\r\n /**\r\n * The ID of the context that the leaderboard is associated with, or null if the leaderboard is not tied to a particular context.\r\n *\r\n * @name Phaser.FacebookInstantGamesLeaderboard#contextID\r\n * @type {string}\r\n * @since 3.13.0\r\n */\r\n this.contextID = data.getContextID();\r\n\r\n /**\r\n * The total number of player entries in the leaderboard.\r\n * This value defaults to zero. Populate it via the `getEntryCount()` method.\r\n *\r\n * @name Phaser.FacebookInstantGamesLeaderboard#entryCount\r\n * @type {integer}\r\n * @since 3.13.0\r\n */\r\n this.entryCount = 0;\r\n\r\n /**\r\n * The players score object.\r\n * This value defaults to `null`. Populate it via the `getPlayerScore()` method.\r\n *\r\n * @name Phaser.FacebookInstantGamesLeaderboard#playerScore\r\n * @type {LeaderboardScore}\r\n * @since 3.13.0\r\n */\r\n this.playerScore = null;\r\n\r\n /**\r\n * The scores in the Leaderboard from the currently requested range.\r\n * This value defaults to an empty array. Populate it via the `getScores()` method.\r\n * The contents of this array are reset each time `getScores()` is called.\r\n *\r\n * @name Phaser.FacebookInstantGamesLeaderboard#scores\r\n * @type {LeaderboardScore[]}\r\n * @since 3.13.0\r\n */\r\n this.scores = [];\r\n\r\n this.getEntryCount();\r\n },\r\n\r\n /**\r\n * Fetches the total number of player entries in the leaderboard.\r\n * \r\n * The data is requested in an async call, so the result isn't available immediately.\r\n * \r\n * When the call completes this Leaderboard will emit the `getentrycount` event along with the count and name of the Leaderboard.\r\n *\r\n * @method Phaser.FacebookInstantGamesLeaderboard#getEntryCount\r\n * @since 3.13.0\r\n * \r\n * @return {this} This Leaderboard instance.\r\n */\r\n getEntryCount: function ()\r\n {\r\n var _this = this;\r\n\r\n this.ref.getEntryCountAsync().then(function (count)\r\n {\r\n _this.entryCount = count;\r\n\r\n _this.emit('getentrycount', count, _this.name);\r\n\r\n }).catch(function (e)\r\n {\r\n console.warn(e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Updates the player's score. If the player has an existing score, the old score will only be replaced if the new score is better than it.\r\n * NOTE: If the leaderboard is associated with a specific context, the game must be in that context to set a score for the player.\r\n * \r\n * The data is requested in an async call, so the result isn't available immediately.\r\n * \r\n * When the call completes this Leaderboard will emit the `setscore` event along with the LeaderboardScore object and the name of the Leaderboard.\r\n * \r\n * If the save fails the event will send `null` as the score value.\r\n *\r\n * @method Phaser.FacebookInstantGamesLeaderboard#setScore\r\n * @since 3.13.0\r\n * \r\n * @param {integer} score - The new score for the player. Must be a 64-bit integer number.\r\n * @param {(string|any)} [data] - Metadata to associate with the stored score. Must be less than 2KB in size. If an object is given it will be passed to `JSON.stringify`.\r\n * \r\n * @return {this} This Leaderboard instance.\r\n */\r\n setScore: function (score, data)\r\n {\r\n if (data === undefined) { data = ''; }\r\n\r\n if (typeof data === 'object')\r\n {\r\n data = JSON.stringify(data);\r\n }\r\n\r\n var _this = this;\r\n\r\n this.ref.setScoreAsync(score, data).then(function (entry)\r\n {\r\n if (entry)\r\n {\r\n var score = LeaderboardScore(entry);\r\n\r\n _this.playerScore = score;\r\n \r\n _this.emit('setscore', score, _this.name);\r\n }\r\n else\r\n {\r\n _this.emit('setscore', null, _this.name);\r\n }\r\n\r\n }).catch(function (e)\r\n {\r\n console.warn(e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the players leaderboard entry and stores it in the `playerScore` property.\r\n * \r\n * The data is requested in an async call, so the result isn't available immediately.\r\n * \r\n * When the call completes this Leaderboard will emit the `getplayerscore` event along with the score and the name of the Leaderboard.\r\n * \r\n * If the player has not yet saved a score, the event will send `null` as the score value, and `playerScore` will be set to `null` as well.\r\n *\r\n * @method Phaser.FacebookInstantGamesLeaderboard#getPlayerScore\r\n * @since 3.13.0\r\n * \r\n * @return {this} This Leaderboard instance.\r\n */\r\n getPlayerScore: function ()\r\n {\r\n var _this = this;\r\n\r\n this.ref.getPlayerEntryAsync().then(function (entry)\r\n {\r\n if (entry)\r\n {\r\n var score = LeaderboardScore(entry);\r\n\r\n _this.playerScore = score;\r\n \r\n _this.emit('getplayerscore', score, _this.name);\r\n }\r\n else\r\n {\r\n _this.emit('getplayerscore', null, _this.name);\r\n }\r\n\r\n }).catch(function (e)\r\n {\r\n console.warn(e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieves a set of leaderboard entries, ordered by score ranking in the leaderboard.\r\n * \r\n * The data is requested in an async call, so the result isn't available immediately.\r\n * \r\n * When the call completes this Leaderboard will emit the `getscores` event along with an array of LeaderboardScore entries and the name of the Leaderboard.\r\n *\r\n * @method Phaser.FacebookInstantGamesLeaderboard#getScores\r\n * @since 3.13.0\r\n * \r\n * @param {integer} [count=10] - The number of entries to attempt to fetch from the leaderboard. Currently, up to a maximum of 100 entries may be fetched per query.\r\n * @param {integer} [offset=0] - The offset from the top of the leaderboard that entries will be fetched from.\r\n * \r\n * @return {this} This Leaderboard instance.\r\n */\r\n getScores: function (count, offset)\r\n {\r\n if (count === undefined) { count = 10; }\r\n if (offset === undefined) { offset = 0; }\r\n\r\n var _this = this;\r\n\r\n this.ref.getEntriesAsync(count, offset).then(function (entries)\r\n {\r\n _this.scores = [];\r\n\r\n entries.forEach(function (entry)\r\n {\r\n _this.scores.push(LeaderboardScore(entry));\r\n });\r\n\r\n _this.emit('getscores', _this.scores, _this.name);\r\n\r\n }).catch(function (e)\r\n {\r\n console.warn(e);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieves a set of leaderboard entries, based on the current player's connected players (including the current player), ordered by local rank within the set of connected players.\r\n * \r\n * The data is requested in an async call, so the result isn't available immediately.\r\n * \r\n * When the call completes this Leaderboard will emit the `getconnectedscores` event along with an array of LeaderboardScore entries and the name of the Leaderboard.\r\n *\r\n * @method Phaser.FacebookInstantGamesLeaderboard#getConnectedScores\r\n * @since 3.16.0\r\n * \r\n * @return {this} This Leaderboard instance.\r\n */\r\n getConnectedScores: function ()\r\n {\r\n var _this = this;\r\n\r\n this.ref.getConnectedPlayerEntriesAsync().then(function (entries)\r\n {\r\n _this.scores = [];\r\n\r\n entries.forEach(function (entry)\r\n {\r\n _this.scores.push(LeaderboardScore(entry));\r\n });\r\n\r\n _this.emit('getconnectedscores', _this.scores, _this.name);\r\n\r\n }).catch(function (e)\r\n {\r\n console.warn(e);\r\n });\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Leaderboard;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/plugins/fbinstant/src/Leaderboard.js?"); /***/ }), /***/ "./node_modules/phaser/plugins/fbinstant/src/LeaderboardScore.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/plugins/fbinstant/src/LeaderboardScore.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\n/**\r\n * @typedef {object} LeaderboardScore\r\n *\r\n * @property {integer} score - An integer score value.\r\n * @property {string} scoreFormatted - The score value, formatted with the score format associated with the leaderboard.\r\n * @property {integer} timestamp - The Unix timestamp of when the leaderboard entry was last updated.\r\n * @property {integer} rank - The entry's leaderboard ranking.\r\n * @property {string} data - The developer-specified payload associated with the score, or null if one was not set.\r\n * @property {string} playerName - The player's localized display name.\r\n * @property {string} playerPhotoURL - A url to the player's public profile photo.\r\n * @property {string} playerID - The game's unique identifier for the player.\r\n */\r\n\r\nvar LeaderboardScore = function (entry)\r\n{\r\n return {\r\n score: entry.getScore(),\r\n scoreFormatted: entry.getFormattedScore(),\r\n timestamp: entry.getTimestamp(),\r\n rank: entry.getRank(),\r\n data: entry.getExtraData(),\r\n playerName: entry.getPlayer().getName(),\r\n playerPhotoURL: entry.getPlayer().getPhoto(),\r\n playerID: entry.getPlayer().getID()\r\n };\r\n};\r\n\r\nmodule.exports = LeaderboardScore;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/plugins/fbinstant/src/LeaderboardScore.js?"); /***/ }), /***/ "./node_modules/phaser/plugins/fbinstant/src/Product.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/plugins/fbinstant/src/Product.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar GetFastValue = __webpack_require__(/*! ../../../src/utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\n\r\n/**\r\n * @typedef {object} Product\r\n *\r\n * @property {string} [title] - The title of the product.\r\n * @property {string} [productID] - The product's game-specified identifier.\r\n * @property {string} [description] - The product description.\r\n * @property {string} [imageURI] - A link to the product's associated image.\r\n * @property {string} [price] - The price of the product.\r\n * @property {string} [priceCurrencyCode] - The currency code for the product.\r\n */\r\n\r\nvar Product = function (data)\r\n{\r\n return {\r\n title: GetFastValue(data, 'title', ''),\r\n productID: GetFastValue(data, 'productID', ''),\r\n description: GetFastValue(data, 'description', ''),\r\n imageURI: GetFastValue(data, 'imageURI', ''),\r\n price: GetFastValue(data, 'price', ''),\r\n priceCurrencyCode: GetFastValue(data, 'priceCurrencyCode', '')\r\n };\r\n};\r\n\r\nmodule.exports = Product;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/plugins/fbinstant/src/Product.js?"); /***/ }), /***/ "./node_modules/phaser/plugins/fbinstant/src/Purchase.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/plugins/fbinstant/src/Purchase.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar GetFastValue = __webpack_require__(/*! ../../../src/utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\n\r\n/**\r\n * @typedef {object} Purchase\r\n *\r\n * @property {string} [developerPayload] - A developer-specified string, provided during the purchase of the product.\r\n * @property {string} [paymentID] - The identifier for the purchase transaction.\r\n * @property {string} [productID] - The product's game-specified identifier.\r\n * @property {string} [purchaseTime] - Unix timestamp of when the purchase occurred.\r\n * @property {string} [purchaseToken] - A token representing the purchase that may be used to consume the purchase.\r\n * @property {string} [signedRequest] - Server-signed encoding of the purchase request.\r\n */\r\n\r\nvar Purchase = function (data)\r\n{\r\n return {\r\n developerPayload: GetFastValue(data, 'developerPayload', ''),\r\n paymentID: GetFastValue(data, 'paymentID', ''),\r\n productID: GetFastValue(data, 'productID', ''),\r\n purchaseTime: GetFastValue(data, 'purchaseTime', ''),\r\n purchaseToken: GetFastValue(data, 'purchaseToken', ''),\r\n signedRequest: GetFastValue(data, 'signedRequest', '')\r\n };\r\n};\r\n\r\nmodule.exports = Purchase;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/plugins/fbinstant/src/Purchase.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/AlignTo.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/actions/AlignTo.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author samme\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar QuickSet = __webpack_require__(/*! ../display/align/to/QuickSet */ \"./node_modules/phaser/src/display/align/to/QuickSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, and aligns them next to each other.\r\n *\r\n * The first item isn't moved. The second item is aligned next to the first, then the third next to the second, and so on.\r\n *\r\n * @function Phaser.Actions.AlignTo\r\n * @since 3.22.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {integer} position - The position to align the items with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar AlignTo = function (items, position, offsetX, offsetY)\r\n{\r\n var target = items[0];\r\n\r\n for (var i = 1; i < items.length; i++)\r\n {\r\n var item = items[i];\r\n\r\n QuickSet(item, target, position, offsetX, offsetY);\r\n\r\n target = item;\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = AlignTo;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/AlignTo.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/Angle.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/actions/Angle.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueInc = __webpack_require__(/*! ./PropertyValueInc */ \"./node_modules/phaser/src/actions/PropertyValueInc.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have a public `angle` property,\r\n * and then adds the given value to each of their `angle` properties.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `Angle(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.Angle\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to be added to the `angle` property.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar Angle = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueInc(items, 'angle', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = Angle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/Angle.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/Call.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/actions/Call.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes an array of objects and passes each of them to the given callback.\r\n *\r\n * @function Phaser.Actions.Call\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {Phaser.Types.Actions.CallCallback} callback - The callback to be invoked. It will be passed just one argument: the item from the array.\r\n * @param {*} context - The scope in which the callback will be invoked.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that was passed to this Action.\r\n */\r\nvar Call = function (items, callback, context)\r\n{\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n var item = items[i];\r\n\r\n callback.call(context, item);\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = Call;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/Call.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/GetFirst.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/actions/GetFirst.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes an array of objects and returns the first element in the array that has properties which match\r\n * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }`\r\n * then it would return the first item which had the property `scaleX` set to 0.5 and `alpha` set to 1.\r\n *\r\n * To use this with a Group: `GetFirst(group.getChildren(), compare, index)`\r\n *\r\n * @function Phaser.Actions.GetFirst\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be searched by this action.\r\n * @param {object} compare - The comparison object. Each property in this object will be checked against the items of the array.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n *\r\n * @return {?(object|Phaser.GameObjects.GameObject)} The first object in the array that matches the comparison object, or `null` if no match was found.\r\n */\r\nvar GetFirst = function (items, compare, index)\r\n{\r\n if (index === undefined) { index = 0; }\r\n\r\n for (var i = index; i < items.length; i++)\r\n {\r\n var item = items[i];\r\n\r\n var match = true;\r\n\r\n for (var property in compare)\r\n {\r\n if (item[property] !== compare[property])\r\n {\r\n match = false;\r\n }\r\n }\r\n\r\n if (match)\r\n {\r\n return item;\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nmodule.exports = GetFirst;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/GetFirst.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/GetLast.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/actions/GetLast.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes an array of objects and returns the last element in the array that has properties which match\r\n * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }`\r\n * then it would return the last item which had the property `scaleX` set to 0.5 and `alpha` set to 1.\r\n *\r\n * To use this with a Group: `GetLast(group.getChildren(), compare, index)`\r\n *\r\n * @function Phaser.Actions.GetLast\r\n * @since 3.3.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be searched by this action.\r\n * @param {object} compare - The comparison object. Each property in this object will be checked against the items of the array.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n *\r\n * @return {?(object|Phaser.GameObjects.GameObject)} The last object in the array that matches the comparison object, or `null` if no match was found.\r\n */\r\nvar GetLast = function (items, compare, index)\r\n{\r\n if (index === undefined) { index = 0; }\r\n\r\n for (var i = index; i < items.length; i++)\r\n {\r\n var item = items[i];\r\n\r\n var match = true;\r\n\r\n for (var property in compare)\r\n {\r\n if (item[property] !== compare[property])\r\n {\r\n match = false;\r\n }\r\n }\r\n\r\n if (match)\r\n {\r\n return item;\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nmodule.exports = GetLast;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/GetLast.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/GridAlign.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/actions/GridAlign.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar AlignIn = __webpack_require__(/*! ../display/align/in/QuickSet */ \"./node_modules/phaser/src/display/align/in/QuickSet.js\");\r\nvar CONST = __webpack_require__(/*! ../display/align/const */ \"./node_modules/phaser/src/display/align/const.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar NOOP = __webpack_require__(/*! ../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar Zone = __webpack_require__(/*! ../gameobjects/zone/Zone */ \"./node_modules/phaser/src/gameobjects/zone/Zone.js\");\r\n\r\nvar tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1);\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have public `x` and `y` properties,\r\n * and then aligns them based on the grid configuration given to this action.\r\n *\r\n * @function Phaser.Actions.GridAlign\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {Phaser.Types.Actions.GridAlignConfig} options - The GridAlign Configuration object.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar GridAlign = function (items, options)\r\n{\r\n if (options === undefined) { options = {}; }\r\n\r\n var widthSet = options.hasOwnProperty('width');\r\n var heightSet = options.hasOwnProperty('height');\r\n\r\n var width = GetFastValue(options, 'width', -1);\r\n var height = GetFastValue(options, 'height', -1);\r\n\r\n var cellWidth = GetFastValue(options, 'cellWidth', 1);\r\n var cellHeight = GetFastValue(options, 'cellHeight', cellWidth);\r\n\r\n var position = GetFastValue(options, 'position', CONST.TOP_LEFT);\r\n var x = GetFastValue(options, 'x', 0);\r\n var y = GetFastValue(options, 'y', 0);\r\n\r\n var cx = 0;\r\n var cy = 0;\r\n var w = (width * cellWidth);\r\n var h = (height * cellHeight);\r\n\r\n tempZone.setPosition(x, y);\r\n tempZone.setSize(cellWidth, cellHeight);\r\n\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n AlignIn(items[i], tempZone, position);\r\n\r\n if (widthSet && width === -1)\r\n {\r\n // We keep laying them out horizontally until we've done them all\r\n tempZone.x += cellWidth;\r\n }\r\n else if (heightSet && height === -1)\r\n {\r\n // We keep laying them out vertically until we've done them all\r\n tempZone.y += cellHeight;\r\n }\r\n else\r\n {\r\n // We keep laying them out until we hit the column limit\r\n cx += cellWidth;\r\n tempZone.x += cellWidth;\r\n\r\n if (cx === w)\r\n {\r\n cx = 0;\r\n cy += cellHeight;\r\n tempZone.x = x;\r\n tempZone.y += cellHeight;\r\n\r\n if (cy === h)\r\n {\r\n // We've hit the column limit, so return, even if there are items left\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = GridAlign;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/GridAlign.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/IncAlpha.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/actions/IncAlpha.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueInc = __webpack_require__(/*! ./PropertyValueInc */ \"./node_modules/phaser/src/actions/PropertyValueInc.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have a public `alpha` property,\r\n * and then adds the given value to each of their `alpha` properties.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `IncAlpha(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.IncAlpha\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to be added to the `alpha` property.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar IncAlpha = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueInc(items, 'alpha', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = IncAlpha;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/IncAlpha.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/IncX.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/actions/IncX.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueInc = __webpack_require__(/*! ./PropertyValueInc */ \"./node_modules/phaser/src/actions/PropertyValueInc.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have a public `x` property,\r\n * and then adds the given value to each of their `x` properties.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `IncX(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.IncX\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to be added to the `x` property.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar IncX = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueInc(items, 'x', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = IncX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/IncX.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/IncXY.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/actions/IncXY.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueInc = __webpack_require__(/*! ./PropertyValueInc */ \"./node_modules/phaser/src/actions/PropertyValueInc.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have public `x` and `y` properties,\r\n * and then adds the given value to each of them.\r\n *\r\n * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `IncXY(group.getChildren(), x, y, stepX, stepY)`\r\n *\r\n * @function Phaser.Actions.IncXY\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} x - The amount to be added to the `x` property.\r\n * @param {number} [y=x] - The amount to be added to the `y` property. If `undefined` or `null` it uses the `x` value.\r\n * @param {number} [stepX=0] - This is added to the `x` amount, multiplied by the iteration counter.\r\n * @param {number} [stepY=0] - This is added to the `y` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar IncXY = function (items, x, y, stepX, stepY, index, direction)\r\n{\r\n if (y === undefined || y === null) { y = x; }\r\n\r\n PropertyValueInc(items, 'x', x, stepX, index, direction);\r\n\r\n return PropertyValueInc(items, 'y', y, stepY, index, direction);\r\n};\r\n\r\nmodule.exports = IncXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/IncXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/IncY.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/actions/IncY.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueInc = __webpack_require__(/*! ./PropertyValueInc */ \"./node_modules/phaser/src/actions/PropertyValueInc.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have a public `y` property,\r\n * and then adds the given value to each of their `y` properties.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `IncY(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.IncY\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to be added to the `y` property.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar IncY = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueInc(items, 'y', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = IncY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/IncY.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/PlaceOnCircle.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/actions/PlaceOnCircle.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Circle.\r\n * \r\n * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property.\r\n *\r\n * @function Phaser.Actions.PlaceOnCircle\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {Phaser.Geom.Circle} circle - The Circle to position the Game Objects on.\r\n * @param {number} [startAngle=0] - Optional angle to start position from, in radians.\r\n * @param {number} [endAngle=6.28] - Optional angle to stop position at, in radians.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar PlaceOnCircle = function (items, circle, startAngle, endAngle)\r\n{\r\n if (startAngle === undefined) { startAngle = 0; }\r\n if (endAngle === undefined) { endAngle = 6.28; }\r\n\r\n var angle = startAngle;\r\n var angleStep = (endAngle - startAngle) / items.length;\r\n\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n items[i].x = circle.x + (circle.radius * Math.cos(angle));\r\n items[i].y = circle.y + (circle.radius * Math.sin(angle));\r\n\r\n angle += angleStep;\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = PlaceOnCircle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/PlaceOnCircle.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/PlaceOnEllipse.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/actions/PlaceOnEllipse.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of an Ellipse.\r\n * \r\n * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property.\r\n *\r\n * @function Phaser.Actions.PlaceOnEllipse\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to position the Game Objects on.\r\n * @param {number} [startAngle=0] - Optional angle to start position from, in radians.\r\n * @param {number} [endAngle=6.28] - Optional angle to stop position at, in radians.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar PlaceOnEllipse = function (items, ellipse, startAngle, endAngle)\r\n{\r\n if (startAngle === undefined) { startAngle = 0; }\r\n if (endAngle === undefined) { endAngle = 6.28; }\r\n\r\n var angle = startAngle;\r\n var angleStep = (endAngle - startAngle) / items.length;\r\n\r\n var a = ellipse.width / 2;\r\n var b = ellipse.height / 2;\r\n\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n items[i].x = ellipse.x + a * Math.cos(angle);\r\n items[i].y = ellipse.y + b * Math.sin(angle);\r\n\r\n angle += angleStep;\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = PlaceOnEllipse;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/PlaceOnEllipse.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/PlaceOnLine.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/actions/PlaceOnLine.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetPoints = __webpack_require__(/*! ../geom/line/GetPoints */ \"./node_modules/phaser/src/geom/line/GetPoints.js\");\r\n\r\n/**\r\n * Positions an array of Game Objects on evenly spaced points of a Line.\r\n *\r\n * @function Phaser.Actions.PlaceOnLine\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {Phaser.Geom.Line} line - The Line to position the Game Objects on.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar PlaceOnLine = function (items, line)\r\n{\r\n var points = GetPoints(line, items.length);\r\n\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n var item = items[i];\r\n var point = points[i];\r\n\r\n item.x = point.x;\r\n item.y = point.y;\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = PlaceOnLine;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/PlaceOnLine.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/PlaceOnRectangle.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/actions/PlaceOnRectangle.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MarchingAnts = __webpack_require__(/*! ../geom/rectangle/MarchingAnts */ \"./node_modules/phaser/src/geom/rectangle/MarchingAnts.js\");\r\nvar RotateLeft = __webpack_require__(/*! ../utils/array/RotateLeft */ \"./node_modules/phaser/src/utils/array/RotateLeft.js\");\r\nvar RotateRight = __webpack_require__(/*! ../utils/array/RotateRight */ \"./node_modules/phaser/src/utils/array/RotateRight.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle.\r\n * \r\n * Placement starts from the top-left of the rectangle, and proceeds in a clockwise direction.\r\n * If the `shift` parameter is given you can offset where placement begins.\r\n *\r\n * @function Phaser.Actions.PlaceOnRectangle\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to position the Game Objects on.\r\n * @param {integer} [shift=1] - An optional positional offset.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar PlaceOnRectangle = function (items, rect, shift)\r\n{\r\n if (shift === undefined) { shift = 0; }\r\n\r\n var points = MarchingAnts(rect, false, items.length);\r\n\r\n if (shift > 0)\r\n {\r\n RotateLeft(points, shift);\r\n }\r\n else if (shift < 0)\r\n {\r\n RotateRight(points, Math.abs(shift));\r\n }\r\n\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n items[i].x = points[i].x;\r\n items[i].y = points[i].y;\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = PlaceOnRectangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/PlaceOnRectangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/PlaceOnTriangle.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/actions/PlaceOnTriangle.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BresenhamPoints = __webpack_require__(/*! ../geom/line/BresenhamPoints */ \"./node_modules/phaser/src/geom/line/BresenhamPoints.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle.\r\n * \r\n * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property.\r\n *\r\n * @function Phaser.Actions.PlaceOnTriangle\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to position the Game Objects on.\r\n * @param {number} [stepRate=1] - An optional step rate, to increase or decrease the packing of the Game Objects on the lines.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar PlaceOnTriangle = function (items, triangle, stepRate)\r\n{\r\n var p1 = BresenhamPoints({ x1: triangle.x1, y1: triangle.y1, x2: triangle.x2, y2: triangle.y2 }, stepRate);\r\n var p2 = BresenhamPoints({ x1: triangle.x2, y1: triangle.y2, x2: triangle.x3, y2: triangle.y3 }, stepRate);\r\n var p3 = BresenhamPoints({ x1: triangle.x3, y1: triangle.y3, x2: triangle.x1, y2: triangle.y1 }, stepRate);\r\n\r\n // Remove overlaps\r\n p1.pop();\r\n p2.pop();\r\n p3.pop();\r\n\r\n p1 = p1.concat(p2, p3);\r\n\r\n var step = p1.length / items.length;\r\n var p = 0;\r\n\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n var item = items[i];\r\n var point = p1[Math.floor(p)];\r\n\r\n item.x = point.x;\r\n item.y = point.y;\r\n\r\n p += step;\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = PlaceOnTriangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/PlaceOnTriangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/PlayAnimation.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/actions/PlayAnimation.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Play an animation with the given key, starting at the given startFrame on all Game Objects in items.\r\n *\r\n * @function Phaser.Actions.PlayAnimation\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {string} key - The name of the animation to play.\r\n * @param {(string|integer)} [startFrame] - The starting frame of the animation with the given key.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar PlayAnimation = function (items, key, startFrame)\r\n{\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n items[i].anims.play(key, startFrame);\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = PlayAnimation;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/PlayAnimation.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/PropertyValueInc.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/actions/PropertyValueInc.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have a public property as defined in `key`,\r\n * and then adds the given value to it.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `PropertyValueInc(group.getChildren(), key, value, step)`\r\n *\r\n * @function Phaser.Actions.PropertyValueInc\r\n * @since 3.3.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {string} key - The property to be updated.\r\n * @param {number} value - The amount to be added to the property.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar PropertyValueInc = function (items, key, value, step, index, direction)\r\n{\r\n if (step === undefined) { step = 0; }\r\n if (index === undefined) { index = 0; }\r\n if (direction === undefined) { direction = 1; }\r\n\r\n var i;\r\n var t = 0;\r\n var end = items.length;\r\n\r\n if (direction === 1)\r\n {\r\n // Start to End\r\n for (i = index; i < end; i++)\r\n {\r\n items[i][key] += value + (t * step);\r\n t++;\r\n }\r\n }\r\n else\r\n {\r\n // End to Start\r\n for (i = index; i >= 0; i--)\r\n {\r\n items[i][key] += value + (t * step);\r\n t++;\r\n }\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = PropertyValueInc;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/PropertyValueInc.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/PropertyValueSet.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/actions/PropertyValueSet.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have a public property as defined in `key`,\r\n * and then sets it to the given value.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `PropertyValueSet(group.getChildren(), key, value, step)`\r\n *\r\n * @function Phaser.Actions.PropertyValueSet\r\n * @since 3.3.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {string} key - The property to be updated.\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar PropertyValueSet = function (items, key, value, step, index, direction)\r\n{\r\n if (step === undefined) { step = 0; }\r\n if (index === undefined) { index = 0; }\r\n if (direction === undefined) { direction = 1; }\r\n\r\n var i;\r\n var t = 0;\r\n var end = items.length;\r\n\r\n if (direction === 1)\r\n {\r\n // Start to End\r\n for (i = index; i < end; i++)\r\n {\r\n items[i][key] = value + (t * step);\r\n t++;\r\n }\r\n }\r\n else\r\n {\r\n // End to Start\r\n for (i = index; i >= 0; i--)\r\n {\r\n items[i][key] = value + (t * step);\r\n t++;\r\n }\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = PropertyValueSet;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/PropertyValueSet.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/RandomCircle.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/actions/RandomCircle.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Random = __webpack_require__(/*! ../geom/circle/Random */ \"./node_modules/phaser/src/geom/circle/Random.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects and positions them at random locations within the Circle.\r\n * \r\n * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property.\r\n *\r\n * @function Phaser.Actions.RandomCircle\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {Phaser.Geom.Circle} circle - The Circle to position the Game Objects within.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar RandomCircle = function (items, circle)\r\n{\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n Random(circle, items[i]);\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = RandomCircle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/RandomCircle.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/RandomEllipse.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/actions/RandomEllipse.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Random = __webpack_require__(/*! ../geom/ellipse/Random */ \"./node_modules/phaser/src/geom/ellipse/Random.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects and positions them at random locations within the Ellipse.\r\n * \r\n * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property.\r\n *\r\n * @function Phaser.Actions.RandomEllipse\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to position the Game Objects within.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar RandomEllipse = function (items, ellipse)\r\n{\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n Random(ellipse, items[i]);\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = RandomEllipse;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/RandomEllipse.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/RandomLine.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/actions/RandomLine.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Random = __webpack_require__(/*! ../geom/line/Random */ \"./node_modules/phaser/src/geom/line/Random.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects and positions them at random locations on the Line.\r\n * \r\n * If you wish to pass a `Phaser.GameObjects.Line` Shape to this function, you should pass its `geom` property.\r\n *\r\n * @function Phaser.Actions.RandomLine\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {Phaser.Geom.Line} line - The Line to position the Game Objects randomly on.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar RandomLine = function (items, line)\r\n{\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n Random(line, items[i]);\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = RandomLine;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/RandomLine.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/RandomRectangle.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/actions/RandomRectangle.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Random = __webpack_require__(/*! ../geom/rectangle/Random */ \"./node_modules/phaser/src/geom/rectangle/Random.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects and positions them at random locations within the Rectangle.\r\n *\r\n * @function Phaser.Actions.RandomRectangle\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to position the Game Objects within.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar RandomRectangle = function (items, rect)\r\n{\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n Random(rect, items[i]);\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = RandomRectangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/RandomRectangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/RandomTriangle.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/actions/RandomTriangle.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Random = __webpack_require__(/*! ../geom/triangle/Random */ \"./node_modules/phaser/src/geom/triangle/Random.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects and positions them at random locations within the Triangle.\r\n * \r\n * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property.\r\n *\r\n * @function Phaser.Actions.RandomTriangle\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to position the Game Objects within.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar RandomTriangle = function (items, triangle)\r\n{\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n Random(triangle, items[i]);\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = RandomTriangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/RandomTriangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/Rotate.js": /*!***************************************************!*\ !*** ./node_modules/phaser/src/actions/Rotate.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueInc = __webpack_require__(/*! ./PropertyValueInc */ \"./node_modules/phaser/src/actions/PropertyValueInc.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have a public `rotation` property,\r\n * and then adds the given value to each of their `rotation` properties.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `Rotate(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.Rotate\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to be added to the `rotation` property (in radians).\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar Rotate = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueInc(items, 'rotation', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = Rotate;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/Rotate.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/RotateAround.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/actions/RotateAround.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RotateAroundDistance = __webpack_require__(/*! ../math/RotateAroundDistance */ \"./node_modules/phaser/src/math/RotateAroundDistance.js\");\r\nvar DistanceBetween = __webpack_require__(/*! ../math/distance/DistanceBetween */ \"./node_modules/phaser/src/math/distance/DistanceBetween.js\");\r\n\r\n/**\r\n * Rotates each item around the given point by the given angle.\r\n *\r\n * @function Phaser.Actions.RotateAround\r\n * @since 3.0.0\r\n * @see Phaser.Math.RotateAroundDistance\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {object} point - Any object with public `x` and `y` properties.\r\n * @param {number} angle - The angle to rotate by, in radians.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar RotateAround = function (items, point, angle)\r\n{\r\n var x = point.x;\r\n var y = point.y;\r\n\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n var item = items[i];\r\n\r\n RotateAroundDistance(item, x, y, angle, Math.max(1, DistanceBetween(item.x, item.y, x, y)));\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = RotateAround;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/RotateAround.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/RotateAroundDistance.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/actions/RotateAroundDistance.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MathRotateAroundDistance = __webpack_require__(/*! ../math/RotateAroundDistance */ \"./node_modules/phaser/src/math/RotateAroundDistance.js\");\r\n\r\n/**\r\n * Rotates an array of Game Objects around a point by the given angle and distance.\r\n *\r\n * @function Phaser.Actions.RotateAroundDistance\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {object} point - Any object with public `x` and `y` properties.\r\n * @param {number} angle - The angle to rotate by, in radians.\r\n * @param {number} distance - The distance from the point of rotation in pixels.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar RotateAroundDistance = function (items, point, angle, distance)\r\n{\r\n var x = point.x;\r\n var y = point.y;\r\n\r\n // There's nothing to do\r\n if (distance === 0)\r\n {\r\n return items;\r\n }\r\n\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n MathRotateAroundDistance(items[i], x, y, angle, distance);\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = RotateAroundDistance;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/RotateAroundDistance.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/ScaleX.js": /*!***************************************************!*\ !*** ./node_modules/phaser/src/actions/ScaleX.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueInc = __webpack_require__(/*! ./PropertyValueInc */ \"./node_modules/phaser/src/actions/PropertyValueInc.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have a public `scaleX` property,\r\n * and then adds the given value to each of their `scaleX` properties.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `ScaleX(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.ScaleX\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to be added to the `scaleX` property.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar ScaleX = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueInc(items, 'scaleX', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = ScaleX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/ScaleX.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/ScaleXY.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/actions/ScaleXY.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueInc = __webpack_require__(/*! ./PropertyValueInc */ \"./node_modules/phaser/src/actions/PropertyValueInc.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have public `scaleX` and `scaleY` properties,\r\n * and then adds the given value to each of them.\r\n *\r\n * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `ScaleXY(group.getChildren(), scaleX, scaleY, stepX, stepY)`\r\n *\r\n * @function Phaser.Actions.ScaleXY\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} scaleX - The amount to be added to the `scaleX` property.\r\n * @param {number} [scaleY] - The amount to be added to the `scaleY` property. If `undefined` or `null` it uses the `scaleX` value.\r\n * @param {number} [stepX=0] - This is added to the `scaleX` amount, multiplied by the iteration counter.\r\n * @param {number} [stepY=0] - This is added to the `scaleY` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar ScaleXY = function (items, scaleX, scaleY, stepX, stepY, index, direction)\r\n{\r\n if (scaleY === undefined || scaleY === null) { scaleY = scaleX; }\r\n\r\n PropertyValueInc(items, 'scaleX', scaleX, stepX, index, direction);\r\n\r\n return PropertyValueInc(items, 'scaleY', scaleY, stepY, index, direction);\r\n};\r\n\r\nmodule.exports = ScaleXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/ScaleXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/ScaleY.js": /*!***************************************************!*\ !*** ./node_modules/phaser/src/actions/ScaleY.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueInc = __webpack_require__(/*! ./PropertyValueInc */ \"./node_modules/phaser/src/actions/PropertyValueInc.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have a public `scaleY` property,\r\n * and then adds the given value to each of their `scaleY` properties.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `ScaleY(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.ScaleY\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to be added to the `scaleY` property.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar ScaleY = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueInc(items, 'scaleY', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = ScaleY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/ScaleY.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetAlpha.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/actions/SetAlpha.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueSet = __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have the public property `alpha`\r\n * and then sets it to the given value.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `SetAlpha(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.SetAlpha\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar SetAlpha = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueSet(items, 'alpha', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = SetAlpha;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetAlpha.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetBlendMode.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/actions/SetBlendMode.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueSet = __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have the public property `blendMode`\r\n * and then sets it to the given value.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `SetBlendMode(group.getChildren(), value)`\r\n *\r\n * @function Phaser.Actions.SetBlendMode\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to set the property to.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar SetBlendMode = function (items, value, index, direction)\r\n{\r\n return PropertyValueSet(items, 'blendMode', value, 0, index, direction);\r\n};\r\n\r\nmodule.exports = SetBlendMode;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetBlendMode.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetDepth.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/actions/SetDepth.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueSet = __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have the public property `depth`\r\n * and then sets it to the given value.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `SetDepth(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.SetDepth\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar SetDepth = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueSet(items, 'depth', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = SetDepth;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetDepth.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetHitArea.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/actions/SetHitArea.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Passes all provided Game Objects to the Input Manager to enable them for input with identical areas and callbacks.\r\n * \r\n * @see {@link Phaser.GameObjects.GameObject#setInteractive}\r\n *\r\n * @function Phaser.Actions.SetHitArea\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @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.\r\n * @param {Phaser.Types.Input.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.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar SetHitArea = function (items, hitArea, hitAreaCallback)\r\n{\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n items[i].setInteractive(hitArea, hitAreaCallback);\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = SetHitArea;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetHitArea.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetOrigin.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/actions/SetOrigin.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueSet = __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have the public properties `originX` and `originY`\r\n * and then sets them to the given values.\r\n *\r\n * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `SetOrigin(group.getChildren(), originX, originY, stepX, stepY)`\r\n *\r\n * @function Phaser.Actions.SetOrigin\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} originX - The amount to set the `originX` property to.\r\n * @param {number} [originY] - The amount to set the `originY` property to. If `undefined` or `null` it uses the `originX` value.\r\n * @param {number} [stepX=0] - This is added to the `originX` amount, multiplied by the iteration counter.\r\n * @param {number} [stepY=0] - This is added to the `originY` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar SetOrigin = function (items, originX, originY, stepX, stepY, index, direction)\r\n{\r\n if (originY === undefined || originY === null) { originY = originX; }\r\n\r\n PropertyValueSet(items, 'originX', originX, stepX, index, direction);\r\n\r\n return PropertyValueSet(items, 'originY', originY, stepY, index, direction);\r\n};\r\n\r\nmodule.exports = SetOrigin;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetOrigin.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetRotation.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/actions/SetRotation.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueSet = __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have the public property `rotation`\r\n * and then sets it to the given value.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `SetRotation(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.SetRotation\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar SetRotation = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueSet(items, 'rotation', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = SetRotation;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetRotation.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetScale.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/actions/SetScale.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueSet = __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have the public properties `scaleX` and `scaleY`\r\n * and then sets them to the given values.\r\n *\r\n * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `SetScale(group.getChildren(), scaleX, scaleY, stepX, stepY)`\r\n *\r\n * @function Phaser.Actions.SetScale\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} scaleX - The amount to set the `scaleX` property to.\r\n * @param {number} [scaleY] - The amount to set the `scaleY` property to. If `undefined` or `null` it uses the `scaleX` value.\r\n * @param {number} [stepX=0] - This is added to the `scaleX` amount, multiplied by the iteration counter.\r\n * @param {number} [stepY=0] - This is added to the `scaleY` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar SetScale = function (items, scaleX, scaleY, stepX, stepY, index, direction)\r\n{\r\n if (scaleY === undefined || scaleY === null) { scaleY = scaleX; }\r\n\r\n PropertyValueSet(items, 'scaleX', scaleX, stepX, index, direction);\r\n\r\n return PropertyValueSet(items, 'scaleY', scaleY, stepY, index, direction);\r\n};\r\n\r\nmodule.exports = SetScale;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetScale.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetScaleX.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/actions/SetScaleX.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueSet = __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have the public property `scaleX`\r\n * and then sets it to the given value.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `SetScaleX(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.SetScaleX\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar SetScaleX = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueSet(items, 'scaleX', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = SetScaleX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetScaleX.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetScaleY.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/actions/SetScaleY.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueSet = __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have the public property `scaleY`\r\n * and then sets it to the given value.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `SetScaleY(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.SetScaleY\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar SetScaleY = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueSet(items, 'scaleY', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = SetScaleY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetScaleY.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetScrollFactor.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/actions/SetScrollFactor.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueSet = __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have the public properties `scrollFactorX` and `scrollFactorY`\r\n * and then sets them to the given values.\r\n *\r\n * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `SetScrollFactor(group.getChildren(), scrollFactorX, scrollFactorY, stepX, stepY)`\r\n *\r\n * @function Phaser.Actions.SetScrollFactor\r\n * @since 3.21.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} scrollFactorX - The amount to set the `scrollFactorX` property to.\r\n * @param {number} [scrollFactorY] - The amount to set the `scrollFactorY` property to. If `undefined` or `null` it uses the `scrollFactorX` value.\r\n * @param {number} [stepX=0] - This is added to the `scrollFactorX` amount, multiplied by the iteration counter.\r\n * @param {number} [stepY=0] - This is added to the `scrollFactorY` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar SetScrollFactor = function (items, scrollFactorX, scrollFactorY, stepX, stepY, index, direction)\r\n{\r\n if (scrollFactorY === undefined || scrollFactorY === null) { scrollFactorY = scrollFactorX; }\r\n\r\n PropertyValueSet(items, 'scrollFactorX', scrollFactorX, stepX, index, direction);\r\n\r\n return PropertyValueSet(items, 'scrollFactorY', scrollFactorY, stepY, index, direction);\r\n};\r\n\r\nmodule.exports = SetScrollFactor;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetScrollFactor.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetScrollFactorX.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/actions/SetScrollFactorX.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueSet = __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have the public property `scrollFactorX`\r\n * and then sets it to the given value.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `SetScrollFactorX(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.SetScrollFactorX\r\n * @since 3.21.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar SetScrollFactorX = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueSet(items, 'scrollFactorX', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = SetScrollFactorX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetScrollFactorX.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetScrollFactorY.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/actions/SetScrollFactorY.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueSet = __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have the public property `scrollFactorY`\r\n * and then sets it to the given value.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `SetScrollFactorY(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.SetScrollFactorY\r\n * @since 3.21.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar SetScrollFactorY = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueSet(items, 'scrollFactorY', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = SetScrollFactorY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetScrollFactorY.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetTint.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/actions/SetTint.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * 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.\r\n *\r\n * @function Phaser.Actions.SetTint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @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.\r\n * @param {number} [topRight] - The tint to be applied to top-right corner of item.\r\n * @param {number} [bottomLeft] - The tint to be applied to the bottom-left corner of item.\r\n * @param {number} [bottomRight] - The tint to be applied to the bottom-right corner of item.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar SetTint = function (items, topLeft, topRight, bottomLeft, bottomRight)\r\n{\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n items[i].setTint(topLeft, topRight, bottomLeft, bottomRight);\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = SetTint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetTint.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetVisible.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/actions/SetVisible.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueSet = __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have the public property `visible`\r\n * and then sets it to the given value.\r\n *\r\n * To use this with a Group: `SetVisible(group.getChildren(), value)`\r\n *\r\n * @function Phaser.Actions.SetVisible\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {boolean} value - The value to set the property to.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar SetVisible = function (items, value, index, direction)\r\n{\r\n return PropertyValueSet(items, 'visible', value, 0, index, direction);\r\n};\r\n\r\nmodule.exports = SetVisible;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetVisible.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetX.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/actions/SetX.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueSet = __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have the public property `x`\r\n * and then sets it to the given value.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `SetX(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.SetX\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar SetX = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueSet(items, 'x', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = SetX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetX.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetXY.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/actions/SetXY.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueSet = __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have the public properties `x` and `y`\r\n * and then sets them to the given values.\r\n *\r\n * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `SetXY(group.getChildren(), x, y, stepX, stepY)`\r\n *\r\n * @function Phaser.Actions.SetXY\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} x - The amount to set the `x` property to.\r\n * @param {number} [y=x] - The amount to set the `y` property to. If `undefined` or `null` it uses the `x` value.\r\n * @param {number} [stepX=0] - This is added to the `x` amount, multiplied by the iteration counter.\r\n * @param {number} [stepY=0] - This is added to the `y` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar SetXY = function (items, x, y, stepX, stepY, index, direction)\r\n{\r\n if (y === undefined || y === null) { y = x; }\r\n\r\n PropertyValueSet(items, 'x', x, stepX, index, direction);\r\n\r\n return PropertyValueSet(items, 'y', y, stepY, index, direction);\r\n};\r\n\r\nmodule.exports = SetXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SetY.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/actions/SetY.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PropertyValueSet = __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\");\r\n\r\n/**\r\n * Takes an array of Game Objects, or any objects that have the public property `y`\r\n * and then sets it to the given value.\r\n *\r\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\r\n *\r\n * To use this with a Group: `SetY(group.getChildren(), value, step)`\r\n *\r\n * @function Phaser.Actions.SetY\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\r\n */\r\nvar SetY = function (items, value, step, index, direction)\r\n{\r\n return PropertyValueSet(items, 'y', value, step, index, direction);\r\n};\r\n\r\nmodule.exports = SetY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SetY.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/ShiftPosition.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/actions/ShiftPosition.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector2 = __webpack_require__(/*! ../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * Iterate through the items array changing the position of each element to be that of the element that came before\r\n * it in the array (or after it if direction = 1)\r\n * \r\n * The first items position is set to x/y.\r\n * \r\n * The final x/y coords are returned\r\n *\r\n * @function Phaser.Actions.ShiftPosition\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items]\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {number} x - The x coordinate to place the first item in the array at.\r\n * @param {number} y - The y coordinate to place the first item in the array at.\r\n * @param {integer} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first.\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An optional objec to store the final objects position in.\r\n *\r\n * @return {Phaser.Math.Vector2} The output vector.\r\n */\r\nvar ShiftPosition = function (items, x, y, direction, output)\r\n{\r\n if (direction === undefined) { direction = 0; }\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n var px;\r\n var py;\r\n\r\n if (items.length > 1)\r\n {\r\n var i;\r\n var cx;\r\n var cy;\r\n var cur;\r\n\r\n if (direction === 0)\r\n {\r\n // Bottom to Top\r\n\r\n var len = items.length - 1;\r\n\r\n px = items[len].x;\r\n py = items[len].y;\r\n\r\n for (i = len - 1; i >= 0; i--)\r\n {\r\n // Current item\r\n cur = items[i];\r\n\r\n // Get current item x/y, to be passed to the next item in the list\r\n cx = cur.x;\r\n cy = cur.y;\r\n\r\n // Set current item to the previous items x/y\r\n cur.x = px;\r\n cur.y = py;\r\n\r\n // Set current as previous\r\n px = cx;\r\n py = cy;\r\n }\r\n\r\n // Update the head item to the new x/y coordinates\r\n items[len].x = x;\r\n items[len].y = y;\r\n }\r\n else\r\n {\r\n // Top to Bottom\r\n\r\n px = items[0].x;\r\n py = items[0].y;\r\n\r\n for (i = 1; i < items.length; i++)\r\n {\r\n // Current item\r\n cur = items[i];\r\n\r\n // Get current item x/y, to be passed to the next item in the list\r\n cx = cur.x;\r\n cy = cur.y;\r\n\r\n // Set current item to the previous items x/y\r\n cur.x = px;\r\n cur.y = py;\r\n\r\n // Set current as previous\r\n px = cx;\r\n py = cy;\r\n }\r\n\r\n // Update the head item to the new x/y coordinates\r\n items[0].x = x;\r\n items[0].y = y;\r\n }\r\n }\r\n else\r\n {\r\n px = items[0].x;\r\n py = items[0].y;\r\n\r\n items[0].x = x;\r\n items[0].y = y;\r\n }\r\n\r\n // Return the final set of coordinates as they're effectively lost from the shift and may be needed\r\n\r\n output.x = px;\r\n output.y = py;\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = ShiftPosition;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/ShiftPosition.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/Shuffle.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/actions/Shuffle.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ArrayShuffle = __webpack_require__(/*! ../utils/array/Shuffle */ \"./node_modules/phaser/src/utils/array/Shuffle.js\");\r\n\r\n/**\r\n * Shuffles the array in place. The shuffled array is both modified and returned.\r\n *\r\n * @function Phaser.Actions.Shuffle\r\n * @since 3.0.0\r\n * @see Phaser.Utils.Array.Shuffle\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar Shuffle = function (items)\r\n{\r\n return ArrayShuffle(items);\r\n};\r\n\r\nmodule.exports = Shuffle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/Shuffle.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SmoothStep.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/actions/SmoothStep.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MathSmoothStep = __webpack_require__(/*! ../math/SmoothStep */ \"./node_modules/phaser/src/math/SmoothStep.js\");\r\n\r\n/**\r\n * Smoothstep is a sigmoid-like interpolation and clamping function.\r\n * \r\n * 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.\r\n *\r\n * @function Phaser.Actions.SmoothStep\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {string} property - The property of the Game Object to interpolate.\r\n * @param {number} min - The minimum interpolation value.\r\n * @param {number} max - The maximum interpolation value.\r\n * @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`)\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar SmoothStep = function (items, property, min, max, inc)\r\n{\r\n if (inc === undefined) { inc = false; }\r\n\r\n var step = Math.abs(max - min) / items.length;\r\n var i;\r\n\r\n if (inc)\r\n {\r\n for (i = 0; i < items.length; i++)\r\n {\r\n items[i][property] += MathSmoothStep(i * step, min, max);\r\n }\r\n }\r\n else\r\n {\r\n for (i = 0; i < items.length; i++)\r\n {\r\n items[i][property] = MathSmoothStep(i * step, min, max);\r\n }\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = SmoothStep;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SmoothStep.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/SmootherStep.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/actions/SmootherStep.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MathSmootherStep = __webpack_require__(/*! ../math/SmootherStep */ \"./node_modules/phaser/src/math/SmootherStep.js\");\r\n\r\n/**\r\n * Smootherstep is a sigmoid-like interpolation and clamping function.\r\n * \r\n * 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.\r\n *\r\n * @function Phaser.Actions.SmootherStep\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {string} property - The property of the Game Object to interpolate.\r\n * @param {number} min - The minimum interpolation value.\r\n * @param {number} max - The maximum interpolation value.\r\n * @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`)\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar SmootherStep = function (items, property, min, max, inc)\r\n{\r\n if (inc === undefined) { inc = false; }\r\n\r\n var step = Math.abs(max - min) / items.length;\r\n var i;\r\n\r\n if (inc)\r\n {\r\n for (i = 0; i < items.length; i++)\r\n {\r\n items[i][property] += MathSmootherStep(i * step, min, max);\r\n }\r\n }\r\n else\r\n {\r\n for (i = 0; i < items.length; i++)\r\n {\r\n items[i][property] = MathSmootherStep(i * step, min, max);\r\n }\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = SmootherStep;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/SmootherStep.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/Spread.js": /*!***************************************************!*\ !*** ./node_modules/phaser/src/actions/Spread.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes an array of Game Objects and then modifies their `property` so the value equals, or is incremented, by the\r\n * calculated spread value.\r\n * \r\n * The spread value is derived from the given `min` and `max` values and the total number of items in the array.\r\n * \r\n * For example, to cause an array of Sprites to change in alpha from 0 to 1 you could call:\r\n * \r\n * ```javascript\r\n * Phaser.Actions.Spread(itemsArray, 'alpha', 0, 1);\r\n * ```\r\n *\r\n * @function Phaser.Actions.Spread\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {string} property - The property of the Game Object to spread.\r\n * @param {number} min - The minimum value.\r\n * @param {number} max - The maximum value.\r\n * @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`)\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that were passed to this Action.\r\n */\r\nvar Spread = function (items, property, min, max, inc)\r\n{\r\n if (inc === undefined) { inc = false; }\r\n\r\n var step = Math.abs(max - min) / items.length;\r\n var i;\r\n\r\n if (inc)\r\n {\r\n for (i = 0; i < items.length; i++)\r\n {\r\n items[i][property] += i * step + min;\r\n }\r\n }\r\n else\r\n {\r\n for (i = 0; i < items.length; i++)\r\n {\r\n items[i][property] = i * step + min;\r\n }\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = Spread;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/Spread.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/ToggleVisible.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/actions/ToggleVisible.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes an array of Game Objects and toggles the visibility of each one.\r\n * Those previously `visible = false` will become `visible = true`, and vice versa.\r\n *\r\n * @function Phaser.Actions.ToggleVisible\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar ToggleVisible = function (items)\r\n{\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n items[i].visible = !items[i].visible;\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = ToggleVisible;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/ToggleVisible.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/WrapInRectangle.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/actions/WrapInRectangle.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author samme \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Wrap = __webpack_require__(/*! ../math/Wrap */ \"./node_modules/phaser/src/math/Wrap.js\");\r\n\r\n/**\r\n * Wrap each item's coordinates within a rectangle's area.\r\n *\r\n * @function Phaser.Actions.WrapInRectangle\r\n * @since 3.0.0\r\n * @see Phaser.Math.Wrap\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.\r\n * @param {Phaser.Geom.Rectangle} rect - The rectangle.\r\n * @param {number} [padding=0] - An amount added to each side of the rectangle during the operation.\r\n *\r\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.\r\n */\r\nvar WrapInRectangle = function (items, rect, padding)\r\n{\r\n if (padding === undefined)\r\n {\r\n padding = 0;\r\n }\r\n\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n var item = items[i];\r\n\r\n item.x = Wrap(item.x, rect.left - padding, rect.right + padding);\r\n item.y = Wrap(item.y, rect.top - padding, rect.bottom + padding);\r\n }\r\n\r\n return items;\r\n};\r\n\r\nmodule.exports = WrapInRectangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/WrapInRectangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/actions/index.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/actions/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Actions\r\n */\r\n\r\nmodule.exports = {\r\n\r\n AlignTo: __webpack_require__(/*! ./AlignTo */ \"./node_modules/phaser/src/actions/AlignTo.js\"),\r\n Angle: __webpack_require__(/*! ./Angle */ \"./node_modules/phaser/src/actions/Angle.js\"),\r\n Call: __webpack_require__(/*! ./Call */ \"./node_modules/phaser/src/actions/Call.js\"),\r\n GetFirst: __webpack_require__(/*! ./GetFirst */ \"./node_modules/phaser/src/actions/GetFirst.js\"),\r\n GetLast: __webpack_require__(/*! ./GetLast */ \"./node_modules/phaser/src/actions/GetLast.js\"),\r\n GridAlign: __webpack_require__(/*! ./GridAlign */ \"./node_modules/phaser/src/actions/GridAlign.js\"),\r\n IncAlpha: __webpack_require__(/*! ./IncAlpha */ \"./node_modules/phaser/src/actions/IncAlpha.js\"),\r\n IncX: __webpack_require__(/*! ./IncX */ \"./node_modules/phaser/src/actions/IncX.js\"),\r\n IncXY: __webpack_require__(/*! ./IncXY */ \"./node_modules/phaser/src/actions/IncXY.js\"),\r\n IncY: __webpack_require__(/*! ./IncY */ \"./node_modules/phaser/src/actions/IncY.js\"),\r\n PlaceOnCircle: __webpack_require__(/*! ./PlaceOnCircle */ \"./node_modules/phaser/src/actions/PlaceOnCircle.js\"),\r\n PlaceOnEllipse: __webpack_require__(/*! ./PlaceOnEllipse */ \"./node_modules/phaser/src/actions/PlaceOnEllipse.js\"),\r\n PlaceOnLine: __webpack_require__(/*! ./PlaceOnLine */ \"./node_modules/phaser/src/actions/PlaceOnLine.js\"),\r\n PlaceOnRectangle: __webpack_require__(/*! ./PlaceOnRectangle */ \"./node_modules/phaser/src/actions/PlaceOnRectangle.js\"),\r\n PlaceOnTriangle: __webpack_require__(/*! ./PlaceOnTriangle */ \"./node_modules/phaser/src/actions/PlaceOnTriangle.js\"),\r\n PlayAnimation: __webpack_require__(/*! ./PlayAnimation */ \"./node_modules/phaser/src/actions/PlayAnimation.js\"),\r\n PropertyValueInc: __webpack_require__(/*! ./PropertyValueInc */ \"./node_modules/phaser/src/actions/PropertyValueInc.js\"),\r\n PropertyValueSet: __webpack_require__(/*! ./PropertyValueSet */ \"./node_modules/phaser/src/actions/PropertyValueSet.js\"),\r\n RandomCircle: __webpack_require__(/*! ./RandomCircle */ \"./node_modules/phaser/src/actions/RandomCircle.js\"),\r\n RandomEllipse: __webpack_require__(/*! ./RandomEllipse */ \"./node_modules/phaser/src/actions/RandomEllipse.js\"),\r\n RandomLine: __webpack_require__(/*! ./RandomLine */ \"./node_modules/phaser/src/actions/RandomLine.js\"),\r\n RandomRectangle: __webpack_require__(/*! ./RandomRectangle */ \"./node_modules/phaser/src/actions/RandomRectangle.js\"),\r\n RandomTriangle: __webpack_require__(/*! ./RandomTriangle */ \"./node_modules/phaser/src/actions/RandomTriangle.js\"),\r\n Rotate: __webpack_require__(/*! ./Rotate */ \"./node_modules/phaser/src/actions/Rotate.js\"),\r\n RotateAround: __webpack_require__(/*! ./RotateAround */ \"./node_modules/phaser/src/actions/RotateAround.js\"),\r\n RotateAroundDistance: __webpack_require__(/*! ./RotateAroundDistance */ \"./node_modules/phaser/src/actions/RotateAroundDistance.js\"),\r\n ScaleX: __webpack_require__(/*! ./ScaleX */ \"./node_modules/phaser/src/actions/ScaleX.js\"),\r\n ScaleXY: __webpack_require__(/*! ./ScaleXY */ \"./node_modules/phaser/src/actions/ScaleXY.js\"),\r\n ScaleY: __webpack_require__(/*! ./ScaleY */ \"./node_modules/phaser/src/actions/ScaleY.js\"),\r\n SetAlpha: __webpack_require__(/*! ./SetAlpha */ \"./node_modules/phaser/src/actions/SetAlpha.js\"),\r\n SetBlendMode: __webpack_require__(/*! ./SetBlendMode */ \"./node_modules/phaser/src/actions/SetBlendMode.js\"),\r\n SetDepth: __webpack_require__(/*! ./SetDepth */ \"./node_modules/phaser/src/actions/SetDepth.js\"),\r\n SetHitArea: __webpack_require__(/*! ./SetHitArea */ \"./node_modules/phaser/src/actions/SetHitArea.js\"),\r\n SetOrigin: __webpack_require__(/*! ./SetOrigin */ \"./node_modules/phaser/src/actions/SetOrigin.js\"),\r\n SetRotation: __webpack_require__(/*! ./SetRotation */ \"./node_modules/phaser/src/actions/SetRotation.js\"),\r\n SetScale: __webpack_require__(/*! ./SetScale */ \"./node_modules/phaser/src/actions/SetScale.js\"),\r\n SetScaleX: __webpack_require__(/*! ./SetScaleX */ \"./node_modules/phaser/src/actions/SetScaleX.js\"),\r\n SetScaleY: __webpack_require__(/*! ./SetScaleY */ \"./node_modules/phaser/src/actions/SetScaleY.js\"),\r\n SetScrollFactor: __webpack_require__(/*! ./SetScrollFactor */ \"./node_modules/phaser/src/actions/SetScrollFactor.js\"),\r\n SetScrollFactorX: __webpack_require__(/*! ./SetScrollFactorX */ \"./node_modules/phaser/src/actions/SetScrollFactorX.js\"),\r\n SetScrollFactorY: __webpack_require__(/*! ./SetScrollFactorY */ \"./node_modules/phaser/src/actions/SetScrollFactorY.js\"),\r\n SetTint: __webpack_require__(/*! ./SetTint */ \"./node_modules/phaser/src/actions/SetTint.js\"),\r\n SetVisible: __webpack_require__(/*! ./SetVisible */ \"./node_modules/phaser/src/actions/SetVisible.js\"),\r\n SetX: __webpack_require__(/*! ./SetX */ \"./node_modules/phaser/src/actions/SetX.js\"),\r\n SetXY: __webpack_require__(/*! ./SetXY */ \"./node_modules/phaser/src/actions/SetXY.js\"),\r\n SetY: __webpack_require__(/*! ./SetY */ \"./node_modules/phaser/src/actions/SetY.js\"),\r\n ShiftPosition: __webpack_require__(/*! ./ShiftPosition */ \"./node_modules/phaser/src/actions/ShiftPosition.js\"),\r\n Shuffle: __webpack_require__(/*! ./Shuffle */ \"./node_modules/phaser/src/actions/Shuffle.js\"),\r\n SmootherStep: __webpack_require__(/*! ./SmootherStep */ \"./node_modules/phaser/src/actions/SmootherStep.js\"),\r\n SmoothStep: __webpack_require__(/*! ./SmoothStep */ \"./node_modules/phaser/src/actions/SmoothStep.js\"),\r\n Spread: __webpack_require__(/*! ./Spread */ \"./node_modules/phaser/src/actions/Spread.js\"),\r\n ToggleVisible: __webpack_require__(/*! ./ToggleVisible */ \"./node_modules/phaser/src/actions/ToggleVisible.js\"),\r\n WrapInRectangle: __webpack_require__(/*! ./WrapInRectangle */ \"./node_modules/phaser/src/actions/WrapInRectangle.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/actions/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/Animation.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/animations/Animation.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = __webpack_require__(/*! ../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/animations/events/index.js\");\r\nvar FindClosestInSorted = __webpack_require__(/*! ../utils/array/FindClosestInSorted */ \"./node_modules/phaser/src/utils/array/FindClosestInSorted.js\");\r\nvar Frame = __webpack_require__(/*! ./AnimationFrame */ \"./node_modules/phaser/src/animations/AnimationFrame.js\");\r\nvar GetValue = __webpack_require__(/*! ../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Frame based Animation.\r\n *\r\n * This consists of a key, some default values (like the frame rate) and a bunch of Frame objects.\r\n *\r\n * The Animation Manager creates these. Game Objects don't own an instance of these directly.\r\n * Game Objects have the Animation Component, which are like playheads to global Animations (these objects)\r\n * So multiple Game Objects can have playheads all pointing to this one Animation instance.\r\n *\r\n * @class Animation\r\n * @memberof Phaser.Animations\r\n * @extends Phaser.Events.EventEmitter\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Animations.AnimationManager} manager - A reference to the global Animation Manager\r\n * @param {string} key - The unique identifying string for this animation.\r\n * @param {Phaser.Types.Animations.Animation} config - The Animation configuration.\r\n */\r\nvar Animation = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function Animation (manager, key, config)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * A reference to the global Animation Manager.\r\n *\r\n * @name Phaser.Animations.Animation#manager\r\n * @type {Phaser.Animations.AnimationManager}\r\n * @since 3.0.0\r\n */\r\n this.manager = manager;\r\n\r\n /**\r\n * The unique identifying string for this animation.\r\n *\r\n * @name Phaser.Animations.Animation#key\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.key = key;\r\n\r\n /**\r\n * A frame based animation (as opposed to a bone based animation)\r\n *\r\n * @name Phaser.Animations.Animation#type\r\n * @type {string}\r\n * @default frame\r\n * @since 3.0.0\r\n */\r\n this.type = 'frame';\r\n\r\n /**\r\n * Extract all the frame data into the frames array.\r\n *\r\n * @name Phaser.Animations.Animation#frames\r\n * @type {Phaser.Animations.AnimationFrame[]}\r\n * @since 3.0.0\r\n */\r\n this.frames = this.getFrames(\r\n manager.textureManager,\r\n GetValue(config, 'frames', []),\r\n GetValue(config, 'defaultTextureKey', null)\r\n );\r\n\r\n /**\r\n * The frame rate of playback in frames per second (default 24 if duration is null)\r\n *\r\n * @name Phaser.Animations.Animation#frameRate\r\n * @type {integer}\r\n * @default 24\r\n * @since 3.0.0\r\n */\r\n this.frameRate = GetValue(config, 'frameRate', null);\r\n\r\n /**\r\n * How long the animation should play for, in milliseconds.\r\n * If the `frameRate` property has been set then it overrides this value,\r\n * otherwise the `frameRate` is derived from `duration`.\r\n *\r\n * @name Phaser.Animations.Animation#duration\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.duration = GetValue(config, 'duration', null);\r\n\r\n if (this.duration === null && this.frameRate === null)\r\n {\r\n // No duration or frameRate given, use default frameRate of 24fps\r\n this.frameRate = 24;\r\n this.duration = (this.frameRate / this.frames.length) * 1000;\r\n }\r\n else if (this.duration && this.frameRate === null)\r\n {\r\n // Duration given but no frameRate, so set the frameRate based on duration\r\n // I.e. 12 frames in the animation, duration = 4000 ms\r\n // So frameRate is 12 / (4000 / 1000) = 3 fps\r\n this.frameRate = this.frames.length / (this.duration / 1000);\r\n }\r\n else\r\n {\r\n // frameRate given, derive duration from it (even if duration also specified)\r\n // I.e. 15 frames in the animation, frameRate = 30 fps\r\n // So duration is 15 / 30 = 0.5 * 1000 (half a second, or 500ms)\r\n this.duration = (this.frames.length / this.frameRate) * 1000;\r\n }\r\n\r\n /**\r\n * How many ms per frame, not including frame specific modifiers.\r\n *\r\n * @name Phaser.Animations.Animation#msPerFrame\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.msPerFrame = 1000 / this.frameRate;\r\n\r\n /**\r\n * Skip frames if the time lags, or always advanced anyway?\r\n *\r\n * @name Phaser.Animations.Animation#skipMissedFrames\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.skipMissedFrames = GetValue(config, 'skipMissedFrames', true);\r\n\r\n /**\r\n * The delay in ms before the playback will begin.\r\n *\r\n * @name Phaser.Animations.Animation#delay\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.delay = GetValue(config, 'delay', 0);\r\n\r\n /**\r\n * Number of times to repeat the animation. Set to -1 to repeat forever.\r\n *\r\n * @name Phaser.Animations.Animation#repeat\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.repeat = GetValue(config, 'repeat', 0);\r\n\r\n /**\r\n * The delay in ms before the a repeat play starts.\r\n *\r\n * @name Phaser.Animations.Animation#repeatDelay\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.repeatDelay = GetValue(config, 'repeatDelay', 0);\r\n\r\n /**\r\n * Should the animation yoyo (reverse back down to the start) before repeating?\r\n *\r\n * @name Phaser.Animations.Animation#yoyo\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.yoyo = GetValue(config, 'yoyo', false);\r\n\r\n /**\r\n * Should the GameObject's `visible` property be set to `true` when the animation starts to play?\r\n *\r\n * @name Phaser.Animations.Animation#showOnStart\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.showOnStart = GetValue(config, 'showOnStart', false);\r\n\r\n /**\r\n * Should the GameObject's `visible` property be set to `false` when the animation finishes?\r\n *\r\n * @name Phaser.Animations.Animation#hideOnComplete\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.hideOnComplete = GetValue(config, 'hideOnComplete', false);\r\n\r\n /**\r\n * Global pause. All Game Objects using this Animation instance are impacted by this property.\r\n *\r\n * @name Phaser.Animations.Animation#paused\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.paused = false;\r\n\r\n this.manager.on(Events.PAUSE_ALL, this.pause, this);\r\n this.manager.on(Events.RESUME_ALL, this.resume, this);\r\n },\r\n\r\n /**\r\n * Add frames to the end of the animation.\r\n *\r\n * @method Phaser.Animations.Animation#addFrame\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - [description]\r\n *\r\n * @return {Phaser.Animations.Animation} This Animation object.\r\n */\r\n addFrame: function (config)\r\n {\r\n return this.addFrameAt(this.frames.length, config);\r\n },\r\n\r\n /**\r\n * Add frame/s into the animation.\r\n *\r\n * @method Phaser.Animations.Animation#addFrameAt\r\n * @since 3.0.0\r\n *\r\n * @param {integer} index - The index to insert the frame at within the animation.\r\n * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - [description]\r\n *\r\n * @return {Phaser.Animations.Animation} This Animation object.\r\n */\r\n addFrameAt: function (index, config)\r\n {\r\n var newFrames = this.getFrames(this.manager.textureManager, config);\r\n\r\n if (newFrames.length > 0)\r\n {\r\n if (index === 0)\r\n {\r\n this.frames = newFrames.concat(this.frames);\r\n }\r\n else if (index === this.frames.length)\r\n {\r\n this.frames = this.frames.concat(newFrames);\r\n }\r\n else\r\n {\r\n var pre = this.frames.slice(0, index);\r\n var post = this.frames.slice(index);\r\n\r\n this.frames = pre.concat(newFrames, post);\r\n }\r\n\r\n this.updateFrameSequence();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check if the given frame index is valid.\r\n *\r\n * @method Phaser.Animations.Animation#checkFrame\r\n * @since 3.0.0\r\n *\r\n * @param {integer} index - The index to be checked.\r\n *\r\n * @return {boolean} `true` if the index is valid, otherwise `false`.\r\n */\r\n checkFrame: function (index)\r\n {\r\n return (index >= 0 && index < this.frames.length);\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Animations.Animation#completeAnimation\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Components.Animation} component - [description]\r\n */\r\n completeAnimation: function (component)\r\n {\r\n if (this.hideOnComplete)\r\n {\r\n component.parent.visible = false;\r\n }\r\n\r\n component.stop();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Animations.Animation#getFirstTick\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Components.Animation} component - [description]\r\n * @param {boolean} [includeDelay=true] - [description]\r\n */\r\n getFirstTick: function (component, includeDelay)\r\n {\r\n if (includeDelay === undefined) { includeDelay = true; }\r\n\r\n // When is the first update due?\r\n component.accumulator = 0;\r\n component.nextTick = component.msPerFrame + component.currentFrame.duration;\r\n\r\n if (includeDelay)\r\n {\r\n component.nextTick += component._delay;\r\n }\r\n },\r\n\r\n /**\r\n * Returns the AnimationFrame at the provided index\r\n *\r\n * @method Phaser.Animations.Animation#getFrameAt\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {integer} index - The index in the AnimationFrame array\r\n *\r\n * @return {Phaser.Animations.AnimationFrame} The frame at the index provided from the animation sequence\r\n */\r\n getFrameAt: function (index)\r\n {\r\n return this.frames[index];\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Animations.Animation#getFrames\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.TextureManager} textureManager - [description]\r\n * @param {(string|Phaser.Types.Animations.AnimationFrame[])} frames - [description]\r\n * @param {string} [defaultTextureKey] - [description]\r\n *\r\n * @return {Phaser.Animations.AnimationFrame[]} [description]\r\n */\r\n getFrames: function (textureManager, frames, defaultTextureKey)\r\n {\r\n var out = [];\r\n var prev;\r\n var animationFrame;\r\n var index = 1;\r\n var i;\r\n var textureKey;\r\n\r\n // if frames is a string, we'll get all the frames from the texture manager as if it's a sprite sheet\r\n if (typeof frames === 'string')\r\n {\r\n textureKey = frames;\r\n\r\n var texture = textureManager.get(textureKey);\r\n var frameKeys = texture.getFrameNames();\r\n\r\n frames = [];\r\n\r\n frameKeys.forEach(function (idx, value)\r\n {\r\n frames.push({ key: textureKey, frame: value });\r\n });\r\n }\r\n\r\n if (!Array.isArray(frames) || frames.length === 0)\r\n {\r\n return out;\r\n }\r\n\r\n for (i = 0; i < frames.length; i++)\r\n {\r\n var item = frames[i];\r\n\r\n var key = GetValue(item, 'key', defaultTextureKey);\r\n\r\n if (!key)\r\n {\r\n continue;\r\n }\r\n\r\n // Could be an integer or a string\r\n var frame = GetValue(item, 'frame', 0);\r\n\r\n // The actual texture frame\r\n var textureFrame = textureManager.getFrame(key, frame);\r\n\r\n animationFrame = new Frame(key, frame, index, textureFrame);\r\n\r\n animationFrame.duration = GetValue(item, 'duration', 0);\r\n\r\n animationFrame.isFirst = (!prev);\r\n\r\n // The previously created animationFrame\r\n if (prev)\r\n {\r\n prev.nextFrame = animationFrame;\r\n\r\n animationFrame.prevFrame = prev;\r\n }\r\n\r\n out.push(animationFrame);\r\n\r\n prev = animationFrame;\r\n\r\n index++;\r\n }\r\n\r\n if (out.length > 0)\r\n {\r\n animationFrame.isLast = true;\r\n\r\n // Link them end-to-end, so they loop\r\n animationFrame.nextFrame = out[0];\r\n\r\n out[0].prevFrame = animationFrame;\r\n\r\n // Generate the progress data\r\n\r\n var slice = 1 / (out.length - 1);\r\n\r\n for (i = 0; i < out.length; i++)\r\n {\r\n out[i].progress = i * slice;\r\n }\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Animations.Animation#getNextTick\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Components.Animation} component - [description]\r\n */\r\n getNextTick: function (component)\r\n {\r\n // accumulator += delta * _timeScale\r\n // after a large delta surge (perf issue for example) we need to adjust for it here\r\n\r\n // When is the next update due?\r\n component.accumulator -= component.nextTick;\r\n\r\n component.nextTick = component.msPerFrame + component.currentFrame.duration;\r\n },\r\n\r\n /**\r\n * Loads the Animation values into the Animation Component.\r\n *\r\n * @method Phaser.Animations.Animation#load\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to load values into.\r\n * @param {integer} startFrame - The start frame of the animation to load.\r\n */\r\n load: function (component, startFrame)\r\n {\r\n if (startFrame >= this.frames.length)\r\n {\r\n startFrame = 0;\r\n }\r\n\r\n if (component.currentAnim !== this)\r\n {\r\n component.currentAnim = this;\r\n\r\n component.frameRate = this.frameRate;\r\n component.duration = this.duration;\r\n component.msPerFrame = this.msPerFrame;\r\n component.skipMissedFrames = this.skipMissedFrames;\r\n\r\n component._delay = this.delay;\r\n component._repeat = this.repeat;\r\n component._repeatDelay = this.repeatDelay;\r\n component._yoyo = this.yoyo;\r\n }\r\n\r\n var frame = this.frames[startFrame];\r\n\r\n if (startFrame === 0 && !component.forward)\r\n {\r\n frame = this.getLastFrame();\r\n }\r\n\r\n component.updateFrame(frame);\r\n },\r\n\r\n /**\r\n * Returns the frame closest to the given progress value between 0 and 1.\r\n *\r\n * @method Phaser.Animations.Animation#getFrameByProgress\r\n * @since 3.4.0\r\n *\r\n * @param {number} value - A value between 0 and 1.\r\n *\r\n * @return {Phaser.Animations.AnimationFrame} The frame closest to the given progress value.\r\n */\r\n getFrameByProgress: function (value)\r\n {\r\n value = Clamp(value, 0, 1);\r\n\r\n return FindClosestInSorted(value, this.frames, 'progress');\r\n },\r\n\r\n /**\r\n * Advance the animation frame.\r\n *\r\n * @method Phaser.Animations.Animation#nextFrame\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance.\r\n */\r\n nextFrame: function (component)\r\n {\r\n var frame = component.currentFrame;\r\n\r\n // TODO: Add frame skip support\r\n\r\n if (frame.isLast)\r\n {\r\n // We're at the end of the animation\r\n\r\n // Yoyo? (happens before repeat)\r\n if (component._yoyo)\r\n {\r\n this.handleYoyoFrame(component, false);\r\n }\r\n else if (component.repeatCounter > 0)\r\n {\r\n // Repeat (happens before complete)\r\n\r\n if (component._reverse && component.forward)\r\n {\r\n component.forward = false;\r\n }\r\n else\r\n {\r\n this.repeatAnimation(component);\r\n }\r\n }\r\n else\r\n {\r\n this.completeAnimation(component);\r\n }\r\n }\r\n else\r\n {\r\n this.updateAndGetNextTick(component, frame.nextFrame);\r\n }\r\n },\r\n\r\n /**\r\n * Handle the yoyo functionality in nextFrame and previousFrame methods.\r\n *\r\n * @method Phaser.Animations.Animation#handleYoyoFrame\r\n * @private\r\n * @since 3.12.0\r\n *\r\n * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance.\r\n * @param {boolean} isReverse - Is animation in reverse mode? (Default: false)\r\n */\r\n handleYoyoFrame: function (component, isReverse)\r\n {\r\n if (!isReverse) { isReverse = false; }\r\n\r\n if (component._reverse === !isReverse && component.repeatCounter > 0)\r\n {\r\n component.forward = isReverse;\r\n\r\n this.repeatAnimation(component);\r\n\r\n return;\r\n }\r\n\r\n if (component._reverse !== isReverse && component.repeatCounter === 0)\r\n {\r\n this.completeAnimation(component);\r\n\r\n return;\r\n }\r\n \r\n component.forward = isReverse;\r\n\r\n var frame = (isReverse) ? component.currentFrame.nextFrame : component.currentFrame.prevFrame;\r\n\r\n this.updateAndGetNextTick(component, frame);\r\n },\r\n\r\n /**\r\n * Returns the animation last frame.\r\n *\r\n * @method Phaser.Animations.Animation#getLastFrame\r\n * @since 3.12.0\r\n *\r\n * @return {Phaser.Animations.AnimationFrame} component - The Animation Last Frame.\r\n */\r\n getLastFrame: function ()\r\n {\r\n return this.frames[this.frames.length - 1];\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Animations.Animation#previousFrame\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Components.Animation} component - [description]\r\n */\r\n previousFrame: function (component)\r\n {\r\n var frame = component.currentFrame;\r\n\r\n // TODO: Add frame skip support\r\n\r\n if (frame.isFirst)\r\n {\r\n // We're at the start of the animation\r\n\r\n if (component._yoyo)\r\n {\r\n this.handleYoyoFrame(component, true);\r\n }\r\n else if (component.repeatCounter > 0)\r\n {\r\n if (component._reverse && !component.forward)\r\n {\r\n component.currentFrame = this.getLastFrame();\r\n this.repeatAnimation(component);\r\n }\r\n else\r\n {\r\n // Repeat (happens before complete)\r\n component.forward = true;\r\n this.repeatAnimation(component);\r\n }\r\n }\r\n else\r\n {\r\n this.completeAnimation(component);\r\n }\r\n }\r\n else\r\n {\r\n this.updateAndGetNextTick(component, frame.prevFrame);\r\n }\r\n },\r\n\r\n /**\r\n * Update Frame and Wait next tick.\r\n *\r\n * @method Phaser.Animations.Animation#updateAndGetNextTick\r\n * @private\r\n * @since 3.12.0\r\n *\r\n * @param {Phaser.Animations.AnimationFrame} frame - An Animation frame.\r\n */\r\n updateAndGetNextTick: function (component, frame)\r\n {\r\n component.updateFrame(frame);\r\n\r\n this.getNextTick(component);\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Animations.Animation#removeFrame\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Animations.AnimationFrame} frame - [description]\r\n *\r\n * @return {Phaser.Animations.Animation} This Animation object.\r\n */\r\n removeFrame: function (frame)\r\n {\r\n var index = this.frames.indexOf(frame);\r\n\r\n if (index !== -1)\r\n {\r\n this.removeFrameAt(index);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes a frame from the AnimationFrame array at the provided index\r\n * and updates the animation accordingly.\r\n *\r\n * @method Phaser.Animations.Animation#removeFrameAt\r\n * @since 3.0.0\r\n *\r\n * @param {integer} index - The index in the AnimationFrame array\r\n *\r\n * @return {Phaser.Animations.Animation} This Animation object.\r\n */\r\n removeFrameAt: function (index)\r\n {\r\n this.frames.splice(index, 1);\r\n\r\n this.updateFrameSequence();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Animations.Animation#repeatAnimation\r\n * @fires Phaser.Animations.Events#ANIMATION_REPEAT\r\n * @fires Phaser.Animations.Events#SPRITE_ANIMATION_REPEAT\r\n * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Components.Animation} component - [description]\r\n */\r\n repeatAnimation: function (component)\r\n {\r\n if (component._pendingStop === 2)\r\n {\r\n return this.completeAnimation(component);\r\n }\r\n\r\n if (component._repeatDelay > 0 && component.pendingRepeat === false)\r\n {\r\n component.pendingRepeat = true;\r\n component.accumulator -= component.nextTick;\r\n component.nextTick += component._repeatDelay;\r\n }\r\n else\r\n {\r\n component.repeatCounter--;\r\n\r\n component.updateFrame(component.currentFrame[(component.forward) ? 'nextFrame' : 'prevFrame']);\r\n\r\n if (component.isPlaying)\r\n {\r\n this.getNextTick(component);\r\n\r\n component.pendingRepeat = false;\r\n\r\n var frame = component.currentFrame;\r\n var parent = component.parent;\r\n\r\n this.emit(Events.ANIMATION_REPEAT, this, frame);\r\n\r\n parent.emit(Events.SPRITE_ANIMATION_KEY_REPEAT + this.key, this, frame, component.repeatCounter, parent);\r\n\r\n parent.emit(Events.SPRITE_ANIMATION_REPEAT, this, frame, component.repeatCounter, parent);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Sets the texture frame the animation uses for rendering.\r\n *\r\n * @method Phaser.Animations.Animation#setFrame\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Components.Animation} component - [description]\r\n */\r\n setFrame: function (component)\r\n {\r\n // Work out which frame should be set next on the child, and set it\r\n if (component.forward)\r\n {\r\n this.nextFrame(component);\r\n }\r\n else\r\n {\r\n this.previousFrame(component);\r\n }\r\n },\r\n\r\n /**\r\n * Converts the animation data to JSON.\r\n *\r\n * @method Phaser.Animations.Animation#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.Animations.JSONAnimation} [description]\r\n */\r\n toJSON: function ()\r\n {\r\n var output = {\r\n key: this.key,\r\n type: this.type,\r\n frames: [],\r\n frameRate: this.frameRate,\r\n duration: this.duration,\r\n skipMissedFrames: this.skipMissedFrames,\r\n delay: this.delay,\r\n repeat: this.repeat,\r\n repeatDelay: this.repeatDelay,\r\n yoyo: this.yoyo,\r\n showOnStart: this.showOnStart,\r\n hideOnComplete: this.hideOnComplete\r\n };\r\n\r\n this.frames.forEach(function (frame)\r\n {\r\n output.frames.push(frame.toJSON());\r\n });\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Animations.Animation#updateFrameSequence\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Animations.Animation} This Animation object.\r\n */\r\n updateFrameSequence: function ()\r\n {\r\n var len = this.frames.length;\r\n var slice = 1 / (len - 1);\r\n\r\n var frame;\r\n\r\n for (var i = 0; i < len; i++)\r\n {\r\n frame = this.frames[i];\r\n\r\n frame.index = i + 1;\r\n frame.isFirst = false;\r\n frame.isLast = false;\r\n frame.progress = i * slice;\r\n\r\n if (i === 0)\r\n {\r\n frame.isFirst = true;\r\n\r\n if (len === 1)\r\n {\r\n frame.isLast = true;\r\n frame.nextFrame = frame;\r\n frame.prevFrame = frame;\r\n }\r\n else\r\n {\r\n frame.isLast = false;\r\n frame.prevFrame = this.frames[len - 1];\r\n frame.nextFrame = this.frames[i + 1];\r\n }\r\n }\r\n else if (i === len - 1 && len > 1)\r\n {\r\n frame.isLast = true;\r\n frame.prevFrame = this.frames[len - 2];\r\n frame.nextFrame = this.frames[0];\r\n }\r\n else if (len > 1)\r\n {\r\n frame.prevFrame = this.frames[i - 1];\r\n frame.nextFrame = this.frames[i + 1];\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Animations.Animation#pause\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Animations.Animation} This Animation object.\r\n */\r\n pause: function ()\r\n {\r\n this.paused = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Animations.Animation#resume\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Animations.Animation} This Animation object.\r\n */\r\n resume: function ()\r\n {\r\n this.paused = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Animations.Animation#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.removeAllListeners();\r\n\r\n this.manager.off(Events.PAUSE_ALL, this.pause, this);\r\n this.manager.off(Events.RESUME_ALL, this.resume, this);\r\n\r\n this.manager.remove(this.key);\r\n\r\n for (var i = 0; i < this.frames.length; i++)\r\n {\r\n this.frames[i].destroy();\r\n }\r\n\r\n this.frames = [];\r\n\r\n this.manager = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Animation;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/Animation.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/AnimationFrame.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/animations/AnimationFrame.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single frame in an Animation sequence.\r\n *\r\n * An AnimationFrame consists of a reference to the Texture it uses for rendering, references to other\r\n * frames in the animation, and index data. It also has the ability to modify the animation timing.\r\n *\r\n * AnimationFrames are generated automatically by the Animation class.\r\n *\r\n * @class AnimationFrame\r\n * @memberof Phaser.Animations\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {string} textureKey - The key of the Texture this AnimationFrame uses.\r\n * @param {(string|integer)} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses.\r\n * @param {integer} index - The index of this AnimationFrame within the Animation sequence.\r\n * @param {Phaser.Textures.Frame} frame - A reference to the Texture Frame this AnimationFrame uses for rendering.\r\n */\r\nvar AnimationFrame = new Class({\r\n\r\n initialize:\r\n\r\n function AnimationFrame (textureKey, textureFrame, index, frame)\r\n {\r\n /**\r\n * The key of the Texture this AnimationFrame uses.\r\n *\r\n * @name Phaser.Animations.AnimationFrame#textureKey\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.textureKey = textureKey;\r\n\r\n /**\r\n * The key of the Frame within the Texture that this AnimationFrame uses.\r\n *\r\n * @name Phaser.Animations.AnimationFrame#textureFrame\r\n * @type {(string|integer)}\r\n * @since 3.0.0\r\n */\r\n this.textureFrame = textureFrame;\r\n\r\n /**\r\n * The index of this AnimationFrame within the Animation sequence.\r\n *\r\n * @name Phaser.Animations.AnimationFrame#index\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.index = index;\r\n\r\n /**\r\n * A reference to the Texture Frame this AnimationFrame uses for rendering.\r\n *\r\n * @name Phaser.Animations.AnimationFrame#frame\r\n * @type {Phaser.Textures.Frame}\r\n * @since 3.0.0\r\n */\r\n this.frame = frame;\r\n\r\n /**\r\n * Is this the first frame in an animation sequence?\r\n *\r\n * @name Phaser.Animations.AnimationFrame#isFirst\r\n * @type {boolean}\r\n * @default false\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.isFirst = false;\r\n\r\n /**\r\n * Is this the last frame in an animation sequence?\r\n *\r\n * @name Phaser.Animations.AnimationFrame#isLast\r\n * @type {boolean}\r\n * @default false\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.isLast = false;\r\n\r\n /**\r\n * A reference to the AnimationFrame that comes before this one in the animation, if any.\r\n *\r\n * @name Phaser.Animations.AnimationFrame#prevFrame\r\n * @type {?Phaser.Animations.AnimationFrame}\r\n * @default null\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.prevFrame = null;\r\n\r\n /**\r\n * A reference to the AnimationFrame that comes after this one in the animation, if any.\r\n *\r\n * @name Phaser.Animations.AnimationFrame#nextFrame\r\n * @type {?Phaser.Animations.AnimationFrame}\r\n * @default null\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.nextFrame = null;\r\n\r\n /**\r\n * Additional time (in ms) that this frame should appear for during playback.\r\n * The value is added onto the msPerFrame set by the animation.\r\n *\r\n * @name Phaser.Animations.AnimationFrame#duration\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.duration = 0;\r\n\r\n /**\r\n * What % through the animation does this frame come?\r\n * This value is generated when the animation is created and cached here.\r\n *\r\n * @name Phaser.Animations.AnimationFrame#progress\r\n * @type {number}\r\n * @default 0\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.progress = 0;\r\n },\r\n\r\n /**\r\n * Generates a JavaScript object suitable for converting to JSON.\r\n *\r\n * @method Phaser.Animations.AnimationFrame#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.Animations.JSONAnimationFrame} The AnimationFrame data.\r\n */\r\n toJSON: function ()\r\n {\r\n return {\r\n key: this.textureKey,\r\n frame: this.textureFrame,\r\n duration: this.duration\r\n };\r\n },\r\n\r\n /**\r\n * Destroys this object by removing references to external resources and callbacks.\r\n *\r\n * @method Phaser.Animations.AnimationFrame#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.frame = undefined;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = AnimationFrame;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/AnimationFrame.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/AnimationManager.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/animations/AnimationManager.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Animation = __webpack_require__(/*! ./Animation */ \"./node_modules/phaser/src/animations/Animation.js\");\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CustomMap = __webpack_require__(/*! ../structs/Map */ \"./node_modules/phaser/src/structs/Map.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/animations/events/index.js\");\r\nvar GameEvents = __webpack_require__(/*! ../core/events */ \"./node_modules/phaser/src/core/events/index.js\");\r\nvar GetValue = __webpack_require__(/*! ../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar Pad = __webpack_require__(/*! ../utils/string/Pad */ \"./node_modules/phaser/src/utils/string/Pad.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Animation Manager.\r\n *\r\n * Animations are managed by the global Animation Manager. This is a singleton class that is\r\n * responsible for creating and delivering animations and their corresponding data to all Game Objects.\r\n * Unlike plugins it is owned by the Game instance, not the Scene.\r\n *\r\n * Sprites and other Game Objects get the data they need from the AnimationManager.\r\n *\r\n * @class AnimationManager\r\n * @extends Phaser.Events.EventEmitter\r\n * @memberof Phaser.Animations\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - A reference to the Phaser.Game instance.\r\n */\r\nvar AnimationManager = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function AnimationManager (game)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * A reference to the Phaser.Game instance.\r\n *\r\n * @name Phaser.Animations.AnimationManager#game\r\n * @type {Phaser.Game}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.game = game;\r\n\r\n /**\r\n * A reference to the Texture Manager.\r\n *\r\n * @name Phaser.Animations.AnimationManager#textureManager\r\n * @type {Phaser.Textures.TextureManager}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.textureManager = null;\r\n\r\n /**\r\n * The global time scale of the Animation Manager.\r\n *\r\n * This scales the time delta between two frames, thus influencing the speed of time for the Animation Manager.\r\n *\r\n * @name Phaser.Animations.AnimationManager#globalTimeScale\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.globalTimeScale = 1;\r\n\r\n /**\r\n * The Animations registered in the Animation Manager.\r\n *\r\n * This map should be modified with the {@link #add} and {@link #create} methods of the Animation Manager.\r\n *\r\n * @name Phaser.Animations.AnimationManager#anims\r\n * @type {Phaser.Structs.Map.}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.anims = new CustomMap();\r\n\r\n /**\r\n * Whether the Animation Manager is paused along with all of its Animations.\r\n *\r\n * @name Phaser.Animations.AnimationManager#paused\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.paused = false;\r\n\r\n /**\r\n * The name of this Animation Manager.\r\n *\r\n * @name Phaser.Animations.AnimationManager#name\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.name = 'AnimationManager';\r\n\r\n game.events.once(GameEvents.BOOT, this.boot, this);\r\n },\r\n\r\n /**\r\n * Registers event listeners after the Game boots.\r\n *\r\n * @method Phaser.Animations.AnimationManager#boot\r\n * @listens Phaser.Core.Events#DESTROY\r\n * @since 3.0.0\r\n */\r\n boot: function ()\r\n {\r\n this.textureManager = this.game.textures;\r\n\r\n this.game.events.once(GameEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * Adds an existing Animation to the Animation Manager.\r\n *\r\n * @method Phaser.Animations.AnimationManager#add\r\n * @fires Phaser.Animations.Events#ADD_ANIMATION\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key under which the Animation should be added. The Animation will be updated with it. Must be unique.\r\n * @param {Phaser.Animations.Animation} animation - The Animation which should be added to the Animation Manager.\r\n *\r\n * @return {Phaser.Animations.AnimationManager} This Animation Manager.\r\n */\r\n add: function (key, animation)\r\n {\r\n if (this.anims.has(key))\r\n {\r\n console.warn('Animation key exists: ' + key);\r\n\r\n return;\r\n }\r\n\r\n animation.key = key;\r\n\r\n this.anims.set(key, animation);\r\n\r\n this.emit(Events.ADD_ANIMATION, key, animation);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Checks to see if the given key is already in use within the Animation Manager or not.\r\n * \r\n * Animations are global. Keys created in one scene can be used from any other Scene in your game. They are not Scene specific.\r\n *\r\n * @method Phaser.Animations.AnimationManager#exists\r\n * @since 3.16.0\r\n *\r\n * @param {string} key - The key of the Animation to check.\r\n *\r\n * @return {boolean} `true` if the Animation already exists in the Animation Manager, or `false` if the key is available.\r\n */\r\n exists: function (key)\r\n {\r\n return this.anims.has(key);\r\n },\r\n\r\n /**\r\n * Creates a new Animation and adds it to the Animation Manager.\r\n * \r\n * Animations are global. Once created, you can use them in any Scene in your game. They are not Scene specific.\r\n * \r\n * If an invalid key is given this method will return `false`.\r\n * \r\n * If you pass the key of an animation that already exists in the Animation Manager, that animation will be returned.\r\n * \r\n * A brand new animation is only created if the key is valid and not already in use.\r\n * \r\n * If you wish to re-use an existing key, call `AnimationManager.remove` first, then this method.\r\n *\r\n * @method Phaser.Animations.AnimationManager#create\r\n * @fires Phaser.Animations.Events#ADD_ANIMATION\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Animations.Animation} config - The configuration settings for the Animation.\r\n *\r\n * @return {(Phaser.Animations.Animation|false)} The Animation that was created, or `false` is the key is already in use.\r\n */\r\n create: function (config)\r\n {\r\n var key = config.key;\r\n\r\n var anim = false;\r\n\r\n if (key)\r\n {\r\n anim = this.get(key);\r\n\r\n if (!anim)\r\n {\r\n anim = new Animation(this, key, config);\r\n\r\n this.anims.set(key, anim);\r\n \r\n this.emit(Events.ADD_ANIMATION, key, anim);\r\n }\r\n }\r\n\r\n return anim;\r\n },\r\n\r\n /**\r\n * Loads this Animation Manager's Animations and settings from a JSON object.\r\n *\r\n * @method Phaser.Animations.AnimationManager#fromJSON\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Animations.JSONAnimations|Phaser.Types.Animations.JSONAnimation)} data - The JSON object to parse.\r\n * @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.\r\n *\r\n * @return {Phaser.Animations.Animation[]} An array containing all of the Animation objects that were created as a result of this call.\r\n */\r\n fromJSON: function (data, clearCurrentAnimations)\r\n {\r\n if (clearCurrentAnimations === undefined) { clearCurrentAnimations = false; }\r\n\r\n if (clearCurrentAnimations)\r\n {\r\n this.anims.clear();\r\n }\r\n\r\n // Do we have a String (i.e. from JSON, or an Object?)\r\n if (typeof data === 'string')\r\n {\r\n data = JSON.parse(data);\r\n }\r\n\r\n var output = [];\r\n\r\n // Array of animations, or a single animation?\r\n if (data.hasOwnProperty('anims') && Array.isArray(data.anims))\r\n {\r\n for (var i = 0; i < data.anims.length; i++)\r\n {\r\n output.push(this.create(data.anims[i]));\r\n }\r\n\r\n if (data.hasOwnProperty('globalTimeScale'))\r\n {\r\n this.globalTimeScale = data.globalTimeScale;\r\n }\r\n }\r\n else if (data.hasOwnProperty('key') && data.type === 'frame')\r\n {\r\n output.push(this.create(data));\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Animations.AnimationManager#generateFrameNames\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key for the texture containing the animation frames.\r\n * @param {Phaser.Types.Animations.GenerateFrameNames} [config] - The configuration object for the animation frame names.\r\n *\r\n * @return {Phaser.Types.Animations.AnimationFrame[]} The array of {@link Phaser.Types.Animations.AnimationFrame} objects.\r\n */\r\n generateFrameNames: function (key, config)\r\n {\r\n var prefix = GetValue(config, 'prefix', '');\r\n var start = GetValue(config, 'start', 0);\r\n var end = GetValue(config, 'end', 0);\r\n var suffix = GetValue(config, 'suffix', '');\r\n var zeroPad = GetValue(config, 'zeroPad', 0);\r\n var out = GetValue(config, 'outputArray', []);\r\n var frames = GetValue(config, 'frames', false);\r\n\r\n var texture = this.textureManager.get(key);\r\n\r\n if (!texture)\r\n {\r\n return out;\r\n }\r\n\r\n var diff = (start < end) ? 1 : -1;\r\n\r\n // Adjust because we use i !== end in the for loop\r\n end += diff;\r\n\r\n var i;\r\n var frame;\r\n\r\n if (!config)\r\n {\r\n // Use every frame in the atlas?\r\n frames = texture.getFrameNames();\r\n\r\n for (i = 0; i < frames.length; i++)\r\n {\r\n out.push({ key: key, frame: frames[i] });\r\n }\r\n }\r\n else if (Array.isArray(frames))\r\n {\r\n // Have they provided their own custom frame sequence array?\r\n for (i = 0; i < frames.length; i++)\r\n {\r\n frame = prefix + Pad(frames[i], zeroPad, '0', 1) + suffix;\r\n\r\n if (texture.has(frame))\r\n {\r\n out.push({ key: key, frame: frame });\r\n }\r\n }\r\n }\r\n else\r\n {\r\n for (i = start; i !== end; i += diff)\r\n {\r\n frame = prefix + Pad(i, zeroPad, '0', 1) + suffix;\r\n\r\n if (texture.has(frame))\r\n {\r\n out.push({ key: key, frame: frame });\r\n }\r\n }\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object.\r\n *\r\n * Generates objects with numbered frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNumbers}.\r\n *\r\n * @method Phaser.Animations.AnimationManager#generateFrameNumbers\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key for the texture containing the animation frames.\r\n * @param {Phaser.Types.Animations.GenerateFrameNumbers} config - The configuration object for the animation frames.\r\n *\r\n * @return {Phaser.Types.Animations.AnimationFrame[]} The array of {@link Phaser.Types.Animations.AnimationFrame} objects.\r\n */\r\n generateFrameNumbers: function (key, config)\r\n {\r\n var startFrame = GetValue(config, 'start', 0);\r\n var endFrame = GetValue(config, 'end', -1);\r\n var firstFrame = GetValue(config, 'first', false);\r\n var out = GetValue(config, 'outputArray', []);\r\n var frames = GetValue(config, 'frames', false);\r\n\r\n var texture = this.textureManager.get(key);\r\n\r\n if (!texture)\r\n {\r\n return out;\r\n }\r\n\r\n if (firstFrame && texture.has(firstFrame))\r\n {\r\n out.push({ key: key, frame: firstFrame });\r\n }\r\n\r\n var i;\r\n\r\n // Have they provided their own custom frame sequence array?\r\n if (Array.isArray(frames))\r\n {\r\n for (i = 0; i < frames.length; i++)\r\n {\r\n if (texture.has(frames[i]))\r\n {\r\n out.push({ key: key, frame: frames[i] });\r\n }\r\n }\r\n }\r\n else\r\n {\r\n // No endFrame then see if we can get it\r\n if (endFrame === -1)\r\n {\r\n endFrame = texture.frameTotal;\r\n }\r\n\r\n var diff = (startFrame < endFrame) ? 1 : -1;\r\n\r\n // Adjust because we use i !== end in the for loop\r\n endFrame += diff;\r\n\r\n for (i = startFrame; i !== endFrame; i += diff)\r\n {\r\n if (texture.has(i))\r\n {\r\n out.push({ key: key, frame: i });\r\n }\r\n }\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Get an Animation.\r\n *\r\n * @method Phaser.Animations.AnimationManager#get\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the Animation to retrieve.\r\n *\r\n * @return {Phaser.Animations.Animation} The Animation.\r\n */\r\n get: function (key)\r\n {\r\n return this.anims.get(key);\r\n },\r\n\r\n /**\r\n * Load an Animation into a Game Object's Animation Component.\r\n *\r\n * @method Phaser.Animations.AnimationManager#load\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to load the animation into.\r\n * @param {string} key - The key of the animation to load.\r\n * @param {(string|integer)} [startFrame] - The name of a start frame to set on the loaded animation.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object with the animation loaded into it.\r\n */\r\n load: function (child, key, startFrame)\r\n {\r\n var anim = this.get(key);\r\n\r\n if (anim)\r\n {\r\n anim.load(child, startFrame);\r\n }\r\n else\r\n {\r\n console.warn('Missing animation: ' + key);\r\n }\r\n\r\n return child;\r\n },\r\n\r\n /**\r\n * Pause all animations.\r\n *\r\n * @method Phaser.Animations.AnimationManager#pauseAll\r\n * @fires Phaser.Animations.Events#PAUSE_ALL\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Animations.AnimationManager} This Animation Manager.\r\n */\r\n pauseAll: function ()\r\n {\r\n if (!this.paused)\r\n {\r\n this.paused = true;\r\n\r\n this.emit(Events.PAUSE_ALL);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Play an animation on the given Game Objects that have an Animation Component.\r\n *\r\n * @method Phaser.Animations.AnimationManager#play\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the animation to play on the Game Object.\r\n * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Objects to play the animation on.\r\n *\r\n * @return {Phaser.Animations.AnimationManager} This Animation Manager.\r\n */\r\n play: function (key, child)\r\n {\r\n if (!Array.isArray(child))\r\n {\r\n child = [ child ];\r\n }\r\n\r\n var anim = this.get(key);\r\n\r\n if (!anim)\r\n {\r\n return;\r\n }\r\n\r\n for (var i = 0; i < child.length; i++)\r\n {\r\n child[i].anims.play(key);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Remove an animation.\r\n *\r\n * @method Phaser.Animations.AnimationManager#remove\r\n * @fires Phaser.Animations.Events#REMOVE_ANIMATION\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the animation to remove.\r\n *\r\n * @return {Phaser.Animations.Animation} [description]\r\n */\r\n remove: function (key)\r\n {\r\n var anim = this.get(key);\r\n\r\n if (anim)\r\n {\r\n this.emit(Events.REMOVE_ANIMATION, key, anim);\r\n\r\n this.anims.delete(key);\r\n }\r\n\r\n return anim;\r\n },\r\n\r\n /**\r\n * Resume all paused animations.\r\n *\r\n * @method Phaser.Animations.AnimationManager#resumeAll\r\n * @fires Phaser.Animations.Events#RESUME_ALL\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Animations.AnimationManager} This Animation Manager.\r\n */\r\n resumeAll: function ()\r\n {\r\n if (this.paused)\r\n {\r\n this.paused = false;\r\n\r\n this.emit(Events.RESUME_ALL);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes an array of Game Objects that have an Animation Component and then\r\n * starts the given animation playing on them, each one offset by the\r\n * `stagger` amount given to this method.\r\n *\r\n * @method Phaser.Animations.AnimationManager#staggerPlay\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\r\n *\r\n * @param {string} key - The key of the animation to play on the Game Objects.\r\n * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} children - An array of Game Objects to play the animation on. They must have an Animation Component.\r\n * @param {number} [stagger=0] - The amount of time, in milliseconds, to offset each play time by.\r\n *\r\n * @return {Phaser.Animations.AnimationManager} This Animation Manager.\r\n */\r\n staggerPlay: function (key, children, stagger)\r\n {\r\n if (stagger === undefined) { stagger = 0; }\r\n\r\n if (!Array.isArray(children))\r\n {\r\n children = [ children ];\r\n }\r\n\r\n var anim = this.get(key);\r\n\r\n if (!anim)\r\n {\r\n return;\r\n }\r\n\r\n for (var i = 0; i < children.length; i++)\r\n {\r\n children[i].anims.delayedPlay(stagger * i, key);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Get the animation data as javascript object by giving key, or get the data of all animations as array of objects, if key wasn't provided.\r\n *\r\n * @method Phaser.Animations.AnimationManager#toJSON\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - [description]\r\n *\r\n * @return {Phaser.Types.Animations.JSONAnimations} [description]\r\n */\r\n toJSON: function (key)\r\n {\r\n if (key !== undefined && key !== '')\r\n {\r\n return this.anims.get(key).toJSON();\r\n }\r\n else\r\n {\r\n var output = {\r\n anims: [],\r\n globalTimeScale: this.globalTimeScale\r\n };\r\n\r\n this.anims.each(function (animationKey, animation)\r\n {\r\n output.anims.push(animation.toJSON());\r\n });\r\n\r\n return output;\r\n }\r\n },\r\n\r\n /**\r\n * Destroy this Animation Manager and clean up animation definitions and references to other objects.\r\n * This method should not be called directly. It will be called automatically as a response to a `destroy` event from the Phaser.Game instance.\r\n *\r\n * @method Phaser.Animations.AnimationManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.anims.clear();\r\n\r\n this.textureManager = null;\r\n\r\n this.game = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = AnimationManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/AnimationManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/ADD_ANIMATION_EVENT.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/ADD_ANIMATION_EVENT.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Add Animation Event.\r\n * \r\n * This event is dispatched when a new animation is added to the global Animation Manager.\r\n * \r\n * This can happen either as a result of an animation instance being added to the Animation Manager,\r\n * or the Animation Manager creating a new animation directly.\r\n *\r\n * @event Phaser.Animations.Events#ADD_ANIMATION\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the Animation that was added to the global Animation Manager.\r\n * @param {Phaser.Animations.Animation} animation - An instance of the newly created Animation.\r\n */\r\nmodule.exports = 'add';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/ADD_ANIMATION_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/ANIMATION_COMPLETE_EVENT.js": /*!*******************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/ANIMATION_COMPLETE_EVENT.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Animation Complete Event.\r\n * \r\n * This event is dispatched by an Animation instance when it completes, i.e. finishes playing or is manually stopped.\r\n * \r\n * Be careful with the volume of events this could generate. If a group of Sprites all complete the same\r\n * animation at the same time, this event will invoke its handler for each one of them.\r\n *\r\n * @event Phaser.Animations.Events#ANIMATION_COMPLETE\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed.\r\n * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on.\r\n * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed.\r\n */\r\nmodule.exports = 'complete';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/ANIMATION_COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/ANIMATION_REPEAT_EVENT.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/ANIMATION_REPEAT_EVENT.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Animation Repeat Event.\r\n * \r\n * This event is dispatched when a currently playing animation repeats.\r\n * \r\n * The event is dispatched directly from the Animation object itself. Which means that listeners\r\n * bound to this event will be invoked every time the Animation repeats, for every Game Object that may have it.\r\n *\r\n * @event Phaser.Animations.Events#ANIMATION_REPEAT\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Animations.Animation} animation - A reference to the Animation that repeated.\r\n * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation was on when it repeated.\r\n */\r\nmodule.exports = 'repeat';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/ANIMATION_REPEAT_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/ANIMATION_RESTART_EVENT.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/ANIMATION_RESTART_EVENT.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Animation Restart Event.\r\n * \r\n * This event is dispatched by an Animation instance when it restarts.\r\n * \r\n * Be careful with the volume of events this could generate. If a group of Sprites all restart the same\r\n * animation at the same time, this event will invoke its handler for each one of them.\r\n *\r\n * @event Phaser.Animations.Events#ANIMATION_RESTART\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Animations.Animation} animation - A reference to the Animation that restarted playing.\r\n * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with.\r\n * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing.\r\n */\r\nmodule.exports = 'restart';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/ANIMATION_RESTART_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/ANIMATION_START_EVENT.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/ANIMATION_START_EVENT.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Animation Start Event.\r\n * \r\n * This event is dispatched by an Animation instance when it starts playing.\r\n * \r\n * Be careful with the volume of events this could generate. If a group of Sprites all play the same\r\n * animation at the same time, this event will invoke its handler for each one of them.\r\n *\r\n * @event Phaser.Animations.Events#ANIMATION_START\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Animations.Animation} animation - A reference to the Animation that started playing.\r\n * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with.\r\n * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing.\r\n */\r\nmodule.exports = 'start';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/ANIMATION_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/PAUSE_ALL_EVENT.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/PAUSE_ALL_EVENT.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pause All Animations Event.\r\n * \r\n * This event is dispatched when the global Animation Manager is told to pause.\r\n * \r\n * When this happens all current animations will stop updating, although it doesn't necessarily mean\r\n * that the game has paused as well.\r\n *\r\n * @event Phaser.Animations.Events#PAUSE_ALL\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'pauseall';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/PAUSE_ALL_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/REMOVE_ANIMATION_EVENT.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/REMOVE_ANIMATION_EVENT.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Remove Animation Event.\r\n * \r\n * This event is dispatched when an animation is removed from the global Animation Manager.\r\n *\r\n * @event Phaser.Animations.Events#REMOVE_ANIMATION\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the Animation that was removed from the global Animation Manager.\r\n * @param {Phaser.Animations.Animation} animation - An instance of the removed Animation.\r\n */\r\nmodule.exports = 'remove';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/REMOVE_ANIMATION_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/RESUME_ALL_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/RESUME_ALL_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Resume All Animations Event.\r\n * \r\n * This event is dispatched when the global Animation Manager resumes, having been previously paused.\r\n * \r\n * When this happens all current animations will continue updating again.\r\n *\r\n * @event Phaser.Animations.Events#RESUME_ALL\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'resumeall';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/RESUME_ALL_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_COMPLETE_EVENT.js": /*!**************************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_COMPLETE_EVENT.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sprite Animation Complete Event.\r\n * \r\n * This event is dispatched by a Sprite when an animation finishes playing on it.\r\n * \r\n * Listen for it on the Sprite using `sprite.on('animationcomplete', listener)`\r\n * \r\n * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_COMPLETE` event.\r\n *\r\n * @event Phaser.Animations.Events#SPRITE_ANIMATION_COMPLETE\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed.\r\n * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on.\r\n * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed.\r\n */\r\nmodule.exports = 'animationcomplete';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_COMPLETE_EVENT.js": /*!******************************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_COMPLETE_EVENT.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sprite Animation Key Complete Event.\r\n * \r\n * This event is dispatched by a Sprite when a specific animation finishes playing on it.\r\n * \r\n * Listen for it on the Sprite using `sprite.on('animationcomplete-key', listener)` where `key` is the key of\r\n * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationcomplete-explode`.\r\n *\r\n * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_COMPLETE\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed.\r\n * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on.\r\n * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed.\r\n */\r\nmodule.exports = 'animationcomplete-';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_REPEAT_EVENT.js": /*!****************************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_REPEAT_EVENT.js ***! \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sprite Animation Key Repeat Event.\r\n * \r\n * This event is dispatched by a Sprite when a specific animation repeats playing on it.\r\n * \r\n * Listen for it on the Sprite using `sprite.on('animationrepeat-key', listener)` where `key` is the key of\r\n * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrepeat-explode`.\r\n *\r\n * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Animations.Animation} animation - A reference to the Animation that is repeating on the Sprite.\r\n * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with.\r\n * @param {integer} repeatCount - The number of times the Animation has repeated so far.\r\n * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation repeated playing.\r\n */\r\nmodule.exports = 'animationrepeat-';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_REPEAT_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_RESTART_EVENT.js": /*!*****************************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_RESTART_EVENT.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sprite Animation Key Restart Event.\r\n * \r\n * This event is dispatched by a Sprite when a specific animation restarts playing on it.\r\n * \r\n * Listen for it on the Sprite using `sprite.on('animationrestart-key', listener)` where `key` is the key of\r\n * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrestart-explode`.\r\n *\r\n * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_RESTART\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was restarted on the Sprite.\r\n * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with.\r\n * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing.\r\n */\r\nmodule.exports = 'animationrestart-';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_RESTART_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_START_EVENT.js": /*!***************************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_START_EVENT.js ***! \***************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sprite Animation Key Start Event.\r\n * \r\n * This event is dispatched by a Sprite when a specific animation starts playing on it.\r\n * \r\n * Listen for it on the Sprite using `sprite.on('animationstart-key', listener)` where `key` is the key of\r\n * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationstart-explode`.\r\n *\r\n * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_START\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was started on the Sprite.\r\n * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with.\r\n * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing.\r\n */\r\nmodule.exports = 'animationstart-';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_UPDATE_EVENT.js": /*!****************************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_UPDATE_EVENT.js ***! \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sprite Animation Key Update Event.\r\n * \r\n * This event is dispatched by a Sprite when a specific animation playing on it updates. This happens when the animation changes frame,\r\n * based on the animation frame rate and other factors like `timeScale` and `delay`.\r\n * \r\n * Listen for it on the Sprite using `sprite.on('animationupdate-key', listener)` where `key` is the key of\r\n * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationupdate-explode`.\r\n *\r\n * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has updated on the Sprite.\r\n * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation.\r\n * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation updated.\r\n */\r\nmodule.exports = 'animationupdate-';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_UPDATE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_REPEAT_EVENT.js": /*!************************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_REPEAT_EVENT.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sprite Animation Repeat Event.\r\n * \r\n * This event is dispatched by a Sprite when an animation repeats playing on it.\r\n * \r\n * Listen for it on the Sprite using `sprite.on('animationrepeat', listener)`\r\n * \r\n * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_REPEAT` event.\r\n *\r\n * @event Phaser.Animations.Events#SPRITE_ANIMATION_REPEAT\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Animations.Animation} animation - A reference to the Animation that is repeating on the Sprite.\r\n * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with.\r\n * @param {integer} repeatCount - The number of times the Animation has repeated so far.\r\n * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation repeated playing.\r\n */\r\nmodule.exports = 'animationrepeat';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_REPEAT_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_RESTART_EVENT.js": /*!*************************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_RESTART_EVENT.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sprite Animation Restart Event.\r\n * \r\n * This event is dispatched by a Sprite when an animation restarts playing on it.\r\n * \r\n * Listen for it on the Sprite using `sprite.on('animationrestart', listener)`\r\n * \r\n * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_RESTART` event.\r\n *\r\n * @event Phaser.Animations.Events#SPRITE_ANIMATION_RESTART\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was restarted on the Sprite.\r\n * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with.\r\n * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing.\r\n */\r\nmodule.exports = 'animationrestart';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_RESTART_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_START_EVENT.js": /*!***********************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_START_EVENT.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sprite Animation Start Event.\r\n * \r\n * This event is dispatched by a Sprite when an animation starts playing on it.\r\n * \r\n * Listen for it on the Sprite using `sprite.on('animationstart', listener)`\r\n * \r\n * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_START` event.\r\n *\r\n * @event Phaser.Animations.Events#SPRITE_ANIMATION_START\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was started on the Sprite.\r\n * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with.\r\n * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing.\r\n */\r\nmodule.exports = 'animationstart';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_UPDATE_EVENT.js": /*!************************************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_UPDATE_EVENT.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sprite Animation Update Event.\r\n * \r\n * This event is dispatched by a Sprite when an animation playing on it updates. This happens when the animation changes frame,\r\n * based on the animation frame rate and other factors like `timeScale` and `delay`.\r\n * \r\n * Listen for it on the Sprite using `sprite.on('animationupdate', listener)`\r\n * \r\n * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_UPDATE` event.\r\n *\r\n * @event Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has updated on the Sprite.\r\n * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation.\r\n * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation updated.\r\n */\r\nmodule.exports = 'animationupdate';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_UPDATE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/events/index.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/animations/events/index.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Animations.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n ADD_ANIMATION: __webpack_require__(/*! ./ADD_ANIMATION_EVENT */ \"./node_modules/phaser/src/animations/events/ADD_ANIMATION_EVENT.js\"),\r\n ANIMATION_COMPLETE: __webpack_require__(/*! ./ANIMATION_COMPLETE_EVENT */ \"./node_modules/phaser/src/animations/events/ANIMATION_COMPLETE_EVENT.js\"),\r\n ANIMATION_REPEAT: __webpack_require__(/*! ./ANIMATION_REPEAT_EVENT */ \"./node_modules/phaser/src/animations/events/ANIMATION_REPEAT_EVENT.js\"),\r\n ANIMATION_RESTART: __webpack_require__(/*! ./ANIMATION_RESTART_EVENT */ \"./node_modules/phaser/src/animations/events/ANIMATION_RESTART_EVENT.js\"),\r\n ANIMATION_START: __webpack_require__(/*! ./ANIMATION_START_EVENT */ \"./node_modules/phaser/src/animations/events/ANIMATION_START_EVENT.js\"),\r\n PAUSE_ALL: __webpack_require__(/*! ./PAUSE_ALL_EVENT */ \"./node_modules/phaser/src/animations/events/PAUSE_ALL_EVENT.js\"),\r\n REMOVE_ANIMATION: __webpack_require__(/*! ./REMOVE_ANIMATION_EVENT */ \"./node_modules/phaser/src/animations/events/REMOVE_ANIMATION_EVENT.js\"),\r\n RESUME_ALL: __webpack_require__(/*! ./RESUME_ALL_EVENT */ \"./node_modules/phaser/src/animations/events/RESUME_ALL_EVENT.js\"),\r\n SPRITE_ANIMATION_COMPLETE: __webpack_require__(/*! ./SPRITE_ANIMATION_COMPLETE_EVENT */ \"./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_COMPLETE_EVENT.js\"),\r\n SPRITE_ANIMATION_KEY_COMPLETE: __webpack_require__(/*! ./SPRITE_ANIMATION_KEY_COMPLETE_EVENT */ \"./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_COMPLETE_EVENT.js\"),\r\n SPRITE_ANIMATION_KEY_REPEAT: __webpack_require__(/*! ./SPRITE_ANIMATION_KEY_REPEAT_EVENT */ \"./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_REPEAT_EVENT.js\"),\r\n SPRITE_ANIMATION_KEY_RESTART: __webpack_require__(/*! ./SPRITE_ANIMATION_KEY_RESTART_EVENT */ \"./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_RESTART_EVENT.js\"),\r\n SPRITE_ANIMATION_KEY_START: __webpack_require__(/*! ./SPRITE_ANIMATION_KEY_START_EVENT */ \"./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_START_EVENT.js\"),\r\n SPRITE_ANIMATION_KEY_UPDATE: __webpack_require__(/*! ./SPRITE_ANIMATION_KEY_UPDATE_EVENT */ \"./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_KEY_UPDATE_EVENT.js\"),\r\n SPRITE_ANIMATION_REPEAT: __webpack_require__(/*! ./SPRITE_ANIMATION_REPEAT_EVENT */ \"./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_REPEAT_EVENT.js\"),\r\n SPRITE_ANIMATION_RESTART: __webpack_require__(/*! ./SPRITE_ANIMATION_RESTART_EVENT */ \"./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_RESTART_EVENT.js\"),\r\n SPRITE_ANIMATION_START: __webpack_require__(/*! ./SPRITE_ANIMATION_START_EVENT */ \"./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_START_EVENT.js\"),\r\n SPRITE_ANIMATION_UPDATE: __webpack_require__(/*! ./SPRITE_ANIMATION_UPDATE_EVENT */ \"./node_modules/phaser/src/animations/events/SPRITE_ANIMATION_UPDATE_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/animations/index.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/animations/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Animations\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Animation: __webpack_require__(/*! ./Animation */ \"./node_modules/phaser/src/animations/Animation.js\"),\r\n AnimationFrame: __webpack_require__(/*! ./AnimationFrame */ \"./node_modules/phaser/src/animations/AnimationFrame.js\"),\r\n AnimationManager: __webpack_require__(/*! ./AnimationManager */ \"./node_modules/phaser/src/animations/AnimationManager.js\"),\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/animations/events/index.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/animations/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/cache/BaseCache.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/cache/BaseCache.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CustomMap = __webpack_require__(/*! ../structs/Map */ \"./node_modules/phaser/src/structs/Map.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/cache/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The BaseCache is a base Cache class that can be used for storing references to any kind of data.\r\n *\r\n * Data can be added, retrieved and removed based on the given keys.\r\n *\r\n * Keys are string-based.\r\n *\r\n * @class BaseCache\r\n * @memberof Phaser.Cache\r\n * @constructor\r\n * @since 3.0.0\r\n */\r\nvar BaseCache = new Class({\r\n\r\n initialize:\r\n\r\n function BaseCache ()\r\n {\r\n /**\r\n * The Map in which the cache objects are stored.\r\n *\r\n * You can query the Map directly or use the BaseCache methods.\r\n *\r\n * @name Phaser.Cache.BaseCache#entries\r\n * @type {Phaser.Structs.Map.}\r\n * @since 3.0.0\r\n */\r\n this.entries = new CustomMap();\r\n\r\n /**\r\n * An instance of EventEmitter used by the cache to emit related events.\r\n *\r\n * @name Phaser.Cache.BaseCache#events\r\n * @type {Phaser.Events.EventEmitter}\r\n * @since 3.0.0\r\n */\r\n this.events = new EventEmitter();\r\n },\r\n\r\n /**\r\n * Adds an item to this cache. The item is referenced by a unique string, which you are responsible\r\n * for setting and keeping track of. The item can only be retrieved by using this string.\r\n *\r\n * @method Phaser.Cache.BaseCache#add\r\n * @fires Phaser.Cache.Events#ADD\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique key by which the data added to the cache will be referenced.\r\n * @param {*} data - The data to be stored in the cache.\r\n *\r\n * @return {Phaser.Cache.BaseCache} This BaseCache object.\r\n */\r\n add: function (key, data)\r\n {\r\n this.entries.set(key, data);\r\n\r\n this.events.emit(Events.ADD, this, key, data);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Checks if this cache contains an item matching the given key.\r\n * This performs the same action as `BaseCache.exists`.\r\n *\r\n * @method Phaser.Cache.BaseCache#has\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique key of the item to be checked in this cache.\r\n *\r\n * @return {boolean} Returns `true` if the cache contains an item matching the given key, otherwise `false`.\r\n */\r\n has: function (key)\r\n {\r\n return this.entries.has(key);\r\n },\r\n\r\n /**\r\n * Checks if this cache contains an item matching the given key.\r\n * This performs the same action as `BaseCache.has` and is called directly by the Loader.\r\n *\r\n * @method Phaser.Cache.BaseCache#exists\r\n * @since 3.7.0\r\n *\r\n * @param {string} key - The unique key of the item to be checked in this cache.\r\n *\r\n * @return {boolean} Returns `true` if the cache contains an item matching the given key, otherwise `false`.\r\n */\r\n exists: function (key)\r\n {\r\n return this.entries.has(key);\r\n },\r\n\r\n /**\r\n * Gets an item from this cache based on the given key.\r\n *\r\n * @method Phaser.Cache.BaseCache#get\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique key of the item to be retrieved from this cache.\r\n *\r\n * @return {*} The item in the cache, or `null` if no item matching the given key was found.\r\n */\r\n get: function (key)\r\n {\r\n return this.entries.get(key);\r\n },\r\n\r\n /**\r\n * Removes and item from this cache based on the given key.\r\n *\r\n * If an entry matching the key is found it is removed from the cache and a `remove` event emitted.\r\n * No additional checks are done on the item removed. If other systems or parts of your game code\r\n * are relying on this item, it is up to you to sever those relationships prior to removing the item.\r\n *\r\n * @method Phaser.Cache.BaseCache#remove\r\n * @fires Phaser.Cache.Events#REMOVE\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique key of the item to remove from the cache.\r\n *\r\n * @return {Phaser.Cache.BaseCache} This BaseCache object.\r\n */\r\n remove: function (key)\r\n {\r\n var entry = this.get(key);\r\n\r\n if (entry)\r\n {\r\n this.entries.delete(key);\r\n\r\n this.events.emit(Events.REMOVE, this, key, entry.data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns all keys in use in this cache.\r\n *\r\n * @method Phaser.Cache.BaseCache#getKeys\r\n * @since 3.17.0\r\n *\r\n * @return {string[]} Array containing all the keys.\r\n */\r\n getKeys: function ()\r\n {\r\n return this.entries.keys();\r\n },\r\n\r\n /**\r\n * Destroys this cache and all items within it.\r\n *\r\n * @method Phaser.Cache.BaseCache#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.entries.clear();\r\n this.events.removeAllListeners();\r\n\r\n this.entries = null;\r\n this.events = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = BaseCache;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cache/BaseCache.js?"); /***/ }), /***/ "./node_modules/phaser/src/cache/CacheManager.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/cache/CacheManager.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BaseCache = __webpack_require__(/*! ./BaseCache */ \"./node_modules/phaser/src/cache/BaseCache.js\");\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GameEvents = __webpack_require__(/*! ../core/events */ \"./node_modules/phaser/src/core/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Cache Manager is the global cache owned and maintained by the Game instance.\r\n *\r\n * Various systems, such as the file Loader, rely on this cache in order to store the files\r\n * it has loaded. The manager itself doesn't store any files, but instead owns multiple BaseCache\r\n * instances, one per type of file. You can also add your own custom caches.\r\n *\r\n * @class CacheManager\r\n * @memberof Phaser.Cache\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - A reference to the Phaser.Game instance that owns this CacheManager.\r\n */\r\nvar CacheManager = new Class({\r\n\r\n initialize:\r\n\r\n function CacheManager (game)\r\n {\r\n /**\r\n * A reference to the Phaser.Game instance that owns this CacheManager.\r\n *\r\n * @name Phaser.Cache.CacheManager#game\r\n * @type {Phaser.Game}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.game = game;\r\n\r\n /**\r\n * A Cache storing all binary files, typically added via the Loader.\r\n *\r\n * @name Phaser.Cache.CacheManager#binary\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.0.0\r\n */\r\n this.binary = new BaseCache();\r\n\r\n /**\r\n * A Cache storing all bitmap font data files, typically added via the Loader.\r\n * Only the font data is stored in this cache, the textures are part of the Texture Manager.\r\n *\r\n * @name Phaser.Cache.CacheManager#bitmapFont\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.0.0\r\n */\r\n this.bitmapFont = new BaseCache();\r\n\r\n /**\r\n * A Cache storing all JSON data files, typically added via the Loader.\r\n *\r\n * @name Phaser.Cache.CacheManager#json\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.0.0\r\n */\r\n this.json = new BaseCache();\r\n\r\n /**\r\n * A Cache storing all physics data files, typically added via the Loader.\r\n *\r\n * @name Phaser.Cache.CacheManager#physics\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.0.0\r\n */\r\n this.physics = new BaseCache();\r\n\r\n /**\r\n * A Cache storing all shader source files, typically added via the Loader.\r\n *\r\n * @name Phaser.Cache.CacheManager#shader\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.0.0\r\n */\r\n this.shader = new BaseCache();\r\n\r\n /**\r\n * A Cache storing all non-streaming audio files, typically added via the Loader.\r\n *\r\n * @name Phaser.Cache.CacheManager#audio\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.0.0\r\n */\r\n this.audio = new BaseCache();\r\n\r\n /**\r\n * A Cache storing all non-streaming video files, typically added via the Loader.\r\n *\r\n * @name Phaser.Cache.CacheManager#video\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.20.0\r\n */\r\n this.video = new BaseCache();\r\n\r\n /**\r\n * A Cache storing all text files, typically added via the Loader.\r\n *\r\n * @name Phaser.Cache.CacheManager#text\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.0.0\r\n */\r\n this.text = new BaseCache();\r\n\r\n /**\r\n * A Cache storing all html files, typically added via the Loader.\r\n *\r\n * @name Phaser.Cache.CacheManager#html\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.12.0\r\n */\r\n this.html = new BaseCache();\r\n\r\n /**\r\n * A Cache storing all WaveFront OBJ files, typically added via the Loader.\r\n *\r\n * @name Phaser.Cache.CacheManager#obj\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.0.0\r\n */\r\n this.obj = new BaseCache();\r\n\r\n /**\r\n * A Cache storing all tilemap data files, typically added via the Loader.\r\n * Only the data is stored in this cache, the textures are part of the Texture Manager.\r\n *\r\n * @name Phaser.Cache.CacheManager#tilemap\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.0.0\r\n */\r\n this.tilemap = new BaseCache();\r\n\r\n /**\r\n * A Cache storing all xml data files, typically added via the Loader.\r\n *\r\n * @name Phaser.Cache.CacheManager#xml\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.0.0\r\n */\r\n this.xml = new BaseCache();\r\n\r\n /**\r\n * An object that contains your own custom BaseCache entries.\r\n * Add to this via the `addCustom` method.\r\n *\r\n * @name Phaser.Cache.CacheManager#custom\r\n * @type {Object.}\r\n * @since 3.0.0\r\n */\r\n this.custom = {};\r\n\r\n this.game.events.once(GameEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * Add your own custom Cache for storing your own files.\r\n * The cache will be available under `Cache.custom.key`.\r\n * The cache will only be created if the key is not already in use.\r\n *\r\n * @method Phaser.Cache.CacheManager#addCustom\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique key of your custom cache.\r\n *\r\n * @return {Phaser.Cache.BaseCache} A reference to the BaseCache that was created. If the key was already in use, a reference to the existing cache is returned instead.\r\n */\r\n addCustom: function (key)\r\n {\r\n if (!this.custom.hasOwnProperty(key))\r\n {\r\n this.custom[key] = new BaseCache();\r\n }\r\n\r\n return this.custom[key];\r\n },\r\n\r\n /**\r\n * Removes all entries from all BaseCaches and destroys all custom caches.\r\n *\r\n * @method Phaser.Cache.CacheManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n var keys = [\r\n 'binary',\r\n 'bitmapFont',\r\n 'json',\r\n 'physics',\r\n 'shader',\r\n 'audio',\r\n 'video',\r\n 'text',\r\n 'html',\r\n 'obj',\r\n 'tilemap',\r\n 'xml'\r\n ];\r\n\r\n for (var i = 0; i < keys.length; i++)\r\n {\r\n this[keys[i]].destroy();\r\n this[keys[i]] = null;\r\n }\r\n\r\n for (var key in this.custom)\r\n {\r\n this.custom[key].destroy();\r\n }\r\n\r\n this.custom = null;\r\n\r\n this.game = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = CacheManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cache/CacheManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/cache/events/ADD_EVENT.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/cache/events/ADD_EVENT.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Cache Add Event.\r\n * \r\n * This event is dispatched by any Cache that extends the BaseCache each time a new object is added to it.\r\n *\r\n * @event Phaser.Cache.Events#ADD\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Cache.BaseCache} cache - The cache to which the object was added.\r\n * @param {string} key - The key of the object added to the cache.\r\n * @param {*} object - A reference to the object that was added to the cache.\r\n */\r\nmodule.exports = 'add';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cache/events/ADD_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cache/events/REMOVE_EVENT.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/cache/events/REMOVE_EVENT.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Cache Remove Event.\r\n * \r\n * This event is dispatched by any Cache that extends the BaseCache each time an object is removed from it.\r\n *\r\n * @event Phaser.Cache.Events#REMOVE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Cache.BaseCache} cache - The cache from which the object was removed.\r\n * @param {string} key - The key of the object removed from the cache.\r\n * @param {*} object - A reference to the object that was removed from the cache.\r\n */\r\nmodule.exports = 'remove';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cache/events/REMOVE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cache/events/index.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/cache/events/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Cache.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n ADD: __webpack_require__(/*! ./ADD_EVENT */ \"./node_modules/phaser/src/cache/events/ADD_EVENT.js\"),\r\n REMOVE: __webpack_require__(/*! ./REMOVE_EVENT */ \"./node_modules/phaser/src/cache/events/REMOVE_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cache/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/cache/index.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/cache/index.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Cache\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BaseCache: __webpack_require__(/*! ./BaseCache */ \"./node_modules/phaser/src/cache/BaseCache.js\"),\r\n CacheManager: __webpack_require__(/*! ./CacheManager */ \"./node_modules/phaser/src/cache/CacheManager.js\"),\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/cache/events/index.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cache/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/BaseCamera.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/BaseCamera.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../../gameobjects/components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar DegToRad = __webpack_require__(/*! ../../math/DegToRad */ \"./node_modules/phaser/src/math/DegToRad.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/cameras/2d/events/index.js\");\r\nvar Rectangle = __webpack_require__(/*! ../../geom/rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar TransformMatrix = __webpack_require__(/*! ../../gameobjects/components/TransformMatrix */ \"./node_modules/phaser/src/gameobjects/components/TransformMatrix.js\");\r\nvar ValueToColor = __webpack_require__(/*! ../../display/color/ValueToColor */ \"./node_modules/phaser/src/display/color/ValueToColor.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Base Camera class.\r\n *\r\n * The Camera is the way in which all games are rendered in Phaser. They provide a view into your game world,\r\n * and can be positioned, rotated, zoomed and scrolled accordingly.\r\n *\r\n * A Camera consists of two elements: The viewport and the scroll values.\r\n *\r\n * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are\r\n * created the same size as your game, but their position and size can be set to anything. This means if you\r\n * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game,\r\n * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`).\r\n *\r\n * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this\r\n * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the\r\n * viewport, and changing the viewport has no impact on the scrolling.\r\n *\r\n * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method,\r\n * allowing you to filter Game Objects out on a per-Camera basis.\r\n * \r\n * The Base Camera is extended by the Camera class, which adds in special effects including Fade,\r\n * Flash and Camera Shake, as well as the ability to follow Game Objects.\r\n * \r\n * The Base Camera was introduced in Phaser 3.12. It was split off from the Camera class, to allow\r\n * you to isolate special effects as needed. Therefore the 'since' values for properties of this class relate\r\n * to when they were added to the Camera class.\r\n *\r\n * @class BaseCamera\r\n * @memberof Phaser.Cameras.Scene2D\r\n * @constructor\r\n * @since 3.12.0\r\n * \r\n * @extends Phaser.Events.EventEmitter\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {number} x - The x position of the Camera, relative to the top-left of the game canvas.\r\n * @param {number} y - The y position of the Camera, relative to the top-left of the game canvas.\r\n * @param {number} width - The width of the Camera, in pixels.\r\n * @param {number} height - The height of the Camera, in pixels.\r\n */\r\nvar BaseCamera = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n Mixins: [\r\n Components.Alpha,\r\n Components.Visible\r\n ],\r\n\r\n initialize:\r\n\r\n function BaseCamera (x, y, width, height)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = 0; }\r\n if (height === undefined) { height = 0; }\r\n\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * A reference to the Scene this camera belongs to.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene;\r\n\r\n /**\r\n * A reference to the Game Scene Manager.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#sceneManager\r\n * @type {Phaser.Scenes.SceneManager}\r\n * @since 3.12.0\r\n */\r\n this.sceneManager;\r\n\r\n /**\r\n * A reference to the Game Scale Manager.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#scaleManager\r\n * @type {Phaser.Scale.ScaleManager}\r\n * @since 3.16.0\r\n */\r\n this.scaleManager;\r\n\r\n /**\r\n * A reference to the Scene's Camera Manager to which this Camera belongs.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#cameraManager\r\n * @type {Phaser.Cameras.Scene2D.CameraManager}\r\n * @since 3.17.0\r\n */\r\n this.cameraManager;\r\n\r\n /**\r\n * The Camera ID. Assigned by the Camera Manager and used to handle camera exclusion.\r\n * This value is a bitmask.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#id\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.11.0\r\n */\r\n this.id = 0;\r\n\r\n /**\r\n * The name of the Camera. This is left empty for your own use.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#name\r\n * @type {string}\r\n * @default ''\r\n * @since 3.0.0\r\n */\r\n this.name = '';\r\n\r\n /**\r\n * This property is un-used in v3.16.\r\n * \r\n * The resolution of the Game, used in most Camera calculations.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#resolution\r\n * @type {number}\r\n * @readonly\r\n * @deprecated\r\n * @since 3.12.0\r\n */\r\n this.resolution = 1;\r\n\r\n /**\r\n * Should this camera round its pixel values to integers?\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#roundPixels\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.roundPixels = false;\r\n\r\n /**\r\n * Is this Camera visible or not?\r\n *\r\n * A visible camera will render and perform input tests.\r\n * An invisible camera will not render anything and will skip input tests.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#visible\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.10.0\r\n */\r\n\r\n /**\r\n * Is this Camera using a bounds to restrict scrolling movement?\r\n *\r\n * Set this property along with the bounds via `Camera.setBounds`.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#useBounds\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.useBounds = false;\r\n\r\n /**\r\n * The World View is a Rectangle that defines the area of the 'world' the Camera is currently looking at.\r\n * This factors in the Camera viewport size, zoom and scroll position and is updated in the Camera preRender step.\r\n * If you have enabled Camera bounds the worldview will be clamped to those bounds accordingly.\r\n * You can use it for culling or intersection checks.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#worldView\r\n * @type {Phaser.Geom.Rectangle}\r\n * @readonly\r\n * @since 3.11.0\r\n */\r\n this.worldView = new Rectangle();\r\n\r\n /**\r\n * Is this Camera dirty?\r\n * \r\n * A dirty Camera has had either its viewport size, bounds, scroll, rotation or zoom levels changed since the last frame.\r\n * \r\n * This flag is cleared during the `postRenderCamera` method of the renderer.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#dirty\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.11.0\r\n */\r\n this.dirty = true;\r\n\r\n /**\r\n * The x position of the Camera viewport, relative to the top-left of the game canvas.\r\n * The viewport is the area into which the camera renders.\r\n * To adjust the position the camera is looking at in the game world, see the `scrollX` value.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#x\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._x = x;\r\n\r\n /**\r\n * The y position of the Camera, relative to the top-left of the game canvas.\r\n * The viewport is the area into which the camera renders.\r\n * To adjust the position the camera is looking at in the game world, see the `scrollY` value.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#y\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._y = y;\r\n\r\n /**\r\n * Internal Camera X value multiplied by the resolution.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#_cx\r\n * @type {number}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._cx = 0;\r\n\r\n /**\r\n * Internal Camera Y value multiplied by the resolution.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#_cy\r\n * @type {number}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._cy = 0;\r\n\r\n /**\r\n * Internal Camera Width value multiplied by the resolution.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#_cw\r\n * @type {number}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._cw = 0;\r\n\r\n /**\r\n * Internal Camera Height value multiplied by the resolution.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#_ch\r\n * @type {number}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._ch = 0;\r\n\r\n /**\r\n * The width of the Camera viewport, in pixels.\r\n *\r\n * The viewport is the area into which the Camera renders. Setting the viewport does\r\n * not restrict where the Camera can scroll to.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#_width\r\n * @type {number}\r\n * @private\r\n * @since 3.11.0\r\n */\r\n this._width = width;\r\n\r\n /**\r\n * The height of the Camera viewport, in pixels.\r\n *\r\n * The viewport is the area into which the Camera renders. Setting the viewport does\r\n * not restrict where the Camera can scroll to.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#_height\r\n * @type {number}\r\n * @private\r\n * @since 3.11.0\r\n */\r\n this._height = height;\r\n\r\n /**\r\n * The bounds the camera is restrained to during scrolling.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#_bounds\r\n * @type {Phaser.Geom.Rectangle}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._bounds = new Rectangle();\r\n\r\n /**\r\n * The horizontal scroll position of this Camera.\r\n *\r\n * Change this value to cause the Camera to scroll around your Scene.\r\n *\r\n * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method,\r\n * will automatically adjust the Camera scroll values accordingly.\r\n *\r\n * You can set the bounds within which the Camera can scroll via the `setBounds` method.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#_scrollX\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.11.0\r\n */\r\n this._scrollX = 0;\r\n\r\n /**\r\n * The vertical scroll position of this Camera.\r\n *\r\n * Change this value to cause the Camera to scroll around your Scene.\r\n *\r\n * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method,\r\n * will automatically adjust the Camera scroll values accordingly.\r\n *\r\n * You can set the bounds within which the Camera can scroll via the `setBounds` method.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#_scrollY\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.11.0\r\n */\r\n this._scrollY = 0;\r\n\r\n /**\r\n * The Camera zoom value. Change this value to zoom in, or out of, a Scene.\r\n *\r\n * A value of 0.5 would zoom the Camera out, so you can now see twice as much\r\n * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel\r\n * now takes up 2 pixels when rendered.\r\n *\r\n * Set to 1 to return to the default zoom level.\r\n *\r\n * Be careful to never set this value to zero.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#_zoom\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.11.0\r\n */\r\n this._zoom = 1;\r\n\r\n /**\r\n * The rotation of the Camera in radians.\r\n *\r\n * Camera rotation always takes place based on the Camera viewport. By default, rotation happens\r\n * in the center of the viewport. You can adjust this with the `originX` and `originY` properties.\r\n *\r\n * Rotation influences the rendering of _all_ Game Objects visible by this Camera. However, it does not\r\n * rotate the Camera viewport itself, which always remains an axis-aligned rectangle.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#_rotation\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.11.0\r\n */\r\n this._rotation = 0;\r\n\r\n /**\r\n * A local transform matrix used for internal calculations.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#matrix\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.matrix = new TransformMatrix();\r\n\r\n /**\r\n * Does this Camera have a transparent background?\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#transparent\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.transparent = true;\r\n\r\n /**\r\n * The background color of this Camera. Only used if `transparent` is `false`.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#backgroundColor\r\n * @type {Phaser.Display.Color}\r\n * @since 3.0.0\r\n */\r\n this.backgroundColor = ValueToColor('rgba(0,0,0,0)');\r\n\r\n /**\r\n * The Camera alpha value. Setting this property impacts every single object that this Camera\r\n * renders. You can either set the property directly, i.e. via a Tween, to fade a Camera in or out,\r\n * or via the chainable `setAlpha` method instead.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#alpha\r\n * @type {number}\r\n * @default 1\r\n * @since 3.11.0\r\n */\r\n\r\n /**\r\n * Should the camera cull Game Objects before checking them for input hit tests?\r\n * In some special cases it may be beneficial to disable this.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#disableCull\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.disableCull = false;\r\n\r\n /**\r\n * A temporary array of culled objects.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#culledObjects\r\n * @type {Phaser.GameObjects.GameObject[]}\r\n * @default []\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.culledObjects = [];\r\n\r\n /**\r\n * The mid-point of the Camera in 'world' coordinates.\r\n *\r\n * Use it to obtain exactly where in the world the center of the camera is currently looking.\r\n *\r\n * This value is updated in the preRender method, after the scroll values and follower\r\n * have been processed.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#midPoint\r\n * @type {Phaser.Math.Vector2}\r\n * @readonly\r\n * @since 3.11.0\r\n */\r\n this.midPoint = new Vector2(width / 2, height / 2);\r\n\r\n /**\r\n * The horizontal origin of rotation for this Camera.\r\n *\r\n * By default the camera rotates around the center of the viewport.\r\n *\r\n * Changing the origin allows you to adjust the point in the viewport from which rotation happens.\r\n * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right.\r\n *\r\n * See `setOrigin` to set both origins in a single, chainable call.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#originX\r\n * @type {number}\r\n * @default 0.5\r\n * @since 3.11.0\r\n */\r\n this.originX = 0.5;\r\n\r\n /**\r\n * The vertical origin of rotation for this Camera.\r\n *\r\n * By default the camera rotates around the center of the viewport.\r\n *\r\n * Changing the origin allows you to adjust the point in the viewport from which rotation happens.\r\n * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right.\r\n *\r\n * See `setOrigin` to set both origins in a single, chainable call.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#originY\r\n * @type {number}\r\n * @default 0.5\r\n * @since 3.11.0\r\n */\r\n this.originY = 0.5;\r\n\r\n /**\r\n * Does this Camera have a custom viewport?\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#_customViewport\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.12.0\r\n */\r\n this._customViewport = false;\r\n\r\n /**\r\n * The Mask this Camera is using during render.\r\n * Set the mask using the `setMask` method. Remove the mask using the `clearMask` method.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#mask\r\n * @type {?(Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask)}\r\n * @since 3.17.0\r\n */\r\n this.mask = null;\r\n\r\n /**\r\n * The Camera that this Camera uses for translation during masking.\r\n * \r\n * If the mask is fixed in position this will be a reference to\r\n * the CameraManager.default instance. Otherwise, it'll be a reference\r\n * to itself.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#_maskCamera\r\n * @type {?Phaser.Cameras.Scene2D.BaseCamera}\r\n * @private\r\n * @since 3.17.0\r\n */\r\n this._maskCamera = null;\r\n },\r\n\r\n /**\r\n * Set the Alpha level of this Camera. The alpha controls the opacity of the Camera as it renders.\r\n * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setAlpha\r\n * @since 3.11.0\r\n *\r\n * @param {number} [value=1] - The Camera alpha value.\r\n *\r\n * @return {this} This Camera instance.\r\n */\r\n\r\n /**\r\n * Sets the rotation origin of this Camera.\r\n *\r\n * The values are given in the range 0 to 1 and are only used when calculating Camera rotation.\r\n *\r\n * By default the camera rotates around the center of the viewport.\r\n *\r\n * Changing the origin allows you to adjust the point in the viewport from which rotation happens.\r\n * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setOrigin\r\n * @since 3.11.0\r\n *\r\n * @param {number} [x=0.5] - The horizontal origin value.\r\n * @param {number} [y=x] - The vertical origin value. If not defined it will be set to the value of `x`.\r\n *\r\n * @return {this} This Camera instance.\r\n */\r\n setOrigin: function (x, y)\r\n {\r\n if (x === undefined) { x = 0.5; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.originX = x;\r\n this.originY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculates what the Camera.scrollX and scrollY values would need to be in order to move\r\n * the Camera so it is centered on the given x and y coordinates, without actually moving\r\n * the Camera there. The results are clamped based on the Camera bounds, if set.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#getScroll\r\n * @since 3.11.0\r\n *\r\n * @param {number} x - The horizontal coordinate to center on.\r\n * @param {number} y - The vertical coordinate to center on.\r\n * @param {Phaser.Math.Vector2} [out] - A Vector2 to store the values in. If not given a new Vector2 is created.\r\n *\r\n * @return {Phaser.Math.Vector2} The scroll coordinates stored in the `x` and `y` properties.\r\n */\r\n getScroll: function (x, y, out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n var originX = this.width * 0.5;\r\n var originY = this.height * 0.5;\r\n\r\n out.x = x - originX;\r\n out.y = y - originY;\r\n\r\n if (this.useBounds)\r\n {\r\n out.x = this.clampX(out.x);\r\n out.y = this.clampY(out.y);\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Moves the Camera horizontally so that it is centered on the given x coordinate, bounds allowing.\r\n * Calling this does not change the scrollY value.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#centerOnX\r\n * @since 3.16.0\r\n *\r\n * @param {number} x - The horizontal coordinate to center on.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n centerOnX: function (x)\r\n {\r\n var originX = this.width * 0.5;\r\n\r\n this.midPoint.x = x;\r\n\r\n this.scrollX = x - originX;\r\n\r\n if (this.useBounds)\r\n {\r\n this.scrollX = this.clampX(this.scrollX);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves the Camera vertically so that it is centered on the given y coordinate, bounds allowing.\r\n * Calling this does not change the scrollX value.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#centerOnY\r\n * @since 3.16.0\r\n *\r\n * @param {number} y - The vertical coordinate to center on.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n centerOnY: function (y)\r\n {\r\n var originY = this.height * 0.5;\r\n\r\n this.midPoint.y = y;\r\n\r\n this.scrollY = y - originY;\r\n\r\n if (this.useBounds)\r\n {\r\n this.scrollY = this.clampY(this.scrollY);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves the Camera so that it is centered on the given coordinates, bounds allowing.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#centerOn\r\n * @since 3.11.0\r\n *\r\n * @param {number} x - The horizontal coordinate to center on.\r\n * @param {number} y - The vertical coordinate to center on.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n centerOn: function (x, y)\r\n {\r\n this.centerOnX(x);\r\n this.centerOnY(y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves the Camera so that it is looking at the center of the Camera Bounds, if enabled.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#centerToBounds\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n centerToBounds: function ()\r\n {\r\n if (this.useBounds)\r\n {\r\n var bounds = this._bounds;\r\n var originX = this.width * 0.5;\r\n var originY = this.height * 0.5;\r\n\r\n this.midPoint.set(bounds.centerX, bounds.centerY);\r\n\r\n this.scrollX = bounds.centerX - originX;\r\n this.scrollY = bounds.centerY - originY;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves the Camera so that it is re-centered based on its viewport size.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#centerToSize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n centerToSize: function ()\r\n {\r\n this.scrollX = this.width * 0.5;\r\n this.scrollY = this.height * 0.5;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes an array of Game Objects and returns a new array featuring only those objects\r\n * visible by this camera.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#cull\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject[]} G - [renderableObjects,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject[]} renderableObjects - An array of Game Objects to cull.\r\n *\r\n * @return {Phaser.GameObjects.GameObject[]} An array of Game Objects visible to this Camera.\r\n */\r\n cull: function (renderableObjects)\r\n {\r\n if (this.disableCull)\r\n {\r\n return renderableObjects;\r\n }\r\n\r\n var cameraMatrix = this.matrix.matrix;\r\n\r\n var mva = cameraMatrix[0];\r\n var mvb = cameraMatrix[1];\r\n var mvc = cameraMatrix[2];\r\n var mvd = cameraMatrix[3];\r\n\r\n /* First Invert Matrix */\r\n var determinant = (mva * mvd) - (mvb * mvc);\r\n\r\n if (!determinant)\r\n {\r\n return renderableObjects;\r\n }\r\n\r\n var mve = cameraMatrix[4];\r\n var mvf = cameraMatrix[5];\r\n\r\n var scrollX = this.scrollX;\r\n var scrollY = this.scrollY;\r\n var cameraW = this.width;\r\n var cameraH = this.height;\r\n var culledObjects = this.culledObjects;\r\n var length = renderableObjects.length;\r\n\r\n determinant = 1 / determinant;\r\n\r\n culledObjects.length = 0;\r\n\r\n for (var index = 0; index < length; ++index)\r\n {\r\n var object = renderableObjects[index];\r\n\r\n if (!object.hasOwnProperty('width') || object.parentContainer)\r\n {\r\n culledObjects.push(object);\r\n continue;\r\n }\r\n\r\n var objectW = object.width;\r\n var objectH = object.height;\r\n var objectX = (object.x - (scrollX * object.scrollFactorX)) - (objectW * object.originX);\r\n var objectY = (object.y - (scrollY * object.scrollFactorY)) - (objectH * object.originY);\r\n var tx = (objectX * mva + objectY * mvc + mve);\r\n var ty = (objectX * mvb + objectY * mvd + mvf);\r\n var tw = ((objectX + objectW) * mva + (objectY + objectH) * mvc + mve);\r\n var th = ((objectX + objectW) * mvb + (objectY + objectH) * mvd + mvf);\r\n var cullTop = this.y;\r\n var cullBottom = cullTop + cameraH;\r\n var cullLeft = this.x;\r\n var cullRight = cullLeft + cameraW;\r\n\r\n if ((tw > cullLeft && tx < cullRight) && (th > cullTop && ty < cullBottom))\r\n {\r\n culledObjects.push(object);\r\n }\r\n }\r\n\r\n return culledObjects;\r\n },\r\n\r\n /**\r\n * Converts the given `x` and `y` coordinates into World space, based on this Cameras transform.\r\n * You can optionally provide a Vector2, or similar object, to store the results in.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#getWorldPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {number} x - The x position to convert to world space.\r\n * @param {number} y - The y position to convert to world space.\r\n * @param {(object|Phaser.Math.Vector2)} [output] - An optional object to store the results in. If not provided a new Vector2 will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} An object holding the converted values in its `x` and `y` properties.\r\n */\r\n getWorldPoint: function (x, y, output)\r\n {\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n var cameraMatrix = this.matrix.matrix;\r\n\r\n var mva = cameraMatrix[0];\r\n var mvb = cameraMatrix[1];\r\n var mvc = cameraMatrix[2];\r\n var mvd = cameraMatrix[3];\r\n var mve = cameraMatrix[4];\r\n var mvf = cameraMatrix[5];\r\n\r\n // Invert Matrix\r\n var determinant = (mva * mvd) - (mvb * mvc);\r\n\r\n if (!determinant)\r\n {\r\n output.x = x;\r\n output.y = y;\r\n\r\n return output;\r\n }\r\n\r\n determinant = 1 / determinant;\r\n\r\n var ima = mvd * determinant;\r\n var imb = -mvb * determinant;\r\n var imc = -mvc * determinant;\r\n var imd = mva * determinant;\r\n var ime = (mvc * mvf - mvd * mve) * determinant;\r\n var imf = (mvb * mve - mva * mvf) * determinant;\r\n\r\n var c = Math.cos(this.rotation);\r\n var s = Math.sin(this.rotation);\r\n\r\n var zoom = this.zoom;\r\n var res = this.resolution;\r\n\r\n var scrollX = this.scrollX;\r\n var scrollY = this.scrollY;\r\n\r\n // Works for zoom of 1 with any resolution, but resolution > 1 and zoom !== 1 breaks\r\n var sx = x + ((scrollX * c - scrollY * s) * zoom);\r\n var sy = y + ((scrollX * s + scrollY * c) * zoom);\r\n\r\n // Apply transform to point\r\n output.x = (sx * ima + sy * imc) * res + ime;\r\n output.y = (sx * imb + sy * imd) * res + imf;\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Given a Game Object, or an array of Game Objects, it will update all of their camera filter settings\r\n * so that they are ignored by this Camera. This means they will not be rendered by this Camera.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#ignore\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group)} entries - The Game Object, or array of Game Objects, to be ignored by this Camera.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n ignore: function (entries)\r\n {\r\n var id = this.id;\r\n\r\n if (!Array.isArray(entries))\r\n {\r\n entries = [ entries ];\r\n }\r\n\r\n for (var i = 0; i < entries.length; i++)\r\n {\r\n var entry = entries[i];\r\n\r\n if (Array.isArray(entry))\r\n {\r\n this.ignore(entry);\r\n }\r\n else if (entry.isParent)\r\n {\r\n this.ignore(entry.getChildren());\r\n }\r\n else\r\n {\r\n entry.cameraFilter |= id;\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal preRender step.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#preRender\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {number} resolution - The game resolution, as set in the Scale Manager.\r\n */\r\n preRender: function (resolution)\r\n {\r\n var width = this.width;\r\n var height = this.height;\r\n\r\n var halfWidth = width * 0.5;\r\n var halfHeight = height * 0.5;\r\n\r\n var zoom = this.zoom * resolution;\r\n var matrix = this.matrix;\r\n\r\n var originX = width * this.originX;\r\n var originY = height * this.originY;\r\n\r\n var sx = this.scrollX;\r\n var sy = this.scrollY;\r\n\r\n if (this.useBounds)\r\n {\r\n sx = this.clampX(sx);\r\n sy = this.clampY(sy);\r\n }\r\n\r\n if (this.roundPixels)\r\n {\r\n originX = Math.round(originX);\r\n originY = Math.round(originY);\r\n }\r\n\r\n // Values are in pixels and not impacted by zooming the Camera\r\n this.scrollX = sx;\r\n this.scrollY = sy;\r\n\r\n var midX = sx + halfWidth;\r\n var midY = sy + halfHeight;\r\n\r\n // The center of the camera, in world space, so taking zoom into account\r\n // Basically the pixel value of what it's looking at in the middle of the cam\r\n this.midPoint.set(midX, midY);\r\n\r\n var displayWidth = width / zoom;\r\n var displayHeight = height / zoom;\r\n\r\n this.worldView.setTo(\r\n midX - (displayWidth / 2),\r\n midY - (displayHeight / 2),\r\n displayWidth,\r\n displayHeight\r\n );\r\n\r\n matrix.applyITRS(this.x + originX, this.y + originY, this.rotation, zoom, zoom);\r\n matrix.translate(-originX, -originY);\r\n },\r\n\r\n /**\r\n * Takes an x value and checks it's within the range of the Camera bounds, adjusting if required.\r\n * Do not call this method if you are not using camera bounds.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#clampX\r\n * @since 3.11.0\r\n *\r\n * @param {number} x - The value to horizontally scroll clamp.\r\n *\r\n * @return {number} The adjusted value to use as scrollX.\r\n */\r\n clampX: function (x)\r\n {\r\n var bounds = this._bounds;\r\n\r\n var dw = this.displayWidth;\r\n\r\n var bx = bounds.x + ((dw - this.width) / 2);\r\n var bw = Math.max(bx, bx + bounds.width - dw);\r\n\r\n if (x < bx)\r\n {\r\n x = bx;\r\n }\r\n else if (x > bw)\r\n {\r\n x = bw;\r\n }\r\n\r\n return x;\r\n },\r\n\r\n /**\r\n * Takes a y value and checks it's within the range of the Camera bounds, adjusting if required.\r\n * Do not call this method if you are not using camera bounds.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#clampY\r\n * @since 3.11.0\r\n *\r\n * @param {number} y - The value to vertically scroll clamp.\r\n *\r\n * @return {number} The adjusted value to use as scrollY.\r\n */\r\n clampY: function (y)\r\n {\r\n var bounds = this._bounds;\r\n\r\n var dh = this.displayHeight;\r\n\r\n var by = bounds.y + ((dh - this.height) / 2);\r\n var bh = Math.max(by, by + bounds.height - dh);\r\n\r\n if (y < by)\r\n {\r\n y = by;\r\n }\r\n else if (y > bh)\r\n {\r\n y = bh;\r\n }\r\n\r\n return y;\r\n },\r\n\r\n /*\r\n var gap = this._zoomInversed;\r\n return gap * Math.round((src.x - this.scrollX * src.scrollFactorX) / gap);\r\n */\r\n\r\n /**\r\n * If this Camera has previously had movement bounds set on it, this will remove them.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#removeBounds\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n removeBounds: function ()\r\n {\r\n this.useBounds = false;\r\n\r\n this.dirty = true;\r\n\r\n this._bounds.setEmpty();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the rotation of this Camera. This causes everything it renders to appear rotated.\r\n *\r\n * Rotating a camera does not rotate the viewport itself, it is applied during rendering.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setAngle\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The cameras angle of rotation, given in degrees.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n setAngle: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.rotation = DegToRad(value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the background color for this Camera.\r\n *\r\n * By default a Camera has a transparent background but it can be given a solid color, with any level\r\n * of transparency, via this method.\r\n *\r\n * The color value can be specified using CSS color notation, hex or numbers.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setBackgroundColor\r\n * @since 3.0.0\r\n *\r\n * @param {(string|number|Phaser.Types.Display.InputColorObject)} [color='rgba(0,0,0,0)'] - The color value. In CSS, hex or numeric color notation.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n setBackgroundColor: function (color)\r\n {\r\n if (color === undefined) { color = 'rgba(0,0,0,0)'; }\r\n\r\n this.backgroundColor = ValueToColor(color);\r\n\r\n this.transparent = (this.backgroundColor.alpha === 0);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the bounds of the Camera. The bounds are an axis-aligned rectangle.\r\n * \r\n * The Camera bounds controls where the Camera can scroll to, stopping it from scrolling off the\r\n * edges and into blank space. It does not limit the placement of Game Objects, or where\r\n * the Camera viewport can be positioned.\r\n * \r\n * Temporarily disable the bounds by changing the boolean `Camera.useBounds`.\r\n * \r\n * Clear the bounds entirely by calling `Camera.removeBounds`.\r\n * \r\n * If you set bounds that are smaller than the viewport it will stop the Camera from being\r\n * able to scroll. The bounds can be positioned where-ever you wish. By default they are from\r\n * 0x0 to the canvas width x height. This means that the coordinate 0x0 is the top left of\r\n * the Camera bounds. However, you can position them anywhere. So if you wanted a game world\r\n * that was 2048x2048 in size, with 0x0 being the center of it, you can set the bounds x/y\r\n * to be -1024, -1024, with a width and height of 2048. Depending on your game you may find\r\n * it easier for 0x0 to be the top-left of the bounds, or you may wish 0x0 to be the middle.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setBounds\r\n * @since 3.0.0\r\n *\r\n * @param {integer} x - The top-left x coordinate of the bounds.\r\n * @param {integer} y - The top-left y coordinate of the bounds.\r\n * @param {integer} width - The width of the bounds, in pixels.\r\n * @param {integer} height - The height of the bounds, in pixels.\r\n * @param {boolean} [centerOn=false] - If `true` the Camera will automatically be centered on the new bounds.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n setBounds: function (x, y, width, height, centerOn)\r\n {\r\n if (centerOn === undefined) { centerOn = false; }\r\n\r\n this._bounds.setTo(x, y, width, height);\r\n\r\n this.dirty = true;\r\n this.useBounds = true;\r\n\r\n if (centerOn)\r\n {\r\n this.centerToBounds();\r\n }\r\n else\r\n {\r\n this.scrollX = this.clampX(this.scrollX);\r\n this.scrollY = this.clampY(this.scrollY);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns a rectangle containing the bounds of the Camera.\r\n * \r\n * If the Camera does not have any bounds the rectangle will be empty.\r\n * \r\n * The rectangle is a copy of the bounds, so is safe to modify.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#getBounds\r\n * @since 3.16.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} [out] - An optional Rectangle to store the bounds in. If not given, a new Rectangle will be created.\r\n *\r\n * @return {Phaser.Geom.Rectangle} A rectangle containing the bounds of this Camera.\r\n */\r\n getBounds: function (out)\r\n {\r\n if (out === undefined) { out = new Rectangle(); }\r\n\r\n var source = this._bounds;\r\n\r\n out.setTo(source.x, source.y, source.width, source.height);\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Sets the name of this Camera.\r\n * This value is for your own use and isn't used internally.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setName\r\n * @since 3.0.0\r\n *\r\n * @param {string} [value=''] - The name of the Camera.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n setName: function (value)\r\n {\r\n if (value === undefined) { value = ''; }\r\n\r\n this.name = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the position of the Camera viewport within the game.\r\n *\r\n * This does not change where the camera is 'looking'. See `setScroll` to control that.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setPosition\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The top-left x coordinate of the Camera viewport.\r\n * @param {number} [y=x] - The top-left y coordinate of the Camera viewport.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n setPosition: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the rotation of this Camera. This causes everything it renders to appear rotated.\r\n *\r\n * Rotating a camera does not rotate the viewport itself, it is applied during rendering.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setRotation\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The rotation of the Camera, in radians.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n setRotation: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.rotation = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Should the Camera round pixel values to whole integers when rendering Game Objects?\r\n * \r\n * In some types of game, especially with pixel art, this is required to prevent sub-pixel aliasing.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setRoundPixels\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - `true` to round Camera pixels, `false` to not.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n setRoundPixels: function (value)\r\n {\r\n this.roundPixels = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Scene the Camera is bound to.\r\n * \r\n * Also populates the `resolution` property and updates the internal size values.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setScene\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene the camera is bound to.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n setScene: function (scene)\r\n {\r\n if (this.scene && this._customViewport)\r\n {\r\n this.sceneManager.customViewports--;\r\n }\r\n\r\n this.scene = scene;\r\n\r\n var sys = scene.sys;\r\n\r\n this.sceneManager = sys.game.scene;\r\n this.scaleManager = sys.scale;\r\n this.cameraManager = sys.cameras;\r\n\r\n var res = this.scaleManager.resolution;\r\n\r\n this.resolution = res;\r\n\r\n this._cx = this._x * res;\r\n this._cy = this._y * res;\r\n this._cw = this._width * res;\r\n this._ch = this._height * res;\r\n\r\n this.updateSystem();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the position of where the Camera is looking within the game.\r\n * You can also modify the properties `Camera.scrollX` and `Camera.scrollY` directly.\r\n * Use this method, or the scroll properties, to move your camera around the game world.\r\n *\r\n * This does not change where the camera viewport is placed. See `setPosition` to control that.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setScroll\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the Camera in the game world.\r\n * @param {number} [y=x] - The y coordinate of the Camera in the game world.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n setScroll: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.scrollX = x;\r\n this.scrollY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the size of the Camera viewport.\r\n *\r\n * By default a Camera is the same size as the game, but can be made smaller via this method,\r\n * allowing you to create mini-cam style effects by creating and positioning a smaller Camera\r\n * viewport within your game.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setSize\r\n * @since 3.0.0\r\n *\r\n * @param {integer} width - The width of the Camera viewport.\r\n * @param {integer} [height=width] - The height of the Camera viewport.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n setSize: function (width, height)\r\n {\r\n if (height === undefined) { height = width; }\r\n\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * This method sets the position and size of the Camera viewport in a single call.\r\n *\r\n * If you're trying to change where the Camera is looking at in your game, then see\r\n * the method `Camera.setScroll` instead. This method is for changing the viewport\r\n * itself, not what the camera can see.\r\n *\r\n * By default a Camera is the same size as the game, but can be made smaller via this method,\r\n * allowing you to create mini-cam style effects by creating and positioning a smaller Camera\r\n * viewport within your game.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setViewport\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The top-left x coordinate of the Camera viewport.\r\n * @param {number} y - The top-left y coordinate of the Camera viewport.\r\n * @param {integer} width - The width of the Camera viewport.\r\n * @param {integer} [height=width] - The height of the Camera viewport.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n setViewport: function (x, y, width, height)\r\n {\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the zoom value of the Camera.\r\n *\r\n * Changing to a smaller value, such as 0.5, will cause the camera to 'zoom out'.\r\n * Changing to a larger value, such as 2, will cause the camera to 'zoom in'.\r\n *\r\n * A value of 1 means 'no zoom' and is the default.\r\n *\r\n * Changing the zoom does not impact the Camera viewport in any way, it is only applied during rendering.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setZoom\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=1] - The zoom value of the Camera. The minimum it can be is 0.001.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.\r\n */\r\n setZoom: function (value)\r\n {\r\n if (value === undefined) { value = 1; }\r\n\r\n if (value === 0)\r\n {\r\n value = 0.001;\r\n }\r\n\r\n this.zoom = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the mask to be applied to this Camera during rendering.\r\n *\r\n * The mask must have been previously created and can be either a GeometryMask or a BitmapMask.\r\n * \r\n * Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas.\r\n *\r\n * If a mask is already set on this Camera it will be immediately replaced.\r\n * \r\n * Masks have no impact on physics or input detection. They are purely a rendering component\r\n * that allows you to limit what is visible during the render pass.\r\n * \r\n * Note: You cannot mask a Camera that has `renderToTexture` set.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setMask\r\n * @since 3.17.0\r\n *\r\n * @param {(Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask)} mask - The mask this Camera will use when rendering.\r\n * @param {boolean} [fixedPosition=true] - Should the mask translate along with the Camera, or be fixed in place and not impacted by the Cameras transform?\r\n *\r\n * @return {this} This Camera instance.\r\n */\r\n setMask: function (mask, fixedPosition)\r\n {\r\n if (fixedPosition === undefined) { fixedPosition = true; }\r\n\r\n this.mask = mask;\r\n\r\n this._maskCamera = (fixedPosition) ? this.cameraManager.default : this;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Clears the mask that this Camera was using.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#clearMask\r\n * @since 3.17.0\r\n *\r\n * @param {boolean} [destroyMask=false] - Destroy the mask before clearing it?\r\n *\r\n * @return {this} This Camera instance.\r\n */\r\n clearMask: function (destroyMask)\r\n {\r\n if (destroyMask === undefined) { destroyMask = false; }\r\n\r\n if (destroyMask && this.mask)\r\n {\r\n this.mask.destroy();\r\n }\r\n\r\n this.mask = null;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the visibility of this Camera.\r\n *\r\n * An invisible Camera will skip rendering and input tests of everything it can see.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#setVisible\r\n * @since 3.10.0\r\n *\r\n * @param {boolean} value - The visible state of the Camera.\r\n *\r\n * @return {this} This Camera instance.\r\n */\r\n\r\n /**\r\n * Returns an Object suitable for JSON storage containing all of the Camera viewport and rendering properties.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.Cameras.Scene2D.JSONCamera} A well-formed object suitable for conversion to JSON.\r\n */\r\n toJSON: function ()\r\n {\r\n var output = {\r\n name: this.name,\r\n x: this.x,\r\n y: this.y,\r\n width: this.width,\r\n height: this.height,\r\n zoom: this.zoom,\r\n rotation: this.rotation,\r\n roundPixels: this.roundPixels,\r\n scrollX: this.scrollX,\r\n scrollY: this.scrollY,\r\n backgroundColor: this.backgroundColor.rgba\r\n };\r\n\r\n if (this.useBounds)\r\n {\r\n output['bounds'] = {\r\n x: this._bounds.x,\r\n y: this._bounds.y,\r\n width: this._bounds.width,\r\n height: this._bounds.height\r\n };\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Internal method called automatically by the Camera Manager.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#update\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n update: function ()\r\n {\r\n // NOOP\r\n },\r\n\r\n /**\r\n * Internal method called automatically when the viewport changes.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#updateSystem\r\n * @private\r\n * @since 3.12.0\r\n */\r\n updateSystem: function ()\r\n {\r\n if (!this.scaleManager)\r\n {\r\n return;\r\n }\r\n\r\n var custom = (this._x !== 0 || this._y !== 0 || this.scaleManager.width !== this._width || this.scaleManager.height !== this._height);\r\n\r\n var sceneManager = this.sceneManager;\r\n\r\n if (custom && !this._customViewport)\r\n {\r\n // We need a custom viewport for this Camera\r\n sceneManager.customViewports++;\r\n }\r\n else if (!custom && this._customViewport)\r\n {\r\n // We're turning off a custom viewport for this Camera\r\n sceneManager.customViewports--;\r\n }\r\n\r\n this.dirty = true;\r\n this._customViewport = custom;\r\n },\r\n\r\n /**\r\n * Destroys this Camera instance and its internal properties and references.\r\n * Once destroyed you cannot use this Camera again, even if re-added to a Camera Manager.\r\n * \r\n * This method is called automatically by `CameraManager.remove` if that methods `runDestroy` argument is `true`, which is the default.\r\n * \r\n * Unless you have a specific reason otherwise, always use `CameraManager.remove` and allow it to handle the camera destruction,\r\n * rather than calling this method directly.\r\n *\r\n * @method Phaser.Cameras.Scene2D.BaseCamera#destroy\r\n * @fires Phaser.Cameras.Scene2D.Events#DESTROY\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.emit(Events.DESTROY, this);\r\n\r\n this.removeAllListeners();\r\n\r\n this.matrix.destroy();\r\n\r\n this.culledObjects = [];\r\n\r\n if (this._customViewport)\r\n {\r\n // We're turning off a custom viewport for this Camera\r\n this.sceneManager.customViewports--;\r\n }\r\n\r\n this._bounds = null;\r\n\r\n this.scene = null;\r\n this.scaleManager = null;\r\n this.sceneManager = null;\r\n this.cameraManager = null;\r\n },\r\n\r\n /**\r\n * The x position of the Camera viewport, relative to the top-left of the game canvas.\r\n * The viewport is the area into which the camera renders.\r\n * To adjust the position the camera is looking at in the game world, see the `scrollX` value.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#x\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n x: {\r\n\r\n get: function ()\r\n {\r\n return this._x;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._x = value;\r\n this._cx = value * this.resolution;\r\n this.updateSystem();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The y position of the Camera viewport, relative to the top-left of the game canvas.\r\n * The viewport is the area into which the camera renders.\r\n * To adjust the position the camera is looking at in the game world, see the `scrollY` value.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#y\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n y: {\r\n\r\n get: function ()\r\n {\r\n return this._y;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._y = value;\r\n this._cy = value * this.resolution;\r\n this.updateSystem();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The width of the Camera viewport, in pixels.\r\n *\r\n * The viewport is the area into which the Camera renders. Setting the viewport does\r\n * not restrict where the Camera can scroll to.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n width: {\r\n\r\n get: function ()\r\n {\r\n return this._width;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._width = value;\r\n this._cw = value * this.resolution;\r\n this.updateSystem();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The height of the Camera viewport, in pixels.\r\n *\r\n * The viewport is the area into which the Camera renders. Setting the viewport does\r\n * not restrict where the Camera can scroll to.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n height: {\r\n\r\n get: function ()\r\n {\r\n return this._height;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._height = value;\r\n this._ch = value * this.resolution;\r\n this.updateSystem();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The horizontal scroll position of this Camera.\r\n *\r\n * Change this value to cause the Camera to scroll around your Scene.\r\n *\r\n * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method,\r\n * will automatically adjust the Camera scroll values accordingly.\r\n *\r\n * You can set the bounds within which the Camera can scroll via the `setBounds` method.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#scrollX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n scrollX: {\r\n\r\n get: function ()\r\n {\r\n return this._scrollX;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scrollX = value;\r\n this.dirty = true;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical scroll position of this Camera.\r\n *\r\n * Change this value to cause the Camera to scroll around your Scene.\r\n *\r\n * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method,\r\n * will automatically adjust the Camera scroll values accordingly.\r\n *\r\n * You can set the bounds within which the Camera can scroll via the `setBounds` method.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#scrollY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n scrollY: {\r\n\r\n get: function ()\r\n {\r\n return this._scrollY;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scrollY = value;\r\n this.dirty = true;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Camera zoom value. Change this value to zoom in, or out of, a Scene.\r\n *\r\n * A value of 0.5 would zoom the Camera out, so you can now see twice as much\r\n * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel\r\n * now takes up 2 pixels when rendered.\r\n *\r\n * Set to 1 to return to the default zoom level.\r\n *\r\n * Be careful to never set this value to zero.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#zoom\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n zoom: {\r\n\r\n get: function ()\r\n {\r\n return this._zoom;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._zoom = value;\r\n this.dirty = true;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The rotation of the Camera in radians.\r\n *\r\n * Camera rotation always takes place based on the Camera viewport. By default, rotation happens\r\n * in the center of the viewport. You can adjust this with the `originX` and `originY` properties.\r\n *\r\n * Rotation influences the rendering of _all_ Game Objects visible by this Camera. However, it does not\r\n * rotate the Camera viewport itself, which always remains an axis-aligned rectangle.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#rotation\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.11.0\r\n */\r\n rotation: {\r\n\r\n get: function ()\r\n {\r\n return this._rotation;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._rotation = value;\r\n this.dirty = true;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The horizontal position of the center of the Camera's viewport, relative to the left of the game canvas.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#centerX\r\n * @type {number}\r\n * @readonly\r\n * @since 3.10.0\r\n */\r\n centerX: {\r\n\r\n get: function ()\r\n {\r\n return this.x + (0.5 * this.width);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical position of the center of the Camera's viewport, relative to the top of the game canvas.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#centerY\r\n * @type {number}\r\n * @readonly\r\n * @since 3.10.0\r\n */\r\n centerY: {\r\n\r\n get: function ()\r\n {\r\n return this.y + (0.5 * this.height);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The displayed width of the camera viewport, factoring in the camera zoom level.\r\n *\r\n * If a camera has a viewport width of 800 and a zoom of 0.5 then its display width\r\n * would be 1600, as it's displaying twice as many pixels as zoom level 1.\r\n *\r\n * Equally, a camera with a width of 800 and zoom of 2 would have a display width\r\n * of 400 pixels.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#displayWidth\r\n * @type {number}\r\n * @readonly\r\n * @since 3.11.0\r\n */\r\n displayWidth: {\r\n\r\n get: function ()\r\n {\r\n return this.width / this.zoom;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The displayed height of the camera viewport, factoring in the camera zoom level.\r\n *\r\n * If a camera has a viewport height of 600 and a zoom of 0.5 then its display height\r\n * would be 1200, as it's displaying twice as many pixels as zoom level 1.\r\n *\r\n * Equally, a camera with a height of 600 and zoom of 2 would have a display height\r\n * of 300 pixels.\r\n *\r\n * @name Phaser.Cameras.Scene2D.BaseCamera#displayHeight\r\n * @type {number}\r\n * @readonly\r\n * @since 3.11.0\r\n */\r\n displayHeight: {\r\n\r\n get: function ()\r\n {\r\n return this.height / this.zoom;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = BaseCamera;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/BaseCamera.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/Camera.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/Camera.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BaseCamera = __webpack_require__(/*! ./BaseCamera */ \"./node_modules/phaser/src/cameras/2d/BaseCamera.js\");\r\nvar CanvasPool = __webpack_require__(/*! ../../display/canvas/CanvasPool */ \"./node_modules/phaser/src/display/canvas/CanvasPool.js\");\r\nvar CenterOn = __webpack_require__(/*! ../../geom/rectangle/CenterOn */ \"./node_modules/phaser/src/geom/rectangle/CenterOn.js\");\r\nvar Clamp = __webpack_require__(/*! ../../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../../gameobjects/components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar Effects = __webpack_require__(/*! ./effects */ \"./node_modules/phaser/src/cameras/2d/effects/index.js\");\r\nvar Linear = __webpack_require__(/*! ../../math/Linear */ \"./node_modules/phaser/src/math/Linear.js\");\r\nvar Rectangle = __webpack_require__(/*! ../../geom/rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Camera.\r\n *\r\n * The Camera is the way in which all games are rendered in Phaser. They provide a view into your game world,\r\n * and can be positioned, rotated, zoomed and scrolled accordingly.\r\n *\r\n * A Camera consists of two elements: The viewport and the scroll values.\r\n *\r\n * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are\r\n * created the same size as your game, but their position and size can be set to anything. This means if you\r\n * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game,\r\n * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`).\r\n *\r\n * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this\r\n * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the\r\n * viewport, and changing the viewport has no impact on the scrolling.\r\n *\r\n * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method,\r\n * allowing you to filter Game Objects out on a per-Camera basis.\r\n *\r\n * A Camera also has built-in special effects including Fade, Flash and Camera Shake.\r\n *\r\n * @class Camera\r\n * @memberof Phaser.Cameras.Scene2D\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.Cameras.Scene2D.BaseCamera\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.Tint\r\n *\r\n * @param {number} x - The x position of the Camera, relative to the top-left of the game canvas.\r\n * @param {number} y - The y position of the Camera, relative to the top-left of the game canvas.\r\n * @param {number} width - The width of the Camera, in pixels.\r\n * @param {number} height - The height of the Camera, in pixels.\r\n */\r\nvar Camera = new Class({\r\n\r\n Extends: BaseCamera,\r\n\r\n Mixins: [\r\n Components.Flip,\r\n Components.Tint\r\n ],\r\n\r\n initialize:\r\n\r\n function Camera (x, y, width, height)\r\n {\r\n BaseCamera.call(this, x, y, width, height);\r\n\r\n /**\r\n * Does this Camera allow the Game Objects it renders to receive input events?\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#inputEnabled\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.inputEnabled = true;\r\n\r\n /**\r\n * The Camera Fade effect handler.\r\n * To fade this camera see the `Camera.fade` methods.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#fadeEffect\r\n * @type {Phaser.Cameras.Scene2D.Effects.Fade}\r\n * @since 3.5.0\r\n */\r\n this.fadeEffect = new Effects.Fade(this);\r\n\r\n /**\r\n * The Camera Flash effect handler.\r\n * To flash this camera see the `Camera.flash` method.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#flashEffect\r\n * @type {Phaser.Cameras.Scene2D.Effects.Flash}\r\n * @since 3.5.0\r\n */\r\n this.flashEffect = new Effects.Flash(this);\r\n\r\n /**\r\n * The Camera Shake effect handler.\r\n * To shake this camera see the `Camera.shake` method.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#shakeEffect\r\n * @type {Phaser.Cameras.Scene2D.Effects.Shake}\r\n * @since 3.5.0\r\n */\r\n this.shakeEffect = new Effects.Shake(this);\r\n\r\n /**\r\n * The Camera Pan effect handler.\r\n * To pan this camera see the `Camera.pan` method.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#panEffect\r\n * @type {Phaser.Cameras.Scene2D.Effects.Pan}\r\n * @since 3.11.0\r\n */\r\n this.panEffect = new Effects.Pan(this);\r\n\r\n /**\r\n * The Camera Zoom effect handler.\r\n * To zoom this camera see the `Camera.zoom` method.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#zoomEffect\r\n * @type {Phaser.Cameras.Scene2D.Effects.Zoom}\r\n * @since 3.11.0\r\n */\r\n this.zoomEffect = new Effects.Zoom(this);\r\n\r\n /**\r\n * The linear interpolation value to use when following a target.\r\n *\r\n * Can also be set via `setLerp` or as part of the `startFollow` call.\r\n *\r\n * The default values of 1 means the camera will instantly snap to the target coordinates.\r\n * A lower value, such as 0.1 means the camera will more slowly track the target, giving\r\n * a smooth transition. You can set the horizontal and vertical values independently, and also\r\n * adjust this value in real-time during your game.\r\n *\r\n * Be sure to keep the value between 0 and 1. A value of zero will disable tracking on that axis.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#lerp\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.9.0\r\n */\r\n this.lerp = new Vector2(1, 1);\r\n\r\n /**\r\n * The values stored in this property are subtracted from the Camera targets position, allowing you to\r\n * offset the camera from the actual target x/y coordinates by this amount.\r\n * Can also be set via `setFollowOffset` or as part of the `startFollow` call.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#followOffset\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.9.0\r\n */\r\n this.followOffset = new Vector2();\r\n\r\n /**\r\n * The Camera dead zone.\r\n *\r\n * The deadzone is only used when the camera is following a target.\r\n *\r\n * It defines a rectangular region within which if the target is present, the camera will not scroll.\r\n * If the target moves outside of this area, the camera will begin scrolling in order to follow it.\r\n *\r\n * The `lerp` values that you can set for a follower target also apply when using a deadzone.\r\n *\r\n * You can directly set this property to be an instance of a Rectangle. Or, you can use the\r\n * `setDeadzone` method for a chainable approach.\r\n *\r\n * The rectangle you provide can have its dimensions adjusted dynamically, however, please\r\n * note that its position is updated every frame, as it is constantly re-centered on the cameras mid point.\r\n *\r\n * Calling `setDeadzone` with no arguments will reset an active deadzone, as will setting this property\r\n * to `null`.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#deadzone\r\n * @type {?Phaser.Geom.Rectangle}\r\n * @since 3.11.0\r\n */\r\n this.deadzone = null;\r\n\r\n /**\r\n * Internal follow target reference.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#_follow\r\n * @type {?any}\r\n * @private\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this._follow = null;\r\n\r\n /**\r\n * Is this Camera rendering directly to the canvas or to a texture?\r\n *\r\n * Enable rendering to texture with the method `setRenderToTexture` (just enabling this boolean won't be enough)\r\n *\r\n * Once enabled you can toggle it by switching this property.\r\n *\r\n * To properly remove a render texture you should call the `clearRenderToTexture()` method.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#renderToTexture\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.13.0\r\n */\r\n this.renderToTexture = false;\r\n\r\n /**\r\n * If this Camera has been set to render to a texture then this holds a reference\r\n * to the HTML Canvas Element that the Camera is drawing to.\r\n *\r\n * Enable texture rendering using the method `setRenderToTexture`.\r\n *\r\n * This is only populated if Phaser is running with the Canvas Renderer.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#canvas\r\n * @type {HTMLCanvasElement}\r\n * @since 3.13.0\r\n */\r\n this.canvas = null;\r\n\r\n /**\r\n * If this Camera has been set to render to a texture then this holds a reference\r\n * to the Rendering Context belonging to the Canvas element the Camera is drawing to.\r\n *\r\n * Enable texture rendering using the method `setRenderToTexture`.\r\n *\r\n * This is only populated if Phaser is running with the Canvas Renderer.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#context\r\n * @type {CanvasRenderingContext2D}\r\n * @since 3.13.0\r\n */\r\n this.context = null;\r\n\r\n /**\r\n * If this Camera has been set to render to a texture then this holds a reference\r\n * to the GL Texture belonging the Camera is drawing to.\r\n *\r\n * Enable texture rendering using the method `setRenderToTexture`.\r\n *\r\n * This is only set if Phaser is running with the WebGL Renderer.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#glTexture\r\n * @type {?WebGLTexture}\r\n * @since 3.13.0\r\n */\r\n this.glTexture = null;\r\n\r\n /**\r\n * If this Camera has been set to render to a texture then this holds a reference\r\n * to the GL Frame Buffer belonging the Camera is drawing to.\r\n *\r\n * Enable texture rendering using the method `setRenderToTexture`.\r\n *\r\n * This is only set if Phaser is running with the WebGL Renderer.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#framebuffer\r\n * @type {?WebGLFramebuffer}\r\n * @since 3.13.0\r\n */\r\n this.framebuffer = null;\r\n\r\n /**\r\n * If this Camera has been set to render to a texture and to use a custom pipeline,\r\n * then this holds a reference to the pipeline the Camera is drawing with.\r\n *\r\n * Enable texture rendering using the method `setRenderToTexture`.\r\n *\r\n * This is only set if Phaser is running with the WebGL Renderer.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Camera#pipeline\r\n * @type {any}\r\n * @since 3.13.0\r\n */\r\n this.pipeline = null;\r\n },\r\n\r\n /**\r\n * Sets the Camera to render to a texture instead of to the main canvas.\r\n *\r\n * The Camera will redirect all Game Objects it's asked to render to this texture.\r\n *\r\n * During the render sequence, the texture itself will then be rendered to the main canvas.\r\n *\r\n * Doing this gives you the ability to modify the texture before this happens,\r\n * allowing for special effects such as Camera specific shaders, or post-processing\r\n * on the texture.\r\n *\r\n * If running under Canvas the Camera will render to its `canvas` property.\r\n *\r\n * If running under WebGL the Camera will create a frame buffer, which is stored in its `framebuffer` and `glTexture` properties.\r\n *\r\n * If you set a camera to render to a texture then it will emit 2 events during the render loop:\r\n *\r\n * First, it will emit the event `prerender`. This happens right before any Game Object's are drawn to the Camera texture.\r\n *\r\n * Then, it will emit the event `postrender`. This happens after all Game Object's have been drawn, but right before the\r\n * Camera texture is rendered to the main game canvas. It's the final point at which you can manipulate the texture before\r\n * it appears in-game.\r\n *\r\n * You should not enable this unless you plan on actually using the texture it creates\r\n * somehow, otherwise you're just doubling the work required to render your game.\r\n *\r\n * To temporarily disable rendering to a texture, toggle the `renderToTexture` boolean.\r\n *\r\n * If you no longer require the Camera to render to a texture, call the `clearRenderToTexture` method,\r\n * which will delete the respective textures and free-up resources.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#setRenderToTexture\r\n * @since 3.13.0\r\n *\r\n * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - An optional WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance.\r\n */\r\n setRenderToTexture: function (pipeline)\r\n {\r\n var renderer = this.scene.sys.game.renderer;\r\n\r\n if (renderer.gl)\r\n {\r\n this.glTexture = renderer.createTextureFromSource(null, this.width, this.height, 0);\r\n this.framebuffer = renderer.createFramebuffer(this.width, this.height, this.glTexture, false);\r\n }\r\n else\r\n {\r\n this.canvas = CanvasPool.create2D(this, this.width, this.height);\r\n this.context = this.canvas.getContext('2d');\r\n }\r\n\r\n this.renderToTexture = true;\r\n\r\n if (pipeline)\r\n {\r\n this.setPipeline(pipeline);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the WebGL pipeline this Camera is using when rendering to a texture.\r\n *\r\n * You can pass either the string-based name of the pipeline, or a reference to the pipeline itself.\r\n *\r\n * Call this method with no arguments to clear any previously set pipeline.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#setPipeline\r\n * @since 3.13.0\r\n *\r\n * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - The WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference. Or if left empty it will clear the pipeline.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance.\r\n */\r\n setPipeline: function (pipeline)\r\n {\r\n if (typeof pipeline === 'string')\r\n {\r\n var renderer = this.scene.sys.game.renderer;\r\n\r\n if (renderer.gl && renderer.hasPipeline(pipeline))\r\n {\r\n this.pipeline = renderer.getPipeline(pipeline);\r\n }\r\n }\r\n else\r\n {\r\n this.pipeline = pipeline;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * If this Camera was set to render to a texture, this will clear the resources it was using and\r\n * redirect it to render back to the primary Canvas again.\r\n *\r\n * If you only wish to temporarily disable rendering to a texture then you can toggle the\r\n * property `renderToTexture` instead.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#clearRenderToTexture\r\n * @since 3.13.0\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance.\r\n */\r\n clearRenderToTexture: function ()\r\n {\r\n if (!this.scene)\r\n {\r\n return;\r\n }\r\n\r\n var renderer = this.scene.sys.game.renderer;\r\n\r\n if (!renderer)\r\n {\r\n return;\r\n }\r\n\r\n if (renderer.gl)\r\n {\r\n if (this.framebuffer)\r\n {\r\n renderer.deleteFramebuffer(this.framebuffer);\r\n }\r\n\r\n if (this.glTexture)\r\n {\r\n renderer.deleteTexture(this.glTexture);\r\n }\r\n\r\n this.framebuffer = null;\r\n this.glTexture = null;\r\n this.pipeline = null;\r\n }\r\n else\r\n {\r\n CanvasPool.remove(this);\r\n\r\n this.canvas = null;\r\n this.context = null;\r\n }\r\n\r\n this.renderToTexture = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Camera dead zone.\r\n *\r\n * The deadzone is only used when the camera is following a target.\r\n *\r\n * It defines a rectangular region within which if the target is present, the camera will not scroll.\r\n * If the target moves outside of this area, the camera will begin scrolling in order to follow it.\r\n *\r\n * The deadzone rectangle is re-positioned every frame so that it is centered on the mid-point\r\n * of the camera. This allows you to use the object for additional game related checks, such as\r\n * testing if an object is within it or not via a Rectangle.contains call.\r\n *\r\n * The `lerp` values that you can set for a follower target also apply when using a deadzone.\r\n *\r\n * Calling this method with no arguments will reset an active deadzone.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#setDeadzone\r\n * @since 3.11.0\r\n *\r\n * @param {number} [width] - The width of the deadzone rectangle in pixels. If not specified the deadzone is removed.\r\n * @param {number} [height] - The height of the deadzone rectangle in pixels.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance.\r\n */\r\n setDeadzone: function (width, height)\r\n {\r\n if (width === undefined)\r\n {\r\n this.deadzone = null;\r\n }\r\n else\r\n {\r\n if (this.deadzone)\r\n {\r\n this.deadzone.width = width;\r\n this.deadzone.height = height;\r\n }\r\n else\r\n {\r\n this.deadzone = new Rectangle(0, 0, width, height);\r\n }\r\n\r\n if (this._follow)\r\n {\r\n var originX = this.width / 2;\r\n var originY = this.height / 2;\r\n\r\n var fx = this._follow.x - this.followOffset.x;\r\n var fy = this._follow.y - this.followOffset.y;\r\n\r\n this.midPoint.set(fx, fy);\r\n\r\n this.scrollX = fx - originX;\r\n this.scrollY = fy - originY;\r\n }\r\n\r\n CenterOn(this.deadzone, this.midPoint.x, this.midPoint.y);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Fades the Camera in from the given color over the duration specified.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#fadeIn\r\n * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_START\r\n * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE\r\n * @since 3.3.0\r\n *\r\n * @param {integer} [duration=1000] - The duration of the effect in milliseconds.\r\n * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255.\r\n * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255.\r\n * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255.\r\n * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect.\r\n * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is.\r\n * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance.\r\n */\r\n fadeIn: function (duration, red, green, blue, callback, context)\r\n {\r\n return this.fadeEffect.start(false, duration, red, green, blue, true, callback, context);\r\n },\r\n\r\n /**\r\n * Fades the Camera out to the given color over the duration specified.\r\n * This is an alias for Camera.fade that forces the fade to start, regardless of existing fades.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#fadeOut\r\n * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_START\r\n * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE\r\n * @since 3.3.0\r\n *\r\n * @param {integer} [duration=1000] - The duration of the effect in milliseconds.\r\n * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255.\r\n * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255.\r\n * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255.\r\n * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect.\r\n * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is.\r\n * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance.\r\n */\r\n fadeOut: function (duration, red, green, blue, callback, context)\r\n {\r\n return this.fadeEffect.start(true, duration, red, green, blue, true, callback, context);\r\n },\r\n\r\n /**\r\n * Fades the Camera from the given color to transparent over the duration specified.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#fadeFrom\r\n * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_START\r\n * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE\r\n * @since 3.5.0\r\n *\r\n * @param {integer} [duration=1000] - The duration of the effect in milliseconds.\r\n * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255.\r\n * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255.\r\n * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255.\r\n * @param {boolean} [force=false] - Force the effect to start immediately, even if already running.\r\n * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect.\r\n * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is.\r\n * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance.\r\n */\r\n fadeFrom: function (duration, red, green, blue, force, callback, context)\r\n {\r\n return this.fadeEffect.start(false, duration, red, green, blue, force, callback, context);\r\n },\r\n\r\n /**\r\n * Fades the Camera from transparent to the given color over the duration specified.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#fade\r\n * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_START\r\n * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [duration=1000] - The duration of the effect in milliseconds.\r\n * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255.\r\n * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255.\r\n * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255.\r\n * @param {boolean} [force=false] - Force the effect to start immediately, even if already running.\r\n * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect.\r\n * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is.\r\n * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance.\r\n */\r\n fade: function (duration, red, green, blue, force, callback, context)\r\n {\r\n return this.fadeEffect.start(true, duration, red, green, blue, force, callback, context);\r\n },\r\n\r\n /**\r\n * Flashes the Camera by setting it to the given color immediately and then fading it away again quickly over the duration specified.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#flash\r\n * @fires Phaser.Cameras.Scene2D.Events#FLASH_START\r\n * @fires Phaser.Cameras.Scene2D.Events#FLASH_COMPLETE\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [duration=250] - The duration of the effect in milliseconds.\r\n * @param {integer} [red=255] - The amount to fade the red channel towards. A value between 0 and 255.\r\n * @param {integer} [green=255] - The amount to fade the green channel towards. A value between 0 and 255.\r\n * @param {integer} [blue=255] - The amount to fade the blue channel towards. A value between 0 and 255.\r\n * @param {boolean} [force=false] - Force the effect to start immediately, even if already running.\r\n * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect.\r\n * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is.\r\n * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance.\r\n */\r\n flash: function (duration, red, green, blue, force, callback, context)\r\n {\r\n return this.flashEffect.start(duration, red, green, blue, force, callback, context);\r\n },\r\n\r\n /**\r\n * Shakes the Camera by the given intensity over the duration specified.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#shake\r\n * @fires Phaser.Cameras.Scene2D.Events#SHAKE_START\r\n * @fires Phaser.Cameras.Scene2D.Events#SHAKE_COMPLETE\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [duration=100] - The duration of the effect in milliseconds.\r\n * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake.\r\n * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running.\r\n * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect.\r\n * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is.\r\n * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance.\r\n */\r\n shake: function (duration, intensity, force, callback, context)\r\n {\r\n return this.shakeEffect.start(duration, intensity, force, callback, context);\r\n },\r\n\r\n /**\r\n * This effect will scroll the Camera so that the center of its viewport finishes at the given destination,\r\n * over the duration and with the ease specified.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#pan\r\n * @fires Phaser.Cameras.Scene2D.Events#PAN_START\r\n * @fires Phaser.Cameras.Scene2D.Events#PAN_COMPLETE\r\n * @since 3.11.0\r\n *\r\n * @param {number} x - The destination x coordinate to scroll the center of the Camera viewport to.\r\n * @param {number} y - The destination y coordinate to scroll the center of the Camera viewport to.\r\n * @param {integer} [duration=1000] - The duration of the effect in milliseconds.\r\n * @param {(string|function)} [ease='Linear'] - The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function.\r\n * @param {boolean} [force=false] - Force the pan effect to start immediately, even if already running.\r\n * @param {Phaser.Types.Cameras.Scene2D.CameraPanCallback} [callback] - This callback will be invoked every frame for the duration of the effect.\r\n * It is sent four arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is,\r\n * the current camera scroll x coordinate and the current camera scroll y coordinate.\r\n * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance.\r\n */\r\n pan: function (x, y, duration, ease, force, callback, context)\r\n {\r\n return this.panEffect.start(x, y, duration, ease, force, callback, context);\r\n },\r\n\r\n /**\r\n * This effect will zoom the Camera to the given scale, over the duration and with the ease specified.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#zoomTo\r\n * @fires Phaser.Cameras.Scene2D.Events#ZOOM_START\r\n * @fires Phaser.Cameras.Scene2D.Events#ZOOM_COMPLETE\r\n * @since 3.11.0\r\n *\r\n * @param {number} zoom - The target Camera zoom value.\r\n * @param {integer} [duration=1000] - The duration of the effect in milliseconds.\r\n * @param {(string|function)} [ease='Linear'] - The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function.\r\n * @param {boolean} [force=false] - Force the pan effect to start immediately, even if already running.\r\n * @param {Phaser.Types.Cameras.Scene2D.CameraPanCallback} [callback] - This callback will be invoked every frame for the duration of the effect.\r\n * It is sent four arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is,\r\n * the current camera scroll x coordinate and the current camera scroll y coordinate.\r\n * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance.\r\n */\r\n zoomTo: function (zoom, duration, ease, force, callback, context)\r\n {\r\n return this.zoomEffect.start(zoom, duration, ease, force, callback, context);\r\n },\r\n\r\n /**\r\n * Internal preRender step.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#preRender\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {number} resolution - The game resolution, as set in the Scale Manager.\r\n */\r\n preRender: function (resolution)\r\n {\r\n var width = this.width;\r\n var height = this.height;\r\n\r\n var halfWidth = width * 0.5;\r\n var halfHeight = height * 0.5;\r\n\r\n var zoom = this.zoom * resolution;\r\n var matrix = this.matrix;\r\n\r\n var originX = width * this.originX;\r\n var originY = height * this.originY;\r\n\r\n var follow = this._follow;\r\n var deadzone = this.deadzone;\r\n\r\n var sx = this.scrollX;\r\n var sy = this.scrollY;\r\n\r\n if (deadzone)\r\n {\r\n CenterOn(deadzone, this.midPoint.x, this.midPoint.y);\r\n }\r\n\r\n if (follow && !this.panEffect.isRunning)\r\n {\r\n var fx = (follow.x - this.followOffset.x);\r\n var fy = (follow.y - this.followOffset.y);\r\n\r\n if (deadzone)\r\n {\r\n if (fx < deadzone.x)\r\n {\r\n sx = Linear(sx, sx - (deadzone.x - fx), this.lerp.x);\r\n }\r\n else if (fx > deadzone.right)\r\n {\r\n sx = Linear(sx, sx + (fx - deadzone.right), this.lerp.x);\r\n }\r\n\r\n if (fy < deadzone.y)\r\n {\r\n sy = Linear(sy, sy - (deadzone.y - fy), this.lerp.y);\r\n }\r\n else if (fy > deadzone.bottom)\r\n {\r\n sy = Linear(sy, sy + (fy - deadzone.bottom), this.lerp.y);\r\n }\r\n }\r\n else\r\n {\r\n sx = Linear(sx, fx - originX, this.lerp.x);\r\n sy = Linear(sy, fy - originY, this.lerp.y);\r\n }\r\n }\r\n\r\n if (this.useBounds)\r\n {\r\n sx = this.clampX(sx);\r\n sy = this.clampY(sy);\r\n }\r\n\r\n if (this.roundPixels)\r\n {\r\n originX = Math.round(originX);\r\n originY = Math.round(originY);\r\n }\r\n\r\n // Values are in pixels and not impacted by zooming the Camera\r\n this.scrollX = sx;\r\n this.scrollY = sy;\r\n\r\n var midX = sx + halfWidth;\r\n var midY = sy + halfHeight;\r\n\r\n // The center of the camera, in world space, so taking zoom into account\r\n // Basically the pixel value of what it's looking at in the middle of the cam\r\n this.midPoint.set(midX, midY);\r\n\r\n var displayWidth = width / zoom;\r\n var displayHeight = height / zoom;\r\n\r\n this.worldView.setTo(\r\n midX - (displayWidth / 2),\r\n midY - (displayHeight / 2),\r\n displayWidth,\r\n displayHeight\r\n );\r\n\r\n matrix.applyITRS(this.x + originX, this.y + originY, this.rotation, zoom, zoom);\r\n matrix.translate(-originX, -originY);\r\n\r\n this.shakeEffect.preRender();\r\n },\r\n\r\n /**\r\n * Sets the linear interpolation value to use when following a target.\r\n *\r\n * The default values of 1 means the camera will instantly snap to the target coordinates.\r\n * A lower value, such as 0.1 means the camera will more slowly track the target, giving\r\n * a smooth transition. You can set the horizontal and vertical values independently, and also\r\n * adjust this value in real-time during your game.\r\n *\r\n * Be sure to keep the value between 0 and 1. A value of zero will disable tracking on that axis.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#setLerp\r\n * @since 3.9.0\r\n *\r\n * @param {number} [x=1] - The amount added to the horizontal linear interpolation of the follow target.\r\n * @param {number} [y=1] - The amount added to the vertical linear interpolation of the follow target.\r\n *\r\n * @return {this} This Camera instance.\r\n */\r\n setLerp: function (x, y)\r\n {\r\n if (x === undefined) { x = 1; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.lerp.set(x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal and vertical offset of the camera from its follow target.\r\n * The values are subtracted from the targets position during the Cameras update step.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#setFollowOffset\r\n * @since 3.9.0\r\n *\r\n * @param {number} [x=0] - The horizontal offset from the camera follow target.x position.\r\n * @param {number} [y=0] - The vertical offset from the camera follow target.y position.\r\n *\r\n * @return {this} This Camera instance.\r\n */\r\n setFollowOffset: function (x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n this.followOffset.set(x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Camera to follow a Game Object.\r\n *\r\n * When enabled the Camera will automatically adjust its scroll position to keep the target Game Object\r\n * in its center.\r\n *\r\n * You can set the linear interpolation value used in the follow code.\r\n * Use low lerp values (such as 0.1) to automatically smooth the camera motion.\r\n *\r\n * If you find you're getting a slight \"jitter\" effect when following an object it's probably to do with sub-pixel\r\n * rendering of the targets position. This can be rounded by setting the `roundPixels` argument to `true` to\r\n * force full pixel rounding rendering. Note that this can still be broken if you have specified a non-integer zoom\r\n * value on the camera. So be sure to keep the camera zoom to integers.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#startFollow\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject|object)} target - The target for the Camera to follow.\r\n * @param {boolean} [roundPixels=false] - Round the camera position to whole integers to avoid sub-pixel rendering?\r\n * @param {number} [lerpX=1] - A value between 0 and 1. This value specifies the amount of linear interpolation to use when horizontally tracking the target. The closer the value to 1, the faster the camera will track.\r\n * @param {number} [lerpY=1] - A value between 0 and 1. This value specifies the amount of linear interpolation to use when vertically tracking the target. The closer the value to 1, the faster the camera will track.\r\n * @param {number} [offsetX=0] - The horizontal offset from the camera follow target.x position.\r\n * @param {number} [offsetY=0] - The vertical offset from the camera follow target.y position.\r\n *\r\n * @return {this} This Camera instance.\r\n */\r\n startFollow: function (target, roundPixels, lerpX, lerpY, offsetX, offsetY)\r\n {\r\n if (roundPixels === undefined) { roundPixels = false; }\r\n if (lerpX === undefined) { lerpX = 1; }\r\n if (lerpY === undefined) { lerpY = lerpX; }\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = offsetX; }\r\n\r\n this._follow = target;\r\n\r\n this.roundPixels = roundPixels;\r\n\r\n lerpX = Clamp(lerpX, 0, 1);\r\n lerpY = Clamp(lerpY, 0, 1);\r\n\r\n this.lerp.set(lerpX, lerpY);\r\n\r\n this.followOffset.set(offsetX, offsetY);\r\n\r\n var originX = this.width / 2;\r\n var originY = this.height / 2;\r\n\r\n var fx = target.x - offsetX;\r\n var fy = target.y - offsetY;\r\n\r\n this.midPoint.set(fx, fy);\r\n\r\n this.scrollX = fx - originX;\r\n this.scrollY = fy - originY;\r\n\r\n if (this.useBounds)\r\n {\r\n this.scrollX = this.clampX(this.scrollX);\r\n this.scrollY = this.clampY(this.scrollY);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stops a Camera from following a Game Object, if previously set via `Camera.startFollow`.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#stopFollow\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance.\r\n */\r\n stopFollow: function ()\r\n {\r\n this._follow = null;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets any active FX, such as a fade, flash or shake. Useful to call after a fade in order to\r\n * remove the fade.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#resetFX\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance.\r\n */\r\n resetFX: function ()\r\n {\r\n this.panEffect.reset();\r\n this.shakeEffect.reset();\r\n this.flashEffect.reset();\r\n this.fadeEffect.reset();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal method called automatically by the Camera Manager.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#update\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n update: function (time, delta)\r\n {\r\n if (this.visible)\r\n {\r\n this.panEffect.update(time, delta);\r\n this.zoomEffect.update(time, delta);\r\n this.shakeEffect.update(time, delta);\r\n this.flashEffect.update(time, delta);\r\n this.fadeEffect.update(time, delta);\r\n }\r\n },\r\n\r\n /**\r\n * Destroys this Camera instance. You rarely need to call this directly.\r\n *\r\n * Called by the Camera Manager. If you wish to destroy a Camera please use `CameraManager.remove` as\r\n * cameras are stored in a pool, ready for recycling later, and calling this directly will prevent that.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Camera#destroy\r\n * @fires Phaser.Cameras.Scene2D.Events#DESTROY\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.clearRenderToTexture();\r\n\r\n this.resetFX();\r\n\r\n BaseCamera.prototype.destroy.call(this);\r\n\r\n this._follow = null;\r\n\r\n this.deadzone = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Camera;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/Camera.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/CameraManager.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/CameraManager.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Camera = __webpack_require__(/*! ./Camera */ \"./node_modules/phaser/src/cameras/2d/Camera.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar PluginCache = __webpack_require__(/*! ../../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar RectangleContains = __webpack_require__(/*! ../../geom/rectangle/Contains */ \"./node_modules/phaser/src/geom/rectangle/Contains.js\");\r\nvar ScaleEvents = __webpack_require__(/*! ../../scale/events */ \"./node_modules/phaser/src/scale/events/index.js\");\r\nvar SceneEvents = __webpack_require__(/*! ../../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Camera Manager is a plugin that belongs to a Scene and is responsible for managing all of the Scene Cameras.\r\n * \r\n * By default you can access the Camera Manager from within a Scene using `this.cameras`, although this can be changed\r\n * in your game config.\r\n * \r\n * Create new Cameras using the `add` method. Or extend the Camera class with your own addition code and then add\r\n * the new Camera in using the `addExisting` method.\r\n * \r\n * Cameras provide a view into your game world, and can be positioned, rotated, zoomed and scrolled accordingly.\r\n *\r\n * A Camera consists of two elements: The viewport and the scroll values.\r\n *\r\n * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are\r\n * created the same size as your game, but their position and size can be set to anything. This means if you\r\n * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game,\r\n * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`).\r\n *\r\n * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this\r\n * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the\r\n * viewport, and changing the viewport has no impact on the scrolling.\r\n *\r\n * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method,\r\n * allowing you to filter Game Objects out on a per-Camera basis. The Camera Manager can manage up to 31 unique \r\n * 'Game Object ignore capable' Cameras. Any Cameras beyond 31 that you create will all be given a Camera ID of\r\n * zero, meaning that they cannot be used for Game Object exclusion. This means if you need your Camera to ignore\r\n * Game Objects, make sure it's one of the first 31 created.\r\n *\r\n * A Camera also has built-in special effects including Fade, Flash, Camera Shake, Pan and Zoom.\r\n *\r\n * @class CameraManager\r\n * @memberof Phaser.Cameras.Scene2D\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene that owns the Camera Manager plugin.\r\n */\r\nvar CameraManager = new Class({\r\n\r\n initialize:\r\n\r\n function CameraManager (scene)\r\n {\r\n /**\r\n * The Scene that owns the Camera Manager plugin.\r\n *\r\n * @name Phaser.Cameras.Scene2D.CameraManager#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A reference to the Scene.Systems handler for the Scene that owns the Camera Manager.\r\n *\r\n * @name Phaser.Cameras.Scene2D.CameraManager#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n /**\r\n * All Cameras created by, or added to, this Camera Manager, will have their `roundPixels`\r\n * property set to match this value. By default it is set to match the value set in the\r\n * game configuration, but can be changed at any point. Equally, individual cameras can\r\n * also be changed as needed.\r\n *\r\n * @name Phaser.Cameras.Scene2D.CameraManager#roundPixels\r\n * @type {boolean}\r\n * @since 3.11.0\r\n */\r\n this.roundPixels = scene.sys.game.config.roundPixels;\r\n\r\n /**\r\n * An Array of the Camera objects being managed by this Camera Manager.\r\n * The Cameras are updated and rendered in the same order in which they appear in this array.\r\n * Do not directly add or remove entries to this array. However, you can move the contents\r\n * around the array should you wish to adjust the display order.\r\n *\r\n * @name Phaser.Cameras.Scene2D.CameraManager#cameras\r\n * @type {Phaser.Cameras.Scene2D.Camera[]}\r\n * @since 3.0.0\r\n */\r\n this.cameras = [];\r\n\r\n /**\r\n * A handy reference to the 'main' camera. By default this is the first Camera the\r\n * Camera Manager creates. You can also set it directly, or use the `makeMain` argument\r\n * in the `add` and `addExisting` methods. It allows you to access it from your game:\r\n * \r\n * ```javascript\r\n * var cam = this.cameras.main;\r\n * ```\r\n * \r\n * Also see the properties `camera1`, `camera2` and so on.\r\n *\r\n * @name Phaser.Cameras.Scene2D.CameraManager#main\r\n * @type {Phaser.Cameras.Scene2D.Camera}\r\n * @since 3.0.0\r\n */\r\n this.main;\r\n\r\n /**\r\n * A default un-transformed Camera that doesn't exist on the camera list and doesn't\r\n * count towards the total number of cameras being managed. It exists for other\r\n * systems, as well as your own code, should they require a basic un-transformed\r\n * camera instance from which to calculate a view matrix.\r\n *\r\n * @name Phaser.Cameras.Scene2D.CameraManager#default\r\n * @type {Phaser.Cameras.Scene2D.Camera}\r\n * @since 3.17.0\r\n */\r\n this.default;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n scene.sys.events.on(SceneEvents.START, this.start, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#boot\r\n * @private\r\n * @listens Phaser.Scenes.Events#DESTROY\r\n * @since 3.5.1\r\n */\r\n boot: function ()\r\n {\r\n var sys = this.systems;\r\n\r\n if (sys.settings.cameras)\r\n {\r\n // We have cameras to create\r\n this.fromJSON(sys.settings.cameras);\r\n }\r\n else\r\n {\r\n // Make one\r\n this.add();\r\n }\r\n\r\n this.main = this.cameras[0];\r\n\r\n // Create a default camera\r\n this.default = new Camera(0, 0, sys.scale.width, sys.scale.height).setScene(this.scene);\r\n\r\n sys.game.scale.on(ScaleEvents.RESIZE, this.onResize, this);\r\n\r\n this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#start\r\n * @private\r\n * @listens Phaser.Scenes.Events#UPDATE\r\n * @listens Phaser.Scenes.Events#SHUTDOWN\r\n * @since 3.5.0\r\n */\r\n start: function ()\r\n {\r\n if (!this.main)\r\n {\r\n var sys = this.systems;\r\n\r\n if (sys.settings.cameras)\r\n {\r\n // We have cameras to create\r\n this.fromJSON(sys.settings.cameras);\r\n }\r\n else\r\n {\r\n // Make one\r\n this.add();\r\n }\r\n \r\n this.main = this.cameras[0];\r\n }\r\n\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.on(SceneEvents.UPDATE, this.update, this);\r\n eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * Adds a new Camera into the Camera Manager. The Camera Manager can support up to 31 different Cameras.\r\n * \r\n * Each Camera has its own viewport, which controls the size of the Camera and its position within the canvas.\r\n * \r\n * Use the `Camera.scrollX` and `Camera.scrollY` properties to change where the Camera is looking, or the\r\n * Camera methods such as `centerOn`. Cameras also have built in special effects, such as fade, flash, shake,\r\n * pan and zoom.\r\n * \r\n * By default Cameras are transparent and will render anything that they can see based on their `scrollX`\r\n * and `scrollY` values. Game Objects can be set to be ignored by a Camera by using the `Camera.ignore` method.\r\n * \r\n * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change\r\n * it after creation if required.\r\n * \r\n * See the Camera class documentation for more details.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#add\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [x=0] - The horizontal position of the Camera viewport.\r\n * @param {integer} [y=0] - The vertical position of the Camera viewport.\r\n * @param {integer} [width] - The width of the Camera viewport. If not given it'll be the game config size.\r\n * @param {integer} [height] - The height of the Camera viewport. If not given it'll be the game config size.\r\n * @param {boolean} [makeMain=false] - Set this Camera as being the 'main' camera. This just makes the property `main` a reference to it.\r\n * @param {string} [name=''] - The name of the Camera.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} The newly created Camera.\r\n */\r\n add: function (x, y, width, height, makeMain, name)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = this.scene.sys.scale.width; }\r\n if (height === undefined) { height = this.scene.sys.scale.height; }\r\n if (makeMain === undefined) { makeMain = false; }\r\n if (name === undefined) { name = ''; }\r\n\r\n var camera = new Camera(x, y, width, height);\r\n\r\n camera.setName(name);\r\n camera.setScene(this.scene);\r\n camera.setRoundPixels(this.roundPixels);\r\n\r\n camera.id = this.getNextID();\r\n\r\n this.cameras.push(camera);\r\n\r\n if (makeMain)\r\n {\r\n this.main = camera;\r\n }\r\n\r\n return camera;\r\n },\r\n\r\n /**\r\n * Adds an existing Camera into the Camera Manager.\r\n * \r\n * The Camera should either be a `Phaser.Cameras.Scene2D.Camera` instance, or a class that extends from it.\r\n * \r\n * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change\r\n * it after addition if required.\r\n * \r\n * The Camera will be assigned an ID, which is used for Game Object exclusion and then added to the\r\n * manager. As long as it doesn't already exist in the manager it will be added then returned.\r\n * \r\n * If this method returns `null` then the Camera already exists in this Camera Manager.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#addExisting\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to be added to the Camera Manager.\r\n * @param {boolean} [makeMain=false] - Set this Camera as being the 'main' camera. This just makes the property `main` a reference to it.\r\n *\r\n * @return {?Phaser.Cameras.Scene2D.Camera} The Camera that was added to the Camera Manager, or `null` if it couldn't be added.\r\n */\r\n addExisting: function (camera, makeMain)\r\n {\r\n if (makeMain === undefined) { makeMain = false; }\r\n\r\n var index = this.cameras.indexOf(camera);\r\n\r\n if (index === -1)\r\n {\r\n camera.id = this.getNextID();\r\n\r\n camera.setRoundPixels(this.roundPixels);\r\n\r\n this.cameras.push(camera);\r\n\r\n if (makeMain)\r\n {\r\n this.main = camera;\r\n }\r\n \r\n return camera;\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Gets the next available Camera ID number.\r\n * \r\n * The Camera Manager supports up to 31 unique cameras, after which the ID returned will always be zero.\r\n * You can create additional cameras beyond 31, but they cannot be used for Game Object exclusion.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#getNextID\r\n * @private\r\n * @since 3.11.0\r\n *\r\n * @return {number} The next available Camera ID, or 0 if they're all already in use.\r\n */\r\n getNextID: function ()\r\n {\r\n var cameras = this.cameras;\r\n\r\n var testID = 1;\r\n\r\n // Find the first free camera ID we can use\r\n\r\n for (var t = 0; t < 32; t++)\r\n {\r\n var found = false;\r\n\r\n for (var i = 0; i < cameras.length; i++)\r\n {\r\n var camera = cameras[i];\r\n\r\n if (camera && camera.id === testID)\r\n {\r\n found = true;\r\n continue;\r\n }\r\n }\r\n\r\n if (found)\r\n {\r\n testID = testID << 1;\r\n }\r\n else\r\n {\r\n return testID;\r\n }\r\n }\r\n\r\n return 0;\r\n },\r\n\r\n /**\r\n * Gets the total number of Cameras in this Camera Manager.\r\n * \r\n * If the optional `isVisible` argument is set it will only count Cameras that are currently visible.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#getTotal\r\n * @since 3.11.0\r\n * \r\n * @param {boolean} [isVisible=false] - Set the `true` to only include visible Cameras in the total.\r\n *\r\n * @return {integer} The total number of Cameras in this Camera Manager.\r\n */\r\n getTotal: function (isVisible)\r\n {\r\n if (isVisible === undefined) { isVisible = false; }\r\n\r\n var total = 0;\r\n\r\n var cameras = this.cameras;\r\n\r\n for (var i = 0; i < cameras.length; i++)\r\n {\r\n var camera = cameras[i];\r\n\r\n if (!isVisible || (isVisible && camera.visible))\r\n {\r\n total++;\r\n }\r\n }\r\n\r\n return total;\r\n },\r\n\r\n /**\r\n * Populates this Camera Manager based on the given configuration object, or an array of config objects.\r\n * \r\n * See the `Phaser.Types.Cameras.Scene2D.CameraConfig` documentation for details of the object structure.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#fromJSON\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Types.Cameras.Scene2D.CameraConfig|Phaser.Types.Cameras.Scene2D.CameraConfig[])} config - A Camera configuration object, or an array of them, to be added to this Camera Manager.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.CameraManager} This Camera Manager instance.\r\n */\r\n fromJSON: function (config)\r\n {\r\n if (!Array.isArray(config))\r\n {\r\n config = [ config ];\r\n }\r\n\r\n var gameWidth = this.scene.sys.scale.width;\r\n var gameHeight = this.scene.sys.scale.height;\r\n\r\n for (var i = 0; i < config.length; i++)\r\n {\r\n var cameraConfig = config[i];\r\n\r\n var x = GetFastValue(cameraConfig, 'x', 0);\r\n var y = GetFastValue(cameraConfig, 'y', 0);\r\n var width = GetFastValue(cameraConfig, 'width', gameWidth);\r\n var height = GetFastValue(cameraConfig, 'height', gameHeight);\r\n\r\n var camera = this.add(x, y, width, height);\r\n\r\n // Direct properties\r\n camera.name = GetFastValue(cameraConfig, 'name', '');\r\n camera.zoom = GetFastValue(cameraConfig, 'zoom', 1);\r\n camera.rotation = GetFastValue(cameraConfig, 'rotation', 0);\r\n camera.scrollX = GetFastValue(cameraConfig, 'scrollX', 0);\r\n camera.scrollY = GetFastValue(cameraConfig, 'scrollY', 0);\r\n camera.roundPixels = GetFastValue(cameraConfig, 'roundPixels', false);\r\n camera.visible = GetFastValue(cameraConfig, 'visible', true);\r\n\r\n // Background Color\r\n\r\n var backgroundColor = GetFastValue(cameraConfig, 'backgroundColor', false);\r\n\r\n if (backgroundColor)\r\n {\r\n camera.setBackgroundColor(backgroundColor);\r\n }\r\n\r\n // Bounds\r\n\r\n var boundsConfig = GetFastValue(cameraConfig, 'bounds', null);\r\n\r\n if (boundsConfig)\r\n {\r\n var bx = GetFastValue(boundsConfig, 'x', 0);\r\n var by = GetFastValue(boundsConfig, 'y', 0);\r\n var bwidth = GetFastValue(boundsConfig, 'width', gameWidth);\r\n var bheight = GetFastValue(boundsConfig, 'height', gameHeight);\r\n\r\n camera.setBounds(bx, by, bwidth, bheight);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets a Camera based on its name.\r\n * \r\n * Camera names are optional and don't have to be set, so this method is only of any use if you\r\n * have given your Cameras unique names.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#getCamera\r\n * @since 3.0.0\r\n *\r\n * @param {string} name - The name of the Camera.\r\n *\r\n * @return {?Phaser.Cameras.Scene2D.Camera} The first Camera with a name matching the given string, otherwise `null`.\r\n */\r\n getCamera: function (name)\r\n {\r\n var cameras = this.cameras;\r\n\r\n for (var i = 0; i < cameras.length; i++)\r\n {\r\n if (cameras[i].name === name)\r\n {\r\n return cameras[i];\r\n }\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Returns an array of all cameras below the given Pointer.\r\n * \r\n * The first camera in the array is the top-most camera in the camera list.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#getCamerasBelowPointer\r\n * @since 3.10.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The Pointer to check against.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera[]} An array of cameras below the Pointer.\r\n */\r\n getCamerasBelowPointer: function (pointer)\r\n {\r\n var cameras = this.cameras;\r\n\r\n var x = pointer.x;\r\n var y = pointer.y;\r\n\r\n var output = [];\r\n\r\n for (var i = 0; i < cameras.length; i++)\r\n {\r\n var camera = cameras[i];\r\n\r\n if (camera.visible && camera.inputEnabled && RectangleContains(camera, x, y))\r\n {\r\n // So the top-most camera is at the top of the search array\r\n output.unshift(camera);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Removes the given Camera, or an array of Cameras, from this Camera Manager.\r\n * \r\n * If found in the Camera Manager it will be immediately removed from the local cameras array.\r\n * If also currently the 'main' camera, 'main' will be reset to be camera 0.\r\n * \r\n * The removed Cameras are automatically destroyed if the `runDestroy` argument is `true`, which is the default.\r\n * If you wish to re-use the cameras then set this to `false`, but know that they will retain their references\r\n * and internal data until destroyed or re-added to a Camera Manager.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#remove\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Cameras.Scene2D.Camera|Phaser.Cameras.Scene2D.Camera[])} camera - The Camera, or an array of Cameras, to be removed from this Camera Manager.\r\n * @param {boolean} [runDestroy=true] - Automatically call `Camera.destroy` on each Camera removed from this Camera Manager.\r\n * \r\n * @return {integer} The total number of Cameras removed.\r\n */\r\n remove: function (camera, runDestroy)\r\n {\r\n if (runDestroy === undefined) { runDestroy = true; }\r\n\r\n if (!Array.isArray(camera))\r\n {\r\n camera = [ camera ];\r\n }\r\n\r\n var total = 0;\r\n var cameras = this.cameras;\r\n\r\n for (var i = 0; i < camera.length; i++)\r\n {\r\n var index = cameras.indexOf(camera[i]);\r\n\r\n if (index !== -1)\r\n {\r\n if (runDestroy)\r\n {\r\n cameras[index].destroy();\r\n }\r\n\r\n cameras.splice(index, 1);\r\n\r\n total++;\r\n }\r\n }\r\n\r\n if (!this.main && cameras[0])\r\n {\r\n this.main = cameras[0];\r\n }\r\n\r\n return total;\r\n },\r\n\r\n /**\r\n * The internal render method. This is called automatically by the Scene and should not be invoked directly.\r\n * \r\n * It will iterate through all local cameras and render them in turn, as long as they're visible and have\r\n * an alpha level > 0.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#render\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Renderer that will render the children to this camera.\r\n * @param {Phaser.GameObjects.GameObject[]} children - An array of renderable Game Objects.\r\n * @param {number} interpolation - Interpolation value. Reserved for future use.\r\n */\r\n render: function (renderer, children, interpolation)\r\n {\r\n var scene = this.scene;\r\n var cameras = this.cameras;\r\n\r\n for (var i = 0; i < this.cameras.length; i++)\r\n {\r\n var camera = cameras[i];\r\n\r\n if (camera.visible && camera.alpha > 0)\r\n {\r\n // Hard-coded to 1 for now\r\n camera.preRender(1);\r\n\r\n renderer.render(scene, children, interpolation, camera);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Resets this Camera Manager.\r\n * \r\n * This will iterate through all current Cameras, destroying them all, then it will reset the\r\n * cameras array, reset the ID counter and create 1 new single camera using the default values.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#resetAll\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} The freshly created main Camera.\r\n */\r\n resetAll: function ()\r\n {\r\n for (var i = 0; i < this.cameras.length; i++)\r\n {\r\n this.cameras[i].destroy();\r\n }\r\n\r\n this.cameras = [];\r\n\r\n this.main = this.add();\r\n\r\n return this.main;\r\n },\r\n\r\n /**\r\n * The main update loop. Called automatically when the Scene steps.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#update\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n update: function (time, delta)\r\n {\r\n for (var i = 0; i < this.cameras.length; i++)\r\n {\r\n this.cameras[i].update(time, delta);\r\n }\r\n },\r\n\r\n /**\r\n * The event handler that manages the `resize` event dispatched by the Scale Manager.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#onResize\r\n * @since 3.18.0\r\n *\r\n * @param {Phaser.Structs.Size} gameSize - The default Game Size object. This is the un-modified game dimensions.\r\n * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this.\r\n */\r\n onResize: function (gameSize, baseSize, displaySize, resolution, previousWidth, previousHeight)\r\n {\r\n for (var i = 0; i < this.cameras.length; i++)\r\n {\r\n var cam = this.cameras[i];\r\n\r\n // if camera is at 0x0 and was the size of the previous game size, then we can safely assume it\r\n // should be updated to match the new game size too\r\n\r\n if (cam._x === 0 && cam._y === 0 && cam._width === previousWidth && cam._height === previousHeight)\r\n {\r\n cam.setSize(baseSize.width, baseSize.height);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Resizes all cameras to the given dimensions.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#resize\r\n * @since 3.2.0\r\n *\r\n * @param {number} width - The new width of the camera.\r\n * @param {number} height - The new height of the camera.\r\n */\r\n resize: function (width, height)\r\n {\r\n for (var i = 0; i < this.cameras.length; i++)\r\n {\r\n this.cameras[i].setSize(width, height);\r\n }\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#shutdown\r\n * @private\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n this.main = undefined;\r\n\r\n for (var i = 0; i < this.cameras.length; i++)\r\n {\r\n this.cameras[i].destroy();\r\n }\r\n\r\n this.cameras = [];\r\n\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.off(SceneEvents.UPDATE, this.update, this);\r\n eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Phaser.Cameras.Scene2D.CameraManager#destroy\r\n * @private\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.default.destroy();\r\n\r\n this.scene.sys.events.off(SceneEvents.START, this.start, this);\r\n\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nPluginCache.register('CameraManager', CameraManager, 'cameras');\r\n\r\nmodule.exports = CameraManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/CameraManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/effects/Fade.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/effects/Fade.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = __webpack_require__(/*! ../../../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/cameras/2d/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Camera Fade effect.\r\n *\r\n * This effect will fade the camera viewport to the given color, over the duration specified.\r\n *\r\n * Only the camera viewport is faded. None of the objects it is displaying are impacted, i.e. their colors do\r\n * not change.\r\n *\r\n * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback,\r\n * which is invoked each frame for the duration of the effect, if required.\r\n *\r\n * @class Fade\r\n * @memberof Phaser.Cameras.Scene2D.Effects\r\n * @constructor\r\n * @since 3.5.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera this effect is acting upon.\r\n */\r\nvar Fade = new Class({\r\n\r\n initialize:\r\n\r\n function Fade (camera)\r\n {\r\n /**\r\n * The Camera this effect belongs to.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Fade#camera\r\n * @type {Phaser.Cameras.Scene2D.Camera}\r\n * @readonly\r\n * @since 3.5.0\r\n */\r\n this.camera = camera;\r\n\r\n /**\r\n * Is this effect actively running?\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Fade#isRunning\r\n * @type {boolean}\r\n * @readonly\r\n * @default false\r\n * @since 3.5.0\r\n */\r\n this.isRunning = false;\r\n\r\n /**\r\n * Has this effect finished running?\r\n *\r\n * This is different from `isRunning` because it remains set to `true` when the effect is over,\r\n * until the effect is either reset or started again.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Fade#isComplete\r\n * @type {boolean}\r\n * @readonly\r\n * @default false\r\n * @since 3.5.0\r\n */\r\n this.isComplete = false;\r\n\r\n /**\r\n * The direction of the fade.\r\n * `true` = fade out (transparent to color), `false` = fade in (color to transparent)\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Fade#direction\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.5.0\r\n */\r\n this.direction = true;\r\n\r\n /**\r\n * The duration of the effect, in milliseconds.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Fade#duration\r\n * @type {integer}\r\n * @readonly\r\n * @default 0\r\n * @since 3.5.0\r\n */\r\n this.duration = 0;\r\n\r\n /**\r\n * The value of the red color channel the camera will use for the fade effect.\r\n * A value between 0 and 255.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Fade#red\r\n * @type {integer}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this.red = 0;\r\n\r\n /**\r\n * The value of the green color channel the camera will use for the fade effect.\r\n * A value between 0 and 255.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Fade#green\r\n * @type {integer}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this.green = 0;\r\n\r\n /**\r\n * The value of the blue color channel the camera will use for the fade effect.\r\n * A value between 0 and 255.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Fade#blue\r\n * @type {integer}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this.blue = 0;\r\n\r\n /**\r\n * The value of the alpha channel used during the fade effect.\r\n * A value between 0 and 1.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Fade#alpha\r\n * @type {number}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this.alpha = 0;\r\n\r\n /**\r\n * If this effect is running this holds the current percentage of the progress, a value between 0 and 1.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Fade#progress\r\n * @type {number}\r\n * @since 3.5.0\r\n */\r\n this.progress = 0;\r\n\r\n /**\r\n * Effect elapsed timer.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Fade#_elapsed\r\n * @type {number}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this._elapsed = 0;\r\n\r\n /**\r\n * This callback is invoked every frame for the duration of the effect.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Fade#_onUpdate\r\n * @type {?Phaser.Types.Cameras.Scene2D.CameraFadeCallback}\r\n * @private\r\n * @default null\r\n * @since 3.5.0\r\n */\r\n this._onUpdate;\r\n\r\n /**\r\n * On Complete callback scope.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Fade#_onUpdateScope\r\n * @type {any}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this._onUpdateScope;\r\n },\r\n\r\n /**\r\n * Fades the Camera to or from the given color over the duration specified.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Fade#start\r\n * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_START\r\n * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_START\r\n * @since 3.5.0\r\n *\r\n * @param {boolean} [direction=true] - The direction of the fade. `true` = fade out (transparent to color), `false` = fade in (color to transparent)\r\n * @param {integer} [duration=1000] - The duration of the effect in milliseconds.\r\n * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255.\r\n * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255.\r\n * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255.\r\n * @param {boolean} [force=false] - Force the effect to start immediately, even if already running.\r\n * @param {Phaser.Types.Cameras.Scene2D.CameraFadeCallback} [callback] - This callback will be invoked every frame for the duration of the effect.\r\n * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is.\r\n * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} The Camera on which the effect was started.\r\n */\r\n start: function (direction, duration, red, green, blue, force, callback, context)\r\n {\r\n if (direction === undefined) { direction = true; }\r\n if (duration === undefined) { duration = 1000; }\r\n if (red === undefined) { red = 0; }\r\n if (green === undefined) { green = 0; }\r\n if (blue === undefined) { blue = 0; }\r\n if (force === undefined) { force = false; }\r\n if (callback === undefined) { callback = null; }\r\n if (context === undefined) { context = this.camera.scene; }\r\n\r\n if (!force && this.isRunning)\r\n {\r\n return this.camera;\r\n }\r\n\r\n this.isRunning = true;\r\n this.isComplete = false;\r\n this.duration = duration;\r\n this.direction = direction;\r\n this.progress = 0;\r\n\r\n this.red = red;\r\n this.green = green;\r\n this.blue = blue;\r\n this.alpha = (direction) ? Number.MIN_VALUE : 1;\r\n\r\n this._elapsed = 0;\r\n\r\n this._onUpdate = callback;\r\n this._onUpdateScope = context;\r\n\r\n var eventName = (direction) ? Events.FADE_OUT_START : Events.FADE_IN_START;\r\n\r\n this.camera.emit(eventName, this.camera, this, duration, red, green, blue);\r\n\r\n return this.camera;\r\n },\r\n\r\n /**\r\n * The main update loop for this effect. Called automatically by the Camera.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Fade#update\r\n * @since 3.5.0\r\n *\r\n * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n update: function (time, delta)\r\n {\r\n if (!this.isRunning)\r\n {\r\n return;\r\n }\r\n\r\n this._elapsed += delta;\r\n\r\n this.progress = Clamp(this._elapsed / this.duration, 0, 1);\r\n\r\n if (this._onUpdate)\r\n {\r\n this._onUpdate.call(this._onUpdateScope, this.camera, this.progress);\r\n }\r\n\r\n if (this._elapsed < this.duration)\r\n {\r\n this.alpha = (this.direction) ? this.progress : 1 - this.progress;\r\n }\r\n else\r\n {\r\n this.alpha = (this.direction) ? 1 : 0;\r\n this.effectComplete();\r\n }\r\n },\r\n\r\n /**\r\n * Called internally by the Canvas Renderer.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Fade#postRenderCanvas\r\n * @since 3.5.0\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The Canvas context to render to.\r\n *\r\n * @return {boolean} `true` if the effect drew to the renderer, otherwise `false`.\r\n */\r\n postRenderCanvas: function (ctx)\r\n {\r\n if (!this.isRunning && !this.isComplete)\r\n {\r\n return false;\r\n }\r\n\r\n var camera = this.camera;\r\n\r\n ctx.fillStyle = 'rgba(' + this.red + ',' + this.green + ',' + this.blue + ',' + this.alpha + ')';\r\n ctx.fillRect(camera._cx, camera._cy, camera._cw, camera._ch);\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Called internally by the WebGL Renderer.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Fade#postRenderWebGL\r\n * @since 3.5.0\r\n *\r\n * @param {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} pipeline - The WebGL Pipeline to render to.\r\n * @param {function} getTintFunction - A function that will return the gl safe tint colors.\r\n *\r\n * @return {boolean} `true` if the effect drew to the renderer, otherwise `false`.\r\n */\r\n postRenderWebGL: function (pipeline, getTintFunction)\r\n {\r\n if (!this.isRunning && !this.isComplete)\r\n {\r\n return false;\r\n }\r\n\r\n var camera = this.camera;\r\n var red = this.red / 255;\r\n var blue = this.blue / 255;\r\n var green = this.green / 255;\r\n\r\n pipeline.drawFillRect(\r\n camera._cx, camera._cy, camera._cw, camera._ch,\r\n getTintFunction(red, green, blue, 1),\r\n this.alpha\r\n );\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Called internally when the effect completes.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Fade#effectComplete\r\n * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE\r\n * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE\r\n * @since 3.5.0\r\n */\r\n effectComplete: function ()\r\n {\r\n this._onUpdate = null;\r\n this._onUpdateScope = null;\r\n\r\n this.isRunning = false;\r\n this.isComplete = true;\r\n\r\n var eventName = (this.direction) ? Events.FADE_OUT_COMPLETE : Events.FADE_IN_COMPLETE;\r\n\r\n this.camera.emit(eventName, this.camera, this);\r\n },\r\n\r\n /**\r\n * Resets this camera effect.\r\n * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Fade#reset\r\n * @since 3.5.0\r\n */\r\n reset: function ()\r\n {\r\n this.isRunning = false;\r\n this.isComplete = false;\r\n\r\n this._onUpdate = null;\r\n this._onUpdateScope = null;\r\n },\r\n\r\n /**\r\n * Destroys this effect, releasing it from the Camera.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Fade#destroy\r\n * @since 3.5.0\r\n */\r\n destroy: function ()\r\n {\r\n this.reset();\r\n\r\n this.camera = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Fade;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/effects/Fade.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/effects/Flash.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/effects/Flash.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = __webpack_require__(/*! ../../../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/cameras/2d/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Camera Flash effect.\r\n *\r\n * This effect will flash the camera viewport to the given color, over the duration specified.\r\n *\r\n * Only the camera viewport is flashed. None of the objects it is displaying are impacted, i.e. their colors do\r\n * not change.\r\n *\r\n * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback,\r\n * which is invoked each frame for the duration of the effect, if required.\r\n *\r\n * @class Flash\r\n * @memberof Phaser.Cameras.Scene2D.Effects\r\n * @constructor\r\n * @since 3.5.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera this effect is acting upon.\r\n */\r\nvar Flash = new Class({\r\n\r\n initialize:\r\n\r\n function Flash (camera)\r\n {\r\n /**\r\n * The Camera this effect belongs to.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Flash#camera\r\n * @type {Phaser.Cameras.Scene2D.Camera}\r\n * @readonly\r\n * @since 3.5.0\r\n */\r\n this.camera = camera;\r\n\r\n /**\r\n * Is this effect actively running?\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Flash#isRunning\r\n * @type {boolean}\r\n * @readonly\r\n * @default false\r\n * @since 3.5.0\r\n */\r\n this.isRunning = false;\r\n\r\n /**\r\n * The duration of the effect, in milliseconds.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Flash#duration\r\n * @type {integer}\r\n * @readonly\r\n * @default 0\r\n * @since 3.5.0\r\n */\r\n this.duration = 0;\r\n\r\n /**\r\n * The value of the red color channel the camera will use for the fade effect.\r\n * A value between 0 and 255.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Flash#red\r\n * @type {integer}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this.red = 0;\r\n\r\n /**\r\n * The value of the green color channel the camera will use for the fade effect.\r\n * A value between 0 and 255.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Flash#green\r\n * @type {integer}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this.green = 0;\r\n\r\n /**\r\n * The value of the blue color channel the camera will use for the fade effect.\r\n * A value between 0 and 255.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Flash#blue\r\n * @type {integer}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this.blue = 0;\r\n\r\n /**\r\n * The value of the alpha channel used during the fade effect.\r\n * A value between 0 and 1.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Flash#alpha\r\n * @type {number}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this.alpha = 0;\r\n\r\n /**\r\n * If this effect is running this holds the current percentage of the progress, a value between 0 and 1.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Flash#progress\r\n * @type {number}\r\n * @since 3.5.0\r\n */\r\n this.progress = 0;\r\n\r\n /**\r\n * Effect elapsed timer.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Flash#_elapsed\r\n * @type {number}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this._elapsed = 0;\r\n\r\n /**\r\n * This callback is invoked every frame for the duration of the effect.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Flash#_onUpdate\r\n * @type {?Phaser.Types.Cameras.Scene2D.CameraFlashCallback}\r\n * @private\r\n * @default null\r\n * @since 3.5.0\r\n */\r\n this._onUpdate;\r\n\r\n /**\r\n * On Complete callback scope.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Flash#_onUpdateScope\r\n * @type {any}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this._onUpdateScope;\r\n },\r\n\r\n /**\r\n * Flashes the Camera to or from the given color over the duration specified.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Flash#start\r\n * @fires Phaser.Cameras.Scene2D.Events#FLASH_START\r\n * @fires Phaser.Cameras.Scene2D.Events#FLASH_COMPLETE\r\n * @since 3.5.0\r\n *\r\n * @param {integer} [duration=250] - The duration of the effect in milliseconds.\r\n * @param {integer} [red=255] - The amount to fade the red channel towards. A value between 0 and 255.\r\n * @param {integer} [green=255] - The amount to fade the green channel towards. A value between 0 and 255.\r\n * @param {integer} [blue=255] - The amount to fade the blue channel towards. A value between 0 and 255.\r\n * @param {boolean} [force=false] - Force the effect to start immediately, even if already running.\r\n * @param {Phaser.Types.Cameras.Scene2D.CameraFlashCallback} [callback] - This callback will be invoked every frame for the duration of the effect.\r\n * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is.\r\n * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} The Camera on which the effect was started.\r\n */\r\n start: function (duration, red, green, blue, force, callback, context)\r\n {\r\n if (duration === undefined) { duration = 250; }\r\n if (red === undefined) { red = 255; }\r\n if (green === undefined) { green = 255; }\r\n if (blue === undefined) { blue = 255; }\r\n if (force === undefined) { force = false; }\r\n if (callback === undefined) { callback = null; }\r\n if (context === undefined) { context = this.camera.scene; }\r\n\r\n if (!force && this.isRunning)\r\n {\r\n return this.camera;\r\n }\r\n\r\n this.isRunning = true;\r\n this.duration = duration;\r\n this.progress = 0;\r\n\r\n this.red = red;\r\n this.green = green;\r\n this.blue = blue;\r\n this.alpha = 1;\r\n\r\n this._elapsed = 0;\r\n\r\n this._onUpdate = callback;\r\n this._onUpdateScope = context;\r\n\r\n this.camera.emit(Events.FLASH_START, this.camera, this, duration, red, green, blue);\r\n\r\n return this.camera;\r\n },\r\n\r\n /**\r\n * The main update loop for this effect. Called automatically by the Camera.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Flash#update\r\n * @since 3.5.0\r\n *\r\n * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n update: function (time, delta)\r\n {\r\n if (!this.isRunning)\r\n {\r\n return;\r\n }\r\n\r\n this._elapsed += delta;\r\n\r\n this.progress = Clamp(this._elapsed / this.duration, 0, 1);\r\n\r\n if (this._onUpdate)\r\n {\r\n this._onUpdate.call(this._onUpdateScope, this.camera, this.progress);\r\n }\r\n\r\n if (this._elapsed < this.duration)\r\n {\r\n this.alpha = 1 - this.progress;\r\n }\r\n else\r\n {\r\n this.effectComplete();\r\n }\r\n },\r\n\r\n /**\r\n * Called internally by the Canvas Renderer.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Flash#postRenderCanvas\r\n * @since 3.5.0\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The Canvas context to render to.\r\n *\r\n * @return {boolean} `true` if the effect drew to the renderer, otherwise `false`.\r\n */\r\n postRenderCanvas: function (ctx)\r\n {\r\n if (!this.isRunning)\r\n {\r\n return false;\r\n }\r\n\r\n var camera = this.camera;\r\n\r\n ctx.fillStyle = 'rgba(' + this.red + ',' + this.green + ',' + this.blue + ',' + this.alpha + ')';\r\n ctx.fillRect(camera._cx, camera._cy, camera._cw, camera._ch);\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Called internally by the WebGL Renderer.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Flash#postRenderWebGL\r\n * @since 3.5.0\r\n *\r\n * @param {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} pipeline - The WebGL Pipeline to render to.\r\n * @param {function} getTintFunction - A function that will return the gl safe tint colors.\r\n *\r\n * @return {boolean} `true` if the effect drew to the renderer, otherwise `false`.\r\n */\r\n postRenderWebGL: function (pipeline, getTintFunction)\r\n {\r\n if (!this.isRunning)\r\n {\r\n return false;\r\n }\r\n\r\n var camera = this.camera;\r\n var red = this.red / 255;\r\n var blue = this.blue / 255;\r\n var green = this.green / 255;\r\n\r\n pipeline.drawFillRect(\r\n camera._cx, camera._cy, camera._cw, camera._ch,\r\n getTintFunction(red, green, blue, 1),\r\n this.alpha\r\n );\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Called internally when the effect completes.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Flash#effectComplete\r\n * @fires Phaser.Cameras.Scene2D.Events#FLASH_COMPLETE\r\n * @since 3.5.0\r\n */\r\n effectComplete: function ()\r\n {\r\n this._onUpdate = null;\r\n this._onUpdateScope = null;\r\n\r\n this.isRunning = false;\r\n\r\n this.camera.emit(Events.FLASH_COMPLETE, this.camera, this);\r\n },\r\n\r\n /**\r\n * Resets this camera effect.\r\n * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Flash#reset\r\n * @since 3.5.0\r\n */\r\n reset: function ()\r\n {\r\n this.isRunning = false;\r\n\r\n this._onUpdate = null;\r\n this._onUpdateScope = null;\r\n },\r\n\r\n /**\r\n * Destroys this effect, releasing it from the Camera.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Flash#destroy\r\n * @since 3.5.0\r\n */\r\n destroy: function ()\r\n {\r\n this.reset();\r\n\r\n this.camera = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Flash;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/effects/Flash.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/effects/Pan.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/effects/Pan.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = __webpack_require__(/*! ../../../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EaseMap = __webpack_require__(/*! ../../../math/easing/EaseMap */ \"./node_modules/phaser/src/math/easing/EaseMap.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/cameras/2d/events/index.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Camera Pan effect.\r\n *\r\n * This effect will scroll the Camera so that the center of its viewport finishes at the given destination,\r\n * over the duration and with the ease specified.\r\n *\r\n * Only the camera scroll is moved. None of the objects it is displaying are impacted, i.e. their positions do\r\n * not change.\r\n *\r\n * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback,\r\n * which is invoked each frame for the duration of the effect if required.\r\n *\r\n * @class Pan\r\n * @memberof Phaser.Cameras.Scene2D.Effects\r\n * @constructor\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera this effect is acting upon.\r\n */\r\nvar Pan = new Class({\r\n\r\n initialize:\r\n\r\n function Pan (camera)\r\n {\r\n /**\r\n * The Camera this effect belongs to.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Pan#camera\r\n * @type {Phaser.Cameras.Scene2D.Camera}\r\n * @readonly\r\n * @since 3.11.0\r\n */\r\n this.camera = camera;\r\n\r\n /**\r\n * Is this effect actively running?\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Pan#isRunning\r\n * @type {boolean}\r\n * @readonly\r\n * @default false\r\n * @since 3.11.0\r\n */\r\n this.isRunning = false;\r\n\r\n /**\r\n * The duration of the effect, in milliseconds.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Pan#duration\r\n * @type {integer}\r\n * @readonly\r\n * @default 0\r\n * @since 3.11.0\r\n */\r\n this.duration = 0;\r\n\r\n /**\r\n * The starting scroll coordinates to pan the camera from.\r\n * \r\n * @name Phaser.Cameras.Scene2D.Effects.Pan#source\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.11.0\r\n */\r\n this.source = new Vector2();\r\n\r\n /**\r\n * The constantly updated value based on zoom.\r\n * \r\n * @name Phaser.Cameras.Scene2D.Effects.Pan#current\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.11.0\r\n */\r\n this.current = new Vector2();\r\n\r\n /**\r\n * The destination scroll coordinates to pan the camera to.\r\n * \r\n * @name Phaser.Cameras.Scene2D.Effects.Pan#destination\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.11.0\r\n */\r\n this.destination = new Vector2();\r\n\r\n /**\r\n * The ease function to use during the pan.\r\n * \r\n * @name Phaser.Cameras.Scene2D.Effects.Pan#ease\r\n * @type {function}\r\n * @since 3.11.0\r\n */\r\n this.ease;\r\n\r\n /**\r\n * If this effect is running this holds the current percentage of the progress, a value between 0 and 1.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Pan#progress\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n this.progress = 0;\r\n\r\n /**\r\n * Effect elapsed timer.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Pan#_elapsed\r\n * @type {number}\r\n * @private\r\n * @since 3.11.0\r\n */\r\n this._elapsed = 0;\r\n\r\n /**\r\n * This callback is invoked every frame for the duration of the effect.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Pan#_onUpdate\r\n * @type {?Phaser.Types.Cameras.Scene2D.CameraPanCallback}\r\n * @private\r\n * @default null\r\n * @since 3.11.0\r\n */\r\n this._onUpdate;\r\n\r\n /**\r\n * On Complete callback scope.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Pan#_onUpdateScope\r\n * @type {any}\r\n * @private\r\n * @since 3.11.0\r\n */\r\n this._onUpdateScope;\r\n },\r\n\r\n /**\r\n * This effect will scroll the Camera so that the center of its viewport finishes at the given destination,\r\n * over the duration and with the ease specified.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Pan#start\r\n * @fires Phaser.Cameras.Scene2D.Events#PAN_START\r\n * @fires Phaser.Cameras.Scene2D.Events#PAN_COMPLETE\r\n * @since 3.11.0\r\n *\r\n * @param {number} x - The destination x coordinate to scroll the center of the Camera viewport to.\r\n * @param {number} y - The destination y coordinate to scroll the center of the Camera viewport to.\r\n * @param {integer} [duration=1000] - The duration of the effect in milliseconds.\r\n * @param {(string|function)} [ease='Linear'] - The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function.\r\n * @param {boolean} [force=false] - Force the pan effect to start immediately, even if already running.\r\n * @param {Phaser.Types.Cameras.Scene2D.CameraPanCallback} [callback] - This callback will be invoked every frame for the duration of the effect.\r\n * It is sent four arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is,\r\n * the current camera scroll x coordinate and the current camera scroll y coordinate.\r\n * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} The Camera on which the effect was started.\r\n */\r\n start: function (x, y, duration, ease, force, callback, context)\r\n {\r\n if (duration === undefined) { duration = 1000; }\r\n if (ease === undefined) { ease = EaseMap.Linear; }\r\n if (force === undefined) { force = false; }\r\n if (callback === undefined) { callback = null; }\r\n if (context === undefined) { context = this.camera.scene; }\r\n\r\n var cam = this.camera;\r\n\r\n if (!force && this.isRunning)\r\n {\r\n return cam;\r\n }\r\n\r\n this.isRunning = true;\r\n this.duration = duration;\r\n this.progress = 0;\r\n\r\n // Starting from\r\n this.source.set(cam.scrollX, cam.scrollY);\r\n\r\n // Destination\r\n this.destination.set(x, y);\r\n\r\n // Zoom factored version\r\n cam.getScroll(x, y, this.current);\r\n\r\n // Using this ease\r\n if (typeof ease === 'string' && EaseMap.hasOwnProperty(ease))\r\n {\r\n this.ease = EaseMap[ease];\r\n }\r\n else if (typeof ease === 'function')\r\n {\r\n this.ease = ease;\r\n }\r\n\r\n this._elapsed = 0;\r\n\r\n this._onUpdate = callback;\r\n this._onUpdateScope = context;\r\n\r\n this.camera.emit(Events.PAN_START, this.camera, this, duration, x, y);\r\n\r\n return cam;\r\n },\r\n\r\n /**\r\n * The main update loop for this effect. Called automatically by the Camera.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Pan#update\r\n * @since 3.11.0\r\n *\r\n * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n update: function (time, delta)\r\n {\r\n if (!this.isRunning)\r\n {\r\n return;\r\n }\r\n\r\n this._elapsed += delta;\r\n\r\n var progress = Clamp(this._elapsed / this.duration, 0, 1);\r\n\r\n this.progress = progress;\r\n\r\n var cam = this.camera;\r\n\r\n if (this._elapsed < this.duration)\r\n {\r\n var v = this.ease(progress);\r\n\r\n cam.getScroll(this.destination.x, this.destination.y, this.current);\r\n\r\n var x = this.source.x + ((this.current.x - this.source.x) * v);\r\n var y = this.source.y + ((this.current.y - this.source.y) * v);\r\n\r\n cam.setScroll(x, y);\r\n\r\n if (this._onUpdate)\r\n {\r\n this._onUpdate.call(this._onUpdateScope, cam, progress, x, y);\r\n }\r\n }\r\n else\r\n {\r\n cam.centerOn(this.destination.x, this.destination.y);\r\n\r\n if (this._onUpdate)\r\n {\r\n this._onUpdate.call(this._onUpdateScope, cam, progress, cam.scrollX, cam.scrollY);\r\n }\r\n \r\n this.effectComplete();\r\n }\r\n },\r\n\r\n /**\r\n * Called internally when the effect completes.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Pan#effectComplete\r\n * @fires Phaser.Cameras.Scene2D.Events#PAN_COMPLETE\r\n * @since 3.11.0\r\n */\r\n effectComplete: function ()\r\n {\r\n this._onUpdate = null;\r\n this._onUpdateScope = null;\r\n\r\n this.isRunning = false;\r\n\r\n this.camera.emit(Events.PAN_COMPLETE, this.camera, this);\r\n },\r\n\r\n /**\r\n * Resets this camera effect.\r\n * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Pan#reset\r\n * @since 3.11.0\r\n */\r\n reset: function ()\r\n {\r\n this.isRunning = false;\r\n\r\n this._onUpdate = null;\r\n this._onUpdateScope = null;\r\n },\r\n\r\n /**\r\n * Destroys this effect, releasing it from the Camera.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Pan#destroy\r\n * @since 3.11.0\r\n */\r\n destroy: function ()\r\n {\r\n this.reset();\r\n\r\n this.camera = null;\r\n this.source = null;\r\n this.destination = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Pan;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/effects/Pan.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/effects/Shake.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/effects/Shake.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = __webpack_require__(/*! ../../../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/cameras/2d/events/index.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Camera Shake effect.\r\n *\r\n * This effect will shake the camera viewport by a random amount, bounded by the specified intensity, each frame.\r\n *\r\n * Only the camera viewport is moved. None of the objects it is displaying are impacted, i.e. their positions do\r\n * not change.\r\n *\r\n * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback,\r\n * which is invoked each frame for the duration of the effect if required.\r\n *\r\n * @class Shake\r\n * @memberof Phaser.Cameras.Scene2D.Effects\r\n * @constructor\r\n * @since 3.5.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera this effect is acting upon.\r\n */\r\nvar Shake = new Class({\r\n\r\n initialize:\r\n\r\n function Shake (camera)\r\n {\r\n /**\r\n * The Camera this effect belongs to.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Shake#camera\r\n * @type {Phaser.Cameras.Scene2D.Camera}\r\n * @readonly\r\n * @since 3.5.0\r\n */\r\n this.camera = camera;\r\n\r\n /**\r\n * Is this effect actively running?\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Shake#isRunning\r\n * @type {boolean}\r\n * @readonly\r\n * @default false\r\n * @since 3.5.0\r\n */\r\n this.isRunning = false;\r\n\r\n /**\r\n * The duration of the effect, in milliseconds.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Shake#duration\r\n * @type {integer}\r\n * @readonly\r\n * @default 0\r\n * @since 3.5.0\r\n */\r\n this.duration = 0;\r\n\r\n /**\r\n * The intensity of the effect. Use small float values. The default when the effect starts is 0.05.\r\n * This is a Vector2 object, allowing you to control the shake intensity independently across x and y.\r\n * You can modify this value while the effect is active to create more varied shake effects.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Shake#intensity\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.5.0\r\n */\r\n this.intensity = new Vector2();\r\n\r\n /**\r\n * If this effect is running this holds the current percentage of the progress, a value between 0 and 1.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Shake#progress\r\n * @type {number}\r\n * @since 3.5.0\r\n */\r\n this.progress = 0;\r\n\r\n /**\r\n * Effect elapsed timer.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Shake#_elapsed\r\n * @type {number}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this._elapsed = 0;\r\n\r\n /**\r\n * How much to offset the camera by horizontally.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Shake#_offsetX\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._offsetX = 0;\r\n\r\n /**\r\n * How much to offset the camera by vertically.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Shake#_offsetY\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._offsetY = 0;\r\n\r\n /**\r\n * This callback is invoked every frame for the duration of the effect.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Shake#_onUpdate\r\n * @type {?Phaser.Types.Cameras.Scene2D.CameraShakeCallback}\r\n * @private\r\n * @default null\r\n * @since 3.5.0\r\n */\r\n this._onUpdate;\r\n\r\n /**\r\n * On Complete callback scope.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Shake#_onUpdateScope\r\n * @type {any}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this._onUpdateScope;\r\n },\r\n\r\n /**\r\n * Shakes the Camera by the given intensity over the duration specified.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Shake#start\r\n * @fires Phaser.Cameras.Scene2D.Events#SHAKE_START\r\n * @fires Phaser.Cameras.Scene2D.Events#SHAKE_COMPLETE\r\n * @since 3.5.0\r\n *\r\n * @param {integer} [duration=100] - The duration of the effect in milliseconds.\r\n * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake.\r\n * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running.\r\n * @param {Phaser.Types.Cameras.Scene2D.CameraShakeCallback} [callback] - This callback will be invoked every frame for the duration of the effect.\r\n * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is.\r\n * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} The Camera on which the effect was started.\r\n */\r\n start: function (duration, intensity, force, callback, context)\r\n {\r\n if (duration === undefined) { duration = 100; }\r\n if (intensity === undefined) { intensity = 0.05; }\r\n if (force === undefined) { force = false; }\r\n if (callback === undefined) { callback = null; }\r\n if (context === undefined) { context = this.camera.scene; }\r\n\r\n if (!force && this.isRunning)\r\n {\r\n return this.camera;\r\n }\r\n\r\n this.isRunning = true;\r\n this.duration = duration;\r\n this.progress = 0;\r\n\r\n if (typeof intensity === 'number')\r\n {\r\n this.intensity.set(intensity);\r\n }\r\n else\r\n {\r\n this.intensity.set(intensity.x, intensity.y);\r\n }\r\n\r\n this._elapsed = 0;\r\n this._offsetX = 0;\r\n this._offsetY = 0;\r\n\r\n this._onUpdate = callback;\r\n this._onUpdateScope = context;\r\n\r\n this.camera.emit(Events.SHAKE_START, this.camera, this, duration, intensity);\r\n\r\n return this.camera;\r\n },\r\n\r\n /**\r\n * The pre-render step for this effect. Called automatically by the Camera.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Shake#preRender\r\n * @since 3.5.0\r\n */\r\n preRender: function ()\r\n {\r\n if (this.isRunning)\r\n {\r\n this.camera.matrix.translate(this._offsetX, this._offsetY);\r\n }\r\n },\r\n\r\n /**\r\n * The main update loop for this effect. Called automatically by the Camera.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Shake#update\r\n * @since 3.5.0\r\n *\r\n * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n update: function (time, delta)\r\n {\r\n if (!this.isRunning)\r\n {\r\n return;\r\n }\r\n\r\n this._elapsed += delta;\r\n\r\n this.progress = Clamp(this._elapsed / this.duration, 0, 1);\r\n\r\n if (this._onUpdate)\r\n {\r\n this._onUpdate.call(this._onUpdateScope, this.camera, this.progress);\r\n }\r\n\r\n if (this._elapsed < this.duration)\r\n {\r\n var intensity = this.intensity;\r\n var width = this.camera._cw;\r\n var height = this.camera._ch;\r\n var zoom = this.camera.zoom;\r\n\r\n this._offsetX = (Math.random() * intensity.x * width * 2 - intensity.x * width) * zoom;\r\n this._offsetY = (Math.random() * intensity.y * height * 2 - intensity.y * height) * zoom;\r\n\r\n if (this.camera.roundPixels)\r\n {\r\n this._offsetX = Math.round(this._offsetX);\r\n this._offsetY = Math.round(this._offsetY);\r\n }\r\n }\r\n else\r\n {\r\n this.effectComplete();\r\n }\r\n },\r\n\r\n /**\r\n * Called internally when the effect completes.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Shake#effectComplete\r\n * @fires Phaser.Cameras.Scene2D.Events#SHAKE_COMPLETE\r\n * @since 3.5.0\r\n */\r\n effectComplete: function ()\r\n {\r\n this._offsetX = 0;\r\n this._offsetY = 0;\r\n\r\n this._onUpdate = null;\r\n this._onUpdateScope = null;\r\n\r\n this.isRunning = false;\r\n\r\n this.camera.emit(Events.SHAKE_COMPLETE, this.camera, this);\r\n },\r\n\r\n /**\r\n * Resets this camera effect.\r\n * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Shake#reset\r\n * @since 3.5.0\r\n */\r\n reset: function ()\r\n {\r\n this.isRunning = false;\r\n\r\n this._offsetX = 0;\r\n this._offsetY = 0;\r\n\r\n this._onUpdate = null;\r\n this._onUpdateScope = null;\r\n },\r\n\r\n /**\r\n * Destroys this effect, releasing it from the Camera.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Shake#destroy\r\n * @since 3.5.0\r\n */\r\n destroy: function ()\r\n {\r\n this.reset();\r\n\r\n this.camera = null;\r\n this.intensity = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Shake;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/effects/Shake.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/effects/Zoom.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/effects/Zoom.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = __webpack_require__(/*! ../../../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EaseMap = __webpack_require__(/*! ../../../math/easing/EaseMap */ \"./node_modules/phaser/src/math/easing/EaseMap.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/cameras/2d/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Camera Zoom effect.\r\n *\r\n * This effect will zoom the Camera to the given scale, over the duration and with the ease specified.\r\n *\r\n * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback,\r\n * which is invoked each frame for the duration of the effect if required.\r\n *\r\n * @class Zoom\r\n * @memberof Phaser.Cameras.Scene2D.Effects\r\n * @constructor\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera this effect is acting upon.\r\n */\r\nvar Zoom = new Class({\r\n\r\n initialize:\r\n\r\n function Zoom (camera)\r\n {\r\n /**\r\n * The Camera this effect belongs to.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Zoom#camera\r\n * @type {Phaser.Cameras.Scene2D.Camera}\r\n * @readonly\r\n * @since 3.11.0\r\n */\r\n this.camera = camera;\r\n\r\n /**\r\n * Is this effect actively running?\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Zoom#isRunning\r\n * @type {boolean}\r\n * @readonly\r\n * @default false\r\n * @since 3.11.0\r\n */\r\n this.isRunning = false;\r\n\r\n /**\r\n * The duration of the effect, in milliseconds.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Zoom#duration\r\n * @type {integer}\r\n * @readonly\r\n * @default 0\r\n * @since 3.11.0\r\n */\r\n this.duration = 0;\r\n\r\n /**\r\n * The starting zoom value;\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Zoom#source\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n this.source = 1;\r\n\r\n /**\r\n * The destination zoom value.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Zoom#destination\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n this.destination = 1;\r\n\r\n /**\r\n * The ease function to use during the zoom.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Zoom#ease\r\n * @type {function}\r\n * @since 3.11.0\r\n */\r\n this.ease;\r\n\r\n /**\r\n * If this effect is running this holds the current percentage of the progress, a value between 0 and 1.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Zoom#progress\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n this.progress = 0;\r\n\r\n /**\r\n * Effect elapsed timer.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Zoom#_elapsed\r\n * @type {number}\r\n * @private\r\n * @since 3.11.0\r\n */\r\n this._elapsed = 0;\r\n\r\n /**\r\n * This callback is invoked every frame for the duration of the effect.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Zoom#_onUpdate\r\n * @type {?Phaser.Types.Cameras.Scene2D.CameraZoomCallback}\r\n * @private\r\n * @default null\r\n * @since 3.11.0\r\n */\r\n this._onUpdate;\r\n\r\n /**\r\n * On Complete callback scope.\r\n *\r\n * @name Phaser.Cameras.Scene2D.Effects.Zoom#_onUpdateScope\r\n * @type {any}\r\n * @private\r\n * @since 3.11.0\r\n */\r\n this._onUpdateScope;\r\n },\r\n\r\n /**\r\n * This effect will zoom the Camera to the given scale, over the duration and with the ease specified.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Zoom#start\r\n * @fires Phaser.Cameras.Scene2D.Events#ZOOM_START\r\n * @fires Phaser.Cameras.Scene2D.Events#ZOOM_COMPLETE\r\n * @since 3.11.0\r\n *\r\n * @param {number} zoom - The target Camera zoom value.\r\n * @param {integer} [duration=1000] - The duration of the effect in milliseconds.\r\n * @param {(string|function)} [ease='Linear'] - The ease to use for the Zoom. Can be any of the Phaser Easing constants or a custom function.\r\n * @param {boolean} [force=false] - Force the zoom effect to start immediately, even if already running.\r\n * @param {Phaser.Types.Cameras.Scene2D.CameraZoomCallback} [callback] - This callback will be invoked every frame for the duration of the effect.\r\n * It is sent three arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is,\r\n * and the current camera zoom value.\r\n * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs.\r\n *\r\n * @return {Phaser.Cameras.Scene2D.Camera} The Camera on which the effect was started.\r\n */\r\n start: function (zoom, duration, ease, force, callback, context)\r\n {\r\n if (duration === undefined) { duration = 1000; }\r\n if (ease === undefined) { ease = EaseMap.Linear; }\r\n if (force === undefined) { force = false; }\r\n if (callback === undefined) { callback = null; }\r\n if (context === undefined) { context = this.camera.scene; }\r\n\r\n var cam = this.camera;\r\n\r\n if (!force && this.isRunning)\r\n {\r\n return cam;\r\n }\r\n\r\n this.isRunning = true;\r\n this.duration = duration;\r\n this.progress = 0;\r\n\r\n // Starting from\r\n this.source = cam.zoom;\r\n\r\n // Zooming to\r\n this.destination = zoom;\r\n\r\n // Using this ease\r\n if (typeof ease === 'string' && EaseMap.hasOwnProperty(ease))\r\n {\r\n this.ease = EaseMap[ease];\r\n }\r\n else if (typeof ease === 'function')\r\n {\r\n this.ease = ease;\r\n }\r\n\r\n this._elapsed = 0;\r\n\r\n this._onUpdate = callback;\r\n this._onUpdateScope = context;\r\n\r\n this.camera.emit(Events.ZOOM_START, this.camera, this, duration, zoom);\r\n\r\n return cam;\r\n },\r\n\r\n /**\r\n * The main update loop for this effect. Called automatically by the Camera.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Zoom#update\r\n * @since 3.11.0\r\n *\r\n * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n update: function (time, delta)\r\n {\r\n if (!this.isRunning)\r\n {\r\n return;\r\n }\r\n\r\n this._elapsed += delta;\r\n\r\n this.progress = Clamp(this._elapsed / this.duration, 0, 1);\r\n\r\n if (this._elapsed < this.duration)\r\n {\r\n this.camera.zoom = this.source + ((this.destination - this.source) * this.ease(this.progress));\r\n\r\n if (this._onUpdate)\r\n {\r\n this._onUpdate.call(this._onUpdateScope, this.camera, this.progress, this.camera.zoom);\r\n }\r\n }\r\n else\r\n {\r\n this.camera.zoom = this.destination;\r\n\r\n if (this._onUpdate)\r\n {\r\n this._onUpdate.call(this._onUpdateScope, this.camera, this.progress, this.destination);\r\n }\r\n\r\n this.effectComplete();\r\n }\r\n },\r\n\r\n /**\r\n * Called internally when the effect completes.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Zoom#effectComplete\r\n * @fires Phaser.Cameras.Scene2D.Events#ZOOM_COMPLETE\r\n * @since 3.11.0\r\n */\r\n effectComplete: function ()\r\n {\r\n this._onUpdate = null;\r\n this._onUpdateScope = null;\r\n\r\n this.isRunning = false;\r\n\r\n this.camera.emit(Events.ZOOM_COMPLETE, this.camera, this);\r\n },\r\n\r\n /**\r\n * Resets this camera effect.\r\n * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Zoom#reset\r\n * @since 3.11.0\r\n */\r\n reset: function ()\r\n {\r\n this.isRunning = false;\r\n\r\n this._onUpdate = null;\r\n this._onUpdateScope = null;\r\n },\r\n\r\n /**\r\n * Destroys this effect, releasing it from the Camera.\r\n *\r\n * @method Phaser.Cameras.Scene2D.Effects.Zoom#destroy\r\n * @since 3.11.0\r\n */\r\n destroy: function ()\r\n {\r\n this.reset();\r\n\r\n this.camera = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Zoom;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/effects/Zoom.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/effects/index.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/effects/index.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Cameras.Scene2D.Effects\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Fade: __webpack_require__(/*! ./Fade */ \"./node_modules/phaser/src/cameras/2d/effects/Fade.js\"),\r\n Flash: __webpack_require__(/*! ./Flash */ \"./node_modules/phaser/src/cameras/2d/effects/Flash.js\"),\r\n Pan: __webpack_require__(/*! ./Pan */ \"./node_modules/phaser/src/cameras/2d/effects/Pan.js\"),\r\n Shake: __webpack_require__(/*! ./Shake */ \"./node_modules/phaser/src/cameras/2d/effects/Shake.js\"),\r\n Zoom: __webpack_require__(/*! ./Zoom */ \"./node_modules/phaser/src/cameras/2d/effects/Zoom.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/effects/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/DESTROY_EVENT.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/DESTROY_EVENT.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Destroy Camera Event.\r\n * \r\n * This event is dispatched by a Camera instance when it is destroyed by the Camera Manager.\r\n *\r\n * @event Phaser.Cameras.Scene2D.Events#DESTROY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Cameras.Scene2D.BaseCamera} camera - The camera that was destroyed.\r\n */\r\nmodule.exports = 'cameradestroy';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/DESTROY_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/FADE_IN_COMPLETE_EVENT.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/FADE_IN_COMPLETE_EVENT.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Camera Fade In Complete Event.\r\n * \r\n * This event is dispatched by a Camera instance when the Fade In Effect completes.\r\n * \r\n * Listen to it from a Camera instance using `Camera.on('camerafadeincomplete', listener)`.\r\n *\r\n * @event Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE\r\n * @since 3.3.0\r\n * \r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on.\r\n * @param {Phaser.Cameras.Scene2D.Effects.Fade} effect - A reference to the effect instance.\r\n */\r\nmodule.exports = 'camerafadeincomplete';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/FADE_IN_COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/FADE_IN_START_EVENT.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/FADE_IN_START_EVENT.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Camera Fade In Start Event.\r\n * \r\n * This event is dispatched by a Camera instance when the Fade In Effect starts.\r\n * \r\n * Listen to it from a Camera instance using `Camera.on('camerafadeinstart', listener)`.\r\n *\r\n * @event Phaser.Cameras.Scene2D.Events#FADE_IN_START\r\n * @since 3.3.0\r\n * \r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on.\r\n * @param {Phaser.Cameras.Scene2D.Effects.Fade} effect - A reference to the effect instance.\r\n * @param {integer} duration - The duration of the effect.\r\n * @param {integer} red - The red color channel value.\r\n * @param {integer} green - The green color channel value.\r\n * @param {integer} blue - The blue color channel value.\r\n */\r\nmodule.exports = 'camerafadeinstart';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/FADE_IN_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/FADE_OUT_COMPLETE_EVENT.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/FADE_OUT_COMPLETE_EVENT.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Camera Fade Out Complete Event.\r\n * \r\n * This event is dispatched by a Camera instance when the Fade Out Effect completes.\r\n * \r\n * Listen to it from a Camera instance using `Camera.on('camerafadeoutcomplete', listener)`.\r\n *\r\n * @event Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE\r\n * @since 3.3.0\r\n * \r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on.\r\n * @param {Phaser.Cameras.Scene2D.Effects.Fade} effect - A reference to the effect instance.\r\n */\r\nmodule.exports = 'camerafadeoutcomplete';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/FADE_OUT_COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/FADE_OUT_START_EVENT.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/FADE_OUT_START_EVENT.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Camera Fade Out Start Event.\r\n * \r\n * This event is dispatched by a Camera instance when the Fade Out Effect starts.\r\n * \r\n * Listen to it from a Camera instance using `Camera.on('camerafadeoutstart', listener)`.\r\n *\r\n * @event Phaser.Cameras.Scene2D.Events#FADE_OUT_START\r\n * @since 3.3.0\r\n * \r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on.\r\n * @param {Phaser.Cameras.Scene2D.Effects.Fade} effect - A reference to the effect instance.\r\n * @param {integer} duration - The duration of the effect.\r\n * @param {integer} red - The red color channel value.\r\n * @param {integer} green - The green color channel value.\r\n * @param {integer} blue - The blue color channel value.\r\n */\r\nmodule.exports = 'camerafadeoutstart';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/FADE_OUT_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/FLASH_COMPLETE_EVENT.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/FLASH_COMPLETE_EVENT.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Camera Flash Complete Event.\r\n * \r\n * This event is dispatched by a Camera instance when the Flash Effect completes.\r\n *\r\n * @event Phaser.Cameras.Scene2D.Events#FLASH_COMPLETE\r\n * @since 3.3.0\r\n * \r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on.\r\n * @param {Phaser.Cameras.Scene2D.Effects.Flash} effect - A reference to the effect instance.\r\n */\r\nmodule.exports = 'cameraflashcomplete';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/FLASH_COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/FLASH_START_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/FLASH_START_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Camera Flash Start Event.\r\n * \r\n * This event is dispatched by a Camera instance when the Flash Effect starts.\r\n *\r\n * @event Phaser.Cameras.Scene2D.Events#FLASH_START\r\n * @since 3.3.0\r\n * \r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on.\r\n * @param {Phaser.Cameras.Scene2D.Effects.Flash} effect - A reference to the effect instance.\r\n * @param {integer} duration - The duration of the effect.\r\n * @param {integer} red - The red color channel value.\r\n * @param {integer} green - The green color channel value.\r\n * @param {integer} blue - The blue color channel value.\r\n */\r\nmodule.exports = 'cameraflashstart';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/FLASH_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/PAN_COMPLETE_EVENT.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/PAN_COMPLETE_EVENT.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Camera Pan Complete Event.\r\n * \r\n * This event is dispatched by a Camera instance when the Pan Effect completes.\r\n *\r\n * @event Phaser.Cameras.Scene2D.Events#PAN_COMPLETE\r\n * @since 3.3.0\r\n * \r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on.\r\n * @param {Phaser.Cameras.Scene2D.Effects.Pan} effect - A reference to the effect instance.\r\n */\r\nmodule.exports = 'camerapancomplete';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/PAN_COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/PAN_START_EVENT.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/PAN_START_EVENT.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Camera Pan Start Event.\r\n * \r\n * This event is dispatched by a Camera instance when the Pan Effect starts.\r\n *\r\n * @event Phaser.Cameras.Scene2D.Events#PAN_START\r\n * @since 3.3.0\r\n * \r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on.\r\n * @param {Phaser.Cameras.Scene2D.Effects.Pan} effect - A reference to the effect instance.\r\n * @param {integer} duration - The duration of the effect.\r\n * @param {number} x - The destination scroll x coordinate.\r\n * @param {number} y - The destination scroll y coordinate.\r\n */\r\nmodule.exports = 'camerapanstart';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/PAN_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/POST_RENDER_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/POST_RENDER_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Camera Post-Render Event.\r\n * \r\n * This event is dispatched by a Camera instance after is has finished rendering.\r\n * It is only dispatched if the Camera is rendering to a texture.\r\n * \r\n * Listen to it from a Camera instance using: `camera.on('postrender', listener)`.\r\n *\r\n * @event Phaser.Cameras.Scene2D.Events#POST_RENDER\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Cameras.Scene2D.BaseCamera} camera - The camera that has finished rendering to a texture.\r\n */\r\nmodule.exports = 'postrender';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/POST_RENDER_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/PRE_RENDER_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/PRE_RENDER_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Camera Pre-Render Event.\r\n * \r\n * This event is dispatched by a Camera instance when it is about to render.\r\n * It is only dispatched if the Camera is rendering to a texture.\r\n * \r\n * Listen to it from a Camera instance using: `camera.on('prerender', listener)`.\r\n *\r\n * @event Phaser.Cameras.Scene2D.Events#PRE_RENDER\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Cameras.Scene2D.BaseCamera} camera - The camera that is about to render to a texture.\r\n */\r\nmodule.exports = 'prerender';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/PRE_RENDER_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/SHAKE_COMPLETE_EVENT.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/SHAKE_COMPLETE_EVENT.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Camera Shake Complete Event.\r\n * \r\n * This event is dispatched by a Camera instance when the Shake Effect completes.\r\n *\r\n * @event Phaser.Cameras.Scene2D.Events#SHAKE_COMPLETE\r\n * @since 3.3.0\r\n * \r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on.\r\n * @param {Phaser.Cameras.Scene2D.Effects.Shake} effect - A reference to the effect instance.\r\n */\r\nmodule.exports = 'camerashakecomplete';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/SHAKE_COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/SHAKE_START_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/SHAKE_START_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Camera Shake Start Event.\r\n * \r\n * This event is dispatched by a Camera instance when the Shake Effect starts.\r\n *\r\n * @event Phaser.Cameras.Scene2D.Events#SHAKE_START\r\n * @since 3.3.0\r\n * \r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on.\r\n * @param {Phaser.Cameras.Scene2D.Effects.Shake} effect - A reference to the effect instance.\r\n * @param {integer} duration - The duration of the effect.\r\n * @param {number} intensity - The intensity of the effect.\r\n */\r\nmodule.exports = 'camerashakestart';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/SHAKE_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/ZOOM_COMPLETE_EVENT.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/ZOOM_COMPLETE_EVENT.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Camera Zoom Complete Event.\r\n * \r\n * This event is dispatched by a Camera instance when the Zoom Effect completes.\r\n *\r\n * @event Phaser.Cameras.Scene2D.Events#ZOOM_COMPLETE\r\n * @since 3.3.0\r\n * \r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on.\r\n * @param {Phaser.Cameras.Scene2D.Effects.Zoom} effect - A reference to the effect instance.\r\n */\r\nmodule.exports = 'camerazoomcomplete';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/ZOOM_COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/ZOOM_START_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/ZOOM_START_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Camera Zoom Start Event.\r\n * \r\n * This event is dispatched by a Camera instance when the Zoom Effect starts.\r\n *\r\n * @event Phaser.Cameras.Scene2D.Events#ZOOM_START\r\n * @since 3.3.0\r\n * \r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on.\r\n * @param {Phaser.Cameras.Scene2D.Effects.Zoom} effect - A reference to the effect instance.\r\n * @param {integer} duration - The duration of the effect.\r\n * @param {number} zoom - The destination zoom value.\r\n */\r\nmodule.exports = 'camerazoomstart';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/ZOOM_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/events/index.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/events/index.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Cameras.Scene2D.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n DESTROY: __webpack_require__(/*! ./DESTROY_EVENT */ \"./node_modules/phaser/src/cameras/2d/events/DESTROY_EVENT.js\"),\r\n FADE_IN_COMPLETE: __webpack_require__(/*! ./FADE_IN_COMPLETE_EVENT */ \"./node_modules/phaser/src/cameras/2d/events/FADE_IN_COMPLETE_EVENT.js\"),\r\n FADE_IN_START: __webpack_require__(/*! ./FADE_IN_START_EVENT */ \"./node_modules/phaser/src/cameras/2d/events/FADE_IN_START_EVENT.js\"),\r\n FADE_OUT_COMPLETE: __webpack_require__(/*! ./FADE_OUT_COMPLETE_EVENT */ \"./node_modules/phaser/src/cameras/2d/events/FADE_OUT_COMPLETE_EVENT.js\"),\r\n FADE_OUT_START: __webpack_require__(/*! ./FADE_OUT_START_EVENT */ \"./node_modules/phaser/src/cameras/2d/events/FADE_OUT_START_EVENT.js\"),\r\n FLASH_COMPLETE: __webpack_require__(/*! ./FLASH_COMPLETE_EVENT */ \"./node_modules/phaser/src/cameras/2d/events/FLASH_COMPLETE_EVENT.js\"),\r\n FLASH_START: __webpack_require__(/*! ./FLASH_START_EVENT */ \"./node_modules/phaser/src/cameras/2d/events/FLASH_START_EVENT.js\"),\r\n PAN_COMPLETE: __webpack_require__(/*! ./PAN_COMPLETE_EVENT */ \"./node_modules/phaser/src/cameras/2d/events/PAN_COMPLETE_EVENT.js\"),\r\n PAN_START: __webpack_require__(/*! ./PAN_START_EVENT */ \"./node_modules/phaser/src/cameras/2d/events/PAN_START_EVENT.js\"),\r\n POST_RENDER: __webpack_require__(/*! ./POST_RENDER_EVENT */ \"./node_modules/phaser/src/cameras/2d/events/POST_RENDER_EVENT.js\"),\r\n PRE_RENDER: __webpack_require__(/*! ./PRE_RENDER_EVENT */ \"./node_modules/phaser/src/cameras/2d/events/PRE_RENDER_EVENT.js\"),\r\n SHAKE_COMPLETE: __webpack_require__(/*! ./SHAKE_COMPLETE_EVENT */ \"./node_modules/phaser/src/cameras/2d/events/SHAKE_COMPLETE_EVENT.js\"),\r\n SHAKE_START: __webpack_require__(/*! ./SHAKE_START_EVENT */ \"./node_modules/phaser/src/cameras/2d/events/SHAKE_START_EVENT.js\"),\r\n ZOOM_COMPLETE: __webpack_require__(/*! ./ZOOM_COMPLETE_EVENT */ \"./node_modules/phaser/src/cameras/2d/events/ZOOM_COMPLETE_EVENT.js\"),\r\n ZOOM_START: __webpack_require__(/*! ./ZOOM_START_EVENT */ \"./node_modules/phaser/src/cameras/2d/events/ZOOM_START_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/2d/index.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/cameras/2d/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Cameras.Scene2D\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Camera: __webpack_require__(/*! ./Camera */ \"./node_modules/phaser/src/cameras/2d/Camera.js\"),\r\n BaseCamera: __webpack_require__(/*! ./BaseCamera */ \"./node_modules/phaser/src/cameras/2d/BaseCamera.js\"),\r\n CameraManager: __webpack_require__(/*! ./CameraManager */ \"./node_modules/phaser/src/cameras/2d/CameraManager.js\"),\r\n Effects: __webpack_require__(/*! ./effects */ \"./node_modules/phaser/src/cameras/2d/effects/index.js\"),\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/cameras/2d/events/index.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/2d/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/controls/FixedKeyControl.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/cameras/controls/FixedKeyControl.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Fixed Key Camera Control.\r\n *\r\n * This allows you to control the movement and zoom of a camera using the defined keys.\r\n *\r\n * ```javascript\r\n * var camControl = new FixedKeyControl({\r\n * camera: this.cameras.main,\r\n * left: cursors.left,\r\n * right: cursors.right,\r\n * speed: float OR { x: 0, y: 0 }\r\n * });\r\n * ```\r\n *\r\n * Movement is precise and has no 'smoothing' applied to it.\r\n *\r\n * You must call the `update` method of this controller every frame.\r\n *\r\n * @class FixedKeyControl\r\n * @memberof Phaser.Cameras.Controls\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Cameras.Controls.FixedKeyControlConfig} config - The Fixed Key Control configuration object.\r\n */\r\nvar FixedKeyControl = new Class({\r\n\r\n initialize:\r\n\r\n function FixedKeyControl (config)\r\n {\r\n /**\r\n * The Camera that this Control will update.\r\n *\r\n * @name Phaser.Cameras.Controls.FixedKeyControl#camera\r\n * @type {?Phaser.Cameras.Scene2D.Camera}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.camera = GetValue(config, 'camera', null);\r\n\r\n /**\r\n * The Key to be pressed that will move the Camera left.\r\n *\r\n * @name Phaser.Cameras.Controls.FixedKeyControl#left\r\n * @type {?Phaser.Input.Keyboard.Key}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.left = GetValue(config, 'left', null);\r\n\r\n /**\r\n * The Key to be pressed that will move the Camera right.\r\n *\r\n * @name Phaser.Cameras.Controls.FixedKeyControl#right\r\n * @type {?Phaser.Input.Keyboard.Key}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.right = GetValue(config, 'right', null);\r\n\r\n /**\r\n * The Key to be pressed that will move the Camera up.\r\n *\r\n * @name Phaser.Cameras.Controls.FixedKeyControl#up\r\n * @type {?Phaser.Input.Keyboard.Key}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.up = GetValue(config, 'up', null);\r\n\r\n /**\r\n * The Key to be pressed that will move the Camera down.\r\n *\r\n * @name Phaser.Cameras.Controls.FixedKeyControl#down\r\n * @type {?Phaser.Input.Keyboard.Key}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.down = GetValue(config, 'down', null);\r\n\r\n /**\r\n * The Key to be pressed that will zoom the Camera in.\r\n *\r\n * @name Phaser.Cameras.Controls.FixedKeyControl#zoomIn\r\n * @type {?Phaser.Input.Keyboard.Key}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.zoomIn = GetValue(config, 'zoomIn', null);\r\n\r\n /**\r\n * The Key to be pressed that will zoom the Camera out.\r\n *\r\n * @name Phaser.Cameras.Controls.FixedKeyControl#zoomOut\r\n * @type {?Phaser.Input.Keyboard.Key}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.zoomOut = GetValue(config, 'zoomOut', null);\r\n\r\n /**\r\n * The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed.\r\n *\r\n * @name Phaser.Cameras.Controls.FixedKeyControl#zoomSpeed\r\n * @type {number}\r\n * @default 0.01\r\n * @since 3.0.0\r\n */\r\n this.zoomSpeed = GetValue(config, 'zoomSpeed', 0.01);\r\n\r\n /**\r\n * The horizontal speed the camera will move.\r\n *\r\n * @name Phaser.Cameras.Controls.FixedKeyControl#speedX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.speedX = 0;\r\n\r\n /**\r\n * The vertical speed the camera will move.\r\n *\r\n * @name Phaser.Cameras.Controls.FixedKeyControl#speedY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.speedY = 0;\r\n\r\n var speed = GetValue(config, 'speed', null);\r\n\r\n if (typeof speed === 'number')\r\n {\r\n this.speedX = speed;\r\n this.speedY = speed;\r\n }\r\n else\r\n {\r\n this.speedX = GetValue(config, 'speed.x', 0);\r\n this.speedY = GetValue(config, 'speed.y', 0);\r\n }\r\n\r\n /**\r\n * Internal property to track the current zoom level.\r\n *\r\n * @name Phaser.Cameras.Controls.FixedKeyControl#_zoom\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._zoom = 0;\r\n\r\n /**\r\n * A flag controlling if the Controls will update the Camera or not.\r\n *\r\n * @name Phaser.Cameras.Controls.FixedKeyControl#active\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.active = (this.camera !== null);\r\n },\r\n\r\n /**\r\n * Starts the Key Control running, providing it has been linked to a camera.\r\n *\r\n * @method Phaser.Cameras.Controls.FixedKeyControl#start\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Cameras.Controls.FixedKeyControl} This Key Control instance.\r\n */\r\n start: function ()\r\n {\r\n this.active = (this.camera !== null);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stops this Key Control from running. Call `start` to start it again.\r\n *\r\n * @method Phaser.Cameras.Controls.FixedKeyControl#stop\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Cameras.Controls.FixedKeyControl} This Key Control instance.\r\n */\r\n stop: function ()\r\n {\r\n this.active = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Binds this Key Control to a camera.\r\n *\r\n * @method Phaser.Cameras.Controls.FixedKeyControl#setCamera\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to bind this Key Control to.\r\n *\r\n * @return {Phaser.Cameras.Controls.FixedKeyControl} This Key Control instance.\r\n */\r\n setCamera: function (camera)\r\n {\r\n this.camera = camera;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Applies the results of pressing the control keys to the Camera.\r\n *\r\n * You must call this every step, it is not called automatically.\r\n *\r\n * @method Phaser.Cameras.Controls.FixedKeyControl#update\r\n * @since 3.0.0\r\n *\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\n update: function (delta)\r\n {\r\n if (!this.active)\r\n {\r\n return;\r\n }\r\n\r\n if (delta === undefined) { delta = 1; }\r\n\r\n var cam = this.camera;\r\n\r\n if (this.up && this.up.isDown)\r\n {\r\n cam.scrollY -= ((this.speedY * delta) | 0);\r\n }\r\n else if (this.down && this.down.isDown)\r\n {\r\n cam.scrollY += ((this.speedY * delta) | 0);\r\n }\r\n\r\n if (this.left && this.left.isDown)\r\n {\r\n cam.scrollX -= ((this.speedX * delta) | 0);\r\n }\r\n else if (this.right && this.right.isDown)\r\n {\r\n cam.scrollX += ((this.speedX * delta) | 0);\r\n }\r\n\r\n // Camera zoom\r\n\r\n if (this.zoomIn && this.zoomIn.isDown)\r\n {\r\n cam.zoom -= this.zoomSpeed;\r\n\r\n if (cam.zoom < 0.1)\r\n {\r\n cam.zoom = 0.1;\r\n }\r\n }\r\n else if (this.zoomOut && this.zoomOut.isDown)\r\n {\r\n cam.zoom += this.zoomSpeed;\r\n }\r\n },\r\n\r\n /**\r\n * Destroys this Key Control.\r\n *\r\n * @method Phaser.Cameras.Controls.FixedKeyControl#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.camera = null;\r\n\r\n this.left = null;\r\n this.right = null;\r\n this.up = null;\r\n this.down = null;\r\n\r\n this.zoomIn = null;\r\n this.zoomOut = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = FixedKeyControl;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/controls/FixedKeyControl.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/controls/SmoothedKeyControl.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/cameras/controls/SmoothedKeyControl.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Smoothed Key Camera Control.\r\n *\r\n * This allows you to control the movement and zoom of a camera using the defined keys.\r\n * Unlike the Fixed Camera Control you can also provide physics values for acceleration, drag and maxSpeed for smoothing effects.\r\n *\r\n * ```javascript\r\n * var controlConfig = {\r\n * camera: this.cameras.main,\r\n * left: cursors.left,\r\n * right: cursors.right,\r\n * up: cursors.up,\r\n * down: cursors.down,\r\n * zoomIn: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.Q),\r\n * zoomOut: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.E),\r\n * zoomSpeed: 0.02,\r\n * acceleration: 0.06,\r\n * drag: 0.0005,\r\n * maxSpeed: 1.0\r\n * };\r\n * ```\r\n * \r\n * You must call the `update` method of this controller every frame.\r\n *\r\n * @class SmoothedKeyControl\r\n * @memberof Phaser.Cameras.Controls\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Cameras.Controls.SmoothedKeyControlConfig} config - The Smoothed Key Control configuration object.\r\n */\r\nvar SmoothedKeyControl = new Class({\r\n\r\n initialize:\r\n\r\n function SmoothedKeyControl (config)\r\n {\r\n /**\r\n * The Camera that this Control will update.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#camera\r\n * @type {?Phaser.Cameras.Scene2D.Camera}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.camera = GetValue(config, 'camera', null);\r\n\r\n /**\r\n * The Key to be pressed that will move the Camera left.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#left\r\n * @type {?Phaser.Input.Keyboard.Key}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.left = GetValue(config, 'left', null);\r\n\r\n /**\r\n * The Key to be pressed that will move the Camera right.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#right\r\n * @type {?Phaser.Input.Keyboard.Key}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.right = GetValue(config, 'right', null);\r\n\r\n /**\r\n * The Key to be pressed that will move the Camera up.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#up\r\n * @type {?Phaser.Input.Keyboard.Key}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.up = GetValue(config, 'up', null);\r\n\r\n /**\r\n * The Key to be pressed that will move the Camera down.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#down\r\n * @type {?Phaser.Input.Keyboard.Key}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.down = GetValue(config, 'down', null);\r\n\r\n /**\r\n * The Key to be pressed that will zoom the Camera in.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#zoomIn\r\n * @type {?Phaser.Input.Keyboard.Key}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.zoomIn = GetValue(config, 'zoomIn', null);\r\n\r\n /**\r\n * The Key to be pressed that will zoom the Camera out.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#zoomOut\r\n * @type {?Phaser.Input.Keyboard.Key}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.zoomOut = GetValue(config, 'zoomOut', null);\r\n\r\n /**\r\n * The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#zoomSpeed\r\n * @type {number}\r\n * @default 0.01\r\n * @since 3.0.0\r\n */\r\n this.zoomSpeed = GetValue(config, 'zoomSpeed', 0.01);\r\n\r\n /**\r\n * The horizontal acceleration the camera will move.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#accelX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.accelX = 0;\r\n\r\n /**\r\n * The vertical acceleration the camera will move.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#accelY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.accelY = 0;\r\n\r\n var accel = GetValue(config, 'acceleration', null);\r\n\r\n if (typeof accel === 'number')\r\n {\r\n this.accelX = accel;\r\n this.accelY = accel;\r\n }\r\n else\r\n {\r\n this.accelX = GetValue(config, 'acceleration.x', 0);\r\n this.accelY = GetValue(config, 'acceleration.y', 0);\r\n }\r\n\r\n /**\r\n * The horizontal drag applied to the camera when it is moving.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#dragX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.dragX = 0;\r\n\r\n /**\r\n * The vertical drag applied to the camera when it is moving.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#dragY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.dragY = 0;\r\n\r\n var drag = GetValue(config, 'drag', null);\r\n\r\n if (typeof drag === 'number')\r\n {\r\n this.dragX = drag;\r\n this.dragY = drag;\r\n }\r\n else\r\n {\r\n this.dragX = GetValue(config, 'drag.x', 0);\r\n this.dragY = GetValue(config, 'drag.y', 0);\r\n }\r\n\r\n /**\r\n * The maximum horizontal speed the camera will move.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#maxSpeedX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.maxSpeedX = 0;\r\n\r\n /**\r\n * The maximum vertical speed the camera will move.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#maxSpeedY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.maxSpeedY = 0;\r\n\r\n var maxSpeed = GetValue(config, 'maxSpeed', null);\r\n\r\n if (typeof maxSpeed === 'number')\r\n {\r\n this.maxSpeedX = maxSpeed;\r\n this.maxSpeedY = maxSpeed;\r\n }\r\n else\r\n {\r\n this.maxSpeedX = GetValue(config, 'maxSpeed.x', 0);\r\n this.maxSpeedY = GetValue(config, 'maxSpeed.y', 0);\r\n }\r\n\r\n /**\r\n * Internal property to track the speed of the control.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#_speedX\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._speedX = 0;\r\n\r\n /**\r\n * Internal property to track the speed of the control.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#_speedY\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._speedY = 0;\r\n\r\n /**\r\n * Internal property to track the zoom of the control.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#_zoom\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._zoom = 0;\r\n\r\n /**\r\n * A flag controlling if the Controls will update the Camera or not.\r\n *\r\n * @name Phaser.Cameras.Controls.SmoothedKeyControl#active\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.active = (this.camera !== null);\r\n },\r\n\r\n /**\r\n * Starts the Key Control running, providing it has been linked to a camera.\r\n *\r\n * @method Phaser.Cameras.Controls.SmoothedKeyControl#start\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Cameras.Controls.SmoothedKeyControl} This Key Control instance.\r\n */\r\n start: function ()\r\n {\r\n this.active = (this.camera !== null);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stops this Key Control from running. Call `start` to start it again.\r\n *\r\n * @method Phaser.Cameras.Controls.SmoothedKeyControl#stop\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Cameras.Controls.SmoothedKeyControl} This Key Control instance.\r\n */\r\n stop: function ()\r\n {\r\n this.active = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Binds this Key Control to a camera.\r\n *\r\n * @method Phaser.Cameras.Controls.SmoothedKeyControl#setCamera\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to bind this Key Control to.\r\n *\r\n * @return {Phaser.Cameras.Controls.SmoothedKeyControl} This Key Control instance.\r\n */\r\n setCamera: function (camera)\r\n {\r\n this.camera = camera;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Applies the results of pressing the control keys to the Camera.\r\n *\r\n * You must call this every step, it is not called automatically.\r\n *\r\n * @method Phaser.Cameras.Controls.SmoothedKeyControl#update\r\n * @since 3.0.0\r\n *\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\n update: function (delta)\r\n {\r\n if (!this.active)\r\n {\r\n return;\r\n }\r\n\r\n if (delta === undefined) { delta = 1; }\r\n\r\n var cam = this.camera;\r\n\r\n // Apply Deceleration\r\n\r\n if (this._speedX > 0)\r\n {\r\n this._speedX -= this.dragX * delta;\r\n\r\n if (this._speedX < 0)\r\n {\r\n this._speedX = 0;\r\n }\r\n }\r\n else if (this._speedX < 0)\r\n {\r\n this._speedX += this.dragX * delta;\r\n\r\n if (this._speedX > 0)\r\n {\r\n this._speedX = 0;\r\n }\r\n }\r\n\r\n if (this._speedY > 0)\r\n {\r\n this._speedY -= this.dragY * delta;\r\n\r\n if (this._speedY < 0)\r\n {\r\n this._speedY = 0;\r\n }\r\n }\r\n else if (this._speedY < 0)\r\n {\r\n this._speedY += this.dragY * delta;\r\n\r\n if (this._speedY > 0)\r\n {\r\n this._speedY = 0;\r\n }\r\n }\r\n\r\n // Check for keys\r\n\r\n if (this.up && this.up.isDown)\r\n {\r\n this._speedY += this.accelY;\r\n\r\n if (this._speedY > this.maxSpeedY)\r\n {\r\n this._speedY = this.maxSpeedY;\r\n }\r\n }\r\n else if (this.down && this.down.isDown)\r\n {\r\n this._speedY -= this.accelY;\r\n\r\n if (this._speedY < -this.maxSpeedY)\r\n {\r\n this._speedY = -this.maxSpeedY;\r\n }\r\n }\r\n\r\n if (this.left && this.left.isDown)\r\n {\r\n this._speedX += this.accelX;\r\n\r\n if (this._speedX > this.maxSpeedX)\r\n {\r\n this._speedX = this.maxSpeedX;\r\n }\r\n }\r\n else if (this.right && this.right.isDown)\r\n {\r\n this._speedX -= this.accelX;\r\n\r\n if (this._speedX < -this.maxSpeedX)\r\n {\r\n this._speedX = -this.maxSpeedX;\r\n }\r\n }\r\n\r\n // Camera zoom\r\n\r\n if (this.zoomIn && this.zoomIn.isDown)\r\n {\r\n this._zoom = -this.zoomSpeed;\r\n }\r\n else if (this.zoomOut && this.zoomOut.isDown)\r\n {\r\n this._zoom = this.zoomSpeed;\r\n }\r\n else\r\n {\r\n this._zoom = 0;\r\n }\r\n\r\n // Apply to Camera\r\n\r\n if (this._speedX !== 0)\r\n {\r\n cam.scrollX -= ((this._speedX * delta) | 0);\r\n }\r\n\r\n if (this._speedY !== 0)\r\n {\r\n cam.scrollY -= ((this._speedY * delta) | 0);\r\n }\r\n\r\n if (this._zoom !== 0)\r\n {\r\n cam.zoom += this._zoom;\r\n\r\n if (cam.zoom < 0.001)\r\n {\r\n cam.zoom = 0.001;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Destroys this Key Control.\r\n *\r\n * @method Phaser.Cameras.Controls.SmoothedKeyControl#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.camera = null;\r\n\r\n this.left = null;\r\n this.right = null;\r\n this.up = null;\r\n this.down = null;\r\n\r\n this.zoomIn = null;\r\n this.zoomOut = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SmoothedKeyControl;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/controls/SmoothedKeyControl.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/controls/index.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/cameras/controls/index.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Cameras.Controls\r\n */\r\n\r\nmodule.exports = {\r\n\r\n FixedKeyControl: __webpack_require__(/*! ./FixedKeyControl */ \"./node_modules/phaser/src/cameras/controls/FixedKeyControl.js\"),\r\n SmoothedKeyControl: __webpack_require__(/*! ./SmoothedKeyControl */ \"./node_modules/phaser/src/cameras/controls/SmoothedKeyControl.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/controls/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/cameras/index.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/cameras/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Cameras\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Types.Cameras\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Controls: __webpack_require__(/*! ./controls */ \"./node_modules/phaser/src/cameras/controls/index.js\"),\r\n Scene2D: __webpack_require__(/*! ./2d */ \"./node_modules/phaser/src/cameras/2d/index.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/cameras/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/const.js": /*!******************************************!*\ !*** ./node_modules/phaser/src/const.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Global constants.\r\n * \r\n * @ignore\r\n */\r\n\r\nvar CONST = {\r\n\r\n /**\r\n * Phaser Release Version\r\n * \r\n * @name Phaser.VERSION\r\n * @const\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n VERSION: '3.22.0',\r\n\r\n BlendModes: __webpack_require__(/*! ./renderer/BlendModes */ \"./node_modules/phaser/src/renderer/BlendModes.js\"),\r\n\r\n ScaleModes: __webpack_require__(/*! ./renderer/ScaleModes */ \"./node_modules/phaser/src/renderer/ScaleModes.js\"),\r\n\r\n /**\r\n * AUTO Detect Renderer.\r\n * \r\n * @name Phaser.AUTO\r\n * @const\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n AUTO: 0,\r\n\r\n /**\r\n * Canvas Renderer.\r\n * \r\n * @name Phaser.CANVAS\r\n * @const\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n CANVAS: 1,\r\n\r\n /**\r\n * WebGL Renderer.\r\n * \r\n * @name Phaser.WEBGL\r\n * @const\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n WEBGL: 2,\r\n\r\n /**\r\n * Headless Renderer.\r\n * \r\n * @name Phaser.HEADLESS\r\n * @const\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n HEADLESS: 3,\r\n\r\n /**\r\n * In Phaser the value -1 means 'forever' in lots of cases, this const allows you to use it instead\r\n * to help you remember what the value is doing in your code.\r\n * \r\n * @name Phaser.FOREVER\r\n * @const\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FOREVER: -1,\r\n\r\n /**\r\n * Direction constant.\r\n * \r\n * @name Phaser.NONE\r\n * @const\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n NONE: 4,\r\n\r\n /**\r\n * Direction constant.\r\n * \r\n * @name Phaser.UP\r\n * @const\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n UP: 5,\r\n\r\n /**\r\n * Direction constant.\r\n * \r\n * @name Phaser.DOWN\r\n * @const\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n DOWN: 6,\r\n\r\n /**\r\n * Direction constant.\r\n * \r\n * @name Phaser.LEFT\r\n * @const\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LEFT: 7,\r\n\r\n /**\r\n * Direction constant.\r\n * \r\n * @name Phaser.RIGHT\r\n * @const\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n RIGHT: 8\r\n\r\n};\r\n\r\nmodule.exports = CONST;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/const.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/Config.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/core/Config.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/const.js\");\r\nvar Device = __webpack_require__(/*! ../device */ \"./node_modules/phaser/src/device/index.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar GetValue = __webpack_require__(/*! ../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\nvar PhaserMath = __webpack_require__(/*! ../math/ */ \"./node_modules/phaser/src/math/index.js\");\r\nvar NOOP = __webpack_require__(/*! ../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar DefaultPlugins = __webpack_require__(/*! ../plugins/DefaultPlugins */ \"./node_modules/phaser/src/plugins/DefaultPlugins.js\");\r\nvar ValueToColor = __webpack_require__(/*! ../display/color/ValueToColor */ \"./node_modules/phaser/src/display/color/ValueToColor.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The active game configuration settings, parsed from a {@link Phaser.Types.Core.GameConfig} object.\r\n *\r\n * @class Config\r\n * @memberof Phaser.Core\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Core.GameConfig} [GameConfig] - The configuration object for your Phaser Game instance.\r\n *\r\n * @see Phaser.Game#config\r\n */\r\nvar Config = new Class({\r\n\r\n initialize:\r\n\r\n function Config (config)\r\n {\r\n if (config === undefined) { config = {}; }\r\n\r\n var defaultBannerColor = [\r\n '#ff0000',\r\n '#ffff00',\r\n '#00ff00',\r\n '#00ffff',\r\n '#000000'\r\n ];\r\n\r\n var defaultBannerTextColor = '#ffffff';\r\n\r\n /**\r\n * @const {(integer|string)} Phaser.Core.Config#width - The width of the underlying canvas, in pixels.\r\n */\r\n this.width = GetValue(config, 'width', 1024);\r\n\r\n /**\r\n * @const {(integer|string)} Phaser.Core.Config#height - The height of the underlying canvas, in pixels.\r\n */\r\n this.height = GetValue(config, 'height', 768);\r\n\r\n /**\r\n * @const {(Phaser.Scale.ZoomType|integer)} Phaser.Core.Config#zoom - The zoom factor, as used by the Scale Manager.\r\n */\r\n this.zoom = GetValue(config, 'zoom', 1);\r\n\r\n /**\r\n * @const {number} Phaser.Core.Config#resolution - The canvas device pixel resolution. Currently un-used.\r\n */\r\n this.resolution = GetValue(config, 'resolution', 1);\r\n\r\n /**\r\n * @const {?*} Phaser.Core.Config#parent - A parent DOM element into which the canvas created by the renderer will be injected.\r\n */\r\n this.parent = GetValue(config, 'parent', undefined);\r\n\r\n /**\r\n * @const {Phaser.Scale.ScaleModeType} Phaser.Core.Config#scaleMode - The scale mode as used by the Scale Manager. The default is zero, which is no scaling.\r\n */\r\n this.scaleMode = GetValue(config, 'scaleMode', 0);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#expandParent - Is the Scale Manager allowed to adjust the CSS height property of the parent to be 100%?\r\n */\r\n this.expandParent = GetValue(config, 'expandParent', true);\r\n\r\n /**\r\n * @const {integer} Phaser.Core.Config#autoRound - Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices.\r\n */\r\n this.autoRound = GetValue(config, 'autoRound', false);\r\n\r\n /**\r\n * @const {Phaser.Scale.CenterType} Phaser.Core.Config#autoCenter - Automatically center the canvas within the parent?\r\n */\r\n this.autoCenter = GetValue(config, 'autoCenter', 0);\r\n\r\n /**\r\n * @const {integer} Phaser.Core.Config#resizeInterval - How many ms should elapse before checking if the browser size has changed?\r\n */\r\n this.resizeInterval = GetValue(config, 'resizeInterval', 500);\r\n\r\n /**\r\n * @const {?(HTMLElement|string)} Phaser.Core.Config#fullscreenTarget - The DOM element that will be sent into full screen mode, or its `id`. If undefined Phaser will create its own div and insert the canvas into it when entering fullscreen mode.\r\n */\r\n this.fullscreenTarget = GetValue(config, 'fullscreenTarget', null);\r\n\r\n /**\r\n * @const {integer} Phaser.Core.Config#minWidth - The minimum width, in pixels, the canvas will scale down to. A value of zero means no minimum.\r\n */\r\n this.minWidth = GetValue(config, 'minWidth', 0);\r\n\r\n /**\r\n * @const {integer} Phaser.Core.Config#maxWidth - The maximum width, in pixels, the canvas will scale up to. A value of zero means no maximum.\r\n */\r\n this.maxWidth = GetValue(config, 'maxWidth', 0);\r\n\r\n /**\r\n * @const {integer} Phaser.Core.Config#minHeight - The minimum height, in pixels, the canvas will scale down to. A value of zero means no minimum.\r\n */\r\n this.minHeight = GetValue(config, 'minHeight', 0);\r\n\r\n /**\r\n * @const {integer} Phaser.Core.Config#maxHeight - The maximum height, in pixels, the canvas will scale up to. A value of zero means no maximum.\r\n */\r\n this.maxHeight = GetValue(config, 'maxHeight', 0);\r\n\r\n // Scale Manager - Anything set in here over-rides anything set above\r\n\r\n var scaleConfig = GetValue(config, 'scale', null);\r\n\r\n if (scaleConfig)\r\n {\r\n this.width = GetValue(scaleConfig, 'width', this.width);\r\n this.height = GetValue(scaleConfig, 'height', this.height);\r\n this.zoom = GetValue(scaleConfig, 'zoom', this.zoom);\r\n this.resolution = GetValue(scaleConfig, 'resolution', this.resolution);\r\n this.parent = GetValue(scaleConfig, 'parent', this.parent);\r\n this.scaleMode = GetValue(scaleConfig, 'mode', this.scaleMode);\r\n this.expandParent = GetValue(scaleConfig, 'expandParent', this.expandParent);\r\n this.autoRound = GetValue(scaleConfig, 'autoRound', this.autoRound);\r\n this.autoCenter = GetValue(scaleConfig, 'autoCenter', this.autoCenter);\r\n this.resizeInterval = GetValue(scaleConfig, 'resizeInterval', this.resizeInterval);\r\n this.fullscreenTarget = GetValue(scaleConfig, 'fullscreenTarget', this.fullscreenTarget);\r\n this.minWidth = GetValue(scaleConfig, 'min.width', this.minWidth);\r\n this.maxWidth = GetValue(scaleConfig, 'max.width', this.maxWidth);\r\n this.minHeight = GetValue(scaleConfig, 'min.height', this.minHeight);\r\n this.maxHeight = GetValue(scaleConfig, 'max.height', this.maxHeight);\r\n }\r\n\r\n /**\r\n * @const {number} Phaser.Core.Config#renderType - Force Phaser to use a specific renderer. Can be `CONST.CANVAS`, `CONST.WEBGL`, `CONST.HEADLESS` or `CONST.AUTO` (default)\r\n */\r\n this.renderType = GetValue(config, 'type', CONST.AUTO);\r\n\r\n /**\r\n * @const {?HTMLCanvasElement} Phaser.Core.Config#canvas - Force Phaser to use your own Canvas element instead of creating one.\r\n */\r\n this.canvas = GetValue(config, 'canvas', null);\r\n\r\n /**\r\n * @const {?(CanvasRenderingContext2D|WebGLRenderingContext)} Phaser.Core.Config#context - Force Phaser to use your own Canvas context instead of creating one.\r\n */\r\n this.context = GetValue(config, 'context', null);\r\n\r\n /**\r\n * @const {?string} Phaser.Core.Config#canvasStyle - Optional CSS attributes to be set on the canvas object created by the renderer.\r\n */\r\n this.canvasStyle = GetValue(config, 'canvasStyle', null);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#customEnvironment - Is Phaser running under a custom (non-native web) environment? If so, set this to `true` to skip internal Feature detection. If `true` the `renderType` cannot be left as `AUTO`.\r\n */\r\n this.customEnvironment = GetValue(config, 'customEnvironment', false);\r\n\r\n /**\r\n * @const {?object} Phaser.Core.Config#sceneConfig - The default Scene configuration object.\r\n */\r\n this.sceneConfig = GetValue(config, 'scene', null);\r\n\r\n /**\r\n * @const {string[]} Phaser.Core.Config#seed - A seed which the Random Data Generator will use. If not given, a dynamic seed based on the time is used.\r\n */\r\n this.seed = GetValue(config, 'seed', [ (Date.now() * Math.random()).toString() ]);\r\n\r\n PhaserMath.RND = new PhaserMath.RandomDataGenerator(this.seed);\r\n\r\n /**\r\n * @const {string} Phaser.Core.Config#gameTitle - The title of the game.\r\n */\r\n this.gameTitle = GetValue(config, 'title', '');\r\n\r\n /**\r\n * @const {string} Phaser.Core.Config#gameURL - The URL of the game.\r\n */\r\n this.gameURL = GetValue(config, 'url', 'https://phaser.io');\r\n\r\n /**\r\n * @const {string} Phaser.Core.Config#gameVersion - The version of the game.\r\n */\r\n this.gameVersion = GetValue(config, 'version', '');\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#autoFocus - If `true` the window will automatically be given focus immediately and on any future mousedown event.\r\n */\r\n this.autoFocus = GetValue(config, 'autoFocus', true);\r\n\r\n // DOM Element Container\r\n\r\n /**\r\n * @const {?boolean} Phaser.Core.Config#domCreateContainer - Should the game create a div element to act as a DOM Container? Only enable if you're using DOM Element objects. You must provide a parent object if you use this feature.\r\n */\r\n this.domCreateContainer = GetValue(config, 'dom.createContainer', false);\r\n\r\n /**\r\n * @const {?boolean} Phaser.Core.Config#domBehindCanvas - Should the DOM Container that is created (if `dom.createContainer` is true) be positioned behind (true) or over the top (false, the default) of the game canvas?\r\n */\r\n this.domBehindCanvas = GetValue(config, 'dom.behindCanvas', false);\r\n\r\n // Input\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#inputKeyboard - Enable the Keyboard Plugin. This can be disabled in games that don't need keyboard input.\r\n */\r\n this.inputKeyboard = GetValue(config, 'input.keyboard', true);\r\n\r\n /**\r\n * @const {*} Phaser.Core.Config#inputKeyboardEventTarget - The DOM Target to listen for keyboard events on. Defaults to `window` if not specified.\r\n */\r\n this.inputKeyboardEventTarget = GetValue(config, 'input.keyboard.target', window);\r\n\r\n /**\r\n * @const {?integer[]} Phaser.Core.Config#inputKeyboardCapture - `preventDefault` will be called on every non-modified key which has a key code in this array. By default, it is empty.\r\n */\r\n this.inputKeyboardCapture = GetValue(config, 'input.keyboard.capture', []);\r\n\r\n /**\r\n * @const {(boolean|object)} Phaser.Core.Config#inputMouse - Enable the Mouse Plugin. This can be disabled in games that don't need mouse input.\r\n */\r\n this.inputMouse = GetValue(config, 'input.mouse', true);\r\n\r\n /**\r\n * @const {?*} Phaser.Core.Config#inputMouseEventTarget - The DOM Target to listen for mouse events on. Defaults to the game canvas if not specified.\r\n */\r\n this.inputMouseEventTarget = GetValue(config, 'input.mouse.target', null);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#inputMouseCapture - Should mouse events be captured? I.e. have prevent default called on them.\r\n */\r\n this.inputMouseCapture = GetValue(config, 'input.mouse.capture', true);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#inputTouch - Enable the Touch Plugin. This can be disabled in games that don't need touch input.\r\n */\r\n this.inputTouch = GetValue(config, 'input.touch', Device.input.touch);\r\n\r\n /**\r\n * @const {?*} Phaser.Core.Config#inputTouchEventTarget - The DOM Target to listen for touch events on. Defaults to the game canvas if not specified.\r\n */\r\n this.inputTouchEventTarget = GetValue(config, 'input.touch.target', null);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#inputTouchCapture - Should touch events be captured? I.e. have prevent default called on them.\r\n */\r\n this.inputTouchCapture = GetValue(config, 'input.touch.capture', true);\r\n\r\n /**\r\n * @const {integer} Phaser.Core.Config#inputActivePointers - The number of Pointer objects created by default. In a mouse-only, or non-multi touch game, you can leave this as 1.\r\n */\r\n this.inputActivePointers = GetValue(config, 'input.activePointers', 1);\r\n\r\n /**\r\n * @const {integer} Phaser.Core.Config#inputSmoothFactor - The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}.\r\n */\r\n this.inputSmoothFactor = GetValue(config, 'input.smoothFactor', 0);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#inputWindowEvents - Should Phaser listen for input events on the Window? If you disable this, events like 'POINTER_UP_OUTSIDE' will no longer fire.\r\n */\r\n this.inputWindowEvents = GetValue(config, 'input.windowEvents', true);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#inputGamepad - Enable the Gamepad Plugin. This can be disabled in games that don't need gamepad input.\r\n */\r\n this.inputGamepad = GetValue(config, 'input.gamepad', false);\r\n\r\n /**\r\n * @const {*} Phaser.Core.Config#inputGamepadEventTarget - The DOM Target to listen for gamepad events on. Defaults to `window` if not specified.\r\n */\r\n this.inputGamepadEventTarget = GetValue(config, 'input.gamepad.target', window);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#disableContextMenu - Set to `true` to disable the right-click context menu.\r\n */\r\n this.disableContextMenu = GetValue(config, 'disableContextMenu', false);\r\n\r\n /**\r\n * @const {Phaser.Types.Core.AudioConfig} Phaser.Core.Config#audio - The Audio Configuration object.\r\n */\r\n this.audio = GetValue(config, 'audio');\r\n\r\n // If you do: { banner: false } it won't display any banner at all\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#hideBanner - Don't write the banner line to the console.log.\r\n */\r\n this.hideBanner = (GetValue(config, 'banner', null) === false);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#hidePhaser - Omit Phaser's name and version from the banner.\r\n */\r\n this.hidePhaser = GetValue(config, 'banner.hidePhaser', false);\r\n\r\n /**\r\n * @const {string} Phaser.Core.Config#bannerTextColor - The color of the banner text.\r\n */\r\n this.bannerTextColor = GetValue(config, 'banner.text', defaultBannerTextColor);\r\n\r\n /**\r\n * @const {string[]} Phaser.Core.Config#bannerBackgroundColor - The background colors of the banner.\r\n */\r\n this.bannerBackgroundColor = GetValue(config, 'banner.background', defaultBannerColor);\r\n\r\n if (this.gameTitle === '' && this.hidePhaser)\r\n {\r\n this.hideBanner = true;\r\n }\r\n\r\n /**\r\n * @const {?Phaser.Types.Core.FPSConfig} Phaser.Core.Config#fps - The Frame Rate Configuration object, as parsed by the Timestep class.\r\n */\r\n this.fps = GetValue(config, 'fps', null);\r\n\r\n // Renderer Settings\r\n // These can either be in a `render` object within the Config, or specified on their own\r\n\r\n var renderConfig = GetValue(config, 'render', config);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#antialias - 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.\r\n */\r\n this.antialias = GetValue(renderConfig, 'antialias', true);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#antialiasGL - Sets the `antialias` property when the WebGL context is created. Setting this value does not impact any subsequent textures that are created, or the canvas style attributes.\r\n */\r\n this.antialiasGL = GetValue(renderConfig, 'antialiasGL', true);\r\n\r\n /**\r\n * @const {string} Phaser.Core.Config#mipmapFilter - Sets the `mipmapFilter` property when the WebGL renderer is created.\r\n */\r\n this.mipmapFilter = GetValue(renderConfig, 'mipmapFilter', 'LINEAR');\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#desynchronized - When set to `true` it will create a desynchronized context for both 2D and WebGL. See https://developers.google.com/web/updates/2019/05/desynchronized for details.\r\n */\r\n this.desynchronized = GetValue(renderConfig, 'desynchronized', false);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#roundPixels - Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property.\r\n */\r\n this.roundPixels = GetValue(renderConfig, 'roundPixels', false);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.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).\r\n */\r\n this.pixelArt = GetValue(renderConfig, 'pixelArt', this.zoom !== 1);\r\n\r\n if (this.pixelArt)\r\n {\r\n this.antialias = false;\r\n this.roundPixels = true;\r\n }\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#transparent - Whether the game canvas will have a transparent background.\r\n */\r\n this.transparent = GetValue(renderConfig, 'transparent', false);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#clearBeforeRender - Whether the game canvas will be cleared between each rendering frame. You can disable this if you have a full-screen background image or game object.\r\n */\r\n this.clearBeforeRender = GetValue(renderConfig, 'clearBeforeRender', true);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#premultipliedAlpha - In WebGL mode, sets the drawing buffer to contain colors with pre-multiplied alpha.\r\n */\r\n this.premultipliedAlpha = GetValue(renderConfig, 'premultipliedAlpha', true);\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#failIfMajorPerformanceCaveat - Let the browser abort creating a WebGL context if it judges performance would be unacceptable.\r\n */\r\n this.failIfMajorPerformanceCaveat = GetValue(renderConfig, 'failIfMajorPerformanceCaveat', false);\r\n\r\n /**\r\n * @const {string} Phaser.Core.Config#powerPreference - \"high-performance\", \"low-power\" or \"default\". A hint to the browser on how much device power the game might use.\r\n */\r\n this.powerPreference = GetValue(renderConfig, 'powerPreference', 'default');\r\n\r\n /**\r\n * @const {integer} Phaser.Core.Config#batchSize - The default WebGL Batch size.\r\n */\r\n this.batchSize = GetValue(renderConfig, 'batchSize', 2000);\r\n\r\n /**\r\n * @const {integer} Phaser.Core.Config#maxLights - The maximum number of lights allowed to be visible within range of a single Camera in the LightManager.\r\n */\r\n this.maxLights = GetValue(renderConfig, 'maxLights', 10);\r\n\r\n var bgc = GetValue(config, 'backgroundColor', 0);\r\n\r\n /**\r\n * @const {Phaser.Display.Color} Phaser.Core.Config#backgroundColor - The background color of the game canvas. The default is black. This value is ignored if `transparent` is set to `true`.\r\n */\r\n this.backgroundColor = ValueToColor(bgc);\r\n\r\n if (bgc === 0 && this.transparent)\r\n {\r\n this.backgroundColor.alpha = 0;\r\n }\r\n\r\n /**\r\n * @const {Phaser.Types.Core.BootCallback} Phaser.Core.Config#preBoot - Called before Phaser boots. Useful for initializing anything not related to Phaser that Phaser may require while booting.\r\n */\r\n this.preBoot = GetValue(config, 'callbacks.preBoot', NOOP);\r\n\r\n /**\r\n * @const {Phaser.Types.Core.BootCallback} Phaser.Core.Config#postBoot - 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.\r\n */\r\n this.postBoot = GetValue(config, 'callbacks.postBoot', NOOP);\r\n\r\n /**\r\n * @const {Phaser.Types.Core.PhysicsConfig} Phaser.Core.Config#physics - The Physics Configuration object.\r\n */\r\n this.physics = GetValue(config, 'physics', {});\r\n\r\n /**\r\n * @const {(boolean|string)} Phaser.Core.Config#defaultPhysicsSystem - The default physics system. It will be started for each scene. Either 'arcade', 'impact' or 'matter'.\r\n */\r\n this.defaultPhysicsSystem = GetValue(this.physics, 'default', false);\r\n\r\n /**\r\n * @const {string} Phaser.Core.Config#loaderBaseURL - A URL used to resolve paths given to the loader. Example: 'http://labs.phaser.io/assets/'.\r\n */\r\n this.loaderBaseURL = GetValue(config, 'loader.baseURL', '');\r\n\r\n /**\r\n * @const {string} Phaser.Core.Config#loaderPath - A URL path used to resolve relative paths given to the loader. Example: 'images/sprites/'.\r\n */\r\n this.loaderPath = GetValue(config, 'loader.path', '');\r\n\r\n /**\r\n * @const {integer} Phaser.Core.Config#loaderMaxParallelDownloads - Maximum parallel downloads allowed for resources (Default to 32).\r\n */\r\n this.loaderMaxParallelDownloads = GetValue(config, 'loader.maxParallelDownloads', 32);\r\n\r\n /**\r\n * @const {(string|undefined)} Phaser.Core.Config#loaderCrossOrigin - '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}.\r\n */\r\n this.loaderCrossOrigin = GetValue(config, 'loader.crossOrigin', undefined);\r\n\r\n /**\r\n * @const {string} Phaser.Core.Config#loaderResponseType - The response type of the XHR request, e.g. `blob`, `text`, etc.\r\n */\r\n this.loaderResponseType = GetValue(config, 'loader.responseType', '');\r\n\r\n /**\r\n * @const {boolean} Phaser.Core.Config#loaderAsync - Should the XHR request use async or not?\r\n */\r\n this.loaderAsync = GetValue(config, 'loader.async', true);\r\n\r\n /**\r\n * @const {string} Phaser.Core.Config#loaderUser - Optional username for all XHR requests.\r\n */\r\n this.loaderUser = GetValue(config, 'loader.user', '');\r\n\r\n /**\r\n * @const {string} Phaser.Core.Config#loaderPassword - Optional password for all XHR requests.\r\n */\r\n this.loaderPassword = GetValue(config, 'loader.password', '');\r\n\r\n /**\r\n * @const {integer} Phaser.Core.Config#loaderTimeout - Optional XHR timeout value, in ms.\r\n */\r\n this.loaderTimeout = GetValue(config, 'loader.timeout', 0);\r\n\r\n /*\r\n * Allows `plugins` property to either be an array, in which case it just replaces\r\n * the default plugins like previously, or a config object.\r\n *\r\n * plugins: {\r\n * global: [\r\n * { key: 'TestPlugin', plugin: TestPlugin, start: true, data: { msg: 'The plugin is alive' } },\r\n * ],\r\n * scene: [\r\n * { key: 'WireFramePlugin', plugin: WireFramePlugin, systemKey: 'wireFramePlugin', sceneKey: 'wireframe' }\r\n * ],\r\n * default: [], OR\r\n * defaultMerge: [\r\n * 'ModPlayer'\r\n * ]\r\n * }\r\n */\r\n\r\n /**\r\n * @const {any} Phaser.Core.Config#installGlobalPlugins - An array of global plugins to be installed.\r\n */\r\n this.installGlobalPlugins = [];\r\n\r\n /**\r\n * @const {any} Phaser.Core.Config#installScenePlugins - An array of Scene level plugins to be installed.\r\n */\r\n this.installScenePlugins = [];\r\n\r\n var plugins = GetValue(config, 'plugins', null);\r\n var defaultPlugins = DefaultPlugins.DefaultScene;\r\n\r\n if (plugins)\r\n {\r\n // Old 3.7 array format?\r\n if (Array.isArray(plugins))\r\n {\r\n this.defaultPlugins = plugins;\r\n }\r\n else if (IsPlainObject(plugins))\r\n {\r\n this.installGlobalPlugins = GetFastValue(plugins, 'global', []);\r\n this.installScenePlugins = GetFastValue(plugins, 'scene', []);\r\n\r\n if (Array.isArray(plugins.default))\r\n {\r\n defaultPlugins = plugins.default;\r\n }\r\n else if (Array.isArray(plugins.defaultMerge))\r\n {\r\n defaultPlugins = defaultPlugins.concat(plugins.defaultMerge);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @const {any} Phaser.Core.Config#defaultPlugins - The plugins installed into every Scene (in addition to CoreScene and Global).\r\n */\r\n this.defaultPlugins = defaultPlugins;\r\n\r\n // Default / Missing Images\r\n var pngPrefix = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg';\r\n\r\n /**\r\n * @const {string} Phaser.Core.Config#defaultImage - A base64 encoded PNG that will be used as the default blank texture.\r\n */\r\n this.defaultImage = GetValue(config, 'images.default', pngPrefix + 'AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg==');\r\n\r\n /**\r\n * @const {string} Phaser.Core.Config#missingImage - A base64 encoded PNG that will be used as the default texture when a texture is assigned that is missing or not loaded.\r\n */\r\n this.missingImage = GetValue(config, 'images.missing', pngPrefix + 'CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg==');\r\n\r\n if (window)\r\n {\r\n if (window.FORCE_WEBGL)\r\n {\r\n this.renderType = CONST.WEBGL;\r\n }\r\n else if (window.FORCE_CANVAS)\r\n {\r\n this.renderType = CONST.CANVAS;\r\n }\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Config;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/Config.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/CreateRenderer.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/core/CreateRenderer.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CanvasInterpolation = __webpack_require__(/*! ../display/canvas/CanvasInterpolation */ \"./node_modules/phaser/src/display/canvas/CanvasInterpolation.js\");\r\nvar CanvasPool = __webpack_require__(/*! ../display/canvas/CanvasPool */ \"./node_modules/phaser/src/display/canvas/CanvasPool.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/const.js\");\r\nvar Features = __webpack_require__(/*! ../device/Features */ \"./node_modules/phaser/src/device/Features.js\");\r\n\r\n/**\r\n * Called automatically by Phaser.Game and responsible for creating the renderer it will use.\r\n *\r\n * Relies upon two webpack global flags to be defined: `WEBGL_RENDERER` and `CANVAS_RENDERER` during build time, but not at run-time.\r\n *\r\n * @function Phaser.Core.CreateRenderer\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - The Phaser.Game instance on which the renderer will be set.\r\n */\r\nvar CreateRenderer = function (game)\r\n{\r\n var config = game.config;\r\n\r\n if ((config.customEnvironment || config.canvas) && config.renderType === CONST.AUTO)\r\n {\r\n throw new Error('Must set explicit renderType in custom environment');\r\n }\r\n\r\n // Not a custom environment, didn't provide their own canvas and not headless, so determine the renderer:\r\n if (!config.customEnvironment && !config.canvas && config.renderType !== CONST.HEADLESS)\r\n {\r\n if (config.renderType === CONST.CANVAS || (config.renderType !== CONST.CANVAS && !Features.webGL))\r\n {\r\n if (Features.canvas)\r\n {\r\n // They requested Canvas and their browser supports it\r\n config.renderType = CONST.CANVAS;\r\n }\r\n else\r\n {\r\n throw new Error('Cannot create Canvas or WebGL context, aborting.');\r\n }\r\n }\r\n else\r\n {\r\n // Game requested WebGL and browser says it supports it\r\n config.renderType = CONST.WEBGL;\r\n }\r\n }\r\n\r\n // Pixel Art mode?\r\n if (!config.antialias)\r\n {\r\n CanvasPool.disableSmoothing();\r\n }\r\n\r\n var baseSize = game.scale.baseSize;\r\n\r\n var width = baseSize.width;\r\n var height = baseSize.height;\r\n\r\n // Does the game config provide its own canvas element to use?\r\n if (config.canvas)\r\n {\r\n game.canvas = config.canvas;\r\n\r\n game.canvas.width = width;\r\n game.canvas.height = height;\r\n }\r\n else\r\n {\r\n game.canvas = CanvasPool.create(game, width, height, config.renderType);\r\n }\r\n\r\n // Does the game config provide some canvas css styles to use?\r\n if (config.canvasStyle)\r\n {\r\n game.canvas.style = config.canvasStyle;\r\n }\r\n\r\n // Pixel Art mode?\r\n if (!config.antialias)\r\n {\r\n CanvasInterpolation.setCrisp(game.canvas);\r\n }\r\n\r\n if (config.renderType === CONST.HEADLESS)\r\n {\r\n // Nothing more to do here\r\n return;\r\n }\r\n\r\n var CanvasRenderer;\r\n var WebGLRenderer;\r\n\r\n if (true)\r\n {\r\n CanvasRenderer = __webpack_require__(/*! ../renderer/canvas/CanvasRenderer */ \"./node_modules/phaser/src/renderer/canvas/CanvasRenderer.js\");\r\n WebGLRenderer = __webpack_require__(/*! ../renderer/webgl/WebGLRenderer */ \"./node_modules/phaser/src/renderer/webgl/WebGLRenderer.js\");\r\n\r\n // Let the config pick the renderer type, as both are included\r\n if (config.renderType === CONST.WEBGL)\r\n {\r\n game.renderer = new WebGLRenderer(game);\r\n }\r\n else\r\n {\r\n game.renderer = new CanvasRenderer(game);\r\n game.context = game.renderer.gameContext;\r\n }\r\n }\r\n\r\n if (false)\r\n {}\r\n\r\n if (false)\r\n {}\r\n};\r\n\r\nmodule.exports = CreateRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/CreateRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/DebugHeader.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/core/DebugHeader.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/const.js\");\r\n\r\n/**\r\n * Called automatically by Phaser.Game and responsible for creating the console.log debug header.\r\n *\r\n * You can customize or disable the header via the Game Config object.\r\n *\r\n * @function Phaser.Core.DebugHeader\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - The Phaser.Game instance which will output this debug header.\r\n */\r\nvar DebugHeader = function (game)\r\n{\r\n var config = game.config;\r\n\r\n if (config.hideBanner)\r\n {\r\n return;\r\n }\r\n\r\n var renderType = 'WebGL';\r\n\r\n if (config.renderType === CONST.CANVAS)\r\n {\r\n renderType = 'Canvas';\r\n }\r\n else if (config.renderType === CONST.HEADLESS)\r\n {\r\n renderType = 'Headless';\r\n }\r\n\r\n var audioConfig = config.audio;\r\n var deviceAudio = game.device.audio;\r\n\r\n var audioType;\r\n\r\n if (deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio))\r\n {\r\n audioType = 'Web Audio';\r\n }\r\n else if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData))\r\n {\r\n audioType = 'No Audio';\r\n }\r\n else\r\n {\r\n audioType = 'HTML5 Audio';\r\n }\r\n\r\n if (!game.device.browser.ie)\r\n {\r\n var c = '';\r\n var args = [ c ];\r\n\r\n if (Array.isArray(config.bannerBackgroundColor))\r\n {\r\n var lastColor;\r\n\r\n config.bannerBackgroundColor.forEach(function (color)\r\n {\r\n c = c.concat('%c ');\r\n\r\n args.push('background: ' + color);\r\n\r\n lastColor = color;\r\n\r\n });\r\n\r\n // inject the text color\r\n args[args.length - 1] = 'color: ' + config.bannerTextColor + '; background: ' + lastColor;\r\n }\r\n else\r\n {\r\n c = c.concat('%c ');\r\n\r\n args.push('color: ' + config.bannerTextColor + '; background: ' + config.bannerBackgroundColor);\r\n }\r\n\r\n // URL link background color (always white)\r\n args.push('background: #fff');\r\n\r\n if (config.gameTitle)\r\n {\r\n c = c.concat(config.gameTitle);\r\n\r\n if (config.gameVersion)\r\n {\r\n c = c.concat(' v' + config.gameVersion);\r\n }\r\n\r\n if (!config.hidePhaser)\r\n {\r\n c = c.concat(' / ');\r\n }\r\n }\r\n\r\n var fb = (typeof PLUGIN_FBINSTANT) ? '-FB' : '';\r\n\r\n if (!config.hidePhaser)\r\n {\r\n c = c.concat('Phaser v' + CONST.VERSION + fb + ' (' + renderType + ' | ' + audioType + ')');\r\n }\r\n\r\n c = c.concat(' %c ' + config.gameURL);\r\n\r\n // Inject the new string back into the args array\r\n args[0] = c;\r\n\r\n console.log.apply(console, args);\r\n }\r\n else if (window['console'])\r\n {\r\n console.log('Phaser v' + CONST.VERSION + ' / https://phaser.io');\r\n }\r\n};\r\n\r\nmodule.exports = DebugHeader;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/DebugHeader.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/Game.js": /*!**********************************************!*\ !*** ./node_modules/phaser/src/core/Game.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar AddToDOM = __webpack_require__(/*! ../dom/AddToDOM */ \"./node_modules/phaser/src/dom/AddToDOM.js\");\r\nvar AnimationManager = __webpack_require__(/*! ../animations/AnimationManager */ \"./node_modules/phaser/src/animations/AnimationManager.js\");\r\nvar CacheManager = __webpack_require__(/*! ../cache/CacheManager */ \"./node_modules/phaser/src/cache/CacheManager.js\");\r\nvar CanvasPool = __webpack_require__(/*! ../display/canvas/CanvasPool */ \"./node_modules/phaser/src/display/canvas/CanvasPool.js\");\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Config = __webpack_require__(/*! ./Config */ \"./node_modules/phaser/src/core/Config.js\");\r\nvar CreateDOMContainer = __webpack_require__(/*! ../dom/CreateDOMContainer */ \"./node_modules/phaser/src/dom/CreateDOMContainer.js\");\r\nvar CreateRenderer = __webpack_require__(/*! ./CreateRenderer */ \"./node_modules/phaser/src/core/CreateRenderer.js\");\r\nvar DataManager = __webpack_require__(/*! ../data/DataManager */ \"./node_modules/phaser/src/data/DataManager.js\");\r\nvar DebugHeader = __webpack_require__(/*! ./DebugHeader */ \"./node_modules/phaser/src/core/DebugHeader.js\");\r\nvar Device = __webpack_require__(/*! ../device */ \"./node_modules/phaser/src/device/index.js\");\r\nvar DOMContentLoaded = __webpack_require__(/*! ../dom/DOMContentLoaded */ \"./node_modules/phaser/src/dom/DOMContentLoaded.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/core/events/index.js\");\r\nvar InputManager = __webpack_require__(/*! ../input/InputManager */ \"./node_modules/phaser/src/input/InputManager.js\");\r\nvar PluginCache = __webpack_require__(/*! ../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar PluginManager = __webpack_require__(/*! ../plugins/PluginManager */ \"./node_modules/phaser/src/plugins/PluginManager.js\");\r\nvar ScaleManager = __webpack_require__(/*! ../scale/ScaleManager */ \"./node_modules/phaser/src/scale/ScaleManager.js\");\r\nvar SceneManager = __webpack_require__(/*! ../scene/SceneManager */ \"./node_modules/phaser/src/scene/SceneManager.js\");\r\nvar TextureEvents = __webpack_require__(/*! ../textures/events */ \"./node_modules/phaser/src/textures/events/index.js\");\r\nvar TextureManager = __webpack_require__(/*! ../textures/TextureManager */ \"./node_modules/phaser/src/textures/TextureManager.js\");\r\nvar TimeStep = __webpack_require__(/*! ./TimeStep */ \"./node_modules/phaser/src/core/TimeStep.js\");\r\nvar VisibilityHandler = __webpack_require__(/*! ./VisibilityHandler */ \"./node_modules/phaser/src/core/VisibilityHandler.js\");\r\n\r\nif (typeof FEATURE_SOUND)\r\n{\r\n var SoundManagerCreator = __webpack_require__(/*! ../sound/SoundManagerCreator */ \"./node_modules/phaser/src/sound/SoundManagerCreator.js\");\r\n}\r\n\r\nif (typeof PLUGIN_FBINSTANT)\r\n{\r\n var FacebookInstantGamesPlugin = __webpack_require__(/*! ../../plugins/fbinstant/src/FacebookInstantGamesPlugin */ \"./node_modules/phaser/plugins/fbinstant/src/FacebookInstantGamesPlugin.js\");\r\n}\r\n\r\n/**\r\n * @classdesc\r\n * The Phaser.Game instance is the main controller for the entire Phaser game. It is responsible\r\n * for handling the boot process, parsing the configuration values, creating the renderer,\r\n * and setting-up all of the global Phaser systems, such as sound and input.\r\n * Once that is complete it will start the Scene Manager and then begin the main game loop.\r\n *\r\n * You should generally avoid accessing any of the systems created by Game, and instead use those\r\n * made available to you via the Phaser.Scene Systems class instead.\r\n *\r\n * @class Game\r\n * @memberof Phaser\r\n * @constructor\r\n * @fires Phaser.Core.Events#BLUR\r\n * @fires Phaser.Core.Events#FOCUS\r\n * @fires Phaser.Core.Events#HIDDEN\r\n * @fires Phaser.Core.Events#VISIBLE\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Core.GameConfig} [GameConfig] - The configuration object for your Phaser Game instance.\r\n */\r\nvar Game = new Class({\r\n\r\n initialize:\r\n\r\n function Game (config)\r\n {\r\n /**\r\n * The parsed Game Configuration object.\r\n *\r\n * The values stored within this object are read-only and should not be changed at run-time.\r\n *\r\n * @name Phaser.Game#config\r\n * @type {Phaser.Core.Config}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.config = new Config(config);\r\n\r\n /**\r\n * A reference to either the Canvas or WebGL Renderer that this Game is using.\r\n *\r\n * @name Phaser.Game#renderer\r\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\r\n * @since 3.0.0\r\n */\r\n this.renderer = null;\r\n\r\n /**\r\n * A reference to an HTML Div Element used as the DOM Element Container.\r\n *\r\n * Only set if `createDOMContainer` is `true` in the game config (by default it is `false`) and\r\n * if you provide a parent element to insert the Phaser Game inside.\r\n *\r\n * See the DOM Element Game Object for more details.\r\n *\r\n * @name Phaser.Game#domContainer\r\n * @type {HTMLDivElement}\r\n * @since 3.17.0\r\n */\r\n this.domContainer = null;\r\n\r\n /**\r\n * A reference to the HTML Canvas Element that Phaser uses to render the game.\r\n * This is created automatically by Phaser unless you provide a `canvas` property\r\n * in your Game Config.\r\n *\r\n * @name Phaser.Game#canvas\r\n * @type {HTMLCanvasElement}\r\n * @since 3.0.0\r\n */\r\n this.canvas = null;\r\n\r\n /**\r\n * A reference to the Rendering Context belonging to the Canvas Element this game is rendering to.\r\n * If the game is running under Canvas it will be a 2d Canvas Rendering Context.\r\n * If the game is running under WebGL it will be a WebGL Rendering Context.\r\n * This context is created automatically by Phaser unless you provide a `context` property\r\n * in your Game Config.\r\n *\r\n * @name Phaser.Game#context\r\n * @type {(CanvasRenderingContext2D|WebGLRenderingContext)}\r\n * @since 3.0.0\r\n */\r\n this.context = null;\r\n\r\n /**\r\n * A flag indicating when this Game instance has finished its boot process.\r\n *\r\n * @name Phaser.Game#isBooted\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.isBooted = false;\r\n\r\n /**\r\n * A flag indicating if this Game is currently running its game step or not.\r\n *\r\n * @name Phaser.Game#isRunning\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.isRunning = false;\r\n\r\n /**\r\n * An Event Emitter which is used to broadcast game-level events from the global systems.\r\n *\r\n * @name Phaser.Game#events\r\n * @type {Phaser.Events.EventEmitter}\r\n * @since 3.0.0\r\n */\r\n this.events = new EventEmitter();\r\n\r\n /**\r\n * An instance of the Animation Manager.\r\n *\r\n * The Animation Manager is a global system responsible for managing all animations used within your game.\r\n *\r\n * @name Phaser.Game#anims\r\n * @type {Phaser.Animations.AnimationManager}\r\n * @since 3.0.0\r\n */\r\n this.anims = new AnimationManager(this);\r\n\r\n /**\r\n * An instance of the Texture Manager.\r\n *\r\n * The Texture Manager is a global system responsible for managing all textures being used by your game.\r\n *\r\n * @name Phaser.Game#textures\r\n * @type {Phaser.Textures.TextureManager}\r\n * @since 3.0.0\r\n */\r\n this.textures = new TextureManager(this);\r\n\r\n /**\r\n * An instance of the Cache Manager.\r\n *\r\n * The Cache Manager is a global system responsible for caching, accessing and releasing external game assets.\r\n *\r\n * @name Phaser.Game#cache\r\n * @type {Phaser.Cache.CacheManager}\r\n * @since 3.0.0\r\n */\r\n this.cache = new CacheManager(this);\r\n\r\n /**\r\n * An instance of the Data Manager\r\n *\r\n * @name Phaser.Game#registry\r\n * @type {Phaser.Data.DataManager}\r\n * @since 3.0.0\r\n */\r\n this.registry = new DataManager(this);\r\n\r\n /**\r\n * An instance of the Input Manager.\r\n *\r\n * The Input Manager is a global system responsible for the capture of browser-level input events.\r\n *\r\n * @name Phaser.Game#input\r\n * @type {Phaser.Input.InputManager}\r\n * @since 3.0.0\r\n */\r\n this.input = new InputManager(this, this.config);\r\n\r\n /**\r\n * An instance of the Scene Manager.\r\n *\r\n * The Scene Manager is a global system responsible for creating, modifying and updating the Scenes in your game.\r\n *\r\n * @name Phaser.Game#scene\r\n * @type {Phaser.Scenes.SceneManager}\r\n * @since 3.0.0\r\n */\r\n this.scene = new SceneManager(this, this.config.sceneConfig);\r\n\r\n /**\r\n * A reference to the Device inspector.\r\n *\r\n * Contains information about the device running this game, such as OS, browser vendor and feature support.\r\n * Used by various systems to determine capabilities and code paths.\r\n *\r\n * @name Phaser.Game#device\r\n * @type {Phaser.DeviceConf}\r\n * @since 3.0.0\r\n */\r\n this.device = Device;\r\n\r\n /**\r\n * An instance of the Scale Manager.\r\n *\r\n * The Scale Manager is a global system responsible for handling scaling of the game canvas.\r\n *\r\n * @name Phaser.Game#scale\r\n * @type {Phaser.Scale.ScaleManager}\r\n * @since 3.16.0\r\n */\r\n this.scale = new ScaleManager(this, this.config);\r\n\r\n /**\r\n * An instance of the base Sound Manager.\r\n *\r\n * The Sound Manager is a global system responsible for the playback and updating of all audio in your game.\r\n *\r\n * You can disable the inclusion of the Sound Manager in your build by toggling the webpack `FEATURE_SOUND` flag.\r\n *\r\n * @name Phaser.Game#sound\r\n * @type {(Phaser.Sound.NoAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager|Phaser.Sound.WebAudioSoundManager)}\r\n * @since 3.0.0\r\n */\r\n this.sound = null;\r\n\r\n if (typeof FEATURE_SOUND)\r\n {\r\n this.sound = SoundManagerCreator.create(this);\r\n }\r\n\r\n /**\r\n * An instance of the Time Step.\r\n *\r\n * The Time Step is a global system responsible for setting-up and responding to the browser frame events, processing\r\n * them and calculating delta values. It then automatically calls the game step.\r\n *\r\n * @name Phaser.Game#loop\r\n * @type {Phaser.Core.TimeStep}\r\n * @since 3.0.0\r\n */\r\n this.loop = new TimeStep(this, this.config.fps);\r\n\r\n /**\r\n * An instance of the Plugin Manager.\r\n *\r\n * The Plugin Manager is a global system that allows plugins to register themselves with it, and can then install\r\n * those plugins into Scenes as required.\r\n *\r\n * @name Phaser.Game#plugins\r\n * @type {Phaser.Plugins.PluginManager}\r\n * @since 3.0.0\r\n */\r\n this.plugins = new PluginManager(this, this.config);\r\n\r\n if (typeof PLUGIN_FBINSTANT)\r\n {\r\n /**\r\n * An instance of the Facebook Instant Games Plugin.\r\n *\r\n * This will only be available if the plugin has been built into Phaser,\r\n * or you're using the special Facebook Instant Games custom build.\r\n *\r\n * @name Phaser.Game#facebook\r\n * @type {Phaser.FacebookInstantGamesPlugin}\r\n * @since 3.13.0\r\n */\r\n this.facebook = new FacebookInstantGamesPlugin(this);\r\n }\r\n\r\n /**\r\n * Is this Game pending destruction at the start of the next frame?\r\n *\r\n * @name Phaser.Game#pendingDestroy\r\n * @type {boolean}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this.pendingDestroy = false;\r\n\r\n /**\r\n * Remove the Canvas once the destroy is over?\r\n *\r\n * @name Phaser.Game#removeCanvas\r\n * @type {boolean}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this.removeCanvas = false;\r\n\r\n /**\r\n * Remove everything when the game is destroyed.\r\n * You cannot create a new Phaser instance on the same web page after doing this.\r\n *\r\n * @name Phaser.Game#noReturn\r\n * @type {boolean}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this.noReturn = false;\r\n\r\n /**\r\n * Does the window the game is running in currently have focus or not?\r\n * This is modified by the VisibilityHandler.\r\n *\r\n * @name Phaser.Game#hasFocus\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.9.0\r\n */\r\n this.hasFocus = false;\r\n\r\n // Wait for the DOM Ready event, then call boot.\r\n DOMContentLoaded(this.boot.bind(this));\r\n },\r\n\r\n /**\r\n * This method is called automatically when the DOM is ready. It is responsible for creating the renderer,\r\n * displaying the Debug Header, adding the game canvas to the DOM and emitting the 'boot' event.\r\n * It listens for a 'ready' event from the base systems and once received it will call `Game.start`.\r\n *\r\n * @method Phaser.Game#boot\r\n * @protected\r\n * @fires Phaser.Core.Events#BOOT\r\n * @listens Phaser.Textures.Events#READY\r\n * @since 3.0.0\r\n */\r\n boot: function ()\r\n {\r\n if (!PluginCache.hasCore('EventEmitter'))\r\n {\r\n console.warn('Aborting. Core Plugins missing.');\r\n return;\r\n }\r\n\r\n this.isBooted = true;\r\n\r\n this.config.preBoot(this);\r\n\r\n this.scale.preBoot();\r\n\r\n CreateRenderer(this);\r\n\r\n CreateDOMContainer(this);\r\n\r\n DebugHeader(this);\r\n\r\n AddToDOM(this.canvas, this.config.parent);\r\n\r\n // The Texture Manager has to wait on a couple of non-blocking events before it's fully ready.\r\n // So it will emit this internal event when done:\r\n this.textures.once(TextureEvents.READY, this.texturesReady, this);\r\n\r\n this.events.emit(Events.BOOT);\r\n },\r\n\r\n /**\r\n * Called automatically when the Texture Manager has finished setting up and preparing the\r\n * default textures.\r\n *\r\n * @method Phaser.Game#texturesReady\r\n * @private\r\n * @fires Phaser.Game#ready\r\n * @since 3.12.0\r\n */\r\n texturesReady: function ()\r\n {\r\n // Start all the other systems\r\n this.events.emit(Events.READY);\r\n\r\n this.start();\r\n },\r\n\r\n /**\r\n * Called automatically by Game.boot once all of the global systems have finished setting themselves up.\r\n * By this point the Game is now ready to start the main loop running.\r\n * It will also enable the Visibility Handler.\r\n *\r\n * @method Phaser.Game#start\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n start: function ()\r\n {\r\n this.isRunning = true;\r\n\r\n this.config.postBoot(this);\r\n\r\n if (this.renderer)\r\n {\r\n this.loop.start(this.step.bind(this));\r\n }\r\n else\r\n {\r\n this.loop.start(this.headlessStep.bind(this));\r\n }\r\n\r\n VisibilityHandler(this);\r\n\r\n var eventEmitter = this.events;\r\n\r\n eventEmitter.on(Events.HIDDEN, this.onHidden, this);\r\n eventEmitter.on(Events.VISIBLE, this.onVisible, this);\r\n eventEmitter.on(Events.BLUR, this.onBlur, this);\r\n eventEmitter.on(Events.FOCUS, this.onFocus, this);\r\n },\r\n\r\n /**\r\n * The main Game Step. Called automatically by the Time Step, once per browser frame (typically as a result of\r\n * Request Animation Frame, or Set Timeout on very old browsers.)\r\n *\r\n * The step will update the global managers first, then proceed to update each Scene in turn, via the Scene Manager.\r\n *\r\n * It will then render each Scene in turn, via the Renderer. This process emits `prerender` and `postrender` events.\r\n *\r\n * @method Phaser.Game#step\r\n * @fires Phaser.Core.Events#PRE_STEP_EVENT\r\n * @fires Phaser.Core.Events#STEP_EVENT\r\n * @fires Phaser.Core.Events#POST_STEP_EVENT\r\n * @fires Phaser.Core.Events#PRE_RENDER_EVENT\r\n * @fires Phaser.Core.Events#POST_RENDER_EVENT\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\n step: function (time, delta)\r\n {\r\n if (this.pendingDestroy)\r\n {\r\n return this.runDestroy();\r\n }\r\n\r\n var eventEmitter = this.events;\r\n\r\n // Global Managers like Input and Sound update in the prestep\r\n\r\n eventEmitter.emit(Events.PRE_STEP, time, delta);\r\n\r\n // This is mostly meant for user-land code and plugins\r\n\r\n eventEmitter.emit(Events.STEP, time, delta);\r\n\r\n // Update the Scene Manager and all active Scenes\r\n\r\n this.scene.update(time, delta);\r\n\r\n // Our final event before rendering starts\r\n\r\n eventEmitter.emit(Events.POST_STEP, time, delta);\r\n\r\n var renderer = this.renderer;\r\n\r\n // Run the Pre-render (clearing the canvas, setting background colors, etc)\r\n\r\n renderer.preRender();\r\n\r\n eventEmitter.emit(Events.PRE_RENDER, renderer, time, delta);\r\n\r\n // The main render loop. Iterates all Scenes and all Cameras in those scenes, rendering to the renderer instance.\r\n\r\n this.scene.render(renderer);\r\n\r\n // The Post-Render call. Tidies up loose end, takes snapshots, etc.\r\n\r\n renderer.postRender();\r\n\r\n // The final event before the step repeats. Your last chance to do anything to the canvas before it all starts again.\r\n\r\n eventEmitter.emit(Events.POST_RENDER, renderer, time, delta);\r\n },\r\n\r\n /**\r\n * A special version of the Game Step for the HEADLESS renderer only.\r\n *\r\n * The main Game Step. Called automatically by the Time Step, once per browser frame (typically as a result of\r\n * Request Animation Frame, or Set Timeout on very old browsers.)\r\n *\r\n * The step will update the global managers first, then proceed to update each Scene in turn, via the Scene Manager.\r\n *\r\n * This process emits `prerender` and `postrender` events, even though nothing actually displays.\r\n *\r\n * @method Phaser.Game#headlessStep\r\n * @fires Phaser.Game#prerenderEvent\r\n * @fires Phaser.Game#postrenderEvent\r\n * @since 3.2.0\r\n *\r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\n headlessStep: function (time, delta)\r\n {\r\n if (this.pendingDestroy)\r\n {\r\n return this.runDestroy();\r\n }\r\n\r\n var eventEmitter = this.events;\r\n\r\n // Global Managers\r\n\r\n eventEmitter.emit(Events.PRE_STEP, time, delta);\r\n\r\n eventEmitter.emit(Events.STEP, time, delta);\r\n\r\n // Scenes\r\n\r\n this.scene.update(time, delta);\r\n\r\n eventEmitter.emit(Events.POST_STEP, time, delta);\r\n\r\n // Render\r\n\r\n eventEmitter.emit(Events.PRE_RENDER);\r\n\r\n eventEmitter.emit(Events.POST_RENDER);\r\n },\r\n\r\n /**\r\n * Called automatically by the Visibility Handler.\r\n * This will pause the main loop and then emit a pause event.\r\n *\r\n * @method Phaser.Game#onHidden\r\n * @protected\r\n * @fires Phaser.Core.Events#PAUSE\r\n * @since 3.0.0\r\n */\r\n onHidden: function ()\r\n {\r\n this.loop.pause();\r\n\r\n this.events.emit(Events.PAUSE);\r\n },\r\n\r\n /**\r\n * Called automatically by the Visibility Handler.\r\n * This will resume the main loop and then emit a resume event.\r\n *\r\n * @method Phaser.Game#onVisible\r\n * @protected\r\n * @fires Phaser.Core.Events#RESUME\r\n * @since 3.0.0\r\n */\r\n onVisible: function ()\r\n {\r\n this.loop.resume();\r\n\r\n this.events.emit(Events.RESUME);\r\n },\r\n\r\n /**\r\n * Called automatically by the Visibility Handler.\r\n * This will set the main loop into a 'blurred' state, which pauses it.\r\n *\r\n * @method Phaser.Game#onBlur\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n onBlur: function ()\r\n {\r\n this.hasFocus = false;\r\n\r\n this.loop.blur();\r\n },\r\n\r\n /**\r\n * Called automatically by the Visibility Handler.\r\n * This will set the main loop into a 'focused' state, which resumes it.\r\n *\r\n * @method Phaser.Game#onFocus\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n onFocus: function ()\r\n {\r\n this.hasFocus = true;\r\n\r\n this.loop.focus();\r\n },\r\n\r\n /**\r\n * Returns the current game frame.\r\n *\r\n * When the game starts running, the frame is incremented every time Request Animation Frame, or Set Timeout, fires.\r\n *\r\n * @method Phaser.Game#getFrame\r\n * @since 3.16.0\r\n *\r\n * @return {number} The current game frame.\r\n */\r\n getFrame: function ()\r\n {\r\n return this.loop.frame;\r\n },\r\n\r\n /**\r\n * Returns the time that the current game step started at, as based on `performance.now`.\r\n *\r\n * @method Phaser.Game#getTime\r\n * @since 3.16.0\r\n *\r\n * @return {number} The current game timestamp.\r\n */\r\n getTime: function ()\r\n {\r\n return this.loop.now;\r\n },\r\n\r\n /**\r\n * Flags this Game instance as needing to be destroyed on the _next frame_, making this an asynchronous operation.\r\n *\r\n * It will wait until the current frame has completed and then call `runDestroy` internally.\r\n *\r\n * If you need to react to the games eventual destruction, listen for the `DESTROY` event.\r\n *\r\n * If you **do not** need to run Phaser again on the same web page you can set the `noReturn` argument to `true` and it will free-up\r\n * memory being held by the core Phaser plugins. If you do need to create another game instance on the same page, leave this as `false`.\r\n *\r\n * @method Phaser.Game#destroy\r\n * @fires Phaser.Core.Events#DESTROY\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} removeCanvas - Set to `true` if you would like the parent canvas element removed from the DOM, or `false` to leave it in place.\r\n * @param {boolean} [noReturn=false] - If `true` all the core Phaser plugins are destroyed. You cannot create another instance of Phaser on the same web page if you do this.\r\n */\r\n destroy: function (removeCanvas, noReturn)\r\n {\r\n if (noReturn === undefined) { noReturn = false; }\r\n\r\n this.pendingDestroy = true;\r\n\r\n this.removeCanvas = removeCanvas;\r\n this.noReturn = noReturn;\r\n },\r\n\r\n /**\r\n * Destroys this Phaser.Game instance, all global systems, all sub-systems and all Scenes.\r\n *\r\n * @method Phaser.Game#runDestroy\r\n * @private\r\n * @since 3.5.0\r\n */\r\n runDestroy: function ()\r\n {\r\n this.scene.destroy();\r\n \r\n this.events.emit(Events.DESTROY);\r\n\r\n this.events.removeAllListeners();\r\n\r\n if (this.renderer)\r\n {\r\n this.renderer.destroy();\r\n }\r\n\r\n if (this.removeCanvas && this.canvas)\r\n {\r\n CanvasPool.remove(this.canvas);\r\n\r\n if (this.canvas.parentNode)\r\n {\r\n this.canvas.parentNode.removeChild(this.canvas);\r\n }\r\n }\r\n\r\n if (this.domContainer)\r\n {\r\n this.domContainer.parentNode.removeChild(this.domContainer);\r\n }\r\n\r\n this.loop.destroy();\r\n\r\n this.pendingDestroy = false;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Game;\r\n\r\n/**\r\n * \"Computers are good at following instructions, but not at reading your mind.\" - Donald Knuth\r\n */\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/Game.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/TimeStep.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/core/TimeStep.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GetValue = __webpack_require__(/*! ../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar NOOP = __webpack_require__(/*! ../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar RequestAnimationFrame = __webpack_require__(/*! ../dom/RequestAnimationFrame */ \"./node_modules/phaser/src/dom/RequestAnimationFrame.js\");\r\n\r\n// http://www.testufo.com/#test=animation-time-graph\r\n\r\n/**\r\n * @classdesc\r\n * The core runner class that Phaser uses to handle the game loop. It can use either Request Animation Frame,\r\n * or SetTimeout, based on browser support and config settings, to create a continuous loop within the browser.\r\n * \r\n * Each time the loop fires, `TimeStep.step` is called and this is then passed onto the core Game update loop,\r\n * it is the core heartbeat of your game. It will fire as often as Request Animation Frame is capable of handling\r\n * on the target device.\r\n * \r\n * Note that there are lots of situations where a browser will stop updating your game. Such as if the player\r\n * switches tabs, or covers up the browser window with another application. In these cases, the 'heartbeat'\r\n * of your game will pause, and only resume when focus is returned to it by the player. There is no way to avoid\r\n * this situation, all you can do is use the visibility events the browser, and Phaser, provide to detect when\r\n * it has happened and then gracefully recover.\r\n *\r\n * @class TimeStep\r\n * @memberof Phaser.Core\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - A reference to the Phaser.Game instance that owns this Time Step.\r\n * @param {Phaser.Types.Core.FPSConfig} config\r\n */\r\nvar TimeStep = new Class({\r\n\r\n initialize:\r\n\r\n function TimeStep (game, config)\r\n {\r\n /**\r\n * A reference to the Phaser.Game instance.\r\n *\r\n * @name Phaser.Core.TimeStep#game\r\n * @type {Phaser.Game}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.game = game;\r\n\r\n /**\r\n * The Request Animation Frame DOM Event handler.\r\n *\r\n * @name Phaser.Core.TimeStep#raf\r\n * @type {Phaser.DOM.RequestAnimationFrame}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.raf = new RequestAnimationFrame();\r\n\r\n /**\r\n * A flag that is set once the TimeStep has started running and toggled when it stops.\r\n *\r\n * @name Phaser.Core.TimeStep#started\r\n * @type {boolean}\r\n * @readonly\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.started = false;\r\n\r\n /**\r\n * A flag that is set once the TimeStep has started running and toggled when it stops.\r\n * The difference between this value and `started` is that `running` is toggled when\r\n * the TimeStep is sent to sleep, where-as `started` remains `true`, only changing if\r\n * the TimeStep is actually stopped, not just paused.\r\n *\r\n * @name Phaser.Core.TimeStep#running\r\n * @type {boolean}\r\n * @readonly\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.running = false;\r\n\r\n /**\r\n * The minimum fps rate you want the Time Step to run at.\r\n *\r\n * @name Phaser.Core.TimeStep#minFps\r\n * @type {integer}\r\n * @default 5\r\n * @since 3.0.0\r\n */\r\n this.minFps = GetValue(config, 'min', 5);\r\n\r\n /**\r\n * The target fps rate for the Time Step to run at.\r\n *\r\n * Setting this value will not actually change the speed at which the browser runs, that is beyond\r\n * the control of Phaser. Instead, it allows you to determine performance issues and if the Time Step\r\n * is spiraling out of control.\r\n *\r\n * @name Phaser.Core.TimeStep#targetFps\r\n * @type {integer}\r\n * @default 60\r\n * @since 3.0.0\r\n */\r\n this.targetFps = GetValue(config, 'target', 60);\r\n\r\n /**\r\n * The minFps value in ms.\r\n * Defaults to 200ms between frames (i.e. super slow!)\r\n *\r\n * @name Phaser.Core.TimeStep#_min\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._min = 1000 / this.minFps;\r\n\r\n /**\r\n * The targetFps value in ms.\r\n * Defaults to 16.66ms between frames (i.e. normal)\r\n *\r\n * @name Phaser.Core.TimeStep#_target\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._target = 1000 / this.targetFps;\r\n\r\n /**\r\n * An exponential moving average of the frames per second.\r\n *\r\n * @name Phaser.Core.TimeStep#actualFps\r\n * @type {integer}\r\n * @readonly\r\n * @default 60\r\n * @since 3.0.0\r\n */\r\n this.actualFps = this.targetFps;\r\n\r\n /**\r\n * The time at which the next fps rate update will take place.\r\n * When an fps update happens, the `framesThisSecond` value is reset.\r\n *\r\n * @name Phaser.Core.TimeStep#nextFpsUpdate\r\n * @type {integer}\r\n * @readonly\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.nextFpsUpdate = 0;\r\n\r\n /**\r\n * The number of frames processed this second.\r\n *\r\n * @name Phaser.Core.TimeStep#framesThisSecond\r\n * @type {integer}\r\n * @readonly\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.framesThisSecond = 0;\r\n\r\n /**\r\n * A callback to be invoked each time the Time Step steps.\r\n *\r\n * @name Phaser.Core.TimeStep#callback\r\n * @type {Phaser.Types.Core.TimeStepCallback}\r\n * @default NOOP\r\n * @since 3.0.0\r\n */\r\n this.callback = NOOP;\r\n\r\n /**\r\n * You can force the Time Step to use Set Timeout instead of Request Animation Frame by setting\r\n * the `forceSetTimeOut` property to `true` in the Game Configuration object. It cannot be changed at run-time.\r\n *\r\n * @name Phaser.Core.TimeStep#forceSetTimeOut\r\n * @type {boolean}\r\n * @readonly\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.forceSetTimeOut = GetValue(config, 'forceSetTimeOut', false);\r\n\r\n /**\r\n * The time, calculated at the start of the current step, as smoothed by the delta value.\r\n *\r\n * @name Phaser.Core.TimeStep#time\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.time = 0;\r\n\r\n /**\r\n * The time at which the game started running. This value is adjusted if the game is then\r\n * paused and resumes.\r\n *\r\n * @name Phaser.Core.TimeStep#startTime\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.startTime = 0;\r\n\r\n /**\r\n * The time, as returned by `performance.now` of the previous step.\r\n *\r\n * @name Phaser.Core.TimeStep#lastTime\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.lastTime = 0;\r\n\r\n /**\r\n * The current frame the game is on. This counter is incremented once every game step, regardless of how much\r\n * time has passed and is unaffected by delta smoothing.\r\n *\r\n * @name Phaser.Core.TimeStep#frame\r\n * @type {integer}\r\n * @readonly\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.frame = 0;\r\n\r\n /**\r\n * Is the browser currently considered in focus by the Page Visibility API?\r\n * This value is set in the `blur` method, which is called automatically by the Game instance.\r\n *\r\n * @name Phaser.Core.TimeStep#inFocus\r\n * @type {boolean}\r\n * @readonly\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.inFocus = true;\r\n\r\n /**\r\n * The timestamp at which the game became paused, as determined by the Page Visibility API.\r\n *\r\n * @name Phaser.Core.TimeStep#_pauseTime\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._pauseTime = 0;\r\n\r\n /**\r\n * An internal counter to allow for the browser 'cooling down' after coming back into focus.\r\n *\r\n * @name Phaser.Core.TimeStep#_coolDown\r\n * @type {integer}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._coolDown = 0;\r\n\r\n /**\r\n * The delta time, in ms, since the last game step. This is a clamped and smoothed average value.\r\n *\r\n * @name Phaser.Core.TimeStep#delta\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.delta = 0;\r\n\r\n /**\r\n * Internal index of the delta history position.\r\n *\r\n * @name Phaser.Core.TimeStep#deltaIndex\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.deltaIndex = 0;\r\n\r\n /**\r\n * Internal array holding the previous delta values, used for delta smoothing.\r\n *\r\n * @name Phaser.Core.TimeStep#deltaHistory\r\n * @type {integer[]}\r\n * @since 3.0.0\r\n */\r\n this.deltaHistory = [];\r\n\r\n /**\r\n * The maximum number of delta values that are retained in order to calculate a smoothed moving average.\r\n * \r\n * This can be changed in the Game Config via the `fps.deltaHistory` property. The default is 10.\r\n *\r\n * @name Phaser.Core.TimeStep#deltaSmoothingMax\r\n * @type {integer}\r\n * @default 10\r\n * @since 3.0.0\r\n */\r\n this.deltaSmoothingMax = GetValue(config, 'deltaHistory', 10);\r\n\r\n /**\r\n * The number of frames that the cooldown is set to after the browser panics over the FPS rate, usually\r\n * as a result of switching tabs and regaining focus.\r\n * \r\n * This can be changed in the Game Config via the `fps.panicMax` property. The default is 120.\r\n *\r\n * @name Phaser.Core.TimeStep#panicMax\r\n * @type {integer}\r\n * @default 120\r\n * @since 3.0.0\r\n */\r\n this.panicMax = GetValue(config, 'panicMax', 120);\r\n\r\n /**\r\n * The actual elapsed time in ms between one update and the next.\r\n * \r\n * Unlike with `delta`, no smoothing, capping, or averaging is applied to this value.\r\n * So please be careful when using this value in math calculations.\r\n *\r\n * @name Phaser.Core.TimeStep#rawDelta\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.rawDelta = 0;\r\n\r\n /**\r\n * The time, as returned by `performance.now` at the very start of the current step.\r\n * This can differ from the `time` value in that it isn't calculated based on the delta value.\r\n *\r\n * @name Phaser.Core.TimeStep#now\r\n * @type {number}\r\n * @default 0\r\n * @since 3.18.0\r\n */\r\n this.now = 0;\r\n\r\n /**\r\n * Apply smoothing to the delta value used within Phasers internal calculations?\r\n * \r\n * This can be changed in the Game Config via the `fps.smoothStep` property. The default is `true`.\r\n * \r\n * Smoothing helps settle down the delta values after browser tab switches, or other situations\r\n * which could cause significant delta spikes or dips. By default it has been enabled in Phaser 3\r\n * since the first version, but is now exposed under this property (and the corresponding game config\r\n * `smoothStep` value), to allow you to easily disable it, should you require.\r\n *\r\n * @name Phaser.Core.TimeStep#smoothStep\r\n * @type {boolean}\r\n * @since 3.22.0\r\n */\r\n this.smoothStep = GetValue(config, 'smoothStep', true);\r\n },\r\n\r\n /**\r\n * Called by the Game instance when the DOM window.onBlur event triggers.\r\n *\r\n * @method Phaser.Core.TimeStep#blur\r\n * @since 3.0.0\r\n */\r\n blur: function ()\r\n {\r\n this.inFocus = false;\r\n },\r\n\r\n /**\r\n * Called by the Game instance when the DOM window.onFocus event triggers.\r\n *\r\n * @method Phaser.Core.TimeStep#focus\r\n * @since 3.0.0\r\n */\r\n focus: function ()\r\n {\r\n this.inFocus = true;\r\n\r\n this.resetDelta();\r\n },\r\n\r\n /**\r\n * Called when the visibility API says the game is 'hidden' (tab switch out of view, etc)\r\n *\r\n * @method Phaser.Core.TimeStep#pause\r\n * @since 3.0.0\r\n */\r\n pause: function ()\r\n {\r\n this._pauseTime = window.performance.now();\r\n },\r\n\r\n /**\r\n * Called when the visibility API says the game is 'visible' again (tab switch back into view, etc)\r\n *\r\n * @method Phaser.Core.TimeStep#resume\r\n * @since 3.0.0\r\n */\r\n resume: function ()\r\n {\r\n this.resetDelta();\r\n\r\n this.startTime += this.time - this._pauseTime;\r\n },\r\n\r\n /**\r\n * Resets the time, lastTime, fps averages and delta history.\r\n * Called automatically when a browser sleeps them resumes.\r\n *\r\n * @method Phaser.Core.TimeStep#resetDelta\r\n * @since 3.0.0\r\n */\r\n resetDelta: function ()\r\n {\r\n var now = window.performance.now();\r\n\r\n this.time = now;\r\n this.lastTime = now;\r\n this.nextFpsUpdate = now + 1000;\r\n this.framesThisSecond = 0;\r\n\r\n // Pre-populate smoothing array\r\n\r\n for (var i = 0; i < this.deltaSmoothingMax; i++)\r\n {\r\n this.deltaHistory[i] = Math.min(this._target, this.deltaHistory[i]);\r\n }\r\n\r\n this.delta = 0;\r\n this.deltaIndex = 0;\r\n\r\n this._coolDown = this.panicMax;\r\n },\r\n\r\n /**\r\n * Starts the Time Step running, if it is not already doing so.\r\n * Called automatically by the Game Boot process.\r\n *\r\n * @method Phaser.Core.TimeStep#start\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Core.TimeStepCallback} callback - The callback to be invoked each time the Time Step steps.\r\n */\r\n start: function (callback)\r\n {\r\n if (this.started)\r\n {\r\n return this;\r\n }\r\n\r\n this.started = true;\r\n this.running = true;\r\n\r\n for (var i = 0; i < this.deltaSmoothingMax; i++)\r\n {\r\n this.deltaHistory[i] = this._target;\r\n }\r\n\r\n this.resetDelta();\r\n\r\n this.startTime = window.performance.now();\r\n\r\n this.callback = callback;\r\n\r\n this.raf.start(this.step.bind(this), this.forceSetTimeOut, this._target);\r\n },\r\n\r\n /**\r\n * The main step method. This is called each time the browser updates, either by Request Animation Frame,\r\n * or by Set Timeout. It is responsible for calculating the delta values, frame totals, cool down history and more.\r\n * You generally should never call this method directly.\r\n *\r\n * @method Phaser.Core.TimeStep#step\r\n * @since 3.0.0\r\n */\r\n step: function ()\r\n {\r\n // Because the timestamp passed in from raf represents the beginning of the main thread frame that we’re currently in,\r\n // not the actual time now, and as we want to compare this time value against Event timeStamps and the like, we need a\r\n // more accurate one:\r\n\r\n var time = window.performance.now();\r\n\r\n this.now = time;\r\n\r\n var before = time - this.lastTime;\r\n\r\n if (before < 0)\r\n {\r\n // Because, Chrome.\r\n before = 0;\r\n }\r\n\r\n this.rawDelta = before;\r\n\r\n var idx = this.deltaIndex;\r\n var history = this.deltaHistory;\r\n var max = this.deltaSmoothingMax;\r\n\r\n // delta time (time is in ms)\r\n var dt = before;\r\n\r\n // Delta Average\r\n var avg = before;\r\n\r\n // When a browser switches tab, then comes back again, it takes around 10 frames before\r\n // the delta time settles down so we employ a 'cooling down' period before we start\r\n // trusting the delta values again, to avoid spikes flooding through our delta average\r\n\r\n if (this.smoothStep)\r\n {\r\n if (this._coolDown > 0 || !this.inFocus)\r\n {\r\n this._coolDown--;\r\n \r\n dt = Math.min(dt, this._target);\r\n }\r\n \r\n if (dt > this._min)\r\n {\r\n // Probably super bad start time or browser tab context loss,\r\n // so use the last 'sane' dt value\r\n \r\n dt = history[idx];\r\n \r\n // Clamp delta to min (in case history has become corrupted somehow)\r\n dt = Math.min(dt, this._min);\r\n }\r\n \r\n // Smooth out the delta over the previous X frames\r\n \r\n // add the delta to the smoothing array\r\n history[idx] = dt;\r\n \r\n // adjusts the delta history array index based on the smoothing count\r\n // this stops the array growing beyond the size of deltaSmoothingMax\r\n this.deltaIndex++;\r\n \r\n if (this.deltaIndex > max)\r\n {\r\n this.deltaIndex = 0;\r\n }\r\n \r\n // Loop the history array, adding the delta values together\r\n avg = 0;\r\n \r\n for (var i = 0; i < max; i++)\r\n {\r\n avg += history[i];\r\n }\r\n \r\n // Then divide by the array length to get the average delta\r\n avg /= max;\r\n }\r\n\r\n // Set as the world delta value\r\n this.delta = avg;\r\n\r\n // Real-world timer advance\r\n this.time += this.rawDelta;\r\n\r\n // Update the estimate of the frame rate, `fps`. Every second, the number\r\n // of frames that occurred in that second are included in an exponential\r\n // moving average of all frames per second, with an alpha of 0.25. This\r\n // means that more recent seconds affect the estimated frame rate more than\r\n // older seconds.\r\n //\r\n // When a browser window is NOT minimized, but is covered up (i.e. you're using\r\n // another app which has spawned a window over the top of the browser), then it\r\n // will start to throttle the raf callback time. It waits for a while, and then\r\n // starts to drop the frame rate at 1 frame per second until it's down to just over 1fps.\r\n // So if the game was running at 60fps, and the player opens a new window, then\r\n // after 60 seconds (+ the 'buffer time') it'll be down to 1fps, so rafin'g at 1Hz.\r\n //\r\n // When they make the game visible again, the frame rate is increased at a rate of\r\n // approx. 8fps, back up to 60fps (or the max it can obtain)\r\n //\r\n // There is no easy way to determine if this drop in frame rate is because the\r\n // browser is throttling raf, or because the game is struggling with performance\r\n // because you're asking it to do too much on the device.\r\n\r\n if (time > this.nextFpsUpdate)\r\n {\r\n // Compute the new exponential moving average with an alpha of 0.25.\r\n this.actualFps = 0.25 * this.framesThisSecond + 0.75 * this.actualFps;\r\n this.nextFpsUpdate = time + 1000;\r\n this.framesThisSecond = 0;\r\n }\r\n\r\n this.framesThisSecond++;\r\n\r\n // Interpolation - how far between what is expected and where we are?\r\n var interpolation = avg / this._target;\r\n\r\n this.callback(time, avg, interpolation);\r\n\r\n // Shift time value over\r\n this.lastTime = time;\r\n\r\n this.frame++;\r\n },\r\n\r\n /**\r\n * Manually calls `TimeStep.step`.\r\n *\r\n * @method Phaser.Core.TimeStep#tick\r\n * @since 3.0.0\r\n */\r\n tick: function ()\r\n {\r\n this.step();\r\n },\r\n\r\n /**\r\n * Sends the TimeStep to sleep, stopping Request Animation Frame (or SetTimeout) and toggling the `running` flag to false.\r\n *\r\n * @method Phaser.Core.TimeStep#sleep\r\n * @since 3.0.0\r\n */\r\n sleep: function ()\r\n {\r\n if (this.running)\r\n {\r\n this.raf.stop();\r\n\r\n this.running = false;\r\n }\r\n },\r\n\r\n /**\r\n * Wakes-up the TimeStep, restarting Request Animation Frame (or SetTimeout) and toggling the `running` flag to true.\r\n * The `seamless` argument controls if the wake-up should adjust the start time or not.\r\n *\r\n * @method Phaser.Core.TimeStep#wake\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [seamless=false] - Adjust the startTime based on the lastTime values.\r\n */\r\n wake: function (seamless)\r\n {\r\n if (this.running)\r\n {\r\n this.sleep();\r\n }\r\n else if (seamless)\r\n {\r\n this.startTime += -this.lastTime + (this.lastTime + window.performance.now());\r\n }\r\n\r\n this.raf.start(this.step.bind(this), this.useRAF);\r\n\r\n this.running = true;\r\n\r\n this.step();\r\n },\r\n\r\n /**\r\n * Gets the duration which the game has been running, in seconds.\r\n *\r\n * @method Phaser.Core.TimeStep#getDuration\r\n * @since 3.17.0\r\n *\r\n * @return {number} The duration in seconds.\r\n */\r\n getDuration: function ()\r\n {\r\n return Math.round(this.lastTime - this.startTime) / 1000;\r\n },\r\n\r\n /**\r\n * Gets the duration which the game has been running, in ms.\r\n *\r\n * @method Phaser.Core.TimeStep#getDurationMS\r\n * @since 3.17.0\r\n *\r\n * @return {number} The duration in ms.\r\n */\r\n getDurationMS: function ()\r\n {\r\n return Math.round(this.lastTime - this.startTime);\r\n },\r\n\r\n /**\r\n * Stops the TimeStep running.\r\n *\r\n * @method Phaser.Core.TimeStep#stop\r\n * @since 3.0.0\r\n *\r\n * @return {this} The TimeStep object.\r\n */\r\n stop: function ()\r\n {\r\n this.running = false;\r\n this.started = false;\r\n\r\n this.raf.stop();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Destroys the TimeStep. This will stop Request Animation Frame, stop the step, clear the callbacks and null\r\n * any objects.\r\n *\r\n * @method Phaser.Core.TimeStep#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.stop();\r\n\r\n this.callback = NOOP;\r\n\r\n this.raf = null;\r\n this.game = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = TimeStep;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/TimeStep.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/VisibilityHandler.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/core/VisibilityHandler.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/core/events/index.js\");\r\n\r\n/**\r\n * The Visibility Handler is responsible for listening out for document level visibility change events.\r\n * This includes `visibilitychange` if the browser supports it, and blur and focus events. It then uses\r\n * the provided Event Emitter and fires the related events.\r\n *\r\n * @function Phaser.Core.VisibilityHandler\r\n * @fires Phaser.Core.Events#BLUR\r\n * @fires Phaser.Core.Events#FOCUS\r\n * @fires Phaser.Core.Events#HIDDEN\r\n * @fires Phaser.Core.Events#VISIBLE\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - The Game instance this Visibility Handler is working on.\r\n */\r\nvar VisibilityHandler = function (game)\r\n{\r\n var hiddenVar;\r\n var eventEmitter = game.events;\r\n\r\n if (document.hidden !== undefined)\r\n {\r\n hiddenVar = 'visibilitychange';\r\n }\r\n else\r\n {\r\n var vendors = [ 'webkit', 'moz', 'ms' ];\r\n\r\n vendors.forEach(function (prefix)\r\n {\r\n if (document[prefix + 'Hidden'] !== undefined)\r\n {\r\n document.hidden = function ()\r\n {\r\n return document[prefix + 'Hidden'];\r\n };\r\n\r\n hiddenVar = prefix + 'visibilitychange';\r\n }\r\n\r\n });\r\n }\r\n\r\n var onChange = function (event)\r\n {\r\n if (document.hidden || event.type === 'pause')\r\n {\r\n eventEmitter.emit(Events.HIDDEN);\r\n }\r\n else\r\n {\r\n eventEmitter.emit(Events.VISIBLE);\r\n }\r\n };\r\n\r\n if (hiddenVar)\r\n {\r\n document.addEventListener(hiddenVar, onChange, false);\r\n }\r\n\r\n window.onblur = function ()\r\n {\r\n eventEmitter.emit(Events.BLUR);\r\n };\r\n\r\n window.onfocus = function ()\r\n {\r\n eventEmitter.emit(Events.FOCUS);\r\n };\r\n\r\n // Automatically give the window focus unless config says otherwise\r\n if (window.focus && game.config.autoFocus)\r\n {\r\n window.focus();\r\n }\r\n};\r\n\r\nmodule.exports = VisibilityHandler;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/VisibilityHandler.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/BLUR_EVENT.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/core/events/BLUR_EVENT.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Blur Event.\r\n * \r\n * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded\r\n * enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps\r\n * tab, or if they simply remove focus from the browser to another app.\r\n *\r\n * @event Phaser.Core.Events#BLUR\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'blur';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/BLUR_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/BOOT_EVENT.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/core/events/BOOT_EVENT.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Boot Event.\r\n * \r\n * This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running.\r\n * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required.\r\n *\r\n * @event Phaser.Core.Events#BOOT\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'boot';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/BOOT_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/CONTEXT_LOST_EVENT.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/core/events/CONTEXT_LOST_EVENT.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Context Lost Event.\r\n * \r\n * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Lost event from the browser.\r\n * \r\n * The partner event is `CONTEXT_RESTORED`.\r\n *\r\n * @event Phaser.Core.Events#CONTEXT_LOST\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'contextlost';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/CONTEXT_LOST_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/CONTEXT_RESTORED_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/core/events/CONTEXT_RESTORED_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Context Restored Event.\r\n * \r\n * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Restored event from the browser.\r\n * \r\n * The partner event is `CONTEXT_LOST`.\r\n *\r\n * @event Phaser.Core.Events#CONTEXT_RESTORED\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'contextrestored';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/CONTEXT_RESTORED_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/DESTROY_EVENT.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/core/events/DESTROY_EVENT.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Destroy Event.\r\n * \r\n * This event is dispatched when the game instance has been told to destroy itself.\r\n * Lots of internal systems listen to this event in order to clear themselves out.\r\n * Custom plugins and game code should also do the same.\r\n *\r\n * @event Phaser.Core.Events#DESTROY\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'destroy';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/DESTROY_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/FOCUS_EVENT.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/core/events/FOCUS_EVENT.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Focus Event.\r\n * \r\n * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded\r\n * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it.\r\n *\r\n * @event Phaser.Core.Events#FOCUS\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'focus';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/FOCUS_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/HIDDEN_EVENT.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/core/events/HIDDEN_EVENT.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Hidden Event.\r\n * \r\n * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded\r\n * enters a hidden state. Only browsers that support the Visibility API will cause this event to be emitted.\r\n * \r\n * In most modern browsers, when the document enters a hidden state, the Request Animation Frame and setTimeout, which\r\n * control the main game loop, will automatically pause. There is no way to stop this from happening. It is something\r\n * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games)\r\n *\r\n * @event Phaser.Core.Events#HIDDEN\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'hidden';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/HIDDEN_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/PAUSE_EVENT.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/core/events/PAUSE_EVENT.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Pause Event.\r\n * \r\n * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler.\r\n *\r\n * @event Phaser.Core.Events#PAUSE\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'pause';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/PAUSE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/POST_RENDER_EVENT.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/core/events/POST_RENDER_EVENT.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Post-Render Event.\r\n * \r\n * This event is dispatched right at the end of the render process.\r\n * \r\n * Every Scene will have rendered and been drawn to the canvas by the time this event is fired.\r\n * Use it for any last minute post-processing before the next game step begins.\r\n *\r\n * @event Phaser.Core.Events#POST_RENDER\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance.\r\n */\r\nmodule.exports = 'postrender';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/POST_RENDER_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/POST_STEP_EVENT.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/core/events/POST_STEP_EVENT.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Post-Step Event.\r\n * \r\n * This event is dispatched after the Scene Manager has updated.\r\n * Hook into it from plugins or systems that need to do things before the render starts.\r\n *\r\n * @event Phaser.Core.Events#POST_STEP\r\n * @since 3.0.0\r\n * \r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'poststep';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/POST_STEP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/PRE_RENDER_EVENT.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/core/events/PRE_RENDER_EVENT.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Pre-Render Event.\r\n * \r\n * This event is dispatched immediately before any of the Scenes have started to render.\r\n * \r\n * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet.\r\n *\r\n * @event Phaser.Core.Events#PRE_RENDER\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance.\r\n */\r\nmodule.exports = 'prerender';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/PRE_RENDER_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/PRE_STEP_EVENT.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/core/events/PRE_STEP_EVENT.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Pre-Step Event.\r\n * \r\n * This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened.\r\n * Hook into it from plugins or systems that need to update before the Scene Manager does.\r\n *\r\n * @event Phaser.Core.Events#PRE_STEP\r\n * @since 3.0.0\r\n * \r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'prestep';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/PRE_STEP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/READY_EVENT.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/core/events/READY_EVENT.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Ready Event.\r\n * \r\n * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready,\r\n * and all local systems are now able to start.\r\n *\r\n * @event Phaser.Core.Events#READY\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'ready';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/READY_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/RESUME_EVENT.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/core/events/RESUME_EVENT.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Resume Event.\r\n * \r\n * This event is dispatched when the game loop leaves a paused state and resumes running.\r\n *\r\n * @event Phaser.Core.Events#RESUME\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'resume';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/RESUME_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/STEP_EVENT.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/core/events/STEP_EVENT.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Step Event.\r\n * \r\n * This event is dispatched after the Game Pre-Step and before the Scene Manager steps.\r\n * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have.\r\n *\r\n * @event Phaser.Core.Events#STEP\r\n * @since 3.0.0\r\n * \r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'step';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/STEP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/VISIBLE_EVENT.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/core/events/VISIBLE_EVENT.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Visible Event.\r\n * \r\n * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded\r\n * enters a visible state, previously having been hidden.\r\n * \r\n * Only browsers that support the Visibility API will cause this event to be emitted.\r\n *\r\n * @event Phaser.Core.Events#VISIBLE\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'visible';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/VISIBLE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/events/index.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/core/events/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Core.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BLUR: __webpack_require__(/*! ./BLUR_EVENT */ \"./node_modules/phaser/src/core/events/BLUR_EVENT.js\"),\r\n BOOT: __webpack_require__(/*! ./BOOT_EVENT */ \"./node_modules/phaser/src/core/events/BOOT_EVENT.js\"),\r\n CONTEXT_LOST: __webpack_require__(/*! ./CONTEXT_LOST_EVENT */ \"./node_modules/phaser/src/core/events/CONTEXT_LOST_EVENT.js\"),\r\n CONTEXT_RESTORED: __webpack_require__(/*! ./CONTEXT_RESTORED_EVENT */ \"./node_modules/phaser/src/core/events/CONTEXT_RESTORED_EVENT.js\"),\r\n DESTROY: __webpack_require__(/*! ./DESTROY_EVENT */ \"./node_modules/phaser/src/core/events/DESTROY_EVENT.js\"),\r\n FOCUS: __webpack_require__(/*! ./FOCUS_EVENT */ \"./node_modules/phaser/src/core/events/FOCUS_EVENT.js\"),\r\n HIDDEN: __webpack_require__(/*! ./HIDDEN_EVENT */ \"./node_modules/phaser/src/core/events/HIDDEN_EVENT.js\"),\r\n PAUSE: __webpack_require__(/*! ./PAUSE_EVENT */ \"./node_modules/phaser/src/core/events/PAUSE_EVENT.js\"),\r\n POST_RENDER: __webpack_require__(/*! ./POST_RENDER_EVENT */ \"./node_modules/phaser/src/core/events/POST_RENDER_EVENT.js\"),\r\n POST_STEP: __webpack_require__(/*! ./POST_STEP_EVENT */ \"./node_modules/phaser/src/core/events/POST_STEP_EVENT.js\"),\r\n PRE_RENDER: __webpack_require__(/*! ./PRE_RENDER_EVENT */ \"./node_modules/phaser/src/core/events/PRE_RENDER_EVENT.js\"),\r\n PRE_STEP: __webpack_require__(/*! ./PRE_STEP_EVENT */ \"./node_modules/phaser/src/core/events/PRE_STEP_EVENT.js\"),\r\n READY: __webpack_require__(/*! ./READY_EVENT */ \"./node_modules/phaser/src/core/events/READY_EVENT.js\"),\r\n RESUME: __webpack_require__(/*! ./RESUME_EVENT */ \"./node_modules/phaser/src/core/events/RESUME_EVENT.js\"),\r\n STEP: __webpack_require__(/*! ./STEP_EVENT */ \"./node_modules/phaser/src/core/events/STEP_EVENT.js\"),\r\n VISIBLE: __webpack_require__(/*! ./VISIBLE_EVENT */ \"./node_modules/phaser/src/core/events/VISIBLE_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/core/index.js": /*!***********************************************!*\ !*** ./node_modules/phaser/src/core/index.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Core\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Config: __webpack_require__(/*! ./Config */ \"./node_modules/phaser/src/core/Config.js\"),\r\n CreateRenderer: __webpack_require__(/*! ./CreateRenderer */ \"./node_modules/phaser/src/core/CreateRenderer.js\"),\r\n DebugHeader: __webpack_require__(/*! ./DebugHeader */ \"./node_modules/phaser/src/core/DebugHeader.js\"),\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/core/events/index.js\"),\r\n TimeStep: __webpack_require__(/*! ./TimeStep */ \"./node_modules/phaser/src/core/TimeStep.js\"),\r\n VisibilityHandler: __webpack_require__(/*! ./VisibilityHandler */ \"./node_modules/phaser/src/core/VisibilityHandler.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/core/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/create/GenerateTexture.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/create/GenerateTexture.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Arne16 = __webpack_require__(/*! ./palettes/Arne16 */ \"./node_modules/phaser/src/create/palettes/Arne16.js\");\r\nvar CanvasPool = __webpack_require__(/*! ../display/canvas/CanvasPool */ \"./node_modules/phaser/src/display/canvas/CanvasPool.js\");\r\nvar GetValue = __webpack_require__(/*! ../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Create.GenerateTexture\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Create.GenerateTextureConfig} config - [description]\r\n *\r\n * @return {HTMLCanvasElement} [description]\r\n */\r\nvar GenerateTexture = function (config)\r\n{\r\n var data = GetValue(config, 'data', []);\r\n var canvas = GetValue(config, 'canvas', null);\r\n var palette = GetValue(config, 'palette', Arne16);\r\n var pixelWidth = GetValue(config, 'pixelWidth', 1);\r\n var pixelHeight = GetValue(config, 'pixelHeight', pixelWidth);\r\n var resizeCanvas = GetValue(config, 'resizeCanvas', true);\r\n var clearCanvas = GetValue(config, 'clearCanvas', true);\r\n var preRender = GetValue(config, 'preRender', null);\r\n var postRender = GetValue(config, 'postRender', null);\r\n\r\n var width = Math.floor(Math.abs(data[0].length * pixelWidth));\r\n var height = Math.floor(Math.abs(data.length * pixelHeight));\r\n\r\n if (!canvas)\r\n {\r\n canvas = CanvasPool.create2D(this, width, height);\r\n resizeCanvas = false;\r\n clearCanvas = false;\r\n }\r\n\r\n if (resizeCanvas)\r\n {\r\n canvas.width = width;\r\n canvas.height = height;\r\n }\r\n\r\n var ctx = canvas.getContext('2d');\r\n\r\n if (clearCanvas)\r\n {\r\n ctx.clearRect(0, 0, width, height);\r\n }\r\n\r\n // preRender Callback?\r\n if (preRender)\r\n {\r\n preRender(canvas, ctx);\r\n }\r\n\r\n // Draw it\r\n for (var y = 0; y < data.length; y++)\r\n {\r\n var row = data[y];\r\n\r\n for (var x = 0; x < row.length; x++)\r\n {\r\n var d = row[x];\r\n\r\n if (d !== '.' && d !== ' ')\r\n {\r\n ctx.fillStyle = palette[d];\r\n ctx.fillRect(x * pixelWidth, y * pixelHeight, pixelWidth, pixelHeight);\r\n }\r\n }\r\n }\r\n\r\n // postRender Callback?\r\n if (postRender)\r\n {\r\n postRender(canvas, ctx);\r\n }\r\n\r\n return canvas;\r\n};\r\n\r\nmodule.exports = GenerateTexture;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/create/GenerateTexture.js?"); /***/ }), /***/ "./node_modules/phaser/src/create/index.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/create/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Create\r\n */\r\n\r\nmodule.exports = {\r\n \r\n GenerateTexture: __webpack_require__(/*! ./GenerateTexture */ \"./node_modules/phaser/src/create/GenerateTexture.js\"),\r\n Palettes: __webpack_require__(/*! ./palettes */ \"./node_modules/phaser/src/create/palettes/index.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/create/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/create/palettes/Arne16.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/create/palettes/Arne16.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * A 16 color palette by [Arne](http://androidarts.com/palette/16pal.htm)\r\n *\r\n * @name Phaser.Create.Palettes.ARNE16\r\n * @since 3.0.0\r\n *\r\n * @type {Phaser.Types.Create.Palette}\r\n */\r\nmodule.exports = {\r\n 0: '#000',\r\n 1: '#9D9D9D',\r\n 2: '#FFF',\r\n 3: '#BE2633',\r\n 4: '#E06F8B',\r\n 5: '#493C2B',\r\n 6: '#A46422',\r\n 7: '#EB8931',\r\n 8: '#F7E26B',\r\n 9: '#2F484E',\r\n A: '#44891A',\r\n B: '#A3CE27',\r\n C: '#1B2632',\r\n D: '#005784',\r\n E: '#31A2F2',\r\n F: '#B2DCEF'\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/create/palettes/Arne16.js?"); /***/ }), /***/ "./node_modules/phaser/src/create/palettes/C64.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/create/palettes/C64.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * A 16 color palette inspired by the Commodore 64.\r\n *\r\n * @name Phaser.Create.Palettes.C64\r\n * @since 3.0.0\r\n *\r\n * @type {Phaser.Types.Create.Palette}\r\n */\r\nmodule.exports = {\r\n 0: '#000',\r\n 1: '#fff',\r\n 2: '#8b4131',\r\n 3: '#7bbdc5',\r\n 4: '#8b41ac',\r\n 5: '#6aac41',\r\n 6: '#3931a4',\r\n 7: '#d5de73',\r\n 8: '#945a20',\r\n 9: '#5a4100',\r\n A: '#bd736a',\r\n B: '#525252',\r\n C: '#838383',\r\n D: '#acee8b',\r\n E: '#7b73de',\r\n F: '#acacac'\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/create/palettes/C64.js?"); /***/ }), /***/ "./node_modules/phaser/src/create/palettes/CGA.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/create/palettes/CGA.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * A 16 color CGA inspired palette by [Arne](http://androidarts.com/palette/16pal.htm)\r\n *\r\n * @name Phaser.Create.Palettes.CGA\r\n * @since 3.0.0\r\n *\r\n * @type {Phaser.Types.Create.Palette}\r\n */\r\nmodule.exports = {\r\n 0: '#000',\r\n 1: '#2234d1',\r\n 2: '#0c7e45',\r\n 3: '#44aacc',\r\n 4: '#8a3622',\r\n 5: '#5c2e78',\r\n 6: '#aa5c3d',\r\n 7: '#b5b5b5',\r\n 8: '#5e606e',\r\n 9: '#4c81fb',\r\n A: '#6cd947',\r\n B: '#7be2f9',\r\n C: '#eb8a60',\r\n D: '#e23d69',\r\n E: '#ffd93f',\r\n F: '#fff'\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/create/palettes/CGA.js?"); /***/ }), /***/ "./node_modules/phaser/src/create/palettes/JMP.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/create/palettes/JMP.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * A 16 color JMP palette by [Arne](http://androidarts.com/palette/16pal.htm)\r\n *\r\n * @name Phaser.Create.Palettes.JMP\r\n * @since 3.0.0\r\n *\r\n * @type {Phaser.Types.Create.Palette}\r\n */\r\nmodule.exports = {\r\n 0: '#000',\r\n 1: '#191028',\r\n 2: '#46af45',\r\n 3: '#a1d685',\r\n 4: '#453e78',\r\n 5: '#7664fe',\r\n 6: '#833129',\r\n 7: '#9ec2e8',\r\n 8: '#dc534b',\r\n 9: '#e18d79',\r\n A: '#d6b97b',\r\n B: '#e9d8a1',\r\n C: '#216c4b',\r\n D: '#d365c8',\r\n E: '#afaab9',\r\n F: '#f5f4eb'\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/create/palettes/JMP.js?"); /***/ }), /***/ "./node_modules/phaser/src/create/palettes/MSX.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/create/palettes/MSX.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * A 16 color palette inspired by Japanese computers like the MSX.\r\n *\r\n * @name Phaser.Create.Palettes.MSX\r\n * @since 3.0.0\r\n *\r\n * @type {Phaser.Types.Create.Palette}\r\n */\r\nmodule.exports = {\r\n 0: '#000',\r\n 1: '#191028',\r\n 2: '#46af45',\r\n 3: '#a1d685',\r\n 4: '#453e78',\r\n 5: '#7664fe',\r\n 6: '#833129',\r\n 7: '#9ec2e8',\r\n 8: '#dc534b',\r\n 9: '#e18d79',\r\n A: '#d6b97b',\r\n B: '#e9d8a1',\r\n C: '#216c4b',\r\n D: '#d365c8',\r\n E: '#afaab9',\r\n F: '#fff'\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/create/palettes/MSX.js?"); /***/ }), /***/ "./node_modules/phaser/src/create/palettes/index.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/create/palettes/index.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Create.Palettes\r\n */\r\n\r\nmodule.exports = {\r\n\r\n ARNE16: __webpack_require__(/*! ./Arne16 */ \"./node_modules/phaser/src/create/palettes/Arne16.js\"),\r\n C64: __webpack_require__(/*! ./C64 */ \"./node_modules/phaser/src/create/palettes/C64.js\"),\r\n CGA: __webpack_require__(/*! ./CGA */ \"./node_modules/phaser/src/create/palettes/CGA.js\"),\r\n JMP: __webpack_require__(/*! ./JMP */ \"./node_modules/phaser/src/create/palettes/JMP.js\"),\r\n MSX: __webpack_require__(/*! ./MSX */ \"./node_modules/phaser/src/create/palettes/MSX.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/create/palettes/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/curves/CubicBezierCurve.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/curves/CubicBezierCurve.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog)\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CubicBezier = __webpack_require__(/*! ../math/interpolation/CubicBezierInterpolation */ \"./node_modules/phaser/src/math/interpolation/CubicBezierInterpolation.js\");\r\nvar Curve = __webpack_require__(/*! ./Curve */ \"./node_modules/phaser/src/curves/Curve.js\");\r\nvar Vector2 = __webpack_require__(/*! ../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A higher-order Bézier curve constructed of four points.\r\n *\r\n * @class CubicBezier\r\n * @extends Phaser.Curves.Curve\r\n * @memberof Phaser.Curves\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector2[])} p0 - Start point, or an array of point pairs.\r\n * @param {Phaser.Math.Vector2} p1 - Control Point 1.\r\n * @param {Phaser.Math.Vector2} p2 - Control Point 2.\r\n * @param {Phaser.Math.Vector2} p3 - End Point.\r\n */\r\nvar CubicBezierCurve = new Class({\r\n\r\n Extends: Curve,\r\n\r\n initialize:\r\n\r\n function CubicBezierCurve (p0, p1, p2, p3)\r\n {\r\n Curve.call(this, 'CubicBezierCurve');\r\n\r\n if (Array.isArray(p0))\r\n {\r\n p3 = new Vector2(p0[6], p0[7]);\r\n p2 = new Vector2(p0[4], p0[5]);\r\n p1 = new Vector2(p0[2], p0[3]);\r\n p0 = new Vector2(p0[0], p0[1]);\r\n }\r\n\r\n /**\r\n * The start point of this curve.\r\n *\r\n * @name Phaser.Curves.CubicBezier#p0\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.p0 = p0;\r\n\r\n /**\r\n * The first control point of this curve.\r\n *\r\n * @name Phaser.Curves.CubicBezier#p1\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.p1 = p1;\r\n\r\n /**\r\n * The second control point of this curve.\r\n *\r\n * @name Phaser.Curves.CubicBezier#p2\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.p2 = p2;\r\n\r\n /**\r\n * The end point of this curve.\r\n *\r\n * @name Phaser.Curves.CubicBezier#p3\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.p3 = p3;\r\n },\r\n\r\n /**\r\n * Gets the starting point on the curve.\r\n *\r\n * @method Phaser.Curves.CubicBezier#getStartPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned.\r\n */\r\n getStartPoint: function (out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n return out.copy(this.p0);\r\n },\r\n\r\n /**\r\n * Returns the resolution of this curve.\r\n *\r\n * @method Phaser.Curves.CubicBezier#getResolution\r\n * @since 3.0.0\r\n *\r\n * @param {number} divisions - The amount of divisions used by this curve.\r\n *\r\n * @return {number} The resolution of the curve.\r\n */\r\n getResolution: function (divisions)\r\n {\r\n return divisions;\r\n },\r\n\r\n /**\r\n * Get point at relative position in curve according to length.\r\n *\r\n * @method Phaser.Curves.CubicBezier#getPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {number} t - The position along the curve to return. Where 0 is the start and 1 is the end.\r\n * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned.\r\n */\r\n getPoint: function (t, out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n var p0 = this.p0;\r\n var p1 = this.p1;\r\n var p2 = this.p2;\r\n var p3 = this.p3;\r\n\r\n return out.set(CubicBezier(t, p0.x, p1.x, p2.x, p3.x), CubicBezier(t, p0.y, p1.y, p2.y, p3.y));\r\n },\r\n\r\n /**\r\n * Draws this curve to the specified graphics object.\r\n *\r\n * @method Phaser.Curves.CubicBezier#draw\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return]\r\n *\r\n * @param {Phaser.GameObjects.Graphics} graphics - The graphics object this curve should be drawn to.\r\n * @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.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} The graphics object this curve was drawn to. Useful for method chaining.\r\n */\r\n draw: function (graphics, pointsTotal)\r\n {\r\n if (pointsTotal === undefined) { pointsTotal = 32; }\r\n\r\n var points = this.getPoints(pointsTotal);\r\n\r\n graphics.beginPath();\r\n graphics.moveTo(this.p0.x, this.p0.y);\r\n\r\n for (var i = 1; i < points.length; i++)\r\n {\r\n graphics.lineTo(points[i].x, points[i].y);\r\n }\r\n\r\n graphics.strokePath();\r\n\r\n // So you can chain graphics calls\r\n return graphics;\r\n },\r\n\r\n /**\r\n * Returns a JSON object that describes this curve.\r\n *\r\n * @method Phaser.Curves.CubicBezier#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.Curves.JSONCurve} The JSON object containing this curve data.\r\n */\r\n toJSON: function ()\r\n {\r\n return {\r\n type: this.type,\r\n points: [\r\n this.p0.x, this.p0.y,\r\n this.p1.x, this.p1.y,\r\n this.p2.x, this.p2.y,\r\n this.p3.x, this.p3.y\r\n ]\r\n };\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Generates a curve from a JSON object.\r\n *\r\n * @function Phaser.Curves.CubicBezier.fromJSON\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Curves.JSONCurve} data - The JSON object containing this curve data.\r\n *\r\n * @return {Phaser.Curves.CubicBezier} The curve generated from the JSON object.\r\n */\r\nCubicBezierCurve.fromJSON = function (data)\r\n{\r\n var points = data.points;\r\n\r\n var p0 = new Vector2(points[0], points[1]);\r\n var p1 = new Vector2(points[2], points[3]);\r\n var p2 = new Vector2(points[4], points[5]);\r\n var p3 = new Vector2(points[6], points[7]);\r\n\r\n return new CubicBezierCurve(p0, p1, p2, p3);\r\n};\r\n\r\nmodule.exports = CubicBezierCurve;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/curves/CubicBezierCurve.js?"); /***/ }), /***/ "./node_modules/phaser/src/curves/Curve.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/curves/Curve.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar FromPoints = __webpack_require__(/*! ../geom/rectangle/FromPoints */ \"./node_modules/phaser/src/geom/rectangle/FromPoints.js\");\r\nvar Rectangle = __webpack_require__(/*! ../geom/rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar Vector2 = __webpack_require__(/*! ../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Base Curve class, which all other curve types extend.\r\n *\r\n * Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog)\r\n *\r\n * @class Curve\r\n * @memberof Phaser.Curves\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {string} type - The curve type.\r\n */\r\nvar Curve = new Class({\r\n\r\n initialize:\r\n\r\n function Curve (type)\r\n {\r\n /**\r\n * String based identifier for the type of curve.\r\n *\r\n * @name Phaser.Curves.Curve#type\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * The default number of divisions within the curve.\r\n *\r\n * @name Phaser.Curves.Curve#defaultDivisions\r\n * @type {integer}\r\n * @default 5\r\n * @since 3.0.0\r\n */\r\n this.defaultDivisions = 5;\r\n\r\n /**\r\n * The quantity of arc length divisions within the curve.\r\n *\r\n * @name Phaser.Curves.Curve#arcLengthDivisions\r\n * @type {integer}\r\n * @default 100\r\n * @since 3.0.0\r\n */\r\n this.arcLengthDivisions = 100;\r\n\r\n /**\r\n * An array of cached arc length values.\r\n *\r\n * @name Phaser.Curves.Curve#cacheArcLengths\r\n * @type {number[]}\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.cacheArcLengths = [];\r\n\r\n /**\r\n * Does the data of this curve need updating?\r\n *\r\n * @name Phaser.Curves.Curve#needsUpdate\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.needsUpdate = true;\r\n\r\n /**\r\n * For a curve on a Path, `false` means the Path will ignore this curve.\r\n *\r\n * @name Phaser.Curves.Curve#active\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.active = true;\r\n\r\n /**\r\n * A temporary calculation Vector.\r\n *\r\n * @name Phaser.Curves.Curve#_tmpVec2A\r\n * @type {Phaser.Math.Vector2}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._tmpVec2A = new Vector2();\r\n\r\n /**\r\n * A temporary calculation Vector.\r\n *\r\n * @name Phaser.Curves.Curve#_tmpVec2B\r\n * @type {Phaser.Math.Vector2}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._tmpVec2B = new Vector2();\r\n },\r\n\r\n /**\r\n * Draws this curve on the given Graphics object.\r\n *\r\n * The curve is drawn using `Graphics.strokePoints` so will be drawn at whatever the present Graphics stroke color is.\r\n * The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it.\r\n *\r\n * @method Phaser.Curves.Curve#draw\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return]\r\n *\r\n * @param {Phaser.GameObjects.Graphics} graphics - The Graphics instance onto which this curve will be drawn.\r\n * @param {integer} [pointsTotal=32] - The resolution of the curve. The higher the value the smoother it will render, at the cost of rendering performance.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} The Graphics object to which the curve was drawn.\r\n */\r\n draw: function (graphics, pointsTotal)\r\n {\r\n if (pointsTotal === undefined) { pointsTotal = 32; }\r\n\r\n // So you can chain graphics calls\r\n return graphics.strokePoints(this.getPoints(pointsTotal));\r\n },\r\n\r\n /**\r\n * Returns a Rectangle where the position and dimensions match the bounds of this Curve.\r\n *\r\n * You can control the accuracy of the bounds. The value given is used to work out how many points\r\n * to plot across the curve. Higher values are more accurate at the cost of calculation speed.\r\n *\r\n * @method Phaser.Curves.Curve#getBounds\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the bounds in. If falsey a new object will be created.\r\n * @param {integer} [accuracy=16] - The accuracy of the bounds calculations.\r\n *\r\n * @return {Phaser.Geom.Rectangle} A Rectangle object holding the bounds of this curve. If `out` was given it will be this object.\r\n */\r\n getBounds: function (out, accuracy)\r\n {\r\n if (!out) { out = new Rectangle(); }\r\n if (accuracy === undefined) { accuracy = 16; }\r\n\r\n var len = this.getLength();\r\n\r\n if (accuracy > len)\r\n {\r\n accuracy = len / 2;\r\n }\r\n\r\n // The length of the curve in pixels\r\n // So we'll have 1 spaced point per 'accuracy' pixels\r\n\r\n var spaced = Math.max(1, Math.round(len / accuracy));\r\n\r\n return FromPoints(this.getSpacedPoints(spaced), out);\r\n },\r\n\r\n /**\r\n * Returns an array of points, spaced out X distance pixels apart.\r\n * The smaller the distance, the larger the array will be.\r\n *\r\n * @method Phaser.Curves.Curve#getDistancePoints\r\n * @since 3.0.0\r\n *\r\n * @param {integer} distance - The distance, in pixels, between each point along the curve.\r\n *\r\n * @return {Phaser.Geom.Point[]} An Array of Point objects.\r\n */\r\n getDistancePoints: function (distance)\r\n {\r\n var len = this.getLength();\r\n\r\n var spaced = Math.max(1, len / distance);\r\n\r\n return this.getSpacedPoints(spaced);\r\n },\r\n\r\n /**\r\n * Get a point at the end of the curve.\r\n *\r\n * @method Phaser.Curves.Curve#getEndPoint\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} [out] - Optional Vector object to store the result in.\r\n *\r\n * @return {Phaser.Math.Vector2} Vector2 containing the coordinates of the curves end point.\r\n */\r\n getEndPoint: function (out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n return this.getPointAt(1, out);\r\n },\r\n\r\n /**\r\n * Get total curve arc length\r\n *\r\n * @method Phaser.Curves.Curve#getLength\r\n * @since 3.0.0\r\n *\r\n * @return {number} The total length of the curve.\r\n */\r\n getLength: function ()\r\n {\r\n var lengths = this.getLengths();\r\n\r\n return lengths[lengths.length - 1];\r\n },\r\n\r\n\r\n /**\r\n * Get a list of cumulative segment lengths.\r\n *\r\n * These lengths are\r\n *\r\n * - [0] 0\r\n * - [1] The first segment\r\n * - [2] The first and second segment\r\n * - ...\r\n * - [divisions] All segments\r\n *\r\n * @method Phaser.Curves.Curve#getLengths\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [divisions] - The number of divisions or segments.\r\n *\r\n * @return {number[]} An array of cumulative lengths.\r\n */\r\n getLengths: function (divisions)\r\n {\r\n if (divisions === undefined) { divisions = this.arcLengthDivisions; }\r\n\r\n if ((this.cacheArcLengths.length === divisions + 1) && !this.needsUpdate)\r\n {\r\n return this.cacheArcLengths;\r\n }\r\n\r\n this.needsUpdate = false;\r\n\r\n var cache = [];\r\n var current;\r\n var last = this.getPoint(0, this._tmpVec2A);\r\n var sum = 0;\r\n\r\n cache.push(0);\r\n\r\n for (var p = 1; p <= divisions; p++)\r\n {\r\n current = this.getPoint(p / divisions, this._tmpVec2B);\r\n\r\n sum += current.distance(last);\r\n\r\n cache.push(sum);\r\n\r\n last.copy(current);\r\n }\r\n\r\n this.cacheArcLengths = cache;\r\n\r\n return cache; // { sums: cache, sum:sum }; Sum is in the last element.\r\n },\r\n\r\n // Get point at relative position in curve according to arc length\r\n\r\n // - u [0 .. 1]\r\n\r\n /**\r\n * Get a point at a relative position on the curve, by arc length.\r\n *\r\n * @method Phaser.Curves.Curve#getPointAt\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {number} u - The relative position, [0..1].\r\n * @param {Phaser.Math.Vector2} [out] - A point to store the result in.\r\n *\r\n * @return {Phaser.Math.Vector2} The point.\r\n */\r\n getPointAt: function (u, out)\r\n {\r\n var t = this.getUtoTmapping(u);\r\n\r\n return this.getPoint(t, out);\r\n },\r\n\r\n // Get sequence of points using getPoint( t )\r\n\r\n /**\r\n * Get a sequence of evenly spaced points from the curve.\r\n *\r\n * You can pass `divisions`, `stepRate`, or neither.\r\n *\r\n * The number of divisions will be\r\n *\r\n * 1. `divisions`, if `divisions` > 0; or\r\n * 2. `this.getLength / stepRate`, if `stepRate` > 0; or\r\n * 3. `this.defaultDivisions`\r\n *\r\n * `1 + divisions` points will be returned.\r\n *\r\n * @method Phaser.Curves.Curve#getPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2[]} O - [out,$return]\r\n *\r\n * @param {integer} [divisions] - The number of divisions to make.\r\n * @param {number} [stepRate] - The curve distance between points, implying `divisions`.\r\n * @param {(array|Phaser.Math.Vector2[])} [out] - An optional array to store the points in.\r\n *\r\n * @return {(array|Phaser.Math.Vector2[])} An array of Points from the curve.\r\n */\r\n getPoints: function (divisions, stepRate, out)\r\n {\r\n if (out === undefined) { out = []; }\r\n\r\n // If divisions is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.\r\n if (!divisions)\r\n {\r\n if (!stepRate)\r\n {\r\n divisions = this.defaultDivisions;\r\n }\r\n else\r\n {\r\n divisions = this.getLength() / stepRate;\r\n }\r\n }\r\n\r\n for (var d = 0; d <= divisions; d++)\r\n {\r\n out.push(this.getPoint(d / divisions));\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Get a random point from the curve.\r\n *\r\n * @method Phaser.Curves.Curve#getRandomPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {Phaser.Math.Vector2} [out] - A point object to store the result in.\r\n *\r\n * @return {Phaser.Math.Vector2} The point.\r\n */\r\n getRandomPoint: function (out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n return this.getPoint(Math.random(), out);\r\n },\r\n\r\n // Get sequence of points using getPointAt( u )\r\n\r\n /**\r\n * Get a sequence of equally spaced points (by arc distance) from the curve.\r\n *\r\n * `1 + divisions` points will be returned.\r\n *\r\n * @method Phaser.Curves.Curve#getSpacedPoints\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [divisions=this.defaultDivisions] - The number of divisions to make.\r\n * @param {number} [stepRate] - Step between points. Used to calculate the number of points to return when divisions is falsy. Ignored if divisions is positive.\r\n * @param {(array|Phaser.Math.Vector2[])} [out] - An optional array to store the points in.\r\n *\r\n * @return {Phaser.Math.Vector2[]} An array of points.\r\n */\r\n getSpacedPoints: function (divisions, stepRate, out)\r\n {\r\n if (out === undefined) { out = []; }\r\n\r\n // If divisions is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.\r\n if (!divisions)\r\n {\r\n if (!stepRate)\r\n {\r\n divisions = this.defaultDivisions;\r\n }\r\n else\r\n {\r\n divisions = this.getLength() / stepRate;\r\n }\r\n }\r\n\r\n for (var d = 0; d <= divisions; d++)\r\n {\r\n var t = this.getUtoTmapping(d / divisions, null, divisions);\r\n\r\n out.push(this.getPoint(t));\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Get a point at the start of the curve.\r\n *\r\n * @method Phaser.Curves.Curve#getStartPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {Phaser.Math.Vector2} [out] - A point to store the result in.\r\n *\r\n * @return {Phaser.Math.Vector2} The point.\r\n */\r\n getStartPoint: function (out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n return this.getPointAt(0, out);\r\n },\r\n\r\n /**\r\n * Get a unit vector tangent at a relative position on the curve.\r\n * In case any sub curve does not implement its tangent derivation,\r\n * 2 points a small delta apart will be used to find its gradient\r\n * which seems to give a reasonable approximation\r\n *\r\n * @method Phaser.Curves.Curve#getTangent\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {number} t - The relative position on the curve, [0..1].\r\n * @param {Phaser.Math.Vector2} [out] - A vector to store the result in.\r\n *\r\n * @return {Phaser.Math.Vector2} Vector approximating the tangent line at the point t (delta +/- 0.0001)\r\n */\r\n getTangent: function (t, out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n var delta = 0.0001;\r\n var t1 = t - delta;\r\n var t2 = t + delta;\r\n\r\n // Capping in case of danger\r\n\r\n if (t1 < 0)\r\n {\r\n t1 = 0;\r\n }\r\n\r\n if (t2 > 1)\r\n {\r\n t2 = 1;\r\n }\r\n\r\n this.getPoint(t1, this._tmpVec2A);\r\n this.getPoint(t2, out);\r\n\r\n return out.subtract(this._tmpVec2A).normalize();\r\n },\r\n\r\n /**\r\n * Get a unit vector tangent at a relative position on the curve, by arc length.\r\n *\r\n * @method Phaser.Curves.Curve#getTangentAt\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {number} u - The relative position on the curve, [0..1].\r\n * @param {Phaser.Math.Vector2} [out] - A vector to store the result in.\r\n *\r\n * @return {Phaser.Math.Vector2} The tangent vector.\r\n */\r\n getTangentAt: function (u, out)\r\n {\r\n var t = this.getUtoTmapping(u);\r\n\r\n return this.getTangent(t, out);\r\n },\r\n\r\n // Given a distance in pixels, get a t to find p.\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Curves.Curve#getTFromDistance\r\n * @since 3.0.0\r\n *\r\n * @param {integer} distance - [description]\r\n * @param {integer} [divisions] - [description]\r\n *\r\n * @return {number} [description]\r\n */\r\n getTFromDistance: function (distance, divisions)\r\n {\r\n if (distance <= 0)\r\n {\r\n return 0;\r\n }\r\n\r\n return this.getUtoTmapping(0, distance, divisions);\r\n },\r\n\r\n // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Curves.Curve#getUtoTmapping\r\n * @since 3.0.0\r\n *\r\n * @param {number} u - [description]\r\n * @param {integer} distance - [description]\r\n * @param {integer} [divisions] - [description]\r\n *\r\n * @return {number} [description]\r\n */\r\n getUtoTmapping: function (u, distance, divisions)\r\n {\r\n var arcLengths = this.getLengths(divisions);\r\n\r\n var i = 0;\r\n var il = arcLengths.length;\r\n\r\n var targetArcLength; // The targeted u distance value to get\r\n\r\n if (distance)\r\n {\r\n // Cannot overshoot the curve\r\n targetArcLength = Math.min(distance, arcLengths[il - 1]);\r\n }\r\n else\r\n {\r\n targetArcLength = u * arcLengths[il - 1];\r\n }\r\n\r\n // binary search for the index with largest value smaller than target u distance\r\n\r\n var low = 0;\r\n var high = il - 1;\r\n var comparison;\r\n\r\n while (low <= high)\r\n {\r\n i = Math.floor(low + (high - low) / 2); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats\r\n\r\n comparison = arcLengths[i] - targetArcLength;\r\n\r\n if (comparison < 0)\r\n {\r\n low = i + 1;\r\n }\r\n else if (comparison > 0)\r\n {\r\n high = i - 1;\r\n }\r\n else\r\n {\r\n high = i;\r\n break;\r\n }\r\n }\r\n\r\n i = high;\r\n\r\n if (arcLengths[i] === targetArcLength)\r\n {\r\n return i / (il - 1);\r\n }\r\n\r\n // we could get finer grain at lengths, or use simple interpolation between two points\r\n\r\n var lengthBefore = arcLengths[i];\r\n var lengthAfter = arcLengths[i + 1];\r\n\r\n var segmentLength = lengthAfter - lengthBefore;\r\n\r\n // determine where we are between the 'before' and 'after' points\r\n\r\n var segmentFraction = (targetArcLength - lengthBefore) / segmentLength;\r\n\r\n // add that fractional amount to t\r\n\r\n return (i + segmentFraction) / (il - 1);\r\n },\r\n\r\n /**\r\n * Calculate and cache the arc lengths.\r\n *\r\n * @method Phaser.Curves.Curve#updateArcLengths\r\n * @since 3.0.0\r\n *\r\n * @see Phaser.Curves.Curve#getLengths()\r\n */\r\n updateArcLengths: function ()\r\n {\r\n this.needsUpdate = true;\r\n\r\n this.getLengths();\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Curve;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/curves/Curve.js?"); /***/ }), /***/ "./node_modules/phaser/src/curves/EllipseCurve.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/curves/EllipseCurve.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog)\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Curve = __webpack_require__(/*! ./Curve */ \"./node_modules/phaser/src/curves/Curve.js\");\r\nvar DegToRad = __webpack_require__(/*! ../math/DegToRad */ \"./node_modules/phaser/src/math/DegToRad.js\");\r\nvar GetValue = __webpack_require__(/*! ../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar RadToDeg = __webpack_require__(/*! ../math/RadToDeg */ \"./node_modules/phaser/src/math/RadToDeg.js\");\r\nvar Vector2 = __webpack_require__(/*! ../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * An Elliptical Curve derived from the Base Curve class.\r\n * \r\n * See https://en.wikipedia.org/wiki/Elliptic_curve for more details.\r\n *\r\n * @class Ellipse\r\n * @extends Phaser.Curves.Curve\r\n * @memberof Phaser.Curves\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {(number|Phaser.Types.Curves.EllipseCurveConfig)} [x=0] - The x coordinate of the ellipse, or an Ellipse Curve configuration object.\r\n * @param {number} [y=0] - The y coordinate of the ellipse.\r\n * @param {number} [xRadius=0] - The horizontal radius of ellipse.\r\n * @param {number} [yRadius=0] - The vertical radius of ellipse.\r\n * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees.\r\n * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees.\r\n * @param {boolean} [clockwise=false] - Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`).\r\n * @param {integer} [rotation=0] - The rotation of the ellipse, in degrees.\r\n */\r\nvar EllipseCurve = new Class({\r\n\r\n Extends: Curve,\r\n\r\n initialize:\r\n\r\n function EllipseCurve (x, y, xRadius, yRadius, startAngle, endAngle, clockwise, rotation)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n var config = x;\r\n\r\n x = GetValue(config, 'x', 0);\r\n y = GetValue(config, 'y', 0);\r\n xRadius = GetValue(config, 'xRadius', 0);\r\n yRadius = GetValue(config, 'yRadius', xRadius);\r\n startAngle = GetValue(config, 'startAngle', 0);\r\n endAngle = GetValue(config, 'endAngle', 360);\r\n clockwise = GetValue(config, 'clockwise', false);\r\n rotation = GetValue(config, 'rotation', 0);\r\n }\r\n else\r\n {\r\n if (yRadius === undefined) { yRadius = xRadius; }\r\n if (startAngle === undefined) { startAngle = 0; }\r\n if (endAngle === undefined) { endAngle = 360; }\r\n if (clockwise === undefined) { clockwise = false; }\r\n if (rotation === undefined) { rotation = 0; }\r\n }\r\n\r\n Curve.call(this, 'EllipseCurve');\r\n\r\n // Center point\r\n\r\n /**\r\n * The center point of the ellipse. Used for calculating rotation.\r\n *\r\n * @name Phaser.Curves.Ellipse#p0\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.p0 = new Vector2(x, y);\r\n\r\n /**\r\n * The horizontal radius of the ellipse.\r\n *\r\n * @name Phaser.Curves.Ellipse#_xRadius\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._xRadius = xRadius;\r\n\r\n /**\r\n * The vertical radius of the ellipse.\r\n *\r\n * @name Phaser.Curves.Ellipse#_yRadius\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._yRadius = yRadius;\r\n\r\n // Radians\r\n\r\n /**\r\n * The starting angle of the ellipse in radians.\r\n *\r\n * @name Phaser.Curves.Ellipse#_startAngle\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._startAngle = DegToRad(startAngle);\r\n\r\n /**\r\n * The end angle of the ellipse in radians.\r\n *\r\n * @name Phaser.Curves.Ellipse#_endAngle\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._endAngle = DegToRad(endAngle);\r\n\r\n /**\r\n * Anti-clockwise direction.\r\n *\r\n * @name Phaser.Curves.Ellipse#_clockwise\r\n * @type {boolean}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._clockwise = clockwise;\r\n\r\n /**\r\n * The rotation of the arc.\r\n *\r\n * @name Phaser.Curves.Ellipse#_rotation\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._rotation = DegToRad(rotation);\r\n },\r\n\r\n /**\r\n * Gets the starting point on the curve.\r\n *\r\n * @method Phaser.Curves.Ellipse#getStartPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned.\r\n */\r\n getStartPoint: function (out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n return this.getPoint(0, out);\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Curves.Ellipse#getResolution\r\n * @since 3.0.0\r\n *\r\n * @param {number} divisions - [description]\r\n *\r\n * @return {number} [description]\r\n */\r\n getResolution: function (divisions)\r\n {\r\n return divisions * 2;\r\n },\r\n\r\n /**\r\n * Get point at relative position in curve according to length.\r\n *\r\n * @method Phaser.Curves.Ellipse#getPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {number} t - The position along the curve to return. Where 0 is the start and 1 is the end.\r\n * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned.\r\n */\r\n getPoint: function (t, out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n var twoPi = Math.PI * 2;\r\n var deltaAngle = this._endAngle - this._startAngle;\r\n var samePoints = Math.abs(deltaAngle) < Number.EPSILON;\r\n\r\n // ensures that deltaAngle is 0 .. 2 PI\r\n while (deltaAngle < 0)\r\n {\r\n deltaAngle += twoPi;\r\n }\r\n\r\n while (deltaAngle > twoPi)\r\n {\r\n deltaAngle -= twoPi;\r\n }\r\n\r\n if (deltaAngle < Number.EPSILON)\r\n {\r\n if (samePoints)\r\n {\r\n deltaAngle = 0;\r\n }\r\n else\r\n {\r\n deltaAngle = twoPi;\r\n }\r\n }\r\n\r\n if (this._clockwise && !samePoints)\r\n {\r\n if (deltaAngle === twoPi)\r\n {\r\n deltaAngle = - twoPi;\r\n }\r\n else\r\n {\r\n deltaAngle = deltaAngle - twoPi;\r\n }\r\n }\r\n\r\n var angle = this._startAngle + t * deltaAngle;\r\n var x = this.p0.x + this._xRadius * Math.cos(angle);\r\n var y = this.p0.y + this._yRadius * Math.sin(angle);\r\n\r\n if (this._rotation !== 0)\r\n {\r\n var cos = Math.cos(this._rotation);\r\n var sin = Math.sin(this._rotation);\r\n\r\n var tx = x - this.p0.x;\r\n var ty = y - this.p0.y;\r\n\r\n // Rotate the point about the center of the ellipse.\r\n x = tx * cos - ty * sin + this.p0.x;\r\n y = tx * sin + ty * cos + this.p0.y;\r\n }\r\n\r\n return out.set(x, y);\r\n },\r\n\r\n /**\r\n * Sets the horizontal radius of this curve.\r\n *\r\n * @method Phaser.Curves.Ellipse#setXRadius\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The horizontal radius of this curve.\r\n *\r\n * @return {Phaser.Curves.Ellipse} This curve object.\r\n */\r\n setXRadius: function (value)\r\n {\r\n this.xRadius = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the vertical radius of this curve.\r\n *\r\n * @method Phaser.Curves.Ellipse#setYRadius\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The vertical radius of this curve.\r\n *\r\n * @return {Phaser.Curves.Ellipse} This curve object.\r\n */\r\n setYRadius: function (value)\r\n {\r\n this.yRadius = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the width of this curve.\r\n *\r\n * @method Phaser.Curves.Ellipse#setWidth\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The width of this curve.\r\n *\r\n * @return {Phaser.Curves.Ellipse} This curve object.\r\n */\r\n setWidth: function (value)\r\n {\r\n this.xRadius = value * 2;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the height of this curve.\r\n *\r\n * @method Phaser.Curves.Ellipse#setHeight\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The height of this curve.\r\n *\r\n * @return {Phaser.Curves.Ellipse} This curve object.\r\n */\r\n setHeight: function (value)\r\n {\r\n this.yRadius = value * 2;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the start angle of this curve.\r\n *\r\n * @method Phaser.Curves.Ellipse#setStartAngle\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The start angle of this curve, in radians.\r\n *\r\n * @return {Phaser.Curves.Ellipse} This curve object.\r\n */\r\n setStartAngle: function (value)\r\n {\r\n this.startAngle = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the end angle of this curve.\r\n *\r\n * @method Phaser.Curves.Ellipse#setEndAngle\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The end angle of this curve, in radians.\r\n *\r\n * @return {Phaser.Curves.Ellipse} This curve object.\r\n */\r\n setEndAngle: function (value)\r\n {\r\n this.endAngle = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets if this curve extends clockwise or anti-clockwise.\r\n *\r\n * @method Phaser.Curves.Ellipse#setClockwise\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The clockwise state of this curve.\r\n *\r\n * @return {Phaser.Curves.Ellipse} This curve object.\r\n */\r\n setClockwise: function (value)\r\n {\r\n this.clockwise = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the rotation of this curve.\r\n *\r\n * @method Phaser.Curves.Ellipse#setRotation\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The rotation of this curve, in radians.\r\n *\r\n * @return {Phaser.Curves.Ellipse} This curve object.\r\n */\r\n setRotation: function (value)\r\n {\r\n this.rotation = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The x coordinate of the center of the ellipse.\r\n *\r\n * @name Phaser.Curves.Ellipse#x\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n x: {\r\n\r\n get: function ()\r\n {\r\n return this.p0.x;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.p0.x = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The y coordinate of the center of the ellipse.\r\n *\r\n * @name Phaser.Curves.Ellipse#y\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n y: {\r\n\r\n get: function ()\r\n {\r\n return this.p0.y;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.p0.y = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The horizontal radius of the ellipse.\r\n *\r\n * @name Phaser.Curves.Ellipse#xRadius\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n xRadius: {\r\n\r\n get: function ()\r\n {\r\n return this._xRadius;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._xRadius = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical radius of the ellipse.\r\n *\r\n * @name Phaser.Curves.Ellipse#yRadius\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n yRadius: {\r\n\r\n get: function ()\r\n {\r\n return this._yRadius;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._yRadius = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The start angle of the ellipse in degrees.\r\n *\r\n * @name Phaser.Curves.Ellipse#startAngle\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n startAngle: {\r\n\r\n get: function ()\r\n {\r\n return RadToDeg(this._startAngle);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._startAngle = DegToRad(value);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The end angle of the ellipse in degrees.\r\n *\r\n * @name Phaser.Curves.Ellipse#endAngle\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n endAngle: {\r\n\r\n get: function ()\r\n {\r\n return RadToDeg(this._endAngle);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._endAngle = DegToRad(value);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * `true` if the ellipse rotation is clockwise or `false` if anti-clockwise.\r\n *\r\n * @name Phaser.Curves.Ellipse#clockwise\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n clockwise: {\r\n\r\n get: function ()\r\n {\r\n return this._clockwise;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._clockwise = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The rotation of the ellipse, relative to the center, in degrees.\r\n *\r\n * @name Phaser.Curves.Ellipse#angle\r\n * @type {number}\r\n * @since 3.14.0\r\n */\r\n angle: {\r\n\r\n get: function ()\r\n {\r\n return RadToDeg(this._rotation);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._rotation = DegToRad(value);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The rotation of the ellipse, relative to the center, in radians.\r\n *\r\n * @name Phaser.Curves.Ellipse#rotation\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n rotation: {\r\n\r\n get: function ()\r\n {\r\n return this._rotation;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._rotation = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * JSON serialization of the curve.\r\n *\r\n * @method Phaser.Curves.Ellipse#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.Curves.JSONEllipseCurve} The JSON object containing this curve data.\r\n */\r\n toJSON: function ()\r\n {\r\n return {\r\n type: this.type,\r\n x: this.p0.x,\r\n y: this.p0.y,\r\n xRadius: this._xRadius,\r\n yRadius: this._yRadius,\r\n startAngle: RadToDeg(this._startAngle),\r\n endAngle: RadToDeg(this._endAngle),\r\n clockwise: this._clockwise,\r\n rotation: RadToDeg(this._rotation)\r\n };\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Creates a curve from the provided Ellipse Curve Configuration object.\r\n *\r\n * @function Phaser.Curves.Ellipse.fromJSON\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Curves.JSONEllipseCurve} data - The JSON object containing this curve data.\r\n *\r\n * @return {Phaser.Curves.Ellipse} The ellipse curve constructed from the configuration object.\r\n */\r\nEllipseCurve.fromJSON = function (data)\r\n{\r\n return new EllipseCurve(data);\r\n};\r\n\r\nmodule.exports = EllipseCurve;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/curves/EllipseCurve.js?"); /***/ }), /***/ "./node_modules/phaser/src/curves/LineCurve.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/curves/LineCurve.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog)\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Curve = __webpack_require__(/*! ./Curve */ \"./node_modules/phaser/src/curves/Curve.js\");\r\nvar FromPoints = __webpack_require__(/*! ../geom/rectangle/FromPoints */ \"./node_modules/phaser/src/geom/rectangle/FromPoints.js\");\r\nvar Rectangle = __webpack_require__(/*! ../geom/rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar Vector2 = __webpack_require__(/*! ../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\nvar tmpVec2 = new Vector2();\r\n\r\n/**\r\n * @classdesc\r\n * A LineCurve is a \"curve\" comprising exactly two points (a line segment).\r\n *\r\n * @class Line\r\n * @extends Phaser.Curves.Curve\r\n * @memberof Phaser.Curves\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|number[])} p0 - The first endpoint.\r\n * @param {Phaser.Math.Vector2} [p1] - The second endpoint.\r\n */\r\nvar LineCurve = new Class({\r\n\r\n Extends: Curve,\r\n\r\n initialize:\r\n\r\n // vec2s or array\r\n function LineCurve (p0, p1)\r\n {\r\n Curve.call(this, 'LineCurve');\r\n\r\n if (Array.isArray(p0))\r\n {\r\n p1 = new Vector2(p0[2], p0[3]);\r\n p0 = new Vector2(p0[0], p0[1]);\r\n }\r\n\r\n /**\r\n * The first endpoint.\r\n *\r\n * @name Phaser.Curves.Line#p0\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.p0 = p0;\r\n\r\n /**\r\n * The second endpoint.\r\n *\r\n * @name Phaser.Curves.Line#p1\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.p1 = p1;\r\n\r\n // Override default Curve.arcLengthDivisions\r\n\r\n /**\r\n * The quantity of arc length divisions within the curve.\r\n *\r\n * @name Phaser.Curves.Line#arcLengthDivisions\r\n * @type {integer}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.arcLengthDivisions = 1;\r\n },\r\n\r\n /**\r\n * Returns a Rectangle where the position and dimensions match the bounds of this Curve.\r\n *\r\n * @method Phaser.Curves.Line#getBounds\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} [out] - A Rectangle object to store the bounds in. If not given a new Rectangle will be created.\r\n *\r\n * @return {Phaser.Geom.Rectangle} A Rectangle object holding the bounds of this curve. If `out` was given it will be this object.\r\n */\r\n getBounds: function (out)\r\n {\r\n if (out === undefined) { out = new Rectangle(); }\r\n\r\n return FromPoints([ this.p0, this.p1 ], out);\r\n },\r\n\r\n /**\r\n * Gets the starting point on the curve.\r\n *\r\n * @method Phaser.Curves.Line#getStartPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned.\r\n */\r\n getStartPoint: function (out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n return out.copy(this.p0);\r\n },\r\n\r\n /**\r\n * Gets the resolution of the line.\r\n *\r\n * @method Phaser.Curves.Line#getResolution\r\n * @since 3.0.0\r\n *\r\n * @param {number} [divisions=1] - The number of divisions to consider.\r\n *\r\n * @return {number} The resolution. Equal to the number of divisions.\r\n */\r\n getResolution: function (divisions)\r\n {\r\n if (divisions === undefined) { divisions = 1; }\r\n\r\n return divisions;\r\n },\r\n\r\n /**\r\n * Get point at relative position in curve according to length.\r\n *\r\n * @method Phaser.Curves.Line#getPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {number} t - The position along the curve to return. Where 0 is the start and 1 is the end.\r\n * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned.\r\n */\r\n getPoint: function (t, out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n if (t === 1)\r\n {\r\n return out.copy(this.p1);\r\n }\r\n\r\n out.copy(this.p1).subtract(this.p0).scale(t).add(this.p0);\r\n\r\n return out;\r\n },\r\n\r\n // Line curve is linear, so we can overwrite default getPointAt\r\n\r\n /**\r\n * Gets a point at a given position on the line.\r\n *\r\n * @method Phaser.Curves.Line#getPointAt\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {number} u - The position along the curve to return. Where 0 is the start and 1 is the end.\r\n * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned.\r\n */\r\n getPointAt: function (u, out)\r\n {\r\n return this.getPoint(u, out);\r\n },\r\n\r\n /**\r\n * Gets the slope of the line as a unit vector.\r\n *\r\n * @method Phaser.Curves.Line#getTangent\r\n * @since 3.0.0\r\n * \r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @return {Phaser.Math.Vector2} The tangent vector.\r\n */\r\n getTangent: function ()\r\n {\r\n var tangent = tmpVec2.copy(this.p1).subtract(this.p0);\r\n\r\n return tangent.normalize();\r\n },\r\n\r\n // Override default Curve.getUtoTmapping\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Curves.Line#getUtoTmapping\r\n * @since 3.0.0\r\n *\r\n * @param {number} u - [description]\r\n * @param {integer} distance - [description]\r\n * @param {integer} [divisions] - [description]\r\n *\r\n * @return {number} [description]\r\n */\r\n getUtoTmapping: function (u, distance, divisions)\r\n {\r\n var t;\r\n\r\n if (distance)\r\n {\r\n var arcLengths = this.getLengths(divisions);\r\n var lineLength = arcLengths[arcLengths.length - 1];\r\n\r\n // Cannot overshoot the curve\r\n var targetLineLength = Math.min(distance, lineLength);\r\n\r\n t = targetLineLength / lineLength;\r\n }\r\n else\r\n {\r\n t = u;\r\n }\r\n\r\n return t;\r\n },\r\n\r\n // Override default Curve.draw because this is better than calling getPoints on a line!\r\n\r\n /**\r\n * Draws this curve on the given Graphics object.\r\n *\r\n * The curve is drawn using `Graphics.lineBetween` so will be drawn at whatever the present Graphics line color is.\r\n * The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it.\r\n *\r\n * @method Phaser.Curves.Line#draw\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return]\r\n *\r\n * @param {Phaser.GameObjects.Graphics} graphics - The Graphics instance onto which this curve will be drawn.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} The Graphics object to which the curve was drawn.\r\n */\r\n draw: function (graphics)\r\n {\r\n graphics.lineBetween(this.p0.x, this.p0.y, this.p1.x, this.p1.y);\r\n\r\n // So you can chain graphics calls\r\n return graphics;\r\n },\r\n\r\n /**\r\n * Gets a JSON representation of the line.\r\n *\r\n * @method Phaser.Curves.Line#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.Curves.JSONCurve} The JSON object containing this curve data.\r\n */\r\n toJSON: function ()\r\n {\r\n return {\r\n type: this.type,\r\n points: [\r\n this.p0.x, this.p0.y,\r\n this.p1.x, this.p1.y\r\n ]\r\n };\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Configures this line from a JSON representation.\r\n *\r\n * @function Phaser.Curves.Line.fromJSON\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Curves.JSONCurve} data - The JSON object containing this curve data.\r\n *\r\n * @return {Phaser.Curves.Line} A new LineCurve object.\r\n */\r\nLineCurve.fromJSON = function (data)\r\n{\r\n var points = data.points;\r\n\r\n var p0 = new Vector2(points[0], points[1]);\r\n var p1 = new Vector2(points[2], points[3]);\r\n\r\n return new LineCurve(p0, p1);\r\n};\r\n\r\nmodule.exports = LineCurve;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/curves/LineCurve.js?"); /***/ }), /***/ "./node_modules/phaser/src/curves/QuadraticBezierCurve.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/curves/QuadraticBezierCurve.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Curve = __webpack_require__(/*! ./Curve */ \"./node_modules/phaser/src/curves/Curve.js\");\r\nvar QuadraticBezierInterpolation = __webpack_require__(/*! ../math/interpolation/QuadraticBezierInterpolation */ \"./node_modules/phaser/src/math/interpolation/QuadraticBezierInterpolation.js\");\r\nvar Vector2 = __webpack_require__(/*! ../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * [description]\r\n *\r\n * @class QuadraticBezier\r\n * @extends Phaser.Curves.Curve\r\n * @memberof Phaser.Curves\r\n * @constructor\r\n * @since 3.2.0\r\n *\r\n * @param {(Phaser.Math.Vector2|number[])} p0 - Start point, or an array of point pairs.\r\n * @param {Phaser.Math.Vector2} p1 - Control Point 1.\r\n * @param {Phaser.Math.Vector2} p2 - Control Point 2.\r\n */\r\nvar QuadraticBezier = new Class({\r\n\r\n Extends: Curve,\r\n\r\n initialize:\r\n\r\n function QuadraticBezier (p0, p1, p2)\r\n {\r\n Curve.call(this, 'QuadraticBezier');\r\n\r\n if (Array.isArray(p0))\r\n {\r\n p2 = new Vector2(p0[4], p0[5]);\r\n p1 = new Vector2(p0[2], p0[3]);\r\n p0 = new Vector2(p0[0], p0[1]);\r\n }\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Curves.QuadraticBezier#p0\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.2.0\r\n */\r\n this.p0 = p0;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Curves.QuadraticBezier#p1\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.2.0\r\n */\r\n this.p1 = p1;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Curves.QuadraticBezier#p2\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.2.0\r\n */\r\n this.p2 = p2;\r\n },\r\n\r\n /**\r\n * Gets the starting point on the curve.\r\n *\r\n * @method Phaser.Curves.QuadraticBezier#getStartPoint\r\n * @since 3.2.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned.\r\n */\r\n getStartPoint: function (out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n return out.copy(this.p0);\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Curves.QuadraticBezier#getResolution\r\n * @since 3.2.0\r\n *\r\n * @param {number} divisions - [description]\r\n *\r\n * @return {number} [description]\r\n */\r\n getResolution: function (divisions)\r\n {\r\n return divisions;\r\n },\r\n\r\n /**\r\n * Get point at relative position in curve according to length.\r\n *\r\n * @method Phaser.Curves.QuadraticBezier#getPoint\r\n * @since 3.2.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {number} t - The position along the curve to return. Where 0 is the start and 1 is the end.\r\n * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned.\r\n */\r\n getPoint: function (t, out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n var p0 = this.p0;\r\n var p1 = this.p1;\r\n var p2 = this.p2;\r\n\r\n return out.set(\r\n QuadraticBezierInterpolation(t, p0.x, p1.x, p2.x),\r\n QuadraticBezierInterpolation(t, p0.y, p1.y, p2.y)\r\n );\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Curves.QuadraticBezier#draw\r\n * @since 3.2.0\r\n *\r\n * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return]\r\n *\r\n * @param {Phaser.GameObjects.Graphics} graphics - `Graphics` object to draw onto.\r\n * @param {integer} [pointsTotal=32] - Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} `Graphics` object that was drawn to.\r\n */\r\n draw: function (graphics, pointsTotal)\r\n {\r\n if (pointsTotal === undefined) { pointsTotal = 32; }\r\n\r\n var points = this.getPoints(pointsTotal);\r\n\r\n graphics.beginPath();\r\n graphics.moveTo(this.p0.x, this.p0.y);\r\n\r\n for (var i = 1; i < points.length; i++)\r\n {\r\n graphics.lineTo(points[i].x, points[i].y);\r\n }\r\n\r\n graphics.strokePath();\r\n\r\n // So you can chain graphics calls\r\n return graphics;\r\n },\r\n\r\n /**\r\n * Converts the curve into a JSON compatible object.\r\n *\r\n * @method Phaser.Curves.QuadraticBezier#toJSON\r\n * @since 3.2.0\r\n *\r\n * @return {Phaser.Types.Curves.JSONCurve} The JSON object containing this curve data.\r\n */\r\n toJSON: function ()\r\n {\r\n return {\r\n type: this.type,\r\n points: [\r\n this.p0.x, this.p0.y,\r\n this.p1.x, this.p1.y,\r\n this.p2.x, this.p2.y\r\n ]\r\n };\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Creates a curve from a JSON object, e. g. created by `toJSON`.\r\n *\r\n * @function Phaser.Curves.QuadraticBezier.fromJSON\r\n * @since 3.2.0\r\n *\r\n * @param {Phaser.Types.Curves.JSONCurve} data - The JSON object containing this curve data.\r\n *\r\n * @return {Phaser.Curves.QuadraticBezier} The created curve instance.\r\n */\r\nQuadraticBezier.fromJSON = function (data)\r\n{\r\n var points = data.points;\r\n\r\n var p0 = new Vector2(points[0], points[1]);\r\n var p1 = new Vector2(points[2], points[3]);\r\n var p2 = new Vector2(points[4], points[5]);\r\n\r\n return new QuadraticBezier(p0, p1, p2);\r\n};\r\n\r\nmodule.exports = QuadraticBezier;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/curves/QuadraticBezierCurve.js?"); /***/ }), /***/ "./node_modules/phaser/src/curves/SplineCurve.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/curves/SplineCurve.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog)\r\n\r\nvar CatmullRom = __webpack_require__(/*! ../math/CatmullRom */ \"./node_modules/phaser/src/math/CatmullRom.js\");\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Curve = __webpack_require__(/*! ./Curve */ \"./node_modules/phaser/src/curves/Curve.js\");\r\nvar Vector2 = __webpack_require__(/*! ../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * Create a smooth 2d spline curve from a series of points.\r\n *\r\n * @class Spline\r\n * @extends Phaser.Curves.Curve\r\n * @memberof Phaser.Curves\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2[]|number[]|number[][])} [points] - The points that configure the curve.\r\n */\r\nvar SplineCurve = new Class({\r\n\r\n Extends: Curve,\r\n\r\n initialize:\r\n\r\n function SplineCurve (points)\r\n {\r\n if (points === undefined) { points = []; }\r\n\r\n Curve.call(this, 'SplineCurve');\r\n\r\n /**\r\n * The Vector2 points that configure the curve.\r\n *\r\n * @name Phaser.Curves.Spline#points\r\n * @type {Phaser.Math.Vector2[]}\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.points = [];\r\n\r\n this.addPoints(points);\r\n },\r\n\r\n /**\r\n * Add a list of points to the current list of Vector2 points of the curve.\r\n *\r\n * @method Phaser.Curves.Spline#addPoints\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2[]|number[]|number[][])} points - The points that configure the curve.\r\n *\r\n * @return {Phaser.Curves.Spline} This curve object.\r\n */\r\n addPoints: function (points)\r\n {\r\n for (var i = 0; i < points.length; i++)\r\n {\r\n var p = new Vector2();\r\n\r\n if (typeof points[i] === 'number')\r\n {\r\n p.x = points[i];\r\n p.y = points[i + 1];\r\n i++;\r\n }\r\n else if (Array.isArray(points[i]))\r\n {\r\n // An array of arrays?\r\n p.x = points[i][0];\r\n p.y = points[i][1];\r\n }\r\n else\r\n {\r\n p.x = points[i].x;\r\n p.y = points[i].y;\r\n }\r\n\r\n this.points.push(p);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a point to the current list of Vector2 points of the curve.\r\n *\r\n * @method Phaser.Curves.Spline#addPoint\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of this curve\r\n * @param {number} y - The y coordinate of this curve\r\n *\r\n * @return {Phaser.Math.Vector2} The new Vector2 added to the curve\r\n */\r\n addPoint: function (x, y)\r\n {\r\n var vec = new Vector2(x, y);\r\n\r\n this.points.push(vec);\r\n\r\n return vec;\r\n },\r\n\r\n /**\r\n * Gets the starting point on the curve.\r\n *\r\n * @method Phaser.Curves.Spline#getStartPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned.\r\n */\r\n getStartPoint: function (out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n return out.copy(this.points[0]);\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Curves.Spline#getResolution\r\n * @since 3.0.0\r\n *\r\n * @param {number} divisions - [description]\r\n *\r\n * @return {number} [description]\r\n */\r\n getResolution: function (divisions)\r\n {\r\n return divisions * this.points.length;\r\n },\r\n\r\n /**\r\n * Get point at relative position in curve according to length.\r\n *\r\n * @method Phaser.Curves.Spline#getPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {number} t - The position along the curve to return. Where 0 is the start and 1 is the end.\r\n * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned.\r\n */\r\n getPoint: function (t, out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n var points = this.points;\r\n\r\n var point = (points.length - 1) * t;\r\n\r\n var intPoint = Math.floor(point);\r\n\r\n var weight = point - intPoint;\r\n\r\n var p0 = points[(intPoint === 0) ? intPoint : intPoint - 1];\r\n var p1 = points[intPoint];\r\n var p2 = points[(intPoint > points.length - 2) ? points.length - 1 : intPoint + 1];\r\n var p3 = points[(intPoint > points.length - 3) ? points.length - 1 : intPoint + 2];\r\n\r\n return out.set(CatmullRom(weight, p0.x, p1.x, p2.x, p3.x), CatmullRom(weight, p0.y, p1.y, p2.y, p3.y));\r\n },\r\n\r\n /**\r\n * Exports a JSON object containing this curve data.\r\n *\r\n * @method Phaser.Curves.Spline#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.Curves.JSONCurve} The JSON object containing this curve data.\r\n */\r\n toJSON: function ()\r\n {\r\n var points = [];\r\n\r\n for (var i = 0; i < this.points.length; i++)\r\n {\r\n points.push(this.points[i].x);\r\n points.push(this.points[i].y);\r\n }\r\n\r\n return {\r\n type: this.type,\r\n points: points\r\n };\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Imports a JSON object containing this curve data.\r\n *\r\n * @function Phaser.Curves.Spline.fromJSON\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Curves.JSONCurve} data - The JSON object containing this curve data.\r\n *\r\n * @return {Phaser.Curves.Spline} The spline curve created.\r\n */\r\nSplineCurve.fromJSON = function (data)\r\n{\r\n return new SplineCurve(data.points);\r\n};\r\n\r\nmodule.exports = SplineCurve;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/curves/SplineCurve.js?"); /***/ }), /***/ "./node_modules/phaser/src/curves/index.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/curves/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Curves\r\n */\r\n\r\nmodule.exports = {\r\n Path: __webpack_require__(/*! ./path/Path */ \"./node_modules/phaser/src/curves/path/Path.js\"),\r\n\r\n CubicBezier: __webpack_require__(/*! ./CubicBezierCurve */ \"./node_modules/phaser/src/curves/CubicBezierCurve.js\"),\r\n Curve: __webpack_require__(/*! ./Curve */ \"./node_modules/phaser/src/curves/Curve.js\"),\r\n Ellipse: __webpack_require__(/*! ./EllipseCurve */ \"./node_modules/phaser/src/curves/EllipseCurve.js\"),\r\n Line: __webpack_require__(/*! ./LineCurve */ \"./node_modules/phaser/src/curves/LineCurve.js\"),\r\n QuadraticBezier: __webpack_require__(/*! ./QuadraticBezierCurve */ \"./node_modules/phaser/src/curves/QuadraticBezierCurve.js\"),\r\n Spline: __webpack_require__(/*! ./SplineCurve */ \"./node_modules/phaser/src/curves/SplineCurve.js\")\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/curves/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/curves/path/MoveTo.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/curves/path/MoveTo.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A MoveTo Curve is a very simple curve consisting of only a single point. Its intended use is to move the ending point in a Path.\r\n *\r\n * @class MoveTo\r\n * @memberof Phaser.Curves\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - `x` pixel coordinate.\r\n * @param {number} [y] - `y` pixel coordinate.\r\n */\r\nvar MoveTo = new Class({\r\n\r\n initialize:\r\n\r\n function MoveTo (x, y)\r\n {\r\n // Skip length calcs in paths\r\n\r\n /**\r\n * Denotes that this Curve does not influence the bounds, points, and drawing of its parent Path. Must be `false` or some methods in the parent Path will throw errors.\r\n *\r\n * @name Phaser.Curves.MoveTo#active\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.active = false;\r\n\r\n /**\r\n * The lone point which this curve consists of.\r\n *\r\n * @name Phaser.Curves.MoveTo#p0\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.p0 = new Vector2(x, y);\r\n },\r\n\r\n /**\r\n * Get point at relative position in curve according to length.\r\n *\r\n * @method Phaser.Curves.MoveTo#getPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {number} t - The position along the curve to return. Where 0 is the start and 1 is the end.\r\n * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned.\r\n */\r\n getPoint: function (t, out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n return out.copy(this.p0);\r\n },\r\n\r\n /**\r\n * Retrieves the point at given position in the curve. This will always return this curve's only point.\r\n *\r\n * @method Phaser.Curves.MoveTo#getPointAt\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {number} u - The position in the path to retrieve, between 0 and 1. Not used.\r\n * @param {Phaser.Math.Vector2} [out] - An optional vector in which to store the point.\r\n *\r\n * @return {Phaser.Math.Vector2} The modified `out` vector, or a new `Vector2` if none was provided.\r\n */\r\n getPointAt: function (u, out)\r\n {\r\n return this.getPoint(u, out);\r\n },\r\n\r\n /**\r\n * Gets the resolution of this curve.\r\n *\r\n * @method Phaser.Curves.MoveTo#getResolution\r\n * @since 3.0.0\r\n *\r\n * @return {number} The resolution of this curve. For a MoveTo the value is always 1.\r\n */\r\n getResolution: function ()\r\n {\r\n return 1;\r\n },\r\n\r\n /**\r\n * Gets the length of this curve.\r\n *\r\n * @method Phaser.Curves.MoveTo#getLength\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this curve. For a MoveTo the value is always 0.\r\n */\r\n getLength: function ()\r\n {\r\n return 0;\r\n },\r\n\r\n /**\r\n * Converts this curve into a JSON-serializable object.\r\n *\r\n * @method Phaser.Curves.MoveTo#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.Curves.JSONCurve} A primitive object with the curve's type and only point.\r\n */\r\n toJSON: function ()\r\n {\r\n return {\r\n type: 'MoveTo',\r\n points: [\r\n this.p0.x, this.p0.y\r\n ]\r\n };\r\n }\r\n\r\n});\r\n\r\nmodule.exports = MoveTo;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/curves/path/MoveTo.js?"); /***/ }), /***/ "./node_modules/phaser/src/curves/path/Path.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/curves/path/Path.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog)\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CubicBezierCurve = __webpack_require__(/*! ../CubicBezierCurve */ \"./node_modules/phaser/src/curves/CubicBezierCurve.js\");\r\nvar EllipseCurve = __webpack_require__(/*! ../EllipseCurve */ \"./node_modules/phaser/src/curves/EllipseCurve.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../../gameobjects/GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar LineCurve = __webpack_require__(/*! ../LineCurve */ \"./node_modules/phaser/src/curves/LineCurve.js\");\r\nvar MovePathTo = __webpack_require__(/*! ./MoveTo */ \"./node_modules/phaser/src/curves/path/MoveTo.js\");\r\nvar QuadraticBezierCurve = __webpack_require__(/*! ../QuadraticBezierCurve */ \"./node_modules/phaser/src/curves/QuadraticBezierCurve.js\");\r\nvar Rectangle = __webpack_require__(/*! ../../geom/rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar SplineCurve = __webpack_require__(/*! ../SplineCurve */ \"./node_modules/phaser/src/curves/SplineCurve.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Path combines multiple Curves into one continuous compound curve.\r\n * It does not matter how many Curves are in the Path or what type they are.\r\n *\r\n * A Curve in a Path does not have to start where the previous Curve ends - that is to say, a Path does not\r\n * have to be an uninterrupted curve. Only the order of the Curves influences the actual points on the Path.\r\n *\r\n * @class Path\r\n * @memberof Phaser.Curves\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The X coordinate of the Path's starting point or a {@link Phaser.Types.Curves.JSONPath}.\r\n * @param {number} [y=0] - The Y coordinate of the Path's starting point.\r\n */\r\nvar Path = new Class({\r\n\r\n initialize:\r\n\r\n function Path (x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n /**\r\n * The name of this Path.\r\n * Empty by default and never populated by Phaser, this is left for developers to use.\r\n *\r\n * @name Phaser.Curves.Path#name\r\n * @type {string}\r\n * @default ''\r\n * @since 3.0.0\r\n */\r\n this.name = '';\r\n\r\n /**\r\n * The list of Curves which make up this Path.\r\n *\r\n * @name Phaser.Curves.Path#curves\r\n * @type {Phaser.Curves.Curve[]}\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.curves = [];\r\n\r\n /**\r\n * The cached length of each Curve in the Path.\r\n *\r\n * Used internally by {@link #getCurveLengths}.\r\n *\r\n * @name Phaser.Curves.Path#cacheLengths\r\n * @type {number[]}\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.cacheLengths = [];\r\n\r\n /**\r\n * Automatically closes the path.\r\n *\r\n * @name Phaser.Curves.Path#autoClose\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.autoClose = false;\r\n\r\n /**\r\n * The starting point of the Path.\r\n *\r\n * This is not necessarily equivalent to the starting point of the first Curve in the Path. In an empty Path, it's also treated as the ending point.\r\n *\r\n * @name Phaser.Curves.Path#startPoint\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.startPoint = new Vector2();\r\n\r\n /**\r\n * A temporary vector used to avoid object creation when adding a Curve to the Path.\r\n *\r\n * @name Phaser.Curves.Path#_tmpVec2A\r\n * @type {Phaser.Math.Vector2}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._tmpVec2A = new Vector2();\r\n\r\n /**\r\n * A temporary vector used to avoid object creation when adding a Curve to the Path.\r\n *\r\n * @name Phaser.Curves.Path#_tmpVec2B\r\n * @type {Phaser.Math.Vector2}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._tmpVec2B = new Vector2();\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.fromJSON(x);\r\n }\r\n else\r\n {\r\n this.startPoint.set(x, y);\r\n }\r\n },\r\n\r\n /**\r\n * Appends a Curve to the end of the Path.\r\n *\r\n * The Curve does not have to start where the Path ends or, for an empty Path, at its defined starting point.\r\n *\r\n * @method Phaser.Curves.Path#add\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Curves.Curve} curve - The Curve to append.\r\n *\r\n * @return {Phaser.Curves.Path} This Path object.\r\n */\r\n add: function (curve)\r\n {\r\n this.curves.push(curve);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a circular Ellipse Curve positioned at the end of the Path.\r\n *\r\n * @method Phaser.Curves.Path#circleTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} radius - The radius of the circle.\r\n * @param {boolean} [clockwise=false] - `true` to create a clockwise circle as opposed to a counter-clockwise circle.\r\n * @param {number} [rotation=0] - The rotation of the circle in degrees.\r\n *\r\n * @return {Phaser.Curves.Path} This Path object.\r\n */\r\n circleTo: function (radius, clockwise, rotation)\r\n {\r\n if (clockwise === undefined) { clockwise = false; }\r\n\r\n return this.ellipseTo(radius, radius, 0, 360, clockwise, rotation);\r\n },\r\n\r\n /**\r\n * Ensures that the Path is closed.\r\n *\r\n * A closed Path starts and ends at the same point. If the Path is not closed, a straight Line Curve will be created from the ending point directly to the starting point. During the check, the actual starting point of the Path, i.e. the starting point of the first Curve, will be used as opposed to the Path's defined {@link startPoint}, which could differ.\r\n *\r\n * Calling this method on an empty Path will result in an error.\r\n *\r\n * @method Phaser.Curves.Path#closePath\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Curves.Path} This Path object.\r\n */\r\n closePath: function ()\r\n {\r\n // Add a line curve if start and end of lines are not connected\r\n var startPoint = this.curves[0].getPoint(0);\r\n var endPoint = this.curves[this.curves.length - 1].getPoint(1);\r\n\r\n if (!startPoint.equals(endPoint))\r\n {\r\n // This will copy a reference to the vectors, which probably isn't sensible\r\n this.curves.push(new LineCurve(endPoint, startPoint));\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a cubic bezier curve starting at the previous end point and ending at p3, using p1 and p2 as control points.\r\n *\r\n * @method Phaser.Curves.Path#cubicBezierTo\r\n * @since 3.0.0\r\n *\r\n * @param {(number|Phaser.Math.Vector2)} x - The x coordinate of the end point. Or, if a Vector2, the p1 value.\r\n * @param {(number|Phaser.Math.Vector2)} y - The y coordinate of the end point. Or, if a Vector2, the p2 value.\r\n * @param {(number|Phaser.Math.Vector2)} control1X - The x coordinate of the first control point. Or, if a Vector2, the p3 value.\r\n * @param {number} [control1Y] - The y coordinate of the first control point. Not used if Vector2s are provided as the first 3 arguments.\r\n * @param {number} [control2X] - The x coordinate of the second control point. Not used if Vector2s are provided as the first 3 arguments.\r\n * @param {number} [control2Y] - The y coordinate of the second control point. Not used if Vector2s are provided as the first 3 arguments.\r\n *\r\n * @return {Phaser.Curves.Path} This Path object.\r\n */\r\n cubicBezierTo: function (x, y, control1X, control1Y, control2X, control2Y)\r\n {\r\n var p0 = this.getEndPoint();\r\n var p1;\r\n var p2;\r\n var p3;\r\n\r\n // Assume they're all Vector2s\r\n if (x instanceof Vector2)\r\n {\r\n p1 = x;\r\n p2 = y;\r\n p3 = control1X;\r\n }\r\n else\r\n {\r\n p1 = new Vector2(control1X, control1Y);\r\n p2 = new Vector2(control2X, control2Y);\r\n p3 = new Vector2(x, y);\r\n }\r\n\r\n return this.add(new CubicBezierCurve(p0, p1, p2, p3));\r\n },\r\n\r\n // Creates a quadratic bezier curve starting at the previous end point and ending at p2, using p1 as a control point\r\n\r\n /**\r\n * Creates a Quadratic Bezier Curve starting at the ending point of the Path.\r\n *\r\n * @method Phaser.Curves.Path#quadraticBezierTo\r\n * @since 3.2.0\r\n *\r\n * @param {(number|Phaser.Math.Vector2[])} x - The X coordinate of the second control point or, if it's a `Vector2`, the first control point.\r\n * @param {number} [y] - The Y coordinate of the second control point or, if `x` is a `Vector2`, the second control point.\r\n * @param {number} [controlX] - If `x` is not a `Vector2`, the X coordinate of the first control point.\r\n * @param {number} [controlY] - If `x` is not a `Vector2`, the Y coordinate of the first control point.\r\n *\r\n * @return {Phaser.Curves.Path} This Path object.\r\n */\r\n quadraticBezierTo: function (x, y, controlX, controlY)\r\n {\r\n var p0 = this.getEndPoint();\r\n var p1;\r\n var p2;\r\n\r\n // Assume they're all Vector2s\r\n if (x instanceof Vector2)\r\n {\r\n p1 = x;\r\n p2 = y;\r\n }\r\n else\r\n {\r\n p1 = new Vector2(controlX, controlY);\r\n p2 = new Vector2(x, y);\r\n }\r\n\r\n return this.add(new QuadraticBezierCurve(p0, p1, p2));\r\n },\r\n\r\n /**\r\n * Draws all Curves in the Path to a Graphics Game Object.\r\n *\r\n * @method Phaser.Curves.Path#draw\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.Graphics} G - [out,$return]\r\n *\r\n * @param {Phaser.GameObjects.Graphics} graphics - The Graphics Game Object to draw to.\r\n * @param {integer} [pointsTotal=32] - The number of points to draw for each Curve. Higher numbers result in a smoother curve but require more processing.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} The Graphics object which was drawn to.\r\n */\r\n draw: function (graphics, pointsTotal)\r\n {\r\n for (var i = 0; i < this.curves.length; i++)\r\n {\r\n var curve = this.curves[i];\r\n\r\n if (!curve.active)\r\n {\r\n continue;\r\n }\r\n\r\n curve.draw(graphics, pointsTotal);\r\n }\r\n\r\n return graphics;\r\n },\r\n\r\n /**\r\n * Creates an ellipse curve positioned at the previous end point, using the given parameters.\r\n *\r\n * @method Phaser.Curves.Path#ellipseTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} [xRadius=0] - The horizontal radius of ellipse.\r\n * @param {number} [yRadius=0] - The vertical radius of ellipse.\r\n * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees.\r\n * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees.\r\n * @param {boolean} [clockwise=false] - Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`).\r\n * @param {number} [rotation=0] - The rotation of the ellipse, in degrees.\r\n *\r\n * @return {Phaser.Curves.Path} This Path object.\r\n */\r\n ellipseTo: function (xRadius, yRadius, startAngle, endAngle, clockwise, rotation)\r\n {\r\n var ellipse = new EllipseCurve(0, 0, xRadius, yRadius, startAngle, endAngle, clockwise, rotation);\r\n\r\n var end = this.getEndPoint(this._tmpVec2A);\r\n\r\n // Calculate where to center the ellipse\r\n var start = ellipse.getStartPoint(this._tmpVec2B);\r\n\r\n end.subtract(start);\r\n\r\n ellipse.x = end.x;\r\n ellipse.y = end.y;\r\n\r\n return this.add(ellipse);\r\n },\r\n\r\n /**\r\n * Creates a Path from a Path Configuration object.\r\n *\r\n * The provided object should be a {@link Phaser.Types.Curves.JSONPath}, as returned by {@link #toJSON}. Providing a malformed object may cause errors.\r\n *\r\n * @method Phaser.Curves.Path#fromJSON\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Curves.JSONPath} data - The JSON object containing the Path data.\r\n *\r\n * @return {Phaser.Curves.Path} This Path object.\r\n */\r\n fromJSON: function (data)\r\n {\r\n // data should be an object matching the Path.toJSON object structure.\r\n\r\n this.curves = [];\r\n this.cacheLengths = [];\r\n\r\n this.startPoint.set(data.x, data.y);\r\n\r\n this.autoClose = data.autoClose;\r\n\r\n for (var i = 0; i < data.curves.length; i++)\r\n {\r\n var curve = data.curves[i];\r\n\r\n switch (curve.type)\r\n {\r\n case 'LineCurve':\r\n this.add(LineCurve.fromJSON(curve));\r\n break;\r\n\r\n case 'EllipseCurve':\r\n this.add(EllipseCurve.fromJSON(curve));\r\n break;\r\n\r\n case 'SplineCurve':\r\n this.add(SplineCurve.fromJSON(curve));\r\n break;\r\n\r\n case 'CubicBezierCurve':\r\n this.add(CubicBezierCurve.fromJSON(curve));\r\n break;\r\n\r\n case 'QuadraticBezierCurve':\r\n this.add(QuadraticBezierCurve.fromJSON(curve));\r\n break;\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns a Rectangle with a position and size matching the bounds of this Path.\r\n *\r\n * @method Phaser.Curves.Path#getBounds\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the bounds in.\r\n * @param {integer} [accuracy=16] - The accuracy of the bounds calculations. Higher values are more accurate at the cost of calculation speed.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided.\r\n */\r\n getBounds: function (out, accuracy)\r\n {\r\n if (out === undefined) { out = new Rectangle(); }\r\n if (accuracy === undefined) { accuracy = 16; }\r\n\r\n out.x = Number.MAX_VALUE;\r\n out.y = Number.MAX_VALUE;\r\n\r\n var bounds = new Rectangle();\r\n var maxRight = MATH_CONST.MIN_SAFE_INTEGER;\r\n var maxBottom = MATH_CONST.MIN_SAFE_INTEGER;\r\n\r\n for (var i = 0; i < this.curves.length; i++)\r\n {\r\n var curve = this.curves[i];\r\n\r\n if (!curve.active)\r\n {\r\n continue;\r\n }\r\n\r\n curve.getBounds(bounds, accuracy);\r\n\r\n out.x = Math.min(out.x, bounds.x);\r\n out.y = Math.min(out.y, bounds.y);\r\n\r\n maxRight = Math.max(maxRight, bounds.right);\r\n maxBottom = Math.max(maxBottom, bounds.bottom);\r\n }\r\n\r\n out.right = maxRight;\r\n out.bottom = maxBottom;\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Returns an array containing the length of the Path at the end of each Curve.\r\n *\r\n * The result of this method will be cached to avoid recalculating it in subsequent calls. The cache is only invalidated when the {@link #curves} array changes in length, leading to potential inaccuracies if a Curve in the Path is changed, or if a Curve is removed and another is added in its place.\r\n *\r\n * @method Phaser.Curves.Path#getCurveLengths\r\n * @since 3.0.0\r\n *\r\n * @return {number[]} An array containing the length of the Path at the end of each one of its Curves.\r\n */\r\n getCurveLengths: function ()\r\n {\r\n // We use cache values if curves and cache array are same length\r\n\r\n if (this.cacheLengths.length === this.curves.length)\r\n {\r\n return this.cacheLengths;\r\n }\r\n\r\n // Get length of sub-curve\r\n // Push sums into cached array\r\n\r\n var lengths = [];\r\n var sums = 0;\r\n\r\n for (var i = 0; i < this.curves.length; i++)\r\n {\r\n sums += this.curves[i].getLength();\r\n\r\n lengths.push(sums);\r\n }\r\n\r\n this.cacheLengths = lengths;\r\n\r\n return lengths;\r\n },\r\n\r\n /**\r\n * Returns the ending point of the Path.\r\n *\r\n * A Path's ending point is equivalent to the ending point of the last Curve in the Path. For an empty Path, the ending point is at the Path's defined {@link #startPoint}.\r\n *\r\n * @method Phaser.Curves.Path#getEndPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {Phaser.Math.Vector2} [out] - The object to store the point in.\r\n *\r\n * @return {Phaser.Math.Vector2} The modified `out` object, or a new Vector2 if none was provided.\r\n */\r\n getEndPoint: function (out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n if (this.curves.length > 0)\r\n {\r\n this.curves[this.curves.length - 1].getPoint(1, out);\r\n }\r\n else\r\n {\r\n out.copy(this.startPoint);\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Returns the total length of the Path.\r\n *\r\n * @see {@link #getCurveLengths}\r\n *\r\n * @method Phaser.Curves.Path#getLength\r\n * @since 3.0.0\r\n *\r\n * @return {number} The total length of the Path.\r\n */\r\n getLength: function ()\r\n {\r\n var lens = this.getCurveLengths();\r\n\r\n return lens[lens.length - 1];\r\n },\r\n\r\n // To get accurate point with reference to\r\n // entire path distance at time t,\r\n // following has to be done:\r\n\r\n // 1. Length of each sub path have to be known\r\n // 2. Locate and identify type of curve\r\n // 3. Get t for the curve\r\n // 4. Return curve.getPointAt(t')\r\n\r\n /**\r\n * Calculates the coordinates of the point at the given normalized location (between 0 and 1) on the Path.\r\n *\r\n * The location is relative to the entire Path, not to an individual Curve. A location of 0.5 is always in the middle of the Path and is thus an equal distance away from both its starting and ending points. In a Path with one Curve, it would be in the middle of the Curve; in a Path with two Curves, it could be anywhere on either one of them depending on their lengths.\r\n *\r\n * @method Phaser.Curves.Path#getPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {number} t - The location of the point to return, between 0 and 1.\r\n * @param {Phaser.Math.Vector2} [out] - The object in which to store the calculated point.\r\n *\r\n * @return {?Phaser.Math.Vector2} The modified `out` object, or a new `Vector2` if none was provided.\r\n */\r\n getPoint: function (t, out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n var d = t * this.getLength();\r\n var curveLengths = this.getCurveLengths();\r\n var i = 0;\r\n\r\n while (i < curveLengths.length)\r\n {\r\n if (curveLengths[i] >= d)\r\n {\r\n var diff = curveLengths[i] - d;\r\n var curve = this.curves[i];\r\n\r\n var segmentLength = curve.getLength();\r\n var u = (segmentLength === 0) ? 0 : 1 - diff / segmentLength;\r\n\r\n return curve.getPointAt(u, out);\r\n }\r\n\r\n i++;\r\n }\r\n\r\n // loop where sum != 0, sum > d , sum+1 1 && !points[points.length - 1].equals(points[0]))\r\n {\r\n points.push(points[0]);\r\n }\r\n\r\n return points;\r\n },\r\n\r\n /**\r\n * Returns a randomly chosen point anywhere on the path. This follows the same rules as `getPoint` in that it may return a point on any Curve inside this path.\r\n *\r\n * When calling this method multiple times, the points are not guaranteed to be equally spaced spatially.\r\n *\r\n * @method Phaser.Curves.Path#getRandomPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {Phaser.Math.Vector2} [out] - `Vector2` instance that should be used for storing the result. If `undefined` a new `Vector2` will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} The modified `out` object, or a new `Vector2` if none was provided.\r\n */\r\n getRandomPoint: function (out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n return this.getPoint(Math.random(), out);\r\n },\r\n\r\n /**\r\n * Divides this Path into a set of equally spaced points,\r\n *\r\n * The resulting points are equally spaced with respect to the points' position on the path, but not necessarily equally spaced spatially.\r\n *\r\n * @method Phaser.Curves.Path#getSpacedPoints\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [divisions=40] - The amount of points to divide this Path into.\r\n *\r\n * @return {Phaser.Math.Vector2[]} A list of the points this path was subdivided into.\r\n */\r\n getSpacedPoints: function (divisions)\r\n {\r\n if (divisions === undefined) { divisions = 40; }\r\n\r\n var points = [];\r\n\r\n for (var i = 0; i <= divisions; i++)\r\n {\r\n points.push(this.getPoint(i / divisions));\r\n }\r\n\r\n if (this.autoClose)\r\n {\r\n points.push(points[0]);\r\n }\r\n\r\n return points;\r\n },\r\n\r\n /**\r\n * Returns the starting point of the Path.\r\n *\r\n * @method Phaser.Curves.Path#getStartPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {Phaser.Math.Vector2} [out] - `Vector2` instance that should be used for storing the result. If `undefined` a new `Vector2` will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} The modified `out` object, or a new Vector2 if none was provided.\r\n */\r\n getStartPoint: function (out)\r\n {\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n return out.copy(this.startPoint);\r\n },\r\n\r\n /**\r\n * Creates a line curve from the previous end point to x/y.\r\n *\r\n * @method Phaser.Curves.Path#lineTo\r\n * @since 3.0.0\r\n *\r\n * @param {(number|Phaser.Math.Vector2)} x - The X coordinate of the line's end point, or a `Vector2` containing the entire end point.\r\n * @param {number} [y] - The Y coordinate of the line's end point, if a number was passed as the X parameter.\r\n *\r\n * @return {Phaser.Curves.Path} This Path object.\r\n */\r\n lineTo: function (x, y)\r\n {\r\n if (x instanceof Vector2)\r\n {\r\n this._tmpVec2B.copy(x);\r\n }\r\n else\r\n {\r\n this._tmpVec2B.set(x, y);\r\n }\r\n\r\n var end = this.getEndPoint(this._tmpVec2A);\r\n\r\n return this.add(new LineCurve([ end.x, end.y, this._tmpVec2B.x, this._tmpVec2B.y ]));\r\n },\r\n\r\n /**\r\n * Creates a spline curve starting at the previous end point, using the given points on the curve.\r\n *\r\n * @method Phaser.Curves.Path#splineTo\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2[]} points - The points the newly created spline curve should consist of.\r\n *\r\n * @return {Phaser.Curves.Path} This Path object.\r\n */\r\n splineTo: function (points)\r\n {\r\n points.unshift(this.getEndPoint());\r\n\r\n return this.add(new SplineCurve(points));\r\n },\r\n\r\n /**\r\n * Creates a \"gap\" in this path from the path's current end point to the given coordinates.\r\n *\r\n * After calling this function, this Path's end point will be equal to the given coordinates\r\n *\r\n * @method Phaser.Curves.Path#moveTo\r\n * @since 3.0.0\r\n *\r\n * @param {(number|Phaser.Math.Vector2)} x - The X coordinate of the position to move the path's end point to, or a `Vector2` containing the entire new end point.\r\n * @param {number} y - The Y coordinate of the position to move the path's end point to, if a number was passed as the X coordinate.\r\n *\r\n * @return {Phaser.Curves.Path} This Path object.\r\n */\r\n moveTo: function (x, y)\r\n {\r\n if (x instanceof Vector2)\r\n {\r\n return this.add(new MovePathTo(x.x, x.y));\r\n }\r\n else\r\n {\r\n return this.add(new MovePathTo(x, y));\r\n }\r\n },\r\n\r\n /**\r\n * Converts this Path to a JSON object containing the path information and its constituent curves.\r\n *\r\n * @method Phaser.Curves.Path#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.Curves.JSONPath} The JSON object containing this path's data.\r\n */\r\n toJSON: function ()\r\n {\r\n var out = [];\r\n\r\n for (var i = 0; i < this.curves.length; i++)\r\n {\r\n out.push(this.curves[i].toJSON());\r\n }\r\n\r\n return {\r\n type: 'Path',\r\n x: this.startPoint.x,\r\n y: this.startPoint.y,\r\n autoClose: this.autoClose,\r\n curves: out\r\n };\r\n },\r\n\r\n /**\r\n * cacheLengths must be recalculated.\r\n *\r\n * @method Phaser.Curves.Path#updateArcLengths\r\n * @since 3.0.0\r\n */\r\n updateArcLengths: function ()\r\n {\r\n this.cacheLengths = [];\r\n\r\n this.getCurveLengths();\r\n },\r\n\r\n /**\r\n * Disposes of this Path, clearing its internal references to objects so they can be garbage-collected.\r\n *\r\n * @method Phaser.Curves.Path#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.curves.length = 0;\r\n this.cacheLengths.length = 0;\r\n this.startPoint = undefined;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Creates a new Path Object.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#path\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Path.\r\n * @param {number} y - The vertical position of this Path.\r\n *\r\n * @return {Phaser.Curves.Path} The Path Object that was created.\r\n */\r\nGameObjectFactory.register('path', function (x, y)\r\n{\r\n return new Path(x, y);\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\r\nmodule.exports = Path;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/curves/path/Path.js?"); /***/ }), /***/ "./node_modules/phaser/src/data/DataManager.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/data/DataManager.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/data/events/index.js\");\r\n\r\n/**\r\n * @callback DataEachCallback\r\n *\r\n * @param {*} parent - The parent object of the DataManager.\r\n * @param {string} key - The key of the value.\r\n * @param {*} value - The value.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin.\r\n * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter,\r\n * or have a property called `events` that is an instance of it.\r\n *\r\n * @class DataManager\r\n * @memberof Phaser.Data\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {object} parent - The object that this DataManager belongs to.\r\n * @param {Phaser.Events.EventEmitter} eventEmitter - The DataManager's event emitter.\r\n */\r\nvar DataManager = new Class({\r\n\r\n initialize:\r\n\r\n function DataManager (parent, eventEmitter)\r\n {\r\n /**\r\n * The object that this DataManager belongs to.\r\n *\r\n * @name Phaser.Data.DataManager#parent\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.parent = parent;\r\n\r\n /**\r\n * The DataManager's event emitter.\r\n *\r\n * @name Phaser.Data.DataManager#events\r\n * @type {Phaser.Events.EventEmitter}\r\n * @since 3.0.0\r\n */\r\n this.events = eventEmitter;\r\n\r\n if (!eventEmitter)\r\n {\r\n this.events = (parent.events) ? parent.events : parent;\r\n }\r\n\r\n /**\r\n * The data list.\r\n *\r\n * @name Phaser.Data.DataManager#list\r\n * @type {Object.}\r\n * @default {}\r\n * @since 3.0.0\r\n */\r\n this.list = {};\r\n\r\n /**\r\n * The public values list. You can use this to access anything you have stored\r\n * in this Data Manager. For example, if you set a value called `gold` you can\r\n * access it via:\r\n *\r\n * ```javascript\r\n * this.data.values.gold;\r\n * ```\r\n *\r\n * You can also modify it directly:\r\n * \r\n * ```javascript\r\n * this.data.values.gold += 1000;\r\n * ```\r\n *\r\n * Doing so will emit a `setdata` event from the parent of this Data Manager.\r\n * \r\n * Do not modify this object directly. Adding properties directly to this object will not\r\n * emit any events. Always use `DataManager.set` to create new items the first time around.\r\n *\r\n * @name Phaser.Data.DataManager#values\r\n * @type {Object.}\r\n * @default {}\r\n * @since 3.10.0\r\n */\r\n this.values = {};\r\n\r\n /**\r\n * Whether setting data is frozen for this DataManager.\r\n *\r\n * @name Phaser.Data.DataManager#_frozen\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this._frozen = false;\r\n\r\n if (!parent.hasOwnProperty('sys') && this.events)\r\n {\r\n this.events.once('destroy', this.destroy, this);\r\n }\r\n },\r\n\r\n /**\r\n * Retrieves the value for the given key, or undefined if it doesn't exist.\r\n *\r\n * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either:\r\n * \r\n * ```javascript\r\n * this.data.get('gold');\r\n * ```\r\n *\r\n * Or access the value directly:\r\n * \r\n * ```javascript\r\n * this.data.values.gold;\r\n * ```\r\n *\r\n * You can also pass in an array of keys, in which case an array of values will be returned:\r\n * \r\n * ```javascript\r\n * this.data.get([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * This approach is useful for destructuring arrays in ES6.\r\n *\r\n * @method Phaser.Data.DataManager#get\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys.\r\n *\r\n * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array.\r\n */\r\n get: function (key)\r\n {\r\n var list = this.list;\r\n\r\n if (Array.isArray(key))\r\n {\r\n var output = [];\r\n\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n output.push(list[key[i]]);\r\n }\r\n\r\n return output;\r\n }\r\n else\r\n {\r\n return list[key];\r\n }\r\n },\r\n\r\n /**\r\n * Retrieves all data values in a new object.\r\n *\r\n * @method Phaser.Data.DataManager#getAll\r\n * @since 3.0.0\r\n *\r\n * @return {Object.} All data values.\r\n */\r\n getAll: function ()\r\n {\r\n var results = {};\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list.hasOwnProperty(key))\r\n {\r\n results[key] = this.list[key];\r\n }\r\n }\r\n\r\n return results;\r\n },\r\n\r\n /**\r\n * Queries the DataManager for the values of keys matching the given regular expression.\r\n *\r\n * @method Phaser.Data.DataManager#query\r\n * @since 3.0.0\r\n *\r\n * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj).\r\n *\r\n * @return {Object.} The values of the keys matching the search string.\r\n */\r\n query: function (search)\r\n {\r\n var results = {};\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list.hasOwnProperty(key) && key.match(search))\r\n {\r\n results[key] = this.list[key];\r\n }\r\n }\r\n\r\n return results;\r\n },\r\n\r\n /**\r\n * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created.\r\n * \r\n * ```javascript\r\n * data.set('name', 'Red Gem Stone');\r\n * ```\r\n *\r\n * You can also pass in an object of key value pairs as the first argument:\r\n *\r\n * ```javascript\r\n * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 });\r\n * ```\r\n *\r\n * To get a value back again you can call `get`:\r\n * \r\n * ```javascript\r\n * data.get('gold');\r\n * ```\r\n * \r\n * Or you can access the value directly via the `values` property, where it works like any other variable:\r\n * \r\n * ```javascript\r\n * data.values.gold += 50;\r\n * ```\r\n *\r\n * When the value is first set, a `setdata` event is emitted.\r\n *\r\n * If the key already exists, a `changedata` event is emitted instead, along an event named after the key.\r\n * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`.\r\n * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter.\r\n *\r\n * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.Data.DataManager#set\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.0.0\r\n *\r\n * @param {(string|object)} key - The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored.\r\n * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n set: function (key, data)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (typeof key === 'string')\r\n {\r\n return this.setValue(key, data);\r\n }\r\n else\r\n {\r\n for (var entry in key)\r\n {\r\n this.setValue(entry, key[entry]);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal value setter, called automatically by the `set` method.\r\n *\r\n * @method Phaser.Data.DataManager#setValue\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @private\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The key to set the value for.\r\n * @param {*} data - The value to set.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n setValue: function (key, data)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (this.has(key))\r\n {\r\n // Hit the key getter, which will in turn emit the events.\r\n this.values[key] = data;\r\n }\r\n else\r\n {\r\n var _this = this;\r\n var list = this.list;\r\n var events = this.events;\r\n var parent = this.parent;\r\n\r\n Object.defineProperty(this.values, key, {\r\n\r\n enumerable: true,\r\n \r\n configurable: true,\r\n\r\n get: function ()\r\n {\r\n return list[key];\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (!_this._frozen)\r\n {\r\n var previousValue = list[key];\r\n list[key] = value;\r\n\r\n events.emit(Events.CHANGE_DATA, parent, key, value, previousValue);\r\n events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue);\r\n }\r\n }\r\n\r\n });\r\n\r\n list[key] = data;\r\n\r\n events.emit(Events.SET_DATA, parent, key, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Passes all data entries to the given callback.\r\n *\r\n * @method Phaser.Data.DataManager#each\r\n * @since 3.0.0\r\n *\r\n * @param {DataEachCallback} callback - The function to call.\r\n * @param {*} [context] - Value to use as `this` when executing callback.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n each: function (callback, context)\r\n {\r\n var args = [ this.parent, null, undefined ];\r\n\r\n for (var i = 1; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (var key in this.list)\r\n {\r\n args[1] = key;\r\n args[2] = this.list[key];\r\n\r\n callback.apply(context, args);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Merge the given object of key value pairs into this DataManager.\r\n *\r\n * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument)\r\n * will emit a `changedata` event.\r\n *\r\n * @method Phaser.Data.DataManager#merge\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.0.0\r\n *\r\n * @param {Object.} data - The data to merge.\r\n * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n merge: function (data, overwrite)\r\n {\r\n if (overwrite === undefined) { overwrite = true; }\r\n\r\n // Merge data from another component into this one\r\n for (var key in data)\r\n {\r\n if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key))))\r\n {\r\n this.setValue(key, data[key]);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Remove the value for the given key.\r\n *\r\n * If the key is found in this Data Manager it is removed from the internal lists and a\r\n * `removedata` event is emitted.\r\n * \r\n * You can also pass in an array of keys, in which case all keys in the array will be removed:\r\n * \r\n * ```javascript\r\n * this.data.remove([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * @method Phaser.Data.DataManager#remove\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key to remove, or an array of keys to remove.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n remove: function (key)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n this.removeValue(key[i]);\r\n }\r\n }\r\n else\r\n {\r\n return this.removeValue(key);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal value remover, called automatically by the `remove` method.\r\n *\r\n * @method Phaser.Data.DataManager#removeValue\r\n * @private\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The key to set the value for.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n removeValue: function (key)\r\n {\r\n if (this.has(key))\r\n {\r\n var data = this.list[key];\r\n\r\n delete this.list[key];\r\n delete this.values[key];\r\n\r\n this.events.emit(Events.REMOVE_DATA, this.parent, key, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it.\r\n *\r\n * @method Phaser.Data.DataManager#pop\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the value to retrieve and delete.\r\n *\r\n * @return {*} The value of the given key.\r\n */\r\n pop: function (key)\r\n {\r\n var data = undefined;\r\n\r\n if (!this._frozen && this.has(key))\r\n {\r\n data = this.list[key];\r\n\r\n delete this.list[key];\r\n delete this.values[key];\r\n\r\n this.events.emit(Events.REMOVE_DATA, this.parent, key, data);\r\n }\r\n\r\n return data;\r\n },\r\n\r\n /**\r\n * Determines whether the given key is set in this Data Manager.\r\n * \r\n * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.Data.DataManager#has\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key to check.\r\n *\r\n * @return {boolean} Returns `true` if the key exists, otherwise `false`.\r\n */\r\n has: function (key)\r\n {\r\n return this.list.hasOwnProperty(key);\r\n },\r\n\r\n /**\r\n * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts\r\n * to create new values or update existing ones.\r\n *\r\n * @method Phaser.Data.DataManager#setFreeze\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - Whether to freeze or unfreeze the Data Manager.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n setFreeze: function (value)\r\n {\r\n this._frozen = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Delete all data in this Data Manager and unfreeze it.\r\n *\r\n * @method Phaser.Data.DataManager#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n reset: function ()\r\n {\r\n for (var key in this.list)\r\n {\r\n delete this.list[key];\r\n delete this.values[key];\r\n }\r\n\r\n this._frozen = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Destroy this data manager.\r\n *\r\n * @method Phaser.Data.DataManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.reset();\r\n\r\n this.events.off(Events.CHANGE_DATA);\r\n this.events.off(Events.SET_DATA);\r\n this.events.off(Events.REMOVE_DATA);\r\n\r\n this.parent = null;\r\n },\r\n\r\n /**\r\n * Gets or sets the frozen state of this Data Manager.\r\n * A frozen Data Manager will block all attempts to create new values or update existing ones.\r\n *\r\n * @name Phaser.Data.DataManager#freeze\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n freeze: {\r\n\r\n get: function ()\r\n {\r\n return this._frozen;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._frozen = (value) ? true : false;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Return the total number of entries in this Data Manager.\r\n *\r\n * @name Phaser.Data.DataManager#count\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n count: {\r\n\r\n get: function ()\r\n {\r\n var i = 0;\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list[key] !== undefined)\r\n {\r\n i++;\r\n }\r\n }\r\n\r\n return i;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = DataManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/data/DataManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/data/DataManagerPlugin.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/data/DataManagerPlugin.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar DataManager = __webpack_require__(/*! ./DataManager */ \"./node_modules/phaser/src/data/DataManager.js\");\r\nvar PluginCache = __webpack_require__(/*! ../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar SceneEvents = __webpack_require__(/*! ../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Data Component features a means to store pieces of data specific to a Game Object, System or Plugin.\r\n * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter,\r\n * or have a property called `events` that is an instance of it.\r\n *\r\n * @class DataManagerPlugin\r\n * @extends Phaser.Data.DataManager\r\n * @memberof Phaser.Data\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that this DataManager belongs to.\r\n */\r\nvar DataManagerPlugin = new Class({\r\n\r\n Extends: DataManager,\r\n\r\n initialize:\r\n\r\n function DataManagerPlugin (scene)\r\n {\r\n DataManager.call(this, scene, scene.sys.events);\r\n\r\n /**\r\n * A reference to the Scene that this DataManager belongs to.\r\n *\r\n * @name Phaser.Data.DataManagerPlugin#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A reference to the Scene's Systems.\r\n *\r\n * @name Phaser.Data.DataManagerPlugin#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n scene.sys.events.on(SceneEvents.START, this.start, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Data.DataManagerPlugin#boot\r\n * @private\r\n * @since 3.5.1\r\n */\r\n boot: function ()\r\n {\r\n this.events = this.systems.events;\r\n\r\n this.events.once(SceneEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Data.DataManagerPlugin#start\r\n * @private\r\n * @since 3.5.0\r\n */\r\n start: function ()\r\n {\r\n this.events.once(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Phaser.Data.DataManagerPlugin#shutdown\r\n * @private\r\n * @since 3.5.0\r\n */\r\n shutdown: function ()\r\n {\r\n this.systems.events.off(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Phaser.Data.DataManagerPlugin#destroy\r\n * @since 3.5.0\r\n */\r\n destroy: function ()\r\n {\r\n DataManager.prototype.destroy.call(this);\r\n\r\n this.events.off(SceneEvents.START, this.start, this);\r\n\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nPluginCache.register('DataManagerPlugin', DataManagerPlugin, 'data');\r\n\r\nmodule.exports = DataManagerPlugin;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/data/DataManagerPlugin.js?"); /***/ }), /***/ "./node_modules/phaser/src/data/events/CHANGE_DATA_EVENT.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/data/events/CHANGE_DATA_EVENT.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Change Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item in the data store is changed.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`.\r\n * \r\n * This event is dispatched for all items that change in the Data Manager.\r\n * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event.\r\n *\r\n * @event Phaser.Data.Events#CHANGE_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} value - The new value of the item in the Data Manager.\r\n * @param {any} previousValue - The previous value of the item in the Data Manager.\r\n */\r\nmodule.exports = 'changedata';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/data/events/CHANGE_DATA_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/data/events/CHANGE_DATA_KEY_EVENT.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/data/events/CHANGE_DATA_KEY_EVENT.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Change Data Key Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item in the data store is changed.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`,\r\n * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold`\r\n * then you can listen for `sprite.data.on('changedata-gold')`.\r\n *\r\n * @event Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.16.1\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {any} value - The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n * @param {any} previousValue - The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'changedata-';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/data/events/CHANGE_DATA_KEY_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/data/events/REMOVE_DATA_EVENT.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/data/events/REMOVE_DATA_EVENT.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Remove Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item is removed from it.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`.\r\n *\r\n * @event Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} data - The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'removedata';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/data/events/REMOVE_DATA_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/data/events/SET_DATA_EVENT.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/data/events/SET_DATA_EVENT.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Set Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when a new item is added to the data store.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`.\r\n *\r\n * @event Phaser.Data.Events#SET_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} data - The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'setdata';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/data/events/SET_DATA_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/data/events/index.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/data/events/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Data.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n CHANGE_DATA: __webpack_require__(/*! ./CHANGE_DATA_EVENT */ \"./node_modules/phaser/src/data/events/CHANGE_DATA_EVENT.js\"),\r\n CHANGE_DATA_KEY: __webpack_require__(/*! ./CHANGE_DATA_KEY_EVENT */ \"./node_modules/phaser/src/data/events/CHANGE_DATA_KEY_EVENT.js\"),\r\n REMOVE_DATA: __webpack_require__(/*! ./REMOVE_DATA_EVENT */ \"./node_modules/phaser/src/data/events/REMOVE_DATA_EVENT.js\"),\r\n SET_DATA: __webpack_require__(/*! ./SET_DATA_EVENT */ \"./node_modules/phaser/src/data/events/SET_DATA_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/data/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/data/index.js": /*!***********************************************!*\ !*** ./node_modules/phaser/src/data/index.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Data\r\n */\r\n\r\nmodule.exports = {\r\n\r\n DataManager: __webpack_require__(/*! ./DataManager */ \"./node_modules/phaser/src/data/DataManager.js\"),\r\n DataManagerPlugin: __webpack_require__(/*! ./DataManagerPlugin */ \"./node_modules/phaser/src/data/DataManagerPlugin.js\"),\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/data/events/index.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/data/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/device/Audio.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/device/Audio.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Browser = __webpack_require__(/*! ./Browser */ \"./node_modules/phaser/src/device/Browser.js\");\r\n\r\n/**\r\n * Determines the audio playback capabilities of the device running this Phaser Game instance.\r\n * These values are read-only and populated during the boot sequence of the game.\r\n * They are then referenced by internal game systems and are available for you to access\r\n * via `this.sys.game.device.audio` from within any Scene.\r\n * \r\n * @typedef {object} Phaser.Device.Audio\r\n * @since 3.0.0\r\n * \r\n * @property {boolean} audioData - Can this device play HTML Audio tags?\r\n * @property {boolean} dolby - Can this device play EC-3 Dolby Digital Plus files?\r\n * @property {boolean} m4a - Can this device can play m4a files.\r\n * @property {boolean} mp3 - Can this device play mp3 files?\r\n * @property {boolean} ogg - Can this device play ogg files?\r\n * @property {boolean} opus - Can this device play opus files?\r\n * @property {boolean} wav - Can this device play wav files?\r\n * @property {boolean} webAudio - Does this device have the Web Audio API?\r\n * @property {boolean} webm - Can this device play webm files?\r\n */\r\nvar Audio = {\r\n\r\n audioData: false,\r\n dolby: false,\r\n m4a: false,\r\n mp3: false,\r\n ogg: false,\r\n opus: false,\r\n wav: false,\r\n webAudio: false,\r\n webm: false\r\n\r\n};\r\n\r\nfunction init ()\r\n{\r\n Audio.audioData = !!(window['Audio']);\r\n\r\n Audio.webAudio = !!(window['AudioContext'] || window['webkitAudioContext']);\r\n\r\n var audioElement = document.createElement('audio');\r\n\r\n var result = !!audioElement.canPlayType;\r\n\r\n try\r\n {\r\n if (result)\r\n {\r\n if (audioElement.canPlayType('audio/ogg; codecs=\"vorbis\"').replace(/^no$/, ''))\r\n {\r\n Audio.ogg = true;\r\n }\r\n\r\n if (audioElement.canPlayType('audio/ogg; codecs=\"opus\"').replace(/^no$/, '') || audioElement.canPlayType('audio/opus;').replace(/^no$/, ''))\r\n {\r\n Audio.opus = true;\r\n }\r\n\r\n if (audioElement.canPlayType('audio/mpeg;').replace(/^no$/, ''))\r\n {\r\n Audio.mp3 = true;\r\n }\r\n\r\n // Mimetypes accepted:\r\n // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements\r\n // bit.ly/iphoneoscodecs\r\n if (audioElement.canPlayType('audio/wav; codecs=\"1\"').replace(/^no$/, ''))\r\n {\r\n Audio.wav = true;\r\n }\r\n\r\n if (audioElement.canPlayType('audio/x-m4a;') || audioElement.canPlayType('audio/aac;').replace(/^no$/, ''))\r\n {\r\n Audio.m4a = true;\r\n }\r\n\r\n if (audioElement.canPlayType('audio/webm; codecs=\"vorbis\"').replace(/^no$/, ''))\r\n {\r\n Audio.webm = true;\r\n }\r\n\r\n if (audioElement.canPlayType('audio/mp4;codecs=\"ec-3\"') !== '')\r\n {\r\n if (Browser.edge)\r\n {\r\n Audio.dolby = true;\r\n }\r\n else if (Browser.safari && Browser.safariVersion >= 9)\r\n {\r\n if ((/Mac OS X (\\d+)_(\\d+)/).test(navigator.userAgent))\r\n {\r\n var major = parseInt(RegExp.$1, 10);\r\n var minor = parseInt(RegExp.$2, 10);\r\n\r\n if ((major === 10 && minor >= 11) || major > 10)\r\n {\r\n Audio.dolby = true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n catch (e)\r\n {\r\n // Nothing to do here\r\n }\r\n\r\n return Audio;\r\n}\r\n\r\nmodule.exports = init();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/device/Audio.js?"); /***/ }), /***/ "./node_modules/phaser/src/device/Browser.js": /*!***************************************************!*\ !*** ./node_modules/phaser/src/device/Browser.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar OS = __webpack_require__(/*! ./OS */ \"./node_modules/phaser/src/device/OS.js\");\r\n\r\n/**\r\n * Determines the browser type and version running this Phaser Game instance.\r\n * These values are read-only and populated during the boot sequence of the game.\r\n * They are then referenced by internal game systems and are available for you to access\r\n * via `this.sys.game.device.browser` from within any Scene.\r\n * \r\n * @typedef {object} Phaser.Device.Browser\r\n * @since 3.0.0\r\n * \r\n * @property {boolean} chrome - Set to true if running in Chrome.\r\n * @property {boolean} edge - Set to true if running in Microsoft Edge browser.\r\n * @property {boolean} firefox - Set to true if running in Firefox.\r\n * @property {boolean} ie - Set to true if running in Internet Explorer 11 or less (not Edge).\r\n * @property {boolean} mobileSafari - Set to true if running in Mobile Safari.\r\n * @property {boolean} opera - Set to true if running in Opera.\r\n * @property {boolean} safari - Set to true if running in Safari.\r\n * @property {boolean} silk - Set to true if running in the Silk browser (as used on the Amazon Kindle)\r\n * @property {boolean} trident - Set to true if running a Trident version of Internet Explorer (IE11+)\r\n * @property {number} chromeVersion - If running in Chrome this will contain the major version number.\r\n * @property {number} firefoxVersion - If running in Firefox this will contain the major version number.\r\n * @property {number} ieVersion - If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Browser.trident and Browser.tridentVersion.\r\n * @property {number} safariVersion - If running in Safari this will contain the major version number.\r\n * @property {number} tridentVersion - If running in Internet Explorer 11 this will contain the major version number. See {@link http://msdn.microsoft.com/en-us/library/ie/ms537503(v=vs.85).aspx}\r\n */\r\nvar Browser = {\r\n\r\n chrome: false,\r\n chromeVersion: 0,\r\n edge: false,\r\n firefox: false,\r\n firefoxVersion: 0,\r\n ie: false,\r\n ieVersion: 0,\r\n mobileSafari: false,\r\n opera: false,\r\n safari: false,\r\n safariVersion: 0,\r\n silk: false,\r\n trident: false,\r\n tridentVersion: 0\r\n\r\n};\r\n\r\nfunction init ()\r\n{\r\n var ua = navigator.userAgent;\r\n\r\n if (/Edge\\/\\d+/.test(ua))\r\n {\r\n Browser.edge = true;\r\n }\r\n else if ((/Chrome\\/(\\d+)/).test(ua) && !OS.windowsPhone)\r\n {\r\n Browser.chrome = true;\r\n Browser.chromeVersion = parseInt(RegExp.$1, 10);\r\n }\r\n else if ((/Firefox\\D+(\\d+)/).test(ua))\r\n {\r\n Browser.firefox = true;\r\n Browser.firefoxVersion = parseInt(RegExp.$1, 10);\r\n }\r\n else if ((/AppleWebKit/).test(ua) && OS.iOS)\r\n {\r\n Browser.mobileSafari = true;\r\n }\r\n else if ((/MSIE (\\d+\\.\\d+);/).test(ua))\r\n {\r\n Browser.ie = true;\r\n Browser.ieVersion = parseInt(RegExp.$1, 10);\r\n }\r\n else if ((/Opera/).test(ua))\r\n {\r\n Browser.opera = true;\r\n }\r\n else if ((/Safari/).test(ua) && !OS.windowsPhone)\r\n {\r\n Browser.safari = true;\r\n }\r\n else if ((/Trident\\/(\\d+\\.\\d+)(.*)rv:(\\d+\\.\\d+)/).test(ua))\r\n {\r\n Browser.ie = true;\r\n Browser.trident = true;\r\n Browser.tridentVersion = parseInt(RegExp.$1, 10);\r\n Browser.ieVersion = parseInt(RegExp.$3, 10);\r\n }\r\n\r\n // Silk gets its own if clause because its ua also contains 'Safari'\r\n if ((/Silk/).test(ua))\r\n {\r\n Browser.silk = true;\r\n }\r\n\r\n return Browser;\r\n}\r\n\r\nmodule.exports = init();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/device/Browser.js?"); /***/ }), /***/ "./node_modules/phaser/src/device/CanvasFeatures.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/device/CanvasFeatures.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CanvasPool = __webpack_require__(/*! ../display/canvas/CanvasPool */ \"./node_modules/phaser/src/display/canvas/CanvasPool.js\");\r\n\r\n/**\r\n * Determines the canvas features of the browser running this Phaser Game instance.\r\n * These values are read-only and populated during the boot sequence of the game.\r\n * They are then referenced by internal game systems and are available for you to access\r\n * via `this.sys.game.device.canvasFeatures` from within any Scene.\r\n * \r\n * @typedef {object} Phaser.Device.CanvasFeatures\r\n * @since 3.0.0\r\n * \r\n * @property {boolean} supportInverseAlpha - Set to true if the browser supports inversed alpha.\r\n * @property {boolean} supportNewBlendModes - Set to true if the browser supports new canvas blend modes.\r\n */\r\nvar CanvasFeatures = {\r\n\r\n supportInverseAlpha: false,\r\n supportNewBlendModes: false\r\n\r\n};\r\n\r\nfunction checkBlendMode ()\r\n{\r\n var pngHead = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/';\r\n var pngEnd = 'AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==';\r\n\r\n var magenta = new Image();\r\n\r\n magenta.onload = function ()\r\n {\r\n var yellow = new Image();\r\n\r\n yellow.onload = function ()\r\n {\r\n var canvas = CanvasPool.create(yellow, 6, 1);\r\n var context = canvas.getContext('2d');\r\n\r\n context.globalCompositeOperation = 'multiply';\r\n\r\n context.drawImage(magenta, 0, 0);\r\n context.drawImage(yellow, 2, 0);\r\n\r\n if (!context.getImageData(2, 0, 1, 1))\r\n {\r\n return false;\r\n }\r\n\r\n var data = context.getImageData(2, 0, 1, 1).data;\r\n\r\n CanvasPool.remove(yellow);\r\n\r\n CanvasFeatures.supportNewBlendModes = (data[0] === 255 && data[1] === 0 && data[2] === 0);\r\n };\r\n\r\n yellow.src = pngHead + '/wCKxvRF' + pngEnd;\r\n };\r\n\r\n magenta.src = pngHead + 'AP804Oa6' + pngEnd;\r\n\r\n return false;\r\n}\r\n\r\nfunction checkInverseAlpha ()\r\n{\r\n var canvas = CanvasPool.create(this, 2, 1);\r\n var context = canvas.getContext('2d');\r\n\r\n context.fillStyle = 'rgba(10, 20, 30, 0.5)';\r\n\r\n // Draw a single pixel\r\n context.fillRect(0, 0, 1, 1);\r\n\r\n // Get the color values\r\n var s1 = context.getImageData(0, 0, 1, 1);\r\n\r\n if (s1 === null)\r\n {\r\n return false;\r\n }\r\n\r\n // Plot them to x2\r\n context.putImageData(s1, 1, 0);\r\n\r\n // Get those values\r\n var s2 = context.getImageData(1, 0, 1, 1);\r\n\r\n // Compare and return\r\n return (s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]);\r\n}\r\n\r\nfunction init ()\r\n{\r\n if (document !== undefined)\r\n {\r\n CanvasFeatures.supportNewBlendModes = checkBlendMode();\r\n CanvasFeatures.supportInverseAlpha = checkInverseAlpha();\r\n }\r\n\r\n return CanvasFeatures;\r\n}\r\n\r\nmodule.exports = init();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/device/CanvasFeatures.js?"); /***/ }), /***/ "./node_modules/phaser/src/device/Features.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/device/Features.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar OS = __webpack_require__(/*! ./OS */ \"./node_modules/phaser/src/device/OS.js\");\r\nvar Browser = __webpack_require__(/*! ./Browser */ \"./node_modules/phaser/src/device/Browser.js\");\r\nvar CanvasPool = __webpack_require__(/*! ../display/canvas/CanvasPool */ \"./node_modules/phaser/src/display/canvas/CanvasPool.js\");\r\n\r\n/**\r\n * Determines the features of the browser running this Phaser Game instance.\r\n * These values are read-only and populated during the boot sequence of the game.\r\n * They are then referenced by internal game systems and are available for you to access\r\n * via `this.sys.game.device.features` from within any Scene.\r\n * \r\n * @typedef {object} Phaser.Device.Features\r\n * @since 3.0.0\r\n * \r\n * @property {?boolean} canvasBitBltShift - True if canvas supports a 'copy' bitblt onto itself when the source and destination regions overlap.\r\n * @property {boolean} canvas - Is canvas available?\r\n * @property {boolean} file - Is file available?\r\n * @property {boolean} fileSystem - Is fileSystem available?\r\n * @property {boolean} getUserMedia - Does the device support the getUserMedia API?\r\n * @property {boolean} littleEndian - Is the device big or little endian? (only detected if the browser supports TypedArrays)\r\n * @property {boolean} localStorage - Is localStorage available?\r\n * @property {boolean} pointerLock - Is Pointer Lock available?\r\n * @property {boolean} support32bit - Does the device context support 32bit pixel manipulation using array buffer views?\r\n * @property {boolean} vibration - Does the device support the Vibration API?\r\n * @property {boolean} webGL - Is webGL available?\r\n * @property {boolean} worker - Is worker available?\r\n */\r\nvar Features = {\r\n\r\n canvas: false,\r\n canvasBitBltShift: null,\r\n file: false,\r\n fileSystem: false,\r\n getUserMedia: true,\r\n littleEndian: false,\r\n localStorage: false,\r\n pointerLock: false,\r\n support32bit: false,\r\n vibration: false,\r\n webGL: false,\r\n worker: false\r\n\r\n};\r\n\r\n// Check Little or Big Endian system.\r\n// @author Matt DesLauriers (@mattdesl)\r\nfunction checkIsLittleEndian ()\r\n{\r\n var a = new ArrayBuffer(4);\r\n var b = new Uint8Array(a);\r\n var c = new Uint32Array(a);\r\n\r\n b[0] = 0xa1;\r\n b[1] = 0xb2;\r\n b[2] = 0xc3;\r\n b[3] = 0xd4;\r\n\r\n if (c[0] === 0xd4c3b2a1)\r\n {\r\n return true;\r\n }\r\n\r\n if (c[0] === 0xa1b2c3d4)\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n // Could not determine endianness\r\n return null;\r\n }\r\n}\r\n\r\nfunction init ()\r\n{\r\n Features.canvas = !!window['CanvasRenderingContext2D'];\r\n\r\n try\r\n {\r\n Features.localStorage = !!localStorage.getItem;\r\n }\r\n catch (error)\r\n {\r\n Features.localStorage = false;\r\n }\r\n\r\n Features.file = !!window['File'] && !!window['FileReader'] && !!window['FileList'] && !!window['Blob'];\r\n Features.fileSystem = !!window['requestFileSystem'];\r\n\r\n var isUint8 = false;\r\n\r\n var testWebGL = function ()\r\n {\r\n if (window['WebGLRenderingContext'])\r\n {\r\n try\r\n {\r\n var canvas = CanvasPool.createWebGL(this);\r\n\r\n var ctx = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');\r\n\r\n var canvas2D = CanvasPool.create2D(this);\r\n\r\n var ctx2D = canvas2D.getContext('2d');\r\n\r\n // Can't be done on a webgl context\r\n var image = ctx2D.createImageData(1, 1);\r\n\r\n // Test to see if ImageData uses CanvasPixelArray or Uint8ClampedArray.\r\n // @author Matt DesLauriers (@mattdesl)\r\n isUint8 = image.data instanceof Uint8ClampedArray;\r\n\r\n CanvasPool.remove(canvas);\r\n CanvasPool.remove(canvas2D);\r\n\r\n return !!ctx;\r\n }\r\n catch (e)\r\n {\r\n return false;\r\n }\r\n }\r\n\r\n return false;\r\n };\r\n\r\n Features.webGL = testWebGL();\r\n\r\n Features.worker = !!window['Worker'];\r\n\r\n Features.pointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document;\r\n\r\n navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia;\r\n\r\n window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;\r\n\r\n Features.getUserMedia = Features.getUserMedia && !!navigator.getUserMedia && !!window.URL;\r\n\r\n // Older versions of firefox (< 21) apparently claim support but user media does not actually work\r\n if (Browser.firefox && Browser.firefoxVersion < 21)\r\n {\r\n Features.getUserMedia = false;\r\n }\r\n\r\n // Excludes iOS versions as they generally wrap UIWebView (eg. Safari WebKit) and it\r\n // is safer to not try and use the fast copy-over method.\r\n if (!OS.iOS && (Browser.ie || Browser.firefox || Browser.chrome))\r\n {\r\n Features.canvasBitBltShift = true;\r\n }\r\n\r\n // Known not to work\r\n if (Browser.safari || Browser.mobileSafari)\r\n {\r\n Features.canvasBitBltShift = false;\r\n }\r\n\r\n navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate;\r\n\r\n if (navigator.vibrate)\r\n {\r\n Features.vibration = true;\r\n }\r\n\r\n if (typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint32Array !== 'undefined')\r\n {\r\n Features.littleEndian = checkIsLittleEndian();\r\n }\r\n\r\n Features.support32bit = (\r\n typeof ArrayBuffer !== 'undefined' &&\r\n typeof Uint8ClampedArray !== 'undefined' &&\r\n typeof Int32Array !== 'undefined' &&\r\n Features.littleEndian !== null &&\r\n isUint8\r\n );\r\n\r\n return Features;\r\n}\r\n\r\nmodule.exports = init();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/device/Features.js?"); /***/ }), /***/ "./node_modules/phaser/src/device/Fullscreen.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/device/Fullscreen.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Determines the full screen support of the browser running this Phaser Game instance.\r\n * These values are read-only and populated during the boot sequence of the game.\r\n * They are then referenced by internal game systems and are available for you to access\r\n * via `this.sys.game.device.fullscreen` from within any Scene.\r\n * \r\n * @typedef {object} Phaser.Device.Fullscreen\r\n * @since 3.0.0\r\n * \r\n * @property {boolean} available - Does the browser support the Full Screen API?\r\n * @property {boolean} keyboard - Does the browser support access to the Keyboard during Full Screen mode?\r\n * @property {string} cancel - If the browser supports the Full Screen API this holds the call you need to use to cancel it.\r\n * @property {string} request - If the browser supports the Full Screen API this holds the call you need to use to activate it.\r\n */\r\nvar Fullscreen = {\r\n\r\n available: false,\r\n cancel: '',\r\n keyboard: false,\r\n request: ''\r\n\r\n};\r\n\r\n/**\r\n* Checks for support of the Full Screen API.\r\n* \r\n* @ignore\r\n*/\r\nfunction init ()\r\n{\r\n var i;\r\n\r\n var suffix1 = 'Fullscreen';\r\n var suffix2 = 'FullScreen';\r\n\r\n var fs = [\r\n 'request' + suffix1,\r\n 'request' + suffix2,\r\n 'webkitRequest' + suffix1,\r\n 'webkitRequest' + suffix2,\r\n 'msRequest' + suffix1,\r\n 'msRequest' + suffix2,\r\n 'mozRequest' + suffix2,\r\n 'mozRequest' + suffix1\r\n ];\r\n\r\n for (i = 0; i < fs.length; i++)\r\n {\r\n if (document.documentElement[fs[i]])\r\n {\r\n Fullscreen.available = true;\r\n Fullscreen.request = fs[i];\r\n break;\r\n }\r\n }\r\n\r\n var cfs = [\r\n 'cancel' + suffix2,\r\n 'exit' + suffix1,\r\n 'webkitCancel' + suffix2,\r\n 'webkitExit' + suffix1,\r\n 'msCancel' + suffix2,\r\n 'msExit' + suffix1,\r\n 'mozCancel' + suffix2,\r\n 'mozExit' + suffix1\r\n ];\r\n\r\n if (Fullscreen.available)\r\n {\r\n for (i = 0; i < cfs.length; i++)\r\n {\r\n if (document[cfs[i]])\r\n {\r\n Fullscreen.cancel = cfs[i];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // Keyboard Input?\r\n // Safari 5.1 says it supports fullscreen keyboard, but is lying.\r\n if (window['Element'] && Element['ALLOW_KEYBOARD_INPUT'] && !(/ Version\\/5\\.1(?:\\.\\d+)? Safari\\//).test(navigator.userAgent))\r\n {\r\n Fullscreen.keyboard = true;\r\n }\r\n\r\n Object.defineProperty(Fullscreen, 'active', { get: function () { return !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement); } });\r\n\r\n return Fullscreen;\r\n}\r\n\r\nmodule.exports = init();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/device/Fullscreen.js?"); /***/ }), /***/ "./node_modules/phaser/src/device/Input.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/device/Input.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Browser = __webpack_require__(/*! ./Browser */ \"./node_modules/phaser/src/device/Browser.js\");\r\n\r\n/**\r\n * Determines the input support of the browser running this Phaser Game instance.\r\n * These values are read-only and populated during the boot sequence of the game.\r\n * They are then referenced by internal game systems and are available for you to access\r\n * via `this.sys.game.device.input` from within any Scene.\r\n * \r\n * @typedef {object} Phaser.Device.Input\r\n * @since 3.0.0\r\n * \r\n * @property {?string} wheelType - The newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll'\r\n * @property {boolean} gamepads - Is navigator.getGamepads available?\r\n * @property {boolean} mspointer - Is mspointer available?\r\n * @property {boolean} touch - Is touch available?\r\n */\r\nvar Input = {\r\n\r\n gamepads: false,\r\n mspointer: false,\r\n touch: false,\r\n wheelEvent: null\r\n \r\n};\r\n\r\nfunction init ()\r\n{\r\n if ('ontouchstart' in document.documentElement || (navigator.maxTouchPoints && navigator.maxTouchPoints >= 1))\r\n {\r\n Input.touch = true;\r\n }\r\n\r\n if (navigator.msPointerEnabled || navigator.pointerEnabled)\r\n {\r\n Input.mspointer = true;\r\n }\r\n\r\n if (navigator.getGamepads)\r\n {\r\n Input.gamepads = true;\r\n }\r\n\r\n // See https://developer.mozilla.org/en-US/docs/Web/Events/wheel\r\n if ('onwheel' in window || (Browser.ie && 'WheelEvent' in window))\r\n {\r\n // DOM3 Wheel Event: FF 17+, IE 9+, Chrome 31+, Safari 7+\r\n Input.wheelEvent = 'wheel';\r\n }\r\n else if ('onmousewheel' in window)\r\n {\r\n // Non-FF legacy: IE 6-9, Chrome 1-31, Safari 5-7.\r\n Input.wheelEvent = 'mousewheel';\r\n }\r\n else if (Browser.firefox && 'MouseScrollEvent' in window)\r\n {\r\n // FF prior to 17. This should probably be scrubbed.\r\n Input.wheelEvent = 'DOMMouseScroll';\r\n }\r\n\r\n return Input;\r\n}\r\n\r\nmodule.exports = init();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/device/Input.js?"); /***/ }), /***/ "./node_modules/phaser/src/device/OS.js": /*!**********************************************!*\ !*** ./node_modules/phaser/src/device/OS.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(process) {/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Determines the operating system of the device running this Phaser Game instance.\r\n * These values are read-only and populated during the boot sequence of the game.\r\n * They are then referenced by internal game systems and are available for you to access\r\n * via `this.sys.game.device.os` from within any Scene.\r\n *\r\n * @typedef {object} Phaser.Device.OS\r\n * @since 3.0.0\r\n *\r\n * @property {boolean} android - Is running on android?\r\n * @property {boolean} chromeOS - Is running on chromeOS?\r\n * @property {boolean} cordova - Is the game running under Apache Cordova?\r\n * @property {boolean} crosswalk - Is the game running under the Intel Crosswalk XDK?\r\n * @property {boolean} desktop - Is running on a desktop?\r\n * @property {boolean} ejecta - Is the game running under Ejecta?\r\n * @property {boolean} electron - Is the game running under GitHub Electron?\r\n * @property {boolean} iOS - Is running on iOS?\r\n * @property {boolean} iPad - Is running on iPad?\r\n * @property {boolean} iPhone - Is running on iPhone?\r\n * @property {boolean} kindle - Is running on an Amazon Kindle?\r\n * @property {boolean} linux - Is running on linux?\r\n * @property {boolean} macOS - Is running on macOS?\r\n * @property {boolean} node - Is the game running under Node.js?\r\n * @property {boolean} nodeWebkit - Is the game running under Node-Webkit?\r\n * @property {boolean} webApp - Set to true if running as a WebApp, i.e. within a WebView\r\n * @property {boolean} windows - Is running on windows?\r\n * @property {boolean} windowsPhone - Is running on a Windows Phone?\r\n * @property {number} iOSVersion - If running in iOS this will contain the major version number.\r\n * @property {number} pixelRatio - PixelRatio of the host device?\r\n */\r\nvar OS = {\r\n\r\n android: false,\r\n chromeOS: false,\r\n cordova: false,\r\n crosswalk: false,\r\n desktop: false,\r\n ejecta: false,\r\n electron: false,\r\n iOS: false,\r\n iOSVersion: 0,\r\n iPad: false,\r\n iPhone: false,\r\n kindle: false,\r\n linux: false,\r\n macOS: false,\r\n node: false,\r\n nodeWebkit: false,\r\n pixelRatio: 1,\r\n webApp: false,\r\n windows: false,\r\n windowsPhone: false\r\n\r\n};\r\n\r\nfunction init ()\r\n{\r\n var ua = navigator.userAgent;\r\n\r\n if (/Windows/.test(ua))\r\n {\r\n OS.windows = true;\r\n }\r\n else if (/Mac OS/.test(ua) && !(/like Mac OS/.test(ua)))\r\n {\r\n OS.macOS = true;\r\n }\r\n else if (/Android/.test(ua))\r\n {\r\n OS.android = true;\r\n }\r\n else if (/Linux/.test(ua))\r\n {\r\n OS.linux = true;\r\n }\r\n else if (/iP[ao]d|iPhone/i.test(ua))\r\n {\r\n OS.iOS = true;\r\n\r\n (navigator.appVersion).match(/OS (\\d+)/);\r\n\r\n OS.iOSVersion = parseInt(RegExp.$1, 10);\r\n\r\n OS.iPhone = ua.toLowerCase().indexOf('iphone') !== -1;\r\n OS.iPad = ua.toLowerCase().indexOf('ipad') !== -1;\r\n }\r\n else if (/Kindle/.test(ua) || (/\\bKF[A-Z][A-Z]+/).test(ua) || (/Silk.*Mobile Safari/).test(ua))\r\n {\r\n OS.kindle = true;\r\n\r\n // This will NOT detect early generations of Kindle Fire, I think there is no reliable way...\r\n // E.g. \"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true\"\r\n }\r\n else if (/CrOS/.test(ua))\r\n {\r\n OS.chromeOS = true;\r\n }\r\n\r\n if (/Windows Phone/i.test(ua) || (/IEMobile/i).test(ua))\r\n {\r\n OS.android = false;\r\n OS.iOS = false;\r\n OS.macOS = false;\r\n OS.windows = true;\r\n OS.windowsPhone = true;\r\n }\r\n\r\n var silk = (/Silk/).test(ua);\r\n\r\n if (OS.windows || OS.macOS || (OS.linux && !silk) || OS.chromeOS)\r\n {\r\n OS.desktop = true;\r\n }\r\n\r\n // Windows Phone / Table reset\r\n if (OS.windowsPhone || ((/Windows NT/i.test(ua)) && (/Touch/i.test(ua))))\r\n {\r\n OS.desktop = false;\r\n }\r\n\r\n // WebApp mode in iOS\r\n if (navigator.standalone)\r\n {\r\n OS.webApp = true;\r\n }\r\n\r\n if (window.cordova !== undefined)\r\n {\r\n OS.cordova = true;\r\n }\r\n\r\n if (typeof process !== 'undefined' && process.versions && process.versions.node)\r\n {\r\n OS.node = true;\r\n }\r\n\r\n if (OS.node && typeof process.versions === 'object')\r\n {\r\n OS.nodeWebkit = !!process.versions['node-webkit'];\r\n\r\n OS.electron = !!process.versions.electron;\r\n }\r\n\r\n if (window.ejecta !== undefined)\r\n {\r\n OS.ejecta = true;\r\n }\r\n\r\n if ((/Crosswalk/).test(ua))\r\n {\r\n OS.crosswalk = true;\r\n }\r\n\r\n OS.pixelRatio = window['devicePixelRatio'] || 1;\r\n\r\n return OS;\r\n}\r\n\r\nmodule.exports = init();\r\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/phaser/src/device/OS.js?"); /***/ }), /***/ "./node_modules/phaser/src/device/Video.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/device/Video.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Determines the video support of the browser running this Phaser Game instance.\r\n * These values are read-only and populated during the boot sequence of the game.\r\n * They are then referenced by internal game systems and are available for you to access\r\n * via `this.sys.game.device.video` from within any Scene.\r\n * \r\n * In Phaser 3.20 the properties were renamed to drop the 'Video' suffix.\r\n * \r\n * @typedef {object} Phaser.Device.Video\r\n * @since 3.0.0\r\n * \r\n * @property {boolean} h264 - Can this device play h264 mp4 video files?\r\n * @property {boolean} hls - Can this device play hls video files?\r\n * @property {boolean} mp4 - Can this device play h264 mp4 video files?\r\n * @property {boolean} ogg - Can this device play ogg video files?\r\n * @property {boolean} vp9 - Can this device play vp9 video files?\r\n * @property {boolean} webm - Can this device play webm video files?\r\n */\r\nvar Video = {\r\n\r\n h264: false,\r\n hls: false,\r\n mp4: false,\r\n ogg: false,\r\n vp9: false,\r\n webm: false\r\n\r\n};\r\n\r\nfunction init ()\r\n{\r\n var videoElement = document.createElement('video');\r\n var result = !!videoElement.canPlayType;\r\n\r\n try\r\n {\r\n if (result)\r\n {\r\n if (videoElement.canPlayType('video/ogg; codecs=\"theora\"').replace(/^no$/, ''))\r\n {\r\n Video.ogg = true;\r\n }\r\n\r\n if (videoElement.canPlayType('video/mp4; codecs=\"avc1.42E01E\"').replace(/^no$/, ''))\r\n {\r\n // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546\r\n Video.h264 = true;\r\n Video.mp4 = true;\r\n }\r\n\r\n if (videoElement.canPlayType('video/webm; codecs=\"vp8, vorbis\"').replace(/^no$/, ''))\r\n {\r\n Video.webm = true;\r\n }\r\n\r\n if (videoElement.canPlayType('video/webm; codecs=\"vp9\"').replace(/^no$/, ''))\r\n {\r\n Video.vp9 = true;\r\n }\r\n\r\n if (videoElement.canPlayType('application/x-mpegURL; codecs=\"avc1.42E01E\"').replace(/^no$/, ''))\r\n {\r\n Video.hls = true;\r\n }\r\n }\r\n }\r\n catch (e)\r\n {\r\n // Nothing to do\r\n }\r\n\r\n return Video;\r\n}\r\n\r\nmodule.exports = init();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/device/Video.js?"); /***/ }), /***/ "./node_modules/phaser/src/device/index.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/device/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// This singleton is instantiated as soon as Phaser loads,\r\n// before a Phaser.Game instance has even been created.\r\n// Which means all instances of Phaser Games can share it,\r\n// without having to re-poll the device all over again\r\n\r\n/**\r\n * @namespace Phaser.Device\r\n * @since 3.0.0\r\n */\r\n\r\n/**\r\n * @typedef {object} Phaser.DeviceConf\r\n *\r\n * @property {Phaser.Device.OS} os - The OS Device functions.\r\n * @property {Phaser.Device.Browser} browser - The Browser Device functions.\r\n * @property {Phaser.Device.Features} features - The Features Device functions.\r\n * @property {Phaser.Device.Input} input - The Input Device functions.\r\n * @property {Phaser.Device.Audio} audio - The Audio Device functions.\r\n * @property {Phaser.Device.Video} video - The Video Device functions.\r\n * @property {Phaser.Device.Fullscreen} fullscreen - The Fullscreen Device functions.\r\n * @property {Phaser.Device.CanvasFeatures} canvasFeatures - The Canvas Device functions.\r\n */\r\n\r\nmodule.exports = {\r\n\r\n os: __webpack_require__(/*! ./OS */ \"./node_modules/phaser/src/device/OS.js\"),\r\n browser: __webpack_require__(/*! ./Browser */ \"./node_modules/phaser/src/device/Browser.js\"),\r\n features: __webpack_require__(/*! ./Features */ \"./node_modules/phaser/src/device/Features.js\"),\r\n input: __webpack_require__(/*! ./Input */ \"./node_modules/phaser/src/device/Input.js\"),\r\n audio: __webpack_require__(/*! ./Audio */ \"./node_modules/phaser/src/device/Audio.js\"),\r\n video: __webpack_require__(/*! ./Video */ \"./node_modules/phaser/src/device/Video.js\"),\r\n fullscreen: __webpack_require__(/*! ./Fullscreen */ \"./node_modules/phaser/src/device/Fullscreen.js\"),\r\n canvasFeatures: __webpack_require__(/*! ./CanvasFeatures */ \"./node_modules/phaser/src/device/CanvasFeatures.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/device/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/const.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/display/align/const.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ALIGN_CONST = {\r\n\r\n /**\r\n * A constant representing a top-left alignment or position.\r\n * @constant\r\n * @name Phaser.Display.Align.TOP_LEFT\r\n * @since 3.0.0\r\n * @type {integer}\r\n */\r\n TOP_LEFT: 0,\r\n\r\n /**\r\n * A constant representing a top-center alignment or position.\r\n * @constant\r\n * @name Phaser.Display.Align.TOP_CENTER\r\n * @since 3.0.0\r\n * @type {integer}\r\n */\r\n TOP_CENTER: 1,\r\n\r\n /**\r\n * A constant representing a top-right alignment or position.\r\n * @constant\r\n * @name Phaser.Display.Align.TOP_RIGHT\r\n * @since 3.0.0\r\n * @type {integer}\r\n */\r\n TOP_RIGHT: 2,\r\n\r\n /**\r\n * A constant representing a left-top alignment or position.\r\n * @constant\r\n * @name Phaser.Display.Align.LEFT_TOP\r\n * @since 3.0.0\r\n * @type {integer}\r\n */\r\n LEFT_TOP: 3,\r\n\r\n /**\r\n * A constant representing a left-center alignment or position.\r\n * @constant\r\n * @name Phaser.Display.Align.LEFT_CENTER\r\n * @since 3.0.0\r\n * @type {integer}\r\n */\r\n LEFT_CENTER: 4,\r\n\r\n /**\r\n * A constant representing a left-bottom alignment or position.\r\n * @constant\r\n * @name Phaser.Display.Align.LEFT_BOTTOM\r\n * @since 3.0.0\r\n * @type {integer}\r\n */\r\n LEFT_BOTTOM: 5,\r\n\r\n /**\r\n * A constant representing a center alignment or position.\r\n * @constant\r\n * @name Phaser.Display.Align.CENTER\r\n * @since 3.0.0\r\n * @type {integer}\r\n */\r\n CENTER: 6,\r\n\r\n /**\r\n * A constant representing a right-top alignment or position.\r\n * @constant\r\n * @name Phaser.Display.Align.RIGHT_TOP\r\n * @since 3.0.0\r\n * @type {integer}\r\n */\r\n RIGHT_TOP: 7,\r\n\r\n /**\r\n * A constant representing a right-center alignment or position.\r\n * @constant\r\n * @name Phaser.Display.Align.RIGHT_CENTER\r\n * @since 3.0.0\r\n * @type {integer}\r\n */\r\n RIGHT_CENTER: 8,\r\n\r\n /**\r\n * A constant representing a right-bottom alignment or position.\r\n * @constant\r\n * @name Phaser.Display.Align.RIGHT_BOTTOM\r\n * @since 3.0.0\r\n * @type {integer}\r\n */\r\n RIGHT_BOTTOM: 9,\r\n\r\n /**\r\n * A constant representing a bottom-left alignment or position.\r\n * @constant\r\n * @name Phaser.Display.Align.BOTTOM_LEFT\r\n * @since 3.0.0\r\n * @type {integer}\r\n */\r\n BOTTOM_LEFT: 10,\r\n\r\n /**\r\n * A constant representing a bottom-center alignment or position.\r\n * @constant\r\n * @name Phaser.Display.Align.BOTTOM_CENTER\r\n * @since 3.0.0\r\n * @type {integer}\r\n */\r\n BOTTOM_CENTER: 11,\r\n\r\n /**\r\n * A constant representing a bottom-right alignment or position.\r\n * @constant\r\n * @name Phaser.Display.Align.BOTTOM_RIGHT\r\n * @since 3.0.0\r\n * @type {integer}\r\n */\r\n BOTTOM_RIGHT: 12\r\n\r\n};\r\n\r\nmodule.exports = ALIGN_CONST;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/const.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/in/BottomCenter.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/display/align/in/BottomCenter.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetBottom = __webpack_require__(/*! ../../bounds/GetBottom */ \"./node_modules/phaser/src/display/bounds/GetBottom.js\");\r\nvar GetCenterX = __webpack_require__(/*! ../../bounds/GetCenterX */ \"./node_modules/phaser/src/display/bounds/GetCenterX.js\");\r\nvar SetBottom = __webpack_require__(/*! ../../bounds/SetBottom */ \"./node_modules/phaser/src/display/bounds/SetBottom.js\");\r\nvar SetCenterX = __webpack_require__(/*! ../../bounds/SetCenterX */ \"./node_modules/phaser/src/display/bounds/SetCenterX.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned in the bottom center of the other.\r\n *\r\n * @function Phaser.Display.Align.In.BottomCenter\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar BottomCenter = function (gameObject, alignIn, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetCenterX(gameObject, GetCenterX(alignIn) + offsetX);\r\n SetBottom(gameObject, GetBottom(alignIn) + offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = BottomCenter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/in/BottomCenter.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/in/BottomLeft.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/display/align/in/BottomLeft.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetBottom = __webpack_require__(/*! ../../bounds/GetBottom */ \"./node_modules/phaser/src/display/bounds/GetBottom.js\");\r\nvar GetLeft = __webpack_require__(/*! ../../bounds/GetLeft */ \"./node_modules/phaser/src/display/bounds/GetLeft.js\");\r\nvar SetBottom = __webpack_require__(/*! ../../bounds/SetBottom */ \"./node_modules/phaser/src/display/bounds/SetBottom.js\");\r\nvar SetLeft = __webpack_require__(/*! ../../bounds/SetLeft */ \"./node_modules/phaser/src/display/bounds/SetLeft.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned in the bottom left of the other.\r\n *\r\n * @function Phaser.Display.Align.In.BottomLeft\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar BottomLeft = function (gameObject, alignIn, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetLeft(gameObject, GetLeft(alignIn) - offsetX);\r\n SetBottom(gameObject, GetBottom(alignIn) + offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = BottomLeft;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/in/BottomLeft.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/in/BottomRight.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/display/align/in/BottomRight.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetBottom = __webpack_require__(/*! ../../bounds/GetBottom */ \"./node_modules/phaser/src/display/bounds/GetBottom.js\");\r\nvar GetRight = __webpack_require__(/*! ../../bounds/GetRight */ \"./node_modules/phaser/src/display/bounds/GetRight.js\");\r\nvar SetBottom = __webpack_require__(/*! ../../bounds/SetBottom */ \"./node_modules/phaser/src/display/bounds/SetBottom.js\");\r\nvar SetRight = __webpack_require__(/*! ../../bounds/SetRight */ \"./node_modules/phaser/src/display/bounds/SetRight.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned in the bottom right of the other.\r\n *\r\n * @function Phaser.Display.Align.In.BottomRight\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar BottomRight = function (gameObject, alignIn, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetRight(gameObject, GetRight(alignIn) + offsetX);\r\n SetBottom(gameObject, GetBottom(alignIn) + offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = BottomRight;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/in/BottomRight.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/in/Center.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/display/align/in/Center.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CenterOn = __webpack_require__(/*! ../../bounds/CenterOn */ \"./node_modules/phaser/src/display/bounds/CenterOn.js\");\r\nvar GetCenterX = __webpack_require__(/*! ../../bounds/GetCenterX */ \"./node_modules/phaser/src/display/bounds/GetCenterX.js\");\r\nvar GetCenterY = __webpack_require__(/*! ../../bounds/GetCenterY */ \"./node_modules/phaser/src/display/bounds/GetCenterY.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned in the center of the other.\r\n *\r\n * @function Phaser.Display.Align.In.Center\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar Center = function (gameObject, alignIn, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n CenterOn(gameObject, GetCenterX(alignIn) + offsetX, GetCenterY(alignIn) + offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = Center;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/in/Center.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/in/LeftCenter.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/display/align/in/LeftCenter.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetCenterY = __webpack_require__(/*! ../../bounds/GetCenterY */ \"./node_modules/phaser/src/display/bounds/GetCenterY.js\");\r\nvar GetLeft = __webpack_require__(/*! ../../bounds/GetLeft */ \"./node_modules/phaser/src/display/bounds/GetLeft.js\");\r\nvar SetCenterY = __webpack_require__(/*! ../../bounds/SetCenterY */ \"./node_modules/phaser/src/display/bounds/SetCenterY.js\");\r\nvar SetLeft = __webpack_require__(/*! ../../bounds/SetLeft */ \"./node_modules/phaser/src/display/bounds/SetLeft.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned in the left center of the other.\r\n *\r\n * @function Phaser.Display.Align.In.LeftCenter\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar LeftCenter = function (gameObject, alignIn, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetLeft(gameObject, GetLeft(alignIn) - offsetX);\r\n SetCenterY(gameObject, GetCenterY(alignIn) + offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = LeftCenter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/in/LeftCenter.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/in/QuickSet.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/align/in/QuickSet.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ALIGN_CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/display/align/const.js\");\r\n\r\nvar AlignInMap = [];\r\n\r\nAlignInMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(/*! ./BottomCenter */ \"./node_modules/phaser/src/display/align/in/BottomCenter.js\");\r\nAlignInMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(/*! ./BottomLeft */ \"./node_modules/phaser/src/display/align/in/BottomLeft.js\");\r\nAlignInMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(/*! ./BottomRight */ \"./node_modules/phaser/src/display/align/in/BottomRight.js\");\r\nAlignInMap[ALIGN_CONST.CENTER] = __webpack_require__(/*! ./Center */ \"./node_modules/phaser/src/display/align/in/Center.js\");\r\nAlignInMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(/*! ./LeftCenter */ \"./node_modules/phaser/src/display/align/in/LeftCenter.js\");\r\nAlignInMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(/*! ./RightCenter */ \"./node_modules/phaser/src/display/align/in/RightCenter.js\");\r\nAlignInMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(/*! ./TopCenter */ \"./node_modules/phaser/src/display/align/in/TopCenter.js\");\r\nAlignInMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(/*! ./TopLeft */ \"./node_modules/phaser/src/display/align/in/TopLeft.js\");\r\nAlignInMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(/*! ./TopRight */ \"./node_modules/phaser/src/display/align/in/TopRight.js\");\r\nAlignInMap[ALIGN_CONST.LEFT_BOTTOM] = AlignInMap[ALIGN_CONST.BOTTOM_LEFT];\r\nAlignInMap[ALIGN_CONST.LEFT_TOP] = AlignInMap[ALIGN_CONST.TOP_LEFT];\r\nAlignInMap[ALIGN_CONST.RIGHT_BOTTOM] = AlignInMap[ALIGN_CONST.BOTTOM_RIGHT];\r\nAlignInMap[ALIGN_CONST.RIGHT_TOP] = AlignInMap[ALIGN_CONST.TOP_RIGHT];\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned relative to the other.\r\n * The alignment used is based on the `position` argument, which is an `ALIGN_CONST` value, such as `LEFT_CENTER` or `TOP_RIGHT`.\r\n *\r\n * @function Phaser.Display.Align.In.QuickSet\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [child,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.\r\n * @param {integer} position - The position to align the Game Object with. This is an align constant, such as `ALIGN_CONST.LEFT_CENTER`.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar QuickSet = function (child, alignIn, position, offsetX, offsetY)\r\n{\r\n return AlignInMap[position](child, alignIn, offsetX, offsetY);\r\n};\r\n\r\nmodule.exports = QuickSet;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/in/QuickSet.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/in/RightCenter.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/display/align/in/RightCenter.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetCenterY = __webpack_require__(/*! ../../bounds/GetCenterY */ \"./node_modules/phaser/src/display/bounds/GetCenterY.js\");\r\nvar GetRight = __webpack_require__(/*! ../../bounds/GetRight */ \"./node_modules/phaser/src/display/bounds/GetRight.js\");\r\nvar SetCenterY = __webpack_require__(/*! ../../bounds/SetCenterY */ \"./node_modules/phaser/src/display/bounds/SetCenterY.js\");\r\nvar SetRight = __webpack_require__(/*! ../../bounds/SetRight */ \"./node_modules/phaser/src/display/bounds/SetRight.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned in the right center of the other.\r\n *\r\n * @function Phaser.Display.Align.In.RightCenter\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar RightCenter = function (gameObject, alignIn, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetRight(gameObject, GetRight(alignIn) + offsetX);\r\n SetCenterY(gameObject, GetCenterY(alignIn) + offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = RightCenter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/in/RightCenter.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/in/TopCenter.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/display/align/in/TopCenter.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetCenterX = __webpack_require__(/*! ../../bounds/GetCenterX */ \"./node_modules/phaser/src/display/bounds/GetCenterX.js\");\r\nvar GetTop = __webpack_require__(/*! ../../bounds/GetTop */ \"./node_modules/phaser/src/display/bounds/GetTop.js\");\r\nvar SetCenterX = __webpack_require__(/*! ../../bounds/SetCenterX */ \"./node_modules/phaser/src/display/bounds/SetCenterX.js\");\r\nvar SetTop = __webpack_require__(/*! ../../bounds/SetTop */ \"./node_modules/phaser/src/display/bounds/SetTop.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned in the top center of the other.\r\n *\r\n * @function Phaser.Display.Align.In.TopCenter\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar TopCenter = function (gameObject, alignIn, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetCenterX(gameObject, GetCenterX(alignIn) + offsetX);\r\n SetTop(gameObject, GetTop(alignIn) - offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = TopCenter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/in/TopCenter.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/in/TopLeft.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/display/align/in/TopLeft.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetLeft = __webpack_require__(/*! ../../bounds/GetLeft */ \"./node_modules/phaser/src/display/bounds/GetLeft.js\");\r\nvar GetTop = __webpack_require__(/*! ../../bounds/GetTop */ \"./node_modules/phaser/src/display/bounds/GetTop.js\");\r\nvar SetLeft = __webpack_require__(/*! ../../bounds/SetLeft */ \"./node_modules/phaser/src/display/bounds/SetLeft.js\");\r\nvar SetTop = __webpack_require__(/*! ../../bounds/SetTop */ \"./node_modules/phaser/src/display/bounds/SetTop.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned in the top left of the other.\r\n *\r\n * @function Phaser.Display.Align.In.TopLeft\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar TopLeft = function (gameObject, alignIn, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetLeft(gameObject, GetLeft(alignIn) - offsetX);\r\n SetTop(gameObject, GetTop(alignIn) - offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = TopLeft;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/in/TopLeft.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/in/TopRight.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/align/in/TopRight.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetRight = __webpack_require__(/*! ../../bounds/GetRight */ \"./node_modules/phaser/src/display/bounds/GetRight.js\");\r\nvar GetTop = __webpack_require__(/*! ../../bounds/GetTop */ \"./node_modules/phaser/src/display/bounds/GetTop.js\");\r\nvar SetRight = __webpack_require__(/*! ../../bounds/SetRight */ \"./node_modules/phaser/src/display/bounds/SetRight.js\");\r\nvar SetTop = __webpack_require__(/*! ../../bounds/SetTop */ \"./node_modules/phaser/src/display/bounds/SetTop.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned in the top right of the other.\r\n *\r\n * @function Phaser.Display.Align.In.TopRight\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar TopRight = function (gameObject, alignIn, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetRight(gameObject, GetRight(alignIn) + offsetX);\r\n SetTop(gameObject, GetTop(alignIn) - offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = TopRight;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/in/TopRight.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/in/index.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/display/align/in/index.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Display.Align.In\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BottomCenter: __webpack_require__(/*! ./BottomCenter */ \"./node_modules/phaser/src/display/align/in/BottomCenter.js\"),\r\n BottomLeft: __webpack_require__(/*! ./BottomLeft */ \"./node_modules/phaser/src/display/align/in/BottomLeft.js\"),\r\n BottomRight: __webpack_require__(/*! ./BottomRight */ \"./node_modules/phaser/src/display/align/in/BottomRight.js\"),\r\n Center: __webpack_require__(/*! ./Center */ \"./node_modules/phaser/src/display/align/in/Center.js\"),\r\n LeftCenter: __webpack_require__(/*! ./LeftCenter */ \"./node_modules/phaser/src/display/align/in/LeftCenter.js\"),\r\n QuickSet: __webpack_require__(/*! ./QuickSet */ \"./node_modules/phaser/src/display/align/in/QuickSet.js\"),\r\n RightCenter: __webpack_require__(/*! ./RightCenter */ \"./node_modules/phaser/src/display/align/in/RightCenter.js\"),\r\n TopCenter: __webpack_require__(/*! ./TopCenter */ \"./node_modules/phaser/src/display/align/in/TopCenter.js\"),\r\n TopLeft: __webpack_require__(/*! ./TopLeft */ \"./node_modules/phaser/src/display/align/in/TopLeft.js\"),\r\n TopRight: __webpack_require__(/*! ./TopRight */ \"./node_modules/phaser/src/display/align/in/TopRight.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/in/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/index.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/display/align/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/display/align/const.js\");\r\nvar Extend = __webpack_require__(/*! ../../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\n\r\n/**\r\n * @namespace Phaser.Display.Align\r\n */\r\n\r\nvar Align = {\r\n\r\n In: __webpack_require__(/*! ./in */ \"./node_modules/phaser/src/display/align/in/index.js\"),\r\n To: __webpack_require__(/*! ./to */ \"./node_modules/phaser/src/display/align/to/index.js\")\r\n\r\n};\r\n\r\n// Merge in the consts\r\nAlign = Extend(false, Align, CONST);\r\n\r\nmodule.exports = Align;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/to/BottomCenter.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/display/align/to/BottomCenter.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetBottom = __webpack_require__(/*! ../../bounds/GetBottom */ \"./node_modules/phaser/src/display/bounds/GetBottom.js\");\r\nvar GetCenterX = __webpack_require__(/*! ../../bounds/GetCenterX */ \"./node_modules/phaser/src/display/bounds/GetCenterX.js\");\r\nvar SetCenterX = __webpack_require__(/*! ../../bounds/SetCenterX */ \"./node_modules/phaser/src/display/bounds/SetCenterX.js\");\r\nvar SetTop = __webpack_require__(/*! ../../bounds/SetTop */ \"./node_modules/phaser/src/display/bounds/SetTop.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned next to the bottom center position of the other.\r\n *\r\n * @function Phaser.Display.Align.To.BottomCenter\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar BottomCenter = function (gameObject, alignTo, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetCenterX(gameObject, GetCenterX(alignTo) + offsetX);\r\n SetTop(gameObject, GetBottom(alignTo) + offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = BottomCenter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/to/BottomCenter.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/to/BottomLeft.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/display/align/to/BottomLeft.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetBottom = __webpack_require__(/*! ../../bounds/GetBottom */ \"./node_modules/phaser/src/display/bounds/GetBottom.js\");\r\nvar GetLeft = __webpack_require__(/*! ../../bounds/GetLeft */ \"./node_modules/phaser/src/display/bounds/GetLeft.js\");\r\nvar SetLeft = __webpack_require__(/*! ../../bounds/SetLeft */ \"./node_modules/phaser/src/display/bounds/SetLeft.js\");\r\nvar SetTop = __webpack_require__(/*! ../../bounds/SetTop */ \"./node_modules/phaser/src/display/bounds/SetTop.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned next to the bottom left position of the other.\r\n *\r\n * @function Phaser.Display.Align.To.BottomLeft\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar BottomLeft = function (gameObject, alignTo, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetLeft(gameObject, GetLeft(alignTo) - offsetX);\r\n SetTop(gameObject, GetBottom(alignTo) + offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = BottomLeft;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/to/BottomLeft.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/to/BottomRight.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/display/align/to/BottomRight.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetBottom = __webpack_require__(/*! ../../bounds/GetBottom */ \"./node_modules/phaser/src/display/bounds/GetBottom.js\");\r\nvar GetRight = __webpack_require__(/*! ../../bounds/GetRight */ \"./node_modules/phaser/src/display/bounds/GetRight.js\");\r\nvar SetRight = __webpack_require__(/*! ../../bounds/SetRight */ \"./node_modules/phaser/src/display/bounds/SetRight.js\");\r\nvar SetTop = __webpack_require__(/*! ../../bounds/SetTop */ \"./node_modules/phaser/src/display/bounds/SetTop.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned next to the bottom right position of the other.\r\n *\r\n * @function Phaser.Display.Align.To.BottomRight\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar BottomRight = function (gameObject, alignTo, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetRight(gameObject, GetRight(alignTo) + offsetX);\r\n SetTop(gameObject, GetBottom(alignTo) + offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = BottomRight;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/to/BottomRight.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/to/LeftBottom.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/display/align/to/LeftBottom.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetBottom = __webpack_require__(/*! ../../bounds/GetBottom */ \"./node_modules/phaser/src/display/bounds/GetBottom.js\");\r\nvar GetLeft = __webpack_require__(/*! ../../bounds/GetLeft */ \"./node_modules/phaser/src/display/bounds/GetLeft.js\");\r\nvar SetBottom = __webpack_require__(/*! ../../bounds/SetBottom */ \"./node_modules/phaser/src/display/bounds/SetBottom.js\");\r\nvar SetRight = __webpack_require__(/*! ../../bounds/SetRight */ \"./node_modules/phaser/src/display/bounds/SetRight.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned next to the left bottom position of the other.\r\n *\r\n * @function Phaser.Display.Align.To.LeftBottom\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar LeftBottom = function (gameObject, alignTo, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetRight(gameObject, GetLeft(alignTo) - offsetX);\r\n SetBottom(gameObject, GetBottom(alignTo) + offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = LeftBottom;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/to/LeftBottom.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/to/LeftCenter.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/display/align/to/LeftCenter.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetCenterY = __webpack_require__(/*! ../../bounds/GetCenterY */ \"./node_modules/phaser/src/display/bounds/GetCenterY.js\");\r\nvar GetLeft = __webpack_require__(/*! ../../bounds/GetLeft */ \"./node_modules/phaser/src/display/bounds/GetLeft.js\");\r\nvar SetCenterY = __webpack_require__(/*! ../../bounds/SetCenterY */ \"./node_modules/phaser/src/display/bounds/SetCenterY.js\");\r\nvar SetRight = __webpack_require__(/*! ../../bounds/SetRight */ \"./node_modules/phaser/src/display/bounds/SetRight.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned next to the left center position of the other.\r\n *\r\n * @function Phaser.Display.Align.To.LeftCenter\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar LeftCenter = function (gameObject, alignTo, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetRight(gameObject, GetLeft(alignTo) - offsetX);\r\n SetCenterY(gameObject, GetCenterY(alignTo) + offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = LeftCenter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/to/LeftCenter.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/to/LeftTop.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/display/align/to/LeftTop.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetLeft = __webpack_require__(/*! ../../bounds/GetLeft */ \"./node_modules/phaser/src/display/bounds/GetLeft.js\");\r\nvar GetTop = __webpack_require__(/*! ../../bounds/GetTop */ \"./node_modules/phaser/src/display/bounds/GetTop.js\");\r\nvar SetRight = __webpack_require__(/*! ../../bounds/SetRight */ \"./node_modules/phaser/src/display/bounds/SetRight.js\");\r\nvar SetTop = __webpack_require__(/*! ../../bounds/SetTop */ \"./node_modules/phaser/src/display/bounds/SetTop.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned next to the left top position of the other.\r\n *\r\n * @function Phaser.Display.Align.To.LeftTop\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar LeftTop = function (gameObject, alignTo, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetRight(gameObject, GetLeft(alignTo) - offsetX);\r\n SetTop(gameObject, GetTop(alignTo) - offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = LeftTop;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/to/LeftTop.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/to/QuickSet.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/align/to/QuickSet.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author samme\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ALIGN_CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/display/align/const.js\");\r\n\r\nvar AlignToMap = [];\r\n\r\nAlignToMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(/*! ./BottomCenter */ \"./node_modules/phaser/src/display/align/to/BottomCenter.js\");\r\nAlignToMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(/*! ./BottomLeft */ \"./node_modules/phaser/src/display/align/to/BottomLeft.js\");\r\nAlignToMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(/*! ./BottomRight */ \"./node_modules/phaser/src/display/align/to/BottomRight.js\");\r\nAlignToMap[ALIGN_CONST.LEFT_BOTTOM] = __webpack_require__(/*! ./LeftBottom */ \"./node_modules/phaser/src/display/align/to/LeftBottom.js\");\r\nAlignToMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(/*! ./LeftCenter */ \"./node_modules/phaser/src/display/align/to/LeftCenter.js\");\r\nAlignToMap[ALIGN_CONST.LEFT_TOP] = __webpack_require__(/*! ./LeftTop */ \"./node_modules/phaser/src/display/align/to/LeftTop.js\");\r\nAlignToMap[ALIGN_CONST.RIGHT_BOTTOM] = __webpack_require__(/*! ./RightBottom */ \"./node_modules/phaser/src/display/align/to/RightBottom.js\");\r\nAlignToMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(/*! ./RightCenter */ \"./node_modules/phaser/src/display/align/to/RightCenter.js\");\r\nAlignToMap[ALIGN_CONST.RIGHT_TOP] = __webpack_require__(/*! ./RightTop */ \"./node_modules/phaser/src/display/align/to/RightTop.js\");\r\nAlignToMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(/*! ./TopCenter */ \"./node_modules/phaser/src/display/align/to/TopCenter.js\");\r\nAlignToMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(/*! ./TopLeft */ \"./node_modules/phaser/src/display/align/to/TopLeft.js\");\r\nAlignToMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(/*! ./TopRight */ \"./node_modules/phaser/src/display/align/to/TopRight.js\");\r\n\r\n/**\r\n * Takes a Game Object and aligns it next to another, at the given position.\r\n * The alignment used is based on the `position` argument, which is a `Phaser.Display.Align` property such as `LEFT_CENTER` or `TOP_RIGHT`.\r\n *\r\n * @function Phaser.Display.Align.To.QuickSet\r\n * @since 3.22.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [child,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on.\r\n * @param {integer} position - The position to align the Game Object with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar QuickSet = function (child, alignTo, position, offsetX, offsetY)\r\n{\r\n return AlignToMap[position](child, alignTo, offsetX, offsetY);\r\n};\r\n\r\nmodule.exports = QuickSet;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/to/QuickSet.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/to/RightBottom.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/display/align/to/RightBottom.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetBottom = __webpack_require__(/*! ../../bounds/GetBottom */ \"./node_modules/phaser/src/display/bounds/GetBottom.js\");\r\nvar GetRight = __webpack_require__(/*! ../../bounds/GetRight */ \"./node_modules/phaser/src/display/bounds/GetRight.js\");\r\nvar SetBottom = __webpack_require__(/*! ../../bounds/SetBottom */ \"./node_modules/phaser/src/display/bounds/SetBottom.js\");\r\nvar SetLeft = __webpack_require__(/*! ../../bounds/SetLeft */ \"./node_modules/phaser/src/display/bounds/SetLeft.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned next to the right bottom position of the other.\r\n *\r\n * @function Phaser.Display.Align.To.RightBottom\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar RightBottom = function (gameObject, alignTo, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetLeft(gameObject, GetRight(alignTo) + offsetX);\r\n SetBottom(gameObject, GetBottom(alignTo) + offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = RightBottom;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/to/RightBottom.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/to/RightCenter.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/display/align/to/RightCenter.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetCenterY = __webpack_require__(/*! ../../bounds/GetCenterY */ \"./node_modules/phaser/src/display/bounds/GetCenterY.js\");\r\nvar GetRight = __webpack_require__(/*! ../../bounds/GetRight */ \"./node_modules/phaser/src/display/bounds/GetRight.js\");\r\nvar SetCenterY = __webpack_require__(/*! ../../bounds/SetCenterY */ \"./node_modules/phaser/src/display/bounds/SetCenterY.js\");\r\nvar SetLeft = __webpack_require__(/*! ../../bounds/SetLeft */ \"./node_modules/phaser/src/display/bounds/SetLeft.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned next to the right center position of the other.\r\n *\r\n * @function Phaser.Display.Align.To.RightCenter\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar RightCenter = function (gameObject, alignTo, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetLeft(gameObject, GetRight(alignTo) + offsetX);\r\n SetCenterY(gameObject, GetCenterY(alignTo) + offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = RightCenter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/to/RightCenter.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/to/RightTop.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/align/to/RightTop.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetRight = __webpack_require__(/*! ../../bounds/GetRight */ \"./node_modules/phaser/src/display/bounds/GetRight.js\");\r\nvar GetTop = __webpack_require__(/*! ../../bounds/GetTop */ \"./node_modules/phaser/src/display/bounds/GetTop.js\");\r\nvar SetLeft = __webpack_require__(/*! ../../bounds/SetLeft */ \"./node_modules/phaser/src/display/bounds/SetLeft.js\");\r\nvar SetTop = __webpack_require__(/*! ../../bounds/SetTop */ \"./node_modules/phaser/src/display/bounds/SetTop.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned next to the right top position of the other.\r\n *\r\n * @function Phaser.Display.Align.To.RightTop\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar RightTop = function (gameObject, alignTo, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetLeft(gameObject, GetRight(alignTo) + offsetX);\r\n SetTop(gameObject, GetTop(alignTo) - offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = RightTop;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/to/RightTop.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/to/TopCenter.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/display/align/to/TopCenter.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetCenterX = __webpack_require__(/*! ../../bounds/GetCenterX */ \"./node_modules/phaser/src/display/bounds/GetCenterX.js\");\r\nvar GetTop = __webpack_require__(/*! ../../bounds/GetTop */ \"./node_modules/phaser/src/display/bounds/GetTop.js\");\r\nvar SetBottom = __webpack_require__(/*! ../../bounds/SetBottom */ \"./node_modules/phaser/src/display/bounds/SetBottom.js\");\r\nvar SetCenterX = __webpack_require__(/*! ../../bounds/SetCenterX */ \"./node_modules/phaser/src/display/bounds/SetCenterX.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned next to the top center position of the other.\r\n *\r\n * @function Phaser.Display.Align.To.TopCenter\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar TopCenter = function (gameObject, alignTo, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetCenterX(gameObject, GetCenterX(alignTo) + offsetX);\r\n SetBottom(gameObject, GetTop(alignTo) - offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = TopCenter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/to/TopCenter.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/to/TopLeft.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/display/align/to/TopLeft.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetLeft = __webpack_require__(/*! ../../bounds/GetLeft */ \"./node_modules/phaser/src/display/bounds/GetLeft.js\");\r\nvar GetTop = __webpack_require__(/*! ../../bounds/GetTop */ \"./node_modules/phaser/src/display/bounds/GetTop.js\");\r\nvar SetBottom = __webpack_require__(/*! ../../bounds/SetBottom */ \"./node_modules/phaser/src/display/bounds/SetBottom.js\");\r\nvar SetLeft = __webpack_require__(/*! ../../bounds/SetLeft */ \"./node_modules/phaser/src/display/bounds/SetLeft.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned next to the top left position of the other.\r\n *\r\n * @function Phaser.Display.Align.To.TopLeft\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar TopLeft = function (gameObject, alignTo, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetLeft(gameObject, GetLeft(alignTo) - offsetX);\r\n SetBottom(gameObject, GetTop(alignTo) - offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = TopLeft;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/to/TopLeft.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/to/TopRight.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/align/to/TopRight.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetRight = __webpack_require__(/*! ../../bounds/GetRight */ \"./node_modules/phaser/src/display/bounds/GetRight.js\");\r\nvar GetTop = __webpack_require__(/*! ../../bounds/GetTop */ \"./node_modules/phaser/src/display/bounds/GetTop.js\");\r\nvar SetBottom = __webpack_require__(/*! ../../bounds/SetBottom */ \"./node_modules/phaser/src/display/bounds/SetBottom.js\");\r\nvar SetRight = __webpack_require__(/*! ../../bounds/SetRight */ \"./node_modules/phaser/src/display/bounds/SetRight.js\");\r\n\r\n/**\r\n * Takes given Game Object and aligns it so that it is positioned next to the top right position of the other.\r\n *\r\n * @function Phaser.Display.Align.To.TopRight\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.\r\n * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on.\r\n * @param {number} [offsetX=0] - Optional horizontal offset from the position.\r\n * @param {number} [offsetY=0] - Optional vertical offset from the position.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned.\r\n */\r\nvar TopRight = function (gameObject, alignTo, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n SetRight(gameObject, GetRight(alignTo) + offsetX);\r\n SetBottom(gameObject, GetTop(alignTo) - offsetY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = TopRight;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/to/TopRight.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/align/to/index.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/display/align/to/index.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Display.Align.To\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BottomCenter: __webpack_require__(/*! ./BottomCenter */ \"./node_modules/phaser/src/display/align/to/BottomCenter.js\"),\r\n BottomLeft: __webpack_require__(/*! ./BottomLeft */ \"./node_modules/phaser/src/display/align/to/BottomLeft.js\"),\r\n BottomRight: __webpack_require__(/*! ./BottomRight */ \"./node_modules/phaser/src/display/align/to/BottomRight.js\"),\r\n LeftBottom: __webpack_require__(/*! ./LeftBottom */ \"./node_modules/phaser/src/display/align/to/LeftBottom.js\"),\r\n LeftCenter: __webpack_require__(/*! ./LeftCenter */ \"./node_modules/phaser/src/display/align/to/LeftCenter.js\"),\r\n LeftTop: __webpack_require__(/*! ./LeftTop */ \"./node_modules/phaser/src/display/align/to/LeftTop.js\"),\r\n QuickSet: __webpack_require__(/*! ./QuickSet */ \"./node_modules/phaser/src/display/align/to/QuickSet.js\"),\r\n RightBottom: __webpack_require__(/*! ./RightBottom */ \"./node_modules/phaser/src/display/align/to/RightBottom.js\"),\r\n RightCenter: __webpack_require__(/*! ./RightCenter */ \"./node_modules/phaser/src/display/align/to/RightCenter.js\"),\r\n RightTop: __webpack_require__(/*! ./RightTop */ \"./node_modules/phaser/src/display/align/to/RightTop.js\"),\r\n TopCenter: __webpack_require__(/*! ./TopCenter */ \"./node_modules/phaser/src/display/align/to/TopCenter.js\"),\r\n TopLeft: __webpack_require__(/*! ./TopLeft */ \"./node_modules/phaser/src/display/align/to/TopLeft.js\"),\r\n TopRight: __webpack_require__(/*! ./TopRight */ \"./node_modules/phaser/src/display/align/to/TopRight.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/align/to/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/CenterOn.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/CenterOn.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SetCenterX = __webpack_require__(/*! ./SetCenterX */ \"./node_modules/phaser/src/display/bounds/SetCenterX.js\");\r\nvar SetCenterY = __webpack_require__(/*! ./SetCenterY */ \"./node_modules/phaser/src/display/bounds/SetCenterY.js\");\r\n\r\n/**\r\n * Positions the Game Object so that it is centered on the given coordinates.\r\n *\r\n * @function Phaser.Display.Bounds.CenterOn\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned.\r\n * @param {number} x - The horizontal coordinate to position the Game Object on.\r\n * @param {number} y - The vertical coordinate to position the Game Object on.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned.\r\n */\r\nvar CenterOn = function (gameObject, x, y)\r\n{\r\n SetCenterX(gameObject, x);\r\n\r\n return SetCenterY(gameObject, y);\r\n};\r\n\r\nmodule.exports = CenterOn;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/CenterOn.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/GetBottom.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/GetBottom.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns the bottom coordinate from the bounds of the Game Object.\r\n *\r\n * @function Phaser.Display.Bounds.GetBottom\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.\r\n *\r\n * @return {number} The bottom coordinate of the bounds of the Game Object.\r\n */\r\nvar GetBottom = function (gameObject)\r\n{\r\n return (gameObject.y + gameObject.height) - (gameObject.height * gameObject.originY);\r\n};\r\n\r\nmodule.exports = GetBottom;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/GetBottom.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/GetCenterX.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/GetCenterX.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns the center x coordinate from the bounds of the Game Object.\r\n *\r\n * @function Phaser.Display.Bounds.GetCenterX\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.\r\n *\r\n * @return {number} The center x coordinate of the bounds of the Game Object.\r\n */\r\nvar GetCenterX = function (gameObject)\r\n{\r\n return gameObject.x - (gameObject.width * gameObject.originX) + (gameObject.width * 0.5);\r\n};\r\n\r\nmodule.exports = GetCenterX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/GetCenterX.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/GetCenterY.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/GetCenterY.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns the center y coordinate from the bounds of the Game Object.\r\n *\r\n * @function Phaser.Display.Bounds.GetCenterY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.\r\n *\r\n * @return {number} The center y coordinate of the bounds of the Game Object.\r\n */\r\nvar GetCenterY = function (gameObject)\r\n{\r\n return gameObject.y - (gameObject.height * gameObject.originY) + (gameObject.height * 0.5);\r\n};\r\n\r\nmodule.exports = GetCenterY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/GetCenterY.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/GetLeft.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/GetLeft.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns the left coordinate from the bounds of the Game Object.\r\n *\r\n * @function Phaser.Display.Bounds.GetLeft\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.\r\n *\r\n * @return {number} The left coordinate of the bounds of the Game Object.\r\n */\r\nvar GetLeft = function (gameObject)\r\n{\r\n return gameObject.x - (gameObject.width * gameObject.originX);\r\n};\r\n\r\nmodule.exports = GetLeft;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/GetLeft.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/GetOffsetX.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/GetOffsetX.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns the amount the Game Object is visually offset from its x coordinate.\r\n * This is the same as `width * origin.x`.\r\n * This value will only be > 0 if `origin.x` is not equal to zero.\r\n *\r\n * @function Phaser.Display.Bounds.GetOffsetX\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.\r\n *\r\n * @return {number} The horizontal offset of the Game Object.\r\n */\r\nvar GetOffsetX = function (gameObject)\r\n{\r\n return gameObject.width * gameObject.originX;\r\n};\r\n\r\nmodule.exports = GetOffsetX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/GetOffsetX.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/GetOffsetY.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/GetOffsetY.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns the amount the Game Object is visually offset from its y coordinate.\r\n * This is the same as `width * origin.y`.\r\n * This value will only be > 0 if `origin.y` is not equal to zero.\r\n *\r\n * @function Phaser.Display.Bounds.GetOffsetY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.\r\n *\r\n * @return {number} The vertical offset of the Game Object.\r\n */\r\nvar GetOffsetY = function (gameObject)\r\n{\r\n return gameObject.height * gameObject.originY;\r\n};\r\n\r\nmodule.exports = GetOffsetY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/GetOffsetY.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/GetRight.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/GetRight.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns the right coordinate from the bounds of the Game Object.\r\n *\r\n * @function Phaser.Display.Bounds.GetRight\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.\r\n *\r\n * @return {number} The right coordinate of the bounds of the Game Object.\r\n */\r\nvar GetRight = function (gameObject)\r\n{\r\n return (gameObject.x + gameObject.width) - (gameObject.width * gameObject.originX);\r\n};\r\n\r\nmodule.exports = GetRight;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/GetRight.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/GetTop.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/GetTop.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns the top coordinate from the bounds of the Game Object.\r\n *\r\n * @function Phaser.Display.Bounds.GetTop\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from.\r\n *\r\n * @return {number} The top coordinate of the bounds of the Game Object.\r\n */\r\nvar GetTop = function (gameObject)\r\n{\r\n return gameObject.y - (gameObject.height * gameObject.originY);\r\n};\r\n\r\nmodule.exports = GetTop;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/GetTop.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/SetBottom.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/SetBottom.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Positions the Game Object so that the bottom of its bounds aligns with the given coordinate.\r\n *\r\n * @function Phaser.Display.Bounds.SetBottom\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned.\r\n * @param {number} value - The coordinate to position the Game Object bounds on.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned.\r\n */\r\nvar SetBottom = function (gameObject, value)\r\n{\r\n gameObject.y = (value - gameObject.height) + (gameObject.height * gameObject.originY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = SetBottom;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/SetBottom.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/SetCenterX.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/SetCenterX.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Positions the Game Object so that the center top of its bounds aligns with the given coordinate.\r\n *\r\n * @function Phaser.Display.Bounds.SetCenterX\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned.\r\n * @param {number} x - The coordinate to position the Game Object bounds on.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned.\r\n */\r\nvar SetCenterX = function (gameObject, x)\r\n{\r\n var offsetX = gameObject.width * gameObject.originX;\r\n\r\n gameObject.x = (x + offsetX) - (gameObject.width * 0.5);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = SetCenterX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/SetCenterX.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/SetCenterY.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/SetCenterY.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Positions the Game Object so that the center top of its bounds aligns with the given coordinate.\r\n *\r\n * @function Phaser.Display.Bounds.SetCenterY\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned.\r\n * @param {number} y - The coordinate to position the Game Object bounds on.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned.\r\n */\r\nvar SetCenterY = function (gameObject, y)\r\n{\r\n var offsetY = gameObject.height * gameObject.originY;\r\n\r\n gameObject.y = (y + offsetY) - (gameObject.height * 0.5);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = SetCenterY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/SetCenterY.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/SetLeft.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/SetLeft.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Positions the Game Object so that the left of its bounds aligns with the given coordinate.\r\n *\r\n * @function Phaser.Display.Bounds.SetLeft\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned.\r\n * @param {number} value - The coordinate to position the Game Object bounds on.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned.\r\n */\r\nvar SetLeft = function (gameObject, value)\r\n{\r\n gameObject.x = value + (gameObject.width * gameObject.originX);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = SetLeft;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/SetLeft.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/SetRight.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/SetRight.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Positions the Game Object so that the left of its bounds aligns with the given coordinate.\r\n *\r\n * @function Phaser.Display.Bounds.SetRight\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned.\r\n * @param {number} value - The coordinate to position the Game Object bounds on.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned.\r\n */\r\nvar SetRight = function (gameObject, value)\r\n{\r\n gameObject.x = (value - gameObject.width) + (gameObject.width * gameObject.originX);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = SetRight;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/SetRight.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/SetTop.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/SetTop.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Positions the Game Object so that the top of its bounds aligns with the given coordinate.\r\n *\r\n * @function Phaser.Display.Bounds.SetTop\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned.\r\n * @param {number} value - The coordinate to position the Game Object bounds on.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned.\r\n */\r\nvar SetTop = function (gameObject, value)\r\n{\r\n gameObject.y = value + (gameObject.height * gameObject.originY);\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = SetTop;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/SetTop.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/bounds/index.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/display/bounds/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Display.Bounds\r\n */\r\n\r\nmodule.exports = {\r\n\r\n CenterOn: __webpack_require__(/*! ./CenterOn */ \"./node_modules/phaser/src/display/bounds/CenterOn.js\"),\r\n GetBottom: __webpack_require__(/*! ./GetBottom */ \"./node_modules/phaser/src/display/bounds/GetBottom.js\"),\r\n GetCenterX: __webpack_require__(/*! ./GetCenterX */ \"./node_modules/phaser/src/display/bounds/GetCenterX.js\"),\r\n GetCenterY: __webpack_require__(/*! ./GetCenterY */ \"./node_modules/phaser/src/display/bounds/GetCenterY.js\"),\r\n GetLeft: __webpack_require__(/*! ./GetLeft */ \"./node_modules/phaser/src/display/bounds/GetLeft.js\"),\r\n GetOffsetX: __webpack_require__(/*! ./GetOffsetX */ \"./node_modules/phaser/src/display/bounds/GetOffsetX.js\"),\r\n GetOffsetY: __webpack_require__(/*! ./GetOffsetY */ \"./node_modules/phaser/src/display/bounds/GetOffsetY.js\"),\r\n GetRight: __webpack_require__(/*! ./GetRight */ \"./node_modules/phaser/src/display/bounds/GetRight.js\"),\r\n GetTop: __webpack_require__(/*! ./GetTop */ \"./node_modules/phaser/src/display/bounds/GetTop.js\"),\r\n SetBottom: __webpack_require__(/*! ./SetBottom */ \"./node_modules/phaser/src/display/bounds/SetBottom.js\"),\r\n SetCenterX: __webpack_require__(/*! ./SetCenterX */ \"./node_modules/phaser/src/display/bounds/SetCenterX.js\"),\r\n SetCenterY: __webpack_require__(/*! ./SetCenterY */ \"./node_modules/phaser/src/display/bounds/SetCenterY.js\"),\r\n SetLeft: __webpack_require__(/*! ./SetLeft */ \"./node_modules/phaser/src/display/bounds/SetLeft.js\"),\r\n SetRight: __webpack_require__(/*! ./SetRight */ \"./node_modules/phaser/src/display/bounds/SetRight.js\"),\r\n SetTop: __webpack_require__(/*! ./SetTop */ \"./node_modules/phaser/src/display/bounds/SetTop.js\")\r\n \r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/bounds/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/canvas/CanvasInterpolation.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/display/canvas/CanvasInterpolation.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Display.Canvas.CanvasInterpolation\r\n * @since 3.0.0\r\n */\r\nvar CanvasInterpolation = {\r\n\r\n /**\r\n * Sets the CSS image-rendering property on the given canvas to be 'crisp' (aka 'optimize contrast' on webkit).\r\n *\r\n * @function Phaser.Display.Canvas.CanvasInterpolation.setCrisp\r\n * @since 3.0.0\r\n * \r\n * @param {HTMLCanvasElement} canvas - The canvas object to have the style set on.\r\n * \r\n * @return {HTMLCanvasElement} The canvas.\r\n */\r\n setCrisp: function (canvas)\r\n {\r\n var types = [ 'optimizeSpeed', '-moz-crisp-edges', '-o-crisp-edges', '-webkit-optimize-contrast', 'optimize-contrast', 'crisp-edges', 'pixelated' ];\r\n\r\n types.forEach(function (type)\r\n {\r\n canvas.style['image-rendering'] = type;\r\n });\r\n\r\n canvas.style.msInterpolationMode = 'nearest-neighbor';\r\n\r\n return canvas;\r\n },\r\n\r\n /**\r\n * Sets the CSS image-rendering property on the given canvas to be 'bicubic' (aka 'auto').\r\n *\r\n * @function Phaser.Display.Canvas.CanvasInterpolation.setBicubic\r\n * @since 3.0.0\r\n * \r\n * @param {HTMLCanvasElement} canvas - The canvas object to have the style set on.\r\n * \r\n * @return {HTMLCanvasElement} The canvas.\r\n */\r\n setBicubic: function (canvas)\r\n {\r\n canvas.style['image-rendering'] = 'auto';\r\n canvas.style.msInterpolationMode = 'bicubic';\r\n\r\n return canvas;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = CanvasInterpolation;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/canvas/CanvasInterpolation.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/canvas/CanvasPool.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/canvas/CanvasPool.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ../../const */ \"./node_modules/phaser/src/const.js\");\r\nvar Smoothing = __webpack_require__(/*! ./Smoothing */ \"./node_modules/phaser/src/display/canvas/Smoothing.js\");\r\n\r\n// The pool into which the canvas elements are placed.\r\nvar pool = [];\r\n\r\n// Automatically apply smoothing(false) to created Canvas elements\r\nvar _disableContextSmoothing = false;\r\n\r\n/**\r\n * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements.\r\n * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, \r\n * which is useless for some of the Phaser pipelines / renderer.\r\n *\r\n * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created.\r\n * Which means all instances of Phaser Games on the same page can share the one single pool.\r\n *\r\n * @namespace Phaser.Display.Canvas.CanvasPool\r\n * @since 3.0.0\r\n */\r\nvar CanvasPool = function ()\r\n{\r\n /**\r\n * Creates a new Canvas DOM element, or pulls one from the pool if free.\r\n *\r\n * @function Phaser.Display.Canvas.CanvasPool.create\r\n * @since 3.0.0\r\n *\r\n * @param {*} parent - The parent of the Canvas object.\r\n * @param {integer} [width=1] - The width of the Canvas.\r\n * @param {integer} [height=1] - The height of the Canvas.\r\n * @param {integer} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`.\r\n * @param {boolean} [selfParent=false] - Use the generated Canvas element as the parent?\r\n *\r\n * @return {HTMLCanvasElement} The canvas element that was created or pulled from the pool\r\n */\r\n var create = function (parent, width, height, canvasType, selfParent)\r\n {\r\n if (width === undefined) { width = 1; }\r\n if (height === undefined) { height = 1; }\r\n if (canvasType === undefined) { canvasType = CONST.CANVAS; }\r\n if (selfParent === undefined) { selfParent = false; }\r\n\r\n var canvas;\r\n var container = first(canvasType);\r\n\r\n if (container === null)\r\n {\r\n container = {\r\n parent: parent,\r\n canvas: document.createElement('canvas'),\r\n type: canvasType\r\n };\r\n\r\n if (canvasType === CONST.CANVAS)\r\n {\r\n pool.push(container);\r\n }\r\n\r\n canvas = container.canvas;\r\n }\r\n else\r\n {\r\n container.parent = parent;\r\n\r\n canvas = container.canvas;\r\n }\r\n\r\n if (selfParent)\r\n {\r\n container.parent = canvas;\r\n }\r\n\r\n canvas.width = width;\r\n canvas.height = height;\r\n\r\n if (_disableContextSmoothing && canvasType === CONST.CANVAS)\r\n {\r\n Smoothing.disable(canvas.getContext('2d'));\r\n }\r\n\r\n return canvas;\r\n };\r\n\r\n /**\r\n * Creates a new Canvas DOM element, or pulls one from the pool if free.\r\n *\r\n * @function Phaser.Display.Canvas.CanvasPool.create2D\r\n * @since 3.0.0\r\n *\r\n * @param {*} parent - The parent of the Canvas object.\r\n * @param {integer} [width=1] - The width of the Canvas.\r\n * @param {integer} [height=1] - The height of the Canvas.\r\n *\r\n * @return {HTMLCanvasElement} The created canvas.\r\n */\r\n var create2D = function (parent, width, height)\r\n {\r\n return create(parent, width, height, CONST.CANVAS);\r\n };\r\n\r\n /**\r\n * Creates a new Canvas DOM element, or pulls one from the pool if free.\r\n *\r\n * @function Phaser.Display.Canvas.CanvasPool.createWebGL\r\n * @since 3.0.0\r\n *\r\n * @param {*} parent - The parent of the Canvas object.\r\n * @param {integer} [width=1] - The width of the Canvas.\r\n * @param {integer} [height=1] - The height of the Canvas.\r\n *\r\n * @return {HTMLCanvasElement} The created WebGL canvas.\r\n */\r\n var createWebGL = function (parent, width, height)\r\n {\r\n return create(parent, width, height, CONST.WEBGL);\r\n };\r\n\r\n /**\r\n * Gets the first free canvas index from the pool.\r\n *\r\n * @function Phaser.Display.Canvas.CanvasPool.first\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`.\r\n *\r\n * @return {HTMLCanvasElement} The first free canvas, or `null` if a WebGL canvas was requested or if the pool doesn't have free canvases.\r\n */\r\n var first = function (canvasType)\r\n {\r\n if (canvasType === undefined) { canvasType = CONST.CANVAS; }\r\n\r\n if (canvasType === CONST.WEBGL)\r\n {\r\n return null;\r\n }\r\n\r\n for (var i = 0; i < pool.length; i++)\r\n {\r\n var container = pool[i];\r\n\r\n if (!container.parent && container.type === canvasType)\r\n {\r\n return container;\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n /**\r\n * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use.\r\n * The canvas has its width and height set to 1, and its parent attribute nulled.\r\n *\r\n * @function Phaser.Display.Canvas.CanvasPool.remove\r\n * @since 3.0.0\r\n *\r\n * @param {*} parent - The canvas or the parent of the canvas to free.\r\n */\r\n var remove = function (parent)\r\n {\r\n // Check to see if the parent is a canvas object\r\n var isCanvas = parent instanceof HTMLCanvasElement;\r\n\r\n pool.forEach(function (container)\r\n {\r\n if ((isCanvas && container.canvas === parent) || (!isCanvas && container.parent === parent))\r\n {\r\n container.parent = null;\r\n container.canvas.width = 1;\r\n container.canvas.height = 1;\r\n }\r\n });\r\n };\r\n\r\n /**\r\n * Gets the total number of used canvas elements in the pool.\r\n *\r\n * @function Phaser.Display.Canvas.CanvasPool.total\r\n * @since 3.0.0\r\n *\r\n * @return {integer} The number of used canvases.\r\n */\r\n var total = function ()\r\n {\r\n var c = 0;\r\n\r\n pool.forEach(function (container)\r\n {\r\n if (container.parent)\r\n {\r\n c++;\r\n }\r\n });\r\n\r\n return c;\r\n };\r\n\r\n /**\r\n * Gets the total number of free canvas elements in the pool.\r\n *\r\n * @function Phaser.Display.Canvas.CanvasPool.free\r\n * @since 3.0.0\r\n *\r\n * @return {integer} The number of free canvases.\r\n */\r\n var free = function ()\r\n {\r\n return pool.length - total();\r\n };\r\n\r\n /**\r\n * Disable context smoothing on any new Canvas element created.\r\n *\r\n * @function Phaser.Display.Canvas.CanvasPool.disableSmoothing\r\n * @since 3.0.0\r\n */\r\n var disableSmoothing = function ()\r\n {\r\n _disableContextSmoothing = true;\r\n };\r\n\r\n /**\r\n * Enable context smoothing on any new Canvas element created.\r\n *\r\n * @function Phaser.Display.Canvas.CanvasPool.enableSmoothing\r\n * @since 3.0.0\r\n */\r\n var enableSmoothing = function ()\r\n {\r\n _disableContextSmoothing = false;\r\n };\r\n\r\n return {\r\n create2D: create2D,\r\n create: create,\r\n createWebGL: createWebGL,\r\n disableSmoothing: disableSmoothing,\r\n enableSmoothing: enableSmoothing,\r\n first: first,\r\n free: free,\r\n pool: pool,\r\n remove: remove,\r\n total: total\r\n };\r\n};\r\n\r\n// If we export the called function here, it'll only be invoked once (not every time it's required).\r\nmodule.exports = CanvasPool();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/canvas/CanvasPool.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/canvas/Smoothing.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/display/canvas/Smoothing.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Browser specific prefix, so not going to change between contexts, only between browsers\r\nvar prefix = '';\r\n\r\n/**\r\n * @namespace Phaser.Display.Canvas.Smoothing\r\n * @since 3.0.0\r\n */\r\nvar Smoothing = function ()\r\n{\r\n /**\r\n * Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set.\r\n *\r\n * @function Phaser.Display.Canvas.Smoothing.getPrefix\r\n * @since 3.0.0\r\n *\r\n * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The canvas context to check.\r\n *\r\n * @return {string} The name of the property on the context which controls image smoothing (either `imageSmoothingEnabled` or a vendor-prefixed version thereof), or `null` if not supported.\r\n */\r\n var getPrefix = function (context)\r\n {\r\n var vendors = [ 'i', 'webkitI', 'msI', 'mozI', 'oI' ];\r\n\r\n for (var i = 0; i < vendors.length; i++)\r\n {\r\n var s = vendors[i] + 'mageSmoothingEnabled';\r\n\r\n if (s in context)\r\n {\r\n return s;\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n /**\r\n * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing.\r\n * By default browsers have image smoothing enabled, which isn't always what you visually want, especially\r\n * when using pixel art in a game. Note that this sets the property on the context itself, so that any image\r\n * drawn to the context will be affected. This sets the property across all current browsers but support is\r\n * patchy on earlier browsers, especially on mobile.\r\n *\r\n * @function Phaser.Display.Canvas.Smoothing.enable\r\n * @since 3.0.0\r\n *\r\n * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to enable smoothing.\r\n *\r\n * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context.\r\n */\r\n var enable = function (context)\r\n {\r\n if (prefix === '')\r\n {\r\n prefix = getPrefix(context);\r\n }\r\n\r\n if (prefix)\r\n {\r\n context[prefix] = true;\r\n }\r\n\r\n return context;\r\n };\r\n\r\n /**\r\n * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing.\r\n * By default browsers have image smoothing enabled, which isn't always what you visually want, especially\r\n * when using pixel art in a game. Note that this sets the property on the context itself, so that any image\r\n * drawn to the context will be affected. This sets the property across all current browsers but support is\r\n * patchy on earlier browsers, especially on mobile.\r\n *\r\n * @function Phaser.Display.Canvas.Smoothing.disable\r\n * @since 3.0.0\r\n *\r\n * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to disable smoothing.\r\n *\r\n * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context.\r\n */\r\n var disable = function (context)\r\n {\r\n if (prefix === '')\r\n {\r\n prefix = getPrefix(context);\r\n }\r\n\r\n if (prefix)\r\n {\r\n context[prefix] = false;\r\n }\r\n\r\n return context;\r\n };\r\n\r\n /**\r\n * Returns `true` if the given context has image smoothing enabled, otherwise returns `false`.\r\n * Returns null if no smoothing prefix is available.\r\n *\r\n * @function Phaser.Display.Canvas.Smoothing.isEnabled\r\n * @since 3.0.0\r\n *\r\n * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context to check.\r\n *\r\n * @return {?boolean} `true` if smoothing is enabled on the context, otherwise `false`. `null` if not supported.\r\n */\r\n var isEnabled = function (context)\r\n {\r\n return (prefix !== null) ? context[prefix] : null;\r\n };\r\n\r\n return {\r\n disable: disable,\r\n enable: enable,\r\n getPrefix: getPrefix,\r\n isEnabled: isEnabled\r\n };\r\n\r\n};\r\n\r\nmodule.exports = Smoothing();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/canvas/Smoothing.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/canvas/TouchAction.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/display/canvas/TouchAction.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sets the touch-action property on the canvas style. Can be used to disable default browser touch actions.\r\n *\r\n * @function Phaser.Display.Canvas.TouchAction\r\n * @since 3.0.0\r\n *\r\n * @param {HTMLCanvasElement} canvas - The canvas element to have the style applied to.\r\n * @param {string} [value='none'] - The touch action value to set on the canvas. Set to `none` to disable touch actions.\r\n *\r\n * @return {HTMLCanvasElement} The canvas element.\r\n */\r\nvar TouchAction = function (canvas, value)\r\n{\r\n if (value === undefined) { value = 'none'; }\r\n\r\n canvas.style['msTouchAction'] = value;\r\n canvas.style['ms-touch-action'] = value;\r\n canvas.style['touch-action'] = value;\r\n\r\n return canvas;\r\n};\r\n\r\nmodule.exports = TouchAction;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/canvas/TouchAction.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/canvas/UserSelect.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/canvas/UserSelect.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sets the user-select property on the canvas style. Can be used to disable default browser selection actions.\r\n *\r\n * @function Phaser.Display.Canvas.UserSelect\r\n * @since 3.0.0\r\n *\r\n * @param {HTMLCanvasElement} canvas - The canvas element to have the style applied to.\r\n * @param {string} [value='none'] - The touch callout value to set on the canvas. Set to `none` to disable touch callouts.\r\n *\r\n * @return {HTMLCanvasElement} The canvas element.\r\n */\r\nvar UserSelect = function (canvas, value)\r\n{\r\n if (value === undefined) { value = 'none'; }\r\n\r\n var vendors = [\r\n '-webkit-',\r\n '-khtml-',\r\n '-moz-',\r\n '-ms-',\r\n ''\r\n ];\r\n\r\n vendors.forEach(function (vendor)\r\n {\r\n canvas.style[vendor + 'user-select'] = value;\r\n });\r\n\r\n canvas.style['-webkit-touch-callout'] = value;\r\n canvas.style['-webkit-tap-highlight-color'] = 'rgba(0, 0, 0, 0)';\r\n\r\n return canvas;\r\n};\r\n\r\nmodule.exports = UserSelect;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/canvas/UserSelect.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/canvas/index.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/display/canvas/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Display.Canvas\r\n */\r\n\r\nmodule.exports = {\r\n\r\n CanvasInterpolation: __webpack_require__(/*! ./CanvasInterpolation */ \"./node_modules/phaser/src/display/canvas/CanvasInterpolation.js\"),\r\n CanvasPool: __webpack_require__(/*! ./CanvasPool */ \"./node_modules/phaser/src/display/canvas/CanvasPool.js\"),\r\n Smoothing: __webpack_require__(/*! ./Smoothing */ \"./node_modules/phaser/src/display/canvas/Smoothing.js\"),\r\n TouchAction: __webpack_require__(/*! ./TouchAction */ \"./node_modules/phaser/src/display/canvas/TouchAction.js\"),\r\n UserSelect: __webpack_require__(/*! ./UserSelect */ \"./node_modules/phaser/src/display/canvas/UserSelect.js\")\r\n \r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/canvas/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/Color.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/display/color/Color.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GetColor = __webpack_require__(/*! ./GetColor */ \"./node_modules/phaser/src/display/color/GetColor.js\");\r\nvar GetColor32 = __webpack_require__(/*! ./GetColor32 */ \"./node_modules/phaser/src/display/color/GetColor32.js\");\r\nvar HSVToRGB = __webpack_require__(/*! ./HSVToRGB */ \"./node_modules/phaser/src/display/color/HSVToRGB.js\");\r\nvar RGBToHSV = __webpack_require__(/*! ./RGBToHSV */ \"./node_modules/phaser/src/display/color/RGBToHSV.js\");\r\n\r\n/**\r\n * @namespace Phaser.Display.Color\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * The Color class holds a single color value and allows for easy modification and reading of it.\r\n *\r\n * @class Color\r\n * @memberof Phaser.Display\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [red=0] - The red color value. A number between 0 and 255.\r\n * @param {integer} [green=0] - The green color value. A number between 0 and 255.\r\n * @param {integer} [blue=0] - The blue color value. A number between 0 and 255.\r\n * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255.\r\n */\r\nvar Color = new Class({\r\n\r\n initialize:\r\n\r\n function Color (red, green, blue, alpha)\r\n {\r\n if (red === undefined) { red = 0; }\r\n if (green === undefined) { green = 0; }\r\n if (blue === undefined) { blue = 0; }\r\n if (alpha === undefined) { alpha = 255; }\r\n\r\n /**\r\n * The internal red color value.\r\n *\r\n * @name Phaser.Display.Color#r\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.r = 0;\r\n\r\n /**\r\n * The internal green color value.\r\n *\r\n * @name Phaser.Display.Color#g\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.g = 0;\r\n\r\n /**\r\n * The internal blue color value.\r\n *\r\n * @name Phaser.Display.Color#b\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.b = 0;\r\n\r\n /**\r\n * The internal alpha color value.\r\n *\r\n * @name Phaser.Display.Color#a\r\n * @type {number}\r\n * @private\r\n * @default 255\r\n * @since 3.0.0\r\n */\r\n this.a = 255;\r\n\r\n /**\r\n * The hue color value. A number between 0 and 1.\r\n * This is the base color.\r\n *\r\n * @name Phaser.Display.Color#_h\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._h = 0;\r\n\r\n /**\r\n * The saturation color value. A number between 0 and 1.\r\n * This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white.\r\n *\r\n * @name Phaser.Display.Color#_s\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._s = 0;\r\n\r\n /**\r\n * The lightness color value. A number between 0 and 1.\r\n * This controls how dark the color is. Where 1 is as bright as possible and 0 is black.\r\n *\r\n * @name Phaser.Display.Color#_v\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._v = 0;\r\n\r\n /**\r\n * Is this color update locked?\r\n *\r\n * @name Phaser.Display.Color#_locked\r\n * @type {boolean}\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._locked = false;\r\n\r\n /**\r\n * An array containing the calculated color values for WebGL use.\r\n *\r\n * @name Phaser.Display.Color#gl\r\n * @type {number[]}\r\n * @since 3.0.0\r\n */\r\n this.gl = [ 0, 0, 0, 1 ];\r\n\r\n /**\r\n * Pre-calculated internal color value.\r\n *\r\n * @name Phaser.Display.Color#_color\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._color = 0;\r\n\r\n /**\r\n * Pre-calculated internal color32 value.\r\n *\r\n * @name Phaser.Display.Color#_color32\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._color32 = 0;\r\n\r\n /**\r\n * Pre-calculated internal color rgb string value.\r\n *\r\n * @name Phaser.Display.Color#_rgba\r\n * @type {string}\r\n * @private\r\n * @default ''\r\n * @since 3.0.0\r\n */\r\n this._rgba = '';\r\n\r\n this.setTo(red, green, blue, alpha);\r\n },\r\n\r\n /**\r\n * Sets this color to be transparent. Sets all values to zero.\r\n *\r\n * @method Phaser.Display.Color#transparent\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Display.Color} This Color object.\r\n */\r\n transparent: function ()\r\n {\r\n this._locked = true;\r\n\r\n this.red = 0;\r\n this.green = 0;\r\n this.blue = 0;\r\n this.alpha = 0;\r\n\r\n this._locked = false;\r\n\r\n return this.update(true);\r\n },\r\n\r\n /**\r\n * Sets the color of this Color component.\r\n *\r\n * @method Phaser.Display.Color#setTo\r\n * @since 3.0.0\r\n *\r\n * @param {integer} red - The red color value. A number between 0 and 255.\r\n * @param {integer} green - The green color value. A number between 0 and 255.\r\n * @param {integer} blue - The blue color value. A number between 0 and 255.\r\n * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255.\r\n * @param {boolean} [updateHSV=true] - Update the HSV values after setting the RGB values?\r\n *\r\n * @return {Phaser.Display.Color} This Color object.\r\n */\r\n setTo: function (red, green, blue, alpha, updateHSV)\r\n {\r\n if (alpha === undefined) { alpha = 255; }\r\n if (updateHSV === undefined) { updateHSV = true; }\r\n\r\n this._locked = true;\r\n\r\n this.red = red;\r\n this.green = green;\r\n this.blue = blue;\r\n this.alpha = alpha;\r\n\r\n this._locked = false;\r\n\r\n return this.update(updateHSV);\r\n },\r\n\r\n /**\r\n * Sets the red, green, blue and alpha GL values of this Color component.\r\n *\r\n * @method Phaser.Display.Color#setGLTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} red - The red color value. A number between 0 and 1.\r\n * @param {number} green - The green color value. A number between 0 and 1.\r\n * @param {number} blue - The blue color value. A number between 0 and 1.\r\n * @param {number} [alpha=1] - The alpha value. A number between 0 and 1.\r\n *\r\n * @return {Phaser.Display.Color} This Color object.\r\n */\r\n setGLTo: function (red, green, blue, alpha)\r\n {\r\n if (alpha === undefined) { alpha = 1; }\r\n\r\n this._locked = true;\r\n\r\n this.redGL = red;\r\n this.greenGL = green;\r\n this.blueGL = blue;\r\n this.alphaGL = alpha;\r\n\r\n this._locked = false;\r\n\r\n return this.update(true);\r\n },\r\n\r\n /**\r\n * Sets the color based on the color object given.\r\n *\r\n * @method Phaser.Display.Color#setFromRGB\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Display.InputColorObject} color - An object containing `r`, `g`, `b` and optionally `a` values in the range 0 to 255.\r\n *\r\n * @return {Phaser.Display.Color} This Color object.\r\n */\r\n setFromRGB: function (color)\r\n {\r\n this._locked = true;\r\n\r\n this.red = color.r;\r\n this.green = color.g;\r\n this.blue = color.b;\r\n\r\n if (color.hasOwnProperty('a'))\r\n {\r\n this.alpha = color.a;\r\n }\r\n\r\n this._locked = false;\r\n\r\n return this.update(true);\r\n },\r\n\r\n /**\r\n * Sets the color based on the hue, saturation and lightness values given.\r\n *\r\n * @method Phaser.Display.Color#setFromHSV\r\n * @since 3.13.0\r\n *\r\n * @param {number} h - The hue, in the range 0 - 1. This is the base color.\r\n * @param {number} s - The saturation, in the range 0 - 1. This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white.\r\n * @param {number} v - The value, in the range 0 - 1. This controls how dark the color is. Where 1 is as bright as possible and 0 is black.\r\n *\r\n * @return {Phaser.Display.Color} This Color object.\r\n */\r\n setFromHSV: function (h, s, v)\r\n {\r\n return HSVToRGB(h, s, v, this);\r\n },\r\n\r\n /**\r\n * Updates the internal cache values.\r\n *\r\n * @method Phaser.Display.Color#update\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Display.Color} This Color object.\r\n */\r\n update: function (updateHSV)\r\n {\r\n if (updateHSV === undefined) { updateHSV = false; }\r\n\r\n if (this._locked)\r\n {\r\n return this;\r\n }\r\n\r\n var r = this.r;\r\n var g = this.g;\r\n var b = this.b;\r\n var a = this.a;\r\n\r\n this._color = GetColor(r, g, b);\r\n this._color32 = GetColor32(r, g, b, a);\r\n this._rgba = 'rgba(' + r + ',' + g + ',' + b + ',' + (a / 255) + ')';\r\n\r\n if (updateHSV)\r\n {\r\n RGBToHSV(r, g, b, this);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Updates the internal hsv cache values.\r\n *\r\n * @method Phaser.Display.Color#updateHSV\r\n * @private\r\n * @since 3.13.0\r\n *\r\n * @return {Phaser.Display.Color} This Color object.\r\n */\r\n updateHSV: function ()\r\n {\r\n var r = this.r;\r\n var g = this.g;\r\n var b = this.b;\r\n\r\n RGBToHSV(r, g, b, this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns a new Color component using the values from this one.\r\n *\r\n * @method Phaser.Display.Color#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Display.Color} A new Color object.\r\n */\r\n clone: function ()\r\n {\r\n return new Color(this.r, this.g, this.b, this.a);\r\n },\r\n\r\n /**\r\n * Sets this Color object to be grayscaled based on the shade value given.\r\n *\r\n * @method Phaser.Display.Color#gray\r\n * @since 3.13.0\r\n * \r\n * @param {integer} shade - A value between 0 and 255.\r\n *\r\n * @return {Phaser.Display.Color} This Color object.\r\n */\r\n gray: function (shade)\r\n {\r\n return this.setTo(shade, shade, shade);\r\n },\r\n\r\n /**\r\n * Sets this Color object to be a random color between the `min` and `max` values given.\r\n *\r\n * @method Phaser.Display.Color#random\r\n * @since 3.13.0\r\n * \r\n * @param {integer} [min=0] - The minimum random color value. Between 0 and 255.\r\n * @param {integer} [max=255] - The maximum random color value. Between 0 and 255.\r\n *\r\n * @return {Phaser.Display.Color} This Color object.\r\n */\r\n random: function (min, max)\r\n {\r\n if (min === undefined) { min = 0; }\r\n if (max === undefined) { max = 255; }\r\n\r\n var r = Math.floor(min + Math.random() * (max - min));\r\n var g = Math.floor(min + Math.random() * (max - min));\r\n var b = Math.floor(min + Math.random() * (max - min));\r\n\r\n return this.setTo(r, g, b);\r\n },\r\n\r\n /**\r\n * Sets this Color object to be a random grayscale color between the `min` and `max` values given.\r\n *\r\n * @method Phaser.Display.Color#randomGray\r\n * @since 3.13.0\r\n * \r\n * @param {integer} [min=0] - The minimum random color value. Between 0 and 255.\r\n * @param {integer} [max=255] - The maximum random color value. Between 0 and 255.\r\n *\r\n * @return {Phaser.Display.Color} This Color object.\r\n */\r\n randomGray: function (min, max)\r\n {\r\n if (min === undefined) { min = 0; }\r\n if (max === undefined) { max = 255; }\r\n\r\n var s = Math.floor(min + Math.random() * (max - min));\r\n\r\n return this.setTo(s, s, s);\r\n },\r\n\r\n /**\r\n * Increase the saturation of this Color by the percentage amount given.\r\n * The saturation is the amount of the base color in the hue.\r\n *\r\n * @method Phaser.Display.Color#saturate\r\n * @since 3.13.0\r\n * \r\n * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100.\r\n *\r\n * @return {Phaser.Display.Color} This Color object.\r\n */\r\n saturate: function (amount)\r\n {\r\n this.s += amount / 100;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Decrease the saturation of this Color by the percentage amount given.\r\n * The saturation is the amount of the base color in the hue.\r\n *\r\n * @method Phaser.Display.Color#desaturate\r\n * @since 3.13.0\r\n * \r\n * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100.\r\n *\r\n * @return {Phaser.Display.Color} This Color object.\r\n */\r\n desaturate: function (amount)\r\n {\r\n this.s -= amount / 100;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Increase the lightness of this Color by the percentage amount given.\r\n *\r\n * @method Phaser.Display.Color#lighten\r\n * @since 3.13.0\r\n * \r\n * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100.\r\n *\r\n * @return {Phaser.Display.Color} This Color object.\r\n */\r\n lighten: function (amount)\r\n {\r\n this.v += amount / 100;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Decrease the lightness of this Color by the percentage amount given.\r\n *\r\n * @method Phaser.Display.Color#darken\r\n * @since 3.13.0\r\n * \r\n * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100.\r\n *\r\n * @return {Phaser.Display.Color} This Color object.\r\n */\r\n darken: function (amount)\r\n {\r\n this.v -= amount / 100;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Brighten this Color by the percentage amount given.\r\n *\r\n * @method Phaser.Display.Color#brighten\r\n * @since 3.13.0\r\n * \r\n * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100.\r\n *\r\n * @return {Phaser.Display.Color} This Color object.\r\n */\r\n brighten: function (amount)\r\n {\r\n var r = this.r;\r\n var g = this.g;\r\n var b = this.b;\r\n\r\n r = Math.max(0, Math.min(255, r - Math.round(255 * - (amount / 100))));\r\n g = Math.max(0, Math.min(255, g - Math.round(255 * - (amount / 100))));\r\n b = Math.max(0, Math.min(255, b - Math.round(255 * - (amount / 100))));\r\n\r\n return this.setTo(r, g, b);\r\n },\r\n\r\n /**\r\n * The color of this Color component, not including the alpha channel.\r\n *\r\n * @name Phaser.Display.Color#color\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n color: {\r\n\r\n get: function ()\r\n {\r\n return this._color;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The color of this Color component, including the alpha channel.\r\n *\r\n * @name Phaser.Display.Color#color32\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n color32: {\r\n\r\n get: function ()\r\n {\r\n return this._color32;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The color of this Color component as a string which can be used in CSS color values.\r\n *\r\n * @name Phaser.Display.Color#rgba\r\n * @type {string}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n rgba: {\r\n\r\n get: function ()\r\n {\r\n return this._rgba;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The red color value, normalized to the range 0 to 1.\r\n *\r\n * @name Phaser.Display.Color#redGL\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n redGL: {\r\n\r\n get: function ()\r\n {\r\n return this.gl[0];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.gl[0] = Math.min(Math.abs(value), 1);\r\n\r\n this.r = Math.floor(this.gl[0] * 255);\r\n\r\n this.update(true);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The green color value, normalized to the range 0 to 1.\r\n *\r\n * @name Phaser.Display.Color#greenGL\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n greenGL: {\r\n\r\n get: function ()\r\n {\r\n return this.gl[1];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.gl[1] = Math.min(Math.abs(value), 1);\r\n\r\n this.g = Math.floor(this.gl[1] * 255);\r\n\r\n this.update(true);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The blue color value, normalized to the range 0 to 1.\r\n *\r\n * @name Phaser.Display.Color#blueGL\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n blueGL: {\r\n\r\n get: function ()\r\n {\r\n return this.gl[2];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.gl[2] = Math.min(Math.abs(value), 1);\r\n\r\n this.b = Math.floor(this.gl[2] * 255);\r\n\r\n this.update(true);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The alpha color value, normalized to the range 0 to 1.\r\n *\r\n * @name Phaser.Display.Color#alphaGL\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n alphaGL: {\r\n\r\n get: function ()\r\n {\r\n return this.gl[3];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.gl[3] = Math.min(Math.abs(value), 1);\r\n\r\n this.a = Math.floor(this.gl[3] * 255);\r\n\r\n this.update();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The red color value, normalized to the range 0 to 255.\r\n *\r\n * @name Phaser.Display.Color#red\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n red: {\r\n\r\n get: function ()\r\n {\r\n return this.r;\r\n },\r\n\r\n set: function (value)\r\n {\r\n value = Math.floor(Math.abs(value));\r\n\r\n this.r = Math.min(value, 255);\r\n\r\n this.gl[0] = value / 255;\r\n\r\n this.update(true);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The green color value, normalized to the range 0 to 255.\r\n *\r\n * @name Phaser.Display.Color#green\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n green: {\r\n\r\n get: function ()\r\n {\r\n return this.g;\r\n },\r\n\r\n set: function (value)\r\n {\r\n value = Math.floor(Math.abs(value));\r\n\r\n this.g = Math.min(value, 255);\r\n\r\n this.gl[1] = value / 255;\r\n\r\n this.update(true);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The blue color value, normalized to the range 0 to 255.\r\n *\r\n * @name Phaser.Display.Color#blue\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n blue: {\r\n\r\n get: function ()\r\n {\r\n return this.b;\r\n },\r\n\r\n set: function (value)\r\n {\r\n value = Math.floor(Math.abs(value));\r\n\r\n this.b = Math.min(value, 255);\r\n\r\n this.gl[2] = value / 255;\r\n\r\n this.update(true);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The alpha color value, normalized to the range 0 to 255.\r\n *\r\n * @name Phaser.Display.Color#alpha\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n alpha: {\r\n\r\n get: function ()\r\n {\r\n return this.a;\r\n },\r\n\r\n set: function (value)\r\n {\r\n value = Math.floor(Math.abs(value));\r\n\r\n this.a = Math.min(value, 255);\r\n\r\n this.gl[3] = value / 255;\r\n\r\n this.update();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The hue color value. A number between 0 and 1.\r\n * This is the base color.\r\n *\r\n * @name Phaser.Display.Color#h\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n h: {\r\n\r\n get: function ()\r\n {\r\n return this._h;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._h = value;\r\n\r\n HSVToRGB(value, this._s, this._v, this);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The saturation color value. A number between 0 and 1.\r\n * This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white.\r\n *\r\n * @name Phaser.Display.Color#s\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n s: {\r\n\r\n get: function ()\r\n {\r\n return this._s;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._s = value;\r\n\r\n HSVToRGB(this._h, value, this._v, this);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The lightness color value. A number between 0 and 1.\r\n * This controls how dark the color is. Where 1 is as bright as possible and 0 is black.\r\n *\r\n * @name Phaser.Display.Color#v\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n v: {\r\n\r\n get: function ()\r\n {\r\n return this._v;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._v = value;\r\n\r\n HSVToRGB(this._h, this._s, value, this);\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Color;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/Color.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/ColorToRGBA.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/color/ColorToRGBA.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Converts the given color value into an Object containing r,g,b and a properties.\r\n *\r\n * @function Phaser.Display.Color.ColorToRGBA\r\n * @since 3.0.0\r\n *\r\n * @param {number} color - A color value, optionally including the alpha value.\r\n *\r\n * @return {Phaser.Types.Display.ColorObject} An object containing the parsed color values.\r\n */\r\nvar ColorToRGBA = function (color)\r\n{\r\n var output = {\r\n r: color >> 16 & 0xFF,\r\n g: color >> 8 & 0xFF,\r\n b: color & 0xFF,\r\n a: 255\r\n };\r\n\r\n if (color > 16777215)\r\n {\r\n output.a = color >>> 24;\r\n }\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = ColorToRGBA;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/ColorToRGBA.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/ComponentToHex.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/display/color/ComponentToHex.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns a string containing a hex representation of the given color component.\r\n *\r\n * @function Phaser.Display.Color.ComponentToHex\r\n * @since 3.0.0\r\n *\r\n * @param {integer} color - The color channel to get the hex value for, must be a value between 0 and 255.\r\n *\r\n * @return {string} A string of length 2 characters, i.e. 255 = ff, 100 = 64.\r\n */\r\nvar ComponentToHex = function (color)\r\n{\r\n var hex = color.toString(16);\r\n\r\n return (hex.length === 1) ? '0' + hex : hex;\r\n};\r\n\r\nmodule.exports = ComponentToHex;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/ComponentToHex.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/GetColor.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/display/color/GetColor.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Given 3 separate color values this will return an integer representation of it.\r\n *\r\n * @function Phaser.Display.Color.GetColor\r\n * @since 3.0.0\r\n *\r\n * @param {integer} red - The red color value. A number between 0 and 255.\r\n * @param {integer} green - The green color value. A number between 0 and 255.\r\n * @param {integer} blue - The blue color value. A number between 0 and 255.\r\n *\r\n * @return {number} The combined color value.\r\n */\r\nvar GetColor = function (red, green, blue)\r\n{\r\n return red << 16 | green << 8 | blue;\r\n};\r\n\r\nmodule.exports = GetColor;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/GetColor.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/GetColor32.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/display/color/GetColor32.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Given an alpha and 3 color values this will return an integer representation of it.\r\n *\r\n * @function Phaser.Display.Color.GetColor32\r\n * @since 3.0.0\r\n *\r\n * @param {integer} red - The red color value. A number between 0 and 255.\r\n * @param {integer} green - The green color value. A number between 0 and 255.\r\n * @param {integer} blue - The blue color value. A number between 0 and 255.\r\n * @param {integer} alpha - The alpha color value. A number between 0 and 255.\r\n *\r\n * @return {number} The combined color value.\r\n */\r\nvar GetColor32 = function (red, green, blue, alpha)\r\n{\r\n return alpha << 24 | red << 16 | green << 8 | blue;\r\n};\r\n\r\nmodule.exports = GetColor32;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/GetColor32.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/HSLToColor.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/display/color/HSLToColor.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Color = __webpack_require__(/*! ./Color */ \"./node_modules/phaser/src/display/color/Color.js\");\r\nvar HueToComponent = __webpack_require__(/*! ./HueToComponent */ \"./node_modules/phaser/src/display/color/HueToComponent.js\");\r\n\r\n/**\r\n * Converts HSL (hue, saturation and lightness) values to a Phaser Color object.\r\n *\r\n * @function Phaser.Display.Color.HSLToColor\r\n * @since 3.0.0\r\n *\r\n * @param {number} h - The hue value in the range 0 to 1.\r\n * @param {number} s - The saturation value in the range 0 to 1.\r\n * @param {number} l - The lightness value in the range 0 to 1.\r\n *\r\n * @return {Phaser.Display.Color} A Color object created from the results of the h, s and l values.\r\n */\r\nvar HSLToColor = function (h, s, l)\r\n{\r\n // achromatic by default\r\n var r = l;\r\n var g = l;\r\n var b = l;\r\n\r\n if (s !== 0)\r\n {\r\n var q = (l < 0.5) ? l * (1 + s) : l + s - l * s;\r\n var p = 2 * l - q;\r\n\r\n r = HueToComponent(p, q, h + 1 / 3);\r\n g = HueToComponent(p, q, h);\r\n b = HueToComponent(p, q, h - 1 / 3);\r\n }\r\n\r\n var color = new Color();\r\n\r\n return color.setGLTo(r, g, b, 1);\r\n};\r\n\r\nmodule.exports = HSLToColor;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/HSLToColor.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/HSVColorWheel.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/display/color/HSVColorWheel.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar HSVToRGB = __webpack_require__(/*! ./HSVToRGB */ \"./node_modules/phaser/src/display/color/HSVToRGB.js\");\r\n\r\n/**\r\n * Get HSV color wheel values in an array which will be 360 elements in size.\r\n *\r\n * @function Phaser.Display.Color.HSVColorWheel\r\n * @since 3.0.0\r\n *\r\n * @param {number} [s=1] - The saturation, in the range 0 - 1.\r\n * @param {number} [v=1] - The value, in the range 0 - 1.\r\n *\r\n * @return {Phaser.Types.Display.ColorObject[]} An array containing 360 elements, where each contains a single numeric value corresponding to the color at that point in the HSV color wheel.\r\n */\r\nvar HSVColorWheel = function (s, v)\r\n{\r\n if (s === undefined) { s = 1; }\r\n if (v === undefined) { v = 1; }\r\n\r\n var colors = [];\r\n\r\n for (var c = 0; c <= 359; c++)\r\n {\r\n colors.push(HSVToRGB(c / 359, s, v));\r\n }\r\n\r\n return colors;\r\n};\r\n\r\nmodule.exports = HSVColorWheel;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/HSVColorWheel.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/HSVToRGB.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/display/color/HSVToRGB.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetColor = __webpack_require__(/*! ./GetColor */ \"./node_modules/phaser/src/display/color/GetColor.js\");\r\n\r\n/**\r\n * Converts an HSV (hue, saturation and value) color value to RGB.\r\n * Conversion formula from http://en.wikipedia.org/wiki/HSL_color_space.\r\n * Assumes HSV values are contained in the set [0, 1].\r\n * Based on code by Michael Jackson (https://github.com/mjijackson)\r\n *\r\n * @function Phaser.Display.Color.HSVToRGB\r\n * @since 3.0.0\r\n *\r\n * @param {number} h - The hue, in the range 0 - 1. This is the base color.\r\n * @param {number} s - The saturation, in the range 0 - 1. This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white.\r\n * @param {number} v - The value, in the range 0 - 1. This controls how dark the color is. Where 1 is as bright as possible and 0 is black.\r\n * @param {(Phaser.Types.Display.ColorObject|Phaser.Display.Color)} [out] - A Color object to store the results in. If not given a new ColorObject will be created.\r\n *\r\n * @return {(Phaser.Types.Display.ColorObject|Phaser.Display.Color)} An object with the red, green and blue values set in the r, g and b properties.\r\n */\r\nvar HSVToRGB = function (h, s, v, out)\r\n{\r\n if (s === undefined) { s = 1; }\r\n if (v === undefined) { v = 1; }\r\n\r\n var i = Math.floor(h * 6);\r\n var f = h * 6 - i;\r\n\r\n var p = Math.floor((v * (1 - s)) * 255);\r\n var q = Math.floor((v * (1 - f * s)) * 255);\r\n var t = Math.floor((v * (1 - (1 - f) * s)) * 255);\r\n\r\n v = Math.floor(v *= 255);\r\n\r\n var r = v;\r\n var g = v;\r\n var b = v;\r\n\r\n var c = i % 6;\r\n\r\n if (c === 0)\r\n {\r\n g = t;\r\n b = p;\r\n }\r\n else if (c === 1)\r\n {\r\n r = q;\r\n b = p;\r\n }\r\n else if (c === 2)\r\n {\r\n r = p;\r\n b = t;\r\n }\r\n else if (c === 3)\r\n {\r\n r = p;\r\n g = q;\r\n }\r\n else if (c === 4)\r\n {\r\n r = t;\r\n g = p;\r\n }\r\n else if (c === 5)\r\n {\r\n g = p;\r\n b = q;\r\n }\r\n\r\n if (!out)\r\n {\r\n return { r: r, g: g, b: b, color: GetColor(r, g, b) };\r\n }\r\n else if (out.setTo)\r\n {\r\n return out.setTo(r, g, b, out.alpha, false);\r\n }\r\n else\r\n {\r\n out.r = r;\r\n out.g = g;\r\n out.b = b;\r\n out.color = GetColor(r, g, b);\r\n\r\n return out;\r\n }\r\n};\r\n\r\nmodule.exports = HSVToRGB;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/HSVToRGB.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/HexStringToColor.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/display/color/HexStringToColor.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Color = __webpack_require__(/*! ./Color */ \"./node_modules/phaser/src/display/color/Color.js\");\r\n\r\n/**\r\n * Converts a hex string into a Phaser Color object.\r\n * \r\n * The hex string can supplied as `'#0033ff'` or the short-hand format of `'#03f'`; it can begin with an optional \"#\" or \"0x\", or be unprefixed.\r\n *\r\n * An alpha channel is _not_ supported.\r\n *\r\n * @function Phaser.Display.Color.HexStringToColor\r\n * @since 3.0.0\r\n *\r\n * @param {string} hex - The hex color value to convert, such as `#0033ff` or the short-hand format: `#03f`.\r\n *\r\n * @return {Phaser.Display.Color} A Color object populated by the values of the given string.\r\n */\r\nvar HexStringToColor = function (hex)\r\n{\r\n var color = new Color();\r\n\r\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\r\n hex = hex.replace(/^(?:#|0x)?([a-f\\d])([a-f\\d])([a-f\\d])$/i, function (m, r, g, b)\r\n {\r\n return r + r + g + g + b + b;\r\n });\r\n\r\n var result = (/^(?:#|0x)?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i).exec(hex);\r\n\r\n if (result)\r\n {\r\n var r = parseInt(result[1], 16);\r\n var g = parseInt(result[2], 16);\r\n var b = parseInt(result[3], 16);\r\n\r\n color.setTo(r, g, b);\r\n }\r\n\r\n return color;\r\n};\r\n\r\nmodule.exports = HexStringToColor;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/HexStringToColor.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/HueToComponent.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/display/color/HueToComponent.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Converts a hue to an RGB color.\r\n * Based on code by Michael Jackson (https://github.com/mjijackson)\r\n *\r\n * @function Phaser.Display.Color.HueToComponent\r\n * @since 3.0.0\r\n *\r\n * @param {number} p\r\n * @param {number} q\r\n * @param {number} t\r\n *\r\n * @return {number} The combined color value.\r\n */\r\nvar HueToComponent = function (p, q, t)\r\n{\r\n if (t < 0)\r\n {\r\n t += 1;\r\n }\r\n\r\n if (t > 1)\r\n {\r\n t -= 1;\r\n }\r\n\r\n if (t < 1 / 6)\r\n {\r\n return p + (q - p) * 6 * t;\r\n }\r\n\r\n if (t < 1 / 2)\r\n {\r\n return q;\r\n }\r\n\r\n if (t < 2 / 3)\r\n {\r\n return p + (q - p) * (2 / 3 - t) * 6;\r\n }\r\n\r\n return p;\r\n};\r\n\r\nmodule.exports = HueToComponent;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/HueToComponent.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/IntegerToColor.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/display/color/IntegerToColor.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Color = __webpack_require__(/*! ./Color */ \"./node_modules/phaser/src/display/color/Color.js\");\r\nvar IntegerToRGB = __webpack_require__(/*! ./IntegerToRGB */ \"./node_modules/phaser/src/display/color/IntegerToRGB.js\");\r\n\r\n/**\r\n * Converts the given color value into an instance of a Color object.\r\n *\r\n * @function Phaser.Display.Color.IntegerToColor\r\n * @since 3.0.0\r\n *\r\n * @param {integer} input - The color value to convert into a Color object.\r\n *\r\n * @return {Phaser.Display.Color} A Color object.\r\n */\r\nvar IntegerToColor = function (input)\r\n{\r\n var rgb = IntegerToRGB(input);\r\n\r\n return new Color(rgb.r, rgb.g, rgb.b, rgb.a);\r\n};\r\n\r\nmodule.exports = IntegerToColor;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/IntegerToColor.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/IntegerToRGB.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/display/color/IntegerToRGB.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Return the component parts of a color as an Object with the properties alpha, red, green, blue.\r\n *\r\n * Alpha will only be set if it exists in the given color (0xAARRGGBB)\r\n *\r\n * @function Phaser.Display.Color.IntegerToRGB\r\n * @since 3.0.0\r\n *\r\n * @param {integer} input - The color value to convert into a Color object.\r\n *\r\n * @return {Phaser.Types.Display.ColorObject} An object with the red, green and blue values set in the r, g and b properties.\r\n */\r\nvar IntegerToRGB = function (color)\r\n{\r\n if (color > 16777215)\r\n {\r\n // The color value has an alpha component\r\n return {\r\n a: color >>> 24,\r\n r: color >> 16 & 0xFF,\r\n g: color >> 8 & 0xFF,\r\n b: color & 0xFF\r\n };\r\n }\r\n else\r\n {\r\n return {\r\n a: 255,\r\n r: color >> 16 & 0xFF,\r\n g: color >> 8 & 0xFF,\r\n b: color & 0xFF\r\n };\r\n }\r\n};\r\n\r\nmodule.exports = IntegerToRGB;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/IntegerToRGB.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/Interpolate.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/color/Interpolate.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Linear = __webpack_require__(/*! ../../math/Linear */ \"./node_modules/phaser/src/math/Linear.js\");\r\n\r\n/**\r\n * @namespace Phaser.Display.Color.Interpolate\r\n * @memberof Phaser.Display.Color\r\n * @since 3.0.0\r\n */\r\n\r\n/**\r\n * Interpolates between the two given color ranges over the length supplied.\r\n *\r\n * @function Phaser.Display.Color.Interpolate.RGBWithRGB\r\n * @memberof Phaser.Display.Color.Interpolate\r\n * @static\r\n * @since 3.0.0\r\n *\r\n * @param {number} r1 - Red value.\r\n * @param {number} g1 - Blue value.\r\n * @param {number} b1 - Green value.\r\n * @param {number} r2 - Red value.\r\n * @param {number} g2 - Blue value.\r\n * @param {number} b2 - Green value.\r\n * @param {number} [length=100] - Distance to interpolate over.\r\n * @param {number} [index=0] - Index to start from.\r\n *\r\n * @return {Phaser.Types.Display.ColorObject} An object containing the interpolated color values.\r\n */\r\nvar RGBWithRGB = function (r1, g1, b1, r2, g2, b2, length, index)\r\n{\r\n if (length === undefined) { length = 100; }\r\n if (index === undefined) { index = 0; }\r\n\r\n var t = index / length;\r\n\r\n return {\r\n r: Linear(r1, r2, t),\r\n g: Linear(g1, g2, t),\r\n b: Linear(b1, b2, t)\r\n };\r\n};\r\n\r\n/**\r\n * Interpolates between the two given color objects over the length supplied.\r\n *\r\n * @function Phaser.Display.Color.Interpolate.ColorWithColor\r\n * @memberof Phaser.Display.Color.Interpolate\r\n * @static\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Display.Color} color1 - The first Color object.\r\n * @param {Phaser.Display.Color} color2 - The second Color object.\r\n * @param {number} [length=100] - Distance to interpolate over.\r\n * @param {number} [index=0] - Index to start from.\r\n *\r\n * @return {Phaser.Types.Display.ColorObject} An object containing the interpolated color values.\r\n */\r\nvar ColorWithColor = function (color1, color2, length, index)\r\n{\r\n if (length === undefined) { length = 100; }\r\n if (index === undefined) { index = 0; }\r\n\r\n return RGBWithRGB(color1.r, color1.g, color1.b, color2.r, color2.g, color2.b, length, index);\r\n};\r\n\r\n/**\r\n * Interpolates between the Color object and color values over the length supplied.\r\n *\r\n * @function Phaser.Display.Color.Interpolate.ColorWithRGB\r\n * @memberof Phaser.Display.Color.Interpolate\r\n * @static\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Display.Color} color1 - The first Color object.\r\n * @param {number} r - Red value.\r\n * @param {number} g - Blue value.\r\n * @param {number} b - Green value.\r\n * @param {number} [length=100] - Distance to interpolate over.\r\n * @param {number} [index=0] - Index to start from.\r\n *\r\n * @return {Phaser.Types.Display.ColorObject} An object containing the interpolated color values.\r\n */\r\nvar ColorWithRGB = function (color, r, g, b, length, index)\r\n{\r\n if (length === undefined) { length = 100; }\r\n if (index === undefined) { index = 0; }\r\n\r\n return RGBWithRGB(color.r, color.g, color.b, r, g, b, length, index);\r\n};\r\n\r\nmodule.exports = {\r\n\r\n RGBWithRGB: RGBWithRGB,\r\n ColorWithRGB: ColorWithRGB,\r\n ColorWithColor: ColorWithColor\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/Interpolate.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/ObjectToColor.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/display/color/ObjectToColor.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Color = __webpack_require__(/*! ./Color */ \"./node_modules/phaser/src/display/color/Color.js\");\r\n\r\n/**\r\n * Converts an object containing `r`, `g`, `b` and `a` properties into a Color class instance.\r\n *\r\n * @function Phaser.Display.Color.ObjectToColor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Display.InputColorObject} input - An object containing `r`, `g`, `b` and `a` properties in the range 0 to 255.\r\n *\r\n * @return {Phaser.Display.Color} A Color object.\r\n */\r\nvar ObjectToColor = function (input)\r\n{\r\n return new Color(input.r, input.g, input.b, input.a);\r\n};\r\n\r\nmodule.exports = ObjectToColor;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/ObjectToColor.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/RGBStringToColor.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/display/color/RGBStringToColor.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Color = __webpack_require__(/*! ./Color */ \"./node_modules/phaser/src/display/color/Color.js\");\r\n\r\n/**\r\n * Converts a CSS 'web' string into a Phaser Color object.\r\n * \r\n * The web string can be in the format `'rgb(r,g,b)'` or `'rgba(r,g,b,a)'` where r/g/b are in the range [0..255] and a is in the range [0..1].\r\n *\r\n * @function Phaser.Display.Color.RGBStringToColor\r\n * @since 3.0.0\r\n *\r\n * @param {string} rgb - The CSS format color string, using the `rgb` or `rgba` format.\r\n *\r\n * @return {Phaser.Display.Color} A Color object.\r\n */\r\nvar RGBStringToColor = function (rgb)\r\n{\r\n var color = new Color();\r\n\r\n var result = (/^rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d+(?:\\.\\d+)?))?\\s*\\)$/).exec(rgb.toLowerCase());\r\n\r\n if (result)\r\n {\r\n var r = parseInt(result[1], 10);\r\n var g = parseInt(result[2], 10);\r\n var b = parseInt(result[3], 10);\r\n var a = (result[4] !== undefined) ? parseFloat(result[4]) : 1;\r\n\r\n color.setTo(r, g, b, a * 255);\r\n }\r\n\r\n return color;\r\n};\r\n\r\nmodule.exports = RGBStringToColor;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/RGBStringToColor.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/RGBToHSV.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/display/color/RGBToHSV.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Converts an RGB color value to HSV (hue, saturation and value).\r\n * Conversion formula from http://en.wikipedia.org/wiki/HSL_color_space.\r\n * Assumes RGB values are contained in the set [0, 255] and returns h, s and v in the set [0, 1].\r\n * Based on code by Michael Jackson (https://github.com/mjijackson)\r\n *\r\n * @function Phaser.Display.Color.RGBToHSV\r\n * @since 3.0.0\r\n *\r\n * @param {integer} r - The red color value. A number between 0 and 255.\r\n * @param {integer} g - The green color value. A number between 0 and 255.\r\n * @param {integer} b - The blue color value. A number between 0 and 255.\r\n * @param {(Phaser.Types.Display.HSVColorObject|Phaser.Display.Color)} [out] - An object to store the color values in. If not given an HSV Color Object will be created.\r\n *\r\n * @return {(Phaser.Types.Display.HSVColorObject|Phaser.Display.Color)} An object with the properties `h`, `s` and `v` set.\r\n */\r\nvar RGBToHSV = function (r, g, b, out)\r\n{\r\n if (out === undefined) { out = { h: 0, s: 0, v: 0 }; }\r\n\r\n r /= 255;\r\n g /= 255;\r\n b /= 255;\r\n\r\n var min = Math.min(r, g, b);\r\n var max = Math.max(r, g, b);\r\n var d = max - min;\r\n\r\n // achromatic by default\r\n var h = 0;\r\n var s = (max === 0) ? 0 : d / max;\r\n var v = max;\r\n\r\n if (max !== min)\r\n {\r\n if (max === r)\r\n {\r\n h = (g - b) / d + ((g < b) ? 6 : 0);\r\n }\r\n else if (max === g)\r\n {\r\n h = (b - r) / d + 2;\r\n }\r\n else if (max === b)\r\n {\r\n h = (r - g) / d + 4;\r\n }\r\n\r\n h /= 6;\r\n }\r\n\r\n if (out.hasOwnProperty('_h'))\r\n {\r\n out._h = h;\r\n out._s = s;\r\n out._v = v;\r\n }\r\n else\r\n {\r\n out.h = h;\r\n out.s = s;\r\n out.v = v;\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = RGBToHSV;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/RGBToHSV.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/RGBToString.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/color/RGBToString.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ComponentToHex = __webpack_require__(/*! ./ComponentToHex */ \"./node_modules/phaser/src/display/color/ComponentToHex.js\");\r\n\r\n/**\r\n * Converts the color values into an HTML compatible color string, prefixed with either `#` or `0x`.\r\n *\r\n * @function Phaser.Display.Color.RGBToString\r\n * @since 3.0.0\r\n *\r\n * @param {integer} r - The red color value. A number between 0 and 255.\r\n * @param {integer} g - The green color value. A number between 0 and 255.\r\n * @param {integer} b - The blue color value. A number between 0 and 255.\r\n * @param {integer} [a=255] - The alpha value. A number between 0 and 255.\r\n * @param {string} [prefix=#] - The prefix of the string. Either `#` or `0x`.\r\n *\r\n * @return {string} A string-based representation of the color values.\r\n */\r\nvar RGBToString = function (r, g, b, a, prefix)\r\n{\r\n if (a === undefined) { a = 255; }\r\n if (prefix === undefined) { prefix = '#'; }\r\n\r\n if (prefix === '#')\r\n {\r\n return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);\r\n }\r\n else\r\n {\r\n return '0x' + ComponentToHex(a) + ComponentToHex(r) + ComponentToHex(g) + ComponentToHex(b);\r\n }\r\n};\r\n\r\nmodule.exports = RGBToString;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/RGBToString.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/RandomRGB.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/display/color/RandomRGB.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Between = __webpack_require__(/*! ../../math/Between */ \"./node_modules/phaser/src/math/Between.js\");\r\nvar Color = __webpack_require__(/*! ./Color */ \"./node_modules/phaser/src/display/color/Color.js\");\r\n\r\n/**\r\n * Creates a new Color object where the r, g, and b values have been set to random values\r\n * based on the given min max values.\r\n *\r\n * @function Phaser.Display.Color.RandomRGB\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [min=0] - The minimum value to set the random range from (between 0 and 255)\r\n * @param {integer} [max=255] - The maximum value to set the random range from (between 0 and 255)\r\n *\r\n * @return {Phaser.Display.Color} A Color object.\r\n */\r\nvar RandomRGB = function (min, max)\r\n{\r\n if (min === undefined) { min = 0; }\r\n if (max === undefined) { max = 255; }\r\n\r\n return new Color(Between(min, max), Between(min, max), Between(min, max));\r\n};\r\n\r\nmodule.exports = RandomRGB;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/RandomRGB.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/ValueToColor.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/display/color/ValueToColor.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar HexStringToColor = __webpack_require__(/*! ./HexStringToColor */ \"./node_modules/phaser/src/display/color/HexStringToColor.js\");\r\nvar IntegerToColor = __webpack_require__(/*! ./IntegerToColor */ \"./node_modules/phaser/src/display/color/IntegerToColor.js\");\r\nvar ObjectToColor = __webpack_require__(/*! ./ObjectToColor */ \"./node_modules/phaser/src/display/color/ObjectToColor.js\");\r\nvar RGBStringToColor = __webpack_require__(/*! ./RGBStringToColor */ \"./node_modules/phaser/src/display/color/RGBStringToColor.js\");\r\n\r\n/**\r\n * Converts the given source color value into an instance of a Color class.\r\n * The value can be either a string, prefixed with `rgb` or a hex string, a number or an Object.\r\n *\r\n * @function Phaser.Display.Color.ValueToColor\r\n * @since 3.0.0\r\n *\r\n * @param {(string|number|Phaser.Types.Display.InputColorObject)} input - The source color value to convert.\r\n *\r\n * @return {Phaser.Display.Color} A Color object.\r\n */\r\nvar ValueToColor = function (input)\r\n{\r\n var t = typeof input;\r\n\r\n switch (t)\r\n {\r\n case 'string':\r\n\r\n if (input.substr(0, 3).toLowerCase() === 'rgb')\r\n {\r\n return RGBStringToColor(input);\r\n }\r\n else\r\n {\r\n return HexStringToColor(input);\r\n }\r\n\r\n case 'number':\r\n\r\n return IntegerToColor(input);\r\n\r\n case 'object':\r\n\r\n return ObjectToColor(input);\r\n }\r\n};\r\n\r\nmodule.exports = ValueToColor;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/ValueToColor.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/color/index.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/display/color/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Color = __webpack_require__(/*! ./Color */ \"./node_modules/phaser/src/display/color/Color.js\");\r\n\r\nColor.ColorToRGBA = __webpack_require__(/*! ./ColorToRGBA */ \"./node_modules/phaser/src/display/color/ColorToRGBA.js\");\r\nColor.ComponentToHex = __webpack_require__(/*! ./ComponentToHex */ \"./node_modules/phaser/src/display/color/ComponentToHex.js\");\r\nColor.GetColor = __webpack_require__(/*! ./GetColor */ \"./node_modules/phaser/src/display/color/GetColor.js\");\r\nColor.GetColor32 = __webpack_require__(/*! ./GetColor32 */ \"./node_modules/phaser/src/display/color/GetColor32.js\");\r\nColor.HexStringToColor = __webpack_require__(/*! ./HexStringToColor */ \"./node_modules/phaser/src/display/color/HexStringToColor.js\");\r\nColor.HSLToColor = __webpack_require__(/*! ./HSLToColor */ \"./node_modules/phaser/src/display/color/HSLToColor.js\");\r\nColor.HSVColorWheel = __webpack_require__(/*! ./HSVColorWheel */ \"./node_modules/phaser/src/display/color/HSVColorWheel.js\");\r\nColor.HSVToRGB = __webpack_require__(/*! ./HSVToRGB */ \"./node_modules/phaser/src/display/color/HSVToRGB.js\");\r\nColor.HueToComponent = __webpack_require__(/*! ./HueToComponent */ \"./node_modules/phaser/src/display/color/HueToComponent.js\");\r\nColor.IntegerToColor = __webpack_require__(/*! ./IntegerToColor */ \"./node_modules/phaser/src/display/color/IntegerToColor.js\");\r\nColor.IntegerToRGB = __webpack_require__(/*! ./IntegerToRGB */ \"./node_modules/phaser/src/display/color/IntegerToRGB.js\");\r\nColor.Interpolate = __webpack_require__(/*! ./Interpolate */ \"./node_modules/phaser/src/display/color/Interpolate.js\");\r\nColor.ObjectToColor = __webpack_require__(/*! ./ObjectToColor */ \"./node_modules/phaser/src/display/color/ObjectToColor.js\");\r\nColor.RandomRGB = __webpack_require__(/*! ./RandomRGB */ \"./node_modules/phaser/src/display/color/RandomRGB.js\");\r\nColor.RGBStringToColor = __webpack_require__(/*! ./RGBStringToColor */ \"./node_modules/phaser/src/display/color/RGBStringToColor.js\");\r\nColor.RGBToHSV = __webpack_require__(/*! ./RGBToHSV */ \"./node_modules/phaser/src/display/color/RGBToHSV.js\");\r\nColor.RGBToString = __webpack_require__(/*! ./RGBToString */ \"./node_modules/phaser/src/display/color/RGBToString.js\");\r\nColor.ValueToColor = __webpack_require__(/*! ./ValueToColor */ \"./node_modules/phaser/src/display/color/ValueToColor.js\");\r\n\r\nmodule.exports = Color;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/color/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/index.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/display/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Display\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Align: __webpack_require__(/*! ./align */ \"./node_modules/phaser/src/display/align/index.js\"),\r\n BaseShader: __webpack_require__(/*! ./shader/BaseShader */ \"./node_modules/phaser/src/display/shader/BaseShader.js\"),\r\n Bounds: __webpack_require__(/*! ./bounds */ \"./node_modules/phaser/src/display/bounds/index.js\"),\r\n Canvas: __webpack_require__(/*! ./canvas */ \"./node_modules/phaser/src/display/canvas/index.js\"),\r\n Color: __webpack_require__(/*! ./color */ \"./node_modules/phaser/src/display/color/index.js\"),\r\n Masks: __webpack_require__(/*! ./mask */ \"./node_modules/phaser/src/display/mask/index.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/mask/BitmapMask.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/display/mask/BitmapMask.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GameEvents = __webpack_require__(/*! ../../core/events */ \"./node_modules/phaser/src/core/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel.\r\n * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask,\r\n * not a clipping path. It is only available when using the WebGL Renderer.\r\n *\r\n * A Bitmap Mask can use any Game Object to determine the alpha of each pixel of the masked Game Object(s).\r\n * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha\r\n * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the\r\n * Bitmap Mask doesn't matter.\r\n *\r\n * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an\r\n * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means\r\n * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects\r\n * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the\r\n * corresponding pixel in the mask.\r\n *\r\n * The Bitmap Mask's location matches the location of its Game Object, not the location of the\r\n * masked objects. Moving or transforming the underlying Game Object will change the mask\r\n * (and affect the visibility of any masked objects), whereas moving or transforming a masked object\r\n * will not affect the mask.\r\n *\r\n * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a\r\n * Scene's display list, it will only be used for the mask and its full texture will not be directly\r\n * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will\r\n * render as a normal Game Object and will also serve as a mask.\r\n *\r\n * @class BitmapMask\r\n * @memberof Phaser.Display.Masks\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene which this Bitmap Mask will be used in.\r\n * @param {Phaser.GameObjects.GameObject} renderable - A renderable Game Object that uses a texture, such as a Sprite.\r\n */\r\nvar BitmapMask = new Class({\r\n\r\n initialize:\r\n\r\n function BitmapMask (scene, renderable)\r\n {\r\n var renderer = scene.sys.game.renderer;\r\n\r\n /**\r\n * A reference to either the Canvas or WebGL Renderer that this Mask is using.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#renderer\r\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\r\n * @since 3.11.0\r\n */\r\n this.renderer = renderer;\r\n\r\n /**\r\n * A renderable Game Object that uses a texture, such as a Sprite.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#bitmapMask\r\n * @type {Phaser.GameObjects.GameObject}\r\n * @since 3.0.0\r\n */\r\n this.bitmapMask = renderable;\r\n\r\n /**\r\n * The texture used for the mask's framebuffer.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#maskTexture\r\n * @type {WebGLTexture}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.maskTexture = null;\r\n\r\n /**\r\n * The texture used for the main framebuffer.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#mainTexture\r\n * @type {WebGLTexture}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.mainTexture = null;\r\n\r\n /**\r\n * Whether the Bitmap Mask is dirty and needs to be updated.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#dirty\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.dirty = true;\r\n\r\n /**\r\n * The framebuffer to which a masked Game Object is rendered.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#mainFramebuffer\r\n * @type {WebGLFramebuffer}\r\n * @since 3.0.0\r\n */\r\n this.mainFramebuffer = null;\r\n\r\n /**\r\n * The framebuffer to which the Bitmap Mask's masking Game Object is rendered.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#maskFramebuffer\r\n * @type {WebGLFramebuffer}\r\n * @since 3.0.0\r\n */\r\n this.maskFramebuffer = null;\r\n\r\n /**\r\n * The previous framebuffer set in the renderer before this one was enabled.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#prevFramebuffer\r\n * @type {WebGLFramebuffer}\r\n * @since 3.17.0\r\n */\r\n this.prevFramebuffer = null;\r\n\r\n /**\r\n * Whether to invert the masks alpha.\r\n *\r\n * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#invertAlpha\r\n * @type {boolean}\r\n * @since 3.1.2\r\n */\r\n this.invertAlpha = false;\r\n\r\n /**\r\n * Is this mask a stencil mask?\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#isStencil\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.17.0\r\n */\r\n this.isStencil = false;\r\n\r\n if (renderer && renderer.gl)\r\n {\r\n var width = renderer.width;\r\n var height = renderer.height;\r\n var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0);\r\n var gl = renderer.gl;\r\n var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE;\r\n var filter = gl.LINEAR;\r\n\r\n this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height);\r\n this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height);\r\n this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true);\r\n this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true);\r\n\r\n scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer)\r\n {\r\n var width = renderer.width;\r\n var height = renderer.height;\r\n var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0);\r\n var gl = renderer.gl;\r\n var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE;\r\n var filter = gl.LINEAR;\r\n\r\n this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height);\r\n this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height);\r\n this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true);\r\n this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true);\r\n\r\n }, this);\r\n }\r\n },\r\n\r\n /**\r\n * Sets a new masking Game Object for the Bitmap Mask.\r\n *\r\n * @method Phaser.Display.Masks.BitmapMask#setBitmap\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} renderable - A renderable Game Object that uses a texture, such as a Sprite.\r\n */\r\n setBitmap: function (renderable)\r\n {\r\n this.bitmapMask = renderable;\r\n },\r\n\r\n /**\r\n * Prepares the WebGL Renderer to render a Game Object with this mask applied.\r\n *\r\n * This renders the masking Game Object to the mask framebuffer and switches to the main framebuffer so that the masked Game Object will be rendered to it instead of being rendered directly to the frame.\r\n *\r\n * @method Phaser.Display.Masks.BitmapMask#preRenderWebGL\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to prepare.\r\n * @param {Phaser.GameObjects.GameObject} maskedObject - The masked Game Object which will be drawn.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to.\r\n */\r\n preRenderWebGL: function (renderer, maskedObject, camera)\r\n {\r\n renderer.pipelines.BitmapMaskPipeline.beginMask(this, maskedObject, camera);\r\n },\r\n\r\n /**\r\n * Finalizes rendering of a masked Game Object.\r\n *\r\n * This resets the previously bound framebuffer and switches the WebGL Renderer to the Bitmap Mask Pipeline, which uses a special fragment shader to apply the masking effect.\r\n *\r\n * @method Phaser.Display.Masks.BitmapMask#postRenderWebGL\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to clean up.\r\n */\r\n postRenderWebGL: function (renderer, camera)\r\n {\r\n renderer.pipelines.BitmapMaskPipeline.endMask(this, camera);\r\n },\r\n\r\n /**\r\n * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer.\r\n *\r\n * @method Phaser.Display.Masks.BitmapMask#preRenderCanvas\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to.\r\n * @param {Phaser.GameObjects.GameObject} mask - The masked Game Object which would be rendered.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to.\r\n */\r\n preRenderCanvas: function ()\r\n {\r\n // NOOP\r\n },\r\n\r\n /**\r\n * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer.\r\n *\r\n * @method Phaser.Display.Masks.BitmapMask#postRenderCanvas\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to.\r\n */\r\n postRenderCanvas: function ()\r\n {\r\n // NOOP\r\n },\r\n\r\n /**\r\n * Destroys this BitmapMask and nulls any references it holds.\r\n * \r\n * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it,\r\n * so be sure to call `clearMask` on any Game Object using it, before destroying it.\r\n *\r\n * @method Phaser.Display.Masks.BitmapMask#destroy\r\n * @since 3.7.0\r\n */\r\n destroy: function ()\r\n {\r\n this.bitmapMask = null;\r\n\r\n var renderer = this.renderer;\r\n\r\n if (renderer && renderer.gl)\r\n {\r\n renderer.deleteTexture(this.mainTexture);\r\n renderer.deleteTexture(this.maskTexture);\r\n renderer.deleteFramebuffer(this.mainFramebuffer);\r\n renderer.deleteFramebuffer(this.maskFramebuffer);\r\n }\r\n\r\n this.mainTexture = null;\r\n this.maskTexture = null;\r\n this.mainFramebuffer = null;\r\n this.maskFramebuffer = null;\r\n this.prevFramebuffer = null;\r\n this.renderer = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = BitmapMask;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/mask/BitmapMask.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/mask/GeometryMask.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/mask/GeometryMask.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect\r\n * a visible pixel from the geometry mask. The mask is essentially a clipping path which can only\r\n * make a masked pixel fully visible or fully invisible without changing its alpha (opacity).\r\n *\r\n * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s)\r\n * should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed\r\n * if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and\r\n * alpha of the pixel from the Geometry Mask do not matter.\r\n *\r\n * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects.\r\n * Moving or transforming the underlying Graphics object will change the mask (and affect the visibility\r\n * of any masked objects), whereas moving or transforming a masked object will not affect the mask.\r\n * You can think of the Geometry Mask (or rather, of its Graphics object) as an invisible curtain placed\r\n * in front of all masked objects which has its own visual properties and, naturally, respects the camera's\r\n * visual properties, but isn't affected by and doesn't follow the masked objects by itself.\r\n *\r\n * @class GeometryMask\r\n * @memberof Phaser.Display.Masks\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - This parameter is not used.\r\n * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List.\r\n */\r\nvar GeometryMask = new Class({\r\n\r\n initialize:\r\n\r\n function GeometryMask (scene, graphicsGeometry)\r\n {\r\n /**\r\n * The Graphics object which describes the Geometry Mask.\r\n *\r\n * @name Phaser.Display.Masks.GeometryMask#geometryMask\r\n * @type {Phaser.GameObjects.Graphics}\r\n * @since 3.0.0\r\n */\r\n this.geometryMask = graphicsGeometry;\r\n\r\n /**\r\n * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels\r\n * drawn to the Geometry Mask.\r\n *\r\n * @name Phaser.Display.Masks.GeometryMask#invertAlpha\r\n * @type {boolean}\r\n * @since 3.16.0\r\n */\r\n this.invertAlpha = false;\r\n\r\n /**\r\n * Is this mask a stencil mask?\r\n *\r\n * @name Phaser.Display.Masks.GeometryMask#isStencil\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.17.0\r\n */\r\n this.isStencil = true;\r\n\r\n /**\r\n * The current stencil level.\r\n *\r\n * @name Phaser.Display.Masks.GeometryMask#level\r\n * @type {boolean}\r\n * @private\r\n * @since 3.17.0\r\n */\r\n this.level = 0;\r\n },\r\n\r\n /**\r\n * Sets a new Graphics object for the Geometry Mask.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#setShape\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask.\r\n * \r\n * @return {this} This Geometry Mask\r\n */\r\n setShape: function (graphicsGeometry)\r\n {\r\n this.geometryMask = graphicsGeometry;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the `invertAlpha` property of this Geometry Mask.\r\n * Inverting the alpha essentially flips the way the mask works.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#setInvertAlpha\r\n * @since 3.17.0\r\n *\r\n * @param {boolean} [value=true] - Invert the alpha of this mask?\r\n * \r\n * @return {this} This Geometry Mask\r\n */\r\n setInvertAlpha: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.invertAlpha = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * 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.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#preRenderWebGL\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to.\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object being rendered.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through.\r\n */\r\n preRenderWebGL: function (renderer, child, camera)\r\n {\r\n var gl = renderer.gl;\r\n\r\n // Force flushing before drawing to stencil buffer\r\n renderer.flush();\r\n\r\n if (renderer.maskStack.length === 0)\r\n {\r\n gl.enable(gl.STENCIL_TEST);\r\n gl.clear(gl.STENCIL_BUFFER_BIT);\r\n\r\n renderer.maskCount = 0;\r\n }\r\n\r\n if (renderer.currentCameraMask.mask !== this)\r\n {\r\n renderer.currentMask.mask = this;\r\n }\r\n\r\n renderer.maskStack.push({ mask: this, camera: camera });\r\n\r\n this.applyStencil(renderer, camera, true);\r\n\r\n renderer.maskCount++;\r\n },\r\n\r\n /**\r\n * Applies the current stencil mask to the renderer.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#applyStencil\r\n * @since 3.17.0\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through.\r\n * @param {boolean} inc - Is this an INCR stencil or a DECR stencil?\r\n */\r\n applyStencil: function (renderer, camera, inc)\r\n {\r\n var gl = renderer.gl;\r\n var geometryMask = this.geometryMask;\r\n var level = renderer.maskCount;\r\n\r\n gl.colorMask(false, false, false, false);\r\n\r\n if (inc)\r\n {\r\n gl.stencilFunc(gl.EQUAL, level, 0xFF);\r\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);\r\n }\r\n else\r\n {\r\n gl.stencilFunc(gl.EQUAL, level + 1, 0xFF);\r\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR);\r\n }\r\n\r\n // Write stencil buffer\r\n geometryMask.renderWebGL(renderer, geometryMask, 0, camera);\r\n\r\n renderer.flush();\r\n\r\n gl.colorMask(true, true, true, true);\r\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\r\n\r\n if (inc)\r\n {\r\n if (this.invertAlpha)\r\n {\r\n gl.stencilFunc(gl.NOTEQUAL, level + 1, 0xFF);\r\n }\r\n else\r\n {\r\n gl.stencilFunc(gl.EQUAL, level + 1, 0xFF);\r\n }\r\n }\r\n else if (this.invertAlpha)\r\n {\r\n gl.stencilFunc(gl.NOTEQUAL, level, 0xFF);\r\n }\r\n else\r\n {\r\n gl.stencilFunc(gl.EQUAL, level, 0xFF);\r\n }\r\n },\r\n\r\n /**\r\n * Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#postRenderWebGL\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw flush.\r\n */\r\n postRenderWebGL: function (renderer)\r\n {\r\n var gl = renderer.gl;\r\n\r\n renderer.maskStack.pop();\r\n\r\n renderer.maskCount--;\r\n\r\n if (renderer.maskStack.length === 0)\r\n {\r\n // If this is the only mask in the stack, flush and disable\r\n renderer.flush();\r\n\r\n renderer.currentMask.mask = null;\r\n\r\n gl.disable(gl.STENCIL_TEST);\r\n }\r\n else\r\n {\r\n // Force flush before disabling stencil test\r\n renderer.flush();\r\n\r\n var prev = renderer.maskStack[renderer.maskStack.length - 1];\r\n\r\n prev.mask.applyStencil(renderer, prev.camera, false);\r\n\r\n if (renderer.currentCameraMask.mask !== prev.mask)\r\n {\r\n renderer.currentMask.mask = prev.mask;\r\n renderer.currentMask.camera = prev.camera;\r\n }\r\n else\r\n {\r\n renderer.currentMask.mask = null;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#preRenderCanvas\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance to set the clipping path on.\r\n * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through.\r\n */\r\n preRenderCanvas: function (renderer, mask, camera)\r\n {\r\n var geometryMask = this.geometryMask;\r\n\r\n renderer.currentContext.save();\r\n\r\n geometryMask.renderCanvas(renderer, geometryMask, 0, camera, null, null, true);\r\n\r\n renderer.currentContext.clip();\r\n },\r\n\r\n /**\r\n * Restore the canvas context's previous clipping path, thus turning off the mask for it.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#postRenderCanvas\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance being restored.\r\n */\r\n postRenderCanvas: function (renderer)\r\n {\r\n renderer.currentContext.restore();\r\n },\r\n\r\n /**\r\n * Destroys this GeometryMask and nulls any references it holds.\r\n *\r\n * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it,\r\n * so be sure to call `clearMask` on any Game Object using it, before destroying it.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#destroy\r\n * @since 3.7.0\r\n */\r\n destroy: function ()\r\n {\r\n this.geometryMask = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = GeometryMask;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/mask/GeometryMask.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/mask/index.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/display/mask/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Display.Masks\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BitmapMask: __webpack_require__(/*! ./BitmapMask */ \"./node_modules/phaser/src/display/mask/BitmapMask.js\"),\r\n GeometryMask: __webpack_require__(/*! ./GeometryMask */ \"./node_modules/phaser/src/display/mask/GeometryMask.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/mask/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/display/shader/BaseShader.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/display/shader/BaseShader.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A BaseShader is a small resource class that contains the data required for a WebGL Shader to be created.\r\n * \r\n * It contains the raw source code to the fragment and vertex shader, as well as an object that defines\r\n * the uniforms the shader requires, if any.\r\n * \r\n * BaseShaders are stored in the Shader Cache, available in a Scene via `this.cache.shaders` and are referenced\r\n * by a unique key-based string. Retrieve them via `this.cache.shaders.get(key)`.\r\n * \r\n * BaseShaders are created automatically by the GLSL File Loader when loading an external shader resource.\r\n * They can also be created at runtime, allowing you to use dynamically generated shader source code.\r\n * \r\n * Default fragment and vertex source is used if not provided in the constructor, setting-up a basic shader,\r\n * suitable for debug rendering.\r\n *\r\n * @class BaseShader\r\n * @memberof Phaser.Display\r\n * @constructor\r\n * @since 3.17.0\r\n *\r\n * @param {string} key - The key of this shader. Must be unique within the shader cache.\r\n * @param {string} [fragmentSrc] - The fragment source for the shader.\r\n * @param {string} [vertexSrc] - The vertex source for the shader.\r\n * @param {any} [uniforms] - Optional object defining the uniforms the shader uses.\r\n */\r\nvar BaseShader = new Class({\r\n\r\n initialize:\r\n\r\n function BaseShader (key, fragmentSrc, vertexSrc, uniforms)\r\n {\r\n if (!fragmentSrc || fragmentSrc === '')\r\n {\r\n fragmentSrc = [\r\n 'precision mediump float;',\r\n\r\n 'uniform vec2 resolution;',\r\n\r\n 'varying vec2 fragCoord;',\r\n\r\n 'void main () {',\r\n ' vec2 uv = fragCoord / resolution.xy;',\r\n ' gl_FragColor = vec4(uv.xyx, 1.0);',\r\n '}'\r\n ].join('\\n');\r\n }\r\n\r\n if (!vertexSrc || vertexSrc === '')\r\n {\r\n vertexSrc = [\r\n 'precision mediump float;',\r\n\r\n 'uniform mat4 uProjectionMatrix;',\r\n 'uniform mat4 uViewMatrix;',\r\n 'uniform vec2 uResolution;',\r\n\r\n 'attribute vec2 inPosition;',\r\n\r\n 'varying vec2 fragCoord;',\r\n\r\n 'void main () {',\r\n 'gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);',\r\n 'fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);',\r\n '}'\r\n ].join('\\n');\r\n }\r\n\r\n if (uniforms === undefined) { uniforms = null; }\r\n\r\n /**\r\n * The key of this shader, unique within the shader cache of this Phaser game instance.\r\n *\r\n * @name Phaser.Display.BaseShader#key\r\n * @type {string}\r\n * @since 3.17.0\r\n */\r\n this.key = key;\r\n\r\n /**\r\n * The source code, as a string, of the fragment shader being used.\r\n *\r\n * @name Phaser.Display.BaseShader#fragmentSrc\r\n * @type {string}\r\n * @since 3.17.0\r\n */\r\n this.fragmentSrc = fragmentSrc;\r\n\r\n /**\r\n * The source code, as a string, of the vertex shader being used.\r\n *\r\n * @name Phaser.Display.BaseShader#vertexSrc\r\n * @type {string}\r\n * @since 3.17.0\r\n */\r\n this.vertexSrc = vertexSrc;\r\n\r\n /**\r\n * The default uniforms for this shader.\r\n *\r\n * @name Phaser.Display.BaseShader#uniforms\r\n * @type {?any}\r\n * @since 3.17.0\r\n */\r\n this.uniforms = uniforms;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = BaseShader;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/display/shader/BaseShader.js?"); /***/ }), /***/ "./node_modules/phaser/src/dom/AddToDOM.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/dom/AddToDOM.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Adds the given element to the DOM. If a parent is provided the element is added as a child of the parent, providing it was able to access it.\r\n * If no parent was given it falls back to using `document.body`.\r\n *\r\n * @function Phaser.DOM.AddToDOM\r\n * @since 3.0.0\r\n *\r\n * @param {HTMLElement} element - The element to be added to the DOM. Usually a Canvas object.\r\n * @param {(string|HTMLElement)} [parent] - The parent in which to add the element. Can be a string which is passed to `getElementById` or an actual DOM object.\r\n *\r\n * @return {HTMLElement} The element that was added to the DOM.\r\n */\r\nvar AddToDOM = function (element, parent)\r\n{\r\n var target;\r\n\r\n if (parent)\r\n {\r\n if (typeof parent === 'string')\r\n {\r\n // Hopefully an element ID\r\n target = document.getElementById(parent);\r\n }\r\n else if (typeof parent === 'object' && parent.nodeType === 1)\r\n {\r\n // Quick test for a HTMLElement\r\n target = parent;\r\n }\r\n }\r\n else if (element.parentElement)\r\n {\r\n return element;\r\n }\r\n\r\n // Fallback, covers an invalid ID and a non HTMLElement object\r\n if (!target)\r\n {\r\n target = document.body;\r\n }\r\n\r\n target.appendChild(element);\r\n\r\n return element;\r\n};\r\n\r\nmodule.exports = AddToDOM;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/dom/AddToDOM.js?"); /***/ }), /***/ "./node_modules/phaser/src/dom/CreateDOMContainer.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/dom/CreateDOMContainer.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar AddToDOM = __webpack_require__(/*! ../dom/AddToDOM */ \"./node_modules/phaser/src/dom/AddToDOM.js\");\r\n\r\nvar CreateDOMContainer = function (game)\r\n{\r\n var config = game.config;\r\n\r\n if (!config.parent || !config.domCreateContainer)\r\n {\r\n return;\r\n }\r\n\r\n // DOM Element Container\r\n var div = document.createElement('div');\r\n\r\n div.style.cssText = [\r\n 'display: block;',\r\n 'width: ' + game.scale.width + 'px;',\r\n 'height: ' + game.scale.height + 'px;',\r\n 'padding: 0; margin: 0;',\r\n 'position: absolute;',\r\n 'overflow: hidden;',\r\n 'pointer-events: none;',\r\n 'transform: scale(1);',\r\n 'transform-origin: left top;'\r\n ].join(' ');\r\n\r\n game.domContainer = div;\r\n\r\n AddToDOM(div, config.parent);\r\n};\r\n\r\nmodule.exports = CreateDOMContainer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/dom/CreateDOMContainer.js?"); /***/ }), /***/ "./node_modules/phaser/src/dom/DOMContentLoaded.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/dom/DOMContentLoaded.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar OS = __webpack_require__(/*! ../device/OS */ \"./node_modules/phaser/src/device/OS.js\");\r\n\r\n/**\r\n * @callback ContentLoadedCallback\r\n */\r\n\r\n/**\r\n * Inspects the readyState of the document. If the document is already complete then it invokes the given callback.\r\n * If not complete it sets up several event listeners such as `deviceready`, and once those fire, it invokes the callback.\r\n * Called automatically by the Phaser.Game instance. Should not usually be accessed directly.\r\n *\r\n * @function Phaser.DOM.DOMContentLoaded\r\n * @since 3.0.0\r\n *\r\n * @param {ContentLoadedCallback} callback - The callback to be invoked when the device is ready and the DOM content is loaded.\r\n */\r\nvar DOMContentLoaded = function (callback)\r\n{\r\n if (document.readyState === 'complete' || document.readyState === 'interactive')\r\n {\r\n callback();\r\n\r\n return;\r\n }\r\n\r\n var check = function ()\r\n {\r\n document.removeEventListener('deviceready', check, true);\r\n document.removeEventListener('DOMContentLoaded', check, true);\r\n window.removeEventListener('load', check, true);\r\n\r\n callback();\r\n };\r\n\r\n if (!document.body)\r\n {\r\n window.setTimeout(check, 20);\r\n }\r\n else if (OS.cordova)\r\n {\r\n // Ref. http://docs.phonegap.com/en/3.5.0/cordova_events_events.md.html#deviceready\r\n document.addEventListener('deviceready', check, false);\r\n }\r\n else\r\n {\r\n document.addEventListener('DOMContentLoaded', check, true);\r\n window.addEventListener('load', check, true);\r\n }\r\n};\r\n\r\nmodule.exports = DOMContentLoaded;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/dom/DOMContentLoaded.js?"); /***/ }), /***/ "./node_modules/phaser/src/dom/GetInnerHeight.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/dom/GetInnerHeight.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Attempts to determine the document inner height across iOS and standard devices.\r\n * Based on code by @tylerjpeterson\r\n *\r\n * @function Phaser.DOM.GetInnerHeight\r\n * @since 3.16.0\r\n *\r\n * @param {boolean} iOS - Is this running on iOS?\r\n *\r\n * @return {number} The inner height value.\r\n */\r\nvar GetInnerHeight = function (iOS)\r\n{\r\n\r\n if (!iOS)\r\n {\r\n return window.innerHeight;\r\n }\r\n\r\n var axis = Math.abs(window.orientation);\r\n\r\n var size = { w: 0, h: 0 };\r\n \r\n var ruler = document.createElement('div');\r\n\r\n ruler.setAttribute('style', 'position: fixed; height: 100vh; width: 0; top: 0');\r\n\r\n document.documentElement.appendChild(ruler);\r\n\r\n size.w = (axis === 90) ? ruler.offsetHeight : window.innerWidth;\r\n size.h = (axis === 90) ? window.innerWidth : ruler.offsetHeight;\r\n\r\n document.documentElement.removeChild(ruler);\r\n\r\n ruler = null;\r\n\r\n if (Math.abs(window.orientation) !== 90)\r\n {\r\n return size.h;\r\n }\r\n else\r\n {\r\n return size.w;\r\n }\r\n};\r\n\r\nmodule.exports = GetInnerHeight;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/dom/GetInnerHeight.js?"); /***/ }), /***/ "./node_modules/phaser/src/dom/GetScreenOrientation.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/dom/GetScreenOrientation.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ../scale/const */ \"./node_modules/phaser/src/scale/const/index.js\");\r\n\r\n/**\r\n * Attempts to determine the screen orientation using the Orientation API.\r\n *\r\n * @function Phaser.DOM.GetScreenOrientation\r\n * @since 3.16.0\r\n *\r\n * @param {number} width - The width of the viewport.\r\n * @param {number} height - The height of the viewport.\r\n *\r\n * @return {string} The orientation.\r\n */\r\nvar GetScreenOrientation = function (width, height)\r\n{\r\n var screen = window.screen;\r\n var orientation = (screen) ? screen.orientation || screen.mozOrientation || screen.msOrientation : false;\r\n\r\n if (orientation && typeof orientation.type === 'string')\r\n {\r\n // Screen Orientation API specification\r\n return orientation.type;\r\n }\r\n else if (typeof orientation === 'string')\r\n {\r\n // moz / ms-orientation are strings\r\n return orientation;\r\n }\r\n\r\n if (screen)\r\n {\r\n return (screen.height > screen.width) ? CONST.ORIENTATION.PORTRAIT : CONST.ORIENTATION.LANDSCAPE;\r\n }\r\n else if (typeof window.orientation === 'number')\r\n {\r\n // This may change by device based on \"natural\" orientation.\r\n return (window.orientation === 0 || window.orientation === 180) ? CONST.ORIENTATION.PORTRAIT : CONST.ORIENTATION.LANDSCAPE;\r\n }\r\n else if (window.matchMedia)\r\n {\r\n if (window.matchMedia('(orientation: portrait)').matches)\r\n {\r\n return CONST.ORIENTATION.PORTRAIT;\r\n }\r\n else if (window.matchMedia('(orientation: landscape)').matches)\r\n {\r\n return CONST.ORIENTATION.LANDSCAPE;\r\n }\r\n }\r\n \r\n return (height > width) ? CONST.ORIENTATION.PORTRAIT : CONST.ORIENTATION.LANDSCAPE;\r\n};\r\n\r\nmodule.exports = GetScreenOrientation;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/dom/GetScreenOrientation.js?"); /***/ }), /***/ "./node_modules/phaser/src/dom/GetTarget.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/dom/GetTarget.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Attempts to get the target DOM element based on the given value, which can be either\r\n * a string, in which case it will be looked-up by ID, or an element node. If nothing\r\n * can be found it will return a reference to the document.body.\r\n *\r\n * @function Phaser.DOM.GetTarget\r\n * @since 3.16.0\r\n *\r\n * @param {HTMLElement} element - The DOM element to look-up.\r\n */\r\nvar GetTarget = function (element)\r\n{\r\n var target;\r\n\r\n if (element !== '')\r\n {\r\n if (typeof element === 'string')\r\n {\r\n // Hopefully an element ID\r\n target = document.getElementById(element);\r\n }\r\n else if (element && element.nodeType === 1)\r\n {\r\n // Quick test for a HTMLElement\r\n target = element;\r\n }\r\n }\r\n\r\n // Fallback to the document body. Covers an invalid ID and a non HTMLElement object.\r\n if (!target)\r\n {\r\n // Use the full window\r\n target = document.body;\r\n }\r\n\r\n return target;\r\n};\r\n\r\nmodule.exports = GetTarget;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/dom/GetTarget.js?"); /***/ }), /***/ "./node_modules/phaser/src/dom/ParseXML.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/dom/ParseXML.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes the given data string and parses it as XML.\r\n * First tries to use the window.DOMParser and reverts to the Microsoft.XMLDOM if that fails.\r\n * The parsed XML object is returned, or `null` if there was an error while parsing the data.\r\n *\r\n * @function Phaser.DOM.ParseXML\r\n * @since 3.0.0\r\n *\r\n * @param {string} data - The XML source stored in a string.\r\n *\r\n * @return {?(DOMParser|ActiveXObject)} The parsed XML data, or `null` if the data could not be parsed.\r\n */\r\nvar ParseXML = function (data)\r\n{\r\n var xml = '';\r\n\r\n try\r\n {\r\n if (window['DOMParser'])\r\n {\r\n var domparser = new DOMParser();\r\n xml = domparser.parseFromString(data, 'text/xml');\r\n }\r\n else\r\n {\r\n xml = new ActiveXObject('Microsoft.XMLDOM');\r\n xml.loadXML(data);\r\n }\r\n }\r\n catch (e)\r\n {\r\n xml = null;\r\n }\r\n\r\n if (!xml || !xml.documentElement || xml.getElementsByTagName('parsererror').length)\r\n {\r\n return null;\r\n }\r\n else\r\n {\r\n return xml;\r\n }\r\n};\r\n\r\nmodule.exports = ParseXML;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/dom/ParseXML.js?"); /***/ }), /***/ "./node_modules/phaser/src/dom/RemoveFromDOM.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/dom/RemoveFromDOM.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Attempts to remove the element from its parentNode in the DOM.\r\n *\r\n * @function Phaser.DOM.RemoveFromDOM\r\n * @since 3.0.0\r\n *\r\n * @param {HTMLElement} element - The DOM element to remove from its parent node.\r\n */\r\nvar RemoveFromDOM = function (element)\r\n{\r\n if (element.parentNode)\r\n {\r\n element.parentNode.removeChild(element);\r\n }\r\n};\r\n\r\nmodule.exports = RemoveFromDOM;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/dom/RemoveFromDOM.js?"); /***/ }), /***/ "./node_modules/phaser/src/dom/RequestAnimationFrame.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/dom/RequestAnimationFrame.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar NOOP = __webpack_require__(/*! ../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\n/**\r\n * @classdesc\r\n * Abstracts away the use of RAF or setTimeOut for the core game update loop.\r\n * This is invoked automatically by the Phaser.Game instance.\r\n *\r\n * @class RequestAnimationFrame\r\n * @memberof Phaser.DOM\r\n * @constructor\r\n * @since 3.0.0\r\n */\r\nvar RequestAnimationFrame = new Class({\r\n\r\n initialize:\r\n\r\n function RequestAnimationFrame ()\r\n {\r\n /**\r\n * True if RequestAnimationFrame is running, otherwise false.\r\n *\r\n * @name Phaser.DOM.RequestAnimationFrame#isRunning\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.isRunning = false;\r\n\r\n /**\r\n * The callback to be invoked each step.\r\n *\r\n * @name Phaser.DOM.RequestAnimationFrame#callback\r\n * @type {FrameRequestCallback}\r\n * @since 3.0.0\r\n */\r\n this.callback = NOOP;\r\n\r\n /**\r\n * The most recent timestamp. Either a DOMHighResTimeStamp under RAF or `Date.now` under SetTimeout.\r\n *\r\n * @name Phaser.DOM.RequestAnimationFrame#tick\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.tick = 0;\r\n\r\n /**\r\n * True if the step is using setTimeout instead of RAF.\r\n *\r\n * @name Phaser.DOM.RequestAnimationFrame#isSetTimeOut\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.isSetTimeOut = false;\r\n\r\n /**\r\n * The setTimeout or RAF callback ID used when canceling them.\r\n *\r\n * @name Phaser.DOM.RequestAnimationFrame#timeOutID\r\n * @type {?number}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.timeOutID = null;\r\n\r\n /**\r\n * The previous time the step was called.\r\n *\r\n * @name Phaser.DOM.RequestAnimationFrame#lastTime\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.lastTime = 0;\r\n\r\n /**\r\n * The target FPS rate in ms.\r\n * Only used when setTimeout is used instead of RAF.\r\n *\r\n * @name Phaser.DOM.RequestAnimationFrame#target\r\n * @type {number}\r\n * @default 0\r\n * @since 3.21.0\r\n */\r\n this.target = 0;\r\n\r\n var _this = this;\r\n\r\n /**\r\n * The RAF step function.\r\n * Updates the local tick value, invokes the callback and schedules another call to requestAnimationFrame.\r\n *\r\n * @name Phaser.DOM.RequestAnimationFrame#step\r\n * @type {FrameRequestCallback}\r\n * @since 3.0.0\r\n */\r\n this.step = function step ()\r\n {\r\n // Because we cannot trust the time passed to this callback from the browser and need it kept in sync with event times\r\n var timestamp = window.performance.now();\r\n\r\n // DOMHighResTimeStamp\r\n _this.lastTime = _this.tick;\r\n\r\n _this.tick = timestamp;\r\n\r\n _this.callback(timestamp);\r\n\r\n _this.timeOutID = window.requestAnimationFrame(step);\r\n };\r\n\r\n /**\r\n * The SetTimeout step function.\r\n * Updates the local tick value, invokes the callback and schedules another call to setTimeout.\r\n *\r\n * @name Phaser.DOM.RequestAnimationFrame#stepTimeout\r\n * @type {function}\r\n * @since 3.0.0\r\n */\r\n this.stepTimeout = function stepTimeout ()\r\n {\r\n var d = Date.now();\r\n\r\n var delay = Math.min(Math.max(_this.target * 2 + _this.tick - d, 0), _this.target);\r\n\r\n _this.lastTime = _this.tick;\r\n\r\n _this.tick = d;\r\n\r\n _this.callback(d);\r\n\r\n _this.timeOutID = window.setTimeout(stepTimeout, delay);\r\n };\r\n },\r\n\r\n /**\r\n * Starts the requestAnimationFrame or setTimeout process running.\r\n *\r\n * @method Phaser.DOM.RequestAnimationFrame#start\r\n * @since 3.0.0\r\n *\r\n * @param {FrameRequestCallback} callback - The callback to invoke each step.\r\n * @param {boolean} forceSetTimeOut - Should it use SetTimeout, even if RAF is available?\r\n * @param {number} targetFPS - The target fps rate (in ms). Only used when setTimeout is used.\r\n */\r\n start: function (callback, forceSetTimeOut, targetFPS)\r\n {\r\n if (this.isRunning)\r\n {\r\n return;\r\n }\r\n\r\n this.callback = callback;\r\n\r\n this.isSetTimeOut = forceSetTimeOut;\r\n\r\n this.target = targetFPS;\r\n\r\n this.isRunning = true;\r\n\r\n this.timeOutID = (forceSetTimeOut) ? window.setTimeout(this.stepTimeout, 0) : window.requestAnimationFrame(this.step);\r\n },\r\n\r\n /**\r\n * Stops the requestAnimationFrame or setTimeout from running.\r\n *\r\n * @method Phaser.DOM.RequestAnimationFrame#stop\r\n * @since 3.0.0\r\n */\r\n stop: function ()\r\n {\r\n this.isRunning = false;\r\n\r\n if (this.isSetTimeOut)\r\n {\r\n clearTimeout(this.timeOutID);\r\n }\r\n else\r\n {\r\n window.cancelAnimationFrame(this.timeOutID);\r\n }\r\n },\r\n\r\n /**\r\n * Stops the step from running and clears the callback reference.\r\n *\r\n * @method Phaser.DOM.RequestAnimationFrame#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.stop();\r\n\r\n this.callback = NOOP;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = RequestAnimationFrame;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/dom/RequestAnimationFrame.js?"); /***/ }), /***/ "./node_modules/phaser/src/dom/index.js": /*!**********************************************!*\ !*** ./node_modules/phaser/src/dom/index.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.DOM\r\n */\r\n\r\nvar Dom = {\r\n\r\n AddToDOM: __webpack_require__(/*! ./AddToDOM */ \"./node_modules/phaser/src/dom/AddToDOM.js\"),\r\n DOMContentLoaded: __webpack_require__(/*! ./DOMContentLoaded */ \"./node_modules/phaser/src/dom/DOMContentLoaded.js\"),\r\n GetScreenOrientation: __webpack_require__(/*! ./GetScreenOrientation */ \"./node_modules/phaser/src/dom/GetScreenOrientation.js\"),\r\n GetTarget: __webpack_require__(/*! ./GetTarget */ \"./node_modules/phaser/src/dom/GetTarget.js\"),\r\n ParseXML: __webpack_require__(/*! ./ParseXML */ \"./node_modules/phaser/src/dom/ParseXML.js\"),\r\n RemoveFromDOM: __webpack_require__(/*! ./RemoveFromDOM */ \"./node_modules/phaser/src/dom/RemoveFromDOM.js\"),\r\n RequestAnimationFrame: __webpack_require__(/*! ./RequestAnimationFrame */ \"./node_modules/phaser/src/dom/RequestAnimationFrame.js\")\r\n\r\n};\r\n\r\nmodule.exports = Dom;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/dom/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/events/EventEmitter.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/events/EventEmitter.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EE = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar PluginCache = __webpack_require__(/*! ../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\n\r\n/**\r\n * @classdesc\r\n * EventEmitter is a Scene Systems plugin compatible version of eventemitter3.\r\n *\r\n * @class EventEmitter\r\n * @memberof Phaser.Events\r\n * @constructor\r\n * @since 3.0.0\r\n */\r\nvar EventEmitter = new Class({\r\n\r\n Extends: EE,\r\n\r\n initialize:\r\n\r\n function EventEmitter ()\r\n {\r\n EE.call(this);\r\n },\r\n\r\n /**\r\n * Removes all listeners.\r\n *\r\n * @method Phaser.Events.EventEmitter#shutdown\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n this.removeAllListeners();\r\n },\r\n\r\n /**\r\n * Removes all listeners.\r\n *\r\n * @method Phaser.Events.EventEmitter#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.removeAllListeners();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Return an array listing the events for which the emitter has registered listeners.\r\n *\r\n * @method Phaser.Events.EventEmitter#eventNames\r\n * @since 3.0.0\r\n *\r\n * @return {Array.}\r\n */\r\n\r\n/**\r\n * Return the listeners registered for a given event.\r\n *\r\n * @method Phaser.Events.EventEmitter#listeners\r\n * @since 3.0.0\r\n *\r\n * @param {(string|symbol)} event - The event name.\r\n *\r\n * @return {Function[]} The registered listeners.\r\n */\r\n\r\n/**\r\n * Return the number of listeners listening to a given event.\r\n *\r\n * @method Phaser.Events.EventEmitter#listenerCount\r\n * @since 3.0.0\r\n *\r\n * @param {(string|symbol)} event - The event name.\r\n *\r\n * @return {number} The number of listeners.\r\n */\r\n\r\n/**\r\n * Calls each of the listeners registered for a given event.\r\n *\r\n * @method Phaser.Events.EventEmitter#emit\r\n * @since 3.0.0\r\n *\r\n * @param {(string|symbol)} event - The event name.\r\n * @param {...*} [args] - Additional arguments that will be passed to the event handler.\r\n *\r\n * @return {boolean} `true` if the event had listeners, else `false`.\r\n */\r\n\r\n/**\r\n * Add a listener for a given event.\r\n *\r\n * @method Phaser.Events.EventEmitter#on\r\n * @since 3.0.0\r\n *\r\n * @param {(string|symbol)} event - The event name.\r\n * @param {function} fn - The listener function.\r\n * @param {*} [context=this] - The context to invoke the listener with.\r\n *\r\n * @return {this} `this`.\r\n */\r\n\r\n/**\r\n * Add a listener for a given event.\r\n *\r\n * @method Phaser.Events.EventEmitter#addListener\r\n * @since 3.0.0\r\n *\r\n * @param {(string|symbol)} event - The event name.\r\n * @param {function} fn - The listener function.\r\n * @param {*} [context=this] - The context to invoke the listener with.\r\n *\r\n * @return {this} `this`.\r\n */\r\n\r\n/**\r\n * Add a one-time listener for a given event.\r\n *\r\n * @method Phaser.Events.EventEmitter#once\r\n * @since 3.0.0\r\n *\r\n * @param {(string|symbol)} event - The event name.\r\n * @param {function} fn - The listener function.\r\n * @param {*} [context=this] - The context to invoke the listener with.\r\n *\r\n * @return {this} `this`.\r\n */\r\n\r\n/**\r\n * Remove the listeners of a given event.\r\n *\r\n * @method Phaser.Events.EventEmitter#removeListener\r\n * @since 3.0.0\r\n *\r\n * @param {(string|symbol)} event - The event name.\r\n * @param {function} [fn] - Only remove the listeners that match this function.\r\n * @param {*} [context] - Only remove the listeners that have this context.\r\n * @param {boolean} [once] - Only remove one-time listeners.\r\n *\r\n * @return {this} `this`.\r\n */\r\n\r\n/**\r\n * Remove the listeners of a given event.\r\n *\r\n * @method Phaser.Events.EventEmitter#off\r\n * @since 3.0.0\r\n *\r\n * @param {(string|symbol)} event - The event name.\r\n * @param {function} [fn] - Only remove the listeners that match this function.\r\n * @param {*} [context] - Only remove the listeners that have this context.\r\n * @param {boolean} [once] - Only remove one-time listeners.\r\n *\r\n * @return {this} `this`.\r\n */\r\n\r\n/**\r\n * Remove all listeners, or those of the specified event.\r\n *\r\n * @method Phaser.Events.EventEmitter#removeAllListeners\r\n * @since 3.0.0\r\n *\r\n * @param {(string|symbol)} [event] - The event name.\r\n *\r\n * @return {this} `this`.\r\n */\r\n\r\nPluginCache.register('EventEmitter', EventEmitter, 'events');\r\n\r\nmodule.exports = EventEmitter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/events/EventEmitter.js?"); /***/ }), /***/ "./node_modules/phaser/src/events/index.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/events/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Events\r\n */\r\n\r\nmodule.exports = { EventEmitter: __webpack_require__(/*! ./EventEmitter */ \"./node_modules/phaser/src/events/EventEmitter.js\") };\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/BuildGameObject.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/BuildGameObject.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BlendModes = __webpack_require__(/*! ../renderer/BlendModes */ \"./node_modules/phaser/src/renderer/BlendModes.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\n\r\n/**\r\n * Builds a Game Object using the provided configuration object.\r\n *\r\n * @function Phaser.GameObjects.BuildGameObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject.\r\n * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The built Game Object.\r\n */\r\nvar BuildGameObject = function (scene, gameObject, config)\r\n{\r\n // Position\r\n\r\n gameObject.x = GetAdvancedValue(config, 'x', 0);\r\n gameObject.y = GetAdvancedValue(config, 'y', 0);\r\n gameObject.depth = GetAdvancedValue(config, 'depth', 0);\r\n\r\n // Flip\r\n\r\n gameObject.flipX = GetAdvancedValue(config, 'flipX', false);\r\n gameObject.flipY = GetAdvancedValue(config, 'flipY', false);\r\n\r\n // Scale\r\n // Either: { scale: 2 } or { scale: { x: 2, y: 2 }}\r\n\r\n var scale = GetAdvancedValue(config, 'scale', null);\r\n\r\n if (typeof scale === 'number')\r\n {\r\n gameObject.setScale(scale);\r\n }\r\n else if (scale !== null)\r\n {\r\n gameObject.scaleX = GetAdvancedValue(scale, 'x', 1);\r\n gameObject.scaleY = GetAdvancedValue(scale, 'y', 1);\r\n }\r\n\r\n // ScrollFactor\r\n // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }}\r\n\r\n var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null);\r\n\r\n if (typeof scrollFactor === 'number')\r\n {\r\n gameObject.setScrollFactor(scrollFactor);\r\n }\r\n else if (scrollFactor !== null)\r\n {\r\n gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1);\r\n gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1);\r\n }\r\n\r\n // Rotation\r\n\r\n gameObject.rotation = GetAdvancedValue(config, 'rotation', 0);\r\n\r\n var angle = GetAdvancedValue(config, 'angle', null);\r\n\r\n if (angle !== null)\r\n {\r\n gameObject.angle = angle;\r\n }\r\n\r\n // Alpha\r\n\r\n gameObject.alpha = GetAdvancedValue(config, 'alpha', 1);\r\n\r\n // Origin\r\n // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }}\r\n\r\n var origin = GetAdvancedValue(config, 'origin', null);\r\n\r\n if (typeof origin === 'number')\r\n {\r\n gameObject.setOrigin(origin);\r\n }\r\n else if (origin !== null)\r\n {\r\n var ox = GetAdvancedValue(origin, 'x', 0.5);\r\n var oy = GetAdvancedValue(origin, 'y', 0.5);\r\n\r\n gameObject.setOrigin(ox, oy);\r\n }\r\n\r\n // BlendMode\r\n\r\n gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL);\r\n\r\n // Visible\r\n\r\n gameObject.visible = GetAdvancedValue(config, 'visible', true);\r\n\r\n // Add to Scene\r\n\r\n var add = GetAdvancedValue(config, 'add', true);\r\n\r\n if (add)\r\n {\r\n scene.sys.displayList.add(gameObject);\r\n }\r\n\r\n if (gameObject.preUpdate)\r\n {\r\n scene.sys.updateList.add(gameObject);\r\n }\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = BuildGameObject;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/BuildGameObject.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/BuildGameObjectAnimation.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/BuildGameObjectAnimation.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetAdvancedValue = __webpack_require__(/*! ../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\n\r\n/**\r\n * Adds an Animation component to a Sprite and populates it based on the given config.\r\n *\r\n * @function Phaser.GameObjects.BuildGameObjectAnimation\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Sprite} sprite - The sprite to add an Animation component to.\r\n * @param {object} config - The animation config.\r\n *\r\n * @return {Phaser.GameObjects.Sprite} The updated Sprite.\r\n */\r\nvar BuildGameObjectAnimation = function (sprite, config)\r\n{\r\n var animConfig = GetAdvancedValue(config, 'anims', null);\r\n\r\n if (animConfig === null)\r\n {\r\n return sprite;\r\n }\r\n\r\n if (typeof animConfig === 'string')\r\n {\r\n // { anims: 'key' }\r\n sprite.anims.play(animConfig);\r\n }\r\n else if (typeof animConfig === 'object')\r\n {\r\n // { anims: {\r\n // key: string\r\n // startFrame: [string|integer]\r\n // delay: [float]\r\n // repeat: [integer]\r\n // repeatDelay: [float]\r\n // yoyo: [boolean]\r\n // play: [boolean]\r\n // delayedPlay: [boolean]\r\n // }\r\n // }\r\n\r\n var anims = sprite.anims;\r\n\r\n var key = GetAdvancedValue(animConfig, 'key', undefined);\r\n var startFrame = GetAdvancedValue(animConfig, 'startFrame', undefined);\r\n\r\n var delay = GetAdvancedValue(animConfig, 'delay', 0);\r\n var repeat = GetAdvancedValue(animConfig, 'repeat', 0);\r\n var repeatDelay = GetAdvancedValue(animConfig, 'repeatDelay', 0);\r\n var yoyo = GetAdvancedValue(animConfig, 'yoyo', false);\r\n\r\n var play = GetAdvancedValue(animConfig, 'play', false);\r\n var delayedPlay = GetAdvancedValue(animConfig, 'delayedPlay', 0);\r\n\r\n anims.setDelay(delay);\r\n anims.setRepeat(repeat);\r\n anims.setRepeatDelay(repeatDelay);\r\n anims.setYoyo(yoyo);\r\n\r\n if (play)\r\n {\r\n anims.play(key, startFrame);\r\n }\r\n else if (delayedPlay > 0)\r\n {\r\n anims.delayedPlay(delayedPlay, key, startFrame);\r\n }\r\n else\r\n {\r\n anims.load(key);\r\n }\r\n }\r\n\r\n return sprite;\r\n};\r\n\r\nmodule.exports = BuildGameObjectAnimation;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/BuildGameObjectAnimation.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/DisplayList.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/DisplayList.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar List = __webpack_require__(/*! ../structs/List */ \"./node_modules/phaser/src/structs/List.js\");\r\nvar PluginCache = __webpack_require__(/*! ../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar SceneEvents = __webpack_require__(/*! ../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\nvar StableSort = __webpack_require__(/*! ../utils/array/StableSort */ \"./node_modules/phaser/src/utils/array/StableSort.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Display List plugin.\r\n *\r\n * Display Lists belong to a Scene and maintain the list of Game Objects to render every frame.\r\n *\r\n * Some of these Game Objects may also be part of the Scene's [Update List]{@link Phaser.GameObjects.UpdateList}, for updating.\r\n *\r\n * @class DisplayList\r\n * @extends Phaser.Structs.List.\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene that this Display List belongs to.\r\n */\r\nvar DisplayList = new Class({\r\n\r\n Extends: List,\r\n\r\n initialize:\r\n\r\n function DisplayList (scene)\r\n {\r\n List.call(this, scene);\r\n\r\n /**\r\n * The flag the determines whether Game Objects should be sorted when `depthSort()` is called.\r\n *\r\n * @name Phaser.GameObjects.DisplayList#sortChildrenFlag\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.sortChildrenFlag = false;\r\n\r\n /**\r\n * The Scene that this Display List belongs to.\r\n *\r\n * @name Phaser.GameObjects.DisplayList#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * The Scene's Systems.\r\n *\r\n * @name Phaser.GameObjects.DisplayList#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n scene.sys.events.on(SceneEvents.START, this.start, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.GameObjects.DisplayList#boot\r\n * @private\r\n * @since 3.5.1\r\n */\r\n boot: function ()\r\n {\r\n this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.GameObjects.DisplayList#start\r\n * @private\r\n * @since 3.5.0\r\n */\r\n start: function ()\r\n {\r\n this.systems.events.once(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * Force a sort of the display list on the next call to depthSort.\r\n *\r\n * @method Phaser.GameObjects.DisplayList#queueDepthSort\r\n * @since 3.0.0\r\n */\r\n queueDepthSort: function ()\r\n {\r\n this.sortChildrenFlag = true;\r\n },\r\n\r\n /**\r\n * Immediately sorts the display list if the flag is set.\r\n *\r\n * @method Phaser.GameObjects.DisplayList#depthSort\r\n * @since 3.0.0\r\n */\r\n depthSort: function ()\r\n {\r\n if (this.sortChildrenFlag)\r\n {\r\n StableSort.inplace(this.list, this.sortByDepth);\r\n\r\n this.sortChildrenFlag = false;\r\n }\r\n },\r\n\r\n /**\r\n * Compare the depth of two Game Objects.\r\n *\r\n * @method Phaser.GameObjects.DisplayList#sortByDepth\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} childA - The first Game Object.\r\n * @param {Phaser.GameObjects.GameObject} childB - The second Game Object.\r\n *\r\n * @return {integer} The difference between the depths of each Game Object.\r\n */\r\n sortByDepth: function (childA, childB)\r\n {\r\n return childA._depth - childB._depth;\r\n },\r\n\r\n /**\r\n * Returns an array which contains all objects currently on the Display List.\r\n * This is a reference to the main list array, not a copy of it, so be careful not to modify it.\r\n *\r\n * @method Phaser.GameObjects.DisplayList#getChildren\r\n * @since 3.12.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject[]} The group members.\r\n */\r\n getChildren: function ()\r\n {\r\n return this.list;\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Phaser.GameObjects.DisplayList#shutdown\r\n * @private\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n var i = this.list.length;\r\n\r\n while (i--)\r\n {\r\n this.list[i].destroy(true);\r\n }\r\n\r\n this.list.length = 0;\r\n\r\n this.systems.events.off(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Phaser.GameObjects.DisplayList#destroy\r\n * @private\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.scene.sys.events.off(SceneEvents.START, this.start, this);\r\n\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nPluginCache.register('DisplayList', DisplayList, 'displayList');\r\n\r\nmodule.exports = DisplayList;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/DisplayList.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/GameObject.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/GameObject.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar ComponentsToJSON = __webpack_require__(/*! ./components/ToJSON */ \"./node_modules/phaser/src/gameobjects/components/ToJSON.js\");\r\nvar DataManager = __webpack_require__(/*! ../data/DataManager */ \"./node_modules/phaser/src/data/DataManager.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/gameobjects/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The base class that all Game Objects extend.\r\n * You don't create GameObjects directly and they cannot be added to the display list.\r\n * Instead, use them as the base for your own custom classes.\r\n *\r\n * @class GameObject\r\n * @memberof Phaser.GameObjects\r\n * @extends Phaser.Events.EventEmitter\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs.\r\n * @param {string} type - A textual representation of the type of Game Object, i.e. `sprite`.\r\n */\r\nvar GameObject = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function GameObject (scene, type)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * The Scene to which this Game Object belongs.\r\n * Game Objects can only belong to one Scene.\r\n *\r\n * @name Phaser.GameObjects.GameObject#scene\r\n * @type {Phaser.Scene}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A textual representation of this Game Object, i.e. `sprite`.\r\n * Used internally by Phaser but is available for your own custom classes to populate.\r\n *\r\n * @name Phaser.GameObjects.GameObject#type\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * The current state of this Game Object.\r\n * \r\n * Phaser itself will never modify this value, although plugins may do so.\r\n * \r\n * Use this property to track the state of a Game Object during its lifetime. For example, it could change from\r\n * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant\r\n * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons.\r\n * If you need to store complex data about your Game Object, look at using the Data Component instead.\r\n *\r\n * @name Phaser.GameObjects.GameObject#state\r\n * @type {(integer|string)}\r\n * @since 3.16.0\r\n */\r\n this.state = 0;\r\n\r\n /**\r\n * The parent Container of this Game Object, if it has one.\r\n *\r\n * @name Phaser.GameObjects.GameObject#parentContainer\r\n * @type {Phaser.GameObjects.Container}\r\n * @since 3.4.0\r\n */\r\n this.parentContainer = null;\r\n\r\n /**\r\n * The name of this Game Object.\r\n * Empty by default and never populated by Phaser, this is left for developers to use.\r\n *\r\n * @name Phaser.GameObjects.GameObject#name\r\n * @type {string}\r\n * @default ''\r\n * @since 3.0.0\r\n */\r\n this.name = '';\r\n\r\n /**\r\n * The active state of this Game Object.\r\n * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it.\r\n * An active object is one which is having its logic and internal systems updated.\r\n *\r\n * @name Phaser.GameObjects.GameObject#active\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.active = true;\r\n\r\n /**\r\n * The Tab Index of the Game Object.\r\n * Reserved for future use by plugins and the Input Manager.\r\n *\r\n * @name Phaser.GameObjects.GameObject#tabIndex\r\n * @type {integer}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.tabIndex = -1;\r\n\r\n /**\r\n * A Data Manager.\r\n * It allows you to store, query and get key/value paired information specific to this Game Object.\r\n * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`.\r\n *\r\n * @name Phaser.GameObjects.GameObject#data\r\n * @type {Phaser.Data.DataManager}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.data = null;\r\n\r\n /**\r\n * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not.\r\n * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively.\r\n * If those components are not used by your custom class then you can use this bitmask as you wish.\r\n *\r\n * @name Phaser.GameObjects.GameObject#renderFlags\r\n * @type {integer}\r\n * @default 15\r\n * @since 3.0.0\r\n */\r\n this.renderFlags = 15;\r\n\r\n /**\r\n * A bitmask that controls if this Game Object is drawn by a Camera or not.\r\n * Not usually set directly, instead call `Camera.ignore`, however you can\r\n * set this property directly using the Camera.id property:\r\n *\r\n * @example\r\n * this.cameraFilter |= camera.id\r\n *\r\n * @name Phaser.GameObjects.GameObject#cameraFilter\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.cameraFilter = 0;\r\n\r\n /**\r\n * If this Game Object is enabled for input then this property will contain an InteractiveObject instance.\r\n * Not usually set directly. Instead call `GameObject.setInteractive()`.\r\n *\r\n * @name Phaser.GameObjects.GameObject#input\r\n * @type {?Phaser.Types.Input.InteractiveObject}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.input = null;\r\n\r\n /**\r\n * If this Game Object is enabled for physics then this property will contain a reference to a Physics Body.\r\n *\r\n * @name Phaser.GameObjects.GameObject#body\r\n * @type {?(object|Phaser.Physics.Arcade.Body|Phaser.Physics.Impact.Body)}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.body = null;\r\n\r\n /**\r\n * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`.\r\n * This includes calls that may come from a Group, Container or the Scene itself.\r\n * While it allows you to persist a Game Object across Scenes, please understand you are entirely\r\n * responsible for managing references to and from this Game Object.\r\n *\r\n * @name Phaser.GameObjects.GameObject#ignoreDestroy\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.5.0\r\n */\r\n this.ignoreDestroy = false;\r\n\r\n // Tell the Scene to re-sort the children\r\n scene.sys.queueDepthSort();\r\n },\r\n\r\n /**\r\n * Sets the `active` property of this Game Object and returns this Game Object for further chaining.\r\n * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setActive\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - True if this Game Object should be set as active, false if not.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setActive: function (value)\r\n {\r\n this.active = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the `name` property of this Game Object and returns this Game Object for further chaining.\r\n * The `name` property is not populated by Phaser and is presented for your own use.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setName\r\n * @since 3.0.0\r\n *\r\n * @param {string} value - The name to be given to this Game Object.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setName: function (value)\r\n {\r\n this.name = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the current state of this Game Object.\r\n * \r\n * Phaser itself will never modify the State of a Game Object, although plugins may do so.\r\n * \r\n * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'.\r\n * The state value should typically be an integer (ideally mapped to a constant\r\n * in your game code), but could also be a string. It is recommended to keep it light and simple.\r\n * If you need to store complex data about your Game Object, look at using the Data Component instead.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setState\r\n * @since 3.16.0\r\n *\r\n * @param {(integer|string)} value - The state of the Game Object.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setState: function (value)\r\n {\r\n this.state = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds a Data Manager component to this Game Object.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setDataEnabled\r\n * @since 3.0.0\r\n * @see Phaser.Data.DataManager\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setDataEnabled: function ()\r\n {\r\n if (!this.data)\r\n {\r\n this.data = new DataManager(this);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Allows you to store a key value pair within this Game Objects Data Manager.\r\n *\r\n * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled\r\n * before setting the value.\r\n *\r\n * If the key doesn't already exist in the Data Manager then it is created.\r\n *\r\n * ```javascript\r\n * sprite.setData('name', 'Red Gem Stone');\r\n * ```\r\n *\r\n * You can also pass in an object of key value pairs as the first argument:\r\n *\r\n * ```javascript\r\n * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 });\r\n * ```\r\n *\r\n * To get a value back again you can call `getData`:\r\n *\r\n * ```javascript\r\n * sprite.getData('gold');\r\n * ```\r\n *\r\n * Or you can access the value directly via the `values` property, where it works like any other variable:\r\n *\r\n * ```javascript\r\n * sprite.data.values.gold += 50;\r\n * ```\r\n *\r\n * When the value is first set, a `setdata` event is emitted from this Game Object.\r\n *\r\n * If the key already exists, a `changedata` event is emitted instead, along an event named after the key.\r\n * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`.\r\n * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter.\r\n *\r\n * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setData\r\n * @since 3.0.0\r\n *\r\n * @param {(string|object)} key - The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored.\r\n * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored.\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setData: function (key, value)\r\n {\r\n if (!this.data)\r\n {\r\n this.data = new DataManager(this);\r\n }\r\n\r\n this.data.set(key, value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist.\r\n *\r\n * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either:\r\n *\r\n * ```javascript\r\n * sprite.getData('gold');\r\n * ```\r\n *\r\n * Or access the value directly:\r\n *\r\n * ```javascript\r\n * sprite.data.values.gold;\r\n * ```\r\n *\r\n * You can also pass in an array of keys, in which case an array of values will be returned:\r\n *\r\n * ```javascript\r\n * sprite.getData([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * This approach is useful for destructuring arrays in ES6.\r\n *\r\n * @method Phaser.GameObjects.GameObject#getData\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys.\r\n *\r\n * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array.\r\n */\r\n getData: function (key)\r\n {\r\n if (!this.data)\r\n {\r\n this.data = new DataManager(this);\r\n }\r\n\r\n return this.data.get(key);\r\n },\r\n\r\n /**\r\n * Pass this Game Object to the Input Manager to enable it for Input.\r\n *\r\n * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area\r\n * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced\r\n * input detection.\r\n *\r\n * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If\r\n * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific\r\n * shape for it to use.\r\n *\r\n * You can also provide an Input Configuration Object as the only argument to this method.\r\n *\r\n * @method Phaser.GameObjects.GameObject#setInteractive\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - 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.\r\n * @param {Phaser.Types.Input.HitAreaCallback} [callback] - A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback.\r\n * @param {boolean} [dropZone=false] - Should this Game Object be treated as a drop zone target?\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n setInteractive: function (shape, callback, dropZone)\r\n {\r\n this.scene.sys.input.enable(this, shape, callback, dropZone);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * If this Game Object has previously been enabled for input, this will disable it.\r\n *\r\n * An object that is disabled for input stops processing or being considered for\r\n * input events, but can be turned back on again at any time by simply calling\r\n * `setInteractive()` with no arguments provided.\r\n *\r\n * If want to completely remove interaction from this Game Object then use `removeInteractive` instead.\r\n *\r\n * @method Phaser.GameObjects.GameObject#disableInteractive\r\n * @since 3.7.0\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n disableInteractive: function ()\r\n {\r\n if (this.input)\r\n {\r\n this.input.enabled = false;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * If this Game Object has previously been enabled for input, this will queue it\r\n * for removal, causing it to no longer be interactive. The removal happens on\r\n * the next game step, it is not immediate.\r\n *\r\n * The Interactive Object that was assigned to this Game Object will be destroyed,\r\n * removed from the Input Manager and cleared from this Game Object.\r\n *\r\n * If you wish to re-enable this Game Object at a later date you will need to\r\n * re-create its InteractiveObject by calling `setInteractive` again.\r\n *\r\n * If you wish to only temporarily stop an object from receiving input then use\r\n * `disableInteractive` instead, as that toggles the interactive state, where-as\r\n * this erases it completely.\r\n * \r\n * If you wish to resize a hit area, don't remove and then set it as being\r\n * interactive. Instead, access the hitarea object directly and resize the shape\r\n * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the\r\n * shape is a Rectangle, which it is by default.)\r\n *\r\n * @method Phaser.GameObjects.GameObject#removeInteractive\r\n * @since 3.7.0\r\n *\r\n * @return {this} This GameObject.\r\n */\r\n removeInteractive: function ()\r\n {\r\n this.scene.sys.input.clear(this);\r\n\r\n this.input = undefined;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * To be overridden by custom GameObjects. Allows base objects to be used in a Pool.\r\n *\r\n * @method Phaser.GameObjects.GameObject#update\r\n * @since 3.0.0\r\n *\r\n * @param {...*} [args] - args\r\n */\r\n update: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Returns a JSON representation of the Game Object.\r\n *\r\n * @method Phaser.GameObjects.GameObject#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object.\r\n */\r\n toJSON: function ()\r\n {\r\n return ComponentsToJSON(this);\r\n },\r\n\r\n /**\r\n * Compares the renderMask with the renderFlags to see if this Game Object will render or not.\r\n * Also checks the Game Object against the given Cameras exclusion list.\r\n *\r\n * @method Phaser.GameObjects.GameObject#willRender\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object.\r\n *\r\n * @return {boolean} True if the Game Object should be rendered, otherwise false.\r\n */\r\n willRender: function (camera)\r\n {\r\n return !(GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id)));\r\n },\r\n\r\n /**\r\n * Returns an array containing the display list index of either this Game Object, or if it has one,\r\n * its parent Container. It then iterates up through all of the parent containers until it hits the\r\n * root of the display list (which is index 0 in the returned array).\r\n *\r\n * Used internally by the InputPlugin but also useful if you wish to find out the display depth of\r\n * this Game Object and all of its ancestors.\r\n *\r\n * @method Phaser.GameObjects.GameObject#getIndexList\r\n * @since 3.4.0\r\n *\r\n * @return {integer[]} An array of display list position indexes.\r\n */\r\n getIndexList: function ()\r\n {\r\n // eslint-disable-next-line consistent-this\r\n var child = this;\r\n var parent = this.parentContainer;\r\n\r\n var indexes = [];\r\n\r\n while (parent)\r\n {\r\n // indexes.unshift([parent.getIndex(child), parent.name]);\r\n indexes.unshift(parent.getIndex(child));\r\n\r\n child = parent;\r\n\r\n if (!parent.parentContainer)\r\n {\r\n break;\r\n }\r\n else\r\n {\r\n parent = parent.parentContainer;\r\n }\r\n }\r\n\r\n // indexes.unshift([this.scene.sys.displayList.getIndex(child), 'root']);\r\n indexes.unshift(this.scene.sys.displayList.getIndex(child));\r\n\r\n return indexes;\r\n },\r\n\r\n /**\r\n * Destroys this Game Object removing it from the Display List and Update List and\r\n * severing all ties to parent resources.\r\n *\r\n * Also removes itself from the Input Manager and Physics Manager if previously enabled.\r\n *\r\n * Use this to remove a Game Object from your game if you don't ever plan to use it again.\r\n * As long as no reference to it exists within your own code it should become free for\r\n * garbage collection by the browser.\r\n *\r\n * If you just want to temporarily disable an object then look at using the\r\n * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected.\r\n *\r\n * @method Phaser.GameObjects.GameObject#destroy\r\n * @fires Phaser.GameObjects.Events#DESTROY\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [fromScene=false] - Is this Game Object being destroyed as the result of a Scene shutdown?\r\n */\r\n destroy: function (fromScene)\r\n {\r\n if (fromScene === undefined) { fromScene = false; }\r\n\r\n // This Game Object has already been destroyed\r\n if (!this.scene || this.ignoreDestroy)\r\n {\r\n return;\r\n }\r\n\r\n if (this.preDestroy)\r\n {\r\n this.preDestroy.call(this);\r\n }\r\n\r\n this.emit(Events.DESTROY, this);\r\n\r\n var sys = this.scene.sys;\r\n\r\n if (!fromScene)\r\n {\r\n sys.displayList.remove(this);\r\n sys.updateList.remove(this);\r\n }\r\n\r\n if (this.input)\r\n {\r\n sys.input.clear(this);\r\n this.input = undefined;\r\n }\r\n\r\n if (this.data)\r\n {\r\n this.data.destroy();\r\n\r\n this.data = undefined;\r\n }\r\n\r\n if (this.body)\r\n {\r\n this.body.destroy();\r\n this.body = undefined;\r\n }\r\n\r\n // Tell the Scene to re-sort the children\r\n if (!fromScene)\r\n {\r\n sys.queueDepthSort();\r\n }\r\n\r\n this.active = false;\r\n this.visible = false;\r\n\r\n this.scene = undefined;\r\n\r\n this.parentContainer = undefined;\r\n\r\n this.removeAllListeners();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not.\r\n *\r\n * @constant {integer} RENDER_MASK\r\n * @memberof Phaser.GameObjects.GameObject\r\n * @default\r\n */\r\nGameObject.RENDER_MASK = 15;\r\n\r\nmodule.exports = GameObject;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/GameObject.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/GameObjectCreator.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/GameObjectCreator.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar PluginCache = __webpack_require__(/*! ../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar SceneEvents = __webpack_require__(/*! ../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Game Object Creator is a Scene plugin that allows you to quickly create many common\r\n * types of Game Objects and return them. Unlike the Game Object Factory, they are not automatically\r\n * added to the Scene.\r\n *\r\n * Game Objects directly register themselves with the Creator and inject their own creation\r\n * methods into the class.\r\n *\r\n * @class GameObjectCreator\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object Factory belongs.\r\n */\r\nvar GameObjectCreator = new Class({\r\n\r\n initialize:\r\n\r\n function GameObjectCreator (scene)\r\n {\r\n /**\r\n * The Scene to which this Game Object Creator belongs.\r\n *\r\n * @name Phaser.GameObjects.GameObjectCreator#scene\r\n * @type {Phaser.Scene}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A reference to the Scene.Systems.\r\n *\r\n * @name Phaser.GameObjects.GameObjectCreator#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n /**\r\n * A reference to the Scene Display List.\r\n *\r\n * @name Phaser.GameObjects.GameObjectCreator#displayList\r\n * @type {Phaser.GameObjects.DisplayList}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.displayList;\r\n\r\n /**\r\n * A reference to the Scene Update List.\r\n *\r\n * @name Phaser.GameObjects.GameObjectCreator#updateList\r\n * @type {Phaser.GameObjects.UpdateList}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.updateList;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n scene.sys.events.on(SceneEvents.START, this.start, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#boot\r\n * @private\r\n * @since 3.5.1\r\n */\r\n boot: function ()\r\n {\r\n this.displayList = this.systems.displayList;\r\n this.updateList = this.systems.updateList;\r\n\r\n this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#start\r\n * @private\r\n * @since 3.5.0\r\n */\r\n start: function ()\r\n {\r\n this.systems.events.once(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#shutdown\r\n * @private\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n this.systems.events.off(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#destroy\r\n * @private\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.scene.sys.events.off(SceneEvents.START, this.start, this);\r\n\r\n this.scene = null;\r\n this.systems = null;\r\n this.displayList = null;\r\n this.updateList = null;\r\n }\r\n\r\n});\r\n\r\n// Static method called directly by the Game Object creator functions\r\n\r\nGameObjectCreator.register = function (factoryType, factoryFunction)\r\n{\r\n if (!GameObjectCreator.prototype.hasOwnProperty(factoryType))\r\n {\r\n GameObjectCreator.prototype[factoryType] = factoryFunction;\r\n }\r\n};\r\n\r\nGameObjectCreator.remove = function (factoryType)\r\n{\r\n if (GameObjectCreator.prototype.hasOwnProperty(factoryType))\r\n {\r\n delete GameObjectCreator.prototype[factoryType];\r\n }\r\n};\r\n\r\nPluginCache.register('GameObjectCreator', GameObjectCreator, 'make');\r\n\r\nmodule.exports = GameObjectCreator;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/GameObjectCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/GameObjectFactory.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/GameObjectFactory.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar PluginCache = __webpack_require__(/*! ../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar SceneEvents = __webpack_require__(/*! ../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Game Object Factory is a Scene plugin that allows you to quickly create many common\r\n * types of Game Objects and have them automatically registered with the Scene.\r\n *\r\n * Game Objects directly register themselves with the Factory and inject their own creation\r\n * methods into the class.\r\n *\r\n * @class GameObjectFactory\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object Factory belongs.\r\n */\r\nvar GameObjectFactory = new Class({\r\n\r\n initialize:\r\n\r\n function GameObjectFactory (scene)\r\n {\r\n /**\r\n * The Scene to which this Game Object Factory belongs.\r\n *\r\n * @name Phaser.GameObjects.GameObjectFactory#scene\r\n * @type {Phaser.Scene}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A reference to the Scene.Systems.\r\n *\r\n * @name Phaser.GameObjects.GameObjectFactory#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n /**\r\n * A reference to the Scene Display List.\r\n *\r\n * @name Phaser.GameObjects.GameObjectFactory#displayList\r\n * @type {Phaser.GameObjects.DisplayList}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.displayList;\r\n\r\n /**\r\n * A reference to the Scene Update List.\r\n *\r\n * @name Phaser.GameObjects.GameObjectFactory#updateList\r\n * @type {Phaser.GameObjects.UpdateList}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.updateList;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n scene.sys.events.on(SceneEvents.START, this.start, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#boot\r\n * @private\r\n * @since 3.5.1\r\n */\r\n boot: function ()\r\n {\r\n this.displayList = this.systems.displayList;\r\n this.updateList = this.systems.updateList;\r\n\r\n this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#start\r\n * @private\r\n * @since 3.5.0\r\n */\r\n start: function ()\r\n {\r\n this.systems.events.once(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * Adds an existing Game Object to this Scene.\r\n *\r\n * If the Game Object renders, it will be added to the Display List.\r\n * If it has a `preUpdate` method, it will be added to the Update List.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#existing\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.Group)} child - The child to be added to this Scene.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was added.\r\n */\r\n existing: function (child)\r\n {\r\n if (child.renderCanvas || child.renderWebGL)\r\n {\r\n this.displayList.add(child);\r\n }\r\n\r\n if (child.preUpdate)\r\n {\r\n this.updateList.add(child);\r\n }\r\n\r\n return child;\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#shutdown\r\n * @private\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n this.systems.events.off(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#destroy\r\n * @private\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.scene.sys.events.off(SceneEvents.START, this.start, this);\r\n\r\n this.scene = null;\r\n this.systems = null;\r\n\r\n this.displayList = null;\r\n this.updateList = null;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Static method called directly by the Game Object factory functions.\r\n * With this method you can register a custom GameObject factory in the GameObjectFactory,\r\n * providing a name (`factoryType`) and the constructor (`factoryFunction`) in order\r\n * to be called when you call to Phaser.Scene.add[ factoryType ] method.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory.register\r\n * @static\r\n * @since 3.0.0\r\n *\r\n * @param {string} factoryType - The key of the factory that you will use to call to Phaser.Scene.add[ factoryType ] method.\r\n * @param {function} factoryFunction - The constructor function to be called when you invoke to the Phaser.Scene.add method.\r\n */\r\nGameObjectFactory.register = function (factoryType, factoryFunction)\r\n{\r\n if (!GameObjectFactory.prototype.hasOwnProperty(factoryType))\r\n {\r\n GameObjectFactory.prototype[factoryType] = factoryFunction;\r\n }\r\n};\r\n\r\n/**\r\n * Static method called directly by the Game Object factory functions.\r\n * With this method you can remove a custom GameObject factory registered in the GameObjectFactory,\r\n * providing a its `factoryType`.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory.remove\r\n * @static\r\n * @since 3.0.0\r\n *\r\n * @param {string} factoryType - The key of the factory that you want to remove from the GameObjectFactory.\r\n */\r\nGameObjectFactory.remove = function (factoryType)\r\n{\r\n if (GameObjectFactory.prototype.hasOwnProperty(factoryType))\r\n {\r\n delete GameObjectFactory.prototype[factoryType];\r\n }\r\n};\r\n\r\nPluginCache.register('GameObjectFactory', GameObjectFactory, 'add');\r\n\r\nmodule.exports = GameObjectFactory;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/GameObjectFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/UpdateList.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/UpdateList.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar ProcessQueue = __webpack_require__(/*! ../structs/ProcessQueue */ \"./node_modules/phaser/src/structs/ProcessQueue.js\");\r\nvar PluginCache = __webpack_require__(/*! ../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar SceneEvents = __webpack_require__(/*! ../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Update List plugin.\r\n *\r\n * Update Lists belong to a Scene and maintain the list Game Objects to be updated every frame.\r\n *\r\n * Some or all of these Game Objects may also be part of the Scene's [Display List]{@link Phaser.GameObjects.DisplayList}, for Rendering.\r\n *\r\n * @class UpdateList\r\n * @extends Phaser.Structs.ProcessQueue.\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene that the Update List belongs to.\r\n */\r\nvar UpdateList = new Class({\r\n\r\n Extends: ProcessQueue,\r\n\r\n initialize:\r\n\r\n function UpdateList (scene)\r\n {\r\n ProcessQueue.call(this);\r\n\r\n /**\r\n * The Scene that the Update List belongs to.\r\n *\r\n * @name Phaser.GameObjects.UpdateList#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * The Scene's Systems.\r\n *\r\n * @name Phaser.GameObjects.UpdateList#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n /**\r\n * The `pending` list is a selection of items which are due to be made 'active' in the next update.\r\n *\r\n * @name Phaser.GameObjects.UpdateList#_pending\r\n * @type {Array.<*>}\r\n * @private\r\n * @default []\r\n * @since 3.20.0\r\n */\r\n\r\n /**\r\n * The `active` list is a selection of items which are considered active and should be updated.\r\n *\r\n * @name Phaser.GameObjects.UpdateList#_active\r\n * @type {Array.<*>}\r\n * @private\r\n * @default []\r\n * @since 3.20.0\r\n */\r\n\r\n /**\r\n * The `destroy` list is a selection of items that were active and are awaiting being destroyed in the next update.\r\n *\r\n * @name Phaser.GameObjects.UpdateList#_destroy\r\n * @type {Array.<*>}\r\n * @private\r\n * @default []\r\n * @since 3.20.0\r\n */\r\n\r\n /**\r\n * The total number of items awaiting processing.\r\n *\r\n * @name Phaser.GameObjects.UpdateList#_toProcess\r\n * @type {integer}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n scene.sys.events.on(SceneEvents.START, this.start, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.GameObjects.UpdateList#boot\r\n * @private\r\n * @since 3.5.1\r\n */\r\n boot: function ()\r\n {\r\n this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.GameObjects.UpdateList#start\r\n * @private\r\n * @since 3.5.0\r\n */\r\n start: function ()\r\n {\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.on(SceneEvents.PRE_UPDATE, this.update, this);\r\n eventEmitter.on(SceneEvents.UPDATE, this.sceneUpdate, this);\r\n eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * The update step.\r\n *\r\n * Pre-updates every active Game Object in the list.\r\n *\r\n * @method Phaser.GameObjects.UpdateList#sceneUpdate\r\n * @since 3.20.0\r\n *\r\n * @param {number} time - The current timestamp.\r\n * @param {number} delta - The delta time elapsed since the last frame.\r\n */\r\n sceneUpdate: function (time, delta)\r\n {\r\n var list = this._active;\r\n var length = list.length;\r\n\r\n for (var i = 0; i < length; i++)\r\n {\r\n var gameObject = list[i];\r\n\r\n if (gameObject.active)\r\n {\r\n gameObject.preUpdate.call(gameObject, time, delta);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * \r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Phaser.GameObjects.UpdateList#shutdown\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n var i = this._active.length;\r\n\r\n while (i--)\r\n {\r\n this._active[i].destroy(true);\r\n }\r\n\r\n i = this._pending.length;\r\n\r\n while (i--)\r\n {\r\n this._pending[i].destroy(true);\r\n }\r\n\r\n i = this._destroy.length;\r\n\r\n while (i--)\r\n {\r\n this._destroy[i].destroy(true);\r\n }\r\n\r\n this._toProcess = 0;\r\n\r\n this._pending = [];\r\n this._active = [];\r\n this._destroy = [];\r\n\r\n this.removeAllListeners();\r\n\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.off(SceneEvents.PRE_UPDATE, this.preUpdate, this);\r\n eventEmitter.off(SceneEvents.UPDATE, this.sceneUpdate, this);\r\n eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * \r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Phaser.GameObjects.UpdateList#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.systems.events.off(SceneEvents.START, this.start, this);\r\n\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n /**\r\n * Adds a new item to the Update List.\r\n * \r\n * The item is added to the pending list and made active in the next update.\r\n *\r\n * @method Phaser.GameObjects.UpdateList#add\r\n * @since 3.0.0\r\n *\r\n * @param {*} item - The item to add to the queue.\r\n *\r\n * @return {*} The item that was added.\r\n */\r\n\r\n /**\r\n * Removes an item from the Update List.\r\n * \r\n * The item is added to the pending destroy and fully removed in the next update.\r\n *\r\n * @method Phaser.GameObjects.UpdateList#remove\r\n * @since 3.0.0\r\n *\r\n * @param {*} item - The item to be removed from the queue.\r\n *\r\n * @return {*} The item that was removed.\r\n */\r\n\r\n /**\r\n * Removes all active items from this Update List.\r\n * \r\n * All the items are marked as 'pending destroy' and fully removed in the next update.\r\n *\r\n * @method Phaser.GameObjects.UpdateList#removeAll\r\n * @since 3.20.0\r\n *\r\n * @return {this} This Update List object.\r\n */\r\n\r\n /**\r\n * Update this queue. First it will process any items awaiting destruction, and remove them.\r\n * \r\n * Then it will check to see if there are any items pending insertion, and move them to an\r\n * active state. Finally, it will return a list of active items for further processing.\r\n *\r\n * @method Phaser.GameObjects.UpdateList#update\r\n * @since 3.0.0\r\n *\r\n * @return {Array.<*>} A list of active items.\r\n */\r\n\r\n /**\r\n * Returns the current list of active items.\r\n * \r\n * This method returns a reference to the active list array, not a copy of it.\r\n * Therefore, be careful to not modify this array outside of the ProcessQueue.\r\n *\r\n * @method Phaser.GameObjects.UpdateList#getActive\r\n * @since 3.0.0\r\n *\r\n * @return {Array.<*>} A list of active items.\r\n */\r\n\r\n /**\r\n * The number of entries in the active list.\r\n *\r\n * @name Phaser.GameObjects.UpdateList#length\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.20.0\r\n */\r\n});\r\n\r\nPluginCache.register('UpdateList', UpdateList, 'updateList');\r\n\r\nmodule.exports = UpdateList;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/UpdateList.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/GetBitmapTextSize.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/GetBitmapTextSize.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the position, width and height of a BitmapText Game Object.\r\n *\r\n * Returns a BitmapTextSize object that contains global and local variants of the Game Objects x and y coordinates and\r\n * its width and height.\r\n *\r\n * The global position and size take into account the Game Object's position and scale.\r\n *\r\n * The local position and size just takes into account the font data.\r\n *\r\n * @function GetBitmapTextSize\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {(Phaser.GameObjects.DynamicBitmapText|Phaser.GameObjects.BitmapText)} src - The BitmapText to calculate the position, width and height of.\r\n * @param {boolean} [round] - Whether to round the results to the nearest integer.\r\n * @param {object} [out] - Optional object to store the results in, to save constant object creation.\r\n *\r\n * @return {Phaser.Types.GameObjects.BitmapText.BitmapTextSize} The calculated position, width and height of the BitmapText.\r\n */\r\nvar GetBitmapTextSize = function (src, round, out)\r\n{\r\n if (out === undefined)\r\n {\r\n out = {\r\n local: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n global: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n lines: {\r\n shortest: 0,\r\n longest: 0,\r\n lengths: null,\r\n height: 0\r\n },\r\n wrappedText: '',\r\n words: [],\r\n scaleX: 0,\r\n scaleY: 0\r\n };\r\n\r\n return out;\r\n }\r\n\r\n var text = src.text;\r\n var textLength = text.length;\r\n var maxWidth = src.maxWidth;\r\n var wordWrapCharCode = src.wordWrapCharCode;\r\n\r\n var bx = Number.MAX_VALUE;\r\n var by = Number.MAX_VALUE;\r\n var bw = 0;\r\n var bh = 0;\r\n\r\n var chars = src.fontData.chars;\r\n var lineHeight = src.fontData.lineHeight;\r\n var letterSpacing = src.letterSpacing;\r\n\r\n var xAdvance = 0;\r\n var yAdvance = 0;\r\n\r\n var charCode = 0;\r\n\r\n var glyph = null;\r\n\r\n var x = 0;\r\n var y = 0;\r\n\r\n var scale = (src.fontSize / src.fontData.size);\r\n var sx = scale * src.scaleX;\r\n var sy = scale * src.scaleY;\r\n\r\n var lastGlyph = null;\r\n var lastCharCode = 0;\r\n var lineWidths = [];\r\n var shortestLine = Number.MAX_VALUE;\r\n var longestLine = 0;\r\n var currentLine = 0;\r\n var currentLineWidth = 0;\r\n\r\n var i;\r\n var words = [];\r\n var current = null;\r\n\r\n // Scan for breach of maxWidth and insert carriage-returns\r\n if (maxWidth > 0)\r\n {\r\n for (i = 0; i < textLength; i++)\r\n {\r\n charCode = text.charCodeAt(i);\r\n\r\n if (charCode === 10)\r\n {\r\n if (current !== null)\r\n {\r\n words.push({\r\n word: current.word,\r\n i: current.i,\r\n x: current.x * sx,\r\n y: current.y * sy,\r\n w: current.w * sx,\r\n h: current.h * sy,\r\n cr: true\r\n });\r\n\r\n current = null;\r\n }\r\n\r\n xAdvance = 0;\r\n yAdvance += lineHeight;\r\n lastGlyph = null;\r\n\r\n continue;\r\n }\r\n\r\n glyph = chars[charCode];\r\n\r\n if (!glyph)\r\n {\r\n continue;\r\n }\r\n\r\n if (lastGlyph !== null)\r\n {\r\n var glyphKerningOffset = glyph.kerning[lastCharCode];\r\n }\r\n\r\n if (charCode === wordWrapCharCode)\r\n {\r\n if (current !== null)\r\n {\r\n words.push({\r\n word: current.word,\r\n i: current.i,\r\n x: current.x * sx,\r\n y: current.y * sy,\r\n w: current.w * sx,\r\n h: current.h * sy,\r\n cr: false\r\n });\r\n \r\n current = null;\r\n }\r\n }\r\n else\r\n {\r\n if (current === null)\r\n {\r\n // We're starting a new word, recording the starting index, etc\r\n current = { word: '', i: i, x: xAdvance, y: yAdvance, w: 0, h: lineHeight, cr: false };\r\n }\r\n\r\n current.word = current.word.concat(text[i]);\r\n current.w += glyph.xOffset + glyph.xAdvance + ((glyphKerningOffset !== undefined) ? glyphKerningOffset : 0);\r\n }\r\n\r\n xAdvance += glyph.xAdvance + letterSpacing;\r\n lastGlyph = glyph;\r\n lastCharCode = charCode;\r\n }\r\n\r\n // Last word\r\n if (current !== null)\r\n {\r\n words.push({\r\n word: current.word,\r\n i: current.i,\r\n x: current.x * sx,\r\n y: current.y * sy,\r\n w: current.w * sx,\r\n h: current.h * sy,\r\n cr: false\r\n });\r\n }\r\n\r\n // Reset for the next loop\r\n xAdvance = 0;\r\n yAdvance = 0;\r\n lastGlyph = null;\r\n lastCharCode = 0;\r\n\r\n // Loop through the words array and see if we've got any > maxWidth\r\n var prev;\r\n var offset = 0;\r\n var crs = [];\r\n\r\n for (i = 0; i < words.length; i++)\r\n {\r\n var entry = words[i];\r\n var left = entry.x;\r\n var right = entry.x + entry.w;\r\n\r\n if (prev)\r\n {\r\n var diff = left - (prev.x + prev.w);\r\n\r\n offset = left - (diff + prev.w);\r\n\r\n prev = null;\r\n }\r\n\r\n var checkLeft = left - offset;\r\n var checkRight = right - offset;\r\n\r\n if (checkLeft > maxWidth || checkRight > maxWidth)\r\n {\r\n crs.push(entry.i - 1);\r\n\r\n if (entry.cr)\r\n {\r\n crs.push(entry.i + entry.word.length);\r\n\r\n offset = 0;\r\n prev = null;\r\n }\r\n else\r\n {\r\n prev = entry;\r\n }\r\n }\r\n else if (entry.cr)\r\n {\r\n crs.push(entry.i + entry.word.length);\r\n\r\n offset = 0;\r\n prev = null;\r\n }\r\n }\r\n\r\n var stringInsert = function (str, index, value)\r\n {\r\n return str.substr(0, index) + value + str.substr(index + 1);\r\n };\r\n\r\n for (i = crs.length - 1; i >= 0; i--)\r\n {\r\n // eslint-disable-next-line quotes\r\n text = stringInsert(text, crs[i], \"\\n\");\r\n }\r\n\r\n out.wrappedText = text;\r\n\r\n textLength = text.length;\r\n\r\n // Recalculated in the next loop\r\n words = [];\r\n current = null;\r\n }\r\n\r\n for (i = 0; i < textLength; i++)\r\n {\r\n charCode = text.charCodeAt(i);\r\n\r\n if (charCode === 10)\r\n {\r\n if (current !== null)\r\n {\r\n words.push({\r\n word: current.word,\r\n i: current.i,\r\n x: current.x * sx,\r\n y: current.y * sy,\r\n w: current.w * sx,\r\n h: current.h * sy\r\n });\r\n\r\n current = null;\r\n }\r\n\r\n xAdvance = 0;\r\n yAdvance += lineHeight;\r\n lastGlyph = null;\r\n\r\n lineWidths[currentLine] = currentLineWidth;\r\n\r\n if (currentLineWidth > longestLine)\r\n {\r\n longestLine = currentLineWidth;\r\n }\r\n\r\n if (currentLineWidth < shortestLine)\r\n {\r\n shortestLine = currentLineWidth;\r\n }\r\n\r\n currentLine++;\r\n currentLineWidth = 0;\r\n\r\n continue;\r\n }\r\n\r\n glyph = chars[charCode];\r\n\r\n if (!glyph)\r\n {\r\n continue;\r\n }\r\n\r\n x = xAdvance;\r\n y = yAdvance;\r\n\r\n if (lastGlyph !== null)\r\n {\r\n var kerningOffset = glyph.kerning[lastCharCode];\r\n\r\n x += (kerningOffset !== undefined) ? kerningOffset : 0;\r\n }\r\n\r\n if (bx > x)\r\n {\r\n bx = x;\r\n }\r\n\r\n if (by > y)\r\n {\r\n by = y;\r\n }\r\n\r\n var gw = x + glyph.xAdvance;\r\n var gh = y + lineHeight;\r\n\r\n if (bw < gw)\r\n {\r\n bw = gw;\r\n }\r\n\r\n if (bh < gh)\r\n {\r\n bh = gh;\r\n }\r\n\r\n if (charCode === wordWrapCharCode)\r\n {\r\n if (current !== null)\r\n {\r\n words.push({\r\n word: current.word,\r\n i: current.i,\r\n x: current.x * sx,\r\n y: current.y * sy,\r\n w: current.w * sx,\r\n h: current.h * sy\r\n });\r\n \r\n current = null;\r\n }\r\n }\r\n else\r\n {\r\n if (current === null)\r\n {\r\n // We're starting a new word, recording the starting index, etc\r\n current = { word: '', i: i, x: xAdvance, y: yAdvance, w: 0, h: lineHeight };\r\n }\r\n\r\n current.word = current.word.concat(text[i]);\r\n current.w += glyph.xOffset + glyph.xAdvance + ((kerningOffset !== undefined) ? kerningOffset : 0);\r\n }\r\n\r\n xAdvance += glyph.xAdvance + letterSpacing;\r\n lastGlyph = glyph;\r\n lastCharCode = charCode;\r\n currentLineWidth = gw * scale;\r\n }\r\n\r\n // Last word\r\n if (current !== null)\r\n {\r\n words.push({\r\n word: current.word,\r\n i: current.i,\r\n x: current.x * sx,\r\n y: current.y * sy,\r\n w: current.w * sx,\r\n h: current.h * sy\r\n });\r\n }\r\n\r\n lineWidths[currentLine] = currentLineWidth;\r\n\r\n if (currentLineWidth > longestLine)\r\n {\r\n longestLine = currentLineWidth;\r\n }\r\n\r\n if (currentLineWidth < shortestLine)\r\n {\r\n shortestLine = currentLineWidth;\r\n }\r\n\r\n var local = out.local;\r\n var global = out.global;\r\n var lines = out.lines;\r\n\r\n local.x = bx * scale;\r\n local.y = by * scale;\r\n local.width = bw * scale;\r\n local.height = bh * scale;\r\n\r\n global.x = (src.x - src.displayOriginX) + (bx * sx);\r\n global.y = (src.y - src.displayOriginY) + (by * sy);\r\n global.width = bw * sx;\r\n global.height = bh * sy;\r\n\r\n lines.shortest = shortestLine;\r\n lines.longest = longestLine;\r\n lines.lengths = lineWidths;\r\n\r\n if (round)\r\n {\r\n local.x = Math.round(local.x);\r\n local.y = Math.round(local.y);\r\n local.width = Math.round(local.width);\r\n local.height = Math.round(local.height);\r\n\r\n global.x = Math.round(global.x);\r\n global.y = Math.round(global.y);\r\n global.width = Math.round(global.width);\r\n global.height = Math.round(global.height);\r\n\r\n lines.shortest = Math.round(shortestLine);\r\n lines.longest = Math.round(longestLine);\r\n }\r\n\r\n out.words = words;\r\n out.lines.height = lineHeight;\r\n out.scaleX = src.scaleX;\r\n out.scaleY = src.scaleY;\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetBitmapTextSize;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/GetBitmapTextSize.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/ParseFromAtlas.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/ParseFromAtlas.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ParseXMLBitmapFont = __webpack_require__(/*! ./ParseXMLBitmapFont */ \"./node_modules/phaser/src/gameobjects/bitmaptext/ParseXMLBitmapFont.js\");\r\n\r\n/**\r\n * Parse an XML Bitmap Font from an Atlas.\r\n *\r\n * Adds the parsed Bitmap Font data to the cache with the `fontName` key.\r\n *\r\n * @function ParseFromAtlas\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to parse the Bitmap Font for.\r\n * @param {string} fontName - The key of the font to add to the Bitmap Font cache.\r\n * @param {string} textureKey - The key of the BitmapFont's texture.\r\n * @param {string} frameKey - The key of the BitmapFont texture's frame.\r\n * @param {string} xmlKey - The key of the XML data of the font to parse.\r\n * @param {integer} [xSpacing] - The x-axis spacing to add between each letter.\r\n * @param {integer} [ySpacing] - The y-axis spacing to add to the line height.\r\n *\r\n * @return {boolean} Whether the parsing was successful or not.\r\n */\r\nvar ParseFromAtlas = function (scene, fontName, textureKey, frameKey, xmlKey, xSpacing, ySpacing)\r\n{\r\n var frame = scene.sys.textures.getFrame(textureKey, frameKey);\r\n var xml = scene.sys.cache.xml.get(xmlKey);\r\n\r\n if (frame && xml)\r\n {\r\n var data = ParseXMLBitmapFont(xml, xSpacing, ySpacing, frame);\r\n\r\n scene.sys.cache.bitmapFont.add(fontName, { data: data, texture: textureKey, frame: frameKey });\r\n\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n};\r\n\r\nmodule.exports = ParseFromAtlas;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/ParseFromAtlas.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/ParseRetroFont.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/ParseRetroFont.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\n\r\n/**\r\n * Parses a Retro Font configuration object so you can pass it to the BitmapText constructor\r\n * and create a BitmapText object using a fixed-width retro font.\r\n *\r\n * @function Phaser.GameObjects.RetroFont.Parse\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Phaser Scene.\r\n * @param {Phaser.Types.GameObjects.BitmapText.RetroFontConfig} config - The font configuration object.\r\n *\r\n * @return {object} A parsed Bitmap Font data entry for the Bitmap Font cache.\r\n */\r\nvar ParseRetroFont = function (scene, config)\r\n{\r\n var w = config.width;\r\n var h = config.height;\r\n var cx = Math.floor(w / 2);\r\n var cy = Math.floor(h / 2);\r\n var letters = GetValue(config, 'chars', '');\r\n\r\n if (letters === '')\r\n {\r\n return;\r\n }\r\n\r\n var key = GetValue(config, 'image', '');\r\n var offsetX = GetValue(config, 'offset.x', 0);\r\n var offsetY = GetValue(config, 'offset.y', 0);\r\n var spacingX = GetValue(config, 'spacing.x', 0);\r\n var spacingY = GetValue(config, 'spacing.y', 0);\r\n var lineSpacing = GetValue(config, 'lineSpacing', 0);\r\n\r\n var charsPerRow = GetValue(config, 'charsPerRow', null);\r\n\r\n if (charsPerRow === null)\r\n {\r\n charsPerRow = scene.sys.textures.getFrame(key).width / w;\r\n\r\n if (charsPerRow > letters.length)\r\n {\r\n charsPerRow = letters.length;\r\n }\r\n }\r\n\r\n var x = offsetX;\r\n var y = offsetY;\r\n\r\n var data = {\r\n retroFont: true,\r\n font: key,\r\n size: w,\r\n lineHeight: h + lineSpacing,\r\n chars: {}\r\n };\r\n\r\n var r = 0;\r\n\r\n for (var i = 0; i < letters.length; i++)\r\n {\r\n // var node = letters[i];\r\n\r\n var charCode = letters.charCodeAt(i);\r\n\r\n data.chars[charCode] =\r\n {\r\n x: x,\r\n y: y,\r\n width: w,\r\n height: h,\r\n centerX: cx,\r\n centerY: cy,\r\n xOffset: 0,\r\n yOffset: 0,\r\n xAdvance: w,\r\n data: {},\r\n kerning: {}\r\n };\r\n\r\n r++;\r\n\r\n if (r === charsPerRow)\r\n {\r\n r = 0;\r\n x = offsetX;\r\n y += h + spacingY;\r\n }\r\n else\r\n {\r\n x += w + spacingX;\r\n }\r\n }\r\n\r\n var entry = {\r\n data: data,\r\n frame: null,\r\n texture: key\r\n };\r\n\r\n return entry;\r\n};\r\n\r\nmodule.exports = ParseRetroFont;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/ParseRetroFont.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/ParseXMLBitmapFont.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/ParseXMLBitmapFont.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Read an integer value from an XML Node.\r\n *\r\n * @function getValue\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Node} node - The XML Node.\r\n * @param {string} attribute - The attribute to read.\r\n *\r\n * @return {integer} The parsed value.\r\n */\r\nfunction getValue (node, attribute)\r\n{\r\n return parseInt(node.getAttribute(attribute), 10);\r\n}\r\n\r\n/**\r\n * Parse an XML font to Bitmap Font data for the Bitmap Font cache.\r\n *\r\n * @function ParseXMLBitmapFont\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {XMLDocument} xml - The XML Document to parse the font from.\r\n * @param {integer} [xSpacing=0] - The x-axis spacing to add between each letter.\r\n * @param {integer} [ySpacing=0] - The y-axis spacing to add to the line height.\r\n * @param {Phaser.Textures.Frame} [frame] - The texture frame to take into account while parsing.\r\n *\r\n * @return {Phaser.Types.GameObjects.BitmapText.BitmapFontData} The parsed Bitmap Font data.\r\n */\r\nvar ParseXMLBitmapFont = function (xml, xSpacing, ySpacing, frame)\r\n{\r\n if (xSpacing === undefined) { xSpacing = 0; }\r\n if (ySpacing === undefined) { ySpacing = 0; }\r\n\r\n var data = {};\r\n var info = xml.getElementsByTagName('info')[0];\r\n var common = xml.getElementsByTagName('common')[0];\r\n\r\n data.font = info.getAttribute('face');\r\n data.size = getValue(info, 'size');\r\n data.lineHeight = getValue(common, 'lineHeight') + ySpacing;\r\n data.chars = {};\r\n\r\n var letters = xml.getElementsByTagName('char');\r\n\r\n var adjustForTrim = (frame !== undefined && frame.trimmed);\r\n\r\n if (adjustForTrim)\r\n {\r\n var top = frame.height;\r\n var left = frame.width;\r\n }\r\n\r\n for (var i = 0; i < letters.length; i++)\r\n {\r\n var node = letters[i];\r\n\r\n var charCode = getValue(node, 'id');\r\n var gx = getValue(node, 'x');\r\n var gy = getValue(node, 'y');\r\n var gw = getValue(node, 'width');\r\n var gh = getValue(node, 'height');\r\n\r\n // Handle frame trim issues\r\n\r\n if (adjustForTrim)\r\n {\r\n if (gx < left)\r\n {\r\n left = gx;\r\n }\r\n\r\n if (gy < top)\r\n {\r\n top = gy;\r\n }\r\n }\r\n\r\n data.chars[charCode] =\r\n {\r\n x: gx,\r\n y: gy,\r\n width: gw,\r\n height: gh,\r\n centerX: Math.floor(gw / 2),\r\n centerY: Math.floor(gh / 2),\r\n xOffset: getValue(node, 'xoffset'),\r\n yOffset: getValue(node, 'yoffset'),\r\n xAdvance: getValue(node, 'xadvance') + xSpacing,\r\n data: {},\r\n kerning: {}\r\n };\r\n }\r\n\r\n if (adjustForTrim && top !== 0 && left !== 0)\r\n {\r\n // Now we know the top and left coordinates of the glyphs in the original data\r\n // so we can work out how much to adjust the glyphs by\r\n\r\n for (var code in data.chars)\r\n {\r\n var glyph = data.chars[code];\r\n\r\n glyph.x -= frame.x;\r\n glyph.y -= frame.y;\r\n }\r\n }\r\n\r\n var kernings = xml.getElementsByTagName('kerning');\r\n\r\n for (i = 0; i < kernings.length; i++)\r\n {\r\n var kern = kernings[i];\r\n\r\n var first = getValue(kern, 'first');\r\n var second = getValue(kern, 'second');\r\n var amount = getValue(kern, 'amount');\r\n\r\n data.chars[second].kerning[first] = amount;\r\n }\r\n\r\n return data;\r\n};\r\n\r\nmodule.exports = ParseXMLBitmapFont;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/ParseXMLBitmapFont.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/RetroFont.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/RetroFont.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RETRO_FONT_CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/gameobjects/bitmaptext/const.js\");\r\nvar Extend = __webpack_require__(/*! ../../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\n\r\n/**\r\n * @namespace Phaser.GameObjects.RetroFont\r\n * @since 3.6.0\r\n */\r\n\r\nvar RetroFont = { Parse: __webpack_require__(/*! ./ParseRetroFont */ \"./node_modules/phaser/src/gameobjects/bitmaptext/ParseRetroFont.js\") };\r\n\r\n// Merge in the consts\r\nRetroFont = Extend(false, RetroFont, RETRO_FONT_CONST);\r\n\r\nmodule.exports = RetroFont;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/RetroFont.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/const.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/const.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RETRO_FONT_CONST = {\r\n\r\n /**\r\n * Text Set 1 = !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\r\n * \r\n * @name Phaser.GameObjects.RetroFont.TEXT_SET1\r\n * @type {string}\r\n * @since 3.6.0\r\n */\r\n TEXT_SET1: ' !\"#$%&\\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~',\r\n\r\n /**\r\n * Text Set 2 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n * \r\n * @name Phaser.GameObjects.RetroFont.TEXT_SET2\r\n * @type {string}\r\n * @since 3.6.0\r\n */\r\n TEXT_SET2: ' !\"#$%&\\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ',\r\n\r\n /**\r\n * Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 \r\n * \r\n * @name Phaser.GameObjects.RetroFont.TEXT_SET3\r\n * @type {string}\r\n * @since 3.6.0\r\n */\r\n TEXT_SET3: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ',\r\n\r\n /**\r\n * Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789\r\n * \r\n * @name Phaser.GameObjects.RetroFont.TEXT_SET4\r\n * @type {string}\r\n * @since 3.6.0\r\n */\r\n TEXT_SET4: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789',\r\n\r\n /**\r\n * Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789\r\n * \r\n * @name Phaser.GameObjects.RetroFont.TEXT_SET5\r\n * @type {string}\r\n * @since 3.6.0\r\n */\r\n TEXT_SET5: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() \\'!?-*:0123456789',\r\n\r\n /**\r\n * Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' \r\n * \r\n * @name Phaser.GameObjects.RetroFont.TEXT_SET6\r\n * @type {string}\r\n * @since 3.6.0\r\n */\r\n TEXT_SET6: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.\\' ',\r\n\r\n /**\r\n * Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39\r\n * \r\n * @name Phaser.GameObjects.RetroFont.TEXT_SET7\r\n * @type {string}\r\n * @since 3.6.0\r\n */\r\n TEXT_SET7: 'AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-\\'39',\r\n\r\n /**\r\n * Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n * \r\n * @name Phaser.GameObjects.RetroFont.TEXT_SET8\r\n * @type {string}\r\n * @since 3.6.0\r\n */\r\n TEXT_SET8: '0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ',\r\n\r\n /**\r\n * Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!\r\n * \r\n * @name Phaser.GameObjects.RetroFont.TEXT_SET9\r\n * @type {string}\r\n * @since 3.6.0\r\n */\r\n TEXT_SET9: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,\\'\"?!',\r\n\r\n /**\r\n * Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n * \r\n * @name Phaser.GameObjects.RetroFont.TEXT_SET10\r\n * @type {string}\r\n * @since 3.6.0\r\n */\r\n TEXT_SET10: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\r\n\r\n /**\r\n * Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789\r\n * \r\n * @name Phaser.GameObjects.RetroFont.TEXT_SET11\r\n * @since 3.6.0\r\n * @type {string}\r\n */\r\n TEXT_SET11: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()\\':;0123456789'\r\n\r\n};\r\n\r\nmodule.exports = RETRO_FONT_CONST;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/const.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js": /*!*************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BitmapText = __webpack_require__(/*! ../static/BitmapText */ \"./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapText.js\");\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Render = __webpack_require__(/*! ./DynamicBitmapTextRender */ \"./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextRender.js\");\r\n\r\n/**\r\n * @classdesc\r\n * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure.\r\n * \r\n * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to\r\n * match the font structure.\r\n * \r\n * Dynamic Bitmap Text objects are different from Static Bitmap Text in that they invoke a callback for each\r\n * letter being rendered during the render pass. This callback allows you to manipulate the properties of\r\n * each letter being rendered, such as its position, scale or tint, allowing you to create interesting effects\r\n * like jiggling text, which can't be done with Static text. This means that Dynamic Text takes more processing\r\n * time, so only use them if you require the callback ability they have.\r\n *\r\n * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability\r\n * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by\r\n * processing the font texture in an image editor, applying fills and any other effects required.\r\n *\r\n * To create multi-line text insert \\r, \\n or \\r\\n escape codes into the text string.\r\n *\r\n * To create a BitmapText data files you need a 3rd party app such as:\r\n *\r\n * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/\r\n * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner\r\n * Littera (Web-based, free): http://kvazars.com/littera/\r\n *\r\n * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of\r\n * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson\r\n *\r\n * @class DynamicBitmapText\r\n * @extends Phaser.GameObjects.BitmapText\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. It can only belong to one Scene at any given time.\r\n * @param {number} x - The x coordinate of this Game Object in world space.\r\n * @param {number} y - The y coordinate of this Game Object in world space.\r\n * @param {string} font - The key of the font to use from the Bitmap Font cache.\r\n * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text.\r\n * @param {number} [size] - The font size of this Bitmap Text.\r\n * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object.\r\n */\r\nvar DynamicBitmapText = new Class({\r\n\r\n Extends: BitmapText,\r\n\r\n Mixins: [\r\n Render\r\n ],\r\n\r\n initialize:\r\n\r\n function DynamicBitmapText (scene, x, y, font, text, size, align)\r\n {\r\n BitmapText.call(this, scene, x, y, font, text, size, align);\r\n\r\n this.type = 'DynamicBitmapText';\r\n\r\n /**\r\n * The horizontal scroll position of the Bitmap Text.\r\n *\r\n * @name Phaser.GameObjects.DynamicBitmapText#scrollX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.scrollX = 0;\r\n\r\n /**\r\n * The vertical scroll position of the Bitmap Text.\r\n *\r\n * @name Phaser.GameObjects.DynamicBitmapText#scrollY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.scrollY = 0;\r\n\r\n /**\r\n * The crop width of the Bitmap Text.\r\n *\r\n * @name Phaser.GameObjects.DynamicBitmapText#cropWidth\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.cropWidth = 0;\r\n\r\n /**\r\n * The crop height of the Bitmap Text.\r\n *\r\n * @name Phaser.GameObjects.DynamicBitmapText#cropHeight\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.cropHeight = 0;\r\n\r\n /**\r\n * A callback that alters how each character of the Bitmap Text is rendered.\r\n *\r\n * @name Phaser.GameObjects.DynamicBitmapText#displayCallback\r\n * @type {Phaser.Types.GameObjects.BitmapText.DisplayCallback}\r\n * @since 3.0.0\r\n */\r\n this.displayCallback;\r\n\r\n /**\r\n * The data object that is populated during rendering, then passed to the displayCallback.\r\n * You should modify this object then return it back from the callback. It's updated values\r\n * will be used to render the specific glyph.\r\n * \r\n * Please note that if you need a reference to this object locally in your game code then you\r\n * should shallow copy it, as it's updated and re-used for every glyph in the text.\r\n *\r\n * @name Phaser.GameObjects.DynamicBitmapText#callbackData\r\n * @type {Phaser.Types.GameObjects.BitmapText.DisplayCallbackConfig}\r\n * @since 3.11.0\r\n */\r\n this.callbackData = {\r\n parent: this,\r\n color: 0,\r\n tint: {\r\n topLeft: 0,\r\n topRight: 0,\r\n bottomLeft: 0,\r\n bottomRight: 0\r\n },\r\n index: 0,\r\n charCode: 0,\r\n x: 0,\r\n y: 0,\r\n scale: 0,\r\n rotation: 0,\r\n data: 0\r\n };\r\n },\r\n\r\n /**\r\n * Set the crop size of this Bitmap Text.\r\n *\r\n * @method Phaser.GameObjects.DynamicBitmapText#setSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of the crop.\r\n * @param {number} height - The height of the crop.\r\n *\r\n * @return {Phaser.GameObjects.DynamicBitmapText} This Game Object.\r\n */\r\n setSize: function (width, height)\r\n {\r\n this.cropWidth = width;\r\n this.cropHeight = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a callback that alters how each character of the Bitmap Text is rendered.\r\n *\r\n * The callback receives a {@link Phaser.Types.GameObjects.BitmapText.DisplayCallbackConfig} object that contains information about the character that's\r\n * about to be rendered.\r\n *\r\n * It should return an object with `x`, `y`, `scale` and `rotation` properties that will be used instead of the\r\n * usual values when rendering.\r\n *\r\n * @method Phaser.GameObjects.DynamicBitmapText#setDisplayCallback\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.BitmapText.DisplayCallback} callback - The display callback to set.\r\n *\r\n * @return {Phaser.GameObjects.DynamicBitmapText} This Game Object.\r\n */\r\n setDisplayCallback: function (callback)\r\n {\r\n this.displayCallback = callback;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the horizontal scroll position of this Bitmap Text.\r\n *\r\n * @method Phaser.GameObjects.DynamicBitmapText#setScrollX\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The horizontal scroll position to set.\r\n *\r\n * @return {Phaser.GameObjects.DynamicBitmapText} This Game Object.\r\n */\r\n setScrollX: function (value)\r\n {\r\n this.scrollX = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the vertical scroll position of this Bitmap Text.\r\n *\r\n * @method Phaser.GameObjects.DynamicBitmapText#setScrollY\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The vertical scroll position to set.\r\n *\r\n * @return {Phaser.GameObjects.DynamicBitmapText} This Game Object.\r\n */\r\n setScrollY: function (value)\r\n {\r\n this.scrollY = value;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = DynamicBitmapText;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextCanvasRenderer.js": /*!***************************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextCanvasRenderer.js ***! \***************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SetTransform = __webpack_require__(/*! ../../../renderer/canvas/utils/SetTransform */ \"./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js\");\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.DynamicBitmapText#renderCanvas\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.DynamicBitmapText} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar DynamicBitmapTextCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var text = src._text;\r\n var textLength = text.length;\r\n\r\n var ctx = renderer.currentContext;\r\n\r\n if (textLength === 0 || !SetTransform(renderer, ctx, src, camera, parentMatrix))\r\n {\r\n return;\r\n }\r\n \r\n var textureFrame = src.frame;\r\n\r\n var displayCallback = src.displayCallback;\r\n var callbackData = src.callbackData;\r\n\r\n var chars = src.fontData.chars;\r\n var lineHeight = src.fontData.lineHeight;\r\n var letterSpacing = src._letterSpacing;\r\n\r\n var xAdvance = 0;\r\n var yAdvance = 0;\r\n\r\n var charCode = 0;\r\n\r\n var glyph = null;\r\n var glyphX = 0;\r\n var glyphY = 0;\r\n var glyphW = 0;\r\n var glyphH = 0;\r\n\r\n var x = 0;\r\n var y = 0;\r\n\r\n var lastGlyph = null;\r\n var lastCharCode = 0;\r\n\r\n var image = src.frame.source.image;\r\n\r\n var textureX = textureFrame.cutX;\r\n var textureY = textureFrame.cutY;\r\n\r\n var rotation = 0;\r\n var scale = 0;\r\n var baseScale = (src._fontSize / src.fontData.size);\r\n\r\n var align = src._align;\r\n var currentLine = 0;\r\n var lineOffsetX = 0;\r\n\r\n // Update the bounds - skipped internally if not dirty\r\n src.getTextBounds(false);\r\n\r\n var lineData = src._bounds.lines;\r\n\r\n if (align === 1)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[0]) / 2;\r\n }\r\n else if (align === 2)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[0]);\r\n }\r\n\r\n ctx.translate(-src.displayOriginX, -src.displayOriginY);\r\n\r\n var roundPixels = camera.roundPixels;\r\n\r\n if (src.cropWidth > 0 && src.cropHeight > 0)\r\n {\r\n ctx.beginPath();\r\n ctx.rect(0, 0, src.cropWidth, src.cropHeight);\r\n ctx.clip();\r\n }\r\n\r\n for (var i = 0; i < textLength; i++)\r\n {\r\n // Reset the scale (in case the callback changed it)\r\n scale = baseScale;\r\n rotation = 0;\r\n\r\n charCode = text.charCodeAt(i);\r\n\r\n if (charCode === 10)\r\n {\r\n currentLine++;\r\n\r\n if (align === 1)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[currentLine]) / 2;\r\n }\r\n else if (align === 2)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[currentLine]);\r\n }\r\n\r\n xAdvance = 0;\r\n yAdvance += lineHeight;\r\n lastGlyph = null;\r\n\r\n continue;\r\n }\r\n\r\n glyph = chars[charCode];\r\n\r\n if (!glyph)\r\n {\r\n continue;\r\n }\r\n\r\n glyphX = textureX + glyph.x;\r\n glyphY = textureY + glyph.y;\r\n\r\n glyphW = glyph.width;\r\n glyphH = glyph.height;\r\n\r\n x = (glyph.xOffset + xAdvance) - src.scrollX;\r\n y = (glyph.yOffset + yAdvance) - src.scrollY;\r\n\r\n if (lastGlyph !== null)\r\n {\r\n var kerningOffset = glyph.kerning[lastCharCode];\r\n x += (kerningOffset !== undefined) ? kerningOffset : 0;\r\n }\r\n\r\n if (displayCallback)\r\n {\r\n callbackData.index = i;\r\n callbackData.charCode = charCode;\r\n callbackData.x = x;\r\n callbackData.y = y;\r\n callbackData.scale = scale;\r\n callbackData.rotation = rotation;\r\n callbackData.data = glyph.data;\r\n\r\n var output = displayCallback(callbackData);\r\n\r\n x = output.x;\r\n y = output.y;\r\n scale = output.scale;\r\n rotation = output.rotation;\r\n }\r\n\r\n x *= scale;\r\n y *= scale;\r\n\r\n x += lineOffsetX;\r\n\r\n xAdvance += glyph.xAdvance + letterSpacing;\r\n lastGlyph = glyph;\r\n lastCharCode = charCode;\r\n\r\n // Nothing to render or a space? Then skip to the next glyph\r\n if (glyphW === 0 || glyphH === 0 || charCode === 32)\r\n {\r\n continue;\r\n }\r\n\r\n if (roundPixels)\r\n {\r\n x = Math.round(x);\r\n y = Math.round(y);\r\n }\r\n\r\n ctx.save();\r\n\r\n ctx.translate(x, y);\r\n\r\n ctx.rotate(rotation);\r\n\r\n ctx.scale(scale, scale);\r\n\r\n ctx.drawImage(image, glyphX, glyphY, glyphW, glyphH, 0, 0, glyphW, glyphH);\r\n\r\n ctx.restore();\r\n }\r\n\r\n ctx.restore();\r\n};\r\n\r\nmodule.exports = DynamicBitmapTextCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextCreator.js": /*!********************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextCreator.js ***! \********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BitmapText = __webpack_require__(/*! ./DynamicBitmapText */ \"./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js\");\r\nvar BuildGameObject = __webpack_require__(/*! ../../BuildGameObject */ \"./node_modules/phaser/src/gameobjects/BuildGameObject.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\n\r\n/**\r\n * Creates a new Dynamic Bitmap Text Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Dynamic Bitmap Text Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#dynamicBitmapText\r\n * @since 3.0.0\r\n *²\r\n * @param {Phaser.Types.GameObjects.BitmapText.BitmapTextConfig} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {Phaser.GameObjects.DynamicBitmapText} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('dynamicBitmapText', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n var font = GetAdvancedValue(config, 'font', '');\r\n var text = GetAdvancedValue(config, 'text', '');\r\n var size = GetAdvancedValue(config, 'size', false);\r\n\r\n var bitmapText = new BitmapText(this.scene, 0, 0, font, text, size);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, bitmapText, config);\r\n\r\n return bitmapText;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectCreator context.\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextFactory.js": /*!********************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextFactory.js ***! \********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar DynamicBitmapText = __webpack_require__(/*! ./DynamicBitmapText */ \"./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Dynamic Bitmap Text Game Object and adds it to the Scene.\r\n * \r\n * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure.\r\n * \r\n * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to\r\n * match the font structure.\r\n * \r\n * Dynamic Bitmap Text objects are different from Static Bitmap Text in that they invoke a callback for each\r\n * letter being rendered during the render pass. This callback allows you to manipulate the properties of\r\n * each letter being rendered, such as its position, scale or tint, allowing you to create interesting effects\r\n * like jiggling text, which can't be done with Static text. This means that Dynamic Text takes more processing\r\n * time, so only use them if you require the callback ability they have.\r\n *\r\n * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability\r\n * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by\r\n * processing the font texture in an image editor, applying fills and any other effects required.\r\n *\r\n * To create multi-line text insert \\r, \\n or \\r\\n escape codes into the text string.\r\n *\r\n * To create a BitmapText data files you need a 3rd party app such as:\r\n *\r\n * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/\r\n * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner\r\n * Littera (Web-based, free): http://kvazars.com/littera/\r\n *\r\n * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of\r\n * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson\r\n *\r\n * Note: This method will only be available if the Dynamic Bitmap Text Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#dynamicBitmapText\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x position of the Game Object.\r\n * @param {number} y - The y position of the Game Object.\r\n * @param {string} font - The key of the font to use from the BitmapFont cache.\r\n * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text.\r\n * @param {number} [size] - The font size to set.\r\n *\r\n * @return {Phaser.GameObjects.DynamicBitmapText} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size)\r\n{\r\n return this.displayList.add(new DynamicBitmapText(this.scene, x, y, font, text, size));\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextRender.js": /*!*******************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextRender.js ***! \*******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./DynamicBitmapTextWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./DynamicBitmapTextCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextWebGLRenderer.js": /*!**************************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextWebGLRenderer.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Utils = __webpack_require__(/*! ../../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.DynamicBitmapText#renderWebGL\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.DynamicBitmapText} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var text = src.text;\r\n var textLength = text.length;\r\n\r\n if (textLength === 0)\r\n {\r\n return;\r\n }\r\n\r\n var pipeline = this.pipeline;\r\n\r\n renderer.setPipeline(pipeline, src);\r\n\r\n var crop = (src.cropWidth > 0 || src.cropHeight > 0);\r\n\r\n if (crop)\r\n {\r\n pipeline.flush();\r\n\r\n renderer.pushScissor(\r\n src.x,\r\n src.y,\r\n src.cropWidth * src.scaleX,\r\n src.cropHeight * src.scaleY\r\n );\r\n }\r\n\r\n var camMatrix = pipeline._tempMatrix1;\r\n var spriteMatrix = pipeline._tempMatrix2;\r\n var calcMatrix = pipeline._tempMatrix3;\r\n var fontMatrix = pipeline._tempMatrix4;\r\n\r\n spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n spriteMatrix.e = src.x;\r\n spriteMatrix.f = src.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n spriteMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n spriteMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n\r\n var frame = src.frame;\r\n var texture = frame.glTexture;\r\n var textureX = frame.cutX;\r\n var textureY = frame.cutY;\r\n var textureWidth = texture.width;\r\n var textureHeight = texture.height;\r\n\r\n var tintEffect = (src._isTinted && src.tintFill);\r\n var tintTL = Utils.getTintAppendFloatAlpha(src._tintTL, camera.alpha * src._alphaTL);\r\n var tintTR = Utils.getTintAppendFloatAlpha(src._tintTR, camera.alpha * src._alphaTR);\r\n var tintBL = Utils.getTintAppendFloatAlpha(src._tintBL, camera.alpha * src._alphaBL);\r\n var tintBR = Utils.getTintAppendFloatAlpha(src._tintBR, camera.alpha * src._alphaBR);\r\n\r\n pipeline.setTexture2D(texture, 0);\r\n\r\n var xAdvance = 0;\r\n var yAdvance = 0;\r\n var charCode = 0;\r\n var lastCharCode = 0;\r\n var letterSpacing = src.letterSpacing;\r\n var glyph;\r\n var glyphX = 0;\r\n var glyphY = 0;\r\n var glyphW = 0;\r\n var glyphH = 0;\r\n var lastGlyph;\r\n var scrollX = src.scrollX;\r\n var scrollY = src.scrollY;\r\n\r\n var fontData = src.fontData;\r\n var chars = fontData.chars;\r\n var lineHeight = fontData.lineHeight;\r\n var scale = (src.fontSize / fontData.size);\r\n var rotation = 0;\r\n\r\n var align = src._align;\r\n var currentLine = 0;\r\n var lineOffsetX = 0;\r\n\r\n // Update the bounds - skipped internally if not dirty\r\n src.getTextBounds(false);\r\n\r\n var lineData = src._bounds.lines;\r\n\r\n if (align === 1)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[0]) / 2;\r\n }\r\n else if (align === 2)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[0]);\r\n }\r\n\r\n var roundPixels = camera.roundPixels;\r\n var displayCallback = src.displayCallback;\r\n var callbackData = src.callbackData;\r\n\r\n for (var i = 0; i < textLength; i++)\r\n {\r\n charCode = text.charCodeAt(i);\r\n\r\n // Carriage-return\r\n if (charCode === 10)\r\n {\r\n currentLine++;\r\n\r\n if (align === 1)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[currentLine]) / 2;\r\n }\r\n else if (align === 2)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[currentLine]);\r\n }\r\n\r\n xAdvance = 0;\r\n yAdvance += lineHeight;\r\n lastGlyph = null;\r\n\r\n continue;\r\n }\r\n\r\n glyph = chars[charCode];\r\n\r\n if (!glyph)\r\n {\r\n continue;\r\n }\r\n\r\n glyphX = textureX + glyph.x;\r\n glyphY = textureY + glyph.y;\r\n\r\n glyphW = glyph.width;\r\n glyphH = glyph.height;\r\n\r\n var x = (glyph.xOffset + xAdvance) - scrollX;\r\n var y = (glyph.yOffset + yAdvance) - scrollY;\r\n\r\n if (lastGlyph !== null)\r\n {\r\n var kerningOffset = glyph.kerning[lastCharCode];\r\n x += (kerningOffset !== undefined) ? kerningOffset : 0;\r\n }\r\n\r\n xAdvance += glyph.xAdvance + letterSpacing;\r\n lastGlyph = glyph;\r\n lastCharCode = charCode;\r\n\r\n // Nothing to render or a space? Then skip to the next glyph\r\n if (glyphW === 0 || glyphH === 0 || charCode === 32)\r\n {\r\n continue;\r\n }\r\n\r\n scale = (src.fontSize / src.fontData.size);\r\n rotation = 0;\r\n\r\n if (displayCallback)\r\n {\r\n callbackData.color = 0;\r\n callbackData.tint.topLeft = tintTL;\r\n callbackData.tint.topRight = tintTR;\r\n callbackData.tint.bottomLeft = tintBL;\r\n callbackData.tint.bottomRight = tintBR;\r\n callbackData.index = i;\r\n callbackData.charCode = charCode;\r\n callbackData.x = x;\r\n callbackData.y = y;\r\n callbackData.scale = scale;\r\n callbackData.rotation = rotation;\r\n callbackData.data = glyph.data;\r\n\r\n var output = displayCallback(callbackData);\r\n\r\n x = output.x;\r\n y = output.y;\r\n scale = output.scale;\r\n rotation = output.rotation;\r\n\r\n if (output.color)\r\n {\r\n tintTL = output.color;\r\n tintTR = output.color;\r\n tintBL = output.color;\r\n tintBR = output.color;\r\n }\r\n else\r\n {\r\n tintTL = output.tint.topLeft;\r\n tintTR = output.tint.topRight;\r\n tintBL = output.tint.bottomLeft;\r\n tintBR = output.tint.bottomRight;\r\n }\r\n\r\n tintTL = Utils.getTintAppendFloatAlpha(tintTL, camera.alpha * src._alphaTL);\r\n tintTR = Utils.getTintAppendFloatAlpha(tintTR, camera.alpha * src._alphaTR);\r\n tintBL = Utils.getTintAppendFloatAlpha(tintBL, camera.alpha * src._alphaBL);\r\n tintBR = Utils.getTintAppendFloatAlpha(tintBR, camera.alpha * src._alphaBR);\r\n }\r\n\r\n x *= scale;\r\n y *= scale;\r\n\r\n x -= src.displayOriginX;\r\n y -= src.displayOriginY;\r\n\r\n x += lineOffsetX;\r\n\r\n fontMatrix.applyITRS(x, y, rotation, scale, scale);\r\n\r\n calcMatrix.multiply(fontMatrix, spriteMatrix);\r\n\r\n var u0 = glyphX / textureWidth;\r\n var v0 = glyphY / textureHeight;\r\n var u1 = (glyphX + glyphW) / textureWidth;\r\n var v1 = (glyphY + glyphH) / textureHeight;\r\n\r\n var xw = glyphW;\r\n var yh = glyphH;\r\n\r\n var tx0 = spriteMatrix.e;\r\n var ty0 = spriteMatrix.f;\r\n\r\n var tx1 = yh * spriteMatrix.c + spriteMatrix.e;\r\n var ty1 = yh * spriteMatrix.d + spriteMatrix.f;\r\n\r\n var tx2 = xw * spriteMatrix.a + yh * spriteMatrix.c + spriteMatrix.e;\r\n var ty2 = xw * spriteMatrix.b + yh * spriteMatrix.d + spriteMatrix.f;\r\n\r\n var tx3 = xw * spriteMatrix.a + spriteMatrix.e;\r\n var ty3 = xw * spriteMatrix.b + spriteMatrix.f;\r\n\r\n if (roundPixels)\r\n {\r\n tx0 = Math.round(tx0);\r\n ty0 = Math.round(ty0);\r\n\r\n tx1 = Math.round(tx1);\r\n ty1 = Math.round(ty1);\r\n\r\n tx2 = Math.round(tx2);\r\n ty2 = Math.round(ty2);\r\n\r\n tx3 = Math.round(tx3);\r\n ty3 = Math.round(ty3);\r\n }\r\n\r\n pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, 0);\r\n }\r\n\r\n if (crop)\r\n {\r\n pipeline.flush();\r\n\r\n renderer.popScissor();\r\n }\r\n};\r\n\r\nmodule.exports = DynamicBitmapTextWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapText.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapText.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar GetBitmapTextSize = __webpack_require__(/*! ../GetBitmapTextSize */ \"./node_modules/phaser/src/gameobjects/bitmaptext/GetBitmapTextSize.js\");\r\nvar ParseFromAtlas = __webpack_require__(/*! ../ParseFromAtlas */ \"./node_modules/phaser/src/gameobjects/bitmaptext/ParseFromAtlas.js\");\r\nvar ParseXMLBitmapFont = __webpack_require__(/*! ../ParseXMLBitmapFont */ \"./node_modules/phaser/src/gameobjects/bitmaptext/ParseXMLBitmapFont.js\");\r\nvar Render = __webpack_require__(/*! ./BitmapTextRender */ \"./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextRender.js\");\r\n\r\n/**\r\n * @classdesc\r\n * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure.\r\n *\r\n * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to\r\n * match the font structure.\r\n *\r\n * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability\r\n * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by\r\n * processing the font texture in an image editor, applying fills and any other effects required.\r\n *\r\n * To create multi-line text insert \\r, \\n or \\r\\n escape codes into the text string.\r\n *\r\n * To create a BitmapText data files you need a 3rd party app such as:\r\n *\r\n * BMFont (Windows, free): {@link http://www.angelcode.com/products/bmfont/|http://www.angelcode.com/products/bmfont/}\r\n * Glyph Designer (OS X, commercial): {@link http://www.71squared.com/en/glyphdesigner|http://www.71squared.com/en/glyphdesigner}\r\n * Littera (Web-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/}\r\n *\r\n * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of\r\n * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: {@link http://codebeautify.org/xmltojson|http://codebeautify.org/xmltojson}\r\n *\r\n * @class BitmapText\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Texture\r\n * @extends Phaser.GameObjects.Components.Tint\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. It can only belong to one Scene at any given time.\r\n * @param {number} x - The x coordinate of this Game Object in world space.\r\n * @param {number} y - The y coordinate of this Game Object in world space.\r\n * @param {string} font - The key of the font to use from the Bitmap Font cache.\r\n * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text.\r\n * @param {number} [size] - The font size of this Bitmap Text.\r\n * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object.\r\n */\r\nvar BitmapText = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.Alpha,\r\n Components.BlendMode,\r\n Components.Depth,\r\n Components.Mask,\r\n Components.Origin,\r\n Components.Pipeline,\r\n Components.ScrollFactor,\r\n Components.Texture,\r\n Components.Tint,\r\n Components.Transform,\r\n Components.Visible,\r\n Render\r\n ],\r\n\r\n initialize:\r\n\r\n function BitmapText (scene, x, y, font, text, size, align)\r\n {\r\n if (text === undefined) { text = ''; }\r\n if (align === undefined) { align = 0; }\r\n\r\n GameObject.call(this, scene, 'BitmapText');\r\n\r\n /**\r\n * The key of the Bitmap Font used by this Bitmap Text.\r\n * To change the font after creation please use `setFont`.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#font\r\n * @type {string}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.font = font;\r\n\r\n var entry = this.scene.sys.cache.bitmapFont.get(font);\r\n\r\n /**\r\n * The data of the Bitmap Font used by this Bitmap Text.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#fontData\r\n * @type {Phaser.Types.GameObjects.BitmapText.BitmapFontData}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.fontData = entry.data;\r\n\r\n /**\r\n * The text that this Bitmap Text object displays.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#_text\r\n * @type {string}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._text = '';\r\n\r\n /**\r\n * The font size of this Bitmap Text.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#_fontSize\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._fontSize = size || this.fontData.size;\r\n\r\n /**\r\n * Adds / Removes spacing between characters.\r\n *\r\n * Can be a negative or positive number.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#_letterSpacing\r\n * @type {number}\r\n * @private\r\n * @since 3.4.0\r\n */\r\n this._letterSpacing = 0;\r\n\r\n /**\r\n * Controls the alignment of each line of text in this BitmapText object.\r\n * Only has any effect when this BitmapText contains multiple lines of text, split with carriage-returns.\r\n * Has no effect with single-lines of text.\r\n *\r\n * See the methods `setLeftAlign`, `setCenterAlign` and `setRightAlign`.\r\n *\r\n * 0 = Left aligned (default)\r\n * 1 = Middle aligned\r\n * 2 = Right aligned\r\n *\r\n * The alignment position is based on the longest line of text.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#_align\r\n * @type {integer}\r\n * @private\r\n * @since 3.11.0\r\n */\r\n this._align = align;\r\n\r\n /**\r\n * An object that describes the size of this Bitmap Text.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#_bounds\r\n * @type {Phaser.Types.GameObjects.BitmapText.BitmapTextSize}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._bounds = GetBitmapTextSize();\r\n\r\n /**\r\n * An internal dirty flag for bounds calculation.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#_dirty\r\n * @type {boolean}\r\n * @private\r\n * @since 3.11.0\r\n */\r\n this._dirty = true;\r\n\r\n /**\r\n * Internal cache var holding the maxWidth.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#_maxWidth\r\n * @type {number}\r\n * @private\r\n * @since 3.21.0\r\n */\r\n this._maxWidth = 0;\r\n\r\n /**\r\n * The character code used to detect for word wrapping.\r\n * Defaults to 32 (a space character).\r\n *\r\n * @name Phaser.GameObjects.BitmapText#wordWrapCharCode\r\n * @type {number}\r\n * @since 3.21.0\r\n */\r\n this.wordWrapCharCode = 32;\r\n\r\n this.setTexture(entry.texture, entry.frame);\r\n this.setPosition(x, y);\r\n this.setOrigin(0, 0);\r\n this.initPipeline();\r\n\r\n this.setText(text);\r\n },\r\n\r\n /**\r\n * Set the lines of text in this BitmapText to be left-aligned.\r\n * This only has any effect if this BitmapText contains more than one line of text.\r\n *\r\n * @method Phaser.GameObjects.BitmapText#setLeftAlign\r\n * @since 3.11.0\r\n *\r\n * @return {this} This BitmapText Object.\r\n */\r\n setLeftAlign: function ()\r\n {\r\n this._align = BitmapText.ALIGN_LEFT;\r\n\r\n this._dirty = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the lines of text in this BitmapText to be center-aligned.\r\n * This only has any effect if this BitmapText contains more than one line of text.\r\n *\r\n * @method Phaser.GameObjects.BitmapText#setCenterAlign\r\n * @since 3.11.0\r\n *\r\n * @return {this} This BitmapText Object.\r\n */\r\n setCenterAlign: function ()\r\n {\r\n this._align = BitmapText.ALIGN_CENTER;\r\n\r\n this._dirty = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the lines of text in this BitmapText to be right-aligned.\r\n * This only has any effect if this BitmapText contains more than one line of text.\r\n *\r\n * @method Phaser.GameObjects.BitmapText#setRightAlign\r\n * @since 3.11.0\r\n *\r\n * @return {this} This BitmapText Object.\r\n */\r\n setRightAlign: function ()\r\n {\r\n this._align = BitmapText.ALIGN_RIGHT;\r\n\r\n this._dirty = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the font size of this Bitmap Text.\r\n *\r\n * @method Phaser.GameObjects.BitmapText#setFontSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} size - The font size to set.\r\n *\r\n * @return {this} This BitmapText Object.\r\n */\r\n setFontSize: function (size)\r\n {\r\n this._fontSize = size;\r\n\r\n this._dirty = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the letter spacing between each character of this Bitmap Text.\r\n * Can be a positive value to increase the space, or negative to reduce it.\r\n * Spacing is applied after the kerning values have been set.\r\n *\r\n * @method Phaser.GameObjects.BitmapText#setLetterSpacing\r\n * @since 3.4.0\r\n *\r\n * @param {number} [spacing=0] - The amount of horizontal space to add between each character.\r\n *\r\n * @return {this} This BitmapText Object.\r\n */\r\n setLetterSpacing: function (spacing)\r\n {\r\n if (spacing === undefined) { spacing = 0; }\r\n\r\n this._letterSpacing = spacing;\r\n\r\n this._dirty = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the textual content of this BitmapText.\r\n *\r\n * An array of strings will be converted into multi-line text. Use the align methods to change multi-line alignment.\r\n *\r\n * @method Phaser.GameObjects.BitmapText#setText\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} value - The string, or array of strings, to be set as the content of this BitmapText.\r\n *\r\n * @return {this} This BitmapText Object.\r\n */\r\n setText: function (value)\r\n {\r\n if (!value && value !== 0)\r\n {\r\n value = '';\r\n }\r\n\r\n if (Array.isArray(value))\r\n {\r\n value = value.join('\\n');\r\n }\r\n\r\n if (value !== this.text)\r\n {\r\n this._text = value.toString();\r\n\r\n this._dirty = true;\r\n\r\n this.updateDisplayOrigin();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the bounds of this Bitmap Text.\r\n *\r\n * An object is returned that contains the position, width and height of the Bitmap Text in local and global\r\n * contexts.\r\n *\r\n * Local size is based on just the font size and a [0, 0] position.\r\n *\r\n * Global size takes into account the Game Object's scale, world position and display origin.\r\n *\r\n * Also in the object is data regarding the length of each line, should this be a multi-line BitmapText.\r\n *\r\n * @method Phaser.GameObjects.BitmapText#getTextBounds\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [round] - Whether to round the results to the nearest integer.\r\n *\r\n * @return {Phaser.Types.GameObjects.BitmapText.BitmapTextSize} An object that describes the size of this Bitmap Text.\r\n */\r\n getTextBounds: function (round)\r\n {\r\n // local = The BitmapText based on fontSize and 0x0 coords\r\n // global = The BitmapText, taking into account scale and world position\r\n // lines = The BitmapText line data\r\n\r\n var bounds = this._bounds;\r\n\r\n if (this._dirty || this.scaleX !== bounds.scaleX || this.scaleY !== bounds.scaleY)\r\n {\r\n GetBitmapTextSize(this, round, bounds);\r\n\r\n this._dirty = false;\r\n\r\n this.updateDisplayOrigin();\r\n }\r\n\r\n return bounds;\r\n },\r\n\r\n /**\r\n * Changes the font this BitmapText is using to render.\r\n *\r\n * The new texture is loaded and applied to the BitmapText. The existing test, size and alignment are preserved,\r\n * unless overridden via the arguments.\r\n *\r\n * @method Phaser.GameObjects.BitmapText#setFont\r\n * @since 3.11.0\r\n *\r\n * @param {string} font - The key of the font to use from the Bitmap Font cache.\r\n * @param {number} [size] - The font size of this Bitmap Text. If not specified the current size will be used.\r\n * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. If not specified the current alignment will be used.\r\n *\r\n * @return {this} This BitmapText Object.\r\n */\r\n setFont: function (key, size, align)\r\n {\r\n if (size === undefined) { size = this._fontSize; }\r\n if (align === undefined) { align = this._align; }\r\n\r\n if (key !== this.font)\r\n {\r\n var entry = this.scene.sys.cache.bitmapFont.get(key);\r\n\r\n if (entry)\r\n {\r\n this.font = key;\r\n this.fontData = entry.data;\r\n this._fontSize = size;\r\n this._align = align;\r\n\r\n this.setTexture(entry.texture, entry.frame);\r\n\r\n GetBitmapTextSize(this, false, this._bounds);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the maximum display width of this BitmapText in pixels.\r\n *\r\n * If `BitmapText.text` is longer than `maxWidth` then the lines will be automatically wrapped\r\n * based on the previous whitespace character found in the line.\r\n *\r\n * If no whitespace was found then no wrapping will take place and consequently the `maxWidth` value will not be honored.\r\n *\r\n * Disable maxWidth by setting the value to 0.\r\n *\r\n * You can set the whitespace character to be searched for by setting the `wordWrapCharCode` parameter or property.\r\n *\r\n * @method Phaser.GameObjects.BitmapText#setMaxWidth\r\n * @since 3.21.0\r\n *\r\n * @param {number} value - The maximum display width of this BitmapText in pixels. Set to zero to disable.\r\n * @param {number} [wordWrapCharCode] - The character code to check for when word wrapping. Defaults to 32 (the space character).\r\n *\r\n * @return {this} This BitmapText Object.\r\n */\r\n setMaxWidth: function (value, wordWrapCharCode)\r\n {\r\n this._maxWidth = value;\r\n\r\n this._dirty = true;\r\n\r\n if (wordWrapCharCode !== undefined)\r\n {\r\n this.wordWrapCharCode = wordWrapCharCode;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Controls the alignment of each line of text in this BitmapText object.\r\n *\r\n * Only has any effect when this BitmapText contains multiple lines of text, split with carriage-returns.\r\n * Has no effect with single-lines of text.\r\n *\r\n * See the methods `setLeftAlign`, `setCenterAlign` and `setRightAlign`.\r\n *\r\n * 0 = Left aligned (default)\r\n * 1 = Middle aligned\r\n * 2 = Right aligned\r\n *\r\n * The alignment position is based on the longest line of text.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#align\r\n * @type {integer}\r\n * @since 3.11.0\r\n */\r\n align: {\r\n\r\n set: function (value)\r\n {\r\n this._align = value;\r\n this._dirty = true;\r\n },\r\n\r\n get: function ()\r\n {\r\n return this._align;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The text that this Bitmap Text object displays.\r\n *\r\n * You can also use the method `setText` if you want a chainable way to change the text content.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#text\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n text: {\r\n\r\n set: function (value)\r\n {\r\n this.setText(value);\r\n },\r\n\r\n get: function ()\r\n {\r\n return this._text;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The font size of this Bitmap Text.\r\n *\r\n * You can also use the method `setFontSize` if you want a chainable way to change the font size.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#fontSize\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n fontSize: {\r\n\r\n set: function (value)\r\n {\r\n this._fontSize = value;\r\n this._dirty = true;\r\n },\r\n\r\n get: function ()\r\n {\r\n return this._fontSize;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Adds / Removes spacing between characters.\r\n *\r\n * Can be a negative or positive number.\r\n *\r\n * You can also use the method `setLetterSpacing` if you want a chainable way to change the letter spacing.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#letterSpacing\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n letterSpacing: {\r\n\r\n set: function (value)\r\n {\r\n this._letterSpacing = value;\r\n this._dirty = true;\r\n },\r\n\r\n get: function ()\r\n {\r\n return this._letterSpacing;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The maximum display width of this BitmapText in pixels.\r\n *\r\n * If BitmapText.text is longer than maxWidth then the lines will be automatically wrapped\r\n * based on the last whitespace character found in the line.\r\n *\r\n * If no whitespace was found then no wrapping will take place and consequently the maxWidth value will not be honored.\r\n *\r\n * Disable maxWidth by setting the value to 0.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#maxWidth\r\n * @type {number}\r\n * @since 3.21.0\r\n */\r\n maxWidth: {\r\n\r\n set: function (value)\r\n {\r\n this._maxWidth = value;\r\n this._dirty = true;\r\n },\r\n\r\n get: function ()\r\n {\r\n return this._maxWidth;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The width of this Bitmap Text.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#width\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n width: {\r\n\r\n get: function ()\r\n {\r\n this.getTextBounds(false);\r\n\r\n return this._bounds.global.width;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The height of this bitmap text.\r\n *\r\n * @name Phaser.GameObjects.BitmapText#height\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n height: {\r\n\r\n get: function ()\r\n {\r\n this.getTextBounds(false);\r\n\r\n return this._bounds.global.height;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Build a JSON representation of this Bitmap Text.\r\n *\r\n * @method Phaser.GameObjects.BitmapText#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.GameObjects.BitmapText.JSONBitmapText} A JSON representation of this Bitmap Text.\r\n */\r\n toJSON: function ()\r\n {\r\n var out = Components.ToJSON(this);\r\n\r\n // Extra data is added here\r\n\r\n var data = {\r\n font: this.font,\r\n text: this.text,\r\n fontSize: this.fontSize,\r\n letterSpacing: this.letterSpacing,\r\n align: this.align\r\n };\r\n\r\n out.data = data;\r\n\r\n return out;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Left align the text characters in a multi-line BitmapText object.\r\n *\r\n * @name Phaser.GameObjects.BitmapText.ALIGN_LEFT\r\n * @type {integer}\r\n * @since 3.11.0\r\n */\r\nBitmapText.ALIGN_LEFT = 0;\r\n\r\n/**\r\n * Center align the text characters in a multi-line BitmapText object.\r\n *\r\n * @name Phaser.GameObjects.BitmapText.ALIGN_CENTER\r\n * @type {integer}\r\n * @since 3.11.0\r\n */\r\nBitmapText.ALIGN_CENTER = 1;\r\n\r\n/**\r\n * Right align the text characters in a multi-line BitmapText object.\r\n *\r\n * @name Phaser.GameObjects.BitmapText.ALIGN_RIGHT\r\n * @type {integer}\r\n * @since 3.11.0\r\n */\r\nBitmapText.ALIGN_RIGHT = 2;\r\n\r\n/**\r\n * Parse an XML Bitmap Font from an Atlas.\r\n *\r\n * Adds the parsed Bitmap Font data to the cache with the `fontName` key.\r\n *\r\n * @method Phaser.GameObjects.BitmapText.ParseFromAtlas\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to parse the Bitmap Font for.\r\n * @param {string} fontName - The key of the font to add to the Bitmap Font cache.\r\n * @param {string} textureKey - The key of the BitmapFont's texture.\r\n * @param {string} frameKey - The key of the BitmapFont texture's frame.\r\n * @param {string} xmlKey - The key of the XML data of the font to parse.\r\n * @param {integer} [xSpacing] - The x-axis spacing to add between each letter.\r\n * @param {integer} [ySpacing] - The y-axis spacing to add to the line height.\r\n *\r\n * @return {boolean} Whether the parsing was successful or not.\r\n */\r\nBitmapText.ParseFromAtlas = ParseFromAtlas;\r\n\r\n/**\r\n * Parse an XML font to Bitmap Font data for the Bitmap Font cache.\r\n *\r\n * @method Phaser.GameObjects.BitmapText.ParseXMLBitmapFont\r\n * @since 3.17.0\r\n *\r\n * @param {XMLDocument} xml - The XML Document to parse the font from.\r\n * @param {integer} [xSpacing=0] - The x-axis spacing to add between each letter.\r\n * @param {integer} [ySpacing=0] - The y-axis spacing to add to the line height.\r\n * @param {Phaser.Textures.Frame} [frame] - The texture frame to take into account while parsing.\r\n *\r\n * @return {Phaser.Types.GameObjects.BitmapText.BitmapFontData} The parsed Bitmap Font data.\r\n */\r\nBitmapText.ParseXMLBitmapFont = ParseXMLBitmapFont;\r\n\r\nmodule.exports = BitmapText;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapText.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextCanvasRenderer.js": /*!*******************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextCanvasRenderer.js ***! \*******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SetTransform = __webpack_require__(/*! ../../../renderer/canvas/utils/SetTransform */ \"./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js\");\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.BitmapText#renderCanvas\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.BitmapText} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar BitmapTextCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var text = src._text;\r\n var textLength = text.length;\r\n\r\n var ctx = renderer.currentContext;\r\n\r\n if (textLength === 0 || !SetTransform(renderer, ctx, src, camera, parentMatrix))\r\n {\r\n return;\r\n }\r\n \r\n var textureFrame = src.frame;\r\n\r\n var chars = src.fontData.chars;\r\n var lineHeight = src.fontData.lineHeight;\r\n var letterSpacing = src._letterSpacing;\r\n\r\n var xAdvance = 0;\r\n var yAdvance = 0;\r\n\r\n var charCode = 0;\r\n\r\n var glyph = null;\r\n var glyphX = 0;\r\n var glyphY = 0;\r\n var glyphW = 0;\r\n var glyphH = 0;\r\n\r\n var x = 0;\r\n var y = 0;\r\n\r\n var lastGlyph = null;\r\n var lastCharCode = 0;\r\n\r\n var image = src.frame.source.image;\r\n\r\n var textureX = textureFrame.cutX;\r\n var textureY = textureFrame.cutY;\r\n\r\n var scale = (src._fontSize / src.fontData.size);\r\n\r\n var align = src._align;\r\n var currentLine = 0;\r\n var lineOffsetX = 0;\r\n\r\n // Update the bounds - skipped internally if not dirty\r\n var bounds = src.getTextBounds(false);\r\n\r\n // In case the method above changed it (word wrapping)\r\n if (src.maxWidth > 0)\r\n {\r\n text = bounds.wrappedText;\r\n textLength = text.length;\r\n }\r\n\r\n var lineData = src._bounds.lines;\r\n\r\n if (align === 1)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[0]) / 2;\r\n }\r\n else if (align === 2)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[0]);\r\n }\r\n\r\n ctx.translate(-src.displayOriginX, -src.displayOriginY);\r\n\r\n var roundPixels = camera.roundPixels;\r\n\r\n for (var i = 0; i < textLength; i++)\r\n {\r\n charCode = text.charCodeAt(i);\r\n\r\n if (charCode === 10)\r\n {\r\n currentLine++;\r\n\r\n if (align === 1)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[currentLine]) / 2;\r\n }\r\n else if (align === 2)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[currentLine]);\r\n }\r\n\r\n xAdvance = 0;\r\n yAdvance += lineHeight;\r\n lastGlyph = null;\r\n\r\n continue;\r\n }\r\n\r\n glyph = chars[charCode];\r\n\r\n if (!glyph)\r\n {\r\n continue;\r\n }\r\n\r\n glyphX = textureX + glyph.x;\r\n glyphY = textureY + glyph.y;\r\n\r\n glyphW = glyph.width;\r\n glyphH = glyph.height;\r\n\r\n x = glyph.xOffset + xAdvance;\r\n y = glyph.yOffset + yAdvance;\r\n\r\n if (lastGlyph !== null)\r\n {\r\n var kerningOffset = glyph.kerning[lastCharCode];\r\n x += (kerningOffset !== undefined) ? kerningOffset : 0;\r\n }\r\n\r\n x *= scale;\r\n y *= scale;\r\n\r\n x += lineOffsetX;\r\n\r\n xAdvance += glyph.xAdvance + letterSpacing;\r\n lastGlyph = glyph;\r\n lastCharCode = charCode;\r\n\r\n // Nothing to render or a space? Then skip to the next glyph\r\n if (glyphW === 0 || glyphH === 0 || charCode === 32)\r\n {\r\n continue;\r\n }\r\n\r\n if (roundPixels)\r\n {\r\n x = Math.round(x);\r\n y = Math.round(y);\r\n }\r\n\r\n ctx.save();\r\n\r\n ctx.translate(x, y);\r\n\r\n ctx.scale(scale, scale);\r\n\r\n ctx.drawImage(image, glyphX, glyphY, glyphW, glyphH, 0, 0, glyphW, glyphH);\r\n\r\n ctx.restore();\r\n }\r\n\r\n ctx.restore();\r\n};\r\n\r\nmodule.exports = BitmapTextCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextCreator.js": /*!************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextCreator.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BitmapText = __webpack_require__(/*! ./BitmapText */ \"./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapText.js\");\r\nvar BuildGameObject = __webpack_require__(/*! ../../BuildGameObject */ \"./node_modules/phaser/src/gameobjects/BuildGameObject.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar GetValue = __webpack_require__(/*! ../../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\n\r\n/**\r\n * Creates a new Bitmap Text Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Bitmap Text Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#bitmapText\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.BitmapText.BitmapTextConfig} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n * \r\n * @return {Phaser.GameObjects.BitmapText} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('bitmapText', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n var font = GetValue(config, 'font', '');\r\n var text = GetAdvancedValue(config, 'text', '');\r\n var size = GetAdvancedValue(config, 'size', false);\r\n var align = GetValue(config, 'align', 0);\r\n\r\n var bitmapText = new BitmapText(this.scene, 0, 0, font, text, size, align);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, bitmapText, config);\r\n\r\n return bitmapText;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectCreator context.\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextFactory.js": /*!************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextFactory.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BitmapText = __webpack_require__(/*! ./BitmapText */ \"./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapText.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Bitmap Text Game Object and adds it to the Scene.\r\n * \r\n * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure.\r\n * \r\n * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to\r\n * match the font structure.\r\n * \r\n * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability\r\n * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by\r\n * processing the font texture in an image editor, applying fills and any other effects required.\r\n *\r\n * To create multi-line text insert \\r, \\n or \\r\\n escape codes into the text string.\r\n *\r\n * To create a BitmapText data files you need a 3rd party app such as:\r\n *\r\n * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/\r\n * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner\r\n * Littera (Web-based, free): http://kvazars.com/littera/\r\n *\r\n * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of\r\n * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson\r\n *\r\n * Note: This method will only be available if the Bitmap Text Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#bitmapText\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x position of the Game Object.\r\n * @param {number} y - The y position of the Game Object.\r\n * @param {string} font - The key of the font to use from the BitmapFont cache.\r\n * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text.\r\n * @param {number} [size] - The font size to set.\r\n * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object.\r\n *\r\n * @return {Phaser.GameObjects.BitmapText} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('bitmapText', function (x, y, font, text, size, align)\r\n{\r\n return this.displayList.add(new BitmapText(this.scene, x, y, font, text, size, align));\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextRender.js": /*!***********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextRender.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./BitmapTextWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./BitmapTextCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextWebGLRenderer.js": /*!******************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextWebGLRenderer.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Utils = __webpack_require__(/*! ../../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.BitmapText#renderWebGL\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.BitmapText} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var text = src._text;\r\n var textLength = text.length;\r\n\r\n if (textLength === 0)\r\n {\r\n return;\r\n }\r\n \r\n var pipeline = this.pipeline;\r\n\r\n renderer.setPipeline(pipeline, src);\r\n\r\n var camMatrix = pipeline._tempMatrix1;\r\n var spriteMatrix = pipeline._tempMatrix2;\r\n var calcMatrix = pipeline._tempMatrix3;\r\n\r\n spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n spriteMatrix.e = src.x;\r\n spriteMatrix.f = src.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n spriteMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n spriteMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n\r\n var frame = src.frame;\r\n var texture = frame.glTexture;\r\n var textureX = frame.cutX;\r\n var textureY = frame.cutY;\r\n var textureWidth = texture.width;\r\n var textureHeight = texture.height;\r\n\r\n var tintEffect = (src._isTinted && src.tintFill);\r\n var tintTL = Utils.getTintAppendFloatAlpha(src._tintTL, camera.alpha * src._alphaTL);\r\n var tintTR = Utils.getTintAppendFloatAlpha(src._tintTR, camera.alpha * src._alphaTR);\r\n var tintBL = Utils.getTintAppendFloatAlpha(src._tintBL, camera.alpha * src._alphaBL);\r\n var tintBR = Utils.getTintAppendFloatAlpha(src._tintBR, camera.alpha * src._alphaBR);\r\n\r\n pipeline.setTexture2D(texture, 0);\r\n\r\n var xAdvance = 0;\r\n var yAdvance = 0;\r\n var charCode = 0;\r\n var lastCharCode = 0;\r\n var letterSpacing = src._letterSpacing;\r\n var glyph;\r\n var glyphX = 0;\r\n var glyphY = 0;\r\n var glyphW = 0;\r\n var glyphH = 0;\r\n var lastGlyph;\r\n\r\n var fontData = src.fontData;\r\n var chars = fontData.chars;\r\n var lineHeight = fontData.lineHeight;\r\n var scale = (src._fontSize / fontData.size);\r\n\r\n var align = src._align;\r\n var currentLine = 0;\r\n var lineOffsetX = 0;\r\n\r\n // Update the bounds - skipped internally if not dirty\r\n var bounds = src.getTextBounds(false);\r\n\r\n // In case the method above changed it (word wrapping)\r\n if (src.maxWidth > 0)\r\n {\r\n text = bounds.wrappedText;\r\n textLength = text.length;\r\n }\r\n\r\n var lineData = src._bounds.lines;\r\n\r\n if (align === 1)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[0]) / 2;\r\n }\r\n else if (align === 2)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[0]);\r\n }\r\n\r\n var roundPixels = camera.roundPixels;\r\n\r\n for (var i = 0; i < textLength; i++)\r\n {\r\n charCode = text.charCodeAt(i);\r\n\r\n // Carriage-return\r\n if (charCode === 10)\r\n {\r\n currentLine++;\r\n\r\n if (align === 1)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[currentLine]) / 2;\r\n }\r\n else if (align === 2)\r\n {\r\n lineOffsetX = (lineData.longest - lineData.lengths[currentLine]);\r\n }\r\n \r\n xAdvance = 0;\r\n yAdvance += lineHeight;\r\n lastGlyph = null;\r\n \r\n continue;\r\n }\r\n\r\n glyph = chars[charCode];\r\n\r\n if (!glyph)\r\n {\r\n continue;\r\n }\r\n\r\n glyphX = textureX + glyph.x;\r\n glyphY = textureY + glyph.y;\r\n\r\n glyphW = glyph.width;\r\n glyphH = glyph.height;\r\n\r\n var x = glyph.xOffset + xAdvance;\r\n var y = glyph.yOffset + yAdvance;\r\n\r\n if (lastGlyph !== null)\r\n {\r\n var kerningOffset = glyph.kerning[lastCharCode];\r\n x += (kerningOffset !== undefined) ? kerningOffset : 0;\r\n }\r\n\r\n xAdvance += glyph.xAdvance + letterSpacing;\r\n lastGlyph = glyph;\r\n lastCharCode = charCode;\r\n\r\n // Nothing to render or a space? Then skip to the next glyph\r\n if (glyphW === 0 || glyphH === 0 || charCode === 32)\r\n {\r\n continue;\r\n }\r\n\r\n x *= scale;\r\n y *= scale;\r\n\r\n x -= src.displayOriginX;\r\n y -= src.displayOriginY;\r\n\r\n x += lineOffsetX;\r\n\r\n var u0 = glyphX / textureWidth;\r\n var v0 = glyphY / textureHeight;\r\n var u1 = (glyphX + glyphW) / textureWidth;\r\n var v1 = (glyphY + glyphH) / textureHeight;\r\n\r\n var xw = x + (glyphW * scale);\r\n var yh = y + (glyphH * scale);\r\n\r\n var tx0 = calcMatrix.getX(x, y);\r\n var ty0 = calcMatrix.getY(x, y);\r\n\r\n var tx1 = calcMatrix.getX(x, yh);\r\n var ty1 = calcMatrix.getY(x, yh);\r\n\r\n var tx2 = calcMatrix.getX(xw, yh);\r\n var ty2 = calcMatrix.getY(xw, yh);\r\n\r\n var tx3 = calcMatrix.getX(xw, y);\r\n var ty3 = calcMatrix.getY(xw, y);\r\n\r\n if (roundPixels)\r\n {\r\n tx0 = Math.round(tx0);\r\n ty0 = Math.round(ty0);\r\n\r\n tx1 = Math.round(tx1);\r\n ty1 = Math.round(ty1);\r\n\r\n tx2 = Math.round(tx2);\r\n ty2 = Math.round(ty2);\r\n\r\n tx3 = Math.round(tx3);\r\n ty3 = Math.round(ty3);\r\n }\r\n\r\n pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, 0);\r\n }\r\n};\r\n\r\nmodule.exports = BitmapTextWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/blitter/Blitter.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/blitter/Blitter.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BlitterRender = __webpack_require__(/*! ./BlitterRender */ \"./node_modules/phaser/src/gameobjects/blitter/BlitterRender.js\");\r\nvar Bob = __webpack_require__(/*! ./Bob */ \"./node_modules/phaser/src/gameobjects/blitter/Bob.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar Frame = __webpack_require__(/*! ../../textures/Frame */ \"./node_modules/phaser/src/textures/Frame.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar List = __webpack_require__(/*! ../../structs/List */ \"./node_modules/phaser/src/structs/List.js\");\r\n\r\n/**\r\n * @callback CreateCallback\r\n *\r\n * @param {Phaser.GameObjects.Bob} bob - The Bob that was created by the Blitter.\r\n * @param {integer} index - The position of the Bob within the Blitter display list.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * A Blitter Game Object.\r\n *\r\n * The Blitter Game Object is a special kind of container that creates, updates and manages Bob objects.\r\n * Bobs are designed for rendering speed rather than flexibility. They consist of a texture, or frame from a texture,\r\n * a position and an alpha value. You cannot scale or rotate them. They use a batched drawing method for speed\r\n * during rendering.\r\n *\r\n * A Blitter Game Object has one texture bound to it. Bobs created by the Blitter can use any Frame from this\r\n * Texture to render with, but they cannot use any other Texture. It is this single texture-bind that allows\r\n * them their speed.\r\n *\r\n * If you have a need to blast a large volume of frames around the screen then Blitter objects are well worth\r\n * investigating. They are especially useful for using as a base for your own special effects systems.\r\n *\r\n * @class Blitter\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Size\r\n * @extends Phaser.GameObjects.Components.Texture\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. It can only belong to one Scene at any given time.\r\n * @param {number} [x=0] - The x coordinate of this Game Object in world space.\r\n * @param {number} [y=0] - The y coordinate of this Game Object in world space.\r\n * @param {string} [texture='__DEFAULT'] - The key of the texture this Game Object will use for rendering. The Texture must already exist in the Texture Manager.\r\n * @param {(string|integer)} [frame=0] - The Frame of the Texture that this Game Object will use. Only set if the Texture has multiple frames, such as a Texture Atlas or Sprite Sheet.\r\n */\r\nvar Blitter = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.Alpha,\r\n Components.BlendMode,\r\n Components.Depth,\r\n Components.Mask,\r\n Components.Pipeline,\r\n Components.ScrollFactor,\r\n Components.Size,\r\n Components.Texture,\r\n Components.Transform,\r\n Components.Visible,\r\n BlitterRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Blitter (scene, x, y, texture, frame)\r\n {\r\n GameObject.call(this, scene, 'Blitter');\r\n\r\n this.setTexture(texture, frame);\r\n this.setPosition(x, y);\r\n this.initPipeline();\r\n\r\n /**\r\n * The children of this Blitter.\r\n * This List contains all of the Bob objects created by the Blitter.\r\n *\r\n * @name Phaser.GameObjects.Blitter#children\r\n * @type {Phaser.Structs.List.}\r\n * @since 3.0.0\r\n */\r\n this.children = new List();\r\n\r\n /**\r\n * A transient array that holds all of the Bobs that will be rendered this frame.\r\n * The array is re-populated whenever the dirty flag is set.\r\n *\r\n * @name Phaser.GameObjects.Blitter#renderList\r\n * @type {Phaser.GameObjects.Bob[]}\r\n * @default []\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.renderList = [];\r\n\r\n /**\r\n * Is the Blitter considered dirty?\r\n * A 'dirty' Blitter has had its child count changed since the last frame.\r\n *\r\n * @name Phaser.GameObjects.Blitter#dirty\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.dirty = false;\r\n },\r\n\r\n /**\r\n * Creates a new Bob in this Blitter.\r\n *\r\n * The Bob is created at the given coordinates, relative to the Blitter and uses the given frame.\r\n * A Bob can use any frame belonging to the texture bound to the Blitter.\r\n *\r\n * @method Phaser.GameObjects.Blitter#create\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x position of the Bob. Bob coordinate are relative to the position of the Blitter object.\r\n * @param {number} y - The y position of the Bob. Bob coordinate are relative to the position of the Blitter object.\r\n * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using.\r\n * @param {boolean} [visible=true] - Should the created Bob render or not?\r\n * @param {integer} [index] - The position in the Blitters Display List to add the new Bob at. Defaults to the top of the list.\r\n *\r\n * @return {Phaser.GameObjects.Bob} The newly created Bob object.\r\n */\r\n create: function (x, y, frame, visible, index)\r\n {\r\n if (visible === undefined) { visible = true; }\r\n if (index === undefined) { index = this.children.length; }\r\n\r\n if (frame === undefined)\r\n {\r\n frame = this.frame;\r\n }\r\n else if (!(frame instanceof Frame))\r\n {\r\n frame = this.texture.get(frame);\r\n }\r\n\r\n var bob = new Bob(this, x, y, frame, visible);\r\n\r\n this.children.addAt(bob, index, false);\r\n\r\n this.dirty = true;\r\n\r\n return bob;\r\n },\r\n\r\n /**\r\n * Creates multiple Bob objects within this Blitter and then passes each of them to the specified callback.\r\n *\r\n * @method Phaser.GameObjects.Blitter#createFromCallback\r\n * @since 3.0.0\r\n *\r\n * @param {CreateCallback} callback - The callback to invoke after creating a bob. It will be sent two arguments: The Bob and the index of the Bob.\r\n * @param {integer} quantity - The quantity of Bob objects to create.\r\n * @param {(string|integer|Phaser.Textures.Frame|string[]|integer[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture.\r\n * @param {boolean} [visible=true] - Should the created Bob render or not?\r\n *\r\n * @return {Phaser.GameObjects.Bob[]} An array of Bob objects that were created.\r\n */\r\n createFromCallback: function (callback, quantity, frame, visible)\r\n {\r\n var bobs = this.createMultiple(quantity, frame, visible);\r\n\r\n for (var i = 0; i < bobs.length; i++)\r\n {\r\n var bob = bobs[i];\r\n\r\n callback.call(this, bob, i);\r\n }\r\n\r\n return bobs;\r\n },\r\n\r\n /**\r\n * Creates multiple Bobs in one call.\r\n *\r\n * The amount created is controlled by a combination of the `quantity` argument and the number of frames provided.\r\n *\r\n * If the quantity is set to 10 and you provide 2 frames, then 20 Bobs will be created. 10 with the first\r\n * frame and 10 with the second.\r\n *\r\n * @method Phaser.GameObjects.Blitter#createMultiple\r\n * @since 3.0.0\r\n *\r\n * @param {integer} quantity - The quantity of Bob objects to create.\r\n * @param {(string|integer|Phaser.Textures.Frame|string[]|integer[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture.\r\n * @param {boolean} [visible=true] - Should the created Bob render or not?\r\n *\r\n * @return {Phaser.GameObjects.Bob[]} An array of Bob objects that were created.\r\n */\r\n createMultiple: function (quantity, frame, visible)\r\n {\r\n if (frame === undefined) { frame = this.frame.name; }\r\n if (visible === undefined) { visible = true; }\r\n\r\n if (!Array.isArray(frame))\r\n {\r\n frame = [ frame ];\r\n }\r\n\r\n var bobs = [];\r\n var _this = this;\r\n\r\n frame.forEach(function (singleFrame)\r\n {\r\n for (var i = 0; i < quantity; i++)\r\n {\r\n bobs.push(_this.create(0, 0, singleFrame, visible));\r\n }\r\n });\r\n\r\n return bobs;\r\n },\r\n\r\n /**\r\n * Checks if the given child can render or not, by checking its `visible` and `alpha` values.\r\n *\r\n * @method Phaser.GameObjects.Blitter#childCanRender\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Bob} child - The Bob to check for rendering.\r\n *\r\n * @return {boolean} Returns `true` if the given child can render, otherwise `false`.\r\n */\r\n childCanRender: function (child)\r\n {\r\n return (child.visible && child.alpha > 0);\r\n },\r\n\r\n /**\r\n * Returns an array of Bobs to be rendered.\r\n * If the Blitter is dirty then a new list is generated and stored in `renderList`.\r\n *\r\n * @method Phaser.GameObjects.Blitter#getRenderList\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Bob[]} An array of Bob objects that will be rendered this frame.\r\n */\r\n getRenderList: function ()\r\n {\r\n if (this.dirty)\r\n {\r\n this.renderList = this.children.list.filter(this.childCanRender, this);\r\n this.dirty = false;\r\n }\r\n\r\n return this.renderList;\r\n },\r\n\r\n /**\r\n * Removes all Bobs from the children List and clears the dirty flag.\r\n *\r\n * @method Phaser.GameObjects.Blitter#clear\r\n * @since 3.0.0\r\n */\r\n clear: function ()\r\n {\r\n this.children.removeAll();\r\n this.dirty = true;\r\n },\r\n\r\n /**\r\n * Internal destroy handler, called as part of the destroy process.\r\n *\r\n * @method Phaser.GameObjects.Blitter#preDestroy\r\n * @protected\r\n * @since 3.9.0\r\n */\r\n preDestroy: function ()\r\n {\r\n this.children.destroy();\r\n\r\n this.renderList = [];\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Blitter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/blitter/Blitter.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/blitter/BlitterCanvasRenderer.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/blitter/BlitterCanvasRenderer.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Blitter#renderCanvas\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Blitter} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar BlitterCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var list = src.getRenderList();\r\n\r\n if (list.length === 0)\r\n {\r\n return;\r\n }\r\n\r\n var ctx = renderer.currentContext;\r\n\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (alpha === 0)\r\n {\r\n // Nothing to see, so abort early\r\n return;\r\n }\r\n\r\n // Blend Mode + Scale Mode\r\n ctx.globalCompositeOperation = renderer.blendModes[src.blendMode];\r\n\r\n ctx.imageSmoothingEnabled = !(!renderer.antialias || src.frame.source.scaleMode);\r\n\r\n var cameraScrollX = src.x - camera.scrollX * src.scrollFactorX;\r\n var cameraScrollY = src.y - camera.scrollY * src.scrollFactorY;\r\n\r\n ctx.save();\r\n\r\n if (parentMatrix)\r\n {\r\n parentMatrix.copyToContext(ctx);\r\n }\r\n\r\n var roundPixels = camera.roundPixels;\r\n\r\n // Render bobs\r\n for (var i = 0; i < list.length; i++)\r\n {\r\n var bob = list[i];\r\n var flip = (bob.flipX || bob.flipY);\r\n var frame = bob.frame;\r\n var cd = frame.canvasData;\r\n var dx = frame.x;\r\n var dy = frame.y;\r\n var fx = 1;\r\n var fy = 1;\r\n\r\n var bobAlpha = bob.alpha * alpha;\r\n\r\n if (bobAlpha === 0)\r\n {\r\n continue;\r\n }\r\n\r\n ctx.globalAlpha = bobAlpha;\r\n \r\n if (!flip)\r\n {\r\n if (roundPixels)\r\n {\r\n dx = Math.round(dx);\r\n dy = Math.round(dy);\r\n }\r\n\r\n ctx.drawImage(\r\n frame.source.image,\r\n cd.x,\r\n cd.y,\r\n cd.width,\r\n cd.height,\r\n dx + bob.x + cameraScrollX,\r\n dy + bob.y + cameraScrollY,\r\n cd.width,\r\n cd.height\r\n );\r\n }\r\n else\r\n {\r\n if (bob.flipX)\r\n {\r\n fx = -1;\r\n dx -= cd.width;\r\n }\r\n\r\n if (bob.flipY)\r\n {\r\n fy = -1;\r\n dy -= cd.height;\r\n }\r\n\r\n ctx.save();\r\n ctx.translate(bob.x + cameraScrollX, bob.y + cameraScrollY);\r\n ctx.scale(fx, fy);\r\n ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, dx, dy, cd.width, cd.height);\r\n ctx.restore();\r\n }\r\n }\r\n \r\n ctx.restore();\r\n};\r\n\r\nmodule.exports = BlitterCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/blitter/BlitterCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/blitter/BlitterCreator.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/blitter/BlitterCreator.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Blitter = __webpack_require__(/*! ./Blitter */ \"./node_modules/phaser/src/gameobjects/blitter/Blitter.js\");\r\nvar BuildGameObject = __webpack_require__(/*! ../BuildGameObject */ \"./node_modules/phaser/src/gameobjects/BuildGameObject.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\n\r\n/**\r\n * Creates a new Blitter Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Blitter Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#blitter\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {Phaser.GameObjects.Blitter} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('blitter', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n var key = GetAdvancedValue(config, 'key', null);\r\n var frame = GetAdvancedValue(config, 'frame', null);\r\n\r\n var blitter = new Blitter(this.scene, 0, 0, key, frame);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, blitter, config);\r\n\r\n return blitter;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectCreator context.\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/blitter/BlitterCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/blitter/BlitterFactory.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/blitter/BlitterFactory.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Blitter = __webpack_require__(/*! ./Blitter */ \"./node_modules/phaser/src/gameobjects/blitter/Blitter.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Blitter Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Blitter Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#blitter\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x position of the Game Object.\r\n * @param {number} y - The y position of the Game Object.\r\n * @param {string} key - The key of the Texture the Blitter object will use.\r\n * @param {(string|integer)} [frame] - The default Frame children of the Blitter will use.\r\n * \r\n * @return {Phaser.GameObjects.Blitter} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('blitter', function (x, y, key, frame)\r\n{\r\n return this.displayList.add(new Blitter(this.scene, x, y, key, frame));\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n// \r\n// There are several properties available to use:\r\n// \r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/blitter/BlitterFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/blitter/BlitterRender.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/blitter/BlitterRender.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./BlitterWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/blitter/BlitterWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./BlitterCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/blitter/BlitterCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/blitter/BlitterRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/blitter/BlitterWebGLRenderer.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/blitter/BlitterWebGLRenderer.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Utils = __webpack_require__(/*! ../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Blitter#renderWebGL\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Blitter} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar BlitterWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var list = src.getRenderList();\r\n\r\n if (list.length === 0)\r\n {\r\n return;\r\n }\r\n\r\n var pipeline = this.pipeline;\r\n\r\n renderer.setPipeline(pipeline, src);\r\n\r\n var cameraScrollX = camera.scrollX * src.scrollFactorX;\r\n var cameraScrollY = camera.scrollY * src.scrollFactorY;\r\n\r\n var calcMatrix = pipeline._tempMatrix1;\r\n\r\n calcMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n calcMatrix.multiplyWithOffset(parentMatrix, -cameraScrollX, -cameraScrollY);\r\n\r\n cameraScrollX = 0;\r\n cameraScrollY = 0;\r\n }\r\n\r\n var blitterX = src.x - cameraScrollX;\r\n var blitterY = src.y - cameraScrollY;\r\n var prevTextureSourceIndex = -1;\r\n var tintEffect = false;\r\n var alpha = camera.alpha * src.alpha;\r\n var roundPixels = camera.roundPixels;\r\n\r\n for (var index = 0; index < list.length; index++)\r\n {\r\n var bob = list[index];\r\n var frame = bob.frame;\r\n var bobAlpha = bob.alpha * alpha;\r\n\r\n if (bobAlpha === 0)\r\n {\r\n continue;\r\n }\r\n\r\n var width = frame.width;\r\n var height = frame.height;\r\n\r\n var x = blitterX + bob.x + frame.x;\r\n var y = blitterY + bob.y + frame.y;\r\n\r\n if (bob.flipX)\r\n {\r\n width *= -1;\r\n x += frame.width;\r\n }\r\n\r\n if (bob.flipY)\r\n {\r\n height *= -1;\r\n y += frame.height;\r\n }\r\n\r\n var xw = x + width;\r\n var yh = y + height;\r\n\r\n var tx0 = calcMatrix.getX(x, y);\r\n var ty0 = calcMatrix.getY(x, y);\r\n\r\n var tx1 = calcMatrix.getX(xw, yh);\r\n var ty1 = calcMatrix.getY(xw, yh);\r\n\r\n var tint = Utils.getTintAppendFloatAlpha(bob.tint, bobAlpha);\r\n\r\n // Bind texture only if the Texture Source is different from before\r\n if (frame.sourceIndex !== prevTextureSourceIndex)\r\n {\r\n pipeline.setTexture2D(frame.glTexture, 0);\r\n\r\n prevTextureSourceIndex = frame.sourceIndex;\r\n }\r\n\r\n if (roundPixels)\r\n {\r\n tx0 = Math.round(tx0);\r\n ty0 = Math.round(ty0);\r\n\r\n tx1 = Math.round(tx1);\r\n ty1 = Math.round(ty1);\r\n }\r\n\r\n // TL x/y, BL x/y, BR x/y, TR x/y\r\n if (pipeline.batchQuad(tx0, ty0, tx0, ty1, tx1, ty1, tx1, ty0, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, frame.glTexture, 0))\r\n {\r\n prevTextureSourceIndex = -1;\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = BlitterWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/blitter/BlitterWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/blitter/Bob.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/blitter/Bob.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Frame = __webpack_require__(/*! ../../textures/Frame */ \"./node_modules/phaser/src/textures/Frame.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Bob Game Object.\r\n *\r\n * A Bob belongs to a Blitter Game Object. The Blitter is responsible for managing and rendering this object.\r\n *\r\n * A Bob has a position, alpha value and a frame from a texture that it uses to render with. You can also toggle\r\n * the flipped and visible state of the Bob. The Frame the Bob uses to render can be changed dynamically, but it\r\n * must be a Frame within the Texture used by the parent Blitter.\r\n *\r\n * Bob positions are relative to the Blitter parent. So if you move the Blitter parent, all Bob children will\r\n * have their positions impacted by this change as well.\r\n *\r\n * You can manipulate Bob objects directly from your game code, but the creation and destruction of them should be\r\n * handled via the Blitter parent.\r\n *\r\n * @class Bob\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Blitter} blitter - The parent Blitter object is responsible for updating this Bob.\r\n * @param {number} x - The horizontal position of this Game Object in the world, relative to the parent Blitter position.\r\n * @param {number} y - The vertical position of this Game Object in the world, relative to the parent Blitter position.\r\n * @param {(string|integer)} frame - The Frame this Bob will render with, as defined in the Texture the parent Blitter is using.\r\n * @param {boolean} visible - Should the Bob render visible or not to start with?\r\n */\r\nvar Bob = new Class({\r\n\r\n initialize:\r\n\r\n function Bob (blitter, x, y, frame, visible)\r\n {\r\n /**\r\n * The Blitter object that this Bob belongs to.\r\n *\r\n * @name Phaser.GameObjects.Bob#parent\r\n * @type {Phaser.GameObjects.Blitter}\r\n * @since 3.0.0\r\n */\r\n this.parent = blitter;\r\n\r\n /**\r\n * The x position of this Bob, relative to the x position of the Blitter.\r\n *\r\n * @name Phaser.GameObjects.Bob#x\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.x = x;\r\n\r\n /**\r\n * The y position of this Bob, relative to the y position of the Blitter.\r\n *\r\n * @name Phaser.GameObjects.Bob#y\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.y = y;\r\n\r\n /**\r\n * The frame that the Bob uses to render with.\r\n * To change the frame use the `Bob.setFrame` method.\r\n *\r\n * @name Phaser.GameObjects.Bob#frame\r\n * @type {Phaser.Textures.Frame}\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n this.frame = frame;\r\n\r\n /**\r\n * A blank object which can be used to store data related to this Bob in.\r\n *\r\n * @name Phaser.GameObjects.Bob#data\r\n * @type {object}\r\n * @default {}\r\n * @since 3.0.0\r\n */\r\n this.data = {};\r\n\r\n /**\r\n * The tint value of this Bob.\r\n *\r\n * @name Phaser.GameObjects.Bob#tint\r\n * @type {number}\r\n * @default 0xffffff\r\n * @since 3.20.0\r\n */\r\n this.tint = 0xffffff;\r\n\r\n /**\r\n * The visible state of this Bob.\r\n *\r\n * @name Phaser.GameObjects.Bob#_visible\r\n * @type {boolean}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._visible = visible;\r\n\r\n /**\r\n * The alpha value of this Bob.\r\n *\r\n * @name Phaser.GameObjects.Bob#_alpha\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this._alpha = 1;\r\n\r\n /**\r\n * The horizontally flipped state of the Bob.\r\n * A Bob that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture.\r\n *\r\n * @name Phaser.GameObjects.Bob#flipX\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.flipX = false;\r\n\r\n /**\r\n * The vertically flipped state of the Bob.\r\n * A Bob that is flipped vertically will render inversed on the vertical axis (i.e. upside down)\r\n * Flipping always takes place from the middle of the texture.\r\n *\r\n * @name Phaser.GameObjects.Bob#flipY\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.flipY = false;\r\n },\r\n\r\n /**\r\n * Changes the Texture Frame being used by this Bob.\r\n * The frame must be part of the Texture the parent Blitter is using.\r\n * If no value is given it will use the default frame of the Blitter parent.\r\n *\r\n * @method Phaser.GameObjects.Bob#setFrame\r\n * @since 3.0.0\r\n *\r\n * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The frame to be used during rendering.\r\n *\r\n * @return {Phaser.GameObjects.Bob} This Bob Game Object.\r\n */\r\n setFrame: function (frame)\r\n {\r\n if (frame === undefined)\r\n {\r\n this.frame = this.parent.frame;\r\n }\r\n else if (frame instanceof Frame && frame.texture === this.parent.texture)\r\n {\r\n this.frame = frame;\r\n }\r\n else\r\n {\r\n this.frame = this.parent.texture.get(frame);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the horizontal and vertical flipped state of this Bob back to their default un-flipped state.\r\n *\r\n * @method Phaser.GameObjects.Bob#resetFlip\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Bob} This Bob Game Object.\r\n */\r\n resetFlip: function ()\r\n {\r\n this.flipX = false;\r\n this.flipY = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets this Bob.\r\n *\r\n * Changes the position to the values given, and optionally changes the frame.\r\n *\r\n * Also resets the flipX and flipY values, sets alpha back to 1 and visible to true.\r\n *\r\n * @method Phaser.GameObjects.Bob#reset\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x position of the Bob. Bob coordinate are relative to the position of the Blitter object.\r\n * @param {number} y - The y position of the Bob. Bob coordinate are relative to the position of the Blitter object.\r\n * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using.\r\n *\r\n * @return {Phaser.GameObjects.Bob} This Bob Game Object.\r\n */\r\n reset: function (x, y, frame)\r\n {\r\n this.x = x;\r\n this.y = y;\r\n\r\n this.flipX = false;\r\n this.flipY = false;\r\n\r\n this._alpha = 1;\r\n this._visible = true;\r\n\r\n this.parent.dirty = true;\r\n\r\n if (frame)\r\n {\r\n this.setFrame(frame);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Changes the position of this Bob to the values given.\r\n *\r\n * @method Phaser.GameObjects.Bob#setPosition\r\n * @since 3.20.0\r\n *\r\n * @param {number} x - The x position of the Bob. Bob coordinate are relative to the position of the Blitter object.\r\n * @param {number} y - The y position of the Bob. Bob coordinate are relative to the position of the Blitter object.\r\n *\r\n * @return {Phaser.GameObjects.Bob} This Bob Game Object.\r\n */\r\n setPosition: function (x, y)\r\n {\r\n this.x = x;\r\n this.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal flipped state of this Bob.\r\n *\r\n * @method Phaser.GameObjects.Bob#setFlipX\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\r\n *\r\n * @return {Phaser.GameObjects.Bob} This Bob Game Object.\r\n */\r\n setFlipX: function (value)\r\n {\r\n this.flipX = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the vertical flipped state of this Bob.\r\n *\r\n * @method Phaser.GameObjects.Bob#setFlipY\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\r\n *\r\n * @return {Phaser.GameObjects.Bob} This Bob Game Object.\r\n */\r\n setFlipY: function (value)\r\n {\r\n this.flipY = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal and vertical flipped state of this Bob.\r\n *\r\n * @method Phaser.GameObjects.Bob#setFlip\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\r\n * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\r\n *\r\n * @return {Phaser.GameObjects.Bob} This Bob Game Object.\r\n */\r\n setFlip: function (x, y)\r\n {\r\n this.flipX = x;\r\n this.flipY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the visibility of this Bob.\r\n * \r\n * An invisible Bob will skip rendering.\r\n *\r\n * @method Phaser.GameObjects.Bob#setVisible\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The visible state of the Game Object.\r\n *\r\n * @return {Phaser.GameObjects.Bob} This Bob Game Object.\r\n */\r\n setVisible: function (value)\r\n {\r\n this.visible = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the Alpha level of this Bob. The alpha controls the opacity of the Game Object as it renders.\r\n * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.\r\n * \r\n * A Bob with alpha 0 will skip rendering.\r\n *\r\n * @method Phaser.GameObjects.Bob#setAlpha\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The alpha value used for this Bob. Between 0 and 1.\r\n *\r\n * @return {Phaser.GameObjects.Bob} This Bob Game Object.\r\n */\r\n setAlpha: function (value)\r\n {\r\n this.alpha = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the tint of this Bob.\r\n *\r\n * @method Phaser.GameObjects.Bob#setTint\r\n * @since 3.20.0\r\n *\r\n * @param {number} value - The tint value used for this Bob. Between 0 and 0xffffff.\r\n *\r\n * @return {Phaser.GameObjects.Bob} This Bob Game Object.\r\n */\r\n setTint: function (value)\r\n {\r\n this.tint = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Destroys this Bob instance.\r\n * Removes itself from the Blitter and clears the parent, frame and data properties.\r\n *\r\n * @method Phaser.GameObjects.Bob#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.parent.dirty = true;\r\n\r\n this.parent.children.remove(this);\r\n\r\n this.parent = undefined;\r\n this.frame = undefined;\r\n this.data = undefined;\r\n },\r\n\r\n /**\r\n * The visible state of the Bob.\r\n * \r\n * An invisible Bob will skip rendering.\r\n *\r\n * @name Phaser.GameObjects.Bob#visible\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n visible: {\r\n\r\n get: function ()\r\n {\r\n return this._visible;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.parent.dirty |= (this._visible !== value);\r\n this._visible = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The alpha value of the Bob, between 0 and 1.\r\n * \r\n * A Bob with alpha 0 will skip rendering.\r\n *\r\n * @name Phaser.GameObjects.Bob#alpha\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n alpha: {\r\n\r\n get: function ()\r\n {\r\n return this._alpha;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.parent.dirty |= ((this._alpha > 0) !== (value > 0));\r\n this._alpha = value;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Bob;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/blitter/Bob.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/Alpha.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/Alpha.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = __webpack_require__(/*! ../../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 2; // 0010\r\n\r\n/**\r\n * Provides methods used for setting the alpha properties of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Alpha\r\n * @since 3.0.0\r\n */\r\n\r\nvar Alpha = {\r\n\r\n /**\r\n * Private internal value. Holds the global alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#_alpha\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alpha: 1,\r\n\r\n /**\r\n * Private internal value. Holds the top-left alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#_alphaTL\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alphaTL: 1,\r\n\r\n /**\r\n * Private internal value. Holds the top-right alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#_alphaTR\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alphaTR: 1,\r\n\r\n /**\r\n * Private internal value. Holds the bottom-left alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#_alphaBL\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alphaBL: 1,\r\n\r\n /**\r\n * Private internal value. Holds the bottom-right alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#_alphaBR\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alphaBR: 1,\r\n\r\n /**\r\n * Clears all alpha values associated with this Game Object.\r\n *\r\n * Immediately sets the alpha levels back to 1 (fully opaque).\r\n *\r\n * @method Phaser.GameObjects.Components.Alpha#clearAlpha\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n clearAlpha: function ()\r\n {\r\n return this.setAlpha(1);\r\n },\r\n\r\n /**\r\n * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders.\r\n * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.\r\n *\r\n * If your game is running under WebGL you can optionally specify four different alpha values, each of which\r\n * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used.\r\n *\r\n * @method Phaser.GameObjects.Components.Alpha#setAlpha\r\n * @since 3.0.0\r\n *\r\n * @param {number} [topLeft=1] - The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object.\r\n * @param {number} [topRight] - The alpha value used for the top-right of the Game Object. WebGL only.\r\n * @param {number} [bottomLeft] - The alpha value used for the bottom-left of the Game Object. WebGL only.\r\n * @param {number} [bottomRight] - The alpha value used for the bottom-right of the Game Object. WebGL only.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setAlpha: function (topLeft, topRight, bottomLeft, bottomRight)\r\n {\r\n if (topLeft === undefined) { topLeft = 1; }\r\n\r\n // Treat as if there is only one alpha value for the whole Game Object\r\n if (topRight === undefined)\r\n {\r\n this.alpha = topLeft;\r\n }\r\n else\r\n {\r\n this._alphaTL = Clamp(topLeft, 0, 1);\r\n this._alphaTR = Clamp(topRight, 0, 1);\r\n this._alphaBL = Clamp(bottomLeft, 0, 1);\r\n this._alphaBR = Clamp(bottomRight, 0, 1);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The alpha value of the Game Object.\r\n *\r\n * This is a global value, impacting the entire Game Object, not just a region of it.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#alpha\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n alpha: {\r\n\r\n get: function ()\r\n {\r\n return this._alpha;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alpha = v;\r\n this._alphaTL = v;\r\n this._alphaTR = v;\r\n this._alphaBL = v;\r\n this._alphaBR = v;\r\n\r\n if (v === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The alpha value starting from the top-left of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#alphaTopLeft\r\n * @type {number}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n alphaTopLeft: {\r\n\r\n get: function ()\r\n {\r\n return this._alphaTL;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alphaTL = v;\r\n\r\n if (v !== 0)\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The alpha value starting from the top-right of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#alphaTopRight\r\n * @type {number}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n alphaTopRight: {\r\n\r\n get: function ()\r\n {\r\n return this._alphaTR;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alphaTR = v;\r\n\r\n if (v !== 0)\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The alpha value starting from the bottom-left of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#alphaBottomLeft\r\n * @type {number}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n alphaBottomLeft: {\r\n\r\n get: function ()\r\n {\r\n return this._alphaBL;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alphaBL = v;\r\n\r\n if (v !== 0)\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The alpha value starting from the bottom-right of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#alphaBottomRight\r\n * @type {number}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n alphaBottomRight: {\r\n\r\n get: function ()\r\n {\r\n return this._alphaBR;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alphaBR = v;\r\n\r\n if (v !== 0)\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Alpha;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/Alpha.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/AlphaSingle.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/AlphaSingle.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = __webpack_require__(/*! ../../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 2; // 0010\r\n\r\n/**\r\n * Provides methods used for setting the alpha property of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.GameObjects.Components.AlphaSingle\r\n * @since 3.22.0\r\n */\r\n\r\nvar AlphaSingle = {\r\n\r\n /**\r\n * Private internal value. Holds the global alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.AlphaSingle#_alpha\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alpha: 1,\r\n\r\n /**\r\n * Clears all alpha values associated with this Game Object.\r\n *\r\n * Immediately sets the alpha levels back to 1 (fully opaque).\r\n *\r\n * @method Phaser.GameObjects.Components.AlphaSingle#clearAlpha\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n clearAlpha: function ()\r\n {\r\n return this.setAlpha(1);\r\n },\r\n\r\n /**\r\n * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders.\r\n * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.\r\n *\r\n * @method Phaser.GameObjects.Components.AlphaSingle#setAlpha\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=1] - The alpha value applied across the whole Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setAlpha: function (value)\r\n {\r\n if (value === undefined) { value = 1; }\r\n\r\n this.alpha = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The alpha value of the Game Object.\r\n *\r\n * This is a global value, impacting the entire Game Object, not just a region of it.\r\n *\r\n * @name Phaser.GameObjects.Components.AlphaSingle#alpha\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n alpha: {\r\n\r\n get: function ()\r\n {\r\n return this._alpha;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alpha = v;\r\n\r\n if (v === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n }\r\n\r\n};\r\n\r\nmodule.exports = AlphaSingle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/AlphaSingle.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/Animation.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/Animation.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BaseAnimation = __webpack_require__(/*! ../../animations/Animation */ \"./node_modules/phaser/src/animations/Animation.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Events = __webpack_require__(/*! ../../animations/events */ \"./node_modules/phaser/src/animations/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Game Object Animation Controller.\r\n *\r\n * This controller lives as an instance within a Game Object, accessible as `sprite.anims`.\r\n *\r\n * @class Animation\r\n * @memberof Phaser.GameObjects.Components\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} parent - The Game Object to which this animation controller belongs.\r\n */\r\nvar Animation = new Class({\r\n\r\n initialize:\r\n\r\n function Animation (parent)\r\n {\r\n /**\r\n * The Game Object to which this animation controller belongs.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#parent\r\n * @type {Phaser.GameObjects.GameObject}\r\n * @since 3.0.0\r\n */\r\n this.parent = parent;\r\n\r\n /**\r\n * A reference to the global Animation Manager.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#animationManager\r\n * @type {Phaser.Animations.AnimationManager}\r\n * @since 3.0.0\r\n */\r\n this.animationManager = parent.scene.sys.anims;\r\n\r\n this.animationManager.once(Events.REMOVE_ANIMATION, this.remove, this);\r\n\r\n /**\r\n * Is an animation currently playing or not?\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#isPlaying\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.isPlaying = false;\r\n\r\n /**\r\n * The current Animation loaded into this Animation Controller.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#currentAnim\r\n * @type {?Phaser.Animations.Animation}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.currentAnim = null;\r\n\r\n /**\r\n * The current AnimationFrame being displayed by this Animation Controller.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#currentFrame\r\n * @type {?Phaser.Animations.AnimationFrame}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.currentFrame = null;\r\n\r\n /**\r\n * The key of the next Animation to be loaded into this Animation Controller when the current animation completes.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#nextAnim\r\n * @type {?string}\r\n * @default null\r\n * @since 3.16.0\r\n */\r\n this.nextAnim = null;\r\n\r\n /**\r\n * Time scale factor.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#_timeScale\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this._timeScale = 1;\r\n\r\n /**\r\n * The frame rate of playback in frames per second.\r\n * The default is 24 if the `duration` property is `null`.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#frameRate\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.frameRate = 0;\r\n\r\n /**\r\n * How long the animation should play for, in milliseconds.\r\n * If the `frameRate` property has been set then it overrides this value,\r\n * otherwise the `frameRate` is derived from `duration`.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#duration\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.duration = 0;\r\n\r\n /**\r\n * ms per frame, not including frame specific modifiers that may be present in the Animation data.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#msPerFrame\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.msPerFrame = 0;\r\n\r\n /**\r\n * Skip frames if the time lags, or always advanced anyway?\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#skipMissedFrames\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.skipMissedFrames = true;\r\n\r\n /**\r\n * A delay before starting playback, in milliseconds.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#_delay\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._delay = 0;\r\n\r\n /**\r\n * Number of times to repeat the animation (-1 for infinity)\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#_repeat\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._repeat = 0;\r\n\r\n /**\r\n * Delay before the repeat starts, in milliseconds.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#_repeatDelay\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._repeatDelay = 0;\r\n\r\n /**\r\n * Should the animation yoyo? (reverse back down to the start) before repeating?\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#_yoyo\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this._yoyo = false;\r\n\r\n /**\r\n * Will the playhead move forwards (`true`) or in reverse (`false`).\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#forward\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.forward = true;\r\n\r\n /**\r\n * An Internal trigger that's play the animation in reverse mode ('true') or not ('false'),\r\n * needed because forward can be changed by yoyo feature.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#_reverse\r\n * @type {boolean}\r\n * @default false\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._reverse = false;\r\n\r\n /**\r\n * Internal time overflow accumulator.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#accumulator\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.accumulator = 0;\r\n\r\n /**\r\n * The time point at which the next animation frame will change.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#nextTick\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.nextTick = 0;\r\n\r\n /**\r\n * An internal counter keeping track of how many repeats are left to play.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#repeatCounter\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.repeatCounter = 0;\r\n\r\n /**\r\n * An internal flag keeping track of pending repeats.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#pendingRepeat\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.pendingRepeat = false;\r\n\r\n /**\r\n * Is the Animation paused?\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#_paused\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this._paused = false;\r\n\r\n /**\r\n * Was the animation previously playing before being paused?\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#_wasPlaying\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this._wasPlaying = false;\r\n\r\n /**\r\n * Internal property tracking if this Animation is waiting to stop.\r\n *\r\n * 0 = No\r\n * 1 = Waiting for ms to pass\r\n * 2 = Waiting for repeat\r\n * 3 = Waiting for specific frame\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#_pendingStop\r\n * @type {integer}\r\n * @private\r\n * @since 3.4.0\r\n */\r\n this._pendingStop = 0;\r\n\r\n /**\r\n * Internal property used by _pendingStop.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#_pendingStopValue\r\n * @type {any}\r\n * @private\r\n * @since 3.4.0\r\n */\r\n this._pendingStopValue;\r\n },\r\n\r\n /**\r\n * Sets an animation to be played immediately after the current one completes.\r\n * \r\n * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, or have the `stop` method called directly on it.\r\n * \r\n * An animation set to repeat forever will never enter a completed state.\r\n * \r\n * You can chain a new animation at any point, including before the current one starts playing, during it, or when it ends (via its `animationcomplete` callback).\r\n * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained animations without impacting the global animation they're playing.\r\n * \r\n * Call this method with no arguments to reset the chained animation.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#chain\r\n * @since 3.16.0\r\n *\r\n * @param {(string|Phaser.Animations.Animation)} [key] - The string-based key of the animation to play next, as defined previously in the Animation Manager. Or an Animation instance.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n chain: function (key)\r\n {\r\n if (key instanceof BaseAnimation)\r\n {\r\n key = key.key;\r\n }\r\n\r\n this.nextAnim = key;\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Sets the amount of time, in milliseconds, that the animation will be delayed before starting playback.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#setDelay\r\n * @since 3.4.0\r\n *\r\n * @param {integer} [value=0] - The amount of time, in milliseconds, to wait before starting playback.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n setDelay: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this._delay = value;\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Gets the amount of time, in milliseconds that the animation will be delayed before starting playback.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#getDelay\r\n * @since 3.4.0\r\n *\r\n * @return {integer} The amount of time, in milliseconds, the Animation will wait before starting playback.\r\n */\r\n getDelay: function ()\r\n {\r\n return this._delay;\r\n },\r\n\r\n /**\r\n * Waits for the specified delay, in milliseconds, then starts playback of the requested animation.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#delayedPlay\r\n * @since 3.0.0\r\n *\r\n * @param {integer} delay - The delay, in milliseconds, to wait before starting the animation playing.\r\n * @param {string} key - The key of the animation to play.\r\n * @param {integer} [startFrame=0] - The frame of the animation to start from.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n delayedPlay: function (delay, key, startFrame)\r\n {\r\n this.play(key, true, startFrame);\r\n\r\n this.nextTick += delay;\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Returns the key of the animation currently loaded into this component.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#getCurrentKey\r\n * @since 3.0.0\r\n *\r\n * @return {string} The key of the Animation loaded into this component.\r\n */\r\n getCurrentKey: function ()\r\n {\r\n if (this.currentAnim)\r\n {\r\n return this.currentAnim.key;\r\n }\r\n },\r\n\r\n /**\r\n * Internal method used to load an animation into this component.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#load\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the animation to load.\r\n * @param {integer} [startFrame=0] - The start frame of the animation to load.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n load: function (key, startFrame)\r\n {\r\n if (startFrame === undefined) { startFrame = 0; }\r\n\r\n if (this.isPlaying)\r\n {\r\n this.stop();\r\n }\r\n\r\n // Load the new animation in\r\n this.animationManager.load(this, key, startFrame);\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Pause the current animation and set the `isPlaying` property to `false`.\r\n * You can optionally pause it at a specific frame.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#pause\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Animations.AnimationFrame} [atFrame] - An optional frame to set after pausing the animation.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n pause: function (atFrame)\r\n {\r\n if (!this._paused)\r\n {\r\n this._paused = true;\r\n this._wasPlaying = this.isPlaying;\r\n this.isPlaying = false;\r\n }\r\n\r\n if (atFrame !== undefined)\r\n {\r\n this.updateFrame(atFrame);\r\n }\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Resumes playback of a paused animation and sets the `isPlaying` property to `true`.\r\n * You can optionally tell it to start playback from a specific frame.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#resume\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Animations.AnimationFrame} [fromFrame] - An optional frame to set before restarting playback.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n resume: function (fromFrame)\r\n {\r\n if (this._paused)\r\n {\r\n this._paused = false;\r\n this.isPlaying = this._wasPlaying;\r\n }\r\n\r\n if (fromFrame !== undefined)\r\n {\r\n this.updateFrame(fromFrame);\r\n }\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * `true` if the current animation is paused, otherwise `false`.\r\n *\r\n * @name Phaser.GameObjects.Components.Animation#isPaused\r\n * @readonly\r\n * @type {boolean}\r\n * @since 3.4.0\r\n */\r\n isPaused: {\r\n\r\n get: function ()\r\n {\r\n return this._paused;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Plays an Animation on a Game Object that has the Animation component, such as a Sprite.\r\n * \r\n * Animations are stored in the global Animation Manager and are referenced by a unique string-based key.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#play\r\n * @fires Phaser.GameObjects.Components.Animation#onStartEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Animations.Animation)} key - The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance.\r\n * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call.\r\n * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n play: function (key, ignoreIfPlaying, startFrame)\r\n {\r\n if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; }\r\n if (startFrame === undefined) { startFrame = 0; }\r\n\r\n if (key instanceof BaseAnimation)\r\n {\r\n key = key.key;\r\n }\r\n\r\n if (ignoreIfPlaying && this.isPlaying && this.currentAnim.key === key)\r\n {\r\n return this.parent;\r\n }\r\n\r\n this.forward = true;\r\n this._reverse = false;\r\n this._paused = false;\r\n this._wasPlaying = true;\r\n\r\n return this._startAnimation(key, startFrame);\r\n },\r\n\r\n /**\r\n * Plays an Animation (in reverse mode) on the Game Object that owns this Animation Component.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#playReverse\r\n * @fires Phaser.GameObjects.Components.Animation#onStartEvent\r\n * @since 3.12.0\r\n *\r\n * @param {(string|Phaser.Animations.Animation)} key - The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance.\r\n * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call.\r\n * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n playReverse: function (key, ignoreIfPlaying, startFrame)\r\n {\r\n if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; }\r\n if (startFrame === undefined) { startFrame = 0; }\r\n\r\n if (key instanceof BaseAnimation)\r\n {\r\n key = key.key;\r\n }\r\n\r\n if (ignoreIfPlaying && this.isPlaying && this.currentAnim.key === key)\r\n {\r\n return this.parent;\r\n }\r\n\r\n this.forward = false;\r\n this._reverse = true;\r\n\r\n return this._startAnimation(key, startFrame);\r\n },\r\n\r\n /**\r\n * Load an Animation and fires 'onStartEvent' event, extracted from 'play' method.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#_startAnimation\r\n * @fires Phaser.Animations.Events#START_ANIMATION_EVENT\r\n * @fires Phaser.Animations.Events#SPRITE_START_ANIMATION_EVENT\r\n * @fires Phaser.Animations.Events#SPRITE_START_KEY_ANIMATION_EVENT\r\n * @since 3.12.0\r\n *\r\n * @param {string} key - The string-based key of the animation to play, as defined previously in the Animation Manager.\r\n * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n _startAnimation: function (key, startFrame)\r\n {\r\n this.load(key, startFrame);\r\n\r\n var anim = this.currentAnim;\r\n var gameObject = this.parent;\r\n\r\n if (!anim)\r\n {\r\n return gameObject;\r\n }\r\n\r\n // Should give us 9,007,199,254,740,991 safe repeats\r\n this.repeatCounter = (this._repeat === -1) ? Number.MAX_VALUE : this._repeat;\r\n\r\n anim.getFirstTick(this);\r\n\r\n this.isPlaying = true;\r\n this.pendingRepeat = false;\r\n\r\n if (anim.showOnStart)\r\n {\r\n gameObject.visible = true;\r\n }\r\n\r\n var frame = this.currentFrame;\r\n\r\n anim.emit(Events.ANIMATION_START, anim, frame, gameObject);\r\n\r\n gameObject.emit(Events.SPRITE_ANIMATION_KEY_START + key, anim, frame, gameObject);\r\n\r\n gameObject.emit(Events.SPRITE_ANIMATION_START, anim, frame, gameObject);\r\n\r\n return gameObject;\r\n },\r\n\r\n /**\r\n * Reverse the Animation that is already playing on the Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#reverse\r\n * @since 3.12.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n reverse: function ()\r\n {\r\n if (this.isPlaying)\r\n {\r\n this._reverse = !this._reverse;\r\n\r\n this.forward = !this.forward;\r\n }\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Returns a value between 0 and 1 indicating how far this animation is through, ignoring repeats and yoyos.\r\n * If the animation has a non-zero repeat defined, `getProgress` and `getTotalProgress` will be different\r\n * because `getProgress` doesn't include any repeats or repeat delays, whereas `getTotalProgress` does.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#getProgress\r\n * @since 3.4.0\r\n *\r\n * @return {number} The progress of the current animation, between 0 and 1.\r\n */\r\n getProgress: function ()\r\n {\r\n var p = this.currentFrame.progress;\r\n\r\n if (!this.forward)\r\n {\r\n p = 1 - p;\r\n }\r\n\r\n return p;\r\n },\r\n\r\n /**\r\n * Takes a value between 0 and 1 and uses it to set how far this animation is through playback.\r\n * Does not factor in repeats or yoyos, but does handle playing forwards or backwards.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#setProgress\r\n * @since 3.4.0\r\n *\r\n * @param {number} [value=0] - The progress value, between 0 and 1.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n setProgress: function (value)\r\n {\r\n if (!this.forward)\r\n {\r\n value = 1 - value;\r\n }\r\n\r\n this.setCurrentFrame(this.currentAnim.getFrameByProgress(value));\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Handle the removal of an animation from the Animation Manager.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#remove\r\n * @since 3.0.0\r\n *\r\n * @param {string} [key] - The key of the removed Animation.\r\n * @param {Phaser.Animations.Animation} [animation] - The removed Animation.\r\n */\r\n remove: function (key, animation)\r\n {\r\n if (animation === undefined) { animation = this.currentAnim; }\r\n\r\n if (this.isPlaying && animation.key === this.currentAnim.key)\r\n {\r\n this.stop();\r\n\r\n this.setCurrentFrame(this.currentAnim.frames[0]);\r\n }\r\n },\r\n\r\n /**\r\n * Gets the number of times that the animation will repeat\r\n * after its first iteration. For example, if returns 1, the animation will\r\n * play a total of twice (the initial play plus 1 repeat).\r\n * A value of -1 means the animation will repeat indefinitely.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#getRepeat\r\n * @since 3.4.0\r\n *\r\n * @return {integer} The number of times that the animation will repeat.\r\n */\r\n getRepeat: function ()\r\n {\r\n return this._repeat;\r\n },\r\n\r\n /**\r\n * Sets the number of times that the animation should repeat\r\n * after its first iteration. For example, if repeat is 1, the animation will\r\n * play a total of twice (the initial play plus 1 repeat).\r\n * To repeat indefinitely, use -1. repeat should always be an integer.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#setRepeat\r\n * @since 3.4.0\r\n *\r\n * @param {integer} value - The number of times that the animation should repeat.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n setRepeat: function (value)\r\n {\r\n this._repeat = value;\r\n\r\n this.repeatCounter = (value === -1) ? Number.MAX_VALUE : value;\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Gets the amount of delay between repeats, if any.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#getRepeatDelay\r\n * @since 3.4.0\r\n *\r\n * @return {number} The delay between repeats.\r\n */\r\n getRepeatDelay: function ()\r\n {\r\n return this._repeatDelay;\r\n },\r\n\r\n /**\r\n * Sets the amount of time in seconds between repeats.\r\n * For example, if `repeat` is 2 and `repeatDelay` is 10, the animation will play initially,\r\n * then wait for 10 seconds before repeating, then play again, then wait another 10 seconds\r\n * before doing its final repeat.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#setRepeatDelay\r\n * @since 3.4.0\r\n *\r\n * @param {number} value - The delay to wait between repeats, in seconds.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n setRepeatDelay: function (value)\r\n {\r\n this._repeatDelay = value;\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Restarts the current animation from its beginning, optionally including its delay value.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#restart\r\n * @fires Phaser.Animations.Events#RESTART_ANIMATION_EVENT\r\n * @fires Phaser.Animations.Events#SPRITE_RESTART_ANIMATION_EVENT\r\n * @fires Phaser.Animations.Events#SPRITE_RESTART_KEY_ANIMATION_EVENT\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [includeDelay=false] - Whether to include the delay value of the animation when restarting.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n restart: function (includeDelay)\r\n {\r\n if (includeDelay === undefined) { includeDelay = false; }\r\n\r\n var anim = this.currentAnim;\r\n\r\n anim.getFirstTick(this, includeDelay);\r\n\r\n this.forward = true;\r\n this.isPlaying = true;\r\n this.pendingRepeat = false;\r\n this._paused = false;\r\n\r\n // Set frame\r\n this.updateFrame(anim.frames[0]);\r\n\r\n var gameObject = this.parent;\r\n var frame = this.currentFrame;\r\n\r\n anim.emit(Events.ANIMATION_RESTART, anim, frame, gameObject);\r\n\r\n gameObject.emit(Events.SPRITE_ANIMATION_KEY_RESTART + anim.key, anim, frame, gameObject);\r\n\r\n gameObject.emit(Events.SPRITE_ANIMATION_RESTART, anim, frame, gameObject);\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Immediately stops the current animation from playing and dispatches the `animationcomplete` event.\r\n * \r\n * If no animation is set, no event will be dispatched.\r\n * \r\n * If there is another animation queued (via the `chain` method) then it will start playing immediately.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#stop\r\n * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n stop: function ()\r\n {\r\n this._pendingStop = 0;\r\n\r\n this.isPlaying = false;\r\n\r\n var gameObject = this.parent;\r\n var anim = this.currentAnim;\r\n var frame = this.currentFrame;\r\n\r\n if (anim)\r\n {\r\n anim.emit(Events.ANIMATION_COMPLETE, anim, frame, gameObject);\r\n\r\n gameObject.emit(Events.SPRITE_ANIMATION_KEY_COMPLETE + anim.key, anim, frame, gameObject);\r\n \r\n gameObject.emit(Events.SPRITE_ANIMATION_COMPLETE, anim, frame, gameObject);\r\n }\r\n\r\n if (this.nextAnim)\r\n {\r\n var key = this.nextAnim;\r\n\r\n this.nextAnim = null;\r\n\r\n this.play(key);\r\n }\r\n\r\n return gameObject;\r\n },\r\n\r\n /**\r\n * Stops the current animation from playing after the specified time delay, given in milliseconds.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#stopAfterDelay\r\n * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent\r\n * @since 3.4.0\r\n *\r\n * @param {integer} delay - The number of milliseconds to wait before stopping this animation.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n stopAfterDelay: function (delay)\r\n {\r\n this._pendingStop = 1;\r\n this._pendingStopValue = delay;\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Stops the current animation from playing when it next repeats.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#stopOnRepeat\r\n * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent\r\n * @since 3.4.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n stopOnRepeat: function ()\r\n {\r\n this._pendingStop = 2;\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Stops the current animation from playing when it next sets the given frame.\r\n * If this frame doesn't exist within the animation it will not stop it from playing.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#stopOnFrame\r\n * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.Animations.AnimationFrame} frame - The frame to check before stopping this animation.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n stopOnFrame: function (frame)\r\n {\r\n this._pendingStop = 3;\r\n this._pendingStopValue = frame;\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Sets the Time Scale factor, allowing you to make the animation go go faster or slower than default.\r\n * Where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#setTimeScale\r\n * @since 3.4.0\r\n *\r\n * @param {number} [value=1] - The time scale factor, where 1 is no change, 0.5 is half speed, etc.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.\r\n */\r\n setTimeScale: function (value)\r\n {\r\n if (value === undefined) { value = 1; }\r\n\r\n this._timeScale = value;\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Gets the Time Scale factor.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#getTimeScale\r\n * @since 3.4.0\r\n *\r\n * @return {number} The Time Scale value.\r\n */\r\n getTimeScale: function ()\r\n {\r\n return this._timeScale;\r\n },\r\n\r\n /**\r\n * Returns the total number of frames in this animation.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#getTotalFrames\r\n * @since 3.4.0\r\n *\r\n * @return {integer} The total number of frames in this animation.\r\n */\r\n getTotalFrames: function ()\r\n {\r\n return this.currentAnim.frames.length;\r\n },\r\n\r\n /**\r\n * The internal update loop for the Animation Component.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#update\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - The current timestamp.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n update: function (time, delta)\r\n {\r\n if (!this.currentAnim || !this.isPlaying || this.currentAnim.paused)\r\n {\r\n return;\r\n }\r\n\r\n this.accumulator += delta * this._timeScale;\r\n\r\n if (this._pendingStop === 1)\r\n {\r\n this._pendingStopValue -= delta;\r\n\r\n if (this._pendingStopValue <= 0)\r\n {\r\n return this.currentAnim.completeAnimation(this);\r\n }\r\n }\r\n\r\n if (this.accumulator >= this.nextTick)\r\n {\r\n this.currentAnim.setFrame(this);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the given Animation Frame as being the current frame\r\n * and applies it to the parent Game Object, adjusting its size and origin as needed.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#setCurrentFrame\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.Animations.AnimationFrame} animationFrame - The Animation Frame to set as being current.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to.\r\n */\r\n setCurrentFrame: function (animationFrame)\r\n {\r\n var gameObject = this.parent;\r\n\r\n this.currentFrame = animationFrame;\r\n\r\n gameObject.texture = animationFrame.frame.texture;\r\n gameObject.frame = animationFrame.frame;\r\n\r\n if (gameObject.isCropped)\r\n {\r\n gameObject.frame.updateCropUVs(gameObject._crop, gameObject.flipX, gameObject.flipY);\r\n }\r\n\r\n gameObject.setSizeToFrame();\r\n\r\n if (animationFrame.frame.customPivot)\r\n {\r\n gameObject.setOrigin(animationFrame.frame.pivotX, animationFrame.frame.pivotY);\r\n }\r\n else\r\n {\r\n gameObject.updateDisplayOrigin();\r\n }\r\n\r\n return gameObject;\r\n },\r\n\r\n /**\r\n * Internal frame change handler.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#updateFrame\r\n * @fires Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE_EVENT\r\n * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE_EVENT\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Animations.AnimationFrame} animationFrame - The animation frame to change to.\r\n */\r\n updateFrame: function (animationFrame)\r\n {\r\n var gameObject = this.setCurrentFrame(animationFrame);\r\n\r\n if (this.isPlaying)\r\n {\r\n if (animationFrame.setAlpha)\r\n {\r\n gameObject.alpha = animationFrame.alpha;\r\n }\r\n\r\n var anim = this.currentAnim;\r\n\r\n gameObject.emit(Events.SPRITE_ANIMATION_KEY_UPDATE + anim.key, anim, animationFrame, gameObject);\r\n\r\n gameObject.emit(Events.SPRITE_ANIMATION_UPDATE, anim, animationFrame, gameObject);\r\n\r\n if (this._pendingStop === 3 && this._pendingStopValue === animationFrame)\r\n {\r\n this.currentAnim.completeAnimation(this);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Advances the animation to the next frame, regardless of the time or animation state.\r\n * If the animation is set to repeat, or yoyo, this will still take effect.\r\n * \r\n * Calling this does not change the direction of the animation. I.e. if it was currently\r\n * playing in reverse, calling this method doesn't then change the direction to forwards.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#nextFrame\r\n * @since 3.16.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to.\r\n */\r\n nextFrame: function ()\r\n {\r\n if (this.currentAnim)\r\n {\r\n this.currentAnim.nextFrame(this);\r\n }\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Advances the animation to the previous frame, regardless of the time or animation state.\r\n * If the animation is set to repeat, or yoyo, this will still take effect.\r\n * \r\n * Calling this does not change the direction of the animation. I.e. if it was currently\r\n * playing in forwards, calling this method doesn't then change the direction to backwards.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#previousFrame\r\n * @since 3.16.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to.\r\n */\r\n previousFrame: function ()\r\n {\r\n if (this.currentAnim)\r\n {\r\n this.currentAnim.previousFrame(this);\r\n }\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Sets if the current Animation will yoyo when it reaches the end.\r\n * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#setYoyo\r\n * @since 3.4.0\r\n *\r\n * @param {boolean} [value=false] - `true` if the animation should yoyo, `false` to not.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to.\r\n */\r\n setYoyo: function (value)\r\n {\r\n if (value === undefined) { value = false; }\r\n\r\n this._yoyo = value;\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Gets if the current Animation will yoyo when it reaches the end.\r\n * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#getYoyo\r\n * @since 3.4.0\r\n *\r\n * @return {boolean} `true` if the animation is set to yoyo, `false` if not.\r\n */\r\n getYoyo: function ()\r\n {\r\n return this._yoyo;\r\n },\r\n\r\n /**\r\n * Destroy this Animation component.\r\n *\r\n * Unregisters event listeners and cleans up its references.\r\n *\r\n * @method Phaser.GameObjects.Components.Animation#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.animationManager.off(Events.REMOVE_ANIMATION, this.remove, this);\r\n\r\n this.animationManager = null;\r\n this.parent = null;\r\n\r\n this.currentAnim = null;\r\n this.currentFrame = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Animation;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/Animation.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/BlendMode.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/BlendMode.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BlendModes = __webpack_require__(/*! ../../renderer/BlendModes */ \"./node_modules/phaser/src/renderer/BlendModes.js\");\r\n\r\n/**\r\n * Provides methods used for setting the blend mode of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.GameObjects.Components.BlendMode\r\n * @since 3.0.0\r\n */\r\n\r\nvar BlendMode = {\r\n\r\n /**\r\n * Private internal value. Holds the current blend mode.\r\n * \r\n * @name Phaser.GameObjects.Components.BlendMode#_blendMode\r\n * @type {integer}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n _blendMode: BlendModes.NORMAL,\r\n\r\n /**\r\n * Sets the Blend Mode being used by this Game Object.\r\n *\r\n * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay)\r\n *\r\n * Under WebGL only the following Blend Modes are available:\r\n *\r\n * * ADD\r\n * * MULTIPLY\r\n * * SCREEN\r\n * * ERASE\r\n *\r\n * Canvas has more available depending on browser support.\r\n *\r\n * You can also create your own custom Blend Modes in WebGL.\r\n *\r\n * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending\r\n * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these\r\n * reasons try to be careful about the construction of your Scene and the frequency of which blend modes\r\n * are used.\r\n *\r\n * @name Phaser.GameObjects.Components.BlendMode#blendMode\r\n * @type {(Phaser.BlendModes|string)}\r\n * @since 3.0.0\r\n */\r\n blendMode: {\r\n\r\n get: function ()\r\n {\r\n return this._blendMode;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (typeof value === 'string')\r\n {\r\n value = BlendModes[value];\r\n }\r\n\r\n value |= 0;\r\n\r\n if (value >= -1)\r\n {\r\n this._blendMode = value;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the Blend Mode being used by this Game Object.\r\n *\r\n * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay)\r\n *\r\n * Under WebGL only the following Blend Modes are available:\r\n *\r\n * * ADD\r\n * * MULTIPLY\r\n * * SCREEN\r\n * * ERASE (only works when rendering to a framebuffer, like a Render Texture)\r\n *\r\n * Canvas has more available depending on browser support.\r\n *\r\n * You can also create your own custom Blend Modes in WebGL.\r\n *\r\n * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending\r\n * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these\r\n * reasons try to be careful about the construction of your Scene and the frequency in which blend modes\r\n * are used.\r\n *\r\n * @method Phaser.GameObjects.Components.BlendMode#setBlendMode\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.BlendModes)} value - The BlendMode value. Either a string or a CONST.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setBlendMode: function (value)\r\n {\r\n this.blendMode = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = BlendMode;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/BlendMode.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/ComputedSize.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/ComputedSize.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for calculating and setting the size of a non-Frame based Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.ComputedSize\r\n * @since 3.0.0\r\n */\r\n\r\nvar ComputedSize = {\r\n\r\n /**\r\n * The native (un-scaled) width of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayWidth` property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n width: 0,\r\n\r\n /**\r\n * The native (un-scaled) height of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayHeight` property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n height: 0,\r\n\r\n /**\r\n * The displayed width of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#displayWidth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayWidth: {\r\n\r\n get: function ()\r\n {\r\n return this.scaleX * this.width;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleX = value / this.width;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The displayed height of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#displayHeight\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayHeight: {\r\n\r\n get: function ()\r\n {\r\n return this.scaleY * this.height;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleY = value / this.height;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the internal size of this Game Object, as used for frame or physics body creation.\r\n * \r\n * This will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or call the\r\n * `setDisplaySize` method, which is the same thing as changing the scale but allows you\r\n * to do so by giving pixel values.\r\n * \r\n * If you have enabled this Game Object for input, changing the size will _not_ change the\r\n * size of the hit area. To do this you should adjust the `input.hitArea` object directly.\r\n * \r\n * @method Phaser.GameObjects.Components.ComputedSize#setSize\r\n * @since 3.4.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setSize: function (width, height)\r\n {\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the display size of this Game Object.\r\n * \r\n * Calling this will adjust the scale.\r\n * \r\n * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize\r\n * @since 3.4.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setDisplaySize: function (width, height)\r\n {\r\n this.displayWidth = width;\r\n this.displayHeight = height;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = ComputedSize;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/ComputedSize.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/Crop.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/Crop.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for getting and setting the texture of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Crop\r\n * @since 3.12.0\r\n */\r\n\r\nvar Crop = {\r\n\r\n /**\r\n * The Texture this Game Object is using to render with.\r\n *\r\n * @name Phaser.GameObjects.Components.Crop#texture\r\n * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture}\r\n * @since 3.0.0\r\n */\r\n texture: null,\r\n\r\n /**\r\n * The Texture Frame this Game Object is using to render with.\r\n *\r\n * @name Phaser.GameObjects.Components.Crop#frame\r\n * @type {Phaser.Textures.Frame}\r\n * @since 3.0.0\r\n */\r\n frame: null,\r\n\r\n /**\r\n * A boolean flag indicating if this Game Object is being cropped or not.\r\n * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off.\r\n * Equally, calling `setCrop` with no arguments will reset the crop and disable it.\r\n *\r\n * @name Phaser.GameObjects.Components.Crop#isCropped\r\n * @type {boolean}\r\n * @since 3.11.0\r\n */\r\n isCropped: false,\r\n\r\n /**\r\n * Applies a crop to a texture based Game Object, such as a Sprite or Image.\r\n * \r\n * The crop is a rectangle that limits the area of the texture frame that is visible during rendering.\r\n * \r\n * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just\r\n * changes what is shown when rendered.\r\n * \r\n * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left.\r\n * \r\n * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left\r\n * half of it, you could call `setCrop(0, 0, 400, 600)`.\r\n * \r\n * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop\r\n * an area of 200x100 when applied to a Game Object that had a scale factor of 2.\r\n * \r\n * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument.\r\n * \r\n * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`.\r\n * \r\n * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow\r\n * the renderer to skip several internal calculations.\r\n *\r\n * @method Phaser.GameObjects.Components.Crop#setCrop\r\n * @since 3.11.0\r\n *\r\n * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored.\r\n * @param {number} [y] - The y coordinate to start the crop from.\r\n * @param {number} [width] - The width of the crop rectangle in pixels.\r\n * @param {number} [height] - The height of the crop rectangle in pixels.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setCrop: function (x, y, width, height)\r\n {\r\n if (x === undefined)\r\n {\r\n this.isCropped = false;\r\n }\r\n else if (this.frame)\r\n {\r\n if (typeof x === 'number')\r\n {\r\n this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY);\r\n }\r\n else\r\n {\r\n var rect = x;\r\n\r\n this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY);\r\n }\r\n\r\n this.isCropped = true;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal method that returns a blank, well-formed crop object for use by a Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Crop#resetCropObject\r\n * @private\r\n * @since 3.12.0\r\n * \r\n * @return {object} The crop object.\r\n */\r\n resetCropObject: function ()\r\n {\r\n return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 };\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Crop;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/Crop.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/Depth.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/Depth.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for setting the depth of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Depth\r\n * @since 3.0.0\r\n */\r\n\r\nvar Depth = {\r\n\r\n /**\r\n * Private internal value. Holds the depth of the Game Object.\r\n * \r\n * @name Phaser.GameObjects.Components.Depth#_depth\r\n * @type {integer}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n _depth: 0,\r\n\r\n /**\r\n * The depth of this Game Object within the Scene.\r\n * \r\n * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order\r\n * of Game Objects, without actually moving their position in the display list.\r\n *\r\n * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth\r\n * value will always render in front of one with a lower value.\r\n *\r\n * Setting the depth will queue a depth sort event within the Scene.\r\n * \r\n * @name Phaser.GameObjects.Components.Depth#depth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n depth: {\r\n\r\n get: function ()\r\n {\r\n return this._depth;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scene.sys.queueDepthSort();\r\n this._depth = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The depth of this Game Object within the Scene.\r\n * \r\n * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order\r\n * of Game Objects, without actually moving their position in the display list.\r\n *\r\n * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth\r\n * value will always render in front of one with a lower value.\r\n *\r\n * Setting the depth will queue a depth sort event within the Scene.\r\n * \r\n * @method Phaser.GameObjects.Components.Depth#setDepth\r\n * @since 3.0.0\r\n *\r\n * @param {integer} value - The depth of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setDepth: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.depth = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Depth;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/Depth.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/Flip.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/Flip.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for visually flipping a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Flip\r\n * @since 3.0.0\r\n */\r\n\r\nvar Flip = {\r\n\r\n /**\r\n * The horizontally flipped state of the Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @name Phaser.GameObjects.Components.Flip#flipX\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n flipX: false,\r\n\r\n /**\r\n * The vertically flipped state of the Game Object.\r\n * \r\n * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down)\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @name Phaser.GameObjects.Components.Flip#flipY\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n flipY: false,\r\n\r\n /**\r\n * Toggles the horizontal flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#toggleFlipX\r\n * @since 3.0.0\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n toggleFlipX: function ()\r\n {\r\n this.flipX = !this.flipX;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Toggles the vertical flipped state of this Game Object.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#toggleFlipY\r\n * @since 3.0.0\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n toggleFlipY: function ()\r\n {\r\n this.flipY = !this.flipY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlipX\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlipX: function (value)\r\n {\r\n this.flipX = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the vertical flipped state of this Game Object.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlipY\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlipY: function (value)\r\n {\r\n this.flipY = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal and vertical flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped will render inversed on the flipped axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlip\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\r\n * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlip: function (x, y)\r\n {\r\n this.flipX = x;\r\n this.flipY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#resetFlip\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n resetFlip: function ()\r\n {\r\n this.flipX = false;\r\n this.flipY = false;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Flip;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/Flip.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/GetBounds.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/GetBounds.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Rectangle = __webpack_require__(/*! ../../geom/rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar RotateAround = __webpack_require__(/*! ../../math/RotateAround */ \"./node_modules/phaser/src/math/RotateAround.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * Provides methods used for obtaining the bounds of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.GameObjects.Components.GetBounds\r\n * @since 3.0.0\r\n */\r\n\r\nvar GetBounds = {\r\n\r\n /**\r\n * Processes the bounds output vector before returning it.\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#prepareBoundsOutput\r\n * @private\r\n * @since 3.18.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} output - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n prepareBoundsOutput: function (output, includeParent)\r\n {\r\n if (includeParent === undefined) { includeParent = false; }\r\n\r\n if (this.rotation !== 0)\r\n {\r\n RotateAround(output, this.x, this.y, this.rotation);\r\n }\r\n\r\n if (includeParent && this.parentContainer)\r\n {\r\n var parentMatrix = this.parentContainer.getBoundsTransformMatrix();\r\n\r\n parentMatrix.transformPoint(output.x, output.y, output);\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Gets the center coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getCenter\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getCenter: function (output)\r\n {\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n output.x = this.x - (this.displayWidth * this.originX) + (this.displayWidth / 2);\r\n output.y = this.y - (this.displayHeight * this.originY) + (this.displayHeight / 2);\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Gets the top-left corner coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getTopLeft\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getTopLeft: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = this.x - (this.displayWidth * this.originX);\r\n output.y = this.y - (this.displayHeight * this.originY);\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the top-center coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getTopCenter\r\n * @since 3.18.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getTopCenter: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2);\r\n output.y = this.y - (this.displayHeight * this.originY);\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the top-right corner coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getTopRight\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getTopRight: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth;\r\n output.y = this.y - (this.displayHeight * this.originY);\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the left-center coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getLeftCenter\r\n * @since 3.18.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getLeftCenter: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = this.x - (this.displayWidth * this.originX);\r\n output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2);\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the right-center coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getRightCenter\r\n * @since 3.18.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getRightCenter: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth;\r\n output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2);\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the bottom-left corner coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getBottomLeft\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getBottomLeft: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = this.x - (this.displayWidth * this.originX);\r\n output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight;\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the bottom-center coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getBottomCenter\r\n * @since 3.18.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getBottomCenter: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2);\r\n output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight;\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the bottom-right corner coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getBottomRight\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getBottomRight: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth;\r\n output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight;\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the bounds of this Game Object, regardless of origin.\r\n * The values are stored and returned in a Rectangle, or Rectangle-like, object.\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getBounds\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [output,$return]\r\n *\r\n * @param {(Phaser.Geom.Rectangle|object)} [output] - An object to store the values in. If not provided a new Rectangle will be created.\r\n *\r\n * @return {(Phaser.Geom.Rectangle|object)} The values stored in the output object.\r\n */\r\n getBounds: function (output)\r\n {\r\n if (output === undefined) { output = new Rectangle(); }\r\n\r\n // We can use the output object to temporarily store the x/y coords in:\r\n\r\n var TLx, TLy, TRx, TRy, BLx, BLy, BRx, BRy;\r\n\r\n // Instead of doing a check if parent container is \r\n // defined per corner we only do it once.\r\n if (this.parentContainer)\r\n {\r\n var parentMatrix = this.parentContainer.getBoundsTransformMatrix();\r\n\r\n this.getTopLeft(output);\r\n parentMatrix.transformPoint(output.x, output.y, output);\r\n\r\n TLx = output.x;\r\n TLy = output.y;\r\n\r\n this.getTopRight(output);\r\n parentMatrix.transformPoint(output.x, output.y, output);\r\n\r\n TRx = output.x;\r\n TRy = output.y;\r\n\r\n this.getBottomLeft(output);\r\n parentMatrix.transformPoint(output.x, output.y, output);\r\n\r\n BLx = output.x;\r\n BLy = output.y;\r\n\r\n this.getBottomRight(output);\r\n parentMatrix.transformPoint(output.x, output.y, output);\r\n\r\n BRx = output.x;\r\n BRy = output.y;\r\n }\r\n else\r\n {\r\n this.getTopLeft(output);\r\n\r\n TLx = output.x;\r\n TLy = output.y;\r\n\r\n this.getTopRight(output);\r\n\r\n TRx = output.x;\r\n TRy = output.y;\r\n\r\n this.getBottomLeft(output);\r\n\r\n BLx = output.x;\r\n BLy = output.y;\r\n\r\n this.getBottomRight(output);\r\n\r\n BRx = output.x;\r\n BRy = output.y;\r\n }\r\n\r\n output.x = Math.min(TLx, TRx, BLx, BRx);\r\n output.y = Math.min(TLy, TRy, BLy, BRy);\r\n output.width = Math.max(TLx, TRx, BLx, BRx) - output.x;\r\n output.height = Math.max(TLy, TRy, BLy, BRy) - output.y;\r\n\r\n return output;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = GetBounds;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/GetBounds.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/Mask.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/Mask.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BitmapMask = __webpack_require__(/*! ../../display/mask/BitmapMask */ \"./node_modules/phaser/src/display/mask/BitmapMask.js\");\r\nvar GeometryMask = __webpack_require__(/*! ../../display/mask/GeometryMask */ \"./node_modules/phaser/src/display/mask/GeometryMask.js\");\r\n\r\n/**\r\n * Provides methods used for getting and setting the mask of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Mask\r\n * @since 3.0.0\r\n */\r\n\r\nvar Mask = {\r\n\r\n /**\r\n * The Mask this Game Object is using during render.\r\n *\r\n * @name Phaser.GameObjects.Components.Mask#mask\r\n * @type {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask}\r\n * @since 3.0.0\r\n */\r\n mask: null,\r\n\r\n /**\r\n * Sets the mask that this Game Object will use to render with.\r\n *\r\n * The mask must have been previously created and can be either a GeometryMask or a BitmapMask.\r\n * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas.\r\n *\r\n * If a mask is already set on this Game Object it will be immediately replaced.\r\n * \r\n * Masks are positioned in global space and are not relative to the Game Object to which they\r\n * are applied. The reason for this is that multiple Game Objects can all share the same mask.\r\n * \r\n * Masks have no impact on physics or input detection. They are purely a rendering component\r\n * that allows you to limit what is visible during the render pass.\r\n *\r\n * @method Phaser.GameObjects.Components.Mask#setMask\r\n * @since 3.6.2\r\n *\r\n * @param {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} mask - The mask this Game Object will use when rendering.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setMask: function (mask)\r\n {\r\n this.mask = mask;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Clears the mask that this Game Object was using.\r\n *\r\n * @method Phaser.GameObjects.Components.Mask#clearMask\r\n * @since 3.6.2\r\n *\r\n * @param {boolean} [destroyMask=false] - Destroy the mask before clearing it?\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n clearMask: function (destroyMask)\r\n {\r\n if (destroyMask === undefined) { destroyMask = false; }\r\n\r\n if (destroyMask && this.mask)\r\n {\r\n this.mask.destroy();\r\n }\r\n\r\n this.mask = null;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates and returns a Bitmap Mask. This mask can be used by any Game Object,\r\n * including this one.\r\n *\r\n * To create the mask you need to pass in a reference to a renderable Game Object.\r\n * A renderable Game Object is one that uses a texture to render with, such as an\r\n * Image, Sprite, Render Texture or BitmapText.\r\n *\r\n * If you do not provide a renderable object, and this Game Object has a texture,\r\n * it will use itself as the object. This means you can call this method to create\r\n * a Bitmap Mask from any renderable Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Mask#createBitmapMask\r\n * @since 3.6.2\r\n * \r\n * @param {Phaser.GameObjects.GameObject} [renderable] - A renderable Game Object that uses a texture, such as a Sprite.\r\n *\r\n * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created.\r\n */\r\n createBitmapMask: function (renderable)\r\n {\r\n if (renderable === undefined && (this.texture || this.shader))\r\n {\r\n // eslint-disable-next-line consistent-this\r\n renderable = this;\r\n }\r\n\r\n return new BitmapMask(this.scene, renderable);\r\n },\r\n\r\n /**\r\n * Creates and returns a Geometry Mask. This mask can be used by any Game Object,\r\n * including this one.\r\n *\r\n * To create the mask you need to pass in a reference to a Graphics Game Object.\r\n *\r\n * If you do not provide a graphics object, and this Game Object is an instance\r\n * of a Graphics object, then it will use itself to create the mask.\r\n * \r\n * This means you can call this method to create a Geometry Mask from any Graphics Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Mask#createGeometryMask\r\n * @since 3.6.2\r\n * \r\n * @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask.\r\n *\r\n * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created.\r\n */\r\n createGeometryMask: function (graphics)\r\n {\r\n if (graphics === undefined && this.type === 'Graphics')\r\n {\r\n // eslint-disable-next-line consistent-this\r\n graphics = this;\r\n }\r\n\r\n return new GeometryMask(this.scene, graphics);\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Mask;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/Mask.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/Origin.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/Origin.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for getting and setting the origin of a Game Object.\r\n * Values are normalized, given in the range 0 to 1.\r\n * Display values contain the calculated pixel values.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Origin\r\n * @since 3.0.0\r\n */\r\n\r\nvar Origin = {\r\n\r\n /**\r\n * A property indicating that a Game Object has this component.\r\n *\r\n * @name Phaser.GameObjects.Components.Origin#_originComponent\r\n * @type {boolean}\r\n * @private\r\n * @default true\r\n * @since 3.2.0\r\n */\r\n _originComponent: true,\r\n\r\n /**\r\n * The horizontal origin of this Game Object.\r\n * The origin maps the relationship between the size and position of the Game Object.\r\n * The default value is 0.5, meaning all Game Objects are positioned based on their center.\r\n * Setting the value to 0 means the position now relates to the left of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Origin#originX\r\n * @type {number}\r\n * @default 0.5\r\n * @since 3.0.0\r\n */\r\n originX: 0.5,\r\n\r\n /**\r\n * The vertical origin of this Game Object.\r\n * The origin maps the relationship between the size and position of the Game Object.\r\n * The default value is 0.5, meaning all Game Objects are positioned based on their center.\r\n * Setting the value to 0 means the position now relates to the top of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Origin#originY\r\n * @type {number}\r\n * @default 0.5\r\n * @since 3.0.0\r\n */\r\n originY: 0.5,\r\n\r\n // private + read only\r\n _displayOriginX: 0,\r\n _displayOriginY: 0,\r\n\r\n /**\r\n * The horizontal display origin of this Game Object.\r\n * The origin is a normalized value between 0 and 1.\r\n * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin.\r\n *\r\n * @name Phaser.GameObjects.Components.Origin#displayOriginX\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayOriginX: {\r\n\r\n get: function ()\r\n {\r\n return this._displayOriginX;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._displayOriginX = value;\r\n this.originX = value / this.width;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical display origin of this Game Object.\r\n * The origin is a normalized value between 0 and 1.\r\n * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin.\r\n *\r\n * @name Phaser.GameObjects.Components.Origin#displayOriginY\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayOriginY: {\r\n\r\n get: function ()\r\n {\r\n return this._displayOriginY;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._displayOriginY = value;\r\n this.originY = value / this.height;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the origin of this Game Object.\r\n *\r\n * The values are given in the range 0 to 1.\r\n *\r\n * @method Phaser.GameObjects.Components.Origin#setOrigin\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0.5] - The horizontal origin value.\r\n * @param {number} [y=x] - The vertical origin value. If not defined it will be set to the value of `x`.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setOrigin: function (x, y)\r\n {\r\n if (x === undefined) { x = 0.5; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.originX = x;\r\n this.originY = y;\r\n\r\n return this.updateDisplayOrigin();\r\n },\r\n\r\n /**\r\n * Sets the origin of this Game Object based on the Pivot values in its Frame.\r\n *\r\n * @method Phaser.GameObjects.Components.Origin#setOriginFromFrame\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setOriginFromFrame: function ()\r\n {\r\n if (!this.frame || !this.frame.customPivot)\r\n {\r\n return this.setOrigin();\r\n }\r\n else\r\n {\r\n this.originX = this.frame.pivotX;\r\n this.originY = this.frame.pivotY;\r\n }\r\n\r\n return this.updateDisplayOrigin();\r\n },\r\n\r\n /**\r\n * Sets the display origin of this Game Object.\r\n * The difference between this and setting the origin is that you can use pixel values for setting the display origin.\r\n *\r\n * @method Phaser.GameObjects.Components.Origin#setDisplayOrigin\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The horizontal display origin value.\r\n * @param {number} [y=x] - The vertical display origin value. If not defined it will be set to the value of `x`.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setDisplayOrigin: function (x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.displayOriginX = x;\r\n this.displayOriginY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Updates the Display Origin cached values internally stored on this Game Object.\r\n * You don't usually call this directly, but it is exposed for edge-cases where you may.\r\n *\r\n * @method Phaser.GameObjects.Components.Origin#updateDisplayOrigin\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n updateDisplayOrigin: function ()\r\n {\r\n this._displayOriginX = this.originX * this.width;\r\n this._displayOriginY = this.originY * this.height;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Origin;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/Origin.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/PathFollower.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/PathFollower.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar DegToRad = __webpack_require__(/*! ../../math/DegToRad */ \"./node_modules/phaser/src/math/DegToRad.js\");\r\nvar GetBoolean = __webpack_require__(/*! ../../tweens/builders/GetBoolean */ \"./node_modules/phaser/src/tweens/builders/GetBoolean.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar TWEEN_CONST = __webpack_require__(/*! ../../tweens/tween/const */ \"./node_modules/phaser/src/tweens/tween/const.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * Provides methods used for managing a Game Object following a Path.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.GameObjects.Components.PathFollower\r\n * @since 3.17.0\r\n */\r\n\r\nvar PathFollower = {\r\n\r\n /**\r\n * The Path this PathFollower is following. It can only follow one Path at a time.\r\n *\r\n * @name Phaser.GameObjects.Components.PathFollower#path\r\n * @type {Phaser.Curves.Path}\r\n * @since 3.0.0\r\n */\r\n path: null,\r\n\r\n /**\r\n * Should the PathFollower automatically rotate to point in the direction of the Path?\r\n *\r\n * @name Phaser.GameObjects.Components.PathFollower#rotateToPath\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n rotateToPath: false,\r\n\r\n /**\r\n * If the PathFollower is rotating to match the Path (@see Phaser.GameObjects.PathFollower#rotateToPath)\r\n * this value is added to the rotation value. This allows you to rotate objects to a path but control\r\n * the angle of the rotation as well.\r\n *\r\n * @name Phaser.GameObjects.PathFollower#pathRotationOffset\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n pathRotationOffset: 0,\r\n\r\n /**\r\n * An additional vector to add to the PathFollowers position, allowing you to offset it from the\r\n * Path coordinates.\r\n *\r\n * @name Phaser.GameObjects.PathFollower#pathOffset\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n pathOffset: null,\r\n\r\n /**\r\n * A Vector2 that stores the current point of the path the follower is on.\r\n *\r\n * @name Phaser.GameObjects.PathFollower#pathVector\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n pathVector: null,\r\n\r\n /**\r\n * The Tween used for following the Path.\r\n *\r\n * @name Phaser.GameObjects.PathFollower#pathTween\r\n * @type {Phaser.Tweens.Tween}\r\n * @since 3.0.0\r\n */\r\n pathTween: null,\r\n\r\n /**\r\n * Settings for the PathFollower.\r\n *\r\n * @name Phaser.GameObjects.PathFollower#pathConfig\r\n * @type {?Phaser.Types.GameObjects.PathFollower.PathConfig}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n pathConfig: null,\r\n\r\n /**\r\n * Records the direction of the follower so it can change direction.\r\n *\r\n * @name Phaser.GameObjects.PathFollower#_prevDirection\r\n * @type {integer}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n _prevDirection: TWEEN_CONST.PLAYING_FORWARD,\r\n\r\n /**\r\n * Set the Path that this PathFollower should follow.\r\n *\r\n * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#setPath\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time.\r\n * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config] - Settings for the PathFollower.\r\n *\r\n * @return {Phaser.GameObjects.PathFollower} This Game Object.\r\n */\r\n setPath: function (path, config)\r\n {\r\n if (config === undefined) { config = this.pathConfig; }\r\n\r\n var tween = this.pathTween;\r\n\r\n if (tween && tween.isPlaying())\r\n {\r\n tween.stop();\r\n }\r\n\r\n this.path = path;\r\n\r\n if (config)\r\n {\r\n this.startFollow(config);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set whether the PathFollower should automatically rotate to point in the direction of the Path.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#setRotateToPath\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - Whether the PathFollower should automatically rotate to point in the direction of the Path.\r\n * @param {number} [offset=0] - Rotation offset in degrees.\r\n *\r\n * @return {Phaser.GameObjects.PathFollower} This Game Object.\r\n */\r\n setRotateToPath: function (value, offset)\r\n {\r\n if (offset === undefined) { offset = 0; }\r\n\r\n this.rotateToPath = value;\r\n\r\n this.pathRotationOffset = offset;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Is this PathFollower actively following a Path or not?\r\n *\r\n * To be considered as `isFollowing` it must be currently moving on a Path, and not paused.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#isFollowing\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` is this PathFollower is actively following a Path, otherwise `false`.\r\n */\r\n isFollowing: function ()\r\n {\r\n var tween = this.pathTween;\r\n\r\n return (tween && tween.isPlaying());\r\n },\r\n\r\n /**\r\n * Starts this PathFollower following its given Path.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#startFollow\r\n * @since 3.3.0\r\n *\r\n * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config={}] - The duration of the follow, or a PathFollower config object.\r\n * @param {number} [startAt=0] - Optional start position of the follow, between 0 and 1.\r\n *\r\n * @return {Phaser.GameObjects.PathFollower} This Game Object.\r\n */\r\n startFollow: function (config, startAt)\r\n {\r\n if (config === undefined) { config = {}; }\r\n if (startAt === undefined) { startAt = 0; }\r\n\r\n var tween = this.pathTween;\r\n\r\n if (tween && tween.isPlaying())\r\n {\r\n tween.stop();\r\n }\r\n\r\n if (typeof config === 'number')\r\n {\r\n config = { duration: config };\r\n }\r\n\r\n // Override in case they've been specified in the config\r\n config.from = GetValue(config, 'from', 0);\r\n config.to = GetValue(config, 'to', 1);\r\n\r\n var positionOnPath = GetBoolean(config, 'positionOnPath', false);\r\n\r\n this.rotateToPath = GetBoolean(config, 'rotateToPath', false);\r\n this.pathRotationOffset = GetValue(config, 'rotationOffset', 0);\r\n\r\n // This works, but it's not an ideal way of doing it as the follower jumps position\r\n var seek = GetValue(config, 'startAt', startAt);\r\n\r\n if (seek)\r\n {\r\n config.onStart = function (tween)\r\n {\r\n var tweenData = tween.data[0];\r\n tweenData.progress = seek;\r\n tweenData.elapsed = tweenData.duration * seek;\r\n var v = tweenData.ease(tweenData.progress);\r\n tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v);\r\n tweenData.target[tweenData.key] = tweenData.current;\r\n };\r\n }\r\n\r\n if (!this.pathOffset)\r\n {\r\n this.pathOffset = new Vector2(this.x, this.y);\r\n }\r\n\r\n if (!this.pathVector)\r\n {\r\n this.pathVector = new Vector2();\r\n }\r\n\r\n this.pathTween = this.scene.sys.tweens.addCounter(config);\r\n\r\n // The starting point of the path, relative to this follower\r\n this.path.getStartPoint(this.pathOffset);\r\n\r\n if (positionOnPath)\r\n {\r\n this.x = this.pathOffset.x;\r\n this.y = this.pathOffset.y;\r\n }\r\n\r\n this.pathOffset.x = this.x - this.pathOffset.x;\r\n this.pathOffset.y = this.y - this.pathOffset.y;\r\n\r\n this._prevDirection = TWEEN_CONST.PLAYING_FORWARD;\r\n\r\n if (this.rotateToPath)\r\n {\r\n // Set the rotation now (in case the tween has a delay on it, etc)\r\n var nextPoint = this.path.getPoint(0.1);\r\n\r\n this.rotation = Math.atan2(nextPoint.y - this.y, nextPoint.x - this.x) + DegToRad(this.pathRotationOffset);\r\n }\r\n\r\n this.pathConfig = config;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Pauses this PathFollower. It will still continue to render, but it will remain motionless at the\r\n * point on the Path at which you paused it.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#pauseFollow\r\n * @since 3.3.0\r\n *\r\n * @return {Phaser.GameObjects.PathFollower} This Game Object.\r\n */\r\n pauseFollow: function ()\r\n {\r\n var tween = this.pathTween;\r\n\r\n if (tween && tween.isPlaying())\r\n {\r\n tween.pause();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resumes a previously paused PathFollower.\r\n *\r\n * If the PathFollower was not paused this has no effect.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#resumeFollow\r\n * @since 3.3.0\r\n *\r\n * @return {Phaser.GameObjects.PathFollower} This Game Object.\r\n */\r\n resumeFollow: function ()\r\n {\r\n var tween = this.pathTween;\r\n\r\n if (tween && tween.isPaused())\r\n {\r\n tween.resume();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stops this PathFollower from following the path any longer.\r\n *\r\n * This will invoke any 'stop' conditions that may exist on the Path, or for the follower.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#stopFollow\r\n * @since 3.3.0\r\n *\r\n * @return {Phaser.GameObjects.PathFollower} This Game Object.\r\n */\r\n stopFollow: function ()\r\n {\r\n var tween = this.pathTween;\r\n\r\n if (tween && tween.isPlaying())\r\n {\r\n tween.stop();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal update handler that advances this PathFollower along the path.\r\n *\r\n * Called automatically by the Scene step, should not typically be called directly.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#pathUpdate\r\n * @since 3.17.0\r\n */\r\n pathUpdate: function ()\r\n {\r\n var tween = this.pathTween;\r\n\r\n if (tween)\r\n {\r\n var tweenData = tween.data[0];\r\n var pathVector = this.pathVector;\r\n\r\n if (tweenData.state !== TWEEN_CONST.COMPLETE)\r\n {\r\n this.path.getPoint(1, pathVector);\r\n\r\n pathVector.add(this.pathOffset);\r\n \r\n this.setPosition(pathVector.x, pathVector.y);\r\n\r\n return;\r\n }\r\n else if (tweenData.state !== TWEEN_CONST.PLAYING_FORWARD && tweenData.state !== TWEEN_CONST.PLAYING_BACKWARD)\r\n {\r\n // If delayed, etc then bail out\r\n return;\r\n }\r\n\r\n this.path.getPoint(tween.getValue(), pathVector);\r\n\r\n pathVector.add(this.pathOffset);\r\n\r\n var oldX = this.x;\r\n var oldY = this.y;\r\n\r\n this.setPosition(pathVector.x, pathVector.y);\r\n\r\n var speedX = this.x - oldX;\r\n var speedY = this.y - oldY;\r\n\r\n if (speedX === 0 && speedY === 0)\r\n {\r\n // Bail out early\r\n return;\r\n }\r\n\r\n if (tweenData.state !== this._prevDirection)\r\n {\r\n // We've changed direction, so don't do a rotate this frame\r\n this._prevDirection = tweenData.state;\r\n\r\n return;\r\n }\r\n\r\n if (this.rotateToPath)\r\n {\r\n this.rotation = Math.atan2(speedY, speedX) + DegToRad(this.pathRotationOffset);\r\n }\r\n }\r\n }\r\n\r\n};\r\n\r\nmodule.exports = PathFollower;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/PathFollower.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/Pipeline.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/Pipeline.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for setting the WebGL rendering pipeline of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Pipeline\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n\r\nvar Pipeline = {\r\n\r\n /**\r\n * The initial WebGL pipeline of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Pipeline#defaultPipeline\r\n * @type {Phaser.Renderer.WebGL.WebGLPipeline}\r\n * @default null\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n defaultPipeline: null,\r\n\r\n /**\r\n * The current WebGL pipeline of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Pipeline#pipeline\r\n * @type {Phaser.Renderer.WebGL.WebGLPipeline}\r\n * @default null\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n pipeline: null,\r\n\r\n /**\r\n * Sets the initial WebGL Pipeline of this Game Object.\r\n * This should only be called during the instantiation of the Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Pipeline#initPipeline\r\n * @webglOnly\r\n * @since 3.0.0\r\n *\r\n * @param {string} [pipelineName=TextureTintPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline.\r\n *\r\n * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`.\r\n */\r\n initPipeline: function (pipelineName)\r\n {\r\n if (pipelineName === undefined) { pipelineName = 'TextureTintPipeline'; }\r\n\r\n var renderer = this.scene.sys.game.renderer;\r\n\r\n if (renderer && renderer.gl && renderer.hasPipeline(pipelineName))\r\n {\r\n this.defaultPipeline = renderer.getPipeline(pipelineName);\r\n this.pipeline = this.defaultPipeline;\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Sets the active WebGL Pipeline of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Pipeline#setPipeline\r\n * @webglOnly\r\n * @since 3.0.0\r\n *\r\n * @param {string} pipelineName - The name of the pipeline to set on this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setPipeline: function (pipelineName)\r\n {\r\n var renderer = this.scene.sys.game.renderer;\r\n\r\n if (renderer && renderer.gl && renderer.hasPipeline(pipelineName))\r\n {\r\n this.pipeline = renderer.getPipeline(pipelineName);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the WebGL Pipeline of this Game Object back to the default it was created with.\r\n *\r\n * @method Phaser.GameObjects.Components.Pipeline#resetPipeline\r\n * @webglOnly\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`.\r\n */\r\n resetPipeline: function ()\r\n {\r\n this.pipeline = this.defaultPipeline;\r\n\r\n return (this.pipeline !== null);\r\n },\r\n\r\n /**\r\n * Gets the name of the WebGL Pipeline this Game Object is currently using.\r\n *\r\n * @method Phaser.GameObjects.Components.Pipeline#getPipelineName\r\n * @webglOnly\r\n * @since 3.0.0\r\n *\r\n * @return {string} The string-based name of the pipeline being used by this Game Object.\r\n */\r\n getPipelineName: function ()\r\n {\r\n return this.pipeline.name;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Pipeline;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/Pipeline.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/ScrollFactor.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/ScrollFactor.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for getting and setting the Scroll Factor of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.ScrollFactor\r\n * @since 3.0.0\r\n */\r\n\r\nvar ScrollFactor = {\r\n\r\n /**\r\n * The horizontal scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scrollFactorX: 1,\r\n\r\n /**\r\n * The vertical scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scrollFactorY: 1,\r\n\r\n /**\r\n * Sets the scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scroll factor of this Game Object.\r\n * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setScrollFactor: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.scrollFactorX = x;\r\n this.scrollFactorY = y;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = ScrollFactor;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/ScrollFactor.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/Size.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/Size.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for getting and setting the size of a Game Object.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Size\r\n * @since 3.0.0\r\n */\r\n\r\nvar Size = {\r\n\r\n /**\r\n * A property indicating that a Game Object has this component.\r\n * \r\n * @name Phaser.GameObjects.Components.Size#_sizeComponent\r\n * @type {boolean}\r\n * @private\r\n * @default true\r\n * @since 3.2.0\r\n */\r\n _sizeComponent: true,\r\n\r\n /**\r\n * The native (un-scaled) width of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayWidth` property.\r\n * \r\n * @name Phaser.GameObjects.Components.Size#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n width: 0,\r\n\r\n /**\r\n * The native (un-scaled) height of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayHeight` property.\r\n * \r\n * @name Phaser.GameObjects.Components.Size#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n height: 0,\r\n\r\n /**\r\n * The displayed width of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.Size#displayWidth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayWidth: {\r\n\r\n get: function ()\r\n {\r\n return Math.abs(this.scaleX * this.frame.realWidth);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleX = value / this.frame.realWidth;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The displayed height of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.Size#displayHeight\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayHeight: {\r\n\r\n get: function ()\r\n {\r\n return Math.abs(this.scaleY * this.frame.realHeight);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleY = value / this.frame.realHeight;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the size of this Game Object to be that of the given Frame.\r\n * \r\n * This will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or call the\r\n * `setDisplaySize` method, which is the same thing as changing the scale but allows you\r\n * to do so by giving pixel values.\r\n * \r\n * If you have enabled this Game Object for input, changing the size will _not_ change the\r\n * size of the hit area. To do this you should adjust the `input.hitArea` object directly.\r\n * \r\n * @method Phaser.GameObjects.Components.Size#setSizeToFrame\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.Frame} frame - The frame to base the size of this Game Object on.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setSizeToFrame: function (frame)\r\n {\r\n if (frame === undefined) { frame = this.frame; }\r\n\r\n this.width = frame.realWidth;\r\n this.height = frame.realHeight;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the internal size of this Game Object, as used for frame or physics body creation.\r\n * \r\n * This will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or call the\r\n * `setDisplaySize` method, which is the same thing as changing the scale but allows you\r\n * to do so by giving pixel values.\r\n * \r\n * If you have enabled this Game Object for input, changing the size will _not_ change the\r\n * size of the hit area. To do this you should adjust the `input.hitArea` object directly.\r\n * \r\n * @method Phaser.GameObjects.Components.Size#setSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setSize: function (width, height)\r\n {\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the display size of this Game Object.\r\n * \r\n * Calling this will adjust the scale.\r\n * \r\n * @method Phaser.GameObjects.Components.Size#setDisplaySize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setDisplaySize: function (width, height)\r\n {\r\n this.displayWidth = width;\r\n this.displayHeight = height;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Size;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/Size.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/Texture.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/Texture.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 8; // 1000\r\n\r\n/**\r\n * Provides methods used for getting and setting the texture of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Texture\r\n * @since 3.0.0\r\n */\r\n\r\nvar Texture = {\r\n\r\n /**\r\n * The Texture this Game Object is using to render with.\r\n *\r\n * @name Phaser.GameObjects.Components.Texture#texture\r\n * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture}\r\n * @since 3.0.0\r\n */\r\n texture: null,\r\n\r\n /**\r\n * The Texture Frame this Game Object is using to render with.\r\n *\r\n * @name Phaser.GameObjects.Components.Texture#frame\r\n * @type {Phaser.Textures.Frame}\r\n * @since 3.0.0\r\n */\r\n frame: null,\r\n\r\n /**\r\n * Internal flag. Not to be set by this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Texture#isCropped\r\n * @type {boolean}\r\n * @private\r\n * @since 3.11.0\r\n */\r\n isCropped: false,\r\n\r\n /**\r\n * Sets the texture and frame this Game Object will use to render with.\r\n *\r\n * Textures are referenced by their string-based keys, as stored in the Texture Manager.\r\n *\r\n * @method Phaser.GameObjects.Components.Texture#setTexture\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Textures.Texture)} key - The key of the texture to be used, as stored in the Texture Manager, or a Texture instance.\r\n * @param {(string|integer)} [frame] - The name or index of the frame within the Texture.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setTexture: function (key, frame)\r\n {\r\n this.texture = this.scene.sys.textures.get(key);\r\n\r\n return this.setFrame(frame);\r\n },\r\n\r\n /**\r\n * Sets the frame this Game Object will use to render with.\r\n *\r\n * The Frame has to belong to the current Texture being used.\r\n *\r\n * It can be either a string or an index.\r\n *\r\n * Calling `setFrame` will modify the `width` and `height` properties of your Game Object.\r\n * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer.\r\n *\r\n * @method Phaser.GameObjects.Components.Texture#setFrame\r\n * @since 3.0.0\r\n *\r\n * @param {(string|integer)} frame - The name or index of the frame within the Texture.\r\n * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object?\r\n * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object?\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setFrame: function (frame, updateSize, updateOrigin)\r\n {\r\n if (updateSize === undefined) { updateSize = true; }\r\n if (updateOrigin === undefined) { updateOrigin = true; }\r\n\r\n this.frame = this.texture.get(frame);\r\n\r\n if (!this.frame.cutWidth || !this.frame.cutHeight)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n\r\n if (this._sizeComponent && updateSize)\r\n {\r\n this.setSizeToFrame();\r\n }\r\n\r\n if (this._originComponent && updateOrigin)\r\n {\r\n if (this.frame.customPivot)\r\n {\r\n this.setOrigin(this.frame.pivotX, this.frame.pivotY);\r\n }\r\n else\r\n {\r\n this.updateDisplayOrigin();\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Texture;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/Texture.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/TextureCrop.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/TextureCrop.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 8; // 1000\r\n\r\n/**\r\n * Provides methods used for getting and setting the texture of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.TextureCrop\r\n * @since 3.0.0\r\n */\r\n\r\nvar TextureCrop = {\r\n\r\n /**\r\n * The Texture this Game Object is using to render with.\r\n *\r\n * @name Phaser.GameObjects.Components.TextureCrop#texture\r\n * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture}\r\n * @since 3.0.0\r\n */\r\n texture: null,\r\n\r\n /**\r\n * The Texture Frame this Game Object is using to render with.\r\n *\r\n * @name Phaser.GameObjects.Components.TextureCrop#frame\r\n * @type {Phaser.Textures.Frame}\r\n * @since 3.0.0\r\n */\r\n frame: null,\r\n\r\n /**\r\n * A boolean flag indicating if this Game Object is being cropped or not.\r\n * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off.\r\n * Equally, calling `setCrop` with no arguments will reset the crop and disable it.\r\n *\r\n * @name Phaser.GameObjects.Components.TextureCrop#isCropped\r\n * @type {boolean}\r\n * @since 3.11.0\r\n */\r\n isCropped: false,\r\n\r\n /**\r\n * Applies a crop to a texture based Game Object, such as a Sprite or Image.\r\n * \r\n * The crop is a rectangle that limits the area of the texture frame that is visible during rendering.\r\n * \r\n * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just\r\n * changes what is shown when rendered.\r\n * \r\n * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left.\r\n * \r\n * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left\r\n * half of it, you could call `setCrop(0, 0, 400, 600)`.\r\n * \r\n * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop\r\n * an area of 200x100 when applied to a Game Object that had a scale factor of 2.\r\n * \r\n * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument.\r\n * \r\n * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`.\r\n * \r\n * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow\r\n * the renderer to skip several internal calculations.\r\n *\r\n * @method Phaser.GameObjects.Components.TextureCrop#setCrop\r\n * @since 3.11.0\r\n *\r\n * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored.\r\n * @param {number} [y] - The y coordinate to start the crop from.\r\n * @param {number} [width] - The width of the crop rectangle in pixels.\r\n * @param {number} [height] - The height of the crop rectangle in pixels.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setCrop: function (x, y, width, height)\r\n {\r\n if (x === undefined)\r\n {\r\n this.isCropped = false;\r\n }\r\n else if (this.frame)\r\n {\r\n if (typeof x === 'number')\r\n {\r\n this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY);\r\n }\r\n else\r\n {\r\n var rect = x;\r\n\r\n this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY);\r\n }\r\n\r\n this.isCropped = true;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the texture and frame this Game Object will use to render with.\r\n *\r\n * Textures are referenced by their string-based keys, as stored in the Texture Manager.\r\n *\r\n * @method Phaser.GameObjects.Components.TextureCrop#setTexture\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the texture to be used, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - The name or index of the frame within the Texture.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setTexture: function (key, frame)\r\n {\r\n this.texture = this.scene.sys.textures.get(key);\r\n\r\n return this.setFrame(frame);\r\n },\r\n\r\n /**\r\n * Sets the frame this Game Object will use to render with.\r\n *\r\n * The Frame has to belong to the current Texture being used.\r\n *\r\n * It can be either a string or an index.\r\n *\r\n * Calling `setFrame` will modify the `width` and `height` properties of your Game Object.\r\n * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer.\r\n *\r\n * @method Phaser.GameObjects.Components.TextureCrop#setFrame\r\n * @since 3.0.0\r\n *\r\n * @param {(string|integer)} frame - The name or index of the frame within the Texture.\r\n * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object?\r\n * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object?\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setFrame: function (frame, updateSize, updateOrigin)\r\n {\r\n if (updateSize === undefined) { updateSize = true; }\r\n if (updateOrigin === undefined) { updateOrigin = true; }\r\n\r\n this.frame = this.texture.get(frame);\r\n\r\n if (!this.frame.cutWidth || !this.frame.cutHeight)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n\r\n if (this._sizeComponent && updateSize)\r\n {\r\n this.setSizeToFrame();\r\n }\r\n\r\n if (this._originComponent && updateOrigin)\r\n {\r\n if (this.frame.customPivot)\r\n {\r\n this.setOrigin(this.frame.pivotX, this.frame.pivotY);\r\n }\r\n else\r\n {\r\n this.updateDisplayOrigin();\r\n }\r\n }\r\n\r\n if (this.isCropped)\r\n {\r\n this.frame.updateCropUVs(this._crop, this.flipX, this.flipY);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal method that returns a blank, well-formed crop object for use by a Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.TextureCrop#resetCropObject\r\n * @private\r\n * @since 3.12.0\r\n * \r\n * @return {object} The crop object.\r\n */\r\n resetCropObject: function ()\r\n {\r\n return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 };\r\n }\r\n\r\n};\r\n\r\nmodule.exports = TextureCrop;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/TextureCrop.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/Tint.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/Tint.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @function GetColor\r\n * @since 3.0.0\r\n * @private\r\n */\r\nvar GetColor = function (value)\r\n{\r\n return (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);\r\n};\r\n\r\n/**\r\n * Provides methods used for setting the tint of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Tint\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n\r\nvar Tint = {\r\n\r\n /**\r\n * Private internal value. Holds the top-left tint value.\r\n * \r\n * @name Phaser.GameObjects.Components.Tint#_tintTL\r\n * @type {number}\r\n * @private\r\n * @default 16777215\r\n * @since 3.0.0\r\n */\r\n _tintTL: 16777215,\r\n\r\n /**\r\n * Private internal value. Holds the top-right tint value.\r\n * \r\n * @name Phaser.GameObjects.Components.Tint#_tintTR\r\n * @type {number}\r\n * @private\r\n * @default 16777215\r\n * @since 3.0.0\r\n */\r\n _tintTR: 16777215,\r\n\r\n /**\r\n * Private internal value. Holds the bottom-left tint value.\r\n * \r\n * @name Phaser.GameObjects.Components.Tint#_tintBL\r\n * @type {number}\r\n * @private\r\n * @default 16777215\r\n * @since 3.0.0\r\n */\r\n _tintBL: 16777215,\r\n\r\n /**\r\n * Private internal value. Holds the bottom-right tint value.\r\n * \r\n * @name Phaser.GameObjects.Components.Tint#_tintBR\r\n * @type {number}\r\n * @private\r\n * @default 16777215\r\n * @since 3.0.0\r\n */\r\n _tintBR: 16777215,\r\n\r\n /**\r\n * Private internal value. Holds if the Game Object is tinted or not.\r\n * \r\n * @name Phaser.GameObjects.Components.Tint#_isTinted\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.11.0\r\n */\r\n _isTinted: false,\r\n\r\n /**\r\n * Fill or additive?\r\n * \r\n * @name Phaser.GameObjects.Components.Tint#tintFill\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.11.0\r\n */\r\n tintFill: false,\r\n\r\n /**\r\n * Clears all tint values associated with this Game Object.\r\n * \r\n * Immediately sets the color values back to 0xffffff and the tint type to 'additive',\r\n * which results in no visible change to the texture.\r\n *\r\n * @method Phaser.GameObjects.Components.Tint#clearTint\r\n * @webglOnly\r\n * @since 3.0.0\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n clearTint: function ()\r\n {\r\n this.setTint(0xffffff);\r\n\r\n this._isTinted = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets an additive tint on this Game Object.\r\n * \r\n * The tint works by taking the pixel color values from the Game Objects texture, and then\r\n * multiplying it by the color value of the tint. You can provide either one color value,\r\n * in which case the whole Game Object will be tinted in that color. Or you can provide a color\r\n * per corner. The colors are blended together across the extent of the Game Object.\r\n * \r\n * To modify the tint color once set, either call this method again with new values or use the\r\n * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight,\r\n * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently.\r\n * \r\n * To remove a tint call `clearTint`.\r\n * \r\n * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`.\r\n *\r\n * @method Phaser.GameObjects.Components.Tint#setTint\r\n * @webglOnly\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object.\r\n * @param {integer} [topRight] - The tint being applied to the top-right of the Game Object.\r\n * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the Game Object.\r\n * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setTint: function (topLeft, topRight, bottomLeft, bottomRight)\r\n {\r\n if (topLeft === undefined) { topLeft = 0xffffff; }\r\n\r\n if (topRight === undefined)\r\n {\r\n topRight = topLeft;\r\n bottomLeft = topLeft;\r\n bottomRight = topLeft;\r\n }\r\n\r\n this._tintTL = GetColor(topLeft);\r\n this._tintTR = GetColor(topRight);\r\n this._tintBL = GetColor(bottomLeft);\r\n this._tintBR = GetColor(bottomRight);\r\n\r\n this._isTinted = true;\r\n\r\n this.tintFill = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a fill-based tint on this Game Object.\r\n * \r\n * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture\r\n * with those in the tint. You can use this for effects such as making a player flash 'white'\r\n * if hit by something. You can provide either one color value, in which case the whole\r\n * Game Object will be rendered in that color. Or you can provide a color per corner. The colors\r\n * are blended together across the extent of the Game Object.\r\n * \r\n * To modify the tint color once set, either call this method again with new values or use the\r\n * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight,\r\n * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently.\r\n * \r\n * To remove a tint call `clearTint`.\r\n * \r\n * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`.\r\n *\r\n * @method Phaser.GameObjects.Components.Tint#setTintFill\r\n * @webglOnly\r\n * @since 3.11.0\r\n *\r\n * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object.\r\n * @param {integer} [topRight] - The tint being applied to the top-right of the Game Object.\r\n * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the Game Object.\r\n * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setTintFill: function (topLeft, topRight, bottomLeft, bottomRight)\r\n {\r\n this.setTint(topLeft, topRight, bottomLeft, bottomRight);\r\n\r\n this.tintFill = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The tint value being applied to the top-left of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n * \r\n * @name Phaser.GameObjects.Components.Tint#tintTopLeft\r\n * @type {integer}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n tintTopLeft: {\r\n\r\n get: function ()\r\n {\r\n return this._tintTL;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._tintTL = GetColor(value);\r\n this._isTinted = true;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The tint value being applied to the top-right of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n * \r\n * @name Phaser.GameObjects.Components.Tint#tintTopRight\r\n * @type {integer}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n tintTopRight: {\r\n\r\n get: function ()\r\n {\r\n return this._tintTR;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._tintTR = GetColor(value);\r\n this._isTinted = true;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The tint value being applied to the bottom-left of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n * \r\n * @name Phaser.GameObjects.Components.Tint#tintBottomLeft\r\n * @type {integer}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n tintBottomLeft: {\r\n\r\n get: function ()\r\n {\r\n return this._tintBL;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._tintBL = GetColor(value);\r\n this._isTinted = true;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The tint value being applied to the bottom-right of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n * \r\n * @name Phaser.GameObjects.Components.Tint#tintBottomRight\r\n * @type {integer}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n tintBottomRight: {\r\n\r\n get: function ()\r\n {\r\n return this._tintBR;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._tintBR = GetColor(value);\r\n this._isTinted = true;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The tint value being applied to the whole of the Game Object.\r\n * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.\r\n * \r\n * @name Phaser.GameObjects.Components.Tint#tint\r\n * @type {integer}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n tint: {\r\n\r\n set: function (value)\r\n {\r\n this.setTint(value, value, value, value);\r\n }\r\n },\r\n\r\n /**\r\n * Does this Game Object have a tint applied to it or not?\r\n * \r\n * @name Phaser.GameObjects.Components.Tint#isTinted\r\n * @type {boolean}\r\n * @webglOnly\r\n * @readonly\r\n * @since 3.11.0\r\n */\r\n isTinted: {\r\n\r\n get: function ()\r\n {\r\n return this._isTinted;\r\n }\r\n\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Tint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/Tint.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/ToJSON.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/ToJSON.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Build a JSON representation of the given Game Object.\r\n *\r\n * This is typically extended further by Game Object specific implementations.\r\n *\r\n * @method Phaser.GameObjects.Components.ToJSON\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON.\r\n *\r\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object.\r\n */\r\nvar ToJSON = function (gameObject)\r\n{\r\n var out = {\r\n name: gameObject.name,\r\n type: gameObject.type,\r\n x: gameObject.x,\r\n y: gameObject.y,\r\n depth: gameObject.depth,\r\n scale: {\r\n x: gameObject.scaleX,\r\n y: gameObject.scaleY\r\n },\r\n origin: {\r\n x: gameObject.originX,\r\n y: gameObject.originY\r\n },\r\n flipX: gameObject.flipX,\r\n flipY: gameObject.flipY,\r\n rotation: gameObject.rotation,\r\n alpha: gameObject.alpha,\r\n visible: gameObject.visible,\r\n blendMode: gameObject.blendMode,\r\n textureKey: '',\r\n frameKey: '',\r\n data: {}\r\n };\r\n\r\n if (gameObject.texture)\r\n {\r\n out.textureKey = gameObject.texture.key;\r\n out.frameKey = gameObject.frame.name;\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = ToJSON;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/ToJSON.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/Transform.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/Transform.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\nvar TransformMatrix = __webpack_require__(/*! ./TransformMatrix */ \"./node_modules/phaser/src/gameobjects/components/TransformMatrix.js\");\r\nvar WrapAngle = __webpack_require__(/*! ../../math/angle/Wrap */ \"./node_modules/phaser/src/math/angle/Wrap.js\");\r\nvar WrapAngleDegrees = __webpack_require__(/*! ../../math/angle/WrapDegrees */ \"./node_modules/phaser/src/math/angle/WrapDegrees.js\");\r\n\r\n// global bitmask flag for GameObject.renderMask (used by Scale)\r\nvar _FLAG = 4; // 0100\r\n\r\n/**\r\n * Provides methods used for getting and setting the position, scale and rotation of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Transform\r\n * @since 3.0.0\r\n */\r\n\r\nvar Transform = {\r\n\r\n /**\r\n * Private internal value. Holds the horizontal scale value.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#_scaleX\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _scaleX: 1,\r\n\r\n /**\r\n * Private internal value. Holds the vertical scale value.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#_scaleY\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _scaleY: 1,\r\n\r\n /**\r\n * Private internal value. Holds the rotation value in radians.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#_rotation\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n _rotation: 0,\r\n\r\n /**\r\n * The x position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n x: 0,\r\n\r\n /**\r\n * The y position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n y: 0,\r\n\r\n /**\r\n * The z position of this Game Object.\r\n *\r\n * Note: The z position does not control the rendering order of 2D Game Objects. Use\r\n * {@link Phaser.GameObjects.Components.Depth#depth} instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n z: 0,\r\n\r\n /**\r\n * The w position of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#w\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n w: 0,\r\n\r\n /**\r\n * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object\r\n * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`.\r\n *\r\n * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this\r\n * isn't the case, use the `scaleX` or `scaleY` properties instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#scale\r\n * @type {number}\r\n * @default 1\r\n * @since 3.18.0\r\n */\r\n scale: {\r\n\r\n get: function ()\r\n {\r\n return (this._scaleX + this._scaleY) / 2;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleX = value;\r\n this._scaleY = value;\r\n\r\n if (value === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The horizontal scale of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#scaleX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleX;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleX = value;\r\n\r\n if (value === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical scale of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#scaleY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleY;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleY = value;\r\n\r\n if (value === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The angle of this Game Object as expressed in degrees.\r\n *\r\n * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left\r\n * and -90 is up.\r\n *\r\n * If you prefer to work in radians, see the `rotation` property instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#angle\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n angle: {\r\n\r\n get: function ()\r\n {\r\n return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG);\r\n },\r\n\r\n set: function (value)\r\n {\r\n // value is in degrees\r\n this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD;\r\n }\r\n },\r\n\r\n /**\r\n * The angle of this Game Object in radians.\r\n *\r\n * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left\r\n * and -90 is up.\r\n *\r\n * If you prefer to work in degrees, see the `angle` property instead.\r\n *\r\n * @name Phaser.GameObjects.Components.Transform#rotation\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n rotation: {\r\n\r\n get: function ()\r\n {\r\n return this._rotation;\r\n },\r\n\r\n set: function (value)\r\n {\r\n // value is in radians\r\n this._rotation = WrapAngle(value);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setPosition\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The x position of this Game Object.\r\n * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value.\r\n * @param {number} [z=0] - The z position of this Game Object.\r\n * @param {number} [w=0] - The w position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setPosition: function (x, y, z, w)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = x; }\r\n if (z === undefined) { z = 0; }\r\n if (w === undefined) { w = 0; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n this.w = w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the position of this Game Object to be a random position within the confines of\r\n * the given area.\r\n *\r\n * If no area is specified a random position between 0 x 0 and the game width x height is used instead.\r\n *\r\n * The position does not factor in the size of this Game Object, meaning that only the origin is\r\n * guaranteed to be within the area.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setRandomPosition\r\n * @since 3.8.0\r\n *\r\n * @param {number} [x=0] - The x position of the top-left of the random area.\r\n * @param {number} [y=0] - The y position of the top-left of the random area.\r\n * @param {number} [width] - The width of the random area.\r\n * @param {number} [height] - The height of the random area.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setRandomPosition: function (x, y, width, height)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = this.scene.sys.scale.width; }\r\n if (height === undefined) { height = this.scene.sys.scale.height; }\r\n\r\n this.x = x + (Math.random() * width);\r\n this.y = y + (Math.random() * height);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the rotation of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setRotation\r\n * @since 3.0.0\r\n *\r\n * @param {number} [radians=0] - The rotation of this Game Object, in radians.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setRotation: function (radians)\r\n {\r\n if (radians === undefined) { radians = 0; }\r\n\r\n this.rotation = radians;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the angle of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setAngle\r\n * @since 3.0.0\r\n *\r\n * @param {number} [degrees=0] - The rotation of this Game Object, in degrees.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setAngle: function (degrees)\r\n {\r\n if (degrees === undefined) { degrees = 0; }\r\n\r\n this.angle = degrees;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the scale of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setScale\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scale of this Game Object.\r\n * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setScale: function (x, y)\r\n {\r\n if (x === undefined) { x = 1; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.scaleX = x;\r\n this.scaleY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the x position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setX\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The x position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setX: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.x = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the y position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setY\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The y position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setY: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.y = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the z position of this Game Object.\r\n *\r\n * Note: The z position does not control the rendering order of 2D Game Objects. Use\r\n * {@link Phaser.GameObjects.Components.Depth#setDepth} instead.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The z position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setZ: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.z = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the w position of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#setW\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=0] - The w position of this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setW: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.w = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the local transform matrix for this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object.\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix.\r\n */\r\n getLocalTransformMatrix: function (tempMatrix)\r\n {\r\n if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); }\r\n\r\n return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);\r\n },\r\n\r\n /**\r\n * Gets the world transform matrix for this Game Object, factoring in any parent Containers.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations.\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix.\r\n */\r\n getWorldTransformMatrix: function (tempMatrix, parentMatrix)\r\n {\r\n if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); }\r\n if (parentMatrix === undefined) { parentMatrix = new TransformMatrix(); }\r\n\r\n var parent = this.parentContainer;\r\n\r\n if (!parent)\r\n {\r\n return this.getLocalTransformMatrix(tempMatrix);\r\n }\r\n\r\n tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);\r\n\r\n while (parent)\r\n {\r\n parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY);\r\n\r\n parentMatrix.multiply(tempMatrix, tempMatrix);\r\n\r\n parent = parent.parentContainer;\r\n }\r\n\r\n return tempMatrix;\r\n },\r\n\r\n /**\r\n * Gets the sum total rotation of all of this Game Objects parent Containers.\r\n *\r\n * The returned value is in radians and will be zero if this Game Object has no parent container.\r\n *\r\n * @method Phaser.GameObjects.Components.Transform#getParentRotation\r\n * @since 3.18.0\r\n *\r\n * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object.\r\n */\r\n getParentRotation: function ()\r\n {\r\n var rotation = 0;\r\n\r\n var parent = this.parentContainer;\r\n\r\n while (parent)\r\n {\r\n rotation += parent.rotation;\r\n\r\n parent = parent.parentContainer;\r\n }\r\n\r\n return rotation;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Transform;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/Transform.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/TransformMatrix.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/TransformMatrix.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Matrix used for display transformations for rendering.\r\n *\r\n * It is represented like so:\r\n *\r\n * ```\r\n * | a | c | tx |\r\n * | b | d | ty |\r\n * | 0 | 0 | 1 |\r\n * ```\r\n *\r\n * @class TransformMatrix\r\n * @memberof Phaser.GameObjects.Components\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [a=1] - The Scale X value.\r\n * @param {number} [b=0] - The Skew Y value.\r\n * @param {number} [c=0] - The Skew X value.\r\n * @param {number} [d=1] - The Scale Y value.\r\n * @param {number} [tx=0] - The Translate X value.\r\n * @param {number} [ty=0] - The Translate Y value.\r\n */\r\nvar TransformMatrix = new Class({\r\n\r\n initialize:\r\n\r\n function TransformMatrix (a, b, c, d, tx, ty)\r\n {\r\n if (a === undefined) { a = 1; }\r\n if (b === undefined) { b = 0; }\r\n if (c === undefined) { c = 0; }\r\n if (d === undefined) { d = 1; }\r\n if (tx === undefined) { tx = 0; }\r\n if (ty === undefined) { ty = 0; }\r\n\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#matrix\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]);\r\n\r\n /**\r\n * The decomposed matrix.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.decomposedMatrix = {\r\n translateX: 0,\r\n translateY: 0,\r\n scaleX: 1,\r\n scaleY: 1,\r\n rotation: 0\r\n };\r\n },\r\n\r\n /**\r\n * The Scale X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#a\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n a: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[0];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[0] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Skew Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#b\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n b: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[1];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[1] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Skew X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#c\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n c: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[2];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[2] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Scale Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#d\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n d: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[3];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[3] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#e\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n e: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[4];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[4] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#f\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n f: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[5];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[5] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#tx\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n tx: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[4];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[4] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#ty\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n ty: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[5];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[5] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The rotation of the Matrix. Value is in radians.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#rotation\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n rotation: {\r\n\r\n get: function ()\r\n {\r\n return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The rotation of the Matrix, normalized to be within the Phaser right-handed\r\n * clockwise rotation space. Value is in radians.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#rotationNormalized\r\n * @type {number}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n rotationNormalized: {\r\n\r\n get: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n if (a || b)\r\n {\r\n // var r = Math.sqrt(a * a + b * b);\r\n \r\n return (b > 0) ? Math.acos(a / this.scaleX) : -Math.acos(a / this.scaleX);\r\n }\r\n else if (c || d)\r\n {\r\n // var s = Math.sqrt(c * c + d * d);\r\n \r\n return MATH_CONST.TAU - ((d > 0) ? Math.acos(-c / this.scaleY) : -Math.acos(c / this.scaleY));\r\n }\r\n else\r\n {\r\n return 0;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The decomposed horizontal scale of the Matrix. This value is always positive.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#scaleX\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return Math.sqrt((this.a * this.a) + (this.b * this.b));\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The decomposed vertical scale of the Matrix. This value is always positive.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#scaleY\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return Math.sqrt((this.c * this.c) + (this.d * this.d));\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Reset the Matrix to an identity matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity\r\n * @since 3.0.0\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n loadIdentity: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = 1;\r\n matrix[1] = 0;\r\n matrix[2] = 0;\r\n matrix[3] = 1;\r\n matrix[4] = 0;\r\n matrix[5] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#translate\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal translation value.\r\n * @param {number} y - The vertical translation value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n translate: function (x, y)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[4] = matrix[0] * x + matrix[2] * y + matrix[4];\r\n matrix[5] = matrix[1] * x + matrix[3] * y + matrix[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scale value.\r\n * @param {number} y - The vertical scale value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n scale: function (x, y)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] *= x;\r\n matrix[1] *= x;\r\n matrix[2] *= y;\r\n matrix[3] *= y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle of rotation in radians.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n rotate: function (angle)\r\n {\r\n var sin = Math.sin(angle);\r\n var cos = Math.cos(angle);\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n matrix[0] = a * cos + c * sin;\r\n matrix[1] = b * cos + d * sin;\r\n matrix[2] = a * -sin + c * cos;\r\n matrix[3] = b * -sin + d * cos;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n * \r\n * If an `out` Matrix is given then the results will be stored in it.\r\n * If it is not given, this matrix will be updated in place instead.\r\n * Use an `out` Matrix if you do not wish to mutate this matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} rhs - The Matrix to multiply by.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [out] - An optional Matrix to store the results in.\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} Either this TransformMatrix, or the `out` Matrix, if given in the arguments.\r\n */\r\n multiply: function (rhs, out)\r\n {\r\n var matrix = this.matrix;\r\n var source = rhs.matrix;\r\n\r\n var localA = matrix[0];\r\n var localB = matrix[1];\r\n var localC = matrix[2];\r\n var localD = matrix[3];\r\n var localE = matrix[4];\r\n var localF = matrix[5];\r\n\r\n var sourceA = source[0];\r\n var sourceB = source[1];\r\n var sourceC = source[2];\r\n var sourceD = source[3];\r\n var sourceE = source[4];\r\n var sourceF = source[5];\r\n\r\n var destinationMatrix = (out === undefined) ? this : out;\r\n\r\n destinationMatrix.a = (sourceA * localA) + (sourceB * localC);\r\n destinationMatrix.b = (sourceA * localB) + (sourceB * localD);\r\n destinationMatrix.c = (sourceC * localA) + (sourceD * localC);\r\n destinationMatrix.d = (sourceC * localB) + (sourceD * localD);\r\n destinationMatrix.e = (sourceE * localA) + (sourceF * localC) + localE;\r\n destinationMatrix.f = (sourceE * localB) + (sourceF * localD) + localF;\r\n\r\n return destinationMatrix;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the matrix given, including the offset.\r\n * \r\n * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`.\r\n * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#multiplyWithOffset\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from.\r\n * @param {number} offsetX - Horizontal offset to factor in to the multiplication.\r\n * @param {number} offsetY - Vertical offset to factor in to the multiplication.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n multiplyWithOffset: function (src, offsetX, offsetY)\r\n {\r\n var matrix = this.matrix;\r\n var otherMatrix = src.matrix;\r\n\r\n var a0 = matrix[0];\r\n var b0 = matrix[1];\r\n var c0 = matrix[2];\r\n var d0 = matrix[3];\r\n var tx0 = matrix[4];\r\n var ty0 = matrix[5];\r\n\r\n var pse = offsetX * a0 + offsetY * c0 + tx0;\r\n var psf = offsetX * b0 + offsetY * d0 + ty0;\r\n\r\n var a1 = otherMatrix[0];\r\n var b1 = otherMatrix[1];\r\n var c1 = otherMatrix[2];\r\n var d1 = otherMatrix[3];\r\n var tx1 = otherMatrix[4];\r\n var ty1 = otherMatrix[5];\r\n\r\n matrix[0] = a1 * a0 + b1 * c0;\r\n matrix[1] = a1 * b0 + b1 * d0;\r\n matrix[2] = c1 * a0 + d1 * c0;\r\n matrix[3] = c1 * b0 + d1 * d0;\r\n matrix[4] = tx1 * a0 + ty1 * c0 + pse;\r\n matrix[5] = tx1 * b0 + ty1 * d0 + psf;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#transform\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The Scale X value.\r\n * @param {number} b - The Shear Y value.\r\n * @param {number} c - The Shear X value.\r\n * @param {number} d - The Scale Y value.\r\n * @param {number} tx - The Translate X value.\r\n * @param {number} ty - The Translate Y value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n transform: function (a, b, c, d, tx, ty)\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a0 = matrix[0];\r\n var b0 = matrix[1];\r\n var c0 = matrix[2];\r\n var d0 = matrix[3];\r\n var tx0 = matrix[4];\r\n var ty0 = matrix[5];\r\n\r\n matrix[0] = a * a0 + b * c0;\r\n matrix[1] = a * b0 + b * d0;\r\n matrix[2] = c * a0 + d * c0;\r\n matrix[3] = c * b0 + d * d0;\r\n matrix[4] = tx * a0 + ty * c0 + tx0;\r\n matrix[5] = tx * b0 + ty * d0 + ty0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform a point using this Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the point to transform.\r\n * @param {number} y - The y coordinate of the point to transform.\r\n * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates.\r\n *\r\n * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} The Point containing the transformed coordinates.\r\n */\r\n transformPoint: function (x, y, point)\r\n {\r\n if (point === undefined) { point = { x: 0, y: 0 }; }\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n point.x = x * a + y * c + tx;\r\n point.y = x * b + y * d + ty;\r\n\r\n return point;\r\n },\r\n\r\n /**\r\n * Invert the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#invert\r\n * @since 3.0.0\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n invert: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n var n = a * d - b * c;\r\n\r\n matrix[0] = d / n;\r\n matrix[1] = -b / n;\r\n matrix[2] = -c / n;\r\n matrix[3] = a / n;\r\n matrix[4] = (c * ty - d * tx) / n;\r\n matrix[5] = -(a * ty - b * tx) / n;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix to copy those of the matrix given.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyFrom\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n copyFrom: function (src)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = src.a;\r\n matrix[1] = src.b;\r\n matrix[2] = src.c;\r\n matrix[3] = src.d;\r\n matrix[4] = src.e;\r\n matrix[5] = src.f;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix to copy those of the array given.\r\n * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyFromArray\r\n * @since 3.11.0\r\n *\r\n * @param {array} src - The array of values to set into this matrix.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n copyFromArray: function (src)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = src[0];\r\n matrix[1] = src[1];\r\n matrix[2] = src[2];\r\n matrix[3] = src[3];\r\n matrix[4] = src[4];\r\n matrix[5] = src[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Copy the values from this Matrix to the given Canvas Rendering Context.\r\n * This will use the Context.transform method.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyToContext\r\n * @since 3.12.0\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to.\r\n *\r\n * @return {CanvasRenderingContext2D} The Canvas Rendering Context.\r\n */\r\n copyToContext: function (ctx)\r\n {\r\n var matrix = this.matrix;\r\n\r\n ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\r\n\r\n return ctx;\r\n },\r\n\r\n /**\r\n * Copy the values from this Matrix to the given Canvas Rendering Context.\r\n * This will use the Context.setTransform method.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#setToContext\r\n * @since 3.12.0\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to.\r\n *\r\n * @return {CanvasRenderingContext2D} The Canvas Rendering Context.\r\n */\r\n setToContext: function (ctx)\r\n {\r\n var matrix = this.matrix;\r\n\r\n ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\r\n\r\n return ctx;\r\n },\r\n\r\n /**\r\n * Copy the values in this Matrix to the array given.\r\n * \r\n * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray\r\n * @since 3.12.0\r\n *\r\n * @param {array} [out] - The array to copy the matrix values in to.\r\n *\r\n * @return {array} An array where elements 0 to 5 contain the values from this matrix.\r\n */\r\n copyToArray: function (out)\r\n {\r\n var matrix = this.matrix;\r\n\r\n if (out === undefined)\r\n {\r\n out = [ matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] ];\r\n }\r\n else\r\n {\r\n out[0] = matrix[0];\r\n out[1] = matrix[1];\r\n out[2] = matrix[2];\r\n out[3] = matrix[3];\r\n out[4] = matrix[4];\r\n out[5] = matrix[5];\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#setTransform\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The Scale X value.\r\n * @param {number} b - The Shear Y value.\r\n * @param {number} c - The Shear X value.\r\n * @param {number} d - The Scale Y value.\r\n * @param {number} tx - The Translate X value.\r\n * @param {number} ty - The Translate Y value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n setTransform: function (a, b, c, d, tx, ty)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = a;\r\n matrix[1] = b;\r\n matrix[2] = c;\r\n matrix[3] = d;\r\n matrix[4] = tx;\r\n matrix[5] = ty;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Decompose this Matrix into its translation, scale and rotation values using QR decomposition.\r\n * \r\n * The result must be applied in the following order to reproduce the current matrix:\r\n * \r\n * translate -> rotate -> scale\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix\r\n * @since 3.0.0\r\n *\r\n * @return {object} The decomposed Matrix.\r\n */\r\n decomposeMatrix: function ()\r\n {\r\n var decomposedMatrix = this.decomposedMatrix;\r\n\r\n var matrix = this.matrix;\r\n\r\n // a = scale X (1)\r\n // b = shear Y (0)\r\n // c = shear X (0)\r\n // d = scale Y (1)\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n var determ = a * d - b * c;\r\n\r\n decomposedMatrix.translateX = matrix[4];\r\n decomposedMatrix.translateY = matrix[5];\r\n\r\n if (a || b)\r\n {\r\n var r = Math.sqrt(a * a + b * b);\r\n\r\n decomposedMatrix.rotation = (b > 0) ? Math.acos(a / r) : -Math.acos(a / r);\r\n decomposedMatrix.scaleX = r;\r\n decomposedMatrix.scaleY = determ / r;\r\n }\r\n else if (c || d)\r\n {\r\n var s = Math.sqrt(c * c + d * d);\r\n\r\n decomposedMatrix.rotation = Math.PI * 0.5 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s));\r\n decomposedMatrix.scaleX = determ / s;\r\n decomposedMatrix.scaleY = s;\r\n }\r\n else\r\n {\r\n decomposedMatrix.rotation = 0;\r\n decomposedMatrix.scaleX = 0;\r\n decomposedMatrix.scaleY = 0;\r\n }\r\n\r\n return decomposedMatrix;\r\n },\r\n\r\n /**\r\n * Apply the identity, translate, rotate and scale operations on the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#applyITRS\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal translation.\r\n * @param {number} y - The vertical translation.\r\n * @param {number} rotation - The angle of rotation in radians.\r\n * @param {number} scaleX - The horizontal scale.\r\n * @param {number} scaleY - The vertical scale.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n applyITRS: function (x, y, rotation, scaleX, scaleY)\r\n {\r\n var matrix = this.matrix;\r\n\r\n var radianSin = Math.sin(rotation);\r\n var radianCos = Math.cos(rotation);\r\n\r\n // Translate\r\n matrix[4] = x;\r\n matrix[5] = y;\r\n\r\n // Rotate and Scale\r\n matrix[0] = radianCos * scaleX;\r\n matrix[1] = radianSin * scaleX;\r\n matrix[2] = -radianSin * scaleY;\r\n matrix[3] = radianCos * scaleY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of\r\n * the current matrix with its transformation applied.\r\n * \r\n * Can be used to translate points from world to local space.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse\r\n * @since 3.12.0\r\n *\r\n * @param {number} x - The x position to translate.\r\n * @param {number} y - The y position to translate.\r\n * @param {Phaser.Math.Vector2} [output] - A Vector2, or point-like object, to store the results in.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates, inverse-transformed through this matrix.\r\n */\r\n applyInverse: function (x, y, output)\r\n {\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n var id = 1 / ((a * d) + (c * -b));\r\n\r\n output.x = (d * id * x) + (-c * id * y) + (((ty * c) - (tx * d)) * id);\r\n output.y = (a * id * y) + (-b * id * x) + (((-ty * a) + (tx * b)) * id);\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns the X component of this matrix multiplied by the given values.\r\n * This is the same as `x * a + y * c + e`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getX\r\n * @since 3.12.0\r\n * \r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n *\r\n * @return {number} The calculated x value.\r\n */\r\n getX: function (x, y)\r\n {\r\n return x * this.a + y * this.c + this.e;\r\n },\r\n\r\n /**\r\n * Returns the Y component of this matrix multiplied by the given values.\r\n * This is the same as `x * b + y * d + f`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getY\r\n * @since 3.12.0\r\n * \r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n *\r\n * @return {number} The calculated y value.\r\n */\r\n getY: function (x, y)\r\n {\r\n return x * this.b + y * this.d + this.f;\r\n },\r\n\r\n /**\r\n * Returns a string that can be used in a CSS Transform call as a `matrix` property.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix\r\n * @since 3.12.0\r\n *\r\n * @return {string} A string containing the CSS Transform matrix values.\r\n */\r\n getCSSMatrix: function ()\r\n {\r\n var m = this.matrix;\r\n\r\n return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')';\r\n },\r\n\r\n /**\r\n * Destroys this Transform Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#destroy\r\n * @since 3.4.0\r\n */\r\n destroy: function ()\r\n {\r\n this.matrix = null;\r\n this.decomposedMatrix = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = TransformMatrix;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/TransformMatrix.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/Visible.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/Visible.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 1; // 0001\r\n\r\n/**\r\n * Provides methods used for setting the visibility of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Visible\r\n * @since 3.0.0\r\n */\r\n\r\nvar Visible = {\r\n\r\n /**\r\n * Private internal value. Holds the visible value.\r\n * \r\n * @name Phaser.GameObjects.Components.Visible#_visible\r\n * @type {boolean}\r\n * @private\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n _visible: true,\r\n\r\n /**\r\n * The visible state of the Game Object.\r\n * \r\n * An invisible Game Object will skip rendering, but will still process update logic.\r\n * \r\n * @name Phaser.GameObjects.Components.Visible#visible\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n visible: {\r\n\r\n get: function ()\r\n {\r\n return this._visible;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (value)\r\n {\r\n this._visible = true;\r\n this.renderFlags |= _FLAG;\r\n }\r\n else\r\n {\r\n this._visible = false;\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the visibility of this Game Object.\r\n * \r\n * An invisible Game Object will skip rendering, but will still process update logic.\r\n *\r\n * @method Phaser.GameObjects.Components.Visible#setVisible\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The visible state of the Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setVisible: function (value)\r\n {\r\n this.visible = value;\r\n\r\n return this;\r\n }\r\n};\r\n\r\nmodule.exports = Visible;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/Visible.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/components/index.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/components/index.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.GameObjects.Components\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Alpha: __webpack_require__(/*! ./Alpha */ \"./node_modules/phaser/src/gameobjects/components/Alpha.js\"),\r\n AlphaSingle: __webpack_require__(/*! ./AlphaSingle */ \"./node_modules/phaser/src/gameobjects/components/AlphaSingle.js\"),\r\n Animation: __webpack_require__(/*! ./Animation */ \"./node_modules/phaser/src/gameobjects/components/Animation.js\"),\r\n BlendMode: __webpack_require__(/*! ./BlendMode */ \"./node_modules/phaser/src/gameobjects/components/BlendMode.js\"),\r\n ComputedSize: __webpack_require__(/*! ./ComputedSize */ \"./node_modules/phaser/src/gameobjects/components/ComputedSize.js\"),\r\n Crop: __webpack_require__(/*! ./Crop */ \"./node_modules/phaser/src/gameobjects/components/Crop.js\"),\r\n Depth: __webpack_require__(/*! ./Depth */ \"./node_modules/phaser/src/gameobjects/components/Depth.js\"),\r\n Flip: __webpack_require__(/*! ./Flip */ \"./node_modules/phaser/src/gameobjects/components/Flip.js\"),\r\n GetBounds: __webpack_require__(/*! ./GetBounds */ \"./node_modules/phaser/src/gameobjects/components/GetBounds.js\"),\r\n Mask: __webpack_require__(/*! ./Mask */ \"./node_modules/phaser/src/gameobjects/components/Mask.js\"),\r\n Origin: __webpack_require__(/*! ./Origin */ \"./node_modules/phaser/src/gameobjects/components/Origin.js\"),\r\n PathFollower: __webpack_require__(/*! ./PathFollower */ \"./node_modules/phaser/src/gameobjects/components/PathFollower.js\"),\r\n Pipeline: __webpack_require__(/*! ./Pipeline */ \"./node_modules/phaser/src/gameobjects/components/Pipeline.js\"),\r\n ScrollFactor: __webpack_require__(/*! ./ScrollFactor */ \"./node_modules/phaser/src/gameobjects/components/ScrollFactor.js\"),\r\n Size: __webpack_require__(/*! ./Size */ \"./node_modules/phaser/src/gameobjects/components/Size.js\"),\r\n Texture: __webpack_require__(/*! ./Texture */ \"./node_modules/phaser/src/gameobjects/components/Texture.js\"),\r\n TextureCrop: __webpack_require__(/*! ./TextureCrop */ \"./node_modules/phaser/src/gameobjects/components/TextureCrop.js\"),\r\n Tint: __webpack_require__(/*! ./Tint */ \"./node_modules/phaser/src/gameobjects/components/Tint.js\"),\r\n ToJSON: __webpack_require__(/*! ./ToJSON */ \"./node_modules/phaser/src/gameobjects/components/ToJSON.js\"),\r\n Transform: __webpack_require__(/*! ./Transform */ \"./node_modules/phaser/src/gameobjects/components/Transform.js\"),\r\n TransformMatrix: __webpack_require__(/*! ./TransformMatrix */ \"./node_modules/phaser/src/gameobjects/components/TransformMatrix.js\"),\r\n Visible: __webpack_require__(/*! ./Visible */ \"./node_modules/phaser/src/gameobjects/components/Visible.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/components/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/container/Container.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/container/Container.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ArrayUtils = __webpack_require__(/*! ../../utils/array */ \"./node_modules/phaser/src/utils/array/index.js\");\r\nvar BlendModes = __webpack_require__(/*! ../../renderer/BlendModes */ \"./node_modules/phaser/src/renderer/BlendModes.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/gameobjects/events/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar Rectangle = __webpack_require__(/*! ../../geom/rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar Render = __webpack_require__(/*! ./ContainerRender */ \"./node_modules/phaser/src/gameobjects/container/ContainerRender.js\");\r\nvar Union = __webpack_require__(/*! ../../geom/rectangle/Union */ \"./node_modules/phaser/src/geom/rectangle/Union.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Container Game Object.\r\n *\r\n * A Container, as the name implies, can 'contain' other types of Game Object.\r\n * When a Game Object is added to a Container, the Container becomes responsible for the rendering of it.\r\n * By default it will be removed from the Display List and instead added to the Containers own internal list.\r\n *\r\n * The position of the Game Object automatically becomes relative to the position of the Container.\r\n *\r\n * When the Container is rendered, all of its children are rendered as well, in the order in which they exist\r\n * within the Container. Container children can be repositioned using methods such as `MoveUp`, `MoveDown` and `SendToBack`.\r\n *\r\n * If you modify a transform property of the Container, such as `Container.x` or `Container.rotation` then it will\r\n * automatically influence all children as well.\r\n *\r\n * Containers can include other Containers for deeply nested transforms.\r\n *\r\n * Containers can have masks set on them and can be used as a mask too. However, Container children cannot be masked.\r\n * The masks do not 'stack up'. Only a Container on the root of the display list will use its mask.\r\n *\r\n * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them\r\n * to use as their hit area. Container children can also be enabled for input, independent of the Container.\r\n *\r\n * Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However,\r\n * if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies,\r\n * if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children\r\n * with physics do not factor in the Container due to the excessive extra calculations needed. Please structure\r\n * your game to work around this.\r\n *\r\n * It's important to understand the impact of using Containers. They add additional processing overhead into\r\n * every one of their children. The deeper you nest them, the more the cost escalates. This is especially true\r\n * for input events. You also loose the ability to set the display depth of Container children in the same\r\n * flexible manner as those not within them. In short, don't use them for the sake of it. You pay a small cost\r\n * every time you create one, try to structure your game around avoiding that where possible.\r\n *\r\n * @class Container\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.4.0\r\n *\r\n * @extends Phaser.GameObjects.Components.AlphaSingle\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.ComputedSize\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to this Container.\r\n */\r\nvar Container = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.AlphaSingle,\r\n Components.BlendMode,\r\n Components.ComputedSize,\r\n Components.Depth,\r\n Components.Mask,\r\n Components.Transform,\r\n Components.Visible,\r\n Render\r\n ],\r\n\r\n initialize:\r\n\r\n function Container (scene, x, y, children)\r\n {\r\n GameObject.call(this, scene, 'Container');\r\n\r\n /**\r\n * An array holding the children of this Container.\r\n *\r\n * @name Phaser.GameObjects.Container#list\r\n * @type {Phaser.GameObjects.GameObject[]}\r\n * @since 3.4.0\r\n */\r\n this.list = [];\r\n\r\n /**\r\n * Does this Container exclusively manage its children?\r\n *\r\n * The default is `true` which means a child added to this Container cannot\r\n * belong in another Container, which includes the Scene display list.\r\n *\r\n * If you disable this then this Container will no longer exclusively manage its children.\r\n * This allows you to create all kinds of interesting graphical effects, such as replicating\r\n * Game Objects without reparenting them all over the Scene.\r\n * However, doing so will prevent children from receiving any kind of input event or have\r\n * their physics bodies work by default, as they're no longer a single entity on the\r\n * display list, but are being replicated where-ever this Container is.\r\n *\r\n * @name Phaser.GameObjects.Container#exclusive\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.4.0\r\n */\r\n this.exclusive = true;\r\n\r\n /**\r\n * Containers can have an optional maximum size. If set to anything above 0 it\r\n * will constrict the addition of new Game Objects into the Container, capping off\r\n * the maximum limit the Container can grow in size to.\r\n *\r\n * @name Phaser.GameObjects.Container#maxSize\r\n * @type {integer}\r\n * @default -1\r\n * @since 3.4.0\r\n */\r\n this.maxSize = -1;\r\n\r\n /**\r\n * The cursor position.\r\n *\r\n * @name Phaser.GameObjects.Container#position\r\n * @type {integer}\r\n * @since 3.4.0\r\n */\r\n this.position = 0;\r\n\r\n /**\r\n * Internal Transform Matrix used for local space conversion.\r\n *\r\n * @name Phaser.GameObjects.Container#localTransform\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.4.0\r\n */\r\n this.localTransform = new Components.TransformMatrix();\r\n\r\n /**\r\n * Internal temporary Transform Matrix used to avoid object creation.\r\n *\r\n * @name Phaser.GameObjects.Container#tempTransformMatrix\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @private\r\n * @since 3.4.0\r\n */\r\n this.tempTransformMatrix = new Components.TransformMatrix();\r\n\r\n /**\r\n * A reference to the Scene Display List.\r\n *\r\n * @name Phaser.GameObjects.Container#_displayList\r\n * @type {Phaser.GameObjects.DisplayList}\r\n * @private\r\n * @since 3.4.0\r\n */\r\n this._displayList = scene.sys.displayList;\r\n\r\n /**\r\n * The property key to sort by.\r\n *\r\n * @name Phaser.GameObjects.Container#_sortKey\r\n * @type {string}\r\n * @private\r\n * @since 3.4.0\r\n */\r\n this._sortKey = '';\r\n\r\n /**\r\n * A reference to the Scene Systems Event Emitter.\r\n *\r\n * @name Phaser.GameObjects.Container#_sysEvents\r\n * @type {Phaser.Events.EventEmitter}\r\n * @private\r\n * @since 3.9.0\r\n */\r\n this._sysEvents = scene.sys.events;\r\n\r\n /**\r\n * The horizontal scroll factor of this Container.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Container.\r\n *\r\n * When a camera scrolls it will change the location at which this Container is rendered on-screen.\r\n * It does not change the Containers actual position values.\r\n * \r\n * For a Container, setting this value will only update the Container itself, not its children.\r\n * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Container.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Container#scrollFactorX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.scrollFactorX = 1;\r\n\r\n /**\r\n * The vertical scroll factor of this Container.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Container.\r\n *\r\n * When a camera scrolls it will change the location at which this Container is rendered on-screen.\r\n * It does not change the Containers actual position values.\r\n * \r\n * For a Container, setting this value will only update the Container itself, not its children.\r\n * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Container.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Container#scrollFactorY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.scrollFactorY = 1;\r\n\r\n this.setPosition(x, y);\r\n\r\n this.clearAlpha();\r\n\r\n this.setBlendMode(BlendModes.SKIP_CHECK);\r\n\r\n if (children)\r\n {\r\n this.add(children);\r\n }\r\n },\r\n\r\n /**\r\n * Internal value to allow Containers to be used for input and physics.\r\n * Do not change this value. It has no effect other than to break things.\r\n *\r\n * @name Phaser.GameObjects.Container#originX\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n originX: {\r\n\r\n get: function ()\r\n {\r\n return 0.5;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Internal value to allow Containers to be used for input and physics.\r\n * Do not change this value. It has no effect other than to break things.\r\n *\r\n * @name Phaser.GameObjects.Container#originY\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n originY: {\r\n\r\n get: function ()\r\n {\r\n return 0.5;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Internal value to allow Containers to be used for input and physics.\r\n * Do not change this value. It has no effect other than to break things.\r\n *\r\n * @name Phaser.GameObjects.Container#displayOriginX\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n displayOriginX: {\r\n\r\n get: function ()\r\n {\r\n return this.width * 0.5;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Internal value to allow Containers to be used for input and physics.\r\n * Do not change this value. It has no effect other than to break things.\r\n *\r\n * @name Phaser.GameObjects.Container#displayOriginY\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n displayOriginY: {\r\n\r\n get: function ()\r\n {\r\n return this.height * 0.5;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Does this Container exclusively manage its children?\r\n *\r\n * The default is `true` which means a child added to this Container cannot\r\n * belong in another Container, which includes the Scene display list.\r\n *\r\n * If you disable this then this Container will no longer exclusively manage its children.\r\n * This allows you to create all kinds of interesting graphical effects, such as replicating\r\n * Game Objects without reparenting them all over the Scene.\r\n * However, doing so will prevent children from receiving any kind of input event or have\r\n * their physics bodies work by default, as they're no longer a single entity on the\r\n * display list, but are being replicated where-ever this Container is.\r\n *\r\n * @method Phaser.GameObjects.Container#setExclusive\r\n * @since 3.4.0\r\n *\r\n * @param {boolean} [value=true] - The exclusive state of this Container.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container.\r\n */\r\n setExclusive: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.exclusive = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the bounds of this Container. It works by iterating all children of the Container,\r\n * getting their respective bounds, and then working out a min-max rectangle from that.\r\n * It does not factor in if the children render or not, all are included.\r\n *\r\n * Some children are unable to return their bounds, such as Graphics objects, in which case\r\n * they are skipped.\r\n *\r\n * Depending on the quantity of children in this Container it could be a really expensive call,\r\n * so cache it and only poll it as needed.\r\n *\r\n * The values are stored and returned in a Rectangle object.\r\n *\r\n * @method Phaser.GameObjects.Container#getBounds\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} [output] - A Geom.Rectangle object to store the values in. If not provided a new Rectangle will be created.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The values stored in the output object.\r\n */\r\n getBounds: function (output)\r\n {\r\n if (output === undefined) { output = new Rectangle(); }\r\n\r\n output.setTo(this.x, this.y, 0, 0);\r\n\r\n if (this.list.length > 0)\r\n {\r\n var children = this.list;\r\n var tempRect = new Rectangle();\r\n\r\n for (var i = 0; i < children.length; i++)\r\n {\r\n var entry = children[i];\r\n\r\n if (entry.getBounds)\r\n {\r\n entry.getBounds(tempRect);\r\n\r\n Union(tempRect, output, output);\r\n }\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Internal add handler.\r\n *\r\n * @method Phaser.GameObjects.Container#addHandler\r\n * @private\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was just added to this Container.\r\n */\r\n addHandler: function (gameObject)\r\n {\r\n gameObject.once(Events.DESTROY, this.remove, this);\r\n\r\n if (this.exclusive)\r\n {\r\n this._displayList.remove(gameObject);\r\n\r\n if (gameObject.parentContainer)\r\n {\r\n gameObject.parentContainer.remove(gameObject);\r\n }\r\n\r\n gameObject.parentContainer = this;\r\n }\r\n },\r\n\r\n /**\r\n * Internal remove handler.\r\n *\r\n * @method Phaser.GameObjects.Container#removeHandler\r\n * @private\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was just removed from this Container.\r\n */\r\n removeHandler: function (gameObject)\r\n {\r\n gameObject.off(Events.DESTROY, this.remove);\r\n\r\n if (this.exclusive)\r\n {\r\n gameObject.parentContainer = null;\r\n }\r\n },\r\n\r\n /**\r\n * Takes a Point-like object, such as a Vector2, Geom.Point or object with public x and y properties,\r\n * and transforms it into the space of this Container, then returns it in the output object.\r\n *\r\n * @method Phaser.GameObjects.Container#pointToContainer\r\n * @since 3.4.0\r\n *\r\n * @param {(object|Phaser.Geom.Point|Phaser.Math.Vector2)} source - The Source Point to be transformed.\r\n * @param {(object|Phaser.Geom.Point|Phaser.Math.Vector2)} [output] - A destination object to store the transformed point in. If none given a Vector2 will be created and returned.\r\n *\r\n * @return {(object|Phaser.Geom.Point|Phaser.Math.Vector2)} The transformed point.\r\n */\r\n pointToContainer: function (source, output)\r\n {\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n if (this.parentContainer)\r\n {\r\n return this.parentContainer.pointToContainer(source, output);\r\n }\r\n\r\n var tempMatrix = this.tempTransformMatrix;\r\n\r\n // No need to loadIdentity because applyITRS overwrites every value anyway\r\n tempMatrix.applyITRS(this.x, this.y, this.rotation, this.scaleX, this.scaleY);\r\n\r\n tempMatrix.invert();\r\n\r\n tempMatrix.transformPoint(source.x, source.y, output);\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns the world transform matrix as used for Bounds checks.\r\n * \r\n * The returned matrix is temporal and shouldn't be stored.\r\n *\r\n * @method Phaser.GameObjects.Container#getBoundsTransformMatrix\r\n * @since 3.4.0\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} The world transform matrix.\r\n */\r\n getBoundsTransformMatrix: function ()\r\n {\r\n return this.getWorldTransformMatrix(this.tempTransformMatrix, this.localTransform);\r\n },\r\n\r\n /**\r\n * Adds the given Game Object, or array of Game Objects, to this Container.\r\n *\r\n * Each Game Object must be unique within the Container.\r\n *\r\n * @method Phaser.GameObjects.Container#add\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to add to the Container.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n add: function (child)\r\n {\r\n ArrayUtils.Add(this.list, child, this.maxSize, this.addHandler, this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds the given Game Object, or array of Game Objects, to this Container at the specified position.\r\n *\r\n * Existing Game Objects in the Container are shifted up.\r\n *\r\n * Each Game Object must be unique within the Container.\r\n *\r\n * @method Phaser.GameObjects.Container#addAt\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to add to the Container.\r\n * @param {integer} [index=0] - The position to insert the Game Object/s at.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n addAt: function (child, index)\r\n {\r\n ArrayUtils.AddAt(this.list, child, index, this.maxSize, this.addHandler, this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns the Game Object at the given position in this Container.\r\n *\r\n * @method Phaser.GameObjects.Container#getAt\r\n * @since 3.4.0\r\n *\r\n * @param {integer} index - The position to get the Game Object from.\r\n *\r\n * @return {?Phaser.GameObjects.GameObject} The Game Object at the specified index, or `null` if none found.\r\n */\r\n getAt: function (index)\r\n {\r\n return this.list[index];\r\n },\r\n\r\n /**\r\n * Returns the index of the given Game Object in this Container.\r\n *\r\n * @method Phaser.GameObjects.Container#getIndex\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to search for in this Container.\r\n *\r\n * @return {integer} The index of the Game Object in this Container, or -1 if not found.\r\n */\r\n getIndex: function (child)\r\n {\r\n return this.list.indexOf(child);\r\n },\r\n\r\n /**\r\n * Sort the contents of this Container so the items are in order based on the given property.\r\n * For example: `sort('alpha')` would sort the elements based on the value of their `alpha` property.\r\n *\r\n * @method Phaser.GameObjects.Container#sort\r\n * @since 3.4.0\r\n *\r\n * @param {string} property - The property to lexically sort by.\r\n * @param {function} [handler] - Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n sort: function (property, handler)\r\n {\r\n if (!property)\r\n {\r\n return this;\r\n }\r\n\r\n if (handler === undefined)\r\n {\r\n handler = function (childA, childB)\r\n {\r\n return childA[property] - childB[property];\r\n };\r\n }\r\n\r\n ArrayUtils.StableSort.inplace(this.list, handler);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Searches for the first instance of a child with its `name` property matching the given argument.\r\n * Should more than one child have the same name only the first is returned.\r\n *\r\n * @method Phaser.GameObjects.Container#getByName\r\n * @since 3.4.0\r\n *\r\n * @param {string} name - The name to search for.\r\n *\r\n * @return {?Phaser.GameObjects.GameObject} The first child with a matching name, or `null` if none were found.\r\n */\r\n getByName: function (name)\r\n {\r\n return ArrayUtils.GetFirst(this.list, 'name', name);\r\n },\r\n\r\n /**\r\n * Returns a random Game Object from this Container.\r\n *\r\n * @method Phaser.GameObjects.Container#getRandom\r\n * @since 3.4.0\r\n *\r\n * @param {integer} [startIndex=0] - An optional start index.\r\n * @param {integer} [length] - An optional length, the total number of elements (from the startIndex) to choose from.\r\n *\r\n * @return {?Phaser.GameObjects.GameObject} A random child from the Container, or `null` if the Container is empty.\r\n */\r\n getRandom: function (startIndex, length)\r\n {\r\n return ArrayUtils.GetRandom(this.list, startIndex, length);\r\n },\r\n\r\n /**\r\n * Gets the first Game Object in this Container.\r\n *\r\n * You can also specify a property and value to search for, in which case it will return the first\r\n * Game Object in this Container with a matching property and / or value.\r\n *\r\n * For example: `getFirst('visible', true)` would return the first Game Object that had its `visible` property set.\r\n *\r\n * You can limit the search to the `startIndex` - `endIndex` range.\r\n *\r\n * @method Phaser.GameObjects.Container#getFirst\r\n * @since 3.4.0\r\n *\r\n * @param {string} property - The property to test on each Game Object in the Container.\r\n * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check.\r\n * @param {integer} [startIndex=0] - An optional start index to search from.\r\n * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included)\r\n *\r\n * @return {?Phaser.GameObjects.GameObject} The first matching Game Object, or `null` if none was found.\r\n */\r\n getFirst: function (property, value, startIndex, endIndex)\r\n {\r\n return ArrayUtils.GetFirst(this.list, property, value, startIndex, endIndex);\r\n },\r\n\r\n /**\r\n * Returns all Game Objects in this Container.\r\n *\r\n * You can optionally specify a matching criteria using the `property` and `value` arguments.\r\n *\r\n * For example: `getAll('body')` would return only Game Objects that have a body property.\r\n *\r\n * You can also specify a value to compare the property to:\r\n *\r\n * `getAll('visible', true)` would return only Game Objects that have their visible property set to `true`.\r\n *\r\n * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects,\r\n * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only\r\n * the first 50 Game Objects.\r\n *\r\n * @method Phaser.GameObjects.Container#getAll\r\n * @since 3.4.0\r\n *\r\n * @param {string} [property] - The property to test on each Game Object in the Container.\r\n * @param {any} [value] - If property is set then the `property` must strictly equal this value to be included in the results.\r\n * @param {integer} [startIndex=0] - An optional start index to search from.\r\n * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included)\r\n *\r\n * @return {Phaser.GameObjects.GameObject[]} An array of matching Game Objects from this Container.\r\n */\r\n getAll: function (property, value, startIndex, endIndex)\r\n {\r\n return ArrayUtils.GetAll(this.list, property, value, startIndex, endIndex);\r\n },\r\n\r\n /**\r\n * Returns the total number of Game Objects in this Container that have a property\r\n * matching the given value.\r\n *\r\n * For example: `count('visible', true)` would count all the elements that have their visible property set.\r\n *\r\n * You can optionally limit the operation to the `startIndex` - `endIndex` range.\r\n *\r\n * @method Phaser.GameObjects.Container#count\r\n * @since 3.4.0\r\n *\r\n * @param {string} property - The property to check.\r\n * @param {any} value - The value to check.\r\n * @param {integer} [startIndex=0] - An optional start index to search from.\r\n * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included)\r\n *\r\n * @return {integer} The total number of Game Objects in this Container with a property matching the given value.\r\n */\r\n count: function (property, value, startIndex, endIndex)\r\n {\r\n return ArrayUtils.CountAllMatching(this.list, property, value, startIndex, endIndex);\r\n },\r\n\r\n /**\r\n * Swaps the position of two Game Objects in this Container.\r\n * Both Game Objects must belong to this Container.\r\n *\r\n * @method Phaser.GameObjects.Container#swap\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child1 - The first Game Object to swap.\r\n * @param {Phaser.GameObjects.GameObject} child2 - The second Game Object to swap.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n swap: function (child1, child2)\r\n {\r\n ArrayUtils.Swap(this.list, child1, child2);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves a Game Object to a new position within this Container.\r\n *\r\n * The Game Object must already be a child of this Container.\r\n *\r\n * The Game Object is removed from its old position and inserted into the new one.\r\n * Therefore the Container size does not change. Other children will change position accordingly.\r\n *\r\n * @method Phaser.GameObjects.Container#moveTo\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to move.\r\n * @param {integer} index - The new position of the Game Object in this Container.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n moveTo: function (child, index)\r\n {\r\n ArrayUtils.MoveTo(this.list, child, index);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes the given Game Object, or array of Game Objects, from this Container.\r\n *\r\n * The Game Objects must already be children of this Container.\r\n *\r\n * You can also optionally call `destroy` on each Game Object that is removed from the Container.\r\n *\r\n * @method Phaser.GameObjects.Container#remove\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to be removed from the Container.\r\n * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each child successfully removed from this Container.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n remove: function (child, destroyChild)\r\n {\r\n var removed = ArrayUtils.Remove(this.list, child, this.removeHandler, this);\r\n\r\n if (destroyChild && removed)\r\n {\r\n if (!Array.isArray(removed))\r\n {\r\n removed = [ removed ];\r\n }\r\n\r\n for (var i = 0; i < removed.length; i++)\r\n {\r\n removed[i].destroy();\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes the Game Object at the given position in this Container.\r\n *\r\n * You can also optionally call `destroy` on the Game Object, if one is found.\r\n *\r\n * @method Phaser.GameObjects.Container#removeAt\r\n * @since 3.4.0\r\n *\r\n * @param {integer} index - The index of the Game Object to be removed.\r\n * @param {boolean} [destroyChild=false] - Optionally call `destroy` on the Game Object if successfully removed from this Container.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n removeAt: function (index, destroyChild)\r\n {\r\n var removed = ArrayUtils.RemoveAt(this.list, index, this.removeHandler, this);\r\n\r\n if (destroyChild && removed)\r\n {\r\n removed.destroy();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes the Game Objects between the given positions in this Container.\r\n *\r\n * You can also optionally call `destroy` on each Game Object that is removed from the Container.\r\n *\r\n * @method Phaser.GameObjects.Container#removeBetween\r\n * @since 3.4.0\r\n *\r\n * @param {integer} [startIndex=0] - An optional start index to search from.\r\n * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included)\r\n * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each Game Object successfully removed from this Container.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n removeBetween: function (startIndex, endIndex, destroyChild)\r\n {\r\n var removed = ArrayUtils.RemoveBetween(this.list, startIndex, endIndex, this.removeHandler, this);\r\n\r\n if (destroyChild)\r\n {\r\n for (var i = 0; i < removed.length; i++)\r\n {\r\n removed[i].destroy();\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes all Game Objects from this Container.\r\n *\r\n * You can also optionally call `destroy` on each Game Object that is removed from the Container.\r\n *\r\n * @method Phaser.GameObjects.Container#removeAll\r\n * @since 3.4.0\r\n *\r\n * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each Game Object successfully removed from this Container.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n removeAll: function (destroyChild)\r\n {\r\n var removed = ArrayUtils.RemoveBetween(this.list, 0, this.list.length, this.removeHandler, this);\r\n\r\n if (destroyChild)\r\n {\r\n for (var i = 0; i < removed.length; i++)\r\n {\r\n removed[i].destroy();\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Brings the given Game Object to the top of this Container.\r\n * This will cause it to render on-top of any other objects in the Container.\r\n *\r\n * @method Phaser.GameObjects.Container#bringToTop\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to bring to the top of the Container.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n bringToTop: function (child)\r\n {\r\n ArrayUtils.BringToTop(this.list, child);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sends the given Game Object to the bottom of this Container.\r\n * This will cause it to render below any other objects in the Container.\r\n *\r\n * @method Phaser.GameObjects.Container#sendToBack\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to send to the bottom of the Container.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n sendToBack: function (child)\r\n {\r\n ArrayUtils.SendToBack(this.list, child);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves the given Game Object up one place in this Container, unless it's already at the top.\r\n *\r\n * @method Phaser.GameObjects.Container#moveUp\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to be moved in the Container.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n moveUp: function (child)\r\n {\r\n ArrayUtils.MoveUp(this.list, child);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves the given Game Object down one place in this Container, unless it's already at the bottom.\r\n *\r\n * @method Phaser.GameObjects.Container#moveDown\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to be moved in the Container.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n moveDown: function (child)\r\n {\r\n ArrayUtils.MoveDown(this.list, child);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reverses the order of all Game Objects in this Container.\r\n *\r\n * @method Phaser.GameObjects.Container#reverse\r\n * @since 3.4.0\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n reverse: function ()\r\n {\r\n this.list.reverse();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Shuffles the all Game Objects in this Container using the Fisher-Yates implementation.\r\n *\r\n * @method Phaser.GameObjects.Container#shuffle\r\n * @since 3.4.0\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n shuffle: function ()\r\n {\r\n ArrayUtils.Shuffle(this.list);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Replaces a Game Object in this Container with the new Game Object.\r\n * The new Game Object cannot already be a child of this Container.\r\n *\r\n * @method Phaser.GameObjects.Container#replace\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} oldChild - The Game Object in this Container that will be replaced.\r\n * @param {Phaser.GameObjects.GameObject} newChild - The Game Object to be added to this Container.\r\n * @param {boolean} [destroyChild=false] - Optionally call `destroy` on the Game Object if successfully removed from this Container.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n replace: function (oldChild, newChild, destroyChild)\r\n {\r\n var moved = ArrayUtils.Replace(this.list, oldChild, newChild);\r\n\r\n if (moved)\r\n {\r\n this.addHandler(newChild);\r\n this.removeHandler(oldChild);\r\n\r\n if (destroyChild)\r\n {\r\n oldChild.destroy();\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns `true` if the given Game Object is a direct child of this Container.\r\n *\r\n * This check does not scan nested Containers.\r\n *\r\n * @method Phaser.GameObjects.Container#exists\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to check for within this Container.\r\n *\r\n * @return {boolean} True if the Game Object is an immediate child of this Container, otherwise false.\r\n */\r\n exists: function (child)\r\n {\r\n return (this.list.indexOf(child) > -1);\r\n },\r\n\r\n /**\r\n * Sets the property to the given value on all Game Objects in this Container.\r\n *\r\n * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects,\r\n * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only\r\n * the first 50 Game Objects.\r\n *\r\n * @method Phaser.GameObjects.Container#setAll\r\n * @since 3.4.0\r\n *\r\n * @param {string} property - The property that must exist on the Game Object.\r\n * @param {any} value - The value to get the property to.\r\n * @param {integer} [startIndex=0] - An optional start index to search from.\r\n * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included)\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n setAll: function (property, value, startIndex, endIndex)\r\n {\r\n ArrayUtils.SetAll(this.list, property, value, startIndex, endIndex);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * @callback EachContainerCallback\r\n * @generic I - [item]\r\n *\r\n * @param {*} item - The child Game Object of the Container.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\r\n */\r\n\r\n /**\r\n * Passes all Game Objects in this Container to the given callback.\r\n *\r\n * A copy of the Container is made before passing each entry to your callback.\r\n * This protects against the callback itself modifying the Container.\r\n *\r\n * If you know for sure that the callback will not change the size of this Container\r\n * then you can use the more performant `Container.iterate` method instead.\r\n *\r\n * @method Phaser.GameObjects.Container#each\r\n * @since 3.4.0\r\n *\r\n * @param {function} callback - The function to call.\r\n * @param {object} [context] - Value to use as `this` when executing callback.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n each: function (callback, context)\r\n {\r\n var args = [ null ];\r\n var i;\r\n var temp = this.list.slice();\r\n var len = temp.length;\r\n\r\n for (i = 2; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (i = 0; i < len; i++)\r\n {\r\n args[0] = temp[i];\r\n\r\n callback.apply(context, args);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Passes all Game Objects in this Container to the given callback.\r\n *\r\n * Only use this method when you absolutely know that the Container will not be modified during\r\n * the iteration, i.e. by removing or adding to its contents.\r\n *\r\n * @method Phaser.GameObjects.Container#iterate\r\n * @since 3.4.0\r\n *\r\n * @param {function} callback - The function to call.\r\n * @param {object} [context] - Value to use as `this` when executing callback.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\r\n *\r\n * @return {Phaser.GameObjects.Container} This Container instance.\r\n */\r\n iterate: function (callback, context)\r\n {\r\n var args = [ null ];\r\n var i;\r\n\r\n for (i = 2; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (i = 0; i < this.list.length; i++)\r\n {\r\n args[0] = this.list[i];\r\n\r\n callback.apply(context, args);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the scroll factor of this Container and optionally all of its children.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @method Phaser.GameObjects.Container#setScrollFactor\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scroll factor of this Game Object.\r\n * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value.\r\n * @param {boolean} [updateChildren=false] - Apply this scrollFactor to all Container children as well?\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setScrollFactor: function (x, y, updateChildren)\r\n {\r\n if (y === undefined) { y = x; }\r\n if (updateChildren === undefined) { updateChildren = false; }\r\n\r\n this.scrollFactorX = x;\r\n this.scrollFactorY = y;\r\n\r\n if (updateChildren)\r\n {\r\n ArrayUtils.SetAll(this.list, 'scrollFactorX', x);\r\n ArrayUtils.SetAll(this.list, 'scrollFactorY', y);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The number of Game Objects inside this Container.\r\n *\r\n * @name Phaser.GameObjects.Container#length\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n length: {\r\n\r\n get: function ()\r\n {\r\n return this.list.length;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns the first Game Object within the Container, or `null` if it is empty.\r\n *\r\n * You can move the cursor by calling `Container.next` and `Container.previous`.\r\n *\r\n * @name Phaser.GameObjects.Container#first\r\n * @type {?Phaser.GameObjects.GameObject}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n first: {\r\n\r\n get: function ()\r\n {\r\n this.position = 0;\r\n\r\n if (this.list.length > 0)\r\n {\r\n return this.list[0];\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns the last Game Object within the Container, or `null` if it is empty.\r\n *\r\n * You can move the cursor by calling `Container.next` and `Container.previous`.\r\n *\r\n * @name Phaser.GameObjects.Container#last\r\n * @type {?Phaser.GameObjects.GameObject}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n last: {\r\n\r\n get: function ()\r\n {\r\n if (this.list.length > 0)\r\n {\r\n this.position = this.list.length - 1;\r\n\r\n return this.list[this.position];\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns the next Game Object within the Container, or `null` if it is empty.\r\n *\r\n * You can move the cursor by calling `Container.next` and `Container.previous`.\r\n *\r\n * @name Phaser.GameObjects.Container#next\r\n * @type {?Phaser.GameObjects.GameObject}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n next: {\r\n\r\n get: function ()\r\n {\r\n if (this.position < this.list.length)\r\n {\r\n this.position++;\r\n\r\n return this.list[this.position];\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns the previous Game Object within the Container, or `null` if it is empty.\r\n *\r\n * You can move the cursor by calling `Container.next` and `Container.previous`.\r\n *\r\n * @name Phaser.GameObjects.Container#previous\r\n * @type {?Phaser.GameObjects.GameObject}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n previous: {\r\n\r\n get: function ()\r\n {\r\n if (this.position > 0)\r\n {\r\n this.position--;\r\n\r\n return this.list[this.position];\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Internal destroy handler, called as part of the destroy process.\r\n *\r\n * @method Phaser.GameObjects.Container#preDestroy\r\n * @protected\r\n * @since 3.9.0\r\n */\r\n preDestroy: function ()\r\n {\r\n this.removeAll(!!this.exclusive);\r\n\r\n this.localTransform.destroy();\r\n this.tempTransformMatrix.destroy();\r\n\r\n this.list = [];\r\n this._displayList = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Container;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/container/Container.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/container/ContainerCanvasRenderer.js": /*!**********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/container/ContainerCanvasRenderer.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Container#renderCanvas\r\n * @since 3.4.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar ContainerCanvasRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var children = container.list;\r\n\r\n if (children.length === 0)\r\n {\r\n return;\r\n }\r\n\r\n var transformMatrix = container.localTransform;\r\n \r\n if (parentMatrix)\r\n {\r\n transformMatrix.loadIdentity();\r\n transformMatrix.multiply(parentMatrix);\r\n transformMatrix.translate(container.x, container.y);\r\n transformMatrix.rotate(container.rotation);\r\n transformMatrix.scale(container.scaleX, container.scaleY);\r\n }\r\n else\r\n {\r\n transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY);\r\n }\r\n\r\n var containerHasBlendMode = (container.blendMode !== -1);\r\n\r\n if (!containerHasBlendMode)\r\n {\r\n // If Container is SKIP_TEST then set blend mode to be Normal\r\n renderer.setBlendMode(0);\r\n }\r\n\r\n var alpha = container._alpha;\r\n var scrollFactorX = container.scrollFactorX;\r\n var scrollFactorY = container.scrollFactorY;\r\n\r\n for (var i = 0; i < children.length; i++)\r\n {\r\n var child = children[i];\r\n\r\n if (!child.willRender(camera))\r\n {\r\n continue;\r\n }\r\n\r\n var childAlpha = child.alpha;\r\n var childScrollFactorX = child.scrollFactorX;\r\n var childScrollFactorY = child.scrollFactorY;\r\n\r\n if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode)\r\n {\r\n // If Container doesn't have its own blend mode, then a child can have one\r\n renderer.setBlendMode(child.blendMode);\r\n }\r\n\r\n // Set parent values\r\n child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY);\r\n child.setAlpha(childAlpha * alpha);\r\n\r\n // Render\r\n child.renderCanvas(renderer, child, interpolationPercentage, camera, transformMatrix);\r\n\r\n // Restore original values\r\n child.setAlpha(childAlpha);\r\n child.setScrollFactor(childScrollFactorX, childScrollFactorY);\r\n }\r\n};\r\n\r\nmodule.exports = ContainerCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/container/ContainerCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/container/ContainerCreator.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/container/ContainerCreator.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BuildGameObject = __webpack_require__(/*! ../BuildGameObject */ \"./node_modules/phaser/src/gameobjects/BuildGameObject.js\");\r\nvar Container = __webpack_require__(/*! ./Container */ \"./node_modules/phaser/src/gameobjects/container/Container.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\n\r\n/**\r\n * Creates a new Container Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Container Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#container\r\n * @since 3.4.0\r\n *\r\n * @param {object} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {Phaser.GameObjects.Container} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('container', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n var x = GetAdvancedValue(config, 'x', 0);\r\n var y = GetAdvancedValue(config, 'y', 0);\r\n\r\n var container = new Container(this.scene, x, y);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, container, config);\r\n \r\n return container;\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/container/ContainerCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/container/ContainerFactory.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/container/ContainerFactory.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Container = __webpack_require__(/*! ./Container */ \"./node_modules/phaser/src/gameobjects/container/Container.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Container Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Container Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#container\r\n * @since 3.4.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to this Container.\r\n *\r\n * @return {Phaser.GameObjects.Container} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('container', function (x, y, children)\r\n{\r\n return this.displayList.add(new Container(this.scene, x, y, children));\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/container/ContainerFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/container/ContainerRender.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/container/ContainerRender.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./ContainerWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/container/ContainerWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./ContainerCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/container/ContainerCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/container/ContainerRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/container/ContainerWebGLRenderer.js": /*!*********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/container/ContainerWebGLRenderer.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Container#renderWebGL\r\n * @since 3.4.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar ContainerWebGLRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var children = container.list;\r\n\r\n if (children.length === 0)\r\n {\r\n return;\r\n }\r\n\r\n var transformMatrix = container.localTransform;\r\n \r\n if (parentMatrix)\r\n {\r\n transformMatrix.loadIdentity();\r\n transformMatrix.multiply(parentMatrix);\r\n transformMatrix.translate(container.x, container.y);\r\n transformMatrix.rotate(container.rotation);\r\n transformMatrix.scale(container.scaleX, container.scaleY);\r\n }\r\n else\r\n {\r\n transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY);\r\n }\r\n\r\n var containerHasBlendMode = (container.blendMode !== -1);\r\n\r\n if (!containerHasBlendMode)\r\n {\r\n // If Container is SKIP_TEST then set blend mode to be Normal\r\n renderer.setBlendMode(0);\r\n }\r\n\r\n var alpha = container.alpha;\r\n\r\n var scrollFactorX = container.scrollFactorX;\r\n var scrollFactorY = container.scrollFactorY;\r\n\r\n var list = children;\r\n var childCount = children.length;\r\n\r\n for (var i = 0; i < childCount; i++)\r\n {\r\n var child = children[i];\r\n\r\n if (!child.willRender(camera))\r\n {\r\n continue;\r\n }\r\n\r\n var childAlphaTopLeft;\r\n var childAlphaTopRight;\r\n var childAlphaBottomLeft;\r\n var childAlphaBottomRight;\r\n\r\n if (child.alphaTopLeft !== undefined)\r\n {\r\n childAlphaTopLeft = child.alphaTopLeft;\r\n childAlphaTopRight = child.alphaTopRight;\r\n childAlphaBottomLeft = child.alphaBottomLeft;\r\n childAlphaBottomRight = child.alphaBottomRight;\r\n }\r\n else\r\n {\r\n var childAlpha = child.alpha;\r\n\r\n childAlphaTopLeft = childAlpha;\r\n childAlphaTopRight = childAlpha;\r\n childAlphaBottomLeft = childAlpha;\r\n childAlphaBottomRight = childAlpha;\r\n }\r\n\r\n var childScrollFactorX = child.scrollFactorX;\r\n var childScrollFactorY = child.scrollFactorY;\r\n\r\n if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode)\r\n {\r\n // If Container doesn't have its own blend mode, then a child can have one\r\n renderer.setBlendMode(child.blendMode);\r\n }\r\n\r\n var mask = child.mask;\r\n\r\n if (mask)\r\n {\r\n mask.preRenderWebGL(renderer, child, camera);\r\n }\r\n\r\n var type = child.type;\r\n\r\n if (type !== renderer.currentType)\r\n {\r\n renderer.newType = true;\r\n renderer.currentType = type;\r\n }\r\n\r\n renderer.nextTypeMatch = (i < childCount - 1) ? (list[i + 1].type === renderer.currentType) : false;\r\n\r\n // Set parent values\r\n child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY);\r\n\r\n child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha);\r\n\r\n // Render\r\n child.renderWebGL(renderer, child, interpolationPercentage, camera, transformMatrix);\r\n\r\n // Restore original values\r\n\r\n child.setAlpha(childAlphaTopLeft, childAlphaTopRight, childAlphaBottomLeft, childAlphaBottomRight);\r\n\r\n child.setScrollFactor(childScrollFactorX, childScrollFactorY);\r\n\r\n if (mask)\r\n {\r\n mask.postRenderWebGL(renderer, camera);\r\n }\r\n\r\n renderer.newType = false;\r\n }\r\n};\r\n\r\nmodule.exports = ContainerWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/container/ContainerWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/domelement/CSSBlendModes.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/domelement/CSSBlendModes.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Phaser Blend Modes to CSS Blend Modes Map.\r\n * \r\n * @name Phaser.CSSBlendModes\r\n * @enum {string}\r\n * @memberof Phaser\r\n * @readonly\r\n * @since 3.12.0\r\n */\r\n\r\nmodule.exports = [\r\n 'normal',\r\n 'multiply',\r\n 'multiply',\r\n 'screen',\r\n 'overlay',\r\n 'darken',\r\n 'lighten',\r\n 'color-dodge',\r\n 'color-burn',\r\n 'hard-light',\r\n 'soft-light',\r\n 'difference',\r\n 'exclusion',\r\n 'hue',\r\n 'saturation',\r\n 'color',\r\n 'luminosity'\r\n];\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/domelement/CSSBlendModes.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/domelement/DOMElement.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/domelement/DOMElement.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar DOMElementRender = __webpack_require__(/*! ./DOMElementRender */ \"./node_modules/phaser/src/gameobjects/domelement/DOMElementRender.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\nvar RemoveFromDOM = __webpack_require__(/*! ../../dom/RemoveFromDOM */ \"./node_modules/phaser/src/dom/RemoveFromDOM.js\");\r\nvar SCENE_EVENTS = __webpack_require__(/*! ../../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\nvar Vector4 = __webpack_require__(/*! ../../math/Vector4 */ \"./node_modules/phaser/src/math/Vector4.js\");\r\n\r\n/**\r\n * @classdesc\r\n * DOM Element Game Objects are a way to control and manipulate HTML Elements over the top of your game.\r\n * \r\n * In order for DOM Elements to display you have to enable them by adding the following to your game\r\n * configuration object:\r\n * \r\n * ```javascript\r\n * dom {\r\n * createContainer: true\r\n * }\r\n * ```\r\n * \r\n * When this is added, Phaser will automatically create a DOM Container div that is positioned over the top\r\n * of the game canvas. This div is sized to match the canvas, and if the canvas size changes, as a result of\r\n * settings within the Scale Manager, the dom container is resized accordingly.\r\n * \r\n * You can create a DOM Element by either passing in DOMStrings, or by passing in a reference to an existing\r\n * Element that you wish to be placed under the control of Phaser. For example:\r\n * \r\n * ```javascript\r\n * this.add.dom(x, y, 'div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser');\r\n * ```\r\n * \r\n * The above code will insert a div element into the DOM Container at the given x/y coordinate. The DOMString in\r\n * the 4th argument sets the initial CSS style of the div and the final argument is the inner text. In this case,\r\n * it will create a lime colored div that is 220px by 100px in size with the text Phaser in it, in an Arial font.\r\n * \r\n * You should nearly always, without exception, use explicitly sized HTML Elements, in order to fully control\r\n * alignment and positioning of the elements next to regular game content.\r\n * \r\n * Rather than specify the CSS and HTML directly you can use the `load.html` File Loader to load it into the\r\n * cache and then use the `createFromCache` method instead. You can also use `createFromHTML` and various other\r\n * methods available in this class to help construct your elements.\r\n * \r\n * Once the element has been created you can then control it like you would any other Game Object. You can set its\r\n * position, scale, rotation, alpha and other properties. It will move as the main Scene Camera moves and be clipped\r\n * at the edge of the canvas. It's important to remember some limitations of DOM Elements: The obvious one is that\r\n * they appear above or below your game canvas. You cannot blend them into the display list, meaning you cannot have\r\n * a DOM Element, then a Sprite, then another DOM Element behind it.\r\n * \r\n * They also cannot be enabled for input. To do that, you have to use the `addListener` method to add native event\r\n * listeners directly. The final limitation is to do with cameras. The DOM Container is sized to match the game canvas\r\n * entirely and clipped accordingly. DOM Elements respect camera scrolling and scrollFactor settings, but if you\r\n * change the size of the camera so it no longer matches the size of the canvas, they won't be clipped accordingly.\r\n * \r\n * Also, all DOM Elements are inserted into the same DOM Container, regardless of which Scene they are created in.\r\n * \r\n * DOM Elements are a powerful way to align native HTML with your Phaser Game Objects. For example, you can insert\r\n * a login form for a multiplayer game directly into your title screen. Or a text input box for a highscore table.\r\n * Or a banner ad from a 3rd party service. Or perhaps you'd like to use them for high resolution text display and\r\n * UI. The choice is up to you, just remember that you're dealing with standard HTML and CSS floating over the top\r\n * of your game, and should treat it accordingly.\r\n *\r\n * @class DOMElement\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.17.0\r\n *\r\n * @extends Phaser.GameObjects.Components.AlphaSingle\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} [x=0] - The horizontal position of this DOM Element in the world.\r\n * @param {number} [y=0] - The vertical position of this DOM Element in the world.\r\n * @param {(Element|string)} [element] - An existing DOM element, or a string. If a string starting with a # it will do a `getElementById` look-up on the string (minus the hash). Without a hash, it represents the type of element to create, i.e. 'div'.\r\n * @param {(string|any)} [style] - If a string, will be set directly as the elements `style` property value. If a plain object, will be iterated and the values transferred. In both cases the values replacing whatever CSS styles may have been previously set.\r\n * @param {string} [innerText] - If given, will be set directly as the elements `innerText` property value, replacing whatever was there before.\r\n */\r\nvar DOMElement = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.AlphaSingle,\r\n Components.BlendMode,\r\n Components.Depth,\r\n Components.Origin,\r\n Components.ScrollFactor,\r\n Components.Transform,\r\n Components.Visible,\r\n DOMElementRender\r\n ],\r\n\r\n initialize:\r\n\r\n function DOMElement (scene, x, y, element, style, innerText)\r\n {\r\n GameObject.call(this, scene, 'DOMElement');\r\n\r\n /**\r\n * A reference to the parent DOM Container that the Game instance created when it started.\r\n * \r\n * @name Phaser.GameObjects.DOMElement#parent\r\n * @type {Element}\r\n * @since 3.17.0\r\n */\r\n this.parent = scene.sys.game.domContainer;\r\n\r\n /**\r\n * A reference to the HTML Cache.\r\n * \r\n * @name Phaser.GameObjects.DOMElement#cache\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.17.0\r\n */\r\n this.cache = scene.sys.cache.html;\r\n\r\n /**\r\n * The actual DOM Element that this Game Object is bound to. For example, if you've created a `
`\r\n * then this property is a direct reference to that element within the dom.\r\n * \r\n * @name Phaser.GameObjects.DOMElement#node\r\n * @type {Element}\r\n * @since 3.17.0\r\n */\r\n this.node;\r\n\r\n /**\r\n * By default a DOM Element will have its transform, display, opacity, zIndex and blend mode properties\r\n * updated when its rendered. If, for some reason, you don't want any of these changed other than the\r\n * CSS transform, then set this flag to `true`. When `true` only the CSS Transform is applied and it's\r\n * up to you to keep track of and set the other properties as required.\r\n * \r\n * This can be handy if, for example, you've a nested DOM Element and you don't want the opacity to be\r\n * picked-up by any of its children.\r\n * \r\n * @name Phaser.GameObjects.DOMElement#transformOnly\r\n * @type {boolean}\r\n * @since 3.17.0\r\n */\r\n this.transformOnly = false;\r\n\r\n /**\r\n * The angle, in radians, by which to skew the DOM Element on the horizontal axis.\r\n * \r\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform\r\n * \r\n * @name Phaser.GameObjects.DOMElement#skewX\r\n * @type {number}\r\n * @since 3.17.0\r\n */\r\n this.skewX = 0;\r\n\r\n /**\r\n * The angle, in radians, by which to skew the DOM Element on the vertical axis.\r\n * \r\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform\r\n * \r\n * @name Phaser.GameObjects.DOMElement#skewY\r\n * @type {number}\r\n * @since 3.17.0\r\n */\r\n this.skewY = 0;\r\n\r\n /**\r\n * A Vector4 that contains the 3D rotation of this DOM Element around a fixed axis in 3D space.\r\n * \r\n * All values in the Vector4 are treated as degrees, unless the `rotate3dAngle` property is changed.\r\n * \r\n * For more details see the following MDN page:\r\n * \r\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d\r\n * \r\n * @name Phaser.GameObjects.DOMElement#rotate3d\r\n * @type {Phaser.Math.Vector4}\r\n * @since 3.17.0\r\n */\r\n this.rotate3d = new Vector4();\r\n\r\n /**\r\n * The unit that represents the 3D rotation values. By default this is `deg` for degrees, but can\r\n * be changed to any supported unit. See this page for further details:\r\n * \r\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d\r\n * \r\n * @name Phaser.GameObjects.DOMElement#rotate3dAngle\r\n * @type {string}\r\n * @since 3.17.0\r\n */\r\n this.rotate3dAngle = 'deg';\r\n\r\n /**\r\n * The native (un-scaled) width of this Game Object.\r\n * \r\n * For a DOM Element this property is read-only.\r\n * \r\n * The property `displayWidth` holds the computed bounds of this DOM Element, factoring in scaling.\r\n * \r\n * @name Phaser.GameObjects.DOMElement#width\r\n * @type {number}\r\n * @readonly\r\n * @since 3.17.0\r\n */\r\n this.width = 0;\r\n\r\n /**\r\n * The native (un-scaled) height of this Game Object.\r\n * \r\n * For a DOM Element this property is read-only.\r\n * \r\n * The property `displayHeight` holds the computed bounds of this DOM Element, factoring in scaling.\r\n * \r\n * @name Phaser.GameObjects.DOMElement#height\r\n * @type {number}\r\n * @readonly\r\n * @since 3.17.0\r\n */\r\n this.height = 0;\r\n\r\n /**\r\n * The computed display width of this Game Object, based on the `getBoundingClientRect` DOM call.\r\n * \r\n * The property `width` holds the un-scaled width of this DOM Element.\r\n * \r\n * @name Phaser.GameObjects.DOMElement#displayWidth\r\n * @type {number}\r\n * @readonly\r\n * @since 3.17.0\r\n */\r\n this.displayWidth = 0;\r\n\r\n /**\r\n * The computed display height of this Game Object, based on the `getBoundingClientRect` DOM call.\r\n * \r\n * The property `height` holds the un-scaled height of this DOM Element.\r\n * \r\n * @name Phaser.GameObjects.DOMElement#displayHeight\r\n * @type {number}\r\n * @readonly\r\n * @since 3.17.0\r\n */\r\n this.displayHeight = 0;\r\n\r\n /**\r\n * Internal native event handler.\r\n * \r\n * @name Phaser.GameObjects.DOMElement#handler\r\n * @type {number}\r\n * @private\r\n * @since 3.17.0\r\n */\r\n this.handler = this.dispatchNativeEvent.bind(this);\r\n\r\n this.setPosition(x, y);\r\n\r\n if (typeof element === 'string')\r\n {\r\n // hash?\r\n if (element[0] === '#')\r\n {\r\n this.setElement(element.substr(1), style, innerText);\r\n }\r\n else\r\n {\r\n this.createElement(element, style, innerText);\r\n }\r\n }\r\n else if (element)\r\n {\r\n this.setElement(element, style, innerText);\r\n }\r\n\r\n scene.sys.events.on(SCENE_EVENTS.SLEEP, this.handleSceneEvent, this);\r\n scene.sys.events.on(SCENE_EVENTS.WAKE, this.handleSceneEvent, this);\r\n },\r\n\r\n /**\r\n * Handles a Scene Sleep and Wake event.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#handleSceneEvent\r\n * @private\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Scenes.Systems} sys - The Scene Systems.\r\n */\r\n handleSceneEvent: function (sys)\r\n {\r\n var node = this.node;\r\n var style = node.style;\r\n \r\n if (node)\r\n {\r\n style.display = (sys.settings.visible) ? 'block' : 'none';\r\n }\r\n },\r\n\r\n /**\r\n * Sets the horizontal and vertical skew values of this DOM Element.\r\n * \r\n * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/transform\r\n *\r\n * @method Phaser.GameObjects.DOMElement#setSkew\r\n * @since 3.17.0\r\n *\r\n * @param {number} [x=0] - The angle, in radians, by which to skew the DOM Element on the horizontal axis.\r\n * @param {number} [y=x] - The angle, in radians, by which to skew the DOM Element on the vertical axis.\r\n * \r\n * @return {this} This DOM Element instance.\r\n */\r\n setSkew: function (x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.skewX = x;\r\n this.skewY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the perspective CSS property of the _parent DOM Container_. This determines the distance between the z=0\r\n * plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with\r\n * z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The strength of the effect is determined\r\n * by the value of this property.\r\n * \r\n * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/perspective\r\n * \r\n * **Changing this value changes it globally for all DOM Elements, as they all share the same parent container.**\r\n *\r\n * @method Phaser.GameObjects.DOMElement#setPerspective\r\n * @since 3.17.0\r\n *\r\n * @param {number} value - The perspective value, in pixels, that determines the distance between the z plane and the user.\r\n * \r\n * @return {this} This DOM Element instance.\r\n */\r\n setPerspective: function (value)\r\n {\r\n this.parent.style.perspective = value + 'px';\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The perspective CSS property value of the _parent DOM Container_. This determines the distance between the z=0\r\n * plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with\r\n * z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The strength of the effect is determined\r\n * by the value of this property.\r\n * \r\n * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/perspective\r\n * \r\n * **Changing this value changes it globally for all DOM Elements, as they all share the same parent container.**\r\n * \r\n * @name Phaser.GameObjects.DOMElement#perspective\r\n * @type {number}\r\n * @since 3.17.0\r\n */\r\n perspective: {\r\n\r\n get: function ()\r\n {\r\n return parseFloat(this.parent.style.perspective);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.parent.style.perspective = value + 'px';\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Adds one or more native DOM event listeners onto the underlying Element of this Game Object.\r\n * The event is then dispatched via this Game Objects standard event emitter.\r\n * \r\n * For example:\r\n * \r\n * ```javascript\r\n * var div = this.add.dom(x, y, element);\r\n * \r\n * div.addListener('click');\r\n * \r\n * div.on('click', handler);\r\n * ```\r\n *\r\n * @method Phaser.GameObjects.DOMElement#addListener\r\n * @since 3.17.0\r\n *\r\n * @param {string} events - The DOM event/s to listen for. You can specify multiple events by separating them with spaces.\r\n * \r\n * @return {this} This DOM Element instance.\r\n */\r\n addListener: function (events)\r\n {\r\n if (this.node)\r\n {\r\n events = events.split(' ');\r\n\r\n for (var i = 0; i < events.length; i++)\r\n {\r\n this.node.addEventListener(events[i], this.handler, false);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes one or more native DOM event listeners from the underlying Element of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#removeListener\r\n * @since 3.17.0\r\n *\r\n * @param {string} events - The DOM event/s to stop listening for. You can specify multiple events by separating them with spaces.\r\n * \r\n * @return {this} This DOM Element instance.\r\n */\r\n removeListener: function (events)\r\n {\r\n if (this.node)\r\n {\r\n events = events.split(' ');\r\n\r\n for (var i = 0; i < events.length; i++)\r\n {\r\n this.node.removeEventListener(events[i], this.handler);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal event proxy to dispatch native DOM Events via this Game Object.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#dispatchNativeEvent\r\n * @private\r\n * @since 3.17.0\r\n *\r\n * @param {any} event - The native DOM event.\r\n */\r\n dispatchNativeEvent: function (event)\r\n {\r\n this.emit(event.type, event);\r\n },\r\n\r\n /**\r\n * Creates a native DOM Element, adds it to the parent DOM Container and then binds it to this Game Object,\r\n * so you can control it. The `tagName` should be a string and is passed to `document.createElement`:\r\n * \r\n * ```javascript\r\n * this.add.dom().createElement('div');\r\n * ```\r\n * \r\n * For more details on acceptable tag names see: https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement\r\n * \r\n * You can also pass in a DOMString or style object to set the CSS on the created element, and an optional `innerText`\r\n * value as well. Here is an example of a DOMString:\r\n * \r\n * ```javascript\r\n * this.add.dom().createElement('div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser');\r\n * ```\r\n * \r\n * And using a style object:\r\n * \r\n * ```javascript\r\n * var style = {\r\n * 'background-color': 'lime';\r\n * 'width': '200px';\r\n * 'height': '100px';\r\n * 'font': '48px Arial';\r\n * };\r\n * \r\n * this.add.dom().createElement('div', style, 'Phaser');\r\n * ```\r\n * \r\n * If this Game Object already has an Element, it is removed from the DOM entirely first.\r\n * Any event listeners you may have previously created will need to be re-created after this call.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#createElement\r\n * @since 3.17.0\r\n *\r\n * @param {string} tagName - A string that specifies the type of element to be created. The nodeName of the created element is initialized with the value of tagName. Don't use qualified names (like \"html:a\") with this method.\r\n * @param {(string|any)} [style] - Either a DOMString that holds the CSS styles to be applied to the created element, or an object the styles will be ready from.\r\n * @param {string} [innerText] - A DOMString that holds the text that will be set as the innerText of the created element.\r\n * \r\n * @return {this} This DOM Element instance.\r\n */\r\n createElement: function (tagName, style, innerText)\r\n {\r\n return this.setElement(document.createElement(tagName), style, innerText);\r\n },\r\n\r\n /**\r\n * Binds a new DOM Element to this Game Object. If this Game Object already has an Element it is removed from the DOM\r\n * entirely first. Any event listeners you may have previously created will need to be re-created on the new element.\r\n * \r\n * The `element` argument you pass to this method can be either a string tagName:\r\n * \r\n * ```javascript\r\n *

Phaser

\r\n *\r\n * this.add.dom().setElement('heading');\r\n * ```\r\n * \r\n * Or a reference to an Element instance:\r\n * \r\n * ```javascript\r\n *

Phaser

\r\n *\r\n * var h1 = document.getElementById('heading');\r\n * \r\n * this.add.dom().setElement(h1);\r\n * ```\r\n * \r\n * You can also pass in a DOMString or style object to set the CSS on the created element, and an optional `innerText`\r\n * value as well. Here is an example of a DOMString:\r\n * \r\n * ```javascript\r\n * this.add.dom().setElement(h1, 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser');\r\n * ```\r\n * \r\n * And using a style object:\r\n * \r\n * ```javascript\r\n * var style = {\r\n * 'background-color': 'lime';\r\n * 'width': '200px';\r\n * 'height': '100px';\r\n * 'font': '48px Arial';\r\n * };\r\n * \r\n * this.add.dom().setElement(h1, style, 'Phaser');\r\n * ```\r\n *\r\n * @method Phaser.GameObjects.DOMElement#setElement\r\n * @since 3.17.0\r\n *\r\n * @param {(string|Element)} element - If a string it is passed to `getElementById()`, or it should be a reference to an existing Element.\r\n * @param {(string|any)} [style] - Either a DOMString that holds the CSS styles to be applied to the created element, or an object the styles will be ready from.\r\n * @param {string} [innerText] - A DOMString that holds the text that will be set as the innerText of the created element.\r\n * \r\n * @return {this} This DOM Element instance.\r\n */\r\n setElement: function (element, style, innerText)\r\n {\r\n // Already got an element? Remove it first\r\n this.removeElement();\r\n\r\n var target;\r\n\r\n if (typeof element === 'string')\r\n {\r\n // hash?\r\n if (element[0] === '#')\r\n {\r\n element = element.substr(1);\r\n }\r\n\r\n target = document.getElementById(element);\r\n }\r\n else if (typeof element === 'object' && element.nodeType === 1)\r\n {\r\n target = element;\r\n }\r\n\r\n if (!target)\r\n {\r\n return this;\r\n }\r\n\r\n this.node = target;\r\n\r\n // style can be empty, a string or a plain object\r\n if (style && IsPlainObject(style))\r\n {\r\n for (var key in style)\r\n {\r\n target.style[key] = style[key];\r\n }\r\n }\r\n else if (typeof style === 'string')\r\n {\r\n target.style = style;\r\n }\r\n\r\n // Add / Override the values we need\r\n\r\n target.style.zIndex = '0';\r\n target.style.display = 'inline';\r\n target.style.position = 'absolute';\r\n\r\n // Node handler\r\n\r\n target.phaser = this;\r\n\r\n if (this.parent)\r\n {\r\n this.parent.appendChild(target);\r\n }\r\n\r\n // InnerText\r\n\r\n if (innerText)\r\n {\r\n target.innerText = innerText;\r\n }\r\n\r\n return this.updateSize();\r\n },\r\n\r\n /**\r\n * Takes a block of html from the HTML Cache, that has previously been preloaded into the game, and then\r\n * creates a DOM Element from it. The loaded HTML is set as the `innerHTML` property of the created\r\n * element.\r\n * \r\n * Assume the following html is stored in a file called `loginform.html`:\r\n * \r\n * ```html\r\n * \r\n * \r\n * ```\r\n * \r\n * Which is loaded into your game using the cache key 'login':\r\n * \r\n * ```javascript\r\n * this.load.html('login', 'assets/loginform.html');\r\n * ```\r\n * \r\n * You can create a DOM Element from it using the cache key:\r\n * \r\n * ```javascript\r\n * this.add.dom().createFromCache('login');\r\n * ```\r\n * \r\n * The optional `elementType` argument controls the container that is created, into which the loaded html is inserted.\r\n * The default is a plain `div` object, but any valid tagName can be given.\r\n * \r\n * If this Game Object already has an Element, it is removed from the DOM entirely first.\r\n * Any event listeners you may have previously created will need to be re-created after this call.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#createFromCache\r\n * @since 3.17.0\r\n * \r\n * @param {string} The key of the html cache entry to use for this DOM Element.\r\n * @param {string} [tagName='div'] - The tag name of the element into which all of the loaded html will be inserted. Defaults to a plain div tag.\r\n * \r\n * @return {this} This DOM Element instance.\r\n */\r\n createFromCache: function (key, tagName)\r\n {\r\n var html = this.cache.get(key);\r\n\r\n if (html)\r\n {\r\n this.createFromHTML(html, tagName);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes a string of html and then creates a DOM Element from it. The HTML is set as the `innerHTML`\r\n * property of the created element.\r\n * \r\n * ```javascript\r\n * let form = `\r\n * \r\n * \r\n * `;\r\n * ```\r\n * \r\n * You can create a DOM Element from it using the string:\r\n * \r\n * ```javascript\r\n * this.add.dom().createFromHTML(form);\r\n * ```\r\n * \r\n * The optional `elementType` argument controls the type of container that is created, into which the html is inserted.\r\n * The default is a plain `div` object, but any valid tagName can be given.\r\n * \r\n * If this Game Object already has an Element, it is removed from the DOM entirely first.\r\n * Any event listeners you may have previously created will need to be re-created after this call.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#createFromHTML\r\n * @since 3.17.0\r\n * \r\n * @param {string} A string of html to be set as the `innerHTML` property of the created element.\r\n * @param {string} [tagName='div'] - The tag name of the element into which all of the html will be inserted. Defaults to a plain div tag.\r\n * \r\n * @return {this} This DOM Element instance.\r\n */\r\n createFromHTML: function (html, tagName)\r\n {\r\n if (tagName === undefined) { tagName = 'div'; }\r\n\r\n // Already got an element? Remove it first\r\n this.removeElement();\r\n\r\n var element = document.createElement(tagName);\r\n\r\n this.node = element;\r\n\r\n element.style.zIndex = '0';\r\n element.style.display = 'inline';\r\n element.style.position = 'absolute';\r\n\r\n // Node handler\r\n\r\n element.phaser = this;\r\n\r\n if (this.parent)\r\n {\r\n this.parent.appendChild(element);\r\n }\r\n\r\n element.innerHTML = html;\r\n\r\n return this.updateSize();\r\n },\r\n\r\n /**\r\n * Removes the current DOM Element bound to this Game Object from the DOM entirely and resets the\r\n * `node` property of this Game Object to be `null`.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#removeElement\r\n * @since 3.17.0\r\n * \r\n * @return {this} This DOM Element instance.\r\n */\r\n removeElement: function ()\r\n {\r\n if (this.node)\r\n {\r\n RemoveFromDOM(this.node);\r\n\r\n this.node = null;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal method that calls `getBoundingClientRect` on the `node` and then sets the bounds width\r\n * and height into the `displayWidth` and `displayHeight` properties, and the `clientWidth` and `clientHeight`\r\n * values into the `width` and `height` properties respectively.\r\n * \r\n * This is called automatically whenever a new element is created or set.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#updateSize\r\n * @since 3.17.0\r\n * \r\n * @return {this} This DOM Element instance.\r\n */\r\n updateSize: function ()\r\n {\r\n var node = this.node;\r\n\r\n var nodeBounds = node.getBoundingClientRect();\r\n\r\n this.width = node.clientWidth;\r\n this.height = node.clientHeight;\r\n\r\n this.displayWidth = nodeBounds.width || 0;\r\n this.displayHeight = nodeBounds.height || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through\r\n * them, looking for the first one that has a property matching the given key and value. It then returns this child\r\n * if found, or `null` if not.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#getChildByProperty\r\n * @since 3.17.0\r\n * \r\n * @param {string} property - The property to search the children for.\r\n * @param {string} value - The value the property must strictly equal.\r\n * \r\n * @return {?Element} The first matching child DOM Element, or `null` if not found.\r\n */\r\n getChildByProperty: function (property, value)\r\n {\r\n if (this.node)\r\n {\r\n var children = this.node.querySelectorAll('*');\r\n\r\n for (var i = 0; i < children.length; i++)\r\n {\r\n if (children[i][property] === value)\r\n {\r\n return children[i];\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through\r\n * them, looking for the first one that has a matching id. It then returns this child if found, or `null` if not.\r\n * \r\n * Be aware that class and id names are case-sensitive.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#getChildByID\r\n * @since 3.17.0\r\n * \r\n * @param {string} id - The id to search the children for.\r\n * \r\n * @return {?Element} The first matching child DOM Element, or `null` if not found.\r\n */\r\n getChildByID: function (id)\r\n {\r\n return this.getChildByProperty('id', id);\r\n },\r\n\r\n /**\r\n * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through\r\n * them, looking for the first one that has a matching name. It then returns this child if found, or `null` if not.\r\n * \r\n * Be aware that class and id names are case-sensitive.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#getChildByName\r\n * @since 3.17.0\r\n * \r\n * @param {string} name - The name to search the children for.\r\n * \r\n * @return {?Element} The first matching child DOM Element, or `null` if not found.\r\n */\r\n getChildByName: function (name)\r\n {\r\n return this.getChildByProperty('name', name);\r\n },\r\n\r\n /**\r\n * Sets the `className` property of the DOM Element node and updates the internal sizes.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#setClassName\r\n * @since 3.17.0\r\n * \r\n * @param {string} className - A string representing the class or space-separated classes of the element.\r\n * \r\n * @return {this} This DOM Element instance.\r\n */\r\n setClassName: function (className)\r\n {\r\n if (this.node)\r\n {\r\n this.node.className = className;\r\n\r\n this.updateSize();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the `innerText` property of the DOM Element node and updates the internal sizes.\r\n * \r\n * Note that only certain types of Elements can have `innerText` set on them.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#setText\r\n * @since 3.17.0\r\n * \r\n * @param {string} text - A DOMString representing the rendered text content of the element.\r\n * \r\n * @return {this} This DOM Element instance.\r\n */\r\n setText: function (text)\r\n {\r\n if (this.node)\r\n {\r\n this.node.innerText = text;\r\n\r\n this.updateSize();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the `innerHTML` property of the DOM Element node and updates the internal sizes.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#setHTML\r\n * @since 3.17.0\r\n * \r\n * @param {string} html - A DOMString of html to be set as the `innerHTML` property of the element.\r\n * \r\n * @return {this} This DOM Element instance.\r\n */\r\n setHTML: function (html)\r\n {\r\n if (this.node)\r\n {\r\n this.node.innerHTML = html;\r\n\r\n this.updateSize();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Runs internal update tasks.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#preUpdate\r\n * @private\r\n * @since 3.17.0\r\n */\r\n preUpdate: function ()\r\n {\r\n var parent = this.parentContainer;\r\n var node = this.node;\r\n\r\n if (node && parent && !parent.willRender())\r\n {\r\n node.style.display = 'none';\r\n }\r\n },\r\n\r\n /**\r\n * Compares the renderMask with the renderFlags to see if this Game Object will render or not.\r\n * \r\n * DOMElements always return `true` as they need to still set values during the render pass, even if not visible.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#willRender\r\n * @since 3.17.0\r\n *\r\n * @return {boolean} `true` if the Game Object should be rendered, otherwise `false`.\r\n */\r\n willRender: function ()\r\n {\r\n return true;\r\n },\r\n\r\n /**\r\n * Handles the pre-destroy step for the DOM Element, which removes the underlying node from the DOM.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#preDestroy\r\n * @private\r\n * @since 3.17.0\r\n */\r\n preDestroy: function ()\r\n {\r\n this.removeElement();\r\n\r\n this.scene.sys.events.off(SCENE_EVENTS.SLEEP, this.handleSceneEvent, this);\r\n this.scene.sys.events.off(SCENE_EVENTS.WAKE, this.handleSceneEvent, this);\r\n }\r\n\r\n});\r\n\r\nmodule.exports = DOMElement;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/domelement/DOMElement.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/domelement/DOMElementCSSRenderer.js": /*!*********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/domelement/DOMElementCSSRenderer.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CSSBlendModes = __webpack_require__(/*! ./CSSBlendModes */ \"./node_modules/phaser/src/gameobjects/domelement/CSSBlendModes.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.DOMElement#renderWebGL\r\n * @since 3.17.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active renderer.\r\n * @param {Phaser.GameObjects.DOMElement} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar DOMElementCSSRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var node = src.node;\r\n var style = node.style;\r\n var settings = src.scene.sys.settings;\r\n\r\n if (!node || !style || !settings.visible || GameObject.RENDER_MASK !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id)) || (src.parentContainer && !src.parentContainer.willRender()))\r\n {\r\n if (node)\r\n {\r\n style.display = 'none';\r\n }\r\n \r\n return;\r\n }\r\n\r\n var parent = src.parentContainer;\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (parent)\r\n {\r\n alpha *= parent.alpha;\r\n }\r\n\r\n var camMatrix = renderer._tempMatrix1;\r\n var srcMatrix = renderer._tempMatrix2;\r\n var calcMatrix = renderer._tempMatrix3;\r\n\r\n var dx = 0;\r\n var dy = 0;\r\n\r\n var tx = '0%';\r\n var ty = '0%';\r\n\r\n if (parentMatrix)\r\n {\r\n dx = (src.width * src.scaleX) * src.originX;\r\n dy = (src.height * src.scaleY) * src.originY;\r\n\r\n srcMatrix.applyITRS(src.x - dx, src.y - dy, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n srcMatrix.e = src.x - dx;\r\n srcMatrix.f = src.y - dy;\r\n\r\n // Multiply by the src matrix, store result in calcMatrix\r\n camMatrix.multiply(srcMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n dx = (src.width) * src.originX;\r\n dy = (src.height) * src.originY;\r\n \r\n srcMatrix.applyITRS(src.x - dx, src.y - dy, src.rotation, src.scaleX, src.scaleY);\r\n \r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n tx = (100 * src.originX) + '%';\r\n ty = (100 * src.originY) + '%';\r\n\r\n srcMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n srcMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n // Multiply by the src matrix, store result in calcMatrix\r\n camMatrix.multiply(srcMatrix, calcMatrix);\r\n }\r\n\r\n if (!src.transformOnly)\r\n {\r\n style.display = 'block';\r\n style.opacity = alpha;\r\n style.zIndex = src._depth;\r\n style.pointerEvents = 'auto';\r\n style.mixBlendMode = CSSBlendModes[src._blendMode];\r\n }\r\n\r\n // https://developer.mozilla.org/en-US/docs/Web/CSS/transform\r\n\r\n style.transform =\r\n calcMatrix.getCSSMatrix() +\r\n ' skew(' + src.skewX + 'rad, ' + src.skewY + 'rad)' +\r\n ' rotate3d(' + src.rotate3d.x + ',' + src.rotate3d.y + ',' + src.rotate3d.z + ',' + src.rotate3d.w + src.rotate3dAngle + ')';\r\n\r\n style.transformOrigin = tx + ' ' + ty;\r\n};\r\n\r\nmodule.exports = DOMElementCSSRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/domelement/DOMElementCSSRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/domelement/DOMElementFactory.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/domelement/DOMElementFactory.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar DOMElement = __webpack_require__(/*! ./DOMElement */ \"./node_modules/phaser/src/gameobjects/domelement/DOMElement.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * DOM Element Game Objects are a way to control and manipulate HTML Elements over the top of your game.\r\n * \r\n * In order for DOM Elements to display you have to enable them by adding the following to your game\r\n * configuration object:\r\n * \r\n * ```javascript\r\n * dom {\r\n * createContainer: true\r\n * }\r\n * ```\r\n * \r\n * When this is added, Phaser will automatically create a DOM Container div that is positioned over the top\r\n * of the game canvas. This div is sized to match the canvas, and if the canvas size changes, as a result of\r\n * settings within the Scale Manager, the dom container is resized accordingly.\r\n * \r\n * You can create a DOM Element by either passing in DOMStrings, or by passing in a reference to an existing\r\n * Element that you wish to be placed under the control of Phaser. For example:\r\n * \r\n * ```javascript\r\n * this.add.dom(x, y, 'div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser');\r\n * ```\r\n * \r\n * The above code will insert a div element into the DOM Container at the given x/y coordinate. The DOMString in\r\n * the 4th argument sets the initial CSS style of the div and the final argument is the inner text. In this case,\r\n * it will create a lime colored div that is 220px by 100px in size with the text Phaser in it, in an Arial font.\r\n * \r\n * You should nearly always, without exception, use explicitly sized HTML Elements, in order to fully control\r\n * alignment and positioning of the elements next to regular game content.\r\n * \r\n * Rather than specify the CSS and HTML directly you can use the `load.html` File Loader to load it into the\r\n * cache and then use the `createFromCache` method instead. You can also use `createFromHTML` and various other\r\n * methods available in this class to help construct your elements.\r\n * \r\n * Once the element has been created you can then control it like you would any other Game Object. You can set its\r\n * position, scale, rotation, alpha and other properties. It will move as the main Scene Camera moves and be clipped\r\n * at the edge of the canvas. It's important to remember some limitations of DOM Elements: The obvious one is that\r\n * they appear above or below your game canvas. You cannot blend them into the display list, meaning you cannot have\r\n * a DOM Element, then a Sprite, then another DOM Element behind it.\r\n * \r\n * They also cannot be enabled for input. To do that, you have to use the `addListener` method to add native event\r\n * listeners directly. The final limitation is to do with cameras. The DOM Container is sized to match the game canvas\r\n * entirely and clipped accordingly. DOM Elements respect camera scrolling and scrollFactor settings, but if you\r\n * change the size of the camera so it no longer matches the size of the canvas, they won't be clipped accordingly.\r\n * \r\n * Also, all DOM Elements are inserted into the same DOM Container, regardless of which Scene they are created in.\r\n * \r\n * DOM Elements are a powerful way to align native HTML with your Phaser Game Objects. For example, you can insert\r\n * a login form for a multiplayer game directly into your title screen. Or a text input box for a highscore table.\r\n * Or a banner ad from a 3rd party service. Or perhaps you'd like to use them for high resolution text display and\r\n * UI. The choice is up to you, just remember that you're dealing with standard HTML and CSS floating over the top\r\n * of your game, and should treat it accordingly.\r\n *\r\n * Note: This method will only be available if the DOM Element Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#dom\r\n * @since 3.17.0\r\n *\r\n * @param {number} x - The horizontal position of this DOM Element in the world.\r\n * @param {number} y - The vertical position of this DOM Element in the world.\r\n * @param {(HTMLElement|string)} [element] - An existing DOM element, or a string. If a string starting with a # it will do a `getElementById` look-up on the string (minus the hash). Without a hash, it represents the type of element to create, i.e. 'div'.\r\n * @param {(string|any)} [style] - If a string, will be set directly as the elements `style` property value. If a plain object, will be iterated and the values transferred. In both cases the values replacing whatever CSS styles may have been previously set.\r\n * @param {string} [innerText] - If given, will be set directly as the elements `innerText` property value, replacing whatever was there before.\r\n *\r\n * @return {Phaser.GameObjects.DOMElement} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('dom', function (x, y, element, style, innerText)\r\n{\r\n var gameObject = new DOMElement(this.scene, x, y, element, style, innerText);\r\n\r\n this.displayList.add(gameObject);\r\n this.updateList.add(gameObject);\r\n\r\n return gameObject;\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/domelement/DOMElementFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/domelement/DOMElementRender.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/domelement/DOMElementRender.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./DOMElementCSSRenderer */ \"./node_modules/phaser/src/gameobjects/domelement/DOMElementCSSRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./DOMElementCSSRenderer */ \"./node_modules/phaser/src/gameobjects/domelement/DOMElementCSSRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/domelement/DOMElementRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/events/DESTROY_EVENT.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/events/DESTROY_EVENT.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Destroy Event.\r\n * \r\n * This event is dispatched when a Game Object instance is being destroyed.\r\n * \r\n * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#DESTROY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed.\r\n */\r\nmodule.exports = 'destroy';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/events/DESTROY_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/events/VIDEO_COMPLETE_EVENT.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/events/VIDEO_COMPLETE_EVENT.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Complete Event.\r\n * \r\n * This event is dispatched when a Video finishes playback by reaching the end of its duration. It\r\n * is also dispatched if a video marker sequence is being played and reaches the end.\r\n * \r\n * Note that not all videos can fire this event. Live streams, for example, have no fixed duration,\r\n * so never technically 'complete'.\r\n * \r\n * If a video is stopped from playback, via the `Video.stop` method, it will emit the\r\n * `VIDEO_STOP` event instead of this one.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('complete', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_COMPLETE\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed playback.\r\n */\r\nmodule.exports = 'complete';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/events/VIDEO_COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/events/VIDEO_CREATED_EVENT.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/events/VIDEO_CREATED_EVENT.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Created Event.\r\n * \r\n * This event is dispatched when the texture for a Video has been created. This happens\r\n * when enough of the video source has been loaded that the browser is able to render a\r\n * frame from it.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('created', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_CREATED\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event.\r\n * @param {integer} width - The width of the video.\r\n * @param {integer} height - The height of the video.\r\n */\r\nmodule.exports = 'created';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/events/VIDEO_CREATED_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/events/VIDEO_ERROR_EVENT.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/events/VIDEO_ERROR_EVENT.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Error Event.\r\n * \r\n * This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('error', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_ERROR\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error.\r\n * @param {Event} event - The native DOM event the browser raised during playback.\r\n */\r\nmodule.exports = 'error';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/events/VIDEO_ERROR_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/events/VIDEO_LOOP_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/events/VIDEO_LOOP_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Loop Event.\r\n * \r\n * This event is dispatched when a Video that is currently playing has looped. This only\r\n * happens if the `loop` parameter was specified, or the `setLoop` method was called,\r\n * and if the video has a fixed duration. Video streams, for example, cannot loop, as\r\n * they have no duration.\r\n * \r\n * Looping is based on the result of the Video `timeupdate` event. This event is not\r\n * frame-accurate, due to the way browsers work, so please do not rely on this loop\r\n * event to be time or frame precise.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('loop', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_LOOP\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which has looped.\r\n */\r\nmodule.exports = 'loop';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/events/VIDEO_LOOP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/events/VIDEO_PLAY_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/events/VIDEO_PLAY_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Play Event.\r\n * \r\n * This event is dispatched when a Video begins playback. For videos that do not require\r\n * interaction unlocking, this is usually as soon as the `Video.play` method is called.\r\n * However, for videos that require unlocking, it is fired once playback begins after\r\n * they've been unlocked.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('play', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_PLAY\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback.\r\n */\r\nmodule.exports = 'play';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/events/VIDEO_PLAY_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/events/VIDEO_SEEKED_EVENT.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/events/VIDEO_SEEKED_EVENT.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Seeked Event.\r\n * \r\n * This event is dispatched when a Video completes seeking to a new point in its timeline.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('seeked', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_SEEKED\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed seeking.\r\n */\r\nmodule.exports = 'seeked';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/events/VIDEO_SEEKED_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/events/VIDEO_SEEKING_EVENT.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/events/VIDEO_SEEKING_EVENT.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Seeking Event.\r\n * \r\n * This event is dispatched when a Video _begins_ seeking to a new point in its timeline.\r\n * When the seek is complete, it will dispatch the `VIDEO_SEEKED` event to conclude.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('seeking', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_SEEKING\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which started seeking.\r\n */\r\nmodule.exports = 'seeking';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/events/VIDEO_SEEKING_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/events/VIDEO_STOP_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/events/VIDEO_STOP_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Stopped Event.\r\n * \r\n * This event is dispatched when a Video is stopped from playback via a call to the `Video.stop` method,\r\n * either directly via game code, or indirectly as the result of changing a video source or destroying it.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('stop', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_STOP\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which stopped playback.\r\n */\r\nmodule.exports = 'stop';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/events/VIDEO_STOP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/events/VIDEO_TIMEOUT_EVENT.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/events/VIDEO_TIMEOUT_EVENT.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Timeout Event.\r\n * \r\n * This event is dispatched when a Video has exhausted its allocated time while trying to connect to a video\r\n * source to start playback.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('timeout', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_TIMEOUT\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which timed out.\r\n */\r\nmodule.exports = 'timeout';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/events/VIDEO_TIMEOUT_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/events/VIDEO_UNLOCKED_EVENT.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/events/VIDEO_UNLOCKED_EVENT.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Unlocked Event.\r\n * \r\n * This event is dispatched when a Video that was prevented from playback due to the browsers\r\n * Media Engagement Interaction policy, is unlocked by a user gesture.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('unlocked', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_UNLOCKED\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event.\r\n */\r\nmodule.exports = 'unlocked';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/events/VIDEO_UNLOCKED_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/events/index.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/events/index.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.GameObjects.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n DESTROY: __webpack_require__(/*! ./DESTROY_EVENT */ \"./node_modules/phaser/src/gameobjects/events/DESTROY_EVENT.js\"),\r\n VIDEO_COMPLETE: __webpack_require__(/*! ./VIDEO_COMPLETE_EVENT */ \"./node_modules/phaser/src/gameobjects/events/VIDEO_COMPLETE_EVENT.js\"),\r\n VIDEO_CREATED: __webpack_require__(/*! ./VIDEO_CREATED_EVENT */ \"./node_modules/phaser/src/gameobjects/events/VIDEO_CREATED_EVENT.js\"),\r\n VIDEO_ERROR: __webpack_require__(/*! ./VIDEO_ERROR_EVENT */ \"./node_modules/phaser/src/gameobjects/events/VIDEO_ERROR_EVENT.js\"),\r\n VIDEO_LOOP: __webpack_require__(/*! ./VIDEO_LOOP_EVENT */ \"./node_modules/phaser/src/gameobjects/events/VIDEO_LOOP_EVENT.js\"),\r\n VIDEO_PLAY: __webpack_require__(/*! ./VIDEO_PLAY_EVENT */ \"./node_modules/phaser/src/gameobjects/events/VIDEO_PLAY_EVENT.js\"),\r\n VIDEO_SEEKED: __webpack_require__(/*! ./VIDEO_SEEKED_EVENT */ \"./node_modules/phaser/src/gameobjects/events/VIDEO_SEEKED_EVENT.js\"),\r\n VIDEO_SEEKING: __webpack_require__(/*! ./VIDEO_SEEKING_EVENT */ \"./node_modules/phaser/src/gameobjects/events/VIDEO_SEEKING_EVENT.js\"),\r\n VIDEO_STOP: __webpack_require__(/*! ./VIDEO_STOP_EVENT */ \"./node_modules/phaser/src/gameobjects/events/VIDEO_STOP_EVENT.js\"),\r\n VIDEO_TIMEOUT: __webpack_require__(/*! ./VIDEO_TIMEOUT_EVENT */ \"./node_modules/phaser/src/gameobjects/events/VIDEO_TIMEOUT_EVENT.js\"),\r\n VIDEO_UNLOCKED: __webpack_require__(/*! ./VIDEO_UNLOCKED_EVENT */ \"./node_modules/phaser/src/gameobjects/events/VIDEO_UNLOCKED_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/extern/Extern.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/extern/Extern.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar ExternRender = __webpack_require__(/*! ./ExternRender */ \"./node_modules/phaser/src/gameobjects/extern/ExternRender.js\");\r\n\r\n/**\r\n * @classdesc\r\n * An Extern Game Object is a special type of Game Object that allows you to pass\r\n * rendering off to a 3rd party.\r\n * \r\n * When you create an Extern and place it in the display list of a Scene, the renderer will\r\n * process the list as usual. When it finds an Extern it will flush the current batch,\r\n * clear down the pipeline and prepare a transform matrix which your render function can\r\n * take advantage of, if required.\r\n * \r\n * The WebGL context is then left is a 'clean' state, ready for you to bind your own shaders,\r\n * or draw to it, whatever you wish to do. Once you've finished, you should free-up any\r\n * of your resources. The Extern will then rebind the Phaser pipeline and carry on \r\n * rendering the display list.\r\n * \r\n * Although this object has lots of properties such as Alpha, Blend Mode and Tint, none of\r\n * them are used during rendering unless you take advantage of them in your own render code.\r\n *\r\n * @class Extern\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.16.0\r\n *\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Size\r\n * @extends Phaser.GameObjects.Components.Texture\r\n * @extends Phaser.GameObjects.Components.Tint\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n */\r\nvar Extern = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.Alpha,\r\n Components.BlendMode,\r\n Components.Depth,\r\n Components.Flip,\r\n Components.Origin,\r\n Components.ScrollFactor,\r\n Components.Size,\r\n Components.Texture,\r\n Components.Tint,\r\n Components.Transform,\r\n Components.Visible,\r\n ExternRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Extern (scene)\r\n {\r\n GameObject.call(this, scene, 'Extern');\r\n },\r\n\r\n preUpdate: function ()\r\n {\r\n // override this!\r\n // Arguments: time, delta\r\n },\r\n\r\n render: function ()\r\n {\r\n // override this!\r\n // Arguments: renderer, camera, calcMatrix\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Extern;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/extern/Extern.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/extern/ExternCanvasRenderer.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/extern/ExternCanvasRenderer.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/extern/ExternCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/extern/ExternFactory.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/extern/ExternFactory.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Extern = __webpack_require__(/*! ./Extern */ \"./node_modules/phaser/src/gameobjects/extern/Extern.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Extern Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Extern Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#extern\r\n * @since 3.16.0\r\n *\r\n * @return {Phaser.GameObjects.Extern} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('extern', function ()\r\n{\r\n var extern = new Extern(this.scene);\r\n\r\n this.displayList.add(extern);\r\n this.updateList.add(extern);\r\n\r\n return extern;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/extern/ExternFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/extern/ExternRender.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/extern/ExternRender.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./ExternWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/extern/ExternWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./ExternCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/extern/ExternCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/extern/ExternRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/extern/ExternWebGLRenderer.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/extern/ExternWebGLRenderer.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Extern#renderWebGL\r\n * @since 3.16.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Extern} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar ExternWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var pipeline = renderer.currentPipeline;\r\n\r\n renderer.clearPipeline();\r\n\r\n var camMatrix = renderer._tempMatrix1;\r\n var spriteMatrix = renderer._tempMatrix2;\r\n var calcMatrix = renderer._tempMatrix3;\r\n\r\n spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n spriteMatrix.e = src.x;\r\n spriteMatrix.f = src.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n spriteMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n spriteMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n\r\n // Callback\r\n src.render.call(src, renderer, camera, calcMatrix);\r\n\r\n renderer.rebindPipeline(pipeline);\r\n};\r\n\r\nmodule.exports = ExternWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/extern/ExternWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/graphics/Commands.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/graphics/Commands.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nmodule.exports = {\r\n\r\n ARC: 0,\r\n BEGIN_PATH: 1,\r\n CLOSE_PATH: 2,\r\n FILL_RECT: 3,\r\n LINE_TO: 4,\r\n MOVE_TO: 5,\r\n LINE_STYLE: 6,\r\n FILL_STYLE: 7,\r\n FILL_PATH: 8,\r\n STROKE_PATH: 9,\r\n FILL_TRIANGLE: 10,\r\n STROKE_TRIANGLE: 11,\r\n SAVE: 14,\r\n RESTORE: 15,\r\n TRANSLATE: 16,\r\n SCALE: 17,\r\n ROTATE: 18,\r\n SET_TEXTURE: 19,\r\n CLEAR_TEXTURE: 20,\r\n GRADIENT_FILL_STYLE: 21,\r\n GRADIENT_LINE_STYLE: 22\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/graphics/Commands.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/graphics/Graphics.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/graphics/Graphics.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BaseCamera = __webpack_require__(/*! ../../cameras/2d/BaseCamera.js */ \"./node_modules/phaser/src/cameras/2d/BaseCamera.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Commands = __webpack_require__(/*! ./Commands */ \"./node_modules/phaser/src/gameobjects/graphics/Commands.js\");\r\nvar ComponentsAlpha = __webpack_require__(/*! ../components/AlphaSingle */ \"./node_modules/phaser/src/gameobjects/components/AlphaSingle.js\");\r\nvar ComponentsBlendMode = __webpack_require__(/*! ../components/BlendMode */ \"./node_modules/phaser/src/gameobjects/components/BlendMode.js\");\r\nvar ComponentsDepth = __webpack_require__(/*! ../components/Depth */ \"./node_modules/phaser/src/gameobjects/components/Depth.js\");\r\nvar ComponentsMask = __webpack_require__(/*! ../components/Mask */ \"./node_modules/phaser/src/gameobjects/components/Mask.js\");\r\nvar ComponentsPipeline = __webpack_require__(/*! ../components/Pipeline */ \"./node_modules/phaser/src/gameobjects/components/Pipeline.js\");\r\nvar ComponentsTransform = __webpack_require__(/*! ../components/Transform */ \"./node_modules/phaser/src/gameobjects/components/Transform.js\");\r\nvar ComponentsVisible = __webpack_require__(/*! ../components/Visible */ \"./node_modules/phaser/src/gameobjects/components/Visible.js\");\r\nvar ComponentsScrollFactor = __webpack_require__(/*! ../components/ScrollFactor */ \"./node_modules/phaser/src/gameobjects/components/ScrollFactor.js\");\r\n\r\nvar TransformMatrix = __webpack_require__(/*! ../components/TransformMatrix */ \"./node_modules/phaser/src/gameobjects/components/TransformMatrix.js\");\r\n\r\nvar Ellipse = __webpack_require__(/*! ../../geom/ellipse/Ellipse */ \"./node_modules/phaser/src/geom/ellipse/Ellipse.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\nvar Render = __webpack_require__(/*! ./GraphicsRender */ \"./node_modules/phaser/src/gameobjects/graphics/GraphicsRender.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Graphics object is a way to draw primitive shapes to your game. Primitives include forms of geometry, such as\r\n * Rectangles, Circles, and Polygons. They also include lines, arcs and curves. When you initially create a Graphics\r\n * object it will be empty.\r\n *\r\n * To draw to it you must first specify a line style or fill style (or both), draw shapes using paths, and finally\r\n * fill or stroke them. For example:\r\n *\r\n * ```javascript\r\n * graphics.lineStyle(5, 0xFF00FF, 1.0);\r\n * graphics.beginPath();\r\n * graphics.moveTo(100, 100);\r\n * graphics.lineTo(200, 200);\r\n * graphics.closePath();\r\n * graphics.strokePath();\r\n * ```\r\n *\r\n * There are also many helpful methods that draw and fill/stroke common shapes for you.\r\n *\r\n * ```javascript\r\n * graphics.lineStyle(5, 0xFF00FF, 1.0);\r\n * graphics.fillStyle(0xFFFFFF, 1.0);\r\n * graphics.fillRect(50, 50, 400, 200);\r\n * graphics.strokeRect(50, 50, 400, 200);\r\n * ```\r\n *\r\n * When a Graphics object is rendered it will render differently based on if the game is running under Canvas or WebGL.\r\n * Under Canvas it will use the HTML Canvas context drawing operations to draw the path.\r\n * Under WebGL the graphics data is decomposed into polygons. Both of these are expensive processes, especially with\r\n * complex shapes.\r\n *\r\n * If your Graphics object doesn't change much (or at all) once you've drawn your shape to it, then you will help\r\n * performance by calling {@link Phaser.GameObjects.Graphics#generateTexture}. This will 'bake' the Graphics object into\r\n * a Texture, and return it. You can then use this Texture for Sprites or other display objects. If your Graphics object\r\n * updates frequently then you should avoid doing this, as it will constantly generate new textures, which will consume\r\n * memory.\r\n *\r\n * As you can tell, Graphics objects are a bit of a trade-off. While they are extremely useful, you need to be careful\r\n * in their complexity and quantity of them in your game.\r\n *\r\n * @class Graphics\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.GameObjects.Components.AlphaSingle\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Graphics object belongs.\r\n * @param {Phaser.Types.GameObjects.Graphics.Options} [options] - Options that set the position and default style of this Graphics object.\r\n */\r\nvar Graphics = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n ComponentsAlpha,\r\n ComponentsBlendMode,\r\n ComponentsDepth,\r\n ComponentsMask,\r\n ComponentsPipeline,\r\n ComponentsTransform,\r\n ComponentsVisible,\r\n ComponentsScrollFactor,\r\n Render\r\n ],\r\n\r\n initialize:\r\n\r\n function Graphics (scene, options)\r\n {\r\n var x = GetValue(options, 'x', 0);\r\n var y = GetValue(options, 'y', 0);\r\n\r\n GameObject.call(this, scene, 'Graphics');\r\n\r\n this.setPosition(x, y);\r\n this.initPipeline();\r\n\r\n /**\r\n * The horizontal display origin of the Graphics.\r\n *\r\n * @name Phaser.GameObjects.Graphics#displayOriginX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.displayOriginX = 0;\r\n\r\n /**\r\n * The vertical display origin of the Graphics.\r\n *\r\n * @name Phaser.GameObjects.Graphics#displayOriginY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.displayOriginY = 0;\r\n\r\n /**\r\n * The array of commands used to render the Graphics.\r\n *\r\n * @name Phaser.GameObjects.Graphics#commandBuffer\r\n * @type {array}\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.commandBuffer = [];\r\n\r\n /**\r\n * The default fill color for shapes rendered by this Graphics object.\r\n *\r\n * @name Phaser.GameObjects.Graphics#defaultFillColor\r\n * @type {number}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.defaultFillColor = -1;\r\n\r\n /**\r\n * The default fill alpha for shapes rendered by this Graphics object.\r\n *\r\n * @name Phaser.GameObjects.Graphics#defaultFillAlpha\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.defaultFillAlpha = 1;\r\n\r\n /**\r\n * The default stroke width for shapes rendered by this Graphics object.\r\n *\r\n * @name Phaser.GameObjects.Graphics#defaultStrokeWidth\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.defaultStrokeWidth = 1;\r\n\r\n /**\r\n * The default stroke color for shapes rendered by this Graphics object.\r\n *\r\n * @name Phaser.GameObjects.Graphics#defaultStrokeColor\r\n * @type {number}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.defaultStrokeColor = -1;\r\n\r\n /**\r\n * The default stroke alpha for shapes rendered by this Graphics object.\r\n *\r\n * @name Phaser.GameObjects.Graphics#defaultStrokeAlpha\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.defaultStrokeAlpha = 1;\r\n\r\n /**\r\n * Internal property that keeps track of the line width style setting.\r\n *\r\n * @name Phaser.GameObjects.Graphics#_lineWidth\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._lineWidth = 1.0;\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.GameObjects.Graphics#_tempMatrix1\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.17.0\r\n */\r\n this._tempMatrix1 = new TransformMatrix();\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.GameObjects.Graphics#_tempMatrix2\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.17.0\r\n */\r\n this._tempMatrix2 = new TransformMatrix();\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.GameObjects.Graphics#_tempMatrix3\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.17.0\r\n */\r\n this._tempMatrix3 = new TransformMatrix();\r\n\r\n this.setDefaultStyles(options);\r\n },\r\n\r\n /**\r\n * Set the default style settings for this Graphics object.\r\n *\r\n * @method Phaser.GameObjects.Graphics#setDefaultStyles\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Graphics.Styles} options - The styles to set as defaults.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n setDefaultStyles: function (options)\r\n {\r\n if (GetValue(options, 'lineStyle', null))\r\n {\r\n this.defaultStrokeWidth = GetValue(options, 'lineStyle.width', 1);\r\n this.defaultStrokeColor = GetValue(options, 'lineStyle.color', 0xffffff);\r\n this.defaultStrokeAlpha = GetValue(options, 'lineStyle.alpha', 1);\r\n\r\n this.lineStyle(this.defaultStrokeWidth, this.defaultStrokeColor, this.defaultStrokeAlpha);\r\n }\r\n\r\n if (GetValue(options, 'fillStyle', null))\r\n {\r\n this.defaultFillColor = GetValue(options, 'fillStyle.color', 0xffffff);\r\n this.defaultFillAlpha = GetValue(options, 'fillStyle.alpha', 1);\r\n\r\n this.fillStyle(this.defaultFillColor, this.defaultFillAlpha);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the current line style.\r\n *\r\n * @method Phaser.GameObjects.Graphics#lineStyle\r\n * @since 3.0.0\r\n *\r\n * @param {number} lineWidth - The stroke width.\r\n * @param {number} color - The stroke color.\r\n * @param {number} [alpha=1] - The stroke alpha.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n lineStyle: function (lineWidth, color, alpha)\r\n {\r\n if (alpha === undefined) { alpha = 1; }\r\n\r\n this.commandBuffer.push(\r\n Commands.LINE_STYLE,\r\n lineWidth, color, alpha\r\n );\r\n\r\n this._lineWidth = lineWidth;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the current fill style.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fillStyle\r\n * @since 3.0.0\r\n *\r\n * @param {number} color - The fill color.\r\n * @param {number} [alpha=1] - The fill alpha.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fillStyle: function (color, alpha)\r\n {\r\n if (alpha === undefined) { alpha = 1; }\r\n\r\n this.commandBuffer.push(\r\n Commands.FILL_STYLE,\r\n color, alpha\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a gradient fill style. This is a WebGL only feature.\r\n *\r\n * The gradient color values represent the 4 corners of an untransformed rectangle.\r\n * The gradient is used to color all filled shapes and paths drawn after calling this method.\r\n * If you wish to turn a gradient off, call `fillStyle` and provide a new single fill color.\r\n *\r\n * When filling a triangle only the first 3 color values provided are used for the 3 points of a triangle.\r\n *\r\n * This feature is best used only on rectangles and triangles. All other shapes will give strange results.\r\n *\r\n * Note that for objects such as arcs or ellipses, or anything which is made out of triangles, each triangle used\r\n * will be filled with a gradient on its own. There is no ability to gradient fill a shape or path as a single\r\n * entity at this time.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fillGradientStyle\r\n * @webglOnly\r\n * @since 3.12.0\r\n *\r\n * @param {integer} topLeft - The tint being applied to the top-left of the Game Object.\r\n * @param {integer} topRight - The tint being applied to the top-right of the Game Object.\r\n * @param {integer} bottomLeft - The tint being applied to the bottom-left of the Game Object.\r\n * @param {integer} bottomRight - The tint being applied to the bottom-right of the Game Object.\r\n * @param {number} [alpha=1] - The fill alpha.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fillGradientStyle: function (topLeft, topRight, bottomLeft, bottomRight, alpha)\r\n {\r\n if (alpha === undefined) { alpha = 1; }\r\n\r\n this.commandBuffer.push(\r\n Commands.GRADIENT_FILL_STYLE,\r\n alpha, topLeft, topRight, bottomLeft, bottomRight\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a gradient line style. This is a WebGL only feature.\r\n *\r\n * The gradient color values represent the 4 corners of an untransformed rectangle.\r\n * The gradient is used to color all stroked shapes and paths drawn after calling this method.\r\n * If you wish to turn a gradient off, call `lineStyle` and provide a new single line color.\r\n *\r\n * This feature is best used only on single lines. All other shapes will give strange results.\r\n *\r\n * Note that for objects such as arcs or ellipses, or anything which is made out of triangles, each triangle used\r\n * will be filled with a gradient on its own. There is no ability to gradient stroke a shape or path as a single\r\n * entity at this time.\r\n *\r\n * @method Phaser.GameObjects.Graphics#lineGradientStyle\r\n * @webglOnly\r\n * @since 3.12.0\r\n *\r\n * @param {number} lineWidth - The stroke width.\r\n * @param {integer} topLeft - The tint being applied to the top-left of the Game Object.\r\n * @param {integer} topRight - The tint being applied to the top-right of the Game Object.\r\n * @param {integer} bottomLeft - The tint being applied to the bottom-left of the Game Object.\r\n * @param {integer} bottomRight - The tint being applied to the bottom-right of the Game Object.\r\n * @param {number} [alpha=1] - The fill alpha.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n lineGradientStyle: function (lineWidth, topLeft, topRight, bottomLeft, bottomRight, alpha)\r\n {\r\n if (alpha === undefined) { alpha = 1; }\r\n\r\n this.commandBuffer.push(\r\n Commands.GRADIENT_LINE_STYLE,\r\n lineWidth, alpha, topLeft, topRight, bottomLeft, bottomRight\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the texture frame this Graphics Object will use when drawing all shapes defined after calling this.\r\n *\r\n * Textures are referenced by their string-based keys, as stored in the Texture Manager.\r\n *\r\n * Once set, all shapes will use this texture. Call this method with no arguments to clear it.\r\n *\r\n * The textures are not tiled. They are stretched to the dimensions of the shapes being rendered. For this reason,\r\n * it works best with seamless / tileable textures.\r\n *\r\n * The mode argument controls how the textures are combined with the fill colors. The default value (0) will\r\n * multiply the texture by the fill color. A value of 1 will use just the fill color, but the alpha data from the texture,\r\n * and a value of 2 will use just the texture and no fill color at all.\r\n *\r\n * @method Phaser.GameObjects.Graphics#setTexture\r\n * @since 3.12.0\r\n * @webglOnly\r\n *\r\n * @param {string} [key] - The key of the texture to be used, as stored in the Texture Manager. Leave blank to clear a previously set texture.\r\n * @param {(string|integer)} [frame] - The name or index of the frame within the Texture.\r\n * @param {number} [mode=0] - The texture tint mode. 0 is multiply, 1 is alpha only and 2 is texture only.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setTexture: function (key, frame, mode)\r\n {\r\n if (mode === undefined) { mode = 0; }\r\n\r\n if (key === undefined)\r\n {\r\n this.commandBuffer.push(\r\n Commands.CLEAR_TEXTURE\r\n );\r\n }\r\n else\r\n {\r\n var textureFrame = this.scene.sys.textures.getFrame(key, frame);\r\n\r\n if (textureFrame)\r\n {\r\n if (mode === 2)\r\n {\r\n mode = 3;\r\n }\r\n\r\n this.commandBuffer.push(\r\n Commands.SET_TEXTURE,\r\n textureFrame,\r\n mode\r\n );\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Start a new shape path.\r\n *\r\n * @method Phaser.GameObjects.Graphics#beginPath\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n beginPath: function ()\r\n {\r\n this.commandBuffer.push(\r\n Commands.BEGIN_PATH\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Close the current path.\r\n *\r\n * @method Phaser.GameObjects.Graphics#closePath\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n closePath: function ()\r\n {\r\n this.commandBuffer.push(\r\n Commands.CLOSE_PATH\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Fill the current path.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fillPath\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fillPath: function ()\r\n {\r\n this.commandBuffer.push(\r\n Commands.FILL_PATH\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Fill the current path.\r\n * \r\n * This is an alias for `Graphics.fillPath` and does the same thing.\r\n * It was added to match the CanvasRenderingContext 2D API.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fill\r\n * @since 3.16.0\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fill: function ()\r\n {\r\n this.commandBuffer.push(\r\n Commands.FILL_PATH\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stroke the current path.\r\n *\r\n * @method Phaser.GameObjects.Graphics#strokePath\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n strokePath: function ()\r\n {\r\n this.commandBuffer.push(\r\n Commands.STROKE_PATH\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stroke the current path.\r\n * \r\n * This is an alias for `Graphics.strokePath` and does the same thing.\r\n * It was added to match the CanvasRenderingContext 2D API.\r\n *\r\n * @method Phaser.GameObjects.Graphics#stroke\r\n * @since 3.16.0\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n stroke: function ()\r\n {\r\n this.commandBuffer.push(\r\n Commands.STROKE_PATH\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Fill the given circle.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fillCircleShape\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The circle to fill.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fillCircleShape: function (circle)\r\n {\r\n return this.fillCircle(circle.x, circle.y, circle.radius);\r\n },\r\n\r\n /**\r\n * Stroke the given circle.\r\n *\r\n * @method Phaser.GameObjects.Graphics#strokeCircleShape\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The circle to stroke.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n strokeCircleShape: function (circle)\r\n {\r\n return this.strokeCircle(circle.x, circle.y, circle.radius);\r\n },\r\n\r\n /**\r\n * Fill a circle with the given position and radius.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fillCircle\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the center of the circle.\r\n * @param {number} y - The y coordinate of the center of the circle.\r\n * @param {number} radius - The radius of the circle.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fillCircle: function (x, y, radius)\r\n {\r\n this.beginPath();\r\n this.arc(x, y, radius, 0, MATH_CONST.PI2);\r\n this.fillPath();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stroke a circle with the given position and radius.\r\n *\r\n * @method Phaser.GameObjects.Graphics#strokeCircle\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the center of the circle.\r\n * @param {number} y - The y coordinate of the center of the circle.\r\n * @param {number} radius - The radius of the circle.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n strokeCircle: function (x, y, radius)\r\n {\r\n this.beginPath();\r\n this.arc(x, y, radius, 0, MATH_CONST.PI2);\r\n this.strokePath();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Fill the given rectangle.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fillRectShape\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The rectangle to fill.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fillRectShape: function (rect)\r\n {\r\n return this.fillRect(rect.x, rect.y, rect.width, rect.height);\r\n },\r\n\r\n /**\r\n * Stroke the given rectangle.\r\n *\r\n * @method Phaser.GameObjects.Graphics#strokeRectShape\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The rectangle to stroke.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n strokeRectShape: function (rect)\r\n {\r\n return this.strokeRect(rect.x, rect.y, rect.width, rect.height);\r\n },\r\n\r\n /**\r\n * Fill a rectangle with the given position and size.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fillRect\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the top-left of the rectangle.\r\n * @param {number} y - The y coordinate of the top-left of the rectangle.\r\n * @param {number} width - The width of the rectangle.\r\n * @param {number} height - The height of the rectangle.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fillRect: function (x, y, width, height)\r\n {\r\n this.commandBuffer.push(\r\n Commands.FILL_RECT,\r\n x, y, width, height\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stroke a rectangle with the given position and size.\r\n *\r\n * @method Phaser.GameObjects.Graphics#strokeRect\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the top-left of the rectangle.\r\n * @param {number} y - The y coordinate of the top-left of the rectangle.\r\n * @param {number} width - The width of the rectangle.\r\n * @param {number} height - The height of the rectangle.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n strokeRect: function (x, y, width, height)\r\n {\r\n var lineWidthHalf = this._lineWidth / 2;\r\n var minx = x - lineWidthHalf;\r\n var maxx = x + lineWidthHalf;\r\n\r\n this.beginPath();\r\n this.moveTo(x, y);\r\n this.lineTo(x, y + height);\r\n this.strokePath();\r\n\r\n this.beginPath();\r\n this.moveTo(x + width, y);\r\n this.lineTo(x + width, y + height);\r\n this.strokePath();\r\n\r\n this.beginPath();\r\n this.moveTo(minx, y);\r\n this.lineTo(maxx + width, y);\r\n this.strokePath();\r\n\r\n this.beginPath();\r\n this.moveTo(minx, y + height);\r\n this.lineTo(maxx + width, y + height);\r\n this.strokePath();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Fill a rounded rectangle with the given position, size and radius.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fillRoundedRect\r\n * @since 3.11.0\r\n *\r\n * @param {number} x - The x coordinate of the top-left of the rectangle.\r\n * @param {number} y - The y coordinate of the top-left of the rectangle.\r\n * @param {number} width - The width of the rectangle.\r\n * @param {number} height - The height of the rectangle.\r\n * @param {(Phaser.Types.GameObjects.Graphics.RoundedRectRadius|number)} [radius=20] - The corner radius; It can also be an object to specify different radii for corners.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fillRoundedRect: function (x, y, width, height, radius)\r\n {\r\n if (radius === undefined) { radius = 20; }\r\n\r\n var tl = radius;\r\n var tr = radius;\r\n var bl = radius;\r\n var br = radius;\r\n\r\n if (typeof radius !== 'number')\r\n {\r\n tl = GetFastValue(radius, 'tl', 20);\r\n tr = GetFastValue(radius, 'tr', 20);\r\n bl = GetFastValue(radius, 'bl', 20);\r\n br = GetFastValue(radius, 'br', 20);\r\n }\r\n\r\n this.beginPath();\r\n this.moveTo(x + tl, y);\r\n this.lineTo(x + width - tr, y);\r\n this.arc(x + width - tr, y + tr, tr, -MATH_CONST.TAU, 0);\r\n this.lineTo(x + width, y + height - br);\r\n this.arc(x + width - br, y + height - br, br, 0, MATH_CONST.TAU);\r\n this.lineTo(x + bl, y + height);\r\n this.arc(x + bl, y + height - bl, bl, MATH_CONST.TAU, Math.PI);\r\n this.lineTo(x, y + tl);\r\n this.arc(x + tl, y + tl, tl, -Math.PI, -MATH_CONST.TAU);\r\n this.fillPath();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stroke a rounded rectangle with the given position, size and radius.\r\n *\r\n * @method Phaser.GameObjects.Graphics#strokeRoundedRect\r\n * @since 3.11.0\r\n *\r\n * @param {number} x - The x coordinate of the top-left of the rectangle.\r\n * @param {number} y - The y coordinate of the top-left of the rectangle.\r\n * @param {number} width - The width of the rectangle.\r\n * @param {number} height - The height of the rectangle.\r\n * @param {(Phaser.Types.GameObjects.Graphics.RoundedRectRadius|number)} [radius=20] - The corner radius; It can also be an object to specify different radii for corners.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n strokeRoundedRect: function (x, y, width, height, radius)\r\n {\r\n if (radius === undefined) { radius = 20; }\r\n\r\n var tl = radius;\r\n var tr = radius;\r\n var bl = radius;\r\n var br = radius;\r\n\r\n if (typeof radius !== 'number')\r\n {\r\n tl = GetFastValue(radius, 'tl', 20);\r\n tr = GetFastValue(radius, 'tr', 20);\r\n bl = GetFastValue(radius, 'bl', 20);\r\n br = GetFastValue(radius, 'br', 20);\r\n }\r\n\r\n this.beginPath();\r\n this.moveTo(x + tl, y);\r\n this.lineTo(x + width - tr, y);\r\n this.arc(x + width - tr, y + tr, tr, -MATH_CONST.TAU, 0);\r\n this.lineTo(x + width, y + height - br);\r\n this.arc(x + width - br, y + height - br, br, 0, MATH_CONST.TAU);\r\n this.lineTo(x + bl, y + height);\r\n this.arc(x + bl, y + height - bl, bl, MATH_CONST.TAU, Math.PI);\r\n this.lineTo(x, y + tl);\r\n this.arc(x + tl, y + tl, tl, -Math.PI, -MATH_CONST.TAU);\r\n this.strokePath();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Fill the given point.\r\n *\r\n * Draws a square at the given position, 1 pixel in size by default.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fillPointShape\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - The point to fill.\r\n * @param {number} [size=1] - The size of the square to draw.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fillPointShape: function (point, size)\r\n {\r\n return this.fillPoint(point.x, point.y, size);\r\n },\r\n\r\n /**\r\n * Fill a point at the given position.\r\n *\r\n * Draws a square at the given position, 1 pixel in size by default.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fillPoint\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the point.\r\n * @param {number} y - The y coordinate of the point.\r\n * @param {number} [size=1] - The size of the square to draw.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fillPoint: function (x, y, size)\r\n {\r\n if (!size || size < 1)\r\n {\r\n size = 1;\r\n }\r\n else\r\n {\r\n x -= (size / 2);\r\n y -= (size / 2);\r\n }\r\n\r\n this.commandBuffer.push(\r\n Commands.FILL_RECT,\r\n x, y, size, size\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Fill the given triangle.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fillTriangleShape\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The triangle to fill.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fillTriangleShape: function (triangle)\r\n {\r\n return this.fillTriangle(triangle.x1, triangle.y1, triangle.x2, triangle.y2, triangle.x3, triangle.y3);\r\n },\r\n\r\n /**\r\n * Stroke the given triangle.\r\n *\r\n * @method Phaser.GameObjects.Graphics#strokeTriangleShape\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The triangle to stroke.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n strokeTriangleShape: function (triangle)\r\n {\r\n return this.strokeTriangle(triangle.x1, triangle.y1, triangle.x2, triangle.y2, triangle.x3, triangle.y3);\r\n },\r\n\r\n /**\r\n * Fill a triangle with the given points.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fillTriangle\r\n * @since 3.0.0\r\n *\r\n * @param {number} x0 - The x coordinate of the first point.\r\n * @param {number} y0 - The y coordinate of the first point.\r\n * @param {number} x1 - The x coordinate of the second point.\r\n * @param {number} y1 - The y coordinate of the second point.\r\n * @param {number} x2 - The x coordinate of the third point.\r\n * @param {number} y2 - The y coordinate of the third point.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fillTriangle: function (x0, y0, x1, y1, x2, y2)\r\n {\r\n this.commandBuffer.push(\r\n Commands.FILL_TRIANGLE,\r\n x0, y0, x1, y1, x2, y2\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stroke a triangle with the given points.\r\n *\r\n * @method Phaser.GameObjects.Graphics#strokeTriangle\r\n * @since 3.0.0\r\n *\r\n * @param {number} x0 - The x coordinate of the first point.\r\n * @param {number} y0 - The y coordinate of the first point.\r\n * @param {number} x1 - The x coordinate of the second point.\r\n * @param {number} y1 - The y coordinate of the second point.\r\n * @param {number} x2 - The x coordinate of the third point.\r\n * @param {number} y2 - The y coordinate of the third point.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n strokeTriangle: function (x0, y0, x1, y1, x2, y2)\r\n {\r\n this.commandBuffer.push(\r\n Commands.STROKE_TRIANGLE,\r\n x0, y0, x1, y1, x2, y2\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Draw the given line.\r\n *\r\n * @method Phaser.GameObjects.Graphics#strokeLineShape\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to stroke.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n strokeLineShape: function (line)\r\n {\r\n return this.lineBetween(line.x1, line.y1, line.x2, line.y2);\r\n },\r\n\r\n /**\r\n * Draw a line between the given points.\r\n *\r\n * @method Phaser.GameObjects.Graphics#lineBetween\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the start point of the line.\r\n * @param {number} y1 - The y coordinate of the start point of the line.\r\n * @param {number} x2 - The x coordinate of the end point of the line.\r\n * @param {number} y2 - The y coordinate of the end point of the line.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n lineBetween: function (x1, y1, x2, y2)\r\n {\r\n this.beginPath();\r\n this.moveTo(x1, y1);\r\n this.lineTo(x2, y2);\r\n this.strokePath();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Draw a line from the current drawing position to the given position.\r\n *\r\n * Moves the current drawing position to the given position.\r\n *\r\n * @method Phaser.GameObjects.Graphics#lineTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate to draw the line to.\r\n * @param {number} y - The y coordinate to draw the line to.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n lineTo: function (x, y)\r\n {\r\n this.commandBuffer.push(\r\n Commands.LINE_TO,\r\n x, y\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Move the current drawing position to the given position.\r\n *\r\n * @method Phaser.GameObjects.Graphics#moveTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate to move to.\r\n * @param {number} y - The y coordinate to move to.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n moveTo: function (x, y)\r\n {\r\n this.commandBuffer.push(\r\n Commands.MOVE_TO,\r\n x, y\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stroke the shape represented by the given array of points.\r\n *\r\n * Pass `closeShape` to automatically close the shape by joining the last to the first point.\r\n * \r\n * Pass `closePath` to automatically close the path before it is stroked.\r\n *\r\n * @method Phaser.GameObjects.Graphics#strokePoints\r\n * @since 3.0.0\r\n *\r\n * @param {(array|Phaser.Geom.Point[])} points - The points to stroke.\r\n * @param {boolean} [closeShape=false] - When `true`, the shape is closed by joining the last point to the first point.\r\n * @param {boolean} [closePath=false] - When `true`, the path is closed before being stroked.\r\n * @param {integer} [endIndex] - The index of `points` to stop drawing at. Defaults to `points.length`.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n strokePoints: function (points, closeShape, closePath, endIndex)\r\n {\r\n if (closeShape === undefined) { closeShape = false; }\r\n if (closePath === undefined) { closePath = false; }\r\n if (endIndex === undefined) { endIndex = points.length; }\r\n\r\n this.beginPath();\r\n\r\n this.moveTo(points[0].x, points[0].y);\r\n\r\n for (var i = 1; i < endIndex; i++)\r\n {\r\n this.lineTo(points[i].x, points[i].y);\r\n }\r\n\r\n if (closeShape)\r\n {\r\n this.lineTo(points[0].x, points[0].y);\r\n }\r\n\r\n if (closePath)\r\n {\r\n this.closePath();\r\n }\r\n\r\n this.strokePath();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Fill the shape represented by the given array of points.\r\n *\r\n * Pass `closeShape` to automatically close the shape by joining the last to the first point.\r\n * \r\n * Pass `closePath` to automatically close the path before it is filled.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fillPoints\r\n * @since 3.0.0\r\n *\r\n * @param {(array|Phaser.Geom.Point[])} points - The points to fill.\r\n * @param {boolean} [closeShape=false] - When `true`, the shape is closed by joining the last point to the first point.\r\n * @param {boolean} [closePath=false] - When `true`, the path is closed before being stroked.\r\n * @param {integer} [endIndex] - The index of `points` to stop at. Defaults to `points.length`.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fillPoints: function (points, closeShape, closePath, endIndex)\r\n {\r\n if (closeShape === undefined) { closeShape = false; }\r\n if (closePath === undefined) { closePath = false; }\r\n if (endIndex === undefined) { endIndex = points.length; }\r\n\r\n this.beginPath();\r\n\r\n this.moveTo(points[0].x, points[0].y);\r\n\r\n for (var i = 1; i < endIndex; i++)\r\n {\r\n this.lineTo(points[i].x, points[i].y);\r\n }\r\n\r\n if (closeShape)\r\n {\r\n this.lineTo(points[0].x, points[0].y);\r\n }\r\n\r\n if (closePath)\r\n {\r\n this.closePath();\r\n }\r\n\r\n this.fillPath();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stroke the given ellipse.\r\n *\r\n * @method Phaser.GameObjects.Graphics#strokeEllipseShape\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Ellipse} ellipse - The ellipse to stroke.\r\n * @param {integer} [smoothness=32] - The number of points to draw the ellipse with.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n strokeEllipseShape: function (ellipse, smoothness)\r\n {\r\n if (smoothness === undefined) { smoothness = 32; }\r\n\r\n var points = ellipse.getPoints(smoothness);\r\n\r\n return this.strokePoints(points, true);\r\n },\r\n\r\n /**\r\n * Stroke an ellipse with the given position and size.\r\n *\r\n * @method Phaser.GameObjects.Graphics#strokeEllipse\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the center of the ellipse.\r\n * @param {number} y - The y coordinate of the center of the ellipse.\r\n * @param {number} width - The width of the ellipse.\r\n * @param {number} height - The height of the ellipse.\r\n * @param {integer} [smoothness=32] - The number of points to draw the ellipse with.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n strokeEllipse: function (x, y, width, height, smoothness)\r\n {\r\n if (smoothness === undefined) { smoothness = 32; }\r\n\r\n var ellipse = new Ellipse(x, y, width, height);\r\n\r\n var points = ellipse.getPoints(smoothness);\r\n\r\n return this.strokePoints(points, true);\r\n },\r\n\r\n /**\r\n * Fill the given ellipse.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fillEllipseShape\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Ellipse} ellipse - The ellipse to fill.\r\n * @param {integer} [smoothness=32] - The number of points to draw the ellipse with.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fillEllipseShape: function (ellipse, smoothness)\r\n {\r\n if (smoothness === undefined) { smoothness = 32; }\r\n\r\n var points = ellipse.getPoints(smoothness);\r\n\r\n return this.fillPoints(points, true);\r\n },\r\n\r\n /**\r\n * Fill an ellipse with the given position and size.\r\n *\r\n * @method Phaser.GameObjects.Graphics#fillEllipse\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the center of the ellipse.\r\n * @param {number} y - The y coordinate of the center of the ellipse.\r\n * @param {number} width - The width of the ellipse.\r\n * @param {number} height - The height of the ellipse.\r\n * @param {integer} [smoothness=32] - The number of points to draw the ellipse with.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n fillEllipse: function (x, y, width, height, smoothness)\r\n {\r\n if (smoothness === undefined) { smoothness = 32; }\r\n\r\n var ellipse = new Ellipse(x, y, width, height);\r\n\r\n var points = ellipse.getPoints(smoothness);\r\n\r\n return this.fillPoints(points, true);\r\n },\r\n\r\n /**\r\n * Draw an arc.\r\n *\r\n * This method can be used to create circles, or parts of circles.\r\n * \r\n * Make sure you call `beginPath` before starting the arc unless you wish for the arc to automatically\r\n * close when filled or stroked.\r\n *\r\n * Use the optional `overshoot` argument increase the number of iterations that take place when\r\n * the arc is rendered in WebGL. This is useful if you're drawing an arc with an especially thick line,\r\n * as it will allow the arc to fully join-up. Try small values at first, i.e. 0.01.\r\n *\r\n * Call {@link Phaser.GameObjects.Graphics#fillPath} or {@link Phaser.GameObjects.Graphics#strokePath} after calling\r\n * this method to draw the arc.\r\n *\r\n * @method Phaser.GameObjects.Graphics#arc\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the center of the circle.\r\n * @param {number} y - The y coordinate of the center of the circle.\r\n * @param {number} radius - The radius of the circle.\r\n * @param {number} startAngle - The starting angle, in radians.\r\n * @param {number} endAngle - The ending angle, in radians.\r\n * @param {boolean} [anticlockwise=false] - Whether the drawing should be anticlockwise or clockwise.\r\n * @param {number} [overshoot=0] - This value allows you to increase the segment iterations in WebGL rendering. Useful if the arc has a thick stroke and needs to overshoot to join-up cleanly. Use small numbers such as 0.01 to start with and increase as needed.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n arc: function (x, y, radius, startAngle, endAngle, anticlockwise, overshoot)\r\n {\r\n if (anticlockwise === undefined) { anticlockwise = false; }\r\n if (overshoot === undefined) { overshoot = 0; }\r\n\r\n this.commandBuffer.push(\r\n Commands.ARC,\r\n x, y, radius, startAngle, endAngle, anticlockwise, overshoot\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a pie-chart slice shape centered at `x`, `y` with the given radius.\r\n * You must define the start and end angle of the slice.\r\n *\r\n * Setting the `anticlockwise` argument to `true` creates a shape similar to Pacman.\r\n * Setting it to `false` creates a shape like a slice of pie.\r\n *\r\n * This method will begin a new path and close the path at the end of it.\r\n * To display the actual slice you need to call either `strokePath` or `fillPath` after it.\r\n *\r\n * @method Phaser.GameObjects.Graphics#slice\r\n * @since 3.4.0\r\n *\r\n * @param {number} x - The horizontal center of the slice.\r\n * @param {number} y - The vertical center of the slice.\r\n * @param {number} radius - The radius of the slice.\r\n * @param {number} startAngle - The start angle of the slice, given in radians.\r\n * @param {number} endAngle - The end angle of the slice, given in radians.\r\n * @param {boolean} [anticlockwise=false] - Whether the drawing should be anticlockwise or clockwise.\r\n * @param {number} [overshoot=0] - This value allows you to overshoot the endAngle by this amount. Useful if the arc has a thick stroke and needs to overshoot to join-up cleanly.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n slice: function (x, y, radius, startAngle, endAngle, anticlockwise, overshoot)\r\n {\r\n if (anticlockwise === undefined) { anticlockwise = false; }\r\n if (overshoot === undefined) { overshoot = 0; }\r\n\r\n this.commandBuffer.push(Commands.BEGIN_PATH);\r\n\r\n this.commandBuffer.push(Commands.MOVE_TO, x, y);\r\n\r\n this.commandBuffer.push(Commands.ARC, x, y, radius, startAngle, endAngle, anticlockwise, overshoot);\r\n\r\n this.commandBuffer.push(Commands.CLOSE_PATH);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Saves the state of the Graphics by pushing the current state onto a stack.\r\n *\r\n * The most recently saved state can then be restored with {@link Phaser.GameObjects.Graphics#restore}.\r\n *\r\n * @method Phaser.GameObjects.Graphics#save\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n save: function ()\r\n {\r\n this.commandBuffer.push(\r\n Commands.SAVE\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Restores the most recently saved state of the Graphics by popping from the state stack.\r\n *\r\n * Use {@link Phaser.GameObjects.Graphics#save} to save the current state, and call this afterwards to restore that state.\r\n *\r\n * If there is no saved state, this command does nothing.\r\n *\r\n * @method Phaser.GameObjects.Graphics#restore\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n restore: function ()\r\n {\r\n this.commandBuffer.push(\r\n Commands.RESTORE\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Inserts a translation command into this Graphics objects command buffer.\r\n * \r\n * All objects drawn _after_ calling this method will be translated\r\n * by the given amount.\r\n * \r\n * This does not change the position of the Graphics object itself,\r\n * only of the objects drawn by it after calling this method.\r\n *\r\n * @method Phaser.GameObjects.Graphics#translateCanvas\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal translation to apply.\r\n * @param {number} y - The vertical translation to apply.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n translateCanvas: function (x, y)\r\n {\r\n this.commandBuffer.push(\r\n Commands.TRANSLATE,\r\n x, y\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Inserts a scale command into this Graphics objects command buffer.\r\n * \r\n * All objects drawn _after_ calling this method will be scaled\r\n * by the given amount.\r\n * \r\n * This does not change the scale of the Graphics object itself,\r\n * only of the objects drawn by it after calling this method.\r\n *\r\n * @method Phaser.GameObjects.Graphics#scaleCanvas\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scale to apply.\r\n * @param {number} y - The vertical scale to apply.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n scaleCanvas: function (x, y)\r\n {\r\n this.commandBuffer.push(\r\n Commands.SCALE,\r\n x, y\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Inserts a rotation command into this Graphics objects command buffer.\r\n * \r\n * All objects drawn _after_ calling this method will be rotated\r\n * by the given amount.\r\n * \r\n * This does not change the rotation of the Graphics object itself,\r\n * only of the objects drawn by it after calling this method.\r\n *\r\n * @method Phaser.GameObjects.Graphics#rotateCanvas\r\n * @since 3.0.0\r\n *\r\n * @param {number} radians - The rotation angle, in radians.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n rotateCanvas: function (radians)\r\n {\r\n this.commandBuffer.push(\r\n Commands.ROTATE,\r\n radians\r\n );\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Clear the command buffer and reset the fill style and line style to their defaults.\r\n *\r\n * @method Phaser.GameObjects.Graphics#clear\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n clear: function ()\r\n {\r\n this.commandBuffer.length = 0;\r\n\r\n if (this.defaultFillColor > -1)\r\n {\r\n this.fillStyle(this.defaultFillColor, this.defaultFillAlpha);\r\n }\r\n\r\n if (this.defaultStrokeColor > -1)\r\n {\r\n this.lineStyle(this.defaultStrokeWidth, this.defaultStrokeColor, this.defaultStrokeAlpha);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a texture from this Graphics object.\r\n *\r\n * If `key` is a string it'll generate a new texture using it and add it into the\r\n * Texture Manager (assuming no key conflict happens).\r\n *\r\n * If `key` is a Canvas it will draw the texture to that canvas context. Note that it will NOT\r\n * automatically upload it to the GPU in WebGL mode.\r\n *\r\n * @method Phaser.GameObjects.Graphics#generateTexture\r\n * @since 3.0.0\r\n *\r\n * @param {(string|HTMLCanvasElement)} key - The key to store the texture with in the Texture Manager, or a Canvas to draw to.\r\n * @param {integer} [width] - The width of the graphics to generate.\r\n * @param {integer} [height] - The height of the graphics to generate.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} This Game Object.\r\n */\r\n generateTexture: function (key, width, height)\r\n {\r\n var sys = this.scene.sys;\r\n var renderer = sys.game.renderer;\r\n\r\n if (width === undefined) { width = sys.scale.width; }\r\n if (height === undefined) { height = sys.scale.height; }\r\n\r\n Graphics.TargetCamera.setScene(this.scene);\r\n Graphics.TargetCamera.setViewport(0, 0, width, height);\r\n Graphics.TargetCamera.scrollX = this.x;\r\n Graphics.TargetCamera.scrollY = this.y;\r\n\r\n var texture;\r\n var ctx;\r\n\r\n if (typeof key === 'string')\r\n {\r\n if (sys.textures.exists(key))\r\n {\r\n // Key is a string, it DOES exist in the Texture Manager AND is a canvas, so draw to it\r\n\r\n texture = sys.textures.get(key);\r\n\r\n var src = texture.getSourceImage();\r\n\r\n if (src instanceof HTMLCanvasElement)\r\n {\r\n ctx = src.getContext('2d');\r\n }\r\n }\r\n else\r\n {\r\n // Key is a string and doesn't exist in the Texture Manager, so generate and save it\r\n\r\n texture = sys.textures.createCanvas(key, width, height);\r\n\r\n ctx = texture.getSourceImage().getContext('2d');\r\n }\r\n }\r\n else if (key instanceof HTMLCanvasElement)\r\n {\r\n // Key is a Canvas, so draw to it\r\n\r\n ctx = key.getContext('2d');\r\n }\r\n\r\n if (ctx)\r\n {\r\n // var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix, renderTargetCtx, allowClip)\r\n this.renderCanvas(renderer, this, 0, Graphics.TargetCamera, null, ctx, false);\r\n\r\n if (texture)\r\n {\r\n texture.refresh();\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal destroy handler, called as part of the destroy process.\r\n *\r\n * @method Phaser.GameObjects.Graphics#preDestroy\r\n * @protected\r\n * @since 3.9.0\r\n */\r\n preDestroy: function ()\r\n {\r\n this.commandBuffer = [];\r\n }\r\n\r\n});\r\n\r\n/**\r\n * A Camera used specifically by the Graphics system for rendering to textures.\r\n *\r\n * @name Phaser.GameObjects.Graphics.TargetCamera\r\n * @type {Phaser.Cameras.Scene2D.Camera}\r\n * @since 3.1.0\r\n */\r\nGraphics.TargetCamera = new BaseCamera();\r\n\r\nmodule.exports = Graphics;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/graphics/Graphics.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/graphics/GraphicsCanvasRenderer.js": /*!********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/graphics/GraphicsCanvasRenderer.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Commands = __webpack_require__(/*! ./Commands */ \"./node_modules/phaser/src/gameobjects/graphics/Commands.js\");\r\nvar SetTransform = __webpack_require__(/*! ../../renderer/canvas/utils/SetTransform */ \"./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js\");\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Graphics#renderCanvas\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Graphics} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n * @param {CanvasRenderingContext2D} [renderTargetCtx] - The target rendering context.\r\n * @param {boolean} allowClip - If `true` then path operations will be used instead of fill operations.\r\n */\r\nvar GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix, renderTargetCtx, allowClip)\r\n{\r\n var commandBuffer = src.commandBuffer;\r\n var commandBufferLength = commandBuffer.length;\r\n\r\n var ctx = renderTargetCtx || renderer.currentContext;\r\n\r\n if (commandBufferLength === 0 || !SetTransform(renderer, ctx, src, camera, parentMatrix))\r\n {\r\n return;\r\n }\r\n\r\n var lineAlpha = 1;\r\n var fillAlpha = 1;\r\n var lineColor = 0;\r\n var fillColor = 0;\r\n var lineWidth = 1;\r\n var red = 0;\r\n var green = 0;\r\n var blue = 0;\r\n\r\n // Reset any currently active paths\r\n ctx.beginPath();\r\n\r\n for (var index = 0; index < commandBufferLength; ++index)\r\n {\r\n var commandID = commandBuffer[index];\r\n\r\n switch (commandID)\r\n {\r\n case Commands.ARC:\r\n ctx.arc(\r\n commandBuffer[index + 1],\r\n commandBuffer[index + 2],\r\n commandBuffer[index + 3],\r\n commandBuffer[index + 4],\r\n commandBuffer[index + 5],\r\n commandBuffer[index + 6]\r\n );\r\n\r\n // +7 because overshoot is the 7th value, not used in Canvas\r\n index += 7;\r\n break;\r\n\r\n case Commands.LINE_STYLE:\r\n lineWidth = commandBuffer[index + 1];\r\n lineColor = commandBuffer[index + 2];\r\n lineAlpha = commandBuffer[index + 3];\r\n red = ((lineColor & 0xFF0000) >>> 16);\r\n green = ((lineColor & 0xFF00) >>> 8);\r\n blue = (lineColor & 0xFF);\r\n ctx.strokeStyle = 'rgba(' + red + ',' + green + ',' + blue + ',' + lineAlpha + ')';\r\n ctx.lineWidth = lineWidth;\r\n index += 3;\r\n break;\r\n\r\n case Commands.FILL_STYLE:\r\n fillColor = commandBuffer[index + 1];\r\n fillAlpha = commandBuffer[index + 2];\r\n red = ((fillColor & 0xFF0000) >>> 16);\r\n green = ((fillColor & 0xFF00) >>> 8);\r\n blue = (fillColor & 0xFF);\r\n ctx.fillStyle = 'rgba(' + red + ',' + green + ',' + blue + ',' + fillAlpha + ')';\r\n index += 2;\r\n break;\r\n\r\n case Commands.BEGIN_PATH:\r\n ctx.beginPath();\r\n break;\r\n\r\n case Commands.CLOSE_PATH:\r\n ctx.closePath();\r\n break;\r\n\r\n case Commands.FILL_PATH:\r\n if (!allowClip)\r\n {\r\n ctx.fill();\r\n }\r\n break;\r\n\r\n case Commands.STROKE_PATH:\r\n if (!allowClip)\r\n {\r\n ctx.stroke();\r\n }\r\n break;\r\n\r\n case Commands.FILL_RECT:\r\n if (!allowClip)\r\n {\r\n ctx.fillRect(\r\n commandBuffer[index + 1],\r\n commandBuffer[index + 2],\r\n commandBuffer[index + 3],\r\n commandBuffer[index + 4]\r\n );\r\n }\r\n else\r\n {\r\n ctx.rect(\r\n commandBuffer[index + 1],\r\n commandBuffer[index + 2],\r\n commandBuffer[index + 3],\r\n commandBuffer[index + 4]\r\n );\r\n }\r\n index += 4;\r\n break;\r\n\r\n case Commands.FILL_TRIANGLE:\r\n ctx.beginPath();\r\n ctx.moveTo(commandBuffer[index + 1], commandBuffer[index + 2]);\r\n ctx.lineTo(commandBuffer[index + 3], commandBuffer[index + 4]);\r\n ctx.lineTo(commandBuffer[index + 5], commandBuffer[index + 6]);\r\n ctx.closePath();\r\n if (!allowClip)\r\n {\r\n ctx.fill();\r\n }\r\n index += 6;\r\n break;\r\n\r\n case Commands.STROKE_TRIANGLE:\r\n ctx.beginPath();\r\n ctx.moveTo(commandBuffer[index + 1], commandBuffer[index + 2]);\r\n ctx.lineTo(commandBuffer[index + 3], commandBuffer[index + 4]);\r\n ctx.lineTo(commandBuffer[index + 5], commandBuffer[index + 6]);\r\n ctx.closePath();\r\n if (!allowClip)\r\n {\r\n ctx.stroke();\r\n }\r\n index += 6;\r\n break;\r\n\r\n case Commands.LINE_TO:\r\n ctx.lineTo(\r\n commandBuffer[index + 1],\r\n commandBuffer[index + 2]\r\n );\r\n index += 2;\r\n break;\r\n\r\n case Commands.MOVE_TO:\r\n ctx.moveTo(\r\n commandBuffer[index + 1],\r\n commandBuffer[index + 2]\r\n );\r\n index += 2;\r\n break;\r\n\r\n case Commands.LINE_FX_TO:\r\n ctx.lineTo(\r\n commandBuffer[index + 1],\r\n commandBuffer[index + 2]\r\n );\r\n index += 5;\r\n break;\r\n\r\n case Commands.MOVE_FX_TO:\r\n ctx.moveTo(\r\n commandBuffer[index + 1],\r\n commandBuffer[index + 2]\r\n );\r\n index += 5;\r\n break;\r\n\r\n case Commands.SAVE:\r\n ctx.save();\r\n break;\r\n\r\n case Commands.RESTORE:\r\n ctx.restore();\r\n break;\r\n\r\n case Commands.TRANSLATE:\r\n ctx.translate(\r\n commandBuffer[index + 1],\r\n commandBuffer[index + 2]\r\n );\r\n index += 2;\r\n break;\r\n\r\n case Commands.SCALE:\r\n ctx.scale(\r\n commandBuffer[index + 1],\r\n commandBuffer[index + 2]\r\n );\r\n index += 2;\r\n break;\r\n\r\n case Commands.ROTATE:\r\n ctx.rotate(\r\n commandBuffer[index + 1]\r\n );\r\n index += 1;\r\n break;\r\n\r\n case Commands.GRADIENT_FILL_STYLE:\r\n index += 5;\r\n break;\r\n\r\n case Commands.GRADIENT_LINE_STYLE:\r\n index += 6;\r\n break;\r\n\r\n case Commands.SET_TEXTURE:\r\n index += 2;\r\n break;\r\n }\r\n }\r\n\r\n // Restore the context saved in SetTransform\r\n ctx.restore();\r\n};\r\n\r\nmodule.exports = GraphicsCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/graphics/GraphicsCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/graphics/GraphicsCreator.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/graphics/GraphicsCreator.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectCreator = __webpack_require__(/*! ../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar Graphics = __webpack_require__(/*! ./Graphics */ \"./node_modules/phaser/src/gameobjects/graphics/Graphics.js\");\r\n\r\n/**\r\n * Creates a new Graphics Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Graphics Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#graphics\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('graphics', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n var graphics = new Graphics(this.scene, config);\r\n\r\n if (config.add)\r\n {\r\n this.scene.sys.displayList.add(graphics);\r\n }\r\n \r\n return graphics;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectCreator context.\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/graphics/GraphicsCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/graphics/GraphicsFactory.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/graphics/GraphicsFactory.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Graphics = __webpack_require__(/*! ./Graphics */ \"./node_modules/phaser/src/gameobjects/graphics/Graphics.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Graphics Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Graphics Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#graphics\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Graphics.Options} [config] - The Graphics configuration.\r\n *\r\n * @return {Phaser.GameObjects.Graphics} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('graphics', function (config)\r\n{\r\n return this.displayList.add(new Graphics(this.scene, config));\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/graphics/GraphicsFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/graphics/GraphicsRender.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/graphics/GraphicsRender.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./GraphicsWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/graphics/GraphicsWebGLRenderer.js\");\r\n\r\n // Needed for Graphics.generateTexture\r\n renderCanvas = __webpack_require__(/*! ./GraphicsCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/graphics/GraphicsCanvasRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./GraphicsCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/graphics/GraphicsCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/graphics/GraphicsRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/graphics/GraphicsWebGLRenderer.js": /*!*******************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/graphics/GraphicsWebGLRenderer.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Commands = __webpack_require__(/*! ./Commands */ \"./node_modules/phaser/src/gameobjects/graphics/Commands.js\");\r\nvar Utils = __webpack_require__(/*! ../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n// TODO: Remove the use of this\r\nvar Point = function (x, y, width)\r\n{\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n};\r\n\r\n// TODO: Remove the use of this\r\nvar Path = function (x, y, width)\r\n{\r\n this.points = [];\r\n this.pointsLength = 1;\r\n this.points[0] = new Point(x, y, width);\r\n};\r\n\r\nvar matrixStack = [];\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Graphics#renderWebGL\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Graphics} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n if (src.commandBuffer.length === 0)\r\n {\r\n return;\r\n }\r\n\r\n var pipeline = this.pipeline;\r\n\r\n renderer.setPipeline(pipeline, src);\r\n\r\n var camMatrix = src._tempMatrix1;\r\n var graphicsMatrix = src._tempMatrix2;\r\n var currentMatrix = src._tempMatrix3;\r\n\r\n currentMatrix.loadIdentity();\r\n\r\n graphicsMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n graphicsMatrix.e = src.x;\r\n graphicsMatrix.f = src.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(graphicsMatrix);\r\n }\r\n else\r\n {\r\n graphicsMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n graphicsMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(graphicsMatrix);\r\n }\r\n\r\n var commands = src.commandBuffer;\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n var lineWidth = 1;\r\n var fillTint = pipeline.fillTint;\r\n var strokeTint = pipeline.strokeTint;\r\n\r\n var tx = 0;\r\n var ty = 0;\r\n var ta = 0;\r\n var iterStep = 0.01;\r\n var PI2 = Math.PI * 2;\r\n\r\n var cmd;\r\n\r\n var path = [];\r\n var pathIndex = 0;\r\n var pathOpen = false;\r\n var lastPath = null;\r\n\r\n var getTint = Utils.getTintAppendFloatAlphaAndSwap;\r\n\r\n var currentTexture = renderer.blankTexture.glTexture;\r\n\r\n for (var cmdIndex = 0; cmdIndex < commands.length; cmdIndex++)\r\n {\r\n cmd = commands[cmdIndex];\r\n\r\n switch (cmd)\r\n {\r\n case Commands.BEGIN_PATH:\r\n\r\n path.length = 0;\r\n lastPath = null;\r\n pathOpen = true;\r\n break;\r\n\r\n case Commands.CLOSE_PATH:\r\n\r\n pathOpen = false;\r\n\r\n if (lastPath && lastPath.points.length)\r\n {\r\n lastPath.points.push(lastPath.points[0]);\r\n }\r\n break;\r\n\r\n case Commands.FILL_PATH:\r\n for (pathIndex = 0; pathIndex < path.length; pathIndex++)\r\n {\r\n pipeline.setTexture2D(currentTexture);\r\n\r\n pipeline.batchFillPath(\r\n path[pathIndex].points,\r\n currentMatrix,\r\n camMatrix\r\n );\r\n }\r\n break;\r\n\r\n case Commands.STROKE_PATH:\r\n for (pathIndex = 0; pathIndex < path.length; pathIndex++)\r\n {\r\n pipeline.setTexture2D(currentTexture);\r\n\r\n pipeline.batchStrokePath(\r\n path[pathIndex].points,\r\n lineWidth,\r\n pathOpen,\r\n currentMatrix,\r\n camMatrix\r\n );\r\n }\r\n break;\r\n\r\n case Commands.LINE_STYLE:\r\n lineWidth = commands[++cmdIndex];\r\n var strokeColor = commands[++cmdIndex];\r\n var strokeAlpha = commands[++cmdIndex] * alpha;\r\n var strokeTintColor = getTint(strokeColor, strokeAlpha);\r\n strokeTint.TL = strokeTintColor;\r\n strokeTint.TR = strokeTintColor;\r\n strokeTint.BL = strokeTintColor;\r\n strokeTint.BR = strokeTintColor;\r\n break;\r\n\r\n case Commands.FILL_STYLE:\r\n var fillColor = commands[++cmdIndex];\r\n var fillAlpha = commands[++cmdIndex] * alpha;\r\n var fillTintColor = getTint(fillColor, fillAlpha);\r\n fillTint.TL = fillTintColor;\r\n fillTint.TR = fillTintColor;\r\n fillTint.BL = fillTintColor;\r\n fillTint.BR = fillTintColor;\r\n break;\r\n\r\n case Commands.GRADIENT_FILL_STYLE:\r\n var gradientFillAlpha = commands[++cmdIndex] * alpha;\r\n fillTint.TL = getTint(commands[++cmdIndex], gradientFillAlpha);\r\n fillTint.TR = getTint(commands[++cmdIndex], gradientFillAlpha);\r\n fillTint.BL = getTint(commands[++cmdIndex], gradientFillAlpha);\r\n fillTint.BR = getTint(commands[++cmdIndex], gradientFillAlpha);\r\n break;\r\n\r\n case Commands.GRADIENT_LINE_STYLE:\r\n lineWidth = commands[++cmdIndex];\r\n var gradientLineAlpha = commands[++cmdIndex] * alpha;\r\n strokeTint.TL = getTint(commands[++cmdIndex], gradientLineAlpha);\r\n strokeTint.TR = getTint(commands[++cmdIndex], gradientLineAlpha);\r\n strokeTint.BL = getTint(commands[++cmdIndex], gradientLineAlpha);\r\n strokeTint.BR = getTint(commands[++cmdIndex], gradientLineAlpha);\r\n break;\r\n\r\n case Commands.ARC:\r\n var iteration = 0;\r\n var x = commands[++cmdIndex];\r\n var y = commands[++cmdIndex];\r\n var radius = commands[++cmdIndex];\r\n var startAngle = commands[++cmdIndex];\r\n var endAngle = commands[++cmdIndex];\r\n var anticlockwise = commands[++cmdIndex];\r\n var overshoot = commands[++cmdIndex];\r\n\r\n endAngle -= startAngle;\r\n\r\n if (anticlockwise)\r\n {\r\n if (endAngle < -PI2)\r\n {\r\n endAngle = -PI2;\r\n }\r\n else if (endAngle > 0)\r\n {\r\n endAngle = -PI2 + endAngle % PI2;\r\n }\r\n }\r\n else if (endAngle > PI2)\r\n {\r\n endAngle = PI2;\r\n }\r\n else if (endAngle < 0)\r\n {\r\n endAngle = PI2 + endAngle % PI2;\r\n }\r\n\r\n if (lastPath === null)\r\n {\r\n lastPath = new Path(x + Math.cos(startAngle) * radius, y + Math.sin(startAngle) * radius, lineWidth);\r\n path.push(lastPath);\r\n iteration += iterStep;\r\n }\r\n\r\n while (iteration < 1 + overshoot)\r\n {\r\n ta = endAngle * iteration + startAngle;\r\n tx = x + Math.cos(ta) * radius;\r\n ty = y + Math.sin(ta) * radius;\r\n\r\n lastPath.points.push(new Point(tx, ty, lineWidth));\r\n\r\n iteration += iterStep;\r\n }\r\n\r\n ta = endAngle + startAngle;\r\n tx = x + Math.cos(ta) * radius;\r\n ty = y + Math.sin(ta) * radius;\r\n\r\n lastPath.points.push(new Point(tx, ty, lineWidth));\r\n\r\n break;\r\n\r\n case Commands.FILL_RECT:\r\n pipeline.setTexture2D(currentTexture);\r\n pipeline.batchFillRect(\r\n commands[++cmdIndex],\r\n commands[++cmdIndex],\r\n commands[++cmdIndex],\r\n commands[++cmdIndex],\r\n currentMatrix,\r\n camMatrix\r\n );\r\n break;\r\n\r\n case Commands.FILL_TRIANGLE:\r\n pipeline.setTexture2D(currentTexture);\r\n pipeline.batchFillTriangle(\r\n commands[++cmdIndex],\r\n commands[++cmdIndex],\r\n commands[++cmdIndex],\r\n commands[++cmdIndex],\r\n commands[++cmdIndex],\r\n commands[++cmdIndex],\r\n currentMatrix,\r\n camMatrix\r\n );\r\n break;\r\n\r\n case Commands.STROKE_TRIANGLE:\r\n pipeline.setTexture2D(currentTexture);\r\n pipeline.batchStrokeTriangle(\r\n commands[++cmdIndex],\r\n commands[++cmdIndex],\r\n commands[++cmdIndex],\r\n commands[++cmdIndex],\r\n commands[++cmdIndex],\r\n commands[++cmdIndex],\r\n lineWidth,\r\n currentMatrix,\r\n camMatrix\r\n );\r\n break;\r\n\r\n case Commands.LINE_TO:\r\n if (lastPath !== null)\r\n {\r\n lastPath.points.push(new Point(commands[++cmdIndex], commands[++cmdIndex], lineWidth));\r\n }\r\n else\r\n {\r\n lastPath = new Path(commands[++cmdIndex], commands[++cmdIndex], lineWidth);\r\n path.push(lastPath);\r\n }\r\n break;\r\n\r\n case Commands.MOVE_TO:\r\n lastPath = new Path(commands[++cmdIndex], commands[++cmdIndex], lineWidth);\r\n path.push(lastPath);\r\n break;\r\n\r\n case Commands.SAVE:\r\n matrixStack.push(currentMatrix.copyToArray());\r\n break;\r\n\r\n case Commands.RESTORE:\r\n currentMatrix.copyFromArray(matrixStack.pop());\r\n break;\r\n\r\n case Commands.TRANSLATE:\r\n x = commands[++cmdIndex];\r\n y = commands[++cmdIndex];\r\n currentMatrix.translate(x, y);\r\n break;\r\n\r\n case Commands.SCALE:\r\n x = commands[++cmdIndex];\r\n y = commands[++cmdIndex];\r\n currentMatrix.scale(x, y);\r\n break;\r\n\r\n case Commands.ROTATE:\r\n currentMatrix.rotate(commands[++cmdIndex]);\r\n break;\r\n\r\n case Commands.SET_TEXTURE:\r\n var frame = commands[++cmdIndex];\r\n var mode = commands[++cmdIndex];\r\n\r\n pipeline.currentFrame = frame;\r\n pipeline.setTexture2D(frame.glTexture, 0);\r\n pipeline.tintEffect = mode;\r\n\r\n currentTexture = frame.glTexture;\r\n\r\n break;\r\n\r\n case Commands.CLEAR_TEXTURE:\r\n pipeline.currentFrame = renderer.blankTexture;\r\n pipeline.tintEffect = 2;\r\n currentTexture = renderer.blankTexture.glTexture;\r\n break;\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = GraphicsWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/graphics/GraphicsWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/group/Group.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/group/Group.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Actions = __webpack_require__(/*! ../../actions/ */ \"./node_modules/phaser/src/actions/index.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/gameobjects/events/index.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\nvar Range = __webpack_require__(/*! ../../utils/array/Range */ \"./node_modules/phaser/src/utils/array/Range.js\");\r\nvar Set = __webpack_require__(/*! ../../structs/Set */ \"./node_modules/phaser/src/structs/Set.js\");\r\nvar Sprite = __webpack_require__(/*! ../sprite/Sprite */ \"./node_modules/phaser/src/gameobjects/sprite/Sprite.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Group is a way for you to create, manipulate, or recycle similar Game Objects.\r\n *\r\n * Group membership is non-exclusive. A Game Object can belong to several groups, one group, or none.\r\n *\r\n * Groups themselves aren't displayable, and can't be positioned, rotated, scaled, or hidden.\r\n *\r\n * @class Group\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n * @param {Phaser.Scene} scene - The scene this group belongs to.\r\n * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.\r\n * @param {Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} [config] - Settings for this group. If `key` is set, Phaser.GameObjects.Group#createMultiple is also called with these settings.\r\n *\r\n * @see Phaser.Physics.Arcade.Group\r\n * @see Phaser.Physics.Arcade.StaticGroup\r\n */\r\nvar Group = new Class({\r\n\r\n initialize:\r\n\r\n function Group (scene, children, config)\r\n {\r\n // They can pass in any of the following as the first argument:\r\n\r\n // 1) A single child\r\n // 2) An array of children\r\n // 3) A config object\r\n // 4) An array of config objects\r\n\r\n // Or they can pass in a child, or array of children AND a config object\r\n\r\n if (config)\r\n {\r\n // config has been set, are the children an array?\r\n\r\n if (children && !Array.isArray(children))\r\n {\r\n children = [ children ];\r\n }\r\n }\r\n else if (Array.isArray(children))\r\n {\r\n // No config, so let's check the children argument\r\n\r\n if (IsPlainObject(children[0]))\r\n {\r\n // It's an array of plain config objects\r\n config = children;\r\n children = null;\r\n }\r\n }\r\n else if (IsPlainObject(children))\r\n {\r\n // Children isn't an array. Is it a config object though?\r\n config = children;\r\n children = null;\r\n }\r\n\r\n /**\r\n * This scene this group belongs to.\r\n *\r\n * @name Phaser.GameObjects.Group#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * Members of this group.\r\n *\r\n * @name Phaser.GameObjects.Group#children\r\n * @type {Phaser.Structs.Set.}\r\n * @since 3.0.0\r\n */\r\n this.children = new Set(children);\r\n\r\n /**\r\n * A flag identifying this object as a group.\r\n *\r\n * @name Phaser.GameObjects.Group#isParent\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.isParent = true;\r\n\r\n /**\r\n * A textual representation of this Game Object.\r\n * Used internally by Phaser but is available for your own custom classes to populate.\r\n *\r\n * @name Phaser.GameObjects.Group#type\r\n * @type {string}\r\n * @default 'Group'\r\n * @since 3.21.0\r\n */\r\n this.type = 'Group';\r\n\r\n /**\r\n * The class to create new group members from.\r\n *\r\n * @name Phaser.GameObjects.Group#classType\r\n * @type {Function}\r\n * @since 3.0.0\r\n * @default Phaser.GameObjects.Sprite\r\n */\r\n this.classType = GetFastValue(config, 'classType', Sprite);\r\n\r\n /**\r\n * The name of this group.\r\n * Empty by default and never populated by Phaser, this is left for developers to use.\r\n *\r\n * @name Phaser.GameObjects.Group#name\r\n * @type {string}\r\n * @default ''\r\n * @since 3.18.0\r\n */\r\n this.name = GetFastValue(config, 'name', '');\r\n\r\n /**\r\n * Whether this group runs its {@link Phaser.GameObjects.Group#preUpdate} method\r\n * (which may update any members).\r\n *\r\n * @name Phaser.GameObjects.Group#active\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.active = GetFastValue(config, 'active', true);\r\n\r\n /**\r\n * The maximum size of this group, if used as a pool. -1 is no limit.\r\n *\r\n * @name Phaser.GameObjects.Group#maxSize\r\n * @type {integer}\r\n * @since 3.0.0\r\n * @default -1\r\n */\r\n this.maxSize = GetFastValue(config, 'maxSize', -1);\r\n\r\n /**\r\n * A default texture key to use when creating new group members.\r\n *\r\n * This is used in {@link Phaser.GameObjects.Group#create}\r\n * but not in {@link Phaser.GameObjects.Group#createMultiple}.\r\n *\r\n * @name Phaser.GameObjects.Group#defaultKey\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.defaultKey = GetFastValue(config, 'defaultKey', null);\r\n\r\n /**\r\n * A default texture frame to use when creating new group members.\r\n *\r\n * @name Phaser.GameObjects.Group#defaultFrame\r\n * @type {(string|integer)}\r\n * @since 3.0.0\r\n */\r\n this.defaultFrame = GetFastValue(config, 'defaultFrame', null);\r\n\r\n /**\r\n * Whether to call the update method of any members.\r\n *\r\n * @name Phaser.GameObjects.Group#runChildUpdate\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Group#preUpdate\r\n */\r\n this.runChildUpdate = GetFastValue(config, 'runChildUpdate', false);\r\n\r\n /**\r\n * A function to be called when adding or creating group members.\r\n *\r\n * @name Phaser.GameObjects.Group#createCallback\r\n * @type {?Phaser.Types.GameObjects.Group.GroupCallback}\r\n * @since 3.0.0\r\n */\r\n this.createCallback = GetFastValue(config, 'createCallback', null);\r\n\r\n /**\r\n * A function to be called when removing group members.\r\n *\r\n * @name Phaser.GameObjects.Group#removeCallback\r\n * @type {?Phaser.Types.GameObjects.Group.GroupCallback}\r\n * @since 3.0.0\r\n */\r\n this.removeCallback = GetFastValue(config, 'removeCallback', null);\r\n\r\n /**\r\n * A function to be called when creating several group members at once.\r\n *\r\n * @name Phaser.GameObjects.Group#createMultipleCallback\r\n * @type {?Phaser.Types.GameObjects.Group.GroupMultipleCreateCallback}\r\n * @since 3.0.0\r\n */\r\n this.createMultipleCallback = GetFastValue(config, 'createMultipleCallback', null);\r\n\r\n /**\r\n * A function to be called when adding or creating group members.\r\n * For internal use only by a Group, or any class that extends it.\r\n *\r\n * @name Phaser.GameObjects.Group#internalCreateCallback\r\n * @type {?Phaser.Types.GameObjects.Group.GroupCallback}\r\n * @private\r\n * @since 3.22.0\r\n */\r\n this.internalCreateCallback = GetFastValue(config, 'internalCreateCallback', null);\r\n\r\n /**\r\n * A function to be called when removing group members.\r\n * For internal use only by a Group, or any class that extends it.\r\n *\r\n * @name Phaser.GameObjects.Group#internalRemoveCallback\r\n * @type {?Phaser.Types.GameObjects.Group.GroupCallback}\r\n * @private\r\n * @since 3.22.0\r\n */\r\n this.internalRemoveCallback = GetFastValue(config, 'internalRemoveCallback', null);\r\n\r\n if (config)\r\n {\r\n this.createMultiple(config);\r\n }\r\n },\r\n\r\n /**\r\n * Creates a new Game Object and adds it to this group, unless the group {@link Phaser.GameObjects.Group#isFull is full}.\r\n *\r\n * Calls {@link Phaser.GameObjects.Group#createCallback}.\r\n *\r\n * @method Phaser.GameObjects.Group#create\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The horizontal position of the new Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of the new Game Object in the world.\r\n * @param {string} [key=defaultKey] - The texture key of the new Game Object.\r\n * @param {(string|integer)} [frame=defaultFrame] - The texture frame of the new Game Object.\r\n * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of the new Game Object.\r\n * @param {boolean} [active=true] - The {@link Phaser.GameObjects.GameObject#active} state of the new Game Object.\r\n *\r\n * @return {any} The new Game Object (usually a Sprite, etc.).\r\n */\r\n create: function (x, y, key, frame, visible, active)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (key === undefined) { key = this.defaultKey; }\r\n if (frame === undefined) { frame = this.defaultFrame; }\r\n if (visible === undefined) { visible = true; }\r\n if (active === undefined) { active = true; }\r\n\r\n // Pool?\r\n if (this.isFull())\r\n {\r\n return null;\r\n }\r\n\r\n var child = new this.classType(this.scene, x, y, key, frame);\r\n\r\n this.scene.sys.displayList.add(child);\r\n\r\n if (child.preUpdate)\r\n {\r\n this.scene.sys.updateList.add(child);\r\n }\r\n\r\n child.visible = visible;\r\n child.setActive(active);\r\n\r\n this.add(child);\r\n\r\n return child;\r\n },\r\n\r\n /**\r\n * Creates several Game Objects and adds them to this group.\r\n *\r\n * If the group becomes {@link Phaser.GameObjects.Group#isFull}, no further Game Objects are created.\r\n *\r\n * Calls {@link Phaser.GameObjects.Group#createMultipleCallback} and {@link Phaser.GameObjects.Group#createCallback}.\r\n *\r\n * @method Phaser.GameObjects.Group#createMultiple\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Group.GroupCreateConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig[]} config - Creation settings. This can be a single configuration object or an array of such objects, which will be applied in turn.\r\n *\r\n * @return {any[]} The newly created Game Objects.\r\n */\r\n createMultiple: function (config)\r\n {\r\n if (this.isFull())\r\n {\r\n return [];\r\n }\r\n\r\n if (!Array.isArray(config))\r\n {\r\n config = [ config ];\r\n }\r\n\r\n var output = [];\r\n\r\n if (config[0].key)\r\n {\r\n for (var i = 0; i < config.length; i++)\r\n {\r\n var entries = this.createFromConfig(config[i]);\r\n\r\n output = output.concat(entries);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * A helper for {@link Phaser.GameObjects.Group#createMultiple}.\r\n *\r\n * @method Phaser.GameObjects.Group#createFromConfig\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Group.GroupCreateConfig} options - Creation settings.\r\n *\r\n * @return {any[]} The newly created Game Objects.\r\n */\r\n createFromConfig: function (options)\r\n {\r\n if (this.isFull())\r\n {\r\n return [];\r\n }\r\n\r\n this.classType = GetFastValue(options, 'classType', this.classType);\r\n\r\n var key = GetFastValue(options, 'key', undefined);\r\n var frame = GetFastValue(options, 'frame', null);\r\n var visible = GetFastValue(options, 'visible', true);\r\n var active = GetFastValue(options, 'active', true);\r\n\r\n var entries = [];\r\n\r\n // Can't do anything without at least a key\r\n if (key === undefined)\r\n {\r\n return entries;\r\n }\r\n else\r\n {\r\n if (!Array.isArray(key))\r\n {\r\n key = [ key ];\r\n }\r\n\r\n if (!Array.isArray(frame))\r\n {\r\n frame = [ frame ];\r\n }\r\n }\r\n\r\n // Build an array of key frame pairs to loop through\r\n\r\n var repeat = GetFastValue(options, 'repeat', 0);\r\n var randomKey = GetFastValue(options, 'randomKey', false);\r\n var randomFrame = GetFastValue(options, 'randomFrame', false);\r\n var yoyo = GetFastValue(options, 'yoyo', false);\r\n var quantity = GetFastValue(options, 'quantity', false);\r\n var frameQuantity = GetFastValue(options, 'frameQuantity', 1);\r\n var max = GetFastValue(options, 'max', 0);\r\n\r\n // If a quantity value is set we use that to override the frameQuantity\r\n\r\n var range = Range(key, frame, {\r\n max: max,\r\n qty: (quantity) ? quantity : frameQuantity,\r\n random: randomKey,\r\n randomB: randomFrame,\r\n repeat: repeat,\r\n yoyo: yoyo\r\n });\r\n\r\n if (options.createCallback)\r\n {\r\n this.createCallback = options.createCallback;\r\n }\r\n\r\n if (options.removeCallback)\r\n {\r\n this.removeCallback = options.removeCallback;\r\n }\r\n\r\n for (var c = 0; c < range.length; c++)\r\n {\r\n var created = this.create(0, 0, range[c].a, range[c].b, visible, active);\r\n\r\n if (!created)\r\n {\r\n break;\r\n }\r\n\r\n entries.push(created);\r\n }\r\n\r\n // Post-creation options (applied only to those items created in this call):\r\n\r\n var x = GetValue(options, 'setXY.x', 0);\r\n var y = GetValue(options, 'setXY.y', 0);\r\n var stepX = GetValue(options, 'setXY.stepX', 0);\r\n var stepY = GetValue(options, 'setXY.stepY', 0);\r\n\r\n Actions.SetXY(entries, x, y, stepX, stepY);\r\n\r\n var rotation = GetValue(options, 'setRotation.value', 0);\r\n var stepRotation = GetValue(options, 'setRotation.step', 0);\r\n\r\n Actions.SetRotation(entries, rotation, stepRotation);\r\n\r\n var scaleX = GetValue(options, 'setScale.x', 1);\r\n var scaleY = GetValue(options, 'setScale.y', scaleX);\r\n var stepScaleX = GetValue(options, 'setScale.stepX', 0);\r\n var stepScaleY = GetValue(options, 'setScale.stepY', 0);\r\n\r\n Actions.SetScale(entries, scaleX, scaleY, stepScaleX, stepScaleY);\r\n\r\n var alpha = GetValue(options, 'setAlpha.value', 1);\r\n var stepAlpha = GetValue(options, 'setAlpha.step', 0);\r\n\r\n Actions.SetAlpha(entries, alpha, stepAlpha);\r\n\r\n var depth = GetValue(options, 'setDepth.value', 0);\r\n var stepDepth = GetValue(options, 'setDepth.step', 0);\r\n\r\n Actions.SetDepth(entries, depth, stepDepth);\r\n\r\n var scrollFactorX = GetValue(options, 'setScrollFactor.x', 1);\r\n var scrollFactorY = GetValue(options, 'setScrollFactor.y', scrollFactorX);\r\n var stepScrollFactorX = GetValue(options, 'setScrollFactor.stepX', 0);\r\n var stepScrollFactorY = GetValue(options, 'setScrollFactor.stepY', 0);\r\n\r\n Actions.SetScrollFactor(entries, scrollFactorX, scrollFactorY, stepScrollFactorX, stepScrollFactorY);\r\n\r\n var hitArea = GetFastValue(options, 'hitArea', null);\r\n var hitAreaCallback = GetFastValue(options, 'hitAreaCallback', null);\r\n\r\n if (hitArea)\r\n {\r\n Actions.SetHitArea(entries, hitArea, hitAreaCallback);\r\n }\r\n\r\n var grid = GetFastValue(options, 'gridAlign', false);\r\n\r\n if (grid)\r\n {\r\n Actions.GridAlign(entries, grid);\r\n }\r\n\r\n if (this.createMultipleCallback)\r\n {\r\n this.createMultipleCallback.call(this, entries);\r\n }\r\n\r\n return entries;\r\n },\r\n\r\n /**\r\n * Updates any group members, if {@link Phaser.GameObjects.Group#runChildUpdate} is enabled.\r\n *\r\n * @method Phaser.GameObjects.Group#preUpdate\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - The current timestamp.\r\n * @param {number} delta - The delta time elapsed since the last frame.\r\n */\r\n preUpdate: function (time, delta)\r\n {\r\n if (!this.runChildUpdate || this.children.size === 0)\r\n {\r\n return;\r\n }\r\n\r\n // Because a Group child may mess with the length of the Group during its update\r\n var temp = this.children.entries.slice();\r\n\r\n for (var i = 0; i < temp.length; i++)\r\n {\r\n var item = temp[i];\r\n\r\n if (item.active)\r\n {\r\n item.update(time, delta);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Adds a Game Object to this group.\r\n *\r\n * Calls {@link Phaser.GameObjects.Group#createCallback}.\r\n *\r\n * @method Phaser.GameObjects.Group#add\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to add.\r\n * @param {boolean} [addToScene=false] - Also add the Game Object to the scene.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n add: function (child, addToScene)\r\n {\r\n if (addToScene === undefined) { addToScene = false; }\r\n\r\n if (this.isFull())\r\n {\r\n return this;\r\n }\r\n\r\n this.children.set(child);\r\n\r\n if (this.internalCreateCallback)\r\n {\r\n this.internalCreateCallback.call(this, child);\r\n }\r\n\r\n if (this.createCallback)\r\n {\r\n this.createCallback.call(this, child);\r\n }\r\n\r\n if (addToScene)\r\n {\r\n this.scene.sys.displayList.add(child);\r\n\r\n if (child.preUpdate)\r\n {\r\n this.scene.sys.updateList.add(child);\r\n }\r\n }\r\n\r\n child.on(Events.DESTROY, this.remove, this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds several Game Objects to this group.\r\n *\r\n * Calls {@link Phaser.GameObjects.Group#createCallback}.\r\n *\r\n * @method Phaser.GameObjects.Group#addMultiple\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject[]} children - The Game Objects to add.\r\n * @param {boolean} [addToScene=false] - Also add the Game Objects to the scene.\r\n *\r\n * @return {Phaser.GameObjects.Group} This group.\r\n */\r\n addMultiple: function (children, addToScene)\r\n {\r\n if (addToScene === undefined) { addToScene = false; }\r\n\r\n if (Array.isArray(children))\r\n {\r\n for (var i = 0; i < children.length; i++)\r\n {\r\n this.add(children[i], addToScene);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes a member of this Group and optionally removes it from the Scene and / or destroys it.\r\n *\r\n * Calls {@link Phaser.GameObjects.Group#removeCallback}.\r\n *\r\n * @method Phaser.GameObjects.Group#remove\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to remove.\r\n * @param {boolean} [removeFromScene=false] - Optionally remove the Group member from the Scene it belongs to.\r\n * @param {boolean} [destroyChild=false] - Optionally call destroy on the removed Group member.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n remove: function (child, removeFromScene, destroyChild)\r\n {\r\n if (removeFromScene === undefined) { removeFromScene = false; }\r\n if (destroyChild === undefined) { destroyChild = false; }\r\n\r\n if (!this.children.contains(child))\r\n {\r\n return this;\r\n }\r\n\r\n this.children.delete(child);\r\n\r\n if (this.internalRemoveCallback)\r\n {\r\n this.internalRemoveCallback.call(this, child);\r\n }\r\n\r\n if (this.removeCallback)\r\n {\r\n this.removeCallback.call(this, child);\r\n }\r\n\r\n child.off(Events.DESTROY, this.remove, this);\r\n\r\n if (destroyChild)\r\n {\r\n child.destroy();\r\n }\r\n else if (removeFromScene)\r\n {\r\n child.scene.sys.displayList.remove(child);\r\n\r\n if (child.preUpdate)\r\n {\r\n child.scene.sys.updateList.remove(child);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes all members of this Group and optionally removes them from the Scene and / or destroys them.\r\n *\r\n * Does not call {@link Phaser.GameObjects.Group#removeCallback}.\r\n *\r\n * @method Phaser.GameObjects.Group#clear\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [removeFromScene=false] - Optionally remove each Group member from the Scene.\r\n * @param {boolean} [destroyChild=false] - Optionally call destroy on the removed Group members.\r\n *\r\n * @return {Phaser.GameObjects.Group} This group.\r\n */\r\n clear: function (removeFromScene, destroyChild)\r\n {\r\n if (removeFromScene === undefined) { removeFromScene = false; }\r\n if (destroyChild === undefined) { destroyChild = false; }\r\n\r\n var children = this.children;\r\n\r\n for (var i = 0; i < children.size; i++)\r\n {\r\n var gameObject = children.entries[i];\r\n\r\n gameObject.off(Events.DESTROY, this.remove, this);\r\n\r\n if (destroyChild)\r\n {\r\n gameObject.destroy();\r\n }\r\n else if (removeFromScene)\r\n {\r\n gameObject.scene.sys.displayList.remove(gameObject);\r\n\r\n if (gameObject.preUpdate)\r\n {\r\n gameObject.scene.sys.updateList.remove(gameObject);\r\n }\r\n }\r\n }\r\n\r\n this.children.clear();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Tests if a Game Object is a member of this group.\r\n *\r\n * @method Phaser.GameObjects.Group#contains\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - A Game Object.\r\n *\r\n * @return {boolean} True if the Game Object is a member of this group.\r\n */\r\n contains: function (child)\r\n {\r\n return this.children.contains(child);\r\n },\r\n\r\n /**\r\n * All members of the group.\r\n *\r\n * @method Phaser.GameObjects.Group#getChildren\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject[]} The group members.\r\n */\r\n getChildren: function ()\r\n {\r\n return this.children.entries;\r\n },\r\n\r\n /**\r\n * The number of members of the group.\r\n *\r\n * @method Phaser.GameObjects.Group#getLength\r\n * @since 3.0.0\r\n *\r\n * @return {integer}\r\n */\r\n getLength: function ()\r\n {\r\n return this.children.size;\r\n },\r\n\r\n /**\r\n * Scans the Group, from top to bottom, for the first member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument,\r\n * assigns `x` and `y`, and returns the member.\r\n *\r\n * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`.\r\n * Unless a new member is created, `key`, `frame`, and `visible` are ignored.\r\n *\r\n * @method Phaser.GameObjects.Group#getFirst\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match.\r\n * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments.\r\n * @param {number} [x] - The horizontal position of the Game Object in the world.\r\n * @param {number} [y] - The vertical position of the Game Object in the world.\r\n * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created).\r\n * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created).\r\n * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created).\r\n *\r\n * @return {?any} The first matching group member, or a newly created member, or null.\r\n */\r\n getFirst: function (state, createIfNull, x, y, key, frame, visible)\r\n {\r\n return this.getHandler(true, 1, state, createIfNull, x, y, key, frame, visible);\r\n },\r\n\r\n /**\r\n * Scans the Group, from top to bottom, for the nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument,\r\n * assigns `x` and `y`, and returns the member.\r\n *\r\n * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`.\r\n * Unless a new member is created, `key`, `frame`, and `visible` are ignored.\r\n *\r\n * @method Phaser.GameObjects.Group#getFirstNth\r\n * @since 3.6.0\r\n *\r\n * @param {integer} nth - The nth matching Group member to search for.\r\n * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match.\r\n * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments.\r\n * @param {number} [x] - The horizontal position of the Game Object in the world.\r\n * @param {number} [y] - The vertical position of the Game Object in the world.\r\n * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created).\r\n * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created).\r\n * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created).\r\n *\r\n * @return {?any} The first matching group member, or a newly created member, or null.\r\n */\r\n getFirstNth: function (nth, state, createIfNull, x, y, key, frame, visible)\r\n {\r\n return this.getHandler(true, nth, state, createIfNull, x, y, key, frame, visible);\r\n },\r\n\r\n /**\r\n * Scans the Group for the last member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument,\r\n * assigns `x` and `y`, and returns the member.\r\n *\r\n * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`.\r\n * Unless a new member is created, `key`, `frame`, and `visible` are ignored.\r\n *\r\n * @method Phaser.GameObjects.Group#getLast\r\n * @since 3.6.0\r\n *\r\n * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match.\r\n * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments.\r\n * @param {number} [x] - The horizontal position of the Game Object in the world.\r\n * @param {number} [y] - The vertical position of the Game Object in the world.\r\n * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created).\r\n * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created).\r\n * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created).\r\n *\r\n * @return {?any} The first matching group member, or a newly created member, or null.\r\n */\r\n getLast: function (state, createIfNull, x, y, key, frame, visible)\r\n {\r\n return this.getHandler(false, 1, state, createIfNull, x, y, key, frame, visible);\r\n },\r\n\r\n /**\r\n * Scans the Group for the last nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument,\r\n * assigns `x` and `y`, and returns the member.\r\n *\r\n * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`.\r\n * Unless a new member is created, `key`, `frame`, and `visible` are ignored.\r\n *\r\n * @method Phaser.GameObjects.Group#getLastNth\r\n * @since 3.6.0\r\n *\r\n * @param {integer} nth - The nth matching Group member to search for.\r\n * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match.\r\n * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments.\r\n * @param {number} [x] - The horizontal position of the Game Object in the world.\r\n * @param {number} [y] - The vertical position of the Game Object in the world.\r\n * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created).\r\n * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created).\r\n * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created).\r\n *\r\n * @return {?any} The first matching group member, or a newly created member, or null.\r\n */\r\n getLastNth: function (nth, state, createIfNull, x, y, key, frame, visible)\r\n {\r\n return this.getHandler(false, nth, state, createIfNull, x, y, key, frame, visible);\r\n },\r\n\r\n /**\r\n * Scans the group for the last member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument,\r\n * assigns `x` and `y`, and returns the member.\r\n *\r\n * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`.\r\n * Unless a new member is created, `key`, `frame`, and `visible` are ignored.\r\n *\r\n * @method Phaser.GameObjects.Group#getHandler\r\n * @private\r\n * @since 3.6.0\r\n *\r\n * @param {boolean} forwards - Search front to back or back to front?\r\n * @param {integer} nth - Stop matching after nth successful matches.\r\n * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match.\r\n * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments.\r\n * @param {number} [x] - The horizontal position of the Game Object in the world.\r\n * @param {number} [y] - The vertical position of the Game Object in the world.\r\n * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created).\r\n * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created).\r\n * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created).\r\n *\r\n * @return {?any} The first matching group member, or a newly created member, or null.\r\n */\r\n getHandler: function (forwards, nth, state, createIfNull, x, y, key, frame, visible)\r\n {\r\n if (state === undefined) { state = false; }\r\n if (createIfNull === undefined) { createIfNull = false; }\r\n\r\n var gameObject;\r\n\r\n var i;\r\n var total = 0;\r\n var children = this.children.entries;\r\n\r\n if (forwards)\r\n {\r\n for (i = 0; i < children.length; i++)\r\n {\r\n gameObject = children[i];\r\n\r\n if (gameObject.active === state)\r\n {\r\n total++;\r\n\r\n if (total === nth)\r\n {\r\n break;\r\n }\r\n }\r\n else\r\n {\r\n gameObject = null;\r\n }\r\n }\r\n }\r\n else\r\n {\r\n for (i = children.length - 1; i >= 0; i--)\r\n {\r\n gameObject = children[i];\r\n\r\n if (gameObject.active === state)\r\n {\r\n total++;\r\n\r\n if (total === nth)\r\n {\r\n break;\r\n }\r\n }\r\n else\r\n {\r\n gameObject = null;\r\n }\r\n }\r\n }\r\n\r\n if (gameObject)\r\n {\r\n if (typeof(x) === 'number')\r\n {\r\n gameObject.x = x;\r\n }\r\n\r\n if (typeof(y) === 'number')\r\n {\r\n gameObject.y = y;\r\n }\r\n\r\n return gameObject;\r\n }\r\n\r\n // Got this far? We need to create or bail\r\n if (createIfNull)\r\n {\r\n return this.create(x, y, key, frame, visible);\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n },\r\n\r\n /**\r\n * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `false`,\r\n * assigns `x` and `y`, and returns the member.\r\n *\r\n * If no inactive member is found and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`.\r\n * The new Game Object will have its active state set to `true`.\r\n * Unless a new member is created, `key`, `frame`, and `visible` are ignored.\r\n *\r\n * @method Phaser.GameObjects.Group#get\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The horizontal position of the Game Object in the world.\r\n * @param {number} [y] - The vertical position of the Game Object in the world.\r\n * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created).\r\n * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created).\r\n * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created).\r\n *\r\n * @return {?any} The first inactive group member, or a newly created member, or null.\r\n */\r\n get: function (x, y, key, frame, visible)\r\n {\r\n return this.getFirst(false, true, x, y, key, frame, visible);\r\n },\r\n\r\n /**\r\n * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `true`,\r\n * assigns `x` and `y`, and returns the member.\r\n *\r\n * If no active member is found and `createIfNull` is `true` and the group isn't full then it will create a new one using `x`, `y`, `key`, `frame`, and `visible`.\r\n * Unless a new member is created, `key`, `frame`, and `visible` are ignored.\r\n *\r\n * @method Phaser.GameObjects.Group#getFirstAlive\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments.\r\n * @param {number} [x] - The horizontal position of the Game Object in the world.\r\n * @param {number} [y] - The vertical position of the Game Object in the world.\r\n * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created).\r\n * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created).\r\n * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created).\r\n *\r\n * @return {any} The first active group member, or a newly created member, or null.\r\n */\r\n getFirstAlive: function (createIfNull, x, y, key, frame, visible)\r\n {\r\n return this.getFirst(true, createIfNull, x, y, key, frame, visible);\r\n },\r\n\r\n /**\r\n * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `false`,\r\n * assigns `x` and `y`, and returns the member.\r\n *\r\n * If no inactive member is found and `createIfNull` is `true` and the group isn't full then it will create a new one using `x`, `y`, `key`, `frame`, and `visible`.\r\n * The new Game Object will have an active state set to `true`.\r\n * Unless a new member is created, `key`, `frame`, and `visible` are ignored.\r\n *\r\n * @method Phaser.GameObjects.Group#getFirstDead\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments.\r\n * @param {number} [x] - The horizontal position of the Game Object in the world.\r\n * @param {number} [y] - The vertical position of the Game Object in the world.\r\n * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created).\r\n * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created).\r\n * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created).\r\n *\r\n * @return {any} The first inactive group member, or a newly created member, or null.\r\n */\r\n getFirstDead: function (createIfNull, x, y, key, frame, visible)\r\n {\r\n return this.getFirst(false, createIfNull, x, y, key, frame, visible);\r\n },\r\n\r\n /**\r\n * {@link Phaser.GameObjects.Components.Animation#play Plays} an animation for all members of this group.\r\n *\r\n * @method Phaser.GameObjects.Group#playAnimation\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The string-based key of the animation to play.\r\n * @param {string} [startFrame=0] - Optionally start the animation playing from this frame index.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n playAnimation: function (key, startFrame)\r\n {\r\n Actions.PlayAnimation(this.children.entries, key, startFrame);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Whether this group's size at its {@link Phaser.GameObjects.Group#maxSize maximum}.\r\n *\r\n * @method Phaser.GameObjects.Group#isFull\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} True if the number of members equals {@link Phaser.GameObjects.Group#maxSize}.\r\n */\r\n isFull: function ()\r\n {\r\n if (this.maxSize === -1)\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return (this.children.size >= this.maxSize);\r\n }\r\n },\r\n\r\n /**\r\n * Counts the number of active (or inactive) group members.\r\n *\r\n * @method Phaser.GameObjects.Group#countActive\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [value=true] - Count active (true) or inactive (false) group members.\r\n *\r\n * @return {integer} The number of group members with an active state matching the `active` argument.\r\n */\r\n countActive: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n var total = 0;\r\n\r\n for (var i = 0; i < this.children.size; i++)\r\n {\r\n if (this.children.entries[i].active === value)\r\n {\r\n total++;\r\n }\r\n }\r\n\r\n return total;\r\n },\r\n\r\n /**\r\n * Counts the number of in-use (active) group members.\r\n *\r\n * @method Phaser.GameObjects.Group#getTotalUsed\r\n * @since 3.0.0\r\n *\r\n * @return {integer} The number of group members with an active state of true.\r\n */\r\n getTotalUsed: function ()\r\n {\r\n return this.countActive();\r\n },\r\n\r\n /**\r\n * The difference of {@link Phaser.GameObjects.Group#maxSize} and the number of active group members.\r\n *\r\n * This represents the number of group members that could be created or reactivated before reaching the size limit.\r\n *\r\n * @method Phaser.GameObjects.Group#getTotalFree\r\n * @since 3.0.0\r\n *\r\n * @return {integer} maxSize minus the number of active group numbers; or a large number (if maxSize is -1).\r\n */\r\n getTotalFree: function ()\r\n {\r\n var used = this.getTotalUsed();\r\n var capacity = (this.maxSize === -1) ? 999999999999 : this.maxSize;\r\n\r\n return (capacity - used);\r\n },\r\n\r\n /**\r\n * Sets the property as defined in `key` of each group member to the given value.\r\n *\r\n * @method Phaser.GameObjects.Group#propertyValueSet\r\n * @since 3.21.0\r\n *\r\n * @param {string} key - The property to be updated.\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n propertyValueSet: function (key, value, step, index, direction)\r\n {\r\n Actions.PropertyValueSet(this.children.entries, key, value, step, index, direction);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds the given value to the property as defined in `key` of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#propertyValueInc\r\n * @since 3.21.0\r\n *\r\n * @param {string} key - The property to be updated.\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n propertyValueInc: function (key, value, step, index, direction)\r\n {\r\n Actions.PropertyValueInc(this.children.entries, key, value, step, index, direction);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the x of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#setX\r\n * @since 3.21.0\r\n *\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n setX: function (value, step)\r\n {\r\n Actions.SetX(this.children.entries, value, step);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the y of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#setY\r\n * @since 3.21.0\r\n *\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n setY: function (value, step)\r\n {\r\n Actions.SetY(this.children.entries, value, step);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the x, y of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#setXY\r\n * @since 3.21.0\r\n *\r\n * @param {number} x - The amount to set the `x` property to.\r\n * @param {number} [y=x] - The amount to set the `y` property to. If `undefined` or `null` it uses the `x` value.\r\n * @param {number} [stepX=0] - This is added to the `x` amount, multiplied by the iteration counter.\r\n * @param {number} [stepY=0] - This is added to the `y` amount, multiplied by the iteration counter.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n setXY: function (x, y, stepX, stepY)\r\n {\r\n Actions.SetXY(this.children.entries, x, y, stepX, stepY);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds the given value to the x of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#incX\r\n * @since 3.21.0\r\n *\r\n * @param {number} value - The amount to be added to the `x` property.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n incX: function (value, step)\r\n {\r\n Actions.IncX(this.children.entries, value, step);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds the given value to the y of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#incY\r\n * @since 3.21.0\r\n *\r\n * @param {number} value - The amount to be added to the `y` property.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n incY: function (value, step)\r\n {\r\n Actions.IncY(this.children.entries, value, step);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds the given value to the x, y of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#incXY\r\n * @since 3.21.0\r\n *\r\n * @param {number} x - The amount to be added to the `x` property.\r\n * @param {number} [y=x] - The amount to be added to the `y` property. If `undefined` or `null` it uses the `x` value.\r\n * @param {number} [stepX=0] - This is added to the `x` amount, multiplied by the iteration counter.\r\n * @param {number} [stepY=0] - This is added to the `y` amount, multiplied by the iteration counter.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n incXY: function (x, y, stepX, stepY)\r\n {\r\n Actions.IncXY(this.children.entries, x, y, stepX, stepY);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Iterate through the group members changing the position of each element to be that of the element that came before\r\n * it in the array (or after it if direction = 1)\r\n * \r\n * The first group member position is set to x/y.\r\n *\r\n * @method Phaser.GameObjects.Group#shiftPosition\r\n * @since 3.21.0\r\n *\r\n * @param {number} x - The x coordinate to place the first item in the array at.\r\n * @param {number} y - The y coordinate to place the first item in the array at.\r\n * @param {integer} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n shiftPosition: function (x, y, direction)\r\n {\r\n Actions.ShiftPosition(this.children.entries, x, y, direction);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the angle of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#angle\r\n * @since 3.21.0\r\n *\r\n * @param {number} value - The amount to set the angle to, in degrees.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n angle: function (value, step)\r\n {\r\n Actions.Angle(this.children.entries, value, step);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the rotation of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#rotate\r\n * @since 3.21.0\r\n *\r\n * @param {number} value - The amount to set the rotation to, in radians.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n rotate: function (value, step)\r\n {\r\n Actions.Rotate(this.children.entries, value, step);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotates each group member around the given point by the given angle.\r\n *\r\n * @method Phaser.GameObjects.Group#rotateAround\r\n * @since 3.21.0\r\n *\r\n * @param {Phaser.Types.Math.Vector2Like} point - Any object with public `x` and `y` properties.\r\n * @param {number} angle - The angle to rotate by, in radians.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n rotateAround: function (point, angle)\r\n {\r\n Actions.RotateAround(this.children.entries, point, angle);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotates each group member around the given point by the given angle and distance.\r\n *\r\n * @method Phaser.GameObjects.Group#rotateAroundDistance\r\n * @since 3.21.0\r\n *\r\n * @param {Phaser.Types.Math.Vector2Like} point - Any object with public `x` and `y` properties.\r\n * @param {number} angle - The angle to rotate by, in radians.\r\n * @param {number} distance - The distance from the point of rotation in pixels.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n rotateAroundDistance: function (point, angle, distance)\r\n {\r\n Actions.RotateAroundDistance(this.children.entries, point, angle, distance);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the alpha of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#setAlpha\r\n * @since 3.21.0\r\n *\r\n * @param {number} value - The amount to set the alpha to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n setAlpha: function (value, step)\r\n {\r\n Actions.SetAlpha(this.children.entries, value, step);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the tint of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#setTint\r\n * @since 3.21.0\r\n *\r\n * @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.\r\n * @param {number} [topRight] - The tint to be applied to top-right corner of item.\r\n * @param {number} [bottomLeft] - The tint to be applied to the bottom-left corner of item.\r\n * @param {number} [bottomRight] - The tint to be applied to the bottom-right corner of item.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n setTint: function (topLeft, topRight, bottomLeft, bottomRight)\r\n {\r\n Actions.SetTint(this.children.entries, topLeft, topRight, bottomLeft, bottomRight);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the originX, originY of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#setOrigin\r\n * @since 3.21.0\r\n *\r\n * @param {number} originX - The amount to set the `originX` property to.\r\n * @param {number} [originY] - The amount to set the `originY` property to. If `undefined` or `null` it uses the `originX` value.\r\n * @param {number} [stepX=0] - This is added to the `originX` amount, multiplied by the iteration counter.\r\n * @param {number} [stepY=0] - This is added to the `originY` amount, multiplied by the iteration counter.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n setOrigin: function (originX, originY, stepX, stepY)\r\n {\r\n Actions.SetOrigin(this.children.entries, originX, originY, stepX, stepY);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the scaleX of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#scaleX\r\n * @since 3.21.0\r\n *\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n scaleX: function (value, step)\r\n {\r\n Actions.ScaleX(this.children.entries, value, step);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the scaleY of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#scaleY\r\n * @since 3.21.0\r\n *\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n scaleY: function (value, step)\r\n {\r\n Actions.ScaleY(this.children.entries, value, step);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the scaleX, scaleY of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#scaleXY\r\n * @since 3.21.0\r\n *\r\n * @param {number} scaleX - The amount to be added to the `scaleX` property.\r\n * @param {number} [scaleY] - The amount to be added to the `scaleY` property. If `undefined` or `null` it uses the `scaleX` value.\r\n * @param {number} [stepX=0] - This is added to the `scaleX` amount, multiplied by the iteration counter.\r\n * @param {number} [stepY=0] - This is added to the `scaleY` amount, multiplied by the iteration counter.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n scaleXY: function (scaleX, scaleY, stepX, stepY)\r\n {\r\n Actions.ScaleXY(this.children.entries, scaleX, scaleY, stepX, stepY);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the depth of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#setDepth\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The amount to set the property to.\r\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n setDepth: function (value, step)\r\n {\r\n Actions.SetDepth(this.children.entries, value, step);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the blendMode of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#setBlendMode\r\n * @since 3.21.0\r\n *\r\n * @param {number} value - The amount to set the property to.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n setBlendMode: function (value)\r\n {\r\n Actions.SetBlendMode(this.children.entries, value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Passes all group members to the Input Manager to enable them for input with identical areas and callbacks.\r\n *\r\n * @method Phaser.GameObjects.Group#setHitArea\r\n * @since 3.21.0\r\n *\r\n * @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.\r\n * @param {Phaser.Types.Input.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.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n setHitArea: function (hitArea, hitAreaCallback)\r\n {\r\n Actions.SetHitArea(this.children.entries, hitArea, hitAreaCallback);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Shuffles the group members in place.\r\n *\r\n * @method Phaser.GameObjects.Group#shuffle\r\n * @since 3.21.0\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n shuffle: function ()\r\n {\r\n Actions.Shuffle(this.children.entries);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Deactivates a member of this group.\r\n *\r\n * @method Phaser.GameObjects.Group#kill\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - A member of this group.\r\n */\r\n kill: function (gameObject)\r\n {\r\n if (this.children.contains(gameObject))\r\n {\r\n gameObject.setActive(false);\r\n }\r\n },\r\n\r\n /**\r\n * Deactivates and hides a member of this group.\r\n *\r\n * @method Phaser.GameObjects.Group#killAndHide\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - A member of this group.\r\n */\r\n killAndHide: function (gameObject)\r\n {\r\n if (this.children.contains(gameObject))\r\n {\r\n gameObject.setActive(false);\r\n gameObject.setVisible(false);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the visible of each group member.\r\n *\r\n * @method Phaser.GameObjects.Group#setVisible\r\n * @since 3.21.0\r\n *\r\n * @param {boolean} value - The value to set the property to.\r\n * @param {integer} [index=0] - An optional offset to start searching from within the items array.\r\n * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n setVisible: function (value, index, direction)\r\n {\r\n Actions.SetVisible(this.children.entries, value, index, direction);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Toggles (flips) the visible state of each member of this group.\r\n *\r\n * @method Phaser.GameObjects.Group#toggleVisible\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Group} This Group object.\r\n */\r\n toggleVisible: function ()\r\n {\r\n Actions.ToggleVisible(this.children.entries);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Empties this group and removes it from the Scene.\r\n *\r\n * Does not call {@link Phaser.GameObjects.Group#removeCallback}.\r\n *\r\n * @method Phaser.GameObjects.Group#destroy\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [destroyChildren=false] - Also {@link Phaser.GameObjects.GameObject#destroy} each group member.\r\n */\r\n destroy: function (destroyChildren)\r\n {\r\n if (destroyChildren === undefined) { destroyChildren = false; }\r\n\r\n // This Game Object had already been destroyed\r\n if (!this.scene || this.ignoreDestroy)\r\n {\r\n return;\r\n }\r\n\r\n this.clear(false, destroyChildren);\r\n\r\n this.scene = undefined;\r\n this.children = undefined;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Group;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/group/Group.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/group/GroupCreator.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/group/GroupCreator.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectCreator = __webpack_require__(/*! ../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar Group = __webpack_require__(/*! ./Group */ \"./node_modules/phaser/src/gameobjects/group/Group.js\");\r\n\r\n/**\r\n * Creates a new Group Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Group Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#group\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} config - The configuration object this Game Object will use to create itself.\r\n *\r\n * @return {Phaser.GameObjects.Group} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('group', function (config)\r\n{\r\n return new Group(this.scene, null, config);\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectCreator context.\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/group/GroupCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/group/GroupFactory.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/group/GroupFactory.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Group = __webpack_require__(/*! ./Group */ \"./node_modules/phaser/src/gameobjects/group/Group.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Group Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Group Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#group\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupConfig[])} [children] - Game Objects to add to this Group; or the `config` argument.\r\n * @param {Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} [config] - A Group Configuration object.\r\n *\r\n * @return {Phaser.GameObjects.Group} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('group', function (children, config)\r\n{\r\n return this.updateList.add(new Group(this.scene, children, config));\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/group/GroupFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/image/Image.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/image/Image.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar ImageRender = __webpack_require__(/*! ./ImageRender */ \"./node_modules/phaser/src/gameobjects/image/ImageRender.js\");\r\n\r\n/**\r\n * @classdesc\r\n * An Image Game Object.\r\n *\r\n * An Image is a light-weight Game Object useful for the display of static images in your game,\r\n * such as logos, backgrounds, scenery or other non-animated elements. Images can have input\r\n * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an\r\n * Image and a Sprite is that you cannot animate an Image as they do not have the Animation component.\r\n *\r\n * @class Image\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Size\r\n * @extends Phaser.GameObjects.Components.TextureCrop\r\n * @extends Phaser.GameObjects.Components.Tint\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n */\r\nvar Image = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.Alpha,\r\n Components.BlendMode,\r\n Components.Depth,\r\n Components.Flip,\r\n Components.GetBounds,\r\n Components.Mask,\r\n Components.Origin,\r\n Components.Pipeline,\r\n Components.ScrollFactor,\r\n Components.Size,\r\n Components.TextureCrop,\r\n Components.Tint,\r\n Components.Transform,\r\n Components.Visible,\r\n ImageRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Image (scene, x, y, texture, frame)\r\n {\r\n GameObject.call(this, scene, 'Image');\r\n\r\n /**\r\n * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method.\r\n *\r\n * @name Phaser.GameObjects.Image#_crop\r\n * @type {object}\r\n * @private\r\n * @since 3.11.0\r\n */\r\n this._crop = this.resetCropObject();\r\n\r\n this.setTexture(texture, frame);\r\n this.setPosition(x, y);\r\n this.setSizeToFrame();\r\n this.setOriginFromFrame();\r\n this.initPipeline();\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Image;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/image/Image.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/image/ImageCanvasRenderer.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/image/ImageCanvasRenderer.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Image#renderCanvas\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar ImageCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n renderer.batchSprite(src, src.frame, camera, parentMatrix);\r\n};\r\n\r\nmodule.exports = ImageCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/image/ImageCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/image/ImageCreator.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/image/ImageCreator.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BuildGameObject = __webpack_require__(/*! ../BuildGameObject */ \"./node_modules/phaser/src/gameobjects/BuildGameObject.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar Image = __webpack_require__(/*! ./Image */ \"./node_modules/phaser/src/gameobjects/image/Image.js\");\r\n\r\n/**\r\n * Creates a new Image Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Image Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#image\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {Phaser.GameObjects.Image} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('image', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n var key = GetAdvancedValue(config, 'key', null);\r\n var frame = GetAdvancedValue(config, 'frame', null);\r\n\r\n var image = new Image(this.scene, 0, 0, key, frame);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, image, config);\r\n\r\n return image;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectCreator context.\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/image/ImageCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/image/ImageFactory.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/image/ImageFactory.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Image = __webpack_require__(/*! ./Image */ \"./node_modules/phaser/src/gameobjects/image/Image.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Image Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Image Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#image\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n *\r\n * @return {Phaser.GameObjects.Image} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('image', function (x, y, key, frame)\r\n{\r\n return this.displayList.add(new Image(this.scene, x, y, key, frame));\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/image/ImageFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/image/ImageRender.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/image/ImageRender.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./ImageWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/image/ImageWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./ImageCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/image/ImageCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/image/ImageRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/image/ImageWebGLRenderer.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/image/ImageWebGLRenderer.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Image#renderWebGL\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar ImageWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n this.pipeline.batchSprite(src, camera, parentMatrix);\r\n};\r\n\r\nmodule.exports = ImageWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/image/ImageWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/index.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.GameObjects\r\n */\r\n\r\nvar GameObjects = {\r\n\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/gameobjects/events/index.js\"),\r\n\r\n DisplayList: __webpack_require__(/*! ./DisplayList */ \"./node_modules/phaser/src/gameobjects/DisplayList.js\"),\r\n GameObjectCreator: __webpack_require__(/*! ./GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\"),\r\n GameObjectFactory: __webpack_require__(/*! ./GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\"),\r\n UpdateList: __webpack_require__(/*! ./UpdateList */ \"./node_modules/phaser/src/gameobjects/UpdateList.js\"),\r\n\r\n Components: __webpack_require__(/*! ./components */ \"./node_modules/phaser/src/gameobjects/components/index.js\"),\r\n\r\n BuildGameObject: __webpack_require__(/*! ./BuildGameObject */ \"./node_modules/phaser/src/gameobjects/BuildGameObject.js\"),\r\n BuildGameObjectAnimation: __webpack_require__(/*! ./BuildGameObjectAnimation */ \"./node_modules/phaser/src/gameobjects/BuildGameObjectAnimation.js\"),\r\n GameObject: __webpack_require__(/*! ./GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\"),\r\n BitmapText: __webpack_require__(/*! ./bitmaptext/static/BitmapText */ \"./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapText.js\"),\r\n Blitter: __webpack_require__(/*! ./blitter/Blitter */ \"./node_modules/phaser/src/gameobjects/blitter/Blitter.js\"),\r\n Container: __webpack_require__(/*! ./container/Container */ \"./node_modules/phaser/src/gameobjects/container/Container.js\"),\r\n DOMElement: __webpack_require__(/*! ./domelement/DOMElement */ \"./node_modules/phaser/src/gameobjects/domelement/DOMElement.js\"),\r\n DynamicBitmapText: __webpack_require__(/*! ./bitmaptext/dynamic/DynamicBitmapText */ \"./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js\"),\r\n Extern: __webpack_require__(/*! ./extern/Extern.js */ \"./node_modules/phaser/src/gameobjects/extern/Extern.js\"),\r\n Graphics: __webpack_require__(/*! ./graphics/Graphics.js */ \"./node_modules/phaser/src/gameobjects/graphics/Graphics.js\"),\r\n Group: __webpack_require__(/*! ./group/Group */ \"./node_modules/phaser/src/gameobjects/group/Group.js\"),\r\n Image: __webpack_require__(/*! ./image/Image */ \"./node_modules/phaser/src/gameobjects/image/Image.js\"),\r\n Particles: __webpack_require__(/*! ./particles */ \"./node_modules/phaser/src/gameobjects/particles/index.js\"),\r\n PathFollower: __webpack_require__(/*! ./pathfollower/PathFollower */ \"./node_modules/phaser/src/gameobjects/pathfollower/PathFollower.js\"),\r\n RenderTexture: __webpack_require__(/*! ./rendertexture/RenderTexture */ \"./node_modules/phaser/src/gameobjects/rendertexture/RenderTexture.js\"),\r\n RetroFont: __webpack_require__(/*! ./bitmaptext/RetroFont */ \"./node_modules/phaser/src/gameobjects/bitmaptext/RetroFont.js\"),\r\n Sprite: __webpack_require__(/*! ./sprite/Sprite */ \"./node_modules/phaser/src/gameobjects/sprite/Sprite.js\"),\r\n Text: __webpack_require__(/*! ./text/static/Text */ \"./node_modules/phaser/src/gameobjects/text/static/Text.js\"),\r\n TileSprite: __webpack_require__(/*! ./tilesprite/TileSprite */ \"./node_modules/phaser/src/gameobjects/tilesprite/TileSprite.js\"),\r\n Zone: __webpack_require__(/*! ./zone/Zone */ \"./node_modules/phaser/src/gameobjects/zone/Zone.js\"),\r\n Video: __webpack_require__(/*! ./video/Video */ \"./node_modules/phaser/src/gameobjects/video/Video.js\"),\r\n\r\n // Shapes\r\n\r\n Shape: __webpack_require__(/*! ./shape/Shape */ \"./node_modules/phaser/src/gameobjects/shape/Shape.js\"),\r\n Arc: __webpack_require__(/*! ./shape/arc/Arc */ \"./node_modules/phaser/src/gameobjects/shape/arc/Arc.js\"),\r\n Curve: __webpack_require__(/*! ./shape/curve/Curve */ \"./node_modules/phaser/src/gameobjects/shape/curve/Curve.js\"),\r\n Ellipse: __webpack_require__(/*! ./shape/ellipse/Ellipse */ \"./node_modules/phaser/src/gameobjects/shape/ellipse/Ellipse.js\"),\r\n Grid: __webpack_require__(/*! ./shape/grid/Grid */ \"./node_modules/phaser/src/gameobjects/shape/grid/Grid.js\"),\r\n IsoBox: __webpack_require__(/*! ./shape/isobox/IsoBox */ \"./node_modules/phaser/src/gameobjects/shape/isobox/IsoBox.js\"),\r\n IsoTriangle: __webpack_require__(/*! ./shape/isotriangle/IsoTriangle */ \"./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangle.js\"),\r\n Line: __webpack_require__(/*! ./shape/line/Line */ \"./node_modules/phaser/src/gameobjects/shape/line/Line.js\"),\r\n Polygon: __webpack_require__(/*! ./shape/polygon/Polygon */ \"./node_modules/phaser/src/gameobjects/shape/polygon/Polygon.js\"),\r\n Rectangle: __webpack_require__(/*! ./shape/rectangle/Rectangle */ \"./node_modules/phaser/src/gameobjects/shape/rectangle/Rectangle.js\"),\r\n Star: __webpack_require__(/*! ./shape/star/Star */ \"./node_modules/phaser/src/gameobjects/shape/star/Star.js\"),\r\n Triangle: __webpack_require__(/*! ./shape/triangle/Triangle */ \"./node_modules/phaser/src/gameobjects/shape/triangle/Triangle.js\"),\r\n\r\n // Game Object Factories\r\n\r\n Factories: {\r\n Blitter: __webpack_require__(/*! ./blitter/BlitterFactory */ \"./node_modules/phaser/src/gameobjects/blitter/BlitterFactory.js\"),\r\n Container: __webpack_require__(/*! ./container/ContainerFactory */ \"./node_modules/phaser/src/gameobjects/container/ContainerFactory.js\"),\r\n DOMElement: __webpack_require__(/*! ./domelement/DOMElementFactory */ \"./node_modules/phaser/src/gameobjects/domelement/DOMElementFactory.js\"),\r\n DynamicBitmapText: __webpack_require__(/*! ./bitmaptext/dynamic/DynamicBitmapTextFactory */ \"./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextFactory.js\"),\r\n Extern: __webpack_require__(/*! ./extern/ExternFactory */ \"./node_modules/phaser/src/gameobjects/extern/ExternFactory.js\"),\r\n Graphics: __webpack_require__(/*! ./graphics/GraphicsFactory */ \"./node_modules/phaser/src/gameobjects/graphics/GraphicsFactory.js\"),\r\n Group: __webpack_require__(/*! ./group/GroupFactory */ \"./node_modules/phaser/src/gameobjects/group/GroupFactory.js\"),\r\n Image: __webpack_require__(/*! ./image/ImageFactory */ \"./node_modules/phaser/src/gameobjects/image/ImageFactory.js\"),\r\n Particles: __webpack_require__(/*! ./particles/ParticleManagerFactory */ \"./node_modules/phaser/src/gameobjects/particles/ParticleManagerFactory.js\"),\r\n PathFollower: __webpack_require__(/*! ./pathfollower/PathFollowerFactory */ \"./node_modules/phaser/src/gameobjects/pathfollower/PathFollowerFactory.js\"),\r\n RenderTexture: __webpack_require__(/*! ./rendertexture/RenderTextureFactory */ \"./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureFactory.js\"),\r\n Sprite: __webpack_require__(/*! ./sprite/SpriteFactory */ \"./node_modules/phaser/src/gameobjects/sprite/SpriteFactory.js\"),\r\n StaticBitmapText: __webpack_require__(/*! ./bitmaptext/static/BitmapTextFactory */ \"./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextFactory.js\"),\r\n Text: __webpack_require__(/*! ./text/static/TextFactory */ \"./node_modules/phaser/src/gameobjects/text/static/TextFactory.js\"),\r\n TileSprite: __webpack_require__(/*! ./tilesprite/TileSpriteFactory */ \"./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteFactory.js\"),\r\n Zone: __webpack_require__(/*! ./zone/ZoneFactory */ \"./node_modules/phaser/src/gameobjects/zone/ZoneFactory.js\"),\r\n Video: __webpack_require__(/*! ./video/VideoFactory */ \"./node_modules/phaser/src/gameobjects/video/VideoFactory.js\"),\r\n\r\n // Shapes\r\n Arc: __webpack_require__(/*! ./shape/arc/ArcFactory */ \"./node_modules/phaser/src/gameobjects/shape/arc/ArcFactory.js\"),\r\n Curve: __webpack_require__(/*! ./shape/curve/CurveFactory */ \"./node_modules/phaser/src/gameobjects/shape/curve/CurveFactory.js\"),\r\n Ellipse: __webpack_require__(/*! ./shape/ellipse/EllipseFactory */ \"./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseFactory.js\"),\r\n Grid: __webpack_require__(/*! ./shape/grid/GridFactory */ \"./node_modules/phaser/src/gameobjects/shape/grid/GridFactory.js\"),\r\n IsoBox: __webpack_require__(/*! ./shape/isobox/IsoBoxFactory */ \"./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxFactory.js\"),\r\n IsoTriangle: __webpack_require__(/*! ./shape/isotriangle/IsoTriangleFactory */ \"./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleFactory.js\"),\r\n Line: __webpack_require__(/*! ./shape/line/LineFactory */ \"./node_modules/phaser/src/gameobjects/shape/line/LineFactory.js\"),\r\n Polygon: __webpack_require__(/*! ./shape/polygon/PolygonFactory */ \"./node_modules/phaser/src/gameobjects/shape/polygon/PolygonFactory.js\"),\r\n Rectangle: __webpack_require__(/*! ./shape/rectangle/RectangleFactory */ \"./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleFactory.js\"),\r\n Star: __webpack_require__(/*! ./shape/star/StarFactory */ \"./node_modules/phaser/src/gameobjects/shape/star/StarFactory.js\"),\r\n Triangle: __webpack_require__(/*! ./shape/triangle/TriangleFactory */ \"./node_modules/phaser/src/gameobjects/shape/triangle/TriangleFactory.js\")\r\n },\r\n\r\n Creators: {\r\n Blitter: __webpack_require__(/*! ./blitter/BlitterCreator */ \"./node_modules/phaser/src/gameobjects/blitter/BlitterCreator.js\"),\r\n Container: __webpack_require__(/*! ./container/ContainerCreator */ \"./node_modules/phaser/src/gameobjects/container/ContainerCreator.js\"),\r\n DynamicBitmapText: __webpack_require__(/*! ./bitmaptext/dynamic/DynamicBitmapTextCreator */ \"./node_modules/phaser/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextCreator.js\"),\r\n Graphics: __webpack_require__(/*! ./graphics/GraphicsCreator */ \"./node_modules/phaser/src/gameobjects/graphics/GraphicsCreator.js\"),\r\n Group: __webpack_require__(/*! ./group/GroupCreator */ \"./node_modules/phaser/src/gameobjects/group/GroupCreator.js\"),\r\n Image: __webpack_require__(/*! ./image/ImageCreator */ \"./node_modules/phaser/src/gameobjects/image/ImageCreator.js\"),\r\n Particles: __webpack_require__(/*! ./particles/ParticleManagerCreator */ \"./node_modules/phaser/src/gameobjects/particles/ParticleManagerCreator.js\"),\r\n RenderTexture: __webpack_require__(/*! ./rendertexture/RenderTextureCreator */ \"./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureCreator.js\"),\r\n Sprite: __webpack_require__(/*! ./sprite/SpriteCreator */ \"./node_modules/phaser/src/gameobjects/sprite/SpriteCreator.js\"),\r\n StaticBitmapText: __webpack_require__(/*! ./bitmaptext/static/BitmapTextCreator */ \"./node_modules/phaser/src/gameobjects/bitmaptext/static/BitmapTextCreator.js\"),\r\n Text: __webpack_require__(/*! ./text/static/TextCreator */ \"./node_modules/phaser/src/gameobjects/text/static/TextCreator.js\"),\r\n TileSprite: __webpack_require__(/*! ./tilesprite/TileSpriteCreator */ \"./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteCreator.js\"),\r\n Zone: __webpack_require__(/*! ./zone/ZoneCreator */ \"./node_modules/phaser/src/gameobjects/zone/ZoneCreator.js\"),\r\n Video: __webpack_require__(/*! ./video/VideoCreator */ \"./node_modules/phaser/src/gameobjects/video/VideoCreator.js\")\r\n }\r\n\r\n};\r\n\r\nif (true)\r\n{\r\n // WebGL only Game Objects\r\n GameObjects.Mesh = __webpack_require__(/*! ./mesh/Mesh */ \"./node_modules/phaser/src/gameobjects/mesh/Mesh.js\");\r\n GameObjects.Quad = __webpack_require__(/*! ./quad/Quad */ \"./node_modules/phaser/src/gameobjects/quad/Quad.js\");\r\n GameObjects.Shader = __webpack_require__(/*! ./shader/Shader */ \"./node_modules/phaser/src/gameobjects/shader/Shader.js\");\r\n\r\n GameObjects.Factories.Mesh = __webpack_require__(/*! ./mesh/MeshFactory */ \"./node_modules/phaser/src/gameobjects/mesh/MeshFactory.js\");\r\n GameObjects.Factories.Quad = __webpack_require__(/*! ./quad/QuadFactory */ \"./node_modules/phaser/src/gameobjects/quad/QuadFactory.js\");\r\n GameObjects.Factories.Shader = __webpack_require__(/*! ./shader/ShaderFactory */ \"./node_modules/phaser/src/gameobjects/shader/ShaderFactory.js\");\r\n\r\n GameObjects.Creators.Mesh = __webpack_require__(/*! ./mesh/MeshCreator */ \"./node_modules/phaser/src/gameobjects/mesh/MeshCreator.js\");\r\n GameObjects.Creators.Quad = __webpack_require__(/*! ./quad/QuadCreator */ \"./node_modules/phaser/src/gameobjects/quad/QuadCreator.js\");\r\n GameObjects.Creators.Shader = __webpack_require__(/*! ./shader/ShaderCreator */ \"./node_modules/phaser/src/gameobjects/shader/ShaderCreator.js\");\r\n\r\n GameObjects.Light = __webpack_require__(/*! ./lights/Light */ \"./node_modules/phaser/src/gameobjects/lights/Light.js\");\r\n\r\n __webpack_require__(/*! ./lights/LightsManager */ \"./node_modules/phaser/src/gameobjects/lights/LightsManager.js\");\r\n __webpack_require__(/*! ./lights/LightsPlugin */ \"./node_modules/phaser/src/gameobjects/lights/LightsPlugin.js\");\r\n}\r\n\r\nmodule.exports = GameObjects;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/lights/Light.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/lights/Light.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Utils = __webpack_require__(/*! ../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A 2D point light.\r\n *\r\n * These are typically created by a {@link Phaser.GameObjects.LightsManager}, available from within a scene via `this.lights`.\r\n *\r\n * Any Game Objects using the Light2D pipeline will then be affected by these Lights.\r\n *\r\n * They can also simply be used to represent a point light for your own purposes.\r\n *\r\n * @class Light\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of the light.\r\n * @param {number} y - The vertical position of the light.\r\n * @param {number} radius - The radius of the light.\r\n * @param {number} r - The red color of the light. A value between 0 and 1.\r\n * @param {number} g - The green color of the light. A value between 0 and 1.\r\n * @param {number} b - The blue color of the light. A value between 0 and 1.\r\n * @param {number} intensity - The intensity of the light.\r\n */\r\nvar Light = new Class({\r\n\r\n initialize:\r\n\r\n function Light (x, y, radius, r, g, b, intensity)\r\n {\r\n /**\r\n * The horizontal position of the light.\r\n *\r\n * @name Phaser.GameObjects.Light#x\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.x = x;\r\n\r\n /**\r\n * The vertical position of the light.\r\n *\r\n * @name Phaser.GameObjects.Light#y\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.y = y;\r\n\r\n /**\r\n * The radius of the light.\r\n *\r\n * @name Phaser.GameObjects.Light#radius\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.radius = radius;\r\n\r\n /**\r\n * The red color of the light. A value between 0 and 1.\r\n *\r\n * @name Phaser.GameObjects.Light#r\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.r = r;\r\n\r\n /**\r\n * The green color of the light. A value between 0 and 1.\r\n *\r\n * @name Phaser.GameObjects.Light#g\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.g = g;\r\n\r\n /**\r\n * The blue color of the light. A value between 0 and 1.\r\n *\r\n * @name Phaser.GameObjects.Light#b\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.b = b;\r\n\r\n /**\r\n * The intensity of the light.\r\n *\r\n * @name Phaser.GameObjects.Light#intensity\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.intensity = intensity;\r\n\r\n /**\r\n * The horizontal scroll factor of the light.\r\n *\r\n * @name Phaser.GameObjects.Light#scrollFactorX\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.scrollFactorX = 1.0;\r\n\r\n /**\r\n * The vertical scroll factor of the light.\r\n *\r\n * @name Phaser.GameObjects.Light#scrollFactorY\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.scrollFactorY = 1.0;\r\n },\r\n\r\n /**\r\n * Set the properties of the light.\r\n *\r\n * Sets both horizontal and vertical scroll factor to 1. Use {@link Phaser.GameObjects.Light#setScrollFactor} to set\r\n * the scroll factor.\r\n *\r\n * @method Phaser.GameObjects.Light#set\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of the light.\r\n * @param {number} y - The vertical position of the light.\r\n * @param {number} radius - The radius of the light.\r\n * @param {number} r - The red color. A value between 0 and 1.\r\n * @param {number} g - The green color. A value between 0 and 1.\r\n * @param {number} b - The blue color. A value between 0 and 1.\r\n * @param {number} intensity - The intensity of the light.\r\n *\r\n * @return {Phaser.GameObjects.Light} This Light object.\r\n */\r\n set: function (x, y, radius, r, g, b, intensity)\r\n {\r\n this.x = x;\r\n this.y = y;\r\n\r\n this.radius = radius;\r\n\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n\r\n this.intensity = intensity;\r\n\r\n this.scrollFactorX = 1;\r\n this.scrollFactorY = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the scroll factor of the light.\r\n *\r\n * @method Phaser.GameObjects.Light#setScrollFactor\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scroll factor of the light.\r\n * @param {number} y - The vertical scroll factor of the light.\r\n *\r\n * @return {Phaser.GameObjects.Light} This Light object.\r\n */\r\n setScrollFactor: function (x, y)\r\n {\r\n if (x === undefined) { x = 1; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.scrollFactorX = x;\r\n this.scrollFactorY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the color of the light from a single integer RGB value.\r\n *\r\n * @method Phaser.GameObjects.Light#setColor\r\n * @since 3.0.0\r\n *\r\n * @param {number} rgb - The integer RGB color of the light.\r\n *\r\n * @return {Phaser.GameObjects.Light} This Light object.\r\n */\r\n setColor: function (rgb)\r\n {\r\n var color = Utils.getFloatsFromUintRGB(rgb);\r\n\r\n this.r = color[0];\r\n this.g = color[1];\r\n this.b = color[2];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the intensity of the light.\r\n *\r\n * @method Phaser.GameObjects.Light#setIntensity\r\n * @since 3.0.0\r\n *\r\n * @param {number} intensity - The intensity of the light.\r\n *\r\n * @return {Phaser.GameObjects.Light} This Light object.\r\n */\r\n setIntensity: function (intensity)\r\n {\r\n this.intensity = intensity;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the position of the light.\r\n *\r\n * @method Phaser.GameObjects.Light#setPosition\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of the light.\r\n * @param {number} y - The vertical position of the light.\r\n *\r\n * @return {Phaser.GameObjects.Light} This Light object.\r\n */\r\n setPosition: function (x, y)\r\n {\r\n this.x = x;\r\n this.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the radius of the light.\r\n *\r\n * @method Phaser.GameObjects.Light#setRadius\r\n * @since 3.0.0\r\n *\r\n * @param {number} radius - The radius of the light.\r\n *\r\n * @return {Phaser.GameObjects.Light} This Light object.\r\n */\r\n setRadius: function (radius)\r\n {\r\n this.radius = radius;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Light;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/lights/Light.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/lights/LightsManager.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/lights/LightsManager.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Light = __webpack_require__(/*! ./Light */ \"./node_modules/phaser/src/gameobjects/lights/Light.js\");\r\nvar Utils = __webpack_require__(/*! ../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * @callback LightForEach\r\n *\r\n * @param {Phaser.GameObjects.Light} light - The Light.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * Manages Lights for a Scene.\r\n *\r\n * Affects the rendering of Game Objects using the `Light2D` pipeline.\r\n *\r\n * @class LightsManager\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n */\r\nvar LightsManager = new Class({\r\n\r\n initialize:\r\n\r\n function LightsManager ()\r\n {\r\n /**\r\n * The pool of Lights.\r\n *\r\n * Used to recycle removed Lights for a more efficient use of memory.\r\n *\r\n * @name Phaser.GameObjects.LightsManager#lightPool\r\n * @type {Phaser.GameObjects.Light[]}\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.lightPool = [];\r\n\r\n /**\r\n * The Lights in the Scene.\r\n *\r\n * @name Phaser.GameObjects.LightsManager#lights\r\n * @type {Phaser.GameObjects.Light[]}\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.lights = [];\r\n\r\n /**\r\n * Lights that have been culled from a Camera's viewport.\r\n *\r\n * Lights in this list will not be rendered.\r\n *\r\n * @name Phaser.GameObjects.LightsManager#culledLights\r\n * @type {Phaser.GameObjects.Light[]}\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.culledLights = [];\r\n\r\n /**\r\n * The ambient color.\r\n *\r\n * @name Phaser.GameObjects.LightsManager#ambientColor\r\n * @type {{ r: number, g: number, b: number }}\r\n * @since 3.0.0\r\n */\r\n this.ambientColor = { r: 0.1, g: 0.1, b: 0.1 };\r\n\r\n /**\r\n * Whether the Lights Manager is enabled.\r\n *\r\n * @name Phaser.GameObjects.LightsManager#active\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.active = false;\r\n\r\n /**\r\n * The maximum number of lights that a single Camera and the lights shader can process.\r\n * Change this via the `maxLights` property in your game config, as it cannot be changed at runtime.\r\n *\r\n * @name Phaser.GameObjects.LightsManager#maxLights\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.15.0\r\n */\r\n this.maxLights = -1;\r\n },\r\n\r\n /**\r\n * Enable the Lights Manager.\r\n *\r\n * @method Phaser.GameObjects.LightsManager#enable\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.LightsManager} This Lights Manager object.\r\n */\r\n enable: function ()\r\n {\r\n if (this.maxLights === -1)\r\n {\r\n this.maxLights = this.scene.sys.game.renderer.config.maxLights;\r\n }\r\n\r\n this.active = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Disable the Lights Manager.\r\n *\r\n * @method Phaser.GameObjects.LightsManager#disable\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.LightsManager} This Lights Manager object.\r\n */\r\n disable: function ()\r\n {\r\n this.active = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Cull any Lights that aren't visible to the given Camera.\r\n *\r\n * Culling Lights improves performance by ensuring that only Lights within a Camera's viewport are rendered.\r\n *\r\n * @method Phaser.GameObjects.LightsManager#cull\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to cull Lights for.\r\n *\r\n * @return {Phaser.GameObjects.Light[]} The culled Lights.\r\n */\r\n cull: function (camera)\r\n {\r\n var lights = this.lights;\r\n var culledLights = this.culledLights;\r\n var length = lights.length;\r\n var cameraCenterX = camera.x + camera.width / 2.0;\r\n var cameraCenterY = camera.y + camera.height / 2.0;\r\n var cameraRadius = (camera.width + camera.height) / 2.0;\r\n var point = { x: 0, y: 0 };\r\n var cameraMatrix = camera.matrix;\r\n var viewportHeight = this.systems.game.config.height;\r\n\r\n culledLights.length = 0;\r\n\r\n for (var index = 0; index < length && culledLights.length < this.maxLights; index++)\r\n {\r\n var light = lights[index];\r\n\r\n cameraMatrix.transformPoint(light.x, light.y, point);\r\n\r\n // We'll just use bounding spheres to test if lights should be rendered\r\n var dx = cameraCenterX - (point.x - (camera.scrollX * light.scrollFactorX * camera.zoom));\r\n var dy = cameraCenterY - (viewportHeight - (point.y - (camera.scrollY * light.scrollFactorY) * camera.zoom));\r\n var distance = Math.sqrt(dx * dx + dy * dy);\r\n\r\n if (distance < light.radius + cameraRadius)\r\n {\r\n culledLights.push(lights[index]);\r\n }\r\n }\r\n\r\n return culledLights;\r\n },\r\n\r\n /**\r\n * Iterate over each Light with a callback.\r\n *\r\n * @method Phaser.GameObjects.LightsManager#forEachLight\r\n * @since 3.0.0\r\n *\r\n * @param {LightForEach} callback - The callback that is called with each Light.\r\n *\r\n * @return {Phaser.GameObjects.LightsManager} This Lights Manager object.\r\n */\r\n forEachLight: function (callback)\r\n {\r\n if (!callback)\r\n {\r\n return;\r\n }\r\n\r\n var lights = this.lights;\r\n var length = lights.length;\r\n\r\n for (var index = 0; index < length; ++index)\r\n {\r\n callback(lights[index]);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the ambient light color.\r\n *\r\n * @method Phaser.GameObjects.LightsManager#setAmbientColor\r\n * @since 3.0.0\r\n *\r\n * @param {number} rgb - The integer RGB color of the ambient light.\r\n *\r\n * @return {Phaser.GameObjects.LightsManager} This Lights Manager object.\r\n */\r\n setAmbientColor: function (rgb)\r\n {\r\n var color = Utils.getFloatsFromUintRGB(rgb);\r\n\r\n this.ambientColor.r = color[0];\r\n this.ambientColor.g = color[1];\r\n this.ambientColor.b = color[2];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns the maximum number of Lights allowed to appear at once.\r\n *\r\n * @method Phaser.GameObjects.LightsManager#getMaxVisibleLights\r\n * @since 3.0.0\r\n *\r\n * @return {integer} The maximum number of Lights allowed to appear at once.\r\n */\r\n getMaxVisibleLights: function ()\r\n {\r\n return 10;\r\n },\r\n\r\n /**\r\n * Get the number of Lights managed by this Lights Manager.\r\n *\r\n * @method Phaser.GameObjects.LightsManager#getLightCount\r\n * @since 3.0.0\r\n *\r\n * @return {integer} The number of Lights managed by this Lights Manager.\r\n */\r\n getLightCount: function ()\r\n {\r\n return this.lights.length;\r\n },\r\n\r\n /**\r\n * Add a Light.\r\n *\r\n * @method Phaser.GameObjects.LightsManager#addLight\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The horizontal position of the Light.\r\n * @param {number} [y=0] - The vertical position of the Light.\r\n * @param {number} [radius=100] - The radius of the Light.\r\n * @param {number} [rgb=0xffffff] - The integer RGB color of the light.\r\n * @param {number} [intensity=1] - The intensity of the Light.\r\n *\r\n * @return {Phaser.GameObjects.Light} The Light that was added.\r\n */\r\n addLight: function (x, y, radius, rgb, intensity)\r\n {\r\n var color = null;\r\n var light = null;\r\n\r\n x = (x === undefined) ? 0.0 : x;\r\n y = (y === undefined) ? 0.0 : y;\r\n rgb = (rgb === undefined) ? 0xffffff : rgb;\r\n radius = (radius === undefined) ? 100.0 : radius;\r\n intensity = (intensity === undefined) ? 1.0 : intensity;\r\n\r\n color = Utils.getFloatsFromUintRGB(rgb);\r\n light = null;\r\n\r\n if (this.lightPool.length > 0)\r\n {\r\n light = this.lightPool.pop();\r\n light.set(x, y, radius, color[0], color[1], color[2], intensity);\r\n }\r\n else\r\n {\r\n light = new Light(x, y, radius, color[0], color[1], color[2], intensity);\r\n }\r\n\r\n this.lights.push(light);\r\n\r\n return light;\r\n },\r\n\r\n /**\r\n * Remove a Light.\r\n *\r\n * @method Phaser.GameObjects.LightsManager#removeLight\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Light} light - The Light to remove.\r\n *\r\n * @return {Phaser.GameObjects.LightsManager} This Lights Manager object.\r\n */\r\n removeLight: function (light)\r\n {\r\n var index = this.lights.indexOf(light);\r\n\r\n if (index >= 0)\r\n {\r\n this.lightPool.push(light);\r\n this.lights.splice(index, 1);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Shut down the Lights Manager.\r\n *\r\n * Recycles all active Lights into the Light pool, resets ambient light color and clears the lists of Lights and\r\n * culled Lights.\r\n *\r\n * @method Phaser.GameObjects.LightsManager#shutdown\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n while (this.lights.length > 0)\r\n {\r\n this.lightPool.push(this.lights.pop());\r\n }\r\n\r\n this.ambientColor = { r: 0.1, g: 0.1, b: 0.1 };\r\n this.culledLights.length = 0;\r\n this.lights.length = 0;\r\n },\r\n\r\n /**\r\n * Destroy the Lights Manager.\r\n *\r\n * Cleans up all references by calling {@link Phaser.GameObjects.LightsManager#shutdown}.\r\n *\r\n * @method Phaser.GameObjects.LightsManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n }\r\n\r\n});\r\n\r\nmodule.exports = LightsManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/lights/LightsManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/lights/LightsPlugin.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/lights/LightsPlugin.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar LightsManager = __webpack_require__(/*! ./LightsManager */ \"./node_modules/phaser/src/gameobjects/lights/LightsManager.js\");\r\nvar PluginCache = __webpack_require__(/*! ../../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar SceneEvents = __webpack_require__(/*! ../../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Scene plugin that provides a {@link Phaser.GameObjects.LightsManager} for the Light2D pipeline.\r\n *\r\n * Available from within a Scene via `this.lights`.\r\n *\r\n * Add Lights using the {@link Phaser.GameObjects.LightsManager#addLight} method:\r\n *\r\n * ```javascript\r\n * // Enable the Lights Manager because it is disabled by default\r\n * this.lights.enable();\r\n *\r\n * // Create a Light at [400, 300] with a radius of 200\r\n * this.lights.addLight(400, 300, 200);\r\n * ```\r\n *\r\n * For Game Objects to be affected by the Lights when rendered, you will need to set them to use the `Light2D` pipeline like so:\r\n *\r\n * ```javascript\r\n * sprite.setPipeline('Light2D');\r\n * ```\r\n *\r\n * @class LightsPlugin\r\n * @extends Phaser.GameObjects.LightsManager\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene that this Lights Plugin belongs to.\r\n */\r\nvar LightsPlugin = new Class({\r\n\r\n Extends: LightsManager,\r\n\r\n initialize:\r\n\r\n function LightsPlugin (scene)\r\n {\r\n /**\r\n * A reference to the Scene that this Lights Plugin belongs to.\r\n *\r\n * @name Phaser.GameObjects.LightsPlugin#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A reference to the Scene's systems.\r\n *\r\n * @name Phaser.GameObjects.LightsPlugin#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n if (!scene.sys.settings.isBooted)\r\n {\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n }\r\n\r\n LightsManager.call(this);\r\n },\r\n\r\n /**\r\n * Boot the Lights Plugin.\r\n *\r\n * @method Phaser.GameObjects.LightsPlugin#boot\r\n * @since 3.0.0\r\n */\r\n boot: function ()\r\n {\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.on(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n eventEmitter.on(SceneEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * Destroy the Lights Plugin.\r\n *\r\n * Cleans up all references.\r\n *\r\n * @method Phaser.GameObjects.LightsPlugin#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.scene = undefined;\r\n this.systems = undefined;\r\n }\r\n\r\n});\r\n\r\nPluginCache.register('LightsPlugin', LightsPlugin, 'lights');\r\n\r\nmodule.exports = LightsPlugin;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/lights/LightsPlugin.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/mesh/Mesh.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/mesh/Mesh.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar MeshRender = __webpack_require__(/*! ./MeshRender */ \"./node_modules/phaser/src/gameobjects/mesh/MeshRender.js\");\r\nvar NOOP = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Mesh Game Object.\r\n *\r\n * @class Mesh\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @webglOnly\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.Size\r\n * @extends Phaser.GameObjects.Components.Texture\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {number[]} vertices - An array containing the vertices data for this Mesh.\r\n * @param {number[]} uv - An array containing the uv data for this Mesh.\r\n * @param {number[]} colors - An array containing the color data for this Mesh.\r\n * @param {number[]} alphas - An array containing the alpha data for this Mesh.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n */\r\nvar Mesh = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.BlendMode,\r\n Components.Depth,\r\n Components.Mask,\r\n Components.Pipeline,\r\n Components.Size,\r\n Components.Texture,\r\n Components.Transform,\r\n Components.Visible,\r\n Components.ScrollFactor,\r\n MeshRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Mesh (scene, x, y, vertices, uv, colors, alphas, texture, frame)\r\n {\r\n GameObject.call(this, scene, 'Mesh');\r\n\r\n if (vertices.length !== uv.length)\r\n {\r\n throw new Error('Mesh Vertex count must match UV count');\r\n }\r\n\r\n var verticesUB = (vertices.length / 2) | 0;\r\n\r\n if (colors.length > 0 && colors.length < verticesUB)\r\n {\r\n throw new Error('Mesh Color count must match Vertex count');\r\n }\r\n\r\n if (alphas.length > 0 && alphas.length < verticesUB)\r\n {\r\n throw new Error('Mesh Alpha count must match Vertex count');\r\n }\r\n\r\n var i;\r\n\r\n if (colors.length === 0)\r\n {\r\n for (i = 0; i < verticesUB; ++i)\r\n {\r\n colors[i] = 0xFFFFFF;\r\n }\r\n }\r\n\r\n if (alphas.length === 0)\r\n {\r\n for (i = 0; i < verticesUB; ++i)\r\n {\r\n alphas[i] = 1.0;\r\n }\r\n }\r\n\r\n /**\r\n * An array containing the vertices data for this Mesh.\r\n *\r\n * @name Phaser.GameObjects.Mesh#vertices\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.vertices = new Float32Array(vertices);\r\n\r\n /**\r\n * An array containing the uv data for this Mesh.\r\n *\r\n * @name Phaser.GameObjects.Mesh#uv\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.uv = new Float32Array(uv);\r\n\r\n /**\r\n * An array containing the color data for this Mesh.\r\n *\r\n * @name Phaser.GameObjects.Mesh#colors\r\n * @type {Uint32Array}\r\n * @since 3.0.0\r\n */\r\n this.colors = new Uint32Array(colors);\r\n\r\n /**\r\n * An array containing the alpha data for this Mesh.\r\n *\r\n * @name Phaser.GameObjects.Mesh#alphas\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.alphas = new Float32Array(alphas);\r\n\r\n /**\r\n * Fill or additive mode used when blending the color values?\r\n * \r\n * @name Phaser.GameObjects.Mesh#tintFill\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.11.0\r\n */\r\n this.tintFill = false;\r\n\r\n this.setTexture(texture, frame);\r\n this.setPosition(x, y);\r\n this.setSizeToFrame();\r\n this.initPipeline();\r\n },\r\n\r\n /**\r\n * This method is left intentionally empty and does not do anything.\r\n * It is retained to allow a Mesh or Quad to be added to a Container.\r\n * \r\n * @method Phaser.GameObjects.Mesh#setAlpha\r\n * @since 3.17.0\r\n */\r\n setAlpha: NOOP\r\n\r\n});\r\n\r\nmodule.exports = Mesh;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/mesh/Mesh.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/mesh/MeshCanvasRenderer.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/mesh/MeshCanvasRenderer.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * This is a stub function for Mesh.Render. There is no Canvas renderer for Mesh objects.\r\n *\r\n * @method Phaser.GameObjects.Mesh#renderCanvas\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Mesh} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n */\r\nvar MeshCanvasRenderer = function ()\r\n{\r\n};\r\n\r\nmodule.exports = MeshCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/mesh/MeshCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/mesh/MeshCreator.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/mesh/MeshCreator.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BuildGameObject = __webpack_require__(/*! ../BuildGameObject */ \"./node_modules/phaser/src/gameobjects/BuildGameObject.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar Mesh = __webpack_require__(/*! ./Mesh */ \"./node_modules/phaser/src/gameobjects/mesh/Mesh.js\");\r\n\r\n/**\r\n * Creates a new Mesh Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#mesh\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {Phaser.GameObjects.Mesh} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('mesh', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n var key = GetAdvancedValue(config, 'key', null);\r\n var frame = GetAdvancedValue(config, 'frame', null);\r\n var vertices = GetValue(config, 'vertices', []);\r\n var colors = GetValue(config, 'colors', []);\r\n var alphas = GetValue(config, 'alphas', []);\r\n var uv = GetValue(config, 'uv', []);\r\n\r\n var mesh = new Mesh(this.scene, 0, 0, vertices, uv, colors, alphas, key, frame);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, mesh, config);\r\n\r\n return mesh;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectCreator context.\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/mesh/MeshCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/mesh/MeshFactory.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/mesh/MeshFactory.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Mesh = __webpack_require__(/*! ./Mesh */ \"./node_modules/phaser/src/gameobjects/mesh/Mesh.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Mesh Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#mesh\r\n * @webglOnly\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {number[]} vertices - An array containing the vertices data for this Mesh.\r\n * @param {number[]} uv - An array containing the uv data for this Mesh.\r\n * @param {number[]} colors - An array containing the color data for this Mesh.\r\n * @param {number[]} alphas - An array containing the alpha data for this Mesh.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n *\r\n * @return {Phaser.GameObjects.Mesh} The Game Object that was created.\r\n */\r\nif (true)\r\n{\r\n GameObjectFactory.register('mesh', function (x, y, vertices, uv, colors, alphas, texture, frame)\r\n {\r\n return this.displayList.add(new Mesh(this.scene, x, y, vertices, uv, colors, alphas, texture, frame));\r\n });\r\n}\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/mesh/MeshFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/mesh/MeshRender.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/mesh/MeshRender.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./MeshWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/mesh/MeshWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./MeshCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/mesh/MeshCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/mesh/MeshRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/mesh/MeshWebGLRenderer.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/mesh/MeshWebGLRenderer.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Utils = __webpack_require__(/*! ../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Mesh#renderWebGL\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Mesh} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar MeshWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var pipeline = this.pipeline;\r\n\r\n renderer.setPipeline(pipeline, src);\r\n\r\n var camMatrix = pipeline._tempMatrix1;\r\n var spriteMatrix = pipeline._tempMatrix2;\r\n var calcMatrix = pipeline._tempMatrix3;\r\n\r\n spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n spriteMatrix.e = src.x;\r\n spriteMatrix.f = src.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n spriteMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n spriteMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n\r\n var frame = src.frame;\r\n var texture = frame.glTexture;\r\n\r\n var vertices = src.vertices;\r\n var uvs = src.uv;\r\n var colors = src.colors;\r\n var alphas = src.alphas;\r\n\r\n var meshVerticesLength = vertices.length;\r\n var vertexCount = Math.floor(meshVerticesLength * 0.5);\r\n\r\n if (pipeline.vertexCount + vertexCount > pipeline.vertexCapacity)\r\n {\r\n pipeline.flush();\r\n }\r\n\r\n pipeline.setTexture2D(texture, 0);\r\n\r\n var vertexViewF32 = pipeline.vertexViewF32;\r\n var vertexViewU32 = pipeline.vertexViewU32;\r\n\r\n var vertexOffset = (pipeline.vertexCount * pipeline.vertexComponentCount) - 1;\r\n\r\n var colorIndex = 0;\r\n var tintEffect = src.tintFill;\r\n\r\n for (var i = 0; i < meshVerticesLength; i += 2)\r\n {\r\n var x = vertices[i + 0];\r\n var y = vertices[i + 1];\r\n\r\n var tx = x * calcMatrix.a + y * calcMatrix.c + calcMatrix.e;\r\n var ty = x * calcMatrix.b + y * calcMatrix.d + calcMatrix.f;\r\n\r\n if (camera.roundPixels)\r\n {\r\n tx = Math.round(tx);\r\n ty = Math.round(ty);\r\n }\r\n\r\n vertexViewF32[++vertexOffset] = tx;\r\n vertexViewF32[++vertexOffset] = ty;\r\n vertexViewF32[++vertexOffset] = uvs[i + 0];\r\n vertexViewF32[++vertexOffset] = uvs[i + 1];\r\n vertexViewF32[++vertexOffset] = tintEffect;\r\n vertexViewU32[++vertexOffset] = Utils.getTintAppendFloatAlpha(colors[colorIndex], camera.alpha * alphas[colorIndex]);\r\n\r\n colorIndex++;\r\n }\r\n\r\n pipeline.vertexCount += vertexCount;\r\n};\r\n\r\nmodule.exports = MeshWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/mesh/MeshWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/particles/EmitterOp.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/particles/EmitterOp.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar FloatBetween = __webpack_require__(/*! ../../math/FloatBetween */ \"./node_modules/phaser/src/math/FloatBetween.js\");\r\nvar GetEaseFunction = __webpack_require__(/*! ../../tweens/builders/GetEaseFunction */ \"./node_modules/phaser/src/tweens/builders/GetEaseFunction.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar Wrap = __webpack_require__(/*! ../../math/Wrap */ \"./node_modules/phaser/src/math/Wrap.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Particle Emitter property.\r\n *\r\n * Facilitates changing Particle properties as they are emitted and throughout their lifetime.\r\n *\r\n * @class EmitterOp\r\n * @memberof Phaser.GameObjects.Particles\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig} config - Settings for the Particle Emitter that owns this property.\r\n * @param {string} key - The name of the property.\r\n * @param {number} defaultValue - The default value of the property.\r\n * @param {boolean} [emitOnly=false] - Whether the property can only be modified when a Particle is emitted.\r\n */\r\nvar EmitterOp = new Class({\r\n\r\n initialize:\r\n\r\n function EmitterOp (config, key, defaultValue, emitOnly)\r\n {\r\n if (emitOnly === undefined)\r\n {\r\n emitOnly = false;\r\n }\r\n\r\n /**\r\n * The name of this property.\r\n *\r\n * @name Phaser.GameObjects.Particles.EmitterOp#propertyKey\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.propertyKey = key;\r\n\r\n /**\r\n * The value of this property.\r\n *\r\n * @name Phaser.GameObjects.Particles.EmitterOp#propertyValue\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.propertyValue = defaultValue;\r\n\r\n /**\r\n * The default value of this property.\r\n *\r\n * @name Phaser.GameObjects.Particles.EmitterOp#defaultValue\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.defaultValue = defaultValue;\r\n\r\n /**\r\n * The number of steps for stepped easing between {@link Phaser.GameObjects.Particles.EmitterOp#start} and\r\n * {@link Phaser.GameObjects.Particles.EmitterOp#end} values, per emit.\r\n *\r\n * @name Phaser.GameObjects.Particles.EmitterOp#steps\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.steps = 0;\r\n\r\n /**\r\n * The step counter for stepped easing, per emit.\r\n *\r\n * @name Phaser.GameObjects.Particles.EmitterOp#counter\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.counter = 0;\r\n\r\n /**\r\n * The start value for this property to ease between.\r\n *\r\n * @name Phaser.GameObjects.Particles.EmitterOp#start\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.start = 0;\r\n\r\n /**\r\n * The end value for this property to ease between.\r\n *\r\n * @name Phaser.GameObjects.Particles.EmitterOp#end\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.end = 0;\r\n\r\n /**\r\n * The easing function to use for updating this property.\r\n *\r\n * @name Phaser.GameObjects.Particles.EmitterOp#ease\r\n * @type {?function}\r\n * @since 3.0.0\r\n */\r\n this.ease;\r\n\r\n /**\r\n * Whether this property can only be modified when a Particle is emitted.\r\n *\r\n * Set to `true` to allow only {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} callbacks to be set and\r\n * affect this property.\r\n *\r\n * Set to `false` to allow both {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} and\r\n * {@link Phaser.GameObjects.Particles.EmitterOp#onUpdate} callbacks to be set and affect this property.\r\n *\r\n * @name Phaser.GameObjects.Particles.EmitterOp#emitOnly\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.emitOnly = emitOnly;\r\n\r\n /**\r\n * The callback to run for Particles when they are emitted from the Particle Emitter.\r\n *\r\n * @name Phaser.GameObjects.Particles.EmitterOp#onEmit\r\n * @type {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback}\r\n * @since 3.0.0\r\n */\r\n this.onEmit = this.defaultEmit;\r\n\r\n /**\r\n * The callback to run for Particles when they are updated.\r\n *\r\n * @name Phaser.GameObjects.Particles.EmitterOp#onUpdate\r\n * @type {Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateCallback}\r\n * @since 3.0.0\r\n */\r\n this.onUpdate = this.defaultUpdate;\r\n\r\n this.loadConfig(config);\r\n },\r\n\r\n /**\r\n * Load the property from a Particle Emitter configuration object.\r\n *\r\n * Optionally accepts a new property key to use, replacing the current one.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#loadConfig\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig} [config] - Settings for the Particle Emitter that owns this property.\r\n * @param {string} [newKey] - The new key to use for this property, if any.\r\n */\r\n loadConfig: function (config, newKey)\r\n {\r\n if (config === undefined)\r\n {\r\n config = {};\r\n }\r\n\r\n if (newKey)\r\n {\r\n this.propertyKey = newKey;\r\n }\r\n\r\n this.propertyValue = GetFastValue(\r\n config,\r\n this.propertyKey,\r\n this.defaultValue\r\n );\r\n\r\n this.setMethods();\r\n\r\n if (this.emitOnly)\r\n {\r\n // Reset it back again\r\n this.onUpdate = this.defaultUpdate;\r\n }\r\n },\r\n\r\n /**\r\n * Build a JSON representation of this Particle Emitter property.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {object} A JSON representation of this Particle Emitter property.\r\n */\r\n toJSON: function ()\r\n {\r\n return this.propertyValue;\r\n },\r\n\r\n /**\r\n * Change the current value of the property and update its callback methods.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#onChange\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value of the property.\r\n *\r\n * @return {Phaser.GameObjects.Particles.EmitterOp} This Emitter Op object.\r\n */\r\n onChange: function (value)\r\n {\r\n this.propertyValue = value;\r\n\r\n return this.setMethods();\r\n },\r\n\r\n /**\r\n * Update the {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} and\r\n * {@link Phaser.GameObjects.Particles.EmitterOp#onUpdate} callbacks based on the type of the current\r\n * {@link Phaser.GameObjects.Particles.EmitterOp#propertyValue}.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#setMethods\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Particles.EmitterOp} This Emitter Op object.\r\n */\r\n setMethods: function ()\r\n {\r\n var value = this.propertyValue;\r\n\r\n var t = typeof value;\r\n\r\n if (t === 'number')\r\n {\r\n // Explicit static value:\r\n // x: 400\r\n\r\n this.onEmit = this.staticValueEmit;\r\n this.onUpdate = this.staticValueUpdate; // How?\r\n }\r\n else if (Array.isArray(value))\r\n {\r\n // Picks a random element from the array:\r\n // x: [ 100, 200, 300, 400 ]\r\n\r\n this.onEmit = this.randomStaticValueEmit;\r\n }\r\n else if (t === 'function')\r\n {\r\n // The same as setting just the onUpdate function and no onEmit (unless this op is an emitOnly one)\r\n // Custom callback, must return a value:\r\n\r\n /*\r\n x: function (particle, key, t, value)\r\n {\r\n return value + 50;\r\n }\r\n */\r\n\r\n if (this.emitOnly)\r\n {\r\n this.onEmit = value;\r\n }\r\n else\r\n {\r\n this.onUpdate = value;\r\n }\r\n }\r\n else if (t === 'object' && (this.has(value, 'random') || this.hasBoth(value, 'start', 'end') || this.hasBoth(value, 'min', 'max')))\r\n {\r\n this.start = this.has(value, 'start') ? value.start : value.min;\r\n this.end = this.has(value, 'end') ? value.end : value.max;\r\n\r\n var isRandom = (this.hasBoth(value, 'min', 'max') || !!value.random);\r\n\r\n // A random starting value (using 'min | max' instead of 'start | end' automatically implies a random value)\r\n\r\n // x: { start: 100, end: 400, random: true } OR { min: 100, max: 400 } OR { random: [ 100, 400 ] }\r\n\r\n if (isRandom)\r\n {\r\n var rnd = value.random;\r\n\r\n // x: { random: [ 100, 400 ] } = the same as doing: x: { start: 100, end: 400, random: true }\r\n if (Array.isArray(rnd))\r\n {\r\n this.start = rnd[0];\r\n this.end = rnd[1];\r\n }\r\n\r\n this.onEmit = this.randomRangedValueEmit;\r\n }\r\n\r\n if (this.has(value, 'steps'))\r\n {\r\n // A stepped (per emit) range\r\n\r\n // x: { start: 100, end: 400, steps: 64 }\r\n\r\n // Increments a value stored in the emitter\r\n\r\n this.steps = value.steps;\r\n this.counter = this.start;\r\n\r\n this.onEmit = this.steppedEmit;\r\n }\r\n else\r\n {\r\n // An eased range (defaults to Linear if not specified)\r\n\r\n // x: { start: 100, end: 400, [ ease: 'Linear' ] }\r\n\r\n var easeType = this.has(value, 'ease') ? value.ease : 'Linear';\r\n\r\n this.ease = GetEaseFunction(easeType);\r\n\r\n if (!isRandom)\r\n {\r\n this.onEmit = this.easedValueEmit;\r\n }\r\n\r\n // BUG: alpha, rotate, scaleX, scaleY, or tint are eased here if {min, max} is given.\r\n // Probably this branch should exclude isRandom entirely.\r\n\r\n this.onUpdate = this.easeValueUpdate;\r\n }\r\n }\r\n else if (t === 'object' && this.hasEither(value, 'onEmit', 'onUpdate'))\r\n {\r\n // Custom onEmit and onUpdate callbacks\r\n\r\n /*\r\n x: {\r\n // Called at the start of the particles life, when it is being created\r\n onEmit: function (particle, key, t, value)\r\n {\r\n return value;\r\n },\r\n\r\n // Called during the particles life on each update\r\n onUpdate: function (particle, key, t, value)\r\n {\r\n return value;\r\n }\r\n }\r\n */\r\n\r\n if (this.has(value, 'onEmit'))\r\n {\r\n this.onEmit = value.onEmit;\r\n }\r\n\r\n if (this.has(value, 'onUpdate'))\r\n {\r\n this.onUpdate = value.onUpdate;\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether an object has the given property.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#has\r\n * @since 3.0.0\r\n *\r\n * @param {object} object - The object to check.\r\n * @param {string} key - The key of the property to look for in the object.\r\n *\r\n * @return {boolean} `true` if the property exists in the object, `false` otherwise.\r\n */\r\n has: function (object, key)\r\n {\r\n return object.hasOwnProperty(key);\r\n },\r\n\r\n /**\r\n * Check whether an object has both of the given properties.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#hasBoth\r\n * @since 3.0.0\r\n *\r\n * @param {object} object - The object to check.\r\n * @param {string} key1 - The key of the first property to check the object for.\r\n * @param {string} key2 - The key of the second property to check the object for.\r\n *\r\n * @return {boolean} `true` if both properties exist in the object, `false` otherwise.\r\n */\r\n hasBoth: function (object, key1, key2)\r\n {\r\n return object.hasOwnProperty(key1) && object.hasOwnProperty(key2);\r\n },\r\n\r\n /**\r\n * Check whether an object has at least one of the given properties.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#hasEither\r\n * @since 3.0.0\r\n *\r\n * @param {object} object - The object to check.\r\n * @param {string} key1 - The key of the first property to check the object for.\r\n * @param {string} key2 - The key of the second property to check the object for.\r\n *\r\n * @return {boolean} `true` if at least one of the properties exists in the object, `false` if neither exist.\r\n */\r\n hasEither: function (object, key1, key2)\r\n {\r\n return object.hasOwnProperty(key1) || object.hasOwnProperty(key2);\r\n },\r\n\r\n /**\r\n * The returned value sets what the property will be at the START of the particles life, on emit.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#defaultEmit\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Particles.Particle} particle - The particle.\r\n * @param {string} key - The name of the property.\r\n * @param {number} [value] - The current value of the property.\r\n *\r\n * @return {number} The new value of the property.\r\n */\r\n defaultEmit: function (particle, key, value)\r\n {\r\n return value;\r\n },\r\n\r\n /**\r\n * The returned value updates the property for the duration of the particles life.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#defaultUpdate\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Particles.Particle} particle - The particle.\r\n * @param {string} key - The name of the property.\r\n * @param {number} t - The T value (between 0 and 1)\r\n * @param {number} value - The current value of the property.\r\n *\r\n * @return {number} The new value of the property.\r\n */\r\n defaultUpdate: function (particle, key, t, value)\r\n {\r\n return value;\r\n },\r\n\r\n /**\r\n * An `onEmit` callback that returns the current value of the property.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#staticValueEmit\r\n * @since 3.0.0\r\n *\r\n * @return {number} The current value of the property.\r\n */\r\n staticValueEmit: function ()\r\n {\r\n return this.propertyValue;\r\n },\r\n\r\n /**\r\n * An `onUpdate` callback that returns the current value of the property.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#staticValueUpdate\r\n * @since 3.0.0\r\n *\r\n * @return {number} The current value of the property.\r\n */\r\n staticValueUpdate: function ()\r\n {\r\n return this.propertyValue;\r\n },\r\n\r\n /**\r\n * An `onEmit` callback that returns a random value from the current value array.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#randomStaticValueEmit\r\n * @since 3.0.0\r\n *\r\n * @return {number} The new value of the property.\r\n */\r\n randomStaticValueEmit: function ()\r\n {\r\n var randomIndex = Math.floor(Math.random() * this.propertyValue.length);\r\n\r\n return this.propertyValue[randomIndex];\r\n },\r\n\r\n /**\r\n * An `onEmit` callback that returns a value between the {@link Phaser.GameObjects.Particles.EmitterOp#start} and\r\n * {@link Phaser.GameObjects.Particles.EmitterOp#end} range.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#randomRangedValueEmit\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Particles.Particle} particle - The particle.\r\n * @param {string} key - The key of the property.\r\n *\r\n * @return {number} The new value of the property.\r\n */\r\n randomRangedValueEmit: function (particle, key)\r\n {\r\n var value = FloatBetween(this.start, this.end);\r\n\r\n if (particle && particle.data[key])\r\n {\r\n particle.data[key].min = value;\r\n }\r\n\r\n return value;\r\n },\r\n\r\n /**\r\n * An `onEmit` callback that returns a stepped value between the\r\n * {@link Phaser.GameObjects.Particles.EmitterOp#start} and {@link Phaser.GameObjects.Particles.EmitterOp#end}\r\n * range.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#steppedEmit\r\n * @since 3.0.0\r\n *\r\n * @return {number} The new value of the property.\r\n */\r\n steppedEmit: function ()\r\n {\r\n var current = this.counter;\r\n\r\n var next = this.counter + (this.end - this.start) / this.steps;\r\n\r\n this.counter = Wrap(next, this.start, this.end);\r\n\r\n return current;\r\n },\r\n\r\n /**\r\n * An `onEmit` callback for an eased property.\r\n *\r\n * It prepares the particle for easing by {@link Phaser.GameObjects.Particles.EmitterOp#easeValueUpdate}.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#easedValueEmit\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Particles.Particle} particle - The particle.\r\n * @param {string} key - The name of the property.\r\n *\r\n * @return {number} {@link Phaser.GameObjects.Particles.EmitterOp#start}, as the new value of the property.\r\n */\r\n easedValueEmit: function (particle, key)\r\n {\r\n if (particle && particle.data[key])\r\n {\r\n var data = particle.data[key];\r\n\r\n data.min = this.start;\r\n data.max = this.end;\r\n }\r\n\r\n return this.start;\r\n },\r\n\r\n /**\r\n * An `onUpdate` callback that returns an eased value between the\r\n * {@link Phaser.GameObjects.Particles.EmitterOp#start} and {@link Phaser.GameObjects.Particles.EmitterOp#end}\r\n * range.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterOp#easeValueUpdate\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Particles.Particle} particle - The particle.\r\n * @param {string} key - The name of the property.\r\n * @param {number} t - The T value (between 0 and 1)\r\n *\r\n * @return {number} The new value of the property.\r\n */\r\n easeValueUpdate: function (particle, key, t)\r\n {\r\n var data = particle.data[key];\r\n\r\n return (data.max - data.min) * this.ease(t) + data.min;\r\n }\r\n});\r\n\r\nmodule.exports = EmitterOp;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/particles/EmitterOp.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/particles/GravityWell.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/particles/GravityWell.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The GravityWell action applies a force on the particle to draw it towards, or repel it from, a single point.\r\n * \r\n * The force applied is inversely proportional to the square of the distance from the particle to the point, in accordance with Newton's law of gravity.\r\n * \r\n * This simulates the effect of gravity over large distances (as between planets, for example).\r\n *\r\n * @class GravityWell\r\n * @memberof Phaser.GameObjects.Particles\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {(number|Phaser.Types.GameObjects.Particles.GravityWellConfig)} [x=0] - The x coordinate of the Gravity Well, in world space.\r\n * @param {number} [y=0] - The y coordinate of the Gravity Well, in world space.\r\n * @param {number} [power=0] - The strength of the gravity force - larger numbers produce a stronger force.\r\n * @param {number} [epsilon=100] - The minimum distance for which the gravity force is calculated.\r\n * @param {number} [gravity=50] - The gravitational force of this Gravity Well.\r\n */\r\nvar GravityWell = new Class({\r\n\r\n initialize:\r\n\r\n function GravityWell (x, y, power, epsilon, gravity)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n var config = x;\r\n\r\n x = GetFastValue(config, 'x', 0);\r\n y = GetFastValue(config, 'y', 0);\r\n power = GetFastValue(config, 'power', 0);\r\n epsilon = GetFastValue(config, 'epsilon', 100);\r\n gravity = GetFastValue(config, 'gravity', 50);\r\n }\r\n else\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (power === undefined) { power = 0; }\r\n if (epsilon === undefined) { epsilon = 100; }\r\n if (gravity === undefined) { gravity = 50; }\r\n }\r\n\r\n /**\r\n * The x coordinate of the Gravity Well, in world space.\r\n *\r\n * @name Phaser.GameObjects.Particles.GravityWell#x\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.x = x;\r\n\r\n /**\r\n * The y coordinate of the Gravity Well, in world space.\r\n *\r\n * @name Phaser.GameObjects.Particles.GravityWell#y\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.y = y;\r\n\r\n /**\r\n * The active state of the Gravity Well. An inactive Gravity Well will not influence any particles.\r\n *\r\n * @name Phaser.GameObjects.Particles.GravityWell#active\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.active = true;\r\n\r\n /**\r\n * Internal gravity value.\r\n *\r\n * @name Phaser.GameObjects.Particles.GravityWell#_gravity\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._gravity = gravity;\r\n\r\n /**\r\n * Internal power value.\r\n *\r\n * @name Phaser.GameObjects.Particles.GravityWell#_power\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._power = 0;\r\n\r\n /**\r\n * Internal epsilon value.\r\n *\r\n * @name Phaser.GameObjects.Particles.GravityWell#_epsilon\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._epsilon = 0;\r\n\r\n /**\r\n * The strength of the gravity force - larger numbers produce a stronger force.\r\n *\r\n * @name Phaser.GameObjects.Particles.GravityWell#power\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.power = power;\r\n\r\n /**\r\n * The minimum distance for which the gravity force is calculated.\r\n *\r\n * @name Phaser.GameObjects.Particles.GravityWell#epsilon\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.epsilon = epsilon;\r\n },\r\n\r\n /**\r\n * Takes a Particle and updates it based on the properties of this Gravity Well.\r\n *\r\n * @method Phaser.GameObjects.Particles.GravityWell#update\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Particles.Particle} particle - The Particle to update.\r\n * @param {number} delta - The delta time in ms.\r\n * @param {number} step - The delta value divided by 1000.\r\n */\r\n update: function (particle, delta)\r\n {\r\n var x = this.x - particle.x;\r\n var y = this.y - particle.y;\r\n var dSq = x * x + y * y;\r\n\r\n if (dSq === 0)\r\n {\r\n return;\r\n }\r\n\r\n var d = Math.sqrt(dSq);\r\n\r\n if (dSq < this._epsilon)\r\n {\r\n dSq = this._epsilon;\r\n }\r\n\r\n var factor = ((this._power * delta) / (dSq * d)) * 100;\r\n\r\n particle.velocityX += x * factor;\r\n particle.velocityY += y * factor;\r\n },\r\n\r\n epsilon: {\r\n\r\n get: function ()\r\n {\r\n return Math.sqrt(this._epsilon);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._epsilon = value * value;\r\n }\r\n\r\n },\r\n\r\n power: {\r\n\r\n get: function ()\r\n {\r\n return this._power / this._gravity;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._power = value * this._gravity;\r\n }\r\n\r\n },\r\n\r\n gravity: {\r\n\r\n get: function ()\r\n {\r\n return this._gravity;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var pwr = this.power;\r\n this._gravity = value;\r\n this.power = pwr;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = GravityWell;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/particles/GravityWell.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/particles/Particle.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/particles/Particle.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar DegToRad = __webpack_require__(/*! ../../math/DegToRad */ \"./node_modules/phaser/src/math/DegToRad.js\");\r\nvar DistanceBetween = __webpack_require__(/*! ../../math/distance/DistanceBetween */ \"./node_modules/phaser/src/math/distance/DistanceBetween.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Particle is a simple Game Object controlled by a Particle Emitter and Manager, and rendered by the Manager.\r\n * It uses its own lightweight physics system, and can interact only with its Emitter's bounds and zones.\r\n *\r\n * @class Particle\r\n * @memberof Phaser.GameObjects.Particles\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - The Emitter to which this Particle belongs.\r\n */\r\nvar Particle = new Class({\r\n\r\n initialize:\r\n\r\n function Particle (emitter)\r\n {\r\n /**\r\n * The Emitter to which this Particle belongs.\r\n *\r\n * A Particle can only belong to a single Emitter and is created, updated and destroyed via it.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#emitter\r\n * @type {Phaser.GameObjects.Particles.ParticleEmitter}\r\n * @since 3.0.0\r\n */\r\n this.emitter = emitter;\r\n\r\n /**\r\n * The texture frame used to render this Particle.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#frame\r\n * @type {Phaser.Textures.Frame}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.frame = null;\r\n\r\n /**\r\n * The x coordinate of this Particle.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y coordinate of this Particle.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n /**\r\n * The x velocity of this Particle.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#velocityX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.velocityX = 0;\r\n\r\n /**\r\n * The y velocity of this Particle.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#velocityY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.velocityY = 0;\r\n\r\n /**\r\n * The x acceleration of this Particle.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#accelerationX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.accelerationX = 0;\r\n\r\n /**\r\n * The y acceleration of this Particle.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#accelerationY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.accelerationY = 0;\r\n\r\n /**\r\n * The maximum horizontal velocity this Particle can travel at.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#maxVelocityX\r\n * @type {number}\r\n * @default 10000\r\n * @since 3.0.0\r\n */\r\n this.maxVelocityX = 10000;\r\n\r\n /**\r\n * The maximum vertical velocity this Particle can travel at.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#maxVelocityY\r\n * @type {number}\r\n * @default 10000\r\n * @since 3.0.0\r\n */\r\n this.maxVelocityY = 10000;\r\n\r\n /**\r\n * The bounciness, or restitution, of this Particle.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#bounce\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.bounce = 0;\r\n\r\n /**\r\n * The horizontal scale of this Particle.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#scaleX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.scaleX = 1;\r\n\r\n /**\r\n * The vertical scale of this Particle.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#scaleY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.scaleY = 1;\r\n\r\n /**\r\n * The alpha value of this Particle.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#alpha\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.alpha = 1;\r\n\r\n /**\r\n * The angle of this Particle in degrees.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#angle\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.angle = 0;\r\n\r\n /**\r\n * The angle of this Particle in radians.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#rotation\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.rotation = 0;\r\n\r\n /**\r\n * The tint applied to this Particle.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#tint\r\n * @type {integer}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n this.tint = 0xffffff;\r\n\r\n /**\r\n * The lifespan of this Particle in ms.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#life\r\n * @type {number}\r\n * @default 1000\r\n * @since 3.0.0\r\n */\r\n this.life = 1000;\r\n\r\n /**\r\n * The current life of this Particle in ms.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#lifeCurrent\r\n * @type {number}\r\n * @default 1000\r\n * @since 3.0.0\r\n */\r\n this.lifeCurrent = 1000;\r\n\r\n /**\r\n * The delay applied to this Particle upon emission, in ms.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#delayCurrent\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.delayCurrent = 0;\r\n\r\n /**\r\n * The normalized lifespan T value, where 0 is the start and 1 is the end.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#lifeT\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.lifeT = 0;\r\n\r\n /**\r\n * The data used by the ease equation.\r\n *\r\n * @name Phaser.GameObjects.Particles.Particle#data\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.data = {\r\n tint: { min: 0xffffff, max: 0xffffff, current: 0xffffff },\r\n alpha: { min: 1, max: 1 },\r\n rotate: { min: 0, max: 0 },\r\n scaleX: { min: 1, max: 1 },\r\n scaleY: { min: 1, max: 1 }\r\n };\r\n },\r\n\r\n /**\r\n * Checks to see if this Particle is alive and updating.\r\n *\r\n * @method Phaser.GameObjects.Particles.Particle#isAlive\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if this Particle is alive and updating, otherwise `false`.\r\n */\r\n isAlive: function ()\r\n {\r\n return (this.lifeCurrent > 0);\r\n },\r\n\r\n /**\r\n * Resets the position of this particle back to zero.\r\n *\r\n * @method Phaser.GameObjects.Particles.Particle#resetPosition\r\n * @since 3.16.0\r\n */\r\n resetPosition: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n },\r\n\r\n /**\r\n * Starts this Particle from the given coordinates.\r\n *\r\n * @method Phaser.GameObjects.Particles.Particle#fire\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate to launch this Particle from.\r\n * @param {number} y - The y coordinate to launch this Particle from.\r\n */\r\n fire: function (x, y)\r\n {\r\n var emitter = this.emitter;\r\n\r\n this.frame = emitter.getFrame();\r\n\r\n if (emitter.emitZone)\r\n {\r\n // Updates particle.x and particle.y during this call\r\n emitter.emitZone.getPoint(this);\r\n }\r\n\r\n if (x === undefined)\r\n {\r\n if (emitter.follow)\r\n {\r\n this.x += emitter.follow.x + emitter.followOffset.x;\r\n }\r\n\r\n this.x += emitter.x.onEmit(this, 'x');\r\n }\r\n else\r\n {\r\n this.x += x;\r\n }\r\n\r\n if (y === undefined)\r\n {\r\n if (emitter.follow)\r\n {\r\n this.y += emitter.follow.y + emitter.followOffset.y;\r\n }\r\n\r\n this.y += emitter.y.onEmit(this, 'y');\r\n }\r\n else\r\n {\r\n this.y += y;\r\n }\r\n\r\n this.life = emitter.lifespan.onEmit(this, 'lifespan');\r\n this.lifeCurrent = this.life;\r\n this.lifeT = 0;\r\n\r\n var sx = emitter.speedX.onEmit(this, 'speedX');\r\n var sy = (emitter.speedY) ? emitter.speedY.onEmit(this, 'speedY') : sx;\r\n\r\n if (emitter.radial)\r\n {\r\n var rad = DegToRad(emitter.angle.onEmit(this, 'angle'));\r\n\r\n this.velocityX = Math.cos(rad) * Math.abs(sx);\r\n this.velocityY = Math.sin(rad) * Math.abs(sy);\r\n }\r\n else if (emitter.moveTo)\r\n {\r\n var mx = emitter.moveToX.onEmit(this, 'moveToX');\r\n var my = (emitter.moveToY) ? emitter.moveToY.onEmit(this, 'moveToY') : mx;\r\n\r\n var angle = Math.atan2(my - this.y, mx - this.x);\r\n\r\n var speed = DistanceBetween(this.x, this.y, mx, my) / (this.life / 1000);\r\n\r\n // We know how many pixels we need to move, but how fast?\r\n // var speed = this.distanceToXY(displayObject, x, y) / (maxTime / 1000);\r\n\r\n this.velocityX = Math.cos(angle) * speed;\r\n this.velocityY = Math.sin(angle) * speed;\r\n }\r\n else\r\n {\r\n this.velocityX = sx;\r\n this.velocityY = sy;\r\n }\r\n\r\n if (emitter.acceleration)\r\n {\r\n this.accelerationX = emitter.accelerationX.onEmit(this, 'accelerationX');\r\n this.accelerationY = emitter.accelerationY.onEmit(this, 'accelerationY');\r\n }\r\n\r\n this.maxVelocityX = emitter.maxVelocityX.onEmit(this, 'maxVelocityX');\r\n this.maxVelocityY = emitter.maxVelocityY.onEmit(this, 'maxVelocityY');\r\n\r\n this.delayCurrent = emitter.delay.onEmit(this, 'delay');\r\n\r\n this.scaleX = emitter.scaleX.onEmit(this, 'scaleX');\r\n this.scaleY = (emitter.scaleY) ? emitter.scaleY.onEmit(this, 'scaleY') : this.scaleX;\r\n\r\n this.angle = emitter.rotate.onEmit(this, 'rotate');\r\n this.rotation = DegToRad(this.angle);\r\n\r\n this.bounce = emitter.bounce.onEmit(this, 'bounce');\r\n\r\n this.alpha = emitter.alpha.onEmit(this, 'alpha');\r\n\r\n this.tint = emitter.tint.onEmit(this, 'tint');\r\n },\r\n\r\n /**\r\n * An internal method that calculates the velocity of the Particle.\r\n *\r\n * @method Phaser.GameObjects.Particles.Particle#computeVelocity\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - The Emitter that is updating this Particle.\r\n * @param {number} delta - The delta time in ms.\r\n * @param {number} step - The delta value divided by 1000.\r\n * @param {array} processors - Particle processors (gravity wells).\r\n */\r\n computeVelocity: function (emitter, delta, step, processors)\r\n {\r\n var vx = this.velocityX;\r\n var vy = this.velocityY;\r\n\r\n var ax = this.accelerationX;\r\n var ay = this.accelerationY;\r\n\r\n var mx = this.maxVelocityX;\r\n var my = this.maxVelocityY;\r\n\r\n vx += (emitter.gravityX * step);\r\n vy += (emitter.gravityY * step);\r\n\r\n if (ax)\r\n {\r\n vx += (ax * step);\r\n }\r\n\r\n if (ay)\r\n {\r\n vy += (ay * step);\r\n }\r\n\r\n if (vx > mx)\r\n {\r\n vx = mx;\r\n }\r\n else if (vx < -mx)\r\n {\r\n vx = -mx;\r\n }\r\n\r\n if (vy > my)\r\n {\r\n vy = my;\r\n }\r\n else if (vy < -my)\r\n {\r\n vy = -my;\r\n }\r\n\r\n this.velocityX = vx;\r\n this.velocityY = vy;\r\n\r\n // Apply any additional processors\r\n for (var i = 0; i < processors.length; i++)\r\n {\r\n processors[i].update(this, delta, step);\r\n }\r\n },\r\n\r\n /**\r\n * Checks if this Particle is still within the bounds defined by the given Emitter.\r\n *\r\n * If not, and depending on the Emitter collision flags, the Particle may either stop or rebound.\r\n *\r\n * @method Phaser.GameObjects.Particles.Particle#checkBounds\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - The Emitter to check the bounds against.\r\n */\r\n checkBounds: function (emitter)\r\n {\r\n var bounds = emitter.bounds;\r\n var bounce = -this.bounce;\r\n\r\n if (this.x < bounds.x && emitter.collideLeft)\r\n {\r\n this.x = bounds.x;\r\n this.velocityX *= bounce;\r\n }\r\n else if (this.x > bounds.right && emitter.collideRight)\r\n {\r\n this.x = bounds.right;\r\n this.velocityX *= bounce;\r\n }\r\n\r\n if (this.y < bounds.y && emitter.collideTop)\r\n {\r\n this.y = bounds.y;\r\n this.velocityY *= bounce;\r\n }\r\n else if (this.y > bounds.bottom && emitter.collideBottom)\r\n {\r\n this.y = bounds.bottom;\r\n this.velocityY *= bounce;\r\n }\r\n },\r\n\r\n /**\r\n * The main update method for this Particle.\r\n *\r\n * Updates its life values, computes the velocity and repositions the Particle.\r\n *\r\n * @method Phaser.GameObjects.Particles.Particle#update\r\n * @since 3.0.0\r\n *\r\n * @param {number} delta - The delta time in ms.\r\n * @param {number} step - The delta value divided by 1000.\r\n * @param {array} processors - An optional array of update processors.\r\n *\r\n * @return {boolean} Returns `true` if this Particle has now expired and should be removed, otherwise `false` if still active.\r\n */\r\n update: function (delta, step, processors)\r\n {\r\n if (this.delayCurrent > 0)\r\n {\r\n this.delayCurrent -= delta;\r\n\r\n return false;\r\n }\r\n\r\n var emitter = this.emitter;\r\n\r\n // How far along in life is this particle? (t = 0 to 1)\r\n var t = 1 - (this.lifeCurrent / this.life);\r\n\r\n this.lifeT = t;\r\n\r\n this.computeVelocity(emitter, delta, step, processors);\r\n\r\n this.x += this.velocityX * step;\r\n this.y += this.velocityY * step;\r\n\r\n if (emitter.bounds)\r\n {\r\n this.checkBounds(emitter);\r\n }\r\n\r\n if (emitter.deathZone && emitter.deathZone.willKill(this))\r\n {\r\n this.lifeCurrent = 0;\r\n\r\n // No need to go any further, particle has been killed\r\n return true;\r\n }\r\n\r\n this.scaleX = emitter.scaleX.onUpdate(this, 'scaleX', t, this.scaleX);\r\n\r\n if (emitter.scaleY)\r\n {\r\n this.scaleY = emitter.scaleY.onUpdate(this, 'scaleY', t, this.scaleY);\r\n }\r\n else\r\n {\r\n this.scaleY = this.scaleX;\r\n }\r\n\r\n this.angle = emitter.rotate.onUpdate(this, 'rotate', t, this.angle);\r\n this.rotation = DegToRad(this.angle);\r\n\r\n this.alpha = emitter.alpha.onUpdate(this, 'alpha', t, this.alpha);\r\n\r\n this.tint = emitter.tint.onUpdate(this, 'tint', t, this.tint);\r\n\r\n this.lifeCurrent -= delta;\r\n\r\n return (this.lifeCurrent <= 0);\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Particle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/particles/Particle.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/particles/ParticleEmitter.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/particles/ParticleEmitter.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BlendModes = __webpack_require__(/*! ../../renderer/BlendModes */ \"./node_modules/phaser/src/renderer/BlendModes.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar DeathZone = __webpack_require__(/*! ./zones/DeathZone */ \"./node_modules/phaser/src/gameobjects/particles/zones/DeathZone.js\");\r\nvar EdgeZone = __webpack_require__(/*! ./zones/EdgeZone */ \"./node_modules/phaser/src/gameobjects/particles/zones/EdgeZone.js\");\r\nvar EmitterOp = __webpack_require__(/*! ./EmitterOp */ \"./node_modules/phaser/src/gameobjects/particles/EmitterOp.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar GetRandom = __webpack_require__(/*! ../../utils/array/GetRandom */ \"./node_modules/phaser/src/utils/array/GetRandom.js\");\r\nvar HasAny = __webpack_require__(/*! ../../utils/object/HasAny */ \"./node_modules/phaser/src/utils/object/HasAny.js\");\r\nvar HasValue = __webpack_require__(/*! ../../utils/object/HasValue */ \"./node_modules/phaser/src/utils/object/HasValue.js\");\r\nvar Particle = __webpack_require__(/*! ./Particle */ \"./node_modules/phaser/src/gameobjects/particles/Particle.js\");\r\nvar RandomZone = __webpack_require__(/*! ./zones/RandomZone */ \"./node_modules/phaser/src/gameobjects/particles/zones/RandomZone.js\");\r\nvar Rectangle = __webpack_require__(/*! ../../geom/rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar StableSort = __webpack_require__(/*! ../../utils/array/StableSort */ \"./node_modules/phaser/src/utils/array/StableSort.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\nvar Wrap = __webpack_require__(/*! ../../math/Wrap */ \"./node_modules/phaser/src/math/Wrap.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A particle emitter represents a single particle stream.\r\n * It controls a pool of {@link Phaser.GameObjects.Particles.Particle Particles} and is controlled by a {@link Phaser.GameObjects.Particles.ParticleEmitterManager Particle Emitter Manager}.\r\n *\r\n * @class ParticleEmitter\r\n * @memberof Phaser.GameObjects.Particles\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.GameObjects.Particles.ParticleEmitterManager} manager - The Emitter Manager this Emitter belongs to.\r\n * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig} config - Settings for this emitter.\r\n */\r\nvar ParticleEmitter = new Class({\r\n\r\n Mixins: [\r\n Components.BlendMode,\r\n Components.Mask,\r\n Components.ScrollFactor,\r\n Components.Visible\r\n ],\r\n\r\n initialize:\r\n\r\n function ParticleEmitter (manager, config)\r\n {\r\n /**\r\n * The Emitter Manager this Emitter belongs to.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#manager\r\n * @type {Phaser.GameObjects.Particles.ParticleEmitterManager}\r\n * @since 3.0.0\r\n */\r\n this.manager = manager;\r\n\r\n /**\r\n * The texture assigned to particles.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#texture\r\n * @type {Phaser.Textures.Texture}\r\n * @since 3.0.0\r\n */\r\n this.texture = manager.texture;\r\n\r\n /**\r\n * The texture frames assigned to particles.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#frames\r\n * @type {Phaser.Textures.Frame[]}\r\n * @since 3.0.0\r\n */\r\n this.frames = [ manager.defaultFrame ];\r\n\r\n /**\r\n * The default texture frame assigned to particles.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#defaultFrame\r\n * @type {Phaser.Textures.Frame}\r\n * @since 3.0.0\r\n */\r\n this.defaultFrame = manager.defaultFrame;\r\n\r\n /**\r\n * Names of simple configuration properties.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#configFastMap\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.configFastMap = [\r\n 'active',\r\n 'blendMode',\r\n 'collideBottom',\r\n 'collideLeft',\r\n 'collideRight',\r\n 'collideTop',\r\n 'deathCallback',\r\n 'deathCallbackScope',\r\n 'emitCallback',\r\n 'emitCallbackScope',\r\n 'follow',\r\n 'frequency',\r\n 'gravityX',\r\n 'gravityY',\r\n 'maxParticles',\r\n 'name',\r\n 'on',\r\n 'particleBringToTop',\r\n 'particleClass',\r\n 'radial',\r\n 'timeScale',\r\n 'trackVisible',\r\n 'visible'\r\n ];\r\n\r\n /**\r\n * Names of complex configuration properties.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#configOpMap\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.configOpMap = [\r\n 'accelerationX',\r\n 'accelerationY',\r\n 'angle',\r\n 'alpha',\r\n 'bounce',\r\n 'delay',\r\n 'lifespan',\r\n 'maxVelocityX',\r\n 'maxVelocityY',\r\n 'moveToX',\r\n 'moveToY',\r\n 'quantity',\r\n 'rotate',\r\n 'scaleX',\r\n 'scaleY',\r\n 'speedX',\r\n 'speedY',\r\n 'tint',\r\n 'x',\r\n 'y'\r\n ];\r\n\r\n /**\r\n * The name of this Particle Emitter.\r\n *\r\n * Empty by default and never populated by Phaser, this is left for developers to use.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#name\r\n * @type {string}\r\n * @default ''\r\n * @since 3.0.0\r\n */\r\n this.name = '';\r\n\r\n /**\r\n * The Particle Class which will be emitted by this Emitter.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#particleClass\r\n * @type {Phaser.GameObjects.Particles.Particle}\r\n * @default Phaser.GameObjects.Particles.Particle\r\n * @since 3.0.0\r\n */\r\n this.particleClass = Particle;\r\n\r\n /**\r\n * The x-coordinate of the particle origin (where particles will be emitted).\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#x\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 0\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setPosition\r\n */\r\n this.x = new EmitterOp(config, 'x', 0, true);\r\n\r\n /**\r\n * The y-coordinate of the particle origin (where particles will be emitted).\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#y\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 0\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setPosition\r\n */\r\n this.y = new EmitterOp(config, 'y', 0, true);\r\n\r\n /**\r\n * A radial emitter will emit particles in all directions between angle min and max,\r\n * using {@link Phaser.GameObjects.Particles.ParticleEmitter#speed} as the value. If set to false then this acts as a point Emitter.\r\n * A point emitter will emit particles only in the direction derived from the speedX and speedY values.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#radial\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setRadial\r\n */\r\n this.radial = true;\r\n\r\n /**\r\n * Horizontal acceleration applied to emitted particles, in pixels per second squared.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#gravityX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setGravity\r\n */\r\n this.gravityX = 0;\r\n\r\n /**\r\n * Vertical acceleration applied to emitted particles, in pixels per second squared.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#gravityY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setGravity\r\n */\r\n this.gravityY = 0;\r\n\r\n /**\r\n * Whether accelerationX and accelerationY are non-zero. Set automatically during configuration.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#acceleration\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.acceleration = false;\r\n\r\n /**\r\n * Horizontal acceleration applied to emitted particles, in pixels per second squared.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#accelerationX\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.accelerationX = new EmitterOp(config, 'accelerationX', 0, true);\r\n\r\n /**\r\n * Vertical acceleration applied to emitted particles, in pixels per second squared.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#accelerationY\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.accelerationY = new EmitterOp(config, 'accelerationY', 0, true);\r\n\r\n /**\r\n * The maximum horizontal velocity of emitted particles, in pixels per second squared.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#maxVelocityX\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 10000\r\n * @since 3.0.0\r\n */\r\n this.maxVelocityX = new EmitterOp(config, 'maxVelocityX', 10000, true);\r\n\r\n /**\r\n * The maximum vertical velocity of emitted particles, in pixels per second squared.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#maxVelocityY\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 10000\r\n * @since 3.0.0\r\n */\r\n this.maxVelocityY = new EmitterOp(config, 'maxVelocityY', 10000, true);\r\n\r\n /**\r\n * The initial horizontal speed of emitted particles, in pixels per second.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#speedX\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 0\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setSpeedX\r\n */\r\n this.speedX = new EmitterOp(config, 'speedX', 0, true);\r\n\r\n /**\r\n * The initial vertical speed of emitted particles, in pixels per second.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#speedY\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 0\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setSpeedY\r\n */\r\n this.speedY = new EmitterOp(config, 'speedY', 0, true);\r\n\r\n /**\r\n * Whether moveToX and moveToY are nonzero. Set automatically during configuration.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#moveTo\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.moveTo = false;\r\n\r\n /**\r\n * The x-coordinate emitted particles move toward, when {@link Phaser.GameObjects.Particles.ParticleEmitter#moveTo} is true.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#moveToX\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.moveToX = new EmitterOp(config, 'moveToX', 0, true);\r\n\r\n /**\r\n * The y-coordinate emitted particles move toward, when {@link Phaser.GameObjects.Particles.ParticleEmitter#moveTo} is true.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#moveToY\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.moveToY = new EmitterOp(config, 'moveToY', 0, true);\r\n\r\n /**\r\n * Whether particles will rebound when they meet the emitter bounds.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#bounce\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.bounce = new EmitterOp(config, 'bounce', 0, true);\r\n\r\n /**\r\n * The horizontal scale of emitted particles.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#scaleX\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 1\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setScale\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setScaleX\r\n */\r\n this.scaleX = new EmitterOp(config, 'scaleX', 1);\r\n\r\n /**\r\n * The vertical scale of emitted particles.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#scaleY\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 1\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setScale\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setScaleY\r\n */\r\n this.scaleY = new EmitterOp(config, 'scaleY', 1);\r\n\r\n /**\r\n * Color tint applied to emitted particles. Any alpha component (0xAA000000) is ignored.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#tint\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 0xffffffff\r\n * @since 3.0.0\r\n */\r\n this.tint = new EmitterOp(config, 'tint', 0xffffffff);\r\n\r\n /**\r\n * The alpha (transparency) of emitted particles.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#alpha\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 1\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setAlpha\r\n */\r\n this.alpha = new EmitterOp(config, 'alpha', 1);\r\n\r\n /**\r\n * The lifespan of emitted particles, in ms.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#lifespan\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 1000\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setLifespan\r\n */\r\n this.lifespan = new EmitterOp(config, 'lifespan', 1000, true);\r\n\r\n /**\r\n * The angle of the initial velocity of emitted particles, in degrees.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#angle\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default { min: 0, max: 360 }\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setAngle\r\n */\r\n this.angle = new EmitterOp(config, 'angle', { min: 0, max: 360 }, true);\r\n\r\n /**\r\n * The rotation of emitted particles, in degrees.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#rotate\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.rotate = new EmitterOp(config, 'rotate', 0);\r\n\r\n /**\r\n * A function to call when a particle is emitted.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#emitCallback\r\n * @type {?Phaser.Types.GameObjects.Particles.ParticleEmitterCallback}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.emitCallback = null;\r\n\r\n /**\r\n * The calling context for {@link Phaser.GameObjects.Particles.ParticleEmitter#emitCallback}.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#emitCallbackScope\r\n * @type {?*}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.emitCallbackScope = null;\r\n\r\n /**\r\n * A function to call when a particle dies.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#deathCallback\r\n * @type {?Phaser.Types.GameObjects.Particles.ParticleDeathCallback}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.deathCallback = null;\r\n\r\n /**\r\n * The calling context for {@link Phaser.GameObjects.Particles.ParticleEmitter#deathCallback}.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#deathCallbackScope\r\n * @type {?*}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.deathCallbackScope = null;\r\n\r\n /**\r\n * Set to hard limit the amount of particle objects this emitter is allowed to create.\r\n * 0 means unlimited.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#maxParticles\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.maxParticles = 0;\r\n\r\n /**\r\n * How many particles are emitted each time particles are emitted (one explosion or one flow cycle).\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#quantity\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 1\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrequency\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setQuantity\r\n */\r\n this.quantity = new EmitterOp(config, 'quantity', 1, true);\r\n\r\n /**\r\n * How many ms to wait after emission before the particles start updating.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#delay\r\n * @type {Phaser.GameObjects.Particles.EmitterOp}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.delay = new EmitterOp(config, 'delay', 0, true);\r\n\r\n /**\r\n * For a flow emitter, the time interval (>= 0) between particle flow cycles in ms.\r\n * A value of 0 means there is one particle flow cycle for each logic update (the maximum flow frequency). This is the default setting.\r\n * For an exploding emitter, this value will be -1.\r\n * Calling {@link Phaser.GameObjects.Particles.ParticleEmitter#flow} also puts the emitter in flow mode (frequency >= 0).\r\n * Calling {@link Phaser.GameObjects.Particles.ParticleEmitter#explode} also puts the emitter in explode mode (frequency = -1).\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#frequency\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrequency\r\n */\r\n this.frequency = 0;\r\n\r\n /**\r\n * Controls if the emitter is currently emitting a particle flow (when frequency >= 0).\r\n * Already alive particles will continue to update until they expire.\r\n * Controlled by {@link Phaser.GameObjects.Particles.ParticleEmitter#start} and {@link Phaser.GameObjects.Particles.ParticleEmitter#stop}.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#on\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.on = true;\r\n\r\n /**\r\n * Newly emitted particles are added to the top of the particle list, i.e. rendered above those already alive.\r\n * Set to false to send them to the back.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#particleBringToTop\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.particleBringToTop = true;\r\n\r\n /**\r\n * The time rate applied to active particles, affecting lifespan, movement, and tweens. Values larger than 1 are faster than normal.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#timeScale\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.timeScale = 1;\r\n\r\n /**\r\n * An object describing a shape to emit particles from.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#emitZone\r\n * @type {?Phaser.GameObjects.Particles.Zones.EdgeZone|Phaser.GameObjects.Particles.Zones.RandomZone}\r\n * @default null\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setEmitZone\r\n */\r\n this.emitZone = null;\r\n\r\n /**\r\n * An object describing a shape that deactivates particles when they interact with it.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#deathZone\r\n * @type {?Phaser.GameObjects.Particles.Zones.DeathZone}\r\n * @default null\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setDeathZone\r\n */\r\n this.deathZone = null;\r\n\r\n /**\r\n * A rectangular boundary constraining particle movement.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#bounds\r\n * @type {?Phaser.Geom.Rectangle}\r\n * @default null\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setBounds\r\n */\r\n this.bounds = null;\r\n\r\n /**\r\n * Whether particles interact with the left edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#collideLeft\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.collideLeft = true;\r\n\r\n /**\r\n * Whether particles interact with the right edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#collideRight\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.collideRight = true;\r\n\r\n /**\r\n * Whether particles interact with the top edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#collideTop\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.collideTop = true;\r\n\r\n /**\r\n * Whether particles interact with the bottom edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#collideBottom\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.collideBottom = true;\r\n\r\n /**\r\n * Whether this emitter updates itself and its particles.\r\n *\r\n * Controlled by {@link Phaser.GameObjects.Particles.ParticleEmitter#pause}\r\n * and {@link Phaser.GameObjects.Particles.ParticleEmitter#resume}.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#active\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.active = true;\r\n\r\n /**\r\n * Set this to false to hide any active particles.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#visible\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setVisible\r\n */\r\n this.visible = true;\r\n\r\n /**\r\n * The blend mode of this emitter's particles.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#blendMode\r\n * @type {integer}\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setBlendMode\r\n */\r\n this.blendMode = BlendModes.NORMAL;\r\n\r\n /**\r\n * A Game Object whose position is used as the particle origin.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#follow\r\n * @type {?Phaser.GameObjects.GameObject}\r\n * @default null\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#startFollow\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#stopFollow\r\n */\r\n this.follow = null;\r\n\r\n /**\r\n * The offset of the particle origin from the {@link Phaser.GameObjects.Particles.ParticleEmitter#follow} target.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#followOffset\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#startFollow\r\n */\r\n this.followOffset = new Vector2();\r\n\r\n /**\r\n * Whether the emitter's {@link Phaser.GameObjects.Particles.ParticleEmitter#visible} state will track\r\n * the {@link Phaser.GameObjects.Particles.ParticleEmitter#follow} target's visibility state.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#trackVisible\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#startFollow\r\n */\r\n this.trackVisible = false;\r\n\r\n /**\r\n * The current texture frame, as an index of {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#currentFrame\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrame\r\n */\r\n this.currentFrame = 0;\r\n\r\n /**\r\n * Whether texture {@link Phaser.GameObjects.Particles.ParticleEmitter#frames} are selected at random.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#randomFrame\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrame\r\n */\r\n this.randomFrame = true;\r\n\r\n /**\r\n * The number of consecutive particles that receive a single texture frame (per frame cycle).\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#frameQuantity\r\n * @type {integer}\r\n * @default 1\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrame\r\n */\r\n this.frameQuantity = 1;\r\n\r\n /**\r\n * Inactive particles.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#dead\r\n * @type {Phaser.GameObjects.Particles.Particle[]}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.dead = [];\r\n\r\n /**\r\n * Active particles\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#alive\r\n * @type {Phaser.GameObjects.Particles.Particle[]}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.alive = [];\r\n\r\n /**\r\n * The time until the next flow cycle.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#_counter\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._counter = 0;\r\n\r\n /**\r\n * Counts up to {@link Phaser.GameObjects.Particles.ParticleEmitter#frameQuantity}.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitter#_frameCounter\r\n * @type {integer}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._frameCounter = 0;\r\n\r\n if (config)\r\n {\r\n this.fromJSON(config);\r\n }\r\n },\r\n\r\n /**\r\n * Merges configuration settings into the emitter's current settings.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#fromJSON\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig} config - Settings for this emitter.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n fromJSON: function (config)\r\n {\r\n if (!config)\r\n {\r\n return this;\r\n }\r\n\r\n // Only update properties from their current state if they exist in the given config\r\n\r\n var i = 0;\r\n var key = '';\r\n\r\n for (i = 0; i < this.configFastMap.length; i++)\r\n {\r\n key = this.configFastMap[i];\r\n\r\n if (HasValue(config, key))\r\n {\r\n this[key] = GetFastValue(config, key);\r\n }\r\n }\r\n\r\n for (i = 0; i < this.configOpMap.length; i++)\r\n {\r\n key = this.configOpMap[i];\r\n\r\n if (HasValue(config, key))\r\n {\r\n this[key].loadConfig(config);\r\n }\r\n }\r\n\r\n this.acceleration = (this.accelerationX.propertyValue !== 0 || this.accelerationY.propertyValue !== 0);\r\n\r\n this.moveTo = (this.moveToX.propertyValue !== 0 || this.moveToY.propertyValue !== 0);\r\n\r\n // Special 'speed' override\r\n\r\n if (HasValue(config, 'speed'))\r\n {\r\n this.speedX.loadConfig(config, 'speed');\r\n this.speedY = null;\r\n }\r\n\r\n // If you specify speedX, speedY or moveTo then it changes the emitter from radial to a point emitter\r\n if (HasAny(config, [ 'speedX', 'speedY' ]) || this.moveTo)\r\n {\r\n this.radial = false;\r\n }\r\n\r\n // Special 'scale' override\r\n\r\n if (HasValue(config, 'scale'))\r\n {\r\n this.scaleX.loadConfig(config, 'scale');\r\n this.scaleY = null;\r\n }\r\n\r\n if (HasValue(config, 'callbackScope'))\r\n {\r\n var callbackScope = GetFastValue(config, 'callbackScope', null);\r\n\r\n this.emitCallbackScope = callbackScope;\r\n this.deathCallbackScope = callbackScope;\r\n }\r\n\r\n if (HasValue(config, 'emitZone'))\r\n {\r\n this.setEmitZone(config.emitZone);\r\n }\r\n\r\n if (HasValue(config, 'deathZone'))\r\n {\r\n this.setDeathZone(config.deathZone);\r\n }\r\n\r\n if (HasValue(config, 'bounds'))\r\n {\r\n this.setBounds(config.bounds);\r\n }\r\n\r\n if (HasValue(config, 'followOffset'))\r\n {\r\n this.followOffset.setFromObject(GetFastValue(config, 'followOffset', 0));\r\n }\r\n\r\n if (HasValue(config, 'frame'))\r\n {\r\n this.setFrame(config.frame);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a description of this emitter suitable for JSON serialization.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#toJSON\r\n * @since 3.0.0\r\n *\r\n * @param {object} [output] - An object to copy output into.\r\n *\r\n * @return {object} - The output object.\r\n */\r\n toJSON: function (output)\r\n {\r\n if (output === undefined) { output = {}; }\r\n\r\n var i = 0;\r\n var key = '';\r\n\r\n for (i = 0; i < this.configFastMap.length; i++)\r\n {\r\n key = this.configFastMap[i];\r\n\r\n output[key] = this[key];\r\n }\r\n\r\n for (i = 0; i < this.configOpMap.length; i++)\r\n {\r\n key = this.configOpMap[i];\r\n\r\n if (this[key])\r\n {\r\n output[key] = this[key].toJSON();\r\n }\r\n }\r\n\r\n // special handlers\r\n if (!this.speedY)\r\n {\r\n delete output.speedX;\r\n output.speed = this.speedX.toJSON();\r\n }\r\n\r\n if (!this.scaleY)\r\n {\r\n delete output.scaleX;\r\n output.scale = this.scaleX.toJSON();\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Continuously moves the particle origin to follow a Game Object's position.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#startFollow\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} target - The Game Object to follow.\r\n * @param {number} [offsetX=0] - Horizontal offset of the particle origin from the Game Object.\r\n * @param {number} [offsetY=0] - Vertical offset of the particle origin from the Game Object.\r\n * @param {boolean} [trackVisible=false] - Whether the emitter's visible state will track the target's visible state.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n startFollow: function (target, offsetX, offsetY, trackVisible)\r\n {\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n if (trackVisible === undefined) { trackVisible = false; }\r\n\r\n this.follow = target;\r\n this.followOffset.set(offsetX, offsetY);\r\n this.trackVisible = trackVisible;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stops following a Game Object.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#stopFollow\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n stopFollow: function ()\r\n {\r\n this.follow = null;\r\n this.followOffset.set(0, 0);\r\n this.trackVisible = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Chooses a texture frame from {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#getFrame\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Textures.Frame} The texture frame.\r\n */\r\n getFrame: function ()\r\n {\r\n if (this.frames.length === 1)\r\n {\r\n return this.defaultFrame;\r\n }\r\n else if (this.randomFrame)\r\n {\r\n return GetRandom(this.frames);\r\n }\r\n else\r\n {\r\n var frame = this.frames[this.currentFrame];\r\n\r\n this._frameCounter++;\r\n\r\n if (this._frameCounter === this.frameQuantity)\r\n {\r\n this._frameCounter = 0;\r\n this.currentFrame = Wrap(this.currentFrame + 1, 0, this._frameLength);\r\n }\r\n\r\n return frame;\r\n }\r\n },\r\n\r\n // frame: 0\r\n // frame: 'red'\r\n // frame: [ 0, 1, 2, 3 ]\r\n // frame: [ 'red', 'green', 'blue', 'pink', 'white' ]\r\n // frame: { frames: [ 'red', 'green', 'blue', 'pink', 'white' ], [cycle: bool], [quantity: int] }\r\n\r\n /**\r\n * Sets a pattern for assigning texture frames to emitted particles.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setFrame\r\n * @since 3.0.0\r\n *\r\n * @param {(array|string|integer|Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig)} frames - One or more texture frames, or a configuration object.\r\n * @param {boolean} [pickRandom=true] - Whether frames should be assigned at random from `frames`.\r\n * @param {integer} [quantity=1] - The number of consecutive particles that will receive each frame.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setFrame: function (frames, pickRandom, quantity)\r\n {\r\n if (pickRandom === undefined) { pickRandom = true; }\r\n if (quantity === undefined) { quantity = 1; }\r\n\r\n this.randomFrame = pickRandom;\r\n this.frameQuantity = quantity;\r\n this.currentFrame = 0;\r\n this._frameCounter = 0;\r\n\r\n var t = typeof (frames);\r\n\r\n if (Array.isArray(frames) || t === 'string' || t === 'number')\r\n {\r\n this.manager.setEmitterFrames(frames, this);\r\n }\r\n else if (t === 'object')\r\n {\r\n var frameConfig = frames;\r\n\r\n frames = GetFastValue(frameConfig, 'frames', null);\r\n\r\n if (frames)\r\n {\r\n this.manager.setEmitterFrames(frames, this);\r\n }\r\n\r\n var isCycle = GetFastValue(frameConfig, 'cycle', false);\r\n\r\n this.randomFrame = (isCycle) ? false : true;\r\n\r\n this.frameQuantity = GetFastValue(frameConfig, 'quantity', quantity);\r\n }\r\n\r\n this._frameLength = this.frames.length;\r\n\r\n if (this._frameLength === 1)\r\n {\r\n this.frameQuantity = 1;\r\n this.randomFrame = false;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Turns {@link Phaser.GameObjects.Particles.ParticleEmitter#radial} particle movement on or off.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setRadial\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [value=true] - Radial mode (true) or point mode (true).\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setRadial: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.radial = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the position of the emitter's particle origin.\r\n * New particles will be emitted here.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setPosition\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} x - The x-coordinate of the particle origin.\r\n * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} y - The y-coordinate of the particle origin.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setPosition: function (x, y)\r\n {\r\n this.x.onChange(x);\r\n this.y.onChange(y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets or modifies a rectangular boundary constraining the particles.\r\n *\r\n * To remove the boundary, set {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds} to null.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setBounds\r\n * @since 3.0.0\r\n *\r\n * @param {(number|Phaser.Types.GameObjects.Particles.ParticleEmitterBounds|Phaser.Types.GameObjects.Particles.ParticleEmitterBoundsAlt)} x - The x-coordinate of the left edge of the boundary, or an object representing a rectangle.\r\n * @param {number} y - The y-coordinate of the top edge of the boundary.\r\n * @param {number} width - The width of the boundary.\r\n * @param {number} height - The height of the boundary.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setBounds: function (x, y, width, height)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n var obj = x;\r\n\r\n x = obj.x;\r\n y = obj.y;\r\n width = (HasValue(obj, 'w')) ? obj.w : obj.width;\r\n height = (HasValue(obj, 'h')) ? obj.h : obj.height;\r\n }\r\n\r\n if (this.bounds)\r\n {\r\n this.bounds.setTo(x, y, width, height);\r\n }\r\n else\r\n {\r\n this.bounds = new Rectangle(x, y, width, height);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the initial horizontal speed of emitted particles.\r\n * Changes the emitter to point mode.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setSpeedX\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The speed, in pixels per second.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setSpeedX: function (value)\r\n {\r\n this.speedX.onChange(value);\r\n\r\n // If you specify speedX and Y then it changes the emitter from radial to a point emitter\r\n this.radial = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the initial vertical speed of emitted particles.\r\n * Changes the emitter to point mode.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setSpeedY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The speed, in pixels per second.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setSpeedY: function (value)\r\n {\r\n if (this.speedY)\r\n {\r\n this.speedY.onChange(value);\r\n\r\n // If you specify speedX and Y then it changes the emitter from radial to a point emitter\r\n this.radial = false;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the initial radial speed of emitted particles.\r\n * Changes the emitter to radial mode.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setSpeed\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The speed, in pixels per second.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setSpeed: function (value)\r\n {\r\n this.speedX.onChange(value);\r\n this.speedY = null;\r\n\r\n // If you specify speedX and Y then it changes the emitter from radial to a point emitter\r\n this.radial = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal scale of emitted particles.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setScaleX\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType|Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType)} value - The scale, relative to 1.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setScaleX: function (value)\r\n {\r\n this.scaleX.onChange(value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the vertical scale of emitted particles.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setScaleY\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType|Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType)} value - The scale, relative to 1.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setScaleY: function (value)\r\n {\r\n this.scaleY.onChange(value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the scale of emitted particles.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setScale\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType|Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType)} value - The scale, relative to 1.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setScale: function (value)\r\n {\r\n this.scaleX.onChange(value);\r\n this.scaleY = null;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal gravity applied to emitted particles.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setGravityX\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - Acceleration due to gravity, in pixels per second squared.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setGravityX: function (value)\r\n {\r\n this.gravityX = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the vertical gravity applied to emitted particles.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setGravityY\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - Acceleration due to gravity, in pixels per second squared.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setGravityY: function (value)\r\n {\r\n this.gravityY = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the gravity applied to emitted particles.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setGravity\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - Horizontal acceleration due to gravity, in pixels per second squared.\r\n * @param {number} y - Vertical acceleration due to gravity, in pixels per second squared.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setGravity: function (x, y)\r\n {\r\n this.gravityX = x;\r\n this.gravityY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the opacity of emitted particles.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setAlpha\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType|Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType)} value - A value between 0 (transparent) and 1 (opaque).\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setAlpha: function (value)\r\n {\r\n this.alpha.onChange(value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the color tint of emitted particles.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setTint\r\n * @since 3.22.0\r\n *\r\n * @param {(Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType|Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType)} value - A value between 0 and 0xffffff.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setTint: function (value)\r\n {\r\n this.tint.onChange(value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the angle of a {@link Phaser.GameObjects.Particles.ParticleEmitter#radial} particle stream.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setEmitterAngle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The angle of the initial velocity of emitted particles.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setEmitterAngle: function (value)\r\n {\r\n this.angle.onChange(value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the angle of a {@link Phaser.GameObjects.Particles.ParticleEmitter#radial} particle stream.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setAngle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The angle of the initial velocity of emitted particles.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setAngle: function (value)\r\n {\r\n this.angle.onChange(value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the lifespan of newly emitted particles.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setLifespan\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The particle lifespan, in ms.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setLifespan: function (value)\r\n {\r\n this.lifespan.onChange(value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the number of particles released at each flow cycle or explosion.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setQuantity\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} quantity - The number of particles to release at each flow cycle or explosion.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setQuantity: function (quantity)\r\n {\r\n this.quantity.onChange(quantity);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the emitter's {@link Phaser.GameObjects.Particles.ParticleEmitter#frequency}\r\n * and {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setFrequency\r\n * @since 3.0.0\r\n *\r\n * @param {number} frequency - The time interval (>= 0) of each flow cycle, in ms; or -1 to put the emitter in explosion mode.\r\n * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} [quantity] - The number of particles to release at each flow cycle or explosion.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setFrequency: function (frequency, quantity)\r\n {\r\n this.frequency = frequency;\r\n\r\n this._counter = 0;\r\n\r\n if (quantity)\r\n {\r\n this.quantity.onChange(quantity);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets or removes the {@link Phaser.GameObjects.Particles.ParticleEmitter#emitZone}.\r\n *\r\n * An {@link Phaser.Types.GameObjects.Particles.ParticleEmitterEdgeZoneConfig EdgeZone} places particles on its edges. Its {@link Phaser.Types.GameObjects.Particles.EdgeZoneSource source} can be a Curve, Path, Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; or any object with a suitable {@link Phaser.Types.GameObjects.Particles.EdgeZoneSourceCallback getPoints} method.\r\n *\r\n * A {@link Phaser.Types.GameObjects.Particles.ParticleEmitterRandomZoneConfig RandomZone} places randomly within its interior. Its {@link RandomZoneSource source} can be a Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; or any object with a suitable {@link Phaser.Types.GameObjects.Particles.RandomZoneSourceCallback getRandomPoint} method.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setEmitZone\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterEdgeZoneConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterRandomZoneConfig} [zoneConfig] - An object describing the zone, or `undefined` to remove any current emit zone.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setEmitZone: function (zoneConfig)\r\n {\r\n if (zoneConfig === undefined)\r\n {\r\n this.emitZone = null;\r\n }\r\n else\r\n {\r\n // Where source = Geom like Circle, or a Path or Curve\r\n // emitZone: { type: 'random', source: X }\r\n // emitZone: { type: 'edge', source: X, quantity: 32, [stepRate=0], [yoyo=false], [seamless=true] }\r\n\r\n var type = GetFastValue(zoneConfig, 'type', 'random');\r\n var source = GetFastValue(zoneConfig, 'source', null);\r\n\r\n switch (type)\r\n {\r\n case 'random':\r\n\r\n this.emitZone = new RandomZone(source);\r\n\r\n break;\r\n\r\n case 'edge':\r\n\r\n var quantity = GetFastValue(zoneConfig, 'quantity', 1);\r\n var stepRate = GetFastValue(zoneConfig, 'stepRate', 0);\r\n var yoyo = GetFastValue(zoneConfig, 'yoyo', false);\r\n var seamless = GetFastValue(zoneConfig, 'seamless', true);\r\n\r\n this.emitZone = new EdgeZone(source, quantity, stepRate, yoyo, seamless);\r\n\r\n break;\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets or removes the {@link Phaser.GameObjects.Particles.ParticleEmitter#deathZone}.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#setDeathZone\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterDeathZoneConfig} [zoneConfig] - An object describing the zone, or `undefined` to remove any current death zone.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n setDeathZone: function (zoneConfig)\r\n {\r\n if (zoneConfig === undefined)\r\n {\r\n this.deathZone = null;\r\n }\r\n else\r\n {\r\n // Where source = Geom like Circle or Rect that supports a 'contains' function\r\n // deathZone: { type: 'onEnter', source: X }\r\n // deathZone: { type: 'onLeave', source: X }\r\n\r\n var type = GetFastValue(zoneConfig, 'type', 'onEnter');\r\n var source = GetFastValue(zoneConfig, 'source', null);\r\n\r\n if (source && typeof source.contains === 'function')\r\n {\r\n var killOnEnter = (type === 'onEnter') ? true : false;\r\n\r\n this.deathZone = new DeathZone(source, killOnEnter);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates inactive particles and adds them to this emitter's pool.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#reserve\r\n * @since 3.0.0\r\n *\r\n * @param {integer} particleCount - The number of particles to create.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n reserve: function (particleCount)\r\n {\r\n var dead = this.dead;\r\n\r\n for (var i = 0; i < particleCount; i++)\r\n {\r\n dead.push(new this.particleClass(this));\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the number of active (in-use) particles in this emitter.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#getAliveParticleCount\r\n * @since 3.0.0\r\n *\r\n * @return {integer} The number of particles with `active=true`.\r\n */\r\n getAliveParticleCount: function ()\r\n {\r\n return this.alive.length;\r\n },\r\n\r\n /**\r\n * Gets the number of inactive (available) particles in this emitter.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#getDeadParticleCount\r\n * @since 3.0.0\r\n *\r\n * @return {integer} The number of particles with `active=false`.\r\n */\r\n getDeadParticleCount: function ()\r\n {\r\n return this.dead.length;\r\n },\r\n\r\n /**\r\n * Gets the total number of particles in this emitter.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#getParticleCount\r\n * @since 3.0.0\r\n *\r\n * @return {integer} The number of particles, including both alive and dead.\r\n */\r\n getParticleCount: function ()\r\n {\r\n return this.getAliveParticleCount() + this.getDeadParticleCount();\r\n },\r\n\r\n /**\r\n * Whether this emitter is at its limit (if set).\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#atLimit\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} Returns `true` if this Emitter is at its limit, or `false` if no limit, or below the `maxParticles` level.\r\n */\r\n atLimit: function ()\r\n {\r\n return (this.maxParticles > 0 && this.getParticleCount() === this.maxParticles);\r\n },\r\n\r\n /**\r\n * Sets a function to call for each newly emitted particle.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#onParticleEmit\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterCallback} callback - The function.\r\n * @param {*} [context] - The calling context.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n onParticleEmit: function (callback, context)\r\n {\r\n if (callback === undefined)\r\n {\r\n // Clear any previously set callback\r\n this.emitCallback = null;\r\n this.emitCallbackScope = null;\r\n }\r\n else if (typeof callback === 'function')\r\n {\r\n this.emitCallback = callback;\r\n\r\n if (context)\r\n {\r\n this.emitCallbackScope = context;\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a function to call for each particle death.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#onParticleDeath\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.ParticleDeathCallback} callback - The function.\r\n * @param {*} [context] - The function's calling context.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n onParticleDeath: function (callback, context)\r\n {\r\n if (callback === undefined)\r\n {\r\n // Clear any previously set callback\r\n this.deathCallback = null;\r\n this.deathCallbackScope = null;\r\n }\r\n else if (typeof callback === 'function')\r\n {\r\n this.deathCallback = callback;\r\n\r\n if (context)\r\n {\r\n this.deathCallbackScope = context;\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Deactivates every particle in this emitter.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#killAll\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n killAll: function ()\r\n {\r\n var dead = this.dead;\r\n var alive = this.alive;\r\n\r\n while (alive.length > 0)\r\n {\r\n dead.push(alive.pop());\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calls a function for each active particle in this emitter.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#forEachAlive\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterCallback} callback - The function.\r\n * @param {*} context - The function's calling context.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n forEachAlive: function (callback, context)\r\n {\r\n var alive = this.alive;\r\n var length = alive.length;\r\n\r\n for (var index = 0; index < length; ++index)\r\n {\r\n // Sends the Particle and the Emitter\r\n callback.call(context, alive[index], this);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calls a function for each inactive particle in this emitter.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#forEachDead\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterCallback} callback - The function.\r\n * @param {*} context - The function's calling context.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n forEachDead: function (callback, context)\r\n {\r\n var dead = this.dead;\r\n var length = dead.length;\r\n\r\n for (var index = 0; index < length; ++index)\r\n {\r\n // Sends the Particle and the Emitter\r\n callback.call(context, dead[index], this);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Turns {@link Phaser.GameObjects.Particles.ParticleEmitter#on} the emitter and resets the flow counter.\r\n *\r\n * If this emitter is in flow mode (frequency >= 0; the default), the particle flow will start (or restart).\r\n *\r\n * If this emitter is in explode mode (frequency = -1), nothing will happen.\r\n * Use {@link Phaser.GameObjects.Particles.ParticleEmitter#explode} or {@link Phaser.GameObjects.Particles.ParticleEmitter#flow} instead.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#start\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n start: function ()\r\n {\r\n this.on = true;\r\n\r\n this._counter = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Turns {@link Phaser.GameObjects.Particles.ParticleEmitter#on off} the emitter.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#stop\r\n * @since 3.11.0\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n stop: function ()\r\n {\r\n this.on = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * {@link Phaser.GameObjects.Particles.ParticleEmitter#active Deactivates} the emitter.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#pause\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n pause: function ()\r\n {\r\n this.active = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * {@link Phaser.GameObjects.Particles.ParticleEmitter#active Activates} the emitter.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#resume\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n resume: function ()\r\n {\r\n this.active = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes the emitter from its manager and the scene.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#remove\r\n * @since 3.22.0\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n remove: function ()\r\n {\r\n this.manager.removeEmitter(this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sorts active particles with {@link Phaser.GameObjects.Particles.ParticleEmitter#depthSortCallback}.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#depthSort\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n depthSort: function ()\r\n {\r\n StableSort.inplace(this.alive, this.depthSortCallback);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Puts the emitter in flow mode (frequency >= 0) and starts (or restarts) a particle flow.\r\n *\r\n * To resume a flow at the current frequency and quantity, use {@link Phaser.GameObjects.Particles.ParticleEmitter#start} instead.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#flow\r\n * @since 3.0.0\r\n *\r\n * @param {number} frequency - The time interval (>= 0) of each flow cycle, in ms.\r\n * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} [count=1] - The number of particles to emit at each flow cycle.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.\r\n */\r\n flow: function (frequency, count)\r\n {\r\n if (count === undefined) { count = 1; }\r\n\r\n this.frequency = frequency;\r\n\r\n this.quantity.onChange(count);\r\n\r\n return this.start();\r\n },\r\n\r\n /**\r\n * Puts the emitter in explode mode (frequency = -1), stopping any current particle flow, and emits several particles all at once.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#explode\r\n * @since 3.0.0\r\n *\r\n * @param {integer} count - The amount of Particles to emit.\r\n * @param {number} x - The x coordinate to emit the Particles from.\r\n * @param {number} y - The y coordinate to emit the Particles from.\r\n *\r\n * @return {Phaser.GameObjects.Particles.Particle} The most recently emitted Particle.\r\n */\r\n explode: function (count, x, y)\r\n {\r\n this.frequency = -1;\r\n\r\n return this.emitParticle(count, x, y);\r\n },\r\n\r\n /**\r\n * Emits particles at a given position (or the emitter's current position).\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#emitParticleAt\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=this.x] - The x coordinate to emit the Particles from.\r\n * @param {number} [y=this.x] - The y coordinate to emit the Particles from.\r\n * @param {integer} [count=this.quantity] - The number of Particles to emit.\r\n *\r\n * @return {Phaser.GameObjects.Particles.Particle} The most recently emitted Particle.\r\n */\r\n emitParticleAt: function (x, y, count)\r\n {\r\n return this.emitParticle(count, x, y);\r\n },\r\n\r\n /**\r\n * Emits particles at a given position (or the emitter's current position).\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#emitParticle\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [count=this.quantity] - The number of Particles to emit.\r\n * @param {number} [x=this.x] - The x coordinate to emit the Particles from.\r\n * @param {number} [y=this.x] - The y coordinate to emit the Particles from.\r\n *\r\n * @return {Phaser.GameObjects.Particles.Particle} The most recently emitted Particle.\r\n *\r\n * @see Phaser.GameObjects.Particles.Particle#fire\r\n */\r\n emitParticle: function (count, x, y)\r\n {\r\n if (this.atLimit())\r\n {\r\n return;\r\n }\r\n\r\n if (count === undefined)\r\n {\r\n count = this.quantity.onEmit();\r\n }\r\n\r\n var dead = this.dead;\r\n\r\n for (var i = 0; i < count; i++)\r\n {\r\n var particle = dead.pop();\r\n\r\n if (!particle)\r\n {\r\n particle = new this.particleClass(this);\r\n }\r\n\r\n particle.fire(x, y);\r\n\r\n if (this.particleBringToTop)\r\n {\r\n this.alive.push(particle);\r\n }\r\n else\r\n {\r\n this.alive.unshift(particle);\r\n }\r\n\r\n if (this.emitCallback)\r\n {\r\n this.emitCallback.call(this.emitCallbackScope, particle, this);\r\n }\r\n\r\n if (this.atLimit())\r\n {\r\n break;\r\n }\r\n }\r\n\r\n return particle;\r\n },\r\n\r\n /**\r\n * Updates this emitter and its particles.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#preUpdate\r\n * @since 3.0.0\r\n *\r\n * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n preUpdate: function (time, delta)\r\n {\r\n // Scale the delta\r\n delta *= this.timeScale;\r\n\r\n var step = (delta / 1000);\r\n\r\n if (this.trackVisible)\r\n {\r\n this.visible = this.follow.visible;\r\n }\r\n\r\n // Any particle processors?\r\n var processors = this.manager.getProcessors();\r\n\r\n var particles = this.alive;\r\n var dead = this.dead;\r\n\r\n var i = 0;\r\n var rip = [];\r\n var length = particles.length;\r\n\r\n for (i = 0; i < length; i++)\r\n {\r\n var particle = particles[i];\r\n\r\n // update returns `true` if the particle is now dead (lifeCurrent <= 0)\r\n if (particle.update(delta, step, processors))\r\n {\r\n rip.push({ index: i, particle: particle });\r\n }\r\n }\r\n\r\n // Move dead particles to the dead array\r\n length = rip.length;\r\n\r\n if (length > 0)\r\n {\r\n var deathCallback = this.deathCallback;\r\n var deathCallbackScope = this.deathCallbackScope;\r\n\r\n for (i = length - 1; i >= 0; i--)\r\n {\r\n var entry = rip[i];\r\n\r\n // Remove from particles array\r\n particles.splice(entry.index, 1);\r\n\r\n // Add to dead array\r\n dead.push(entry.particle);\r\n\r\n // Callback\r\n if (deathCallback)\r\n {\r\n deathCallback.call(deathCallbackScope, entry.particle);\r\n }\r\n\r\n entry.particle.resetPosition();\r\n }\r\n }\r\n\r\n if (!this.on)\r\n {\r\n return;\r\n }\r\n\r\n if (this.frequency === 0)\r\n {\r\n this.emitParticle();\r\n }\r\n else if (this.frequency > 0)\r\n {\r\n this._counter -= delta;\r\n\r\n if (this._counter <= 0)\r\n {\r\n this.emitParticle();\r\n\r\n // counter = frequency - remained from previous delta\r\n this._counter = (this.frequency - Math.abs(this._counter));\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Calculates the difference of two particles, for sorting them by depth.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitter#depthSortCallback\r\n * @since 3.0.0\r\n *\r\n * @param {object} a - The first particle.\r\n * @param {object} b - The second particle.\r\n *\r\n * @return {integer} The difference of a and b's y coordinates.\r\n */\r\n depthSortCallback: function (a, b)\r\n {\r\n return a.y - b.y;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ParticleEmitter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/particles/ParticleEmitter.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/particles/ParticleEmitterManager.js": /*!*********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/particles/ParticleEmitterManager.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar GravityWell = __webpack_require__(/*! ./GravityWell */ \"./node_modules/phaser/src/gameobjects/particles/GravityWell.js\");\r\nvar List = __webpack_require__(/*! ../../structs/List */ \"./node_modules/phaser/src/structs/List.js\");\r\nvar ParticleEmitter = __webpack_require__(/*! ./ParticleEmitter */ \"./node_modules/phaser/src/gameobjects/particles/ParticleEmitter.js\");\r\nvar Render = __webpack_require__(/*! ./ParticleManagerRender */ \"./node_modules/phaser/src/gameobjects/particles/ParticleManagerRender.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Particle Emitter Manager creates and controls {@link Phaser.GameObjects.Particles.ParticleEmitter Particle Emitters} and {@link Phaser.GameObjects.Particles.GravityWell Gravity Wells}.\r\n *\r\n * @class ParticleEmitterManager\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects.Particles\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Emitter Manager belongs.\r\n * @param {string} texture - The key of the Texture this Emitter Manager will use to render particles, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Emitter Manager will use to render particles.\r\n * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]} [emitters] - Configuration settings for one or more emitters to create.\r\n */\r\nvar ParticleEmitterManager = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.Depth,\r\n Components.Mask,\r\n Components.Pipeline,\r\n Components.Transform,\r\n Components.Visible,\r\n Render\r\n ],\r\n\r\n initialize:\r\n\r\n // frame is optional and can contain the emitters array or object if skipped\r\n function ParticleEmitterManager (scene, texture, frame, emitters)\r\n {\r\n GameObject.call(this, scene, 'ParticleEmitterManager');\r\n\r\n /**\r\n * The blend mode applied to all emitters and particles.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitterManager#blendMode\r\n * @type {integer}\r\n * @default -1\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.blendMode = -1;\r\n\r\n /**\r\n * The time scale applied to all emitters and particles, affecting flow rate, lifespan, and movement.\r\n * Values larger than 1 are faster than normal.\r\n * This is multiplied with any timeScale set on each individual emitter.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitterManager#timeScale\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.timeScale = 1;\r\n\r\n /**\r\n * The texture used to render this Emitter Manager's particles.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitterManager#texture\r\n * @type {Phaser.Textures.Texture}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.texture = null;\r\n\r\n /**\r\n * The texture frame used to render this Emitter Manager's particles.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitterManager#frame\r\n * @type {Phaser.Textures.Frame}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.frame = null;\r\n\r\n /**\r\n * Names of this Emitter Manager's texture frames.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitterManager#frameNames\r\n * @type {string[]}\r\n * @since 3.0.0\r\n */\r\n this.frameNames = [];\r\n\r\n // frame is optional and can contain the emitters array or object if skipped\r\n if (frame !== null && (typeof frame === 'object' || Array.isArray(frame)))\r\n {\r\n emitters = frame;\r\n frame = null;\r\n }\r\n\r\n this.setTexture(texture, frame);\r\n\r\n this.initPipeline();\r\n\r\n /**\r\n * A list of Emitters being managed by this Emitter Manager.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitterManager#emitters\r\n * @type {Phaser.Structs.List.}\r\n * @since 3.0.0\r\n */\r\n this.emitters = new List(this);\r\n\r\n /**\r\n * A list of Gravity Wells being managed by this Emitter Manager.\r\n *\r\n * @name Phaser.GameObjects.Particles.ParticleEmitterManager#wells\r\n * @type {Phaser.Structs.List.}\r\n * @since 3.0.0\r\n */\r\n this.wells = new List(this);\r\n\r\n if (emitters)\r\n {\r\n // An array of emitter configs?\r\n if (!Array.isArray(emitters))\r\n {\r\n emitters = [ emitters ];\r\n }\r\n\r\n for (var i = 0; i < emitters.length; i++)\r\n {\r\n this.createEmitter(emitters[i]);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Sets the texture and frame this Emitter Manager will use to render with.\r\n *\r\n * Textures are referenced by their string-based keys, as stored in the Texture Manager.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setTexture\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the texture to be used, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - The name or index of the frame within the Texture.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager.\r\n */\r\n setTexture: function (key, frame)\r\n {\r\n this.texture = this.scene.sys.textures.get(key);\r\n\r\n return this.setFrame(frame);\r\n },\r\n\r\n /**\r\n * Sets the frame this Emitter Manager will use to render with.\r\n *\r\n * The Frame has to belong to the current Texture being used.\r\n *\r\n * It can be either a string or an index.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setFrame\r\n * @since 3.0.0\r\n *\r\n * @param {(string|integer)} [frame] - The name or index of the frame within the Texture.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager.\r\n */\r\n setFrame: function (frame)\r\n {\r\n this.frame = this.texture.get(frame);\r\n\r\n var frames = this.texture.getFramesFromTextureSource(this.frame.sourceIndex);\r\n\r\n var names = [];\r\n\r\n frames.forEach(function (sourceFrame)\r\n {\r\n names.push(sourceFrame.name);\r\n });\r\n\r\n this.frameNames = names;\r\n\r\n this.defaultFrame = this.frame;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Assigns texture frames to an emitter.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setEmitterFrames\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Textures.Frame|Phaser.Textures.Frame[])} frames - The texture frames.\r\n * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - The particle emitter to modify.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager.\r\n */\r\n setEmitterFrames: function (frames, emitter)\r\n {\r\n if (!Array.isArray(frames))\r\n {\r\n frames = [ frames ];\r\n }\r\n\r\n var out = emitter.frames;\r\n\r\n out.length = 0;\r\n\r\n for (var i = 0; i < frames.length; i++)\r\n {\r\n var frame = frames[i];\r\n\r\n if (this.frameNames.indexOf(frame) !== -1)\r\n {\r\n out.push(this.texture.get(frame));\r\n }\r\n }\r\n\r\n if (out.length > 0)\r\n {\r\n emitter.defaultFrame = out[0];\r\n }\r\n else\r\n {\r\n emitter.defaultFrame = this.defaultFrame;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds an existing Particle Emitter to this Emitter Manager.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#addEmitter\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - The Particle Emitter to add to this Emitter Manager.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} The Particle Emitter that was added to this Emitter Manager.\r\n */\r\n addEmitter: function (emitter)\r\n {\r\n return this.emitters.add(emitter);\r\n },\r\n\r\n /**\r\n * Creates a new Particle Emitter object, adds it to this Emitter Manager and returns a reference to it.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#createEmitter\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig} config - Configuration settings for the Particle Emitter to create.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitter} The Particle Emitter that was created.\r\n */\r\n createEmitter: function (config)\r\n {\r\n return this.addEmitter(new ParticleEmitter(this, config));\r\n },\r\n\r\n /**\r\n * Removes a Particle Emitter from this Emitter Manager, if the Emitter belongs to this Manager.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#removeEmitter\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter\r\n *\r\n * @return {?Phaser.GameObjects.Particles.ParticleEmitter} The Particle Emitter if it was removed or null if it was not.\r\n */\r\n removeEmitter: function (emitter)\r\n {\r\n return this.emitters.remove(emitter, true);\r\n },\r\n\r\n /**\r\n * Adds an existing Gravity Well object to this Emitter Manager.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#addGravityWell\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Particles.GravityWell} well - The Gravity Well to add to this Emitter Manager.\r\n *\r\n * @return {Phaser.GameObjects.Particles.GravityWell} The Gravity Well that was added to this Emitter Manager.\r\n */\r\n addGravityWell: function (well)\r\n {\r\n return this.wells.add(well);\r\n },\r\n\r\n /**\r\n * Creates a new Gravity Well, adds it to this Emitter Manager and returns a reference to it.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#createGravityWell\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.GravityWellConfig} config - Configuration settings for the Gravity Well to create.\r\n *\r\n * @return {Phaser.GameObjects.Particles.GravityWell} The Gravity Well that was created.\r\n */\r\n createGravityWell: function (config)\r\n {\r\n return this.addGravityWell(new GravityWell(config));\r\n },\r\n\r\n /**\r\n * Emits particles from each active emitter.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#emitParticle\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}.\r\n * @param {number} [x] - The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location.\r\n * @param {number} [y] - The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager.\r\n */\r\n emitParticle: function (count, x, y)\r\n {\r\n var emitters = this.emitters.list;\r\n\r\n for (var i = 0; i < emitters.length; i++)\r\n {\r\n var emitter = emitters[i];\r\n\r\n if (emitter.active)\r\n {\r\n emitter.emitParticle(count, x, y);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Emits particles from each active emitter.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#emitParticleAt\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location.\r\n * @param {number} [y] - The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location.\r\n * @param {integer} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager.\r\n */\r\n emitParticleAt: function (x, y, count)\r\n {\r\n return this.emitParticle(count, x, y);\r\n },\r\n\r\n /**\r\n * Pauses this Emitter Manager.\r\n *\r\n * This has the effect of pausing all emitters, and all particles of those emitters, currently under its control.\r\n *\r\n * The particles will still render, but they will not have any of their logic updated.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#pause\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager.\r\n */\r\n pause: function ()\r\n {\r\n this.active = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resumes this Emitter Manager, should it have been previously paused.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#resume\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager.\r\n */\r\n resume: function ()\r\n {\r\n this.active = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets all active particle processors (gravity wells).\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#getProcessors\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Particles.GravityWell[]} - The active gravity wells.\r\n */\r\n getProcessors: function ()\r\n {\r\n return this.wells.getAll('active', true);\r\n },\r\n\r\n /**\r\n * Updates all active emitters.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#preUpdate\r\n * @since 3.0.0\r\n *\r\n * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n preUpdate: function (time, delta)\r\n {\r\n // Scale the delta\r\n delta *= this.timeScale;\r\n\r\n var emitters = this.emitters.list;\r\n\r\n for (var i = 0; i < emitters.length; i++)\r\n {\r\n var emitter = emitters[i];\r\n\r\n if (emitter.active)\r\n {\r\n emitter.preUpdate(time, delta);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * A NOOP method so you can pass an EmitterManager to a Container.\r\n * Calling this method will do nothing. It is intentionally empty.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setAlpha\r\n * @private\r\n * @since 3.10.0\r\n */\r\n setAlpha: function ()\r\n {\r\n },\r\n\r\n /**\r\n * A NOOP method so you can pass an EmitterManager to a Container.\r\n * Calling this method will do nothing. It is intentionally empty.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setScrollFactor\r\n * @private\r\n * @since 3.10.0\r\n */\r\n setScrollFactor: function ()\r\n {\r\n },\r\n\r\n /**\r\n * A NOOP method so you can pass an EmitterManager to a Container.\r\n * Calling this method will do nothing. It is intentionally empty.\r\n *\r\n * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setBlendMode\r\n * @private\r\n * @since 3.15.0\r\n */\r\n setBlendMode: function ()\r\n {\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ParticleEmitterManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/particles/ParticleEmitterManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/particles/ParticleManagerCanvasRenderer.js": /*!****************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/particles/ParticleManagerCanvasRenderer.js ***! \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterManager#renderCanvas\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Particles.ParticleEmitterManager} emitterManager - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar ParticleManagerCanvasRenderer = function (renderer, emitterManager, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var emitters = emitterManager.emitters.list;\r\n var emittersLength = emitters.length;\r\n\r\n if (emittersLength === 0)\r\n {\r\n return;\r\n }\r\n\r\n var camMatrix = renderer._tempMatrix1.copyFrom(camera.matrix);\r\n var calcMatrix = renderer._tempMatrix2;\r\n var particleMatrix = renderer._tempMatrix3;\r\n var managerMatrix = renderer._tempMatrix4.applyITRS(emitterManager.x, emitterManager.y, emitterManager.rotation, emitterManager.scaleX, emitterManager.scaleY);\r\n\r\n camMatrix.multiply(managerMatrix);\r\n\r\n var roundPixels = camera.roundPixels;\r\n\r\n var ctx = renderer.currentContext;\r\n\r\n ctx.save();\r\n\r\n for (var e = 0; e < emittersLength; e++)\r\n {\r\n var emitter = emitters[e];\r\n var particles = emitter.alive;\r\n var particleCount = particles.length;\r\n\r\n if (!emitter.visible || particleCount === 0)\r\n {\r\n continue;\r\n }\r\n\r\n var scrollX = camera.scrollX * emitter.scrollFactorX;\r\n var scrollY = camera.scrollY * emitter.scrollFactorY;\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -scrollX, -scrollY);\r\n\r\n scrollX = 0;\r\n scrollY = 0;\r\n }\r\n\r\n ctx.globalCompositeOperation = renderer.blendModes[emitter.blendMode];\r\n\r\n for (var i = 0; i < particleCount; i++)\r\n {\r\n var particle = particles[i];\r\n\r\n var alpha = particle.alpha * camera.alpha;\r\n\r\n if (alpha <= 0)\r\n {\r\n continue;\r\n }\r\n\r\n var frame = particle.frame;\r\n var cd = frame.canvasData;\r\n\r\n var x = -(frame.halfWidth);\r\n var y = -(frame.halfHeight);\r\n\r\n particleMatrix.applyITRS(0, 0, particle.rotation, particle.scaleX, particle.scaleY);\r\n\r\n particleMatrix.e = particle.x - scrollX;\r\n particleMatrix.f = particle.y - scrollY;\r\n\r\n camMatrix.multiply(particleMatrix, calcMatrix);\r\n\r\n ctx.globalAlpha = alpha;\r\n \r\n ctx.save();\r\n\r\n calcMatrix.copyToContext(ctx);\r\n\r\n if (roundPixels)\r\n {\r\n x = Math.round(x);\r\n y = Math.round(y);\r\n }\r\n\r\n ctx.imageSmoothingEnabled = !(!renderer.antialias || frame.source.scaleMode);\r\n\r\n ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height);\r\n\r\n ctx.restore();\r\n }\r\n }\r\n\r\n ctx.restore();\r\n};\r\n\r\nmodule.exports = ParticleManagerCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/particles/ParticleManagerCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/particles/ParticleManagerCreator.js": /*!*********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/particles/ParticleManagerCreator.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectCreator = __webpack_require__(/*! ../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar ParticleEmitterManager = __webpack_require__(/*! ./ParticleEmitterManager */ \"./node_modules/phaser/src/gameobjects/particles/ParticleEmitterManager.js\");\r\n\r\n/**\r\n * Creates a new Particle Emitter Manager Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Particles Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#particles\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('particles', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n var key = GetAdvancedValue(config, 'key', null);\r\n var frame = GetAdvancedValue(config, 'frame', null);\r\n var emitters = GetFastValue(config, 'emitters', null);\r\n\r\n // frame is optional and can contain the emitters array or object if skipped\r\n var manager = new ParticleEmitterManager(this.scene, key, frame, emitters);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n var add = GetFastValue(config, 'add', false);\r\n\r\n if (add)\r\n {\r\n this.displayList.add(manager);\r\n }\r\n\r\n this.updateList.add(manager);\r\n\r\n return manager;\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/particles/ParticleManagerCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/particles/ParticleManagerFactory.js": /*!*********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/particles/ParticleManagerFactory.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar ParticleEmitterManager = __webpack_require__(/*! ./ParticleEmitterManager */ \"./node_modules/phaser/src/gameobjects/particles/ParticleEmitterManager.js\");\r\n\r\n/**\r\n * Creates a new Particle Emitter Manager Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Particles Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#particles\r\n * @since 3.0.0\r\n *\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer|object)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]} [emitters] - Configuration settings for one or more emitters to create.\r\n *\r\n * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('particles', function (key, frame, emitters)\r\n{\r\n var manager = new ParticleEmitterManager(this.scene, key, frame, emitters);\r\n\r\n this.displayList.add(manager);\r\n this.updateList.add(manager);\r\n\r\n return manager;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/particles/ParticleManagerFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/particles/ParticleManagerRender.js": /*!********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/particles/ParticleManagerRender.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./ParticleManagerWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/particles/ParticleManagerWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./ParticleManagerCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/particles/ParticleManagerCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/particles/ParticleManagerRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/particles/ParticleManagerWebGLRenderer.js": /*!***************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/particles/ParticleManagerWebGLRenderer.js ***! \***************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Utils = __webpack_require__(/*! ../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Particles.EmitterManager#renderWebGL\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Particles.ParticleEmitterManager} emitterManager - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var emitters = emitterManager.emitters.list;\r\n var emittersLength = emitters.length;\r\n\r\n if (emittersLength === 0)\r\n {\r\n return;\r\n }\r\n\r\n var pipeline = this.pipeline;\r\n\r\n var camMatrix = pipeline._tempMatrix1.copyFrom(camera.matrix);\r\n var calcMatrix = pipeline._tempMatrix2;\r\n var particleMatrix = pipeline._tempMatrix3;\r\n var managerMatrix = pipeline._tempMatrix4.applyITRS(emitterManager.x, emitterManager.y, emitterManager.rotation, emitterManager.scaleX, emitterManager.scaleY);\r\n\r\n camMatrix.multiply(managerMatrix);\r\n\r\n renderer.setPipeline(pipeline);\r\n\r\n var roundPixels = camera.roundPixels;\r\n var texture = emitterManager.defaultFrame.glTexture;\r\n var getTint = Utils.getTintAppendFloatAlphaAndSwap;\r\n\r\n pipeline.setTexture2D(texture, 0);\r\n\r\n for (var e = 0; e < emittersLength; e++)\r\n {\r\n var emitter = emitters[e];\r\n var particles = emitter.alive;\r\n var particleCount = particles.length;\r\n\r\n if (!emitter.visible || particleCount === 0)\r\n {\r\n continue;\r\n }\r\n\r\n var scrollX = camera.scrollX * emitter.scrollFactorX;\r\n var scrollY = camera.scrollY * emitter.scrollFactorY;\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -scrollX, -scrollY);\r\n\r\n scrollX = 0;\r\n scrollY = 0;\r\n }\r\n\r\n if (renderer.setBlendMode(emitter.blendMode))\r\n {\r\n // Rebind the texture if we've flushed\r\n pipeline.setTexture2D(texture, 0);\r\n }\r\n\r\n if (emitter.mask)\r\n {\r\n emitter.mask.preRenderWebGL(renderer, emitter, camera);\r\n pipeline.setTexture2D(texture, 0);\r\n }\r\n \r\n var tintEffect = 0;\r\n\r\n for (var i = 0; i < particleCount; i++)\r\n {\r\n var particle = particles[i];\r\n\r\n var alpha = particle.alpha * camera.alpha;\r\n\r\n if (alpha <= 0)\r\n {\r\n continue;\r\n }\r\n\r\n var frame = particle.frame;\r\n\r\n var x = -(frame.halfWidth);\r\n var y = -(frame.halfHeight);\r\n var xw = x + frame.width;\r\n var yh = y + frame.height;\r\n\r\n particleMatrix.applyITRS(0, 0, particle.rotation, particle.scaleX, particle.scaleY);\r\n\r\n particleMatrix.e = particle.x - scrollX;\r\n particleMatrix.f = particle.y - scrollY;\r\n\r\n camMatrix.multiply(particleMatrix, calcMatrix);\r\n\r\n var tx0 = calcMatrix.getX(x, y);\r\n var ty0 = calcMatrix.getY(x, y);\r\n \r\n var tx1 = calcMatrix.getX(x, yh);\r\n var ty1 = calcMatrix.getY(x, yh);\r\n \r\n var tx2 = calcMatrix.getX(xw, yh);\r\n var ty2 = calcMatrix.getY(xw, yh);\r\n \r\n var tx3 = calcMatrix.getX(xw, y);\r\n var ty3 = calcMatrix.getY(xw, y);\r\n\r\n if (roundPixels)\r\n {\r\n tx0 = Math.round(tx0);\r\n ty0 = Math.round(ty0);\r\n \r\n tx1 = Math.round(tx1);\r\n ty1 = Math.round(ty1);\r\n \r\n tx2 = Math.round(tx2);\r\n ty2 = Math.round(ty2);\r\n \r\n tx3 = Math.round(tx3);\r\n ty3 = Math.round(ty3);\r\n }\r\n\r\n var tint = getTint(particle.tint, alpha);\r\n\r\n pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, texture, 0);\r\n }\r\n\r\n if (emitter.mask)\r\n {\r\n emitter.mask.postRenderWebGL(renderer, camera);\r\n pipeline.setTexture2D(texture, 0);\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = ParticleManagerWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/particles/ParticleManagerWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/particles/index.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/particles/index.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.GameObjects.Particles\r\n */\r\n\r\nmodule.exports = {\r\n\r\n GravityWell: __webpack_require__(/*! ./GravityWell */ \"./node_modules/phaser/src/gameobjects/particles/GravityWell.js\"),\r\n Particle: __webpack_require__(/*! ./Particle */ \"./node_modules/phaser/src/gameobjects/particles/Particle.js\"),\r\n ParticleEmitter: __webpack_require__(/*! ./ParticleEmitter */ \"./node_modules/phaser/src/gameobjects/particles/ParticleEmitter.js\"),\r\n ParticleEmitterManager: __webpack_require__(/*! ./ParticleEmitterManager */ \"./node_modules/phaser/src/gameobjects/particles/ParticleEmitterManager.js\"),\r\n Zones: __webpack_require__(/*! ./zones */ \"./node_modules/phaser/src/gameobjects/particles/zones/index.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/particles/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/particles/zones/DeathZone.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/particles/zones/DeathZone.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Death Zone.\r\n *\r\n * A Death Zone is a special type of zone that will kill a Particle as soon as it either enters, or leaves, the zone.\r\n *\r\n * The zone consists of a `source` which could be a Geometric shape, such as a Rectangle or Ellipse, or your own\r\n * object as long as it includes a `contains` method for which the Particles can be tested against.\r\n *\r\n * @class DeathZone\r\n * @memberof Phaser.GameObjects.Particles.Zones\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.DeathZoneSource} source - An object instance that has a `contains` method that returns a boolean when given `x` and `y` arguments.\r\n * @param {boolean} killOnEnter - Should the Particle be killed when it enters the zone? `true` or leaves it? `false`\r\n */\r\nvar DeathZone = new Class({\r\n\r\n initialize:\r\n\r\n function DeathZone (source, killOnEnter)\r\n {\r\n /**\r\n * An object instance that has a `contains` method that returns a boolean when given `x` and `y` arguments.\r\n * This could be a Geometry shape, such as `Phaser.Geom.Circle`, or your own custom object.\r\n *\r\n * @name Phaser.GameObjects.Particles.Zones.DeathZone#source\r\n * @type {Phaser.Types.GameObjects.Particles.DeathZoneSource}\r\n * @since 3.0.0\r\n */\r\n this.source = source;\r\n\r\n /**\r\n * Set to `true` if the Particle should be killed if it enters this zone.\r\n * Set to `false` to kill the Particle if it leaves this zone.\r\n *\r\n * @name Phaser.GameObjects.Particles.Zones.DeathZone#killOnEnter\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.killOnEnter = killOnEnter;\r\n },\r\n\r\n /**\r\n * Checks if the given Particle will be killed or not by this zone.\r\n *\r\n * @method Phaser.GameObjects.Particles.Zones.DeathZone#willKill\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Particles.Particle} particle - The Particle to be checked against this zone.\r\n *\r\n * @return {boolean} Return `true` if the Particle is to be killed, otherwise return `false`.\r\n */\r\n willKill: function (particle)\r\n {\r\n var withinZone = this.source.contains(particle.x, particle.y);\r\n\r\n return (withinZone && this.killOnEnter || !withinZone && !this.killOnEnter);\r\n }\r\n\r\n});\r\n\r\nmodule.exports = DeathZone;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/particles/zones/DeathZone.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/particles/zones/EdgeZone.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/particles/zones/EdgeZone.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A zone that places particles on a shape's edges.\r\n *\r\n * @class EdgeZone\r\n * @memberof Phaser.GameObjects.Particles.Zones\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.EdgeZoneSource} source - An object instance with a `getPoints(quantity, stepRate)` method returning an array of points.\r\n * @param {integer} quantity - The number of particles to place on the source edge. Set to 0 to use `stepRate` instead.\r\n * @param {number} stepRate - The distance between each particle. When set, `quantity` is implied and should be set to 0.\r\n * @param {boolean} [yoyo=false] - Whether particles are placed from start to end and then end to start.\r\n * @param {boolean} [seamless=true] - Whether one endpoint will be removed if it's identical to the other.\r\n */\r\nvar EdgeZone = new Class({\r\n\r\n initialize:\r\n\r\n function EdgeZone (source, quantity, stepRate, yoyo, seamless)\r\n {\r\n if (yoyo === undefined) { yoyo = false; }\r\n if (seamless === undefined) { seamless = true; }\r\n\r\n /**\r\n * An object instance with a `getPoints(quantity, stepRate)` method returning an array of points.\r\n *\r\n * @name Phaser.GameObjects.Particles.Zones.EdgeZone#source\r\n * @type {Phaser.Types.GameObjects.Particles.EdgeZoneSource|Phaser.Types.GameObjects.Particles.RandomZoneSource}\r\n * @since 3.0.0\r\n */\r\n this.source = source;\r\n\r\n /**\r\n * The points placed on the source edge.\r\n *\r\n * @name Phaser.GameObjects.Particles.Zones.EdgeZone#points\r\n * @type {Phaser.Geom.Point[]}\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.points = [];\r\n\r\n /**\r\n * The number of particles to place on the source edge. Set to 0 to use `stepRate` instead.\r\n *\r\n * @name Phaser.GameObjects.Particles.Zones.EdgeZone#quantity\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.quantity = quantity;\r\n\r\n /**\r\n * The distance between each particle. When set, `quantity` is implied and should be set to 0.\r\n *\r\n * @name Phaser.GameObjects.Particles.Zones.EdgeZone#stepRate\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.stepRate = stepRate;\r\n\r\n /**\r\n * Whether particles are placed from start to end and then end to start.\r\n *\r\n * @name Phaser.GameObjects.Particles.Zones.EdgeZone#yoyo\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.yoyo = yoyo;\r\n\r\n /**\r\n * The counter used for iterating the EdgeZone's points.\r\n *\r\n * @name Phaser.GameObjects.Particles.Zones.EdgeZone#counter\r\n * @type {number}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.counter = -1;\r\n\r\n /**\r\n * Whether one endpoint will be removed if it's identical to the other.\r\n *\r\n * @name Phaser.GameObjects.Particles.Zones.EdgeZone#seamless\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.seamless = seamless;\r\n\r\n /**\r\n * An internal count of the points belonging to this EdgeZone.\r\n *\r\n * @name Phaser.GameObjects.Particles.Zones.EdgeZone#_length\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._length = 0;\r\n\r\n /**\r\n * An internal value used to keep track of the current iteration direction for the EdgeZone's points.\r\n *\r\n * 0 = forwards, 1 = backwards\r\n *\r\n * @name Phaser.GameObjects.Particles.Zones.EdgeZone#_direction\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._direction = 0;\r\n\r\n this.updateSource();\r\n },\r\n\r\n /**\r\n * Update the {@link Phaser.GameObjects.Particles.Zones.EdgeZone#points} from the EdgeZone's\r\n * {@link Phaser.GameObjects.Particles.Zones.EdgeZone#source}.\r\n *\r\n * Also updates internal properties.\r\n *\r\n * @method Phaser.GameObjects.Particles.Zones.EdgeZone#updateSource\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Particles.Zones.EdgeZone} This Edge Zone.\r\n */\r\n updateSource: function ()\r\n {\r\n this.points = this.source.getPoints(this.quantity, this.stepRate);\r\n\r\n // Remove ends?\r\n if (this.seamless)\r\n {\r\n var a = this.points[0];\r\n var b = this.points[this.points.length - 1];\r\n\r\n if (a.x === b.x && a.y === b.y)\r\n {\r\n this.points.pop();\r\n }\r\n }\r\n\r\n var oldLength = this._length;\r\n\r\n this._length = this.points.length;\r\n\r\n // Adjust counter if we now have less points than before\r\n if (this._length < oldLength && this.counter > this._length)\r\n {\r\n this.counter = this._length - 1;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Change the source of the EdgeZone.\r\n *\r\n * @method Phaser.GameObjects.Particles.Zones.EdgeZone#changeSource\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.EdgeZoneSource} source - An object instance with a `getPoints(quantity, stepRate)` method returning an array of points.\r\n *\r\n * @return {Phaser.GameObjects.Particles.Zones.EdgeZone} This Edge Zone.\r\n */\r\n changeSource: function (source)\r\n {\r\n this.source = source;\r\n\r\n return this.updateSource();\r\n },\r\n\r\n /**\r\n * Get the next point in the Zone and set its coordinates on the given Particle.\r\n *\r\n * @method Phaser.GameObjects.Particles.Zones.EdgeZone#getPoint\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Particles.Particle} particle - The Particle.\r\n */\r\n getPoint: function (particle)\r\n {\r\n if (this._direction === 0)\r\n {\r\n this.counter++;\r\n\r\n if (this.counter >= this._length)\r\n {\r\n if (this.yoyo)\r\n {\r\n this._direction = 1;\r\n this.counter = this._length - 1;\r\n }\r\n else\r\n {\r\n this.counter = 0;\r\n }\r\n }\r\n }\r\n else\r\n {\r\n this.counter--;\r\n\r\n if (this.counter === -1)\r\n {\r\n if (this.yoyo)\r\n {\r\n this._direction = 0;\r\n this.counter = 0;\r\n }\r\n else\r\n {\r\n this.counter = this._length - 1;\r\n }\r\n }\r\n }\r\n\r\n var point = this.points[this.counter];\r\n\r\n if (point)\r\n {\r\n particle.x = point.x;\r\n particle.y = point.y;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = EdgeZone;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/particles/zones/EdgeZone.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/particles/zones/RandomZone.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/particles/zones/RandomZone.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A zone that places particles randomly within a shape's area.\r\n *\r\n * @class RandomZone\r\n * @memberof Phaser.GameObjects.Particles.Zones\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Particles.RandomZoneSource} source - An object instance with a `getRandomPoint(point)` method.\r\n */\r\nvar RandomZone = new Class({\r\n\r\n initialize:\r\n\r\n function RandomZone (source)\r\n {\r\n /**\r\n * An object instance with a `getRandomPoint(point)` method.\r\n *\r\n * @name Phaser.GameObjects.Particles.Zones.RandomZone#source\r\n * @type {Phaser.Types.GameObjects.Particles.RandomZoneSource}\r\n * @since 3.0.0\r\n */\r\n this.source = source;\r\n\r\n /**\r\n * Internal calculation vector.\r\n *\r\n * @name Phaser.GameObjects.Particles.Zones.RandomZone#_tempVec\r\n * @type {Phaser.Math.Vector2}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._tempVec = new Vector2();\r\n },\r\n\r\n /**\r\n * Get the next point in the Zone and set its coordinates on the given Particle.\r\n *\r\n * @method Phaser.GameObjects.Particles.Zones.RandomZone#getPoint\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Particles.Particle} particle - The Particle.\r\n */\r\n getPoint: function (particle)\r\n {\r\n var vec = this._tempVec;\r\n\r\n this.source.getRandomPoint(vec);\r\n\r\n particle.x = vec.x;\r\n particle.y = vec.y;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = RandomZone;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/particles/zones/RandomZone.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/particles/zones/index.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/particles/zones/index.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.GameObjects.Particles.Zones\r\n */\r\n\r\nmodule.exports = {\r\n\r\n DeathZone: __webpack_require__(/*! ./DeathZone */ \"./node_modules/phaser/src/gameobjects/particles/zones/DeathZone.js\"),\r\n EdgeZone: __webpack_require__(/*! ./EdgeZone */ \"./node_modules/phaser/src/gameobjects/particles/zones/EdgeZone.js\"),\r\n RandomZone: __webpack_require__(/*! ./RandomZone */ \"./node_modules/phaser/src/gameobjects/particles/zones/RandomZone.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/particles/zones/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/pathfollower/PathFollower.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/pathfollower/PathFollower.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar Sprite = __webpack_require__(/*! ../sprite/Sprite */ \"./node_modules/phaser/src/gameobjects/sprite/Sprite.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A PathFollower Game Object.\r\n *\r\n * A PathFollower is a Sprite Game Object with some extra helpers to allow it to follow a Path automatically.\r\n *\r\n * Anything you can do with a standard Sprite can be done with this PathFollower, such as animate it, tint it,\r\n * scale it and so on.\r\n *\r\n * PathFollowers are bound to a single Path at any one time and can traverse the length of the Path, from start\r\n * to finish, forwards or backwards, or from any given point on the Path to its end. They can optionally rotate\r\n * to face the direction of the path, be offset from the path coordinates or rotate independently of the Path.\r\n *\r\n * @class PathFollower\r\n * @extends Phaser.GameObjects.Sprite\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n * \r\n * @extends Phaser.GameObjects.Components.PathFollower\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this PathFollower belongs.\r\n * @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n */\r\nvar PathFollower = new Class({\r\n\r\n Extends: Sprite,\r\n\r\n Mixins: [\r\n Components.PathFollower\r\n ],\r\n\r\n initialize:\r\n\r\n function PathFollower (scene, path, x, y, texture, frame)\r\n {\r\n Sprite.call(this, scene, x, y, texture, frame);\r\n\r\n this.path = path;\r\n },\r\n\r\n /**\r\n * Internal update handler that advances this PathFollower along the path.\r\n *\r\n * Called automatically by the Scene step, should not typically be called directly.\r\n *\r\n * @method Phaser.GameObjects.PathFollower#preUpdate\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n preUpdate: function (time, delta)\r\n {\r\n this.anims.update(time, delta);\r\n this.pathUpdate(time);\r\n }\r\n\r\n});\r\n\r\nmodule.exports = PathFollower;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/pathfollower/PathFollower.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/pathfollower/PathFollowerFactory.js": /*!*********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/pathfollower/PathFollowerFactory.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar PathFollower = __webpack_require__(/*! ./PathFollower */ \"./node_modules/phaser/src/gameobjects/pathfollower/PathFollower.js\");\r\n\r\n/**\r\n * Creates a new PathFollower Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the PathFollower Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#follower\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Curves.Path} path - The Path this PathFollower is connected to.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n *\r\n * @return {Phaser.GameObjects.PathFollower} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('follower', function (path, x, y, key, frame)\r\n{\r\n var sprite = new PathFollower(this.scene, path, x, y, key, frame);\r\n\r\n this.displayList.add(sprite);\r\n this.updateList.add(sprite);\r\n\r\n return sprite;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/pathfollower/PathFollowerFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/quad/Quad.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/quad/Quad.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Mesh = __webpack_require__(/*! ../mesh/Mesh */ \"./node_modules/phaser/src/gameobjects/mesh/Mesh.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Quad Game Object.\r\n *\r\n * A Quad is a Mesh Game Object pre-configured with two triangles arranged into a rectangle, with a single\r\n * texture spread across them.\r\n *\r\n * You can manipulate the corner points of the quad via the getters and setters such as `topLeftX`, and also\r\n * change their alpha and color values. The quad itself can be moved by adjusting the `x` and `y` properties.\r\n *\r\n * @class Quad\r\n * @extends Phaser.GameObjects.Mesh\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @webglOnly\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Quad belongs.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n */\r\nvar Quad = new Class({\r\n\r\n Extends: Mesh,\r\n\r\n initialize:\r\n\r\n function Quad (scene, x, y, texture, frame)\r\n {\r\n // 0----3\r\n // |\\ B|\r\n // | \\ |\r\n // | \\ |\r\n // | A \\|\r\n // | \\\r\n // 1----2\r\n\r\n var vertices = [\r\n 0, 0, // tl\r\n 0, 0, // bl\r\n 0, 0, // br\r\n 0, 0, // tl\r\n 0, 0, // br\r\n 0, 0 // tr\r\n ];\r\n\r\n var uv = [\r\n 0, 0, // tl\r\n 0, 1, // bl\r\n 1, 1, // br\r\n 0, 0, // tl\r\n 1, 1, // br\r\n 1, 0 // tr\r\n ];\r\n\r\n var colors = [\r\n 0xffffff, // tl\r\n 0xffffff, // bl\r\n 0xffffff, // br\r\n 0xffffff, // tl\r\n 0xffffff, // br\r\n 0xffffff // tr\r\n ];\r\n\r\n var alphas = [\r\n 1, // tl\r\n 1, // bl\r\n 1, // br\r\n 1, // tl\r\n 1, // br\r\n 1 // tr\r\n ];\r\n\r\n Mesh.call(this, scene, x, y, vertices, uv, colors, alphas, texture, frame);\r\n\r\n this.resetPosition();\r\n },\r\n\r\n /**\r\n * Sets the frame this Game Object will use to render with.\r\n *\r\n * The Frame has to belong to the current Texture being used.\r\n *\r\n * It can be either a string or an index.\r\n *\r\n * Calling `setFrame` will modify the `width` and `height` properties of your Game Object.\r\n * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer.\r\n *\r\n * @method Phaser.GameObjects.Quad#setFrame\r\n * @since 3.11.0\r\n *\r\n * @param {(string|integer)} frame - The name or index of the frame within the Texture.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setFrame: function (frame)\r\n {\r\n this.frame = this.texture.get(frame);\r\n\r\n if (!this.frame.cutWidth || !this.frame.cutHeight)\r\n {\r\n this.renderFlags &= ~8;\r\n }\r\n else\r\n {\r\n this.renderFlags |= 8;\r\n }\r\n\r\n frame = this.frame;\r\n\r\n // TL\r\n this.uv[0] = frame.u0;\r\n this.uv[1] = frame.v0;\r\n\r\n // BL\r\n this.uv[2] = frame.u0;\r\n this.uv[3] = frame.v1;\r\n\r\n // BR\r\n this.uv[4] = frame.u1;\r\n this.uv[5] = frame.v1;\r\n\r\n // TL\r\n this.uv[6] = frame.u0;\r\n this.uv[7] = frame.v0;\r\n\r\n // BR\r\n this.uv[8] = frame.u1;\r\n this.uv[9] = frame.v1;\r\n\r\n // TR\r\n this.uv[10] = frame.u1;\r\n this.uv[11] = frame.v0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The top-left x vertex of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#topLeftX\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n topLeftX: {\r\n\r\n get: function ()\r\n {\r\n return this.x + this.vertices[0];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.vertices[0] = value - this.x;\r\n this.vertices[6] = value - this.x;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The top-left y vertex of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#topLeftY\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n topLeftY: {\r\n\r\n get: function ()\r\n {\r\n return this.y + this.vertices[1];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.vertices[1] = value - this.y;\r\n this.vertices[7] = value - this.y;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The top-right x vertex of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#topRightX\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n topRightX: {\r\n\r\n get: function ()\r\n {\r\n return this.x + this.vertices[10];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.vertices[10] = value - this.x;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The top-right y vertex of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#topRightY\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n topRightY: {\r\n\r\n get: function ()\r\n {\r\n return this.y + this.vertices[11];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.vertices[11] = value - this.y;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The bottom-left x vertex of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#bottomLeftX\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bottomLeftX: {\r\n\r\n get: function ()\r\n {\r\n return this.x + this.vertices[2];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.vertices[2] = value - this.x;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The bottom-left y vertex of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#bottomLeftY\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bottomLeftY: {\r\n\r\n get: function ()\r\n {\r\n return this.y + this.vertices[3];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.vertices[3] = value - this.y;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The bottom-right x vertex of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#bottomRightX\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bottomRightX: {\r\n\r\n get: function ()\r\n {\r\n return this.x + this.vertices[4];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.vertices[4] = value - this.x;\r\n this.vertices[8] = value - this.x;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The bottom-right y vertex of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#bottomRightY\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bottomRightY: {\r\n\r\n get: function ()\r\n {\r\n return this.y + this.vertices[5];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.vertices[5] = value - this.y;\r\n this.vertices[9] = value - this.y;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The top-left alpha value of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#topLeftAlpha\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n topLeftAlpha: {\r\n\r\n get: function ()\r\n {\r\n return this.alphas[0];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.alphas[0] = value;\r\n this.alphas[3] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The top-right alpha value of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#topRightAlpha\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n topRightAlpha: {\r\n\r\n get: function ()\r\n {\r\n return this.alphas[5];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.alphas[5] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The bottom-left alpha value of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#bottomLeftAlpha\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bottomLeftAlpha: {\r\n\r\n get: function ()\r\n {\r\n return this.alphas[1];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.alphas[1] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The bottom-right alpha value of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#bottomRightAlpha\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bottomRightAlpha: {\r\n\r\n get: function ()\r\n {\r\n return this.alphas[2];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.alphas[2] = value;\r\n this.alphas[4] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The top-left color value of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#topLeftColor\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n topLeftColor: {\r\n\r\n get: function ()\r\n {\r\n return this.colors[0];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.colors[0] = value;\r\n this.colors[3] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The top-right color value of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#topRightColor\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n topRightColor: {\r\n\r\n get: function ()\r\n {\r\n return this.colors[5];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.colors[5] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The bottom-left color value of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#bottomLeftColor\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bottomLeftColor: {\r\n\r\n get: function ()\r\n {\r\n return this.colors[1];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.colors[1] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The bottom-right color value of this Quad.\r\n *\r\n * @name Phaser.GameObjects.Quad#bottomRightColor\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bottomRightColor: {\r\n\r\n get: function ()\r\n {\r\n return this.colors[2];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.colors[2] = value;\r\n this.colors[4] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the top-left vertex position of this Quad.\r\n *\r\n * @method Phaser.GameObjects.Quad#setTopLeft\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal coordinate of the vertex.\r\n * @param {number} y - The vertical coordinate of the vertex.\r\n *\r\n * @return {Phaser.GameObjects.Quad} This Game Object.\r\n */\r\n setTopLeft: function (x, y)\r\n {\r\n this.topLeftX = x;\r\n this.topLeftY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the top-right vertex position of this Quad.\r\n *\r\n * @method Phaser.GameObjects.Quad#setTopRight\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal coordinate of the vertex.\r\n * @param {number} y - The vertical coordinate of the vertex.\r\n *\r\n * @return {Phaser.GameObjects.Quad} This Game Object.\r\n */\r\n setTopRight: function (x, y)\r\n {\r\n this.topRightX = x;\r\n this.topRightY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the bottom-left vertex position of this Quad.\r\n *\r\n * @method Phaser.GameObjects.Quad#setBottomLeft\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal coordinate of the vertex.\r\n * @param {number} y - The vertical coordinate of the vertex.\r\n *\r\n * @return {Phaser.GameObjects.Quad} This Game Object.\r\n */\r\n setBottomLeft: function (x, y)\r\n {\r\n this.bottomLeftX = x;\r\n this.bottomLeftY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the bottom-right vertex position of this Quad.\r\n *\r\n * @method Phaser.GameObjects.Quad#setBottomRight\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal coordinate of the vertex.\r\n * @param {number} y - The vertical coordinate of the vertex.\r\n *\r\n * @return {Phaser.GameObjects.Quad} This Game Object.\r\n */\r\n setBottomRight: function (x, y)\r\n {\r\n this.bottomRightX = x;\r\n this.bottomRightY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the positions of the four corner vertices of this Quad.\r\n *\r\n * @method Phaser.GameObjects.Quad#resetPosition\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Quad} This Game Object.\r\n */\r\n resetPosition: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var halfWidth = Math.floor(this.width / 2);\r\n var halfHeight = Math.floor(this.height / 2);\r\n\r\n this.setTopLeft(x - halfWidth, y - halfHeight);\r\n this.setTopRight(x + halfWidth, y - halfHeight);\r\n this.setBottomLeft(x - halfWidth, y + halfHeight);\r\n this.setBottomRight(x + halfWidth, y + halfHeight);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the alpha values used by this Quad back to 1.\r\n *\r\n * @method Phaser.GameObjects.Quad#resetAlpha\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Quad} This Game Object.\r\n */\r\n resetAlpha: function ()\r\n {\r\n var alphas = this.alphas;\r\n\r\n alphas[0] = 1;\r\n alphas[1] = 1;\r\n alphas[2] = 1;\r\n alphas[3] = 1;\r\n alphas[4] = 1;\r\n alphas[5] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the color values used by this Quad back to 0xffffff.\r\n *\r\n * @method Phaser.GameObjects.Quad#resetColors\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Quad} This Game Object.\r\n */\r\n resetColors: function ()\r\n {\r\n var colors = this.colors;\r\n\r\n colors[0] = 0xffffff;\r\n colors[1] = 0xffffff;\r\n colors[2] = 0xffffff;\r\n colors[3] = 0xffffff;\r\n colors[4] = 0xffffff;\r\n colors[5] = 0xffffff;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the position, alpha and color values used by this Quad.\r\n *\r\n * @method Phaser.GameObjects.Quad#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Quad} This Game Object.\r\n */\r\n reset: function ()\r\n {\r\n this.resetPosition();\r\n\r\n this.resetAlpha();\r\n\r\n return this.resetColors();\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Quad;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/quad/Quad.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/quad/QuadCreator.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/quad/QuadCreator.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BuildGameObject = __webpack_require__(/*! ../BuildGameObject */ \"./node_modules/phaser/src/gameobjects/BuildGameObject.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar Quad = __webpack_require__(/*! ./Quad */ \"./node_modules/phaser/src/gameobjects/quad/Quad.js\");\r\n\r\n/**\r\n * Creates a new Quad Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#quad\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {Phaser.GameObjects.Quad} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('quad', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n var x = GetAdvancedValue(config, 'x', 0);\r\n var y = GetAdvancedValue(config, 'y', 0);\r\n var key = GetAdvancedValue(config, 'key', null);\r\n var frame = GetAdvancedValue(config, 'frame', null);\r\n\r\n var quad = new Quad(this.scene, x, y, key, frame);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, quad, config);\r\n\r\n return quad;\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/quad/QuadCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/quad/QuadFactory.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/quad/QuadFactory.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Quad = __webpack_require__(/*! ./Quad */ \"./node_modules/phaser/src/gameobjects/quad/Quad.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Quad Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#quad\r\n * @webglOnly\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n * \r\n * @return {Phaser.GameObjects.Quad} The Game Object that was created.\r\n */\r\nif (true)\r\n{\r\n GameObjectFactory.register('quad', function (x, y, key, frame)\r\n {\r\n return this.displayList.add(new Quad(this.scene, x, y, key, frame));\r\n });\r\n}\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n// \r\n// There are several properties available to use:\r\n// \r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/quad/QuadFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/rendertexture/RenderTexture.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/rendertexture/RenderTexture.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BlendModes = __webpack_require__(/*! ../../renderer/BlendModes */ \"./node_modules/phaser/src/renderer/BlendModes.js\");\r\nvar Camera = __webpack_require__(/*! ../../cameras/2d/BaseCamera */ \"./node_modules/phaser/src/cameras/2d/BaseCamera.js\");\r\nvar CanvasPool = __webpack_require__(/*! ../../display/canvas/CanvasPool */ \"./node_modules/phaser/src/display/canvas/CanvasPool.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar CONST = __webpack_require__(/*! ../../const */ \"./node_modules/phaser/src/const.js\");\r\nvar Frame = __webpack_require__(/*! ../../textures/Frame */ \"./node_modules/phaser/src/textures/Frame.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar Render = __webpack_require__(/*! ./RenderTextureRender */ \"./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureRender.js\");\r\nvar Utils = __webpack_require__(/*! ../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\nvar UUID = __webpack_require__(/*! ../../utils/string/UUID */ \"./node_modules/phaser/src/utils/string/UUID.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Render Texture.\r\n * \r\n * A Render Texture is a special texture that allows any number of Game Objects to be drawn to it. You can take many complex objects and\r\n * draw them all to this one texture, which can they be used as the texture for other Game Object's. It's a way to generate dynamic\r\n * textures at run-time that are WebGL friendly and don't invoke expensive GPU uploads.\r\n * \r\n * Note that under WebGL a FrameBuffer, which is what the Render Texture uses internally, cannot be anti-aliased. This means\r\n * that when drawing objects such as Shapes to a Render Texture they will appear to be drawn with no aliasing, however this\r\n * is a technical limitation of WebGL. To get around it, create your shape as a texture in an art package, then draw that\r\n * to the Render Texture.\r\n *\r\n * @class RenderTexture\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.2.0\r\n *\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.ComputedSize\r\n * @extends Phaser.GameObjects.Components.Crop\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Tint\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {integer} [width=32] - The width of the Render Texture.\r\n * @param {integer} [height=32] - The height of the Render Texture.\r\n * @property {string} [key] - The texture key to make the RenderTexture from.\r\n * @property {string} [frame] - the frame to make the RenderTexture from.\r\n */\r\nvar RenderTexture = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.Alpha,\r\n Components.BlendMode,\r\n Components.ComputedSize,\r\n Components.Crop,\r\n Components.Depth,\r\n Components.Flip,\r\n Components.GetBounds,\r\n Components.Mask,\r\n Components.Origin,\r\n Components.Pipeline,\r\n Components.ScrollFactor,\r\n Components.Tint,\r\n Components.Transform,\r\n Components.Visible,\r\n Render\r\n ],\r\n\r\n initialize:\r\n\r\n function RenderTexture (scene, x, y, width, height, key, frame)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = 32; }\r\n if (height === undefined) { height = 32; }\r\n\r\n GameObject.call(this, scene, 'RenderTexture');\r\n\r\n /**\r\n * A reference to either the Canvas or WebGL Renderer that the Game instance is using.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#renderer\r\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\r\n * @since 3.2.0\r\n */\r\n this.renderer = scene.sys.game.renderer;\r\n\r\n /**\r\n * A reference to the Texture Manager.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#textureManager\r\n * @type {Phaser.Textures.TextureManager}\r\n * @since 3.12.0\r\n */\r\n this.textureManager = scene.sys.textures;\r\n\r\n /**\r\n * The tint of the Render Texture when rendered.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#globalTint\r\n * @type {number}\r\n * @default 0xffffff\r\n * @since 3.2.0\r\n */\r\n this.globalTint = 0xffffff;\r\n\r\n /**\r\n * The alpha of the Render Texture when rendered.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#globalAlpha\r\n * @type {number}\r\n * @default 1\r\n * @since 3.2.0\r\n */\r\n this.globalAlpha = 1;\r\n\r\n /**\r\n * The HTML Canvas Element that the Render Texture is drawing to when using the Canvas Renderer.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#canvas\r\n * @type {HTMLCanvasElement}\r\n * @since 3.2.0\r\n */\r\n this.canvas = null;\r\n\r\n /**\r\n * A reference to the GL Frame Buffer this Render Texture is drawing to.\r\n * This is only set if Phaser is running with the WebGL Renderer.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#framebuffer\r\n * @type {?WebGLFramebuffer}\r\n * @since 3.2.0\r\n */\r\n this.framebuffer = null;\r\n\r\n /**\r\n * Is this Render Texture dirty or not? If not it won't spend time clearing or filling itself.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#dirty\r\n * @type {boolean}\r\n * @since 3.12.0\r\n */\r\n this.dirty = false;\r\n\r\n /**\r\n * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#_crop\r\n * @type {object}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._crop = this.resetCropObject();\r\n\r\n /**\r\n * The Texture corresponding to this Render Texture.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#texture\r\n * @type {Phaser.Textures.Texture}\r\n * @since 3.12.0\r\n */\r\n this.texture = null;\r\n\r\n /**\r\n * The Frame corresponding to this Render Texture.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#frame\r\n * @type {Phaser.Textures.Frame}\r\n * @since 3.12.0\r\n */\r\n this.frame = null;\r\n\r\n /**\r\n * Internal saved texture flag.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#_saved\r\n * @type {boolean}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._saved = false;\r\n\r\n if (key === undefined)\r\n {\r\n this.canvas = CanvasPool.create2D(this, width, height);\r\n\r\n // Create a new Texture for this Text object\r\n this.texture = scene.sys.textures.addCanvas(UUID(), this.canvas);\r\n \r\n // Get the frame\r\n this.frame = this.texture.get();\r\n }\r\n else\r\n {\r\n this.texture = scene.sys.textures.get(key);\r\n \r\n // Get the frame\r\n this.frame = this.texture.get(frame);\r\n\r\n this.canvas = this.frame.source.image;\r\n this._saved = true;\r\n\r\n this.dirty = true;\r\n\r\n this.width = this.frame.cutWidth;\r\n this.height = this.frame.cutHeight;\r\n }\r\n\r\n /**\r\n * A reference to the Rendering Context belonging to the Canvas Element this Render Texture is drawing to.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#context\r\n * @type {CanvasRenderingContext2D}\r\n * @since 3.2.0\r\n */\r\n this.context = this.canvas.getContext('2d');\r\n\r\n /**\r\n * Internal erase mode flag.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#_eraseMode\r\n * @type {boolean}\r\n * @private\r\n * @since 3.16.0\r\n */\r\n this._eraseMode = false;\r\n\r\n /**\r\n * An internal Camera that can be used to move around the Render Texture.\r\n * Control it just like you would any Scene Camera. The difference is that it only impacts the placement of what\r\n * is drawn to the Render Texture. You can scroll, zoom and rotate this Camera.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#camera\r\n * @type {Phaser.Cameras.Scene2D.BaseCamera}\r\n * @since 3.12.0\r\n */\r\n this.camera = new Camera(0, 0, width, height);\r\n\r\n /**\r\n * A reference to the WebGL Rendering Context.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#gl\r\n * @type {WebGLRenderingContext}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.gl = null;\r\n\r\n /**\r\n * A reference to the WebGLTexture that is being rendered to in a WebGL Context.\r\n *\r\n * @name Phaser.GameObjects.RenderTexture#glTexture\r\n * @type {WebGLTexture}\r\n * @default null\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.glTexture = null;\r\n\r\n var renderer = this.renderer;\r\n\r\n if (renderer.type === CONST.WEBGL)\r\n {\r\n var gl = renderer.gl;\r\n\r\n this.gl = gl;\r\n this.glTexture = this.frame.source.glTexture;\r\n this.drawGameObject = this.batchGameObjectWebGL;\r\n this.framebuffer = renderer.createFramebuffer(width, height, this.glTexture, false);\r\n }\r\n else if (renderer.type === CONST.CANVAS)\r\n {\r\n this.drawGameObject = this.batchGameObjectCanvas;\r\n }\r\n\r\n this.camera.setScene(scene);\r\n\r\n this.setPosition(x, y);\r\n\r\n if (key === undefined)\r\n {\r\n this.setSize(width, height);\r\n }\r\n\r\n this.setOrigin(0, 0);\r\n this.initPipeline();\r\n },\r\n\r\n /**\r\n * Sets the size of this Game Object.\r\n * \r\n * @method Phaser.GameObjects.RenderTexture#setSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setSize: function (width, height)\r\n {\r\n return this.resize(width, height);\r\n },\r\n\r\n /**\r\n * Resizes the Render Texture to the new dimensions given.\r\n * \r\n * If Render Texture was created from specific frame, only the size of the frame will be changed. The size of the source\r\n * texture will not change.\r\n *\r\n * If Render Texture was not created from specific frame, the following will happen:\r\n * In WebGL it will destroy and then re-create the frame buffer being used by the Render Texture.\r\n * In Canvas it will resize the underlying canvas element.\r\n * Both approaches will erase everything currently drawn to the Render Texture.\r\n *\r\n * If the dimensions given are the same as those already being used, calling this method will do nothing.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#resize\r\n * @since 3.10.0\r\n *\r\n * @param {number} width - The new width of the Render Texture.\r\n * @param {number} [height=width] - The new height of the Render Texture. If not specified, will be set the same as the `width`.\r\n *\r\n * @return {this} This Render Texture.\r\n */\r\n resize: function (width, height)\r\n {\r\n if (height === undefined) { height = width; }\r\n\r\n if (width !== this.width || height !== this.height)\r\n {\r\n if (this.frame.name === '__BASE')\r\n {\r\n // Resize the texture\r\n\r\n this.canvas.width = width;\r\n this.canvas.height = height;\r\n \r\n this.texture.width = width;\r\n this.texture.height = height;\r\n \r\n if (this.gl)\r\n {\r\n var gl = this.gl;\r\n\r\n this.renderer.deleteTexture(this.frame.source.glTexture);\r\n this.renderer.deleteFramebuffer(this.framebuffer);\r\n\r\n var glTexture = this.renderer.createTexture2D(0, gl.NEAREST, gl.NEAREST, gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.RGBA, null, width, height, false);\r\n\r\n this.framebuffer = this.renderer.createFramebuffer(width, height, glTexture, false);\r\n\r\n this.frame.source.isRenderTexture = true;\r\n\r\n this.frame.glTexture = glTexture;\r\n this.glTexture = glTexture;\r\n }\r\n\r\n this.frame.source.width = width;\r\n this.frame.source.height = height;\r\n\r\n this.camera.setSize(width, height);\r\n\r\n this.frame.setSize(width, height);\r\n\r\n this.width = width;\r\n this.height = height;\r\n }\r\n }\r\n else\r\n {\r\n // Resize the frame\r\n\r\n var baseFrame = this.texture.getSourceImage();\r\n\r\n if (this.frame.cutX + width > baseFrame.width)\r\n {\r\n width = baseFrame.width - this.frame.cutX;\r\n }\r\n\r\n if (this.frame.cutY + height > baseFrame.height)\r\n {\r\n height = baseFrame.height - this.frame.cutY;\r\n }\r\n\r\n this.frame.setSize(width, height, this.frame.cutX, this.frame.cutY);\r\n }\r\n\r\n this.updateDisplayOrigin();\r\n\r\n var input = this.input;\r\n\r\n if (input && !input.customHitArea)\r\n {\r\n input.hitArea.width = width;\r\n input.hitArea.height = height;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the tint to use when rendering this Render Texture.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#setGlobalTint\r\n * @since 3.2.0\r\n *\r\n * @param {integer} tint - The tint value.\r\n *\r\n * @return {this} This Render Texture.\r\n */\r\n setGlobalTint: function (tint)\r\n {\r\n this.globalTint = tint;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the alpha to use when rendering this Render Texture.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#setGlobalAlpha\r\n * @since 3.2.0\r\n *\r\n * @param {number} alpha - The alpha value.\r\n *\r\n * @return {this} This Render Texture.\r\n */\r\n setGlobalAlpha: function (alpha)\r\n {\r\n this.globalAlpha = alpha;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stores a copy of this Render Texture in the Texture Manager using the given key.\r\n * \r\n * After doing this, any texture based Game Object, such as a Sprite, can use the contents of this\r\n * Render Texture by using the texture key:\r\n * \r\n * ```javascript\r\n * var rt = this.add.renderTexture(0, 0, 128, 128);\r\n * \r\n * // Draw something to the Render Texture\r\n * \r\n * rt.saveTexture('doodle');\r\n * \r\n * this.add.image(400, 300, 'doodle');\r\n * ```\r\n * \r\n * Updating the contents of this Render Texture will automatically update _any_ Game Object\r\n * that is using it as a texture. Calling `saveTexture` again will not save another copy\r\n * of the same texture, it will just rename the key of the existing copy.\r\n * \r\n * By default it will create a single base texture. You can add frames to the texture\r\n * by using the `Texture.add` method. After doing this, you can then allow Game Objects\r\n * to use a specific frame from a Render Texture.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#saveTexture\r\n * @since 3.12.0\r\n *\r\n * @param {string} key - The unique key to store the texture as within the global Texture Manager.\r\n *\r\n * @return {Phaser.Textures.Texture} The Texture that was saved.\r\n */\r\n saveTexture: function (key)\r\n {\r\n this.textureManager.renameTexture(this.texture.key, key);\r\n \r\n this._saved = true;\r\n\r\n return this.texture;\r\n },\r\n\r\n /**\r\n * Fills the Render Texture with the given color.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#fill\r\n * @since 3.2.0\r\n *\r\n * @param {number} rgb - The color to fill the Render Texture with.\r\n * @param {number} [alpha=1] - The alpha value used by the fill.\r\n * @param {number} [x=0] - The left coordinate of the fill rectangle.\r\n * @param {number} [y=0] - The top coordinate of the fill rectangle.\r\n * @param {number} [width=this.frame.cutWidth] - The width of the fill rectangle.\r\n * @param {number} [height=this.frame.cutHeight] - The height of the fill rectangle.\r\n *\r\n * @return {this} This Render Texture instance.\r\n */\r\n fill: function (rgb, alpha, x, y, width, height)\r\n {\r\n if (alpha === undefined) { alpha = 1; }\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = this.frame.cutWidth; }\r\n if (height === undefined) { height = this.frame.cutHeight; }\r\n\r\n var r = ((rgb >> 16) | 0) & 0xff;\r\n var g = ((rgb >> 8) | 0) & 0xff;\r\n var b = (rgb | 0) & 0xff;\r\n\r\n var gl = this.gl;\r\n var frame = this.frame;\r\n\r\n this.camera.preRender(1, 1);\r\n\r\n if (gl)\r\n {\r\n var cx = this.camera._cx;\r\n var cy = this.camera._cy;\r\n var cw = this.camera._cw;\r\n var ch = this.camera._ch;\r\n\r\n this.renderer.setFramebuffer(this.framebuffer, false);\r\n\r\n this.renderer.pushScissor(cx, cy, cw, ch, ch);\r\n\r\n var pipeline = this.pipeline;\r\n \r\n pipeline.projOrtho(0, this.texture.width, 0, this.texture.height, -1000.0, 1000.0);\r\n\r\n pipeline.drawFillRect(\r\n x, y, width, height,\r\n Utils.getTintFromFloats(r / 255, g / 255, b / 255, 1),\r\n alpha\r\n );\r\n\r\n this.renderer.setFramebuffer(null, false);\r\n\r\n this.renderer.popScissor();\r\n\r\n pipeline.projOrtho(0, pipeline.width, pipeline.height, 0, -1000.0, 1000.0);\r\n }\r\n else\r\n {\r\n this.renderer.setContext(this.context);\r\n\r\n this.context.fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + alpha + ')';\r\n this.context.fillRect(x + frame.cutX, y + frame.cutY, width, height);\r\n\r\n this.renderer.setContext();\r\n }\r\n\r\n this.dirty = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Clears the Render Texture.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#clear\r\n * @since 3.2.0\r\n *\r\n * @return {this} This Render Texture instance.\r\n */\r\n clear: function ()\r\n {\r\n if (this.dirty)\r\n {\r\n var gl = this.gl;\r\n\r\n if (gl)\r\n {\r\n var renderer = this.renderer;\r\n\r\n renderer.setFramebuffer(this.framebuffer, true);\r\n \r\n if (this.frame.cutWidth !== this.canvas.width || this.frame.cutHeight !== this.canvas.height)\r\n {\r\n gl.scissor(this.frame.cutX, this.frame.cutY, this.frame.cutWidth, this.frame.cutHeight);\r\n }\r\n\r\n gl.clearColor(0, 0, 0, 0);\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n\r\n renderer.setFramebuffer(null, true);\r\n }\r\n else\r\n {\r\n var ctx = this.context;\r\n\r\n ctx.save();\r\n ctx.setTransform(1, 0, 0, 1, 0, 0);\r\n ctx.clearRect(this.frame.cutX, this.frame.cutY, this.frame.cutWidth, this.frame.cutHeight);\r\n ctx.restore();\r\n }\r\n\r\n this.dirty = false;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Draws the given object, or an array of objects, to this Render Texture using a blend mode of ERASE.\r\n * This has the effect of erasing any filled pixels in the objects from this Render Texture.\r\n * \r\n * It can accept any of the following:\r\n * \r\n * * Any renderable Game Object, such as a Sprite, Text, Graphics or TileSprite.\r\n * * Dynamic and Static Tilemap Layers.\r\n * * A Group. The contents of which will be iterated and drawn in turn.\r\n * * A Container. The contents of which will be iterated fully, and drawn in turn.\r\n * * A Scene's Display List. Pass in `Scene.children` to draw the whole list.\r\n * * Another Render Texture.\r\n * * A Texture Frame instance.\r\n * * A string. This is used to look-up a texture from the Texture Manager.\r\n * \r\n * Note: You cannot erase a Render Texture from itself.\r\n * \r\n * If passing in a Group or Container it will only draw children that return `true`\r\n * when their `willRender()` method is called. I.e. a Container with 10 children,\r\n * 5 of which have `visible=false` will only draw the 5 visible ones.\r\n * \r\n * If passing in an array of Game Objects it will draw them all, regardless if\r\n * they pass a `willRender` check or not.\r\n * \r\n * You can pass in a string in which case it will look for a texture in the Texture\r\n * Manager matching that string, and draw the base frame.\r\n * \r\n * You can pass in the `x` and `y` coordinates to draw the objects at. The use of\r\n * the coordinates differ based on what objects are being drawn. If the object is\r\n * a Group, Container or Display List, the coordinates are _added_ to the positions\r\n * of the children. For all other types of object, the coordinates are exact.\r\n * \r\n * Calling this method causes the WebGL batch to flush, so it can write the texture\r\n * data to the framebuffer being used internally. The batch is flushed at the end,\r\n * after the entries have been iterated. So if you've a bunch of objects to draw,\r\n * try and pass them in an array in one single call, rather than making lots of\r\n * separate calls.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#erase\r\n * @since 3.16.0\r\n *\r\n * @param {any} entries - Any renderable Game Object, or Group, Container, Display List, other Render Texture, Texture Frame or an array of any of these.\r\n * @param {number} [x] - The x position to draw the Frame at, or the offset applied to the object.\r\n * @param {number} [y] - The y position to draw the Frame at, or the offset applied to the object.\r\n *\r\n * @return {this} This Render Texture instance.\r\n */\r\n erase: function (entries, x, y)\r\n {\r\n this._eraseMode = true;\r\n\r\n var blendMode = this.renderer.currentBlendMode;\r\n\r\n this.renderer.setBlendMode(BlendModes.ERASE);\r\n\r\n this.draw(entries, x, y, 1, 16777215);\r\n\r\n this.renderer.setBlendMode(blendMode);\r\n\r\n this._eraseMode = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Draws the given object, or an array of objects, to this Render Texture.\r\n * \r\n * It can accept any of the following:\r\n * \r\n * * Any renderable Game Object, such as a Sprite, Text, Graphics or TileSprite.\r\n * * Dynamic and Static Tilemap Layers.\r\n * * A Group. The contents of which will be iterated and drawn in turn.\r\n * * A Container. The contents of which will be iterated fully, and drawn in turn.\r\n * * A Scene's Display List. Pass in `Scene.children` to draw the whole list.\r\n * * Another Render Texture.\r\n * * A Texture Frame instance.\r\n * * A string. This is used to look-up a texture from the Texture Manager.\r\n * \r\n * Note: You cannot draw a Render Texture to itself.\r\n * \r\n * If passing in a Group or Container it will only draw children that return `true`\r\n * when their `willRender()` method is called. I.e. a Container with 10 children,\r\n * 5 of which have `visible=false` will only draw the 5 visible ones.\r\n * \r\n * If passing in an array of Game Objects it will draw them all, regardless if\r\n * they pass a `willRender` check or not.\r\n * \r\n * You can pass in a string in which case it will look for a texture in the Texture\r\n * Manager matching that string, and draw the base frame. If you need to specify\r\n * exactly which frame to draw then use the method `drawFrame` instead.\r\n * \r\n * You can pass in the `x` and `y` coordinates to draw the objects at. The use of\r\n * the coordinates differ based on what objects are being drawn. If the object is\r\n * a Group, Container or Display List, the coordinates are _added_ to the positions\r\n * of the children. For all other types of object, the coordinates are exact.\r\n * \r\n * The `alpha` and `tint` values are only used by Texture Frames.\r\n * Game Objects use their own alpha and tint values when being drawn.\r\n * \r\n * Calling this method causes the WebGL batch to flush, so it can write the texture\r\n * data to the framebuffer being used internally. The batch is flushed at the end,\r\n * after the entries have been iterated. So if you've a bunch of objects to draw,\r\n * try and pass them in an array in one single call, rather than making lots of\r\n * separate calls.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#draw\r\n * @since 3.2.0\r\n *\r\n * @param {any} entries - Any renderable Game Object, or Group, Container, Display List, other Render Texture, Texture Frame or an array of any of these.\r\n * @param {number} [x] - The x position to draw the Frame at, or the offset applied to the object.\r\n * @param {number} [y] - The y position to draw the Frame at, or the offset applied to the object.\r\n * @param {number} [alpha] - The alpha value. Only used for Texture Frames and if not specified defaults to the `globalAlpha` property. Game Objects use their own current alpha value.\r\n * @param {number} [tint] - WebGL only. The tint color value. Only used for Texture Frames and if not specified defaults to the `globalTint` property. Game Objects use their own current tint value.\r\n *\r\n * @return {this} This Render Texture instance.\r\n */\r\n draw: function (entries, x, y, alpha, tint)\r\n {\r\n if (alpha === undefined) { alpha = this.globalAlpha; }\r\n\r\n if (tint === undefined)\r\n {\r\n tint = (this.globalTint >> 16) + (this.globalTint & 0xff00) + ((this.globalTint & 0xff) << 16);\r\n }\r\n else\r\n {\r\n tint = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16);\r\n }\r\n\r\n if (!Array.isArray(entries))\r\n {\r\n entries = [ entries ];\r\n }\r\n\r\n var gl = this.gl;\r\n\r\n this.camera.preRender(1, 1);\r\n\r\n if (gl)\r\n {\r\n var cx = this.camera._cx;\r\n var cy = this.camera._cy;\r\n var cw = this.camera._cw;\r\n var ch = this.camera._ch;\r\n\r\n this.renderer.setFramebuffer(this.framebuffer, false);\r\n\r\n this.renderer.pushScissor(cx, cy, cw, ch, ch);\r\n\r\n var pipeline = this.pipeline;\r\n \r\n pipeline.projOrtho(0, this.texture.width, 0, this.texture.height, -1000.0, 1000.0);\r\n\r\n this.batchList(entries, x, y, alpha, tint);\r\n\r\n pipeline.flush();\r\n\r\n this.renderer.setFramebuffer(null, false);\r\n\r\n this.renderer.popScissor();\r\n\r\n pipeline.projOrtho(0, pipeline.width, pipeline.height, 0, -1000.0, 1000.0);\r\n }\r\n else\r\n {\r\n this.renderer.setContext(this.context);\r\n\r\n this.batchList(entries, x, y, alpha, tint);\r\n\r\n this.renderer.setContext();\r\n }\r\n\r\n this.dirty = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Draws the Texture Frame to the Render Texture at the given position.\r\n * \r\n * Textures are referenced by their string-based keys, as stored in the Texture Manager.\r\n * \r\n * ```javascript\r\n * var rt = this.add.renderTexture(0, 0, 800, 600);\r\n * rt.drawFrame(key, frame);\r\n * ```\r\n * \r\n * You can optionally provide a position, alpha and tint value to apply to the frame\r\n * before it is drawn.\r\n * \r\n * Calling this method will cause a batch flush, so if you've got a stack of things to draw\r\n * in a tight loop, try using the `draw` method instead.\r\n * \r\n * If you need to draw a Sprite to this Render Texture, use the `draw` method instead.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#drawFrame\r\n * @since 3.12.0\r\n *\r\n * @param {string} key - The key of the texture to be used, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - The name or index of the frame within the Texture.\r\n * @param {number} [x=0] - The x position to draw the frame at.\r\n * @param {number} [y=0] - The y position to draw the frame at.\r\n * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property.\r\n * @param {number} [tint] - WebGL only. The tint color to use. If not specified it uses the `globalTint` property.\r\n *\r\n * @return {this} This Render Texture instance.\r\n */\r\n drawFrame: function (key, frame, x, y, alpha, tint)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (alpha === undefined) { alpha = this.globalAlpha; }\r\n\r\n if (tint === undefined)\r\n {\r\n tint = (this.globalTint >> 16) + (this.globalTint & 0xff00) + ((this.globalTint & 0xff) << 16);\r\n }\r\n else\r\n {\r\n tint = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16);\r\n }\r\n\r\n var gl = this.gl;\r\n var textureFrame = this.textureManager.getFrame(key, frame);\r\n\r\n if (textureFrame)\r\n {\r\n this.camera.preRender(1, 1);\r\n\r\n if (gl)\r\n {\r\n var cx = this.camera._cx;\r\n var cy = this.camera._cy;\r\n var cw = this.camera._cw;\r\n var ch = this.camera._ch;\r\n \r\n this.renderer.setFramebuffer(this.framebuffer, false);\r\n \r\n this.renderer.pushScissor(cx, cy, cw, ch, ch);\r\n \r\n var pipeline = this.pipeline;\r\n \r\n pipeline.projOrtho(0, this.texture.width, 0, this.texture.height, -1000.0, 1000.0);\r\n \r\n pipeline.batchTextureFrame(textureFrame, x + this.frame.cutX, y + this.frame.cutY, tint, alpha, this.camera.matrix, null);\r\n \r\n pipeline.flush();\r\n \r\n this.renderer.setFramebuffer(null, false);\r\n\r\n this.renderer.popScissor();\r\n \r\n pipeline.projOrtho(0, pipeline.width, pipeline.height, 0, -1000.0, 1000.0);\r\n }\r\n else\r\n {\r\n this.batchTextureFrame(textureFrame, x + this.frame.cutX, y + this.frame.cutY, alpha, tint);\r\n }\r\n\r\n this.dirty = true;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal method that handles the drawing of an array of children.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#batchList\r\n * @private\r\n * @since 3.12.0\r\n *\r\n * @param {array} children - The array of Game Objects to draw.\r\n * @param {number} [x] - The x position to offset the Game Object by.\r\n * @param {number} [y] - The y position to offset the Game Object by.\r\n * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property.\r\n * @param {number} [tint] - The tint color to use. If not specified it uses the `globalTint` property.\r\n */\r\n batchList: function (children, x, y, alpha, tint)\r\n {\r\n for (var i = 0; i < children.length; i++)\r\n {\r\n var entry = children[i];\r\n\r\n if (!entry || entry === this)\r\n {\r\n continue;\r\n }\r\n\r\n if (entry.renderWebGL || entry.renderCanvas)\r\n {\r\n // Game Objects\r\n this.drawGameObject(entry, x, y);\r\n }\r\n else if (entry.isParent || entry.list)\r\n {\r\n // Groups / Display Lists\r\n this.batchGroup(entry.getChildren(), x, y);\r\n }\r\n else if (typeof entry === 'string')\r\n {\r\n // Texture key\r\n this.batchTextureFrameKey(entry, null, x, y, alpha, tint);\r\n }\r\n else if (entry instanceof Frame)\r\n {\r\n // Texture Frame instance\r\n this.batchTextureFrame(entry, x, y, alpha, tint);\r\n }\r\n else if (Array.isArray(entry))\r\n {\r\n // Another Array\r\n this.batchList(entry, x, y, alpha, tint);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Internal method that handles the drawing a Phaser Group contents.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#batchGroup\r\n * @private\r\n * @since 3.12.0\r\n *\r\n * @param {array} children - The array of Game Objects to draw.\r\n * @param {number} [x=0] - The x position to offset the Game Object by.\r\n * @param {number} [y=0] - The y position to offset the Game Object by.\r\n */\r\n batchGroup: function (children, x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n x += this.frame.cutX;\r\n y += this.frame.cutY;\r\n\r\n for (var i = 0; i < children.length; i++)\r\n {\r\n var entry = children[i];\r\n\r\n if (entry.willRender())\r\n {\r\n var tx = entry.x + x;\r\n var ty = entry.y + y;\r\n\r\n this.drawGameObject(entry, tx, ty);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Internal method that handles drawing a single Phaser Game Object to this Render Texture using WebGL.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#batchGameObjectWebGL\r\n * @private\r\n * @since 3.12.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to draw.\r\n * @param {number} [x] - The x position to draw the Game Object at.\r\n * @param {number} [y] - The y position to draw the Game Object at.\r\n */\r\n batchGameObjectWebGL: function (gameObject, x, y)\r\n {\r\n if (x === undefined) { x = gameObject.x; }\r\n if (y === undefined) { y = gameObject.y; }\r\n\r\n var prevX = gameObject.x;\r\n var prevY = gameObject.y;\r\n\r\n if (!this._eraseMode)\r\n {\r\n this.renderer.setBlendMode(gameObject.blendMode);\r\n }\r\n\r\n gameObject.setPosition(x + this.frame.cutX, y + this.frame.cutY);\r\n \r\n gameObject.renderWebGL(this.renderer, gameObject, 0, this.camera, null);\r\n\r\n gameObject.setPosition(prevX, prevY);\r\n },\r\n\r\n /**\r\n * Internal method that handles drawing a single Phaser Game Object to this Render Texture using Canvas.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#batchGameObjectCanvas\r\n * @private\r\n * @since 3.12.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to draw.\r\n * @param {number} [x] - The x position to draw the Game Object at.\r\n * @param {number} [y] - The y position to draw the Game Object at.\r\n */\r\n batchGameObjectCanvas: function (gameObject, x, y)\r\n {\r\n if (x === undefined) { x = gameObject.x; }\r\n if (y === undefined) { y = gameObject.y; }\r\n\r\n var prevX = gameObject.x;\r\n var prevY = gameObject.y;\r\n\r\n if (this._eraseMode)\r\n {\r\n var blendMode = gameObject.blendMode;\r\n\r\n gameObject.blendMode = BlendModes.ERASE;\r\n }\r\n\r\n gameObject.setPosition(x + this.frame.cutX, y + this.frame.cutY);\r\n\r\n gameObject.renderCanvas(this.renderer, gameObject, 0, this.camera, null);\r\n\r\n gameObject.setPosition(prevX, prevY);\r\n\r\n if (this._eraseMode)\r\n {\r\n gameObject.blendMode = blendMode;\r\n }\r\n },\r\n\r\n /**\r\n * Internal method that handles the drawing of an array of children.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#batchTextureFrameKey\r\n * @private\r\n * @since 3.12.0\r\n *\r\n * @param {string} key - The key of the texture to be used, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - The name or index of the frame within the Texture.\r\n * @param {number} [x=0] - The x position to offset the Game Object by.\r\n * @param {number} [y=0] - The y position to offset the Game Object by.\r\n * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property.\r\n * @param {number} [tint] - The tint color to use. If not specified it uses the `globalTint` property.\r\n */\r\n batchTextureFrameKey: function (key, frame, x, y, alpha, tint)\r\n {\r\n var textureFrame = this.textureManager.getFrame(key, frame);\r\n\r\n if (textureFrame)\r\n {\r\n this.batchTextureFrame(textureFrame, x, y, alpha, tint);\r\n }\r\n },\r\n\r\n /**\r\n * Internal method that handles the drawing of a Texture Frame to this Render Texture.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#batchTextureFrame\r\n * @private\r\n * @since 3.12.0\r\n *\r\n * @param {Phaser.Textures.Frame} textureFrame - The Texture Frame to draw.\r\n * @param {number} [x=0] - The x position to draw the Frame at.\r\n * @param {number} [y=0] - The y position to draw the Frame at.\r\n * @param {number} [tint] - A tint color to be applied to the frame drawn to the Render Texture.\r\n */\r\n batchTextureFrame: function (textureFrame, x, y, alpha, tint)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n x += this.frame.cutX;\r\n y += this.frame.cutY;\r\n\r\n if (this.gl)\r\n {\r\n this.pipeline.batchTextureFrame(textureFrame, x, y, tint, alpha, this.camera.matrix, null);\r\n }\r\n else\r\n {\r\n var ctx = this.context;\r\n var cd = textureFrame.canvasData;\r\n var source = textureFrame.source.image;\r\n \r\n var matrix = this.camera.matrix;\r\n \r\n ctx.globalAlpha = this.globalAlpha;\r\n\r\n ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\r\n\r\n ctx.drawImage(source, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height);\r\n }\r\n },\r\n\r\n /**\r\n * Takes a snapshot of the given area of this Render Texture.\r\n * \r\n * The snapshot is taken immediately.\r\n * \r\n * To capture the whole Render Texture see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`.\r\n * \r\n * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView.\r\n * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it,\r\n * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process,\r\n * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#snapshotArea\r\n * @since 3.19.0\r\n *\r\n * @param {integer} x - The x coordinate to grab from.\r\n * @param {integer} y - The y coordinate to grab from.\r\n * @param {integer} width - The width of the area to grab.\r\n * @param {integer} height - The height of the area to grab.\r\n * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created.\r\n * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`.\r\n * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`.\r\n *\r\n * @return {this} This Render Texture instance.\r\n */\r\n snapshotArea: function (x, y, width, height, callback, type, encoderOptions)\r\n {\r\n if (this.gl)\r\n {\r\n this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, false, x, y, width, height, type, encoderOptions);\r\n }\r\n else\r\n {\r\n this.renderer.snapshotCanvas(this.canvas, callback, false, x, y, width, height, type, encoderOptions);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes a snapshot of the whole of this Render Texture.\r\n * \r\n * The snapshot is taken immediately.\r\n * \r\n * To capture just a portion of the Render Texture see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`.\r\n * \r\n * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView.\r\n * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it,\r\n * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process,\r\n * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#snapshot\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created.\r\n * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`.\r\n * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`.\r\n *\r\n * @return {this} This Render Texture instance.\r\n */\r\n snapshot: function (callback, type, encoderOptions)\r\n {\r\n if (this.gl)\r\n {\r\n this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, false, 0, 0, this.width, this.height, type, encoderOptions);\r\n }\r\n else\r\n {\r\n this.renderer.snapshotCanvas(this.canvas, callback, false, 0, 0, this.width, this.height, type, encoderOptions);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes a snapshot of the given pixel from this Render Texture.\r\n * \r\n * The snapshot is taken immediately.\r\n * \r\n * To capture the whole Render Texture see the `snapshot` method. To capture a specific portion, see `snapshotArea`.\r\n * \r\n * Unlike the other two snapshot methods, this one will send your callback a `Color` object containing the color data for\r\n * the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute,\r\n * using less memory, than the other snapshot methods.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#snapshotPixel\r\n * @since 3.19.0\r\n *\r\n * @param {integer} x - The x coordinate of the pixel to get.\r\n * @param {integer} y - The y coordinate of the pixel to get.\r\n * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted.\r\n *\r\n * @return {this} This Render Texture instance.\r\n */\r\n snapshotPixel: function (x, y, callback)\r\n {\r\n if (this.gl)\r\n {\r\n this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, true, x, y);\r\n }\r\n else\r\n {\r\n this.renderer.snapshotCanvas(this.canvas, callback, true, x, y);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal destroy handler, called as part of the destroy process.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#preDestroy\r\n * @protected\r\n * @since 3.9.0\r\n */\r\n preDestroy: function ()\r\n {\r\n if (!this._saved)\r\n {\r\n CanvasPool.remove(this.canvas);\r\n\r\n if (this.gl)\r\n {\r\n this.renderer.deleteFramebuffer(this.framebuffer);\r\n }\r\n\r\n this.texture.destroy();\r\n this.camera.destroy();\r\n\r\n this.canvas = null;\r\n this.context = null;\r\n this.framebuffer = null;\r\n this.texture = null;\r\n this.glTexture = null;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = RenderTexture;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/rendertexture/RenderTexture.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureCanvasRenderer.js": /*!******************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureCanvasRenderer.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#renderCanvas\r\n * @since 3.2.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.RenderTexture} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar RenderTextureCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n renderer.batchSprite(src, src.frame, camera, parentMatrix);\r\n};\r\n\r\nmodule.exports = RenderTextureCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureCreator.js": /*!***********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureCreator.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BuildGameObject = __webpack_require__(/*! ../BuildGameObject */ \"./node_modules/phaser/src/gameobjects/BuildGameObject.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar RenderTexture = __webpack_require__(/*! ./RenderTexture */ \"./node_modules/phaser/src/gameobjects/rendertexture/RenderTexture.js\");\r\n\r\n/**\r\n * Creates a new Render Texture Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Render Texture Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#renderTexture\r\n * @since 3.2.0\r\n *\r\n * @param {Phaser.Types.GameObjects.RenderTexture.RenderTextureConfig} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {Phaser.GameObjects.RenderTexture} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('renderTexture', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n var x = GetAdvancedValue(config, 'x', 0);\r\n var y = GetAdvancedValue(config, 'y', 0);\r\n var width = GetAdvancedValue(config, 'width', 32);\r\n var height = GetAdvancedValue(config, 'height', 32);\r\n var key = GetAdvancedValue(config, 'key', undefined);\r\n var frame = GetAdvancedValue(config, 'frame', undefined);\r\n\r\n var renderTexture = new RenderTexture(this.scene, x, y, width, height, key, frame);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, renderTexture, config);\r\n\r\n return renderTexture;\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureFactory.js": /*!***********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureFactory.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar RenderTexture = __webpack_require__(/*! ./RenderTexture */ \"./node_modules/phaser/src/gameobjects/rendertexture/RenderTexture.js\");\r\n\r\n/**\r\n * Creates a new Render Texture Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Render Texture Game Object has been built into Phaser.\r\n * \r\n * A Render Texture is a special texture that allows any number of Game Objects to be drawn to it. You can take many complex objects and\r\n * draw them all to this one texture, which can they be used as the texture for other Game Object's. It's a way to generate dynamic\r\n * textures at run-time that are WebGL friendly and don't invoke expensive GPU uploads.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#renderTexture\r\n * @since 3.2.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {integer} [width=32] - The width of the Render Texture.\r\n * @param {integer} [height=32] - The height of the Render Texture.\r\n * @property {string} [key] - The texture key to make the RenderTexture from.\r\n * @property {string} [frame] - the frame to make the RenderTexture from.\r\n * \r\n * @return {Phaser.GameObjects.RenderTexture} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('renderTexture', function (x, y, width, height, key, frame)\r\n{\r\n return this.displayList.add(new RenderTexture(this.scene, x, y, width, height, key, frame));\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureRender.js": /*!**********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureRender.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./RenderTextureWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./RenderTextureCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureWebGLRenderer.js": /*!*****************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureWebGLRenderer.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Utils = __webpack_require__(/*! ../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.RenderTexture#renderWebGL\r\n * @since 3.2.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.RenderTexture} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar RenderTextureWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var frame = src.frame;\r\n var width = frame.width;\r\n var height = frame.height;\r\n var getTint = Utils.getTintAppendFloatAlpha;\r\n\r\n this.pipeline.batchTexture(\r\n src,\r\n frame.glTexture,\r\n width, height,\r\n src.x, src.y,\r\n width, height,\r\n src.scaleX, src.scaleY,\r\n src.rotation,\r\n src.flipX, !src.flipY,\r\n src.scrollFactorX, src.scrollFactorY,\r\n src.displayOriginX, src.displayOriginY,\r\n 0, 0, width, height,\r\n getTint(src._tintTL, camera.alpha * src._alphaTL),\r\n getTint(src._tintTR, camera.alpha * src._alphaTR),\r\n getTint(src._tintBL, camera.alpha * src._alphaBL),\r\n getTint(src._tintBR, camera.alpha * src._alphaBR),\r\n (src._isTinted && src.tintFill),\r\n 0, 0,\r\n camera,\r\n parentMatrix\r\n );\r\n\r\n // Force clear the current texture so that items next in the batch (like Graphics) don't try and use it\r\n renderer.setBlankTexture(true);\r\n};\r\n\r\nmodule.exports = RenderTextureWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/rendertexture/RenderTextureWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shader/Shader.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shader/Shader.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar Extend = __webpack_require__(/*! ../../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\nvar SetValue = __webpack_require__(/*! ../../utils/object/SetValue */ \"./node_modules/phaser/src/utils/object/SetValue.js\");\r\nvar ShaderRender = __webpack_require__(/*! ./ShaderRender */ \"./node_modules/phaser/src/gameobjects/shader/ShaderRender.js\");\r\nvar TransformMatrix = __webpack_require__(/*! ../components/TransformMatrix */ \"./node_modules/phaser/src/gameobjects/components/TransformMatrix.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Shader Game Object.\r\n * \r\n * This Game Object allows you to easily add a quad with its own shader into the display list, and manipulate it\r\n * as you would any other Game Object, including scaling, rotating, positioning and adding to Containers. Shaders\r\n * can be masked with either Bitmap or Geometry masks and can also be used as a Bitmap Mask for a Camera or other\r\n * Game Object. They can also be made interactive and used for input events.\r\n * \r\n * It works by taking a reference to a `Phaser.Display.BaseShader` instance, as found in the Shader Cache. These can\r\n * be created dynamically at runtime, or loaded in via the GLSL File Loader:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.glsl('fire', 'shaders/fire.glsl.js');\r\n * }\r\n * \r\n * function create ()\r\n * {\r\n * this.add.shader('fire', 400, 300, 512, 512);\r\n * }\r\n * ```\r\n * \r\n * Please see the Phaser 3 Examples GitHub repo for examples of loading and creating shaders dynamically.\r\n * \r\n * Due to the way in which they work, you cannot directly change the alpha or blend mode of a Shader. This should\r\n * be handled via exposed uniforms in the shader code itself.\r\n * \r\n * By default a Shader will be created with a standard set of uniforms. These were added to match those\r\n * found on sites such as ShaderToy or GLSLSandbox, and provide common functionality a shader may need,\r\n * such as the timestamp, resolution or pointer position. You can replace them by specifying your own uniforms\r\n * in the Base Shader.\r\n * \r\n * These Shaders work by halting the current pipeline during rendering, creating a viewport matched to the\r\n * size of this Game Object and then renders a quad using the bound shader. At the end, the pipeline is restored.\r\n * \r\n * Because it blocks the pipeline it means it will interrupt any batching that is currently going on, so you should\r\n * use these Game Objects sparingly. If you need to have a fully batched custom shader, then please look at using\r\n * a custom pipeline instead. However, for background or special masking effects, they are extremely effective.\r\n * \r\n * @class Shader\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @webglOnly\r\n * @since 3.17.0\r\n *\r\n * @extends Phaser.GameObjects.Components.ComputedSize\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {(string|Phaser.Display.BaseShader)} key - The key of the shader to use from the shader cache, or a BaseShader instance.\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [width=128] - The width of the Game Object.\r\n * @param {number} [height=128] - The height of the Game Object.\r\n * @param {string[]} [textures] - Optional array of texture keys to bind to the iChannel0...3 uniforms. The textures must already exist in the Texture Manager.\r\n * @param {any} [textureData] - Additional texture data if you want to create shader with none NPOT textures.\r\n */\r\nvar Shader = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.ComputedSize,\r\n Components.Depth,\r\n Components.GetBounds,\r\n Components.Mask,\r\n Components.Origin,\r\n Components.ScrollFactor,\r\n Components.Transform,\r\n Components.Visible,\r\n ShaderRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Shader (scene, key, x, y, width, height, textures, textureData)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = 128; }\r\n if (height === undefined) { height = 128; }\r\n\r\n GameObject.call(this, scene, 'Shader');\r\n\r\n /**\r\n * This Game Object cannot have a blend mode, so skip all checks.\r\n * \r\n * @name Phaser.GameObjects.Shader#blendMode\r\n * @type {integer}\r\n * @private\r\n * @since 3.17.0\r\n */\r\n this.blendMode = -1;\r\n\r\n /**\r\n * The underlying shader object being used.\r\n * Empty by default and set during a call to the `setShader` method.\r\n * \r\n * @name Phaser.GameObjects.Shader#shader\r\n * @type {Phaser.Display.BaseShader}\r\n * @since 3.17.0\r\n */\r\n this.shader;\r\n\r\n var renderer = scene.sys.renderer;\r\n\r\n /**\r\n * A reference to the current renderer.\r\n * Shaders only work with the WebGL Renderer.\r\n * \r\n * @name Phaser.GameObjects.Shader#renderer\r\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\r\n * @since 3.17.0\r\n */\r\n this.renderer = renderer;\r\n\r\n /**\r\n * The WebGL context belonging to the renderer.\r\n *\r\n * @name Phaser.GameObjects.Shader#gl\r\n * @type {WebGLRenderingContext}\r\n * @since 3.17.0\r\n */\r\n this.gl = renderer.gl;\r\n\r\n /**\r\n * Raw byte buffer of vertices this Shader uses.\r\n *\r\n * @name Phaser.GameObjects.Shader#vertexData\r\n * @type {ArrayBuffer}\r\n * @since 3.17.0\r\n */\r\n this.vertexData = new ArrayBuffer(6 * (Float32Array.BYTES_PER_ELEMENT * 2));\r\n\r\n /**\r\n * The WebGL vertex buffer object this shader uses.\r\n *\r\n * @name Phaser.GameObjects.Shader#vertexBuffer\r\n * @type {WebGLBuffer}\r\n * @since 3.17.0\r\n */\r\n this.vertexBuffer = renderer.createVertexBuffer(this.vertexData.byteLength, this.gl.STREAM_DRAW);\r\n\r\n /**\r\n * The WebGL shader program this shader uses.\r\n *\r\n * @name Phaser.GameObjects.Shader#program\r\n * @type {WebGLProgram}\r\n * @since 3.17.0\r\n */\r\n this.program = null;\r\n\r\n /**\r\n * Uint8 view to the vertex raw buffer. Used for uploading vertex buffer resources to the GPU.\r\n *\r\n * @name Phaser.GameObjects.Shader#bytes\r\n * @type {Uint8Array}\r\n * @since 3.17.0\r\n */\r\n this.bytes = new Uint8Array(this.vertexData);\r\n\r\n /**\r\n * Float32 view of the array buffer containing the shaders vertices.\r\n *\r\n * @name Phaser.GameObjects.Shader#vertexViewF32\r\n * @type {Float32Array}\r\n * @since 3.17.0\r\n */\r\n this.vertexViewF32 = new Float32Array(this.vertexData);\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.GameObjects.Shader#_tempMatrix1\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.17.0\r\n */\r\n this._tempMatrix1 = new TransformMatrix();\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.GameObjects.Shader#_tempMatrix2\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.17.0\r\n */\r\n this._tempMatrix2 = new TransformMatrix();\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.GameObjects.Shader#_tempMatrix3\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.17.0\r\n */\r\n this._tempMatrix3 = new TransformMatrix();\r\n\r\n /**\r\n * The view matrix the shader uses during rendering.\r\n * \r\n * @name Phaser.GameObjects.Shader#viewMatrix\r\n * @type {Float32Array}\r\n * @readonly\r\n * @since 3.17.0\r\n */\r\n this.viewMatrix = new Float32Array([ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]);\r\n\r\n /**\r\n * The projection matrix the shader uses during rendering.\r\n * \r\n * @name Phaser.GameObjects.Shader#projectionMatrix\r\n * @type {Float32Array}\r\n * @readonly\r\n * @since 3.17.0\r\n */\r\n this.projectionMatrix = new Float32Array([ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]);\r\n\r\n /**\r\n * The default uniform mappings. These can be added to (or replaced) by specifying your own uniforms when\r\n * creating this shader game object. The uniforms are updated automatically during the render step.\r\n * \r\n * The defaults are:\r\n * \r\n * `resolution` (2f) - Set to the size of this shader.\r\n * `time` (1f) - The elapsed game time, in seconds.\r\n * `mouse` (2f) - If a pointer has been bound (with `setPointer`), this uniform contains its position each frame.\r\n * `date` (4fv) - A vec4 containing the year, month, day and time in seconds.\r\n * `sampleRate` (1f) - Sound sample rate. 44100 by default.\r\n * `iChannel0...3` (sampler2D) - Input channels 0 to 3. `null` by default.\r\n * \r\n * @name Phaser.GameObjects.Shader#uniforms\r\n * @type {any}\r\n * @since 3.17.0\r\n */\r\n this.uniforms = {};\r\n\r\n /**\r\n * The pointer bound to this shader, if any.\r\n * Set via the chainable `setPointer` method, or by modifying this property directly.\r\n * \r\n * @name Phaser.GameObjects.Shader#pointer\r\n * @type {Phaser.Input.Pointer}\r\n * @since 3.17.0\r\n */\r\n this.pointer = null;\r\n\r\n /**\r\n * The cached width of the renderer.\r\n * \r\n * @name Phaser.GameObjects.Shader#_rendererWidth\r\n * @type {number}\r\n * @private\r\n * @since 3.17.0\r\n */\r\n this._rendererWidth = renderer.width;\r\n\r\n /**\r\n * The cached height of the renderer.\r\n * \r\n * @name Phaser.GameObjects.Shader#_rendererHeight\r\n * @type {number}\r\n * @private\r\n * @since 3.17.0\r\n */\r\n this._rendererHeight = renderer.height;\r\n\r\n /**\r\n * Internal texture count tracker.\r\n * \r\n * @name Phaser.GameObjects.Shader#_textureCount\r\n * @type {number}\r\n * @private\r\n * @since 3.17.0\r\n */\r\n this._textureCount = 0;\r\n\r\n /**\r\n * A reference to the GL Frame Buffer this Shader is drawing to.\r\n * This property is only set if you have called `Shader.setRenderToTexture`.\r\n *\r\n * @name Phaser.GameObjects.Shader#framebuffer\r\n * @type {?WebGLFramebuffer}\r\n * @since 3.19.0\r\n */\r\n this.framebuffer = null;\r\n\r\n /**\r\n * A reference to the WebGLTexture this Shader is rendering to.\r\n * This property is only set if you have called `Shader.setRenderToTexture`.\r\n *\r\n * @name Phaser.GameObjects.Shader#glTexture\r\n * @type {?WebGLTexture}\r\n * @since 3.19.0\r\n */\r\n this.glTexture = null;\r\n\r\n /**\r\n * A flag that indicates if this Shader has been set to render to a texture instead of the display list.\r\n * \r\n * This property is `true` if you have called `Shader.setRenderToTexture`, otherwise it's `false`.\r\n * \r\n * A Shader that is rendering to a texture _does not_ appear on the display list.\r\n *\r\n * @name Phaser.GameObjects.Shader#renderToTexture\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.renderToTexture = false;\r\n\r\n /**\r\n * A reference to the Phaser.Textures.Texture that has been stored in the Texture Manager for this Shader.\r\n * \r\n * This property is only set if you have called `Shader.setRenderToTexture`, otherwise it is `null`.\r\n *\r\n * @name Phaser.GameObjects.Shader#texture\r\n * @type {Phaser.Textures.Texture}\r\n * @since 3.19.0\r\n */\r\n this.texture = null;\r\n\r\n this.setPosition(x, y);\r\n this.setSize(width, height);\r\n this.setOrigin(0.5, 0.5);\r\n this.setShader(key, textures, textureData);\r\n },\r\n\r\n /**\r\n * Compares the renderMask with the renderFlags to see if this Game Object will render or not.\r\n * Also checks the Game Object against the given Cameras exclusion list.\r\n *\r\n * @method Phaser.GameObjects.Shader#willRender\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object.\r\n *\r\n * @return {boolean} True if the Game Object should be rendered, otherwise false.\r\n */\r\n willRender: function (camera)\r\n {\r\n if (this.renderToTexture)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return !(GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id)));\r\n }\r\n },\r\n\r\n /**\r\n * Changes this Shader so instead of rendering to the display list it renders to a\r\n * WebGL Framebuffer and WebGL Texture instead. This allows you to use the output\r\n * of this shader as an input for another shader, by mapping a sampler2D uniform\r\n * to it.\r\n * \r\n * After calling this method the `Shader.framebuffer` and `Shader.glTexture` properties\r\n * are populated.\r\n * \r\n * Additionally, you can provide a key to this method. Doing so will create a Phaser Texture\r\n * from this Shader and save it into the Texture Manager, allowing you to then use it for\r\n * any texture-based Game Object, such as a Sprite or Image:\r\n * \r\n * ```javascript\r\n * var shader = this.add.shader('myShader', x, y, width, height);\r\n * \r\n * shader.setRenderToTexture('doodle');\r\n * \r\n * this.add.image(400, 300, 'doodle');\r\n * ```\r\n * \r\n * Note that it stores an active reference to this Shader. That means as this shader updates,\r\n * so does the texture and any object using it to render with. Also, if you destroy this\r\n * shader, be sure to clear any objects that may have been using it as a texture too.\r\n * \r\n * You can access the Phaser Texture that is created via the `Shader.texture` property.\r\n * \r\n * By default it will create a single base texture. You can add frames to the texture\r\n * by using the `Texture.add` method. After doing this, you can then allow Game Objects\r\n * to use a specific frame from a Render Texture.\r\n *\r\n * @method Phaser.GameObjects.Shader#setRenderToTexture\r\n * @since 3.19.0\r\n *\r\n * @param {string} [key] - The unique key to store the texture as within the global Texture Manager.\r\n * @param {boolean} [flipY=false] - Does this texture need vertically flipping before rendering? This should usually be set to `true` if being fed from a buffer.\r\n *\r\n * @return {this} This Shader instance.\r\n */\r\n setRenderToTexture: function (key, flipY)\r\n {\r\n if (flipY === undefined) { flipY = false; }\r\n\r\n if (!this.renderToTexture)\r\n {\r\n var width = this.width;\r\n var height = this.height;\r\n var renderer = this.renderer;\r\n\r\n this.glTexture = renderer.createTextureFromSource(null, width, height, 0);\r\n\r\n this.glTexture.flipY = flipY;\r\n\r\n this.framebuffer = renderer.createFramebuffer(width, height, this.glTexture, false);\r\n\r\n this._rendererWidth = width;\r\n this._rendererHeight = height;\r\n\r\n this.renderToTexture = true;\r\n\r\n this.projOrtho(0, this.width, this.height, 0);\r\n\r\n if (key)\r\n {\r\n this.texture = this.scene.sys.textures.addGLTexture(key, this.glTexture, width, height);\r\n }\r\n }\r\n\r\n // And now render at least once, so our texture isn't blank on the first update\r\n\r\n if (this.shader)\r\n {\r\n var pipeline = renderer.currentPipeline;\r\n\r\n renderer.clearPipeline();\r\n \r\n this.load();\r\n this.flush();\r\n \r\n renderer.rebindPipeline(pipeline);\r\n }\r\n \r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the fragment and, optionally, the vertex shader source code that this Shader will use.\r\n * This will immediately delete the active shader program, if set, and then create a new one\r\n * with the given source. Finally, the shader uniforms are initialized.\r\n *\r\n * @method Phaser.GameObjects.Shader#setShader\r\n * @since 3.17.0\r\n * \r\n * @param {(string|Phaser.Display.BaseShader)} key - The key of the shader to use from the shader cache, or a BaseShader instance.\r\n * @param {string[]} [textures] - Optional array of texture keys to bind to the iChannel0...3 uniforms. The textures must already exist in the Texture Manager.\r\n * @param {any} [textureData] - Additional texture data.\r\n * \r\n * @return {this} This Shader instance.\r\n */\r\n setShader: function (key, textures, textureData)\r\n {\r\n if (textures === undefined) { textures = []; }\r\n\r\n if (typeof key === 'string')\r\n {\r\n var cache = this.scene.sys.cache.shader;\r\n\r\n if (!cache.has(key))\r\n {\r\n console.warn('Shader missing: ' + key);\r\n return this;\r\n }\r\n \r\n this.shader = cache.get(key);\r\n }\r\n else\r\n {\r\n this.shader = key;\r\n }\r\n\r\n var gl = this.gl;\r\n var renderer = this.renderer;\r\n\r\n if (this.program)\r\n {\r\n gl.deleteProgram(this.program);\r\n }\r\n\r\n var program = renderer.createProgram(this.shader.vertexSrc, this.shader.fragmentSrc);\r\n\r\n // The default uniforms available within the vertex shader\r\n renderer.setMatrix4(program, 'uViewMatrix', false, this.viewMatrix);\r\n renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix);\r\n renderer.setFloat2(program, 'uResolution', this.width, this.height);\r\n\r\n this.program = program;\r\n\r\n var d = new Date();\r\n\r\n // The default uniforms available within the fragment shader\r\n var defaultUniforms = {\r\n resolution: { type: '2f', value: { x: this.width, y: this.height } },\r\n time: { type: '1f', value: 0 },\r\n mouse: { type: '2f', value: { x: this.width / 2, y: this.height / 2 } },\r\n date: { type: '4fv', value: [ d.getFullYear(), d.getMonth(), d.getDate(), d.getHours() * 60 * 60 + d.getMinutes() * 60 + d.getSeconds() ] },\r\n sampleRate: { type: '1f', value: 44100.0 },\r\n iChannel0: { type: 'sampler2D', value: null, textureData: { repeat: true } },\r\n iChannel1: { type: 'sampler2D', value: null, textureData: { repeat: true } },\r\n iChannel2: { type: 'sampler2D', value: null, textureData: { repeat: true } },\r\n iChannel3: { type: 'sampler2D', value: null, textureData: { repeat: true } }\r\n };\r\n \r\n if (this.shader.uniforms)\r\n {\r\n this.uniforms = Extend(true, {}, this.shader.uniforms, defaultUniforms);\r\n }\r\n else\r\n {\r\n this.uniforms = defaultUniforms;\r\n }\r\n\r\n for (var i = 0; i < 4; i++)\r\n {\r\n if (textures[i])\r\n {\r\n this.setSampler2D('iChannel' + i, textures[i], i, textureData);\r\n }\r\n }\r\n\r\n this.initUniforms();\r\n\r\n this.projOrtho(0, this._rendererWidth, this._rendererHeight, 0);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Binds a Phaser Pointer object to this Shader.\r\n * \r\n * The screen position of the pointer will be set in to the shaders `mouse` uniform\r\n * automatically every frame. Call this method with no arguments to unbind the pointer.\r\n *\r\n * @method Phaser.GameObjects.Shader#setPointer\r\n * @since 3.17.0\r\n * \r\n * @param {Phaser.Input.Pointer} [pointer] - The Pointer to bind to this shader.\r\n * \r\n * @return {this} This Shader instance.\r\n */\r\n setPointer: function (pointer)\r\n {\r\n this.pointer = pointer;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets this shader to use an orthographic projection matrix.\r\n * This matrix is stored locally in the `projectionMatrix` property,\r\n * as well as being bound to the `uProjectionMatrix` uniform.\r\n * \r\n * @method Phaser.GameObjects.Shader#projOrtho\r\n * @since 3.17.0\r\n *\r\n * @param {number} left - The left value.\r\n * @param {number} right - The right value.\r\n * @param {number} bottom - The bottom value.\r\n * @param {number} top - The top value.\r\n */\r\n projOrtho: function (left, right, bottom, top)\r\n {\r\n var near = -1000;\r\n var far = 1000;\r\n\r\n var leftRight = 1 / (left - right);\r\n var bottomTop = 1 / (bottom - top);\r\n var nearFar = 1 / (near - far);\r\n\r\n var pm = this.projectionMatrix;\r\n\r\n pm[0] = -2 * leftRight;\r\n pm[5] = -2 * bottomTop;\r\n pm[10] = 2 * nearFar;\r\n pm[12] = (left + right) * leftRight;\r\n pm[13] = (top + bottom) * bottomTop;\r\n pm[14] = (far + near) * nearFar;\r\n\r\n var program = this.program;\r\n\r\n this.renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix);\r\n\r\n this._rendererWidth = right;\r\n this._rendererHeight = bottom;\r\n },\r\n\r\n // Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/\r\n // http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf\r\n\r\n /**\r\n * Initializes all of the uniforms this shader uses.\r\n * \r\n * @method Phaser.GameObjects.Shader#initUniforms\r\n * @private\r\n * @since 3.17.0\r\n */\r\n initUniforms: function ()\r\n {\r\n var gl = this.gl;\r\n var map = this.renderer.glFuncMap;\r\n var program = this.program;\r\n\r\n this._textureCount = 0;\r\n\r\n for (var key in this.uniforms)\r\n {\r\n var uniform = this.uniforms[key];\r\n\r\n var type = uniform.type;\r\n var data = map[type];\r\n\r\n uniform.uniformLocation = gl.getUniformLocation(program, key);\r\n\r\n if (type !== 'sampler2D')\r\n {\r\n uniform.glMatrix = data.matrix;\r\n uniform.glValueLength = data.length;\r\n uniform.glFunc = data.func;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Sets a sampler2D uniform on this shader where the source texture is a WebGLTexture.\r\n * \r\n * This allows you to feed the output from one Shader into another:\r\n * \r\n * ```javascript\r\n * let shader1 = this.add.shader(baseShader1, 0, 0, 512, 512).setRenderToTexture();\r\n * let shader2 = this.add.shader(baseShader2, 0, 0, 512, 512).setRenderToTexture('output');\r\n * \r\n * shader1.setSampler2DBuffer('iChannel0', shader2.glTexture, 512, 512);\r\n * shader2.setSampler2DBuffer('iChannel0', shader1.glTexture, 512, 512);\r\n * ```\r\n * \r\n * In the above code, the result of baseShader1 is fed into Shader2 as the `iChannel0` sampler2D uniform.\r\n * The result of baseShader2 is then fed back into shader1 again, creating a feedback loop.\r\n * \r\n * If you wish to use an image from the Texture Manager as a sampler2D input for this shader,\r\n * see the `Shader.setSampler2D` method.\r\n * \r\n * @method Phaser.GameObjects.Shader#setSampler2DBuffer\r\n * @since 3.19.0\r\n * \r\n * @param {string} uniformKey - The key of the sampler2D uniform to be updated, i.e. `iChannel0`.\r\n * @param {WebGLTexture} texture - A WebGLTexture reference.\r\n * @param {integer} width - The width of the texture.\r\n * @param {integer} height - The height of the texture.\r\n * @param {integer} [textureIndex=0] - The texture index.\r\n * @param {any} [textureData] - Additional texture data.\r\n * \r\n * @return {this} This Shader instance.\r\n */\r\n setSampler2DBuffer: function (uniformKey, texture, width, height, textureIndex, textureData)\r\n {\r\n if (textureIndex === undefined) { textureIndex = 0; }\r\n if (textureData === undefined) { textureData = {}; }\r\n\r\n var uniform = this.uniforms[uniformKey];\r\n\r\n uniform.value = texture;\r\n\r\n textureData.width = width;\r\n textureData.height = height;\r\n\r\n uniform.textureData = textureData;\r\n\r\n this._textureCount = textureIndex;\r\n\r\n this.initSampler2D(uniform);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a sampler2D uniform on this shader.\r\n * \r\n * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame\r\n * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized.\r\n * \r\n * If you wish to use another Shader as a sampler2D input for this shader, see the `Shader.setSampler2DBuffer` method.\r\n * \r\n * @method Phaser.GameObjects.Shader#setSampler2D\r\n * @since 3.17.0\r\n * \r\n * @param {string} uniformKey - The key of the sampler2D uniform to be updated, i.e. `iChannel0`.\r\n * @param {string} textureKey - The key of the texture, as stored in the Texture Manager. Must already be loaded.\r\n * @param {integer} [textureIndex=0] - The texture index.\r\n * @param {any} [textureData] - Additional texture data.\r\n * \r\n * @return {this} This Shader instance.\r\n */\r\n setSampler2D: function (uniformKey, textureKey, textureIndex, textureData)\r\n {\r\n if (textureIndex === undefined) { textureIndex = 0; }\r\n\r\n var textureManager = this.scene.sys.textures;\r\n\r\n if (textureManager.exists(textureKey))\r\n {\r\n var frame = textureManager.getFrame(textureKey);\r\n var uniform = this.uniforms[uniformKey];\r\n var source = frame.source;\r\n\r\n uniform.textureKey = textureKey;\r\n uniform.source = source.image;\r\n uniform.value = frame.glTexture;\r\n\r\n if (source.isGLTexture)\r\n {\r\n if (!textureData)\r\n {\r\n textureData = {};\r\n }\r\n\r\n textureData.width = source.width;\r\n textureData.height = source.height;\r\n }\r\n\r\n if (textureData)\r\n {\r\n uniform.textureData = textureData;\r\n }\r\n\r\n this._textureCount = textureIndex;\r\n\r\n this.initSampler2D(uniform);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a property of a uniform already present on this shader.\r\n * \r\n * To modify the value of a uniform such as a 1f or 1i use the `value` property directly:\r\n * \r\n * ```javascript\r\n * shader.setUniform('size.value', 16);\r\n * ```\r\n * \r\n * You can use dot notation to access deeper values, for example:\r\n * \r\n * ```javascript\r\n * shader.setUniform('resolution.value.x', 512);\r\n * ```\r\n * \r\n * The change to the uniform will take effect the next time the shader is rendered.\r\n * \r\n * @method Phaser.GameObjects.Shader#setUniform\r\n * @since 3.17.0\r\n * \r\n * @param {string} key - The key of the uniform to modify. Use dots for deep properties, i.e. `resolution.value.x`.\r\n * @param {any} value - The value to set into the uniform.\r\n * \r\n * @return {this} This Shader instance.\r\n */\r\n setUniform: function (key, value)\r\n {\r\n SetValue(this.uniforms, key, value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns the uniform object for the given key, or `null` if the uniform couldn't be found.\r\n * \r\n * @method Phaser.GameObjects.Shader#getUniform\r\n * @since 3.17.0\r\n * \r\n * @param {string} key - The key of the uniform to return the value for.\r\n * \r\n * @return {any} A reference to the uniform object. This is not a copy, so modifying it will update the original object also.\r\n */\r\n getUniform: function (key)\r\n {\r\n return GetFastValue(this.uniforms, key, null);\r\n },\r\n\r\n /**\r\n * A short-cut method that will directly set the texture being used by the `iChannel0` sampler2D uniform.\r\n * \r\n * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame\r\n * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized.\r\n * \r\n * @method Phaser.GameObjects.Shader#setChannel0\r\n * @since 3.17.0\r\n * \r\n * @param {string} textureKey - The key of the texture, as stored in the Texture Manager. Must already be loaded.\r\n * @param {any} [textureData] - Additional texture data.\r\n * \r\n * @return {this} This Shader instance.\r\n */\r\n setChannel0: function (textureKey, textureData)\r\n {\r\n return this.setSampler2D('iChannel0', textureKey, 0, textureData);\r\n },\r\n\r\n /**\r\n * A short-cut method that will directly set the texture being used by the `iChannel1` sampler2D uniform.\r\n * \r\n * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame\r\n * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized.\r\n * \r\n * @method Phaser.GameObjects.Shader#setChannel1\r\n * @since 3.17.0\r\n * \r\n * @param {string} textureKey - The key of the texture, as stored in the Texture Manager. Must already be loaded.\r\n * @param {any} [textureData] - Additional texture data.\r\n * \r\n * @return {this} This Shader instance.\r\n */\r\n setChannel1: function (textureKey, textureData)\r\n {\r\n return this.setSampler2D('iChannel1', textureKey, 1, textureData);\r\n },\r\n\r\n /**\r\n * A short-cut method that will directly set the texture being used by the `iChannel2` sampler2D uniform.\r\n * \r\n * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame\r\n * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized.\r\n * \r\n * @method Phaser.GameObjects.Shader#setChannel2\r\n * @since 3.17.0\r\n * \r\n * @param {string} textureKey - The key of the texture, as stored in the Texture Manager. Must already be loaded.\r\n * @param {any} [textureData] - Additional texture data.\r\n * \r\n * @return {this} This Shader instance.\r\n */\r\n setChannel2: function (textureKey, textureData)\r\n {\r\n return this.setSampler2D('iChannel2', textureKey, 2, textureData);\r\n },\r\n\r\n /**\r\n * A short-cut method that will directly set the texture being used by the `iChannel3` sampler2D uniform.\r\n * \r\n * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame\r\n * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized.\r\n * \r\n * @method Phaser.GameObjects.Shader#setChannel3\r\n * @since 3.17.0\r\n * \r\n * @param {string} textureKey - The key of the texture, as stored in the Texture Manager. Must already be loaded.\r\n * @param {any} [textureData] - Additional texture data.\r\n * \r\n * @return {this} This Shader instance.\r\n */\r\n setChannel3: function (textureKey, textureData)\r\n {\r\n return this.setSampler2D('iChannel3', textureKey, 3, textureData);\r\n },\r\n\r\n /**\r\n * Internal method that takes a sampler2D uniform and prepares it for use by setting the\r\n * gl texture parameters.\r\n * \r\n * @method Phaser.GameObjects.Shader#initSampler2D\r\n * @private\r\n * @since 3.17.0\r\n * \r\n * @param {any} uniform - The sampler2D uniform to process.\r\n */\r\n initSampler2D: function (uniform)\r\n {\r\n if (!uniform.value)\r\n {\r\n return;\r\n }\r\n\r\n var gl = this.gl;\r\n\r\n gl.activeTexture(gl.TEXTURE0 + this._textureCount);\r\n gl.bindTexture(gl.TEXTURE_2D, uniform.value);\r\n \r\n // Extended texture data\r\n\r\n var data = uniform.textureData;\r\n\r\n if (data)\r\n {\r\n // https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D\r\n \r\n // mag / minFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST\r\n // wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT\r\n // format can be: gl.LUMINANCE or gl.RGBA\r\n \r\n var magFilter = gl[GetFastValue(data, 'magFilter', 'linear').toUpperCase()];\r\n var minFilter = gl[GetFastValue(data, 'minFilter', 'linear').toUpperCase()];\r\n var wrapS = gl[GetFastValue(data, 'wrapS', 'repeat').toUpperCase()];\r\n var wrapT = gl[GetFastValue(data, 'wrapT', 'repeat').toUpperCase()];\r\n var format = gl[GetFastValue(data, 'format', 'rgba').toUpperCase()];\r\n\r\n if (data.repeat)\r\n {\r\n wrapS = gl.REPEAT;\r\n wrapT = gl.REPEAT;\r\n }\r\n\r\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, !!data.flipY);\r\n\r\n if (data.width)\r\n {\r\n var width = GetFastValue(data, 'width', 512);\r\n var height = GetFastValue(data, 'height', 2);\r\n var border = GetFastValue(data, 'border', 0);\r\n \r\n // texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels)\r\n gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null);\r\n }\r\n else\r\n {\r\n // texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels)\r\n gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.source);\r\n }\r\n \r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT);\r\n }\r\n\r\n this.renderer.setProgram(this.program);\r\n \r\n gl.uniform1i(uniform.uniformLocation, this._textureCount);\r\n \r\n this._textureCount++;\r\n },\r\n\r\n /**\r\n * Synchronizes all of the uniforms this shader uses.\r\n * Each uniforms gl function is called in turn.\r\n * \r\n * @method Phaser.GameObjects.Shader#syncUniforms\r\n * @private\r\n * @since 3.17.0\r\n */\r\n syncUniforms: function ()\r\n {\r\n var gl = this.gl;\r\n\r\n var uniforms = this.uniforms;\r\n var uniform;\r\n var length;\r\n var glFunc;\r\n var location;\r\n var value;\r\n var textureCount = 0;\r\n \r\n for (var key in uniforms)\r\n {\r\n uniform = uniforms[key];\r\n\r\n glFunc = uniform.glFunc;\r\n length = uniform.glValueLength;\r\n location = uniform.uniformLocation;\r\n value = uniform.value;\r\n\r\n if (value === null)\r\n {\r\n continue;\r\n }\r\n\r\n if (length === 1)\r\n {\r\n if (uniform.glMatrix)\r\n {\r\n glFunc.call(gl, location, uniform.transpose, value);\r\n }\r\n else\r\n {\r\n glFunc.call(gl, location, value);\r\n }\r\n }\r\n else if (length === 2)\r\n {\r\n glFunc.call(gl, location, value.x, value.y);\r\n }\r\n else if (length === 3)\r\n {\r\n glFunc.call(gl, location, value.x, value.y, value.z);\r\n }\r\n else if (length === 4)\r\n {\r\n glFunc.call(gl, location, value.x, value.y, value.z, value.w);\r\n }\r\n else if (uniform.type === 'sampler2D')\r\n {\r\n gl.activeTexture(gl['TEXTURE' + textureCount]);\r\n\r\n gl.bindTexture(gl.TEXTURE_2D, value);\r\n\r\n gl.uniform1i(location, textureCount);\r\n\r\n textureCount++;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Called automatically during render.\r\n * \r\n * This method performs matrix ITRS and then stores the resulting value in the `uViewMatrix` uniform.\r\n * It then sets up the vertex buffer and shader, updates and syncs the uniforms ready\r\n * for flush to be called.\r\n * \r\n * @method Phaser.GameObjects.Shader#load\r\n * @since 3.17.0\r\n * \r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [matrix2D] - The transform matrix to use during rendering.\r\n */\r\n load: function (matrix2D)\r\n {\r\n // ITRS\r\n\r\n var gl = this.gl;\r\n var width = this.width;\r\n var height = this.height;\r\n var renderer = this.renderer;\r\n var program = this.program;\r\n var vm = this.viewMatrix;\r\n\r\n if (!this.renderToTexture)\r\n {\r\n var x = -this._displayOriginX;\r\n var y = -this._displayOriginY;\r\n \r\n vm[0] = matrix2D[0];\r\n vm[1] = matrix2D[1];\r\n vm[4] = matrix2D[2];\r\n vm[5] = matrix2D[3];\r\n vm[8] = matrix2D[4];\r\n vm[9] = matrix2D[5];\r\n vm[12] = vm[0] * x + vm[4] * y;\r\n vm[13] = vm[1] * x + vm[5] * y;\r\n }\r\n\r\n // Update vertex shader uniforms\r\n\r\n gl.useProgram(program);\r\n\r\n gl.uniformMatrix4fv(gl.getUniformLocation(program, 'uViewMatrix'), false, vm);\r\n gl.uniform2f(gl.getUniformLocation(program, 'uResolution'), this.width, this.height);\r\n\r\n // Update fragment shader uniforms\r\n\r\n var uniforms = this.uniforms;\r\n var res = uniforms.resolution;\r\n\r\n res.value.x = width;\r\n res.value.y = height;\r\n\r\n uniforms.time.value = renderer.game.loop.getDuration();\r\n\r\n var pointer = this.pointer;\r\n\r\n if (pointer)\r\n {\r\n var mouse = uniforms.mouse;\r\n\r\n var px = pointer.x / width;\r\n var py = 1 - pointer.y / height;\r\n \r\n mouse.value.x = px.toFixed(2);\r\n mouse.value.y = py.toFixed(2);\r\n }\r\n\r\n this.syncUniforms();\r\n },\r\n\r\n /**\r\n * Called automatically during render.\r\n * \r\n * Sets the active shader, loads the vertex buffer and then draws.\r\n * \r\n * @method Phaser.GameObjects.Shader#flush\r\n * @since 3.17.0\r\n */\r\n flush: function ()\r\n {\r\n // Bind\r\n\r\n var width = this.width;\r\n var height = this.height;\r\n var program = this.program;\r\n\r\n var gl = this.gl;\r\n var vertexBuffer = this.vertexBuffer;\r\n var renderer = this.renderer;\r\n var vertexSize = Float32Array.BYTES_PER_ELEMENT * 2;\r\n\r\n if (this.renderToTexture)\r\n {\r\n renderer.setFramebuffer(this.framebuffer);\r\n\r\n gl.clearColor(0, 0, 0, 0);\r\n\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n }\r\n\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\r\n\r\n var location = gl.getAttribLocation(program, 'inPosition');\r\n\r\n if (location !== -1)\r\n {\r\n gl.enableVertexAttribArray(location);\r\n\r\n gl.vertexAttribPointer(location, 2, gl.FLOAT, false, vertexSize, 0);\r\n }\r\n\r\n // Draw\r\n\r\n var vf = this.vertexViewF32;\r\n\r\n vf[3] = height;\r\n vf[4] = width;\r\n vf[5] = height;\r\n vf[8] = width;\r\n vf[9] = height;\r\n vf[10] = width;\r\n\r\n // Flush\r\n\r\n var vertexCount = 6;\r\n\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize));\r\n\r\n gl.drawArrays(gl.TRIANGLES, 0, vertexCount);\r\n\r\n if (this.renderToTexture)\r\n {\r\n renderer.setFramebuffer(null, false);\r\n }\r\n },\r\n\r\n /**\r\n * A NOOP method so you can pass a Shader to a Container.\r\n * Calling this method will do nothing. It is intentionally empty.\r\n *\r\n * @method Phaser.GameObjects.Shader#setAlpha\r\n * @private\r\n * @since 3.17.0\r\n */\r\n setAlpha: function ()\r\n {\r\n },\r\n \r\n /**\r\n * A NOOP method so you can pass a Shader to a Container.\r\n * Calling this method will do nothing. It is intentionally empty.\r\n *\r\n * @method Phaser.GameObjects.Shader#setBlendMode\r\n * @private\r\n * @since 3.17.0\r\n */\r\n setBlendMode: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Internal destroy handler, called as part of the destroy process.\r\n *\r\n * @method Phaser.GameObjects.Shader#preDestroy\r\n * @protected\r\n * @since 3.17.0\r\n */\r\n preDestroy: function ()\r\n {\r\n var gl = this.gl;\r\n\r\n gl.deleteProgram(this.program);\r\n gl.deleteBuffer(this.vertexBuffer);\r\n\r\n if (this.renderToTexture)\r\n {\r\n this.renderer.deleteFramebuffer(this.framebuffer);\r\n\r\n this.texture.destroy();\r\n\r\n this.framebuffer = null;\r\n this.glTexture = null;\r\n this.texture = null;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Shader;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shader/Shader.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shader/ShaderCanvasRenderer.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shader/ShaderCanvasRenderer.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * This is a stub function for Shader.Render. There is no Canvas renderer for Shader objects.\r\n *\r\n * @method Phaser.GameObjects.Shader#renderCanvas\r\n * @since 3.17.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Shader} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n */\r\nvar ShaderCanvasRenderer = function ()\r\n{\r\n};\r\n\r\nmodule.exports = ShaderCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shader/ShaderCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shader/ShaderCreator.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shader/ShaderCreator.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BuildGameObject = __webpack_require__(/*! ../BuildGameObject */ \"./node_modules/phaser/src/gameobjects/BuildGameObject.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar Shader = __webpack_require__(/*! ./Shader */ \"./node_modules/phaser/src/gameobjects/shader/Shader.js\");\r\n\r\n/**\r\n * Creates a new Shader Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Shader Game Object and WebGL support have been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#shader\r\n * @since 3.17.0\r\n *\r\n * @param {object} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {Phaser.GameObjects.Shader} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('shader', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n var key = GetAdvancedValue(config, 'key', null);\r\n var x = GetAdvancedValue(config, 'x', 0);\r\n var y = GetAdvancedValue(config, 'y', 0);\r\n var width = GetAdvancedValue(config, 'width', 128);\r\n var height = GetAdvancedValue(config, 'height', 128);\r\n\r\n var shader = new Shader(this.scene, key, x, y, width, height);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, shader, config);\r\n\r\n return shader;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectCreator context.\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shader/ShaderCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shader/ShaderFactory.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shader/ShaderFactory.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Shader = __webpack_require__(/*! ./Shader */ \"./node_modules/phaser/src/gameobjects/shader/Shader.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Shader Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Shader Game Object and WebGL support have been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#shader\r\n * @webglOnly\r\n * @since 3.17.0\r\n *\r\n * @param {(string|Phaser.Display.BaseShader)} key - The key of the shader to use from the shader cache, or a BaseShader instance.\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [width=128] - The width of the Game Object.\r\n * @param {number} [height=128] - The height of the Game Object.\r\n * @param {string[]} [textures] - Optional array of texture keys to bind to the iChannel0...3 uniforms. The textures must already exist in the Texture Manager.\r\n * @param {object} [textureData] - Optional additional texture data.\r\n *\r\n * @return {Phaser.GameObjects.Shader} The Game Object that was created.\r\n */\r\nif (true)\r\n{\r\n GameObjectFactory.register('shader', function (key, x, y, width, height, textures, textureData)\r\n {\r\n return this.displayList.add(new Shader(this.scene, key, x, y, width, height, textures, textureData));\r\n });\r\n}\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shader/ShaderFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shader/ShaderRender.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shader/ShaderRender.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./ShaderWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/shader/ShaderWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./ShaderCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/shader/ShaderCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shader/ShaderRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shader/ShaderWebGLRenderer.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shader/ShaderWebGLRenderer.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Shader#renderWebGL\r\n * @since 3.17.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Shader} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar ShaderWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n if (!src.shader)\r\n {\r\n return;\r\n }\r\n\r\n var pipeline = renderer.currentPipeline;\r\n\r\n renderer.clearPipeline();\r\n\r\n if (src.renderToTexture)\r\n {\r\n src.load();\r\n src.flush();\r\n }\r\n else\r\n {\r\n var camMatrix = src._tempMatrix1;\r\n var shapeMatrix = src._tempMatrix2;\r\n var calcMatrix = src._tempMatrix3;\r\n \r\n shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n \r\n camMatrix.copyFrom(camera.matrix);\r\n \r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n \r\n // Undo the camera scroll\r\n shapeMatrix.e = src.x;\r\n shapeMatrix.f = src.y;\r\n }\r\n else\r\n {\r\n shapeMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n shapeMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n }\r\n \r\n camMatrix.multiply(shapeMatrix, calcMatrix);\r\n \r\n // Renderer size changed?\r\n if (renderer.width !== src._rendererWidth || renderer.height !== src._rendererHeight)\r\n {\r\n src.projOrtho(0, renderer.width, renderer.height, 0);\r\n }\r\n \r\n src.load(calcMatrix.matrix);\r\n src.flush();\r\n }\r\n\r\n renderer.rebindPipeline(pipeline);\r\n};\r\n\r\nmodule.exports = ShaderWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shader/ShaderWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/FillPathWebGL.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/FillPathWebGL.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Utils = __webpack_require__(/*! ../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders a filled path for the given Shape.\r\n *\r\n * @method Phaser.GameObjects.Shape#FillPathWebGL\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The WebGL Pipeline used to render this Shape.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} calcMatrix - The transform matrix used to get the position values.\r\n * @param {Phaser.GameObjects.Shape} src - The Game Object shape being rendered in this call.\r\n * @param {number} alpha - The base alpha value.\r\n * @param {number} dx - The source displayOriginX.\r\n * @param {number} dy - The source displayOriginY.\r\n */\r\nvar FillPathWebGL = function (pipeline, calcMatrix, src, alpha, dx, dy)\r\n{\r\n var fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha);\r\n\r\n var path = src.pathData;\r\n var pathIndexes = src.pathIndexes;\r\n\r\n for (var i = 0; i < pathIndexes.length; i += 3)\r\n {\r\n var p0 = pathIndexes[i] * 2;\r\n var p1 = pathIndexes[i + 1] * 2;\r\n var p2 = pathIndexes[i + 2] * 2;\r\n\r\n var x0 = path[p0 + 0] - dx;\r\n var y0 = path[p0 + 1] - dy;\r\n var x1 = path[p1 + 0] - dx;\r\n var y1 = path[p1 + 1] - dy;\r\n var x2 = path[p2 + 0] - dx;\r\n var y2 = path[p2 + 1] - dy;\r\n\r\n var tx0 = calcMatrix.getX(x0, y0);\r\n var ty0 = calcMatrix.getY(x0, y0);\r\n\r\n var tx1 = calcMatrix.getX(x1, y1);\r\n var ty1 = calcMatrix.getY(x1, y1);\r\n\r\n var tx2 = calcMatrix.getX(x2, y2);\r\n var ty2 = calcMatrix.getY(x2, y2);\r\n \r\n pipeline.setTexture2D();\r\n\r\n pipeline.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, 0, 0, 1, 1, fillTintColor, fillTintColor, fillTintColor, pipeline.tintEffect);\r\n }\r\n};\r\n\r\nmodule.exports = FillPathWebGL;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/FillPathWebGL.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/FillStyleCanvas.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/FillStyleCanvas.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sets the fillStyle on the target context based on the given Shape.\r\n *\r\n * @method Phaser.GameObjects.Shape#FillStyleCanvas\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The context to set the fill style on.\r\n * @param {Phaser.GameObjects.Shape} src - The Game Object to set the fill style from.\r\n * @param {number} [altColor] - An alternative color to render with.\r\n * @param {number} [altAlpha] - An alternative alpha to render with.\r\n */\r\nvar FillStyleCanvas = function (ctx, src, altColor, altAlpha)\r\n{\r\n var fillColor = (altColor) ? altColor : src.fillColor;\r\n var fillAlpha = (altAlpha) ? altAlpha : src.fillAlpha;\r\n\r\n var red = ((fillColor & 0xFF0000) >>> 16);\r\n var green = ((fillColor & 0xFF00) >>> 8);\r\n var blue = (fillColor & 0xFF);\r\n\r\n ctx.fillStyle = 'rgba(' + red + ',' + green + ',' + blue + ',' + fillAlpha + ')';\r\n};\r\n\r\nmodule.exports = FillStyleCanvas;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/FillStyleCanvas.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/LineStyleCanvas.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/LineStyleCanvas.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sets the strokeStyle and lineWidth on the target context based on the given Shape.\r\n *\r\n * @method Phaser.GameObjects.Shape#LineStyleCanvas\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The context to set the stroke style on.\r\n * @param {Phaser.GameObjects.Shape} src - The Game Object to set the stroke style from.\r\n * @param {number} [altColor] - An alternative color to render with.\r\n * @param {number} [altAlpha] - An alternative alpha to render with.\r\n */\r\nvar LineStyleCanvas = function (ctx, src, altColor, altAlpha)\r\n{\r\n var strokeColor = (altColor) ? altColor : src.strokeColor;\r\n var strokeAlpha = (altAlpha) ? altAlpha : src.strokeAlpha;\r\n\r\n var red = ((strokeColor & 0xFF0000) >>> 16);\r\n var green = ((strokeColor & 0xFF00) >>> 8);\r\n var blue = (strokeColor & 0xFF);\r\n\r\n ctx.strokeStyle = 'rgba(' + red + ',' + green + ',' + blue + ',' + strokeAlpha + ')';\r\n ctx.lineWidth = src.lineWidth;\r\n};\r\n\r\nmodule.exports = LineStyleCanvas;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/LineStyleCanvas.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/Shape.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/Shape.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar Line = __webpack_require__(/*! ../../geom/line/Line */ \"./node_modules/phaser/src/geom/line/Line.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Shape Game Object is a base class for the various different shapes, such as the Arc, Star or Polygon.\r\n * You cannot add a Shape directly to your Scene, it is meant as a base for your own custom Shape classes.\r\n *\r\n * @class Shape\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.13.0\r\n *\r\n * @extends Phaser.GameObjects.Components.AlphaSingle\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.ComputedSize\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {string} [type] - The internal type of the Shape.\r\n * @param {any} [data] - The data of the source shape geometry, if any.\r\n */\r\nvar Shape = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.AlphaSingle,\r\n Components.BlendMode,\r\n Components.ComputedSize,\r\n Components.Depth,\r\n Components.GetBounds,\r\n Components.Mask,\r\n Components.Origin,\r\n Components.Pipeline,\r\n Components.ScrollFactor,\r\n Components.Transform,\r\n Components.Visible\r\n ],\r\n\r\n initialize:\r\n\r\n function Shape (scene, type, data)\r\n {\r\n if (type === undefined) { type = 'Shape'; }\r\n\r\n GameObject.call(this, scene, type);\r\n\r\n /**\r\n * The source Shape data. Typically a geometry object.\r\n * You should not manipulate this directly.\r\n *\r\n * @name Phaser.GameObjects.Shape#data\r\n * @type {any}\r\n * @readonly\r\n * @since 3.13.0\r\n */\r\n this.geom = data;\r\n\r\n /**\r\n * Holds the polygon path data for filled rendering.\r\n *\r\n * @name Phaser.GameObjects.Shape#pathData\r\n * @type {number[]}\r\n * @readonly\r\n * @since 3.13.0\r\n */\r\n this.pathData = [];\r\n\r\n /**\r\n * Holds the earcut polygon path index data for filled rendering.\r\n *\r\n * @name Phaser.GameObjects.Shape#pathIndexes\r\n * @type {integer[]}\r\n * @readonly\r\n * @since 3.13.0\r\n */\r\n this.pathIndexes = [];\r\n\r\n /**\r\n * The fill color used by this Shape.\r\n *\r\n * @name Phaser.GameObjects.Shape#fillColor\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.fillColor = 0xffffff;\r\n\r\n /**\r\n * The fill alpha value used by this Shape.\r\n *\r\n * @name Phaser.GameObjects.Shape#fillAlpha\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.fillAlpha = 1;\r\n\r\n /**\r\n * The stroke color used by this Shape.\r\n *\r\n * @name Phaser.GameObjects.Shape#strokeColor\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.strokeColor = 0xffffff;\r\n\r\n /**\r\n * The stroke alpha value used by this Shape.\r\n *\r\n * @name Phaser.GameObjects.Shape#strokeAlpha\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.strokeAlpha = 1;\r\n\r\n /**\r\n * The stroke line width used by this Shape.\r\n *\r\n * @name Phaser.GameObjects.Shape#lineWidth\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.lineWidth = 1;\r\n\r\n /**\r\n * Controls if this Shape is filled or not.\r\n * Note that some Shapes do not support being filled (such as Line shapes)\r\n *\r\n * @name Phaser.GameObjects.Shape#isFilled\r\n * @type {boolean}\r\n * @since 3.13.0\r\n */\r\n this.isFilled = false;\r\n\r\n /**\r\n * Controls if this Shape is stroked or not.\r\n * Note that some Shapes do not support being stroked (such as Iso Box shapes)\r\n *\r\n * @name Phaser.GameObjects.Shape#isStroked\r\n * @type {boolean}\r\n * @since 3.13.0\r\n */\r\n this.isStroked = false;\r\n\r\n /**\r\n * Controls if this Shape path is closed during rendering when stroked.\r\n * Note that some Shapes are always closed when stroked (such as Ellipse shapes)\r\n *\r\n * @name Phaser.GameObjects.Shape#closePath\r\n * @type {boolean}\r\n * @since 3.13.0\r\n */\r\n this.closePath = true;\r\n\r\n /**\r\n * Private internal value.\r\n * A Line used when parsing internal path data to avoid constant object re-creation.\r\n *\r\n * @name Phaser.GameObjects.Curve#_tempLine\r\n * @type {Phaser.Geom.Line}\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._tempLine = new Line();\r\n\r\n this.initPipeline();\r\n },\r\n\r\n /**\r\n * Sets the fill color and alpha for this Shape.\r\n * \r\n * If you wish for the Shape to not be filled then call this method with no arguments, or just set `isFilled` to `false`.\r\n * \r\n * Note that some Shapes do not support fill colors, such as the Line shape.\r\n * \r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Shape#setFillStyle\r\n * @since 3.13.0\r\n * \r\n * @param {number} [color] - The color used to fill this shape. If not provided the Shape will not be filled.\r\n * @param {number} [alpha=1] - The alpha value used when filling this shape, if a fill color is given.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setFillStyle: function (color, alpha)\r\n {\r\n if (alpha === undefined) { alpha = 1; }\r\n\r\n if (color === undefined)\r\n {\r\n this.isFilled = false;\r\n }\r\n else\r\n {\r\n this.fillColor = color;\r\n this.fillAlpha = alpha;\r\n this.isFilled = true;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the stroke color and alpha for this Shape.\r\n * \r\n * If you wish for the Shape to not be stroked then call this method with no arguments, or just set `isStroked` to `false`.\r\n * \r\n * Note that some Shapes do not support being stroked, such as the Iso Box shape.\r\n * \r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Shape#setStrokeStyle\r\n * @since 3.13.0\r\n * \r\n * @param {number} [lineWidth] - The width of line to stroke with. If not provided or undefined the Shape will not be stroked.\r\n * @param {number} [color] - The color used to stroke this shape. If not provided the Shape will not be stroked.\r\n * @param {number} [alpha=1] - The alpha value used when stroking this shape, if a stroke color is given.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setStrokeStyle: function (lineWidth, color, alpha)\r\n {\r\n if (alpha === undefined) { alpha = 1; }\r\n\r\n if (lineWidth === undefined)\r\n {\r\n this.isStroked = false;\r\n }\r\n else\r\n {\r\n this.lineWidth = lineWidth;\r\n this.strokeColor = color;\r\n this.strokeAlpha = alpha;\r\n this.isStroked = true;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets if this Shape path is closed during rendering when stroked.\r\n * Note that some Shapes are always closed when stroked (such as Ellipse shapes)\r\n * \r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Shape#setClosePath\r\n * @since 3.13.0\r\n * \r\n * @param {boolean} value - Set to `true` if the Shape should be closed when stroked, otherwise `false`.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setClosePath: function (value)\r\n {\r\n this.closePath = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal destroy handler, called as part of the destroy process.\r\n *\r\n * @method Phaser.GameObjects.Shape#preDestroy\r\n * @protected\r\n * @since 3.13.0\r\n */\r\n preDestroy: function ()\r\n {\r\n this.geom = null;\r\n this._tempLine = null;\r\n this.pathData = [];\r\n this.pathIndexes = [];\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Shape;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/Shape.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/StrokePathWebGL.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/StrokePathWebGL.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Utils = __webpack_require__(/*! ../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders a stroke outline around the given Shape.\r\n *\r\n * @method Phaser.GameObjects.Shape#StrokePathWebGL\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The WebGL Pipeline used to render this Shape.\r\n * @param {Phaser.GameObjects.Shape} src - The Game Object shape being rendered in this call.\r\n * @param {number} alpha - The base alpha value.\r\n * @param {number} dx - The source displayOriginX.\r\n * @param {number} dy - The source displayOriginY.\r\n */\r\nvar StrokePathWebGL = function (pipeline, src, alpha, dx, dy)\r\n{\r\n var strokeTint = pipeline.strokeTint;\r\n var strokeTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.strokeColor, src.strokeAlpha * alpha);\r\n\r\n strokeTint.TL = strokeTintColor;\r\n strokeTint.TR = strokeTintColor;\r\n strokeTint.BL = strokeTintColor;\r\n strokeTint.BR = strokeTintColor;\r\n\r\n var path = src.pathData;\r\n var pathLength = path.length - 1;\r\n var lineWidth = src.lineWidth;\r\n var halfLineWidth = lineWidth / 2;\r\n\r\n var px1 = path[0] - dx;\r\n var py1 = path[1] - dy;\r\n\r\n if (!src.closePath)\r\n {\r\n pathLength -= 2;\r\n }\r\n\r\n for (var i = 2; i < pathLength; i += 2)\r\n {\r\n var px2 = path[i] - dx;\r\n var py2 = path[i + 1] - dy;\r\n\r\n pipeline.setTexture2D();\r\n\r\n pipeline.batchLine(\r\n px1,\r\n py1,\r\n px2,\r\n py2,\r\n halfLineWidth,\r\n halfLineWidth,\r\n lineWidth,\r\n i - 2,\r\n (src.closePath) ? (i === pathLength - 1) : false\r\n );\r\n\r\n px1 = px2;\r\n py1 = py2;\r\n }\r\n};\r\n\r\nmodule.exports = StrokePathWebGL;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/StrokePathWebGL.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/arc/Arc.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/arc/Arc.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ArcRender = __webpack_require__(/*! ./ArcRender */ \"./node_modules/phaser/src/gameobjects/shape/arc/ArcRender.js\");\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar DegToRad = __webpack_require__(/*! ../../../math/DegToRad */ \"./node_modules/phaser/src/math/DegToRad.js\");\r\nvar Earcut = __webpack_require__(/*! ../../../geom/polygon/Earcut */ \"./node_modules/phaser/src/geom/polygon/Earcut.js\");\r\nvar GeomCircle = __webpack_require__(/*! ../../../geom/circle/Circle */ \"./node_modules/phaser/src/geom/circle/Circle.js\");\r\nvar MATH_CONST = __webpack_require__(/*! ../../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\nvar Shape = __webpack_require__(/*! ../Shape */ \"./node_modules/phaser/src/gameobjects/shape/Shape.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Arc Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports both fill and stroke colors.\r\n * \r\n * When it renders it displays an arc shape. You can control the start and end angles of the arc,\r\n * as well as if the angles are winding clockwise or anti-clockwise. With the default settings\r\n * it renders as a complete circle. By changing the angles you can create other arc shapes,\r\n * such as half-circles.\r\n * \r\n * Arcs also have an `iterations` property and corresponding `setIterations` method. This allows\r\n * you to control how smooth the shape renders in WebGL, by controlling the number of iterations\r\n * that take place during construction.\r\n *\r\n * @class Arc\r\n * @extends Phaser.GameObjects.Shape\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.13.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [radius=128] - The radius of the arc.\r\n * @param {integer} [startAngle=0] - The start angle of the arc, in degrees.\r\n * @param {integer} [endAngle=360] - The end angle of the arc, in degrees.\r\n * @param {boolean} [anticlockwise=false] - The winding order of the start and end angles.\r\n * @param {number} [fillColor] - The color the arc will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n */\r\nvar Arc = new Class({\r\n\r\n Extends: Shape,\r\n\r\n Mixins: [\r\n ArcRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Arc (scene, x, y, radius, startAngle, endAngle, anticlockwise, fillColor, fillAlpha)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (radius === undefined) { radius = 128; }\r\n if (startAngle === undefined) { startAngle = 0; }\r\n if (endAngle === undefined) { endAngle = 360; }\r\n if (anticlockwise === undefined) { anticlockwise = false; }\r\n\r\n Shape.call(this, scene, 'Arc', new GeomCircle(0, 0, radius));\r\n\r\n /**\r\n * Private internal value. Holds the start angle in degrees.\r\n *\r\n * @name Phaser.GameObjects.Arc#_startAngle\r\n * @type {integer}\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._startAngle = startAngle;\r\n\r\n /**\r\n * Private internal value. Holds the end angle in degrees.\r\n *\r\n * @name Phaser.GameObjects.Arc#_endAngle\r\n * @type {integer}\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._endAngle = endAngle;\r\n\r\n /**\r\n * Private internal value. Holds the winding order of the start and end angles.\r\n *\r\n * @name Phaser.GameObjects.Arc#_anticlockwise\r\n * @type {boolean}\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._anticlockwise = anticlockwise;\r\n\r\n /**\r\n * Private internal value. Holds the number of iterations used when drawing the arc.\r\n *\r\n * @name Phaser.GameObjects.Arc#_iterations\r\n * @type {number}\r\n * @default 0.01\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._iterations = 0.01;\r\n\r\n this.setPosition(x, y);\r\n\r\n var diameter = this.geom.radius * 2;\r\n this.setSize(diameter, diameter);\r\n\r\n if (fillColor !== undefined)\r\n {\r\n this.setFillStyle(fillColor, fillAlpha);\r\n }\r\n\r\n this.updateDisplayOrigin();\r\n this.updateData();\r\n },\r\n\r\n /**\r\n * The number of iterations used when drawing the arc.\r\n * Increase this value for smoother arcs, at the cost of more polygons being rendered.\r\n * Modify this value by small amounts, such as 0.01.\r\n *\r\n * @name Phaser.GameObjects.Arc#iterations\r\n * @type {number}\r\n * @default 0.01\r\n * @since 3.13.0\r\n */\r\n iterations: {\r\n\r\n get: function ()\r\n {\r\n return this._iterations;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._iterations = value;\r\n\r\n this.updateData();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The radius of the arc.\r\n *\r\n * @name Phaser.GameObjects.Arc#radius\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n radius: {\r\n\r\n get: function ()\r\n {\r\n return this.geom.radius;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.geom.radius = value;\r\n\r\n var diameter = value * 2;\r\n this.setSize(diameter, diameter);\r\n this.updateDisplayOrigin();\r\n this.updateData();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The start angle of the arc, in degrees.\r\n *\r\n * @name Phaser.GameObjects.Arc#startAngle\r\n * @type {integer}\r\n * @since 3.13.0\r\n */\r\n startAngle: {\r\n\r\n get: function ()\r\n {\r\n return this._startAngle;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._startAngle = value;\r\n\r\n this.updateData();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The end angle of the arc, in degrees.\r\n *\r\n * @name Phaser.GameObjects.Arc#endAngle\r\n * @type {integer}\r\n * @since 3.13.0\r\n */\r\n endAngle: {\r\n\r\n get: function ()\r\n {\r\n return this._endAngle;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._endAngle = value;\r\n\r\n this.updateData();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The winding order of the start and end angles.\r\n *\r\n * @name Phaser.GameObjects.Arc#anticlockwise\r\n * @type {boolean}\r\n * @since 3.13.0\r\n */\r\n anticlockwise: {\r\n\r\n get: function ()\r\n {\r\n return this._anticlockwise;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._anticlockwise = value;\r\n\r\n this.updateData();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the radius of the arc.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Arc#setRadius\r\n * @since 3.13.0\r\n * \r\n * @param {number} value - The value to set the radius to.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setRadius: function (value)\r\n {\r\n this.radius = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the number of iterations used when drawing the arc.\r\n * Increase this value for smoother arcs, at the cost of more polygons being rendered.\r\n * Modify this value by small amounts, such as 0.01.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Arc#setIterations\r\n * @since 3.13.0\r\n * \r\n * @param {number} value - The value to set the iterations to.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setIterations: function (value)\r\n {\r\n if (value === undefined) { value = 0.01; }\r\n\r\n this.iterations = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the starting angle of the arc, in degrees.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Arc#setStartAngle\r\n * @since 3.13.0\r\n * \r\n * @param {integer} value - The value to set the starting angle to.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setStartAngle: function (angle, anticlockwise)\r\n {\r\n this._startAngle = angle;\r\n\r\n if (anticlockwise !== undefined)\r\n {\r\n this._anticlockwise = anticlockwise;\r\n }\r\n\r\n return this.updateData();\r\n },\r\n\r\n /**\r\n * Sets the ending angle of the arc, in degrees.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Arc#setEndAngle\r\n * @since 3.13.0\r\n * \r\n * @param {integer} value - The value to set the ending angle to.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setEndAngle: function (angle, anticlockwise)\r\n {\r\n this._endAngle = angle;\r\n\r\n if (anticlockwise !== undefined)\r\n {\r\n this._anticlockwise = anticlockwise;\r\n }\r\n\r\n return this.updateData();\r\n },\r\n\r\n /**\r\n * Internal method that updates the data and path values.\r\n *\r\n * @method Phaser.GameObjects.Arc#updateData\r\n * @private\r\n * @since 3.13.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n updateData: function ()\r\n {\r\n var step = this._iterations;\r\n var iteration = step;\r\n\r\n var radius = this.geom.radius;\r\n var startAngle = DegToRad(this._startAngle);\r\n var endAngle = DegToRad(this._endAngle);\r\n var anticlockwise = this._anticlockwise;\r\n\r\n var x = radius;\r\n var y = radius;\r\n\r\n endAngle -= startAngle;\r\n\r\n if (anticlockwise)\r\n {\r\n if (endAngle < -MATH_CONST.PI2)\r\n {\r\n endAngle = -MATH_CONST.PI2;\r\n }\r\n else if (endAngle > 0)\r\n {\r\n endAngle = -MATH_CONST.PI2 + endAngle % MATH_CONST.PI2;\r\n }\r\n }\r\n else if (endAngle > MATH_CONST.PI2)\r\n {\r\n endAngle = MATH_CONST.PI2;\r\n }\r\n else if (endAngle < 0)\r\n {\r\n endAngle = MATH_CONST.PI2 + endAngle % MATH_CONST.PI2;\r\n }\r\n\r\n var path = [ x + Math.cos(startAngle) * radius, y + Math.sin(startAngle) * radius ];\r\n\r\n var ta;\r\n\r\n while (iteration < 1)\r\n {\r\n ta = endAngle * iteration + startAngle;\r\n\r\n path.push(x + Math.cos(ta) * radius, y + Math.sin(ta) * radius);\r\n\r\n iteration += step;\r\n }\r\n\r\n ta = endAngle + startAngle;\r\n\r\n path.push(x + Math.cos(ta) * radius, y + Math.sin(ta) * radius);\r\n\r\n path.push(x + Math.cos(startAngle) * radius, y + Math.sin(startAngle) * radius);\r\n\r\n this.pathIndexes = Earcut(path);\r\n this.pathData = path;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Arc;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/arc/Arc.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/arc/ArcCanvasRenderer.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/arc/ArcCanvasRenderer.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar DegToRad = __webpack_require__(/*! ../../../math/DegToRad */ \"./node_modules/phaser/src/math/DegToRad.js\");\r\nvar FillStyleCanvas = __webpack_require__(/*! ../FillStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/FillStyleCanvas.js\");\r\nvar LineStyleCanvas = __webpack_require__(/*! ../LineStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/LineStyleCanvas.js\");\r\nvar SetTransform = __webpack_require__(/*! ../../../renderer/canvas/utils/SetTransform */ \"./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js\");\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Arc#renderCanvas\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Arc} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar ArcCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var ctx = renderer.currentContext;\r\n\r\n if (SetTransform(renderer, ctx, src, camera, parentMatrix))\r\n {\r\n var radius = src.radius;\r\n\r\n ctx.beginPath();\r\n\r\n ctx.arc(\r\n (radius) - src.originX * (radius * 2),\r\n (radius) - src.originY * (radius * 2),\r\n radius,\r\n DegToRad(src._startAngle),\r\n DegToRad(src._endAngle),\r\n src.anticlockwise\r\n );\r\n\r\n if (src.closePath)\r\n {\r\n ctx.closePath();\r\n }\r\n\r\n if (src.isFilled)\r\n {\r\n FillStyleCanvas(ctx, src);\r\n\r\n ctx.fill();\r\n }\r\n\r\n if (src.isStroked)\r\n {\r\n LineStyleCanvas(ctx, src);\r\n\r\n ctx.stroke();\r\n }\r\n\r\n // Restore the context saved in SetTransform\r\n ctx.restore();\r\n }\r\n};\r\n\r\nmodule.exports = ArcCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/arc/ArcCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/arc/ArcFactory.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/arc/ArcFactory.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Arc = __webpack_require__(/*! ./Arc */ \"./node_modules/phaser/src/gameobjects/shape/arc/Arc.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Arc Shape Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Arc Game Object has been built into Phaser.\r\n * \r\n * The Arc Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports both fill and stroke colors.\r\n * \r\n * When it renders it displays an arc shape. You can control the start and end angles of the arc,\r\n * as well as if the angles are winding clockwise or anti-clockwise. With the default settings\r\n * it renders as a complete circle. By changing the angles you can create other arc shapes,\r\n * such as half-circles.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#arc\r\n * @since 3.13.0\r\n *\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [radius=128] - The radius of the arc.\r\n * @param {integer} [startAngle=0] - The start angle of the arc, in degrees.\r\n * @param {integer} [endAngle=360] - The end angle of the arc, in degrees.\r\n * @param {boolean} [anticlockwise=false] - The winding order of the start and end angles.\r\n * @param {number} [fillColor] - The color the arc will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n *\r\n * @return {Phaser.GameObjects.Arc} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('arc', function (x, y, radius, startAngle, endAngle, anticlockwise, fillColor, fillAlpha)\r\n{\r\n return this.displayList.add(new Arc(this.scene, x, y, radius, startAngle, endAngle, anticlockwise, fillColor, fillAlpha));\r\n});\r\n\r\n/**\r\n * Creates a new Circle Shape Game Object and adds it to the Scene.\r\n * \r\n * A Circle is an Arc with no defined start and end angle, making it render as a complete circle.\r\n *\r\n * Note: This method will only be available if the Arc Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#circle\r\n * @since 3.13.0\r\n *\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [radius=128] - The radius of the circle.\r\n * @param {number} [fillColor] - The color the circle will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the circle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n *\r\n * @return {Phaser.GameObjects.Arc} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlpha)\r\n{\r\n return this.displayList.add(new Arc(this.scene, x, y, radius, 0, 360, false, fillColor, fillAlpha));\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/arc/ArcFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/arc/ArcRender.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/arc/ArcRender.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./ArcWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/shape/arc/ArcWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./ArcCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/shape/arc/ArcCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/arc/ArcRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/arc/ArcWebGLRenderer.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/arc/ArcWebGLRenderer.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FillPathWebGL = __webpack_require__(/*! ../FillPathWebGL */ \"./node_modules/phaser/src/gameobjects/shape/FillPathWebGL.js\");\r\nvar StrokePathWebGL = __webpack_require__(/*! ../StrokePathWebGL */ \"./node_modules/phaser/src/gameobjects/shape/StrokePathWebGL.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Arc#renderWebGL\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Arc} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar ArcWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var pipeline = this.pipeline;\r\n\r\n var camMatrix = pipeline._tempMatrix1;\r\n var shapeMatrix = pipeline._tempMatrix2;\r\n var calcMatrix = pipeline._tempMatrix3;\r\n\r\n renderer.setPipeline(pipeline);\r\n\r\n shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n shapeMatrix.e = src.x;\r\n shapeMatrix.f = src.y;\r\n }\r\n else\r\n {\r\n shapeMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n shapeMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n }\r\n\r\n camMatrix.multiply(shapeMatrix, calcMatrix);\r\n\r\n var dx = src._displayOriginX;\r\n var dy = src._displayOriginY;\r\n\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (src.isFilled)\r\n {\r\n FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy);\r\n }\r\n\r\n if (src.isStroked)\r\n {\r\n StrokePathWebGL(pipeline, src, alpha, dx, dy);\r\n }\r\n};\r\n\r\nmodule.exports = ArcWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/arc/ArcWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/curve/Curve.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/curve/Curve.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CurveRender = __webpack_require__(/*! ./CurveRender */ \"./node_modules/phaser/src/gameobjects/shape/curve/CurveRender.js\");\r\nvar Earcut = __webpack_require__(/*! ../../../geom/polygon/Earcut */ \"./node_modules/phaser/src/geom/polygon/Earcut.js\");\r\nvar Rectangle = __webpack_require__(/*! ../../../geom/rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar Shape = __webpack_require__(/*! ../Shape */ \"./node_modules/phaser/src/gameobjects/shape/Shape.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Curve Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports both fill and stroke colors.\r\n * \r\n * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to\r\n * the Curve Shape in the constructor.\r\n * \r\n * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method.\r\n * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations\r\n * that take place during construction. Increase and decrease the default value for smoother, or more\r\n * jagged, shapes.\r\n *\r\n * @class Curve\r\n * @extends Phaser.GameObjects.Shape\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.13.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {Phaser.Curves.Curve} [curve] - The Curve object to use to create the Shape.\r\n * @param {number} [fillColor] - The color the curve will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the curve will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n */\r\nvar Curve = new Class({\r\n\r\n Extends: Shape,\r\n\r\n Mixins: [\r\n CurveRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Curve (scene, x, y, curve, fillColor, fillAlpha)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n Shape.call(this, scene, 'Curve', curve);\r\n\r\n /**\r\n * Private internal value.\r\n * The number of points used to draw the curve. Higher values create smoother renders at the cost of more triangles being drawn.\r\n *\r\n * @name Phaser.GameObjects.Curve#_smoothness\r\n * @type {integer}\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._smoothness = 32;\r\n\r\n /**\r\n * Private internal value.\r\n * The Curve bounds rectangle.\r\n *\r\n * @name Phaser.GameObjects.Curve#_curveBounds\r\n * @type {Phaser.Geom.Rectangle}\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._curveBounds = new Rectangle();\r\n\r\n this.closePath = false;\r\n\r\n this.setPosition(x, y);\r\n\r\n if (fillColor !== undefined)\r\n {\r\n this.setFillStyle(fillColor, fillAlpha);\r\n }\r\n\r\n this.updateData();\r\n },\r\n\r\n /**\r\n * The smoothness of the curve. The number of points used when rendering it.\r\n * Increase this value for smoother curves, at the cost of more polygons being rendered.\r\n *\r\n * @name Phaser.GameObjects.Curve#smoothness\r\n * @type {integer}\r\n * @default 32\r\n * @since 3.13.0\r\n */\r\n smoothness: {\r\n\r\n get: function ()\r\n {\r\n return this._smoothness;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._smoothness = value;\r\n\r\n this.updateData();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the smoothness of the curve. The number of points used when rendering it.\r\n * Increase this value for smoother curves, at the cost of more polygons being rendered.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Curve#setSmoothness\r\n * @since 3.13.0\r\n * \r\n * @param {integer} value - The value to set the smoothness to.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setSmoothness: function (value)\r\n {\r\n this._smoothness = value;\r\n\r\n return this.updateData();\r\n },\r\n\r\n /**\r\n * Internal method that updates the data and path values.\r\n *\r\n * @method Phaser.GameObjects.Curve#updateData\r\n * @private\r\n * @since 3.13.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n updateData: function ()\r\n {\r\n var bounds = this._curveBounds;\r\n var smoothness = this._smoothness;\r\n\r\n // Update the bounds in case the underlying data has changed\r\n this.geom.getBounds(bounds, smoothness);\r\n\r\n this.setSize(bounds.width, bounds.height);\r\n this.updateDisplayOrigin();\r\n\r\n var path = [];\r\n var points = this.geom.getPoints(smoothness);\r\n\r\n for (var i = 0; i < points.length; i++)\r\n {\r\n path.push(points[i].x, points[i].y);\r\n }\r\n\r\n path.push(points[0].x, points[0].y);\r\n\r\n this.pathIndexes = Earcut(path);\r\n this.pathData = path;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Curve;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/curve/Curve.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/curve/CurveCanvasRenderer.js": /*!********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/curve/CurveCanvasRenderer.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FillStyleCanvas = __webpack_require__(/*! ../FillStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/FillStyleCanvas.js\");\r\nvar LineStyleCanvas = __webpack_require__(/*! ../LineStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/LineStyleCanvas.js\");\r\nvar SetTransform = __webpack_require__(/*! ../../../renderer/canvas/utils/SetTransform */ \"./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js\");\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Curve#renderCanvas\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Curve} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar CurveCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var ctx = renderer.currentContext;\r\n\r\n if (SetTransform(renderer, ctx, src, camera, parentMatrix))\r\n {\r\n var dx = src._displayOriginX + src._curveBounds.x;\r\n var dy = src._displayOriginY + src._curveBounds.y;\r\n \r\n var path = src.pathData;\r\n var pathLength = path.length - 1;\r\n \r\n var px1 = path[0] - dx;\r\n var py1 = path[1] - dy;\r\n\r\n ctx.beginPath();\r\n\r\n ctx.moveTo(px1, py1);\r\n \r\n if (!src.closePath)\r\n {\r\n pathLength -= 2;\r\n }\r\n \r\n for (var i = 2; i < pathLength; i += 2)\r\n {\r\n var px2 = path[i] - dx;\r\n var py2 = path[i + 1] - dy;\r\n \r\n ctx.lineTo(px2, py2);\r\n }\r\n\r\n if (src.closePath)\r\n {\r\n ctx.closePath();\r\n }\r\n\r\n if (src.isFilled)\r\n {\r\n FillStyleCanvas(ctx, src);\r\n\r\n ctx.fill();\r\n }\r\n\r\n if (src.isStroked)\r\n {\r\n LineStyleCanvas(ctx, src);\r\n\r\n ctx.stroke();\r\n }\r\n\r\n // Restore the context saved in SetTransform\r\n ctx.restore();\r\n }\r\n};\r\n\r\nmodule.exports = CurveCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/curve/CurveCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/curve/CurveFactory.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/curve/CurveFactory.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectFactory = __webpack_require__(/*! ../../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar Curve = __webpack_require__(/*! ./Curve */ \"./node_modules/phaser/src/gameobjects/shape/curve/Curve.js\");\r\n\r\n/**\r\n * Creates a new Curve Shape Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Curve Game Object has been built into Phaser.\r\n * \r\n * The Curve Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports both fill and stroke colors.\r\n * \r\n * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to\r\n * the Curve Shape in the constructor.\r\n * \r\n * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method.\r\n * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations\r\n * that take place during construction. Increase and decrease the default value for smoother, or more\r\n * jagged, shapes.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#curve\r\n * @since 3.13.0\r\n *\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {Phaser.Curves.Curve} [curve] - The Curve object to use to create the Shape.\r\n * @param {number} [fillColor] - The color the curve will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the curve will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n *\r\n * @return {Phaser.GameObjects.Curve} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha)\r\n{\r\n return this.displayList.add(new Curve(this.scene, x, y, curve, fillColor, fillAlpha));\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/curve/CurveFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/curve/CurveRender.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/curve/CurveRender.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./CurveWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/shape/curve/CurveWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./CurveCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/shape/curve/CurveCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/curve/CurveRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/curve/CurveWebGLRenderer.js": /*!*******************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/curve/CurveWebGLRenderer.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FillPathWebGL = __webpack_require__(/*! ../FillPathWebGL */ \"./node_modules/phaser/src/gameobjects/shape/FillPathWebGL.js\");\r\nvar StrokePathWebGL = __webpack_require__(/*! ../StrokePathWebGL */ \"./node_modules/phaser/src/gameobjects/shape/StrokePathWebGL.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Curve#renderWebGL\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Curve} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar CurveWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var pipeline = this.pipeline;\r\n\r\n var camMatrix = pipeline._tempMatrix1;\r\n var shapeMatrix = pipeline._tempMatrix2;\r\n var calcMatrix = pipeline._tempMatrix3;\r\n\r\n renderer.setPipeline(pipeline);\r\n\r\n shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n shapeMatrix.e = src.x;\r\n shapeMatrix.f = src.y;\r\n }\r\n else\r\n {\r\n shapeMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n shapeMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n }\r\n\r\n camMatrix.multiply(shapeMatrix, calcMatrix);\r\n\r\n var dx = src._displayOriginX + src._curveBounds.x;\r\n var dy = src._displayOriginY + src._curveBounds.y;\r\n\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (src.isFilled)\r\n {\r\n FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy);\r\n }\r\n\r\n if (src.isStroked)\r\n {\r\n StrokePathWebGL(pipeline, src, alpha, dx, dy);\r\n }\r\n};\r\n\r\nmodule.exports = CurveWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/curve/CurveWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/ellipse/Ellipse.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/ellipse/Ellipse.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Earcut = __webpack_require__(/*! ../../../geom/polygon/Earcut */ \"./node_modules/phaser/src/geom/polygon/Earcut.js\");\r\nvar EllipseRender = __webpack_require__(/*! ./EllipseRender */ \"./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseRender.js\");\r\nvar GeomEllipse = __webpack_require__(/*! ../../../geom/ellipse/Ellipse */ \"./node_modules/phaser/src/geom/ellipse/Ellipse.js\");\r\nvar Shape = __webpack_require__(/*! ../Shape */ \"./node_modules/phaser/src/gameobjects/shape/Shape.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Ellipse Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports both fill and stroke colors.\r\n * \r\n * When it renders it displays an ellipse shape. You can control the width and height of the ellipse.\r\n * If the width and height match it will render as a circle. If the width is less than the height,\r\n * it will look more like an egg shape.\r\n * \r\n * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method.\r\n * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations\r\n * that take place during construction. Increase and decrease the default value for smoother, or more\r\n * jagged, shapes.\r\n *\r\n * @class Ellipse\r\n * @extends Phaser.GameObjects.Shape\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.13.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [width=128] - The width of the ellipse. An ellipse with equal width and height renders as a circle.\r\n * @param {number} [height=128] - The height of the ellipse. An ellipse with equal width and height renders as a circle.\r\n * @param {number} [fillColor] - The color the ellipse will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the ellipse will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n */\r\nvar Ellipse = new Class({\r\n\r\n Extends: Shape,\r\n\r\n Mixins: [\r\n EllipseRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Ellipse (scene, x, y, width, height, fillColor, fillAlpha)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = 128; }\r\n if (height === undefined) { height = 128; }\r\n\r\n Shape.call(this, scene, 'Ellipse', new GeomEllipse(width / 2, height / 2, width, height));\r\n\r\n /**\r\n * Private internal value.\r\n * The number of points used to draw the curve. Higher values create smoother renders at the cost of more triangles being drawn.\r\n *\r\n * @name Phaser.GameObjects.Ellipse#_smoothness\r\n * @type {integer}\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._smoothness = 64;\r\n\r\n this.setPosition(x, y);\r\n\r\n this.width = width;\r\n this.height = height;\r\n\r\n if (fillColor !== undefined)\r\n {\r\n this.setFillStyle(fillColor, fillAlpha);\r\n }\r\n\r\n this.updateDisplayOrigin();\r\n this.updateData();\r\n },\r\n\r\n /**\r\n * The smoothness of the ellipse. The number of points used when rendering it.\r\n * Increase this value for a smoother ellipse, at the cost of more polygons being rendered.\r\n *\r\n * @name Phaser.GameObjects.Ellipse#smoothness\r\n * @type {integer}\r\n * @default 64\r\n * @since 3.13.0\r\n */\r\n smoothness: {\r\n\r\n get: function ()\r\n {\r\n return this._smoothness;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._smoothness = value;\r\n\r\n this.updateData();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the size of the ellipse by changing the underlying geometry data, rather than scaling the object.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Ellipse#setSize\r\n * @since 3.13.0\r\n * \r\n * @param {number} width - The width of the ellipse.\r\n * @param {number} height - The height of the ellipse.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setSize: function (width, height)\r\n {\r\n this.geom.setSize(width, height);\r\n\r\n return this.updateData();\r\n },\r\n\r\n /**\r\n * Sets the smoothness of the ellipse. The number of points used when rendering it.\r\n * Increase this value for a smoother ellipse, at the cost of more polygons being rendered.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Ellipse#setSmoothness\r\n * @since 3.13.0\r\n * \r\n * @param {integer} value - The value to set the smoothness to.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setSmoothness: function (value)\r\n {\r\n this._smoothness = value;\r\n\r\n return this.updateData();\r\n },\r\n\r\n /**\r\n * Internal method that updates the data and path values.\r\n *\r\n * @method Phaser.GameObjects.Ellipse#updateData\r\n * @private\r\n * @since 3.13.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n updateData: function ()\r\n {\r\n var path = [];\r\n var points = this.geom.getPoints(this._smoothness);\r\n\r\n for (var i = 0; i < points.length; i++)\r\n {\r\n path.push(points[i].x, points[i].y);\r\n }\r\n\r\n path.push(points[0].x, points[0].y);\r\n\r\n this.pathIndexes = Earcut(path);\r\n this.pathData = path;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Ellipse;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/ellipse/Ellipse.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseCanvasRenderer.js": /*!************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseCanvasRenderer.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FillStyleCanvas = __webpack_require__(/*! ../FillStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/FillStyleCanvas.js\");\r\nvar LineStyleCanvas = __webpack_require__(/*! ../LineStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/LineStyleCanvas.js\");\r\nvar SetTransform = __webpack_require__(/*! ../../../renderer/canvas/utils/SetTransform */ \"./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js\");\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Ellipse#renderCanvas\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Ellipse} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar EllipseCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var ctx = renderer.currentContext;\r\n\r\n if (SetTransform(renderer, ctx, src, camera, parentMatrix))\r\n {\r\n var dx = src._displayOriginX;\r\n var dy = src._displayOriginY;\r\n\r\n var path = src.pathData;\r\n var pathLength = path.length - 1;\r\n \r\n var px1 = path[0] - dx;\r\n var py1 = path[1] - dy;\r\n\r\n ctx.beginPath();\r\n\r\n ctx.moveTo(px1, py1);\r\n \r\n if (!src.closePath)\r\n {\r\n pathLength -= 2;\r\n }\r\n \r\n for (var i = 2; i < pathLength; i += 2)\r\n {\r\n var px2 = path[i] - dx;\r\n var py2 = path[i + 1] - dy;\r\n \r\n ctx.lineTo(px2, py2);\r\n }\r\n\r\n ctx.closePath();\r\n\r\n if (src.isFilled)\r\n {\r\n FillStyleCanvas(ctx, src);\r\n\r\n ctx.fill();\r\n }\r\n\r\n if (src.isStroked)\r\n {\r\n LineStyleCanvas(ctx, src);\r\n\r\n ctx.stroke();\r\n }\r\n\r\n // Restore the context saved in SetTransform\r\n ctx.restore();\r\n }\r\n};\r\n\r\nmodule.exports = EllipseCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseFactory.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseFactory.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Ellipse = __webpack_require__(/*! ./Ellipse */ \"./node_modules/phaser/src/gameobjects/shape/ellipse/Ellipse.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Ellipse Shape Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Ellipse Game Object has been built into Phaser.\r\n * \r\n * The Ellipse Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports both fill and stroke colors.\r\n * \r\n * When it renders it displays an ellipse shape. You can control the width and height of the ellipse.\r\n * If the width and height match it will render as a circle. If the width is less than the height,\r\n * it will look more like an egg shape.\r\n * \r\n * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method.\r\n * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations\r\n * that take place during construction. Increase and decrease the default value for smoother, or more\r\n * jagged, shapes.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#ellipse\r\n * @since 3.13.0\r\n *\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [width=128] - The width of the ellipse. An ellipse with equal width and height renders as a circle.\r\n * @param {number} [height=128] - The height of the ellipse. An ellipse with equal width and height renders as a circle.\r\n * @param {number} [fillColor] - The color the ellipse will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the ellipse will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n *\r\n * @return {Phaser.GameObjects.Ellipse} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('ellipse', function (x, y, width, height, fillColor, fillAlpha)\r\n{\r\n return this.displayList.add(new Ellipse(this.scene, x, y, width, height, fillColor, fillAlpha));\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseRender.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseRender.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./EllipseWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./EllipseCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseWebGLRenderer.js": /*!***********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseWebGLRenderer.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FillPathWebGL = __webpack_require__(/*! ../FillPathWebGL */ \"./node_modules/phaser/src/gameobjects/shape/FillPathWebGL.js\");\r\nvar StrokePathWebGL = __webpack_require__(/*! ../StrokePathWebGL */ \"./node_modules/phaser/src/gameobjects/shape/StrokePathWebGL.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Ellipse#renderWebGL\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Ellipse} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar EllipseWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var pipeline = this.pipeline;\r\n\r\n var camMatrix = pipeline._tempMatrix1;\r\n var shapeMatrix = pipeline._tempMatrix2;\r\n var calcMatrix = pipeline._tempMatrix3;\r\n\r\n renderer.setPipeline(pipeline);\r\n\r\n shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n shapeMatrix.e = src.x;\r\n shapeMatrix.f = src.y;\r\n }\r\n else\r\n {\r\n shapeMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n shapeMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n }\r\n\r\n camMatrix.multiply(shapeMatrix, calcMatrix);\r\n\r\n var dx = src._displayOriginX;\r\n var dy = src._displayOriginY;\r\n\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (src.isFilled)\r\n {\r\n FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy);\r\n }\r\n\r\n if (src.isStroked)\r\n {\r\n StrokePathWebGL(pipeline, src, alpha, dx, dy);\r\n }\r\n};\r\n\r\nmodule.exports = EllipseWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/ellipse/EllipseWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/grid/Grid.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/grid/Grid.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Shape = __webpack_require__(/*! ../Shape */ \"./node_modules/phaser/src/gameobjects/shape/Shape.js\");\r\nvar GridRender = __webpack_require__(/*! ./GridRender */ \"./node_modules/phaser/src/gameobjects/shape/grid/GridRender.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Grid Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports only fill colors and cannot be stroked.\r\n * \r\n * A Grid Shape allows you to display a grid in your game, where you can control the size of the\r\n * grid as well as the width and height of the grid cells. You can set a fill color for each grid\r\n * cell as well as an alternate fill color. When the alternate fill color is set then the grid\r\n * cells will alternate the fill colors as they render, creating a chess-board effect. You can\r\n * also optionally have an outline fill color. If set, this draws lines between the grid cells\r\n * in the given color. If you specify an outline color with an alpha of zero, then it will draw\r\n * the cells spaced out, but without the lines between them.\r\n *\r\n * @class Grid\r\n * @extends Phaser.GameObjects.Shape\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.13.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [width=128] - The width of the grid.\r\n * @param {number} [height=128] - The height of the grid.\r\n * @param {number} [cellWidth=32] - The width of one cell in the grid.\r\n * @param {number} [cellHeight=32] - The height of one cell in the grid.\r\n * @param {number} [fillColor] - The color the grid cells will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n * @param {number} [outlineFillColor] - The color of the lines between the grid cells. See the `setOutline` method.\r\n * @param {number} [outlineFillAlpha] - The alpha of the lines between the grid cells.\r\n */\r\nvar Grid = new Class({\r\n\r\n Extends: Shape,\r\n\r\n Mixins: [\r\n GridRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Grid (scene, x, y, width, height, cellWidth, cellHeight, fillColor, fillAlpha, outlineFillColor, outlineFillAlpha)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = 128; }\r\n if (height === undefined) { height = 128; }\r\n if (cellWidth === undefined) { cellWidth = 32; }\r\n if (cellHeight === undefined) { cellHeight = 32; }\r\n\r\n Shape.call(this, scene, 'Grid', null);\r\n\r\n /**\r\n * The width of each grid cell.\r\n * Must be a positive value.\r\n *\r\n * @name Phaser.GameObjects.Grid#cellWidth\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.cellWidth = cellWidth;\r\n\r\n /**\r\n * The height of each grid cell.\r\n * Must be a positive value.\r\n *\r\n * @name Phaser.GameObjects.Grid#cellHeight\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.cellHeight = cellHeight;\r\n\r\n /**\r\n * Will the grid render its cells in the `fillColor`?\r\n *\r\n * @name Phaser.GameObjects.Grid#showCells\r\n * @type {boolean}\r\n * @since 3.13.0\r\n */\r\n this.showCells = true;\r\n\r\n /**\r\n * The color of the lines between each grid cell.\r\n *\r\n * @name Phaser.GameObjects.Grid#outlineFillColor\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.outlineFillColor = 0;\r\n\r\n /**\r\n * The alpha value for the color of the lines between each grid cell.\r\n *\r\n * @name Phaser.GameObjects.Grid#outlineFillAlpha\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.outlineFillAlpha = 0;\r\n\r\n /**\r\n * Will the grid display the lines between each cell when it renders?\r\n *\r\n * @name Phaser.GameObjects.Grid#showOutline\r\n * @type {boolean}\r\n * @since 3.13.0\r\n */\r\n this.showOutline = true;\r\n\r\n /**\r\n * Will the grid render the alternating cells in the `altFillColor`?\r\n *\r\n * @name Phaser.GameObjects.Grid#showAltCells\r\n * @type {boolean}\r\n * @since 3.13.0\r\n */\r\n this.showAltCells = false;\r\n\r\n /**\r\n * The color the alternating grid cells will be filled with, i.e. 0xff0000 for red.\r\n *\r\n * @name Phaser.GameObjects.Grid#altFillColor\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.altFillColor;\r\n\r\n /**\r\n * The alpha the alternating grid cells will be filled with.\r\n * You can also set the alpha of the overall Shape using its `alpha` property.\r\n *\r\n * @name Phaser.GameObjects.Grid#altFillAlpha\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.altFillAlpha;\r\n\r\n this.setPosition(x, y);\r\n this.setSize(width, height);\r\n\r\n if (fillColor !== undefined)\r\n {\r\n this.setFillStyle(fillColor, fillAlpha);\r\n }\r\n\r\n if (outlineFillColor !== undefined)\r\n {\r\n this.setOutlineStyle(outlineFillColor, outlineFillAlpha);\r\n }\r\n\r\n this.updateDisplayOrigin();\r\n },\r\n\r\n /**\r\n * Sets the fill color and alpha level the grid cells will use when rendering.\r\n * \r\n * If this method is called with no values then the grid cells will not be rendered, \r\n * however the grid lines and alternating cells may still be.\r\n * \r\n * Also see the `setOutlineStyle` and `setAltFillStyle` methods.\r\n * \r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Grid#setFillStyle\r\n * @since 3.13.0\r\n * \r\n * @param {number} [fillColor] - The color the grid cells will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha=1] - The alpha the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setFillStyle: function (fillColor, fillAlpha)\r\n {\r\n if (fillAlpha === undefined) { fillAlpha = 1; }\r\n\r\n if (fillColor === undefined)\r\n {\r\n this.showCells = false;\r\n }\r\n else\r\n {\r\n this.fillColor = fillColor;\r\n this.fillAlpha = fillAlpha;\r\n this.showCells = true;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the fill color and alpha level that the alternating grid cells will use.\r\n * \r\n * If this method is called with no values then alternating grid cells will not be rendered in a different color.\r\n * \r\n * Also see the `setOutlineStyle` and `setFillStyle` methods.\r\n * \r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Grid#setAltFillStyle\r\n * @since 3.13.0\r\n * \r\n * @param {number} [fillColor] - The color the alternating grid cells will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha=1] - The alpha the alternating grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setAltFillStyle: function (fillColor, fillAlpha)\r\n {\r\n if (fillAlpha === undefined) { fillAlpha = 1; }\r\n\r\n if (fillColor === undefined)\r\n {\r\n this.showAltCells = false;\r\n }\r\n else\r\n {\r\n this.altFillColor = fillColor;\r\n this.altFillAlpha = fillAlpha;\r\n this.showAltCells = true;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the fill color and alpha level that the lines between each grid cell will use.\r\n * \r\n * If this method is called with no values then the grid lines will not be rendered at all, however\r\n * the cells themselves may still be if they have colors set.\r\n * \r\n * Also see the `setFillStyle` and `setAltFillStyle` methods.\r\n * \r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Grid#setOutlineStyle\r\n * @since 3.13.0\r\n * \r\n * @param {number} [fillColor] - The color the lines between the grid cells will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha=1] - The alpha the lines between the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setOutlineStyle: function (fillColor, fillAlpha)\r\n {\r\n if (fillAlpha === undefined) { fillAlpha = 1; }\r\n\r\n if (fillColor === undefined)\r\n {\r\n this.showOutline = false;\r\n }\r\n else\r\n {\r\n this.outlineFillColor = fillColor;\r\n this.outlineFillAlpha = fillAlpha;\r\n this.showOutline = true;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Grid;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/grid/Grid.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/grid/GridCanvasRenderer.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/grid/GridCanvasRenderer.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FillStyleCanvas = __webpack_require__(/*! ../FillStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/FillStyleCanvas.js\");\r\nvar LineStyleCanvas = __webpack_require__(/*! ../LineStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/LineStyleCanvas.js\");\r\nvar SetTransform = __webpack_require__(/*! ../../../renderer/canvas/utils/SetTransform */ \"./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js\");\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Grid#renderCanvas\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Grid} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar GridCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var ctx = renderer.currentContext;\r\n\r\n if (SetTransform(renderer, ctx, src, camera, parentMatrix))\r\n {\r\n var dx = -src._displayOriginX;\r\n var dy = -src._displayOriginY;\r\n\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n // Work out the grid size\r\n\r\n var width = src.width;\r\n var height = src.height;\r\n\r\n var cellWidth = src.cellWidth;\r\n var cellHeight = src.cellHeight;\r\n\r\n var gridWidth = Math.ceil(width / cellWidth);\r\n var gridHeight = Math.ceil(height / cellHeight);\r\n\r\n var cellWidthA = cellWidth;\r\n var cellHeightA = cellHeight;\r\n\r\n var cellWidthB = cellWidth - ((gridWidth * cellWidth) - width);\r\n var cellHeightB = cellHeight - ((gridHeight * cellHeight) - height);\r\n\r\n var showCells = src.showCells;\r\n var showAltCells = src.showAltCells;\r\n var showOutline = src.showOutline;\r\n\r\n var x = 0;\r\n var y = 0;\r\n var r = 0;\r\n var cw = 0;\r\n var ch = 0;\r\n\r\n if (showOutline)\r\n {\r\n // To make room for the grid lines (in case alpha < 1)\r\n cellWidthA--;\r\n cellHeightA--;\r\n\r\n if (cellWidthB === cellWidth)\r\n {\r\n cellWidthB--;\r\n }\r\n\r\n if (cellHeightB === cellHeight)\r\n {\r\n cellHeightB--;\r\n }\r\n }\r\n\r\n if (showCells && src.fillAlpha > 0)\r\n {\r\n FillStyleCanvas(ctx, src);\r\n\r\n for (y = 0; y < gridHeight; y++)\r\n {\r\n if (showAltCells)\r\n {\r\n r = y % 2;\r\n }\r\n\r\n for (x = 0; x < gridWidth; x++)\r\n {\r\n if (showAltCells && r)\r\n {\r\n r = 0;\r\n continue;\r\n }\r\n\r\n r++;\r\n\r\n cw = (x < gridWidth - 1) ? cellWidthA : cellWidthB;\r\n ch = (y < gridHeight - 1) ? cellHeightA : cellHeightB;\r\n\r\n ctx.fillRect(\r\n dx + x * cellWidth,\r\n dy + y * cellHeight,\r\n cw,\r\n ch\r\n );\r\n }\r\n }\r\n }\r\n\r\n if (showAltCells && src.altFillAlpha > 0)\r\n {\r\n FillStyleCanvas(ctx, src, src.altFillColor, src.altFillAlpha * alpha);\r\n\r\n for (y = 0; y < gridHeight; y++)\r\n {\r\n if (showAltCells)\r\n {\r\n r = y % 2;\r\n }\r\n\r\n for (x = 0; x < gridWidth; x++)\r\n {\r\n if (showAltCells && !r)\r\n {\r\n r = 1;\r\n continue;\r\n }\r\n\r\n r = 0;\r\n\r\n cw = (x < gridWidth - 1) ? cellWidthA : cellWidthB;\r\n ch = (y < gridHeight - 1) ? cellHeightA : cellHeightB;\r\n\r\n ctx.fillRect(\r\n dx + x * cellWidth,\r\n dy + y * cellHeight,\r\n cw,\r\n ch\r\n );\r\n }\r\n }\r\n }\r\n\r\n if (showOutline && src.outlineFillAlpha > 0)\r\n {\r\n LineStyleCanvas(ctx, src, src.outlineFillColor, src.outlineFillAlpha * alpha);\r\n\r\n for (x = 1; x < gridWidth; x++)\r\n {\r\n var x1 = x * cellWidth;\r\n\r\n ctx.beginPath();\r\n\r\n ctx.moveTo(x1 + dx, dy);\r\n ctx.lineTo(x1 + dx, height + dy);\r\n\r\n ctx.stroke();\r\n }\r\n\r\n for (y = 1; y < gridHeight; y++)\r\n {\r\n var y1 = y * cellHeight;\r\n\r\n ctx.beginPath();\r\n\r\n ctx.moveTo(dx, y1 + dy);\r\n ctx.lineTo(dx + width, y1 + dy);\r\n\r\n ctx.stroke();\r\n }\r\n }\r\n\r\n // Restore the context saved in SetTransform\r\n ctx.restore();\r\n }\r\n};\r\n\r\nmodule.exports = GridCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/grid/GridCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/grid/GridFactory.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/grid/GridFactory.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectFactory = __webpack_require__(/*! ../../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar Grid = __webpack_require__(/*! ./Grid */ \"./node_modules/phaser/src/gameobjects/shape/grid/Grid.js\");\r\n\r\n/**\r\n * Creates a new Grid Shape Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Grid Game Object has been built into Phaser.\r\n * \r\n * The Grid Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports only fill colors and cannot be stroked.\r\n * \r\n * A Grid Shape allows you to display a grid in your game, where you can control the size of the\r\n * grid as well as the width and height of the grid cells. You can set a fill color for each grid\r\n * cell as well as an alternate fill color. When the alternate fill color is set then the grid\r\n * cells will alternate the fill colors as they render, creating a chess-board effect. You can\r\n * also optionally have an outline fill color. If set, this draws lines between the grid cells\r\n * in the given color. If you specify an outline color with an alpha of zero, then it will draw\r\n * the cells spaced out, but without the lines between them.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#grid\r\n * @since 3.13.0\r\n *\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [width=128] - The width of the grid.\r\n * @param {number} [height=128] - The height of the grid.\r\n * @param {number} [cellWidth=32] - The width of one cell in the grid.\r\n * @param {number} [cellHeight=32] - The height of one cell in the grid.\r\n * @param {number} [fillColor] - The color the grid cells will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n * @param {number} [outlineFillColor] - The color of the lines between the grid cells.\r\n * @param {number} [outlineFillAlpha] - The alpha of the lines between the grid cells.\r\n *\r\n * @return {Phaser.GameObjects.Grid} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cellHeight, fillColor, fillAlpha, outlineFillColor, outlineFillAlpha)\r\n{\r\n return this.displayList.add(new Grid(this.scene, x, y, width, height, cellWidth, cellHeight, fillColor, fillAlpha, outlineFillColor, outlineFillAlpha));\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/grid/GridFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/grid/GridRender.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/grid/GridRender.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./GridWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/shape/grid/GridWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./GridCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/shape/grid/GridCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/grid/GridRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/grid/GridWebGLRenderer.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/grid/GridWebGLRenderer.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Utils = __webpack_require__(/*! ../../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Grid#renderWebGL\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Grid} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var pipeline = this.pipeline;\r\n\r\n var camMatrix = pipeline._tempMatrix1;\r\n var shapeMatrix = pipeline._tempMatrix2;\r\n var calcMatrix = pipeline._tempMatrix3;\r\n\r\n renderer.setPipeline(pipeline);\r\n\r\n shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n shapeMatrix.e = src.x;\r\n shapeMatrix.f = src.y;\r\n }\r\n else\r\n {\r\n shapeMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n shapeMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n }\r\n\r\n camMatrix.multiply(shapeMatrix, calcMatrix);\r\n\r\n calcMatrix.translate(-src._displayOriginX, -src._displayOriginY);\r\n\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n // Work out the grid size\r\n\r\n var width = src.width;\r\n var height = src.height;\r\n\r\n var cellWidth = src.cellWidth;\r\n var cellHeight = src.cellHeight;\r\n\r\n var gridWidth = Math.ceil(width / cellWidth);\r\n var gridHeight = Math.ceil(height / cellHeight);\r\n\r\n var cellWidthA = cellWidth;\r\n var cellHeightA = cellHeight;\r\n\r\n var cellWidthB = cellWidth - ((gridWidth * cellWidth) - width);\r\n var cellHeightB = cellHeight - ((gridHeight * cellHeight) - height);\r\n\r\n var fillTint;\r\n var fillTintColor;\r\n\r\n var showCells = src.showCells;\r\n var showAltCells = src.showAltCells;\r\n var showOutline = src.showOutline;\r\n\r\n var x = 0;\r\n var y = 0;\r\n var r = 0;\r\n var cw = 0;\r\n var ch = 0;\r\n\r\n if (showOutline)\r\n {\r\n // To make room for the grid lines (in case alpha < 1)\r\n cellWidthA--;\r\n cellHeightA--;\r\n\r\n if (cellWidthB === cellWidth)\r\n {\r\n cellWidthB--;\r\n }\r\n\r\n if (cellHeightB === cellHeight)\r\n {\r\n cellHeightB--;\r\n }\r\n }\r\n\r\n if (showCells && src.fillAlpha > 0)\r\n {\r\n fillTint = pipeline.fillTint;\r\n fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha);\r\n \r\n fillTint.TL = fillTintColor;\r\n fillTint.TR = fillTintColor;\r\n fillTint.BL = fillTintColor;\r\n fillTint.BR = fillTintColor;\r\n\r\n for (y = 0; y < gridHeight; y++)\r\n {\r\n if (showAltCells)\r\n {\r\n r = y % 2;\r\n }\r\n\r\n for (x = 0; x < gridWidth; x++)\r\n {\r\n if (showAltCells && r)\r\n {\r\n r = 0;\r\n continue;\r\n }\r\n\r\n r++;\r\n\r\n cw = (x < gridWidth - 1) ? cellWidthA : cellWidthB;\r\n ch = (y < gridHeight - 1) ? cellHeightA : cellHeightB;\r\n\r\n pipeline.setTexture2D();\r\n\r\n pipeline.batchFillRect(\r\n x * cellWidth,\r\n y * cellHeight,\r\n cw,\r\n ch\r\n );\r\n }\r\n }\r\n }\r\n\r\n if (showAltCells && src.altFillAlpha > 0)\r\n {\r\n fillTint = pipeline.fillTint;\r\n fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.altFillColor, src.altFillAlpha * alpha);\r\n \r\n fillTint.TL = fillTintColor;\r\n fillTint.TR = fillTintColor;\r\n fillTint.BL = fillTintColor;\r\n fillTint.BR = fillTintColor;\r\n\r\n for (y = 0; y < gridHeight; y++)\r\n {\r\n if (showAltCells)\r\n {\r\n r = y % 2;\r\n }\r\n\r\n for (x = 0; x < gridWidth; x++)\r\n {\r\n if (showAltCells && !r)\r\n {\r\n r = 1;\r\n continue;\r\n }\r\n\r\n r = 0;\r\n\r\n cw = (x < gridWidth - 1) ? cellWidthA : cellWidthB;\r\n ch = (y < gridHeight - 1) ? cellHeightA : cellHeightB;\r\n\r\n pipeline.setTexture2D();\r\n\r\n pipeline.batchFillRect(\r\n x * cellWidth,\r\n y * cellHeight,\r\n cw,\r\n ch\r\n );\r\n }\r\n }\r\n }\r\n\r\n if (showOutline && src.outlineFillAlpha > 0)\r\n {\r\n var strokeTint = pipeline.strokeTint;\r\n var color = Utils.getTintAppendFloatAlphaAndSwap(src.outlineFillColor, src.outlineFillAlpha * alpha);\r\n\r\n strokeTint.TL = color;\r\n strokeTint.TR = color;\r\n strokeTint.BL = color;\r\n strokeTint.BR = color;\r\n\r\n for (x = 1; x < gridWidth; x++)\r\n {\r\n var x1 = x * cellWidth;\r\n\r\n pipeline.setTexture2D();\r\n\r\n pipeline.batchLine(x1, 0, x1, height, 1, 1, 1, 0, false);\r\n }\r\n\r\n for (y = 1; y < gridHeight; y++)\r\n {\r\n var y1 = y * cellHeight;\r\n\r\n pipeline.setTexture2D();\r\n\r\n pipeline.batchLine(0, y1, width, y1, 1, 1, 1, 0, false);\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = GridWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/grid/GridWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/isobox/IsoBox.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/isobox/IsoBox.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar IsoBoxRender = __webpack_require__(/*! ./IsoBoxRender */ \"./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxRender.js\");\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Shape = __webpack_require__(/*! ../Shape */ \"./node_modules/phaser/src/gameobjects/shape/Shape.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The IsoBox Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports only fill colors and cannot be stroked.\r\n * \r\n * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set\r\n * the color of the top, left and right faces of the rectangle respectively. You can also choose\r\n * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties.\r\n * \r\n * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting\r\n * the `projection` property.\r\n *\r\n * @class IsoBox\r\n * @extends Phaser.GameObjects.Shape\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.13.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [size=48] - The width of the iso box in pixels. The left and right faces will be exactly half this value.\r\n * @param {number} [height=32] - The height of the iso box. The left and right faces will be this tall. The overall height of the isobox will be this value plus half the `size` value.\r\n * @param {number} [fillTop=0xeeeeee] - The fill color of the top face of the iso box.\r\n * @param {number} [fillLeft=0x999999] - The fill color of the left face of the iso box.\r\n * @param {number} [fillRight=0xcccccc] - The fill color of the right face of the iso box.\r\n */\r\nvar IsoBox = new Class({\r\n\r\n Extends: Shape,\r\n\r\n Mixins: [\r\n IsoBoxRender\r\n ],\r\n\r\n initialize:\r\n\r\n function IsoBox (scene, x, y, size, height, fillTop, fillLeft, fillRight)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (size === undefined) { size = 48; }\r\n if (height === undefined) { height = 32; }\r\n if (fillTop === undefined) { fillTop = 0xeeeeee; }\r\n if (fillLeft === undefined) { fillLeft = 0x999999; }\r\n if (fillRight === undefined) { fillRight = 0xcccccc; }\r\n\r\n Shape.call(this, scene, 'IsoBox', null);\r\n\r\n /**\r\n * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box.\r\n *\r\n * @name Phaser.GameObjects.IsoBox#projection\r\n * @type {integer}\r\n * @default 4\r\n * @since 3.13.0\r\n */\r\n this.projection = 4;\r\n\r\n /**\r\n * The color used to fill in the top of the iso box.\r\n *\r\n * @name Phaser.GameObjects.IsoBox#fillTop\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.fillTop = fillTop;\r\n\r\n /**\r\n * The color used to fill in the left-facing side of the iso box.\r\n *\r\n * @name Phaser.GameObjects.IsoBox#fillLeft\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.fillLeft = fillLeft;\r\n\r\n /**\r\n * The color used to fill in the right-facing side of the iso box.\r\n *\r\n * @name Phaser.GameObjects.IsoBox#fillRight\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.fillRight = fillRight;\r\n\r\n /**\r\n * Controls if the top-face of the iso box be rendered.\r\n *\r\n * @name Phaser.GameObjects.IsoBox#showTop\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.13.0\r\n */\r\n this.showTop = true;\r\n\r\n /**\r\n * Controls if the left-face of the iso box be rendered.\r\n *\r\n * @name Phaser.GameObjects.IsoBox#showLeft\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.13.0\r\n */\r\n this.showLeft = true;\r\n\r\n /**\r\n * Controls if the right-face of the iso box be rendered.\r\n *\r\n * @name Phaser.GameObjects.IsoBox#showRight\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.13.0\r\n */\r\n this.showRight = true;\r\n\r\n this.isFilled = true;\r\n\r\n this.setPosition(x, y);\r\n this.setSize(size, height);\r\n\r\n this.updateDisplayOrigin();\r\n },\r\n\r\n /**\r\n * Sets the projection level of the iso box. Change this to change the 'angle' at which you are looking at the box.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.IsoBox#setProjection\r\n * @since 3.13.0\r\n * \r\n * @param {integer} value - The value to set the projection to.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setProjection: function (value)\r\n {\r\n this.projection = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets which faces of the iso box will be rendered.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.IsoBox#setFaces\r\n * @since 3.13.0\r\n * \r\n * @param {boolean} [showTop=true] - Show the top-face of the iso box.\r\n * @param {boolean} [showLeft=true] - Show the left-face of the iso box.\r\n * @param {boolean} [showRight=true] - Show the right-face of the iso box.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setFaces: function (showTop, showLeft, showRight)\r\n {\r\n if (showTop === undefined) { showTop = true; }\r\n if (showLeft === undefined) { showLeft = true; }\r\n if (showRight === undefined) { showRight = true; }\r\n\r\n this.showTop = showTop;\r\n this.showLeft = showLeft;\r\n this.showRight = showRight;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the fill colors for each face of the iso box.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.IsoBox#setFillStyle\r\n * @since 3.13.0\r\n * \r\n * @param {number} [fillTop] - The color used to fill the top of the iso box.\r\n * @param {number} [fillLeft] - The color used to fill in the left-facing side of the iso box.\r\n * @param {number} [fillRight] - The color used to fill in the right-facing side of the iso box.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setFillStyle: function (fillTop, fillLeft, fillRight)\r\n {\r\n this.fillTop = fillTop;\r\n this.fillLeft = fillLeft;\r\n this.fillRight = fillRight;\r\n\r\n this.isFilled = true;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = IsoBox;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/isobox/IsoBox.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxCanvasRenderer.js": /*!**********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxCanvasRenderer.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FillStyleCanvas = __webpack_require__(/*! ../FillStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/FillStyleCanvas.js\");\r\nvar SetTransform = __webpack_require__(/*! ../../../renderer/canvas/utils/SetTransform */ \"./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js\");\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.IsoBox#renderCanvas\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.IsoBox} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar IsoBoxCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var ctx = renderer.currentContext;\r\n\r\n if (SetTransform(renderer, ctx, src, camera, parentMatrix) && src.isFilled)\r\n {\r\n var size = src.width;\r\n var height = src.height;\r\n \r\n var sizeA = size / 2;\r\n var sizeB = size / src.projection;\r\n\r\n // Top Face\r\n\r\n if (src.showTop)\r\n {\r\n FillStyleCanvas(ctx, src, src.fillTop);\r\n\r\n ctx.beginPath();\r\n\r\n ctx.moveTo(-sizeA, -height);\r\n ctx.lineTo(0, -sizeB - height);\r\n ctx.lineTo(sizeA, -height);\r\n ctx.lineTo(sizeA, -1);\r\n ctx.lineTo(0, sizeB - 1);\r\n ctx.lineTo(-sizeA, -1);\r\n ctx.lineTo(-sizeA, -height);\r\n\r\n ctx.fill();\r\n }\r\n\r\n // Left Face\r\n\r\n if (src.showLeft)\r\n {\r\n FillStyleCanvas(ctx, src, src.fillLeft);\r\n\r\n ctx.beginPath();\r\n \r\n ctx.moveTo(-sizeA, 0);\r\n ctx.lineTo(0, sizeB);\r\n ctx.lineTo(0, sizeB - height);\r\n ctx.lineTo(-sizeA, -height);\r\n ctx.lineTo(-sizeA, 0);\r\n\r\n ctx.fill();\r\n }\r\n\r\n // Right Face\r\n\r\n if (src.showRight)\r\n {\r\n FillStyleCanvas(ctx, src, src.fillRight);\r\n\r\n ctx.beginPath();\r\n\r\n ctx.moveTo(sizeA, 0);\r\n ctx.lineTo(0, sizeB);\r\n ctx.lineTo(0, sizeB - height);\r\n ctx.lineTo(sizeA, -height);\r\n ctx.lineTo(sizeA, 0);\r\n\r\n ctx.fill();\r\n }\r\n\r\n // Restore the context saved in SetTransform\r\n ctx.restore();\r\n }\r\n};\r\n\r\nmodule.exports = IsoBoxCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxFactory.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxFactory.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectFactory = __webpack_require__(/*! ../../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar IsoBox = __webpack_require__(/*! ./IsoBox */ \"./node_modules/phaser/src/gameobjects/shape/isobox/IsoBox.js\");\r\n\r\n/**\r\n * Creates a new IsoBox Shape Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the IsoBox Game Object has been built into Phaser.\r\n * \r\n * The IsoBox Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports only fill colors and cannot be stroked.\r\n * \r\n * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set\r\n * the color of the top, left and right faces of the rectangle respectively. You can also choose\r\n * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties.\r\n * \r\n * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting\r\n * the `projection` property.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#isobox\r\n * @since 3.13.0\r\n *\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [size=48] - The width of the iso box in pixels. The left and right faces will be exactly half this value.\r\n * @param {number} [height=32] - The height of the iso box. The left and right faces will be this tall. The overall height of the isobox will be this value plus half the `size` value.\r\n * @param {number} [fillTop=0xeeeeee] - The fill color of the top face of the iso box.\r\n * @param {number} [fillLeft=0x999999] - The fill color of the left face of the iso box.\r\n * @param {number} [fillRight=0xcccccc] - The fill color of the right face of the iso box.\r\n *\r\n * @return {Phaser.GameObjects.IsoBox} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fillLeft, fillRight)\r\n{\r\n return this.displayList.add(new IsoBox(this.scene, x, y, size, height, fillTop, fillLeft, fillRight));\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxRender.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxRender.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./IsoBoxWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./IsoBoxCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxWebGLRenderer.js": /*!*********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxWebGLRenderer.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Utils = __webpack_require__(/*! ../../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.IsoBox#renderWebGL\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.IsoBox} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var pipeline = this.pipeline;\r\n\r\n var camMatrix = pipeline._tempMatrix1;\r\n var shapeMatrix = pipeline._tempMatrix2;\r\n var calcMatrix = pipeline._tempMatrix3;\r\n\r\n renderer.setPipeline(pipeline);\r\n\r\n shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n shapeMatrix.e = src.x;\r\n shapeMatrix.f = src.y;\r\n }\r\n else\r\n {\r\n shapeMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n shapeMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n }\r\n\r\n camMatrix.multiply(shapeMatrix, calcMatrix);\r\n\r\n var size = src.width;\r\n var height = src.height;\r\n\r\n var sizeA = size / 2;\r\n var sizeB = size / src.projection;\r\n\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (!src.isFilled)\r\n {\r\n return;\r\n }\r\n\r\n var tint;\r\n\r\n var x0;\r\n var y0;\r\n\r\n var x1;\r\n var y1;\r\n\r\n var x2;\r\n var y2;\r\n\r\n var x3;\r\n var y3;\r\n\r\n // Top Face\r\n\r\n if (src.showTop)\r\n {\r\n tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillTop, alpha);\r\n\r\n x0 = calcMatrix.getX(-sizeA, -height);\r\n y0 = calcMatrix.getY(-sizeA, -height);\r\n \r\n x1 = calcMatrix.getX(0, -sizeB - height);\r\n y1 = calcMatrix.getY(0, -sizeB - height);\r\n \r\n x2 = calcMatrix.getX(sizeA, -height);\r\n y2 = calcMatrix.getY(sizeA, -height);\r\n \r\n x3 = calcMatrix.getX(0, sizeB - height);\r\n y3 = calcMatrix.getY(0, sizeB - height);\r\n\r\n pipeline.setTexture2D();\r\n \r\n pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2);\r\n }\r\n\r\n // Left Face\r\n\r\n if (src.showLeft)\r\n {\r\n tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillLeft, alpha);\r\n\r\n x0 = calcMatrix.getX(-sizeA, 0);\r\n y0 = calcMatrix.getY(-sizeA, 0);\r\n \r\n x1 = calcMatrix.getX(0, sizeB);\r\n y1 = calcMatrix.getY(0, sizeB);\r\n \r\n x2 = calcMatrix.getX(0, sizeB - height);\r\n y2 = calcMatrix.getY(0, sizeB - height);\r\n \r\n x3 = calcMatrix.getX(-sizeA, -height);\r\n y3 = calcMatrix.getY(-sizeA, -height);\r\n\r\n pipeline.setTexture2D();\r\n \r\n pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2);\r\n }\r\n\r\n // Right Face\r\n\r\n if (src.showRight)\r\n {\r\n tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillRight, alpha);\r\n\r\n x0 = calcMatrix.getX(sizeA, 0);\r\n y0 = calcMatrix.getY(sizeA, 0);\r\n \r\n x1 = calcMatrix.getX(0, sizeB);\r\n y1 = calcMatrix.getY(0, sizeB);\r\n \r\n x2 = calcMatrix.getX(0, sizeB - height);\r\n y2 = calcMatrix.getY(0, sizeB - height);\r\n \r\n x3 = calcMatrix.getX(sizeA, -height);\r\n y3 = calcMatrix.getY(sizeA, -height);\r\n\r\n pipeline.setTexture2D();\r\n \r\n pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2);\r\n }\r\n};\r\n\r\nmodule.exports = IsoBoxWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/isobox/IsoBoxWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangle.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangle.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar IsoTriangleRender = __webpack_require__(/*! ./IsoTriangleRender */ \"./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleRender.js\");\r\nvar Shape = __webpack_require__(/*! ../Shape */ \"./node_modules/phaser/src/gameobjects/shape/Shape.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The IsoTriangle Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports only fill colors and cannot be stroked.\r\n * \r\n * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different\r\n * fill color. You can set the color of the top, left and right faces of the triangle respectively\r\n * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties.\r\n * \r\n * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting\r\n * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside\r\n * down or not.\r\n *\r\n * @class IsoTriangle\r\n * @extends Phaser.GameObjects.Shape\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.13.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [size=48] - The width of the iso triangle in pixels. The left and right faces will be exactly half this value.\r\n * @param {number} [height=32] - The height of the iso triangle. The left and right faces will be this tall. The overall height of the iso triangle will be this value plus half the `size` value.\r\n * @param {boolean} [reversed=false] - Is the iso triangle upside down?\r\n * @param {number} [fillTop=0xeeeeee] - The fill color of the top face of the iso triangle.\r\n * @param {number} [fillLeft=0x999999] - The fill color of the left face of the iso triangle.\r\n * @param {number} [fillRight=0xcccccc] - The fill color of the right face of the iso triangle.\r\n */\r\nvar IsoTriangle = new Class({\r\n\r\n Extends: Shape,\r\n\r\n Mixins: [\r\n IsoTriangleRender\r\n ],\r\n\r\n initialize:\r\n\r\n function IsoTriangle (scene, x, y, size, height, reversed, fillTop, fillLeft, fillRight)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (size === undefined) { size = 48; }\r\n if (height === undefined) { height = 32; }\r\n if (reversed === undefined) { reversed = false; }\r\n if (fillTop === undefined) { fillTop = 0xeeeeee; }\r\n if (fillLeft === undefined) { fillLeft = 0x999999; }\r\n if (fillRight === undefined) { fillRight = 0xcccccc; }\r\n\r\n Shape.call(this, scene, 'IsoTriangle', null);\r\n\r\n /**\r\n * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box.\r\n *\r\n * @name Phaser.GameObjects.IsoTriangle#projection\r\n * @type {integer}\r\n * @default 4\r\n * @since 3.13.0\r\n */\r\n this.projection = 4;\r\n\r\n /**\r\n * The color used to fill in the top of the iso triangle. This is only used if the triangle is reversed.\r\n *\r\n * @name Phaser.GameObjects.IsoTriangle#fillTop\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.fillTop = fillTop;\r\n\r\n /**\r\n * The color used to fill in the left-facing side of the iso triangle.\r\n *\r\n * @name Phaser.GameObjects.IsoTriangle#fillLeft\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.fillLeft = fillLeft;\r\n\r\n /**\r\n * The color used to fill in the right-facing side of the iso triangle.\r\n *\r\n * @name Phaser.GameObjects.IsoTriangle#fillRight\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.fillRight = fillRight;\r\n\r\n /**\r\n * Controls if the top-face of the iso triangle be rendered.\r\n *\r\n * @name Phaser.GameObjects.IsoTriangle#showTop\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.13.0\r\n */\r\n this.showTop = true;\r\n\r\n /**\r\n * Controls if the left-face of the iso triangle be rendered.\r\n *\r\n * @name Phaser.GameObjects.IsoTriangle#showLeft\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.13.0\r\n */\r\n this.showLeft = true;\r\n\r\n /**\r\n * Controls if the right-face of the iso triangle be rendered.\r\n *\r\n * @name Phaser.GameObjects.IsoTriangle#showRight\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.13.0\r\n */\r\n this.showRight = true;\r\n\r\n /**\r\n * Sets if the iso triangle will be rendered upside down or not.\r\n *\r\n * @name Phaser.GameObjects.IsoTriangle#isReversed\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.13.0\r\n */\r\n this.isReversed = reversed;\r\n\r\n this.isFilled = true;\r\n\r\n this.setPosition(x, y);\r\n this.setSize(size, height);\r\n\r\n this.updateDisplayOrigin();\r\n },\r\n\r\n /**\r\n * Sets the projection level of the iso triangle. Change this to change the 'angle' at which you are looking at the pyramid.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.IsoTriangle#setProjection\r\n * @since 3.13.0\r\n * \r\n * @param {integer} value - The value to set the projection to.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setProjection: function (value)\r\n {\r\n this.projection = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets if the iso triangle will be rendered upside down or not.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.IsoTriangle#setReversed\r\n * @since 3.13.0\r\n * \r\n * @param {boolean} reversed - Sets if the iso triangle will be rendered upside down or not.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setReversed: function (reversed)\r\n {\r\n this.isReversed = reversed;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets which faces of the iso triangle will be rendered.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.IsoTriangle#setFaces\r\n * @since 3.13.0\r\n * \r\n * @param {boolean} [showTop=true] - Show the top-face of the iso triangle (only if `reversed` is true)\r\n * @param {boolean} [showLeft=true] - Show the left-face of the iso triangle.\r\n * @param {boolean} [showRight=true] - Show the right-face of the iso triangle.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setFaces: function (showTop, showLeft, showRight)\r\n {\r\n if (showTop === undefined) { showTop = true; }\r\n if (showLeft === undefined) { showLeft = true; }\r\n if (showRight === undefined) { showRight = true; }\r\n\r\n this.showTop = showTop;\r\n this.showLeft = showLeft;\r\n this.showRight = showRight;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the fill colors for each face of the iso triangle.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.IsoTriangle#setFillStyle\r\n * @since 3.13.0\r\n * \r\n * @param {number} [fillTop] - The color used to fill the top of the iso triangle.\r\n * @param {number} [fillLeft] - The color used to fill in the left-facing side of the iso triangle.\r\n * @param {number} [fillRight] - The color used to fill in the right-facing side of the iso triangle.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setFillStyle: function (fillTop, fillLeft, fillRight)\r\n {\r\n this.fillTop = fillTop;\r\n this.fillLeft = fillLeft;\r\n this.fillRight = fillRight;\r\n\r\n this.isFilled = true;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = IsoTriangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleCanvasRenderer.js": /*!********************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleCanvasRenderer.js ***! \********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FillStyleCanvas = __webpack_require__(/*! ../FillStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/FillStyleCanvas.js\");\r\nvar SetTransform = __webpack_require__(/*! ../../../renderer/canvas/utils/SetTransform */ \"./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js\");\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.IsoTriangle#renderCanvas\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.IsoTriangle} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar IsoTriangleCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var ctx = renderer.currentContext;\r\n\r\n if (SetTransform(renderer, ctx, src, camera, parentMatrix) && src.isFilled)\r\n {\r\n var size = src.width;\r\n var height = src.height;\r\n \r\n var sizeA = size / 2;\r\n var sizeB = size / src.projection;\r\n\r\n var reversed = src.isReversed;\r\n\r\n // Top Face\r\n\r\n if (src.showTop && reversed)\r\n {\r\n FillStyleCanvas(ctx, src, src.fillTop);\r\n\r\n ctx.beginPath();\r\n\r\n ctx.moveTo(-sizeA, -height);\r\n ctx.lineTo(0, -sizeB - height);\r\n ctx.lineTo(sizeA, -height);\r\n ctx.lineTo(0, sizeB - height);\r\n\r\n ctx.fill();\r\n }\r\n\r\n // Left Face\r\n\r\n if (src.showLeft)\r\n {\r\n FillStyleCanvas(ctx, src, src.fillLeft);\r\n\r\n ctx.beginPath();\r\n\r\n if (reversed)\r\n {\r\n ctx.moveTo(-sizeA, -height);\r\n ctx.lineTo(0, sizeB);\r\n ctx.lineTo(0, sizeB - height);\r\n }\r\n else\r\n {\r\n ctx.moveTo(-sizeA, 0);\r\n ctx.lineTo(0, sizeB);\r\n ctx.lineTo(0, sizeB - height);\r\n }\r\n\r\n ctx.fill();\r\n }\r\n\r\n // Right Face\r\n\r\n if (src.showRight)\r\n {\r\n FillStyleCanvas(ctx, src, src.fillRight);\r\n\r\n ctx.beginPath();\r\n\r\n if (reversed)\r\n {\r\n ctx.moveTo(sizeA, -height);\r\n ctx.lineTo(0, sizeB);\r\n ctx.lineTo(0, sizeB - height);\r\n }\r\n else\r\n {\r\n ctx.moveTo(sizeA, 0);\r\n ctx.lineTo(0, sizeB);\r\n ctx.lineTo(0, sizeB - height);\r\n }\r\n\r\n ctx.fill();\r\n }\r\n\r\n // Restore the context saved in SetTransform\r\n ctx.restore();\r\n }\r\n};\r\n\r\nmodule.exports = IsoTriangleCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleFactory.js": /*!*************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleFactory.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectFactory = __webpack_require__(/*! ../../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar IsoTriangle = __webpack_require__(/*! ./IsoTriangle */ \"./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangle.js\");\r\n\r\n/**\r\n * Creates a new IsoTriangle Shape Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the IsoTriangle Game Object has been built into Phaser.\r\n * \r\n * The IsoTriangle Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports only fill colors and cannot be stroked.\r\n * \r\n * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different\r\n * fill color. You can set the color of the top, left and right faces of the triangle respectively\r\n * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties.\r\n * \r\n * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting\r\n * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside\r\n * down or not.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#isotriangle\r\n * @since 3.13.0\r\n *\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [size=48] - The width of the iso triangle in pixels. The left and right faces will be exactly half this value.\r\n * @param {number} [height=32] - The height of the iso triangle. The left and right faces will be this tall. The overall height of the iso triangle will be this value plus half the `size` value.\r\n * @param {boolean} [reversed=false] - Is the iso triangle upside down?\r\n * @param {number} [fillTop=0xeeeeee] - The fill color of the top face of the iso triangle.\r\n * @param {number} [fillLeft=0x999999] - The fill color of the left face of the iso triangle.\r\n * @param {number} [fillRight=0xcccccc] - The fill color of the right face of the iso triangle.\r\n *\r\n * @return {Phaser.GameObjects.IsoTriangle} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('isotriangle', function (x, y, size, height, reversed, fillTop, fillLeft, fillRight)\r\n{\r\n return this.displayList.add(new IsoTriangle(this.scene, x, y, size, height, reversed, fillTop, fillLeft, fillRight));\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleRender.js": /*!************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleRender.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./IsoTriangleWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./IsoTriangleCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleWebGLRenderer.js": /*!*******************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleWebGLRenderer.js ***! \*******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Utils = __webpack_require__(/*! ../../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.IsoTriangle#renderWebGL\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.IsoTriangle} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var pipeline = this.pipeline;\r\n\r\n var camMatrix = pipeline._tempMatrix1;\r\n var shapeMatrix = pipeline._tempMatrix2;\r\n var calcMatrix = pipeline._tempMatrix3;\r\n\r\n renderer.setPipeline(pipeline);\r\n\r\n shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n shapeMatrix.e = src.x;\r\n shapeMatrix.f = src.y;\r\n }\r\n else\r\n {\r\n shapeMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n shapeMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n }\r\n\r\n camMatrix.multiply(shapeMatrix, calcMatrix);\r\n\r\n var size = src.width;\r\n var height = src.height;\r\n\r\n var sizeA = size / 2;\r\n var sizeB = size / src.projection;\r\n\r\n var reversed = src.isReversed;\r\n\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (!src.isFilled)\r\n {\r\n return;\r\n }\r\n\r\n var tint;\r\n\r\n var x0;\r\n var y0;\r\n\r\n var x1;\r\n var y1;\r\n\r\n var x2;\r\n var y2;\r\n\r\n // Top Face\r\n\r\n if (src.showTop && reversed)\r\n {\r\n tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillTop, alpha);\r\n\r\n x0 = calcMatrix.getX(-sizeA, -height);\r\n y0 = calcMatrix.getY(-sizeA, -height);\r\n \r\n x1 = calcMatrix.getX(0, -sizeB - height);\r\n y1 = calcMatrix.getY(0, -sizeB - height);\r\n \r\n x2 = calcMatrix.getX(sizeA, -height);\r\n y2 = calcMatrix.getY(sizeA, -height);\r\n \r\n var x3 = calcMatrix.getX(0, sizeB - height);\r\n var y3 = calcMatrix.getY(0, sizeB - height);\r\n\r\n pipeline.setTexture2D();\r\n \r\n pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2);\r\n }\r\n\r\n // Left Face\r\n\r\n if (src.showLeft)\r\n {\r\n tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillLeft, alpha);\r\n\r\n if (reversed)\r\n {\r\n x0 = calcMatrix.getX(-sizeA, -height);\r\n y0 = calcMatrix.getY(-sizeA, -height);\r\n \r\n x1 = calcMatrix.getX(0, sizeB);\r\n y1 = calcMatrix.getY(0, sizeB);\r\n \r\n x2 = calcMatrix.getX(0, sizeB - height);\r\n y2 = calcMatrix.getY(0, sizeB - height);\r\n }\r\n else\r\n {\r\n x0 = calcMatrix.getX(-sizeA, 0);\r\n y0 = calcMatrix.getY(-sizeA, 0);\r\n \r\n x1 = calcMatrix.getX(0, sizeB);\r\n y1 = calcMatrix.getY(0, sizeB);\r\n \r\n x2 = calcMatrix.getX(0, sizeB - height);\r\n y2 = calcMatrix.getY(0, sizeB - height);\r\n }\r\n \r\n pipeline.batchTri(x0, y0, x1, y1, x2, y2, 0, 0, 1, 1, tint, tint, tint, 2);\r\n }\r\n\r\n // Right Face\r\n\r\n if (src.showRight)\r\n {\r\n tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillRight, alpha);\r\n\r\n if (reversed)\r\n {\r\n x0 = calcMatrix.getX(sizeA, -height);\r\n y0 = calcMatrix.getY(sizeA, -height);\r\n \r\n x1 = calcMatrix.getX(0, sizeB);\r\n y1 = calcMatrix.getY(0, sizeB);\r\n \r\n x2 = calcMatrix.getX(0, sizeB - height);\r\n y2 = calcMatrix.getY(0, sizeB - height);\r\n }\r\n else\r\n {\r\n x0 = calcMatrix.getX(sizeA, 0);\r\n y0 = calcMatrix.getY(sizeA, 0);\r\n \r\n x1 = calcMatrix.getX(0, sizeB);\r\n y1 = calcMatrix.getY(0, sizeB);\r\n \r\n x2 = calcMatrix.getX(0, sizeB - height);\r\n y2 = calcMatrix.getY(0, sizeB - height);\r\n }\r\n\r\n pipeline.setTexture2D();\r\n \r\n pipeline.batchTri(x0, y0, x1, y1, x2, y2, 0, 0, 1, 1, tint, tint, tint, 2);\r\n }\r\n};\r\n\r\nmodule.exports = IsoTriangleWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/isotriangle/IsoTriangleWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/line/Line.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/line/Line.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Shape = __webpack_require__(/*! ../Shape */ \"./node_modules/phaser/src/gameobjects/shape/Shape.js\");\r\nvar GeomLine = __webpack_require__(/*! ../../../geom/line/Line */ \"./node_modules/phaser/src/geom/line/Line.js\");\r\nvar LineRender = __webpack_require__(/*! ./LineRender */ \"./node_modules/phaser/src/gameobjects/shape/line/LineRender.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Line Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports only stroke colors and cannot be filled.\r\n * \r\n * A Line Shape allows you to draw a line between two points in your game. You can control the\r\n * stroke color and thickness of the line. In WebGL only you can also specify a different\r\n * thickness for the start and end of the line, allowing you to render lines that taper-off.\r\n * \r\n * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead.\r\n *\r\n * Be aware that as with all Game Objects the default origin is 0.5. If you need to draw a Line\r\n * between two points and want the x1/y1 values to match the x/y values, then set the origin to 0.\r\n *\r\n * @class Line\r\n * @extends Phaser.GameObjects.Shape\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.13.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [x1=0] - The horizontal position of the start of the line.\r\n * @param {number} [y1=0] - The vertical position of the start of the line.\r\n * @param {number} [x2=128] - The horizontal position of the end of the line.\r\n * @param {number} [y2=0] - The vertical position of the end of the line.\r\n * @param {number} [strokeColor] - The color the line will be drawn in, i.e. 0xff0000 for red.\r\n * @param {number} [strokeAlpha] - The alpha the line will be drawn in. You can also set the alpha of the overall Shape using its `alpha` property.\r\n */\r\nvar Line = new Class({\r\n\r\n Extends: Shape,\r\n\r\n Mixins: [\r\n LineRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Line (scene, x, y, x1, y1, x2, y2, strokeColor, strokeAlpha)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (x1 === undefined) { x1 = 0; }\r\n if (y1 === undefined) { y1 = 0; }\r\n if (x2 === undefined) { x2 = 128; }\r\n if (y2 === undefined) { y2 = 0; }\r\n\r\n Shape.call(this, scene, 'Line', new GeomLine(x1, y1, x2, y2));\r\n\r\n var width = this.geom.right - this.geom.left;\r\n var height = this.geom.bottom - this.geom.top;\r\n\r\n /**\r\n * The width (or thickness) of the line.\r\n * See the setLineWidth method for extra details on changing this on WebGL.\r\n *\r\n * @name Phaser.GameObjects.Line#lineWidth\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.lineWidth = 1;\r\n\r\n /**\r\n * Private internal value. Holds the start width of the line.\r\n *\r\n * @name Phaser.GameObjects.Line#_startWidth\r\n * @type {number}\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._startWidth = 1;\r\n\r\n /**\r\n * Private internal value. Holds the end width of the line.\r\n *\r\n * @name Phaser.GameObjects.Line#_endWidth\r\n * @type {number}\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._endWidth = 1;\r\n\r\n this.setPosition(x, y);\r\n this.setSize(width, height);\r\n\r\n if (strokeColor !== undefined)\r\n {\r\n this.setStrokeStyle(1, strokeColor, strokeAlpha);\r\n }\r\n\r\n this.updateDisplayOrigin();\r\n },\r\n\r\n /**\r\n * Sets the width of the line.\r\n * \r\n * When using the WebGL renderer you can have different start and end widths.\r\n * When using the Canvas renderer only the `startWidth` value is used. The `endWidth` is ignored.\r\n * \r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Line#setLineWidth\r\n * @since 3.13.0\r\n * \r\n * @param {number} startWidth - The start width of the line.\r\n * @param {number} [endWidth] - The end width of the line. Only used in WebGL.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setLineWidth: function (startWidth, endWidth)\r\n {\r\n if (endWidth === undefined) { endWidth = startWidth; }\r\n\r\n this._startWidth = startWidth;\r\n this._endWidth = endWidth;\r\n\r\n this.lineWidth = startWidth;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the start and end coordinates of this Line.\r\n *\r\n * @method Phaser.GameObjects.Line#setTo\r\n * @since 3.13.0\r\n *\r\n * @param {number} [x1=0] - The horizontal position of the start of the line.\r\n * @param {number} [y1=0] - The vertical position of the start of the line.\r\n * @param {number} [x2=0] - The horizontal position of the end of the line.\r\n * @param {number} [y2=0] - The vertical position of the end of the line.\r\n *\r\n * @return {this} This Line object.\r\n */\r\n setTo: function (x1, y1, x2, y2)\r\n {\r\n this.geom.setTo(x1, y1, x2, y2);\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Line;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/line/Line.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/line/LineCanvasRenderer.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/line/LineCanvasRenderer.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar LineStyleCanvas = __webpack_require__(/*! ../LineStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/LineStyleCanvas.js\");\r\nvar SetTransform = __webpack_require__(/*! ../../../renderer/canvas/utils/SetTransform */ \"./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js\");\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Line#renderCanvas\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Line} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar LineCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var ctx = renderer.currentContext;\r\n\r\n if (SetTransform(renderer, ctx, src, camera, parentMatrix))\r\n {\r\n var dx = src._displayOriginX;\r\n var dy = src._displayOriginY;\r\n\r\n if (src.isStroked)\r\n {\r\n LineStyleCanvas(ctx, src);\r\n\r\n ctx.beginPath();\r\n\r\n ctx.moveTo(src.geom.x1 - dx, src.geom.y1 - dy);\r\n ctx.lineTo(src.geom.x2 - dx, src.geom.y2 - dy);\r\n \r\n ctx.stroke();\r\n }\r\n\r\n // Restore the context saved in SetTransform\r\n ctx.restore();\r\n }\r\n};\r\n\r\nmodule.exports = LineCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/line/LineCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/line/LineFactory.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/line/LineFactory.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectFactory = __webpack_require__(/*! ../../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar Line = __webpack_require__(/*! ./Line */ \"./node_modules/phaser/src/gameobjects/shape/line/Line.js\");\r\n\r\n/**\r\n * Creates a new Line Shape Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Line Game Object has been built into Phaser.\r\n * \r\n * The Line Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports only stroke colors and cannot be filled.\r\n * \r\n * A Line Shape allows you to draw a line between two points in your game. You can control the\r\n * stroke color and thickness of the line. In WebGL only you can also specify a different\r\n * thickness for the start and end of the line, allowing you to render lines that taper-off.\r\n * \r\n * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#line\r\n * @since 3.13.0\r\n *\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [x1=0] - The horizontal position of the start of the line.\r\n * @param {number} [y1=0] - The vertical position of the start of the line.\r\n * @param {number} [x2=128] - The horizontal position of the end of the line.\r\n * @param {number} [y2=0] - The vertical position of the end of the line.\r\n * @param {number} [strokeColor] - The color the line will be drawn in, i.e. 0xff0000 for red.\r\n * @param {number} [strokeAlpha] - The alpha the line will be drawn in. You can also set the alpha of the overall Shape using its `alpha` property.\r\n *\r\n * @return {Phaser.GameObjects.Line} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor, strokeAlpha)\r\n{\r\n return this.displayList.add(new Line(this.scene, x, y, x1, y1, x2, y2, strokeColor, strokeAlpha));\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/line/LineFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/line/LineRender.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/line/LineRender.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./LineWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/shape/line/LineWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./LineCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/shape/line/LineCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/line/LineRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/line/LineWebGLRenderer.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/line/LineWebGLRenderer.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Utils = __webpack_require__(/*! ../../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Line#renderWebGL\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Line} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar LineWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var pipeline = this.pipeline;\r\n\r\n var camMatrix = pipeline._tempMatrix1;\r\n var shapeMatrix = pipeline._tempMatrix2;\r\n\r\n renderer.setPipeline(pipeline);\r\n\r\n shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n shapeMatrix.e = src.x;\r\n shapeMatrix.f = src.y;\r\n }\r\n else\r\n {\r\n shapeMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n shapeMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n }\r\n\r\n var dx = src._displayOriginX;\r\n var dy = src._displayOriginY;\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (src.isStroked)\r\n {\r\n var strokeTint = pipeline.strokeTint;\r\n var color = Utils.getTintAppendFloatAlphaAndSwap(src.strokeColor, src.strokeAlpha * alpha);\r\n\r\n strokeTint.TL = color;\r\n strokeTint.TR = color;\r\n strokeTint.BL = color;\r\n strokeTint.BR = color;\r\n\r\n var startWidth = src._startWidth;\r\n var endWidth = src._endWidth;\r\n\r\n pipeline.setTexture2D();\r\n\r\n pipeline.batchLine(\r\n src.geom.x1 - dx,\r\n src.geom.y1 - dy,\r\n src.geom.x2 - dx,\r\n src.geom.y2 - dy,\r\n startWidth,\r\n endWidth,\r\n 1,\r\n 0,\r\n false,\r\n shapeMatrix,\r\n camMatrix\r\n );\r\n }\r\n};\r\n\r\nmodule.exports = LineWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/line/LineWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/polygon/Polygon.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/polygon/Polygon.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PolygonRender = __webpack_require__(/*! ./PolygonRender */ \"./node_modules/phaser/src/gameobjects/shape/polygon/PolygonRender.js\");\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Earcut = __webpack_require__(/*! ../../../geom/polygon/Earcut */ \"./node_modules/phaser/src/geom/polygon/Earcut.js\");\r\nvar GetAABB = __webpack_require__(/*! ../../../geom/polygon/GetAABB */ \"./node_modules/phaser/src/geom/polygon/GetAABB.js\");\r\nvar GeomPolygon = __webpack_require__(/*! ../../../geom/polygon/Polygon */ \"./node_modules/phaser/src/geom/polygon/Polygon.js\");\r\nvar Shape = __webpack_require__(/*! ../Shape */ \"./node_modules/phaser/src/gameobjects/shape/Shape.js\");\r\nvar Smooth = __webpack_require__(/*! ../../../geom/polygon/Smooth */ \"./node_modules/phaser/src/geom/polygon/Smooth.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Polygon Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports both fill and stroke colors.\r\n * \r\n * The Polygon Shape is created by providing a list of points, which are then used to create an\r\n * internal Polygon geometry object. The points can be set from a variety of formats:\r\n *\r\n * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'`\r\n * - An array of Point or Vector2 objects: `[new Phaser.Math.Vector2(x1, y1), ...]`\r\n * - An array of objects with public x/y properties: `[obj1, obj2, ...]`\r\n * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]`\r\n * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]`\r\n * \r\n * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending\r\n * on the coordinates of the points provided, the final shape may be rendered offset from its origin.\r\n *\r\n * @class Polygon\r\n * @extends Phaser.GameObjects.Shape\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.13.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {any} [points] - The points that make up the polygon.\r\n * @param {number} [fillColor] - The color the polygon will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the polygon will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n */\r\nvar Polygon = new Class({\r\n\r\n Extends: Shape,\r\n\r\n Mixins: [\r\n PolygonRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Polygon (scene, x, y, points, fillColor, fillAlpha)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n Shape.call(this, scene, 'Polygon', new GeomPolygon(points));\r\n\r\n var bounds = GetAABB(this.geom);\r\n\r\n this.setPosition(x, y);\r\n this.setSize(bounds.width, bounds.height);\r\n\r\n if (fillColor !== undefined)\r\n {\r\n this.setFillStyle(fillColor, fillAlpha);\r\n }\r\n\r\n this.updateDisplayOrigin();\r\n this.updateData();\r\n },\r\n\r\n /**\r\n * Smooths the polygon over the number of iterations specified.\r\n * The base polygon data will be updated and replaced with the smoothed values.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Polygon#smooth\r\n * @since 3.13.0\r\n * \r\n * @param {integer} [iterations=1] - The number of times to apply the polygon smoothing.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n smooth: function (iterations)\r\n {\r\n if (iterations === undefined) { iterations = 1; }\r\n\r\n for (var i = 0; i < iterations; i++)\r\n {\r\n Smooth(this.geom);\r\n }\r\n\r\n return this.updateData();\r\n },\r\n\r\n /**\r\n * Internal method that updates the data and path values.\r\n *\r\n * @method Phaser.GameObjects.Polygon#updateData\r\n * @private\r\n * @since 3.13.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n updateData: function ()\r\n {\r\n var path = [];\r\n var points = this.geom.points;\r\n\r\n for (var i = 0; i < points.length; i++)\r\n {\r\n path.push(points[i].x, points[i].y);\r\n }\r\n\r\n path.push(points[0].x, points[0].y);\r\n\r\n this.pathIndexes = Earcut(path);\r\n this.pathData = path;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Polygon;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/polygon/Polygon.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/polygon/PolygonCanvasRenderer.js": /*!************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/polygon/PolygonCanvasRenderer.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FillStyleCanvas = __webpack_require__(/*! ../FillStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/FillStyleCanvas.js\");\r\nvar LineStyleCanvas = __webpack_require__(/*! ../LineStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/LineStyleCanvas.js\");\r\nvar SetTransform = __webpack_require__(/*! ../../../renderer/canvas/utils/SetTransform */ \"./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js\");\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Polygon#renderCanvas\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Polygon} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar PolygonCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var ctx = renderer.currentContext;\r\n\r\n if (SetTransform(renderer, ctx, src, camera, parentMatrix))\r\n {\r\n var dx = src._displayOriginX;\r\n var dy = src._displayOriginY;\r\n\r\n var path = src.pathData;\r\n var pathLength = path.length - 1;\r\n \r\n var px1 = path[0] - dx;\r\n var py1 = path[1] - dy;\r\n\r\n ctx.beginPath();\r\n\r\n ctx.moveTo(px1, py1);\r\n \r\n if (!src.closePath)\r\n {\r\n pathLength -= 2;\r\n }\r\n \r\n for (var i = 2; i < pathLength; i += 2)\r\n {\r\n var px2 = path[i] - dx;\r\n var py2 = path[i + 1] - dy;\r\n \r\n ctx.lineTo(px2, py2);\r\n }\r\n\r\n ctx.closePath();\r\n\r\n if (src.isFilled)\r\n {\r\n FillStyleCanvas(ctx, src);\r\n\r\n ctx.fill();\r\n }\r\n\r\n if (src.isStroked)\r\n {\r\n LineStyleCanvas(ctx, src);\r\n\r\n ctx.stroke();\r\n }\r\n\r\n // Restore the context saved in SetTransform\r\n ctx.restore();\r\n }\r\n};\r\n\r\nmodule.exports = PolygonCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/polygon/PolygonCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/polygon/PolygonFactory.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/polygon/PolygonFactory.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectFactory = __webpack_require__(/*! ../../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar Polygon = __webpack_require__(/*! ./Polygon */ \"./node_modules/phaser/src/gameobjects/shape/polygon/Polygon.js\");\r\n\r\n/**\r\n * Creates a new Polygon Shape Game Object and adds it to the Scene.\r\n * \r\n * Note: This method will only be available if the Polygon Game Object has been built into Phaser.\r\n * \r\n * The Polygon Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports both fill and stroke colors.\r\n * \r\n * The Polygon Shape is created by providing a list of points, which are then used to create an\r\n * internal Polygon geometry object. The points can be set from a variety of formats:\r\n *\r\n * - An array of Point or Vector2 objects: `[new Phaser.Math.Vector2(x1, y1), ...]`\r\n * - An array of objects with public x/y properties: `[obj1, obj2, ...]`\r\n * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]`\r\n * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]`\r\n * \r\n * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending\r\n * on the coordinates of the points provided, the final shape may be rendered offset from its origin.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#polygon\r\n * @since 3.13.0\r\n *\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {any} [points] - The points that make up the polygon.\r\n * @param {number} [fillColor] - The color the polygon will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the polygon will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n *\r\n * @return {Phaser.GameObjects.Polygon} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlpha)\r\n{\r\n return this.displayList.add(new Polygon(this.scene, x, y, points, fillColor, fillAlpha));\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/polygon/PolygonFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/polygon/PolygonRender.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/polygon/PolygonRender.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./PolygonWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/shape/polygon/PolygonWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./PolygonCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/shape/polygon/PolygonCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/polygon/PolygonRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/polygon/PolygonWebGLRenderer.js": /*!***********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/polygon/PolygonWebGLRenderer.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FillPathWebGL = __webpack_require__(/*! ../FillPathWebGL */ \"./node_modules/phaser/src/gameobjects/shape/FillPathWebGL.js\");\r\nvar StrokePathWebGL = __webpack_require__(/*! ../StrokePathWebGL */ \"./node_modules/phaser/src/gameobjects/shape/StrokePathWebGL.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Polygon#renderWebGL\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Polygon} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar PolygonWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var pipeline = this.pipeline;\r\n\r\n var camMatrix = pipeline._tempMatrix1;\r\n var shapeMatrix = pipeline._tempMatrix2;\r\n var calcMatrix = pipeline._tempMatrix3;\r\n\r\n renderer.setPipeline(pipeline);\r\n\r\n shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n shapeMatrix.e = src.x;\r\n shapeMatrix.f = src.y;\r\n }\r\n else\r\n {\r\n shapeMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n shapeMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n }\r\n\r\n camMatrix.multiply(shapeMatrix, calcMatrix);\r\n\r\n var dx = src._displayOriginX;\r\n var dy = src._displayOriginY;\r\n\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (src.isFilled)\r\n {\r\n FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy);\r\n }\r\n\r\n if (src.isStroked)\r\n {\r\n StrokePathWebGL(pipeline, src, alpha, dx, dy);\r\n }\r\n};\r\n\r\nmodule.exports = PolygonWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/polygon/PolygonWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/rectangle/Rectangle.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/rectangle/Rectangle.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GeomRectangle = __webpack_require__(/*! ../../../geom/rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar Shape = __webpack_require__(/*! ../Shape */ \"./node_modules/phaser/src/gameobjects/shape/Shape.js\");\r\nvar RectangleRender = __webpack_require__(/*! ./RectangleRender */ \"./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleRender.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Rectangle Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports both fill and stroke colors.\r\n * \r\n * You can change the size of the rectangle by changing the `width` and `height` properties.\r\n *\r\n * @class Rectangle\r\n * @extends Phaser.GameObjects.Shape\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.13.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {number} [width=128] - The width of the rectangle.\r\n * @param {number} [height=128] - The height of the rectangle.\r\n * @param {number} [fillColor] - The color the rectangle will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the rectangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n */\r\nvar Rectangle = new Class({\r\n\r\n Extends: Shape,\r\n\r\n Mixins: [\r\n RectangleRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Rectangle (scene, x, y, width, height, fillColor, fillAlpha)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = 128; }\r\n if (height === undefined) { height = 128; }\r\n\r\n Shape.call(this, scene, 'Rectangle', new GeomRectangle(0, 0, width, height));\r\n\r\n this.setPosition(x, y);\r\n this.setSize(width, height);\r\n\r\n if (fillColor !== undefined)\r\n {\r\n this.setFillStyle(fillColor, fillAlpha);\r\n }\r\n\r\n this.updateDisplayOrigin();\r\n this.updateData();\r\n },\r\n\r\n /**\r\n * Internal method that updates the data and path values.\r\n *\r\n * @method Phaser.GameObjects.Rectangle#updateData\r\n * @private\r\n * @since 3.13.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n updateData: function ()\r\n {\r\n var path = [];\r\n var rect = this.geom;\r\n var line = this._tempLine;\r\n\r\n rect.getLineA(line);\r\n\r\n path.push(line.x1, line.y1, line.x2, line.y2);\r\n\r\n rect.getLineB(line);\r\n\r\n path.push(line.x2, line.y2);\r\n\r\n rect.getLineC(line);\r\n\r\n path.push(line.x2, line.y2);\r\n\r\n rect.getLineD(line);\r\n\r\n path.push(line.x2, line.y2);\r\n\r\n this.pathData = path;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Rectangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/rectangle/Rectangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleCanvasRenderer.js": /*!****************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleCanvasRenderer.js ***! \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FillStyleCanvas = __webpack_require__(/*! ../FillStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/FillStyleCanvas.js\");\r\nvar LineStyleCanvas = __webpack_require__(/*! ../LineStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/LineStyleCanvas.js\");\r\nvar SetTransform = __webpack_require__(/*! ../../../renderer/canvas/utils/SetTransform */ \"./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js\");\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Rectangle#renderCanvas\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Rectangle} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar RectangleCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var ctx = renderer.currentContext;\r\n\r\n if (SetTransform(renderer, ctx, src, camera, parentMatrix))\r\n {\r\n var dx = src._displayOriginX;\r\n var dy = src._displayOriginY;\r\n\r\n if (src.isFilled)\r\n {\r\n FillStyleCanvas(ctx, src);\r\n \r\n ctx.fillRect(\r\n -dx,\r\n -dy,\r\n src.width,\r\n src.height\r\n );\r\n }\r\n\r\n if (src.isStroked)\r\n {\r\n LineStyleCanvas(ctx, src);\r\n\r\n ctx.beginPath();\r\n\r\n ctx.rect(\r\n -dx,\r\n -dy,\r\n src.width,\r\n src.height\r\n );\r\n\r\n ctx.stroke();\r\n }\r\n\r\n // Restore the context saved in SetTransform\r\n ctx.restore();\r\n }\r\n};\r\n\r\nmodule.exports = RectangleCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleFactory.js": /*!*********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleFactory.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectFactory = __webpack_require__(/*! ../../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar Rectangle = __webpack_require__(/*! ./Rectangle */ \"./node_modules/phaser/src/gameobjects/shape/rectangle/Rectangle.js\");\r\n\r\n/**\r\n * Creates a new Rectangle Shape Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Rectangle Game Object has been built into Phaser.\r\n * \r\n * The Rectangle Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports both fill and stroke colors.\r\n * \r\n * You can change the size of the rectangle by changing the `width` and `height` properties.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#rectangle\r\n * @since 3.13.0\r\n *\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [width=128] - The width of the rectangle.\r\n * @param {number} [height=128] - The height of the rectangle.\r\n * @param {number} [fillColor] - The color the rectangle will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the rectangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n *\r\n * @return {Phaser.GameObjects.Rectangle} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('rectangle', function (x, y, width, height, fillColor, fillAlpha)\r\n{\r\n return this.displayList.add(new Rectangle(this.scene, x, y, width, height, fillColor, fillAlpha));\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleRender.js": /*!********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleRender.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./RectangleWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./RectangleCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleWebGLRenderer.js": /*!***************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleWebGLRenderer.js ***! \***************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar StrokePathWebGL = __webpack_require__(/*! ../StrokePathWebGL */ \"./node_modules/phaser/src/gameobjects/shape/StrokePathWebGL.js\");\r\nvar Utils = __webpack_require__(/*! ../../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Rectangle#renderWebGL\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Rectangle} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar RectangleWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var pipeline = this.pipeline;\r\n\r\n var camMatrix = pipeline._tempMatrix1;\r\n var shapeMatrix = pipeline._tempMatrix2;\r\n var calcMatrix = pipeline._tempMatrix3;\r\n\r\n renderer.setPipeline(pipeline);\r\n\r\n shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n shapeMatrix.e = src.x;\r\n shapeMatrix.f = src.y;\r\n }\r\n else\r\n {\r\n shapeMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n shapeMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n }\r\n\r\n camMatrix.multiply(shapeMatrix, calcMatrix);\r\n\r\n var dx = src._displayOriginX;\r\n var dy = src._displayOriginY;\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (src.isFilled)\r\n {\r\n var fillTint = pipeline.fillTint;\r\n var fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha);\r\n \r\n fillTint.TL = fillTintColor;\r\n fillTint.TR = fillTintColor;\r\n fillTint.BL = fillTintColor;\r\n fillTint.BR = fillTintColor;\r\n\r\n pipeline.setTexture2D();\r\n\r\n pipeline.batchFillRect(\r\n -dx,\r\n -dy,\r\n src.width,\r\n src.height\r\n );\r\n }\r\n\r\n if (src.isStroked)\r\n {\r\n StrokePathWebGL(pipeline, src, alpha, dx, dy);\r\n }\r\n};\r\n\r\nmodule.exports = RectangleWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/rectangle/RectangleWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/star/Star.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/star/Star.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar StarRender = __webpack_require__(/*! ./StarRender */ \"./node_modules/phaser/src/gameobjects/shape/star/StarRender.js\");\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Earcut = __webpack_require__(/*! ../../../geom/polygon/Earcut */ \"./node_modules/phaser/src/geom/polygon/Earcut.js\");\r\nvar Shape = __webpack_require__(/*! ../Shape */ \"./node_modules/phaser/src/gameobjects/shape/Shape.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports both fill and stroke colors.\r\n * \r\n * As the name implies, the Star shape will display a star in your game. You can control several\r\n * aspects of it including the number of points that constitute the star. The default is 5. If\r\n * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky\r\n * star shape.\r\n * \r\n * You can also control the inner and outer radius, which is how 'long' each point of the star is.\r\n * Modify these values to create more interesting shapes.\r\n *\r\n * @class Star\r\n * @extends Phaser.GameObjects.Shape\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.13.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [points=5] - The number of points on the star.\r\n * @param {number} [innerRadius=32] - The inner radius of the star.\r\n * @param {number} [outerRadius=64] - The outer radius of the star.\r\n * @param {number} [fillColor] - The color the star will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the star will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n */\r\nvar Star = new Class({\r\n\r\n Extends: Shape,\r\n\r\n Mixins: [\r\n StarRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Star (scene, x, y, points, innerRadius, outerRadius, fillColor, fillAlpha)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (points === undefined) { points = 5; }\r\n if (innerRadius === undefined) { innerRadius = 32; }\r\n if (outerRadius === undefined) { outerRadius = 64; }\r\n\r\n Shape.call(this, scene, 'Star', null);\r\n\r\n /**\r\n * Private internal value.\r\n * The number of points in the star.\r\n *\r\n * @name Phaser.GameObjects.Star#_points\r\n * @type {integer}\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._points = points;\r\n\r\n /**\r\n * Private internal value.\r\n * The inner radius of the star.\r\n *\r\n * @name Phaser.GameObjects.Star#_innerRadius\r\n * @type {number}\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._innerRadius = innerRadius;\r\n\r\n /**\r\n * Private internal value.\r\n * The outer radius of the star.\r\n *\r\n * @name Phaser.GameObjects.Star#_outerRadius\r\n * @type {number}\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._outerRadius = outerRadius;\r\n\r\n this.setPosition(x, y);\r\n this.setSize(outerRadius * 2, outerRadius * 2);\r\n\r\n if (fillColor !== undefined)\r\n {\r\n this.setFillStyle(fillColor, fillAlpha);\r\n }\r\n\r\n this.updateDisplayOrigin();\r\n this.updateData();\r\n },\r\n\r\n /**\r\n * Sets the number of points that make up the Star shape.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Star#setPoints\r\n * @since 3.13.0\r\n * \r\n * @param {integer} value - The amount of points the Star will have.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setPoints: function (value)\r\n {\r\n this._points = value;\r\n\r\n return this.updateData();\r\n },\r\n\r\n /**\r\n * Sets the inner radius of the Star shape.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Star#setInnerRadius\r\n * @since 3.13.0\r\n * \r\n * @param {number} value - The amount to set the inner radius to.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setInnerRadius: function (value)\r\n {\r\n this._innerRadius = value;\r\n\r\n return this.updateData();\r\n },\r\n\r\n /**\r\n * Sets the outer radius of the Star shape.\r\n * This call can be chained.\r\n *\r\n * @method Phaser.GameObjects.Star#setOuterRadius\r\n * @since 3.13.0\r\n * \r\n * @param {number} value - The amount to set the outer radius to.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setOuterRadius: function (value)\r\n {\r\n this._outerRadius = value;\r\n\r\n return this.updateData();\r\n },\r\n\r\n /**\r\n * The number of points that make up the Star shape.\r\n *\r\n * @name Phaser.GameObjects.Star#points\r\n * @type {integer}\r\n * @default 5\r\n * @since 3.13.0\r\n */\r\n points: {\r\n\r\n get: function ()\r\n {\r\n return this._points;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._points = value;\r\n\r\n this.updateData();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The inner radius of the Star shape.\r\n *\r\n * @name Phaser.GameObjects.Star#innerRadius\r\n * @type {number}\r\n * @default 32\r\n * @since 3.13.0\r\n */\r\n innerRadius: {\r\n\r\n get: function ()\r\n {\r\n return this._innerRadius;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._innerRadius = value;\r\n\r\n this.updateData();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The outer radius of the Star shape.\r\n *\r\n * @name Phaser.GameObjects.Star#outerRadius\r\n * @type {number}\r\n * @default 64\r\n * @since 3.13.0\r\n */\r\n outerRadius: {\r\n\r\n get: function ()\r\n {\r\n return this._outerRadius;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._outerRadius = value;\r\n\r\n this.updateData();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Internal method that updates the data and path values.\r\n *\r\n * @method Phaser.GameObjects.Star#updateData\r\n * @private\r\n * @since 3.13.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n updateData: function ()\r\n {\r\n var path = [];\r\n\r\n var points = this._points;\r\n var innerRadius = this._innerRadius;\r\n var outerRadius = this._outerRadius;\r\n\r\n var rot = Math.PI / 2 * 3;\r\n var step = Math.PI / points;\r\n\r\n // So origin 0.5 = the center of the star\r\n var x = outerRadius;\r\n var y = outerRadius;\r\n \r\n path.push(x, y + -outerRadius);\r\n\r\n for (var i = 0; i < points; i++)\r\n {\r\n path.push(x + Math.cos(rot) * outerRadius, y + Math.sin(rot) * outerRadius);\r\n\r\n rot += step;\r\n\r\n path.push(x + Math.cos(rot) * innerRadius, y + Math.sin(rot) * innerRadius);\r\n \r\n rot += step;\r\n }\r\n\r\n path.push(x, y + -outerRadius);\r\n\r\n this.pathIndexes = Earcut(path);\r\n this.pathData = path;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Star;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/star/Star.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/star/StarCanvasRenderer.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/star/StarCanvasRenderer.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FillStyleCanvas = __webpack_require__(/*! ../FillStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/FillStyleCanvas.js\");\r\nvar LineStyleCanvas = __webpack_require__(/*! ../LineStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/LineStyleCanvas.js\");\r\nvar SetTransform = __webpack_require__(/*! ../../../renderer/canvas/utils/SetTransform */ \"./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js\");\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Star#renderCanvas\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Star} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar StarCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var ctx = renderer.currentContext;\r\n\r\n if (SetTransform(renderer, ctx, src, camera, parentMatrix))\r\n {\r\n var dx = src._displayOriginX;\r\n var dy = src._displayOriginY;\r\n\r\n var path = src.pathData;\r\n var pathLength = path.length - 1;\r\n \r\n var px1 = path[0] - dx;\r\n var py1 = path[1] - dy;\r\n\r\n ctx.beginPath();\r\n\r\n ctx.moveTo(px1, py1);\r\n \r\n if (!src.closePath)\r\n {\r\n pathLength -= 2;\r\n }\r\n \r\n for (var i = 2; i < pathLength; i += 2)\r\n {\r\n var px2 = path[i] - dx;\r\n var py2 = path[i + 1] - dy;\r\n \r\n ctx.lineTo(px2, py2);\r\n }\r\n\r\n ctx.closePath();\r\n\r\n if (src.isFilled)\r\n {\r\n FillStyleCanvas(ctx, src);\r\n\r\n ctx.fill();\r\n }\r\n\r\n if (src.isStroked)\r\n {\r\n LineStyleCanvas(ctx, src);\r\n\r\n ctx.stroke();\r\n }\r\n\r\n // Restore the context saved in SetTransform\r\n ctx.restore();\r\n }\r\n};\r\n\r\nmodule.exports = StarCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/star/StarCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/star/StarFactory.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/star/StarFactory.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Star = __webpack_require__(/*! ./Star */ \"./node_modules/phaser/src/gameobjects/shape/star/Star.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Star Shape Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Star Game Object has been built into Phaser.\r\n * \r\n * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports both fill and stroke colors.\r\n * \r\n * As the name implies, the Star shape will display a star in your game. You can control several\r\n * aspects of it including the number of points that constitute the star. The default is 5. If\r\n * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky\r\n * star shape.\r\n * \r\n * You can also control the inner and outer radius, which is how 'long' each point of the star is.\r\n * Modify these values to create more interesting shapes.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#star\r\n * @since 3.13.0\r\n *\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [points=5] - The number of points on the star.\r\n * @param {number} [innerRadius=32] - The inner radius of the star.\r\n * @param {number} [outerRadius=64] - The outer radius of the star.\r\n * @param {number} [fillColor] - The color the star will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the star will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n *\r\n * @return {Phaser.GameObjects.Star} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('star', function (x, y, points, innerRadius, outerRadius, fillColor, fillAlpha)\r\n{\r\n return this.displayList.add(new Star(this.scene, x, y, points, innerRadius, outerRadius, fillColor, fillAlpha));\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/star/StarFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/star/StarRender.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/star/StarRender.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./StarWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/shape/star/StarWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./StarCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/shape/star/StarCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/star/StarRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/star/StarWebGLRenderer.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/star/StarWebGLRenderer.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FillPathWebGL = __webpack_require__(/*! ../FillPathWebGL */ \"./node_modules/phaser/src/gameobjects/shape/FillPathWebGL.js\");\r\nvar StrokePathWebGL = __webpack_require__(/*! ../StrokePathWebGL */ \"./node_modules/phaser/src/gameobjects/shape/StrokePathWebGL.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Star#renderWebGL\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Star} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar StarWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var pipeline = this.pipeline;\r\n\r\n var camMatrix = pipeline._tempMatrix1;\r\n var shapeMatrix = pipeline._tempMatrix2;\r\n var calcMatrix = pipeline._tempMatrix3;\r\n\r\n renderer.setPipeline(pipeline);\r\n\r\n shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n shapeMatrix.e = src.x;\r\n shapeMatrix.f = src.y;\r\n }\r\n else\r\n {\r\n shapeMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n shapeMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n }\r\n\r\n camMatrix.multiply(shapeMatrix, calcMatrix);\r\n\r\n var dx = src._displayOriginX;\r\n var dy = src._displayOriginY;\r\n\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (src.isFilled)\r\n {\r\n FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy);\r\n }\r\n\r\n if (src.isStroked)\r\n {\r\n StrokePathWebGL(pipeline, src, alpha, dx, dy);\r\n }\r\n};\r\n\r\nmodule.exports = StarWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/star/StarWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/triangle/Triangle.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/triangle/Triangle.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Shape = __webpack_require__(/*! ../Shape */ \"./node_modules/phaser/src/gameobjects/shape/Shape.js\");\r\nvar GeomTriangle = __webpack_require__(/*! ../../../geom/triangle/Triangle */ \"./node_modules/phaser/src/geom/triangle/Triangle.js\");\r\nvar TriangleRender = __webpack_require__(/*! ./TriangleRender */ \"./node_modules/phaser/src/gameobjects/shape/triangle/TriangleRender.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Triangle Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports both fill and stroke colors.\r\n * \r\n * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the\r\n * position of each point of these lines. The triangle is always closed and cannot have an open\r\n * face. If you require that, consider using a Polygon instead.\r\n *\r\n * @class Triangle\r\n * @extends Phaser.GameObjects.Shape\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.13.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [x1=0] - The horizontal position of the first point in the triangle.\r\n * @param {number} [y1=128] - The vertical position of the first point in the triangle.\r\n * @param {number} [x2=64] - The horizontal position of the second point in the triangle.\r\n * @param {number} [y2=0] - The vertical position of the second point in the triangle.\r\n * @param {number} [x3=128] - The horizontal position of the third point in the triangle.\r\n * @param {number} [y3=128] - The vertical position of the third point in the triangle.\r\n * @param {number} [fillColor] - The color the triangle will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the triangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n */\r\nvar Triangle = new Class({\r\n\r\n Extends: Shape,\r\n\r\n Mixins: [\r\n TriangleRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Triangle (scene, x, y, x1, y1, x2, y2, x3, y3, fillColor, fillAlpha)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (x1 === undefined) { x1 = 0; }\r\n if (y1 === undefined) { y1 = 128; }\r\n if (x2 === undefined) { x2 = 64; }\r\n if (y2 === undefined) { y2 = 0; }\r\n if (x3 === undefined) { x3 = 128; }\r\n if (y3 === undefined) { y3 = 128; }\r\n\r\n Shape.call(this, scene, 'Triangle', new GeomTriangle(x1, y1, x2, y2, x3, y3));\r\n\r\n var width = this.geom.right - this.geom.left;\r\n var height = this.geom.bottom - this.geom.top;\r\n\r\n this.setPosition(x, y);\r\n this.setSize(width, height);\r\n\r\n if (fillColor !== undefined)\r\n {\r\n this.setFillStyle(fillColor, fillAlpha);\r\n }\r\n\r\n this.updateDisplayOrigin();\r\n this.updateData();\r\n },\r\n\r\n /**\r\n * Sets the data for the lines that make up this Triangle shape.\r\n *\r\n * @method Phaser.GameObjects.Triangle#setTo\r\n * @since 3.13.0\r\n *\r\n * @param {number} [x1=0] - The horizontal position of the first point in the triangle.\r\n * @param {number} [y1=0] - The vertical position of the first point in the triangle.\r\n * @param {number} [x2=0] - The horizontal position of the second point in the triangle.\r\n * @param {number} [y2=0] - The vertical position of the second point in the triangle.\r\n * @param {number} [x3=0] - The horizontal position of the third point in the triangle.\r\n * @param {number} [y3=0] - The vertical position of the third point in the triangle.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setTo: function (x1, y1, x2, y2, x3, y3)\r\n {\r\n this.geom.setTo(x1, y1, x2, y2, x3, y3);\r\n\r\n return this.updateData();\r\n },\r\n\r\n /**\r\n * Internal method that updates the data and path values.\r\n *\r\n * @method Phaser.GameObjects.Triangle#updateData\r\n * @private\r\n * @since 3.13.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n updateData: function ()\r\n {\r\n var path = [];\r\n var tri = this.geom;\r\n var line = this._tempLine;\r\n\r\n tri.getLineA(line);\r\n\r\n path.push(line.x1, line.y1, line.x2, line.y2);\r\n\r\n tri.getLineB(line);\r\n\r\n path.push(line.x2, line.y2);\r\n\r\n tri.getLineC(line);\r\n\r\n path.push(line.x2, line.y2);\r\n\r\n this.pathData = path;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Triangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/triangle/Triangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/triangle/TriangleCanvasRenderer.js": /*!**************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/triangle/TriangleCanvasRenderer.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FillStyleCanvas = __webpack_require__(/*! ../FillStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/FillStyleCanvas.js\");\r\nvar LineStyleCanvas = __webpack_require__(/*! ../LineStyleCanvas */ \"./node_modules/phaser/src/gameobjects/shape/LineStyleCanvas.js\");\r\nvar SetTransform = __webpack_require__(/*! ../../../renderer/canvas/utils/SetTransform */ \"./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js\");\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Triangle#renderCanvas\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Triangle} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar TriangleCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var ctx = renderer.currentContext;\r\n\r\n if (SetTransform(renderer, ctx, src, camera, parentMatrix))\r\n {\r\n var dx = src._displayOriginX;\r\n var dy = src._displayOriginY;\r\n\r\n var x1 = src.geom.x1 - dx;\r\n var y1 = src.geom.y1 - dy;\r\n var x2 = src.geom.x2 - dx;\r\n var y2 = src.geom.y2 - dy;\r\n var x3 = src.geom.x3 - dx;\r\n var y3 = src.geom.y3 - dy;\r\n\r\n ctx.beginPath();\r\n\r\n ctx.moveTo(x1, y1);\r\n ctx.lineTo(x2, y2);\r\n ctx.lineTo(x3, y3);\r\n\r\n ctx.closePath();\r\n\r\n if (src.isFilled)\r\n {\r\n FillStyleCanvas(ctx, src);\r\n\r\n ctx.fill();\r\n }\r\n\r\n if (src.isStroked)\r\n {\r\n LineStyleCanvas(ctx, src);\r\n\r\n ctx.stroke();\r\n }\r\n\r\n // Restore the context saved in SetTransform\r\n ctx.restore();\r\n }\r\n};\r\n\r\nmodule.exports = TriangleCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/triangle/TriangleCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/triangle/TriangleFactory.js": /*!*******************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/triangle/TriangleFactory.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectFactory = __webpack_require__(/*! ../../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar Triangle = __webpack_require__(/*! ./Triangle */ \"./node_modules/phaser/src/gameobjects/shape/triangle/Triangle.js\");\r\n\r\n/**\r\n * Creates a new Triangle Shape Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Triangle Game Object has been built into Phaser.\r\n * \r\n * The Triangle Shape is a Game Object that can be added to a Scene, Group or Container. You can\r\n * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling\r\n * it for input or physics. It provides a quick and easy way for you to render this shape in your\r\n * game without using a texture, while still taking advantage of being fully batched in WebGL.\r\n * \r\n * This shape supports both fill and stroke colors.\r\n * \r\n * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the\r\n * position of each point of these lines. The triangle is always closed and cannot have an open\r\n * face. If you require that, consider using a Polygon instead.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#triangle\r\n * @since 3.13.0\r\n *\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {number} [x1=0] - The horizontal position of the first point in the triangle.\r\n * @param {number} [y1=128] - The vertical position of the first point in the triangle.\r\n * @param {number} [x2=64] - The horizontal position of the second point in the triangle.\r\n * @param {number} [y2=0] - The vertical position of the second point in the triangle.\r\n * @param {number} [x3=128] - The horizontal position of the third point in the triangle.\r\n * @param {number} [y3=128] - The vertical position of the third point in the triangle.\r\n * @param {number} [fillColor] - The color the triangle will be filled with, i.e. 0xff0000 for red.\r\n * @param {number} [fillAlpha] - The alpha the triangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property.\r\n *\r\n * @return {Phaser.GameObjects.Triangle} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, fillColor, fillAlpha)\r\n{\r\n return this.displayList.add(new Triangle(this.scene, x, y, x1, y1, x2, y2, x3, y3, fillColor, fillAlpha));\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/triangle/TriangleFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/triangle/TriangleRender.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/triangle/TriangleRender.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./TriangleWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/shape/triangle/TriangleWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./TriangleCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/shape/triangle/TriangleCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/triangle/TriangleRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/shape/triangle/TriangleWebGLRenderer.js": /*!*************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/shape/triangle/TriangleWebGLRenderer.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar StrokePathWebGL = __webpack_require__(/*! ../StrokePathWebGL */ \"./node_modules/phaser/src/gameobjects/shape/StrokePathWebGL.js\");\r\nvar Utils = __webpack_require__(/*! ../../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Triangle#renderWebGL\r\n * @since 3.13.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Triangle} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar TriangleWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var pipeline = this.pipeline;\r\n\r\n var camMatrix = pipeline._tempMatrix1;\r\n var shapeMatrix = pipeline._tempMatrix2;\r\n var calcMatrix = pipeline._tempMatrix3;\r\n\r\n renderer.setPipeline(pipeline);\r\n\r\n shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n shapeMatrix.e = src.x;\r\n shapeMatrix.f = src.y;\r\n }\r\n else\r\n {\r\n shapeMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n shapeMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n }\r\n\r\n camMatrix.multiply(shapeMatrix, calcMatrix);\r\n\r\n var dx = src._displayOriginX;\r\n var dy = src._displayOriginY;\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (src.isFilled)\r\n {\r\n var fillTint = pipeline.fillTint;\r\n var fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha);\r\n\r\n fillTint.TL = fillTintColor;\r\n fillTint.TR = fillTintColor;\r\n fillTint.BL = fillTintColor;\r\n fillTint.BR = fillTintColor;\r\n\r\n var x1 = src.geom.x1 - dx;\r\n var y1 = src.geom.y1 - dy;\r\n var x2 = src.geom.x2 - dx;\r\n var y2 = src.geom.y2 - dy;\r\n var x3 = src.geom.x3 - dx;\r\n var y3 = src.geom.y3 - dy;\r\n\r\n pipeline.setTexture2D();\r\n\r\n pipeline.batchFillTriangle(\r\n x1,\r\n y1,\r\n x2,\r\n y2,\r\n x3,\r\n y3,\r\n shapeMatrix,\r\n camMatrix\r\n );\r\n }\r\n\r\n if (src.isStroked)\r\n {\r\n StrokePathWebGL(pipeline, src, alpha, dx, dy);\r\n }\r\n};\r\n\r\nmodule.exports = TriangleWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/shape/triangle/TriangleWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/sprite/Sprite.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/sprite/Sprite.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar SpriteRender = __webpack_require__(/*! ./SpriteRender */ \"./node_modules/phaser/src/gameobjects/sprite/SpriteRender.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Sprite Game Object.\r\n *\r\n * A Sprite Game Object is used for the display of both static and animated images in your game.\r\n * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled\r\n * and animated.\r\n *\r\n * The main difference between a Sprite and an Image Game Object is that you cannot animate Images.\r\n * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation\r\n * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases.\r\n *\r\n * @class Sprite\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Size\r\n * @extends Phaser.GameObjects.Components.TextureCrop\r\n * @extends Phaser.GameObjects.Components.Tint\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n */\r\nvar Sprite = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.Alpha,\r\n Components.BlendMode,\r\n Components.Depth,\r\n Components.Flip,\r\n Components.GetBounds,\r\n Components.Mask,\r\n Components.Origin,\r\n Components.Pipeline,\r\n Components.ScrollFactor,\r\n Components.Size,\r\n Components.TextureCrop,\r\n Components.Tint,\r\n Components.Transform,\r\n Components.Visible,\r\n SpriteRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Sprite (scene, x, y, texture, frame)\r\n {\r\n GameObject.call(this, scene, 'Sprite');\r\n\r\n /**\r\n * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method.\r\n *\r\n * @name Phaser.GameObjects.Sprite#_crop\r\n * @type {object}\r\n * @private\r\n * @since 3.11.0\r\n */\r\n this._crop = this.resetCropObject();\r\n\r\n /**\r\n * The Animation Controller of this Sprite.\r\n *\r\n * @name Phaser.GameObjects.Sprite#anims\r\n * @type {Phaser.GameObjects.Components.Animation}\r\n * @since 3.0.0\r\n */\r\n this.anims = new Components.Animation(this);\r\n\r\n this.setTexture(texture, frame);\r\n this.setPosition(x, y);\r\n this.setSizeToFrame();\r\n this.setOriginFromFrame();\r\n this.initPipeline();\r\n },\r\n\r\n /**\r\n * Update this Sprite's animations.\r\n *\r\n * @method Phaser.GameObjects.Sprite#preUpdate\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - The current timestamp.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n preUpdate: function (time, delta)\r\n {\r\n this.anims.update(time, delta);\r\n },\r\n\r\n /**\r\n * Start playing the given animation.\r\n *\r\n * @method Phaser.GameObjects.Sprite#play\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The string-based key of the animation to play.\r\n * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call.\r\n * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index.\r\n *\r\n * @return {Phaser.GameObjects.Sprite} This Game Object.\r\n */\r\n play: function (key, ignoreIfPlaying, startFrame)\r\n {\r\n this.anims.play(key, ignoreIfPlaying, startFrame);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Build a JSON representation of this Sprite.\r\n *\r\n * @method Phaser.GameObjects.Sprite#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object.\r\n */\r\n toJSON: function ()\r\n {\r\n var data = Components.ToJSON(this);\r\n\r\n // Extra Sprite data is added here\r\n\r\n return data;\r\n },\r\n\r\n /**\r\n * Handles the pre-destroy step for the Sprite, which removes the Animation component.\r\n *\r\n * @method Phaser.GameObjects.Sprite#preDestroy\r\n * @private\r\n * @since 3.14.0\r\n */\r\n preDestroy: function ()\r\n {\r\n this.anims.destroy();\r\n\r\n this.anims = undefined;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Sprite;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/sprite/Sprite.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/sprite/SpriteCanvasRenderer.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/sprite/SpriteCanvasRenderer.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Sprite#renderCanvas\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Sprite} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar SpriteCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n renderer.batchSprite(src, src.frame, camera, parentMatrix);\r\n};\r\n\r\nmodule.exports = SpriteCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/sprite/SpriteCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/sprite/SpriteCreator.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/sprite/SpriteCreator.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BuildGameObject = __webpack_require__(/*! ../BuildGameObject */ \"./node_modules/phaser/src/gameobjects/BuildGameObject.js\");\r\nvar BuildGameObjectAnimation = __webpack_require__(/*! ../BuildGameObjectAnimation */ \"./node_modules/phaser/src/gameobjects/BuildGameObjectAnimation.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar Sprite = __webpack_require__(/*! ./Sprite */ \"./node_modules/phaser/src/gameobjects/sprite/Sprite.js\");\r\n\r\n/**\r\n * Creates a new Sprite Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Sprite Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#sprite\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {Phaser.GameObjects.Sprite} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('sprite', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n var key = GetAdvancedValue(config, 'key', null);\r\n var frame = GetAdvancedValue(config, 'frame', null);\r\n\r\n var sprite = new Sprite(this.scene, 0, 0, key, frame);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, sprite, config);\r\n\r\n // Sprite specific config options:\r\n\r\n BuildGameObjectAnimation(sprite, config);\r\n\r\n return sprite;\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/sprite/SpriteCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/sprite/SpriteFactory.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/sprite/SpriteFactory.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar Sprite = __webpack_require__(/*! ./Sprite */ \"./node_modules/phaser/src/gameobjects/sprite/Sprite.js\");\r\n\r\n/**\r\n * Creates a new Sprite Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Sprite Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#sprite\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n *\r\n * @return {Phaser.GameObjects.Sprite} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('sprite', function (x, y, key, frame)\r\n{\r\n var sprite = new Sprite(this.scene, x, y, key, frame);\r\n\r\n this.displayList.add(sprite);\r\n this.updateList.add(sprite);\r\n\r\n return sprite;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/sprite/SpriteFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/sprite/SpriteRender.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/sprite/SpriteRender.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./SpriteWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/sprite/SpriteWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./SpriteCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/sprite/SpriteCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/sprite/SpriteRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/sprite/SpriteWebGLRenderer.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/sprite/SpriteWebGLRenderer.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Sprite#renderWebGL\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Sprite} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar SpriteWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n this.pipeline.batchSprite(src, camera, parentMatrix);\r\n};\r\n\r\nmodule.exports = SpriteWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/sprite/SpriteWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/text/GetTextSize.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/text/GetTextSize.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns an object containing dimensions of the Text object.\r\n *\r\n * @function Phaser.GameObjects.Text.GetTextSize\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Text} text - The Text object to calculate the size from.\r\n * @param {Phaser.Types.GameObjects.Text.TextMetrics} size - The Text metrics to use when calculating the size.\r\n * @param {array} lines - The lines of text to calculate the size from.\r\n *\r\n * @return {object} An object containing dimensions of the Text object.\r\n */\r\nvar GetTextSize = function (text, size, lines)\r\n{\r\n var canvas = text.canvas;\r\n var context = text.context;\r\n var style = text.style;\r\n\r\n var lineWidths = [];\r\n var maxLineWidth = 0;\r\n var drawnLines = lines.length;\r\n\r\n if (style.maxLines > 0 && style.maxLines < lines.length)\r\n {\r\n drawnLines = style.maxLines;\r\n }\r\n\r\n style.syncFont(canvas, context);\r\n\r\n // Text Width\r\n\r\n for (var i = 0; i < drawnLines; i++)\r\n {\r\n var lineWidth = style.strokeThickness;\r\n\r\n lineWidth += context.measureText(lines[i]).width;\r\n\r\n // Adjust for wrapped text\r\n if (style.wordWrap)\r\n {\r\n lineWidth -= context.measureText(' ').width;\r\n }\r\n\r\n lineWidths[i] = Math.ceil(lineWidth);\r\n maxLineWidth = Math.max(maxLineWidth, lineWidths[i]);\r\n }\r\n\r\n // Text Height\r\n\r\n var lineHeight = size.fontSize + style.strokeThickness;\r\n var height = lineHeight * drawnLines;\r\n var lineSpacing = text.lineSpacing;\r\n\r\n // Adjust for line spacing\r\n if (drawnLines > 1)\r\n {\r\n height += lineSpacing * (drawnLines - 1);\r\n }\r\n\r\n return {\r\n width: maxLineWidth,\r\n height: height,\r\n lines: drawnLines,\r\n lineWidths: lineWidths,\r\n lineSpacing: lineSpacing,\r\n lineHeight: lineHeight\r\n };\r\n};\r\n\r\nmodule.exports = GetTextSize;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/text/GetTextSize.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/text/MeasureText.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/text/MeasureText.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CanvasPool = __webpack_require__(/*! ../../display/canvas/CanvasPool */ \"./node_modules/phaser/src/display/canvas/CanvasPool.js\");\r\n\r\n/**\r\n * Calculates the ascent, descent and fontSize of a given font style.\r\n *\r\n * @function Phaser.GameObjects.Text.MeasureText\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.TextStyle} textStyle - The TextStyle object to measure.\r\n *\r\n * @return {Phaser.Types.GameObjects.Text.TextMetrics} An object containing the ascent, descent and fontSize of the TextStyle.\r\n */\r\nvar MeasureText = function (textStyle)\r\n{\r\n // @property {HTMLCanvasElement} canvas - The canvas element that the text is rendered.\r\n var canvas = CanvasPool.create(this);\r\n\r\n // @property {HTMLCanvasElement} context - The context of the canvas element that the text is rendered to.\r\n var context = canvas.getContext('2d');\r\n\r\n textStyle.syncFont(canvas, context);\r\n\r\n var width = Math.ceil(context.measureText(textStyle.testString).width * textStyle.baselineX);\r\n var baseline = width;\r\n var height = 2 * baseline;\r\n\r\n baseline = baseline * textStyle.baselineY | 0;\r\n\r\n canvas.width = width;\r\n canvas.height = height;\r\n\r\n context.fillStyle = '#f00';\r\n context.fillRect(0, 0, width, height);\r\n\r\n context.font = textStyle._font;\r\n\r\n context.textBaseline = 'alphabetic';\r\n context.fillStyle = '#000';\r\n context.fillText(textStyle.testString, 0, baseline);\r\n\r\n var output = {\r\n ascent: 0,\r\n descent: 0,\r\n fontSize: 0\r\n };\r\n\r\n if (!context.getImageData(0, 0, width, height))\r\n {\r\n output.ascent = baseline;\r\n output.descent = baseline + 6;\r\n output.fontSize = output.ascent + output.descent;\r\n\r\n CanvasPool.remove(canvas);\r\n\r\n return output;\r\n }\r\n\r\n var imagedata = context.getImageData(0, 0, width, height).data;\r\n var pixels = imagedata.length;\r\n var line = width * 4;\r\n var i;\r\n var j;\r\n var idx = 0;\r\n var stop = false;\r\n\r\n // ascent. scan from top to bottom until we find a non red pixel\r\n for (i = 0; i < baseline; i++)\r\n {\r\n for (j = 0; j < line; j += 4)\r\n {\r\n if (imagedata[idx + j] !== 255)\r\n {\r\n stop = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!stop)\r\n {\r\n idx += line;\r\n }\r\n else\r\n {\r\n break;\r\n }\r\n }\r\n\r\n output.ascent = baseline - i;\r\n\r\n idx = pixels - line;\r\n stop = false;\r\n\r\n // descent. scan from bottom to top until we find a non red pixel\r\n for (i = height; i > baseline; i--)\r\n {\r\n for (j = 0; j < line; j += 4)\r\n {\r\n if (imagedata[idx + j] !== 255)\r\n {\r\n stop = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!stop)\r\n {\r\n idx -= line;\r\n }\r\n else\r\n {\r\n break;\r\n }\r\n }\r\n\r\n output.descent = (i - baseline);\r\n output.fontSize = output.ascent + output.descent;\r\n\r\n CanvasPool.remove(canvas);\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = MeasureText;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/text/MeasureText.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/text/TextStyle.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/text/TextStyle.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar MeasureText = __webpack_require__(/*! ./MeasureText */ \"./node_modules/phaser/src/gameobjects/text/MeasureText.js\");\r\n\r\n// Key: [ Object Key, Default Value ]\r\n\r\nvar propertyMap = {\r\n fontFamily: [ 'fontFamily', 'Courier' ],\r\n fontSize: [ 'fontSize', '16px' ],\r\n fontStyle: [ 'fontStyle', '' ],\r\n backgroundColor: [ 'backgroundColor', null ],\r\n color: [ 'color', '#fff' ],\r\n stroke: [ 'stroke', '#fff' ],\r\n strokeThickness: [ 'strokeThickness', 0 ],\r\n shadowOffsetX: [ 'shadow.offsetX', 0 ],\r\n shadowOffsetY: [ 'shadow.offsetY', 0 ],\r\n shadowColor: [ 'shadow.color', '#000' ],\r\n shadowBlur: [ 'shadow.blur', 0 ],\r\n shadowStroke: [ 'shadow.stroke', false ],\r\n shadowFill: [ 'shadow.fill', false ],\r\n align: [ 'align', 'left' ],\r\n maxLines: [ 'maxLines', 0 ],\r\n fixedWidth: [ 'fixedWidth', 0 ],\r\n fixedHeight: [ 'fixedHeight', 0 ],\r\n resolution: [ 'resolution', 0 ],\r\n rtl: [ 'rtl', false ],\r\n testString: [ 'testString', '|MÉqgy' ],\r\n baselineX: [ 'baselineX', 1.2 ],\r\n baselineY: [ 'baselineY', 1.4 ],\r\n wordWrapWidth: [ 'wordWrap.width', null ],\r\n wordWrapCallback: [ 'wordWrap.callback', null ],\r\n wordWrapCallbackScope: [ 'wordWrap.callbackScope', null ],\r\n wordWrapUseAdvanced: [ 'wordWrap.useAdvancedWrap', false ]\r\n};\r\n\r\n/**\r\n * @classdesc\r\n * A TextStyle class manages all of the style settings for a Text object.\r\n * \r\n * Text Game Objects create a TextStyle instance automatically, which is\r\n * accessed via the `Text.style` property. You do not normally need to\r\n * instantiate one yourself.\r\n *\r\n * @class TextStyle\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Text} text - The Text object that this TextStyle is styling.\r\n * @param {Phaser.Types.GameObjects.Text.TextStyle} style - The style settings to set.\r\n */\r\nvar TextStyle = new Class({\r\n\r\n initialize:\r\n\r\n function TextStyle (text, style)\r\n {\r\n /**\r\n * The Text object that this TextStyle is styling.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#parent\r\n * @type {Phaser.GameObjects.Text}\r\n * @since 3.0.0\r\n */\r\n this.parent = text;\r\n\r\n /**\r\n * The font family.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#fontFamily\r\n * @type {string}\r\n * @default 'Courier'\r\n * @since 3.0.0\r\n */\r\n this.fontFamily;\r\n\r\n /**\r\n * The font size.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#fontSize\r\n * @type {string}\r\n * @default '16px'\r\n * @since 3.0.0\r\n */\r\n this.fontSize;\r\n\r\n /**\r\n * The font style.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#fontStyle\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.fontStyle;\r\n\r\n /**\r\n * The background color.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#backgroundColor\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.backgroundColor;\r\n\r\n /**\r\n * The text fill color.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#color\r\n * @type {string}\r\n * @default '#fff'\r\n * @since 3.0.0\r\n */\r\n this.color;\r\n\r\n /**\r\n * The text stroke color.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#stroke\r\n * @type {string}\r\n * @default '#fff'\r\n * @since 3.0.0\r\n */\r\n this.stroke;\r\n\r\n /**\r\n * The text stroke thickness.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#strokeThickness\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.strokeThickness;\r\n\r\n /**\r\n * The horizontal shadow offset.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#shadowOffsetX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.shadowOffsetX;\r\n\r\n /**\r\n * The vertical shadow offset.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#shadowOffsetY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.shadowOffsetY;\r\n\r\n /**\r\n * The shadow color.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#shadowColor\r\n * @type {string}\r\n * @default '#000'\r\n * @since 3.0.0\r\n */\r\n this.shadowColor;\r\n\r\n /**\r\n * The shadow blur radius.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#shadowBlur\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.shadowBlur;\r\n\r\n /**\r\n * Whether shadow stroke is enabled or not.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#shadowStroke\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.shadowStroke;\r\n\r\n /**\r\n * Whether shadow fill is enabled or not.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#shadowFill\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.shadowFill;\r\n\r\n /**\r\n * The text alignment.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#align\r\n * @type {string}\r\n * @default 'left'\r\n * @since 3.0.0\r\n */\r\n this.align;\r\n\r\n /**\r\n * The maximum number of lines to draw.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#maxLines\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.maxLines;\r\n\r\n /**\r\n * The fixed width of the text.\r\n *\r\n * `0` means no fixed with.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#fixedWidth\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.fixedWidth;\r\n\r\n /**\r\n * The fixed height of the text.\r\n *\r\n * `0` means no fixed height.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#fixedHeight\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.fixedHeight;\r\n\r\n /**\r\n * The resolution the text is rendered to its internal canvas at.\r\n * The default is 0, which means it will use the resolution set in the Game Config.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#resolution\r\n * @type {number}\r\n * @default 0\r\n * @since 3.12.0\r\n */\r\n this.resolution;\r\n\r\n /**\r\n * Whether the text should render right to left.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#rtl\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.rtl;\r\n\r\n /**\r\n * The test string to use when measuring the font.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#testString\r\n * @type {string}\r\n * @default '|MÉqgy'\r\n * @since 3.0.0\r\n */\r\n this.testString;\r\n\r\n /**\r\n * The amount of horizontal padding added to the width of the text when calculating the font metrics.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#baselineX\r\n * @type {number}\r\n * @default 1.2\r\n * @since 3.3.0\r\n */\r\n this.baselineX;\r\n\r\n /**\r\n * The amount of vertical padding added to the height of the text when calculating the font metrics.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#baselineY\r\n * @type {number}\r\n * @default 1.4\r\n * @since 3.3.0\r\n */\r\n this.baselineY;\r\n\r\n /**\r\n * The font style, size and family.\r\n *\r\n * @name Phaser.GameObjects.TextStyle#_font\r\n * @type {string}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._font;\r\n\r\n // Set to defaults + user style\r\n this.setStyle(style, false, true);\r\n\r\n var metrics = GetValue(style, 'metrics', false);\r\n\r\n // Provide optional TextMetrics in the style object to avoid the canvas look-up / scanning\r\n // Doing this is reset if you then change the font of this TextStyle after creation\r\n if (metrics)\r\n {\r\n this.metrics = {\r\n ascent: GetValue(metrics, 'ascent', 0),\r\n descent: GetValue(metrics, 'descent', 0),\r\n fontSize: GetValue(metrics, 'fontSize', 0)\r\n };\r\n }\r\n else\r\n {\r\n this.metrics = MeasureText(this);\r\n }\r\n },\r\n\r\n /**\r\n * Set the text style.\r\n *\r\n * @example\r\n * text.setStyle({\r\n * fontSize: '64px',\r\n * fontFamily: 'Arial',\r\n * color: '#ffffff',\r\n * align: 'center',\r\n * backgroundColor: '#ff00ff'\r\n * });\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setStyle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.Text.TextStyle} style - The style settings to set.\r\n * @param {boolean} [updateText=true] - Whether to update the text immediately.\r\n * @param {boolean} [setDefaults=false] - Use the default values is not set, or the local values.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setStyle: function (style, updateText, setDefaults)\r\n {\r\n if (updateText === undefined) { updateText = true; }\r\n if (setDefaults === undefined) { setDefaults = false; }\r\n\r\n // Avoid type mutation\r\n if (style && style.hasOwnProperty('fontSize') && typeof style.fontSize === 'number')\r\n {\r\n style.fontSize = style.fontSize.toString() + 'px';\r\n }\r\n\r\n for (var key in propertyMap)\r\n {\r\n var value = (setDefaults) ? propertyMap[key][1] : this[key];\r\n\r\n if (key === 'wordWrapCallback' || key === 'wordWrapCallbackScope')\r\n {\r\n // Callback & scope should be set without processing the values\r\n this[key] = GetValue(style, propertyMap[key][0], value);\r\n }\r\n else\r\n {\r\n this[key] = GetAdvancedValue(style, propertyMap[key][0], value);\r\n }\r\n }\r\n\r\n // Allow for 'font' override\r\n var font = GetValue(style, 'font', null);\r\n\r\n if (font !== null)\r\n {\r\n this.setFont(font, false);\r\n }\r\n\r\n this._font = [ this.fontStyle, this.fontSize, this.fontFamily ].join(' ').trim();\r\n\r\n // Allow for 'fill' to be used in place of 'color'\r\n var fill = GetValue(style, 'fill', null);\r\n\r\n if (fill !== null)\r\n {\r\n this.color = fill;\r\n }\r\n\r\n if (updateText)\r\n {\r\n return this.update(true);\r\n }\r\n else\r\n {\r\n return this.parent;\r\n }\r\n },\r\n\r\n /**\r\n * Synchronize the font settings to the given Canvas Rendering Context.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#syncFont\r\n * @since 3.0.0\r\n *\r\n * @param {HTMLCanvasElement} canvas - The Canvas Element.\r\n * @param {CanvasRenderingContext2D} context - The Canvas Rendering Context.\r\n */\r\n syncFont: function (canvas, context)\r\n {\r\n context.font = this._font;\r\n },\r\n\r\n /**\r\n * Synchronize the text style settings to the given Canvas Rendering Context.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#syncStyle\r\n * @since 3.0.0\r\n *\r\n * @param {HTMLCanvasElement} canvas - The Canvas Element.\r\n * @param {CanvasRenderingContext2D} context - The Canvas Rendering Context.\r\n */\r\n syncStyle: function (canvas, context)\r\n {\r\n context.textBaseline = 'alphabetic';\r\n\r\n context.fillStyle = this.color;\r\n context.strokeStyle = this.stroke;\r\n\r\n context.lineWidth = this.strokeThickness;\r\n context.lineCap = 'round';\r\n context.lineJoin = 'round';\r\n },\r\n\r\n /**\r\n * Synchronize the shadow settings to the given Canvas Rendering Context.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#syncShadow\r\n * @since 3.0.0\r\n *\r\n * @param {CanvasRenderingContext2D} context - The Canvas Rendering Context.\r\n * @param {boolean} enabled - Whether shadows are enabled or not.\r\n */\r\n syncShadow: function (context, enabled)\r\n {\r\n if (enabled)\r\n {\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n }\r\n else\r\n {\r\n context.shadowOffsetX = 0;\r\n context.shadowOffsetY = 0;\r\n context.shadowColor = 0;\r\n context.shadowBlur = 0;\r\n }\r\n },\r\n\r\n /**\r\n * Update the style settings for the parent Text object.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#update\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} recalculateMetrics - Whether to recalculate font and text metrics.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n update: function (recalculateMetrics)\r\n {\r\n if (recalculateMetrics)\r\n {\r\n this._font = [ this.fontStyle, this.fontSize, this.fontFamily ].join(' ').trim();\r\n\r\n this.metrics = MeasureText(this);\r\n }\r\n\r\n return this.parent.updateText();\r\n },\r\n\r\n /**\r\n * Set the font.\r\n *\r\n * If a string is given, the font family is set.\r\n *\r\n * If an object is given, the `fontFamily`, `fontSize` and `fontStyle`\r\n * properties of that object are set.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setFont\r\n * @since 3.0.0\r\n *\r\n * @param {(string|object)} font - The font family or font settings to set.\r\n * @param {boolean} [updateText=true] - Whether to update the text immediately.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setFont: function (font, updateText)\r\n {\r\n if (updateText === undefined) { updateText = true; }\r\n\r\n var fontFamily = font;\r\n var fontSize = '';\r\n var fontStyle = '';\r\n\r\n if (typeof font !== 'string')\r\n {\r\n fontFamily = GetValue(font, 'fontFamily', 'Courier');\r\n fontSize = GetValue(font, 'fontSize', '16px');\r\n fontStyle = GetValue(font, 'fontStyle', '');\r\n }\r\n else\r\n {\r\n var fontSplit = font.split(' ');\r\n\r\n var i = 0;\r\n\r\n fontStyle = (fontSplit.length > 2) ? fontSplit[i++] : '';\r\n fontSize = fontSplit[i++] || '16px';\r\n fontFamily = fontSplit[i++] || 'Courier';\r\n }\r\n\r\n if (fontFamily !== this.fontFamily || fontSize !== this.fontSize || fontStyle !== this.fontStyle)\r\n {\r\n this.fontFamily = fontFamily;\r\n this.fontSize = fontSize;\r\n this.fontStyle = fontStyle;\r\n\r\n if (updateText)\r\n {\r\n this.update(true);\r\n }\r\n }\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Set the font family.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setFontFamily\r\n * @since 3.0.0\r\n *\r\n * @param {string} family - The font family.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setFontFamily: function (family)\r\n {\r\n if (this.fontFamily !== family)\r\n {\r\n this.fontFamily = family;\r\n\r\n this.update(true);\r\n }\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Set the font style.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setFontStyle\r\n * @since 3.0.0\r\n *\r\n * @param {string} style - The font style.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setFontStyle: function (style)\r\n {\r\n if (this.fontStyle !== style)\r\n {\r\n this.fontStyle = style;\r\n\r\n this.update(true);\r\n }\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Set the font size.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setFontSize\r\n * @since 3.0.0\r\n *\r\n * @param {(number|string)} size - The font size.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setFontSize: function (size)\r\n {\r\n if (typeof size === 'number')\r\n {\r\n size = size.toString() + 'px';\r\n }\r\n\r\n if (this.fontSize !== size)\r\n {\r\n this.fontSize = size;\r\n\r\n this.update(true);\r\n }\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Set the test string to use when measuring the font.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setTestString\r\n * @since 3.0.0\r\n *\r\n * @param {string} string - The test string to use when measuring the font.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setTestString: function (string)\r\n {\r\n this.testString = string;\r\n\r\n return this.update(true);\r\n },\r\n\r\n /**\r\n * Set a fixed width and height for the text.\r\n *\r\n * Pass in `0` for either of these parameters to disable fixed width or height respectively.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setFixedSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The fixed width to set.\r\n * @param {number} height - The fixed height to set.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setFixedSize: function (width, height)\r\n {\r\n this.fixedWidth = width;\r\n this.fixedHeight = height;\r\n\r\n if (width)\r\n {\r\n this.parent.width = width;\r\n }\r\n\r\n if (height)\r\n {\r\n this.parent.height = height;\r\n }\r\n\r\n return this.update(false);\r\n },\r\n\r\n /**\r\n * Set the background color.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setBackgroundColor\r\n * @since 3.0.0\r\n *\r\n * @param {string} color - The background color.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setBackgroundColor: function (color)\r\n {\r\n this.backgroundColor = color;\r\n\r\n return this.update(false);\r\n },\r\n\r\n /**\r\n * Set the text fill color.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setFill\r\n * @since 3.0.0\r\n *\r\n * @param {string} color - The text fill color.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setFill: function (color)\r\n {\r\n this.color = color;\r\n\r\n return this.update(false);\r\n },\r\n\r\n /**\r\n * Set the text fill color.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setColor\r\n * @since 3.0.0\r\n *\r\n * @param {string} color - The text fill color.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setColor: function (color)\r\n {\r\n this.color = color;\r\n\r\n return this.update(false);\r\n },\r\n\r\n /**\r\n * Set the resolution used by the Text object.\r\n *\r\n * By default it will be set to match the resolution set in the Game Config,\r\n * but you can override it via this method. It allows for much clearer text on High DPI devices,\r\n * at the cost of memory because it uses larger internal Canvas textures for the Text.\r\n * \r\n * Please use with caution, as the more high res Text you have, the more memory it uses up.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setResolution\r\n * @since 3.12.0\r\n *\r\n * @param {number} value - The resolution for this Text object to use.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setResolution: function (value)\r\n {\r\n this.resolution = value;\r\n\r\n return this.update(false);\r\n },\r\n\r\n /**\r\n * Set the stroke settings.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setStroke\r\n * @since 3.0.0\r\n *\r\n * @param {string} color - The stroke color.\r\n * @param {number} thickness - The stroke thickness.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setStroke: function (color, thickness)\r\n {\r\n if (thickness === undefined) { thickness = this.strokeThickness; }\r\n\r\n if (color === undefined && this.strokeThickness !== 0)\r\n {\r\n // Reset the stroke to zero (disabling it)\r\n this.strokeThickness = 0;\r\n\r\n this.update(true);\r\n }\r\n else if (this.stroke !== color || this.strokeThickness !== thickness)\r\n {\r\n this.stroke = color;\r\n this.strokeThickness = thickness;\r\n\r\n this.update(true);\r\n }\r\n\r\n return this.parent;\r\n },\r\n\r\n /**\r\n * Set the shadow settings.\r\n * \r\n * Calling this method always re-measures the parent Text object,\r\n * so only call it when you actually change the shadow settings.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setShadow\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The horizontal shadow offset.\r\n * @param {number} [y=0] - The vertical shadow offset.\r\n * @param {string} [color='#000'] - The shadow color.\r\n * @param {number} [blur=0] - The shadow blur radius.\r\n * @param {boolean} [shadowStroke=false] - Whether to stroke the shadow.\r\n * @param {boolean} [shadowFill=true] - Whether to fill the shadow.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setShadow: function (x, y, color, blur, shadowStroke, shadowFill)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (color === undefined) { color = '#000'; }\r\n if (blur === undefined) { blur = 0; }\r\n if (shadowStroke === undefined) { shadowStroke = false; }\r\n if (shadowFill === undefined) { shadowFill = true; }\r\n\r\n this.shadowOffsetX = x;\r\n this.shadowOffsetY = y;\r\n this.shadowColor = color;\r\n this.shadowBlur = blur;\r\n this.shadowStroke = shadowStroke;\r\n this.shadowFill = shadowFill;\r\n\r\n return this.update(false);\r\n },\r\n\r\n /**\r\n * Set the shadow offset.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setShadowOffset\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The horizontal shadow offset.\r\n * @param {number} [y=0] - The vertical shadow offset.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setShadowOffset: function (x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.shadowOffsetX = x;\r\n this.shadowOffsetY = y;\r\n\r\n return this.update(false);\r\n },\r\n\r\n /**\r\n * Set the shadow color.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setShadowColor\r\n * @since 3.0.0\r\n *\r\n * @param {string} [color='#000'] - The shadow color.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setShadowColor: function (color)\r\n {\r\n if (color === undefined) { color = '#000'; }\r\n\r\n this.shadowColor = color;\r\n\r\n return this.update(false);\r\n },\r\n\r\n /**\r\n * Set the shadow blur radius.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setShadowBlur\r\n * @since 3.0.0\r\n *\r\n * @param {number} [blur=0] - The shadow blur radius.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setShadowBlur: function (blur)\r\n {\r\n if (blur === undefined) { blur = 0; }\r\n\r\n this.shadowBlur = blur;\r\n\r\n return this.update(false);\r\n },\r\n\r\n /**\r\n * Enable or disable shadow stroke.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setShadowStroke\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} enabled - Whether shadow stroke is enabled or not.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setShadowStroke: function (enabled)\r\n {\r\n this.shadowStroke = enabled;\r\n\r\n return this.update(false);\r\n },\r\n\r\n /**\r\n * Enable or disable shadow fill.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setShadowFill\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} enabled - Whether shadow fill is enabled or not.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setShadowFill: function (enabled)\r\n {\r\n this.shadowFill = enabled;\r\n\r\n return this.update(false);\r\n },\r\n\r\n /**\r\n * Set the width (in pixels) to use for wrapping lines.\r\n *\r\n * Pass in null to remove wrapping by width.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setWordWrapWidth\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The maximum width of a line in pixels. Set to null to remove wrapping.\r\n * @param {boolean} [useAdvancedWrap=false] - Whether or not to use the advanced wrapping\r\n * algorithm. If true, spaces are collapsed and whitespace is trimmed from lines. If false,\r\n * spaces and whitespace are left as is.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setWordWrapWidth: function (width, useAdvancedWrap)\r\n {\r\n if (useAdvancedWrap === undefined) { useAdvancedWrap = false; }\r\n\r\n this.wordWrapWidth = width;\r\n this.wordWrapUseAdvanced = useAdvancedWrap;\r\n\r\n return this.update(false);\r\n },\r\n\r\n /**\r\n * Set a custom callback for wrapping lines.\r\n *\r\n * Pass in null to remove wrapping by callback.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setWordWrapCallback\r\n * @since 3.0.0\r\n *\r\n * @param {TextStyleWordWrapCallback} callback - A custom function that will be responsible for wrapping the\r\n * text. It will receive two arguments: text (the string to wrap), textObject (this Text\r\n * instance). It should return the wrapped lines either as an array of lines or as a string with\r\n * newline characters in place to indicate where breaks should happen.\r\n * @param {object} [scope=null] - The scope that will be applied when the callback is invoked.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setWordWrapCallback: function (callback, scope)\r\n {\r\n if (scope === undefined) { scope = null; }\r\n\r\n this.wordWrapCallback = callback;\r\n this.wordWrapCallbackScope = scope;\r\n\r\n return this.update(false);\r\n },\r\n\r\n /**\r\n * Set the alignment of the text in this Text object.\r\n * \r\n * The argument can be one of: `left`, `right`, `center` or `justify`.\r\n * \r\n * Alignment only works if the Text object has more than one line of text.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setAlign\r\n * @since 3.0.0\r\n *\r\n * @param {string} [align='left'] - The text alignment for multi-line text.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setAlign: function (align)\r\n {\r\n if (align === undefined) { align = 'left'; }\r\n\r\n this.align = align;\r\n\r\n return this.update(false);\r\n },\r\n\r\n /**\r\n * Set the maximum number of lines to draw.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#setMaxLines\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [max=0] - The maximum number of lines to draw.\r\n *\r\n * @return {Phaser.GameObjects.Text} The parent Text object.\r\n */\r\n setMaxLines: function (max)\r\n {\r\n if (max === undefined) { max = 0; }\r\n\r\n this.maxLines = max;\r\n\r\n return this.update(false);\r\n },\r\n\r\n /**\r\n * Get the current text metrics.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#getTextMetrics\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.GameObjects.Text.TextMetrics} The text metrics.\r\n */\r\n getTextMetrics: function ()\r\n {\r\n var metrics = this.metrics;\r\n\r\n return {\r\n ascent: metrics.ascent,\r\n descent: metrics.descent,\r\n fontSize: metrics.fontSize\r\n };\r\n },\r\n\r\n /**\r\n * Build a JSON representation of this Text Style.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {object} A JSON representation of this Text Style.\r\n */\r\n toJSON: function ()\r\n {\r\n var output = {};\r\n\r\n for (var key in propertyMap)\r\n {\r\n output[key] = this[key];\r\n }\r\n\r\n output.metrics = this.getTextMetrics();\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Destroy this Text Style.\r\n *\r\n * @method Phaser.GameObjects.TextStyle#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.parent = undefined;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = TextStyle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/text/TextStyle.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/text/static/Text.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/text/static/Text.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar AddToDOM = __webpack_require__(/*! ../../../dom/AddToDOM */ \"./node_modules/phaser/src/dom/AddToDOM.js\");\r\nvar CanvasPool = __webpack_require__(/*! ../../../display/canvas/CanvasPool */ \"./node_modules/phaser/src/display/canvas/CanvasPool.js\");\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar GameEvents = __webpack_require__(/*! ../../../core/events */ \"./node_modules/phaser/src/core/events/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar GetTextSize = __webpack_require__(/*! ../GetTextSize */ \"./node_modules/phaser/src/gameobjects/text/GetTextSize.js\");\r\nvar GetValue = __webpack_require__(/*! ../../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar RemoveFromDOM = __webpack_require__(/*! ../../../dom/RemoveFromDOM */ \"./node_modules/phaser/src/dom/RemoveFromDOM.js\");\r\nvar TextRender = __webpack_require__(/*! ./TextRender */ \"./node_modules/phaser/src/gameobjects/text/static/TextRender.js\");\r\nvar TextStyle = __webpack_require__(/*! ../TextStyle */ \"./node_modules/phaser/src/gameobjects/text/TextStyle.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Text Game Object.\r\n * \r\n * Text objects work by creating their own internal hidden Canvas and then renders text to it using\r\n * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered\r\n * to your game during the render pass.\r\n * \r\n * Because it uses the Canvas API you can take advantage of all the features this offers, such as\r\n * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts\r\n * loaded externally, such as Google or TypeKit Web fonts.\r\n * \r\n * **Important:** If the font you wish to use has a space or digit in its name, such as\r\n * 'Press Start 2P' or 'Roboto Condensed', then you _must_ put the font name in quotes, either\r\n * when creating the Text object, or when setting the font via `setFont` or `setFontFamily`. I.e.:\r\n * \r\n * ```javascript\r\n * this.add.text(0, 0, 'Hello World', { fontFamily: '\"Roboto Condensed\"' });\r\n * ```\r\n * \r\n * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all\r\n * quoted properly, too:\r\n * \r\n * ```javascript\r\n * this.add.text(0, 0, 'Hello World', { fontFamily: 'Verdana, \"Times New Roman\", Tahoma, serif' });\r\n * ```\r\n *\r\n * You can only display fonts that are currently loaded and available to the browser: therefore fonts must\r\n * be pre-loaded. Phaser does not do ths for you, so you will require the use of a 3rd party font loader,\r\n * or have the fonts ready available in the CSS on the page in which your Phaser game resides.\r\n *\r\n * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts\r\n * across mobile browsers.\r\n * \r\n * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being\r\n * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the\r\n * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of\r\n * Text objects in your game. If you run into performance issues you would be better off using Bitmap Text\r\n * instead, as it benefits from batching and avoids expensive Canvas API calls.\r\n *\r\n * @class Text\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.ComputedSize\r\n * @extends Phaser.GameObjects.Components.Crop\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Tint\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {(string|string[])} text - The text this Text object will display.\r\n * @param {Phaser.Types.GameObjects.Text.TextStyle} style - The text style configuration object.\r\n */\r\nvar Text = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.Alpha,\r\n Components.BlendMode,\r\n Components.ComputedSize,\r\n Components.Crop,\r\n Components.Depth,\r\n Components.Flip,\r\n Components.GetBounds,\r\n Components.Mask,\r\n Components.Origin,\r\n Components.Pipeline,\r\n Components.ScrollFactor,\r\n Components.Tint,\r\n Components.Transform,\r\n Components.Visible,\r\n TextRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Text (scene, x, y, text, style)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n GameObject.call(this, scene, 'Text');\r\n\r\n /**\r\n * The renderer in use by this Text object.\r\n *\r\n * @name Phaser.GameObjects.Text#renderer\r\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\r\n * @since 3.12.0\r\n */\r\n this.renderer = scene.sys.game.renderer;\r\n\r\n this.setPosition(x, y);\r\n this.setOrigin(0, 0);\r\n this.initPipeline();\r\n\r\n /**\r\n * The canvas element that the text is rendered to.\r\n *\r\n * @name Phaser.GameObjects.Text#canvas\r\n * @type {HTMLCanvasElement}\r\n * @since 3.0.0\r\n */\r\n this.canvas = CanvasPool.create(this);\r\n\r\n /**\r\n * The context of the canvas element that the text is rendered to.\r\n *\r\n * @name Phaser.GameObjects.Text#context\r\n * @type {CanvasRenderingContext2D}\r\n * @since 3.0.0\r\n */\r\n this.context = this.canvas.getContext('2d');\r\n\r\n /**\r\n * The Text Style object.\r\n *\r\n * Manages the style of this Text object.\r\n *\r\n * @name Phaser.GameObjects.Text#style\r\n * @type {Phaser.GameObjects.TextStyle}\r\n * @since 3.0.0\r\n */\r\n this.style = new TextStyle(this, style);\r\n\r\n /**\r\n * Whether to automatically round line positions.\r\n *\r\n * @name Phaser.GameObjects.Text#autoRound\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.autoRound = true;\r\n\r\n /**\r\n * The Regular Expression that is used to split the text up into lines, in\r\n * multi-line text. By default this is `/(?:\\r\\n|\\r|\\n)/`.\r\n * You can change this RegExp to be anything else that you may need.\r\n *\r\n * @name Phaser.GameObjects.Text#splitRegExp\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.splitRegExp = /(?:\\r\\n|\\r|\\n)/;\r\n\r\n /**\r\n * The text to display.\r\n *\r\n * @name Phaser.GameObjects.Text#_text\r\n * @type {string}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._text = undefined;\r\n\r\n /**\r\n * Specify a padding value which is added to the line width and height when calculating the Text size.\r\n * Allows you to add extra spacing if the browser is unable to accurately determine the true font dimensions.\r\n *\r\n * @name Phaser.GameObjects.Text#padding\r\n * @type {{left:number,right:number,top:number,bottom:number}}\r\n * @since 3.0.0\r\n */\r\n this.padding = { left: 0, right: 0, top: 0, bottom: 0 };\r\n\r\n /**\r\n * The width of this Text object.\r\n *\r\n * @name Phaser.GameObjects.Text#width\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.width = 1;\r\n\r\n /**\r\n * The height of this Text object.\r\n *\r\n * @name Phaser.GameObjects.Text#height\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.height = 1;\r\n\r\n /**\r\n * The line spacing value.\r\n * This value is added to the font height to calculate the overall line height.\r\n * Only has an effect if this Text object contains multiple lines of text.\r\n * \r\n * If you update this property directly, instead of using the `setLineSpacing` method, then\r\n * be sure to call `updateText` after, or you won't see the change reflected in the Text object.\r\n *\r\n * @name Phaser.GameObjects.Text#lineSpacing\r\n * @type {number}\r\n * @since 3.13.0\r\n */\r\n this.lineSpacing = 0;\r\n\r\n /**\r\n * Whether the text or its settings have changed and need updating.\r\n *\r\n * @name Phaser.GameObjects.Text#dirty\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.dirty = false;\r\n\r\n // If resolution wasn't set, then we get it from the game config\r\n if (this.style.resolution === 0)\r\n {\r\n this.style.resolution = scene.sys.game.config.resolution;\r\n }\r\n\r\n /**\r\n * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method.\r\n *\r\n * @name Phaser.GameObjects.Text#_crop\r\n * @type {object}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._crop = this.resetCropObject();\r\n\r\n // Create a Texture for this Text object\r\n this.texture = scene.sys.textures.addCanvas(null, this.canvas, true);\r\n\r\n // Get the frame\r\n this.frame = this.texture.get();\r\n\r\n // Set the resolution\r\n this.frame.source.resolution = this.style.resolution;\r\n\r\n if (this.renderer && this.renderer.gl)\r\n {\r\n // Clear the default 1x1 glTexture, as we override it later\r\n this.renderer.deleteTexture(this.frame.source.glTexture);\r\n\r\n this.frame.source.glTexture = null;\r\n }\r\n\r\n this.initRTL();\r\n\r\n this.setText(text);\r\n\r\n if (style && style.padding)\r\n {\r\n this.setPadding(style.padding);\r\n }\r\n\r\n if (style && style.lineSpacing)\r\n {\r\n this.setLineSpacing(style.lineSpacing);\r\n }\r\n\r\n scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function ()\r\n {\r\n this.dirty = true;\r\n }, this);\r\n },\r\n\r\n /**\r\n * Initialize right to left text.\r\n *\r\n * @method Phaser.GameObjects.Text#initRTL\r\n * @since 3.0.0\r\n */\r\n initRTL: function ()\r\n {\r\n if (!this.style.rtl)\r\n {\r\n return;\r\n }\r\n\r\n // Here is where the crazy starts.\r\n //\r\n // Due to browser implementation issues, you cannot fillText BiDi text to a canvas\r\n // that is not part of the DOM. It just completely ignores the direction property.\r\n\r\n this.canvas.dir = 'rtl';\r\n\r\n // Experimental atm, but one day ...\r\n this.context.direction = 'rtl';\r\n\r\n // Add it to the DOM, but hidden within the parent canvas.\r\n this.canvas.style.display = 'none';\r\n\r\n AddToDOM(this.canvas, this.scene.sys.canvas);\r\n\r\n // And finally we set the x origin\r\n this.originX = 1;\r\n },\r\n\r\n /**\r\n * Greedy wrapping algorithm that will wrap words as the line grows longer than its horizontal\r\n * bounds.\r\n *\r\n * @method Phaser.GameObjects.Text#runWordWrap\r\n * @since 3.0.0\r\n *\r\n * @param {string} text - The text to perform word wrap detection against.\r\n *\r\n * @return {string} The text after wrapping has been applied.\r\n */\r\n runWordWrap: function (text)\r\n {\r\n var style = this.style;\r\n\r\n if (style.wordWrapCallback)\r\n {\r\n var wrappedLines = style.wordWrapCallback.call(style.wordWrapCallbackScope, text, this);\r\n\r\n if (Array.isArray(wrappedLines))\r\n {\r\n wrappedLines = wrappedLines.join('\\n');\r\n }\r\n\r\n return wrappedLines;\r\n }\r\n else if (style.wordWrapWidth)\r\n {\r\n if (style.wordWrapUseAdvanced)\r\n {\r\n return this.advancedWordWrap(text, this.context, this.style.wordWrapWidth);\r\n }\r\n else\r\n {\r\n return this.basicWordWrap(text, this.context, this.style.wordWrapWidth);\r\n }\r\n }\r\n else\r\n {\r\n return text;\r\n }\r\n },\r\n\r\n /**\r\n * Advanced wrapping algorithm that will wrap words as the line grows longer than its horizontal\r\n * bounds. Consecutive spaces will be collapsed and replaced with a single space. Lines will be\r\n * trimmed of white space before processing. Throws an error if wordWrapWidth is less than a\r\n * single character.\r\n *\r\n * @method Phaser.GameObjects.Text#advancedWordWrap\r\n * @since 3.0.0\r\n *\r\n * @param {string} text - The text to perform word wrap detection against.\r\n * @param {CanvasRenderingContext2D} context - The Canvas Rendering Context.\r\n * @param {number} wordWrapWidth - The word wrap width.\r\n *\r\n * @return {string} The wrapped text.\r\n */\r\n advancedWordWrap: function (text, context, wordWrapWidth)\r\n {\r\n var output = '';\r\n\r\n // Condense consecutive spaces and split into lines\r\n var lines = text\r\n .replace(/ +/gi, ' ')\r\n .split(this.splitRegExp);\r\n\r\n var linesCount = lines.length;\r\n\r\n for (var i = 0; i < linesCount; i++)\r\n {\r\n var line = lines[i];\r\n var out = '';\r\n\r\n // Trim whitespace\r\n line = line.replace(/^ *|\\s*$/gi, '');\r\n\r\n // If entire line is less than wordWrapWidth append the entire line and exit early\r\n var lineWidth = context.measureText(line).width;\r\n\r\n if (lineWidth < wordWrapWidth)\r\n {\r\n output += line + '\\n';\r\n continue;\r\n }\r\n\r\n // Otherwise, calculate new lines\r\n var currentLineWidth = wordWrapWidth;\r\n\r\n // Split into words\r\n var words = line.split(' ');\r\n\r\n for (var j = 0; j < words.length; j++)\r\n {\r\n var word = words[j];\r\n var wordWithSpace = word + ' ';\r\n var wordWidth = context.measureText(wordWithSpace).width;\r\n\r\n if (wordWidth > currentLineWidth)\r\n {\r\n // Break word\r\n if (j === 0)\r\n {\r\n // Shave off letters from word until it's small enough\r\n var newWord = wordWithSpace;\r\n\r\n while (newWord.length)\r\n {\r\n newWord = newWord.slice(0, -1);\r\n wordWidth = context.measureText(newWord).width;\r\n\r\n if (wordWidth <= currentLineWidth)\r\n {\r\n break;\r\n }\r\n }\r\n\r\n // If wordWrapWidth is too small for even a single letter, shame user\r\n // failure with a fatal error\r\n if (!newWord.length)\r\n {\r\n throw new Error('This text\\'s wordWrapWidth setting is less than a single character!');\r\n }\r\n\r\n // Replace current word in array with remainder\r\n var secondPart = word.substr(newWord.length);\r\n\r\n words[j] = secondPart;\r\n\r\n // Append first piece to output\r\n out += newWord;\r\n }\r\n\r\n // If existing word length is 0, don't include it\r\n var offset = (words[j].length) ? j : j + 1;\r\n\r\n // Collapse rest of sentence and remove any trailing white space\r\n var remainder = words.slice(offset).join(' ')\r\n .replace(/[ \\n]*$/gi, '');\r\n\r\n // Prepend remainder to next line\r\n lines[i + 1] = remainder + ' ' + (lines[i + 1] || '');\r\n linesCount = lines.length;\r\n\r\n break; // Processing on this line\r\n\r\n // Append word with space to output\r\n }\r\n else\r\n {\r\n out += wordWithSpace;\r\n currentLineWidth -= wordWidth;\r\n }\r\n }\r\n\r\n // Append processed line to output\r\n output += out.replace(/[ \\n]*$/gi, '') + '\\n';\r\n }\r\n\r\n // Trim the end of the string\r\n output = output.replace(/[\\s|\\n]*$/gi, '');\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Greedy wrapping algorithm that will wrap words as the line grows longer than its horizontal\r\n * bounds. Spaces are not collapsed and whitespace is not trimmed.\r\n *\r\n * @method Phaser.GameObjects.Text#basicWordWrap\r\n * @since 3.0.0\r\n *\r\n * @param {string} text - The text to perform word wrap detection against.\r\n * @param {CanvasRenderingContext2D} context - The Canvas Rendering Context.\r\n * @param {number} wordWrapWidth - The word wrap width.\r\n *\r\n * @return {string} The wrapped text.\r\n */\r\n basicWordWrap: function (text, context, wordWrapWidth)\r\n {\r\n var result = '';\r\n var lines = text.split(this.splitRegExp);\r\n var lastLineIndex = lines.length - 1;\r\n var whiteSpaceWidth = context.measureText(' ').width;\r\n\r\n for (var i = 0; i <= lastLineIndex; i++)\r\n {\r\n var spaceLeft = wordWrapWidth;\r\n var words = lines[i].split(' ');\r\n var lastWordIndex = words.length - 1;\r\n\r\n for (var j = 0; j <= lastWordIndex; j++)\r\n {\r\n var word = words[j];\r\n var wordWidth = context.measureText(word).width;\r\n var wordWidthWithSpace = wordWidth + whiteSpaceWidth;\r\n\r\n if (wordWidthWithSpace > spaceLeft)\r\n {\r\n // Skip printing the newline if it's the first word of the line that is greater\r\n // than the word wrap width.\r\n if (j > 0)\r\n {\r\n result += '\\n';\r\n spaceLeft = wordWrapWidth;\r\n }\r\n }\r\n\r\n result += word;\r\n\r\n if (j < lastWordIndex)\r\n {\r\n result += ' ';\r\n spaceLeft -= wordWidthWithSpace;\r\n }\r\n else\r\n {\r\n spaceLeft -= wordWidth;\r\n }\r\n }\r\n\r\n if (i < lastLineIndex)\r\n {\r\n result += '\\n';\r\n }\r\n }\r\n\r\n return result;\r\n },\r\n\r\n /**\r\n * Runs the given text through this Text objects word wrapping and returns the results as an\r\n * array, where each element of the array corresponds to a wrapped line of text.\r\n *\r\n * @method Phaser.GameObjects.Text#getWrappedText\r\n * @since 3.0.0\r\n *\r\n * @param {string} text - The text for which the wrapping will be calculated. If unspecified, the Text objects current text will be used.\r\n *\r\n * @return {string[]} An array of strings with the pieces of wrapped text.\r\n */\r\n getWrappedText: function (text)\r\n {\r\n if (text === undefined) { text = this._text; }\r\n\r\n this.style.syncFont(this.canvas, this.context);\r\n\r\n var wrappedLines = this.runWordWrap(text);\r\n\r\n return wrappedLines.split(this.splitRegExp);\r\n },\r\n\r\n /**\r\n * Set the text to display.\r\n *\r\n * An array of strings will be joined with `\\n` line breaks.\r\n *\r\n * @method Phaser.GameObjects.Text#setText\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} value - The string, or array of strings, to be set as the content of this Text object.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setText: function (value)\r\n {\r\n if (!value && value !== 0)\r\n {\r\n value = '';\r\n }\r\n\r\n if (Array.isArray(value))\r\n {\r\n value = value.join('\\n');\r\n }\r\n\r\n if (value !== this._text)\r\n {\r\n this._text = value.toString();\r\n\r\n this.updateText();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the text style.\r\n *\r\n * @example\r\n * text.setStyle({\r\n * fontSize: '64px',\r\n * fontFamily: 'Arial',\r\n * color: '#ffffff',\r\n * align: 'center',\r\n * backgroundColor: '#ff00ff'\r\n * });\r\n *\r\n * @method Phaser.GameObjects.Text#setStyle\r\n * @since 3.0.0\r\n *\r\n * @param {object} style - The style settings to set.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setStyle: function (style)\r\n {\r\n return this.style.setStyle(style);\r\n },\r\n\r\n /**\r\n * Set the font.\r\n *\r\n * If a string is given, the font family is set.\r\n *\r\n * If an object is given, the `fontFamily`, `fontSize` and `fontStyle`\r\n * properties of that object are set.\r\n * \r\n * **Important:** If the font you wish to use has a space or digit in its name, such as\r\n * 'Press Start 2P' or 'Roboto Condensed', then you _must_ put the font name in quotes:\r\n * \r\n * ```javascript\r\n * Text.setFont('\"Roboto Condensed\"');\r\n * ```\r\n * \r\n * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all\r\n * quoted properly, too:\r\n * \r\n * ```javascript\r\n * Text.setFont('Verdana, \"Times New Roman\", Tahoma, serif');\r\n * ```\r\n *\r\n * @method Phaser.GameObjects.Text#setFont\r\n * @since 3.0.0\r\n *\r\n * @param {string} font - The font family or font settings to set.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setFont: function (font)\r\n {\r\n return this.style.setFont(font);\r\n },\r\n\r\n /**\r\n * Set the font family.\r\n * \r\n * **Important:** If the font you wish to use has a space or digit in its name, such as\r\n * 'Press Start 2P' or 'Roboto Condensed', then you _must_ put the font name in quotes:\r\n * \r\n * ```javascript\r\n * Text.setFont('\"Roboto Condensed\"');\r\n * ```\r\n * \r\n * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all\r\n * quoted properly, too:\r\n * \r\n * ```javascript\r\n * Text.setFont('Verdana, \"Times New Roman\", Tahoma, serif');\r\n * ```\r\n *\r\n * @method Phaser.GameObjects.Text#setFontFamily\r\n * @since 3.0.0\r\n *\r\n * @param {string} family - The font family.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setFontFamily: function (family)\r\n {\r\n return this.style.setFontFamily(family);\r\n },\r\n\r\n /**\r\n * Set the font size.\r\n *\r\n * @method Phaser.GameObjects.Text#setFontSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} size - The font size.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setFontSize: function (size)\r\n {\r\n return this.style.setFontSize(size);\r\n },\r\n\r\n /**\r\n * Set the font style.\r\n *\r\n * @method Phaser.GameObjects.Text#setFontStyle\r\n * @since 3.0.0\r\n *\r\n * @param {string} style - The font style.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setFontStyle: function (style)\r\n {\r\n return this.style.setFontStyle(style);\r\n },\r\n\r\n /**\r\n * Set a fixed width and height for the text.\r\n *\r\n * Pass in `0` for either of these parameters to disable fixed width or height respectively.\r\n *\r\n * @method Phaser.GameObjects.Text#setFixedSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The fixed width to set. `0` disables fixed width.\r\n * @param {number} height - The fixed height to set. `0` disables fixed height.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setFixedSize: function (width, height)\r\n {\r\n return this.style.setFixedSize(width, height);\r\n },\r\n\r\n /**\r\n * Set the background color.\r\n *\r\n * @method Phaser.GameObjects.Text#setBackgroundColor\r\n * @since 3.0.0\r\n *\r\n * @param {string} color - The background color.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setBackgroundColor: function (color)\r\n {\r\n return this.style.setBackgroundColor(color);\r\n },\r\n\r\n /**\r\n * Set the fill style to be used by the Text object.\r\n *\r\n * This can be any valid CanvasRenderingContext2D fillStyle value, such as\r\n * a color (in hex, rgb, rgba, hsl or named values), a gradient or a pattern.\r\n *\r\n * See the [MDN fillStyle docs](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle) for more details.\r\n *\r\n * @method Phaser.GameObjects.Text#setFill\r\n * @since 3.0.0\r\n *\r\n * @param {(string|any)} color - The text fill style. Can be any valid CanvasRenderingContext `fillStyle` value.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setFill: function (fillStyle)\r\n {\r\n return this.style.setFill(fillStyle);\r\n },\r\n\r\n /**\r\n * Set the text fill color.\r\n *\r\n * @method Phaser.GameObjects.Text#setColor\r\n * @since 3.0.0\r\n *\r\n * @param {string} color - The text fill color.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setColor: function (color)\r\n {\r\n return this.style.setColor(color);\r\n },\r\n\r\n /**\r\n * Set the stroke settings.\r\n *\r\n * @method Phaser.GameObjects.Text#setStroke\r\n * @since 3.0.0\r\n *\r\n * @param {string} color - The stroke color.\r\n * @param {number} thickness - The stroke thickness.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setStroke: function (color, thickness)\r\n {\r\n return this.style.setStroke(color, thickness);\r\n },\r\n\r\n /**\r\n * Set the shadow settings.\r\n *\r\n * @method Phaser.GameObjects.Text#setShadow\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The horizontal shadow offset.\r\n * @param {number} [y=0] - The vertical shadow offset.\r\n * @param {string} [color='#000'] - The shadow color.\r\n * @param {number} [blur=0] - The shadow blur radius.\r\n * @param {boolean} [shadowStroke=false] - Whether to stroke the shadow.\r\n * @param {boolean} [shadowFill=true] - Whether to fill the shadow.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setShadow: function (x, y, color, blur, shadowStroke, shadowFill)\r\n {\r\n return this.style.setShadow(x, y, color, blur, shadowStroke, shadowFill);\r\n },\r\n\r\n /**\r\n * Set the shadow offset.\r\n *\r\n * @method Phaser.GameObjects.Text#setShadowOffset\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal shadow offset.\r\n * @param {number} y - The vertical shadow offset.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setShadowOffset: function (x, y)\r\n {\r\n return this.style.setShadowOffset(x, y);\r\n },\r\n\r\n /**\r\n * Set the shadow color.\r\n *\r\n * @method Phaser.GameObjects.Text#setShadowColor\r\n * @since 3.0.0\r\n *\r\n * @param {string} color - The shadow color.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setShadowColor: function (color)\r\n {\r\n return this.style.setShadowColor(color);\r\n },\r\n\r\n /**\r\n * Set the shadow blur radius.\r\n *\r\n * @method Phaser.GameObjects.Text#setShadowBlur\r\n * @since 3.0.0\r\n *\r\n * @param {number} blur - The shadow blur radius.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setShadowBlur: function (blur)\r\n {\r\n return this.style.setShadowBlur(blur);\r\n },\r\n\r\n /**\r\n * Enable or disable shadow stroke.\r\n *\r\n * @method Phaser.GameObjects.Text#setShadowStroke\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} enabled - Whether shadow stroke is enabled or not.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setShadowStroke: function (enabled)\r\n {\r\n return this.style.setShadowStroke(enabled);\r\n },\r\n\r\n /**\r\n * Enable or disable shadow fill.\r\n *\r\n * @method Phaser.GameObjects.Text#setShadowFill\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} enabled - Whether shadow fill is enabled or not.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setShadowFill: function (enabled)\r\n {\r\n return this.style.setShadowFill(enabled);\r\n },\r\n\r\n /**\r\n * Set the width (in pixels) to use for wrapping lines. Pass in null to remove wrapping by width.\r\n *\r\n * @method Phaser.GameObjects.Text#setWordWrapWidth\r\n * @since 3.0.0\r\n *\r\n * @param {?number} width - The maximum width of a line in pixels. Set to null to remove wrapping.\r\n * @param {boolean} [useAdvancedWrap=false] - Whether or not to use the advanced wrapping\r\n * algorithm. If true, spaces are collapsed and whitespace is trimmed from lines. If false,\r\n * spaces and whitespace are left as is.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setWordWrapWidth: function (width, useAdvancedWrap)\r\n {\r\n return this.style.setWordWrapWidth(width, useAdvancedWrap);\r\n },\r\n\r\n /**\r\n * Set a custom callback for wrapping lines. Pass in null to remove wrapping by callback.\r\n *\r\n * @method Phaser.GameObjects.Text#setWordWrapCallback\r\n * @since 3.0.0\r\n *\r\n * @param {TextStyleWordWrapCallback} callback - A custom function that will be responsible for wrapping the\r\n * text. It will receive two arguments: text (the string to wrap), textObject (this Text\r\n * instance). It should return the wrapped lines either as an array of lines or as a string with\r\n * newline characters in place to indicate where breaks should happen.\r\n * @param {object} [scope=null] - The scope that will be applied when the callback is invoked.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setWordWrapCallback: function (callback, scope)\r\n {\r\n return this.style.setWordWrapCallback(callback, scope);\r\n },\r\n\r\n /**\r\n * Set the alignment of the text in this Text object.\r\n * \r\n * The argument can be one of: `left`, `right`, `center` or `justify`.\r\n * \r\n * Alignment only works if the Text object has more than one line of text.\r\n *\r\n * @method Phaser.GameObjects.Text#setAlign\r\n * @since 3.0.0\r\n *\r\n * @param {string} [align='left'] - The text alignment for multi-line text.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setAlign: function (align)\r\n {\r\n return this.style.setAlign(align);\r\n },\r\n\r\n /**\r\n * Set the resolution used by this Text object.\r\n *\r\n * By default it will be set to match the resolution set in the Game Config,\r\n * but you can override it via this method, or by specifying it in the Text style configuration object.\r\n * \r\n * It allows for much clearer text on High DPI devices, at the cost of memory because it uses larger\r\n * internal Canvas textures for the Text.\r\n * \r\n * Therefore, please use with caution, as the more high res Text you have, the more memory it uses.\r\n *\r\n * @method Phaser.GameObjects.Text#setResolution\r\n * @since 3.12.0\r\n *\r\n * @param {number} value - The resolution for this Text object to use.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setResolution: function (value)\r\n {\r\n return this.style.setResolution(value);\r\n },\r\n\r\n /**\r\n * Sets the line spacing value.\r\n *\r\n * This value is _added_ to the height of the font when calculating the overall line height.\r\n * This only has an effect if this Text object consists of multiple lines of text.\r\n *\r\n * @method Phaser.GameObjects.Text#setLineSpacing\r\n * @since 3.13.0\r\n *\r\n * @param {number} value - The amount to add to the font height to achieve the overall line height.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setLineSpacing: function (value)\r\n {\r\n this.lineSpacing = value;\r\n\r\n return this.updateText();\r\n },\r\n\r\n /**\r\n * Set the text padding.\r\n *\r\n * 'left' can be an object.\r\n *\r\n * If only 'left' and 'top' are given they are treated as 'x' and 'y'.\r\n *\r\n * @method Phaser.GameObjects.Text#setPadding\r\n * @since 3.0.0\r\n *\r\n * @param {(number|Phaser.Types.GameObjects.Text.TextPadding)} left - The left padding value, or a padding config object.\r\n * @param {number} top - The top padding value.\r\n * @param {number} right - The right padding value.\r\n * @param {number} bottom - The bottom padding value.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setPadding: function (left, top, right, bottom)\r\n {\r\n if (typeof left === 'object')\r\n {\r\n var config = left;\r\n\r\n // If they specify x and/or y this applies to all\r\n var x = GetValue(config, 'x', null);\r\n\r\n if (x !== null)\r\n {\r\n left = x;\r\n right = x;\r\n }\r\n else\r\n {\r\n left = GetValue(config, 'left', 0);\r\n right = GetValue(config, 'right', left);\r\n }\r\n\r\n var y = GetValue(config, 'y', null);\r\n\r\n if (y !== null)\r\n {\r\n top = y;\r\n bottom = y;\r\n }\r\n else\r\n {\r\n top = GetValue(config, 'top', 0);\r\n bottom = GetValue(config, 'bottom', top);\r\n }\r\n }\r\n else\r\n {\r\n if (left === undefined) { left = 0; }\r\n if (top === undefined) { top = left; }\r\n if (right === undefined) { right = left; }\r\n if (bottom === undefined) { bottom = top; }\r\n }\r\n\r\n this.padding.left = left;\r\n this.padding.top = top;\r\n this.padding.right = right;\r\n this.padding.bottom = bottom;\r\n\r\n return this.updateText();\r\n },\r\n\r\n /**\r\n * Set the maximum number of lines to draw.\r\n *\r\n * @method Phaser.GameObjects.Text#setMaxLines\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [max=0] - The maximum number of lines to draw.\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n setMaxLines: function (max)\r\n {\r\n return this.style.setMaxLines(max);\r\n },\r\n\r\n /**\r\n * Update the displayed text.\r\n *\r\n * @method Phaser.GameObjects.Text#updateText\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Text} This Text object.\r\n */\r\n updateText: function ()\r\n {\r\n var canvas = this.canvas;\r\n var context = this.context;\r\n var style = this.style;\r\n var resolution = style.resolution;\r\n var size = style.metrics;\r\n\r\n style.syncFont(canvas, context);\r\n\r\n var outputText = this._text;\r\n\r\n if (style.wordWrapWidth || style.wordWrapCallback)\r\n {\r\n outputText = this.runWordWrap(this._text);\r\n }\r\n\r\n // Split text into lines\r\n var lines = outputText.split(this.splitRegExp);\r\n\r\n var textSize = GetTextSize(this, size, lines);\r\n\r\n var padding = this.padding;\r\n\r\n var textWidth;\r\n\r\n if (style.fixedWidth === 0)\r\n {\r\n this.width = textSize.width + padding.left + padding.right;\r\n\r\n textWidth = textSize.width;\r\n }\r\n else\r\n {\r\n this.width = style.fixedWidth;\r\n\r\n textWidth = this.width - padding.left - padding.right;\r\n\r\n if (textWidth < textSize.width)\r\n {\r\n textWidth = textSize.width;\r\n }\r\n }\r\n\r\n if (style.fixedHeight === 0)\r\n {\r\n this.height = textSize.height + padding.top + padding.bottom;\r\n }\r\n else\r\n {\r\n this.height = style.fixedHeight;\r\n }\r\n\r\n var w = this.width;\r\n var h = this.height;\r\n\r\n this.updateDisplayOrigin();\r\n\r\n w *= resolution;\r\n h *= resolution;\r\n\r\n w = Math.max(w, 1);\r\n h = Math.max(h, 1);\r\n\r\n if (canvas.width !== w || canvas.height !== h)\r\n {\r\n canvas.width = w;\r\n canvas.height = h;\r\n\r\n this.frame.setSize(w, h);\r\n\r\n // Because resizing the canvas resets the context\r\n style.syncFont(canvas, context);\r\n }\r\n else\r\n {\r\n context.clearRect(0, 0, w, h);\r\n }\r\n\r\n context.save();\r\n\r\n context.scale(resolution, resolution);\r\n\r\n if (style.backgroundColor)\r\n {\r\n context.fillStyle = style.backgroundColor;\r\n context.fillRect(0, 0, w, h);\r\n }\r\n\r\n style.syncStyle(canvas, context);\r\n\r\n context.textBaseline = 'alphabetic';\r\n\r\n // Apply padding\r\n context.translate(padding.left, padding.top);\r\n\r\n var linePositionX;\r\n var linePositionY;\r\n\r\n // Draw text line by line\r\n for (var i = 0; i < textSize.lines; i++)\r\n {\r\n linePositionX = style.strokeThickness / 2;\r\n linePositionY = (style.strokeThickness / 2 + i * textSize.lineHeight) + size.ascent;\r\n\r\n if (i > 0)\r\n {\r\n linePositionY += (textSize.lineSpacing * i);\r\n }\r\n\r\n if (style.rtl)\r\n {\r\n linePositionX = w - linePositionX;\r\n }\r\n else if (style.align === 'right')\r\n {\r\n linePositionX += textWidth - textSize.lineWidths[i];\r\n }\r\n else if (style.align === 'center')\r\n {\r\n linePositionX += (textWidth - textSize.lineWidths[i]) / 2;\r\n }\r\n else if (style.align === 'justify')\r\n {\r\n // To justify text line its width must be no less than 85% of defined width\r\n var minimumLengthToApplyJustification = 0.85;\r\n\r\n if (textSize.lineWidths[i] / textSize.width >= minimumLengthToApplyJustification)\r\n {\r\n var extraSpace = textSize.width - textSize.lineWidths[i];\r\n var spaceSize = context.measureText(' ').width;\r\n var trimmedLine = lines[i].trim();\r\n var array = trimmedLine.split(' ');\r\n \r\n extraSpace += (lines[i].length - trimmedLine.length) * spaceSize;\r\n \r\n var extraSpaceCharacters = Math.floor(extraSpace / spaceSize);\r\n var idx = 0;\r\n\r\n while (extraSpaceCharacters > 0)\r\n {\r\n array[idx] += ' ';\r\n idx = (idx + 1) % (array.length - 1 || 1);\r\n --extraSpaceCharacters;\r\n }\r\n \r\n lines[i] = array.join(' ');\r\n }\r\n }\r\n\r\n if (this.autoRound)\r\n {\r\n linePositionX = Math.round(linePositionX);\r\n linePositionY = Math.round(linePositionY);\r\n }\r\n\r\n if (style.strokeThickness)\r\n {\r\n this.style.syncShadow(context, style.shadowStroke);\r\n\r\n context.strokeText(lines[i], linePositionX, linePositionY);\r\n }\r\n\r\n if (style.color)\r\n {\r\n this.style.syncShadow(context, style.shadowFill);\r\n\r\n context.fillText(lines[i], linePositionX, linePositionY);\r\n }\r\n }\r\n\r\n context.restore();\r\n\r\n if (this.renderer.gl)\r\n {\r\n this.frame.source.glTexture = this.renderer.canvasToTexture(canvas, this.frame.source.glTexture, true);\r\n\r\n this.frame.glTexture = this.frame.source.glTexture;\r\n }\r\n\r\n this.dirty = true;\r\n\r\n var input = this.input;\r\n\r\n if (input && !input.customHitArea)\r\n {\r\n input.hitArea.width = this.width;\r\n input.hitArea.height = this.height;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Get the current text metrics.\r\n *\r\n * @method Phaser.GameObjects.Text#getTextMetrics\r\n * @since 3.0.0\r\n *\r\n * @return {object} The text metrics.\r\n */\r\n getTextMetrics: function ()\r\n {\r\n return this.style.getTextMetrics();\r\n },\r\n\r\n /**\r\n * The text string being rendered by this Text Game Object.\r\n *\r\n * @name Phaser.GameObjects.Text#text\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n text: {\r\n\r\n get: function ()\r\n {\r\n return this._text;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.setText(value);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Build a JSON representation of the Text object.\r\n *\r\n * @method Phaser.GameObjects.Text#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Text object.\r\n */\r\n toJSON: function ()\r\n {\r\n var out = Components.ToJSON(this);\r\n\r\n // Extra Text data is added here\r\n\r\n var data = {\r\n autoRound: this.autoRound,\r\n text: this._text,\r\n style: this.style.toJSON(),\r\n padding: {\r\n left: this.padding.left,\r\n right: this.padding.right,\r\n top: this.padding.top,\r\n bottom: this.padding.bottom\r\n }\r\n };\r\n\r\n out.data = data;\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Internal destroy handler, called as part of the destroy process.\r\n *\r\n * @method Phaser.GameObjects.Text#preDestroy\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n preDestroy: function ()\r\n {\r\n if (this.style.rtl)\r\n {\r\n RemoveFromDOM(this.canvas);\r\n }\r\n\r\n CanvasPool.remove(this.canvas);\r\n\r\n this.texture.destroy();\r\n }\r\n\r\n /**\r\n * The horizontal origin of this Game Object.\r\n * The origin maps the relationship between the size and position of the Game Object.\r\n * The default value is 0.5, meaning all Game Objects are positioned based on their center.\r\n * Setting the value to 0 means the position now relates to the left of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Text#originX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The vertical origin of this Game Object.\r\n * The origin maps the relationship between the size and position of the Game Object.\r\n * The default value is 0.5, meaning all Game Objects are positioned based on their center.\r\n * Setting the value to 0 means the position now relates to the top of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Text#originY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n});\r\n\r\nmodule.exports = Text;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/text/static/Text.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/text/static/TextCanvasRenderer.js": /*!*******************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/text/static/TextCanvasRenderer.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Text#renderCanvas\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Text} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar TextCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n if ((src.width === 0) || (src.height === 0))\r\n {\r\n return;\r\n }\r\n\r\n renderer.batchSprite(src, src.frame, camera, parentMatrix);\r\n};\r\n\r\nmodule.exports = TextCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/text/static/TextCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/text/static/TextCreator.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/text/static/TextCreator.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BuildGameObject = __webpack_require__(/*! ../../BuildGameObject */ \"./node_modules/phaser/src/gameobjects/BuildGameObject.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar Text = __webpack_require__(/*! ./Text */ \"./node_modules/phaser/src/gameobjects/text/static/Text.js\");\r\n\r\n/**\r\n * Creates a new Text Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Text Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#text\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {Phaser.GameObjects.Text} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('text', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n // style Object = {\r\n // font: [ 'font', '16px Courier' ],\r\n // backgroundColor: [ 'backgroundColor', null ],\r\n // fill: [ 'fill', '#fff' ],\r\n // stroke: [ 'stroke', '#fff' ],\r\n // strokeThickness: [ 'strokeThickness', 0 ],\r\n // shadowOffsetX: [ 'shadow.offsetX', 0 ],\r\n // shadowOffsetY: [ 'shadow.offsetY', 0 ],\r\n // shadowColor: [ 'shadow.color', '#000' ],\r\n // shadowBlur: [ 'shadow.blur', 0 ],\r\n // shadowStroke: [ 'shadow.stroke', false ],\r\n // shadowFill: [ 'shadow.fill', false ],\r\n // align: [ 'align', 'left' ],\r\n // maxLines: [ 'maxLines', 0 ],\r\n // fixedWidth: [ 'fixedWidth', false ],\r\n // fixedHeight: [ 'fixedHeight', false ],\r\n // rtl: [ 'rtl', false ]\r\n // }\r\n\r\n var content = GetAdvancedValue(config, 'text', '');\r\n var style = GetAdvancedValue(config, 'style', null);\r\n\r\n // Padding\r\n // { padding: 2 }\r\n // { padding: { x: , y: }}\r\n // { padding: { left: , top: }}\r\n // { padding: { left: , right: , top: , bottom: }}\r\n\r\n var padding = GetAdvancedValue(config, 'padding', null);\r\n\r\n if (padding !== null)\r\n {\r\n style.padding = padding;\r\n }\r\n\r\n var text = new Text(this.scene, 0, 0, content, style);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, text, config);\r\n\r\n // Text specific config options:\r\n\r\n text.autoRound = GetAdvancedValue(config, 'autoRound', true);\r\n text.resolution = GetAdvancedValue(config, 'resolution', 1);\r\n\r\n return text;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectCreator context.\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/text/static/TextCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/text/static/TextFactory.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/text/static/TextFactory.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Text = __webpack_require__(/*! ./Text */ \"./node_modules/phaser/src/gameobjects/text/static/Text.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Text Game Object and adds it to the Scene.\r\n * \r\n * A Text Game Object.\r\n * \r\n * Text objects work by creating their own internal hidden Canvas and then renders text to it using\r\n * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered\r\n * to your game during the render pass.\r\n * \r\n * Because it uses the Canvas API you can take advantage of all the features this offers, such as\r\n * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts\r\n * loaded externally, such as Google or TypeKit Web fonts.\r\n *\r\n * You can only display fonts that are currently loaded and available to the browser: therefore fonts must\r\n * be pre-loaded. Phaser does not do ths for you, so you will require the use of a 3rd party font loader,\r\n * or have the fonts ready available in the CSS on the page in which your Phaser game resides.\r\n *\r\n * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts\r\n * across mobile browsers.\r\n * \r\n * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being\r\n * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the\r\n * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of\r\n * Text objects in your game. If you run into performance issues you would be better off using Bitmap Text\r\n * instead, as it benefits from batching and avoids expensive Canvas API calls.\r\n *\r\n * Note: This method will only be available if the Text Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#text\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {(string|string[])} text - The text this Text object will display.\r\n * @param {object} [style] - The Text style configuration object.\r\n *\r\n * @return {Phaser.GameObjects.Text} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('text', function (x, y, text, style)\r\n{\r\n return this.displayList.add(new Text(this.scene, x, y, text, style));\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/text/static/TextFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/text/static/TextRender.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/text/static/TextRender.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./TextWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/text/static/TextWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./TextCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/text/static/TextCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/text/static/TextRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/text/static/TextWebGLRenderer.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/text/static/TextWebGLRenderer.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Utils = __webpack_require__(/*! ../../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Text#renderWebGL\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Text} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar TextWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n if ((src.width === 0) || (src.height === 0))\r\n {\r\n return;\r\n }\r\n\r\n var frame = src.frame;\r\n var width = frame.width;\r\n var height = frame.height;\r\n var getTint = Utils.getTintAppendFloatAlpha;\r\n\r\n this.pipeline.batchTexture(\r\n src,\r\n frame.glTexture,\r\n width, height,\r\n src.x, src.y,\r\n width / src.style.resolution, height / src.style.resolution,\r\n src.scaleX, src.scaleY,\r\n src.rotation,\r\n src.flipX, src.flipY,\r\n src.scrollFactorX, src.scrollFactorY,\r\n src.displayOriginX, src.displayOriginY,\r\n 0, 0, width, height,\r\n getTint(src._tintTL, camera.alpha * src._alphaTL),\r\n getTint(src._tintTR, camera.alpha * src._alphaTR),\r\n getTint(src._tintBL, camera.alpha * src._alphaBL),\r\n getTint(src._tintBR, camera.alpha * src._alphaBR),\r\n (src._isTinted && src.tintFill),\r\n 0, 0,\r\n camera,\r\n parentMatrix\r\n );\r\n};\r\n\r\nmodule.exports = TextWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/text/static/TextWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/tilesprite/TileSprite.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/tilesprite/TileSprite.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CanvasPool = __webpack_require__(/*! ../../display/canvas/CanvasPool */ \"./node_modules/phaser/src/display/canvas/CanvasPool.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar GameEvents = __webpack_require__(/*! ../../core/events */ \"./node_modules/phaser/src/core/events/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar GetPowerOfTwo = __webpack_require__(/*! ../../math/pow2/GetPowerOfTwo */ \"./node_modules/phaser/src/math/pow2/GetPowerOfTwo.js\");\r\nvar Smoothing = __webpack_require__(/*! ../../display/canvas/Smoothing */ \"./node_modules/phaser/src/display/canvas/Smoothing.js\");\r\nvar TileSpriteRender = __webpack_require__(/*! ./TileSpriteRender */ \"./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteRender.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 8; // 1000\r\n\r\n/**\r\n * @classdesc\r\n * A TileSprite is a Sprite that has a repeating texture.\r\n *\r\n * The texture can be scrolled and scaled independently of the TileSprite itself. Textures will automatically wrap and\r\n * are designed so that you can create game backdrops using seamless textures as a source.\r\n *\r\n * You shouldn't ever create a TileSprite any larger than your actual canvas size. If you want to create a large repeating background\r\n * that scrolls across the whole map of your game, then you create a TileSprite that fits the canvas size and then use the `tilePosition`\r\n * property to scroll the texture as the player moves. If you create a TileSprite that is thousands of pixels in size then it will \r\n * consume huge amounts of memory and cause performance issues. Remember: use `tilePosition` to scroll your texture and `tileScale` to\r\n * adjust the scale of the texture - don't resize the sprite itself or make it larger than it needs.\r\n * \r\n * An important note about Tile Sprites and NPOT textures: Internally, TileSprite textures use GL_REPEAT to provide\r\n * seamless repeating of the textures. This, combined with the way in which the textures are handled in WebGL, means\r\n * they need to be POT (power-of-two) sizes in order to wrap. If you provide a NPOT (non power-of-two) texture to a\r\n * TileSprite it will generate a POT sized canvas and draw your texture to it, scaled up to the POT size. It's then\r\n * scaled back down again during rendering to the original dimensions. While this works, in that it allows you to use\r\n * any size texture for a Tile Sprite, it does mean that NPOT textures are going to appear anti-aliased when rendered,\r\n * due to the interpolation that took place when it was resized into a POT texture. This is especially visible in\r\n * pixel art graphics. If you notice it and it becomes an issue, the only way to avoid it is to ensure that you\r\n * provide POT textures for Tile Sprites.\r\n *\r\n * @class TileSprite\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.ComputedSize\r\n * @extends Phaser.GameObjects.Components.Crop\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Tint\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {integer} width - The width of the Game Object. If zero it will use the size of the texture frame.\r\n * @param {integer} height - The height of the Game Object. If zero it will use the size of the texture frame.\r\n * @param {string} textureKey - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frameKey] - An optional frame from the Texture this Game Object is rendering with.\r\n */\r\nvar TileSprite = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.Alpha,\r\n Components.BlendMode,\r\n Components.ComputedSize,\r\n Components.Crop,\r\n Components.Depth,\r\n Components.Flip,\r\n Components.GetBounds,\r\n Components.Mask,\r\n Components.Origin,\r\n Components.Pipeline,\r\n Components.ScrollFactor,\r\n Components.Tint,\r\n Components.Transform,\r\n Components.Visible,\r\n TileSpriteRender\r\n ],\r\n\r\n initialize:\r\n\r\n function TileSprite (scene, x, y, width, height, textureKey, frameKey)\r\n {\r\n var renderer = scene.sys.game.renderer;\r\n\r\n GameObject.call(this, scene, 'TileSprite');\r\n\r\n var displayTexture = scene.sys.textures.get(textureKey);\r\n var displayFrame = displayTexture.get(frameKey);\r\n\r\n if (!width || !height)\r\n {\r\n width = displayFrame.width;\r\n height = displayFrame.height;\r\n }\r\n else\r\n {\r\n width = Math.floor(width);\r\n height = Math.floor(height);\r\n }\r\n\r\n /**\r\n * Internal tile position vector.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#_tilePosition\r\n * @type {Phaser.Math.Vector2}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._tilePosition = new Vector2();\r\n\r\n /**\r\n * Internal tile scale vector.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#_tileScale\r\n * @type {Phaser.Math.Vector2}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._tileScale = new Vector2(1, 1);\r\n\r\n /**\r\n * Whether the Tile Sprite has changed in some way, requiring an re-render of its tile texture.\r\n *\r\n * Such changes include the texture frame and scroll position of the Tile Sprite.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#dirty\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.dirty = false;\r\n\r\n /**\r\n * The renderer in use by this Tile Sprite.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#renderer\r\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\r\n * @since 3.0.0\r\n */\r\n this.renderer = renderer;\r\n\r\n /**\r\n * The Canvas element that the TileSprite renders its fill pattern in to.\r\n * Only used in Canvas mode.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#canvas\r\n * @type {?HTMLCanvasElement}\r\n * @since 3.12.0\r\n */\r\n this.canvas = CanvasPool.create(this, width, height);\r\n\r\n /**\r\n * The Context of the Canvas element that the TileSprite renders its fill pattern in to.\r\n * Only used in Canvas mode.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#context\r\n * @type {CanvasRenderingContext2D}\r\n * @since 3.12.0\r\n */\r\n this.context = this.canvas.getContext('2d');\r\n\r\n /**\r\n * The Texture the TileSprite is using as its fill pattern.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#displayTexture\r\n * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this.displayTexture = displayTexture;\r\n\r\n /**\r\n * The Frame the TileSprite is using as its fill pattern.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#displayFrame\r\n * @type {Phaser.Textures.Frame}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this.displayFrame = displayFrame;\r\n\r\n /**\r\n * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#_crop\r\n * @type {object}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._crop = this.resetCropObject();\r\n\r\n /**\r\n * The Texture this Game Object is using to render with.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#texture\r\n * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture}\r\n * @since 3.0.0\r\n */\r\n this.texture = scene.sys.textures.addCanvas(null, this.canvas, true);\r\n\r\n /**\r\n * The Texture Frame this Game Object is using to render with.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#frame\r\n * @type {Phaser.Textures.Frame}\r\n * @since 3.0.0\r\n */\r\n this.frame = this.texture.get();\r\n\r\n /**\r\n * The next power of two value from the width of the Fill Pattern frame.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#potWidth\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.potWidth = GetPowerOfTwo(displayFrame.width);\r\n\r\n /**\r\n * The next power of two value from the height of the Fill Pattern frame.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#potHeight\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.potHeight = GetPowerOfTwo(displayFrame.height);\r\n\r\n /**\r\n * The Canvas that the TileSprites texture is rendered to.\r\n * This is used to create a WebGL texture from.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#fillCanvas\r\n * @type {HTMLCanvasElement}\r\n * @since 3.12.0\r\n */\r\n this.fillCanvas = CanvasPool.create2D(this, this.potWidth, this.potHeight);\r\n\r\n /**\r\n * The Canvas Context used to render the TileSprites texture.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#fillContext\r\n * @type {CanvasRenderingContext2D}\r\n * @since 3.12.0\r\n */\r\n this.fillContext = this.fillCanvas.getContext('2d');\r\n\r\n /**\r\n * The texture that the Tile Sprite is rendered to, which is then rendered to a Scene.\r\n * In WebGL this is a WebGLTexture. In Canvas it's a Canvas Fill Pattern.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#fillPattern\r\n * @type {?(WebGLTexture|CanvasPattern)}\r\n * @since 3.12.0\r\n */\r\n this.fillPattern = null;\r\n\r\n this.setPosition(x, y);\r\n this.setSize(width, height);\r\n this.setFrame(frameKey);\r\n this.setOriginFromFrame();\r\n this.initPipeline();\r\n\r\n scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer)\r\n {\r\n var gl = renderer.gl;\r\n\r\n this.dirty = true;\r\n this.fillPattern = null;\r\n this.fillPattern = renderer.createTexture2D(0, gl.LINEAR, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.RGBA, this.fillCanvas, this.potWidth, this.potHeight);\r\n\r\n }, this);\r\n },\r\n\r\n /**\r\n * Sets the texture and frame this Game Object will use to render with.\r\n *\r\n * Textures are referenced by their string-based keys, as stored in the Texture Manager.\r\n *\r\n * @method Phaser.GameObjects.TileSprite#setTexture\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the texture to be used, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - The name or index of the frame within the Texture.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setTexture: function (key, frame)\r\n {\r\n this.displayTexture = this.scene.sys.textures.get(key);\r\n\r\n return this.setFrame(frame);\r\n },\r\n\r\n /**\r\n * Sets the frame this Game Object will use to render with.\r\n *\r\n * The Frame has to belong to the current Texture being used.\r\n *\r\n * It can be either a string or an index.\r\n *\r\n * @method Phaser.GameObjects.TileSprite#setFrame\r\n * @since 3.0.0\r\n *\r\n * @param {(string|integer)} frame - The name or index of the frame within the Texture.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setFrame: function (frame)\r\n {\r\n var newFrame = this.displayTexture.get(frame);\r\n\r\n this.potWidth = GetPowerOfTwo(newFrame.width);\r\n this.potHeight = GetPowerOfTwo(newFrame.height);\r\n\r\n // So updateCanvas is triggered\r\n this.canvas.width = 0;\r\n\r\n if (!newFrame.cutWidth || !newFrame.cutHeight)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n\r\n this.displayFrame = newFrame;\r\n\r\n this.dirty = true;\r\n\r\n this.updateTileTexture();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets {@link Phaser.GameObjects.TileSprite#tilePositionX} and {@link Phaser.GameObjects.TileSprite#tilePositionY}.\r\n *\r\n * @method Phaser.GameObjects.TileSprite#setTilePosition\r\n * @since 3.3.0\r\n *\r\n * @param {number} [x] - The x position of this sprite's tiling texture.\r\n * @param {number} [y] - The y position of this sprite's tiling texture.\r\n *\r\n * @return {this} This Tile Sprite instance.\r\n */\r\n setTilePosition: function (x, y)\r\n {\r\n if (x !== undefined)\r\n {\r\n this.tilePositionX = x;\r\n }\r\n\r\n if (y !== undefined)\r\n {\r\n this.tilePositionY = y;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets {@link Phaser.GameObjects.TileSprite#tileScaleX} and {@link Phaser.GameObjects.TileSprite#tileScaleY}.\r\n *\r\n * @method Phaser.GameObjects.TileSprite#setTileScale\r\n * @since 3.12.0\r\n *\r\n * @param {number} [x] - The horizontal scale of the tiling texture. If not given it will use the current `tileScaleX` value.\r\n * @param {number} [y=x] - The vertical scale of the tiling texture. If not given it will use the `x` value.\r\n *\r\n * @return {this} This Tile Sprite instance.\r\n */\r\n setTileScale: function (x, y)\r\n {\r\n if (x === undefined) { x = this.tileScaleX; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.tileScaleX = x;\r\n this.tileScaleY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Render the tile texture if it is dirty, or if the frame has changed.\r\n *\r\n * @method Phaser.GameObjects.TileSprite#updateTileTexture\r\n * @private\r\n * @since 3.0.0\r\n */\r\n updateTileTexture: function ()\r\n {\r\n if (!this.dirty || !this.renderer)\r\n {\r\n return;\r\n }\r\n\r\n // Draw the displayTexture to our fillCanvas\r\n\r\n var frame = this.displayFrame;\r\n\r\n if (frame.source.isRenderTexture || frame.source.isGLTexture)\r\n {\r\n console.warn('TileSprites can only use Image or Canvas based textures');\r\n\r\n this.dirty = false;\r\n\r\n return;\r\n }\r\n\r\n var ctx = this.fillContext;\r\n var canvas = this.fillCanvas;\r\n\r\n var fw = this.potWidth;\r\n var fh = this.potHeight;\r\n\r\n if (!this.renderer.gl)\r\n {\r\n fw = frame.cutWidth;\r\n fh = frame.cutHeight;\r\n }\r\n\r\n ctx.clearRect(0, 0, fw, fh);\r\n\r\n canvas.width = fw;\r\n canvas.height = fh;\r\n\r\n ctx.drawImage(\r\n frame.source.image,\r\n frame.cutX, frame.cutY,\r\n frame.cutWidth, frame.cutHeight,\r\n 0, 0,\r\n fw, fh\r\n );\r\n\r\n if (this.renderer.gl)\r\n {\r\n this.fillPattern = this.renderer.canvasToTexture(canvas, this.fillPattern);\r\n }\r\n else\r\n {\r\n this.fillPattern = ctx.createPattern(canvas, 'repeat');\r\n }\r\n\r\n this.updateCanvas();\r\n\r\n this.dirty = false;\r\n },\r\n\r\n /**\r\n * Draw the fill pattern to the internal canvas.\r\n *\r\n * @method Phaser.GameObjects.TileSprite#updateCanvas\r\n * @private\r\n * @since 3.12.0\r\n */\r\n updateCanvas: function ()\r\n {\r\n var canvas = this.canvas;\r\n\r\n if (canvas.width !== this.width || canvas.height !== this.height)\r\n {\r\n canvas.width = this.width;\r\n canvas.height = this.height;\r\n\r\n this.frame.setSize(this.width, this.height);\r\n this.updateDisplayOrigin();\r\n\r\n this.dirty = true;\r\n }\r\n\r\n if (!this.dirty || this.renderer && this.renderer.gl)\r\n {\r\n this.dirty = false;\r\n return;\r\n }\r\n\r\n var ctx = this.context;\r\n\r\n if (!this.scene.sys.game.config.antialias)\r\n {\r\n Smoothing.disable(ctx);\r\n }\r\n\r\n var scaleX = this._tileScale.x;\r\n var scaleY = this._tileScale.y;\r\n\r\n var positionX = this._tilePosition.x;\r\n var positionY = this._tilePosition.y;\r\n\r\n ctx.clearRect(0, 0, this.width, this.height);\r\n\r\n ctx.save();\r\n\r\n ctx.scale(scaleX, scaleY);\r\n\r\n ctx.translate(-positionX, -positionY);\r\n\r\n ctx.fillStyle = this.fillPattern;\r\n\r\n ctx.fillRect(positionX, positionY, this.width / scaleX, this.height / scaleY);\r\n\r\n ctx.restore();\r\n\r\n this.dirty = false;\r\n },\r\n\r\n /**\r\n * Internal destroy handler, called as part of the destroy process.\r\n *\r\n * @method Phaser.GameObjects.TileSprite#preDestroy\r\n * @protected\r\n * @since 3.9.0\r\n */\r\n preDestroy: function ()\r\n {\r\n if (this.renderer && this.renderer.gl)\r\n {\r\n this.renderer.deleteTexture(this.fillPattern);\r\n }\r\n\r\n CanvasPool.remove(this.canvas);\r\n CanvasPool.remove(this.fillCanvas);\r\n\r\n this.fillPattern = null;\r\n this.fillContext = null;\r\n this.fillCanvas = null;\r\n\r\n this.displayTexture = null;\r\n this.displayFrame = null;\r\n\r\n this.texture.destroy();\r\n\r\n this.renderer = null;\r\n },\r\n\r\n /**\r\n * The horizontal scroll position of the Tile Sprite.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#tilePositionX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n tilePositionX: {\r\n\r\n get: function ()\r\n {\r\n return this._tilePosition.x;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._tilePosition.x = value;\r\n this.dirty = true;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical scroll position of the Tile Sprite.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#tilePositionY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n tilePositionY: {\r\n\r\n get: function ()\r\n {\r\n return this._tilePosition.y;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._tilePosition.y = value;\r\n this.dirty = true;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The horizontal scale of the Tile Sprite texture.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#tileScaleX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.11.0\r\n */\r\n tileScaleX: {\r\n\r\n get: function ()\r\n {\r\n return this._tileScale.x;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._tileScale.x = value;\r\n this.dirty = true;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical scale of the Tile Sprite texture.\r\n *\r\n * @name Phaser.GameObjects.TileSprite#tileScaleY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.11.0\r\n */\r\n tileScaleY: {\r\n\r\n get: function ()\r\n {\r\n return this._tileScale.y;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._tileScale.y = value;\r\n this.dirty = true;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = TileSprite;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/tilesprite/TileSprite.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteCanvasRenderer.js": /*!************************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteCanvasRenderer.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.TileSprite#renderCanvas\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.TileSprite} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar TileSpriteCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n src.updateCanvas();\r\n\r\n renderer.batchSprite(src, src.frame, camera, parentMatrix);\r\n};\r\n\r\nmodule.exports = TileSpriteCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteCreator.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteCreator.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BuildGameObject = __webpack_require__(/*! ../BuildGameObject */ \"./node_modules/phaser/src/gameobjects/BuildGameObject.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar TileSprite = __webpack_require__(/*! ./TileSprite */ \"./node_modules/phaser/src/gameobjects/tilesprite/TileSprite.js\");\r\n\r\n/**\r\n * Creates a new TileSprite Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the TileSprite Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#tileSprite\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.GameObjects.TileSprite.TileSpriteConfig} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {Phaser.GameObjects.TileSprite} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('tileSprite', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n var x = GetAdvancedValue(config, 'x', 0);\r\n var y = GetAdvancedValue(config, 'y', 0);\r\n var width = GetAdvancedValue(config, 'width', 512);\r\n var height = GetAdvancedValue(config, 'height', 512);\r\n var key = GetAdvancedValue(config, 'key', '');\r\n var frame = GetAdvancedValue(config, 'frame', '');\r\n\r\n var tile = new TileSprite(this.scene, x, y, width, height, key, frame);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, tile, config);\r\n\r\n return tile;\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteFactory.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteFactory.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar TileSprite = __webpack_require__(/*! ./TileSprite */ \"./node_modules/phaser/src/gameobjects/tilesprite/TileSprite.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new TileSprite Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the TileSprite Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#tileSprite\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {integer} width - The width of the Game Object. If zero it will use the size of the texture frame.\r\n * @param {integer} height - The height of the Game Object. If zero it will use the size of the texture frame.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n *\r\n * @return {Phaser.GameObjects.TileSprite} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('tileSprite', function (x, y, width, height, key, frame)\r\n{\r\n return this.displayList.add(new TileSprite(this.scene, x, y, width, height, key, frame));\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteRender.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteRender.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./TileSpriteWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./TileSpriteCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteWebGLRenderer.js": /*!***********************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteWebGLRenderer.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Utils = __webpack_require__(/*! ../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.TileSprite#renderWebGL\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.TileSprite} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar TileSpriteWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n src.updateCanvas();\r\n\r\n var getTint = Utils.getTintAppendFloatAlpha;\r\n\r\n this.pipeline.batchTexture(\r\n src,\r\n src.fillPattern,\r\n src.displayFrame.width * src.tileScaleX, src.displayFrame.height * src.tileScaleY,\r\n src.x, src.y,\r\n src.width, src.height,\r\n src.scaleX, src.scaleY,\r\n src.rotation,\r\n src.flipX, src.flipY,\r\n src.scrollFactorX, src.scrollFactorY,\r\n src.originX * src.width, src.originY * src.height,\r\n 0, 0, src.width, src.height,\r\n getTint(src._tintTL, camera.alpha * src._alphaTL),\r\n getTint(src._tintTR, camera.alpha * src._alphaTR),\r\n getTint(src._tintBL, camera.alpha * src._alphaBL),\r\n getTint(src._tintBR, camera.alpha * src._alphaBR),\r\n (src._isTinted && src.tintFill),\r\n (src.tilePositionX % src.displayFrame.width) / src.displayFrame.width,\r\n (src.tilePositionY % src.displayFrame.height) / src.displayFrame.height,\r\n camera,\r\n parentMatrix\r\n );\r\n};\r\n\r\nmodule.exports = TileSpriteWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/tilesprite/TileSpriteWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/video/Video.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/video/Video.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Clamp = __webpack_require__(/*! ../../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/gameobjects/events/index.js\");\r\nvar GameEvents = __webpack_require__(/*! ../../core/events/ */ \"./node_modules/phaser/src/core/events/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar SoundEvents = __webpack_require__(/*! ../../sound/events/ */ \"./node_modules/phaser/src/sound/events/index.js\");\r\nvar UUID = __webpack_require__(/*! ../../utils/string/UUID */ \"./node_modules/phaser/src/utils/string/UUID.js\");\r\nvar VideoRender = __webpack_require__(/*! ./VideoRender */ \"./node_modules/phaser/src/gameobjects/video/VideoRender.js\");\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Video Game Object.\r\n * \r\n * This Game Object is capable of handling playback of a previously loaded video from the Phaser Video Cache,\r\n * or playing a video based on a given URL. Videos can be either local, or streamed.\r\n * \r\n * ```javascript\r\n * preload () {\r\n * this.load.video('pixar', 'nemo.mp4');\r\n * }\r\n * \r\n * create () {\r\n * this.add.video(400, 300, 'pixar');\r\n * }\r\n * ```\r\n * \r\n * To all intents and purposes, a video is a standard Game Object, just like a Sprite. And as such, you can do\r\n * all the usual things to it, such as scaling, rotating, cropping, tinting, making interactive, giving a\r\n * physics body, etc.\r\n * \r\n * Transparent videos are also possible via the WebM file format. Providing the video file has was encoded with\r\n * an alpha channel, and providing the browser supports WebM playback (not all of them do), then it will render\r\n * in-game with full transparency.\r\n * \r\n * ### Autoplaying Videos\r\n * \r\n * Videos can only autoplay if the browser has been unlocked with an interaction, or satisfies the MEI settings.\r\n * The policies that control autoplaying are vast and vary between browser.\r\n * You can, ahd should, read more about it here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide\r\n * \r\n * If your video doesn't contain any audio, then set the `noAudio` parameter to `true` when the video is _loaded_,\r\n * and it will often allow the video to play immediately:\r\n * \r\n * ```javascript\r\n * preload () {\r\n * this.load.video('pixar', 'nemo.mp4', 'loadeddata', false, true);\r\n * }\r\n * ```\r\n * \r\n * The 5th parameter in the load call tells Phaser that the video doesn't contain any audio tracks. Video without\r\n * audio can autoplay without requiring a user interaction. Video with audio cannot do this unless it satisfies\r\n * the browsers MEI settings. See the MDN Autoplay Guide for further details.\r\n * \r\n * Note that due to a bug in IE11 you cannot play a video texture to a Sprite in WebGL. For IE11 force Canvas mode.\r\n * \r\n * More details about video playback and the supported media formats can be found on MDN:\r\n * \r\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement\r\n * https://developer.mozilla.org/en-US/docs/Web/Media/Formats\r\n *\r\n * @class Video\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.20.0\r\n *\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Size\r\n * @extends Phaser.GameObjects.Components.TextureCrop\r\n * @extends Phaser.GameObjects.Components.Tint\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} [key] - Optional key of the Video this Game Object will play, as stored in the Video Cache.\r\n */\r\nvar Video = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.Alpha,\r\n Components.BlendMode,\r\n Components.Depth,\r\n Components.Flip,\r\n Components.GetBounds,\r\n Components.Mask,\r\n Components.Origin,\r\n Components.Pipeline,\r\n Components.ScrollFactor,\r\n Components.Size,\r\n Components.TextureCrop,\r\n Components.Tint,\r\n Components.Transform,\r\n Components.Visible,\r\n VideoRender\r\n ],\r\n\r\n initialize:\r\n\r\n function Video (scene, x, y, key)\r\n {\r\n GameObject.call(this, scene, 'Video');\r\n\r\n /**\r\n * A reference to the HTML Video Element this Video Game Object is playing.\r\n * Will be `null` until a video is loaded for playback.\r\n *\r\n * @name Phaser.GameObjects.Video#video\r\n * @type {?HTMLVideoElement}\r\n * @since 3.20.0\r\n */\r\n this.video = null;\r\n\r\n /**\r\n * The Phaser Texture this Game Object is using to render the video to.\r\n * Will be `null` until a video is loaded for playback.\r\n *\r\n * @name Phaser.GameObjects.Video#videoTexture\r\n * @type {?Phaser.Textures.Texture}\r\n * @since 3.20.0\r\n */\r\n this.videoTexture = null;\r\n\r\n /**\r\n * A reference to the TextureSource belong to the `videoTexture` Texture object.\r\n * Will be `null` until a video is loaded for playback.\r\n *\r\n * @name Phaser.GameObjects.Video#videoTextureSource\r\n * @type {?Phaser.Textures.TextureSource}\r\n * @since 3.20.0\r\n */\r\n this.videoTextureSource = null;\r\n\r\n /**\r\n * A Phaser CanvasTexture instance that holds the most recent snapshot taken from the video.\r\n * This will only be set if `snapshot` or `snapshotArea` have been called, and will be `null` until that point.\r\n *\r\n * @name Phaser.GameObjects.Video#snapshotTexture\r\n * @type {?Phaser.Textures.CanvasTexture}\r\n * @since 3.20.0\r\n */\r\n this.snapshotTexture = null;\r\n\r\n /**\r\n * If you have saved this video to a texture via the `saveTexture` method, this controls if the video\r\n * is rendered with `flipY` in WebGL or not. You often need to set this if you wish to use the video texture\r\n * as the input source for a shader. If you find your video is appearing upside down within a shader or\r\n * custom pipeline, flip this property.\r\n *\r\n * @name Phaser.GameObjects.Video#flipY\r\n * @type {boolean}\r\n * @since 3.20.0\r\n */\r\n this.flipY = false;\r\n\r\n /**\r\n * The key used by the texture as stored in the Texture Manager.\r\n *\r\n * @name Phaser.GameObjects.Video#_key\r\n * @type {string}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this._key = UUID();\r\n\r\n /**\r\n * An internal flag holding the current state of the video lock, should document interaction be required\r\n * before playback can begin.\r\n *\r\n * @name Phaser.GameObjects.Video#touchLocked\r\n * @type {boolean}\r\n * @since 3.20.0\r\n */\r\n this.touchLocked = true;\r\n\r\n /**\r\n * Should the video auto play when document interaction is required and happens?\r\n *\r\n * @name Phaser.GameObjects.Video#playWhenUnlocked\r\n * @type {boolean}\r\n * @since 3.20.0\r\n */\r\n this.playWhenUnlocked = false;\r\n\r\n /**\r\n * When starting playback of a video Phaser will monitor its `readyState` using a `setTimeout` call.\r\n * The `setTimeout` happens once every `Video.retryInterval` ms. It will carry on monitoring the video\r\n * state in this manner until the `retryLimit` is reached and then abort.\r\n *\r\n * @name Phaser.GameObjects.Video#retryLimit\r\n * @type {integer}\r\n * @since 3.20.0\r\n */\r\n this.retryLimit = 20;\r\n\r\n /**\r\n * The current retry attempt.\r\n *\r\n * @name Phaser.GameObjects.Video#retry\r\n * @type {integer}\r\n * @since 3.20.0\r\n */\r\n this.retry = 0;\r\n\r\n /**\r\n * The number of ms between each retry while monitoring the ready state of a downloading video.\r\n *\r\n * @name Phaser.GameObjects.Video#retryInterval\r\n * @type {integer}\r\n * @since 3.20.0\r\n */\r\n this.retryInterval = 500;\r\n\r\n /**\r\n * The setTimeout callback ID.\r\n *\r\n * @name Phaser.GameObjects.Video#_retryID\r\n * @type {integer}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this._retryID = null;\r\n\r\n /**\r\n * The video was muted due to a system event, such as the game losing focus.\r\n *\r\n * @name Phaser.GameObjects.Video#_systemMuted\r\n * @type {boolean}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this._systemMuted = false;\r\n\r\n /**\r\n * The video was muted due to game code, not a system event.\r\n *\r\n * @name Phaser.GameObjects.Video#_codeMuted\r\n * @type {boolean}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this._codeMuted = false;\r\n\r\n /**\r\n * The video was paused due to a system event, such as the game losing focus.\r\n *\r\n * @name Phaser.GameObjects.Video#_systemPaused\r\n * @type {boolean}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this._systemPaused = false;\r\n\r\n /**\r\n * The video was paused due to game code, not a system event.\r\n *\r\n * @name Phaser.GameObjects.Video#_codePaused\r\n * @type {boolean}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this._codePaused = false;\r\n\r\n /**\r\n * The locally bound event callback handlers.\r\n *\r\n * @name Phaser.GameObjects.Video#_callbacks\r\n * @type {any}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this._callbacks = {\r\n play: this.playHandler.bind(this),\r\n error: this.loadErrorHandler.bind(this),\r\n end: this.completeHandler.bind(this),\r\n time: this.timeUpdateHandler.bind(this),\r\n seeking: this.seekingHandler.bind(this),\r\n seeked: this.seekedHandler.bind(this)\r\n };\r\n\r\n /**\r\n * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method.\r\n *\r\n * @name Phaser.GameObjects.Video#_crop\r\n * @type {object}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this._crop = this.resetCropObject();\r\n\r\n /**\r\n * An object containing in and out markers for sequence playback.\r\n *\r\n * @name Phaser.GameObjects.Video#markers\r\n * @type {any}\r\n * @since 3.20.0\r\n */\r\n this.markers = {};\r\n\r\n /**\r\n * The in marker.\r\n *\r\n * @name Phaser.GameObjects.Video#_markerIn\r\n * @type {integer}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this._markerIn = -1;\r\n\r\n /**\r\n * The out marker.\r\n *\r\n * @name Phaser.GameObjects.Video#_markerOut\r\n * @type {integer}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this._markerOut = MATH_CONST.MAX_SAFE_INTEGER;\r\n\r\n /**\r\n * The last time the TextureSource was updated.\r\n *\r\n * @name Phaser.GameObjects.Video#_lastUpdate\r\n * @type {integer}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this._lastUpdate = 0;\r\n\r\n /**\r\n * The key of the video being played from the Video cache, if any.\r\n *\r\n * @name Phaser.GameObjects.Video#_cacheKey\r\n * @type {string}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this._cacheKey = '';\r\n\r\n /**\r\n * Is the video currently seeking?\r\n *\r\n * @name Phaser.GameObjects.Video#_isSeeking\r\n * @type {boolean}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this._isSeeking = false;\r\n\r\n /**\r\n * Should the Video element that this Video is using, be removed from the DOM\r\n * when this Video is destroyed?\r\n *\r\n * @name Phaser.GameObjects.Video#removeVideoElementOnDestroy\r\n * @type {boolean}\r\n * @since 3.21.0\r\n */\r\n this.removeVideoElementOnDestroy = false;\r\n\r\n this.setPosition(x, y);\r\n this.initPipeline();\r\n\r\n if (key)\r\n {\r\n this.changeSource(key, false);\r\n }\r\n\r\n var game = scene.sys.game.events;\r\n\r\n game.on(GameEvents.PAUSE, this.globalPause, this);\r\n game.on(GameEvents.RESUME, this.globalResume, this);\r\n\r\n var sound = scene.sys.sound;\r\n\r\n if (sound)\r\n {\r\n sound.on(SoundEvents.GLOBAL_MUTE, this.globalMute, this);\r\n }\r\n },\r\n\r\n /**\r\n * Starts this video playing.\r\n *\r\n * If the video is already playing, or has been queued to play with `changeSource` then this method just returns.\r\n * \r\n * Videos can only autoplay if the browser has been unlocked. This happens if you have interacted with the browser, i.e.\r\n * by clicking on it or pressing a key, or due to server settings. The policies that control autoplaying are vast and\r\n * vary between browser. You can read more here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide\r\n * \r\n * If your video doesn't contain any audio, then set the `noAudio` parameter to `true` when the video is loaded,\r\n * and it will often allow the video to play immediately:\r\n * \r\n * ```javascript\r\n * preload () {\r\n * this.load.video('pixar', 'nemo.mp4', 'loadeddata', false, true);\r\n * }\r\n * ```\r\n * \r\n * The 5th parameter in the load call tells Phaser that the video doesn't contain any audio tracks. Video without\r\n * audio can autoplay without requiring a user interaction. Video with audio cannot do this unless it satisfies\r\n * the browsers MEI settings. See the MDN Autoplay Guide for details.\r\n * \r\n * If you need audio in your videos, then you'll have to consider the fact that the video cannot start playing until the\r\n * user has interacted with the browser, into your game flow.\r\n *\r\n * @method Phaser.GameObjects.Video#play\r\n * @since 3.20.0\r\n * \r\n * @param {boolean} [loop=false] - Should the video loop automatically when it reaches the end? Please note that not all browsers support _seamless_ video looping for all encoding formats.\r\n * @param {integer} [markerIn] - Optional in marker time, in seconds, for playback of a sequence of the video.\r\n * @param {integer} [markerOut] - Optional out marker time, in seconds, for playback of a sequence of the video.\r\n * \r\n * @return {this} This Video Game Object for method chaining.\r\n */\r\n play: function (loop, markerIn, markerOut)\r\n {\r\n if ((this.touchLocked && this.playWhenUnlocked) || this.isPlaying())\r\n {\r\n return this;\r\n }\r\n\r\n var video = this.video;\r\n\r\n if (!video)\r\n {\r\n console.warn('Video not loaded');\r\n\r\n return this;\r\n }\r\n\r\n if (loop === undefined) { loop = video.loop; }\r\n\r\n var sound = this.scene.sys.sound;\r\n \r\n if (sound && sound.mute)\r\n {\r\n // Mute will be set based on the global mute state of the Sound Manager (if there is one)\r\n this.setMute(true);\r\n }\r\n\r\n if (!isNaN(markerIn))\r\n {\r\n this._markerIn = markerIn;\r\n }\r\n\r\n if (!isNaN(markerOut) && markerOut > markerIn)\r\n {\r\n this._markerOut = markerOut;\r\n }\r\n\r\n video.loop = loop;\r\n\r\n var callbacks = this._callbacks;\r\n\r\n var playPromise = video.play();\r\n\r\n if (playPromise !== undefined)\r\n {\r\n playPromise.then(this.playPromiseSuccessHandler.bind(this)).catch(this.playPromiseErrorHandler.bind(this));\r\n }\r\n else\r\n {\r\n // Old-school browsers with no Promises\r\n video.addEventListener('playing', callbacks.play, true);\r\n\r\n // If video hasn't downloaded properly yet ...\r\n if (video.readyState < 2)\r\n {\r\n this.retry = this.retryLimit;\r\n\r\n this._retryID = window.setTimeout(this.checkVideoProgress.bind(this), this.retryInterval);\r\n }\r\n }\r\n\r\n // Set these _after_ calling `play` or they don't fire (useful, thanks browsers)\r\n video.addEventListener('ended', callbacks.end, true);\r\n video.addEventListener('timeupdate', callbacks.time, true);\r\n video.addEventListener('seeking', callbacks.seeking, true);\r\n video.addEventListener('seeked', callbacks.seeked, true);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * This method allows you to change the source of the current video element. It works by first stopping the\r\n * current video, if playing. Then deleting the video texture, if one has been created. Finally, it makes a\r\n * new video texture and starts playback of the new source through the existing video element.\r\n * \r\n * The reason you may wish to do this is because videos that require interaction to unlock, remain in an unlocked\r\n * state, even if you change the source of the video. By changing the source to a new video you avoid having to\r\n * go through the unlock process again.\r\n *\r\n * @method Phaser.GameObjects.Video#changeSource\r\n * @since 3.20.0\r\n * \r\n * @param {string} key - The key of the Video this Game Object will swap to playing, as stored in the Video Cache.\r\n * @param {boolean} [autoplay=true] - Should the video start playing immediately, once the swap is complete?\r\n * @param {boolean} [loop=false] - Should the video loop automatically when it reaches the end? Please note that not all browsers support _seamless_ video looping for all encoding formats.\r\n * @param {integer} [markerIn] - Optional in marker time, in seconds, for playback of a sequence of the video.\r\n * @param {integer} [markerOut] - Optional out marker time, in seconds, for playback of a sequence of the video.\r\n * \r\n * @return {this} This Video Game Object for method chaining.\r\n */\r\n changeSource: function (key, autoplay, loop, markerIn, markerOut)\r\n {\r\n if (autoplay === undefined) { autoplay = true; }\r\n\r\n var currentVideo = this.video;\r\n\r\n if (currentVideo)\r\n {\r\n this.stop();\r\n }\r\n\r\n var newVideo = this.scene.sys.cache.video.get(key);\r\n\r\n if (newVideo)\r\n {\r\n this.video = newVideo;\r\n\r\n this._cacheKey = key;\r\n\r\n this._codePaused = newVideo.paused;\r\n this._codeMuted = newVideo.muted;\r\n\r\n if (this.videoTexture)\r\n {\r\n this.scene.sys.textures.remove(this._key);\r\n\r\n this.videoTexture = this.scene.sys.textures.create(this._key, newVideo, newVideo.videoWidth, newVideo.videoHeight);\r\n this.videoTextureSource = this.videoTexture.source[0];\r\n this.videoTexture.add('__BASE', 0, 0, 0, newVideo.videoWidth, newVideo.videoHeight);\r\n \r\n this.setTexture(this.videoTexture);\r\n this.setSizeToFrame();\r\n this.updateDisplayOrigin();\r\n\r\n this.emit(Events.VIDEO_CREATED, this, newVideo.videoWidth, newVideo.videoHeight);\r\n }\r\n else\r\n {\r\n this.updateTexture();\r\n }\r\n\r\n newVideo.currentTime = 0;\r\n\r\n this._lastUpdate = 0;\r\n\r\n if (autoplay)\r\n {\r\n this.play(loop, markerIn, markerOut);\r\n }\r\n }\r\n else\r\n {\r\n this.video = null;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds a sequence marker to this video.\r\n * \r\n * Markers allow you to split a video up into sequences, delineated by a start and end time, given in seconds.\r\n * \r\n * You can then play back specific markers via the `playMarker` method.\r\n * \r\n * Note that marker timing is _not_ frame-perfect. You should construct your videos in such a way that you allow for\r\n * plenty of extra padding before and after each sequence to allow for discrepancies in browser seek and currentTime accuracy.\r\n * \r\n * See https://github.com/w3c/media-and-entertainment/issues/4 for more details about this issue.\r\n *\r\n * @method Phaser.GameObjects.Video#addMarker\r\n * @since 3.20.0\r\n * \r\n * @param {string} key - A unique name to give this marker.\r\n * @param {integer} markerIn - The time, in seconds, representing the start of this marker.\r\n * @param {integer} markerOut - The time, in seconds, representing the end of this marker.\r\n * \r\n * @return {this} This Video Game Object for method chaining.\r\n */\r\n addMarker: function (key, markerIn, markerOut)\r\n {\r\n if (!isNaN(markerIn) && markerIn >= 0 && !isNaN(markerOut))\r\n {\r\n this.markers[key] = [ markerIn, markerOut ];\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Plays a pre-defined sequence in this video.\r\n * \r\n * Markers allow you to split a video up into sequences, delineated by a start and end time, given in seconds and\r\n * specified via the `addMarker` method.\r\n * \r\n * Note that marker timing is _not_ frame-perfect. You should construct your videos in such a way that you allow for\r\n * plenty of extra padding before and after each sequence to allow for discrepancies in browser seek and currentTime accuracy.\r\n * \r\n * See https://github.com/w3c/media-and-entertainment/issues/4 for more details about this issue.\r\n *\r\n * @method Phaser.GameObjects.Video#playMarker\r\n * @since 3.20.0\r\n * \r\n * @param {string} key - The name of the marker sequence to play.\r\n * @param {boolean} [loop=false] - Should the video loop automatically when it reaches the end? Please note that not all browsers support _seamless_ video looping for all encoding formats.\r\n * \r\n * @return {this} This Video Game Object for method chaining.\r\n */\r\n playMarker: function (key, loop)\r\n {\r\n var marker = this.markers[key];\r\n\r\n if (marker)\r\n {\r\n this.play(loop, marker[0], marker[1]);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes a previously set marker from this video.\r\n * \r\n * If the marker is currently playing it will _not_ stop playback.\r\n *\r\n * @method Phaser.GameObjects.Video#removeMarker\r\n * @since 3.20.0\r\n * \r\n * @param {string} key - The name of the marker to remove.\r\n * \r\n * @return {this} This Video Game Object for method chaining.\r\n */\r\n removeMarker: function (key)\r\n {\r\n delete this.markers[key];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes a snapshot of the current frame of the video and renders it to a CanvasTexture object,\r\n * which is then returned. You can optionally resize the grab by passing a width and height.\r\n * \r\n * This method returns a reference to the `Video.snapshotTexture` object. Calling this method\r\n * multiple times will overwrite the previous snapshot with the most recent one.\r\n *\r\n * @method Phaser.GameObjects.Video#snapshot\r\n * @since 3.20.0\r\n * \r\n * @param {integer} [width] - The width of the resulting CanvasTexture.\r\n * @param {integer} [height] - The height of the resulting CanvasTexture.\r\n * \r\n * @return {Phaser.Textures.CanvasTexture} \r\n */\r\n snapshot: function (width, height)\r\n {\r\n if (width === undefined) { width = this.width; }\r\n if (height === undefined) { height = this.height; }\r\n\r\n return this.snapshotArea(0, 0, this.width, this.height, width, height);\r\n },\r\n\r\n /**\r\n * Takes a snapshot of the specified area of the current frame of the video and renders it to a CanvasTexture object,\r\n * which is then returned. You can optionally resize the grab by passing a different `destWidth` and `destHeight`.\r\n * \r\n * This method returns a reference to the `Video.snapshotTexture` object. Calling this method\r\n * multiple times will overwrite the previous snapshot with the most recent one.\r\n *\r\n * @method Phaser.GameObjects.Video#snapshotArea\r\n * @since 3.20.0\r\n * \r\n * @param {integer} [x=0] - The horizontal location of the top-left of the area to grab from.\r\n * @param {integer} [y=0] - The vertical location of the top-left of the area to grab from.\r\n * @param {integer} [srcWidth] - The width of area to grab from the video. If not given it will grab the full video dimensions.\r\n * @param {integer} [srcHeight] - The height of area to grab from the video. If not given it will grab the full video dimensions.\r\n * @param {integer} [destWidth] - The destination width of the grab, allowing you to resize it.\r\n * @param {integer} [destHeight] - The destination height of the grab, allowing you to resize it.\r\n * \r\n * @return {Phaser.Textures.CanvasTexture} \r\n */\r\n snapshotArea: function (x, y, srcWidth, srcHeight, destWidth, destHeight)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (srcWidth === undefined) { srcWidth = this.width; }\r\n if (srcHeight === undefined) { srcHeight = this.height; }\r\n if (destWidth === undefined) { destWidth = srcWidth; }\r\n if (destHeight === undefined) { destHeight = srcHeight; }\r\n\r\n var video = this.video;\r\n var snap = this.snapshotTexture;\r\n\r\n if (!snap)\r\n {\r\n snap = this.scene.sys.textures.createCanvas(UUID(), destWidth, destHeight);\r\n\r\n this.snapshotTexture = snap;\r\n\r\n if (video)\r\n {\r\n snap.context.drawImage(video, x, y, srcWidth, srcHeight, 0, 0, destWidth, destHeight);\r\n }\r\n }\r\n else\r\n {\r\n snap.setSize(destWidth, destHeight);\r\n\r\n if (video)\r\n {\r\n snap.context.drawImage(video, x, y, srcWidth, srcHeight, 0, 0, destWidth, destHeight);\r\n }\r\n }\r\n\r\n return snap.update();\r\n },\r\n\r\n /**\r\n * Stores a copy of this Videos `snapshotTexture` in the Texture Manager using the given key.\r\n * \r\n * This texture is created when the `snapshot` or `snapshotArea` methods are called.\r\n * \r\n * After doing this, any texture based Game Object, such as a Sprite, can use the contents of the\r\n * snapshot by using the texture key:\r\n * \r\n * ```javascript\r\n * var vid = this.add.video(0, 0, 'intro');\r\n * \r\n * vid.snapshot();\r\n * \r\n * vid.saveSnapshotTexture('doodle');\r\n * \r\n * this.add.image(400, 300, 'doodle');\r\n * ```\r\n * \r\n * Updating the contents of the `snapshotTexture`, for example by calling `snapshot` again,\r\n * will automatically update _any_ Game Object that is using it as a texture.\r\n * Calling `saveSnapshotTexture` again will not save another copy of the same texture,\r\n * it will just rename the existing one.\r\n * \r\n * By default it will create a single base texture. You can add frames to the texture\r\n * by using the `Texture.add` method. After doing this, you can then allow Game Objects\r\n * to use a specific frame.\r\n *\r\n * @method Phaser.GameObjects.Video#saveSnapshotTexture\r\n * @since 3.20.0\r\n *\r\n * @param {string} key - The unique key to store the texture as within the global Texture Manager.\r\n *\r\n * @return {Phaser.Textures.CanvasTexture} The Texture that was saved.\r\n */\r\n saveSnapshotTexture: function (key)\r\n {\r\n if (this.snapshotTexture)\r\n {\r\n this.scene.sys.textures.renameTexture(this.snapshotTexture.key, key);\r\n }\r\n else\r\n {\r\n this.snapshotTexture = this.scene.sys.textures.createCanvas(key, this.width, this.height);\r\n }\r\n\r\n return this.snapshotTexture;\r\n },\r\n\r\n /**\r\n * Loads a Video from the given URL, ready for playback with the `Video.play` method.\r\n * \r\n * You can control at what point the browser determines the video as being ready for playback via\r\n * the `loadEvent` parameter. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement\r\n * for more details.\r\n *\r\n * @method Phaser.GameObjects.Video#loadURL\r\n * @since 3.20.0\r\n * \r\n * @param {string} url - The URL of the video to load or be streamed.\r\n * @param {string} [loadEvent='loadeddata'] - The load event to listen for. Either `loadeddata`, `canplay` or `canplaythrough`.\r\n * @param {boolean} [noAudio=false] - Does the video have an audio track? If not you can enable auto-playing on it.\r\n * \r\n * @return {this} This Video Game Object for method chaining.\r\n */\r\n loadURL: function (url, loadEvent, noAudio)\r\n {\r\n if (loadEvent === undefined) { loadEvent = 'loadeddata'; }\r\n if (noAudio === undefined) { noAudio = false; }\r\n\r\n if (this.video)\r\n {\r\n this.stop();\r\n }\r\n\r\n if (this.videoTexture)\r\n {\r\n this.scene.sys.textures.remove(this._key);\r\n }\r\n\r\n var video = document.createElement('video');\r\n \r\n video.controls = false;\r\n\r\n if (noAudio)\r\n {\r\n video.muted = true;\r\n video.defaultMuted = true;\r\n\r\n video.setAttribute('autoplay', 'autoplay');\r\n }\r\n\r\n video.setAttribute('playsinline', 'playsinline');\r\n video.setAttribute('preload', 'auto');\r\n\r\n video.addEventListener('error', this._callbacks.error, true);\r\n\r\n video.src = url;\r\n\r\n video.load();\r\n\r\n this.video = video;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * This internal method is called automatically if the playback Promise resolves successfully.\r\n *\r\n * @method Phaser.GameObjects.Video#playPromiseSuccessHandler\r\n * @fires Phaser.GameObjects.Events#VIDEO_PLAY\r\n * @private\r\n * @since 3.20.0\r\n */\r\n playPromiseSuccessHandler: function ()\r\n {\r\n this.touchLocked = false;\r\n\r\n this.emit(Events.VIDEO_PLAY, this);\r\n\r\n if (this._markerIn > -1)\r\n {\r\n this.video.currentTime = this._markerIn;\r\n }\r\n },\r\n\r\n /**\r\n * This internal method is called automatically if the playback Promise fails to resolve.\r\n *\r\n * @method Phaser.GameObjects.Video#playPromiseErrorHandler\r\n * @fires Phaser.GameObjects.Events#VIDEO_ERROR\r\n * @private\r\n * @since 3.20.0\r\n * \r\n * @param {any} error - The Promise resolution error.\r\n */\r\n playPromiseErrorHandler: function (error)\r\n {\r\n this.scene.sys.input.once('pointerdown', this.unlockHandler, this);\r\n\r\n this.touchLocked = true;\r\n this.playWhenUnlocked = true;\r\n\r\n this.emit(Events.VIDEO_ERROR, this, error);\r\n },\r\n\r\n /**\r\n * Called when the video emits a `playing` event during load.\r\n * \r\n * This is only listened for if the browser doesn't support Promises.\r\n *\r\n * @method Phaser.GameObjects.Video#playHandler\r\n * @fires Phaser.GameObjects.Events#VIDEO_PLAY\r\n * @since 3.20.0\r\n */\r\n playHandler: function ()\r\n {\r\n this.touchLocked = false;\r\n\r\n this.emit(Events.VIDEO_PLAY, this);\r\n \r\n this.video.removeEventListener('playing', this._callbacks.play, true);\r\n },\r\n\r\n /**\r\n * This internal method is called automatically if the video fails to load.\r\n *\r\n * @method Phaser.GameObjects.Video#loadErrorHandler\r\n * @fires Phaser.GameObjects.Events#VIDEO_ERROR\r\n * @private\r\n * @since 3.20.0\r\n * \r\n * @param {Event} event - The error Event.\r\n */\r\n loadErrorHandler: function (event)\r\n {\r\n this.stop();\r\n\r\n this.emit(Events.VIDEO_ERROR, this, event);\r\n },\r\n\r\n /**\r\n * This internal method is called if the video couldn't be played because it was interaction locked\r\n * by the browser, but an input event has since been received.\r\n *\r\n * @method Phaser.GameObjects.Video#unlockHandler\r\n * @fires Phaser.GameObjects.Events#VIDEO_UNLOCKED\r\n * @fires Phaser.GameObjects.Events#VIDEO_PLAY\r\n * @private\r\n * @since 3.20.0\r\n * \r\n * @param {any} error - The Promise resolution error.\r\n */\r\n unlockHandler: function ()\r\n {\r\n this.touchLocked = false;\r\n this.playWhenUnlocked = false;\r\n\r\n this.emit(Events.VIDEO_UNLOCKED, this);\r\n\r\n if (this._markerIn > -1)\r\n {\r\n this.video.currentTime = this._markerIn;\r\n }\r\n\r\n this.video.play();\r\n\r\n this.emit(Events.VIDEO_PLAY, this);\r\n },\r\n\r\n /**\r\n * Called when the video completes playback, i.e. reaches an `ended` state.\r\n * \r\n * This will never happen if the video is coming from a live stream, where the duration is `Infinity`.\r\n *\r\n * @method Phaser.GameObjects.Video#completeHandler\r\n * @fires Phaser.GameObjects.Events#VIDEO_COMPLETE\r\n * @since 3.20.0\r\n */\r\n completeHandler: function ()\r\n {\r\n this.emit(Events.VIDEO_COMPLETE, this);\r\n },\r\n\r\n /**\r\n * Called when the video emits a `timeUpdate` event during playback.\r\n * \r\n * This event is too slow and irregular to be used for actual video timing or texture updating,\r\n * but we can use it to determine if a video has looped.\r\n *\r\n * @method Phaser.GameObjects.Video#timeUpdateHandler\r\n * @fires Phaser.GameObjects.Events#VIDEO_LOOP\r\n * @since 3.20.0\r\n */\r\n timeUpdateHandler: function ()\r\n {\r\n if (this.video && this.video.currentTime < this._lastUpdate)\r\n {\r\n this.emit(Events.VIDEO_LOOP, this);\r\n\r\n this._lastUpdate = 0;\r\n }\r\n },\r\n\r\n /**\r\n * The internal update step.\r\n *\r\n * @method Phaser.GameObjects.Video#preUpdate\r\n * @private\r\n * @since 3.20.0\r\n */\r\n preUpdate: function ()\r\n {\r\n var video = this.video;\r\n\r\n if (video)\r\n {\r\n var currentTime = video.currentTime;\r\n\r\n // Don't render a new frame unless the video has actually changed time\r\n if (currentTime !== this._lastUpdate)\r\n {\r\n this._lastUpdate = currentTime;\r\n\r\n this.updateTexture();\r\n\r\n if (currentTime >= this._markerOut)\r\n {\r\n if (video.loop)\r\n {\r\n video.currentTime = this._markerIn;\r\n\r\n this.updateTexture();\r\n\r\n this._lastUpdate = currentTime;\r\n\r\n this.emit(Events.VIDEO_LOOP, this);\r\n }\r\n else\r\n {\r\n this.emit(Events.VIDEO_COMPLETE, this);\r\n\r\n this.stop();\r\n }\r\n }\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Internal callback that monitors the download progress of a video after changing its source.\r\n *\r\n * @method Phaser.GameObjects.Video#checkVideoProgress\r\n * @fires Phaser.GameObjects.Events#VIDEO_TIMEOUT\r\n * @private\r\n * @since 3.20.0\r\n */\r\n checkVideoProgress: function ()\r\n {\r\n if (this.video.readyState >= 2)\r\n {\r\n // We've got enough data to update the texture for playback\r\n this.updateTexture();\r\n }\r\n else\r\n {\r\n this.retry--;\r\n\r\n if (this.retry > 0)\r\n {\r\n this._retryID = window.setTimeout(this.checkVideoProgress.bind(this), this.retryInterval);\r\n }\r\n else\r\n {\r\n this.emit(Events.VIDEO_TIMEOUT, this);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Internal method that is called when enough video data has been received in order to create a texture\r\n * from it. The texture is assigned to the `Video.videoTexture` property and given a base frame that\r\n * encompases the whole video size.\r\n *\r\n * @method Phaser.GameObjects.Video#updateTexture\r\n * @since 3.20.0\r\n */\r\n updateTexture: function ()\r\n {\r\n var video = this.video;\r\n\r\n var width = video.videoWidth;\r\n var height = video.videoHeight;\r\n\r\n if (!this.videoTexture)\r\n {\r\n this.videoTexture = this.scene.sys.textures.create(this._key, video, width, height);\r\n this.videoTextureSource = this.videoTexture.source[0];\r\n this.videoTexture.add('__BASE', 0, 0, 0, width, height);\r\n \r\n this.setTexture(this.videoTexture);\r\n this.setSizeToFrame();\r\n this.updateDisplayOrigin();\r\n \r\n this.emit(Events.VIDEO_CREATED, this, width, height);\r\n }\r\n else\r\n {\r\n var textureSource = this.videoTextureSource;\r\n\r\n if (textureSource.source !== video)\r\n {\r\n textureSource.source = video;\r\n textureSource.width = width;\r\n textureSource.height = height;\r\n }\r\n \r\n textureSource.update();\r\n }\r\n },\r\n\r\n /**\r\n * Returns the key of the currently played video, as stored in the Video Cache.\r\n * If the video did not come from the cache this will return an empty string.\r\n *\r\n * @method Phaser.GameObjects.Video#getVideoKey\r\n * @since 3.20.0\r\n * \r\n * @return {string} The key of the video being played from the Video Cache, if any.\r\n */\r\n getVideoKey: function ()\r\n {\r\n return this._cacheKey;\r\n },\r\n\r\n /**\r\n * Seeks to a given point in the video. The value is given as a float between 0 and 1,\r\n * where 0 represents the start of the video and 1 represents the end.\r\n * \r\n * Seeking only works if the video has a duration, so will not work for live streams.\r\n * \r\n * When seeking begins, this video will emit a `seeking` event. When the video completes\r\n * seeking (i.e. reaches its designated timestamp) it will emit a `seeked` event.\r\n * \r\n * If you wish to seek based on time instead, use the `Video.setCurrentTime` method.\r\n *\r\n * @method Phaser.GameObjects.Video#seekTo\r\n * @since 3.20.0\r\n * \r\n * @param {number} value - The point in the video to seek to. A value between 0 and 1.\r\n * \r\n * @return {this} This Video Game Object for method chaining.\r\n */\r\n seekTo: function (value)\r\n {\r\n var video = this.video;\r\n\r\n if (video)\r\n {\r\n var duration = video.duration;\r\n\r\n if (duration !== Infinity && !isNaN(duration))\r\n {\r\n var seekTime = duration * value;\r\n\r\n this.setCurrentTime(seekTime);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * A double-precision floating-point value indicating the current playback time in seconds.\r\n * If the media has not started to play and has not been seeked, this value is the media's initial playback time.\r\n *\r\n * @method Phaser.GameObjects.Video#getCurrentTime\r\n * @since 3.20.0\r\n * \r\n * @return {number} A double-precision floating-point value indicating the current playback time in seconds.\r\n */\r\n getCurrentTime: function ()\r\n {\r\n return (this.video) ? this.video.currentTime : 0;\r\n },\r\n\r\n /**\r\n * Seeks to a given playback time in the video. The value is given in _seconds_ or as a string.\r\n * \r\n * Seeking only works if the video has a duration, so will not work for live streams.\r\n * \r\n * When seeking begins, this video will emit a `seeking` event. When the video completes\r\n * seeking (i.e. reaches its designated timestamp) it will emit a `seeked` event.\r\n * \r\n * You can provide a string prefixed with either a `+` or a `-`, such as `+2.5` or `-2.5`.\r\n * In this case it will seek to +/- the value given, relative to the _current time_.\r\n * \r\n * If you wish to seek based on a duration percentage instead, use the `Video.seekTo` method.\r\n *\r\n * @method Phaser.GameObjects.Video#setCurrentTime\r\n * @since 3.20.0\r\n * \r\n * @param {(string|number)} value - The playback time to seek to in seconds. Can be expressed as a string, such as `+2` to seek 2 seconds ahead from the current time.\r\n * \r\n * @return {this} This Video Game Object for method chaining.\r\n */\r\n setCurrentTime: function (value)\r\n {\r\n var video = this.video;\r\n\r\n if (video)\r\n {\r\n if (typeof value === 'string')\r\n {\r\n var op = value[0];\r\n var num = parseFloat(value.substr(1));\r\n\r\n if (op === '+')\r\n {\r\n value = video.currentTime + num;\r\n }\r\n else if (op === '-')\r\n {\r\n value = video.currentTime - num;\r\n }\r\n }\r\n\r\n video.currentTime = value;\r\n\r\n this._lastUpdate = value;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns a boolean indicating if this Video is currently seeking, or not.\r\n *\r\n * @method Phaser.GameObjects.Video#isSeeking\r\n * @since 3.20.0\r\n * \r\n * @return {boolean} A boolean indicating if this Video is currently seeking, or not.\r\n */\r\n isSeeking: function ()\r\n {\r\n return this._isSeeking;\r\n },\r\n\r\n /**\r\n * Internal seeking handler.\r\n *\r\n * @method Phaser.GameObjects.Video#seekingHandler\r\n * @fires Phaser.GameObjects.Events#VIDEO_SEEKING\r\n * @private\r\n * @since 3.20.0\r\n */\r\n seekingHandler: function ()\r\n {\r\n this._isSeeking = true;\r\n\r\n this.emit(Events.VIDEO_SEEKING, this);\r\n },\r\n\r\n /**\r\n * Internal seeked handler.\r\n *\r\n * @method Phaser.GameObjects.Video#seekedHandler\r\n * @fires Phaser.GameObjects.Events#VIDEO_SEEKED\r\n * @private\r\n * @since 3.20.0\r\n */\r\n seekedHandler: function ()\r\n {\r\n this._isSeeking = false;\r\n\r\n this.emit(Events.VIDEO_SEEKED, this);\r\n\r\n var video = this.video;\r\n\r\n if (video)\r\n {\r\n this.updateTexture();\r\n }\r\n },\r\n\r\n /**\r\n * Returns the current progress of the video. Progress is defined as a value between 0 (the start)\r\n * and 1 (the end).\r\n * \r\n * Progress can only be returned if the video has a duration, otherwise it will always return zero.\r\n *\r\n * @method Phaser.GameObjects.Video#getProgress\r\n * @since 3.20.0\r\n * \r\n * @return {number} The current progress of playback. If the video has no duration, will always return zero.\r\n */\r\n getProgress: function ()\r\n {\r\n var video = this.video;\r\n\r\n if (video)\r\n {\r\n var now = video.currentTime;\r\n var duration = video.duration;\r\n\r\n if (duration !== Infinity && !isNaN(duration))\r\n {\r\n return now / duration;\r\n }\r\n }\r\n \r\n return 0;\r\n },\r\n\r\n /**\r\n * A double-precision floating-point value which indicates the duration (total length) of the media in seconds,\r\n * on the media's timeline. If no media is present on the element, or the media is not valid, the returned value is NaN.\r\n * \r\n * If the media has no known end (such as for live streams of unknown duration, web radio, media incoming from WebRTC,\r\n * and so forth), this value is +Infinity.\r\n * \r\n * @method Phaser.GameObjects.Video#getDuration\r\n * @since 3.20.0\r\n * \r\n * @return {number} A double-precision floating-point value indicating the duration of the media in seconds.\r\n */\r\n getDuration: function ()\r\n {\r\n return (this.video) ? this.video.duration : 0;\r\n },\r\n\r\n /**\r\n * Sets the muted state of the currently playing video, if one is loaded.\r\n *\r\n * @method Phaser.GameObjects.Video#setMute\r\n * @since 3.20.0\r\n * \r\n * @param {boolean} [value=true] - The mute value. `true` if the video should be muted, otherwise `false`.\r\n * \r\n * @return {this} This Video Game Object for method chaining.\r\n */\r\n setMute: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this._codeMuted = value;\r\n\r\n var video = this.video;\r\n\r\n if (video)\r\n {\r\n video.muted = (this._systemMuted) ? true : value;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns a boolean indicating if this Video is currently muted.\r\n *\r\n * @method Phaser.GameObjects.Video#isMuted\r\n * @since 3.20.0\r\n * \r\n * @return {boolean} A boolean indicating if this Video is currently muted, or not.\r\n */\r\n isMuted: function ()\r\n {\r\n return this._codeMuted;\r\n },\r\n\r\n /**\r\n * Internal global mute handler. Will mute the video, if playing, if the global sound system mutes.\r\n *\r\n * @method Phaser.GameObjects.Video#globalMute\r\n * @private\r\n * @since 3.20.0\r\n * \r\n * @param {(Phaser.Sound.WebAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager)} soundManager - A reference to the Sound Manager that emitted the event.\r\n * @param {boolean} mute - The mute value. `true` if the Sound Manager is now muted, otherwise `false`.\r\n */\r\n globalMute: function (soundManager, value)\r\n {\r\n this._systemMuted = value;\r\n\r\n var video = this.video;\r\n\r\n if (video)\r\n {\r\n video.muted = (this._codeMuted) ? true : value;\r\n }\r\n },\r\n\r\n /**\r\n * Internal global pause handler. Will pause the video if the Game itself pauses.\r\n *\r\n * @method Phaser.GameObjects.Video#globalPause\r\n * @private\r\n * @since 3.20.0\r\n */\r\n globalPause: function ()\r\n {\r\n this._systemPaused = true;\r\n\r\n if (this.video)\r\n {\r\n this.video.pause();\r\n }\r\n },\r\n\r\n /**\r\n * Internal global resume handler. Will resume a paused video if the Game itself resumes.\r\n *\r\n * @method Phaser.GameObjects.Video#globalResume\r\n * @private\r\n * @since 3.20.0\r\n */\r\n globalResume: function ()\r\n {\r\n this._systemPaused = false;\r\n\r\n if (this.video && !this._codePaused)\r\n {\r\n this.video.play();\r\n }\r\n },\r\n\r\n /**\r\n * Sets the paused state of the currently loaded video.\r\n * \r\n * If the video is playing, calling this method with `true` will pause playback.\r\n * If the video is paused, calling this method with `false` will resume playback.\r\n * \r\n * If no video is loaded, this method does nothing.\r\n *\r\n * @method Phaser.GameObjects.Video#setPaused\r\n * @since 3.20.0\r\n * \r\n * @param {boolean} [value=true] - The paused value. `true` if the video should be paused, `false` to resume it.\r\n * \r\n * @return {this} This Video Game Object for method chaining.\r\n */\r\n setPaused: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n var video = this.video;\r\n\r\n this._codePaused = value;\r\n\r\n if (video)\r\n {\r\n if (value)\r\n {\r\n if (!video.paused)\r\n {\r\n video.pause();\r\n }\r\n }\r\n else if (!value)\r\n {\r\n if (video.paused && !this._systemPaused)\r\n {\r\n video.play();\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns a double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest).\r\n * \r\n * @method Phaser.GameObjects.Video#getVolume\r\n * @since 3.20.0\r\n * \r\n * @return {number} A double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest).\r\n */\r\n getVolume: function ()\r\n {\r\n return (this.video) ? this.video.volume : 1;\r\n },\r\n \r\n /**\r\n * Sets the volume of the currently playing video.\r\n * \r\n * The value given is a double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest).\r\n * \r\n * @method Phaser.GameObjects.Video#setVolume\r\n * @since 3.20.0\r\n * \r\n * @param {number} [value=1] - A double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest).\r\n * \r\n * @return {this} This Video Game Object for method chaining.\r\n */\r\n setVolume: function (value)\r\n {\r\n if (value === undefined) { value = 1; }\r\n\r\n if (this.video)\r\n {\r\n this.video.volume = Clamp(value, 0, 1);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns a double that indicates the rate at which the media is being played back.\r\n * \r\n * @method Phaser.GameObjects.Video#getPlaybackRate\r\n * @since 3.20.0\r\n * \r\n * @return {number} A double that indicates the rate at which the media is being played back.\r\n */\r\n getPlaybackRate: function ()\r\n {\r\n return (this.video) ? this.video.playbackRate : 1;\r\n },\r\n\r\n /**\r\n * Sets the playback rate of the current video.\r\n * \r\n * The value given is a double that indicates the rate at which the media is being played back.\r\n * \r\n * @method Phaser.GameObjects.Video#setPlaybackRate\r\n * @since 3.20.0\r\n * \r\n * @param {number} [rate] - A double that indicates the rate at which the media is being played back.\r\n * \r\n * @return {this} This Video Game Object for method chaining.\r\n */\r\n setPlaybackRate: function (rate)\r\n {\r\n if (this.video)\r\n {\r\n this.video.playbackRate = rate;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns a boolean which indicates whether the media element should start over when it reaches the end.\r\n * \r\n * @method Phaser.GameObjects.Video#getLoop\r\n * @since 3.20.0\r\n * \r\n * @return {boolean} A boolean which indicates whether the media element will start over when it reaches the end.\r\n */\r\n getLoop: function ()\r\n {\r\n return (this.video) ? this.video.loop : false;\r\n },\r\n\r\n /**\r\n * Sets the loop state of the current video.\r\n * \r\n * The value given is a boolean which indicates whether the media element will start over when it reaches the end.\r\n * \r\n * Not all videos can loop, for example live streams.\r\n * \r\n * Please note that not all browsers support _seamless_ video looping for all encoding formats.\r\n * \r\n * @method Phaser.GameObjects.Video#setLoop\r\n * @since 3.20.0\r\n * \r\n * @param {boolean} [value=true] - A boolean which indicates whether the media element will start over when it reaches the end.\r\n * \r\n * @return {this} This Video Game Object for method chaining.\r\n */\r\n setLoop: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n if (this.video)\r\n {\r\n this.video.loop = value;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns a boolean which indicates whether the video is currently playing.\r\n * \r\n * @method Phaser.GameObjects.Video#isPlaying\r\n * @since 3.20.0\r\n * \r\n * @return {boolean} A boolean which indicates whether the video is playing, or not.\r\n */\r\n isPlaying: function ()\r\n {\r\n return (this.video) ? !(this.video.paused || this.video.ended) : false;\r\n },\r\n \r\n /**\r\n * Returns a boolean which indicates whether the video is currently paused.\r\n * \r\n * @method Phaser.GameObjects.Video#isPaused\r\n * @since 3.20.0\r\n * \r\n * @return {boolean} A boolean which indicates whether the video is paused, or not.\r\n */\r\n isPaused: function ()\r\n {\r\n return ((this.video && this.video.paused) || this._codePaused || this._systemPaused);\r\n },\r\n\r\n /**\r\n * Stores this Video in the Texture Manager using the given key as a dynamic texture,\r\n * which any texture-based Game Object, such as a Sprite, can use as its texture:\r\n * \r\n * ```javascript\r\n * var vid = this.add.video(0, 0, 'intro');\r\n * \r\n * vid.play();\r\n * \r\n * vid.saveTexture('doodle');\r\n * \r\n * this.add.image(400, 300, 'doodle');\r\n * ```\r\n * \r\n * The saved texture is automatically updated as the video plays. If you pause this video,\r\n * or change its source, then the saved texture updates instantly.\r\n * \r\n * Calling `saveTexture` again will not save another copy of the same texture, it will just rename the existing one.\r\n * \r\n * By default it will create a single base texture. You can add frames to the texture\r\n * by using the `Texture.add` method. After doing this, you can then allow Game Objects\r\n * to use a specific frame.\r\n * \r\n * If you intend to save the texture so you can use it as the input for a Shader, you may need to set the\r\n * `flipY` parameter to `true` if you find the video renders upside down in your shader.\r\n *\r\n * @method Phaser.GameObjects.Video#saveTexture\r\n * @since 3.20.0\r\n *\r\n * @param {string} key - The unique key to store the texture as within the global Texture Manager.\r\n * @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y` during upload?\r\n *\r\n * @return {Phaser.Textures.Texture} The Texture that was saved.\r\n */\r\n saveTexture: function (key, flipY)\r\n {\r\n if (flipY === undefined) { flipY = false; }\r\n\r\n if (this.videoTexture)\r\n {\r\n this.scene.sys.textures.renameTexture(this._key, key);\r\n }\r\n\r\n this._key = key;\r\n\r\n this.flipY = flipY;\r\n\r\n if (this.videoTextureSource)\r\n {\r\n this.videoTextureSource.setFlipY(flipY);\r\n }\r\n\r\n return this.videoTexture;\r\n },\r\n\r\n /**\r\n * Stops the video playing and clears all internal event listeners.\r\n *\r\n * If you only wish to pause playback of the video, and resume it a later time, use the `Video.pause` method instead.\r\n * \r\n * If the video hasn't finished downloading, calling this method will not abort the download. To do that you need to\r\n * call `destroy` instead.\r\n *\r\n * @method Phaser.GameObjects.Video#stop\r\n * @fires Phaser.GameObjects.Events#VIDEO_STOP\r\n * @since 3.20.0\r\n * \r\n * @return {this} This Video Game Object for method chaining.\r\n */\r\n stop: function ()\r\n {\r\n var video = this.video;\r\n\r\n if (video)\r\n {\r\n var callbacks = this._callbacks;\r\n\r\n for (var callback in callbacks)\r\n {\r\n video.removeEventListener(callback, callbacks[callback], true);\r\n }\r\n\r\n video.pause();\r\n }\r\n\r\n if (this._retryID)\r\n {\r\n window.clearTimeout(this._retryID);\r\n }\r\n\r\n this.emit(Events.VIDEO_STOP, this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes the Video element from the DOM by calling parentNode.removeChild on itself.\r\n * \r\n * Also removes the autoplay and src attributes and nulls the Video reference.\r\n * \r\n * You should not call this method if you were playing a video from the Video Cache that\r\n * you wish to play again in your game, or if another Video object is also using the same\r\n * video.\r\n * \r\n * If you loaded an external video via `Video.loadURL` then you should call this function\r\n * to clear up once you are done with the instance.\r\n *\r\n * @method Phaser.GameObjects.Video#removeVideoElement\r\n * @since 3.20.0\r\n */\r\n removeVideoElement: function ()\r\n {\r\n var video = this.video;\r\n\r\n if (!video)\r\n {\r\n return;\r\n }\r\n\r\n if (video.parentNode)\r\n {\r\n video.parentNode.removeChild(video);\r\n }\r\n\r\n while (video.hasChildNodes())\r\n {\r\n video.removeChild(video.firstChild);\r\n }\r\n\r\n video.removeAttribute('autoplay');\r\n video.removeAttribute('src');\r\n\r\n this.video = null;\r\n },\r\n\r\n /**\r\n * Handles the pre-destroy step for the Video object.\r\n * \r\n * This calls `Video.stop` and optionally `Video.removeVideoElement`.\r\n * \r\n * If any Sprites are using this Video as their texture it is up to you to manage those.\r\n *\r\n * @method Phaser.GameObjects.Video#preDestroy\r\n * @private\r\n * @since 3.21.0\r\n */\r\n preDestroy: function ()\r\n {\r\n this.stop();\r\n\r\n if (this.removeVideoElementOnDestroy)\r\n {\r\n this.removeVideoElement();\r\n }\r\n\r\n var game = this.scene.sys.game.events;\r\n\r\n game.off(GameEvents.PAUSE, this.globalPause, this);\r\n game.off(GameEvents.RESUME, this.globalResume, this);\r\n\r\n var sound = this.scene.sys.sound;\r\n\r\n if (sound)\r\n {\r\n sound.off(SoundEvents.GLOBAL_MUTE, this.globalMute, this);\r\n }\r\n\r\n if (this._retryID)\r\n {\r\n window.clearTimeout(this._retryID);\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Video;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/video/Video.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/video/VideoCanvasRenderer.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/video/VideoCanvasRenderer.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Video#renderCanvas\r\n * @since 3.20.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Video} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar VideoCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n if (src.videoTexture)\r\n {\r\n renderer.batchSprite(src, src.frame, camera, parentMatrix);\r\n }\r\n};\r\n\r\nmodule.exports = VideoCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/video/VideoCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/video/VideoCreator.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/video/VideoCreator.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BuildGameObject = __webpack_require__(/*! ../BuildGameObject */ \"./node_modules/phaser/src/gameobjects/BuildGameObject.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar Video = __webpack_require__(/*! ./Video */ \"./node_modules/phaser/src/gameobjects/video/Video.js\");\r\n\r\n/**\r\n * Creates a new Video Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Video Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#video\r\n * @since 3.20.0\r\n *\r\n * @param {object} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {Phaser.GameObjects.Video} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('video', function (config, addToScene)\r\n{\r\n if (config === undefined) { config = {}; }\r\n\r\n var key = GetAdvancedValue(config, 'key', null);\r\n\r\n var video = new Video(this.scene, 0, 0, key);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, video, config);\r\n\r\n return video;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectCreator context.\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/video/VideoCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/video/VideoFactory.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/video/VideoFactory.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Video = __webpack_require__(/*! ./Video */ \"./node_modules/phaser/src/gameobjects/video/Video.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Image Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Image Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#video\r\n * @since 3.20.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n *\r\n * @return {Phaser.GameObjects.Image} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('video', function (x, y, key)\r\n{\r\n var video = new Video(this.scene, x, y, key);\r\n\r\n this.displayList.add(video);\r\n this.updateList.add(video);\r\n\r\n return video;\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/video/VideoFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/video/VideoRender.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/video/VideoRender.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./VideoWebGLRenderer */ \"./node_modules/phaser/src/gameobjects/video/VideoWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./VideoCanvasRenderer */ \"./node_modules/phaser/src/gameobjects/video/VideoCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/video/VideoRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/video/VideoWebGLRenderer.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/video/VideoWebGLRenderer.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Video#renderWebGL\r\n * @since 3.20.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Video} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar VideoWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n if (src.videoTexture)\r\n {\r\n this.pipeline.batchSprite(src, camera, parentMatrix);\r\n }\r\n};\r\n\r\nmodule.exports = VideoWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/video/VideoWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/zone/Zone.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/zone/Zone.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BlendModes = __webpack_require__(/*! ../../renderer/BlendModes */ \"./node_modules/phaser/src/renderer/BlendModes.js\");\r\nvar Circle = __webpack_require__(/*! ../../geom/circle/Circle */ \"./node_modules/phaser/src/geom/circle/Circle.js\");\r\nvar CircleContains = __webpack_require__(/*! ../../geom/circle/Contains */ \"./node_modules/phaser/src/geom/circle/Contains.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar Rectangle = __webpack_require__(/*! ../../geom/rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar RectangleContains = __webpack_require__(/*! ../../geom/rectangle/Contains */ \"./node_modules/phaser/src/geom/rectangle/Contains.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Zone Game Object.\r\n *\r\n * A Zone is a non-rendering rectangular Game Object that has a position and size.\r\n * It has no texture and never displays, but does live on the display list and\r\n * can be moved, scaled and rotated like any other Game Object.\r\n *\r\n * Its primary use is for creating Drop Zones and Input Hit Areas and it has a couple of helper methods\r\n * specifically for this. It is also useful for object overlap checks, or as a base for your own\r\n * non-displaying Game Objects.\r\n\r\n * The default origin is 0.5, the center of the Zone, the same as with Game Objects.\r\n *\r\n * @class Zone\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {number} [width=1] - The width of the Game Object.\r\n * @param {number} [height=1] - The height of the Game Object.\r\n */\r\nvar Zone = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.Depth,\r\n Components.GetBounds,\r\n Components.Origin,\r\n Components.Transform,\r\n Components.ScrollFactor,\r\n Components.Visible\r\n ],\r\n\r\n initialize:\r\n\r\n function Zone (scene, x, y, width, height)\r\n {\r\n if (width === undefined) { width = 1; }\r\n if (height === undefined) { height = width; }\r\n\r\n GameObject.call(this, scene, 'Zone');\r\n\r\n this.setPosition(x, y);\r\n\r\n /**\r\n * The native (un-scaled) width of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Zone#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.width = width;\r\n\r\n /**\r\n * The native (un-scaled) height of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Zone#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.height = height;\r\n\r\n /**\r\n * The Blend Mode of the Game Object.\r\n * Although a Zone never renders, it still has a blend mode to allow it to fit seamlessly into\r\n * display lists without causing a batch flush.\r\n *\r\n * @name Phaser.GameObjects.Zone#blendMode\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.blendMode = BlendModes.NORMAL;\r\n\r\n this.updateDisplayOrigin();\r\n },\r\n\r\n /**\r\n * The displayed width of this Game Object.\r\n * This value takes into account the scale factor.\r\n *\r\n * @name Phaser.GameObjects.Zone#displayWidth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayWidth: {\r\n\r\n get: function ()\r\n {\r\n return this.scaleX * this.width;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleX = value / this.width;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The displayed height of this Game Object.\r\n * This value takes into account the scale factor.\r\n *\r\n * @name Phaser.GameObjects.Zone#displayHeight\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayHeight: {\r\n\r\n get: function ()\r\n {\r\n return this.scaleY * this.height;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleY = value / this.height;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the size of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Zone#setSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * @param {boolean} [resizeInput=true] - If this Zone has a Rectangle for a hit area this argument will resize the hit area as well.\r\n *\r\n * @return {Phaser.GameObjects.Zone} This Game Object.\r\n */\r\n setSize: function (width, height, resizeInput)\r\n {\r\n if (resizeInput === undefined) { resizeInput = true; }\r\n\r\n this.width = width;\r\n this.height = height;\r\n\r\n this.updateDisplayOrigin();\r\n\r\n var input = this.input;\r\n\r\n if (resizeInput && input && !input.customHitArea)\r\n {\r\n input.hitArea.width = width;\r\n input.hitArea.height = height;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the display size of this Game Object.\r\n * Calling this will adjust the scale.\r\n *\r\n * @method Phaser.GameObjects.Zone#setDisplaySize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n *\r\n * @return {Phaser.GameObjects.Zone} This Game Object.\r\n */\r\n setDisplaySize: function (width, height)\r\n {\r\n this.displayWidth = width;\r\n this.displayHeight = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets this Zone to be a Circular Drop Zone.\r\n * The circle is centered on this Zones `x` and `y` coordinates.\r\n *\r\n * @method Phaser.GameObjects.Zone#setCircleDropZone\r\n * @since 3.0.0\r\n *\r\n * @param {number} radius - The radius of the Circle that will form the Drop Zone.\r\n *\r\n * @return {Phaser.GameObjects.Zone} This Game Object.\r\n */\r\n setCircleDropZone: function (radius)\r\n {\r\n return this.setDropZone(new Circle(0, 0, radius), CircleContains);\r\n },\r\n\r\n /**\r\n * Sets this Zone to be a Rectangle Drop Zone.\r\n * The rectangle is centered on this Zones `x` and `y` coordinates.\r\n *\r\n * @method Phaser.GameObjects.Zone#setRectangleDropZone\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of the rectangle drop zone.\r\n * @param {number} height - The height of the rectangle drop zone.\r\n *\r\n * @return {Phaser.GameObjects.Zone} This Game Object.\r\n */\r\n setRectangleDropZone: function (width, height)\r\n {\r\n return this.setDropZone(new Rectangle(0, 0, width, height), RectangleContains);\r\n },\r\n\r\n /**\r\n * Allows you to define your own Geometry shape to be used as a Drop Zone.\r\n *\r\n * @method Phaser.GameObjects.Zone#setDropZone\r\n * @since 3.0.0\r\n *\r\n * @param {object} shape - A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape.\r\n * @param {Phaser.Types.Input.HitAreaCallback} callback - A function that will return `true` if the given x/y coords it is sent are within the shape.\r\n *\r\n * @return {Phaser.GameObjects.Zone} This Game Object.\r\n */\r\n setDropZone: function (shape, callback)\r\n {\r\n if (shape === undefined)\r\n {\r\n this.setRectangleDropZone(this.width, this.height);\r\n }\r\n else if (!this.input)\r\n {\r\n this.setInteractive(shape, callback, true);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * A NOOP method so you can pass a Zone to a Container.\r\n * Calling this method will do nothing. It is intentionally empty.\r\n *\r\n * @method Phaser.GameObjects.Zone#setAlpha\r\n * @private\r\n * @since 3.11.0\r\n */\r\n setAlpha: function ()\r\n {\r\n },\r\n \r\n /**\r\n * A NOOP method so you can pass a Zone to a Container in Canvas.\r\n * Calling this method will do nothing. It is intentionally empty.\r\n *\r\n * @method Phaser.GameObjects.Zone#setBlendMode\r\n * @private\r\n * @since 3.16.2\r\n */\r\n setBlendMode: function ()\r\n {\r\n },\r\n\r\n /**\r\n * A Zone does not render.\r\n *\r\n * @method Phaser.GameObjects.Zone#renderCanvas\r\n * @private\r\n * @since 3.0.0\r\n */\r\n renderCanvas: function ()\r\n {\r\n },\r\n\r\n /**\r\n * A Zone does not render.\r\n *\r\n * @method Phaser.GameObjects.Zone#renderWebGL\r\n * @private\r\n * @since 3.0.0\r\n */\r\n renderWebGL: function ()\r\n {\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Zone;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/zone/Zone.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/zone/ZoneCreator.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/zone/ZoneCreator.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectCreator = __webpack_require__(/*! ../GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar Zone = __webpack_require__(/*! ./Zone */ \"./node_modules/phaser/src/gameobjects/zone/Zone.js\");\r\n\r\n/**\r\n * Creates a new Zone Game Object and returns it.\r\n *\r\n * Note: This method will only be available if the Zone Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#zone\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - The configuration object this Game Object will use to create itself.\r\n *\r\n * @return {Phaser.GameObjects.Zone} The Game Object that was created.\r\n */\r\nGameObjectCreator.register('zone', function (config)\r\n{\r\n var x = GetAdvancedValue(config, 'x', 0);\r\n var y = GetAdvancedValue(config, 'y', 0);\r\n var width = GetAdvancedValue(config, 'width', 1);\r\n var height = GetAdvancedValue(config, 'height', width);\r\n\r\n return new Zone(this.scene, x, y, width, height);\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectCreator context.\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/zone/ZoneCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/gameobjects/zone/ZoneFactory.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/gameobjects/zone/ZoneFactory.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Zone = __webpack_require__(/*! ./Zone */ \"./node_modules/phaser/src/gameobjects/zone/Zone.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\n\r\n/**\r\n * Creates a new Zone Game Object and adds it to the Scene.\r\n *\r\n * Note: This method will only be available if the Zone Game Object has been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#zone\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {number} width - The width of the Game Object.\r\n * @param {number} height - The height of the Game Object.\r\n * \r\n * @return {Phaser.GameObjects.Zone} The Game Object that was created.\r\n */\r\nGameObjectFactory.register('zone', function (x, y, width, height)\r\n{\r\n return this.displayList.add(new Zone(this.scene, x, y, width, height));\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n// \r\n// There are several properties available to use:\r\n// \r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/gameobjects/zone/ZoneFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/Area.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/Area.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the area of the circle.\r\n *\r\n * @function Phaser.Geom.Circle.Area\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The Circle to get the area of.\r\n *\r\n * @return {number} The area of the Circle.\r\n */\r\nvar Area = function (circle)\r\n{\r\n return (circle.radius > 0) ? Math.PI * circle.radius * circle.radius : 0;\r\n};\r\n\r\nmodule.exports = Area;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/Area.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/Circle.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/Circle.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/circle/Contains.js\");\r\nvar GetPoint = __webpack_require__(/*! ./GetPoint */ \"./node_modules/phaser/src/geom/circle/GetPoint.js\");\r\nvar GetPoints = __webpack_require__(/*! ./GetPoints */ \"./node_modules/phaser/src/geom/circle/GetPoints.js\");\r\nvar GEOM_CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/geom/const.js\");\r\nvar Random = __webpack_require__(/*! ./Random */ \"./node_modules/phaser/src/geom/circle/Random.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Circle object.\r\n *\r\n * This is a geometry object, containing numerical values and related methods to inspect and modify them.\r\n * It is not a Game Object, in that you cannot add it to the display list, and it has no texture.\r\n * To render a Circle you should look at the capabilities of the Graphics class.\r\n *\r\n * @class Circle\r\n * @memberof Phaser.Geom\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The x position of the center of the circle.\r\n * @param {number} [y=0] - The y position of the center of the circle.\r\n * @param {number} [radius=0] - The radius of the circle.\r\n */\r\nvar Circle = new Class({\r\n\r\n initialize:\r\n\r\n function Circle (x, y, radius)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (radius === undefined) { radius = 0; }\r\n\r\n /**\r\n * The geometry constant type of this object: `GEOM_CONST.CIRCLE`.\r\n * Used for fast type comparisons.\r\n *\r\n * @name Phaser.Geom.Circle#type\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.type = GEOM_CONST.CIRCLE;\r\n\r\n /**\r\n * The x position of the center of the circle.\r\n *\r\n * @name Phaser.Geom.Circle#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = x;\r\n\r\n /**\r\n * The y position of the center of the circle.\r\n *\r\n * @name Phaser.Geom.Circle#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = y;\r\n\r\n /**\r\n * The internal radius of the circle.\r\n *\r\n * @name Phaser.Geom.Circle#_radius\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._radius = radius;\r\n\r\n /**\r\n * The internal diameter of the circle.\r\n *\r\n * @name Phaser.Geom.Circle#_diameter\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._diameter = radius * 2;\r\n },\r\n\r\n /**\r\n * Check to see if the Circle contains the given x / y coordinates.\r\n *\r\n * @method Phaser.Geom.Circle#contains\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate to check within the circle.\r\n * @param {number} y - The y coordinate to check within the circle.\r\n *\r\n * @return {boolean} True if the coordinates are within the circle, otherwise false.\r\n */\r\n contains: function (x, y)\r\n {\r\n return Contains(this, x, y);\r\n },\r\n\r\n /**\r\n * Returns a Point object containing the coordinates of a point on the circumference of the Circle\r\n * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point\r\n * at 180 degrees around the circle.\r\n *\r\n * @method Phaser.Geom.Circle#getPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {number} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle.\r\n * @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the circle.\r\n */\r\n getPoint: function (position, point)\r\n {\r\n return GetPoint(this, position, point);\r\n },\r\n\r\n /**\r\n * Returns an array of Point objects containing the coordinates of the points around the circumference of the Circle,\r\n * based on the given quantity or stepRate values.\r\n *\r\n * @method Phaser.Geom.Circle#getPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point[]} O - [output,$return]\r\n *\r\n * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead.\r\n * @param {number} [stepRate] - Sets the quantity by getting the circumference of the circle and dividing it by the stepRate.\r\n * @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created.\r\n *\r\n * @return {(array|Phaser.Geom.Point[])} An array of Point objects pertaining to the points around the circumference of the circle.\r\n */\r\n getPoints: function (quantity, stepRate, output)\r\n {\r\n return GetPoints(this, quantity, stepRate, output);\r\n },\r\n\r\n /**\r\n * Returns a uniformly distributed random point from anywhere within the Circle.\r\n *\r\n * @method Phaser.Geom.Circle#getRandomPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [point,$return]\r\n *\r\n * @param {(Phaser.Geom.Point|object)} [point] - A Point or point-like object to set the random `x` and `y` values in.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties.\r\n */\r\n getRandomPoint: function (point)\r\n {\r\n return Random(this, point);\r\n },\r\n\r\n /**\r\n * Sets the x, y and radius of this circle.\r\n *\r\n * @method Phaser.Geom.Circle#setTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The x position of the center of the circle.\r\n * @param {number} [y=0] - The y position of the center of the circle.\r\n * @param {number} [radius=0] - The radius of the circle.\r\n *\r\n * @return {Phaser.Geom.Circle} This Circle object.\r\n */\r\n setTo: function (x, y, radius)\r\n {\r\n this.x = x;\r\n this.y = y;\r\n this._radius = radius;\r\n this._diameter = radius * 2;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets this Circle to be empty with a radius of zero.\r\n * Does not change its position.\r\n *\r\n * @method Phaser.Geom.Circle#setEmpty\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Geom.Circle} This Circle object.\r\n */\r\n setEmpty: function ()\r\n {\r\n this._radius = 0;\r\n this._diameter = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the position of this Circle.\r\n *\r\n * @method Phaser.Geom.Circle#setPosition\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The x position of the center of the circle.\r\n * @param {number} [y=0] - The y position of the center of the circle.\r\n *\r\n * @return {Phaser.Geom.Circle} This Circle object.\r\n */\r\n setPosition: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Checks to see if the Circle is empty: has a radius of zero.\r\n *\r\n * @method Phaser.Geom.Circle#isEmpty\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} True if the Circle is empty, otherwise false.\r\n */\r\n isEmpty: function ()\r\n {\r\n return (this._radius <= 0);\r\n },\r\n\r\n /**\r\n * The radius of the Circle.\r\n *\r\n * @name Phaser.Geom.Circle#radius\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n radius: {\r\n\r\n get: function ()\r\n {\r\n return this._radius;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._radius = value;\r\n this._diameter = value * 2;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The diameter of the Circle.\r\n *\r\n * @name Phaser.Geom.Circle#diameter\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n diameter: {\r\n\r\n get: function ()\r\n {\r\n return this._diameter;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._diameter = value;\r\n this._radius = value * 0.5;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The left position of the Circle.\r\n *\r\n * @name Phaser.Geom.Circle#left\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n left: {\r\n\r\n get: function ()\r\n {\r\n return this.x - this._radius;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.x = value + this._radius;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The right position of the Circle.\r\n *\r\n * @name Phaser.Geom.Circle#right\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n right: {\r\n\r\n get: function ()\r\n {\r\n return this.x + this._radius;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.x = value - this._radius;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The top position of the Circle.\r\n *\r\n * @name Phaser.Geom.Circle#top\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n top: {\r\n\r\n get: function ()\r\n {\r\n return this.y - this._radius;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.y = value + this._radius;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The bottom position of the Circle.\r\n *\r\n * @name Phaser.Geom.Circle#bottom\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bottom: {\r\n\r\n get: function ()\r\n {\r\n return this.y + this._radius;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.y = value - this._radius;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Circle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/Circle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/Circumference.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/Circumference.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns the circumference of the given Circle.\r\n *\r\n * @function Phaser.Geom.Circle.Circumference\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The Circle to get the circumference of.\r\n *\r\n * @return {number} The circumference of the Circle.\r\n */\r\nvar Circumference = function (circle)\r\n{\r\n return 2 * (Math.PI * circle.radius);\r\n};\r\n\r\nmodule.exports = Circumference;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/Circumference.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/CircumferencePoint.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/CircumferencePoint.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Returns a Point object containing the coordinates of a point on the circumference of the Circle based on the given angle.\r\n *\r\n * @function Phaser.Geom.Circle.CircumferencePoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The Circle to get the circumference point on.\r\n * @param {number} angle - The angle from the center of the Circle to the circumference to return the point from. Given in radians.\r\n * @param {(Phaser.Geom.Point|object)} [out] - A Point, or point-like object, to store the results in. If not given a Point will be created.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} A Point object where the `x` and `y` properties are the point on the circumference.\r\n */\r\nvar CircumferencePoint = function (circle, angle, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n out.x = circle.x + (circle.radius * Math.cos(angle));\r\n out.y = circle.y + (circle.radius * Math.sin(angle));\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = CircumferencePoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/CircumferencePoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/Clone.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/Clone.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Circle = __webpack_require__(/*! ./Circle */ \"./node_modules/phaser/src/geom/circle/Circle.js\");\r\n\r\n/**\r\n * Creates a new Circle instance based on the values contained in the given source.\r\n *\r\n * @function Phaser.Geom.Circle.Clone\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Circle|object)} source - The Circle to be cloned. Can be an instance of a Circle or a circle-like object, with x, y and radius properties.\r\n *\r\n * @return {Phaser.Geom.Circle} A clone of the source Circle.\r\n */\r\nvar Clone = function (source)\r\n{\r\n return new Circle(source.x, source.y, source.radius);\r\n};\r\n\r\nmodule.exports = Clone;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/Clone.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/Contains.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/Contains.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check to see if the Circle contains the given x / y coordinates.\r\n *\r\n * @function Phaser.Geom.Circle.Contains\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The Circle to check.\r\n * @param {number} x - The x coordinate to check within the circle.\r\n * @param {number} y - The y coordinate to check within the circle.\r\n *\r\n * @return {boolean} True if the coordinates are within the circle, otherwise false.\r\n */\r\nvar Contains = function (circle, x, y)\r\n{\r\n // Check if x/y are within the bounds first\r\n if (circle.radius > 0 && x >= circle.left && x <= circle.right && y >= circle.top && y <= circle.bottom)\r\n {\r\n var dx = (circle.x - x) * (circle.x - x);\r\n var dy = (circle.y - y) * (circle.y - y);\r\n\r\n return (dx + dy) <= (circle.radius * circle.radius);\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n};\r\n\r\nmodule.exports = Contains;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/Contains.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/ContainsPoint.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/ContainsPoint.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/circle/Contains.js\");\r\n\r\n/**\r\n * Check to see if the Circle contains the given Point object.\r\n *\r\n * @function Phaser.Geom.Circle.ContainsPoint\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The Circle to check.\r\n * @param {(Phaser.Geom.Point|object)} point - The Point object to check if it's within the Circle or not.\r\n *\r\n * @return {boolean} True if the Point coordinates are within the circle, otherwise false.\r\n */\r\nvar ContainsPoint = function (circle, point)\r\n{\r\n return Contains(circle, point.x, point.y);\r\n};\r\n\r\nmodule.exports = ContainsPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/ContainsPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/ContainsRect.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/ContainsRect.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/circle/Contains.js\");\r\n\r\n/**\r\n * Check to see if the Circle contains all four points of the given Rectangle object.\r\n *\r\n * @function Phaser.Geom.Circle.ContainsRect\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The Circle to check.\r\n * @param {(Phaser.Geom.Rectangle|object)} rect - The Rectangle object to check if it's within the Circle or not.\r\n *\r\n * @return {boolean} True if all of the Rectangle coordinates are within the circle, otherwise false.\r\n */\r\nvar ContainsRect = function (circle, rect)\r\n{\r\n return (\r\n Contains(circle, rect.x, rect.y) &&\r\n Contains(circle, rect.right, rect.y) &&\r\n Contains(circle, rect.x, rect.bottom) &&\r\n Contains(circle, rect.right, rect.bottom)\r\n );\r\n};\r\n\r\nmodule.exports = ContainsRect;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/ContainsRect.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/CopyFrom.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/CopyFrom.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Copies the `x`, `y` and `radius` properties from the `source` Circle\r\n * into the given `dest` Circle, then returns the `dest` Circle.\r\n *\r\n * @function Phaser.Geom.Circle.CopyFrom\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Circle} O - [dest,$return]\r\n *\r\n * @param {Phaser.Geom.Circle} source - The source Circle to copy the values from.\r\n * @param {Phaser.Geom.Circle} dest - The destination Circle to copy the values to.\r\n *\r\n * @return {Phaser.Geom.Circle} The destination Circle.\r\n */\r\nvar CopyFrom = function (source, dest)\r\n{\r\n return dest.setTo(source.x, source.y, source.radius);\r\n};\r\n\r\nmodule.exports = CopyFrom;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/CopyFrom.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/Equals.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/Equals.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compares the `x`, `y` and `radius` properties of the two given Circles.\r\n * Returns `true` if they all match, otherwise returns `false`.\r\n *\r\n * @function Phaser.Geom.Circle.Equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The first Circle to compare.\r\n * @param {Phaser.Geom.Circle} toCompare - The second Circle to compare.\r\n *\r\n * @return {boolean} `true` if the two Circles equal each other, otherwise `false`.\r\n */\r\nvar Equals = function (circle, toCompare)\r\n{\r\n return (\r\n circle.x === toCompare.x &&\r\n circle.y === toCompare.y &&\r\n circle.radius === toCompare.radius\r\n );\r\n};\r\n\r\nmodule.exports = Equals;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/Equals.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/GetBounds.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/GetBounds.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Rectangle = __webpack_require__(/*! ../rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\n\r\n/**\r\n * Returns the bounds of the Circle object.\r\n *\r\n * @function Phaser.Geom.Circle.GetBounds\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The Circle to get the bounds from.\r\n * @param {(Phaser.Geom.Rectangle|object)} [out] - A Rectangle, or rectangle-like object, to store the circle bounds in. If not given a new Rectangle will be created.\r\n *\r\n * @return {(Phaser.Geom.Rectangle|object)} The Rectangle object containing the Circles bounds.\r\n */\r\nvar GetBounds = function (circle, out)\r\n{\r\n if (out === undefined) { out = new Rectangle(); }\r\n\r\n out.x = circle.left;\r\n out.y = circle.top;\r\n out.width = circle.diameter;\r\n out.height = circle.diameter;\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetBounds;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/GetBounds.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/GetPoint.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/GetPoint.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CircumferencePoint = __webpack_require__(/*! ./CircumferencePoint */ \"./node_modules/phaser/src/geom/circle/CircumferencePoint.js\");\r\nvar FromPercent = __webpack_require__(/*! ../../math/FromPercent */ \"./node_modules/phaser/src/math/FromPercent.js\");\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Returns a Point object containing the coordinates of a point on the circumference of the Circle\r\n * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point\r\n * at 180 degrees around the circle.\r\n *\r\n * @function Phaser.Geom.Circle.GetPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The Circle to get the circumference point on.\r\n * @param {number} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle.\r\n * @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the circle.\r\n */\r\nvar GetPoint = function (circle, position, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n var angle = FromPercent(position, 0, MATH_CONST.PI2);\r\n\r\n return CircumferencePoint(circle, angle, out);\r\n};\r\n\r\nmodule.exports = GetPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/GetPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/GetPoints.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/GetPoints.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Circumference = __webpack_require__(/*! ./Circumference */ \"./node_modules/phaser/src/geom/circle/Circumference.js\");\r\nvar CircumferencePoint = __webpack_require__(/*! ./CircumferencePoint */ \"./node_modules/phaser/src/geom/circle/CircumferencePoint.js\");\r\nvar FromPercent = __webpack_require__(/*! ../../math/FromPercent */ \"./node_modules/phaser/src/math/FromPercent.js\");\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\n\r\n/**\r\n * Returns an array of Point objects containing the coordinates of the points around the circumference of the Circle,\r\n * based on the given quantity or stepRate values.\r\n *\r\n * @function Phaser.Geom.Circle.GetPoints\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The Circle to get the points from.\r\n * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead.\r\n * @param {number} [stepRate] - Sets the quantity by getting the circumference of the circle and dividing it by the stepRate.\r\n * @param {array} [output] - An array to insert the points in to. If not provided a new array will be created.\r\n *\r\n * @return {Phaser.Geom.Point[]} An array of Point objects pertaining to the points around the circumference of the circle.\r\n */\r\nvar GetPoints = function (circle, quantity, stepRate, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.\r\n if (!quantity)\r\n {\r\n quantity = Circumference(circle) / stepRate;\r\n }\r\n\r\n for (var i = 0; i < quantity; i++)\r\n {\r\n var angle = FromPercent(i / quantity, 0, MATH_CONST.PI2);\r\n\r\n out.push(CircumferencePoint(circle, angle));\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetPoints;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/GetPoints.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/Offset.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/Offset.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Offsets the Circle by the values given.\r\n *\r\n * @function Phaser.Geom.Circle.Offset\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Circle} O - [circle,$return]\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The Circle to be offset (translated.)\r\n * @param {number} x - The amount to horizontally offset the Circle by.\r\n * @param {number} y - The amount to vertically offset the Circle by.\r\n *\r\n * @return {Phaser.Geom.Circle} The Circle that was offset.\r\n */\r\nvar Offset = function (circle, x, y)\r\n{\r\n circle.x += x;\r\n circle.y += y;\r\n\r\n return circle;\r\n};\r\n\r\nmodule.exports = Offset;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/Offset.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/OffsetPoint.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/OffsetPoint.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Offsets the Circle by the values given in the `x` and `y` properties of the Point object.\r\n *\r\n * @function Phaser.Geom.Circle.OffsetPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Circle} O - [circle,$return]\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The Circle to be offset (translated.)\r\n * @param {(Phaser.Geom.Point|object)} point - The Point object containing the values to offset the Circle by.\r\n *\r\n * @return {Phaser.Geom.Circle} The Circle that was offset.\r\n */\r\nvar OffsetPoint = function (circle, point)\r\n{\r\n circle.x += point.x;\r\n circle.y += point.y;\r\n\r\n return circle;\r\n};\r\n\r\nmodule.exports = OffsetPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/OffsetPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/Random.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/Random.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Returns a uniformly distributed random point from anywhere within the given Circle.\r\n *\r\n * @function Phaser.Geom.Circle.Random\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The Circle to get a random point from.\r\n * @param {(Phaser.Geom.Point|object)} [out] - A Point or point-like object to set the random `x` and `y` values in.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties.\r\n */\r\nvar Random = function (circle, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n var t = 2 * Math.PI * Math.random();\r\n var u = Math.random() + Math.random();\r\n var r = (u > 1) ? 2 - u : u;\r\n var x = r * Math.cos(t);\r\n var y = r * Math.sin(t);\r\n\r\n out.x = circle.x + (x * circle.radius);\r\n out.y = circle.y + (y * circle.radius);\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = Random;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/Random.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/circle/index.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/geom/circle/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Circle = __webpack_require__(/*! ./Circle */ \"./node_modules/phaser/src/geom/circle/Circle.js\");\r\n\r\nCircle.Area = __webpack_require__(/*! ./Area */ \"./node_modules/phaser/src/geom/circle/Area.js\");\r\nCircle.Circumference = __webpack_require__(/*! ./Circumference */ \"./node_modules/phaser/src/geom/circle/Circumference.js\");\r\nCircle.CircumferencePoint = __webpack_require__(/*! ./CircumferencePoint */ \"./node_modules/phaser/src/geom/circle/CircumferencePoint.js\");\r\nCircle.Clone = __webpack_require__(/*! ./Clone */ \"./node_modules/phaser/src/geom/circle/Clone.js\");\r\nCircle.Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/circle/Contains.js\");\r\nCircle.ContainsPoint = __webpack_require__(/*! ./ContainsPoint */ \"./node_modules/phaser/src/geom/circle/ContainsPoint.js\");\r\nCircle.ContainsRect = __webpack_require__(/*! ./ContainsRect */ \"./node_modules/phaser/src/geom/circle/ContainsRect.js\");\r\nCircle.CopyFrom = __webpack_require__(/*! ./CopyFrom */ \"./node_modules/phaser/src/geom/circle/CopyFrom.js\");\r\nCircle.Equals = __webpack_require__(/*! ./Equals */ \"./node_modules/phaser/src/geom/circle/Equals.js\");\r\nCircle.GetBounds = __webpack_require__(/*! ./GetBounds */ \"./node_modules/phaser/src/geom/circle/GetBounds.js\");\r\nCircle.GetPoint = __webpack_require__(/*! ./GetPoint */ \"./node_modules/phaser/src/geom/circle/GetPoint.js\");\r\nCircle.GetPoints = __webpack_require__(/*! ./GetPoints */ \"./node_modules/phaser/src/geom/circle/GetPoints.js\");\r\nCircle.Offset = __webpack_require__(/*! ./Offset */ \"./node_modules/phaser/src/geom/circle/Offset.js\");\r\nCircle.OffsetPoint = __webpack_require__(/*! ./OffsetPoint */ \"./node_modules/phaser/src/geom/circle/OffsetPoint.js\");\r\nCircle.Random = __webpack_require__(/*! ./Random */ \"./node_modules/phaser/src/geom/circle/Random.js\");\r\n\r\nmodule.exports = Circle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/circle/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/const.js": /*!***********************************************!*\ !*** ./node_modules/phaser/src/geom/const.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GEOM_CONST = {\r\n\r\n /**\r\n * A Circle Geometry object type.\r\n * \r\n * @name Phaser.Geom.CIRCLE\r\n * @type {integer}\r\n * @since 3.19.0\r\n */\r\n CIRCLE: 0,\r\n\r\n /**\r\n * An Ellipse Geometry object type.\r\n * \r\n * @name Phaser.Geom.ELLIPSE\r\n * @type {integer}\r\n * @since 3.19.0\r\n */\r\n ELLIPSE: 1,\r\n\r\n /**\r\n * A Line Geometry object type.\r\n * \r\n * @name Phaser.Geom.LINE\r\n * @type {integer}\r\n * @since 3.19.0\r\n */\r\n LINE: 2,\r\n\r\n /**\r\n * A Point Geometry object type.\r\n * \r\n * @name Phaser.Geom.POINT\r\n * @type {integer}\r\n * @since 3.19.0\r\n */\r\n POINT: 3,\r\n\r\n /**\r\n * A Polygon Geometry object type.\r\n * \r\n * @name Phaser.Geom.POLYGON\r\n * @type {integer}\r\n * @since 3.19.0\r\n */\r\n POLYGON: 4,\r\n\r\n /**\r\n * A Rectangle Geometry object type.\r\n * \r\n * @name Phaser.Geom.RECTANGLE\r\n * @type {integer}\r\n * @since 3.19.0\r\n */\r\n RECTANGLE: 5,\r\n\r\n /**\r\n * A Triangle Geometry object type.\r\n * \r\n * @name Phaser.Geom.TRIANGLE\r\n * @type {integer}\r\n * @since 3.19.0\r\n */\r\n TRIANGLE: 6\r\n\r\n};\r\n\r\nmodule.exports = GEOM_CONST;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/const.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/Area.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/Area.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the area of the Ellipse.\r\n *\r\n * @function Phaser.Geom.Ellipse.Area\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the area of.\r\n *\r\n * @return {number} The area of the Ellipse.\r\n */\r\nvar Area = function (ellipse)\r\n{\r\n if (ellipse.isEmpty())\r\n {\r\n return 0;\r\n }\r\n\r\n // units squared\r\n return (ellipse.getMajorRadius() * ellipse.getMinorRadius() * Math.PI);\r\n};\r\n\r\nmodule.exports = Area;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/Area.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/Circumference.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/Circumference.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns the circumference of the given Ellipse.\r\n *\r\n * @function Phaser.Geom.Ellipse.Circumference\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the circumference of.\r\n *\r\n * @return {number} The circumference of th Ellipse.\r\n */\r\nvar Circumference = function (ellipse)\r\n{\r\n var rx = ellipse.width / 2;\r\n var ry = ellipse.height / 2;\r\n var h = Math.pow((rx - ry), 2) / Math.pow((rx + ry), 2);\r\n\r\n return (Math.PI * (rx + ry)) * (1 + ((3 * h) / (10 + Math.sqrt(4 - (3 * h)))));\r\n};\r\n\r\nmodule.exports = Circumference;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/Circumference.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/CircumferencePoint.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/CircumferencePoint.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse based on the given angle.\r\n *\r\n * @function Phaser.Geom.Ellipse.CircumferencePoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the circumference point on.\r\n * @param {number} angle - The angle from the center of the Ellipse to the circumference to return the point from. Given in radians.\r\n * @param {(Phaser.Geom.Point|object)} [out] - A Point, or point-like object, to store the results in. If not given a Point will be created.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} A Point object where the `x` and `y` properties are the point on the circumference.\r\n */\r\nvar CircumferencePoint = function (ellipse, angle, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n var halfWidth = ellipse.width / 2;\r\n var halfHeight = ellipse.height / 2;\r\n\r\n out.x = ellipse.x + halfWidth * Math.cos(angle);\r\n out.y = ellipse.y + halfHeight * Math.sin(angle);\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = CircumferencePoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/CircumferencePoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/Clone.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/Clone.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Ellipse = __webpack_require__(/*! ./Ellipse */ \"./node_modules/phaser/src/geom/ellipse/Ellipse.js\");\r\n\r\n/**\r\n * Creates a new Ellipse instance based on the values contained in the given source.\r\n *\r\n * @function Phaser.Geom.Ellipse.Clone\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Ellipse} source - The Ellipse to be cloned. Can be an instance of an Ellipse or a ellipse-like object, with x, y, width and height properties.\r\n *\r\n * @return {Phaser.Geom.Ellipse} A clone of the source Ellipse.\r\n */\r\nvar Clone = function (source)\r\n{\r\n return new Ellipse(source.x, source.y, source.width, source.height);\r\n};\r\n\r\nmodule.exports = Clone;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/Clone.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/Contains.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/Contains.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check to see if the Ellipse contains the given x / y coordinates.\r\n *\r\n * @function Phaser.Geom.Ellipse.Contains\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to check.\r\n * @param {number} x - The x coordinate to check within the ellipse.\r\n * @param {number} y - The y coordinate to check within the ellipse.\r\n *\r\n * @return {boolean} True if the coordinates are within the ellipse, otherwise false.\r\n */\r\nvar Contains = function (ellipse, x, y)\r\n{\r\n if (ellipse.width <= 0 || ellipse.height <= 0)\r\n {\r\n return false;\r\n }\r\n\r\n // Normalize the coords to an ellipse with center 0,0 and a radius of 0.5\r\n var normx = ((x - ellipse.x) / ellipse.width);\r\n var normy = ((y - ellipse.y) / ellipse.height);\r\n\r\n normx *= normx;\r\n normy *= normy;\r\n\r\n return (normx + normy < 0.25);\r\n};\r\n\r\nmodule.exports = Contains;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/Contains.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/ContainsPoint.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/ContainsPoint.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/ellipse/Contains.js\");\r\n\r\n/**\r\n * Check to see if the Ellipse contains the given Point object.\r\n *\r\n * @function Phaser.Geom.Ellipse.ContainsPoint\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to check.\r\n * @param {(Phaser.Geom.Point|object)} point - The Point object to check if it's within the Circle or not.\r\n *\r\n * @return {boolean} True if the Point coordinates are within the circle, otherwise false.\r\n */\r\nvar ContainsPoint = function (ellipse, point)\r\n{\r\n return Contains(ellipse, point.x, point.y);\r\n};\r\n\r\nmodule.exports = ContainsPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/ContainsPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/ContainsRect.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/ContainsRect.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/ellipse/Contains.js\");\r\n\r\n/**\r\n * Check to see if the Ellipse contains all four points of the given Rectangle object.\r\n *\r\n * @function Phaser.Geom.Ellipse.ContainsRect\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to check.\r\n * @param {(Phaser.Geom.Rectangle|object)} rect - The Rectangle object to check if it's within the Ellipse or not.\r\n *\r\n * @return {boolean} True if all of the Rectangle coordinates are within the ellipse, otherwise false.\r\n */\r\nvar ContainsRect = function (ellipse, rect)\r\n{\r\n return (\r\n Contains(ellipse, rect.x, rect.y) &&\r\n Contains(ellipse, rect.right, rect.y) &&\r\n Contains(ellipse, rect.x, rect.bottom) &&\r\n Contains(ellipse, rect.right, rect.bottom)\r\n );\r\n};\r\n\r\nmodule.exports = ContainsRect;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/ContainsRect.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/CopyFrom.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/CopyFrom.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Copies the `x`, `y`, `width` and `height` properties from the `source` Ellipse\r\n * into the given `dest` Ellipse, then returns the `dest` Ellipse.\r\n *\r\n * @function Phaser.Geom.Ellipse.CopyFrom\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Ellipse} O - [dest,$return]\r\n *\r\n * @param {Phaser.Geom.Ellipse} source - The source Ellipse to copy the values from.\r\n * @param {Phaser.Geom.Ellipse} dest - The destination Ellipse to copy the values to.\r\n *\r\n * @return {Phaser.Geom.Ellipse} The destination Ellipse.\r\n */\r\nvar CopyFrom = function (source, dest)\r\n{\r\n return dest.setTo(source.x, source.y, source.width, source.height);\r\n};\r\n\r\nmodule.exports = CopyFrom;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/CopyFrom.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/Ellipse.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/Ellipse.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/ellipse/Contains.js\");\r\nvar GetPoint = __webpack_require__(/*! ./GetPoint */ \"./node_modules/phaser/src/geom/ellipse/GetPoint.js\");\r\nvar GetPoints = __webpack_require__(/*! ./GetPoints */ \"./node_modules/phaser/src/geom/ellipse/GetPoints.js\");\r\nvar GEOM_CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/geom/const.js\");\r\nvar Random = __webpack_require__(/*! ./Random */ \"./node_modules/phaser/src/geom/ellipse/Random.js\");\r\n\r\n/**\r\n * @classdesc\r\n * An Ellipse object.\r\n *\r\n * This is a geometry object, containing numerical values and related methods to inspect and modify them.\r\n * It is not a Game Object, in that you cannot add it to the display list, and it has no texture.\r\n * To render an Ellipse you should look at the capabilities of the Graphics class.\r\n *\r\n * @class Ellipse\r\n * @memberof Phaser.Geom\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The x position of the center of the ellipse.\r\n * @param {number} [y=0] - The y position of the center of the ellipse.\r\n * @param {number} [width=0] - The width of the ellipse.\r\n * @param {number} [height=0] - The height of the ellipse.\r\n */\r\nvar Ellipse = new Class({\r\n\r\n initialize:\r\n\r\n function Ellipse (x, y, width, height)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = 0; }\r\n if (height === undefined) { height = 0; }\r\n\r\n /**\r\n * The geometry constant type of this object: `GEOM_CONST.ELLIPSE`.\r\n * Used for fast type comparisons.\r\n *\r\n * @name Phaser.Geom.Ellipse#type\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.type = GEOM_CONST.ELLIPSE;\r\n\r\n /**\r\n * The x position of the center of the ellipse.\r\n *\r\n * @name Phaser.Geom.Ellipse#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = x;\r\n\r\n /**\r\n * The y position of the center of the ellipse.\r\n *\r\n * @name Phaser.Geom.Ellipse#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = y;\r\n\r\n /**\r\n * The width of the ellipse.\r\n *\r\n * @name Phaser.Geom.Ellipse#width\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.width = width;\r\n\r\n /**\r\n * The height of the ellipse.\r\n *\r\n * @name Phaser.Geom.Ellipse#height\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.height = height;\r\n },\r\n\r\n /**\r\n * Check to see if the Ellipse contains the given x / y coordinates.\r\n *\r\n * @method Phaser.Geom.Ellipse#contains\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate to check within the ellipse.\r\n * @param {number} y - The y coordinate to check within the ellipse.\r\n *\r\n * @return {boolean} True if the coordinates are within the ellipse, otherwise false.\r\n */\r\n contains: function (x, y)\r\n {\r\n return Contains(this, x, y);\r\n },\r\n\r\n /**\r\n * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse\r\n * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point\r\n * at 180 degrees around the circle.\r\n *\r\n * @method Phaser.Geom.Ellipse#getPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {number} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the ellipse.\r\n * @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the ellipse.\r\n */\r\n getPoint: function (position, point)\r\n {\r\n return GetPoint(this, position, point);\r\n },\r\n\r\n /**\r\n * Returns an array of Point objects containing the coordinates of the points around the circumference of the Ellipse,\r\n * based on the given quantity or stepRate values.\r\n *\r\n * @method Phaser.Geom.Ellipse#getPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point[]} O - [output,$return]\r\n *\r\n * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead.\r\n * @param {number} [stepRate] - Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate.\r\n * @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created.\r\n *\r\n * @return {(array|Phaser.Geom.Point[])} An array of Point objects pertaining to the points around the circumference of the ellipse.\r\n */\r\n getPoints: function (quantity, stepRate, output)\r\n {\r\n return GetPoints(this, quantity, stepRate, output);\r\n },\r\n\r\n /**\r\n * Returns a uniformly distributed random point from anywhere within the given Ellipse.\r\n *\r\n * @method Phaser.Geom.Ellipse#getRandomPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [point,$return]\r\n *\r\n * @param {(Phaser.Geom.Point|object)} [point] - A Point or point-like object to set the random `x` and `y` values in.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties.\r\n */\r\n getRandomPoint: function (point)\r\n {\r\n return Random(this, point);\r\n },\r\n\r\n /**\r\n * Sets the x, y, width and height of this ellipse.\r\n *\r\n * @method Phaser.Geom.Ellipse#setTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x position of the center of the ellipse.\r\n * @param {number} y - The y position of the center of the ellipse.\r\n * @param {number} width - The width of the ellipse.\r\n * @param {number} height - The height of the ellipse.\r\n *\r\n * @return {Phaser.Geom.Ellipse} This Ellipse object.\r\n */\r\n setTo: function (x, y, width, height)\r\n {\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets this Ellipse to be empty with a width and height of zero.\r\n * Does not change its position.\r\n *\r\n * @method Phaser.Geom.Ellipse#setEmpty\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Geom.Ellipse} This Ellipse object.\r\n */\r\n setEmpty: function ()\r\n {\r\n this.width = 0;\r\n this.height = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the position of this Ellipse.\r\n *\r\n * @method Phaser.Geom.Ellipse#setPosition\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x position of the center of the ellipse.\r\n * @param {number} y - The y position of the center of the ellipse.\r\n *\r\n * @return {Phaser.Geom.Ellipse} This Ellipse object.\r\n */\r\n setPosition: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the size of this Ellipse.\r\n * Does not change its position.\r\n *\r\n * @method Phaser.Geom.Ellipse#setSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of the ellipse.\r\n * @param {number} [height=width] - The height of the ellipse.\r\n *\r\n * @return {Phaser.Geom.Ellipse} This Ellipse object.\r\n */\r\n setSize: function (width, height)\r\n {\r\n if (height === undefined) { height = width; }\r\n\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Checks to see if the Ellipse is empty: has a width or height equal to zero.\r\n *\r\n * @method Phaser.Geom.Ellipse#isEmpty\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} True if the Ellipse is empty, otherwise false.\r\n */\r\n isEmpty: function ()\r\n {\r\n return (this.width <= 0 || this.height <= 0);\r\n },\r\n\r\n /**\r\n * Returns the minor radius of the ellipse. Also known as the Semi Minor Axis.\r\n *\r\n * @method Phaser.Geom.Ellipse#getMinorRadius\r\n * @since 3.0.0\r\n *\r\n * @return {number} The minor radius.\r\n */\r\n getMinorRadius: function ()\r\n {\r\n return Math.min(this.width, this.height) / 2;\r\n },\r\n\r\n /**\r\n * Returns the major radius of the ellipse. Also known as the Semi Major Axis.\r\n *\r\n * @method Phaser.Geom.Ellipse#getMajorRadius\r\n * @since 3.0.0\r\n *\r\n * @return {number} The major radius.\r\n */\r\n getMajorRadius: function ()\r\n {\r\n return Math.max(this.width, this.height) / 2;\r\n },\r\n\r\n /**\r\n * The left position of the Ellipse.\r\n *\r\n * @name Phaser.Geom.Ellipse#left\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n left: {\r\n\r\n get: function ()\r\n {\r\n return this.x - (this.width / 2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.x = value + (this.width / 2);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The right position of the Ellipse.\r\n *\r\n * @name Phaser.Geom.Ellipse#right\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n right: {\r\n\r\n get: function ()\r\n {\r\n return this.x + (this.width / 2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.x = value - (this.width / 2);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The top position of the Ellipse.\r\n *\r\n * @name Phaser.Geom.Ellipse#top\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n top: {\r\n\r\n get: function ()\r\n {\r\n return this.y - (this.height / 2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.y = value + (this.height / 2);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The bottom position of the Ellipse.\r\n *\r\n * @name Phaser.Geom.Ellipse#bottom\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bottom: {\r\n\r\n get: function ()\r\n {\r\n return this.y + (this.height / 2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.y = value - (this.height / 2);\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Ellipse;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/Ellipse.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/Equals.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/Equals.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compares the `x`, `y`, `width` and `height` properties of the two given Ellipses.\r\n * Returns `true` if they all match, otherwise returns `false`.\r\n *\r\n * @function Phaser.Geom.Ellipse.Equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Ellipse} ellipse - The first Ellipse to compare.\r\n * @param {Phaser.Geom.Ellipse} toCompare - The second Ellipse to compare.\r\n *\r\n * @return {boolean} `true` if the two Ellipse equal each other, otherwise `false`.\r\n */\r\nvar Equals = function (ellipse, toCompare)\r\n{\r\n return (\r\n ellipse.x === toCompare.x &&\r\n ellipse.y === toCompare.y &&\r\n ellipse.width === toCompare.width &&\r\n ellipse.height === toCompare.height\r\n );\r\n};\r\n\r\nmodule.exports = Equals;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/Equals.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/GetBounds.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/GetBounds.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Rectangle = __webpack_require__(/*! ../rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\n\r\n/**\r\n * Returns the bounds of the Ellipse object.\r\n *\r\n * @function Phaser.Geom.Ellipse.GetBounds\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the bounds from.\r\n * @param {(Phaser.Geom.Rectangle|object)} [out] - A Rectangle, or rectangle-like object, to store the ellipse bounds in. If not given a new Rectangle will be created.\r\n *\r\n * @return {(Phaser.Geom.Rectangle|object)} The Rectangle object containing the Ellipse bounds.\r\n */\r\nvar GetBounds = function (ellipse, out)\r\n{\r\n if (out === undefined) { out = new Rectangle(); }\r\n\r\n out.x = ellipse.left;\r\n out.y = ellipse.top;\r\n out.width = ellipse.width;\r\n out.height = ellipse.height;\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetBounds;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/GetBounds.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/GetPoint.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/GetPoint.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CircumferencePoint = __webpack_require__(/*! ./CircumferencePoint */ \"./node_modules/phaser/src/geom/ellipse/CircumferencePoint.js\");\r\nvar FromPercent = __webpack_require__(/*! ../../math/FromPercent */ \"./node_modules/phaser/src/math/FromPercent.js\");\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse\r\n * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point\r\n * at 180 degrees around the circle.\r\n *\r\n * @function Phaser.Geom.Ellipse.GetPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the circumference point on.\r\n * @param {number} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the ellipse.\r\n * @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the ellipse.\r\n */\r\nvar GetPoint = function (ellipse, position, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n var angle = FromPercent(position, 0, MATH_CONST.PI2);\r\n\r\n return CircumferencePoint(ellipse, angle, out);\r\n};\r\n\r\nmodule.exports = GetPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/GetPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/GetPoints.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/GetPoints.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Circumference = __webpack_require__(/*! ./Circumference */ \"./node_modules/phaser/src/geom/ellipse/Circumference.js\");\r\nvar CircumferencePoint = __webpack_require__(/*! ./CircumferencePoint */ \"./node_modules/phaser/src/geom/ellipse/CircumferencePoint.js\");\r\nvar FromPercent = __webpack_require__(/*! ../../math/FromPercent */ \"./node_modules/phaser/src/math/FromPercent.js\");\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\n\r\n/**\r\n * Returns an array of Point objects containing the coordinates of the points around the circumference of the Ellipse,\r\n * based on the given quantity or stepRate values.\r\n *\r\n * @function Phaser.Geom.Ellipse.GetPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point[]} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the points from.\r\n * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead.\r\n * @param {number} [stepRate] - Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate.\r\n * @param {(array|Phaser.Geom.Point[])} [out] - An array to insert the points in to. If not provided a new array will be created.\r\n *\r\n * @return {(array|Phaser.Geom.Point[])} An array of Point objects pertaining to the points around the circumference of the ellipse.\r\n */\r\nvar GetPoints = function (ellipse, quantity, stepRate, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.\r\n if (!quantity)\r\n {\r\n quantity = Circumference(ellipse) / stepRate;\r\n }\r\n\r\n for (var i = 0; i < quantity; i++)\r\n {\r\n var angle = FromPercent(i / quantity, 0, MATH_CONST.PI2);\r\n\r\n out.push(CircumferencePoint(ellipse, angle));\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetPoints;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/GetPoints.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/Offset.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/Offset.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Offsets the Ellipse by the values given.\r\n *\r\n * @function Phaser.Geom.Ellipse.Offset\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Ellipse} O - [ellipse,$return]\r\n *\r\n * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to be offset (translated.)\r\n * @param {number} x - The amount to horizontally offset the Ellipse by.\r\n * @param {number} y - The amount to vertically offset the Ellipse by.\r\n *\r\n * @return {Phaser.Geom.Ellipse} The Ellipse that was offset.\r\n */\r\nvar Offset = function (ellipse, x, y)\r\n{\r\n ellipse.x += x;\r\n ellipse.y += y;\r\n\r\n return ellipse;\r\n};\r\n\r\nmodule.exports = Offset;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/Offset.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/OffsetPoint.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/OffsetPoint.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Offsets the Ellipse by the values given in the `x` and `y` properties of the Point object.\r\n *\r\n * @function Phaser.Geom.Ellipse.OffsetPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Ellipse} O - [ellipse,$return]\r\n *\r\n * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to be offset (translated.)\r\n * @param {(Phaser.Geom.Point|object)} point - The Point object containing the values to offset the Ellipse by.\r\n *\r\n * @return {Phaser.Geom.Ellipse} The Ellipse that was offset.\r\n */\r\nvar OffsetPoint = function (ellipse, point)\r\n{\r\n ellipse.x += point.x;\r\n ellipse.y += point.y;\r\n\r\n return ellipse;\r\n};\r\n\r\nmodule.exports = OffsetPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/OffsetPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/Random.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/Random.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Returns a uniformly distributed random point from anywhere within the given Ellipse.\r\n *\r\n * @function Phaser.Geom.Ellipse.Random\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get a random point from.\r\n * @param {(Phaser.Geom.Point|object)} [out] - A Point or point-like object to set the random `x` and `y` values in.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties.\r\n */\r\nvar Random = function (ellipse, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n var p = Math.random() * Math.PI * 2;\r\n var s = Math.sqrt(Math.random());\r\n\r\n out.x = ellipse.x + ((s * Math.cos(p)) * ellipse.width / 2);\r\n out.y = ellipse.y + ((s * Math.sin(p)) * ellipse.height / 2);\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = Random;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/Random.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/ellipse/index.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/geom/ellipse/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Ellipse = __webpack_require__(/*! ./Ellipse */ \"./node_modules/phaser/src/geom/ellipse/Ellipse.js\");\r\n\r\nEllipse.Area = __webpack_require__(/*! ./Area */ \"./node_modules/phaser/src/geom/ellipse/Area.js\");\r\nEllipse.Circumference = __webpack_require__(/*! ./Circumference */ \"./node_modules/phaser/src/geom/ellipse/Circumference.js\");\r\nEllipse.CircumferencePoint = __webpack_require__(/*! ./CircumferencePoint */ \"./node_modules/phaser/src/geom/ellipse/CircumferencePoint.js\");\r\nEllipse.Clone = __webpack_require__(/*! ./Clone */ \"./node_modules/phaser/src/geom/ellipse/Clone.js\");\r\nEllipse.Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/ellipse/Contains.js\");\r\nEllipse.ContainsPoint = __webpack_require__(/*! ./ContainsPoint */ \"./node_modules/phaser/src/geom/ellipse/ContainsPoint.js\");\r\nEllipse.ContainsRect = __webpack_require__(/*! ./ContainsRect */ \"./node_modules/phaser/src/geom/ellipse/ContainsRect.js\");\r\nEllipse.CopyFrom = __webpack_require__(/*! ./CopyFrom */ \"./node_modules/phaser/src/geom/ellipse/CopyFrom.js\");\r\nEllipse.Equals = __webpack_require__(/*! ./Equals */ \"./node_modules/phaser/src/geom/ellipse/Equals.js\");\r\nEllipse.GetBounds = __webpack_require__(/*! ./GetBounds */ \"./node_modules/phaser/src/geom/ellipse/GetBounds.js\");\r\nEllipse.GetPoint = __webpack_require__(/*! ./GetPoint */ \"./node_modules/phaser/src/geom/ellipse/GetPoint.js\");\r\nEllipse.GetPoints = __webpack_require__(/*! ./GetPoints */ \"./node_modules/phaser/src/geom/ellipse/GetPoints.js\");\r\nEllipse.Offset = __webpack_require__(/*! ./Offset */ \"./node_modules/phaser/src/geom/ellipse/Offset.js\");\r\nEllipse.OffsetPoint = __webpack_require__(/*! ./OffsetPoint */ \"./node_modules/phaser/src/geom/ellipse/OffsetPoint.js\");\r\nEllipse.Random = __webpack_require__(/*! ./Random */ \"./node_modules/phaser/src/geom/ellipse/Random.js\");\r\n\r\nmodule.exports = Ellipse;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/ellipse/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/index.js": /*!***********************************************!*\ !*** ./node_modules/phaser/src/geom/index.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/geom/const.js\");\r\nvar Extend = __webpack_require__(/*! ../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\n\r\n/**\r\n * @namespace Phaser.Geom\r\n */\r\n\r\nvar Geom = {\r\n \r\n Circle: __webpack_require__(/*! ./circle */ \"./node_modules/phaser/src/geom/circle/index.js\"),\r\n Ellipse: __webpack_require__(/*! ./ellipse */ \"./node_modules/phaser/src/geom/ellipse/index.js\"),\r\n Intersects: __webpack_require__(/*! ./intersects */ \"./node_modules/phaser/src/geom/intersects/index.js\"),\r\n Line: __webpack_require__(/*! ./line */ \"./node_modules/phaser/src/geom/line/index.js\"),\r\n Point: __webpack_require__(/*! ./point */ \"./node_modules/phaser/src/geom/point/index.js\"),\r\n Polygon: __webpack_require__(/*! ./polygon */ \"./node_modules/phaser/src/geom/polygon/index.js\"),\r\n Rectangle: __webpack_require__(/*! ./rectangle */ \"./node_modules/phaser/src/geom/rectangle/index.js\"),\r\n Triangle: __webpack_require__(/*! ./triangle */ \"./node_modules/phaser/src/geom/triangle/index.js\")\r\n\r\n};\r\n\r\n// Merge in the consts\r\nGeom = Extend(false, Geom, CONST);\r\n\r\nmodule.exports = Geom;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/CircleToCircle.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/CircleToCircle.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar DistanceBetween = __webpack_require__(/*! ../../math/distance/DistanceBetween */ \"./node_modules/phaser/src/math/distance/DistanceBetween.js\");\r\n\r\n/**\r\n * Checks if two Circles intersect.\r\n *\r\n * @function Phaser.Geom.Intersects.CircleToCircle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Circle} circleA - The first Circle to check for intersection.\r\n * @param {Phaser.Geom.Circle} circleB - The second Circle to check for intersection.\r\n *\r\n * @return {boolean} `true` if the two Circles intersect, otherwise `false`.\r\n */\r\nvar CircleToCircle = function (circleA, circleB)\r\n{\r\n return (DistanceBetween(circleA.x, circleA.y, circleB.x, circleB.y) <= (circleA.radius + circleB.radius));\r\n};\r\n\r\nmodule.exports = CircleToCircle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/CircleToCircle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/CircleToRectangle.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/CircleToRectangle.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks for intersection between a circle and a rectangle.\r\n *\r\n * @function Phaser.Geom.Intersects.CircleToRectangle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The circle to be checked.\r\n * @param {Phaser.Geom.Rectangle} rect - The rectangle to be checked.\r\n *\r\n * @return {boolean} `true` if the two objects intersect, otherwise `false`.\r\n */\r\nvar CircleToRectangle = function (circle, rect)\r\n{\r\n var halfWidth = rect.width / 2;\r\n var halfHeight = rect.height / 2;\r\n\r\n var cx = Math.abs(circle.x - rect.x - halfWidth);\r\n var cy = Math.abs(circle.y - rect.y - halfHeight);\r\n var xDist = halfWidth + circle.radius;\r\n var yDist = halfHeight + circle.radius;\r\n\r\n if (cx > xDist || cy > yDist)\r\n {\r\n return false;\r\n }\r\n else if (cx <= halfWidth || cy <= halfHeight)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n var xCornerDist = cx - halfWidth;\r\n var yCornerDist = cy - halfHeight;\r\n var xCornerDistSq = xCornerDist * xCornerDist;\r\n var yCornerDistSq = yCornerDist * yCornerDist;\r\n var maxCornerDistSq = circle.radius * circle.radius;\r\n\r\n return (xCornerDistSq + yCornerDistSq <= maxCornerDistSq);\r\n }\r\n};\r\n\r\nmodule.exports = CircleToRectangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/CircleToRectangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/GetCircleToCircle.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/GetCircleToCircle.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Florian Vazelle\r\n * @author Geoffrey Glaive\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\nvar CircleToCircle = __webpack_require__(/*! ./CircleToCircle */ \"./node_modules/phaser/src/geom/intersects/CircleToCircle.js\");\r\n\r\n/**\r\n * Checks if two Circles intersect and returns the intersection points as a Point object array.\r\n *\r\n * @function Phaser.Geom.Intersects.GetCircleToCircle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Circle} circleA - The first Circle to check for intersection.\r\n * @param {Phaser.Geom.Circle} circleB - The second Circle to check for intersection.\r\n * @param {array} [out] - An optional array in which to store the points of intersection.\r\n *\r\n * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array.\r\n */\r\nvar GetCircleToCircle = function (circleA, circleB, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n if (CircleToCircle(circleA, circleB))\r\n {\r\n var x0 = circleA.x;\r\n var y0 = circleA.y;\r\n var r0 = circleA.radius;\r\n\r\n var x1 = circleB.x;\r\n var y1 = circleB.y;\r\n var r1 = circleB.radius;\r\n\r\n var coefficientA, coefficientB, coefficientC, lambda, x;\r\n\r\n if (y0 === y1)\r\n {\r\n x = ((r1 * r1) - (r0 * r0) - (x1 * x1) + (x0 * x0)) / (2 * (x0 - x1));\r\n\r\n coefficientA = 1;\r\n coefficientB = -2 * y1;\r\n coefficientC = (x1 * x1) + (x * x) - (2 * x1 * x) + (y1 * y1) - (r1 * r1);\r\n\r\n lambda = (coefficientB * coefficientB) - (4 * coefficientA * coefficientC);\r\n\r\n if (lambda === 0)\r\n {\r\n out.push(new Point(x, (-coefficientB / (2 * coefficientA))));\r\n }\r\n else if (lambda > 0)\r\n {\r\n out.push(new Point(x, (-coefficientB + Math.sqrt(lambda)) / (2 * coefficientA)));\r\n out.push(new Point(x, (-coefficientB - Math.sqrt(lambda)) / (2 * coefficientA)));\r\n }\r\n }\r\n else\r\n {\r\n var v1 = (x0 - x1) / (y0 - y1);\r\n var n = (r1 * r1 - r0 * r0 - x1 * x1 + x0 * x0 - y1 * y1 + y0 * y0) / (2 * (y0 - y1));\r\n\r\n coefficientA = (v1 * v1) + 1;\r\n coefficientB = (2 * y0 * v1) - (2 * n * v1) - (2 * x0);\r\n coefficientC = (x0 * x0) + (y0 * y0) + (n * n) - (r0 * r0) - (2 * y0 * n);\r\n\r\n lambda = (coefficientB * coefficientB) - (4 * coefficientA * coefficientC);\r\n\r\n if (lambda === 0)\r\n {\r\n x = (-coefficientB / (2 * coefficientA));\r\n out.push(new Point(x, (n - (x * v1))));\r\n }\r\n else if (lambda > 0)\r\n {\r\n x = (-coefficientB + Math.sqrt(lambda)) / (2 * coefficientA);\r\n out.push(new Point(x, (n - (x * v1))));\r\n x = (-coefficientB - Math.sqrt(lambda)) / (2 * coefficientA);\r\n out.push(new Point(x, (n - (x * v1))));\r\n }\r\n }\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetCircleToCircle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/GetCircleToCircle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/GetCircleToRectangle.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/GetCircleToRectangle.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Florian Vazelle\r\n * @author Geoffrey Glaive\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetLineToCircle = __webpack_require__(/*! ./GetLineToCircle */ \"./node_modules/phaser/src/geom/intersects/GetLineToCircle.js\");\r\nvar CircleToRectangle = __webpack_require__(/*! ./CircleToRectangle */ \"./node_modules/phaser/src/geom/intersects/CircleToRectangle.js\");\r\n\r\n/**\r\n * Checks for intersection between a circle and a rectangle,\r\n * and returns the intersection points as a Point object array.\r\n *\r\n * @function Phaser.Geom.Intersects.GetCircleToRectangle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Circle} circle - The circle to be checked.\r\n * @param {Phaser.Geom.Rectangle} rect - The rectangle to be checked.\r\n * @param {array} [out] - An optional array in which to store the points of intersection.\r\n *\r\n * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array.\r\n */\r\nvar GetCircleToRectangle = function (circle, rect, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n if (CircleToRectangle(circle, rect))\r\n {\r\n var lineA = rect.getLineA();\r\n var lineB = rect.getLineB();\r\n var lineC = rect.getLineC();\r\n var lineD = rect.getLineD();\r\n\r\n GetLineToCircle(lineA, circle, out);\r\n GetLineToCircle(lineB, circle, out);\r\n GetLineToCircle(lineC, circle, out);\r\n GetLineToCircle(lineD, circle, out);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetCircleToRectangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/GetCircleToRectangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/GetLineToCircle.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/GetLineToCircle.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Florian Vazelle\r\n * @author Geoffrey Glaive\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\nvar LineToCircle = __webpack_require__(/*! ./LineToCircle */ \"./node_modules/phaser/src/geom/intersects/LineToCircle.js\");\r\n\r\n/**\r\n * Checks for intersection between the line segment and circle,\r\n * and returns the intersection points as a Point object array.\r\n *\r\n * @function Phaser.Geom.Intersects.GetLineToCircle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The line segment to check.\r\n * @param {Phaser.Geom.Circle} circle - The circle to check against the line.\r\n * @param {array} [out] - An optional array in which to store the points of intersection.\r\n *\r\n * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array.\r\n */\r\nvar GetLineToCircle = function (line, circle, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n if (LineToCircle(line, circle))\r\n {\r\n var lx1 = line.x1;\r\n var ly1 = line.y1;\r\n\r\n var lx2 = line.x2;\r\n var ly2 = line.y2;\r\n\r\n var cx = circle.x;\r\n var cy = circle.y;\r\n var cr = circle.radius;\r\n\r\n var lDirX = lx2 - lx1;\r\n var lDirY = ly2 - ly1;\r\n var oDirX = lx1 - cx;\r\n var oDirY = ly1 - cy;\r\n\r\n var coefficientA = lDirX * lDirX + lDirY * lDirY;\r\n var coefficientB = 2 * (lDirX * oDirX + lDirY * oDirY);\r\n var coefficientC = oDirX * oDirX + oDirY * oDirY - cr * cr;\r\n\r\n var lambda = (coefficientB * coefficientB) - (4 * coefficientA * coefficientC);\r\n\r\n var x, y;\r\n\r\n if (lambda === 0)\r\n {\r\n var root = -coefficientB / (2 * coefficientA);\r\n x = lx1 + root * lDirX;\r\n y = ly1 + root * lDirY;\r\n if (root >= 0 && root <= 1)\r\n {\r\n out.push(new Point(x, y));\r\n }\r\n }\r\n else if (lambda > 0)\r\n {\r\n var root1 = (-coefficientB - Math.sqrt(lambda)) / (2 * coefficientA);\r\n x = lx1 + root1 * lDirX;\r\n y = ly1 + root1 * lDirY;\r\n if (root1 >= 0 && root1 <= 1)\r\n {\r\n out.push(new Point(x, y));\r\n }\r\n\r\n var root2 = (-coefficientB + Math.sqrt(lambda)) / (2 * coefficientA);\r\n x = lx1 + root2 * lDirX;\r\n y = ly1 + root2 * lDirY;\r\n if (root2 >= 0 && root2 <= 1)\r\n {\r\n out.push(new Point(x, y));\r\n }\r\n }\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetLineToCircle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/GetLineToCircle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/GetLineToRectangle.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/GetLineToRectangle.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Florian Vazelle\r\n * @author Geoffrey Glaive\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\nvar LineToLine = __webpack_require__(/*! ./LineToLine */ \"./node_modules/phaser/src/geom/intersects/LineToLine.js\");\r\nvar LineToRectangle = __webpack_require__(/*! ./LineToRectangle */ \"./node_modules/phaser/src/geom/intersects/LineToRectangle.js\");\r\n\r\n/**\r\n * Checks for intersection between the Line and a Rectangle shape,\r\n * and returns the intersection points as a Point object array.\r\n *\r\n * @function Phaser.Geom.Intersects.GetLineToRectangle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The Line to check for intersection.\r\n * @param {(Phaser.Geom.Rectangle|object)} rect - The Rectangle to check for intersection.\r\n * @param {array} [out] - An optional array in which to store the points of intersection.\r\n *\r\n * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array.\r\n */\r\nvar GetLineToRectangle = function (line, rect, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n if (LineToRectangle(line, rect))\r\n {\r\n var lineA = rect.getLineA();\r\n var lineB = rect.getLineB();\r\n var lineC = rect.getLineC();\r\n var lineD = rect.getLineD();\r\n\r\n var output = [ new Point(), new Point(), new Point(), new Point() ];\r\n\r\n var result = [\r\n LineToLine(lineA, line, output[0]),\r\n LineToLine(lineB, line, output[1]),\r\n LineToLine(lineC, line, output[2]),\r\n LineToLine(lineD, line, output[3])\r\n ];\r\n\r\n for (var i = 0; i < 4; i++)\r\n {\r\n if (result[i]) { out.push(output[i]); }\r\n }\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetLineToRectangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/GetLineToRectangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/GetRectangleIntersection.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/GetRectangleIntersection.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Rectangle = __webpack_require__(/*! ../rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar RectangleToRectangle = __webpack_require__(/*! ./RectangleToRectangle */ \"./node_modules/phaser/src/geom/intersects/RectangleToRectangle.js\");\r\n\r\n/**\r\n * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object.\r\n * \r\n * 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).\r\n * \r\n * 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 intersection, it will be returned without any change.\r\n *\r\n * @function Phaser.Geom.Intersects.GetRectangleIntersection\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [output,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle object.\r\n * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle object.\r\n * @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.\r\n *\r\n * @return {Phaser.Geom.Rectangle} A rectangle object with intersection data.\r\n */\r\nvar GetRectangleIntersection = function (rectA, rectB, output)\r\n{\r\n if (output === undefined) { output = new Rectangle(); }\r\n\r\n if (RectangleToRectangle(rectA, rectB))\r\n {\r\n output.x = Math.max(rectA.x, rectB.x);\r\n output.y = Math.max(rectA.y, rectB.y);\r\n output.width = Math.min(rectA.right, rectB.right) - output.x;\r\n output.height = Math.min(rectA.bottom, rectB.bottom) - output.y;\r\n }\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = GetRectangleIntersection;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/GetRectangleIntersection.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/GetRectangleToRectangle.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/GetRectangleToRectangle.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Florian Vazelle\r\n * @author Geoffrey Glaive\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetLineToRectangle = __webpack_require__(/*! ./GetLineToRectangle */ \"./node_modules/phaser/src/geom/intersects/GetLineToRectangle.js\");\r\nvar RectangleToRectangle = __webpack_require__(/*! ./RectangleToRectangle */ \"./node_modules/phaser/src/geom/intersects/RectangleToRectangle.js\");\r\n\r\n/**\r\n * Checks if two Rectangles intersect and returns the intersection points as a Point object array.\r\n *\r\n * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. As such, the two Rectangles are considered \"solid\". A Rectangle with no width or no height will never intersect another Rectangle.\r\n *\r\n * @function Phaser.Geom.Intersects.GetRectangleToRectangle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to check for intersection.\r\n * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to check for intersection.\r\n * @param {array} [out] - An optional array in which to store the points of intersection.\r\n *\r\n * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array.\r\n */\r\nvar GetRectangleToRectangle = function (rectA, rectB, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n if (RectangleToRectangle(rectA, rectB))\r\n {\r\n var lineA = rectA.getLineA();\r\n var lineB = rectA.getLineB();\r\n var lineC = rectA.getLineC();\r\n var lineD = rectA.getLineD();\r\n\r\n GetLineToRectangle(lineA, rectB, out);\r\n GetLineToRectangle(lineB, rectB, out);\r\n GetLineToRectangle(lineC, rectB, out);\r\n GetLineToRectangle(lineD, rectB, out);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetRectangleToRectangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/GetRectangleToRectangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/GetRectangleToTriangle.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/GetRectangleToTriangle.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Florian Vazelle\r\n * @author Geoffrey Glaive\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RectangleToTriangle = __webpack_require__(/*! ./RectangleToTriangle */ \"./node_modules/phaser/src/geom/intersects/RectangleToTriangle.js\");\r\nvar GetLineToRectangle = __webpack_require__(/*! ./GetLineToRectangle */ \"./node_modules/phaser/src/geom/intersects/GetLineToRectangle.js\");\r\n\r\n/**\r\n * Checks for intersection between Rectangle shape and Triangle shape,\r\n * and returns the intersection points as a Point object array.\r\n *\r\n * @function Phaser.Geom.Intersects.GetRectangleToTriangle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - Rectangle object to test.\r\n * @param {Phaser.Geom.Triangle} triangle - Triangle object to test.\r\n * @param {array} [out] - An optional array in which to store the points of intersection.\r\n *\r\n * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array.\r\n */\r\nvar GetRectangleToTriangle = function (rect, triangle, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n if (RectangleToTriangle(rect, triangle))\r\n {\r\n var lineA = triangle.getLineA();\r\n var lineB = triangle.getLineB();\r\n var lineC = triangle.getLineC();\r\n\r\n GetLineToRectangle(lineA, rect, out);\r\n GetLineToRectangle(lineB, rect, out);\r\n GetLineToRectangle(lineC, rect, out);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetRectangleToTriangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/GetRectangleToTriangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/GetTriangleToCircle.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/GetTriangleToCircle.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Florian Vazelle\r\n * @author Geoffrey Glaive\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetLineToCircle = __webpack_require__(/*! ./GetLineToCircle */ \"./node_modules/phaser/src/geom/intersects/GetLineToCircle.js\");\r\nvar TriangleToCircle = __webpack_require__(/*! ./TriangleToCircle */ \"./node_modules/phaser/src/geom/intersects/TriangleToCircle.js\");\r\n\r\n/**\r\n * Checks if a Triangle and a Circle intersect, and returns the intersection points as a Point object array.\r\n *\r\n * A Circle intersects a Triangle if its center is located within it or if any of the Triangle's sides intersect the Circle. As such, the Triangle and the Circle are considered \"solid\" for the intersection.\r\n *\r\n * @function Phaser.Geom.Intersects.GetTriangleToCircle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to check for intersection.\r\n * @param {Phaser.Geom.Circle} circle - The Circle to check for intersection.\r\n * @param {array} [out] - An optional array in which to store the points of intersection.\r\n *\r\n * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array.\r\n */\r\nvar GetTriangleToCircle = function (triangle, circle, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n if (TriangleToCircle(triangle, circle))\r\n {\r\n var lineA = triangle.getLineA();\r\n var lineB = triangle.getLineB();\r\n var lineC = triangle.getLineC();\r\n\r\n GetLineToCircle(lineA, circle, out);\r\n GetLineToCircle(lineB, circle, out);\r\n GetLineToCircle(lineC, circle, out);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetTriangleToCircle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/GetTriangleToCircle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/GetTriangleToLine.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/GetTriangleToLine.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Florian Vazelle\r\n * @author Geoffrey Glaive\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\nvar TriangleToLine = __webpack_require__(/*! ./TriangleToLine */ \"./node_modules/phaser/src/geom/intersects/TriangleToLine.js\");\r\nvar LineToLine = __webpack_require__(/*! ./LineToLine */ \"./node_modules/phaser/src/geom/intersects/LineToLine.js\");\r\n\r\n/**\r\n * Checks if a Triangle and a Line intersect, and returns the intersection points as a Point object array.\r\n *\r\n * 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\".\r\n *\r\n * @function Phaser.Geom.Intersects.GetTriangleToLine\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to check with.\r\n * @param {Phaser.Geom.Line} line - The Line to check with.\r\n * @param {array} [out] - An optional array in which to store the points of intersection.\r\n *\r\n * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array.\r\n */\r\nvar GetTriangleToLine = function (triangle, line, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n if (TriangleToLine(triangle, line))\r\n {\r\n var lineA = triangle.getLineA();\r\n var lineB = triangle.getLineB();\r\n var lineC = triangle.getLineC();\r\n\r\n var output = [ new Point(), new Point(), new Point() ];\r\n\r\n var result = [\r\n LineToLine(lineA, line, output[0]),\r\n LineToLine(lineB, line, output[1]),\r\n LineToLine(lineC, line, output[2])\r\n ];\r\n\r\n for (var i = 0; i < 3; i++)\r\n {\r\n if (result[i]) { out.push(output[i]); }\r\n }\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetTriangleToLine;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/GetTriangleToLine.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/GetTriangleToTriangle.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/GetTriangleToTriangle.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Florian Vazelle\r\n * @author Geoffrey Glaive\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar TriangleToTriangle = __webpack_require__(/*! ./TriangleToTriangle */ \"./node_modules/phaser/src/geom/intersects/TriangleToTriangle.js\");\r\nvar GetTriangleToLine = __webpack_require__(/*! ./GetTriangleToLine */ \"./node_modules/phaser/src/geom/intersects/GetTriangleToLine.js\");\r\n\r\n/**\r\n * Checks if two Triangles intersect, and returns the intersection points as a Point object array.\r\n *\r\n * A Triangle intersects another Triangle if any pair of their lines intersects or if any point of one Triangle is within the other Triangle. Thus, the Triangles are considered \"solid\".\r\n *\r\n * @function Phaser.Geom.Intersects.GetTriangleToTriangle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} triangleA - The first Triangle to check for intersection.\r\n * @param {Phaser.Geom.Triangle} triangleB - The second Triangle to check for intersection.\r\n * @param {array} [out] - An optional array in which to store the points of intersection.\r\n *\r\n * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array.\r\n */\r\nvar GetTriangleToTriangle = function (triangleA, triangleB, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n if (TriangleToTriangle(triangleA, triangleB))\r\n {\r\n var lineA = triangleB.getLineA();\r\n var lineB = triangleB.getLineB();\r\n var lineC = triangleB.getLineC();\r\n\r\n GetTriangleToLine(triangleA, lineA, out);\r\n GetTriangleToLine(triangleA, lineB, out);\r\n GetTriangleToLine(triangleA, lineC, out);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetTriangleToTriangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/GetTriangleToTriangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/LineToCircle.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/LineToCircle.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Contains = __webpack_require__(/*! ../circle/Contains */ \"./node_modules/phaser/src/geom/circle/Contains.js\");\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\nvar tmp = new Point();\r\n\r\n/**\r\n * Checks for intersection between the line segment and circle.\r\n *\r\n * Based on code by [Matt DesLauriers](https://github.com/mattdesl/line-circle-collision/blob/master/LICENSE.md).\r\n *\r\n * @function Phaser.Geom.Intersects.LineToCircle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The line segment to check.\r\n * @param {Phaser.Geom.Circle} circle - The circle to check against the line.\r\n * @param {(Phaser.Geom.Point|any)} [nearest] - An optional Point-like object. If given the closest point on the Line where the circle intersects will be stored in this object.\r\n *\r\n * @return {boolean} `true` if the two objects intersect, otherwise `false`.\r\n */\r\nvar LineToCircle = function (line, circle, nearest)\r\n{\r\n if (nearest === undefined) { nearest = tmp; }\r\n\r\n if (Contains(circle, line.x1, line.y1))\r\n {\r\n nearest.x = line.x1;\r\n nearest.y = line.y1;\r\n\r\n return true;\r\n }\r\n\r\n if (Contains(circle, line.x2, line.y2))\r\n {\r\n nearest.x = line.x2;\r\n nearest.y = line.y2;\r\n\r\n return true;\r\n }\r\n\r\n var dx = line.x2 - line.x1;\r\n var dy = line.y2 - line.y1;\r\n\r\n var lcx = circle.x - line.x1;\r\n var lcy = circle.y - line.y1;\r\n\r\n // project lc onto d, resulting in vector p\r\n var dLen2 = (dx * dx) + (dy * dy);\r\n var px = dx;\r\n var py = dy;\r\n\r\n if (dLen2 > 0)\r\n {\r\n var dp = ((lcx * dx) + (lcy * dy)) / dLen2;\r\n\r\n px *= dp;\r\n py *= dp;\r\n }\r\n\r\n nearest.x = line.x1 + px;\r\n nearest.y = line.y1 + py;\r\n \r\n // len2 of p\r\n var pLen2 = (px * px) + (py * py);\r\n \r\n return (\r\n pLen2 <= dLen2 &&\r\n ((px * dx) + (py * dy)) >= 0 &&\r\n Contains(circle, nearest.x, nearest.y)\r\n );\r\n};\r\n\r\nmodule.exports = LineToCircle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/LineToCircle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/LineToLine.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/LineToLine.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n// This is based off an explanation and expanded math presented by Paul Bourke:\r\n// See http:'local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/\r\n\r\n/**\r\n * Checks if two Lines intersect. If the Lines are identical, they will be treated as parallel and thus non-intersecting.\r\n *\r\n * @function Phaser.Geom.Intersects.LineToLine\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line1 - The first Line to check.\r\n * @param {Phaser.Geom.Line} line2 - The second Line to check.\r\n * @param {Phaser.Geom.Point} [out] - A Point in which to optionally store the point of intersection.\r\n *\r\n * @return {boolean} `true` if the two Lines intersect, and the `out` object will be populated, if given. Otherwise, `false`.\r\n */\r\nvar LineToLine = function (line1, line2, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n var x1 = line1.x1;\r\n var y1 = line1.y1;\r\n var x2 = line1.x2;\r\n var y2 = line1.y2;\r\n\r\n var x3 = line2.x1;\r\n var y3 = line2.y1;\r\n var x4 = line2.x2;\r\n var y4 = line2.y2;\r\n\r\n var numA = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3);\r\n var numB = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3);\r\n var deNom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\r\n\r\n // Make sure there is not a division by zero - this also indicates that the lines are parallel.\r\n // If numA and numB were both equal to zero the lines would be on top of each other (coincidental).\r\n // This check is not done because it is not necessary for this implementation (the parallel check accounts for this).\r\n\r\n if (deNom === 0)\r\n {\r\n return false;\r\n }\r\n\r\n // Calculate the intermediate fractional point that the lines potentially intersect.\r\n\r\n var uA = numA / deNom;\r\n var uB = numB / deNom;\r\n\r\n // The fractional point will be between 0 and 1 inclusive if the lines intersect.\r\n // If the fractional calculation is larger than 1 or smaller than 0 the lines would need to be longer to intersect.\r\n\r\n if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1)\r\n {\r\n out.x = x1 + (uA * (x2 - x1));\r\n out.y = y1 + (uA * (y2 - y1));\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nmodule.exports = LineToLine;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/LineToLine.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/LineToRectangle.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/LineToRectangle.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks for intersection between the Line and a Rectangle shape, or a rectangle-like\r\n * object, with public `x`, `y`, `right` and `bottom` properties, such as a Sprite or Body.\r\n *\r\n * An intersection is considered valid if:\r\n *\r\n * The line starts within, or ends within, the Rectangle.\r\n * The line segment intersects one of the 4 rectangle edges.\r\n *\r\n * The for the purposes of this function rectangles are considered 'solid'.\r\n *\r\n * @function Phaser.Geom.Intersects.LineToRectangle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The Line to check for intersection.\r\n * @param {(Phaser.Geom.Rectangle|object)} rect - The Rectangle to check for intersection.\r\n *\r\n * @return {boolean} `true` if the Line and the Rectangle intersect, `false` otherwise.\r\n */\r\nvar LineToRectangle = function (line, rect)\r\n{\r\n var x1 = line.x1;\r\n var y1 = line.y1;\r\n\r\n var x2 = line.x2;\r\n var y2 = line.y2;\r\n\r\n var bx1 = rect.x;\r\n var by1 = rect.y;\r\n var bx2 = rect.right;\r\n var by2 = rect.bottom;\r\n\r\n var t = 0;\r\n\r\n // If the start or end of the line is inside the rect then we assume\r\n // collision, as rects are solid for our use-case.\r\n\r\n if ((x1 >= bx1 && x1 <= bx2 && y1 >= by1 && y1 <= by2) ||\r\n (x2 >= bx1 && x2 <= bx2 && y2 >= by1 && y2 <= by2))\r\n {\r\n return true;\r\n }\r\n\r\n if (x1 < bx1 && x2 >= bx1)\r\n {\r\n // Left edge\r\n t = y1 + (y2 - y1) * (bx1 - x1) / (x2 - x1);\r\n\r\n if (t > by1 && t <= by2)\r\n {\r\n return true;\r\n }\r\n }\r\n else if (x1 > bx2 && x2 <= bx2)\r\n {\r\n // Right edge\r\n t = y1 + (y2 - y1) * (bx2 - x1) / (x2 - x1);\r\n\r\n if (t >= by1 && t <= by2)\r\n {\r\n return true;\r\n }\r\n }\r\n\r\n if (y1 < by1 && y2 >= by1)\r\n {\r\n // Top edge\r\n t = x1 + (x2 - x1) * (by1 - y1) / (y2 - y1);\r\n\r\n if (t >= bx1 && t <= bx2)\r\n {\r\n return true;\r\n }\r\n }\r\n else if (y1 > by2 && y2 <= by2)\r\n {\r\n // Bottom edge\r\n t = x1 + (x2 - x1) * (by2 - y1) / (y2 - y1);\r\n\r\n if (t >= bx1 && t <= bx2)\r\n {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n};\r\n\r\nmodule.exports = LineToRectangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/LineToRectangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/PointToLine.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/PointToLine.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @author Florian Mertens\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if the a Point falls between the two end-points of a Line, based on the given line thickness.\r\n * \r\n * Assumes that the line end points are circular, not square.\r\n *\r\n * @function Phaser.Geom.Intersects.PointToLine\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|any)} point - The point, or point-like object to check.\r\n * @param {Phaser.Geom.Line} line - The line segment to test for intersection on.\r\n * @param {number} [lineThickness=1] - The line thickness. Assumes that the line end points are circular.\r\n *\r\n * @return {boolean} `true` if the Point falls on the Line, otherwise `false`.\r\n */\r\nvar PointToLine = function (point, line, lineThickness)\r\n{\r\n if (lineThickness === undefined) { lineThickness = 1; }\r\n\r\n var x1 = line.x1;\r\n var y1 = line.y1;\r\n\r\n var x2 = line.x2;\r\n var y2 = line.y2;\r\n\r\n var px = point.x;\r\n var py = point.y;\r\n\r\n var L2 = (((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)));\r\n\r\n if (L2 === 0)\r\n {\r\n return false;\r\n }\r\n\r\n var r = (((px - x1) * (x2 - x1)) + ((py - y1) * (y2 - y1))) / L2;\r\n\r\n // Assume line thickness is circular\r\n if (r < 0)\r\n {\r\n // Outside line1\r\n return (Math.sqrt(((x1 - px) * (x1 - px)) + ((y1 - py) * (y1 - py))) <= lineThickness);\r\n }\r\n else if ((r >= 0) && (r <= 1))\r\n {\r\n // On the line segment\r\n var s = (((y1 - py) * (x2 - x1)) - ((x1 - px) * (y2 - y1))) / L2;\r\n\r\n return (Math.abs(s) * Math.sqrt(L2) <= lineThickness);\r\n }\r\n else\r\n {\r\n // Outside line2\r\n return (Math.sqrt(((x2 - px) * (x2 - px)) + ((y2 - py) * (y2 - py))) <= lineThickness);\r\n }\r\n};\r\n\r\nmodule.exports = PointToLine;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/PointToLine.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/PointToLineSegment.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/PointToLineSegment.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PointToLine = __webpack_require__(/*! ./PointToLine */ \"./node_modules/phaser/src/geom/intersects/PointToLine.js\");\r\n\r\n/**\r\n * Checks if a Point is located on the given line segment.\r\n *\r\n * @function Phaser.Geom.Intersects.PointToLineSegment\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Point} point - The Point to check for intersection.\r\n * @param {Phaser.Geom.Line} line - The line segment to check for intersection.\r\n *\r\n * @return {boolean} `true` if the Point is on the given line segment, otherwise `false`.\r\n */\r\nvar PointToLineSegment = function (point, line)\r\n{\r\n if (!PointToLine(point, line))\r\n {\r\n return false;\r\n }\r\n\r\n var xMin = Math.min(line.x1, line.x2);\r\n var xMax = Math.max(line.x1, line.x2);\r\n var yMin = Math.min(line.y1, line.y2);\r\n var yMax = Math.max(line.y1, line.y2);\r\n\r\n return ((point.x >= xMin && point.x <= xMax) && (point.y >= yMin && point.y <= yMax));\r\n};\r\n\r\nmodule.exports = PointToLineSegment;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/PointToLineSegment.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/RectangleToRectangle.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/RectangleToRectangle.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if two Rectangles intersect.\r\n *\r\n * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds.\r\n * As such, the two Rectangles are considered \"solid\".\r\n * A Rectangle with no width or no height will never intersect another Rectangle.\r\n *\r\n * @function Phaser.Geom.Intersects.RectangleToRectangle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to check for intersection.\r\n * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to check for intersection.\r\n *\r\n * @return {boolean} `true` if the two Rectangles intersect, otherwise `false`.\r\n */\r\nvar RectangleToRectangle = function (rectA, rectB)\r\n{\r\n if (rectA.width <= 0 || rectA.height <= 0 || rectB.width <= 0 || rectB.height <= 0)\r\n {\r\n return false;\r\n }\r\n\r\n return !(rectA.right < rectB.x || rectA.bottom < rectB.y || rectA.x > rectB.right || rectA.y > rectB.bottom);\r\n};\r\n\r\nmodule.exports = RectangleToRectangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/RectangleToRectangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/RectangleToTriangle.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/RectangleToTriangle.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar LineToLine = __webpack_require__(/*! ./LineToLine */ \"./node_modules/phaser/src/geom/intersects/LineToLine.js\");\r\nvar Contains = __webpack_require__(/*! ../rectangle/Contains */ \"./node_modules/phaser/src/geom/rectangle/Contains.js\");\r\nvar ContainsArray = __webpack_require__(/*! ../triangle/ContainsArray */ \"./node_modules/phaser/src/geom/triangle/ContainsArray.js\");\r\nvar Decompose = __webpack_require__(/*! ../rectangle/Decompose */ \"./node_modules/phaser/src/geom/rectangle/Decompose.js\");\r\n\r\n/**\r\n * Checks for intersection between Rectangle shape and Triangle shape.\r\n *\r\n * @function Phaser.Geom.Intersects.RectangleToTriangle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - Rectangle object to test.\r\n * @param {Phaser.Geom.Triangle} triangle - Triangle object to test.\r\n *\r\n * @return {boolean} A value of `true` if objects intersect; otherwise `false`.\r\n */\r\nvar RectangleToTriangle = function (rect, triangle)\r\n{\r\n // First the cheapest ones:\r\n\r\n if (\r\n triangle.left > rect.right ||\r\n triangle.right < rect.left ||\r\n triangle.top > rect.bottom ||\r\n triangle.bottom < rect.top)\r\n {\r\n return false;\r\n }\r\n\r\n var triA = triangle.getLineA();\r\n var triB = triangle.getLineB();\r\n var triC = triangle.getLineC();\r\n\r\n // Are any of the triangle points within the rectangle?\r\n\r\n if (Contains(rect, triA.x1, triA.y1) || Contains(rect, triA.x2, triA.y2))\r\n {\r\n return true;\r\n }\r\n\r\n if (Contains(rect, triB.x1, triB.y1) || Contains(rect, triB.x2, triB.y2))\r\n {\r\n return true;\r\n }\r\n\r\n if (Contains(rect, triC.x1, triC.y1) || Contains(rect, triC.x2, triC.y2))\r\n {\r\n return true;\r\n }\r\n\r\n // Cheap tests over, now to see if any of the lines intersect ...\r\n\r\n var rectA = rect.getLineA();\r\n var rectB = rect.getLineB();\r\n var rectC = rect.getLineC();\r\n var rectD = rect.getLineD();\r\n\r\n if (LineToLine(triA, rectA) || LineToLine(triA, rectB) || LineToLine(triA, rectC) || LineToLine(triA, rectD))\r\n {\r\n return true;\r\n }\r\n\r\n if (LineToLine(triB, rectA) || LineToLine(triB, rectB) || LineToLine(triB, rectC) || LineToLine(triB, rectD))\r\n {\r\n return true;\r\n }\r\n\r\n if (LineToLine(triC, rectA) || LineToLine(triC, rectB) || LineToLine(triC, rectC) || LineToLine(triC, rectD))\r\n {\r\n return true;\r\n }\r\n\r\n // None of the lines intersect, so are any rectangle points within the triangle?\r\n\r\n var points = Decompose(rect);\r\n var within = ContainsArray(triangle, points, true);\r\n\r\n return (within.length > 0);\r\n};\r\n\r\nmodule.exports = RectangleToTriangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/RectangleToTriangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/RectangleToValues.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/RectangleToValues.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check if rectangle intersects with values.\r\n *\r\n * @function Phaser.Geom.Intersects.RectangleToValues\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The rectangle object\r\n * @param {number} left - The x coordinate of the left of the Rectangle.\r\n * @param {number} right - The x coordinate of the right of the Rectangle.\r\n * @param {number} top - The y coordinate of the top of the Rectangle.\r\n * @param {number} bottom - The y coordinate of the bottom of the Rectangle.\r\n * @param {number} [tolerance=0] - Tolerance allowed in the calculation, expressed in pixels.\r\n *\r\n * @return {boolean} Returns true if there is an intersection.\r\n */\r\nvar RectangleToValues = function (rect, left, right, top, bottom, tolerance)\r\n{\r\n if (tolerance === undefined) { tolerance = 0; }\r\n\r\n return !(\r\n left > rect.right + tolerance ||\r\n right < rect.left - tolerance ||\r\n top > rect.bottom + tolerance ||\r\n bottom < rect.top - tolerance\r\n );\r\n};\r\n\r\nmodule.exports = RectangleToValues;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/RectangleToValues.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/TriangleToCircle.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/TriangleToCircle.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar LineToCircle = __webpack_require__(/*! ./LineToCircle */ \"./node_modules/phaser/src/geom/intersects/LineToCircle.js\");\r\nvar Contains = __webpack_require__(/*! ../triangle/Contains */ \"./node_modules/phaser/src/geom/triangle/Contains.js\");\r\n\r\n/**\r\n * Checks if a Triangle and a Circle intersect.\r\n *\r\n * A Circle intersects a Triangle if its center is located within it or if any of the Triangle's sides intersect the Circle. As such, the Triangle and the Circle are considered \"solid\" for the intersection.\r\n *\r\n * @function Phaser.Geom.Intersects.TriangleToCircle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to check for intersection.\r\n * @param {Phaser.Geom.Circle} circle - The Circle to check for intersection.\r\n *\r\n * @return {boolean} `true` if the Triangle and the `Circle` intersect, otherwise `false`.\r\n */\r\nvar TriangleToCircle = function (triangle, circle)\r\n{\r\n // First the cheapest ones:\r\n\r\n if (\r\n triangle.left > circle.right ||\r\n triangle.right < circle.left ||\r\n triangle.top > circle.bottom ||\r\n triangle.bottom < circle.top)\r\n {\r\n return false;\r\n }\r\n\r\n if (Contains(triangle, circle.x, circle.y))\r\n {\r\n return true;\r\n }\r\n\r\n if (LineToCircle(triangle.getLineA(), circle))\r\n {\r\n return true;\r\n }\r\n\r\n if (LineToCircle(triangle.getLineB(), circle))\r\n {\r\n return true;\r\n }\r\n\r\n if (LineToCircle(triangle.getLineC(), circle))\r\n {\r\n return true;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nmodule.exports = TriangleToCircle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/TriangleToCircle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/TriangleToLine.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/TriangleToLine.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Contains = __webpack_require__(/*! ../triangle/Contains */ \"./node_modules/phaser/src/geom/triangle/Contains.js\");\r\nvar LineToLine = __webpack_require__(/*! ./LineToLine */ \"./node_modules/phaser/src/geom/intersects/LineToLine.js\");\r\n\r\n/**\r\n * Checks if a Triangle and a Line intersect.\r\n * \r\n * 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\".\r\n *\r\n * @function Phaser.Geom.Intersects.TriangleToLine\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to check with.\r\n * @param {Phaser.Geom.Line} line - The Line to check with.\r\n *\r\n * @return {boolean} `true` if the Triangle and the Line intersect, otherwise `false`.\r\n */\r\nvar TriangleToLine = function (triangle, line)\r\n{\r\n // If the Triangle contains either the start or end point of the line, it intersects\r\n if (Contains(triangle, line.getPointA()) || Contains(triangle, line.getPointB()))\r\n {\r\n return true;\r\n }\r\n\r\n // Now check the line against each line of the Triangle\r\n if (LineToLine(triangle.getLineA(), line))\r\n {\r\n return true;\r\n }\r\n\r\n if (LineToLine(triangle.getLineB(), line))\r\n {\r\n return true;\r\n }\r\n\r\n if (LineToLine(triangle.getLineC(), line))\r\n {\r\n return true;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nmodule.exports = TriangleToLine;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/TriangleToLine.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/TriangleToTriangle.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/TriangleToTriangle.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ContainsArray = __webpack_require__(/*! ../triangle/ContainsArray */ \"./node_modules/phaser/src/geom/triangle/ContainsArray.js\");\r\nvar Decompose = __webpack_require__(/*! ../triangle/Decompose */ \"./node_modules/phaser/src/geom/triangle/Decompose.js\");\r\nvar LineToLine = __webpack_require__(/*! ./LineToLine */ \"./node_modules/phaser/src/geom/intersects/LineToLine.js\");\r\n\r\n/**\r\n * Checks if two Triangles intersect.\r\n *\r\n * A Triangle intersects another Triangle if any pair of their lines intersects or if any point of one Triangle is within the other Triangle. Thus, the Triangles are considered \"solid\".\r\n *\r\n * @function Phaser.Geom.Intersects.TriangleToTriangle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} triangleA - The first Triangle to check for intersection.\r\n * @param {Phaser.Geom.Triangle} triangleB - The second Triangle to check for intersection.\r\n *\r\n * @return {boolean} `true` if the Triangles intersect, otherwise `false`.\r\n */\r\nvar TriangleToTriangle = function (triangleA, triangleB)\r\n{\r\n // First the cheapest ones:\r\n\r\n if (\r\n triangleA.left > triangleB.right ||\r\n triangleA.right < triangleB.left ||\r\n triangleA.top > triangleB.bottom ||\r\n triangleA.bottom < triangleB.top)\r\n {\r\n return false;\r\n }\r\n\r\n var lineAA = triangleA.getLineA();\r\n var lineAB = triangleA.getLineB();\r\n var lineAC = triangleA.getLineC();\r\n\r\n var lineBA = triangleB.getLineA();\r\n var lineBB = triangleB.getLineB();\r\n var lineBC = triangleB.getLineC();\r\n\r\n // Now check the lines against each line of TriangleB\r\n if (LineToLine(lineAA, lineBA) || LineToLine(lineAA, lineBB) || LineToLine(lineAA, lineBC))\r\n {\r\n return true;\r\n }\r\n\r\n if (LineToLine(lineAB, lineBA) || LineToLine(lineAB, lineBB) || LineToLine(lineAB, lineBC))\r\n {\r\n return true;\r\n }\r\n\r\n if (LineToLine(lineAC, lineBA) || LineToLine(lineAC, lineBB) || LineToLine(lineAC, lineBC))\r\n {\r\n return true;\r\n }\r\n\r\n // Nope, so check to see if any of the points of triangleA are within triangleB\r\n\r\n var points = Decompose(triangleA);\r\n var within = ContainsArray(triangleB, points, true);\r\n\r\n if (within.length > 0)\r\n {\r\n return true;\r\n }\r\n\r\n // Finally check to see if any of the points of triangleB are within triangleA\r\n\r\n points = Decompose(triangleB);\r\n within = ContainsArray(triangleA, points, true);\r\n\r\n if (within.length > 0)\r\n {\r\n return true;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nmodule.exports = TriangleToTriangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/TriangleToTriangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/intersects/index.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/geom/intersects/index.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Geom.Intersects\r\n */\r\n\r\nmodule.exports = {\r\n\r\n CircleToCircle: __webpack_require__(/*! ./CircleToCircle */ \"./node_modules/phaser/src/geom/intersects/CircleToCircle.js\"),\r\n CircleToRectangle: __webpack_require__(/*! ./CircleToRectangle */ \"./node_modules/phaser/src/geom/intersects/CircleToRectangle.js\"),\r\n GetCircleToCircle: __webpack_require__(/*! ./GetCircleToCircle */ \"./node_modules/phaser/src/geom/intersects/GetCircleToCircle.js\"),\r\n GetCircleToRectangle: __webpack_require__(/*! ./GetCircleToRectangle */ \"./node_modules/phaser/src/geom/intersects/GetCircleToRectangle.js\"),\r\n GetLineToCircle: __webpack_require__(/*! ./GetLineToCircle */ \"./node_modules/phaser/src/geom/intersects/GetLineToCircle.js\"),\r\n GetLineToRectangle: __webpack_require__(/*! ./GetLineToRectangle */ \"./node_modules/phaser/src/geom/intersects/GetLineToRectangle.js\"),\r\n GetRectangleIntersection: __webpack_require__(/*! ./GetRectangleIntersection */ \"./node_modules/phaser/src/geom/intersects/GetRectangleIntersection.js\"),\r\n GetRectangleToRectangle: __webpack_require__(/*! ./GetRectangleToRectangle */ \"./node_modules/phaser/src/geom/intersects/GetRectangleToRectangle.js\"),\r\n GetRectangleToTriangle: __webpack_require__(/*! ./GetRectangleToTriangle */ \"./node_modules/phaser/src/geom/intersects/GetRectangleToTriangle.js\"),\r\n GetTriangleToCircle: __webpack_require__(/*! ./GetTriangleToCircle */ \"./node_modules/phaser/src/geom/intersects/GetTriangleToCircle.js\"),\r\n GetTriangleToLine: __webpack_require__(/*! ./GetTriangleToLine */ \"./node_modules/phaser/src/geom/intersects/GetTriangleToLine.js\"),\r\n GetTriangleToTriangle: __webpack_require__(/*! ./GetTriangleToTriangle */ \"./node_modules/phaser/src/geom/intersects/GetTriangleToTriangle.js\"),\r\n LineToCircle: __webpack_require__(/*! ./LineToCircle */ \"./node_modules/phaser/src/geom/intersects/LineToCircle.js\"),\r\n LineToLine: __webpack_require__(/*! ./LineToLine */ \"./node_modules/phaser/src/geom/intersects/LineToLine.js\"),\r\n LineToRectangle: __webpack_require__(/*! ./LineToRectangle */ \"./node_modules/phaser/src/geom/intersects/LineToRectangle.js\"),\r\n PointToLine: __webpack_require__(/*! ./PointToLine */ \"./node_modules/phaser/src/geom/intersects/PointToLine.js\"),\r\n PointToLineSegment: __webpack_require__(/*! ./PointToLineSegment */ \"./node_modules/phaser/src/geom/intersects/PointToLineSegment.js\"),\r\n RectangleToRectangle: __webpack_require__(/*! ./RectangleToRectangle */ \"./node_modules/phaser/src/geom/intersects/RectangleToRectangle.js\"),\r\n RectangleToTriangle: __webpack_require__(/*! ./RectangleToTriangle */ \"./node_modules/phaser/src/geom/intersects/RectangleToTriangle.js\"),\r\n RectangleToValues: __webpack_require__(/*! ./RectangleToValues */ \"./node_modules/phaser/src/geom/intersects/RectangleToValues.js\"),\r\n TriangleToCircle: __webpack_require__(/*! ./TriangleToCircle */ \"./node_modules/phaser/src/geom/intersects/TriangleToCircle.js\"),\r\n TriangleToLine: __webpack_require__(/*! ./TriangleToLine */ \"./node_modules/phaser/src/geom/intersects/TriangleToLine.js\"),\r\n TriangleToTriangle: __webpack_require__(/*! ./TriangleToTriangle */ \"./node_modules/phaser/src/geom/intersects/TriangleToTriangle.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/intersects/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/Angle.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/geom/line/Angle.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the angle of the line in radians.\r\n *\r\n * @function Phaser.Geom.Line.Angle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to calculate the angle of.\r\n *\r\n * @return {number} The angle of the line, in radians.\r\n */\r\nvar Angle = function (line)\r\n{\r\n return Math.atan2(line.y2 - line.y1, line.x2 - line.x1);\r\n};\r\n\r\nmodule.exports = Angle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/Angle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/BresenhamPoints.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/geom/line/BresenhamPoints.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Using Bresenham's line algorithm this will return an array of all coordinates on this line.\r\n *\r\n * The `start` and `end` points are rounded before this runs as the algorithm works on integers.\r\n *\r\n * @function Phaser.Geom.Line.BresenhamPoints\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The line.\r\n * @param {integer} [stepRate=1] - The optional step rate for the points on the line.\r\n * @param {Phaser.Types.Math.Vector2Like[]} [results] - An optional array to push the resulting coordinates into.\r\n *\r\n * @return {Phaser.Types.Math.Vector2Like[]} The array of coordinates on the line.\r\n */\r\nvar BresenhamPoints = function (line, stepRate, results)\r\n{\r\n if (stepRate === undefined) { stepRate = 1; }\r\n if (results === undefined) { results = []; }\r\n\r\n var x1 = Math.round(line.x1);\r\n var y1 = Math.round(line.y1);\r\n var x2 = Math.round(line.x2);\r\n var y2 = Math.round(line.y2);\r\n\r\n var dx = Math.abs(x2 - x1);\r\n var dy = Math.abs(y2 - y1);\r\n var sx = (x1 < x2) ? 1 : -1;\r\n var sy = (y1 < y2) ? 1 : -1;\r\n var err = dx - dy;\r\n\r\n results.push({ x: x1, y: y1 });\r\n\r\n var i = 1;\r\n\r\n while (!((x1 === x2) && (y1 === y2)))\r\n {\r\n var e2 = err << 1;\r\n\r\n if (e2 > -dy)\r\n {\r\n err -= dy;\r\n x1 += sx;\r\n }\r\n\r\n if (e2 < dx)\r\n {\r\n err += dx;\r\n y1 += sy;\r\n }\r\n\r\n if (i % stepRate === 0)\r\n {\r\n results.push({ x: x1, y: y1 });\r\n }\r\n\r\n i++;\r\n }\r\n\r\n return results;\r\n};\r\n\r\nmodule.exports = BresenhamPoints;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/BresenhamPoints.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/CenterOn.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/geom/line/CenterOn.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n\r\n/**\r\n * Center a line on the given coordinates.\r\n *\r\n * @function Phaser.Geom.Line.CenterOn\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to center.\r\n * @param {number} x - The horizontal coordinate to center the line on.\r\n * @param {number} y - The vertical coordinate to center the line on.\r\n *\r\n * @return {Phaser.Geom.Line} The centered line.\r\n */\r\nvar CenterOn = function (line, x, y)\r\n{\r\n var tx = x - ((line.x1 + line.x2) / 2);\r\n var ty = y - ((line.y1 + line.y2) / 2);\r\n\r\n line.x1 += tx;\r\n line.y1 += ty;\r\n\r\n line.x2 += tx;\r\n line.y2 += ty;\r\n\r\n return line;\r\n};\r\n\r\nmodule.exports = CenterOn;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/CenterOn.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/Clone.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/geom/line/Clone.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Line = __webpack_require__(/*! ./Line */ \"./node_modules/phaser/src/geom/line/Line.js\");\r\n\r\n/**\r\n * Clone the given line.\r\n *\r\n * @function Phaser.Geom.Line.Clone\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} source - The source line to clone.\r\n *\r\n * @return {Phaser.Geom.Line} The cloned line.\r\n */\r\nvar Clone = function (source)\r\n{\r\n return new Line(source.x1, source.y1, source.x2, source.y2);\r\n};\r\n\r\nmodule.exports = Clone;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/Clone.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/CopyFrom.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/geom/line/CopyFrom.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Copy the values of one line to a destination line.\r\n *\r\n * @function Phaser.Geom.Line.CopyFrom\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [dest,$return]\r\n *\r\n * @param {Phaser.Geom.Line} source - The source line to copy the values from.\r\n * @param {Phaser.Geom.Line} dest - The destination line to copy the values to.\r\n *\r\n * @return {Phaser.Geom.Line} The destination line.\r\n */\r\nvar CopyFrom = function (source, dest)\r\n{\r\n return dest.setTo(source.x1, source.y1, source.x2, source.y2);\r\n};\r\n\r\nmodule.exports = CopyFrom;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/CopyFrom.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/Equals.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/geom/line/Equals.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compare two lines for strict equality.\r\n *\r\n * @function Phaser.Geom.Line.Equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The first line to compare.\r\n * @param {Phaser.Geom.Line} toCompare - The second line to compare.\r\n *\r\n * @return {boolean} Whether the two lines are equal.\r\n */\r\nvar Equals = function (line, toCompare)\r\n{\r\n return (\r\n line.x1 === toCompare.x1 &&\r\n line.y1 === toCompare.y1 &&\r\n line.x2 === toCompare.x2 &&\r\n line.y2 === toCompare.y2\r\n );\r\n};\r\n\r\nmodule.exports = Equals;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/Equals.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/Extend.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/geom/line/Extend.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Length = __webpack_require__(/*! ./Length */ \"./node_modules/phaser/src/geom/line/Length.js\");\r\n\r\n/**\r\n * Extends the start and end points of a Line by the given amounts.\r\n *\r\n * The amounts can be positive or negative. Positive points will increase the length of the line,\r\n * while negative ones will decrease it.\r\n *\r\n * If no `right` value is provided it will extend the length of the line equally in both directions.\r\n *\r\n * Pass a value of zero to leave the start or end point unchanged.\r\n *\r\n * @function Phaser.Geom.Line.Extend\r\n * @since 3.16.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The line instance to extend.\r\n * @param {number} left - The amount to extend the start of the line by.\r\n * @param {number} [right] - The amount to extend the end of the line by. If not given it will be set to the `left` value.\r\n *\r\n * @return {Phaser.Geom.Line} The modified Line instance.\r\n */\r\nvar Extend = function (line, left, right)\r\n{\r\n if (right === undefined) { right = left; }\r\n\r\n var length = Length(line);\r\n\r\n var slopX = line.x2 - line.x1;\r\n var slopY = line.y2 - line.y1;\r\n\r\n if (left)\r\n {\r\n line.x1 = line.x1 - slopX / length * left;\r\n line.y1 = line.y1 - slopY / length * left;\r\n }\r\n\r\n if (right)\r\n {\r\n line.x2 = line.x2 + slopX / length * right;\r\n line.y2 = line.y2 + slopY / length * right;\r\n }\r\n\r\n return line;\r\n};\r\n\r\nmodule.exports = Extend;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/Extend.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/GetMidPoint.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/geom/line/GetMidPoint.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Get the midpoint of the given line.\r\n *\r\n * @function Phaser.Geom.Line.GetMidPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to get the midpoint of.\r\n * @param {(Phaser.Geom.Point|object)} [out] - An optional point object to store the midpoint in.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} The midpoint of the Line.\r\n */\r\nvar GetMidPoint = function (line, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n out.x = (line.x1 + line.x2) / 2;\r\n out.y = (line.y1 + line.y2) / 2;\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetMidPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/GetMidPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/GetNearestPoint.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/geom/line/GetNearestPoint.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Florian Mertens\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Get the nearest point on a line perpendicular to the given point.\r\n *\r\n * @function Phaser.Geom.Line.GetNearestPoint\r\n * @since 3.16.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to get the nearest point on.\r\n * @param {(Phaser.Geom.Point|object)} point - The point to get the nearest point to.\r\n * @param {(Phaser.Geom.Point|object)} [out] - An optional point, or point-like object, to store the coordinates of the nearest point on the line.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} The nearest point on the line.\r\n */\r\nvar GetNearestPoint = function (line, point, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n var x1 = line.x1;\r\n var y1 = line.y1;\r\n\r\n var x2 = line.x2;\r\n var y2 = line.y2;\r\n\r\n var L2 = (((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)));\r\n\r\n if (L2 === 0)\r\n {\r\n return out;\r\n }\r\n\r\n var r = (((point.x - x1) * (x2 - x1)) + ((point.y - y1) * (y2 - y1))) / L2;\r\n\r\n out.x = x1 + (r * (x2 - x1));\r\n out.y = y1 + (r * (y2 - y1));\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetNearestPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/GetNearestPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/GetNormal.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/geom/line/GetNormal.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\nvar Angle = __webpack_require__(/*! ./Angle */ \"./node_modules/phaser/src/geom/line/Angle.js\");\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Calculate the normal of the given line.\r\n *\r\n * The normal of a line is a vector that points perpendicular from it.\r\n *\r\n * @function Phaser.Geom.Line.GetNormal\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to calculate the normal of.\r\n * @param {(Phaser.Geom.Point|object)} [out] - An optional point object to store the normal in.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} The normal of the Line.\r\n */\r\nvar GetNormal = function (line, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n var a = Angle(line) - MATH_CONST.TAU;\r\n\r\n out.x = Math.cos(a);\r\n out.y = Math.sin(a);\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetNormal;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/GetNormal.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/GetPoint.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/geom/line/GetPoint.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Get a point on a line that's a given percentage along its length.\r\n *\r\n * @function Phaser.Geom.Line.GetPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Line} line - The line.\r\n * @param {number} position - A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line.\r\n * @param {(Phaser.Geom.Point|object)} [out] - An optional point, or point-like object, to store the coordinates of the point on the line.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} The point on the line.\r\n */\r\nvar GetPoint = function (line, position, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n out.x = line.x1 + (line.x2 - line.x1) * position;\r\n out.y = line.y1 + (line.y2 - line.y1) * position;\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/GetPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/GetPoints.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/geom/line/GetPoints.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Length = __webpack_require__(/*! ./Length */ \"./node_modules/phaser/src/geom/line/Length.js\");\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Get a number of points along a line's length.\r\n *\r\n * Provide a `quantity` to get an exact number of points along the line.\r\n *\r\n * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when\r\n * providing a `stepRate`.\r\n *\r\n * @function Phaser.Geom.Line.GetPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point[]} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Line} line - The line.\r\n * @param {integer} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead.\r\n * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`.\r\n * @param {(array|Phaser.Geom.Point[])} [out] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line.\r\n *\r\n * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line.\r\n */\r\nvar GetPoints = function (line, quantity, stepRate, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.\r\n if (!quantity)\r\n {\r\n quantity = Length(line) / stepRate;\r\n }\r\n\r\n var x1 = line.x1;\r\n var y1 = line.y1;\r\n\r\n var x2 = line.x2;\r\n var y2 = line.y2;\r\n\r\n for (var i = 0; i < quantity; i++)\r\n {\r\n var position = i / quantity;\r\n\r\n var x = x1 + (x2 - x1) * position;\r\n var y = y1 + (y2 - y1) * position;\r\n\r\n out.push(new Point(x, y));\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetPoints;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/GetPoints.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/GetShortestDistance.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/geom/line/GetShortestDistance.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @author Florian Mertens\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Get the shortest distance from a Line to the given Point.\r\n *\r\n * @function Phaser.Geom.Line.GetShortestDistance\r\n * @since 3.16.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to get the distance from.\r\n * @param {(Phaser.Geom.Point|object)} point - The point to get the shortest distance to.\r\n *\r\n * @return {number} The shortest distance from the line to the point.\r\n */\r\nvar GetShortestDistance = function (line, point)\r\n{\r\n var x1 = line.x1;\r\n var y1 = line.y1;\r\n\r\n var x2 = line.x2;\r\n var y2 = line.y2;\r\n\r\n var L2 = (((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)));\r\n\r\n if (L2 === 0)\r\n {\r\n return false;\r\n }\r\n\r\n var s = (((y1 - point.y) * (x2 - x1)) - ((x1 - point.x) * (y2 - y1))) / L2;\r\n\r\n return Math.abs(s) * Math.sqrt(L2);\r\n};\r\n\r\nmodule.exports = GetShortestDistance;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/GetShortestDistance.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/Height.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/geom/line/Height.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the height of the given line.\r\n *\r\n * @function Phaser.Geom.Line.Height\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to calculate the height of.\r\n *\r\n * @return {number} The height of the line.\r\n */\r\nvar Height = function (line)\r\n{\r\n return Math.abs(line.y1 - line.y2);\r\n};\r\n\r\nmodule.exports = Height;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/Height.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/Length.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/geom/line/Length.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the length of the given line.\r\n *\r\n * @function Phaser.Geom.Line.Length\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to calculate the length of.\r\n *\r\n * @return {number} The length of the line.\r\n */\r\nvar Length = function (line)\r\n{\r\n return Math.sqrt((line.x2 - line.x1) * (line.x2 - line.x1) + (line.y2 - line.y1) * (line.y2 - line.y1));\r\n};\r\n\r\nmodule.exports = Length;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/Length.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/Line.js": /*!***************************************************!*\ !*** ./node_modules/phaser/src/geom/line/Line.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GetPoint = __webpack_require__(/*! ./GetPoint */ \"./node_modules/phaser/src/geom/line/GetPoint.js\");\r\nvar GetPoints = __webpack_require__(/*! ./GetPoints */ \"./node_modules/phaser/src/geom/line/GetPoints.js\");\r\nvar GEOM_CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/geom/const.js\");\r\nvar Random = __webpack_require__(/*! ./Random */ \"./node_modules/phaser/src/geom/line/Random.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * Defines a Line segment, a part of a line between two endpoints.\r\n *\r\n * @class Line\r\n * @memberof Phaser.Geom\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x1=0] - The x coordinate of the lines starting point.\r\n * @param {number} [y1=0] - The y coordinate of the lines starting point.\r\n * @param {number} [x2=0] - The x coordinate of the lines ending point.\r\n * @param {number} [y2=0] - The y coordinate of the lines ending point.\r\n */\r\nvar Line = new Class({\r\n\r\n initialize:\r\n\r\n function Line (x1, y1, x2, y2)\r\n {\r\n if (x1 === undefined) { x1 = 0; }\r\n if (y1 === undefined) { y1 = 0; }\r\n if (x2 === undefined) { x2 = 0; }\r\n if (y2 === undefined) { y2 = 0; }\r\n\r\n /**\r\n * The geometry constant type of this object: `GEOM_CONST.LINE`.\r\n * Used for fast type comparisons.\r\n *\r\n * @name Phaser.Geom.Line#type\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.type = GEOM_CONST.LINE;\r\n\r\n /**\r\n * The x coordinate of the lines starting point.\r\n *\r\n * @name Phaser.Geom.Line#x1\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.x1 = x1;\r\n\r\n /**\r\n * The y coordinate of the lines starting point.\r\n *\r\n * @name Phaser.Geom.Line#y1\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.y1 = y1;\r\n\r\n /**\r\n * The x coordinate of the lines ending point.\r\n *\r\n * @name Phaser.Geom.Line#x2\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.x2 = x2;\r\n\r\n /**\r\n * The y coordinate of the lines ending point.\r\n *\r\n * @name Phaser.Geom.Line#y2\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.y2 = y2;\r\n },\r\n\r\n /**\r\n * Get a point on a line that's a given percentage along its length.\r\n *\r\n * @method Phaser.Geom.Line#getPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [output,$return]\r\n *\r\n * @param {number} position - A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line.\r\n * @param {(Phaser.Geom.Point|object)} [output] - An optional point, or point-like object, to store the coordinates of the point on the line.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point on the line.\r\n */\r\n getPoint: function (position, output)\r\n {\r\n return GetPoint(this, position, output);\r\n },\r\n\r\n /**\r\n * Get a number of points along a line's length.\r\n *\r\n * Provide a `quantity` to get an exact number of points along the line.\r\n *\r\n * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when\r\n * providing a `stepRate`.\r\n *\r\n * @method Phaser.Geom.Line#getPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point[]} O - [output,$return]\r\n *\r\n * @param {integer} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead.\r\n * @param {integer} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`.\r\n * @param {(array|Phaser.Geom.Point[])} [output] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line.\r\n *\r\n * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line.\r\n */\r\n getPoints: function (quantity, stepRate, output)\r\n {\r\n return GetPoints(this, quantity, stepRate, output);\r\n },\r\n\r\n /**\r\n * Get a random Point on the Line.\r\n *\r\n * @method Phaser.Geom.Line#getRandomPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [point,$return]\r\n *\r\n * @param {(Phaser.Geom.Point|object)} [point] - An instance of a Point to be modified.\r\n *\r\n * @return {Phaser.Geom.Point} A random Point on the Line.\r\n */\r\n getRandomPoint: function (point)\r\n {\r\n return Random(this, point);\r\n },\r\n\r\n /**\r\n * Set new coordinates for the line endpoints.\r\n *\r\n * @method Phaser.Geom.Line#setTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x1=0] - The x coordinate of the lines starting point.\r\n * @param {number} [y1=0] - The y coordinate of the lines starting point.\r\n * @param {number} [x2=0] - The x coordinate of the lines ending point.\r\n * @param {number} [y2=0] - The y coordinate of the lines ending point.\r\n *\r\n * @return {Phaser.Geom.Line} This Line object.\r\n */\r\n setTo: function (x1, y1, x2, y2)\r\n {\r\n if (x1 === undefined) { x1 = 0; }\r\n if (y1 === undefined) { y1 = 0; }\r\n if (x2 === undefined) { x2 = 0; }\r\n if (y2 === undefined) { y2 = 0; }\r\n\r\n this.x1 = x1;\r\n this.y1 = y1;\r\n\r\n this.x2 = x2;\r\n this.y2 = y2;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns a Vector2 object that corresponds to the start of this Line.\r\n *\r\n * @method Phaser.Geom.Line#getPointA\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [vec2,$return]\r\n *\r\n * @param {Phaser.Math.Vector2} [vec2] - A Vector2 object to set the results in. If `undefined` a new Vector2 will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} A Vector2 object that corresponds to the start of this Line.\r\n */\r\n getPointA: function (vec2)\r\n {\r\n if (vec2 === undefined) { vec2 = new Vector2(); }\r\n\r\n vec2.set(this.x1, this.y1);\r\n\r\n return vec2;\r\n },\r\n\r\n /**\r\n * Returns a Vector2 object that corresponds to the end of this Line.\r\n *\r\n * @method Phaser.Geom.Line#getPointB\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [vec2,$return]\r\n *\r\n * @param {Phaser.Math.Vector2} [vec2] - A Vector2 object to set the results in. If `undefined` a new Vector2 will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} A Vector2 object that corresponds to the end of this Line.\r\n */\r\n getPointB: function (vec2)\r\n {\r\n if (vec2 === undefined) { vec2 = new Vector2(); }\r\n\r\n vec2.set(this.x2, this.y2);\r\n\r\n return vec2;\r\n },\r\n\r\n /**\r\n * The left position of the Line.\r\n *\r\n * @name Phaser.Geom.Line#left\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n left: {\r\n\r\n get: function ()\r\n {\r\n return Math.min(this.x1, this.x2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (this.x1 <= this.x2)\r\n {\r\n this.x1 = value;\r\n }\r\n else\r\n {\r\n this.x2 = value;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The right position of the Line.\r\n *\r\n * @name Phaser.Geom.Line#right\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n right: {\r\n\r\n get: function ()\r\n {\r\n return Math.max(this.x1, this.x2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (this.x1 > this.x2)\r\n {\r\n this.x1 = value;\r\n }\r\n else\r\n {\r\n this.x2 = value;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The top position of the Line.\r\n *\r\n * @name Phaser.Geom.Line#top\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n top: {\r\n\r\n get: function ()\r\n {\r\n return Math.min(this.y1, this.y2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (this.y1 <= this.y2)\r\n {\r\n this.y1 = value;\r\n }\r\n else\r\n {\r\n this.y2 = value;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The bottom position of the Line.\r\n *\r\n * @name Phaser.Geom.Line#bottom\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bottom: {\r\n\r\n get: function ()\r\n {\r\n return Math.max(this.y1, this.y2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (this.y1 > this.y2)\r\n {\r\n this.y1 = value;\r\n }\r\n else\r\n {\r\n this.y2 = value;\r\n }\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Line;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/Line.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/NormalAngle.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/geom/line/NormalAngle.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\nvar Wrap = __webpack_require__(/*! ../../math/Wrap */ \"./node_modules/phaser/src/math/Wrap.js\");\r\nvar Angle = __webpack_require__(/*! ./Angle */ \"./node_modules/phaser/src/geom/line/Angle.js\");\r\n\r\n/**\r\n * Get the angle of the normal of the given line in radians.\r\n *\r\n * @function Phaser.Geom.Line.NormalAngle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to calculate the angle of the normal of.\r\n *\r\n * @return {number} The angle of the normal of the line in radians.\r\n */\r\nvar NormalAngle = function (line)\r\n{\r\n var angle = Angle(line) - MATH_CONST.TAU;\r\n\r\n return Wrap(angle, -Math.PI, Math.PI);\r\n};\r\n\r\nmodule.exports = NormalAngle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/NormalAngle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/NormalX.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/geom/line/NormalX.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\nvar Angle = __webpack_require__(/*! ./Angle */ \"./node_modules/phaser/src/geom/line/Angle.js\");\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Geom.Line.NormalX\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The Line object to get the normal value from.\r\n *\r\n * @return {number} [description]\r\n */\r\nvar NormalX = function (line)\r\n{\r\n return Math.cos(Angle(line) - MATH_CONST.TAU);\r\n};\r\n\r\nmodule.exports = NormalX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/NormalX.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/NormalY.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/geom/line/NormalY.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\nvar Angle = __webpack_require__(/*! ./Angle */ \"./node_modules/phaser/src/geom/line/Angle.js\");\r\n\r\n/**\r\n * The Y value of the normal of the given line.\r\n * The normal of a line is a vector that points perpendicular from it.\r\n *\r\n * @function Phaser.Geom.Line.NormalY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to calculate the normal of.\r\n *\r\n * @return {number} The Y value of the normal of the Line.\r\n */\r\nvar NormalY = function (line)\r\n{\r\n return Math.sin(Angle(line) - MATH_CONST.TAU);\r\n};\r\n\r\nmodule.exports = NormalY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/NormalY.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/Offset.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/geom/line/Offset.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Offset a line by the given amount.\r\n *\r\n * @function Phaser.Geom.Line.Offset\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to offset.\r\n * @param {number} x - The horizontal offset to add to the line.\r\n * @param {number} y - The vertical offset to add to the line.\r\n *\r\n * @return {Phaser.Geom.Line} The offset line.\r\n */\r\nvar Offset = function (line, x, y)\r\n{\r\n line.x1 += x;\r\n line.y1 += y;\r\n\r\n line.x2 += x;\r\n line.y2 += y;\r\n\r\n return line;\r\n};\r\n\r\nmodule.exports = Offset;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/Offset.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/PerpSlope.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/geom/line/PerpSlope.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the perpendicular slope of the given line.\r\n *\r\n * @function Phaser.Geom.Line.PerpSlope\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to calculate the perpendicular slope of.\r\n *\r\n * @return {number} The perpendicular slope of the line.\r\n */\r\nvar PerpSlope = function (line)\r\n{\r\n return -((line.x2 - line.x1) / (line.y2 - line.y1));\r\n};\r\n\r\nmodule.exports = PerpSlope;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/PerpSlope.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/Random.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/geom/line/Random.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Returns a random point on a given Line.\r\n *\r\n * @function Phaser.Geom.Line.Random\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Line} line - The Line to calculate the random Point on.\r\n * @param {(Phaser.Geom.Point|object)} [out] - An instance of a Point to be modified.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} A random Point on the Line.\r\n */\r\nvar Random = function (line, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n var t = Math.random();\r\n\r\n out.x = line.x1 + t * (line.x2 - line.x1);\r\n out.y = line.y1 + t * (line.y2 - line.y1);\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = Random;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/Random.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/ReflectAngle.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/line/ReflectAngle.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Angle = __webpack_require__(/*! ./Angle */ \"./node_modules/phaser/src/geom/line/Angle.js\");\r\nvar NormalAngle = __webpack_require__(/*! ./NormalAngle */ \"./node_modules/phaser/src/geom/line/NormalAngle.js\");\r\n\r\n/**\r\n * Calculate the reflected angle between two lines.\r\n *\r\n * This is the outgoing angle based on the angle of Line 1 and the normalAngle of Line 2.\r\n *\r\n * @function Phaser.Geom.Line.ReflectAngle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} lineA - The first line.\r\n * @param {Phaser.Geom.Line} lineB - The second line.\r\n *\r\n * @return {number} The reflected angle between each line.\r\n */\r\nvar ReflectAngle = function (lineA, lineB)\r\n{\r\n return (2 * NormalAngle(lineB) - Math.PI - Angle(lineA));\r\n};\r\n\r\nmodule.exports = ReflectAngle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/ReflectAngle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/Rotate.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/geom/line/Rotate.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RotateAroundXY = __webpack_require__(/*! ./RotateAroundXY */ \"./node_modules/phaser/src/geom/line/RotateAroundXY.js\");\r\n\r\n/**\r\n * Rotate a line around its midpoint by the given angle in radians.\r\n *\r\n * @function Phaser.Geom.Line.Rotate\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to rotate.\r\n * @param {number} angle - The angle of rotation in radians.\r\n *\r\n * @return {Phaser.Geom.Line} The rotated line.\r\n */\r\nvar Rotate = function (line, angle)\r\n{\r\n var x = (line.x1 + line.x2) / 2;\r\n var y = (line.y1 + line.y2) / 2;\r\n\r\n return RotateAroundXY(line, x, y, angle);\r\n};\r\n\r\nmodule.exports = Rotate;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/Rotate.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/RotateAroundPoint.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/geom/line/RotateAroundPoint.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RotateAroundXY = __webpack_require__(/*! ./RotateAroundXY */ \"./node_modules/phaser/src/geom/line/RotateAroundXY.js\");\r\n\r\n/**\r\n * Rotate a line around a point by the given angle in radians.\r\n *\r\n * @function Phaser.Geom.Line.RotateAroundPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to rotate.\r\n * @param {(Phaser.Geom.Point|object)} point - The point to rotate the line around.\r\n * @param {number} angle - The angle of rotation in radians.\r\n *\r\n * @return {Phaser.Geom.Line} The rotated line.\r\n */\r\nvar RotateAroundPoint = function (line, point, angle)\r\n{\r\n return RotateAroundXY(line, point.x, point.y, angle);\r\n};\r\n\r\nmodule.exports = RotateAroundPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/RotateAroundPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/RotateAroundXY.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/geom/line/RotateAroundXY.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a line around the given coordinates by the given angle in radians.\r\n *\r\n * @function Phaser.Geom.Line.RotateAroundXY\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to rotate.\r\n * @param {number} x - The horizontal coordinate to rotate the line around.\r\n * @param {number} y - The vertical coordinate to rotate the line around.\r\n * @param {number} angle - The angle of rotation in radians.\r\n *\r\n * @return {Phaser.Geom.Line} The rotated line.\r\n */\r\nvar RotateAroundXY = function (line, x, y, angle)\r\n{\r\n var c = Math.cos(angle);\r\n var s = Math.sin(angle);\r\n\r\n var tx = line.x1 - x;\r\n var ty = line.y1 - y;\r\n\r\n line.x1 = tx * c - ty * s + x;\r\n line.y1 = tx * s + ty * c + y;\r\n\r\n tx = line.x2 - x;\r\n ty = line.y2 - y;\r\n\r\n line.x2 = tx * c - ty * s + x;\r\n line.y2 = tx * s + ty * c + y;\r\n\r\n return line;\r\n};\r\n\r\nmodule.exports = RotateAroundXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/RotateAroundXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/SetToAngle.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/line/SetToAngle.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Set a line to a given position, angle and length.\r\n *\r\n * @function Phaser.Geom.Line.SetToAngle\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to set.\r\n * @param {number} x - The horizontal start position of the line.\r\n * @param {number} y - The vertical start position of the line.\r\n * @param {number} angle - The angle of the line in radians.\r\n * @param {number} length - The length of the line.\r\n *\r\n * @return {Phaser.Geom.Line} The updated line.\r\n */\r\nvar SetToAngle = function (line, x, y, angle, length)\r\n{\r\n line.x1 = x;\r\n line.y1 = y;\r\n\r\n line.x2 = x + (Math.cos(angle) * length);\r\n line.y2 = y + (Math.sin(angle) * length);\r\n\r\n return line;\r\n};\r\n\r\nmodule.exports = SetToAngle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/SetToAngle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/Slope.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/geom/line/Slope.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the slope of the given line.\r\n *\r\n * @function Phaser.Geom.Line.Slope\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to calculate the slope of.\r\n *\r\n * @return {number} The slope of the line.\r\n */\r\nvar Slope = function (line)\r\n{\r\n return (line.y2 - line.y1) / (line.x2 - line.x1);\r\n};\r\n\r\nmodule.exports = Slope;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/Slope.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/Width.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/geom/line/Width.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the width of the given line.\r\n *\r\n * @function Phaser.Geom.Line.Width\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to calculate the width of.\r\n *\r\n * @return {number} The width of the line.\r\n */\r\nvar Width = function (line)\r\n{\r\n return Math.abs(line.x1 - line.x2);\r\n};\r\n\r\nmodule.exports = Width;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/Width.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/line/index.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/geom/line/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Line = __webpack_require__(/*! ./Line */ \"./node_modules/phaser/src/geom/line/Line.js\");\r\n\r\nLine.Angle = __webpack_require__(/*! ./Angle */ \"./node_modules/phaser/src/geom/line/Angle.js\");\r\nLine.BresenhamPoints = __webpack_require__(/*! ./BresenhamPoints */ \"./node_modules/phaser/src/geom/line/BresenhamPoints.js\");\r\nLine.CenterOn = __webpack_require__(/*! ./CenterOn */ \"./node_modules/phaser/src/geom/line/CenterOn.js\");\r\nLine.Clone = __webpack_require__(/*! ./Clone */ \"./node_modules/phaser/src/geom/line/Clone.js\");\r\nLine.CopyFrom = __webpack_require__(/*! ./CopyFrom */ \"./node_modules/phaser/src/geom/line/CopyFrom.js\");\r\nLine.Equals = __webpack_require__(/*! ./Equals */ \"./node_modules/phaser/src/geom/line/Equals.js\");\r\nLine.Extend = __webpack_require__(/*! ./Extend */ \"./node_modules/phaser/src/geom/line/Extend.js\");\r\nLine.GetMidPoint = __webpack_require__(/*! ./GetMidPoint */ \"./node_modules/phaser/src/geom/line/GetMidPoint.js\");\r\nLine.GetNearestPoint = __webpack_require__(/*! ./GetNearestPoint */ \"./node_modules/phaser/src/geom/line/GetNearestPoint.js\");\r\nLine.GetNormal = __webpack_require__(/*! ./GetNormal */ \"./node_modules/phaser/src/geom/line/GetNormal.js\");\r\nLine.GetPoint = __webpack_require__(/*! ./GetPoint */ \"./node_modules/phaser/src/geom/line/GetPoint.js\");\r\nLine.GetPoints = __webpack_require__(/*! ./GetPoints */ \"./node_modules/phaser/src/geom/line/GetPoints.js\");\r\nLine.GetShortestDistance = __webpack_require__(/*! ./GetShortestDistance */ \"./node_modules/phaser/src/geom/line/GetShortestDistance.js\");\r\nLine.Height = __webpack_require__(/*! ./Height */ \"./node_modules/phaser/src/geom/line/Height.js\");\r\nLine.Length = __webpack_require__(/*! ./Length */ \"./node_modules/phaser/src/geom/line/Length.js\");\r\nLine.NormalAngle = __webpack_require__(/*! ./NormalAngle */ \"./node_modules/phaser/src/geom/line/NormalAngle.js\");\r\nLine.NormalX = __webpack_require__(/*! ./NormalX */ \"./node_modules/phaser/src/geom/line/NormalX.js\");\r\nLine.NormalY = __webpack_require__(/*! ./NormalY */ \"./node_modules/phaser/src/geom/line/NormalY.js\");\r\nLine.Offset = __webpack_require__(/*! ./Offset */ \"./node_modules/phaser/src/geom/line/Offset.js\");\r\nLine.PerpSlope = __webpack_require__(/*! ./PerpSlope */ \"./node_modules/phaser/src/geom/line/PerpSlope.js\");\r\nLine.Random = __webpack_require__(/*! ./Random */ \"./node_modules/phaser/src/geom/line/Random.js\");\r\nLine.ReflectAngle = __webpack_require__(/*! ./ReflectAngle */ \"./node_modules/phaser/src/geom/line/ReflectAngle.js\");\r\nLine.Rotate = __webpack_require__(/*! ./Rotate */ \"./node_modules/phaser/src/geom/line/Rotate.js\");\r\nLine.RotateAroundPoint = __webpack_require__(/*! ./RotateAroundPoint */ \"./node_modules/phaser/src/geom/line/RotateAroundPoint.js\");\r\nLine.RotateAroundXY = __webpack_require__(/*! ./RotateAroundXY */ \"./node_modules/phaser/src/geom/line/RotateAroundXY.js\");\r\nLine.SetToAngle = __webpack_require__(/*! ./SetToAngle */ \"./node_modules/phaser/src/geom/line/SetToAngle.js\");\r\nLine.Slope = __webpack_require__(/*! ./Slope */ \"./node_modules/phaser/src/geom/line/Slope.js\");\r\nLine.Width = __webpack_require__(/*! ./Width */ \"./node_modules/phaser/src/geom/line/Width.js\");\r\n\r\nmodule.exports = Line;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/line/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/Ceil.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/geom/point/Ceil.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Apply `Math.ceil()` to each coordinate of the given Point.\r\n *\r\n * @function Phaser.Geom.Point.Ceil\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [point,$return]\r\n *\r\n * @param {Phaser.Geom.Point} point - The Point to ceil.\r\n *\r\n * @return {Phaser.Geom.Point} The Point with `Math.ceil()` applied to its coordinates.\r\n */\r\nvar Ceil = function (point)\r\n{\r\n return point.setTo(Math.ceil(point.x), Math.ceil(point.y));\r\n};\r\n\r\nmodule.exports = Ceil;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/Ceil.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/Clone.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/geom/point/Clone.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ./Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Clone the given Point.\r\n *\r\n * @function Phaser.Geom.Point.Clone\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Point} source - The source Point to clone.\r\n *\r\n * @return {Phaser.Geom.Point} The cloned Point.\r\n */\r\nvar Clone = function (source)\r\n{\r\n return new Point(source.x, source.y);\r\n};\r\n\r\nmodule.exports = Clone;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/Clone.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/CopyFrom.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/geom/point/CopyFrom.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Copy the values of one Point to a destination Point.\r\n *\r\n * @function Phaser.Geom.Point.CopyFrom\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [dest,$return]\r\n *\r\n * @param {Phaser.Geom.Point} source - The source Point to copy the values from.\r\n * @param {Phaser.Geom.Point} dest - The destination Point to copy the values to.\r\n *\r\n * @return {Phaser.Geom.Point} The destination Point.\r\n */\r\nvar CopyFrom = function (source, dest)\r\n{\r\n return dest.setTo(source.x, source.y);\r\n};\r\n\r\nmodule.exports = CopyFrom;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/CopyFrom.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/Equals.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/geom/point/Equals.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * A comparison of two `Point` objects to see if they are equal.\r\n *\r\n * @function Phaser.Geom.Point.Equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Point} point - The original `Point` to compare against.\r\n * @param {Phaser.Geom.Point} toCompare - The second `Point` to compare.\r\n *\r\n * @return {boolean} Returns true if the both `Point` objects are equal.\r\n */\r\nvar Equals = function (point, toCompare)\r\n{\r\n return (point.x === toCompare.x && point.y === toCompare.y);\r\n};\r\n\r\nmodule.exports = Equals;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/Equals.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/Floor.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/geom/point/Floor.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Apply `Math.ceil()` to each coordinate of the given Point.\r\n *\r\n * @function Phaser.Geom.Point.Floor\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [point,$return]\r\n *\r\n * @param {Phaser.Geom.Point} point - The Point to floor.\r\n *\r\n * @return {Phaser.Geom.Point} The Point with `Math.floor()` applied to its coordinates.\r\n */\r\nvar Floor = function (point)\r\n{\r\n return point.setTo(Math.floor(point.x), Math.floor(point.y));\r\n};\r\n\r\nmodule.exports = Floor;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/Floor.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/GetCentroid.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/point/GetCentroid.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ./Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Get the centroid or geometric center of a plane figure (the arithmetic mean position of all the points in the figure).\r\n * Informally, it is the point at which a cutout of the shape could be perfectly balanced on the tip of a pin.\r\n *\r\n * @function Phaser.Geom.Point.GetCentroid\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Point[]} points - [description]\r\n * @param {Phaser.Geom.Point} [out] - [description]\r\n *\r\n * @return {Phaser.Geom.Point} [description]\r\n */\r\nvar GetCentroid = function (points, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n if (!Array.isArray(points))\r\n {\r\n throw new Error('GetCentroid points argument must be an array');\r\n }\r\n\r\n var len = points.length;\r\n\r\n if (len < 1)\r\n {\r\n throw new Error('GetCentroid points array must not be empty');\r\n }\r\n else if (len === 1)\r\n {\r\n out.x = points[0].x;\r\n out.y = points[0].y;\r\n }\r\n else\r\n {\r\n for (var i = 0; i < len; i++)\r\n {\r\n out.x += points[i].x;\r\n out.y += points[i].y;\r\n }\r\n\r\n out.x /= len;\r\n out.y /= len;\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetCentroid;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/GetCentroid.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/GetMagnitude.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/geom/point/GetMagnitude.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the magnitude of the point, which equivalent to the length of the line from the origin to this point.\r\n *\r\n * @function Phaser.Geom.Point.GetMagnitude\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Point} point - The point to calculate the magnitude for\r\n *\r\n * @return {number} The resulting magnitude\r\n */\r\nvar GetMagnitude = function (point)\r\n{\r\n return Math.sqrt((point.x * point.x) + (point.y * point.y));\r\n};\r\n\r\nmodule.exports = GetMagnitude;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/GetMagnitude.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/GetMagnitudeSq.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/geom/point/GetMagnitudeSq.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the square of magnitude of given point.(Can be used for fast magnitude calculation of point)\r\n *\r\n * @function Phaser.Geom.Point.GetMagnitudeSq\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Point} point - Returns square of the magnitude/length of given point.\r\n *\r\n * @return {number} Returns square of the magnitude of given point.\r\n */\r\nvar GetMagnitudeSq = function (point)\r\n{\r\n return (point.x * point.x) + (point.y * point.y);\r\n};\r\n\r\nmodule.exports = GetMagnitudeSq;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/GetMagnitudeSq.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/GetRectangleFromPoints.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/geom/point/GetRectangleFromPoints.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Rectangle = __webpack_require__(/*! ../rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\n\r\n/**\r\n * Calculates the Axis Aligned Bounding Box (or aabb) from an array of points.\r\n *\r\n * @function Phaser.Geom.Point.GetRectangleFromPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Point[]} points - [description]\r\n * @param {Phaser.Geom.Rectangle} [out] - [description]\r\n *\r\n * @return {Phaser.Geom.Rectangle} [description]\r\n */\r\nvar GetRectangleFromPoints = function (points, out)\r\n{\r\n if (out === undefined) { out = new Rectangle(); }\r\n\r\n var xMax = Number.NEGATIVE_INFINITY;\r\n var xMin = Number.POSITIVE_INFINITY;\r\n var yMax = Number.NEGATIVE_INFINITY;\r\n var yMin = Number.POSITIVE_INFINITY;\r\n\r\n for (var i = 0; i < points.length; i++)\r\n {\r\n var point = points[i];\r\n\r\n if (point.x > xMax)\r\n {\r\n xMax = point.x;\r\n }\r\n\r\n if (point.x < xMin)\r\n {\r\n xMin = point.x;\r\n }\r\n\r\n if (point.y > yMax)\r\n {\r\n yMax = point.y;\r\n }\r\n\r\n if (point.y < yMin)\r\n {\r\n yMin = point.y;\r\n }\r\n }\r\n\r\n out.x = xMin;\r\n out.y = yMin;\r\n out.width = xMax - xMin;\r\n out.height = yMax - yMin;\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetRectangleFromPoints;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/GetRectangleFromPoints.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/Interpolate.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/point/Interpolate.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ./Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Geom.Point.Interpolate\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Point} pointA - The starting `Point` for the interpolation.\r\n * @param {Phaser.Geom.Point} pointB - The target `Point` for the interpolation.\r\n * @param {number} [t=0] - The amount to interpolate between the two points. Generally, a value between 0 (returns the starting `Point`) and 1 (returns the target `Point`). If omitted, 0 is used.\r\n * @param {(Phaser.Geom.Point|object)} [out] - An optional `Point` object whose `x` and `y` values will be set to the result of the interpolation (can also be any object with `x` and `y` properties). If omitted, a new `Point` created and returned.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} Either the object from the `out` argument with the properties `x` and `y` set to the result of the interpolation or a newly created `Point` object.\r\n */\r\nvar Interpolate = function (pointA, pointB, t, out)\r\n{\r\n if (t === undefined) { t = 0; }\r\n if (out === undefined) { out = new Point(); }\r\n\r\n out.x = pointA.x + ((pointB.x - pointA.x) * t);\r\n out.y = pointA.y + ((pointB.y - pointA.y) * t);\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = Interpolate;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/Interpolate.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/Invert.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/geom/point/Invert.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Swaps the X and the Y coordinate of a point.\r\n *\r\n * @function Phaser.Geom.Point.Invert\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [point,$return]\r\n *\r\n * @param {Phaser.Geom.Point} point - The Point to modify.\r\n *\r\n * @return {Phaser.Geom.Point} The modified `point`.\r\n */\r\nvar Invert = function (point)\r\n{\r\n return point.setTo(point.y, point.x);\r\n};\r\n\r\nmodule.exports = Invert;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/Invert.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/Negative.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/geom/point/Negative.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ./Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Inverts a Point's coordinates.\r\n *\r\n * @function Phaser.Geom.Point.Negative\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Point} point - The Point to invert.\r\n * @param {Phaser.Geom.Point} [out] - The Point to return the inverted coordinates in.\r\n *\r\n * @return {Phaser.Geom.Point} The modified `out` Point, or a new Point if none was provided.\r\n */\r\nvar Negative = function (point, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n return out.setTo(-point.x, -point.y);\r\n};\r\n\r\nmodule.exports = Negative;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/Negative.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/Point.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/geom/point/Point.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GEOM_CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/geom/const.js\");\r\n\r\n/**\r\n * @classdesc\r\n * Defines a Point in 2D space, with an x and y component.\r\n *\r\n * @class Point\r\n * @memberof Phaser.Geom\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The x coordinate of this Point.\r\n * @param {number} [y=x] - The y coordinate of this Point.\r\n */\r\nvar Point = new Class({\r\n\r\n initialize:\r\n\r\n function Point (x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = x; }\r\n\r\n /**\r\n * The geometry constant type of this object: `GEOM_CONST.POINT`.\r\n * Used for fast type comparisons.\r\n *\r\n * @name Phaser.Geom.Point#type\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.type = GEOM_CONST.POINT;\r\n\r\n /**\r\n * The x coordinate of this Point.\r\n *\r\n * @name Phaser.Geom.Point#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = x;\r\n\r\n /**\r\n * The y coordinate of this Point.\r\n *\r\n * @name Phaser.Geom.Point#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = y;\r\n },\r\n\r\n /**\r\n * Set the x and y coordinates of the point to the given values.\r\n *\r\n * @method Phaser.Geom.Point#setTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The x coordinate of this Point.\r\n * @param {number} [y=x] - The y coordinate of this Point.\r\n *\r\n * @return {Phaser.Geom.Point} This Point object.\r\n */\r\n setTo: function (x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Point;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/Point.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/Project.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/geom/point/Project.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ./Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\nvar GetMagnitudeSq = __webpack_require__(/*! ./GetMagnitudeSq */ \"./node_modules/phaser/src/geom/point/GetMagnitudeSq.js\");\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Geom.Point.Project\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Point} pointA - [description]\r\n * @param {Phaser.Geom.Point} pointB - [description]\r\n * @param {Phaser.Geom.Point} [out] - [description]\r\n *\r\n * @return {Phaser.Geom.Point} [description]\r\n */\r\nvar Project = function (pointA, pointB, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n var dot = ((pointA.x * pointB.x) + (pointA.y * pointB.y));\r\n var amt = dot / GetMagnitudeSq(pointB);\r\n\r\n if (amt !== 0)\r\n {\r\n out.x = amt * pointB.x;\r\n out.y = amt * pointB.y;\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = Project;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/Project.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/ProjectUnit.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/point/ProjectUnit.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ./Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Geom.Point.ProjectUnit\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Point} pointA - [description]\r\n * @param {Phaser.Geom.Point} pointB - [description]\r\n * @param {Phaser.Geom.Point} [out] - [description]\r\n *\r\n * @return {Phaser.Geom.Point} [description]\r\n */\r\nvar ProjectUnit = function (pointA, pointB, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n var amt = ((pointA.x * pointB.x) + (pointA.y * pointB.y));\r\n\r\n if (amt !== 0)\r\n {\r\n out.x = amt * pointB.x;\r\n out.y = amt * pointB.y;\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = ProjectUnit;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/ProjectUnit.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/SetMagnitude.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/geom/point/SetMagnitude.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetMagnitude = __webpack_require__(/*! ./GetMagnitude */ \"./node_modules/phaser/src/geom/point/GetMagnitude.js\");\r\n\r\n/**\r\n * Changes the magnitude (length) of a two-dimensional vector without changing its direction.\r\n *\r\n * @function Phaser.Geom.Point.SetMagnitude\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [point,$return]\r\n *\r\n * @param {Phaser.Geom.Point} point - The Point to treat as the end point of the vector.\r\n * @param {number} magnitude - The new magnitude of the vector.\r\n *\r\n * @return {Phaser.Geom.Point} The modified Point.\r\n */\r\nvar SetMagnitude = function (point, magnitude)\r\n{\r\n if (point.x !== 0 || point.y !== 0)\r\n {\r\n var m = GetMagnitude(point);\r\n\r\n point.x /= m;\r\n point.y /= m;\r\n }\r\n\r\n point.x *= magnitude;\r\n point.y *= magnitude;\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = SetMagnitude;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/SetMagnitude.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/point/index.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/geom/point/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ./Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\nPoint.Ceil = __webpack_require__(/*! ./Ceil */ \"./node_modules/phaser/src/geom/point/Ceil.js\");\r\nPoint.Clone = __webpack_require__(/*! ./Clone */ \"./node_modules/phaser/src/geom/point/Clone.js\");\r\nPoint.CopyFrom = __webpack_require__(/*! ./CopyFrom */ \"./node_modules/phaser/src/geom/point/CopyFrom.js\");\r\nPoint.Equals = __webpack_require__(/*! ./Equals */ \"./node_modules/phaser/src/geom/point/Equals.js\");\r\nPoint.Floor = __webpack_require__(/*! ./Floor */ \"./node_modules/phaser/src/geom/point/Floor.js\");\r\nPoint.GetCentroid = __webpack_require__(/*! ./GetCentroid */ \"./node_modules/phaser/src/geom/point/GetCentroid.js\");\r\nPoint.GetMagnitude = __webpack_require__(/*! ./GetMagnitude */ \"./node_modules/phaser/src/geom/point/GetMagnitude.js\");\r\nPoint.GetMagnitudeSq = __webpack_require__(/*! ./GetMagnitudeSq */ \"./node_modules/phaser/src/geom/point/GetMagnitudeSq.js\");\r\nPoint.GetRectangleFromPoints = __webpack_require__(/*! ./GetRectangleFromPoints */ \"./node_modules/phaser/src/geom/point/GetRectangleFromPoints.js\");\r\nPoint.Interpolate = __webpack_require__(/*! ./Interpolate */ \"./node_modules/phaser/src/geom/point/Interpolate.js\");\r\nPoint.Invert = __webpack_require__(/*! ./Invert */ \"./node_modules/phaser/src/geom/point/Invert.js\");\r\nPoint.Negative = __webpack_require__(/*! ./Negative */ \"./node_modules/phaser/src/geom/point/Negative.js\");\r\nPoint.Project = __webpack_require__(/*! ./Project */ \"./node_modules/phaser/src/geom/point/Project.js\");\r\nPoint.ProjectUnit = __webpack_require__(/*! ./ProjectUnit */ \"./node_modules/phaser/src/geom/point/ProjectUnit.js\");\r\nPoint.SetMagnitude = __webpack_require__(/*! ./SetMagnitude */ \"./node_modules/phaser/src/geom/point/SetMagnitude.js\");\r\n\r\nmodule.exports = Point;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/point/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/polygon/Clone.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/geom/polygon/Clone.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Polygon = __webpack_require__(/*! ./Polygon */ \"./node_modules/phaser/src/geom/polygon/Polygon.js\");\r\n\r\n/**\r\n * Create a new polygon which is a copy of the specified polygon\r\n *\r\n * @function Phaser.Geom.Polygon.Clone\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Polygon} polygon - The polygon to create a clone of\r\n *\r\n * @return {Phaser.Geom.Polygon} A new separate Polygon cloned from the specified polygon, based on the same points.\r\n */\r\nvar Clone = function (polygon)\r\n{\r\n return new Polygon(polygon.points);\r\n};\r\n\r\nmodule.exports = Clone;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/polygon/Clone.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/polygon/Contains.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/geom/polygon/Contains.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Checks whether the x and y coordinates are contained within this polygon.\r\n// Adapted from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html by Jonas Raoni Soares Silva\r\n\r\n/**\r\n * Checks if a point is within the bounds of a Polygon.\r\n *\r\n * @function Phaser.Geom.Polygon.Contains\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Polygon} polygon - The Polygon to check against.\r\n * @param {number} x - The X coordinate of the point to check.\r\n * @param {number} y - The Y coordinate of the point to check.\r\n *\r\n * @return {boolean} `true` if the point is within the bounds of the Polygon, otherwise `false`.\r\n */\r\nvar Contains = function (polygon, x, y)\r\n{\r\n var inside = false;\r\n\r\n for (var i = -1, j = polygon.points.length - 1; ++i < polygon.points.length; j = i)\r\n {\r\n var ix = polygon.points[i].x;\r\n var iy = polygon.points[i].y;\r\n\r\n var jx = polygon.points[j].x;\r\n var jy = polygon.points[j].y;\r\n\r\n if (((iy <= y && y < jy) || (jy <= y && y < iy)) && (x < (jx - ix) * (y - iy) / (jy - iy) + ix))\r\n {\r\n inside = !inside;\r\n }\r\n }\r\n\r\n return inside;\r\n};\r\n\r\nmodule.exports = Contains;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/polygon/Contains.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/polygon/ContainsPoint.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/geom/polygon/ContainsPoint.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/polygon/Contains.js\");\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Geom.Polygon.ContainsPoint\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Polygon} polygon - [description]\r\n * @param {Phaser.Geom.Point} point - [description]\r\n *\r\n * @return {boolean} [description]\r\n */\r\nvar ContainsPoint = function (polygon, point)\r\n{\r\n return Contains(polygon, point.x, point.y);\r\n};\r\n\r\nmodule.exports = ContainsPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/polygon/ContainsPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/polygon/Earcut.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/geom/polygon/Earcut.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Earcut 2.1.4 (December 4th 2018)\r\n\r\n/*\r\n * ISC License\r\n * \r\n * Copyright (c) 2016, Mapbox\r\n * \r\n * Permission to use, copy, modify, and/or distribute this software for any purpose\r\n * with or without fee is hereby granted, provided that the above copyright notice\r\n * and this permission notice appear in all copies.\r\n * \r\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\r\n * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\r\n * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\r\n * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\r\n * THIS SOFTWARE.\r\n */\r\n\r\n\r\n\r\nmodule.exports = earcut;\r\n\r\nfunction earcut(data, holeIndices, dim) {\r\n\r\n dim = dim || 2;\r\n\r\n var hasHoles = holeIndices && holeIndices.length,\r\n outerLen = hasHoles ? holeIndices[0] * dim : data.length,\r\n outerNode = linkedList(data, 0, outerLen, dim, true),\r\n triangles = [];\r\n\r\n if (!outerNode || outerNode.next === outerNode.prev) return triangles;\r\n\r\n var minX, minY, maxX, maxY, x, y, invSize;\r\n\r\n if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\r\n\r\n // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\r\n if (data.length > 80 * dim) {\r\n minX = maxX = data[0];\r\n minY = maxY = data[1];\r\n\r\n for (var i = dim; i < outerLen; i += dim) {\r\n x = data[i];\r\n y = data[i + 1];\r\n if (x < minX) minX = x;\r\n if (y < minY) minY = y;\r\n if (x > maxX) maxX = x;\r\n if (y > maxY) maxY = y;\r\n }\r\n\r\n // minX, minY and invSize are later used to transform coords into integers for z-order calculation\r\n invSize = Math.max(maxX - minX, maxY - minY);\r\n invSize = invSize !== 0 ? 1 / invSize : 0;\r\n }\r\n\r\n earcutLinked(outerNode, triangles, dim, minX, minY, invSize);\r\n\r\n return triangles;\r\n}\r\n\r\n// create a circular doubly linked list from polygon points in the specified winding order\r\nfunction linkedList(data, start, end, dim, clockwise) {\r\n var i, last;\r\n\r\n if (clockwise === (signedArea(data, start, end, dim) > 0)) {\r\n for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\r\n } else {\r\n for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\r\n }\r\n\r\n if (last && equals(last, last.next)) {\r\n removeNode(last);\r\n last = last.next;\r\n }\r\n\r\n return last;\r\n}\r\n\r\n// eliminate collinear or duplicate points\r\nfunction filterPoints(start, end) {\r\n if (!start) return start;\r\n if (!end) end = start;\r\n\r\n var p = start,\r\n again;\r\n do {\r\n again = false;\r\n\r\n if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\r\n removeNode(p);\r\n p = end = p.prev;\r\n if (p === p.next) break;\r\n again = true;\r\n\r\n } else {\r\n p = p.next;\r\n }\r\n } while (again || p !== end);\r\n\r\n return end;\r\n}\r\n\r\n// main ear slicing loop which triangulates a polygon (given as a linked list)\r\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\r\n if (!ear) return;\r\n\r\n // interlink polygon nodes in z-order\r\n if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\r\n\r\n var stop = ear,\r\n prev, next;\r\n\r\n // iterate through ears, slicing them one by one\r\n while (ear.prev !== ear.next) {\r\n prev = ear.prev;\r\n next = ear.next;\r\n\r\n if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\r\n // cut off the triangle\r\n triangles.push(prev.i / dim);\r\n triangles.push(ear.i / dim);\r\n triangles.push(next.i / dim);\r\n\r\n removeNode(ear);\r\n\r\n // skipping the next vertex leads to less sliver triangles\r\n ear = next.next;\r\n stop = next.next;\r\n\r\n continue;\r\n }\r\n\r\n ear = next;\r\n\r\n // if we looped through the whole remaining polygon and can't find any more ears\r\n if (ear === stop) {\r\n // try filtering points and slicing again\r\n if (!pass) {\r\n earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\r\n\r\n // if this didn't work, try curing all small self-intersections locally\r\n } else if (pass === 1) {\r\n ear = cureLocalIntersections(ear, triangles, dim);\r\n earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\r\n\r\n // as a last resort, try splitting the remaining polygon into two\r\n } else if (pass === 2) {\r\n splitEarcut(ear, triangles, dim, minX, minY, invSize);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n}\r\n\r\n// check whether a polygon node forms a valid ear with adjacent nodes\r\nfunction isEar(ear) {\r\n var a = ear.prev,\r\n b = ear,\r\n c = ear.next;\r\n\r\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\r\n\r\n // now make sure we don't have other points inside the potential ear\r\n var p = ear.next.next;\r\n\r\n while (p !== ear.prev) {\r\n if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\r\n area(p.prev, p, p.next) >= 0) return false;\r\n p = p.next;\r\n }\r\n\r\n return true;\r\n}\r\n\r\nfunction isEarHashed(ear, minX, minY, invSize) {\r\n var a = ear.prev,\r\n b = ear,\r\n c = ear.next;\r\n\r\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\r\n\r\n // triangle bbox; min & max are calculated like this for speed\r\n var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x),\r\n minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y),\r\n maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x),\r\n maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y);\r\n\r\n // z-order range for the current triangle bbox;\r\n var minZ = zOrder(minTX, minTY, minX, minY, invSize),\r\n maxZ = zOrder(maxTX, maxTY, minX, minY, invSize);\r\n\r\n var p = ear.prevZ,\r\n n = ear.nextZ;\r\n\r\n // look for points inside the triangle in both directions\r\n while (p && p.z >= minZ && n && n.z <= maxZ) {\r\n if (p !== ear.prev && p !== ear.next &&\r\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\r\n area(p.prev, p, p.next) >= 0) return false;\r\n p = p.prevZ;\r\n\r\n if (n !== ear.prev && n !== ear.next &&\r\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&\r\n area(n.prev, n, n.next) >= 0) return false;\r\n n = n.nextZ;\r\n }\r\n\r\n // look for remaining points in decreasing z-order\r\n while (p && p.z >= minZ) {\r\n if (p !== ear.prev && p !== ear.next &&\r\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\r\n area(p.prev, p, p.next) >= 0) return false;\r\n p = p.prevZ;\r\n }\r\n\r\n // look for remaining points in increasing z-order\r\n while (n && n.z <= maxZ) {\r\n if (n !== ear.prev && n !== ear.next &&\r\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&\r\n area(n.prev, n, n.next) >= 0) return false;\r\n n = n.nextZ;\r\n }\r\n\r\n return true;\r\n}\r\n\r\n// go through all polygon nodes and cure small local self-intersections\r\nfunction cureLocalIntersections(start, triangles, dim) {\r\n var p = start;\r\n do {\r\n var a = p.prev,\r\n b = p.next.next;\r\n\r\n if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\r\n\r\n triangles.push(a.i / dim);\r\n triangles.push(p.i / dim);\r\n triangles.push(b.i / dim);\r\n\r\n // remove two nodes involved\r\n removeNode(p);\r\n removeNode(p.next);\r\n\r\n p = start = b;\r\n }\r\n p = p.next;\r\n } while (p !== start);\r\n\r\n return p;\r\n}\r\n\r\n// try splitting polygon into two and triangulate them independently\r\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\r\n // look for a valid diagonal that divides the polygon into two\r\n var a = start;\r\n do {\r\n var b = a.next.next;\r\n while (b !== a.prev) {\r\n if (a.i !== b.i && isValidDiagonal(a, b)) {\r\n // split the polygon in two by the diagonal\r\n var c = splitPolygon(a, b);\r\n\r\n // filter collinear points around the cuts\r\n a = filterPoints(a, a.next);\r\n c = filterPoints(c, c.next);\r\n\r\n // run earcut on each half\r\n earcutLinked(a, triangles, dim, minX, minY, invSize);\r\n earcutLinked(c, triangles, dim, minX, minY, invSize);\r\n return;\r\n }\r\n b = b.next;\r\n }\r\n a = a.next;\r\n } while (a !== start);\r\n}\r\n\r\n// link every hole into the outer loop, producing a single-ring polygon without holes\r\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\r\n var queue = [],\r\n i, len, start, end, list;\r\n\r\n for (i = 0, len = holeIndices.length; i < len; i++) {\r\n start = holeIndices[i] * dim;\r\n end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\r\n list = linkedList(data, start, end, dim, false);\r\n if (list === list.next) list.steiner = true;\r\n queue.push(getLeftmost(list));\r\n }\r\n\r\n queue.sort(compareX);\r\n\r\n // process holes from left to right\r\n for (i = 0; i < queue.length; i++) {\r\n eliminateHole(queue[i], outerNode);\r\n outerNode = filterPoints(outerNode, outerNode.next);\r\n }\r\n\r\n return outerNode;\r\n}\r\n\r\nfunction compareX(a, b) {\r\n return a.x - b.x;\r\n}\r\n\r\n// find a bridge between vertices that connects hole with an outer ring and and link it\r\nfunction eliminateHole(hole, outerNode) {\r\n outerNode = findHoleBridge(hole, outerNode);\r\n if (outerNode) {\r\n var b = splitPolygon(outerNode, hole);\r\n filterPoints(b, b.next);\r\n }\r\n}\r\n\r\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\r\nfunction findHoleBridge(hole, outerNode) {\r\n var p = outerNode,\r\n hx = hole.x,\r\n hy = hole.y,\r\n qx = -Infinity,\r\n m;\r\n\r\n // find a segment intersected by a ray from the hole's leftmost point to the left;\r\n // segment's endpoint with lesser x will be potential connection point\r\n do {\r\n if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\r\n var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\r\n if (x <= hx && x > qx) {\r\n qx = x;\r\n if (x === hx) {\r\n if (hy === p.y) return p;\r\n if (hy === p.next.y) return p.next;\r\n }\r\n m = p.x < p.next.x ? p : p.next;\r\n }\r\n }\r\n p = p.next;\r\n } while (p !== outerNode);\r\n\r\n if (!m) return null;\r\n\r\n if (hx === qx) return m.prev; // hole touches outer segment; pick lower endpoint\r\n\r\n // look for points inside the triangle of hole point, segment intersection and endpoint;\r\n // if there are no points found, we have a valid connection;\r\n // otherwise choose the point of the minimum angle with the ray as connection point\r\n\r\n var stop = m,\r\n mx = m.x,\r\n my = m.y,\r\n tanMin = Infinity,\r\n tan;\r\n\r\n p = m.next;\r\n\r\n while (p !== stop) {\r\n if (hx >= p.x && p.x >= mx && hx !== p.x &&\r\n pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\r\n\r\n tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\r\n\r\n if ((tan < tanMin || (tan === tanMin && p.x > m.x)) && locallyInside(p, hole)) {\r\n m = p;\r\n tanMin = tan;\r\n }\r\n }\r\n\r\n p = p.next;\r\n }\r\n\r\n return m;\r\n}\r\n\r\n// interlink polygon nodes in z-order\r\nfunction indexCurve(start, minX, minY, invSize) {\r\n var p = start;\r\n do {\r\n if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize);\r\n p.prevZ = p.prev;\r\n p.nextZ = p.next;\r\n p = p.next;\r\n } while (p !== start);\r\n\r\n p.prevZ.nextZ = null;\r\n p.prevZ = null;\r\n\r\n sortLinked(p);\r\n}\r\n\r\n// Simon Tatham's linked list merge sort algorithm\r\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\r\nfunction sortLinked(list) {\r\n var i, p, q, e, tail, numMerges, pSize, qSize,\r\n inSize = 1;\r\n\r\n do {\r\n p = list;\r\n list = null;\r\n tail = null;\r\n numMerges = 0;\r\n\r\n while (p) {\r\n numMerges++;\r\n q = p;\r\n pSize = 0;\r\n for (i = 0; i < inSize; i++) {\r\n pSize++;\r\n q = q.nextZ;\r\n if (!q) break;\r\n }\r\n qSize = inSize;\r\n\r\n while (pSize > 0 || (qSize > 0 && q)) {\r\n\r\n if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\r\n e = p;\r\n p = p.nextZ;\r\n pSize--;\r\n } else {\r\n e = q;\r\n q = q.nextZ;\r\n qSize--;\r\n }\r\n\r\n if (tail) tail.nextZ = e;\r\n else list = e;\r\n\r\n e.prevZ = tail;\r\n tail = e;\r\n }\r\n\r\n p = q;\r\n }\r\n\r\n tail.nextZ = null;\r\n inSize *= 2;\r\n\r\n } while (numMerges > 1);\r\n\r\n return list;\r\n}\r\n\r\n// z-order of a point given coords and inverse of the longer side of data bbox\r\nfunction zOrder(x, y, minX, minY, invSize) {\r\n // coords are transformed into non-negative 15-bit integer range\r\n x = 32767 * (x - minX) * invSize;\r\n y = 32767 * (y - minY) * invSize;\r\n\r\n x = (x | (x << 8)) & 0x00FF00FF;\r\n x = (x | (x << 4)) & 0x0F0F0F0F;\r\n x = (x | (x << 2)) & 0x33333333;\r\n x = (x | (x << 1)) & 0x55555555;\r\n\r\n y = (y | (y << 8)) & 0x00FF00FF;\r\n y = (y | (y << 4)) & 0x0F0F0F0F;\r\n y = (y | (y << 2)) & 0x33333333;\r\n y = (y | (y << 1)) & 0x55555555;\r\n\r\n return x | (y << 1);\r\n}\r\n\r\n// find the leftmost node of a polygon ring\r\nfunction getLeftmost(start) {\r\n var p = start,\r\n leftmost = start;\r\n do {\r\n if (p.x < leftmost.x) leftmost = p;\r\n p = p.next;\r\n } while (p !== start);\r\n\r\n return leftmost;\r\n}\r\n\r\n// check if a point lies within a convex triangle\r\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\r\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\r\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\r\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\r\n}\r\n\r\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\r\nfunction isValidDiagonal(a, b) {\r\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) &&\r\n locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b);\r\n}\r\n\r\n// signed area of a triangle\r\nfunction area(p, q, r) {\r\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\r\n}\r\n\r\n// check if two points are equal\r\nfunction equals(p1, p2) {\r\n return p1.x === p2.x && p1.y === p2.y;\r\n}\r\n\r\n// check if two segments intersect\r\nfunction intersects(p1, q1, p2, q2) {\r\n if ((equals(p1, q1) && equals(p2, q2)) ||\r\n (equals(p1, q2) && equals(p2, q1))) return true;\r\n return area(p1, q1, p2) > 0 !== area(p1, q1, q2) > 0 &&\r\n area(p2, q2, p1) > 0 !== area(p2, q2, q1) > 0;\r\n}\r\n\r\n// check if a polygon diagonal intersects any polygon segments\r\nfunction intersectsPolygon(a, b) {\r\n var p = a;\r\n do {\r\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\r\n intersects(p, p.next, a, b)) return true;\r\n p = p.next;\r\n } while (p !== a);\r\n\r\n return false;\r\n}\r\n\r\n// check if a polygon diagonal is locally inside the polygon\r\nfunction locallyInside(a, b) {\r\n return area(a.prev, a, a.next) < 0 ?\r\n area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\r\n area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\r\n}\r\n\r\n// check if the middle point of a polygon diagonal is inside the polygon\r\nfunction middleInside(a, b) {\r\n var p = a,\r\n inside = false,\r\n px = (a.x + b.x) / 2,\r\n py = (a.y + b.y) / 2;\r\n do {\r\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\r\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\r\n inside = !inside;\r\n p = p.next;\r\n } while (p !== a);\r\n\r\n return inside;\r\n}\r\n\r\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\r\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\r\nfunction splitPolygon(a, b) {\r\n var a2 = new Node(a.i, a.x, a.y),\r\n b2 = new Node(b.i, b.x, b.y),\r\n an = a.next,\r\n bp = b.prev;\r\n\r\n a.next = b;\r\n b.prev = a;\r\n\r\n a2.next = an;\r\n an.prev = a2;\r\n\r\n b2.next = a2;\r\n a2.prev = b2;\r\n\r\n bp.next = b2;\r\n b2.prev = bp;\r\n\r\n return b2;\r\n}\r\n\r\n// create a node and optionally link it with previous one (in a circular doubly linked list)\r\nfunction insertNode(i, x, y, last) {\r\n var p = new Node(i, x, y);\r\n\r\n if (!last) {\r\n p.prev = p;\r\n p.next = p;\r\n\r\n } else {\r\n p.next = last.next;\r\n p.prev = last;\r\n last.next.prev = p;\r\n last.next = p;\r\n }\r\n return p;\r\n}\r\n\r\nfunction removeNode(p) {\r\n p.next.prev = p.prev;\r\n p.prev.next = p.next;\r\n\r\n if (p.prevZ) p.prevZ.nextZ = p.nextZ;\r\n if (p.nextZ) p.nextZ.prevZ = p.prevZ;\r\n}\r\n\r\nfunction Node(i, x, y) {\r\n // vertex index in coordinates array\r\n this.i = i;\r\n\r\n // vertex coordinates\r\n this.x = x;\r\n this.y = y;\r\n\r\n // previous and next vertex nodes in a polygon ring\r\n this.prev = null;\r\n this.next = null;\r\n\r\n // z-order curve value\r\n this.z = null;\r\n\r\n // previous and next nodes in z-order\r\n this.prevZ = null;\r\n this.nextZ = null;\r\n\r\n // indicates whether this is a steiner point\r\n this.steiner = false;\r\n}\r\n\r\n// return a percentage difference between the polygon area and its triangulation area;\r\n// used to verify correctness of triangulation\r\nearcut.deviation = function (data, holeIndices, dim, triangles) {\r\n var hasHoles = holeIndices && holeIndices.length;\r\n var outerLen = hasHoles ? holeIndices[0] * dim : data.length;\r\n\r\n var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\r\n if (hasHoles) {\r\n for (var i = 0, len = holeIndices.length; i < len; i++) {\r\n var start = holeIndices[i] * dim;\r\n var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\r\n polygonArea -= Math.abs(signedArea(data, start, end, dim));\r\n }\r\n }\r\n\r\n var trianglesArea = 0;\r\n for (i = 0; i < triangles.length; i += 3) {\r\n var a = triangles[i] * dim;\r\n var b = triangles[i + 1] * dim;\r\n var c = triangles[i + 2] * dim;\r\n trianglesArea += Math.abs(\r\n (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\r\n (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\r\n }\r\n\r\n return polygonArea === 0 && trianglesArea === 0 ? 0 :\r\n Math.abs((trianglesArea - polygonArea) / polygonArea);\r\n};\r\n\r\nfunction signedArea(data, start, end, dim) {\r\n var sum = 0;\r\n for (var i = start, j = end - dim; i < end; i += dim) {\r\n sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\r\n j = i;\r\n }\r\n return sum;\r\n}\r\n\r\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\r\nearcut.flatten = function (data) {\r\n var dim = data[0][0].length,\r\n result = {vertices: [], holes: [], dimensions: dim},\r\n holeIndex = 0;\r\n\r\n for (var i = 0; i < data.length; i++) {\r\n for (var j = 0; j < data[i].length; j++) {\r\n for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);\r\n }\r\n if (i > 0) {\r\n holeIndex += data[i - 1].length;\r\n result.holes.push(holeIndex);\r\n }\r\n }\r\n return result;\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/polygon/Earcut.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/polygon/GetAABB.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/polygon/GetAABB.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Rectangle = __webpack_require__(/*! ../rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\n\r\n/**\r\n * Calculates the bounding AABB rectangle of a polygon.\r\n *\r\n * @function Phaser.Geom.Polygon.GetAABB\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Polygon} polygon - The polygon that should be calculated.\r\n * @param {(Phaser.Geom.Rectangle|object)} [out] - The rectangle or object that has x, y, width, and height properties to store the result. Optional.\r\n *\r\n * @return {(Phaser.Geom.Rectangle|object)} The resulting rectangle or object that is passed in with position and dimensions of the polygon's AABB.\r\n */\r\nvar GetAABB = function (polygon, out)\r\n{\r\n if (out === undefined) { out = new Rectangle(); }\r\n\r\n var minX = Infinity;\r\n var minY = Infinity;\r\n var maxX = -minX;\r\n var maxY = -minY;\r\n var p;\r\n\r\n for (var i = 0; i < polygon.points.length; i++)\r\n {\r\n p = polygon.points[i];\r\n\r\n minX = Math.min(minX, p.x);\r\n minY = Math.min(minY, p.y);\r\n maxX = Math.max(maxX, p.x);\r\n maxY = Math.max(maxY, p.y);\r\n }\r\n\r\n out.x = minX;\r\n out.y = minY;\r\n out.width = maxX - minX;\r\n out.height = maxY - minY;\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetAABB;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/polygon/GetAABB.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/polygon/GetNumberArray.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/geom/polygon/GetNumberArray.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Export the points as an array of flat numbers, following the sequence [ x,y, x,y, x,y ]\r\n\r\n/**\r\n * Stores all of the points of a Polygon into a flat array of numbers following the sequence [ x,y, x,y, x,y ],\r\n * i.e. each point of the Polygon, in the order it's defined, corresponds to two elements of the resultant\r\n * array for the point's X and Y coordinate.\r\n *\r\n * @function Phaser.Geom.Polygon.GetNumberArray\r\n * @since 3.0.0\r\n *\r\n * @generic {number[]} O - [output,$return]\r\n *\r\n * @param {Phaser.Geom.Polygon} polygon - The Polygon whose points to export.\r\n * @param {(array|number[])} [output] - An array to which the points' coordinates should be appended.\r\n *\r\n * @return {(array|number[])} The modified `output` array, or a new array if none was given.\r\n */\r\nvar GetNumberArray = function (polygon, output)\r\n{\r\n if (output === undefined) { output = []; }\r\n\r\n for (var i = 0; i < polygon.points.length; i++)\r\n {\r\n output.push(polygon.points[i].x);\r\n output.push(polygon.points[i].y);\r\n }\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = GetNumberArray;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/polygon/GetNumberArray.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/polygon/GetPoints.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/polygon/GetPoints.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Length = __webpack_require__(/*! ../line/Length */ \"./node_modules/phaser/src/geom/line/Length.js\");\r\nvar Line = __webpack_require__(/*! ../line/Line */ \"./node_modules/phaser/src/geom/line/Line.js\");\r\nvar Perimeter = __webpack_require__(/*! ./Perimeter */ \"./node_modules/phaser/src/geom/polygon/Perimeter.js\");\r\n\r\n/**\r\n * Returns an array of Point objects containing the coordinates of the points around the perimeter of the Polygon,\r\n * based on the given quantity or stepRate values.\r\n *\r\n * @function Phaser.Geom.Polygon.GetPoints\r\n * @since 3.12.0\r\n *\r\n * @param {Phaser.Geom.Polygon} polygon - The Polygon to get the points from.\r\n * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead.\r\n * @param {number} [stepRate] - Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate.\r\n * @param {array} [output] - An array to insert the points in to. If not provided a new array will be created.\r\n *\r\n * @return {Phaser.Geom.Point[]} An array of Point objects pertaining to the points around the perimeter of the Polygon.\r\n */\r\nvar GetPoints = function (polygon, quantity, stepRate, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n var points = polygon.points;\r\n var perimeter = Perimeter(polygon);\r\n\r\n // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.\r\n if (!quantity)\r\n {\r\n quantity = perimeter / stepRate;\r\n }\r\n\r\n for (var i = 0; i < quantity; i++)\r\n {\r\n var position = perimeter * (i / quantity);\r\n var accumulatedPerimeter = 0;\r\n\r\n for (var j = 0; j < points.length; j++)\r\n {\r\n var pointA = points[j];\r\n var pointB = points[(j + 1) % points.length];\r\n var line = new Line(\r\n pointA.x,\r\n pointA.y,\r\n pointB.x,\r\n pointB.y\r\n );\r\n var length = Length(line);\r\n\r\n if (position < accumulatedPerimeter || position > accumulatedPerimeter + length)\r\n {\r\n accumulatedPerimeter += length;\r\n continue;\r\n }\r\n\r\n var point = line.getPoint((position - accumulatedPerimeter) / length);\r\n out.push(point);\r\n\r\n break;\r\n }\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetPoints;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/polygon/GetPoints.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/polygon/Perimeter.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/polygon/Perimeter.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Length = __webpack_require__(/*! ../line/Length */ \"./node_modules/phaser/src/geom/line/Length.js\");\r\nvar Line = __webpack_require__(/*! ../line/Line */ \"./node_modules/phaser/src/geom/line/Line.js\");\r\n\r\n/**\r\n * Returns the perimeter of the given Polygon.\r\n *\r\n * @function Phaser.Geom.Polygon.Perimeter\r\n * @since 3.12.0\r\n *\r\n * @param {Phaser.Geom.Polygon} polygon - The Polygon to get the perimeter of.\r\n *\r\n * @return {number} The perimeter of the Polygon.\r\n */\r\nvar Perimeter = function (polygon)\r\n{\r\n var points = polygon.points;\r\n var perimeter = 0;\r\n\r\n for (var i = 0; i < points.length; i++)\r\n {\r\n var pointA = points[i];\r\n var pointB = points[(i + 1) % points.length];\r\n var line = new Line(\r\n pointA.x,\r\n pointA.y,\r\n pointB.x,\r\n pointB.y\r\n );\r\n\r\n perimeter += Length(line);\r\n }\r\n\r\n return perimeter;\r\n};\r\n\r\nmodule.exports = Perimeter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/polygon/Perimeter.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/polygon/Polygon.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/polygon/Polygon.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/polygon/Contains.js\");\r\nvar GetPoints = __webpack_require__(/*! ./GetPoints */ \"./node_modules/phaser/src/geom/polygon/GetPoints.js\");\r\nvar GEOM_CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/geom/const.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Polygon object\r\n *\r\n * The polygon is a closed shape consists of a series of connected straight lines defined by list of ordered points.\r\n * Several formats are supported to define the list of points, check the setTo method for details. \r\n * This is a geometry object allowing you to define and inspect the shape.\r\n * It is not a Game Object, in that you cannot add it to the display list, and it has no texture.\r\n * To render a Polygon you should look at the capabilities of the Graphics class.\r\n *\r\n * @class Polygon\r\n * @memberof Phaser.Geom\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Point[]} [points] - List of points defining the perimeter of this Polygon. Several formats are supported: \r\n * - A string containing paired x y values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'`\r\n * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]`\r\n * - An array of objects with public x y properties: `[obj1, obj2, ...]`\r\n * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]`\r\n * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]`\r\n */\r\nvar Polygon = new Class({\r\n\r\n initialize:\r\n\r\n function Polygon (points)\r\n {\r\n /**\r\n * The geometry constant type of this object: `GEOM_CONST.POLYGON`.\r\n * Used for fast type comparisons.\r\n *\r\n * @name Phaser.Geom.Polygon#type\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.type = GEOM_CONST.POLYGON;\r\n\r\n /**\r\n * The area of this Polygon.\r\n *\r\n * @name Phaser.Geom.Polygon#area\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.area = 0;\r\n\r\n /**\r\n * An array of number pair objects that make up this polygon. I.e. [ {x,y}, {x,y}, {x,y} ]\r\n *\r\n * @name Phaser.Geom.Polygon#points\r\n * @type {Phaser.Geom.Point[]}\r\n * @since 3.0.0\r\n */\r\n this.points = [];\r\n\r\n if (points)\r\n {\r\n this.setTo(points);\r\n }\r\n },\r\n\r\n /**\r\n * Check to see if the Polygon contains the given x / y coordinates.\r\n *\r\n * @method Phaser.Geom.Polygon#contains\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate to check within the polygon.\r\n * @param {number} y - The y coordinate to check within the polygon.\r\n *\r\n * @return {boolean} `true` if the coordinates are within the polygon, otherwise `false`.\r\n */\r\n contains: function (x, y)\r\n {\r\n return Contains(this, x, y);\r\n },\r\n\r\n /**\r\n * Sets this Polygon to the given points.\r\n *\r\n * The points can be set from a variety of formats:\r\n *\r\n * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'`\r\n * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]`\r\n * - An array of objects with public x/y properties: `[obj1, obj2, ...]`\r\n * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]`\r\n * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]`\r\n *\r\n * `setTo` may also be called without any arguments to remove all points.\r\n *\r\n * @method Phaser.Geom.Polygon#setTo\r\n * @since 3.0.0\r\n *\r\n * @param {array} points - Points defining the perimeter of this polygon. Please check function description above for the different supported formats.\r\n *\r\n * @return {Phaser.Geom.Polygon} This Polygon object.\r\n */\r\n setTo: function (points)\r\n {\r\n this.area = 0;\r\n this.points = [];\r\n\r\n if (typeof points === 'string')\r\n {\r\n points = points.split(' ');\r\n }\r\n\r\n if (!Array.isArray(points))\r\n {\r\n return this;\r\n }\r\n\r\n var p;\r\n var y0 = Number.MAX_VALUE;\r\n\r\n // The points argument is an array, so iterate through it\r\n for (var i = 0; i < points.length; i++)\r\n {\r\n p = { x: 0, y: 0 };\r\n\r\n if (typeof points[i] === 'number' || typeof points[i] === 'string')\r\n {\r\n p.x = parseFloat(points[i]);\r\n p.y = parseFloat(points[i + 1]);\r\n i++;\r\n }\r\n else if (Array.isArray(points[i]))\r\n {\r\n // An array of arrays?\r\n p.x = points[i][0];\r\n p.y = points[i][1];\r\n }\r\n else\r\n {\r\n p.x = points[i].x;\r\n p.y = points[i].y;\r\n }\r\n\r\n this.points.push(p);\r\n\r\n // Lowest boundary\r\n if (p.y < y0)\r\n {\r\n y0 = p.y;\r\n }\r\n }\r\n\r\n this.calculateArea(y0);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculates the area of the Polygon. This is available in the property Polygon.area\r\n *\r\n * @method Phaser.Geom.Polygon#calculateArea\r\n * @since 3.0.0\r\n *\r\n * @return {number} The area of the polygon.\r\n */\r\n calculateArea: function ()\r\n {\r\n if (this.points.length < 3)\r\n {\r\n this.area = 0;\r\n\r\n return this.area;\r\n }\r\n\r\n var sum = 0;\r\n var p1;\r\n var p2;\r\n\r\n for (var i = 0; i < this.points.length - 1; i++)\r\n {\r\n p1 = this.points[i];\r\n p2 = this.points[i + 1];\r\n\r\n sum += (p2.x - p1.x) * (p1.y + p2.y);\r\n }\r\n\r\n p1 = this.points[0];\r\n p2 = this.points[this.points.length - 1];\r\n\r\n sum += (p1.x - p2.x) * (p2.y + p1.y);\r\n\r\n this.area = -sum * 0.5;\r\n\r\n return this.area;\r\n },\r\n\r\n /**\r\n * Returns an array of Point objects containing the coordinates of the points around the perimeter of the Polygon,\r\n * based on the given quantity or stepRate values.\r\n *\r\n * @method Phaser.Geom.Polygon#getPoints\r\n * @since 3.12.0\r\n *\r\n * @generic {Phaser.Geom.Point[]} O - [output,$return]\r\n *\r\n * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead.\r\n * @param {number} [stepRate] - Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate.\r\n * @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created.\r\n *\r\n * @return {(array|Phaser.Geom.Point[])} An array of Point objects pertaining to the points around the perimeter of the Polygon.\r\n */\r\n getPoints: function (quantity, step, output)\r\n {\r\n return GetPoints(this, quantity, step, output);\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Polygon;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/polygon/Polygon.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/polygon/Reverse.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/polygon/Reverse.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Reverses the order of the points of a Polygon.\r\n *\r\n * @function Phaser.Geom.Polygon.Reverse\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Polygon} O - [polygon,$return]\r\n *\r\n * @param {Phaser.Geom.Polygon} polygon - The Polygon to modify.\r\n *\r\n * @return {Phaser.Geom.Polygon} The modified Polygon.\r\n */\r\nvar Reverse = function (polygon)\r\n{\r\n polygon.points.reverse();\r\n\r\n return polygon;\r\n};\r\n\r\nmodule.exports = Reverse;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/polygon/Reverse.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/polygon/Smooth.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/geom/polygon/Smooth.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @author Igor Ognichenko \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @ignore\r\n */\r\nvar copy = function (out, a)\r\n{\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n \r\n return out;\r\n};\r\n\r\n/**\r\n * Takes a Polygon object and applies Chaikin's smoothing algorithm on its points.\r\n *\r\n * @function Phaser.Geom.Polygon.Smooth\r\n * @since 3.13.0\r\n *\r\n * @generic {Phaser.Geom.Polygon} O - [polygon,$return]\r\n *\r\n * @param {Phaser.Geom.Polygon} polygon - The polygon to be smoothed. The polygon will be modified in-place and returned.\r\n *\r\n * @return {Phaser.Geom.Polygon} The input polygon.\r\n */\r\nvar Smooth = function (polygon)\r\n{\r\n var i;\r\n var points = [];\r\n var data = polygon.points;\r\n\r\n for (i = 0; i < data.length; i++)\r\n {\r\n points.push([ data[i].x, data[i].y ]);\r\n }\r\n\r\n var output = [];\r\n \r\n if (points.length > 0)\r\n {\r\n output.push(copy([ 0, 0 ], points[0]));\r\n }\r\n \r\n for (i = 0; i < points.length - 1; i++)\r\n {\r\n var p0 = points[i];\r\n var p1 = points[i + 1];\r\n var p0x = p0[0];\r\n var p0y = p0[1];\r\n var p1x = p1[0];\r\n var p1y = p1[1];\r\n\r\n output.push([ 0.85 * p0x + 0.15 * p1x, 0.85 * p0y + 0.15 * p1y ]);\r\n output.push([ 0.15 * p0x + 0.85 * p1x, 0.15 * p0y + 0.85 * p1y ]);\r\n }\r\n \r\n if (points.length > 1)\r\n {\r\n output.push(copy([ 0, 0 ], points[points.length - 1]));\r\n }\r\n \r\n return polygon.setTo(output);\r\n};\r\n\r\nmodule.exports = Smooth;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/polygon/Smooth.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/polygon/index.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/geom/polygon/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Polygon = __webpack_require__(/*! ./Polygon */ \"./node_modules/phaser/src/geom/polygon/Polygon.js\");\r\n\r\nPolygon.Clone = __webpack_require__(/*! ./Clone */ \"./node_modules/phaser/src/geom/polygon/Clone.js\");\r\nPolygon.Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/polygon/Contains.js\");\r\nPolygon.ContainsPoint = __webpack_require__(/*! ./ContainsPoint */ \"./node_modules/phaser/src/geom/polygon/ContainsPoint.js\");\r\nPolygon.GetAABB = __webpack_require__(/*! ./GetAABB */ \"./node_modules/phaser/src/geom/polygon/GetAABB.js\");\r\nPolygon.GetNumberArray = __webpack_require__(/*! ./GetNumberArray */ \"./node_modules/phaser/src/geom/polygon/GetNumberArray.js\");\r\nPolygon.GetPoints = __webpack_require__(/*! ./GetPoints */ \"./node_modules/phaser/src/geom/polygon/GetPoints.js\");\r\nPolygon.Perimeter = __webpack_require__(/*! ./Perimeter */ \"./node_modules/phaser/src/geom/polygon/Perimeter.js\");\r\nPolygon.Reverse = __webpack_require__(/*! ./Reverse */ \"./node_modules/phaser/src/geom/polygon/Reverse.js\");\r\nPolygon.Smooth = __webpack_require__(/*! ./Smooth */ \"./node_modules/phaser/src/geom/polygon/Smooth.js\");\r\n\r\nmodule.exports = Polygon;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/polygon/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Area.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Area.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the area of the given Rectangle object.\r\n *\r\n * @function Phaser.Geom.Rectangle.Area\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The rectangle to calculate the area of.\r\n *\r\n * @return {number} The area of the Rectangle object.\r\n */\r\nvar Area = function (rect)\r\n{\r\n return rect.width * rect.height;\r\n};\r\n\r\nmodule.exports = Area;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Area.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Ceil.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Ceil.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rounds a Rectangle's position up to the smallest integer greater than or equal to each current coordinate.\r\n *\r\n * @function Phaser.Geom.Rectangle.Ceil\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [rect,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The adjusted Rectangle.\r\n */\r\nvar Ceil = function (rect)\r\n{\r\n rect.x = Math.ceil(rect.x);\r\n rect.y = Math.ceil(rect.y);\r\n\r\n return rect;\r\n};\r\n\r\nmodule.exports = Ceil;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Ceil.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/CeilAll.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/CeilAll.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rounds a Rectangle's position and size up to the smallest integer greater than or equal to each respective value.\r\n *\r\n * @function Phaser.Geom.Rectangle.CeilAll\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [rect,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to modify.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The modified Rectangle.\r\n */\r\nvar CeilAll = function (rect)\r\n{\r\n rect.x = Math.ceil(rect.x);\r\n rect.y = Math.ceil(rect.y);\r\n rect.width = Math.ceil(rect.width);\r\n rect.height = Math.ceil(rect.height);\r\n\r\n return rect;\r\n};\r\n\r\nmodule.exports = CeilAll;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/CeilAll.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/CenterOn.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/CenterOn.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Centers this Rectangle so that the center coordinates match the given x and y values.\r\n\r\n/**\r\n * Moves the top-left corner of a Rectangle so that its center is at the given coordinates.\r\n *\r\n * @function Phaser.Geom.Rectangle.CenterOn\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [rect,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to be centered.\r\n * @param {number} x - The X coordinate of the Rectangle's center.\r\n * @param {number} y - The Y coordinate of the Rectangle's center.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The centered rectangle.\r\n */\r\nvar CenterOn = function (rect, x, y)\r\n{\r\n rect.x = x - (rect.width / 2);\r\n rect.y = y - (rect.height / 2);\r\n\r\n return rect;\r\n};\r\n\r\nmodule.exports = CenterOn;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/CenterOn.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Clone.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Clone.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Rectangle = __webpack_require__(/*! ./Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\n\r\n/**\r\n * Creates a new Rectangle which is identical to the given one.\r\n *\r\n * @function Phaser.Geom.Rectangle.Clone\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} source - The Rectangle to clone.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The newly created Rectangle, which is separate from the given one.\r\n */\r\nvar Clone = function (source)\r\n{\r\n return new Rectangle(source.x, source.y, source.width, source.height);\r\n};\r\n\r\nmodule.exports = Clone;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Clone.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Contains.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Contains.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if a given point is inside a Rectangle's bounds.\r\n *\r\n * @function Phaser.Geom.Rectangle.Contains\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to check.\r\n * @param {number} x - The X coordinate of the point to check.\r\n * @param {number} y - The Y coordinate of the point to check.\r\n *\r\n * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`.\r\n */\r\nvar Contains = function (rect, x, y)\r\n{\r\n if (rect.width <= 0 || rect.height <= 0)\r\n {\r\n return false;\r\n }\r\n\r\n return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y);\r\n};\r\n\r\nmodule.exports = Contains;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Contains.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/ContainsPoint.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/ContainsPoint.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/rectangle/Contains.js\");\r\n\r\n/**\r\n * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object.\r\n *\r\n * @function Phaser.Geom.Rectangle.ContainsPoint\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle object.\r\n * @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.\r\n *\r\n * @return {boolean} A value of true if the Rectangle object contains the specified point, otherwise false.\r\n */\r\nvar ContainsPoint = function (rect, point)\r\n{\r\n return Contains(rect, point.x, point.y);\r\n};\r\n\r\nmodule.exports = ContainsPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/ContainsPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/ContainsRect.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/ContainsRect.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Tests if one rectangle fully contains another.\r\n *\r\n * @function Phaser.Geom.Rectangle.ContainsRect\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rectA - The first rectangle.\r\n * @param {Phaser.Geom.Rectangle} rectB - The second rectangle.\r\n *\r\n * @return {boolean} True only if rectA fully contains rectB.\r\n */\r\nvar ContainsRect = function (rectA, rectB)\r\n{\r\n // Volume check (if rectB volume > rectA then rectA cannot contain it)\r\n if ((rectB.width * rectB.height) > (rectA.width * rectA.height))\r\n {\r\n return false;\r\n }\r\n\r\n return (\r\n (rectB.x > rectA.x && rectB.x < rectA.right) &&\r\n (rectB.right > rectA.x && rectB.right < rectA.right) &&\r\n (rectB.y > rectA.y && rectB.y < rectA.bottom) &&\r\n (rectB.bottom > rectA.y && rectB.bottom < rectA.bottom)\r\n );\r\n};\r\n\r\nmodule.exports = ContainsRect;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/ContainsRect.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/CopyFrom.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/CopyFrom.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Copy the values of one Rectangle to a destination Rectangle.\r\n *\r\n * @function Phaser.Geom.Rectangle.CopyFrom\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [dest,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} source - The source Rectangle to copy the values from.\r\n * @param {Phaser.Geom.Rectangle} dest - The destination Rectangle to copy the values to.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The destination Rectangle.\r\n */\r\nvar CopyFrom = function (source, dest)\r\n{\r\n return dest.setTo(source.x, source.y, source.width, source.height);\r\n};\r\n\r\nmodule.exports = CopyFrom;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/CopyFrom.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Decompose.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Decompose.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Create an array of points for each corner of a Rectangle\r\n * If an array is specified, each point object will be added to the end of the array, otherwise a new array will be created.\r\n *\r\n * @function Phaser.Geom.Rectangle.Decompose\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle object to be decomposed.\r\n * @param {array} [out] - If provided, each point will be added to this array.\r\n *\r\n * @return {array} Will return the array you specified or a new array containing the points of the Rectangle.\r\n */\r\nvar Decompose = function (rect, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n out.push({ x: rect.x, y: rect.y });\r\n out.push({ x: rect.right, y: rect.y });\r\n out.push({ x: rect.right, y: rect.bottom });\r\n out.push({ x: rect.x, y: rect.bottom });\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = Decompose;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Decompose.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Equals.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Equals.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compares the `x`, `y`, `width` and `height` properties of two rectangles.\r\n *\r\n * @function Phaser.Geom.Rectangle.Equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - Rectangle A\r\n * @param {Phaser.Geom.Rectangle} toCompare - Rectangle B\r\n *\r\n * @return {boolean} `true` if the rectangles' properties are an exact match, otherwise `false`.\r\n */\r\nvar Equals = function (rect, toCompare)\r\n{\r\n return (\r\n rect.x === toCompare.x &&\r\n rect.y === toCompare.y &&\r\n rect.width === toCompare.width &&\r\n rect.height === toCompare.height\r\n );\r\n};\r\n\r\nmodule.exports = Equals;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Equals.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/FitInside.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/FitInside.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetAspectRatio = __webpack_require__(/*! ./GetAspectRatio */ \"./node_modules/phaser/src/geom/rectangle/GetAspectRatio.js\");\r\n\r\n/**\r\n * Adjusts the target rectangle, changing its width, height and position,\r\n * so that it fits inside the area of the source rectangle, while maintaining its original\r\n * aspect ratio.\r\n * \r\n * Unlike the `FitOutside` function, there may be some space inside the source area not covered.\r\n *\r\n * @function Phaser.Geom.Rectangle.FitInside\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [target,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} target - The target rectangle to adjust.\r\n * @param {Phaser.Geom.Rectangle} source - The source rectangle to envelop the target in.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The modified target rectangle instance.\r\n */\r\nvar FitInside = function (target, source)\r\n{\r\n var ratio = GetAspectRatio(target);\r\n\r\n if (ratio < GetAspectRatio(source))\r\n {\r\n // Taller than Wide\r\n target.setSize(source.height * ratio, source.height);\r\n }\r\n else\r\n {\r\n // Wider than Tall\r\n target.setSize(source.width, source.width / ratio);\r\n }\r\n\r\n return target.setPosition(\r\n source.centerX - (target.width / 2),\r\n source.centerY - (target.height / 2)\r\n );\r\n};\r\n\r\nmodule.exports = FitInside;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/FitInside.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/FitOutside.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/FitOutside.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetAspectRatio = __webpack_require__(/*! ./GetAspectRatio */ \"./node_modules/phaser/src/geom/rectangle/GetAspectRatio.js\");\r\n\r\n/**\r\n * Adjusts the target rectangle, changing its width, height and position,\r\n * so that it fully covers the area of the source rectangle, while maintaining its original\r\n * aspect ratio.\r\n * \r\n * Unlike the `FitInside` function, the target rectangle may extend further out than the source.\r\n *\r\n * @function Phaser.Geom.Rectangle.FitOutside\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [target,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} target - The target rectangle to adjust.\r\n * @param {Phaser.Geom.Rectangle} source - The source rectangle to envelope the target in.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The modified target rectangle instance.\r\n */\r\nvar FitOutside = function (target, source)\r\n{\r\n var ratio = GetAspectRatio(target);\r\n\r\n if (ratio > GetAspectRatio(source))\r\n {\r\n // Wider than Tall\r\n target.setSize(source.height * ratio, source.height);\r\n }\r\n else\r\n {\r\n // Taller than Wide\r\n target.setSize(source.width, source.width / ratio);\r\n }\r\n\r\n return target.setPosition(\r\n source.centerX - target.width / 2,\r\n source.centerY - target.height / 2\r\n );\r\n};\r\n\r\nmodule.exports = FitOutside;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/FitOutside.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Floor.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Floor.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rounds down (floors) the top left X and Y coordinates of the given Rectangle to the largest integer less than or equal to them\r\n *\r\n * @function Phaser.Geom.Rectangle.Floor\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [rect,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The rectangle to floor the top left X and Y coordinates of\r\n *\r\n * @return {Phaser.Geom.Rectangle} The rectangle that was passed to this function with its coordinates floored.\r\n */\r\nvar Floor = function (rect)\r\n{\r\n rect.x = Math.floor(rect.x);\r\n rect.y = Math.floor(rect.y);\r\n\r\n return rect;\r\n};\r\n\r\nmodule.exports = Floor;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Floor.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/FloorAll.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/FloorAll.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rounds a Rectangle's position and size down to the largest integer less than or equal to each current coordinate or dimension.\r\n *\r\n * @function Phaser.Geom.Rectangle.FloorAll\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [rect,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The adjusted Rectangle.\r\n */\r\nvar FloorAll = function (rect)\r\n{\r\n rect.x = Math.floor(rect.x);\r\n rect.y = Math.floor(rect.y);\r\n rect.width = Math.floor(rect.width);\r\n rect.height = Math.floor(rect.height);\r\n\r\n return rect;\r\n};\r\n\r\nmodule.exports = FloorAll;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/FloorAll.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/FromPoints.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/FromPoints.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Rectangle = __webpack_require__(/*! ./Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\n\r\n// points is an array of Point-like objects,\r\n// either 2 dimensional arrays, or objects with public x/y properties:\r\n// var points = [\r\n// [100, 200],\r\n// [200, 400],\r\n// { x: 30, y: 60 }\r\n// ]\r\n\r\n/**\r\n * Constructs new Rectangle or repositions and resizes an existing Rectangle so that all of the given points are on or within its bounds.\r\n *\r\n * @function Phaser.Geom.Rectangle.FromPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [out,$return]\r\n *\r\n * @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.\r\n * @param {Phaser.Geom.Rectangle} [out] - Optional Rectangle to adjust.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The adjusted `out` Rectangle, or a new Rectangle if none was provided.\r\n */\r\nvar FromPoints = function (points, out)\r\n{\r\n if (out === undefined) { out = new Rectangle(); }\r\n\r\n if (points.length === 0)\r\n {\r\n return out;\r\n }\r\n\r\n var minX = Number.MAX_VALUE;\r\n var minY = Number.MAX_VALUE;\r\n\r\n var maxX = MATH_CONST.MIN_SAFE_INTEGER;\r\n var maxY = MATH_CONST.MIN_SAFE_INTEGER;\r\n\r\n var p;\r\n var px;\r\n var py;\r\n\r\n for (var i = 0; i < points.length; i++)\r\n {\r\n p = points[i];\r\n\r\n if (Array.isArray(p))\r\n {\r\n px = p[0];\r\n py = p[1];\r\n }\r\n else\r\n {\r\n px = p.x;\r\n py = p.y;\r\n }\r\n\r\n minX = Math.min(minX, px);\r\n minY = Math.min(minY, py);\r\n\r\n maxX = Math.max(maxX, px);\r\n maxY = Math.max(maxY, py);\r\n }\r\n\r\n out.x = minX;\r\n out.y = minY;\r\n out.width = maxX - minX;\r\n out.height = maxY - minY;\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = FromPoints;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/FromPoints.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/GetAspectRatio.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/GetAspectRatio.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the width/height ratio of a rectangle.\r\n *\r\n * @function Phaser.Geom.Rectangle.GetAspectRatio\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The rectangle.\r\n *\r\n * @return {number} The width/height ratio of the rectangle.\r\n */\r\nvar GetAspectRatio = function (rect)\r\n{\r\n return (rect.height === 0) ? NaN : rect.width / rect.height;\r\n};\r\n\r\nmodule.exports = GetAspectRatio;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/GetAspectRatio.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/GetCenter.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/GetCenter.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Returns the center of a Rectangle as a Point.\r\n *\r\n * @function Phaser.Geom.Rectangle.GetCenter\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to get the center of.\r\n * @param {(Phaser.Geom.Point|object)} [out] - Optional point-like object to update with the center coordinates.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} The modified `out` object, or a new Point if none was provided.\r\n */\r\nvar GetCenter = function (rect, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n out.x = rect.centerX;\r\n out.y = rect.centerY;\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetCenter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/GetCenter.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/GetPoint.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/GetPoint.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Perimeter = __webpack_require__(/*! ./Perimeter */ \"./node_modules/phaser/src/geom/rectangle/Perimeter.js\");\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Position is a value between 0 and 1 where 0 = the top-left of the rectangle and 0.5 = the bottom right.\r\n *\r\n * @function Phaser.Geom.Rectangle.GetPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rectangle - [description]\r\n * @param {number} position - [description]\r\n * @param {(Phaser.Geom.Point|object)} [out] - [description]\r\n *\r\n * @return {Phaser.Geom.Point} [description]\r\n */\r\nvar GetPoint = function (rectangle, position, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n if (position <= 0 || position >= 1)\r\n {\r\n out.x = rectangle.x;\r\n out.y = rectangle.y;\r\n\r\n return out;\r\n }\r\n\r\n var p = Perimeter(rectangle) * position;\r\n\r\n if (position > 0.5)\r\n {\r\n p -= (rectangle.width + rectangle.height);\r\n\r\n if (p <= rectangle.width)\r\n {\r\n // Face 3\r\n out.x = rectangle.right - p;\r\n out.y = rectangle.bottom;\r\n }\r\n else\r\n {\r\n // Face 4\r\n out.x = rectangle.x;\r\n out.y = rectangle.bottom - (p - rectangle.width);\r\n }\r\n }\r\n else if (p <= rectangle.width)\r\n {\r\n // Face 1\r\n out.x = rectangle.x + p;\r\n out.y = rectangle.y;\r\n }\r\n else\r\n {\r\n // Face 2\r\n out.x = rectangle.right;\r\n out.y = rectangle.y + (p - rectangle.width);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/GetPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/GetPoints.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/GetPoints.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetPoint = __webpack_require__(/*! ./GetPoint */ \"./node_modules/phaser/src/geom/rectangle/GetPoint.js\");\r\nvar Perimeter = __webpack_require__(/*! ./Perimeter */ \"./node_modules/phaser/src/geom/rectangle/Perimeter.js\");\r\n\r\n// Return an array of points from the perimeter of the rectangle\r\n// each spaced out based on the quantity or step required\r\n\r\n/**\r\n * Return an array of points from the perimeter of the rectangle, each spaced out based on the quantity or step required.\r\n *\r\n * @function Phaser.Geom.Rectangle.GetPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point[]} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from.\r\n * @param {number} step - Step between points. Used to calculate the number of points to return when quantity is falsey. Ignored if quantity is positive.\r\n * @param {integer} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points.\r\n * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in.\r\n *\r\n * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle.\r\n */\r\nvar GetPoints = function (rectangle, quantity, stepRate, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.\r\n if (!quantity)\r\n {\r\n quantity = Perimeter(rectangle) / stepRate;\r\n }\r\n\r\n for (var i = 0; i < quantity; i++)\r\n {\r\n var position = i / quantity;\r\n\r\n out.push(GetPoint(rectangle, position));\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetPoints;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/GetPoints.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/GetSize.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/GetSize.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n\r\n/**\r\n * The size of the Rectangle object, expressed as a Point object\r\n * with the values of the width and height properties.\r\n *\r\n * @function Phaser.Geom.Rectangle.GetSize\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - [description]\r\n * @param {(Phaser.Geom.Point|object)} [out] - [description]\r\n *\r\n * @return {(Phaser.Geom.Point|object)} [description]\r\n */\r\nvar GetSize = function (rect, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n out.x = rect.width;\r\n out.y = rect.height;\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetSize;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/GetSize.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Inflate.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Inflate.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CenterOn = __webpack_require__(/*! ./CenterOn */ \"./node_modules/phaser/src/geom/rectangle/CenterOn.js\");\r\n\r\n\r\n/**\r\n * Increases the size of a Rectangle by a specified amount.\r\n *\r\n * The center of the Rectangle stays the same. The amounts are added to each side, so the actual increase in width or height is two times bigger than the respective argument.\r\n *\r\n * @function Phaser.Geom.Rectangle.Inflate\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [rect,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to inflate.\r\n * @param {number} x - How many pixels the left and the right side should be moved by horizontally.\r\n * @param {number} y - How many pixels the top and the bottom side should be moved by vertically.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The inflated Rectangle.\r\n */\r\nvar Inflate = function (rect, x, y)\r\n{\r\n var cx = rect.centerX;\r\n var cy = rect.centerY;\r\n\r\n rect.setSize(rect.width + (x * 2), rect.height + (y * 2));\r\n\r\n return CenterOn(rect, cx, cy);\r\n};\r\n\r\nmodule.exports = Inflate;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Inflate.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Intersection.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Intersection.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Rectangle = __webpack_require__(/*! ./Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar Intersects = __webpack_require__(/*! ../intersects/RectangleToRectangle */ \"./node_modules/phaser/src/geom/intersects/RectangleToRectangle.js\");\r\n\r\n/**\r\n * Takes two Rectangles and first checks to see if they intersect.\r\n * If they intersect it will return the area of intersection in the `out` Rectangle.\r\n * If they do not intersect, the `out` Rectangle will have a width and height of zero.\r\n *\r\n * @function Phaser.Geom.Rectangle.Intersection\r\n * @since 3.11.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [rect,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to get the intersection from.\r\n * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to get the intersection from.\r\n * @param {Phaser.Geom.Rectangle} [out] - A Rectangle to store the intersection results in.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The intersection result. If the width and height are zero, no intersection occurred.\r\n */\r\nvar Intersection = function (rectA, rectB, out)\r\n{\r\n if (out === undefined) { out = new Rectangle(); }\r\n\r\n if (Intersects(rectA, rectB))\r\n {\r\n out.x = Math.max(rectA.x, rectB.x);\r\n out.y = Math.max(rectA.y, rectB.y);\r\n out.width = Math.min(rectA.right, rectB.right) - out.x;\r\n out.height = Math.min(rectA.bottom, rectB.bottom) - out.y;\r\n }\r\n else\r\n {\r\n out.setEmpty();\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = Intersection;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Intersection.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/MarchingAnts.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/MarchingAnts.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Perimeter = __webpack_require__(/*! ./Perimeter */ \"./node_modules/phaser/src/geom/rectangle/Perimeter.js\");\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n\r\n/**\r\n * Return an array of points from the perimeter of the rectangle\r\n * each spaced out based on the quantity or step required\r\n *\r\n * @function Phaser.Geom.Rectangle.MarchingAnts\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point[]} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - [description]\r\n * @param {number} step - [description]\r\n * @param {integer} quantity - [description]\r\n * @param {(array|Phaser.Geom.Point[])} [out] - [description]\r\n *\r\n * @return {(array|Phaser.Geom.Point[])} [description]\r\n */\r\nvar MarchingAnts = function (rect, step, quantity, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n if (!step && !quantity)\r\n {\r\n // Bail out\r\n return out;\r\n }\r\n\r\n // If step is a falsey value (false, null, 0, undefined, etc) then we calculate\r\n // it based on the quantity instead, otherwise we always use the step value\r\n if (!step)\r\n {\r\n step = Perimeter(rect) / quantity;\r\n }\r\n else\r\n {\r\n quantity = Math.round(Perimeter(rect) / step);\r\n }\r\n\r\n var x = rect.x;\r\n var y = rect.y;\r\n var face = 0;\r\n\r\n // Loop across each face of the rectangle\r\n\r\n for (var i = 0; i < quantity; i++)\r\n {\r\n out.push(new Point(x, y));\r\n\r\n switch (face)\r\n {\r\n\r\n // Top face\r\n case 0:\r\n x += step;\r\n\r\n if (x >= rect.right)\r\n {\r\n face = 1;\r\n y += (x - rect.right);\r\n x = rect.right;\r\n }\r\n break;\r\n\r\n // Right face\r\n case 1:\r\n y += step;\r\n\r\n if (y >= rect.bottom)\r\n {\r\n face = 2;\r\n x -= (y - rect.bottom);\r\n y = rect.bottom;\r\n }\r\n break;\r\n\r\n // Bottom face\r\n case 2:\r\n x -= step;\r\n\r\n if (x <= rect.left)\r\n {\r\n face = 3;\r\n y -= (rect.left - x);\r\n x = rect.left;\r\n }\r\n break;\r\n\r\n // Left face\r\n case 3:\r\n y -= step;\r\n\r\n if (y <= rect.top)\r\n {\r\n face = 0;\r\n y = rect.top;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = MarchingAnts;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/MarchingAnts.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/MergePoints.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/MergePoints.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * 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.\r\n *\r\n * @function Phaser.Geom.Rectangle.MergePoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [target,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} target - The Rectangle which should be merged.\r\n * @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.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The modified Rectangle.\r\n */\r\nvar MergePoints = function (target, points)\r\n{\r\n var minX = target.x;\r\n var maxX = target.right;\r\n var minY = target.y;\r\n var maxY = target.bottom;\r\n\r\n for (var i = 0; i < points.length; i++)\r\n {\r\n minX = Math.min(minX, points[i].x);\r\n maxX = Math.max(maxX, points[i].x);\r\n minY = Math.min(minY, points[i].y);\r\n maxY = Math.max(maxY, points[i].y);\r\n }\r\n\r\n target.x = minX;\r\n target.y = minY;\r\n target.width = maxX - minX;\r\n target.height = maxY - minY;\r\n\r\n return target;\r\n};\r\n\r\nmodule.exports = MergePoints;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/MergePoints.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/MergeRect.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/MergeRect.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Merges source rectangle into target rectangle and returns target\r\n// Neither rect should have negative widths or heights\r\n\r\n/**\r\n * Merges the source rectangle into the target rectangle and returns the target.\r\n * Neither rectangle should have a negative width or height.\r\n *\r\n * @function Phaser.Geom.Rectangle.MergeRect\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [target,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} target - Target rectangle. Will be modified to include source rectangle.\r\n * @param {Phaser.Geom.Rectangle} source - Rectangle that will be merged into target rectangle.\r\n *\r\n * @return {Phaser.Geom.Rectangle} Modified target rectangle that contains source rectangle.\r\n */\r\nvar MergeRect = function (target, source)\r\n{\r\n var minX = Math.min(target.x, source.x);\r\n var maxX = Math.max(target.right, source.right);\r\n\r\n target.x = minX;\r\n target.width = maxX - minX;\r\n\r\n var minY = Math.min(target.y, source.y);\r\n var maxY = Math.max(target.bottom, source.bottom);\r\n\r\n target.y = minY;\r\n target.height = maxY - minY;\r\n\r\n return target;\r\n};\r\n\r\nmodule.exports = MergeRect;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/MergeRect.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/MergeXY.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/MergeXY.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Merges a Rectangle with a point by repositioning and/or resizing it so that the point is on or within its bounds.\r\n *\r\n * @function Phaser.Geom.Rectangle.MergeXY\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [target,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} target - The Rectangle which should be merged and modified.\r\n * @param {number} x - The X coordinate of the point which should be merged.\r\n * @param {number} y - The Y coordinate of the point which should be merged.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The modified `target` Rectangle.\r\n */\r\nvar MergeXY = function (target, x, y)\r\n{\r\n var minX = Math.min(target.x, x);\r\n var maxX = Math.max(target.right, x);\r\n\r\n target.x = minX;\r\n target.width = maxX - minX;\r\n\r\n var minY = Math.min(target.y, y);\r\n var maxY = Math.max(target.bottom, y);\r\n\r\n target.y = minY;\r\n target.height = maxY - minY;\r\n\r\n return target;\r\n};\r\n\r\nmodule.exports = MergeXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/MergeXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Offset.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Offset.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Nudges (translates) the top left corner of a Rectangle by a given offset.\r\n *\r\n * @function Phaser.Geom.Rectangle.Offset\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [rect,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust.\r\n * @param {number} x - The distance to move the Rectangle horizontally.\r\n * @param {number} y - The distance to move the Rectangle vertically.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The adjusted Rectangle.\r\n */\r\nvar Offset = function (rect, x, y)\r\n{\r\n rect.x += x;\r\n rect.y += y;\r\n\r\n return rect;\r\n};\r\n\r\nmodule.exports = Offset;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Offset.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/OffsetPoint.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/OffsetPoint.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Nudges (translates) the top-left corner of a Rectangle by the coordinates of a point (translation vector).\r\n *\r\n * @function Phaser.Geom.Rectangle.OffsetPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [rect,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust.\r\n * @param {(Phaser.Geom.Point|Phaser.Math.Vector2)} point - The point whose coordinates should be used as an offset.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The adjusted Rectangle.\r\n */\r\nvar OffsetPoint = function (rect, point)\r\n{\r\n rect.x += point.x;\r\n rect.y += point.y;\r\n\r\n return rect;\r\n};\r\n\r\nmodule.exports = OffsetPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/OffsetPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Overlaps.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Overlaps.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if two Rectangles overlap. If a Rectangle is within another Rectangle, the two will be considered overlapping. Thus, the Rectangles are treated as \"solid\".\r\n *\r\n * @function Phaser.Geom.Rectangle.Overlaps\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to check.\r\n * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to check.\r\n *\r\n * @return {boolean} `true` if the two Rectangles overlap, `false` otherwise.\r\n */\r\nvar Overlaps = function (rectA, rectB)\r\n{\r\n return (\r\n rectA.x < rectB.right &&\r\n rectA.right > rectB.x &&\r\n rectA.y < rectB.bottom &&\r\n rectA.bottom > rectB.y\r\n );\r\n};\r\n\r\nmodule.exports = Overlaps;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Overlaps.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Perimeter.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Perimeter.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the perimeter of a Rectangle.\r\n *\r\n * @function Phaser.Geom.Rectangle.Perimeter\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to use.\r\n *\r\n * @return {number} The perimeter of the Rectangle, equal to `(width * 2) + (height * 2)`.\r\n */\r\nvar Perimeter = function (rect)\r\n{\r\n return 2 * (rect.width + rect.height);\r\n};\r\n\r\nmodule.exports = Perimeter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Perimeter.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/PerimeterPoint.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/PerimeterPoint.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\nvar DegToRad = __webpack_require__(/*! ../../math/DegToRad */ \"./node_modules/phaser/src/math/DegToRad.js\");\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Geom.Rectangle.PerimeterPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rectangle - [description]\r\n * @param {integer} angle - [description]\r\n * @param {Phaser.Geom.Point} [out] - [description]\r\n *\r\n * @return {Phaser.Geom.Point} [description]\r\n */\r\nvar PerimeterPoint = function (rectangle, angle, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n angle = DegToRad(angle);\r\n\r\n var s = Math.sin(angle);\r\n var c = Math.cos(angle);\r\n\r\n var dx = (c > 0) ? rectangle.width / 2 : rectangle.width / -2;\r\n var dy = (s > 0) ? rectangle.height / 2 : rectangle.height / -2;\r\n\r\n if (Math.abs(dx * s) < Math.abs(dy * c))\r\n {\r\n dy = (dx * s) / c;\r\n }\r\n else\r\n {\r\n dx = (dy * c) / s;\r\n }\r\n\r\n out.x = dx + rectangle.centerX;\r\n out.y = dy + rectangle.centerY;\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = PerimeterPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/PerimeterPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Random.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Random.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Returns a random point within a Rectangle.\r\n *\r\n * @function Phaser.Geom.Rectangle.Random\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to return a point from.\r\n * @param {Phaser.Geom.Point} out - The object to update with the point's coordinates.\r\n *\r\n * @return {Phaser.Geom.Point} The modified `out` object, or a new Point if none was provided.\r\n */\r\nvar Random = function (rect, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n out.x = rect.x + (Math.random() * rect.width);\r\n out.y = rect.y + (Math.random() * rect.height);\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = Random;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Random.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/RandomOutside.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/RandomOutside.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Between = __webpack_require__(/*! ../../math/Between */ \"./node_modules/phaser/src/math/Between.js\");\r\nvar ContainsRect = __webpack_require__(/*! ./ContainsRect */ \"./node_modules/phaser/src/geom/rectangle/ContainsRect.js\");\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Calculates a random point that lies within the `outer` Rectangle, but outside of the `inner` Rectangle.\r\n * The inner Rectangle must be fully contained within the outer rectangle.\r\n *\r\n * @function Phaser.Geom.Rectangle.RandomOutside\r\n * @since 3.10.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} outer - The outer Rectangle to get the random point within.\r\n * @param {Phaser.Geom.Rectangle} inner - The inner Rectangle to exclude from the returned point.\r\n * @param {Phaser.Geom.Point} [out] - A Point, or Point-like object to store the result in. If not specified, a new Point will be created.\r\n *\r\n * @return {Phaser.Geom.Point} A Point object containing the random values in its `x` and `y` properties.\r\n */\r\nvar RandomOutside = function (outer, inner, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n if (ContainsRect(outer, inner))\r\n {\r\n // Pick a random quadrant\r\n //\r\n // The quadrants don't extend the full widths / heights of the outer rect to give\r\n // us a better uniformed distribution, otherwise you get clumping in the corners where\r\n // the 4 quads would overlap\r\n\r\n switch (Between(0, 3))\r\n {\r\n case 0: // Top\r\n out.x = outer.x + (Math.random() * (inner.right - outer.x));\r\n out.y = outer.y + (Math.random() * (inner.top - outer.y));\r\n break;\r\n\r\n case 1: // Bottom\r\n out.x = inner.x + (Math.random() * (outer.right - inner.x));\r\n out.y = inner.bottom + (Math.random() * (outer.bottom - inner.bottom));\r\n break;\r\n\r\n case 2: // Left\r\n out.x = outer.x + (Math.random() * (inner.x - outer.x));\r\n out.y = inner.y + (Math.random() * (outer.bottom - inner.y));\r\n break;\r\n\r\n case 3: // Right\r\n out.x = inner.right + (Math.random() * (outer.right - inner.right));\r\n out.y = outer.y + (Math.random() * (inner.bottom - outer.y));\r\n break;\r\n }\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = RandomOutside;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/RandomOutside.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Rectangle.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Rectangle.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/rectangle/Contains.js\");\r\nvar GetPoint = __webpack_require__(/*! ./GetPoint */ \"./node_modules/phaser/src/geom/rectangle/GetPoint.js\");\r\nvar GetPoints = __webpack_require__(/*! ./GetPoints */ \"./node_modules/phaser/src/geom/rectangle/GetPoints.js\");\r\nvar GEOM_CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/geom/const.js\");\r\nvar Line = __webpack_require__(/*! ../line/Line */ \"./node_modules/phaser/src/geom/line/Line.js\");\r\nvar Random = __webpack_require__(/*! ./Random */ \"./node_modules/phaser/src/geom/rectangle/Random.js\");\r\n\r\n/**\r\n * @classdesc\r\n * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height)\r\n *\r\n * @class Rectangle\r\n * @memberof Phaser.Geom\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle.\r\n * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle.\r\n * @param {number} [width=0] - The width of the Rectangle.\r\n * @param {number} [height=0] - The height of the Rectangle.\r\n */\r\nvar Rectangle = new Class({\r\n\r\n initialize:\r\n\r\n function Rectangle (x, y, width, height)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = 0; }\r\n if (height === undefined) { height = 0; }\r\n\r\n /**\r\n * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`.\r\n * Used for fast type comparisons.\r\n *\r\n * @name Phaser.Geom.Rectangle#type\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.type = GEOM_CONST.RECTANGLE;\r\n\r\n /**\r\n * The X coordinate of the top left corner of the Rectangle.\r\n *\r\n * @name Phaser.Geom.Rectangle#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = x;\r\n\r\n /**\r\n * The Y coordinate of the top left corner of the Rectangle.\r\n *\r\n * @name Phaser.Geom.Rectangle#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = y;\r\n\r\n /**\r\n * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side.\r\n *\r\n * @name Phaser.Geom.Rectangle#width\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.width = width;\r\n\r\n /**\r\n * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side.\r\n *\r\n * @name Phaser.Geom.Rectangle#height\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.height = height;\r\n },\r\n\r\n /**\r\n * Checks if the given point is inside the Rectangle's bounds.\r\n *\r\n * @method Phaser.Geom.Rectangle#contains\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The X coordinate of the point to check.\r\n * @param {number} y - The Y coordinate of the point to check.\r\n *\r\n * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`.\r\n */\r\n contains: function (x, y)\r\n {\r\n return Contains(this, x, y);\r\n },\r\n\r\n /**\r\n * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter.\r\n * \r\n * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is.\r\n * \r\n * 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.\r\n *\r\n * @method Phaser.Geom.Rectangle#getPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [output,$return]\r\n *\r\n * @param {number} position - The normalized distance into the Rectangle's perimeter to return.\r\n * @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given.\r\n */\r\n getPoint: function (position, output)\r\n {\r\n return GetPoint(this, position, output);\r\n },\r\n\r\n /**\r\n * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required.\r\n *\r\n * @method Phaser.Geom.Rectangle#getPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point[]} O - [output,$return]\r\n *\r\n * @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`.\r\n * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point.\r\n * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points.\r\n *\r\n * @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided.\r\n */\r\n getPoints: function (quantity, stepRate, output)\r\n {\r\n return GetPoints(this, quantity, stepRate, output);\r\n },\r\n\r\n /**\r\n * Returns a random point within the Rectangle's bounds.\r\n *\r\n * @method Phaser.Geom.Rectangle#getRandomPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [point,$return]\r\n *\r\n * @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point.\r\n *\r\n * @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided.\r\n */\r\n getRandomPoint: function (point)\r\n {\r\n return Random(this, point);\r\n },\r\n\r\n /**\r\n * Sets the position, width, and height of the Rectangle.\r\n *\r\n * @method Phaser.Geom.Rectangle#setTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The X coordinate of the top left corner of the Rectangle.\r\n * @param {number} y - The Y coordinate of the top left corner of the Rectangle.\r\n * @param {number} width - The width of the Rectangle.\r\n * @param {number} height - The height of the Rectangle.\r\n *\r\n * @return {Phaser.Geom.Rectangle} This Rectangle object.\r\n */\r\n setTo: function (x, y, width, height)\r\n {\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the position, width, and height of the Rectangle to 0.\r\n *\r\n * @method Phaser.Geom.Rectangle#setEmpty\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Geom.Rectangle} This Rectangle object.\r\n */\r\n setEmpty: function ()\r\n {\r\n return this.setTo(0, 0, 0, 0);\r\n },\r\n\r\n /**\r\n * Sets the position of the Rectangle.\r\n *\r\n * @method Phaser.Geom.Rectangle#setPosition\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The X coordinate of the top left corner of the Rectangle.\r\n * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle.\r\n *\r\n * @return {Phaser.Geom.Rectangle} This Rectangle object.\r\n */\r\n setPosition: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the width and height of the Rectangle.\r\n *\r\n * @method Phaser.Geom.Rectangle#setSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width to set the Rectangle to.\r\n * @param {number} [height=width] - The height to set the Rectangle to.\r\n *\r\n * @return {Phaser.Geom.Rectangle} This Rectangle object.\r\n */\r\n setSize: function (width, height)\r\n {\r\n if (height === undefined) { height = width; }\r\n\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0.\r\n *\r\n * @method Phaser.Geom.Rectangle#isEmpty\r\n * @since 3.0.0\r\n *\r\n * @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.\r\n */\r\n isEmpty: function ()\r\n {\r\n return (this.width <= 0 || this.height <= 0);\r\n },\r\n\r\n /**\r\n * Returns a Line object that corresponds to the top of this Rectangle.\r\n *\r\n * @method Phaser.Geom.Rectangle#getLineA\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created.\r\n *\r\n * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle.\r\n */\r\n getLineA: function (line)\r\n {\r\n if (line === undefined) { line = new Line(); }\r\n\r\n line.setTo(this.x, this.y, this.right, this.y);\r\n\r\n return line;\r\n },\r\n\r\n /**\r\n * Returns a Line object that corresponds to the right of this Rectangle.\r\n *\r\n * @method Phaser.Geom.Rectangle#getLineB\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created.\r\n *\r\n * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle.\r\n */\r\n getLineB: function (line)\r\n {\r\n if (line === undefined) { line = new Line(); }\r\n\r\n line.setTo(this.right, this.y, this.right, this.bottom);\r\n\r\n return line;\r\n },\r\n\r\n /**\r\n * Returns a Line object that corresponds to the bottom of this Rectangle.\r\n *\r\n * @method Phaser.Geom.Rectangle#getLineC\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created.\r\n *\r\n * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle.\r\n */\r\n getLineC: function (line)\r\n {\r\n if (line === undefined) { line = new Line(); }\r\n\r\n line.setTo(this.right, this.bottom, this.x, this.bottom);\r\n\r\n return line;\r\n },\r\n\r\n /**\r\n * Returns a Line object that corresponds to the left of this Rectangle.\r\n *\r\n * @method Phaser.Geom.Rectangle#getLineD\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created.\r\n *\r\n * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle.\r\n */\r\n getLineD: function (line)\r\n {\r\n if (line === undefined) { line = new Line(); }\r\n\r\n line.setTo(this.x, this.bottom, this.x, this.y);\r\n\r\n return line;\r\n },\r\n\r\n /**\r\n * The x coordinate of the left of the Rectangle.\r\n * 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.\r\n *\r\n * @name Phaser.Geom.Rectangle#left\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n left: {\r\n\r\n get: function ()\r\n {\r\n return this.x;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (value >= this.right)\r\n {\r\n this.width = 0;\r\n }\r\n else\r\n {\r\n this.width = this.right - value;\r\n }\r\n\r\n this.x = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The sum of the x and width properties.\r\n * 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.\r\n *\r\n * @name Phaser.Geom.Rectangle#right\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n right: {\r\n\r\n get: function ()\r\n {\r\n return this.x + this.width;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (value <= this.x)\r\n {\r\n this.width = 0;\r\n }\r\n else\r\n {\r\n this.width = value - this.x;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * 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.\r\n * However it does affect the height property, whereas changing the y value does not affect the height property.\r\n *\r\n * @name Phaser.Geom.Rectangle#top\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n top: {\r\n\r\n get: function ()\r\n {\r\n return this.y;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (value >= this.bottom)\r\n {\r\n this.height = 0;\r\n }\r\n else\r\n {\r\n this.height = (this.bottom - value);\r\n }\r\n\r\n this.y = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The sum of the y and height properties.\r\n * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property.\r\n *\r\n * @name Phaser.Geom.Rectangle#bottom\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bottom: {\r\n\r\n get: function ()\r\n {\r\n return this.y + this.height;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (value <= this.y)\r\n {\r\n this.height = 0;\r\n }\r\n else\r\n {\r\n this.height = value - this.y;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The x coordinate of the center of the Rectangle.\r\n *\r\n * @name Phaser.Geom.Rectangle#centerX\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n centerX: {\r\n\r\n get: function ()\r\n {\r\n return this.x + (this.width / 2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.x = value - (this.width / 2);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The y coordinate of the center of the Rectangle.\r\n *\r\n * @name Phaser.Geom.Rectangle#centerY\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n centerY: {\r\n\r\n get: function ()\r\n {\r\n return this.y + (this.height / 2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.y = value - (this.height / 2);\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Rectangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Rectangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/SameDimensions.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/SameDimensions.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Determines if the two objects (either Rectangles or Rectangle-like) have the same width and height values under strict equality.\r\n *\r\n * @function Phaser.Geom.Rectangle.SameDimensions\r\n * @since 3.15.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The first Rectangle object.\r\n * @param {Phaser.Geom.Rectangle} toCompare - The second Rectangle object.\r\n *\r\n * @return {boolean} `true` if the objects have equivalent values for the `width` and `height` properties, otherwise `false`.\r\n */\r\nvar SameDimensions = function (rect, toCompare)\r\n{\r\n return (rect.width === toCompare.width && rect.height === toCompare.height);\r\n};\r\n\r\nmodule.exports = SameDimensions;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/SameDimensions.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Scale.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Scale.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Scales the width and height of this Rectangle by the given amounts.\r\n\r\n/**\r\n * Scales the width and height of this Rectangle by the given amounts.\r\n *\r\n * @function Phaser.Geom.Rectangle.Scale\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [rect,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The `Rectangle` object that will be scaled by the specified amount(s).\r\n * @param {number} x - The factor by which to scale the rectangle horizontally.\r\n * @param {number} y - The amount by which to scale the rectangle vertically. If this is not specified, the rectangle will be scaled by the factor `x` in both directions.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The rectangle object with updated `width` and `height` properties as calculated from the scaling factor(s).\r\n */\r\nvar Scale = function (rect, x, y)\r\n{\r\n if (y === undefined) { y = x; }\r\n\r\n rect.width *= x;\r\n rect.height *= y;\r\n\r\n return rect;\r\n};\r\n\r\nmodule.exports = Scale;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Scale.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/Union.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/Union.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Rectangle = __webpack_require__(/*! ./Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\n\r\n/**\r\n * 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.\r\n *\r\n * @function Phaser.Geom.Rectangle.Union\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to use.\r\n * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to use.\r\n * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the union in.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided.\r\n */\r\nvar Union = function (rectA, rectB, out)\r\n{\r\n if (out === undefined) { out = new Rectangle(); }\r\n\r\n // Cache vars so we can use one of the input rects as the output rect\r\n var x = Math.min(rectA.x, rectB.x);\r\n var y = Math.min(rectA.y, rectB.y);\r\n var w = Math.max(rectA.right, rectB.right) - x;\r\n var h = Math.max(rectA.bottom, rectB.bottom) - y;\r\n\r\n return out.setTo(x, y, w, h);\r\n};\r\n\r\nmodule.exports = Union;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/Union.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/rectangle/index.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/rectangle/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Rectangle = __webpack_require__(/*! ./Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\n\r\nRectangle.Area = __webpack_require__(/*! ./Area */ \"./node_modules/phaser/src/geom/rectangle/Area.js\");\r\nRectangle.Ceil = __webpack_require__(/*! ./Ceil */ \"./node_modules/phaser/src/geom/rectangle/Ceil.js\");\r\nRectangle.CeilAll = __webpack_require__(/*! ./CeilAll */ \"./node_modules/phaser/src/geom/rectangle/CeilAll.js\");\r\nRectangle.CenterOn = __webpack_require__(/*! ./CenterOn */ \"./node_modules/phaser/src/geom/rectangle/CenterOn.js\");\r\nRectangle.Clone = __webpack_require__(/*! ./Clone */ \"./node_modules/phaser/src/geom/rectangle/Clone.js\");\r\nRectangle.Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/rectangle/Contains.js\");\r\nRectangle.ContainsPoint = __webpack_require__(/*! ./ContainsPoint */ \"./node_modules/phaser/src/geom/rectangle/ContainsPoint.js\");\r\nRectangle.ContainsRect = __webpack_require__(/*! ./ContainsRect */ \"./node_modules/phaser/src/geom/rectangle/ContainsRect.js\");\r\nRectangle.CopyFrom = __webpack_require__(/*! ./CopyFrom */ \"./node_modules/phaser/src/geom/rectangle/CopyFrom.js\");\r\nRectangle.Decompose = __webpack_require__(/*! ./Decompose */ \"./node_modules/phaser/src/geom/rectangle/Decompose.js\");\r\nRectangle.Equals = __webpack_require__(/*! ./Equals */ \"./node_modules/phaser/src/geom/rectangle/Equals.js\");\r\nRectangle.FitInside = __webpack_require__(/*! ./FitInside */ \"./node_modules/phaser/src/geom/rectangle/FitInside.js\");\r\nRectangle.FitOutside = __webpack_require__(/*! ./FitOutside */ \"./node_modules/phaser/src/geom/rectangle/FitOutside.js\");\r\nRectangle.Floor = __webpack_require__(/*! ./Floor */ \"./node_modules/phaser/src/geom/rectangle/Floor.js\");\r\nRectangle.FloorAll = __webpack_require__(/*! ./FloorAll */ \"./node_modules/phaser/src/geom/rectangle/FloorAll.js\");\r\nRectangle.FromPoints = __webpack_require__(/*! ./FromPoints */ \"./node_modules/phaser/src/geom/rectangle/FromPoints.js\");\r\nRectangle.GetAspectRatio = __webpack_require__(/*! ./GetAspectRatio */ \"./node_modules/phaser/src/geom/rectangle/GetAspectRatio.js\");\r\nRectangle.GetCenter = __webpack_require__(/*! ./GetCenter */ \"./node_modules/phaser/src/geom/rectangle/GetCenter.js\");\r\nRectangle.GetPoint = __webpack_require__(/*! ./GetPoint */ \"./node_modules/phaser/src/geom/rectangle/GetPoint.js\");\r\nRectangle.GetPoints = __webpack_require__(/*! ./GetPoints */ \"./node_modules/phaser/src/geom/rectangle/GetPoints.js\");\r\nRectangle.GetSize = __webpack_require__(/*! ./GetSize */ \"./node_modules/phaser/src/geom/rectangle/GetSize.js\");\r\nRectangle.Inflate = __webpack_require__(/*! ./Inflate */ \"./node_modules/phaser/src/geom/rectangle/Inflate.js\");\r\nRectangle.Intersection = __webpack_require__(/*! ./Intersection */ \"./node_modules/phaser/src/geom/rectangle/Intersection.js\");\r\nRectangle.MarchingAnts = __webpack_require__(/*! ./MarchingAnts */ \"./node_modules/phaser/src/geom/rectangle/MarchingAnts.js\");\r\nRectangle.MergePoints = __webpack_require__(/*! ./MergePoints */ \"./node_modules/phaser/src/geom/rectangle/MergePoints.js\");\r\nRectangle.MergeRect = __webpack_require__(/*! ./MergeRect */ \"./node_modules/phaser/src/geom/rectangle/MergeRect.js\");\r\nRectangle.MergeXY = __webpack_require__(/*! ./MergeXY */ \"./node_modules/phaser/src/geom/rectangle/MergeXY.js\");\r\nRectangle.Offset = __webpack_require__(/*! ./Offset */ \"./node_modules/phaser/src/geom/rectangle/Offset.js\");\r\nRectangle.OffsetPoint = __webpack_require__(/*! ./OffsetPoint */ \"./node_modules/phaser/src/geom/rectangle/OffsetPoint.js\");\r\nRectangle.Overlaps = __webpack_require__(/*! ./Overlaps */ \"./node_modules/phaser/src/geom/rectangle/Overlaps.js\");\r\nRectangle.Perimeter = __webpack_require__(/*! ./Perimeter */ \"./node_modules/phaser/src/geom/rectangle/Perimeter.js\");\r\nRectangle.PerimeterPoint = __webpack_require__(/*! ./PerimeterPoint */ \"./node_modules/phaser/src/geom/rectangle/PerimeterPoint.js\");\r\nRectangle.Random = __webpack_require__(/*! ./Random */ \"./node_modules/phaser/src/geom/rectangle/Random.js\");\r\nRectangle.RandomOutside = __webpack_require__(/*! ./RandomOutside */ \"./node_modules/phaser/src/geom/rectangle/RandomOutside.js\");\r\nRectangle.SameDimensions = __webpack_require__(/*! ./SameDimensions */ \"./node_modules/phaser/src/geom/rectangle/SameDimensions.js\");\r\nRectangle.Scale = __webpack_require__(/*! ./Scale */ \"./node_modules/phaser/src/geom/rectangle/Scale.js\");\r\nRectangle.Union = __webpack_require__(/*! ./Union */ \"./node_modules/phaser/src/geom/rectangle/Union.js\");\r\n\r\nmodule.exports = Rectangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/rectangle/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/Area.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/Area.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// The 2D area of a triangle. The area value is always non-negative.\r\n\r\n/**\r\n * Returns the area of a Triangle.\r\n *\r\n * @function Phaser.Geom.Triangle.Area\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to use.\r\n *\r\n * @return {number} The area of the Triangle, always non-negative.\r\n */\r\nvar Area = function (triangle)\r\n{\r\n var x1 = triangle.x1;\r\n var y1 = triangle.y1;\r\n\r\n var x2 = triangle.x2;\r\n var y2 = triangle.y2;\r\n\r\n var x3 = triangle.x3;\r\n var y3 = triangle.y3;\r\n\r\n return Math.abs(((x3 - x1) * (y2 - y1) - (x2 - x1) * (y3 - y1)) / 2);\r\n};\r\n\r\nmodule.exports = Area;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/Area.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/BuildEquilateral.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/BuildEquilateral.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Triangle = __webpack_require__(/*! ./Triangle */ \"./node_modules/phaser/src/geom/triangle/Triangle.js\");\r\n\r\n/**\r\n * 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).\r\n * The x/y specifies the top-middle of the triangle (x1/y1) and length is the length of each side.\r\n *\r\n * @function Phaser.Geom.Triangle.BuildEquilateral\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - x coordinate of the top point of the triangle.\r\n * @param {number} y - y coordinate of the top point of the triangle.\r\n * @param {number} length - Length of each side of the triangle.\r\n *\r\n * @return {Phaser.Geom.Triangle} The Triangle object of the given size.\r\n */\r\nvar BuildEquilateral = function (x, y, length)\r\n{\r\n var height = length * (Math.sqrt(3) / 2);\r\n\r\n var x1 = x;\r\n var y1 = y;\r\n\r\n var x2 = x + (length / 2);\r\n var y2 = y + height;\r\n\r\n var x3 = x - (length / 2);\r\n var y3 = y + height;\r\n\r\n return new Triangle(x1, y1, x2, y2, x3, y3);\r\n};\r\n\r\nmodule.exports = BuildEquilateral;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/BuildEquilateral.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/BuildFromPolygon.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/BuildFromPolygon.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar EarCut = __webpack_require__(/*! ../polygon/Earcut */ \"./node_modules/phaser/src/geom/polygon/Earcut.js\");\r\nvar Triangle = __webpack_require__(/*! ./Triangle */ \"./node_modules/phaser/src/geom/triangle/Triangle.js\");\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Geom.Triangle.BuildFromPolygon\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Triangle[]} O - [out,$return]\r\n *\r\n * @param {array} data - A flat array of vertex coordinates like [x0,y0, x1,y1, x2,y2, ...]\r\n * @param {array} [holes=null] - An array of hole indices if any (e.g. [5, 8] for a 12-vertex input would mean one hole with vertices 5–7 and another with 8–11).\r\n * @param {number} [scaleX=1] - [description]\r\n * @param {number} [scaleY=1] - [description]\r\n * @param {(array|Phaser.Geom.Triangle[])} [out] - [description]\r\n *\r\n * @return {(array|Phaser.Geom.Triangle[])} [description]\r\n */\r\nvar BuildFromPolygon = function (data, holes, scaleX, scaleY, out)\r\n{\r\n if (holes === undefined) { holes = null; }\r\n if (scaleX === undefined) { scaleX = 1; }\r\n if (scaleY === undefined) { scaleY = 1; }\r\n if (out === undefined) { out = []; }\r\n\r\n var tris = EarCut(data, holes);\r\n\r\n var a;\r\n var b;\r\n var c;\r\n\r\n var x1;\r\n var y1;\r\n\r\n var x2;\r\n var y2;\r\n\r\n var x3;\r\n var y3;\r\n\r\n for (var i = 0; i < tris.length; i += 3)\r\n {\r\n a = tris[i];\r\n b = tris[i + 1];\r\n c = tris[i + 2];\r\n\r\n x1 = data[a * 2] * scaleX;\r\n y1 = data[(a * 2) + 1] * scaleY;\r\n\r\n x2 = data[b * 2] * scaleX;\r\n y2 = data[(b * 2) + 1] * scaleY;\r\n\r\n x3 = data[c * 2] * scaleX;\r\n y3 = data[(c * 2) + 1] * scaleY;\r\n\r\n out.push(new Triangle(x1, y1, x2, y2, x3, y3));\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = BuildFromPolygon;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/BuildFromPolygon.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/BuildRight.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/BuildRight.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Triangle = __webpack_require__(/*! ./Triangle */ \"./node_modules/phaser/src/geom/triangle/Triangle.js\");\r\n\r\n// Builds a right triangle, with one 90 degree angle and two acute angles\r\n// The x/y is the coordinate of the 90 degree angle (and will map to x1/y1 in the resulting Triangle)\r\n// w/h can be positive or negative and represent the length of each side\r\n\r\n/**\r\n * Builds a right triangle, i.e. one which has a 90-degree angle and two acute angles.\r\n *\r\n * @function Phaser.Geom.Triangle.BuildRight\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The X coordinate of the right angle, which will also be the first X coordinate of the constructed Triangle.\r\n * @param {number} y - The Y coordinate of the right angle, which will also be the first Y coordinate of the constructed Triangle.\r\n * @param {number} width - The length of the side which is to the left or to the right of the right angle.\r\n * @param {number} height - The length of the side which is above or below the right angle.\r\n *\r\n * @return {Phaser.Geom.Triangle} The constructed right Triangle.\r\n */\r\nvar BuildRight = function (x, y, width, height)\r\n{\r\n if (height === undefined) { height = width; }\r\n\r\n // 90 degree angle\r\n var x1 = x;\r\n var y1 = y;\r\n\r\n var x2 = x;\r\n var y2 = y - height;\r\n\r\n var x3 = x + width;\r\n var y3 = y;\r\n\r\n return new Triangle(x1, y1, x2, y2, x3, y3);\r\n};\r\n\r\nmodule.exports = BuildRight;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/BuildRight.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/CenterOn.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/CenterOn.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Centroid = __webpack_require__(/*! ./Centroid */ \"./node_modules/phaser/src/geom/triangle/Centroid.js\");\r\nvar Offset = __webpack_require__(/*! ./Offset */ \"./node_modules/phaser/src/geom/triangle/Offset.js\");\r\n\r\n/**\r\n * @callback CenterFunction\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to return the center coordinates of.\r\n *\r\n * @return {Phaser.Math.Vector2} The center point of the Triangle according to the function.\r\n */\r\n\r\n/**\r\n * Positions the Triangle so that it is centered on the given coordinates.\r\n *\r\n * @function Phaser.Geom.Triangle.CenterOn\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Triangle} O - [triangle,$return]\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The triangle to be positioned.\r\n * @param {number} x - The horizontal coordinate to center on.\r\n * @param {number} y - The vertical coordinate to center on.\r\n * @param {CenterFunction} [centerFunc] - The function used to center the triangle. Defaults to Centroid centering.\r\n *\r\n * @return {Phaser.Geom.Triangle} The Triangle that was centered.\r\n */\r\nvar CenterOn = function (triangle, x, y, centerFunc)\r\n{\r\n if (centerFunc === undefined) { centerFunc = Centroid; }\r\n\r\n // Get the center of the triangle\r\n var center = centerFunc(triangle);\r\n\r\n // Difference\r\n var diffX = x - center.x;\r\n var diffY = y - center.y;\r\n\r\n return Offset(triangle, diffX, diffY);\r\n};\r\n\r\nmodule.exports = CenterOn;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/CenterOn.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/Centroid.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/Centroid.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n// The three medians (the lines drawn from the vertices to the bisectors of the opposite sides)\r\n// meet in the centroid or center of mass (center of gravity).\r\n// The centroid divides each median in a ratio of 2:1\r\n\r\n/**\r\n * Calculates the position of a Triangle's centroid, which is also its center of mass (center of gravity).\r\n *\r\n * The centroid is the point in a Triangle at which its three medians (the lines drawn from the vertices to the bisectors of the opposite sides) meet. It divides each one in a 2:1 ratio.\r\n *\r\n * @function Phaser.Geom.Triangle.Centroid\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to use.\r\n * @param {(Phaser.Geom.Point|object)} [out] - An object to store the coordinates in.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} The `out` object with modified `x` and `y` properties, or a new Point if none was provided.\r\n */\r\nvar Centroid = function (triangle, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n out.x = (triangle.x1 + triangle.x2 + triangle.x3) / 3;\r\n out.y = (triangle.y1 + triangle.y2 + triangle.y3) / 3;\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = Centroid;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/Centroid.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/CircumCenter.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/CircumCenter.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n// Adapted from http://bjornharrtell.github.io/jsts/doc/api/jsts_geom_Triangle.js.html\r\n\r\n/**\r\n * Computes the determinant of a 2x2 matrix. Uses standard double-precision arithmetic, so is susceptible to round-off error.\r\n *\r\n * @function det\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {number} m00 - The [0,0] entry of the matrix.\r\n * @param {number} m01 - The [0,1] entry of the matrix.\r\n * @param {number} m10 - The [1,0] entry of the matrix.\r\n * @param {number} m11 - The [1,1] entry of the matrix.\r\n *\r\n * @return {number} the determinant.\r\n */\r\nfunction det (m00, m01, m10, m11)\r\n{\r\n return (m00 * m11) - (m01 * m10);\r\n}\r\n\r\n/**\r\n * Computes the circumcentre of a triangle. The circumcentre is the centre of\r\n * the circumcircle, the smallest circle which encloses the triangle. It is also\r\n * the common intersection point of the perpendicular bisectors of the sides of\r\n * the triangle, and is the only point which has equal distance to all three\r\n * vertices of the triangle.\r\n *\r\n * @function Phaser.Geom.Triangle.CircumCenter\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - [description]\r\n * @param {Phaser.Math.Vector2} [out] - [description]\r\n *\r\n * @return {Phaser.Math.Vector2} [description]\r\n */\r\nvar CircumCenter = function (triangle, out)\r\n{\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n var cx = triangle.x3;\r\n var cy = triangle.y3;\r\n\r\n var ax = triangle.x1 - cx;\r\n var ay = triangle.y1 - cy;\r\n\r\n var bx = triangle.x2 - cx;\r\n var by = triangle.y2 - cy;\r\n\r\n var denom = 2 * det(ax, ay, bx, by);\r\n var numx = det(ay, ax * ax + ay * ay, by, bx * bx + by * by);\r\n var numy = det(ax, ax * ax + ay * ay, bx, bx * bx + by * by);\r\n\r\n out.x = cx - numx / denom;\r\n out.y = cy + numy / denom;\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = CircumCenter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/CircumCenter.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/CircumCircle.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/CircumCircle.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Circle = __webpack_require__(/*! ../circle/Circle */ \"./node_modules/phaser/src/geom/circle/Circle.js\");\r\n\r\n// Adapted from https://gist.github.com/mutoo/5617691\r\n\r\n/**\r\n * Finds the circumscribed circle (circumcircle) of a Triangle object. The circumcircle is the circle which touches all of the triangle's vertices.\r\n *\r\n * @function Phaser.Geom.Triangle.CircumCircle\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Circle} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to use as input.\r\n * @param {Phaser.Geom.Circle} [out] - An optional Circle to store the result in.\r\n *\r\n * @return {Phaser.Geom.Circle} The updated `out` Circle, or a new Circle if none was provided.\r\n */\r\nvar CircumCircle = function (triangle, out)\r\n{\r\n if (out === undefined) { out = new Circle(); }\r\n\r\n // A\r\n var x1 = triangle.x1;\r\n var y1 = triangle.y1;\r\n\r\n // B\r\n var x2 = triangle.x2;\r\n var y2 = triangle.y2;\r\n\r\n // C\r\n var x3 = triangle.x3;\r\n var y3 = triangle.y3;\r\n\r\n var A = x2 - x1;\r\n var B = y2 - y1;\r\n var C = x3 - x1;\r\n var D = y3 - y1;\r\n var E = A * (x1 + x2) + B * (y1 + y2);\r\n var F = C * (x1 + x3) + D * (y1 + y3);\r\n var G = 2 * (A * (y3 - y2) - B * (x3 - x2));\r\n\r\n var dx;\r\n var dy;\r\n\r\n // If the points of the triangle are collinear, then just find the\r\n // extremes and use the midpoint as the center of the circumcircle.\r\n\r\n if (Math.abs(G) < 0.000001)\r\n {\r\n var minX = Math.min(x1, x2, x3);\r\n var minY = Math.min(y1, y2, y3);\r\n dx = (Math.max(x1, x2, x3) - minX) * 0.5;\r\n dy = (Math.max(y1, y2, y3) - minY) * 0.5;\r\n\r\n out.x = minX + dx;\r\n out.y = minY + dy;\r\n out.radius = Math.sqrt(dx * dx + dy * dy);\r\n }\r\n else\r\n {\r\n out.x = (D * E - B * F) / G;\r\n out.y = (A * F - C * E) / G;\r\n dx = out.x - x1;\r\n dy = out.y - y1;\r\n out.radius = Math.sqrt(dx * dx + dy * dy);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = CircumCircle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/CircumCircle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/Clone.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/Clone.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Triangle = __webpack_require__(/*! ./Triangle */ \"./node_modules/phaser/src/geom/triangle/Triangle.js\");\r\n\r\n/**\r\n * Clones a Triangle object.\r\n *\r\n * @function Phaser.Geom.Triangle.Clone\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} source - The Triangle to clone.\r\n *\r\n * @return {Phaser.Geom.Triangle} A new Triangle identical to the given one but separate from it.\r\n */\r\nvar Clone = function (source)\r\n{\r\n return new Triangle(source.x1, source.y1, source.x2, source.y2, source.x3, source.y3);\r\n};\r\n\r\nmodule.exports = Clone;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/Clone.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/Contains.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/Contains.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// http://www.blackpawn.com/texts/pointinpoly/\r\n\r\n/**\r\n * Checks if a point (as a pair of coordinates) is inside a Triangle's bounds.\r\n *\r\n * @function Phaser.Geom.Triangle.Contains\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to check.\r\n * @param {number} x - The X coordinate of the point to check.\r\n * @param {number} y - The Y coordinate of the point to check.\r\n *\r\n * @return {boolean} `true` if the point is inside the Triangle, otherwise `false`.\r\n */\r\nvar Contains = function (triangle, x, y)\r\n{\r\n var v0x = triangle.x3 - triangle.x1;\r\n var v0y = triangle.y3 - triangle.y1;\r\n\r\n var v1x = triangle.x2 - triangle.x1;\r\n var v1y = triangle.y2 - triangle.y1;\r\n\r\n var v2x = x - triangle.x1;\r\n var v2y = y - triangle.y1;\r\n\r\n var dot00 = (v0x * v0x) + (v0y * v0y);\r\n var dot01 = (v0x * v1x) + (v0y * v1y);\r\n var dot02 = (v0x * v2x) + (v0y * v2y);\r\n var dot11 = (v1x * v1x) + (v1y * v1y);\r\n var dot12 = (v1x * v2x) + (v1y * v2y);\r\n\r\n // Compute barycentric coordinates\r\n var b = ((dot00 * dot11) - (dot01 * dot01));\r\n var inv = (b === 0) ? 0 : (1 / b);\r\n var u = ((dot11 * dot02) - (dot01 * dot12)) * inv;\r\n var v = ((dot00 * dot12) - (dot01 * dot02)) * inv;\r\n\r\n return (u >= 0 && v >= 0 && (u + v < 1));\r\n};\r\n\r\nmodule.exports = Contains;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/Contains.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/ContainsArray.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/ContainsArray.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// http://www.blackpawn.com/texts/pointinpoly/\r\n\r\n// points is an array of Point-like objects with public x/y properties\r\n// returns an array containing all points that are within the triangle, or an empty array if none\r\n// if 'returnFirst' is true it will return after the first point within the triangle is found\r\n\r\n/**\r\n * Filters an array of point-like objects to only those contained within a triangle.\r\n * 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).\r\n *\r\n * @function Phaser.Geom.Triangle.ContainsArray\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The triangle that the points are being checked in.\r\n * @param {Phaser.Geom.Point[]} points - An array of point-like objects (objects that have an `x` and `y` property)\r\n * @param {boolean} [returnFirst=false] - If `true`, return an array containing only the first point found that is within the triangle.\r\n * @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.\r\n *\r\n * @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.\r\n */\r\nvar ContainsArray = function (triangle, points, returnFirst, out)\r\n{\r\n if (returnFirst === undefined) { returnFirst = false; }\r\n if (out === undefined) { out = []; }\r\n\r\n var v0x = triangle.x3 - triangle.x1;\r\n var v0y = triangle.y3 - triangle.y1;\r\n\r\n var v1x = triangle.x2 - triangle.x1;\r\n var v1y = triangle.y2 - triangle.y1;\r\n\r\n var dot00 = (v0x * v0x) + (v0y * v0y);\r\n var dot01 = (v0x * v1x) + (v0y * v1y);\r\n var dot11 = (v1x * v1x) + (v1y * v1y);\r\n\r\n // Compute barycentric coordinates\r\n var b = ((dot00 * dot11) - (dot01 * dot01));\r\n var inv = (b === 0) ? 0 : (1 / b);\r\n\r\n var u;\r\n var v;\r\n var v2x;\r\n var v2y;\r\n var dot02;\r\n var dot12;\r\n\r\n var x1 = triangle.x1;\r\n var y1 = triangle.y1;\r\n\r\n for (var i = 0; i < points.length; i++)\r\n {\r\n v2x = points[i].x - x1;\r\n v2y = points[i].y - y1;\r\n\r\n dot02 = (v0x * v2x) + (v0y * v2y);\r\n dot12 = (v1x * v2x) + (v1y * v2y);\r\n\r\n u = ((dot11 * dot02) - (dot01 * dot12)) * inv;\r\n v = ((dot00 * dot12) - (dot01 * dot02)) * inv;\r\n \r\n if (u >= 0 && v >= 0 && (u + v < 1))\r\n {\r\n out.push({ x: points[i].x, y: points[i].y });\r\n\r\n if (returnFirst)\r\n {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = ContainsArray;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/ContainsArray.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/ContainsPoint.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/ContainsPoint.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/triangle/Contains.js\");\r\n\r\n/**\r\n * Tests if a triangle contains a point.\r\n *\r\n * @function Phaser.Geom.Triangle.ContainsPoint\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The triangle.\r\n * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|any)} point - The point to test, or any point-like object with public `x` and `y` properties.\r\n *\r\n * @return {boolean} `true` if the point is within the triangle, otherwise `false`.\r\n */\r\nvar ContainsPoint = function (triangle, point)\r\n{\r\n return Contains(triangle, point.x, point.y);\r\n};\r\n\r\nmodule.exports = ContainsPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/ContainsPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/CopyFrom.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/CopyFrom.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Copy the values of one Triangle to a destination Triangle.\r\n *\r\n * @function Phaser.Geom.Triangle.CopyFrom\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Triangle} O - [dest,$return]\r\n *\r\n * @param {Phaser.Geom.Triangle} source - The source Triangle to copy the values from.\r\n * @param {Phaser.Geom.Triangle} dest - The destination Triangle to copy the values to.\r\n *\r\n * @return {Phaser.Geom.Triangle} The destination Triangle.\r\n */\r\nvar CopyFrom = function (source, dest)\r\n{\r\n return dest.setTo(source.x1, source.y1, source.x2, source.y2, source.x3, source.y3);\r\n};\r\n\r\nmodule.exports = CopyFrom;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/CopyFrom.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/Decompose.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/Decompose.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Decomposes a Triangle into an array of its points.\r\n *\r\n * @function Phaser.Geom.Triangle.Decompose\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to decompose.\r\n * @param {array} [out] - An array to store the points into.\r\n *\r\n * @return {array} The provided `out` array, or a new array if none was provided, with three objects with `x` and `y` properties representing each point of the Triangle appended to it.\r\n */\r\nvar Decompose = function (triangle, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n out.push({ x: triangle.x1, y: triangle.y1 });\r\n out.push({ x: triangle.x2, y: triangle.y2 });\r\n out.push({ x: triangle.x3, y: triangle.y3 });\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = Decompose;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/Decompose.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/Equals.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/Equals.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns true if two triangles have the same coordinates.\r\n *\r\n * @function Phaser.Geom.Triangle.Equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The first triangle to check.\r\n * @param {Phaser.Geom.Triangle} toCompare - The second triangle to check.\r\n *\r\n * @return {boolean} `true` if the two given triangles have the exact same coordinates, otherwise `false`.\r\n */\r\nvar Equals = function (triangle, toCompare)\r\n{\r\n return (\r\n triangle.x1 === toCompare.x1 &&\r\n triangle.y1 === toCompare.y1 &&\r\n triangle.x2 === toCompare.x2 &&\r\n triangle.y2 === toCompare.y2 &&\r\n triangle.x3 === toCompare.x3 &&\r\n triangle.y3 === toCompare.y3\r\n );\r\n};\r\n\r\nmodule.exports = Equals;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/Equals.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/GetPoint.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/GetPoint.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\nvar Length = __webpack_require__(/*! ../line/Length */ \"./node_modules/phaser/src/geom/line/Length.js\");\r\n\r\n/**\r\n * Returns a Point from around the perimeter of a Triangle.\r\n *\r\n * @function Phaser.Geom.Triangle.GetPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to get the point on its perimeter from.\r\n * @param {number} position - The position along the perimeter of the triangle. A value between 0 and 1.\r\n * @param {(Phaser.Geom.Point|object)} [out] - An option Point, or Point-like object to store the value in. If not given a new Point will be created.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} A Point object containing the given position from the perimeter of the triangle.\r\n */\r\nvar GetPoint = function (triangle, position, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n var line1 = triangle.getLineA();\r\n var line2 = triangle.getLineB();\r\n var line3 = triangle.getLineC();\r\n\r\n if (position <= 0 || position >= 1)\r\n {\r\n out.x = line1.x1;\r\n out.y = line1.y1;\r\n\r\n return out;\r\n }\r\n\r\n var length1 = Length(line1);\r\n var length2 = Length(line2);\r\n var length3 = Length(line3);\r\n\r\n var perimeter = length1 + length2 + length3;\r\n\r\n var p = perimeter * position;\r\n var localPosition = 0;\r\n\r\n // Which line is it on?\r\n\r\n if (p < length1)\r\n {\r\n // Line 1\r\n localPosition = p / length1;\r\n\r\n out.x = line1.x1 + (line1.x2 - line1.x1) * localPosition;\r\n out.y = line1.y1 + (line1.y2 - line1.y1) * localPosition;\r\n }\r\n else if (p > length1 + length2)\r\n {\r\n // Line 3\r\n p -= length1 + length2;\r\n localPosition = p / length3;\r\n\r\n out.x = line3.x1 + (line3.x2 - line3.x1) * localPosition;\r\n out.y = line3.y1 + (line3.y2 - line3.y1) * localPosition;\r\n }\r\n else\r\n {\r\n // Line 2\r\n p -= length1;\r\n localPosition = p / length2;\r\n\r\n out.x = line2.x1 + (line2.x2 - line2.x1) * localPosition;\r\n out.y = line2.y1 + (line2.y2 - line2.y1) * localPosition;\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/GetPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/GetPoints.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/GetPoints.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Length = __webpack_require__(/*! ../line/Length */ \"./node_modules/phaser/src/geom/line/Length.js\");\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * Returns an array of evenly spaced points on the perimeter of a Triangle.\r\n *\r\n * @function Phaser.Geom.Triangle.GetPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to get the points from.\r\n * @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`.\r\n * @param {number} stepRate - If `quantity` is 0, the distance between each returned point.\r\n * @param {(array|Phaser.Geom.Point[])} [out] - An array to which the points should be appended.\r\n *\r\n * @return {(array|Phaser.Geom.Point[])} The modified `out` array, or a new array if none was provided.\r\n */\r\nvar GetPoints = function (triangle, quantity, stepRate, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n var line1 = triangle.getLineA();\r\n var line2 = triangle.getLineB();\r\n var line3 = triangle.getLineC();\r\n\r\n var length1 = Length(line1);\r\n var length2 = Length(line2);\r\n var length3 = Length(line3);\r\n\r\n var perimeter = length1 + length2 + length3;\r\n\r\n // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.\r\n if (!quantity)\r\n {\r\n quantity = perimeter / stepRate;\r\n }\r\n\r\n for (var i = 0; i < quantity; i++)\r\n {\r\n var p = perimeter * (i / quantity);\r\n var localPosition = 0;\r\n\r\n var point = new Point();\r\n\r\n // Which line is it on?\r\n\r\n if (p < length1)\r\n {\r\n // Line 1\r\n localPosition = p / length1;\r\n\r\n point.x = line1.x1 + (line1.x2 - line1.x1) * localPosition;\r\n point.y = line1.y1 + (line1.y2 - line1.y1) * localPosition;\r\n }\r\n else if (p > length1 + length2)\r\n {\r\n // Line 3\r\n p -= length1 + length2;\r\n localPosition = p / length3;\r\n\r\n point.x = line3.x1 + (line3.x2 - line3.x1) * localPosition;\r\n point.y = line3.y1 + (line3.y2 - line3.y1) * localPosition;\r\n }\r\n else\r\n {\r\n // Line 2\r\n p -= length1;\r\n localPosition = p / length2;\r\n\r\n point.x = line2.x1 + (line2.x2 - line2.x1) * localPosition;\r\n point.y = line2.y1 + (line2.y2 - line2.y1) * localPosition;\r\n }\r\n\r\n out.push(point);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetPoints;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/GetPoints.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/InCenter.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/InCenter.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n// The three angle bisectors of a triangle meet in one point called the incenter.\r\n// It is the center of the incircle, the circle inscribed in the triangle.\r\n\r\nfunction getLength (x1, y1, x2, y2)\r\n{\r\n var x = x1 - x2;\r\n var y = y1 - y2;\r\n var magnitude = (x * x) + (y * y);\r\n\r\n return Math.sqrt(magnitude);\r\n}\r\n\r\n/**\r\n * Calculates the position of the incenter of a Triangle object. This is the point where its three angle bisectors meet and it's also the center of the incircle, which is the circle inscribed in the triangle.\r\n *\r\n * @function Phaser.Geom.Triangle.InCenter\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to find the incenter of.\r\n * @param {Phaser.Geom.Point} [out] - An optional Point in which to store the coordinates.\r\n *\r\n * @return {Phaser.Geom.Point} Point (x, y) of the center pixel of the triangle.\r\n */\r\nvar InCenter = function (triangle, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n var x1 = triangle.x1;\r\n var y1 = triangle.y1;\r\n\r\n var x2 = triangle.x2;\r\n var y2 = triangle.y2;\r\n\r\n var x3 = triangle.x3;\r\n var y3 = triangle.y3;\r\n\r\n var d1 = getLength(x3, y3, x2, y2);\r\n var d2 = getLength(x1, y1, x3, y3);\r\n var d3 = getLength(x2, y2, x1, y1);\r\n\r\n var p = d1 + d2 + d3;\r\n\r\n out.x = (x1 * d1 + x2 * d2 + x3 * d3) / p;\r\n out.y = (y1 * d1 + y2 * d2 + y3 * d3) / p;\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = InCenter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/InCenter.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/Offset.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/Offset.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Moves each point (vertex) of a Triangle by a given offset, thus moving the entire Triangle by that offset.\r\n *\r\n * @function Phaser.Geom.Triangle.Offset\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Triangle} O - [triangle,$return]\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to move.\r\n * @param {number} x - The horizontal offset (distance) by which to move each point. Can be positive or negative.\r\n * @param {number} y - The vertical offset (distance) by which to move each point. Can be positive or negative.\r\n *\r\n * @return {Phaser.Geom.Triangle} The modified Triangle.\r\n */\r\nvar Offset = function (triangle, x, y)\r\n{\r\n triangle.x1 += x;\r\n triangle.y1 += y;\r\n\r\n triangle.x2 += x;\r\n triangle.y2 += y;\r\n\r\n triangle.x3 += x;\r\n triangle.y3 += y;\r\n\r\n return triangle;\r\n};\r\n\r\nmodule.exports = Offset;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/Offset.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/Perimeter.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/Perimeter.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Length = __webpack_require__(/*! ../line/Length */ \"./node_modules/phaser/src/geom/line/Length.js\");\r\n\r\n// The 2D area of a triangle. The area value is always non-negative.\r\n\r\n/**\r\n * Gets the length of the perimeter of the given triangle.\r\n *\r\n * @function Phaser.Geom.Triangle.Perimeter\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - [description]\r\n *\r\n * @return {number} [description]\r\n */\r\nvar Perimeter = function (triangle)\r\n{\r\n var line1 = triangle.getLineA();\r\n var line2 = triangle.getLineB();\r\n var line3 = triangle.getLineC();\r\n\r\n return (Length(line1) + Length(line2) + Length(line3));\r\n};\r\n\r\nmodule.exports = Perimeter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/Perimeter.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/Random.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/Random.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = __webpack_require__(/*! ../point/Point */ \"./node_modules/phaser/src/geom/point/Point.js\");\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Geom.Triangle.Random\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - [description]\r\n * @param {Phaser.Geom.Point} [out] - [description]\r\n *\r\n * @return {Phaser.Geom.Point} [description]\r\n */\r\nvar Random = function (triangle, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n // Basis vectors\r\n var ux = triangle.x2 - triangle.x1;\r\n var uy = triangle.y2 - triangle.y1;\r\n\r\n var vx = triangle.x3 - triangle.x1;\r\n var vy = triangle.y3 - triangle.y1;\r\n\r\n // Random point within the unit square\r\n var r = Math.random();\r\n var s = Math.random();\r\n\r\n // Point outside the triangle? Remap it.\r\n if (r + s >= 1)\r\n {\r\n r = 1 - r;\r\n s = 1 - s;\r\n }\r\n\r\n out.x = triangle.x1 + ((ux * r) + (vx * s));\r\n out.y = triangle.y1 + ((uy * r) + (vy * s));\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = Random;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/Random.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/Rotate.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/Rotate.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RotateAroundXY = __webpack_require__(/*! ./RotateAroundXY */ \"./node_modules/phaser/src/geom/triangle/RotateAroundXY.js\");\r\nvar InCenter = __webpack_require__(/*! ./InCenter */ \"./node_modules/phaser/src/geom/triangle/InCenter.js\");\r\n\r\n/**\r\n * Rotates a Triangle about its incenter, which is the point at which its three angle bisectors meet.\r\n *\r\n * @function Phaser.Geom.Triangle.Rotate\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Triangle} O - [triangle,$return]\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to rotate.\r\n * @param {number} angle - The angle by which to rotate the Triangle, in radians.\r\n *\r\n * @return {Phaser.Geom.Triangle} The rotated Triangle.\r\n */\r\nvar Rotate = function (triangle, angle)\r\n{\r\n var point = InCenter(triangle);\r\n\r\n return RotateAroundXY(triangle, point.x, point.y, angle);\r\n};\r\n\r\nmodule.exports = Rotate;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/Rotate.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/RotateAroundPoint.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/RotateAroundPoint.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RotateAroundXY = __webpack_require__(/*! ./RotateAroundXY */ \"./node_modules/phaser/src/geom/triangle/RotateAroundXY.js\");\r\n\r\n/**\r\n * Rotates a Triangle at a certain angle about a given Point or object with public `x` and `y` properties.\r\n *\r\n * @function Phaser.Geom.Triangle.RotateAroundPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Triangle} O - [triangle,$return]\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to rotate.\r\n * @param {Phaser.Geom.Point} point - The Point to rotate the Triangle about.\r\n * @param {number} angle - The angle by which to rotate the Triangle, in radians.\r\n *\r\n * @return {Phaser.Geom.Triangle} The rotated Triangle.\r\n */\r\nvar RotateAroundPoint = function (triangle, point, angle)\r\n{\r\n return RotateAroundXY(triangle, point.x, point.y, angle);\r\n};\r\n\r\nmodule.exports = RotateAroundPoint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/RotateAroundPoint.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/RotateAroundXY.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/RotateAroundXY.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotates an entire Triangle at a given angle about a specific point.\r\n *\r\n * @function Phaser.Geom.Triangle.RotateAroundXY\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Triangle} O - [triangle,$return]\r\n *\r\n * @param {Phaser.Geom.Triangle} triangle - The Triangle to rotate.\r\n * @param {number} x - The X coordinate of the point to rotate the Triangle about.\r\n * @param {number} y - The Y coordinate of the point to rotate the Triangle about.\r\n * @param {number} angle - The angle by which to rotate the Triangle, in radians.\r\n *\r\n * @return {Phaser.Geom.Triangle} The rotated Triangle.\r\n */\r\nvar RotateAroundXY = function (triangle, x, y, angle)\r\n{\r\n var c = Math.cos(angle);\r\n var s = Math.sin(angle);\r\n\r\n var tx = triangle.x1 - x;\r\n var ty = triangle.y1 - y;\r\n\r\n triangle.x1 = tx * c - ty * s + x;\r\n triangle.y1 = tx * s + ty * c + y;\r\n\r\n tx = triangle.x2 - x;\r\n ty = triangle.y2 - y;\r\n\r\n triangle.x2 = tx * c - ty * s + x;\r\n triangle.y2 = tx * s + ty * c + y;\r\n\r\n tx = triangle.x3 - x;\r\n ty = triangle.y3 - y;\r\n\r\n triangle.x3 = tx * c - ty * s + x;\r\n triangle.y3 = tx * s + ty * c + y;\r\n\r\n return triangle;\r\n};\r\n\r\nmodule.exports = RotateAroundXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/RotateAroundXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/Triangle.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/Triangle.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/triangle/Contains.js\");\r\nvar GetPoint = __webpack_require__(/*! ./GetPoint */ \"./node_modules/phaser/src/geom/triangle/GetPoint.js\");\r\nvar GetPoints = __webpack_require__(/*! ./GetPoints */ \"./node_modules/phaser/src/geom/triangle/GetPoints.js\");\r\nvar GEOM_CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/geom/const.js\");\r\nvar Line = __webpack_require__(/*! ../line/Line */ \"./node_modules/phaser/src/geom/line/Line.js\");\r\nvar Random = __webpack_require__(/*! ./Random */ \"./node_modules/phaser/src/geom/triangle/Random.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A triangle is a plane created by connecting three points.\r\n * The first two arguments specify the first point, the middle two arguments\r\n * specify the second point, and the last two arguments specify the third point.\r\n *\r\n * @class Triangle\r\n * @memberof Phaser.Geom\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x1=0] - `x` coordinate of the first point.\r\n * @param {number} [y1=0] - `y` coordinate of the first point.\r\n * @param {number} [x2=0] - `x` coordinate of the second point.\r\n * @param {number} [y2=0] - `y` coordinate of the second point.\r\n * @param {number} [x3=0] - `x` coordinate of the third point.\r\n * @param {number} [y3=0] - `y` coordinate of the third point.\r\n */\r\nvar Triangle = new Class({\r\n\r\n initialize:\r\n\r\n function Triangle (x1, y1, x2, y2, x3, y3)\r\n {\r\n if (x1 === undefined) { x1 = 0; }\r\n if (y1 === undefined) { y1 = 0; }\r\n if (x2 === undefined) { x2 = 0; }\r\n if (y2 === undefined) { y2 = 0; }\r\n if (x3 === undefined) { x3 = 0; }\r\n if (y3 === undefined) { y3 = 0; }\r\n\r\n /**\r\n * The geometry constant type of this object: `GEOM_CONST.TRIANGLE`.\r\n * Used for fast type comparisons.\r\n *\r\n * @name Phaser.Geom.Triangle#type\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.type = GEOM_CONST.TRIANGLE;\r\n\r\n /**\r\n * `x` coordinate of the first point.\r\n *\r\n * @name Phaser.Geom.Triangle#x1\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x1 = x1;\r\n\r\n /**\r\n * `y` coordinate of the first point.\r\n *\r\n * @name Phaser.Geom.Triangle#y1\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y1 = y1;\r\n\r\n /**\r\n * `x` coordinate of the second point.\r\n *\r\n * @name Phaser.Geom.Triangle#x2\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x2 = x2;\r\n\r\n /**\r\n * `y` coordinate of the second point.\r\n *\r\n * @name Phaser.Geom.Triangle#y2\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y2 = y2;\r\n\r\n /**\r\n * `x` coordinate of the third point.\r\n *\r\n * @name Phaser.Geom.Triangle#x3\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x3 = x3;\r\n\r\n /**\r\n * `y` coordinate of the third point.\r\n *\r\n * @name Phaser.Geom.Triangle#y3\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y3 = y3;\r\n },\r\n\r\n /**\r\n * Checks whether a given points lies within the triangle.\r\n *\r\n * @method Phaser.Geom.Triangle#contains\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the point to check.\r\n * @param {number} y - The y coordinate of the point to check.\r\n *\r\n * @return {boolean} `true` if the coordinate pair is within the triangle, otherwise `false`.\r\n */\r\n contains: function (x, y)\r\n {\r\n return Contains(this, x, y);\r\n },\r\n\r\n /**\r\n * Returns a specific point on the triangle.\r\n *\r\n * @method Phaser.Geom.Triangle#getPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [output,$return]\r\n *\r\n * @param {number} position - Position as float within `0` and `1`. `0` equals the first point.\r\n * @param {(Phaser.Geom.Point|object)} [output] - Optional Point, or point-like object, that the calculated point will be written to.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} Calculated `Point` that represents the requested position. It is the same as `output` when this parameter has been given.\r\n */\r\n getPoint: function (position, output)\r\n {\r\n return GetPoint(this, position, output);\r\n },\r\n\r\n /**\r\n * 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`).\r\n *\r\n * @method Phaser.Geom.Triangle#getPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point[]} O - [output,$return]\r\n *\r\n * @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.\r\n * @param {number} [stepRate] - Distance between two points. Will only be used when `quantity` is falsey.\r\n * @param {(array|Phaser.Geom.Point[])} [output] - Optional Array for writing the calculated points into. Otherwise a new array will be created.\r\n *\r\n * @return {(array|Phaser.Geom.Point[])} Returns a list of calculated `Point` instances or the filled array passed as parameter `output`.\r\n */\r\n getPoints: function (quantity, stepRate, output)\r\n {\r\n return GetPoints(this, quantity, stepRate, output);\r\n },\r\n\r\n /**\r\n * Returns a random point along the triangle.\r\n *\r\n * @method Phaser.Geom.Triangle#getRandomPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [point,$return]\r\n *\r\n * @param {Phaser.Geom.Point} [point] - Optional `Point` that should be modified. Otherwise a new one will be created.\r\n *\r\n * @return {Phaser.Geom.Point} Random `Point`. When parameter `point` has been provided it will be returned.\r\n */\r\n getRandomPoint: function (point)\r\n {\r\n return Random(this, point);\r\n },\r\n\r\n /**\r\n * Sets all three points of the triangle. Leaving out any coordinate sets it to be `0`.\r\n *\r\n * @method Phaser.Geom.Triangle#setTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x1=0] - `x` coordinate of the first point.\r\n * @param {number} [y1=0] - `y` coordinate of the first point.\r\n * @param {number} [x2=0] - `x` coordinate of the second point.\r\n * @param {number} [y2=0] - `y` coordinate of the second point.\r\n * @param {number} [x3=0] - `x` coordinate of the third point.\r\n * @param {number} [y3=0] - `y` coordinate of the third point.\r\n *\r\n * @return {Phaser.Geom.Triangle} This Triangle object.\r\n */\r\n setTo: function (x1, y1, x2, y2, x3, y3)\r\n {\r\n if (x1 === undefined) { x1 = 0; }\r\n if (y1 === undefined) { y1 = 0; }\r\n if (x2 === undefined) { x2 = 0; }\r\n if (y2 === undefined) { y2 = 0; }\r\n if (x3 === undefined) { x3 = 0; }\r\n if (y3 === undefined) { y3 = 0; }\r\n\r\n this.x1 = x1;\r\n this.y1 = y1;\r\n\r\n this.x2 = x2;\r\n this.y2 = y2;\r\n\r\n this.x3 = x3;\r\n this.y3 = y3;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns a Line object that corresponds to Line A of this Triangle.\r\n *\r\n * @method Phaser.Geom.Triangle#getLineA\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created.\r\n *\r\n * @return {Phaser.Geom.Line} A Line object that corresponds to line A of this Triangle.\r\n */\r\n getLineA: function (line)\r\n {\r\n if (line === undefined) { line = new Line(); }\r\n\r\n line.setTo(this.x1, this.y1, this.x2, this.y2);\r\n\r\n return line;\r\n },\r\n\r\n /**\r\n * Returns a Line object that corresponds to Line B of this Triangle.\r\n *\r\n * @method Phaser.Geom.Triangle#getLineB\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created.\r\n *\r\n * @return {Phaser.Geom.Line} A Line object that corresponds to line B of this Triangle.\r\n */\r\n getLineB: function (line)\r\n {\r\n if (line === undefined) { line = new Line(); }\r\n\r\n line.setTo(this.x2, this.y2, this.x3, this.y3);\r\n\r\n return line;\r\n },\r\n\r\n /**\r\n * Returns a Line object that corresponds to Line C of this Triangle.\r\n *\r\n * @method Phaser.Geom.Triangle#getLineC\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created.\r\n *\r\n * @return {Phaser.Geom.Line} A Line object that corresponds to line C of this Triangle.\r\n */\r\n getLineC: function (line)\r\n {\r\n if (line === undefined) { line = new Line(); }\r\n\r\n line.setTo(this.x3, this.y3, this.x1, this.y1);\r\n\r\n return line;\r\n },\r\n\r\n /**\r\n * Left most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly.\r\n *\r\n * @name Phaser.Geom.Triangle#left\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n left: {\r\n\r\n get: function ()\r\n {\r\n return Math.min(this.x1, this.x2, this.x3);\r\n },\r\n\r\n set: function (value)\r\n {\r\n var diff = 0;\r\n\r\n if (this.x1 <= this.x2 && this.x1 <= this.x3)\r\n {\r\n diff = this.x1 - value;\r\n }\r\n else if (this.x2 <= this.x1 && this.x2 <= this.x3)\r\n {\r\n diff = this.x2 - value;\r\n }\r\n else\r\n {\r\n diff = this.x3 - value;\r\n }\r\n\r\n this.x1 -= diff;\r\n this.x2 -= diff;\r\n this.x3 -= diff;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Right most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly.\r\n *\r\n * @name Phaser.Geom.Triangle#right\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n right: {\r\n\r\n get: function ()\r\n {\r\n return Math.max(this.x1, this.x2, this.x3);\r\n },\r\n\r\n set: function (value)\r\n {\r\n var diff = 0;\r\n\r\n if (this.x1 >= this.x2 && this.x1 >= this.x3)\r\n {\r\n diff = this.x1 - value;\r\n }\r\n else if (this.x2 >= this.x1 && this.x2 >= this.x3)\r\n {\r\n diff = this.x2 - value;\r\n }\r\n else\r\n {\r\n diff = this.x3 - value;\r\n }\r\n\r\n this.x1 -= diff;\r\n this.x2 -= diff;\r\n this.x3 -= diff;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Top most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly.\r\n *\r\n * @name Phaser.Geom.Triangle#top\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n top: {\r\n\r\n get: function ()\r\n {\r\n return Math.min(this.y1, this.y2, this.y3);\r\n },\r\n\r\n set: function (value)\r\n {\r\n var diff = 0;\r\n\r\n if (this.y1 <= this.y2 && this.y1 <= this.y3)\r\n {\r\n diff = this.y1 - value;\r\n }\r\n else if (this.y2 <= this.y1 && this.y2 <= this.y3)\r\n {\r\n diff = this.y2 - value;\r\n }\r\n else\r\n {\r\n diff = this.y3 - value;\r\n }\r\n\r\n this.y1 -= diff;\r\n this.y2 -= diff;\r\n this.y3 -= diff;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Bottom most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly.\r\n *\r\n * @name Phaser.Geom.Triangle#bottom\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bottom: {\r\n\r\n get: function ()\r\n {\r\n return Math.max(this.y1, this.y2, this.y3);\r\n },\r\n\r\n set: function (value)\r\n {\r\n var diff = 0;\r\n\r\n if (this.y1 >= this.y2 && this.y1 >= this.y3)\r\n {\r\n diff = this.y1 - value;\r\n }\r\n else if (this.y2 >= this.y1 && this.y2 >= this.y3)\r\n {\r\n diff = this.y2 - value;\r\n }\r\n else\r\n {\r\n diff = this.y3 - value;\r\n }\r\n\r\n this.y1 -= diff;\r\n this.y2 -= diff;\r\n this.y3 -= diff;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Triangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/Triangle.js?"); /***/ }), /***/ "./node_modules/phaser/src/geom/triangle/index.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/geom/triangle/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Triangle = __webpack_require__(/*! ./Triangle */ \"./node_modules/phaser/src/geom/triangle/Triangle.js\");\r\n\r\nTriangle.Area = __webpack_require__(/*! ./Area */ \"./node_modules/phaser/src/geom/triangle/Area.js\");\r\nTriangle.BuildEquilateral = __webpack_require__(/*! ./BuildEquilateral */ \"./node_modules/phaser/src/geom/triangle/BuildEquilateral.js\");\r\nTriangle.BuildFromPolygon = __webpack_require__(/*! ./BuildFromPolygon */ \"./node_modules/phaser/src/geom/triangle/BuildFromPolygon.js\");\r\nTriangle.BuildRight = __webpack_require__(/*! ./BuildRight */ \"./node_modules/phaser/src/geom/triangle/BuildRight.js\");\r\nTriangle.CenterOn = __webpack_require__(/*! ./CenterOn */ \"./node_modules/phaser/src/geom/triangle/CenterOn.js\");\r\nTriangle.Centroid = __webpack_require__(/*! ./Centroid */ \"./node_modules/phaser/src/geom/triangle/Centroid.js\");\r\nTriangle.CircumCenter = __webpack_require__(/*! ./CircumCenter */ \"./node_modules/phaser/src/geom/triangle/CircumCenter.js\");\r\nTriangle.CircumCircle = __webpack_require__(/*! ./CircumCircle */ \"./node_modules/phaser/src/geom/triangle/CircumCircle.js\");\r\nTriangle.Clone = __webpack_require__(/*! ./Clone */ \"./node_modules/phaser/src/geom/triangle/Clone.js\");\r\nTriangle.Contains = __webpack_require__(/*! ./Contains */ \"./node_modules/phaser/src/geom/triangle/Contains.js\");\r\nTriangle.ContainsArray = __webpack_require__(/*! ./ContainsArray */ \"./node_modules/phaser/src/geom/triangle/ContainsArray.js\");\r\nTriangle.ContainsPoint = __webpack_require__(/*! ./ContainsPoint */ \"./node_modules/phaser/src/geom/triangle/ContainsPoint.js\");\r\nTriangle.CopyFrom = __webpack_require__(/*! ./CopyFrom */ \"./node_modules/phaser/src/geom/triangle/CopyFrom.js\");\r\nTriangle.Decompose = __webpack_require__(/*! ./Decompose */ \"./node_modules/phaser/src/geom/triangle/Decompose.js\");\r\nTriangle.Equals = __webpack_require__(/*! ./Equals */ \"./node_modules/phaser/src/geom/triangle/Equals.js\");\r\nTriangle.GetPoint = __webpack_require__(/*! ./GetPoint */ \"./node_modules/phaser/src/geom/triangle/GetPoint.js\");\r\nTriangle.GetPoints = __webpack_require__(/*! ./GetPoints */ \"./node_modules/phaser/src/geom/triangle/GetPoints.js\");\r\nTriangle.InCenter = __webpack_require__(/*! ./InCenter */ \"./node_modules/phaser/src/geom/triangle/InCenter.js\");\r\nTriangle.Perimeter = __webpack_require__(/*! ./Perimeter */ \"./node_modules/phaser/src/geom/triangle/Perimeter.js\");\r\nTriangle.Offset = __webpack_require__(/*! ./Offset */ \"./node_modules/phaser/src/geom/triangle/Offset.js\");\r\nTriangle.Random = __webpack_require__(/*! ./Random */ \"./node_modules/phaser/src/geom/triangle/Random.js\");\r\nTriangle.Rotate = __webpack_require__(/*! ./Rotate */ \"./node_modules/phaser/src/geom/triangle/Rotate.js\");\r\nTriangle.RotateAroundPoint = __webpack_require__(/*! ./RotateAroundPoint */ \"./node_modules/phaser/src/geom/triangle/RotateAroundPoint.js\");\r\nTriangle.RotateAroundXY = __webpack_require__(/*! ./RotateAroundXY */ \"./node_modules/phaser/src/geom/triangle/RotateAroundXY.js\");\r\n\r\nmodule.exports = Triangle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/geom/triangle/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/CreateInteractiveObject.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/input/CreateInteractiveObject.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Creates a new Interactive Object.\r\n * \r\n * This is called automatically by the Input Manager when you enable a Game Object for input.\r\n *\r\n * The resulting Interactive Object is mapped to the Game Object's `input` property.\r\n *\r\n * @function Phaser.Input.CreateInteractiveObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to which this Interactive Object is bound.\r\n * @param {any} hitArea - The hit area for this Interactive Object. Typically a geometry shape, like a Rectangle or Circle.\r\n * @param {Phaser.Types.Input.HitAreaCallback} hitAreaCallback - The 'contains' check callback that the hit area shape will use for all hit tests.\r\n *\r\n * @return {Phaser.Types.Input.InteractiveObject} The new Interactive Object.\r\n */\r\nvar CreateInteractiveObject = function (gameObject, hitArea, hitAreaCallback)\r\n{\r\n return {\r\n\r\n gameObject: gameObject,\r\n\r\n enabled: true,\r\n alwaysEnabled: false,\r\n draggable: false,\r\n dropZone: false,\r\n cursor: false,\r\n\r\n target: null,\r\n\r\n camera: null,\r\n\r\n hitArea: hitArea,\r\n hitAreaCallback: hitAreaCallback,\r\n hitAreaDebug: null,\r\n\r\n // Has the dev specified their own shape, or is this bound to the texture size?\r\n customHitArea: false,\r\n\r\n localX: 0,\r\n localY: 0,\r\n\r\n // 0 = Not being dragged\r\n // 1 = Being checked for dragging\r\n // 2 = Being dragged\r\n dragState: 0,\r\n\r\n dragStartX: 0,\r\n dragStartY: 0,\r\n dragStartXGlobal: 0,\r\n dragStartYGlobal: 0,\r\n\r\n dragX: 0,\r\n dragY: 0\r\n\r\n };\r\n};\r\n\r\nmodule.exports = CreateInteractiveObject;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/CreateInteractiveObject.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/CreatePixelPerfectHandler.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/input/CreatePixelPerfectHandler.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Creates a new Pixel Perfect Handler function.\r\n *\r\n * Access via `InputPlugin.makePixelPerfect` rather than calling it directly.\r\n *\r\n * @function Phaser.Input.CreatePixelPerfectHandler\r\n * @since 3.10.0\r\n *\r\n * @param {Phaser.Textures.TextureManager} textureManager - A reference to the Texture Manager.\r\n * @param {integer} alphaTolerance - The alpha level that the pixel should be above to be included as a successful interaction.\r\n *\r\n * @return {function} The new Pixel Perfect Handler function.\r\n */\r\nvar CreatePixelPerfectHandler = function (textureManager, alphaTolerance)\r\n{\r\n return function (hitArea, x, y, gameObject)\r\n {\r\n var alpha = textureManager.getPixelAlpha(x, y, gameObject.texture.key, gameObject.frame.name);\r\n\r\n return (alpha && alpha >= alphaTolerance);\r\n };\r\n};\r\n\r\nmodule.exports = CreatePixelPerfectHandler;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/CreatePixelPerfectHandler.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/InputManager.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/input/InputManager.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/input/const.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/input/events/index.js\");\r\nvar GameEvents = __webpack_require__(/*! ../core/events */ \"./node_modules/phaser/src/core/events/index.js\");\r\nvar Keyboard = __webpack_require__(/*! ./keyboard/KeyboardManager */ \"./node_modules/phaser/src/input/keyboard/KeyboardManager.js\");\r\nvar Mouse = __webpack_require__(/*! ./mouse/MouseManager */ \"./node_modules/phaser/src/input/mouse/MouseManager.js\");\r\nvar Pointer = __webpack_require__(/*! ./Pointer */ \"./node_modules/phaser/src/input/Pointer.js\");\r\nvar Touch = __webpack_require__(/*! ./touch/TouchManager */ \"./node_modules/phaser/src/input/touch/TouchManager.js\");\r\nvar TransformMatrix = __webpack_require__(/*! ../gameobjects/components/TransformMatrix */ \"./node_modules/phaser/src/gameobjects/components/TransformMatrix.js\");\r\nvar TransformXY = __webpack_require__(/*! ../math/TransformXY */ \"./node_modules/phaser/src/math/TransformXY.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Input Manager is responsible for handling the pointer related systems in a single Phaser Game instance.\r\n *\r\n * Based on the Game Config it will create handlers for mouse and touch support.\r\n *\r\n * Keyboard and Gamepad are plugins, handled directly by the InputPlugin class.\r\n *\r\n * It then manages the events, pointer creation and general hit test related operations.\r\n *\r\n * You rarely need to interact with the Input Manager directly, and as such, all of its properties and methods\r\n * should be considered private. Instead, you should use the Input Plugin, which is a Scene level system, responsible\r\n * for dealing with all input events for a Scene.\r\n *\r\n * @class InputManager\r\n * @memberof Phaser.Input\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - The Game instance that owns the Input Manager.\r\n * @param {object} config - The Input Configuration object, as set in the Game Config.\r\n */\r\nvar InputManager = new Class({\r\n\r\n initialize:\r\n\r\n function InputManager (game, config)\r\n {\r\n /**\r\n * The Game instance that owns the Input Manager.\r\n * A Game only maintains on instance of the Input Manager at any time.\r\n *\r\n * @name Phaser.Input.InputManager#game\r\n * @type {Phaser.Game}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.game = game;\r\n\r\n /**\r\n * A reference to the global Game Scale Manager.\r\n * Used for all bounds checks and pointer scaling.\r\n *\r\n * @name Phaser.Input.InputManager#scaleManager\r\n * @type {Phaser.Scale.ScaleManager}\r\n * @since 3.16.0\r\n */\r\n this.scaleManager;\r\n\r\n /**\r\n * The Canvas that is used for all DOM event input listeners.\r\n *\r\n * @name Phaser.Input.InputManager#canvas\r\n * @type {HTMLCanvasElement}\r\n * @since 3.0.0\r\n */\r\n this.canvas;\r\n\r\n /**\r\n * The Game Configuration object, as set during the game boot.\r\n *\r\n * @name Phaser.Input.InputManager#config\r\n * @type {Phaser.Core.Config}\r\n * @since 3.0.0\r\n */\r\n this.config = config;\r\n\r\n /**\r\n * If set, the Input Manager will run its update loop every frame.\r\n *\r\n * @name Phaser.Input.InputManager#enabled\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.enabled = true;\r\n\r\n /**\r\n * The Event Emitter instance that the Input Manager uses to emit events from.\r\n *\r\n * @name Phaser.Input.InputManager#events\r\n * @type {Phaser.Events.EventEmitter}\r\n * @since 3.0.0\r\n */\r\n this.events = new EventEmitter();\r\n\r\n /**\r\n * Are any mouse or touch pointers currently over the game canvas?\r\n * This is updated automatically by the canvas over and out handlers.\r\n *\r\n * @name Phaser.Input.InputManager#isOver\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n this.isOver = true;\r\n\r\n /**\r\n * The default CSS cursor to be used when interacting with your game.\r\n *\r\n * See the `setDefaultCursor` method for more details.\r\n *\r\n * @name Phaser.Input.InputManager#defaultCursor\r\n * @type {string}\r\n * @since 3.10.0\r\n */\r\n this.defaultCursor = '';\r\n\r\n /**\r\n * A reference to the Keyboard Manager class, if enabled via the `input.keyboard` Game Config property.\r\n *\r\n * @name Phaser.Input.InputManager#keyboard\r\n * @type {?Phaser.Input.Keyboard.KeyboardManager}\r\n * @since 3.16.0\r\n */\r\n this.keyboard = (config.inputKeyboard) ? new Keyboard(this) : null;\r\n\r\n /**\r\n * A reference to the Mouse Manager class, if enabled via the `input.mouse` Game Config property.\r\n *\r\n * @name Phaser.Input.InputManager#mouse\r\n * @type {?Phaser.Input.Mouse.MouseManager}\r\n * @since 3.0.0\r\n */\r\n this.mouse = (config.inputMouse) ? new Mouse(this) : null;\r\n\r\n /**\r\n * A reference to the Touch Manager class, if enabled via the `input.touch` Game Config property.\r\n *\r\n * @name Phaser.Input.InputManager#touch\r\n * @type {Phaser.Input.Touch.TouchManager}\r\n * @since 3.0.0\r\n */\r\n this.touch = (config.inputTouch) ? new Touch(this) : null;\r\n\r\n /**\r\n * An array of Pointers that have been added to the game.\r\n * The first entry is reserved for the Mouse Pointer, the rest are Touch Pointers.\r\n *\r\n * By default there is 1 touch pointer enabled. If you need more use the `addPointer` method to start them,\r\n * or set the `input.activePointers` property in the Game Config.\r\n *\r\n * @name Phaser.Input.InputManager#pointers\r\n * @type {Phaser.Input.Pointer[]}\r\n * @since 3.10.0\r\n */\r\n this.pointers = [];\r\n\r\n /**\r\n * The number of touch objects activated and being processed each update.\r\n *\r\n * You can change this by either calling `addPointer` at run-time, or by\r\n * setting the `input.activePointers` property in the Game Config.\r\n *\r\n * @name Phaser.Input.InputManager#pointersTotal\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.10.0\r\n */\r\n this.pointersTotal = config.inputActivePointers;\r\n\r\n if (config.inputTouch && this.pointersTotal === 1)\r\n {\r\n this.pointersTotal = 2;\r\n }\r\n\r\n for (var i = 0; i <= this.pointersTotal; i++)\r\n {\r\n var pointer = new Pointer(this, i);\r\n\r\n pointer.smoothFactor = config.inputSmoothFactor;\r\n\r\n this.pointers.push(pointer);\r\n }\r\n\r\n /**\r\n * The mouse has its own unique Pointer object, which you can reference directly if making a _desktop specific game_.\r\n * If you are supporting both desktop and touch devices then do not use this property, instead use `activePointer`\r\n * which will always map to the most recently interacted pointer.\r\n *\r\n * @name Phaser.Input.InputManager#mousePointer\r\n * @type {?Phaser.Input.Pointer}\r\n * @since 3.10.0\r\n */\r\n this.mousePointer = (config.inputMouse) ? this.pointers[0] : null;\r\n\r\n /**\r\n * The most recently active Pointer object.\r\n *\r\n * If you've only 1 Pointer in your game then this will accurately be either the first finger touched, or the mouse.\r\n *\r\n * If your game doesn't need to support multi-touch then you can safely use this property in all of your game\r\n * code and it will adapt to be either the mouse or the touch, based on device.\r\n *\r\n * @name Phaser.Input.InputManager#activePointer\r\n * @type {Phaser.Input.Pointer}\r\n * @since 3.0.0\r\n */\r\n this.activePointer = this.pointers[0];\r\n\r\n /**\r\n * If the top-most Scene in the Scene List receives an input it will stop input from\r\n * propagating any lower down the scene list, i.e. if you have a UI Scene at the top\r\n * and click something on it, that click will not then be passed down to any other\r\n * Scene below. Disable this to have input events passed through all Scenes, all the time.\r\n *\r\n * @name Phaser.Input.InputManager#globalTopOnly\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.globalTopOnly = true;\r\n\r\n /**\r\n * The time this Input Manager was last updated.\r\n * This value is populated by the Game Step each frame.\r\n *\r\n * @name Phaser.Input.InputManager#time\r\n * @type {number}\r\n * @readonly\r\n * @since 3.16.2\r\n */\r\n this.time = 0;\r\n\r\n /**\r\n * A re-cycled point-like object to store hit test values in.\r\n *\r\n * @name Phaser.Input.InputManager#_tempPoint\r\n * @type {{x:number, y:number}}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._tempPoint = { x: 0, y: 0 };\r\n\r\n /**\r\n * A re-cycled array to store hit results in.\r\n *\r\n * @name Phaser.Input.InputManager#_tempHitTest\r\n * @type {array}\r\n * @private\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this._tempHitTest = [];\r\n\r\n /**\r\n * A re-cycled matrix used in hit test calculations.\r\n *\r\n * @name Phaser.Input.InputManager#_tempMatrix\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @private\r\n * @since 3.4.0\r\n */\r\n this._tempMatrix = new TransformMatrix();\r\n\r\n /**\r\n * A re-cycled matrix used in hit test calculations.\r\n *\r\n * @name Phaser.Input.InputManager#_tempMatrix2\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._tempMatrix2 = new TransformMatrix();\r\n\r\n /**\r\n * An internal private var that records Scenes aborting event processing.\r\n *\r\n * @name Phaser.Input.InputManager#_tempSkip\r\n * @type {boolean}\r\n * @private\r\n * @since 3.18.0\r\n */\r\n this._tempSkip = false;\r\n\r\n /**\r\n * An internal private array that avoids needing to create a new array on every DOM mouse event.\r\n *\r\n * @name Phaser.Input.InputManager#mousePointerContainer\r\n * @type {Phaser.Input.Pointer[]}\r\n * @private\r\n * @since 3.18.0\r\n */\r\n this.mousePointerContainer = [ this.mousePointer ];\r\n\r\n game.events.once(GameEvents.BOOT, this.boot, this);\r\n },\r\n\r\n /**\r\n * The Boot handler is called by Phaser.Game when it first starts up.\r\n * The renderer is available by now.\r\n *\r\n * @method Phaser.Input.InputManager#boot\r\n * @protected\r\n * @fires Phaser.Input.Events#MANAGER_BOOT\r\n * @since 3.0.0\r\n */\r\n boot: function ()\r\n {\r\n this.canvas = this.game.canvas;\r\n\r\n this.scaleManager = this.game.scale;\r\n\r\n this.events.emit(Events.MANAGER_BOOT);\r\n\r\n this.game.events.on(GameEvents.PRE_RENDER, this.preRender, this);\r\n\r\n this.game.events.once(GameEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * Internal canvas state change, called automatically by the Mouse Manager.\r\n *\r\n * @method Phaser.Input.InputManager#setCanvasOver\r\n * @fires Phaser.Input.Events#GAME_OVER\r\n * @private\r\n * @since 3.16.0\r\n *\r\n * @param {(MouseEvent|TouchEvent)} event - The DOM Event.\r\n */\r\n setCanvasOver: function (event)\r\n {\r\n this.isOver = true;\r\n\r\n this.events.emit(Events.GAME_OVER, event);\r\n },\r\n\r\n /**\r\n * Internal canvas state change, called automatically by the Mouse Manager.\r\n *\r\n * @method Phaser.Input.InputManager#setCanvasOut\r\n * @fires Phaser.Input.Events#GAME_OUT\r\n * @private\r\n * @since 3.16.0\r\n *\r\n * @param {(MouseEvent|TouchEvent)} event - The DOM Event.\r\n */\r\n setCanvasOut: function (event)\r\n {\r\n this.isOver = false;\r\n\r\n this.events.emit(Events.GAME_OUT, event);\r\n },\r\n\r\n /**\r\n * Internal update, called automatically by the Game Step right at the start.\r\n *\r\n * @method Phaser.Input.InputManager#preRender\r\n * @private\r\n * @since 3.18.0\r\n */\r\n preRender: function ()\r\n {\r\n var time = this.game.loop.now;\r\n var delta = this.game.loop.delta;\r\n var scenes = this.game.scene.getScenes(true, true);\r\n\r\n this.time = time;\r\n\r\n this.events.emit(Events.MANAGER_UPDATE);\r\n\r\n for (var i = 0; i < scenes.length; i++)\r\n {\r\n var scene = scenes[i];\r\n\r\n if (scene.sys.input && scene.sys.input.updatePoll(time, delta) && this.globalTopOnly)\r\n {\r\n // If the Scene returns true, it means it captured some input that no other Scene should get, so we bail out\r\n return;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Tells the Input system to set a custom cursor.\r\n * \r\n * This cursor will be the default cursor used when interacting with the game canvas.\r\n *\r\n * If an Interactive Object also sets a custom cursor, this is the cursor that is reset after its use.\r\n *\r\n * Any valid CSS cursor value is allowed, including paths to image files, i.e.:\r\n *\r\n * ```javascript\r\n * this.input.setDefaultCursor('url(assets/cursors/sword.cur), pointer');\r\n * ```\r\n * \r\n * Please read about the differences between browsers when it comes to the file formats and sizes they support:\r\n *\r\n * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor\r\n * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_User_Interface/Using_URL_values_for_the_cursor_property\r\n *\r\n * It's up to you to pick a suitable cursor format that works across the range of browsers you need to support.\r\n *\r\n * @method Phaser.Input.InputManager#setDefaultCursor\r\n * @since 3.10.0\r\n * \r\n * @param {string} cursor - The CSS to be used when setting the default cursor.\r\n */\r\n setDefaultCursor: function (cursor)\r\n {\r\n this.defaultCursor = cursor;\r\n\r\n if (this.canvas.style.cursor !== cursor)\r\n {\r\n this.canvas.style.cursor = cursor;\r\n }\r\n },\r\n\r\n /**\r\n * Called by the InputPlugin when processing over and out events.\r\n * \r\n * Tells the Input Manager to set a custom cursor during its postUpdate step.\r\n *\r\n * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor\r\n *\r\n * @method Phaser.Input.InputManager#setCursor\r\n * @private\r\n * @since 3.10.0\r\n * \r\n * @param {Phaser.Types.Input.InteractiveObject} interactiveObject - The Interactive Object that called this method.\r\n */\r\n setCursor: function (interactiveObject)\r\n {\r\n if (interactiveObject.cursor)\r\n {\r\n this.canvas.style.cursor = interactiveObject.cursor;\r\n }\r\n },\r\n\r\n /**\r\n * Called by the InputPlugin when processing over and out events.\r\n * \r\n * Tells the Input Manager to clear the hand cursor, if set, during its postUpdate step.\r\n *\r\n * @method Phaser.Input.InputManager#resetCursor\r\n * @private\r\n * @since 3.10.0\r\n * \r\n * @param {Phaser.Types.Input.InteractiveObject} interactiveObject - The Interactive Object that called this method.\r\n */\r\n resetCursor: function (interactiveObject)\r\n {\r\n if (interactiveObject.cursor && this.canvas)\r\n {\r\n this.canvas.style.cursor = this.defaultCursor;\r\n }\r\n },\r\n\r\n /**\r\n * Adds new Pointer objects to the Input Manager.\r\n *\r\n * By default Phaser creates 2 pointer objects: `mousePointer` and `pointer1`.\r\n *\r\n * You can create more either by calling this method, or by setting the `input.activePointers` property\r\n * in the Game Config, up to a maximum of 10 pointers.\r\n *\r\n * The first 10 pointers are available via the `InputPlugin.pointerX` properties, once they have been added\r\n * via this method.\r\n *\r\n * @method Phaser.Input.InputManager#addPointer\r\n * @since 3.10.0\r\n *\r\n * @param {integer} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total.\r\n *\r\n * @return {Phaser.Input.Pointer[]} An array containing all of the new Pointer objects that were created.\r\n */\r\n addPointer: function (quantity)\r\n {\r\n if (quantity === undefined) { quantity = 1; }\r\n\r\n var output = [];\r\n\r\n if (this.pointersTotal + quantity > 10)\r\n {\r\n quantity = 10 - this.pointersTotal;\r\n }\r\n\r\n for (var i = 0; i < quantity; i++)\r\n {\r\n var id = this.pointers.length;\r\n\r\n var pointer = new Pointer(this, id);\r\n\r\n pointer.smoothFactor = this.config.inputSmoothFactor;\r\n\r\n this.pointers.push(pointer);\r\n\r\n this.pointersTotal++;\r\n\r\n output.push(pointer);\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Internal method that gets a list of all the active Input Plugins in the game\r\n * and updates each of them in turn, in reverse order (top to bottom), to allow\r\n * for DOM top-level event handling simulation.\r\n *\r\n * @method Phaser.Input.InputManager#updateInputPlugins\r\n * @since 3.16.0\r\n *\r\n * @param {integer} type - The type of event to process.\r\n * @param {Phaser.Input.Pointer[]} pointers - An array of Pointers on which the event occurred.\r\n */\r\n updateInputPlugins: function (type, pointers)\r\n {\r\n var scenes = this.game.scene.getScenes(true, true);\r\n\r\n this._tempSkip = false;\r\n\r\n for (var i = 0; i < scenes.length; i++)\r\n {\r\n var scene = scenes[i];\r\n\r\n if (scene.sys.input)\r\n {\r\n var capture = scene.sys.input.update(type, pointers);\r\n\r\n if ((capture && this.globalTopOnly) || this._tempSkip)\r\n {\r\n // If the Scene returns true, or called stopPropagation, it means it captured some input that no other Scene should get, so we bail out\r\n return;\r\n }\r\n }\r\n }\r\n },\r\n\r\n // event.targetTouches = list of all touches on the TARGET ELEMENT (i.e. game dom element)\r\n // event.touches = list of all touches on the ENTIRE DOCUMENT, not just the target element\r\n // event.changedTouches = the touches that CHANGED in this event, not the total number of them\r\n\r\n /**\r\n * Processes a touch start event, as passed in by the TouchManager.\r\n *\r\n * @method Phaser.Input.InputManager#onTouchStart\r\n * @private\r\n * @since 3.18.0\r\n *\r\n * @param {TouchEvent} event - The native DOM Touch event.\r\n */\r\n onTouchStart: function (event)\r\n {\r\n var pointers = this.pointers;\r\n var changed = [];\r\n\r\n for (var c = 0; c < event.changedTouches.length; c++)\r\n {\r\n var changedTouch = event.changedTouches[c];\r\n\r\n for (var i = 1; i < this.pointersTotal; i++)\r\n {\r\n var pointer = pointers[i];\r\n\r\n if (!pointer.active)\r\n {\r\n pointer.touchstart(changedTouch, event);\r\n\r\n this.activePointer = pointer;\r\n\r\n changed.push(pointer);\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n this.updateInputPlugins(CONST.TOUCH_START, changed);\r\n },\r\n\r\n /**\r\n * Processes a touch move event, as passed in by the TouchManager.\r\n *\r\n * @method Phaser.Input.InputManager#onTouchMove\r\n * @private\r\n * @since 3.18.0\r\n *\r\n * @param {TouchEvent} event - The native DOM Touch event.\r\n */\r\n onTouchMove: function (event)\r\n {\r\n var pointers = this.pointers;\r\n var changed = [];\r\n\r\n for (var c = 0; c < event.changedTouches.length; c++)\r\n {\r\n var changedTouch = event.changedTouches[c];\r\n\r\n for (var i = 1; i < this.pointersTotal; i++)\r\n {\r\n var pointer = pointers[i];\r\n\r\n if (pointer.active && pointer.identifier === changedTouch.identifier)\r\n {\r\n pointer.touchmove(changedTouch, event);\r\n\r\n this.activePointer = pointer;\r\n\r\n changed.push(pointer);\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n this.updateInputPlugins(CONST.TOUCH_MOVE, changed);\r\n },\r\n\r\n // For touch end its a list of the touch points that have been removed from the surface\r\n // https://developer.mozilla.org/en-US/docs/DOM/TouchList\r\n // event.changedTouches = the touches that CHANGED in this event, not the total number of them\r\n\r\n /**\r\n * Processes a touch end event, as passed in by the TouchManager.\r\n *\r\n * @method Phaser.Input.InputManager#onTouchEnd\r\n * @private\r\n * @since 3.18.0\r\n *\r\n * @param {TouchEvent} event - The native DOM Touch event.\r\n */\r\n onTouchEnd: function (event)\r\n {\r\n var pointers = this.pointers;\r\n var changed = [];\r\n\r\n for (var c = 0; c < event.changedTouches.length; c++)\r\n {\r\n var changedTouch = event.changedTouches[c];\r\n\r\n for (var i = 1; i < this.pointersTotal; i++)\r\n {\r\n var pointer = pointers[i];\r\n\r\n if (pointer.active && pointer.identifier === changedTouch.identifier)\r\n {\r\n pointer.touchend(changedTouch, event);\r\n\r\n changed.push(pointer);\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n this.updateInputPlugins(CONST.TOUCH_END, changed);\r\n },\r\n\r\n /**\r\n * Processes a touch cancel event, as passed in by the TouchManager.\r\n *\r\n * @method Phaser.Input.InputManager#onTouchCancel\r\n * @private\r\n * @since 3.18.0\r\n *\r\n * @param {TouchEvent} event - The native DOM Touch event.\r\n */\r\n onTouchCancel: function (event)\r\n {\r\n var pointers = this.pointers;\r\n var changed = [];\r\n\r\n for (var c = 0; c < event.changedTouches.length; c++)\r\n {\r\n var changedTouch = event.changedTouches[c];\r\n\r\n for (var i = 1; i < this.pointersTotal; i++)\r\n {\r\n var pointer = pointers[i];\r\n\r\n if (pointer.active && pointer.identifier === changedTouch.identifier)\r\n {\r\n pointer.touchcancel(changedTouch, event);\r\n\r\n changed.push(pointer);\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n this.updateInputPlugins(CONST.TOUCH_CANCEL, changed);\r\n },\r\n\r\n /**\r\n * Processes a mouse down event, as passed in by the MouseManager.\r\n *\r\n * @method Phaser.Input.InputManager#onMouseDown\r\n * @private\r\n * @since 3.18.0\r\n *\r\n * @param {MouseEvent} event - The native DOM Mouse event.\r\n */\r\n onMouseDown: function (event)\r\n {\r\n this.mousePointer.down(event);\r\n\r\n this.mousePointer.updateMotion();\r\n\r\n this.updateInputPlugins(CONST.MOUSE_DOWN, this.mousePointerContainer);\r\n },\r\n\r\n /**\r\n * Processes a mouse move event, as passed in by the MouseManager.\r\n *\r\n * @method Phaser.Input.InputManager#onMouseMove\r\n * @private\r\n * @since 3.18.0\r\n *\r\n * @param {MouseEvent} event - The native DOM Mouse event.\r\n */\r\n onMouseMove: function (event)\r\n {\r\n this.mousePointer.move(event);\r\n\r\n this.mousePointer.updateMotion();\r\n\r\n this.updateInputPlugins(CONST.MOUSE_MOVE, this.mousePointerContainer);\r\n },\r\n\r\n /**\r\n * Processes a mouse up event, as passed in by the MouseManager.\r\n *\r\n * @method Phaser.Input.InputManager#onMouseUp\r\n * @private\r\n * @since 3.18.0\r\n *\r\n * @param {MouseEvent} event - The native DOM Mouse event.\r\n */\r\n onMouseUp: function (event)\r\n {\r\n this.mousePointer.up(event);\r\n\r\n this.mousePointer.updateMotion();\r\n\r\n this.updateInputPlugins(CONST.MOUSE_UP, this.mousePointerContainer);\r\n },\r\n\r\n /**\r\n * Processes a mouse wheel event, as passed in by the MouseManager.\r\n *\r\n * @method Phaser.Input.InputManager#onMouseWheel\r\n * @private\r\n * @since 3.18.0\r\n *\r\n * @param {WheelEvent} event - The native DOM Wheel event.\r\n */\r\n onMouseWheel: function (event)\r\n {\r\n this.mousePointer.wheel(event);\r\n\r\n this.updateInputPlugins(CONST.MOUSE_WHEEL, this.mousePointerContainer);\r\n },\r\n\r\n /**\r\n * Processes a pointer lock change event, as passed in by the MouseManager.\r\n *\r\n * @method Phaser.Input.InputManager#onPointerLockChange\r\n * @fires Phaser.Input.Events#POINTERLOCK_CHANGE\r\n * @private\r\n * @since 3.19.0\r\n *\r\n * @param {MouseEvent} event - The native DOM Mouse event.\r\n */\r\n onPointerLockChange: function (event)\r\n {\r\n var isLocked = this.mouse.locked;\r\n\r\n this.mousePointer.locked = isLocked;\r\n\r\n this.events.emit(Events.POINTERLOCK_CHANGE, event, isLocked);\r\n },\r\n\r\n /**\r\n * Checks if the given Game Object should be considered as a candidate for input or not.\r\n *\r\n * Checks if the Game Object has an input component that is enabled, that it will render,\r\n * and finally, if it has a parent, that the parent parent, or any ancestor, is visible or not.\r\n *\r\n * @method Phaser.Input.InputManager#inputCandidate\r\n * @private\r\n * @since 3.10.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to test.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera which is being tested against.\r\n *\r\n * @return {boolean} `true` if the Game Object should be considered for input, otherwise `false`.\r\n */\r\n inputCandidate: function (gameObject, camera)\r\n {\r\n var input = gameObject.input;\r\n\r\n if (!input || !input.enabled || (!input.alwaysEnabled && !gameObject.willRender(camera)))\r\n {\r\n return false;\r\n }\r\n\r\n var visible = true;\r\n var parent = gameObject.parentContainer;\r\n\r\n if (parent)\r\n {\r\n do\r\n {\r\n if (!parent.willRender(camera))\r\n {\r\n visible = false;\r\n break;\r\n }\r\n\r\n parent = parent.parentContainer;\r\n\r\n } while (parent);\r\n }\r\n\r\n return visible;\r\n },\r\n\r\n /**\r\n * Performs a hit test using the given Pointer and camera, against an array of interactive Game Objects.\r\n *\r\n * The Game Objects are culled against the camera, and then the coordinates are translated into the local camera space\r\n * and used to determine if they fall within the remaining Game Objects hit areas or not.\r\n *\r\n * If nothing is matched an empty array is returned.\r\n *\r\n * This method is called automatically by InputPlugin.hitTestPointer and doesn't usually need to be invoked directly.\r\n *\r\n * @method Phaser.Input.InputManager#hitTest\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The Pointer to test against.\r\n * @param {array} gameObjects - An array of interactive Game Objects to check.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera which is being tested against.\r\n * @param {array} [output] - An array to store the results in. If not given, a new empty array is created.\r\n *\r\n * @return {array} An array of the Game Objects that were hit during this hit test.\r\n */\r\n hitTest: function (pointer, gameObjects, camera, output)\r\n {\r\n if (output === undefined) { output = this._tempHitTest; }\r\n\r\n var tempPoint = this._tempPoint;\r\n\r\n var csx = camera.scrollX;\r\n var csy = camera.scrollY;\r\n\r\n output.length = 0;\r\n\r\n var x = pointer.x;\r\n var y = pointer.y;\r\n\r\n if (camera.resolution !== 1)\r\n {\r\n x += camera._x;\r\n y += camera._y;\r\n }\r\n\r\n // Stores the world point inside of tempPoint\r\n camera.getWorldPoint(x, y, tempPoint);\r\n\r\n pointer.worldX = tempPoint.x;\r\n pointer.worldY = tempPoint.y;\r\n\r\n var point = { x: 0, y: 0 };\r\n\r\n var matrix = this._tempMatrix;\r\n var parentMatrix = this._tempMatrix2;\r\n\r\n for (var i = 0; i < gameObjects.length; i++)\r\n {\r\n var gameObject = gameObjects[i];\r\n\r\n // Checks if the Game Object can receive input (isn't being ignored by the camera, invisible, etc)\r\n // and also checks all of its parents, if any\r\n if (!this.inputCandidate(gameObject, camera))\r\n {\r\n continue;\r\n }\r\n\r\n var px = tempPoint.x + (csx * gameObject.scrollFactorX) - csx;\r\n var py = tempPoint.y + (csy * gameObject.scrollFactorY) - csy;\r\n\r\n if (gameObject.parentContainer)\r\n {\r\n gameObject.getWorldTransformMatrix(matrix, parentMatrix);\r\n\r\n matrix.applyInverse(px, py, point);\r\n }\r\n else\r\n {\r\n TransformXY(px, py, gameObject.x, gameObject.y, gameObject.rotation, gameObject.scaleX, gameObject.scaleY, point);\r\n }\r\n \r\n if (this.pointWithinHitArea(gameObject, point.x, point.y))\r\n {\r\n output.push(gameObject);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Checks if the given x and y coordinate are within the hit area of the Game Object.\r\n *\r\n * This method assumes that the coordinate values have already been translated into the space of the Game Object.\r\n *\r\n * If the coordinates are within the hit area they are set into the Game Objects Input `localX` and `localY` properties.\r\n *\r\n * @method Phaser.Input.InputManager#pointWithinHitArea\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object to check against.\r\n * @param {number} x - The translated x coordinate for the hit test.\r\n * @param {number} y - The translated y coordinate for the hit test.\r\n *\r\n * @return {boolean} `true` if the coordinates were inside the Game Objects hit area, otherwise `false`.\r\n */\r\n pointWithinHitArea: function (gameObject, x, y)\r\n {\r\n // Normalize the origin\r\n x += gameObject.displayOriginX;\r\n y += gameObject.displayOriginY;\r\n\r\n var input = gameObject.input;\r\n\r\n if (input && input.hitAreaCallback(input.hitArea, x, y, gameObject))\r\n {\r\n input.localX = x;\r\n input.localY = y;\r\n\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n },\r\n\r\n /**\r\n * Checks if the given x and y coordinate are within the hit area of the Interactive Object.\r\n *\r\n * This method assumes that the coordinate values have already been translated into the space of the Interactive Object.\r\n *\r\n * If the coordinates are within the hit area they are set into the Interactive Objects Input `localX` and `localY` properties.\r\n *\r\n * @method Phaser.Input.InputManager#pointWithinInteractiveObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Input.InteractiveObject} object - The Interactive Object to check against.\r\n * @param {number} x - The translated x coordinate for the hit test.\r\n * @param {number} y - The translated y coordinate for the hit test.\r\n *\r\n * @return {boolean} `true` if the coordinates were inside the Game Objects hit area, otherwise `false`.\r\n */\r\n pointWithinInteractiveObject: function (object, x, y)\r\n {\r\n if (!object.hitArea)\r\n {\r\n return false;\r\n }\r\n\r\n // Normalize the origin\r\n x += object.gameObject.displayOriginX;\r\n y += object.gameObject.displayOriginY;\r\n\r\n object.localX = x;\r\n object.localY = y;\r\n\r\n return object.hitAreaCallback(object.hitArea, x, y, object);\r\n },\r\n\r\n /**\r\n * Transforms the pageX and pageY values of a Pointer into the scaled coordinate space of the Input Manager.\r\n *\r\n * @method Phaser.Input.InputManager#transformPointer\r\n * @since 3.10.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The Pointer to transform the values for.\r\n * @param {number} pageX - The Page X value.\r\n * @param {number} pageY - The Page Y value.\r\n * @param {boolean} wasMove - Are we transforming the Pointer from a move event, or an up / down event?\r\n */\r\n transformPointer: function (pointer, pageX, pageY, wasMove)\r\n {\r\n var p0 = pointer.position;\r\n var p1 = pointer.prevPosition;\r\n\r\n // Store previous position\r\n p1.x = p0.x;\r\n p1.y = p0.y;\r\n\r\n // Translate coordinates\r\n var x = this.scaleManager.transformX(pageX);\r\n var y = this.scaleManager.transformY(pageY);\r\n\r\n var a = pointer.smoothFactor;\r\n\r\n if (!wasMove || a === 0)\r\n {\r\n // Set immediately\r\n p0.x = x;\r\n p0.y = y;\r\n }\r\n else\r\n {\r\n // Apply smoothing\r\n p0.x = x * a + p1.x * (1 - a);\r\n p0.y = y * a + p1.y * (1 - a);\r\n }\r\n },\r\n\r\n /**\r\n * Destroys the Input Manager and all of its systems.\r\n *\r\n * There is no way to recover from doing this.\r\n *\r\n * @method Phaser.Input.InputManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.events.removeAllListeners();\r\n\r\n this.game.events.off(GameEvents.PRE_RENDER);\r\n\r\n if (this.keyboard)\r\n {\r\n this.keyboard.destroy();\r\n }\r\n\r\n if (this.mouse)\r\n {\r\n this.mouse.destroy();\r\n }\r\n\r\n if (this.touch)\r\n {\r\n this.touch.destroy();\r\n }\r\n\r\n for (var i = 0; i < this.pointers.length; i++)\r\n {\r\n this.pointers[i].destroy();\r\n }\r\n\r\n this.pointers = [];\r\n this._tempHitTest = [];\r\n this._tempMatrix.destroy();\r\n this.canvas = null;\r\n this.game = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = InputManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/InputManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/InputPlugin.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/input/InputPlugin.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Circle = __webpack_require__(/*! ../geom/circle/Circle */ \"./node_modules/phaser/src/geom/circle/Circle.js\");\r\nvar CircleContains = __webpack_require__(/*! ../geom/circle/Contains */ \"./node_modules/phaser/src/geom/circle/Contains.js\");\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/input/const.js\");\r\nvar CreateInteractiveObject = __webpack_require__(/*! ./CreateInteractiveObject */ \"./node_modules/phaser/src/input/CreateInteractiveObject.js\");\r\nvar CreatePixelPerfectHandler = __webpack_require__(/*! ./CreatePixelPerfectHandler */ \"./node_modules/phaser/src/input/CreatePixelPerfectHandler.js\");\r\nvar DistanceBetween = __webpack_require__(/*! ../math/distance/DistanceBetween */ \"./node_modules/phaser/src/math/distance/DistanceBetween.js\");\r\nvar Ellipse = __webpack_require__(/*! ../geom/ellipse/Ellipse */ \"./node_modules/phaser/src/geom/ellipse/Ellipse.js\");\r\nvar EllipseContains = __webpack_require__(/*! ../geom/ellipse/Contains */ \"./node_modules/phaser/src/geom/ellipse/Contains.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/input/events/index.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar GEOM_CONST = __webpack_require__(/*! ../geom/const */ \"./node_modules/phaser/src/geom/const.js\");\r\nvar InputPluginCache = __webpack_require__(/*! ./InputPluginCache */ \"./node_modules/phaser/src/input/InputPluginCache.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\nvar PluginCache = __webpack_require__(/*! ../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar Rectangle = __webpack_require__(/*! ../geom/rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar RectangleContains = __webpack_require__(/*! ../geom/rectangle/Contains */ \"./node_modules/phaser/src/geom/rectangle/Contains.js\");\r\nvar SceneEvents = __webpack_require__(/*! ../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\nvar Triangle = __webpack_require__(/*! ../geom/triangle/Triangle */ \"./node_modules/phaser/src/geom/triangle/Triangle.js\");\r\nvar TriangleContains = __webpack_require__(/*! ../geom/triangle/Contains */ \"./node_modules/phaser/src/geom/triangle/Contains.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Input Plugin belongs to a Scene and handles all input related events and operations for it.\r\n *\r\n * You can access it from within a Scene using `this.input`.\r\n *\r\n * It emits events directly. For example, you can do:\r\n *\r\n * ```javascript\r\n * this.input.on('pointerdown', callback, context);\r\n * ```\r\n *\r\n * To listen for a pointer down event anywhere on the game canvas.\r\n *\r\n * Game Objects can be enabled for input by calling their `setInteractive` method. After which they\r\n * will directly emit input events:\r\n *\r\n * ```javascript\r\n * var sprite = this.add.sprite(x, y, texture);\r\n * sprite.setInteractive();\r\n * sprite.on('pointerdown', callback, context);\r\n * ```\r\n *\r\n * There are lots of game configuration options available relating to input.\r\n * See the [Input Config object]{@linkcode Phaser.Types.Core.InputConfig} for more details, including how to deal with Phaser\r\n * listening for input events outside of the canvas, how to set a default number of pointers, input\r\n * capture settings and more.\r\n *\r\n * Please also see the Input examples and tutorials for further information.\r\n *\r\n * @class InputPlugin\r\n * @extends Phaser.Events.EventEmitter\r\n * @memberof Phaser.Input\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that this Input Plugin is responsible for.\r\n */\r\nvar InputPlugin = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function InputPlugin (scene)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * A reference to the Scene that this Input Plugin is responsible for.\r\n *\r\n * @name Phaser.Input.InputPlugin#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A reference to the Scene Systems class.\r\n *\r\n * @name Phaser.Input.InputPlugin#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n /**\r\n * A reference to the Scene Systems Settings.\r\n *\r\n * @name Phaser.Input.InputPlugin#settings\r\n * @type {Phaser.Types.Scenes.SettingsObject}\r\n * @since 3.5.0\r\n */\r\n this.settings = scene.sys.settings;\r\n\r\n /**\r\n * A reference to the Game Input Manager.\r\n *\r\n * @name Phaser.Input.InputPlugin#manager\r\n * @type {Phaser.Input.InputManager}\r\n * @since 3.0.0\r\n */\r\n this.manager = scene.sys.game.input;\r\n\r\n /**\r\n * Internal event queue used for plugins only.\r\n *\r\n * @name Phaser.Input.InputPlugin#pluginEvents\r\n * @type {Phaser.Events.EventEmitter}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this.pluginEvents = new EventEmitter();\r\n\r\n /**\r\n * If `true` this Input Plugin will process DOM input events.\r\n *\r\n * @name Phaser.Input.InputPlugin#enabled\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.5.0\r\n */\r\n this.enabled = true;\r\n\r\n /**\r\n * A reference to the Scene Display List. This property is set during the `boot` method.\r\n *\r\n * @name Phaser.Input.InputPlugin#displayList\r\n * @type {Phaser.GameObjects.DisplayList}\r\n * @since 3.0.0\r\n */\r\n this.displayList;\r\n\r\n /**\r\n * A reference to the Scene Cameras Manager. This property is set during the `boot` method.\r\n *\r\n * @name Phaser.Input.InputPlugin#cameras\r\n * @type {Phaser.Cameras.Scene2D.CameraManager}\r\n * @since 3.0.0\r\n */\r\n this.cameras;\r\n\r\n // Inject the available input plugins into this class\r\n InputPluginCache.install(this);\r\n\r\n /**\r\n * A reference to the Mouse Manager.\r\n *\r\n * This property is only set if Mouse support has been enabled in your Game Configuration file.\r\n *\r\n * If you just wish to get access to the mouse pointer, use the `mousePointer` property instead.\r\n *\r\n * @name Phaser.Input.InputPlugin#mouse\r\n * @type {?Phaser.Input.Mouse.MouseManager}\r\n * @since 3.0.0\r\n */\r\n this.mouse = this.manager.mouse;\r\n\r\n /**\r\n * When set to `true` (the default) the Input Plugin will emulate DOM behavior by only emitting events from\r\n * the top-most Game Objects in the Display List.\r\n *\r\n * If set to `false` it will emit events from all Game Objects below a Pointer, not just the top one.\r\n *\r\n * @name Phaser.Input.InputPlugin#topOnly\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.topOnly = true;\r\n\r\n /**\r\n * How often should the Pointers be checked?\r\n *\r\n * The value is a time, given in ms, and is the time that must have elapsed between game steps before\r\n * the Pointers will be polled again. When a pointer is polled it runs a hit test to see which Game\r\n * Objects are currently below it, or being interacted with it.\r\n *\r\n * Pointers will *always* be checked if they have been moved by the user, or press or released.\r\n *\r\n * This property only controls how often they will be polled if they have not been updated.\r\n * You should set this if you want to have Game Objects constantly check against the pointers, even\r\n * if the pointer didn't itself move.\r\n *\r\n * Set to 0 to poll constantly. Set to -1 to only poll on user movement.\r\n *\r\n * @name Phaser.Input.InputPlugin#pollRate\r\n * @type {integer}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.pollRate = -1;\r\n\r\n /**\r\n * Internal poll timer value.\r\n *\r\n * @name Phaser.Input.InputPlugin#_pollTimer\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._pollTimer = 0;\r\n\r\n var _eventData = { cancelled: false };\r\n\r\n /**\r\n * Internal event propagation callback container.\r\n *\r\n * @name Phaser.Input.InputPlugin#_eventContainer\r\n * @type {Phaser.Types.Input.EventData}\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._eventContainer = {\r\n stopPropagation: function ()\r\n {\r\n _eventData.cancelled = true;\r\n }\r\n };\r\n\r\n /**\r\n * Internal event propagation data object.\r\n *\r\n * @name Phaser.Input.InputPlugin#_eventData\r\n * @type {object}\r\n * @private\r\n * @since 3.13.0\r\n */\r\n this._eventData = _eventData;\r\n\r\n /**\r\n * The distance, in pixels, a pointer has to move while being held down, before it thinks it is being dragged.\r\n *\r\n * @name Phaser.Input.InputPlugin#dragDistanceThreshold\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.dragDistanceThreshold = 0;\r\n\r\n /**\r\n * The amount of time, in ms, a pointer has to be held down before it thinks it is dragging.\r\n *\r\n * The default polling rate is to poll only on move so once the time threshold is reached the\r\n * drag event will not start until you move the mouse. If you want it to start immediately\r\n * when the time threshold is reached, you must increase the polling rate by calling\r\n * [setPollAlways]{@linkcode Phaser.Input.InputPlugin#setPollAlways} or\r\n * [setPollRate]{@linkcode Phaser.Input.InputPlugin#setPollRate}.\r\n *\r\n * @name Phaser.Input.InputPlugin#dragTimeThreshold\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.dragTimeThreshold = 0;\r\n\r\n /**\r\n * Used to temporarily store the results of the Hit Test\r\n *\r\n * @name Phaser.Input.InputPlugin#_temp\r\n * @type {array}\r\n * @private\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this._temp = [];\r\n\r\n /**\r\n * Used to temporarily store the results of the Hit Test dropZones\r\n *\r\n * @name Phaser.Input.InputPlugin#_tempZones\r\n * @type {array}\r\n * @private\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this._tempZones = [];\r\n\r\n /**\r\n * A list of all Game Objects that have been set to be interactive in the Scene this Input Plugin is managing.\r\n *\r\n * @name Phaser.Input.InputPlugin#_list\r\n * @type {Phaser.GameObjects.GameObject[]}\r\n * @private\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this._list = [];\r\n\r\n /**\r\n * Objects waiting to be inserted to the list on the next call to 'begin'.\r\n *\r\n * @name Phaser.Input.InputPlugin#_pendingInsertion\r\n * @type {Phaser.GameObjects.GameObject[]}\r\n * @private\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this._pendingInsertion = [];\r\n\r\n /**\r\n * Objects waiting to be removed from the list on the next call to 'begin'.\r\n *\r\n * @name Phaser.Input.InputPlugin#_pendingRemoval\r\n * @type {Phaser.GameObjects.GameObject[]}\r\n * @private\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this._pendingRemoval = [];\r\n\r\n /**\r\n * A list of all Game Objects that have been enabled for dragging.\r\n *\r\n * @name Phaser.Input.InputPlugin#_draggable\r\n * @type {Phaser.GameObjects.GameObject[]}\r\n * @private\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this._draggable = [];\r\n\r\n /**\r\n * A list of all Interactive Objects currently considered as being 'draggable' by any pointer, indexed by pointer ID.\r\n *\r\n * @name Phaser.Input.InputPlugin#_drag\r\n * @type {{0:Array,1:Array,2:Array,3:Array,4:Array,5:Array,6:Array,7:Array,8:Array,9:Array,10:Array}}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._drag = { 0: [], 1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [], 8: [], 9: [], 10: [] };\r\n\r\n /**\r\n * A array containing the dragStates, for this Scene, index by the Pointer ID.\r\n *\r\n * @name Phaser.Input.InputPlugin#_dragState\r\n * @type {integer[]}\r\n * @private\r\n * @since 3.16.0\r\n */\r\n this._dragState = [];\r\n\r\n /**\r\n * A list of all Interactive Objects currently considered as being 'over' by any pointer, indexed by pointer ID.\r\n *\r\n * @name Phaser.Input.InputPlugin#_over\r\n * @type {{0:Array,1:Array,2:Array,3:Array,4:Array,5:Array,6:Array,7:Array,8:Array,9:Array,10:Array}}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._over = { 0: [], 1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [], 8: [], 9: [], 10: [] };\r\n\r\n /**\r\n * A list of valid DOM event types.\r\n *\r\n * @name Phaser.Input.InputPlugin#_validTypes\r\n * @type {string[]}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._validTypes = [ 'onDown', 'onUp', 'onOver', 'onOut', 'onMove', 'onDragStart', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragLeave', 'onDragOver', 'onDrop' ];\r\n\r\n /**\r\n * Internal property that tracks frame event state.\r\n *\r\n * @name Phaser.Input.InputPlugin#_updatedThisFrame\r\n * @type {boolean}\r\n * @private\r\n * @since 3.18.0\r\n */\r\n this._updatedThisFrame = false;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n scene.sys.events.on(SceneEvents.START, this.start, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Input.InputPlugin#boot\r\n * @fires Phaser.Input.Events#BOOT\r\n * @private\r\n * @since 3.5.1\r\n */\r\n boot: function ()\r\n {\r\n this.cameras = this.systems.cameras;\r\n\r\n this.displayList = this.systems.displayList;\r\n\r\n this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);\r\n\r\n // Registered input plugins listen for this\r\n this.pluginEvents.emit(Events.BOOT);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Input.InputPlugin#start\r\n * @fires Phaser.Input.Events#START\r\n * @private\r\n * @since 3.5.0\r\n */\r\n start: function ()\r\n {\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.on(SceneEvents.TRANSITION_START, this.transitionIn, this);\r\n eventEmitter.on(SceneEvents.TRANSITION_OUT, this.transitionOut, this);\r\n eventEmitter.on(SceneEvents.TRANSITION_COMPLETE, this.transitionComplete, this);\r\n eventEmitter.on(SceneEvents.PRE_UPDATE, this.preUpdate, this);\r\n eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n\r\n this.manager.events.on(Events.GAME_OUT, this.onGameOut, this);\r\n this.manager.events.on(Events.GAME_OVER, this.onGameOver, this);\r\n\r\n this.enabled = true;\r\n\r\n // Populate the pointer drag states\r\n this._dragState = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\r\n\r\n // Registered input plugins listen for this\r\n this.pluginEvents.emit(Events.START);\r\n },\r\n\r\n /**\r\n * Game Over handler.\r\n *\r\n * @method Phaser.Input.InputPlugin#onGameOver\r\n * @fires Phaser.Input.Events#GAME_OVER\r\n * @private\r\n * @since 3.16.2\r\n */\r\n onGameOver: function (event)\r\n {\r\n if (this.isActive())\r\n {\r\n this.emit(Events.GAME_OVER, event.timeStamp, event);\r\n }\r\n },\r\n\r\n /**\r\n * Game Out handler.\r\n *\r\n * @method Phaser.Input.InputPlugin#onGameOut\r\n * @fires Phaser.Input.Events#GAME_OUT\r\n * @private\r\n * @since 3.16.2\r\n */\r\n onGameOut: function (event)\r\n {\r\n if (this.isActive())\r\n {\r\n this.emit(Events.GAME_OUT, event.timeStamp, event);\r\n }\r\n },\r\n\r\n /**\r\n * The pre-update handler is responsible for checking the pending removal and insertion lists and\r\n * deleting old Game Objects.\r\n *\r\n * @method Phaser.Input.InputPlugin#preUpdate\r\n * @private\r\n * @fires Phaser.Input.Events#PRE_UPDATE\r\n * @since 3.0.0\r\n */\r\n preUpdate: function ()\r\n {\r\n // Registered input plugins listen for this\r\n this.pluginEvents.emit(Events.PRE_UPDATE);\r\n\r\n var removeList = this._pendingRemoval;\r\n var insertList = this._pendingInsertion;\r\n\r\n var toRemove = removeList.length;\r\n var toInsert = insertList.length;\r\n\r\n if (toRemove === 0 && toInsert === 0)\r\n {\r\n // Quick bail\r\n return;\r\n }\r\n\r\n var current = this._list;\r\n\r\n // Delete old gameObjects\r\n for (var i = 0; i < toRemove; i++)\r\n {\r\n var gameObject = removeList[i];\r\n\r\n var index = current.indexOf(gameObject);\r\n\r\n if (index > -1)\r\n {\r\n current.splice(index, 1);\r\n\r\n this.clear(gameObject, true);\r\n }\r\n }\r\n\r\n // Clear the removal list\r\n removeList.length = 0;\r\n this._pendingRemoval.length = 0;\r\n\r\n // Move pendingInsertion to list (also clears pendingInsertion at the same time)\r\n this._list = current.concat(insertList.splice(0));\r\n },\r\n\r\n /**\r\n * Checks to see if both this plugin and the Scene to which it belongs is active.\r\n *\r\n * @method Phaser.Input.InputPlugin#isActive\r\n * @since 3.10.0\r\n *\r\n * @return {boolean} `true` if the plugin and the Scene it belongs to is active.\r\n */\r\n isActive: function ()\r\n {\r\n return (this.enabled && this.scene.sys.isActive());\r\n },\r\n\r\n /**\r\n * This is called automatically by the Input Manager.\r\n * It emits events for plugins to listen to and also handles polling updates, if enabled.\r\n *\r\n * @method Phaser.Input.InputPlugin#updatePoll\r\n * @since 3.18.0\r\n *\r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n *\r\n * @return {boolean} `true` if the plugin and the Scene it belongs to is active.\r\n */\r\n updatePoll: function (time, delta)\r\n {\r\n if (!this.isActive())\r\n {\r\n return false;\r\n }\r\n\r\n // The plugins should update every frame, regardless if there has been\r\n // any DOM input events or not (such as the Gamepad and Keyboard)\r\n this.pluginEvents.emit(Events.UPDATE, time, delta);\r\n\r\n // We can leave now if we've already updated once this frame via the immediate DOM event handlers\r\n if (this._updatedThisFrame)\r\n {\r\n this._updatedThisFrame = false;\r\n\r\n return false;\r\n }\r\n\r\n var i;\r\n var manager = this.manager;\r\n\r\n var pointers = manager.pointers;\r\n var pointersTotal = manager.pointersTotal;\r\n\r\n for (i = 0; i < pointersTotal; i++)\r\n {\r\n pointers[i].updateMotion();\r\n }\r\n\r\n // No point going any further if there aren't any interactive objects\r\n if (this._list.length === 0)\r\n {\r\n return false;\r\n }\r\n\r\n var rate = this.pollRate;\r\n\r\n if (rate === -1)\r\n {\r\n return false;\r\n }\r\n else if (rate > 0)\r\n {\r\n this._pollTimer -= delta;\r\n\r\n if (this._pollTimer < 0)\r\n {\r\n // Discard timer diff, we're ready to poll again\r\n this._pollTimer = this.pollRate;\r\n }\r\n else\r\n {\r\n // Not enough time has elapsed since the last poll, so abort now\r\n return false;\r\n }\r\n }\r\n\r\n // We got this far? Then we should poll for movement\r\n var captured = false;\r\n\r\n for (i = 0; i < pointersTotal; i++)\r\n {\r\n var total = 0;\r\n\r\n var pointer = pointers[i];\r\n\r\n // Always reset this array\r\n this._tempZones = [];\r\n\r\n // _temp contains a hit tested and camera culled list of IO objects\r\n this._temp = this.hitTestPointer(pointer);\r\n\r\n this.sortGameObjects(this._temp);\r\n this.sortGameObjects(this._tempZones);\r\n\r\n if (this.topOnly)\r\n {\r\n // Only the top-most one counts now, so safely ignore the rest\r\n if (this._temp.length)\r\n {\r\n this._temp.splice(1);\r\n }\r\n\r\n if (this._tempZones.length)\r\n {\r\n this._tempZones.splice(1);\r\n }\r\n }\r\n\r\n total += this.processOverOutEvents(pointer);\r\n\r\n if (this.getDragState(pointer) === 2)\r\n {\r\n this.processDragThresholdEvent(pointer, time);\r\n }\r\n\r\n if (total > 0)\r\n {\r\n // We interacted with an event in this Scene, so block any Scenes below us from doing the same this frame\r\n captured = true;\r\n }\r\n }\r\n\r\n return captured;\r\n },\r\n\r\n /**\r\n * This method is called when a DOM Event is received by the Input Manager. It handles dispatching the events\r\n * to relevant input enabled Game Objects in this scene.\r\n *\r\n * @method Phaser.Input.InputPlugin#update\r\n * @private\r\n * @fires Phaser.Input.Events#UPDATE\r\n * @since 3.0.0\r\n *\r\n * @param {integer} type - The type of event to process.\r\n * @param {Phaser.Input.Pointer[]} pointers - An array of Pointers on which the event occurred.\r\n *\r\n * @return {boolean} `true` if this Scene has captured the input events from all other Scenes, otherwise `false`.\r\n */\r\n update: function (type, pointers)\r\n {\r\n if (!this.isActive())\r\n {\r\n return false;\r\n }\r\n\r\n var pointersTotal = pointers.length;\r\n var captured = false;\r\n\r\n for (var i = 0; i < pointersTotal; i++)\r\n {\r\n var total = 0;\r\n var pointer = pointers[i];\r\n\r\n // Always reset this array\r\n this._tempZones = [];\r\n\r\n // _temp contains a hit tested and camera culled list of IO objects\r\n this._temp = this.hitTestPointer(pointer);\r\n\r\n this.sortGameObjects(this._temp);\r\n this.sortGameObjects(this._tempZones);\r\n\r\n if (this.topOnly)\r\n {\r\n // Only the top-most one counts now, so safely ignore the rest\r\n if (this._temp.length)\r\n {\r\n this._temp.splice(1);\r\n }\r\n\r\n if (this._tempZones.length)\r\n {\r\n this._tempZones.splice(1);\r\n }\r\n }\r\n\r\n switch (type)\r\n {\r\n case CONST.MOUSE_DOWN:\r\n total += this.processDragDownEvent(pointer);\r\n total += this.processDownEvents(pointer);\r\n total += this.processOverOutEvents(pointer);\r\n break;\r\n\r\n case CONST.MOUSE_UP:\r\n total += this.processDragUpEvent(pointer);\r\n total += this.processUpEvents(pointer);\r\n total += this.processOverOutEvents(pointer);\r\n break;\r\n\r\n case CONST.TOUCH_START:\r\n total += this.processDragDownEvent(pointer);\r\n total += this.processDownEvents(pointer);\r\n total += this.processOverEvents(pointer);\r\n break;\r\n\r\n case CONST.TOUCH_END:\r\n case CONST.TOUCH_CANCEL:\r\n total += this.processDragUpEvent(pointer);\r\n total += this.processUpEvents(pointer);\r\n total += this.processOutEvents(pointer);\r\n break;\r\n\r\n case CONST.MOUSE_MOVE:\r\n case CONST.TOUCH_MOVE:\r\n total += this.processDragMoveEvent(pointer);\r\n total += this.processMoveEvents(pointer);\r\n total += this.processOverOutEvents(pointer);\r\n break;\r\n\r\n case CONST.MOUSE_WHEEL:\r\n total += this.processWheelEvent(pointer);\r\n break;\r\n }\r\n\r\n if (total > 0)\r\n {\r\n // We interacted with an event in this Scene, so block any Scenes below us from doing the same this frame\r\n captured = true;\r\n }\r\n }\r\n\r\n this._updatedThisFrame = true;\r\n\r\n return captured;\r\n },\r\n\r\n /**\r\n * Clears a Game Object so it no longer has an Interactive Object associated with it.\r\n * The Game Object is then queued for removal from the Input Plugin on the next update.\r\n *\r\n * @method Phaser.Input.InputPlugin#clear\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will have its Interactive Object removed.\r\n * @param {boolean} [skipQueue=false] - Skip adding this Game Object into the removal queue?\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that had its Interactive Object removed.\r\n */\r\n clear: function (gameObject, skipQueue)\r\n {\r\n if (skipQueue === undefined) { skipQueue = false; }\r\n\r\n var input = gameObject.input;\r\n\r\n // If GameObject.input already cleared from higher class\r\n if (!input)\r\n {\r\n return;\r\n }\r\n\r\n if (!skipQueue)\r\n {\r\n this.queueForRemoval(gameObject);\r\n }\r\n\r\n input.gameObject = undefined;\r\n input.target = undefined;\r\n input.hitArea = undefined;\r\n input.hitAreaCallback = undefined;\r\n input.callbackContext = undefined;\r\n\r\n this.manager.resetCursor(input);\r\n\r\n gameObject.input = null;\r\n\r\n // Clear from _draggable, _drag and _over\r\n var index = this._draggable.indexOf(gameObject);\r\n\r\n if (index > -1)\r\n {\r\n this._draggable.splice(index, 1);\r\n }\r\n\r\n index = this._drag[0].indexOf(gameObject);\r\n\r\n if (index > -1)\r\n {\r\n this._drag[0].splice(index, 1);\r\n }\r\n\r\n index = this._over[0].indexOf(gameObject);\r\n\r\n if (index > -1)\r\n {\r\n this._over[0].splice(index, 1);\r\n }\r\n\r\n return gameObject;\r\n },\r\n\r\n /**\r\n * Disables Input on a single Game Object.\r\n *\r\n * An input disabled Game Object still retains its Interactive Object component and can be re-enabled\r\n * at any time, by passing it to `InputPlugin.enable`.\r\n *\r\n * @method Phaser.Input.InputPlugin#disable\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to have its input system disabled.\r\n */\r\n disable: function (gameObject)\r\n {\r\n gameObject.input.enabled = false;\r\n },\r\n\r\n /**\r\n * Enable a Game Object for interaction.\r\n *\r\n * If the Game Object already has an Interactive Object component, it is enabled and returned.\r\n *\r\n * Otherwise, a new Interactive Object component is created and assigned to the Game Object's `input` property.\r\n *\r\n * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area\r\n * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced\r\n * input detection.\r\n *\r\n * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If\r\n * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific\r\n * shape for it to use.\r\n *\r\n * You can also provide an Input Configuration Object as the only argument to this method.\r\n *\r\n * @method Phaser.Input.InputPlugin#enable\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to be enabled for input.\r\n * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - 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.\r\n * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The 'contains' function to invoke to check if the pointer is within the hit area.\r\n * @param {boolean} [dropZone=false] - Is this Game Object a drop zone or not?\r\n *\r\n * @return {Phaser.Input.InputPlugin} This Input Plugin.\r\n */\r\n enable: function (gameObject, shape, callback, dropZone)\r\n {\r\n if (dropZone === undefined) { dropZone = false; }\r\n\r\n if (gameObject.input)\r\n {\r\n // If it is already has an InteractiveObject then just enable it and return\r\n gameObject.input.enabled = true;\r\n }\r\n else\r\n {\r\n // Create an InteractiveObject and enable it\r\n this.setHitArea(gameObject, shape, callback);\r\n }\r\n\r\n if (gameObject.input && dropZone && !gameObject.input.dropZone)\r\n {\r\n gameObject.input.dropZone = dropZone;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes the given Pointer and performs a hit test against it, to see which interactive Game Objects\r\n * it is currently above.\r\n *\r\n * The hit test is performed against which-ever Camera the Pointer is over. If it is over multiple\r\n * cameras, it starts checking the camera at the top of the camera list, and if nothing is found, iterates down the list.\r\n *\r\n * @method Phaser.Input.InputPlugin#hitTestPointer\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The Pointer to check against the Game Objects.\r\n *\r\n * @return {Phaser.GameObjects.GameObject[]} An array of all the interactive Game Objects the Pointer was above.\r\n */\r\n hitTestPointer: function (pointer)\r\n {\r\n var cameras = this.cameras.getCamerasBelowPointer(pointer);\r\n\r\n for (var c = 0; c < cameras.length; c++)\r\n {\r\n var camera = cameras[c];\r\n\r\n // Get a list of all objects that can be seen by the camera below the pointer in the scene and store in 'over' array.\r\n // All objects in this array are input enabled, as checked by the hitTest method, so we don't need to check later on as well.\r\n var over = this.manager.hitTest(pointer, this._list, camera);\r\n\r\n // Filter out the drop zones\r\n for (var i = 0; i < over.length; i++)\r\n {\r\n var obj = over[i];\r\n\r\n if (obj.input.dropZone)\r\n {\r\n this._tempZones.push(obj);\r\n }\r\n }\r\n\r\n if (over.length > 0)\r\n {\r\n pointer.camera = camera;\r\n\r\n return over;\r\n }\r\n }\r\n\r\n // If we got this far then there were no Game Objects below the pointer, but it was still over\r\n // a camera, so set that the top-most one into the pointer\r\n\r\n pointer.camera = cameras[0];\r\n\r\n return [];\r\n },\r\n\r\n /**\r\n * An internal method that handles the Pointer down event.\r\n *\r\n * @method Phaser.Input.InputPlugin#processDownEvents\r\n * @private\r\n * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_DOWN\r\n * @fires Phaser.Input.Events#GAMEOBJECT_DOWN\r\n * @fires Phaser.Input.Events#POINTER_DOWN\r\n * @fires Phaser.Input.Events#POINTER_DOWN_OUTSIDE\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The Pointer being tested.\r\n *\r\n * @return {integer} The total number of objects interacted with.\r\n */\r\n processDownEvents: function (pointer)\r\n {\r\n var total = 0;\r\n var currentlyOver = this._temp;\r\n\r\n var _eventData = this._eventData;\r\n var _eventContainer = this._eventContainer;\r\n\r\n _eventData.cancelled = false;\r\n\r\n var aborted = false;\r\n\r\n // Go through all objects the pointer was over and fire their events / callbacks\r\n for (var i = 0; i < currentlyOver.length; i++)\r\n {\r\n var gameObject = currentlyOver[i];\r\n\r\n if (!gameObject.input)\r\n {\r\n continue;\r\n }\r\n\r\n total++;\r\n\r\n gameObject.emit(Events.GAMEOBJECT_POINTER_DOWN, pointer, gameObject.input.localX, gameObject.input.localY, _eventContainer);\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n\r\n this.emit(Events.GAMEOBJECT_DOWN, pointer, gameObject, _eventContainer);\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n }\r\n\r\n // If they released outside the canvas, but pressed down inside it, we'll still dispatch the event.\r\n if (!aborted && this.manager)\r\n {\r\n if (pointer.downElement === this.manager.game.canvas)\r\n {\r\n this.emit(Events.POINTER_DOWN, pointer, currentlyOver);\r\n }\r\n else\r\n {\r\n this.emit(Events.POINTER_DOWN_OUTSIDE, pointer);\r\n }\r\n }\r\n\r\n return total;\r\n },\r\n\r\n /**\r\n * Returns the drag state of the given Pointer for this Input Plugin.\r\n *\r\n * The state will be one of the following:\r\n *\r\n * 0 = Not dragging anything\r\n * 1 = Primary button down and objects below, so collect a draglist\r\n * 2 = Pointer being checked if meets drag criteria\r\n * 3 = Pointer meets criteria, notify the draglist\r\n * 4 = Pointer actively dragging the draglist and has moved\r\n * 5 = Pointer actively dragging but has been released, notify draglist\r\n *\r\n * @method Phaser.Input.InputPlugin#getDragState\r\n * @since 3.16.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The Pointer to get the drag state for.\r\n *\r\n * @return {integer} The drag state of the given Pointer.\r\n */\r\n getDragState: function (pointer)\r\n {\r\n return this._dragState[pointer.id];\r\n },\r\n\r\n /**\r\n * Sets the drag state of the given Pointer for this Input Plugin.\r\n *\r\n * The state must be one of the following values:\r\n *\r\n * 0 = Not dragging anything\r\n * 1 = Primary button down and objects below, so collect a draglist\r\n * 2 = Pointer being checked if meets drag criteria\r\n * 3 = Pointer meets criteria, notify the draglist\r\n * 4 = Pointer actively dragging the draglist and has moved\r\n * 5 = Pointer actively dragging but has been released, notify draglist\r\n *\r\n * @method Phaser.Input.InputPlugin#setDragState\r\n * @since 3.16.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The Pointer to set the drag state for.\r\n * @param {integer} state - The drag state value. An integer between 0 and 5.\r\n */\r\n setDragState: function (pointer, state)\r\n {\r\n this._dragState[pointer.id] = state;\r\n },\r\n\r\n /**\r\n * Checks to see if a Pointer is ready to drag the objects below it, based on either a distance\r\n * or time threshold.\r\n *\r\n * @method Phaser.Input.InputPlugin#processDragThresholdEvent\r\n * @private\r\n * @since 3.18.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The Pointer to check the drag thresholds on.\r\n * @param {number} time - The current time.\r\n */\r\n processDragThresholdEvent: function (pointer, time)\r\n {\r\n var passed = false;\r\n var timeThreshold = this.dragTimeThreshold;\r\n var distanceThreshold = this.dragDistanceThreshold;\r\n\r\n if (distanceThreshold > 0 && DistanceBetween(pointer.x, pointer.y, pointer.downX, pointer.downY) >= distanceThreshold)\r\n {\r\n // It has moved far enough to be considered a drag\r\n passed = true;\r\n }\r\n else if (timeThreshold > 0 && (time >= pointer.downTime + timeThreshold))\r\n {\r\n // It has been held down long enough to be considered a drag\r\n passed = true;\r\n }\r\n\r\n if (passed)\r\n {\r\n this.setDragState(pointer, 3);\r\n\r\n return this.processDragStartList(pointer);\r\n }\r\n },\r\n\r\n /**\r\n * Processes the drag list for the given pointer and dispatches the start events for each object on it.\r\n *\r\n * @method Phaser.Input.InputPlugin#processDragStartList\r\n * @private\r\n * @fires Phaser.Input.Events#DRAG_START\r\n * @fires Phaser.Input.Events#GAMEOBJECT_DRAG_START\r\n * @since 3.18.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on.\r\n *\r\n * @return {integer} The number of items that DRAG_START was called on.\r\n */\r\n processDragStartList: function (pointer)\r\n {\r\n // 3 = Pointer meets criteria and is freshly down, notify the draglist\r\n if (this.getDragState(pointer) !== 3)\r\n {\r\n return 0;\r\n }\r\n\r\n var list = this._drag[pointer.id];\r\n\r\n for (var i = 0; i < list.length; i++)\r\n {\r\n var gameObject = list[i];\r\n\r\n var input = gameObject.input;\r\n\r\n input.dragState = 2;\r\n\r\n input.dragStartX = gameObject.x;\r\n input.dragStartY = gameObject.y;\r\n\r\n input.dragStartXGlobal = pointer.x;\r\n input.dragStartYGlobal = pointer.y;\r\n\r\n input.dragX = input.dragStartXGlobal - input.dragStartX;\r\n input.dragY = input.dragStartYGlobal - input.dragStartY;\r\n\r\n gameObject.emit(Events.GAMEOBJECT_DRAG_START, pointer, input.dragX, input.dragY);\r\n\r\n this.emit(Events.DRAG_START, pointer, gameObject);\r\n }\r\n\r\n this.setDragState(pointer, 4);\r\n\r\n return list.length;\r\n },\r\n\r\n /**\r\n * Processes a 'drag down' event for the given pointer. Checks the pointer state, builds-up the drag list\r\n * and prepares them all for interaction.\r\n *\r\n * @method Phaser.Input.InputPlugin#processDragDownEvent\r\n * @private\r\n * @since 3.18.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on.\r\n *\r\n * @return {integer} The number of items that were collected on the drag list.\r\n */\r\n processDragDownEvent: function (pointer)\r\n {\r\n var currentlyOver = this._temp;\r\n\r\n if (this._draggable.length === 0 || currentlyOver.length === 0 || !pointer.primaryDown || this.getDragState(pointer) !== 0)\r\n {\r\n // There are no draggable items, no over items or the pointer isn't down, so let's not even bother going further\r\n return 0;\r\n }\r\n\r\n // 1 = Primary button down and objects below, so collect a draglist\r\n this.setDragState(pointer, 1);\r\n\r\n // Get draggable objects, sort them, pick the top (or all) and store them somewhere\r\n var draglist = [];\r\n\r\n for (var i = 0; i < currentlyOver.length; i++)\r\n {\r\n var gameObject = currentlyOver[i];\r\n\r\n if (gameObject.input.draggable && (gameObject.input.dragState === 0))\r\n {\r\n draglist.push(gameObject);\r\n }\r\n }\r\n\r\n if (draglist.length === 0)\r\n {\r\n this.setDragState(pointer, 0);\r\n\r\n return 0;\r\n }\r\n else if (draglist.length > 1)\r\n {\r\n this.sortGameObjects(draglist);\r\n\r\n if (this.topOnly)\r\n {\r\n draglist.splice(1);\r\n }\r\n }\r\n\r\n // draglist now contains all potential candidates for dragging\r\n this._drag[pointer.id] = draglist;\r\n\r\n if (this.dragDistanceThreshold === 0 && this.dragTimeThreshold === 0)\r\n {\r\n // No drag criteria, so snap immediately to mode 3\r\n this.setDragState(pointer, 3);\r\n\r\n return this.processDragStartList(pointer);\r\n }\r\n else\r\n {\r\n // Check the distance / time on the next event\r\n this.setDragState(pointer, 2);\r\n\r\n return 0;\r\n }\r\n },\r\n\r\n /**\r\n * Processes a 'drag move' event for the given pointer.\r\n *\r\n * @method Phaser.Input.InputPlugin#processDragMoveEvent\r\n * @private\r\n * @fires Phaser.Input.Events#DRAG_ENTER\r\n * @fires Phaser.Input.Events#DRAG\r\n * @fires Phaser.Input.Events#DRAG_LEAVE\r\n * @fires Phaser.Input.Events#DRAG_OVER\r\n * @fires Phaser.Input.Events#GAMEOBJECT_DRAG_ENTER\r\n * @fires Phaser.Input.Events#GAMEOBJECT_DRAG\r\n * @fires Phaser.Input.Events#GAMEOBJECT_DRAG_LEAVE\r\n * @fires Phaser.Input.Events#GAMEOBJECT_DRAG_OVER\r\n * @since 3.18.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on.\r\n *\r\n * @return {integer} The number of items that were updated by this drag event.\r\n */\r\n processDragMoveEvent: function (pointer)\r\n {\r\n // 2 = Pointer being checked if meets drag criteria\r\n if (this.getDragState(pointer) === 2)\r\n {\r\n this.processDragThresholdEvent(pointer, this.manager.game.loop.now);\r\n }\r\n\r\n if (this.getDragState(pointer) !== 4)\r\n {\r\n return 0;\r\n }\r\n\r\n // 4 = Pointer actively dragging the draglist and has moved\r\n var dropZones = this._tempZones;\r\n\r\n var list = this._drag[pointer.id];\r\n\r\n for (var i = 0; i < list.length; i++)\r\n {\r\n var gameObject = list[i];\r\n\r\n var input = gameObject.input;\r\n\r\n var target = input.target;\r\n\r\n // If this GO has a target then let's check it\r\n if (target)\r\n {\r\n var index = dropZones.indexOf(target);\r\n\r\n // Got a target, are we still over it?\r\n if (index === 0)\r\n {\r\n // We're still over it, and it's still the top of the display list, phew ...\r\n gameObject.emit(Events.GAMEOBJECT_DRAG_OVER, pointer, target);\r\n\r\n this.emit(Events.DRAG_OVER, pointer, gameObject, target);\r\n }\r\n else if (index > 0)\r\n {\r\n // Still over it but it's no longer top of the display list (targets must always be at the top)\r\n gameObject.emit(Events.GAMEOBJECT_DRAG_LEAVE, pointer, target);\r\n\r\n this.emit(Events.DRAG_LEAVE, pointer, gameObject, target);\r\n\r\n input.target = dropZones[0];\r\n\r\n target = input.target;\r\n\r\n gameObject.emit(Events.GAMEOBJECT_DRAG_ENTER, pointer, target);\r\n\r\n this.emit(Events.DRAG_ENTER, pointer, gameObject, target);\r\n }\r\n else\r\n {\r\n // Nope, we've moved on (or the target has!), leave the old target\r\n gameObject.emit(Events.GAMEOBJECT_DRAG_LEAVE, pointer, target);\r\n\r\n this.emit(Events.DRAG_LEAVE, pointer, gameObject, target);\r\n\r\n // Anything new to replace it?\r\n // Yup!\r\n if (dropZones[0])\r\n {\r\n input.target = dropZones[0];\r\n\r\n target = input.target;\r\n\r\n gameObject.emit(Events.GAMEOBJECT_DRAG_ENTER, pointer, target);\r\n\r\n this.emit(Events.DRAG_ENTER, pointer, gameObject, target);\r\n }\r\n else\r\n {\r\n // Nope\r\n input.target = null;\r\n }\r\n }\r\n }\r\n else if (!target && dropZones[0])\r\n {\r\n input.target = dropZones[0];\r\n\r\n target = input.target;\r\n\r\n gameObject.emit(Events.GAMEOBJECT_DRAG_ENTER, pointer, target);\r\n\r\n this.emit(Events.DRAG_ENTER, pointer, gameObject, target);\r\n }\r\n\r\n var dragX;\r\n var dragY;\r\n\r\n if (!gameObject.parentContainer)\r\n {\r\n dragX = pointer.x - input.dragX;\r\n dragY = pointer.y - input.dragY;\r\n }\r\n else\r\n {\r\n var dx = pointer.x - input.dragStartXGlobal;\r\n var dy = pointer.y - input.dragStartYGlobal;\r\n\r\n var rotation = gameObject.getParentRotation();\r\n\r\n var dxRotated = dx * Math.cos(rotation) + dy * Math.sin(rotation);\r\n var dyRotated = dy * Math.cos(rotation) - dx * Math.sin(rotation);\r\n\r\n dxRotated *= (1 / gameObject.parentContainer.scaleX);\r\n dyRotated *= (1 / gameObject.parentContainer.scaleY);\r\n\r\n dragX = dxRotated + input.dragStartX;\r\n dragY = dyRotated + input.dragStartY;\r\n }\r\n\r\n gameObject.emit(Events.GAMEOBJECT_DRAG, pointer, dragX, dragY);\r\n\r\n this.emit(Events.DRAG, pointer, gameObject, dragX, dragY);\r\n }\r\n\r\n return list.length;\r\n },\r\n\r\n /**\r\n * Processes a 'drag down' event for the given pointer. Checks the pointer state, builds-up the drag list\r\n * and prepares them all for interaction.\r\n *\r\n * @method Phaser.Input.InputPlugin#processDragUpEvent\r\n * @fires Phaser.Input.Events#DRAG_END\r\n * @fires Phaser.Input.Events#DROP\r\n * @fires Phaser.Input.Events#GAMEOBJECT_DRAG_END\r\n * @fires Phaser.Input.Events#GAMEOBJECT_DROP\r\n * @private\r\n * @since 3.18.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on.\r\n *\r\n * @return {integer} The number of items that were updated by this drag event.\r\n */\r\n processDragUpEvent: function (pointer)\r\n {\r\n // 5 = Pointer was actively dragging but has been released, notify draglist\r\n var list = this._drag[pointer.id];\r\n\r\n for (var i = 0; i < list.length; i++)\r\n {\r\n var gameObject = list[i];\r\n\r\n var input = gameObject.input;\r\n\r\n if (input && input.dragState === 2)\r\n {\r\n input.dragState = 0;\r\n\r\n input.dragX = input.localX - gameObject.displayOriginX;\r\n input.dragY = input.localY - gameObject.displayOriginY;\r\n\r\n var dropped = false;\r\n\r\n var target = input.target;\r\n\r\n if (target)\r\n {\r\n gameObject.emit(Events.GAMEOBJECT_DROP, pointer, target);\r\n\r\n this.emit(Events.DROP, pointer, gameObject, target);\r\n\r\n input.target = null;\r\n\r\n dropped = true;\r\n }\r\n\r\n // And finally the dragend event\r\n\r\n if (gameObject.input)\r\n {\r\n gameObject.emit(Events.GAMEOBJECT_DRAG_END, pointer, input.dragX, input.dragY, dropped);\r\n\r\n this.emit(Events.DRAG_END, pointer, gameObject, dropped);\r\n }\r\n }\r\n }\r\n\r\n this.setDragState(pointer, 0);\r\n\r\n list.splice(0);\r\n\r\n return 0;\r\n },\r\n\r\n /**\r\n * An internal method that handles the Pointer movement event.\r\n *\r\n * @method Phaser.Input.InputPlugin#processMoveEvents\r\n * @private\r\n * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_MOVE\r\n * @fires Phaser.Input.Events#GAMEOBJECT_MOVE\r\n * @fires Phaser.Input.Events#POINTER_MOVE\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against.\r\n *\r\n * @return {integer} The total number of objects interacted with.\r\n */\r\n processMoveEvents: function (pointer)\r\n {\r\n var total = 0;\r\n var currentlyOver = this._temp;\r\n\r\n var _eventData = this._eventData;\r\n var _eventContainer = this._eventContainer;\r\n\r\n _eventData.cancelled = false;\r\n\r\n var aborted = false;\r\n\r\n // Go through all objects the pointer was over and fire their events / callbacks\r\n for (var i = 0; i < currentlyOver.length; i++)\r\n {\r\n var gameObject = currentlyOver[i];\r\n\r\n if (!gameObject.input)\r\n {\r\n continue;\r\n }\r\n\r\n total++;\r\n\r\n gameObject.emit(Events.GAMEOBJECT_POINTER_MOVE, pointer, gameObject.input.localX, gameObject.input.localY, _eventContainer);\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n\r\n this.emit(Events.GAMEOBJECT_MOVE, pointer, gameObject, _eventContainer);\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n\r\n if (this.topOnly)\r\n {\r\n break;\r\n }\r\n }\r\n\r\n if (!aborted)\r\n {\r\n this.emit(Events.POINTER_MOVE, pointer, currentlyOver);\r\n }\r\n\r\n return total;\r\n },\r\n\r\n /**\r\n * An internal method that handles a mouse wheel event.\r\n *\r\n * @method Phaser.Input.InputPlugin#processWheelEvent\r\n * @private\r\n * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_WHEEL\r\n * @fires Phaser.Input.Events#GAMEOBJECT_WHEEL\r\n * @fires Phaser.Input.Events#POINTER_WHEEL\r\n * @since 3.18.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against.\r\n *\r\n * @return {integer} The total number of objects interacted with.\r\n */\r\n processWheelEvent: function (pointer)\r\n {\r\n var total = 0;\r\n var currentlyOver = this._temp;\r\n\r\n var _eventData = this._eventData;\r\n var _eventContainer = this._eventContainer;\r\n\r\n _eventData.cancelled = false;\r\n\r\n var aborted = false;\r\n\r\n var dx = pointer.deltaX;\r\n var dy = pointer.deltaY;\r\n var dz = pointer.deltaZ;\r\n\r\n // Go through all objects the pointer was over and fire their events / callbacks\r\n for (var i = 0; i < currentlyOver.length; i++)\r\n {\r\n var gameObject = currentlyOver[i];\r\n\r\n if (!gameObject.input)\r\n {\r\n continue;\r\n }\r\n\r\n total++;\r\n\r\n gameObject.emit(Events.GAMEOBJECT_POINTER_WHEEL, pointer, dx, dy, dz, _eventContainer);\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n\r\n this.emit(Events.GAMEOBJECT_WHEEL, pointer, gameObject, dx, dy, dz, _eventContainer);\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!aborted)\r\n {\r\n this.emit(Events.POINTER_WHEEL, pointer, currentlyOver, dx, dy, dz);\r\n }\r\n\r\n return total;\r\n },\r\n\r\n /**\r\n * An internal method that handles the Pointer over events.\r\n * This is called when a touch input hits the canvas, having previously been off of it.\r\n *\r\n * @method Phaser.Input.InputPlugin#processOverEvents\r\n * @private\r\n * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_OVER\r\n * @fires Phaser.Input.Events#GAMEOBJECT_OVER\r\n * @fires Phaser.Input.Events#POINTER_OVER\r\n * @since 3.18.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against.\r\n *\r\n * @return {integer} The total number of objects interacted with.\r\n */\r\n processOverEvents: function (pointer)\r\n {\r\n var currentlyOver = this._temp;\r\n\r\n var totalInteracted = 0;\r\n\r\n var total = currentlyOver.length;\r\n\r\n var justOver = [];\r\n\r\n if (total > 0)\r\n {\r\n var manager = this.manager;\r\n\r\n var _eventData = this._eventData;\r\n var _eventContainer = this._eventContainer;\r\n\r\n _eventData.cancelled = false;\r\n\r\n var aborted = false;\r\n\r\n for (var i = 0; i < total; i++)\r\n {\r\n var gameObject = currentlyOver[i];\r\n\r\n if (!gameObject.input)\r\n {\r\n continue;\r\n }\r\n\r\n justOver.push(gameObject);\r\n\r\n manager.setCursor(gameObject.input);\r\n\r\n gameObject.emit(Events.GAMEOBJECT_POINTER_OVER, pointer, gameObject.input.localX, gameObject.input.localY, _eventContainer);\r\n\r\n totalInteracted++;\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n\r\n this.emit(Events.GAMEOBJECT_OVER, pointer, gameObject, _eventContainer);\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!aborted)\r\n {\r\n this.emit(Events.POINTER_OVER, pointer, justOver);\r\n }\r\n }\r\n\r\n // Then sort it into display list order\r\n this._over[pointer.id] = justOver;\r\n\r\n return totalInteracted;\r\n },\r\n\r\n /**\r\n * An internal method that handles the Pointer out events.\r\n * This is called when a touch input leaves the canvas, as it can never be 'over' in this case.\r\n *\r\n * @method Phaser.Input.InputPlugin#processOutEvents\r\n * @private\r\n * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_OUT\r\n * @fires Phaser.Input.Events#GAMEOBJECT_OUT\r\n * @fires Phaser.Input.Events#POINTER_OUT\r\n * @since 3.18.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against.\r\n *\r\n * @return {integer} The total number of objects interacted with.\r\n */\r\n processOutEvents: function (pointer)\r\n {\r\n var previouslyOver = this._over[pointer.id];\r\n\r\n var totalInteracted = 0;\r\n\r\n var total = previouslyOver.length;\r\n\r\n if (total > 0)\r\n {\r\n var manager = this.manager;\r\n\r\n var _eventData = this._eventData;\r\n var _eventContainer = this._eventContainer;\r\n\r\n _eventData.cancelled = false;\r\n\r\n var aborted = false;\r\n\r\n this.sortGameObjects(previouslyOver);\r\n\r\n for (var i = 0; i < total; i++)\r\n {\r\n var gameObject = previouslyOver[i];\r\n\r\n // Call onOut for everything in the previouslyOver array\r\n for (i = 0; i < total; i++)\r\n {\r\n gameObject = previouslyOver[i];\r\n\r\n if (!gameObject.input)\r\n {\r\n continue;\r\n }\r\n\r\n manager.resetCursor(gameObject.input);\r\n\r\n gameObject.emit(Events.GAMEOBJECT_POINTER_OUT, pointer, _eventContainer);\r\n\r\n totalInteracted++;\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n\r\n this.emit(Events.GAMEOBJECT_OUT, pointer, gameObject, _eventContainer);\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!aborted)\r\n {\r\n this.emit(Events.POINTER_OUT, pointer, previouslyOver);\r\n }\r\n }\r\n\r\n this._over[pointer.id] = [];\r\n }\r\n\r\n return totalInteracted;\r\n },\r\n\r\n /**\r\n * An internal method that handles the Pointer over and out events.\r\n *\r\n * @method Phaser.Input.InputPlugin#processOverOutEvents\r\n * @private\r\n * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_OVER\r\n * @fires Phaser.Input.Events#GAMEOBJECT_OVER\r\n * @fires Phaser.Input.Events#POINTER_OVER\r\n * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_OUT\r\n * @fires Phaser.Input.Events#GAMEOBJECT_OUT\r\n * @fires Phaser.Input.Events#POINTER_OUT\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against.\r\n *\r\n * @return {integer} The total number of objects interacted with.\r\n */\r\n processOverOutEvents: function (pointer)\r\n {\r\n var currentlyOver = this._temp;\r\n\r\n var i;\r\n var gameObject;\r\n var justOut = [];\r\n var justOver = [];\r\n var stillOver = [];\r\n var previouslyOver = this._over[pointer.id];\r\n var currentlyDragging = this._drag[pointer.id];\r\n\r\n var manager = this.manager;\r\n\r\n // Go through all objects the pointer was previously over, and see if it still is.\r\n // Splits the previouslyOver array into two parts: justOut and stillOver\r\n\r\n for (i = 0; i < previouslyOver.length; i++)\r\n {\r\n gameObject = previouslyOver[i];\r\n\r\n if (currentlyOver.indexOf(gameObject) === -1 && currentlyDragging.indexOf(gameObject) === -1)\r\n {\r\n // Not in the currentlyOver array, so must be outside of this object now\r\n justOut.push(gameObject);\r\n }\r\n else\r\n {\r\n // In the currentlyOver array\r\n stillOver.push(gameObject);\r\n }\r\n }\r\n\r\n // Go through all objects the pointer is currently over (the hit test results)\r\n // and if not in the previouslyOver array we know it's a new entry, so add to justOver\r\n for (i = 0; i < currentlyOver.length; i++)\r\n {\r\n gameObject = currentlyOver[i];\r\n\r\n // Is this newly over?\r\n\r\n if (previouslyOver.indexOf(gameObject) === -1)\r\n {\r\n justOver.push(gameObject);\r\n }\r\n }\r\n\r\n // By this point the arrays are filled, so now we can process what happened...\r\n\r\n // Process the Just Out objects\r\n var total = justOut.length;\r\n\r\n var totalInteracted = 0;\r\n\r\n var _eventData = this._eventData;\r\n var _eventContainer = this._eventContainer;\r\n\r\n _eventData.cancelled = false;\r\n\r\n var aborted = false;\r\n\r\n if (total > 0)\r\n {\r\n this.sortGameObjects(justOut);\r\n\r\n // Call onOut for everything in the justOut array\r\n for (i = 0; i < total; i++)\r\n {\r\n gameObject = justOut[i];\r\n\r\n if (!gameObject.input)\r\n {\r\n continue;\r\n }\r\n\r\n // Reset cursor before we emit the event, in case they want to change it during the event\r\n manager.resetCursor(gameObject.input);\r\n\r\n gameObject.emit(Events.GAMEOBJECT_POINTER_OUT, pointer, _eventContainer);\r\n\r\n totalInteracted++;\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n\r\n this.emit(Events.GAMEOBJECT_OUT, pointer, gameObject, _eventContainer);\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!aborted)\r\n {\r\n this.emit(Events.POINTER_OUT, pointer, justOut);\r\n }\r\n }\r\n\r\n // Process the Just Over objects\r\n total = justOver.length;\r\n\r\n _eventData.cancelled = false;\r\n\r\n aborted = false;\r\n\r\n if (total > 0)\r\n {\r\n this.sortGameObjects(justOver);\r\n\r\n // Call onOver for everything in the justOver array\r\n for (i = 0; i < total; i++)\r\n {\r\n gameObject = justOver[i];\r\n\r\n if (!gameObject.input)\r\n {\r\n continue;\r\n }\r\n\r\n // Set cursor before we emit the event, in case they want to change it during the event\r\n manager.setCursor(gameObject.input);\r\n\r\n gameObject.emit(Events.GAMEOBJECT_POINTER_OVER, pointer, gameObject.input.localX, gameObject.input.localY, _eventContainer);\r\n\r\n totalInteracted++;\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n\r\n this.emit(Events.GAMEOBJECT_OVER, pointer, gameObject, _eventContainer);\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!aborted)\r\n {\r\n this.emit(Events.POINTER_OVER, pointer, justOver);\r\n }\r\n }\r\n\r\n // Add the contents of justOver to the previously over array\r\n previouslyOver = stillOver.concat(justOver);\r\n\r\n // Then sort it into display list order\r\n this._over[pointer.id] = this.sortGameObjects(previouslyOver);\r\n\r\n return totalInteracted;\r\n },\r\n\r\n /**\r\n * An internal method that handles the Pointer up events.\r\n *\r\n * @method Phaser.Input.InputPlugin#processUpEvents\r\n * @private\r\n * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_UP\r\n * @fires Phaser.Input.Events#GAMEOBJECT_UP\r\n * @fires Phaser.Input.Events#POINTER_UP\r\n * @fires Phaser.Input.Events#POINTER_UP_OUTSIDE\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against.\r\n *\r\n * @return {integer} The total number of objects interacted with.\r\n */\r\n processUpEvents: function (pointer)\r\n {\r\n var currentlyOver = this._temp;\r\n\r\n var _eventData = this._eventData;\r\n var _eventContainer = this._eventContainer;\r\n\r\n _eventData.cancelled = false;\r\n\r\n var aborted = false;\r\n\r\n // Go through all objects the pointer was over and fire their events / callbacks\r\n for (var i = 0; i < currentlyOver.length; i++)\r\n {\r\n var gameObject = currentlyOver[i];\r\n\r\n if (!gameObject.input)\r\n {\r\n continue;\r\n }\r\n\r\n gameObject.emit(Events.GAMEOBJECT_POINTER_UP, pointer, gameObject.input.localX, gameObject.input.localY, _eventContainer);\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n\r\n this.emit(Events.GAMEOBJECT_UP, pointer, gameObject, _eventContainer);\r\n\r\n if (_eventData.cancelled || !gameObject.input)\r\n {\r\n aborted = true;\r\n break;\r\n }\r\n }\r\n\r\n // If they released outside the canvas, but pressed down inside it, we'll still dispatch the event.\r\n if (!aborted && this.manager)\r\n {\r\n if (pointer.upElement === this.manager.game.canvas)\r\n {\r\n this.emit(Events.POINTER_UP, pointer, currentlyOver);\r\n }\r\n else\r\n {\r\n this.emit(Events.POINTER_UP_OUTSIDE, pointer);\r\n }\r\n }\r\n\r\n return currentlyOver.length;\r\n },\r\n\r\n /**\r\n * Queues a Game Object for insertion into this Input Plugin on the next update.\r\n *\r\n * @method Phaser.Input.InputPlugin#queueForInsertion\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to add.\r\n *\r\n * @return {Phaser.Input.InputPlugin} This InputPlugin object.\r\n */\r\n queueForInsertion: function (child)\r\n {\r\n if (this._pendingInsertion.indexOf(child) === -1 && this._list.indexOf(child) === -1)\r\n {\r\n this._pendingInsertion.push(child);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Queues a Game Object for removal from this Input Plugin on the next update.\r\n *\r\n * @method Phaser.Input.InputPlugin#queueForRemoval\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to remove.\r\n *\r\n * @return {Phaser.Input.InputPlugin} This InputPlugin object.\r\n */\r\n queueForRemoval: function (child)\r\n {\r\n this._pendingRemoval.push(child);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the draggable state of the given array of Game Objects.\r\n *\r\n * They can either be set to be draggable, or can have their draggable state removed by passing `false`.\r\n *\r\n * A Game Object will not fire drag events unless it has been specifically enabled for drag.\r\n *\r\n * @method Phaser.Input.InputPlugin#setDraggable\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to change the draggable state on.\r\n * @param {boolean} [value=true] - Set to `true` if the Game Objects should be made draggable, `false` if they should be unset.\r\n *\r\n * @return {Phaser.Input.InputPlugin} This InputPlugin object.\r\n */\r\n setDraggable: function (gameObjects, value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n if (!Array.isArray(gameObjects))\r\n {\r\n gameObjects = [ gameObjects ];\r\n }\r\n\r\n for (var i = 0; i < gameObjects.length; i++)\r\n {\r\n var gameObject = gameObjects[i];\r\n\r\n gameObject.input.draggable = value;\r\n\r\n var index = this._draggable.indexOf(gameObject);\r\n\r\n if (value && index === -1)\r\n {\r\n this._draggable.push(gameObject);\r\n }\r\n else if (!value && index > -1)\r\n {\r\n this._draggable.splice(index, 1);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a function that can be passed to `setInteractive`, `enable` or `setHitArea` that will handle\r\n * pixel-perfect input detection on an Image or Sprite based Game Object, or any custom class that extends them.\r\n *\r\n * The following will create a sprite that is clickable on any pixel that has an alpha value >= 1.\r\n *\r\n * ```javascript\r\n * this.add.sprite(x, y, key).setInteractive(this.input.makePixelPerfect());\r\n * ```\r\n *\r\n * The following will create a sprite that is clickable on any pixel that has an alpha value >= 150.\r\n *\r\n * ```javascript\r\n * this.add.sprite(x, y, key).setInteractive(this.input.makePixelPerfect(150));\r\n * ```\r\n *\r\n * Once you have made an Interactive Object pixel perfect it impacts all input related events for it: down, up,\r\n * dragstart, drag, etc.\r\n *\r\n * As a pointer interacts with the Game Object it will constantly poll the texture, extracting a single pixel from\r\n * the given coordinates and checking its color values. This is an expensive process, so should only be enabled on\r\n * Game Objects that really need it.\r\n *\r\n * You cannot make non-texture based Game Objects pixel perfect. So this will not work on Graphics, BitmapText,\r\n * Render Textures, Text, Tilemaps, Containers or Particles.\r\n *\r\n * @method Phaser.Input.InputPlugin#makePixelPerfect\r\n * @since 3.10.0\r\n *\r\n * @param {integer} [alphaTolerance=1] - The alpha level that the pixel should be above to be included as a successful interaction.\r\n *\r\n * @return {function} A Pixel Perfect Handler for use as a hitArea shape callback.\r\n */\r\n makePixelPerfect: function (alphaTolerance)\r\n {\r\n if (alphaTolerance === undefined) { alphaTolerance = 1; }\r\n\r\n var textureManager = this.systems.textures;\r\n\r\n return CreatePixelPerfectHandler(textureManager, alphaTolerance);\r\n },\r\n\r\n /**\r\n * Sets the hit area for the given array of Game Objects.\r\n *\r\n * A hit area is typically one of the geometric shapes Phaser provides, such as a `Phaser.Geom.Rectangle`\r\n * or `Phaser.Geom.Circle`. However, it can be any object as long as it works with the provided callback.\r\n *\r\n * If no hit area is provided a Rectangle is created based on the size of the Game Object, if possible\r\n * to calculate.\r\n *\r\n * The hit area callback is the function that takes an `x` and `y` coordinate and returns a boolean if\r\n * those values fall within the area of the shape or not. All of the Phaser geometry objects provide this,\r\n * such as `Phaser.Geom.Rectangle.Contains`.\r\n *\r\n * @method Phaser.Input.InputPlugin#setHitArea\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set the hit area on.\r\n * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - 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.\r\n * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The 'contains' function to invoke to check if the pointer is within the hit area.\r\n *\r\n * @return {Phaser.Input.InputPlugin} This InputPlugin object.\r\n */\r\n setHitArea: function (gameObjects, shape, callback)\r\n {\r\n if (shape === undefined)\r\n {\r\n return this.setHitAreaFromTexture(gameObjects);\r\n }\r\n\r\n if (!Array.isArray(gameObjects))\r\n {\r\n gameObjects = [ gameObjects ];\r\n }\r\n\r\n var draggable = false;\r\n var dropZone = false;\r\n var cursor = false;\r\n var useHandCursor = false;\r\n var pixelPerfect = false;\r\n var customHitArea = true;\r\n\r\n // Config object?\r\n if (IsPlainObject(shape))\r\n {\r\n var config = shape;\r\n\r\n shape = GetFastValue(config, 'hitArea', null);\r\n callback = GetFastValue(config, 'hitAreaCallback', null);\r\n draggable = GetFastValue(config, 'draggable', false);\r\n dropZone = GetFastValue(config, 'dropZone', false);\r\n cursor = GetFastValue(config, 'cursor', false);\r\n useHandCursor = GetFastValue(config, 'useHandCursor', false);\r\n\r\n pixelPerfect = GetFastValue(config, 'pixelPerfect', false);\r\n var alphaTolerance = GetFastValue(config, 'alphaTolerance', 1);\r\n\r\n if (pixelPerfect)\r\n {\r\n shape = {};\r\n callback = this.makePixelPerfect(alphaTolerance);\r\n }\r\n\r\n // Still no hitArea or callback?\r\n if (!shape || !callback)\r\n {\r\n this.setHitAreaFromTexture(gameObjects);\r\n customHitArea = false;\r\n }\r\n }\r\n else if (typeof shape === 'function' && !callback)\r\n {\r\n callback = shape;\r\n shape = {};\r\n }\r\n\r\n for (var i = 0; i < gameObjects.length; i++)\r\n {\r\n var gameObject = gameObjects[i];\r\n\r\n if (pixelPerfect && gameObject.type === 'Container')\r\n {\r\n console.warn('Cannot pixelPerfect test a Container. Use a custom callback.');\r\n continue;\r\n }\r\n\r\n var io = (!gameObject.input) ? CreateInteractiveObject(gameObject, shape, callback) : gameObject.input;\r\n\r\n io.customHitArea = customHitArea;\r\n io.dropZone = dropZone;\r\n io.cursor = (useHandCursor) ? 'pointer' : cursor;\r\n\r\n gameObject.input = io;\r\n\r\n if (draggable)\r\n {\r\n this.setDraggable(gameObject);\r\n }\r\n\r\n this.queueForInsertion(gameObject);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Circle` shape, using\r\n * the given coordinates and radius to control its position and size.\r\n *\r\n * @method Phaser.Input.InputPlugin#setHitAreaCircle\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a circle hit area.\r\n * @param {number} x - The center of the circle.\r\n * @param {number} y - The center of the circle.\r\n * @param {number} radius - The radius of the circle.\r\n * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The hit area callback. If undefined it uses Circle.Contains.\r\n *\r\n * @return {Phaser.Input.InputPlugin} This InputPlugin object.\r\n */\r\n setHitAreaCircle: function (gameObjects, x, y, radius, callback)\r\n {\r\n if (callback === undefined) { callback = CircleContains; }\r\n\r\n var shape = new Circle(x, y, radius);\r\n\r\n return this.setHitArea(gameObjects, shape, callback);\r\n },\r\n\r\n /**\r\n * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Ellipse` shape, using\r\n * the given coordinates and dimensions to control its position and size.\r\n *\r\n * @method Phaser.Input.InputPlugin#setHitAreaEllipse\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having an ellipse hit area.\r\n * @param {number} x - The center of the ellipse.\r\n * @param {number} y - The center of the ellipse.\r\n * @param {number} width - The width of the ellipse.\r\n * @param {number} height - The height of the ellipse.\r\n * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The hit area callback. If undefined it uses Ellipse.Contains.\r\n *\r\n * @return {Phaser.Input.InputPlugin} This InputPlugin object.\r\n */\r\n setHitAreaEllipse: function (gameObjects, x, y, width, height, callback)\r\n {\r\n if (callback === undefined) { callback = EllipseContains; }\r\n\r\n var shape = new Ellipse(x, y, width, height);\r\n\r\n return this.setHitArea(gameObjects, shape, callback);\r\n },\r\n\r\n /**\r\n * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Rectangle` shape, using\r\n * the Game Objects texture frame to define the position and size of the hit area.\r\n *\r\n * @method Phaser.Input.InputPlugin#setHitAreaFromTexture\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having an ellipse hit area.\r\n * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The hit area callback. If undefined it uses Rectangle.Contains.\r\n *\r\n * @return {Phaser.Input.InputPlugin} This InputPlugin object.\r\n */\r\n setHitAreaFromTexture: function (gameObjects, callback)\r\n {\r\n if (callback === undefined) { callback = RectangleContains; }\r\n\r\n if (!Array.isArray(gameObjects))\r\n {\r\n gameObjects = [ gameObjects ];\r\n }\r\n\r\n for (var i = 0; i < gameObjects.length; i++)\r\n {\r\n var gameObject = gameObjects[i];\r\n\r\n var frame = gameObject.frame;\r\n\r\n var width = 0;\r\n var height = 0;\r\n\r\n if (gameObject.width)\r\n {\r\n width = gameObject.width;\r\n height = gameObject.height;\r\n }\r\n else if (frame)\r\n {\r\n width = frame.realWidth;\r\n height = frame.realHeight;\r\n }\r\n\r\n if (gameObject.type === 'Container' && (width === 0 || height === 0))\r\n {\r\n console.warn('Container.setInteractive must specify a Shape or call setSize() first');\r\n continue;\r\n }\r\n\r\n if (width !== 0 && height !== 0)\r\n {\r\n gameObject.input = CreateInteractiveObject(gameObject, new Rectangle(0, 0, width, height), callback);\r\n\r\n this.queueForInsertion(gameObject);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Rectangle` shape, using\r\n * the given coordinates and dimensions to control its position and size.\r\n *\r\n * @method Phaser.Input.InputPlugin#setHitAreaRectangle\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a rectangular hit area.\r\n * @param {number} x - The top-left of the rectangle.\r\n * @param {number} y - The top-left of the rectangle.\r\n * @param {number} width - The width of the rectangle.\r\n * @param {number} height - The height of the rectangle.\r\n * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The hit area callback. If undefined it uses Rectangle.Contains.\r\n *\r\n * @return {Phaser.Input.InputPlugin} This InputPlugin object.\r\n */\r\n setHitAreaRectangle: function (gameObjects, x, y, width, height, callback)\r\n {\r\n if (callback === undefined) { callback = RectangleContains; }\r\n\r\n var shape = new Rectangle(x, y, width, height);\r\n\r\n return this.setHitArea(gameObjects, shape, callback);\r\n },\r\n\r\n /**\r\n * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Triangle` shape, using\r\n * the given coordinates to control the position of its points.\r\n *\r\n * @method Phaser.Input.InputPlugin#setHitAreaTriangle\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a triangular hit area.\r\n * @param {number} x1 - The x coordinate of the first point of the triangle.\r\n * @param {number} y1 - The y coordinate of the first point of the triangle.\r\n * @param {number} x2 - The x coordinate of the second point of the triangle.\r\n * @param {number} y2 - The y coordinate of the second point of the triangle.\r\n * @param {number} x3 - The x coordinate of the third point of the triangle.\r\n * @param {number} y3 - The y coordinate of the third point of the triangle.\r\n * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The hit area callback. If undefined it uses Triangle.Contains.\r\n *\r\n * @return {Phaser.Input.InputPlugin} This InputPlugin object.\r\n */\r\n setHitAreaTriangle: function (gameObjects, x1, y1, x2, y2, x3, y3, callback)\r\n {\r\n if (callback === undefined) { callback = TriangleContains; }\r\n\r\n var shape = new Triangle(x1, y1, x2, y2, x3, y3);\r\n\r\n return this.setHitArea(gameObjects, shape, callback);\r\n },\r\n\r\n /**\r\n * Creates an Input Debug Shape for the given Game Object.\r\n *\r\n * The Game Object must have _already_ been enabled for input prior to calling this method.\r\n *\r\n * This is intended to assist you during development and debugging.\r\n *\r\n * Debug Shapes can only be created for Game Objects that are using standard Phaser Geometry for input,\r\n * including: Circle, Ellipse, Line, Polygon, Rectangle and Triangle.\r\n *\r\n * Game Objects that are using their automatic hit areas are using Rectangles by default, so will also work.\r\n *\r\n * The Debug Shape is created and added to the display list and is then kept in sync with the Game Object\r\n * it is connected with. Should you need to modify it yourself, such as to hide it, you can access it via\r\n * the Game Object property: `GameObject.input.hitAreaDebug`.\r\n *\r\n * Calling this method on a Game Object that already has a Debug Shape will first destroy the old shape,\r\n * before creating a new one. If you wish to remove the Debug Shape entirely, you should call the\r\n * method `InputPlugin.removeDebug`.\r\n *\r\n * Note that the debug shape will only show the outline of the input area. If the input test is using a\r\n * pixel perfect check, for example, then this is not displayed. If you are using a custom shape, that\r\n * doesn't extend one of the base Phaser Geometry objects, as your hit area, then this method will not\r\n * work.\r\n *\r\n * @method Phaser.Input.InputPlugin#enableDebug\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to create the input debug shape for.\r\n * @param {number} [color=0x00ff00] - The outline color of the debug shape.\r\n *\r\n * @return {Phaser.Input.InputPlugin} This Input Plugin.\r\n */\r\n enableDebug: function (gameObject, color)\r\n {\r\n if (color === undefined) { color = 0x00ff00; }\r\n\r\n var input = gameObject.input;\r\n\r\n if (!input || !input.hitArea)\r\n {\r\n return this;\r\n }\r\n\r\n var shape = input.hitArea;\r\n var shapeType = shape.type;\r\n var debug = input.hitAreaDebug;\r\n var factory = this.systems.add;\r\n var updateList = this.systems.updateList;\r\n\r\n if (debug)\r\n {\r\n updateList.remove(debug);\r\n\r\n debug.destroy();\r\n\r\n debug = null;\r\n }\r\n\r\n var offsetx = 0;\r\n var offsety = 0;\r\n switch (shapeType)\r\n {\r\n case GEOM_CONST.CIRCLE:\r\n debug = factory.arc(0, 0, shape.radius);\r\n offsetx = shape.x - shape.radius;\r\n offsety = shape.y - shape.radius;\r\n break;\r\n\r\n case GEOM_CONST.ELLIPSE:\r\n debug = factory.ellipse(0, 0, shape.width, shape.height);\r\n offsetx = shape.x - shape.width / 2;\r\n offsety = shape.y - shape.height / 2;\r\n break;\r\n\r\n case GEOM_CONST.LINE:\r\n debug = factory.line(0, 0, shape.x1, shape.y1, shape.x2, shape.y2);\r\n break;\r\n\r\n case GEOM_CONST.POLYGON:\r\n debug = factory.polygon(0, 0, shape.points);\r\n break;\r\n\r\n case GEOM_CONST.RECTANGLE:\r\n debug = factory.rectangle(0, 0, shape.width, shape.height);\r\n offsetx = shape.x;\r\n offsety = shape.y;\r\n break;\r\n\r\n case GEOM_CONST.TRIANGLE:\r\n debug = factory.triangle(0, 0, shape.x1, shape.y1, shape.x2, shape.y2, shape.x3, shape.y3);\r\n break;\r\n }\r\n\r\n if (debug)\r\n {\r\n debug.isFilled = false;\r\n\r\n debug.preUpdate = function ()\r\n {\r\n debug.setStrokeStyle(1 / gameObject.scale, color);\r\n\r\n debug.setDisplayOrigin(gameObject.displayOriginX, gameObject.displayOriginY);\r\n debug.setRotation(gameObject.rotation);\r\n debug.setScale(gameObject.scaleX, gameObject.scaleY);\r\n debug.setPosition(gameObject.x + offsetx, gameObject.y + offsety);\r\n debug.setScrollFactor(gameObject.scrollFactorX, gameObject.scrollFactorY);\r\n };\r\n\r\n updateList.add(debug);\r\n\r\n input.hitAreaDebug = debug;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes an Input Debug Shape from the given Game Object.\r\n *\r\n * The shape is destroyed immediately and the `hitAreaDebug` property is set to `null`.\r\n *\r\n * @method Phaser.Input.InputPlugin#removeDebug\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to remove the input debug shape from.\r\n *\r\n * @return {Phaser.Input.InputPlugin} This Input Plugin.\r\n */\r\n removeDebug: function (gameObject)\r\n {\r\n var input = gameObject.input;\r\n\r\n if (input && input.hitAreaDebug)\r\n {\r\n var debug = input.hitAreaDebug;\r\n\r\n this.systems.updateList.remove(debug);\r\n\r\n debug.destroy();\r\n\r\n input.hitAreaDebug = null;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Pointers to always poll.\r\n *\r\n * When a pointer is polled it runs a hit test to see which Game Objects are currently below it,\r\n * or being interacted with it, regardless if the Pointer has actually moved or not.\r\n *\r\n * You should enable this if you want objects in your game to fire over / out events, and the objects\r\n * are constantly moving, but the pointer may not have. Polling every frame has additional computation\r\n * costs, especially if there are a large number of interactive objects in your game.\r\n *\r\n * @method Phaser.Input.InputPlugin#setPollAlways\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Input.InputPlugin} This InputPlugin object.\r\n */\r\n setPollAlways: function ()\r\n {\r\n return this.setPollRate(0);\r\n },\r\n\r\n /**\r\n * Sets the Pointers to only poll when they are moved or updated.\r\n *\r\n * When a pointer is polled it runs a hit test to see which Game Objects are currently below it,\r\n * or being interacted with it.\r\n *\r\n * @method Phaser.Input.InputPlugin#setPollOnMove\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Input.InputPlugin} This InputPlugin object.\r\n */\r\n setPollOnMove: function ()\r\n {\r\n return this.setPollRate(-1);\r\n },\r\n\r\n /**\r\n * Sets the poll rate value. This is the amount of time that should have elapsed before a pointer\r\n * will be polled again. See the `setPollAlways` and `setPollOnMove` methods.\r\n *\r\n * @method Phaser.Input.InputPlugin#setPollRate\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The amount of time, in ms, that should elapsed before re-polling the pointers.\r\n *\r\n * @return {Phaser.Input.InputPlugin} This InputPlugin object.\r\n */\r\n setPollRate: function (value)\r\n {\r\n this.pollRate = value;\r\n this._pollTimer = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * When set to `true` the global Input Manager will emulate DOM behavior by only emitting events from\r\n * the top-most Scene in the Scene List. By default, if a Scene receives an input event it will then stop the event\r\n * from flowing down to any Scenes below it in the Scene list. To disable this behavior call this method with `false`.\r\n *\r\n * @method Phaser.Input.InputPlugin#setGlobalTopOnly\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - Set to `true` to stop processing input events on the Scene that receives it, or `false` to let the event continue down the Scene list.\r\n *\r\n * @return {Phaser.Input.InputPlugin} This InputPlugin object.\r\n */\r\n setGlobalTopOnly: function (value)\r\n {\r\n this.manager.globalTopOnly = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * When set to `true` this Input Plugin will emulate DOM behavior by only emitting events from\r\n * the top-most Game Objects in the Display List.\r\n *\r\n * If set to `false` it will emit events from all Game Objects below a Pointer, not just the top one.\r\n *\r\n * @method Phaser.Input.InputPlugin#setTopOnly\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - `true` to only include the top-most Game Object, or `false` to include all Game Objects in a hit test.\r\n *\r\n * @return {Phaser.Input.InputPlugin} This InputPlugin object.\r\n */\r\n setTopOnly: function (value)\r\n {\r\n this.topOnly = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Given an array of Game Objects, sort the array and return it, so that the objects are in depth index order\r\n * with the lowest at the bottom.\r\n *\r\n * @method Phaser.Input.InputPlugin#sortGameObjects\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to be sorted.\r\n *\r\n * @return {Phaser.GameObjects.GameObject[]} The sorted array of Game Objects.\r\n */\r\n sortGameObjects: function (gameObjects)\r\n {\r\n if (gameObjects.length < 2)\r\n {\r\n return gameObjects;\r\n }\r\n\r\n this.scene.sys.depthSort();\r\n\r\n return gameObjects.sort(this.sortHandlerGO.bind(this));\r\n },\r\n\r\n /**\r\n * Return the child lowest down the display list (with the smallest index)\r\n * Will iterate through all parent containers, if present.\r\n *\r\n * @method Phaser.Input.InputPlugin#sortHandlerGO\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} childA - The first Game Object to compare.\r\n * @param {Phaser.GameObjects.GameObject} childB - The second Game Object to compare.\r\n *\r\n * @return {integer} Returns either a negative or positive integer, or zero if they match.\r\n */\r\n sortHandlerGO: function (childA, childB)\r\n {\r\n if (!childA.parentContainer && !childB.parentContainer)\r\n {\r\n // Quick bail out when neither child has a container\r\n return this.displayList.getIndex(childB) - this.displayList.getIndex(childA);\r\n }\r\n else if (childA.parentContainer === childB.parentContainer)\r\n {\r\n // Quick bail out when both children have the same container\r\n return childB.parentContainer.getIndex(childB) - childA.parentContainer.getIndex(childA);\r\n }\r\n else if (childA.parentContainer === childB)\r\n {\r\n // Quick bail out when childA is a child of childB\r\n return -1;\r\n }\r\n else if (childB.parentContainer === childA)\r\n {\r\n // Quick bail out when childA is a child of childB\r\n return 1;\r\n }\r\n else\r\n {\r\n // Container index check\r\n var listA = childA.getIndexList();\r\n var listB = childB.getIndexList();\r\n var len = Math.min(listA.length, listB.length);\r\n\r\n for (var i = 0; i < len; i++)\r\n {\r\n var indexA = listA[i];\r\n var indexB = listB[i];\r\n\r\n if (indexA === indexB)\r\n {\r\n // Go to the next level down\r\n continue;\r\n }\r\n else\r\n {\r\n // Non-matching parents, so return\r\n return indexB - indexA;\r\n }\r\n }\r\n }\r\n\r\n // Technically this shouldn't happen, but ...\r\n return 0;\r\n },\r\n\r\n /**\r\n * This method should be called from within an input event handler, such as `pointerdown`.\r\n *\r\n * When called, it stops the Input Manager from allowing _this specific event_ to be processed by any other Scene\r\n * not yet handled in the scene list.\r\n *\r\n * @method Phaser.Input.InputPlugin#stopPropagation\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Input.InputPlugin} This InputPlugin object.\r\n */\r\n stopPropagation: function ()\r\n {\r\n this.manager._tempSkip = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds new Pointer objects to the Input Manager.\r\n *\r\n * By default Phaser creates 2 pointer objects: `mousePointer` and `pointer1`.\r\n *\r\n * You can create more either by calling this method, or by setting the `input.activePointers` property\r\n * in the Game Config, up to a maximum of 10 pointers.\r\n *\r\n * The first 10 pointers are available via the `InputPlugin.pointerX` properties, once they have been added\r\n * via this method.\r\n *\r\n * @method Phaser.Input.InputPlugin#addPointer\r\n * @since 3.10.0\r\n *\r\n * @param {integer} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total.\r\n *\r\n * @return {Phaser.Input.Pointer[]} An array containing all of the new Pointer objects that were created.\r\n */\r\n addPointer: function (quantity)\r\n {\r\n return this.manager.addPointer(quantity);\r\n },\r\n\r\n /**\r\n * Tells the Input system to set a custom cursor.\r\n *\r\n * This cursor will be the default cursor used when interacting with the game canvas.\r\n *\r\n * If an Interactive Object also sets a custom cursor, this is the cursor that is reset after its use.\r\n *\r\n * Any valid CSS cursor value is allowed, including paths to image files, i.e.:\r\n *\r\n * ```javascript\r\n * this.input.setDefaultCursor('url(assets/cursors/sword.cur), pointer');\r\n * ```\r\n *\r\n * Please read about the differences between browsers when it comes to the file formats and sizes they support:\r\n *\r\n * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor\r\n * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_User_Interface/Using_URL_values_for_the_cursor_property\r\n *\r\n * It's up to you to pick a suitable cursor format that works across the range of browsers you need to support.\r\n *\r\n * @method Phaser.Input.InputPlugin#setDefaultCursor\r\n * @since 3.10.0\r\n *\r\n * @param {string} cursor - The CSS to be used when setting the default cursor.\r\n *\r\n * @return {Phaser.Input.InputPlugin} This Input instance.\r\n */\r\n setDefaultCursor: function (cursor)\r\n {\r\n this.manager.setDefaultCursor(cursor);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is transitioning in.\r\n *\r\n * @method Phaser.Input.InputPlugin#transitionIn\r\n * @private\r\n * @since 3.5.0\r\n */\r\n transitionIn: function ()\r\n {\r\n this.enabled = this.settings.transitionAllowInput;\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin has finished transitioning in.\r\n *\r\n * @method Phaser.Input.InputPlugin#transitionComplete\r\n * @private\r\n * @since 3.5.0\r\n */\r\n transitionComplete: function ()\r\n {\r\n if (!this.settings.transitionAllowInput)\r\n {\r\n this.enabled = true;\r\n }\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is transitioning out.\r\n *\r\n * @method Phaser.Input.InputPlugin#transitionOut\r\n * @private\r\n * @since 3.5.0\r\n */\r\n transitionOut: function ()\r\n {\r\n this.enabled = this.settings.transitionAllowInput;\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Phaser.Input.InputPlugin#shutdown\r\n * @fires Phaser.Input.Events#SHUTDOWN\r\n * @private\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n // Registered input plugins listen for this\r\n this.pluginEvents.emit(Events.SHUTDOWN);\r\n\r\n this._temp.length = 0;\r\n this._list.length = 0;\r\n this._draggable.length = 0;\r\n this._pendingRemoval.length = 0;\r\n this._pendingInsertion.length = 0;\r\n this._dragState.length = 0;\r\n\r\n for (var i = 0; i < 10; i++)\r\n {\r\n this._drag[i] = [];\r\n this._over[i] = [];\r\n }\r\n\r\n this.removeAllListeners();\r\n\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.off(SceneEvents.TRANSITION_START, this.transitionIn, this);\r\n eventEmitter.off(SceneEvents.TRANSITION_OUT, this.transitionOut, this);\r\n eventEmitter.off(SceneEvents.TRANSITION_COMPLETE, this.transitionComplete, this);\r\n eventEmitter.off(SceneEvents.PRE_UPDATE, this.preUpdate, this);\r\n\r\n this.manager.events.off(Events.GAME_OUT, this.onGameOut, this);\r\n this.manager.events.off(Events.GAME_OVER, this.onGameOver, this);\r\n\r\n eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Phaser.Input.InputPlugin#destroy\r\n * @fires Phaser.Input.Events#DESTROY\r\n * @private\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n // Registered input plugins listen for this\r\n this.pluginEvents.emit(Events.DESTROY);\r\n\r\n this.pluginEvents.removeAllListeners();\r\n\r\n this.scene.sys.events.off(SceneEvents.START, this.start, this);\r\n\r\n this.scene = null;\r\n this.cameras = null;\r\n this.manager = null;\r\n this.events = null;\r\n this.mouse = null;\r\n },\r\n\r\n /**\r\n * The x coordinates of the ActivePointer based on the first camera in the camera list.\r\n * This is only safe to use if your game has just 1 non-transformed camera and doesn't use multi-touch.\r\n *\r\n * @name Phaser.Input.InputPlugin#x\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n x: {\r\n\r\n get: function ()\r\n {\r\n return this.manager.activePointer.x;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The y coordinates of the ActivePointer based on the first camera in the camera list.\r\n * This is only safe to use if your game has just 1 non-transformed camera and doesn't use multi-touch.\r\n *\r\n * @name Phaser.Input.InputPlugin#y\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n y: {\r\n\r\n get: function ()\r\n {\r\n return this.manager.activePointer.y;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Are any mouse or touch pointers currently over the game canvas?\r\n *\r\n * @name Phaser.Input.InputPlugin#isOver\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n isOver: {\r\n\r\n get: function ()\r\n {\r\n return this.manager.isOver;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The mouse has its own unique Pointer object, which you can reference directly if making a _desktop specific game_.\r\n * If you are supporting both desktop and touch devices then do not use this property, instead use `activePointer`\r\n * which will always map to the most recently interacted pointer.\r\n *\r\n * @name Phaser.Input.InputPlugin#mousePointer\r\n * @type {Phaser.Input.Pointer}\r\n * @readonly\r\n * @since 3.10.0\r\n */\r\n mousePointer: {\r\n\r\n get: function ()\r\n {\r\n return this.manager.mousePointer;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The current active input Pointer.\r\n *\r\n * @name Phaser.Input.InputPlugin#activePointer\r\n * @type {Phaser.Input.Pointer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n activePointer: {\r\n\r\n get: function ()\r\n {\r\n return this.manager.activePointer;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * A touch-based Pointer object.\r\n * This will be `undefined` by default unless you add a new Pointer using `addPointer`.\r\n *\r\n * @name Phaser.Input.InputPlugin#pointer1\r\n * @type {Phaser.Input.Pointer}\r\n * @readonly\r\n * @since 3.10.0\r\n */\r\n pointer1: {\r\n\r\n get: function ()\r\n {\r\n return this.manager.pointers[1];\r\n }\r\n\r\n },\r\n\r\n /**\r\n * A touch-based Pointer object.\r\n * This will be `undefined` by default unless you add a new Pointer using `addPointer`.\r\n *\r\n * @name Phaser.Input.InputPlugin#pointer2\r\n * @type {Phaser.Input.Pointer}\r\n * @readonly\r\n * @since 3.10.0\r\n */\r\n pointer2: {\r\n\r\n get: function ()\r\n {\r\n return this.manager.pointers[2];\r\n }\r\n\r\n },\r\n\r\n /**\r\n * A touch-based Pointer object.\r\n * This will be `undefined` by default unless you add a new Pointer using `addPointer`.\r\n *\r\n * @name Phaser.Input.InputPlugin#pointer3\r\n * @type {Phaser.Input.Pointer}\r\n * @readonly\r\n * @since 3.10.0\r\n */\r\n pointer3: {\r\n\r\n get: function ()\r\n {\r\n return this.manager.pointers[3];\r\n }\r\n\r\n },\r\n\r\n /**\r\n * A touch-based Pointer object.\r\n * This will be `undefined` by default unless you add a new Pointer using `addPointer`.\r\n *\r\n * @name Phaser.Input.InputPlugin#pointer4\r\n * @type {Phaser.Input.Pointer}\r\n * @readonly\r\n * @since 3.10.0\r\n */\r\n pointer4: {\r\n\r\n get: function ()\r\n {\r\n return this.manager.pointers[4];\r\n }\r\n\r\n },\r\n\r\n /**\r\n * A touch-based Pointer object.\r\n * This will be `undefined` by default unless you add a new Pointer using `addPointer`.\r\n *\r\n * @name Phaser.Input.InputPlugin#pointer5\r\n * @type {Phaser.Input.Pointer}\r\n * @readonly\r\n * @since 3.10.0\r\n */\r\n pointer5: {\r\n\r\n get: function ()\r\n {\r\n return this.manager.pointers[5];\r\n }\r\n\r\n },\r\n\r\n /**\r\n * A touch-based Pointer object.\r\n * This will be `undefined` by default unless you add a new Pointer using `addPointer`.\r\n *\r\n * @name Phaser.Input.InputPlugin#pointer6\r\n * @type {Phaser.Input.Pointer}\r\n * @readonly\r\n * @since 3.10.0\r\n */\r\n pointer6: {\r\n\r\n get: function ()\r\n {\r\n return this.manager.pointers[6];\r\n }\r\n\r\n },\r\n\r\n /**\r\n * A touch-based Pointer object.\r\n * This will be `undefined` by default unless you add a new Pointer using `addPointer`.\r\n *\r\n * @name Phaser.Input.InputPlugin#pointer7\r\n * @type {Phaser.Input.Pointer}\r\n * @readonly\r\n * @since 3.10.0\r\n */\r\n pointer7: {\r\n\r\n get: function ()\r\n {\r\n return this.manager.pointers[7];\r\n }\r\n\r\n },\r\n\r\n /**\r\n * A touch-based Pointer object.\r\n * This will be `undefined` by default unless you add a new Pointer using `addPointer`.\r\n *\r\n * @name Phaser.Input.InputPlugin#pointer8\r\n * @type {Phaser.Input.Pointer}\r\n * @readonly\r\n * @since 3.10.0\r\n */\r\n pointer8: {\r\n\r\n get: function ()\r\n {\r\n return this.manager.pointers[8];\r\n }\r\n\r\n },\r\n\r\n /**\r\n * A touch-based Pointer object.\r\n * This will be `undefined` by default unless you add a new Pointer using `addPointer`.\r\n *\r\n * @name Phaser.Input.InputPlugin#pointer9\r\n * @type {Phaser.Input.Pointer}\r\n * @readonly\r\n * @since 3.10.0\r\n */\r\n pointer9: {\r\n\r\n get: function ()\r\n {\r\n return this.manager.pointers[9];\r\n }\r\n\r\n },\r\n\r\n /**\r\n * A touch-based Pointer object.\r\n * This will be `undefined` by default unless you add a new Pointer using `addPointer`.\r\n *\r\n * @name Phaser.Input.InputPlugin#pointer10\r\n * @type {Phaser.Input.Pointer}\r\n * @readonly\r\n * @since 3.10.0\r\n */\r\n pointer10: {\r\n\r\n get: function ()\r\n {\r\n return this.manager.pointers[10];\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nPluginCache.register('InputPlugin', InputPlugin, 'input');\r\n\r\nmodule.exports = InputPlugin;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/InputPlugin.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/InputPluginCache.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/input/InputPluginCache.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetValue = __webpack_require__(/*! ../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\n\r\n// Contains the plugins that Phaser uses globally and locally.\r\n// These are the source objects, not instantiated.\r\nvar inputPlugins = {};\r\n\r\n/**\r\n * @namespace Phaser.Input.InputPluginCache\r\n */\r\n\r\nvar InputPluginCache = {};\r\n\r\n/**\r\n * Static method called directly by the Core internal Plugins.\r\n * Key is a reference used to get the plugin from the plugins object (i.e. InputPlugin)\r\n * Plugin is the object to instantiate to create the plugin\r\n * Mapping is what the plugin is injected into the Scene.Systems as (i.e. input)\r\n *\r\n * @function Phaser.Input.InputPluginCache.register\r\n * @static\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - A reference used to get this plugin from the plugin cache.\r\n * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated.\r\n * @param {string} mapping - If this plugin is to be injected into the Input Plugin, this is the property key used.\r\n * @param {string} settingsKey - The key in the Scene Settings to check to see if this plugin should install or not.\r\n * @param {string} configKey - The key in the Game Config to check to see if this plugin should install or not.\r\n */\r\nInputPluginCache.register = function (key, plugin, mapping, settingsKey, configKey)\r\n{\r\n inputPlugins[key] = { plugin: plugin, mapping: mapping, settingsKey: settingsKey, configKey: configKey };\r\n};\r\n\r\n/**\r\n * Returns the input plugin object from the cache based on the given key.\r\n *\r\n * @function Phaser.Input.InputPluginCache.getCore\r\n * @static\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The key of the input plugin to get.\r\n *\r\n * @return {Phaser.Types.Input.InputPluginContainer} The input plugin object.\r\n */\r\nInputPluginCache.getPlugin = function (key)\r\n{\r\n return inputPlugins[key];\r\n};\r\n\r\n/**\r\n * Installs all of the registered Input Plugins into the given target.\r\n *\r\n * @function Phaser.Input.InputPluginCache.install\r\n * @static\r\n * @since 3.10.0\r\n *\r\n * @param {Phaser.Input.InputPlugin} target - The target InputPlugin to install the plugins into.\r\n */\r\nInputPluginCache.install = function (target)\r\n{\r\n var sys = target.scene.sys;\r\n var settings = sys.settings.input;\r\n var config = sys.game.config;\r\n\r\n for (var key in inputPlugins)\r\n {\r\n var source = inputPlugins[key].plugin;\r\n var mapping = inputPlugins[key].mapping;\r\n var settingsKey = inputPlugins[key].settingsKey;\r\n var configKey = inputPlugins[key].configKey;\r\n\r\n if (GetValue(settings, settingsKey, config[configKey]))\r\n {\r\n target[mapping] = new source(target);\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Removes an input plugin based on the given key.\r\n *\r\n * @function Phaser.Input.InputPluginCache.remove\r\n * @static\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The key of the input plugin to remove.\r\n */\r\nInputPluginCache.remove = function (key)\r\n{\r\n if (inputPlugins.hasOwnProperty(key))\r\n {\r\n delete inputPlugins[key];\r\n }\r\n};\r\n\r\nmodule.exports = InputPluginCache;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/InputPluginCache.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/Pointer.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/input/Pointer.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Angle = __webpack_require__(/*! ../math/angle/Between */ \"./node_modules/phaser/src/math/angle/Between.js\");\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Distance = __webpack_require__(/*! ../math/distance/DistanceBetween */ \"./node_modules/phaser/src/math/distance/DistanceBetween.js\");\r\nvar FuzzyEqual = __webpack_require__(/*! ../math/fuzzy/Equal */ \"./node_modules/phaser/src/math/fuzzy/Equal.js\");\r\nvar SmoothStepInterpolation = __webpack_require__(/*! ../math/interpolation/SmoothStepInterpolation */ \"./node_modules/phaser/src/math/interpolation/SmoothStepInterpolation.js\");\r\nvar Vector2 = __webpack_require__(/*! ../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Pointer object encapsulates both mouse and touch input within Phaser.\r\n *\r\n * By default, Phaser will create 2 pointers for your game to use. If you require more, i.e. for a multi-touch\r\n * game, then use the `InputPlugin.addPointer` method to do so, rather than instantiating this class directly,\r\n * otherwise it won't be managed by the input system.\r\n *\r\n * You can reference the current active pointer via `InputPlugin.activePointer`. You can also use the properties\r\n * `InputPlugin.pointer1` through to `pointer10`, for each pointer you have enabled in your game.\r\n *\r\n * The properties of this object are set by the Input Plugin during processing. This object is then sent in all\r\n * input related events that the Input Plugin emits, so you can reference properties from it directly in your\r\n * callbacks.\r\n *\r\n * @class Pointer\r\n * @memberof Phaser.Input\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.InputManager} manager - A reference to the Input Manager.\r\n * @param {integer} id - The internal ID of this Pointer.\r\n */\r\nvar Pointer = new Class({\r\n\r\n initialize:\r\n\r\n function Pointer (manager, id)\r\n {\r\n /**\r\n * A reference to the Input Manager.\r\n *\r\n * @name Phaser.Input.Pointer#manager\r\n * @type {Phaser.Input.InputManager}\r\n * @since 3.0.0\r\n */\r\n this.manager = manager;\r\n\r\n /**\r\n * The internal ID of this Pointer.\r\n *\r\n * @name Phaser.Input.Pointer#id\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.id = id;\r\n\r\n /**\r\n * The most recent native DOM Event this Pointer has processed.\r\n *\r\n * @name Phaser.Input.Pointer#event\r\n * @type {(TouchEvent|MouseEvent)}\r\n * @since 3.0.0\r\n */\r\n this.event;\r\n\r\n /**\r\n * The DOM element the Pointer was pressed down on, taken from the DOM event.\r\n * In a default set-up this will be the Canvas that Phaser is rendering to, or the Window element.\r\n *\r\n * @name Phaser.Input.Pointer#downElement\r\n * @type {any}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n this.downElement;\r\n\r\n /**\r\n * The DOM element the Pointer was released on, taken from the DOM event.\r\n * In a default set-up this will be the Canvas that Phaser is rendering to, or the Window element.\r\n *\r\n * @name Phaser.Input.Pointer#upElement\r\n * @type {any}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n this.upElement;\r\n\r\n /**\r\n * The camera the Pointer interacted with during its last update.\r\n * \r\n * A Pointer can only ever interact with one camera at once, which will be the top-most camera\r\n * in the list should multiple cameras be positioned on-top of each other.\r\n *\r\n * @name Phaser.Input.Pointer#camera\r\n * @type {Phaser.Cameras.Scene2D.Camera}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.camera = null;\r\n\r\n /**\r\n * A read-only property that indicates which button was pressed, or released, on the pointer\r\n * during the most recent event. It is only set during `up` and `down` events.\r\n * \r\n * On Touch devices the value is always 0.\r\n * \r\n * Users may change the configuration of buttons on their pointing device so that if an event's button property\r\n * is zero, it may not have been caused by the button that is physically left–most on the pointing device;\r\n * however, it should behave as if the left button was clicked in the standard button layout.\r\n *\r\n * @name Phaser.Input.Pointer#button\r\n * @type {integer}\r\n * @readonly\r\n * @default 0\r\n * @since 3.18.0\r\n */\r\n this.button = 0;\r\n\r\n /**\r\n * 0: No button or un-initialized\r\n * 1: Left button\r\n * 2: Right button\r\n * 4: Wheel button or middle button\r\n * 8: 4th button (typically the \"Browser Back\" button)\r\n * 16: 5th button (typically the \"Browser Forward\" button)\r\n * \r\n * For a mouse configured for left-handed use, the button actions are reversed.\r\n * In this case, the values are read from right to left.\r\n *\r\n * @name Phaser.Input.Pointer#buttons\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.buttons = 0;\r\n\r\n /**\r\n * The position of the Pointer in screen space.\r\n *\r\n * @name Phaser.Input.Pointer#position\r\n * @type {Phaser.Math.Vector2}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.position = new Vector2();\r\n\r\n /**\r\n * The previous position of the Pointer in screen space.\r\n * \r\n * The old x and y values are stored in here during the InputManager.transformPointer call.\r\n * \r\n * Use the properties `velocity`, `angle` and `distance` to create your own gesture recognition.\r\n *\r\n * @name Phaser.Input.Pointer#prevPosition\r\n * @type {Phaser.Math.Vector2}\r\n * @readonly\r\n * @since 3.11.0\r\n */\r\n this.prevPosition = new Vector2();\r\n\r\n /**\r\n * An internal vector used for calculations of the pointer speed and angle.\r\n *\r\n * @name Phaser.Input.Pointer#midPoint\r\n * @type {Phaser.Math.Vector2}\r\n * @private\r\n * @since 3.16.0\r\n */\r\n this.midPoint = new Vector2(-1, -1);\r\n\r\n /**\r\n * The current velocity of the Pointer, based on its current and previous positions.\r\n * \r\n * This value is smoothed out each frame, according to the `motionFactor` property.\r\n * \r\n * This property is updated whenever the Pointer moves, regardless of any button states. In other words,\r\n * it changes based on movement alone - a button doesn't have to be pressed first.\r\n *\r\n * @name Phaser.Input.Pointer#velocity\r\n * @type {Phaser.Math.Vector2}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n this.velocity = new Vector2();\r\n\r\n /**\r\n * The current angle the Pointer is moving, in radians, based on its previous and current position.\r\n * \r\n * The angle is based on the old position facing to the current position.\r\n * \r\n * This property is updated whenever the Pointer moves, regardless of any button states. In other words,\r\n * it changes based on movement alone - a button doesn't have to be pressed first.\r\n *\r\n * @name Phaser.Input.Pointer#angle\r\n * @type {number}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n this.angle = 0;\r\n\r\n /**\r\n * The distance the Pointer has moved, based on its previous and current position.\r\n * \r\n * This value is smoothed out each frame, according to the `motionFactor` property.\r\n * \r\n * This property is updated whenever the Pointer moves, regardless of any button states. In other words,\r\n * it changes based on movement alone - a button doesn't have to be pressed first.\r\n * \r\n * If you need the total distance travelled since the primary buttons was pressed down,\r\n * then use the `Pointer.getDistance` method.\r\n *\r\n * @name Phaser.Input.Pointer#distance\r\n * @type {number}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n this.distance = 0;\r\n\r\n /**\r\n * The smoothing factor to apply to the Pointer position.\r\n * \r\n * Due to their nature, pointer positions are inherently noisy. While this is fine for lots of games, if you need cleaner positions\r\n * then you can set this value to apply an automatic smoothing to the positions as they are recorded.\r\n * \r\n * The default value of zero means 'no smoothing'.\r\n * Set to a small value, such as 0.2, to apply an average level of smoothing between positions. You can do this by changing this\r\n * value directly, or by setting the `input.smoothFactor` property in the Game Config.\r\n * \r\n * Positions are only smoothed when the pointer moves. If the primary button on this Pointer enters an Up or Down state, then the position\r\n * is always precise, and not smoothed.\r\n *\r\n * @name Phaser.Input.Pointer#smoothFactor\r\n * @type {number}\r\n * @default 0\r\n * @since 3.16.0\r\n */\r\n this.smoothFactor = 0;\r\n\r\n /**\r\n * The factor applied to the motion smoothing each frame.\r\n * \r\n * This value is passed to the Smooth Step Interpolation that is used to calculate the velocity,\r\n * angle and distance of the Pointer. It's applied every frame, until the midPoint reaches the current\r\n * position of the Pointer. 0.2 provides a good average but can be increased if you need a\r\n * quicker update and are working in a high performance environment. Never set this value to\r\n * zero.\r\n *\r\n * @name Phaser.Input.Pointer#motionFactor\r\n * @type {number}\r\n * @default 0.2\r\n * @since 3.16.0\r\n */\r\n this.motionFactor = 0.2;\r\n\r\n /**\r\n * The x position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with.\r\n * \r\n * If you wish to use this value _outside_ of an input event handler then you should update it first by calling\r\n * the `Pointer.updateWorldPoint` method.\r\n *\r\n * @name Phaser.Input.Pointer#worldX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.10.0\r\n */\r\n this.worldX = 0;\r\n\r\n /**\r\n * The y position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with.\r\n * \r\n * If you wish to use this value _outside_ of an input event handler then you should update it first by calling\r\n * the `Pointer.updateWorldPoint` method.\r\n *\r\n * @name Phaser.Input.Pointer#worldY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.10.0\r\n */\r\n this.worldY = 0;\r\n\r\n /**\r\n * Time when this Pointer was most recently moved (regardless of the state of its buttons, if any)\r\n *\r\n * @name Phaser.Input.Pointer#moveTime\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.moveTime = 0;\r\n\r\n /**\r\n * X coordinate of the Pointer when Button 1 (left button), or Touch, was pressed, used for dragging objects.\r\n *\r\n * @name Phaser.Input.Pointer#downX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.downX = 0;\r\n\r\n /**\r\n * Y coordinate of the Pointer when Button 1 (left button), or Touch, was pressed, used for dragging objects.\r\n *\r\n * @name Phaser.Input.Pointer#downY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.downY = 0;\r\n\r\n /**\r\n * Time when Button 1 (left button), or Touch, was pressed, used for dragging objects.\r\n *\r\n * @name Phaser.Input.Pointer#downTime\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.downTime = 0;\r\n\r\n /**\r\n * X coordinate of the Pointer when Button 1 (left button), or Touch, was released, used for dragging objects.\r\n *\r\n * @name Phaser.Input.Pointer#upX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.upX = 0;\r\n\r\n /**\r\n * Y coordinate of the Pointer when Button 1 (left button), or Touch, was released, used for dragging objects.\r\n *\r\n * @name Phaser.Input.Pointer#upY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.upY = 0;\r\n\r\n /**\r\n * Time when Button 1 (left button), or Touch, was released, used for dragging objects.\r\n *\r\n * @name Phaser.Input.Pointer#upTime\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.upTime = 0;\r\n\r\n /**\r\n * Is the primary button down? (usually button 0, the left mouse button)\r\n *\r\n * @name Phaser.Input.Pointer#primaryDown\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.primaryDown = false;\r\n\r\n /**\r\n * Is _any_ button on this pointer considered as being down?\r\n *\r\n * @name Phaser.Input.Pointer#isDown\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.isDown = false;\r\n\r\n /**\r\n * Did the previous input event come from a Touch input (true) or Mouse? (false)\r\n *\r\n * @name Phaser.Input.Pointer#wasTouch\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.wasTouch = false;\r\n\r\n /**\r\n * Did this Pointer get canceled by a touchcancel event?\r\n * \r\n * Note: \"canceled\" is the American-English spelling of \"cancelled\". Please don't submit PRs correcting it!\r\n *\r\n * @name Phaser.Input.Pointer#wasCanceled\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.15.0\r\n */\r\n this.wasCanceled = false;\r\n\r\n /**\r\n * If the mouse is locked, the horizontal relative movement of the Pointer in pixels since last frame.\r\n *\r\n * @name Phaser.Input.Pointer#movementX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.movementX = 0;\r\n\r\n /**\r\n * If the mouse is locked, the vertical relative movement of the Pointer in pixels since last frame.\r\n *\r\n * @name Phaser.Input.Pointer#movementY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.movementY = 0;\r\n\r\n /**\r\n * The identifier property of the Pointer as set by the DOM event when this Pointer is started.\r\n *\r\n * @name Phaser.Input.Pointer#identifier\r\n * @type {number}\r\n * @since 3.10.0\r\n */\r\n this.identifier = 0;\r\n\r\n /**\r\n * The pointerId property of the Pointer as set by the DOM event when this Pointer is started.\r\n * The browser can and will recycle this value.\r\n *\r\n * @name Phaser.Input.Pointer#pointerId\r\n * @type {number}\r\n * @since 3.10.0\r\n */\r\n this.pointerId = null;\r\n\r\n /**\r\n * An active Pointer is one that is currently pressed down on the display.\r\n * A Mouse is always considered as active.\r\n *\r\n * @name Phaser.Input.Pointer#active\r\n * @type {boolean}\r\n * @since 3.10.0\r\n */\r\n this.active = (id === 0) ? true : false;\r\n\r\n /**\r\n * Is this pointer Pointer Locked?\r\n * \r\n * Only a mouse pointer can be locked and it only becomes locked when requested via\r\n * the browsers Pointer Lock API.\r\n * \r\n * You can request this by calling the `this.input.mouse.requestPointerLock()` method from\r\n * a `pointerdown` or `pointerup` event handler.\r\n *\r\n * @name Phaser.Input.Pointer#locked\r\n * @readonly\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.locked = false;\r\n\r\n /**\r\n * The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device.\r\n *\r\n * @name Phaser.Input.Pointer#deltaX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.18.0\r\n */\r\n this.deltaX = 0;\r\n\r\n /**\r\n * The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device.\r\n * This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down.\r\n *\r\n * @name Phaser.Input.Pointer#deltaY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.18.0\r\n */\r\n this.deltaY = 0;\r\n\r\n /**\r\n * The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device.\r\n *\r\n * @name Phaser.Input.Pointer#deltaZ\r\n * @type {number}\r\n * @default 0\r\n * @since 3.18.0\r\n */\r\n this.deltaZ = 0;\r\n },\r\n\r\n /**\r\n * Takes a Camera and updates this Pointer's `worldX` and `worldY` values so they are\r\n * the result of a translation through the given Camera.\r\n * \r\n * Note that the values will be automatically replaced the moment the Pointer is\r\n * updated by an input event, such as a mouse move, so should be used immediately.\r\n *\r\n * @method Phaser.Input.Pointer#updateWorldPoint\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera which is being tested against.\r\n *\r\n * @return {this} This Pointer object.\r\n */\r\n updateWorldPoint: function (camera)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n\r\n if (camera.resolution !== 1)\r\n {\r\n x += camera._x;\r\n y += camera._y;\r\n }\r\n\r\n // Stores the world point inside of tempPoint\r\n var temp = camera.getWorldPoint(x, y);\r\n\r\n this.worldX = temp.x;\r\n this.worldY = temp.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes a Camera and returns a Vector2 containing the translated position of this Pointer\r\n * within that Camera. This can be used to convert this Pointers position into camera space.\r\n *\r\n * @method Phaser.Input.Pointer#positionToCamera\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the translation.\r\n * @param {(Phaser.Math.Vector2|object)} [output] - A Vector2-like object in which to store the translated position.\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} A Vector2 containing the translated coordinates of this Pointer, based on the given camera.\r\n */\r\n positionToCamera: function (camera, output)\r\n {\r\n return camera.getWorldPoint(this.x, this.y, output);\r\n },\r\n\r\n /**\r\n * Calculates the motion of this Pointer, including its velocity and angle of movement.\r\n * This method is called automatically each frame by the Input Manager.\r\n *\r\n * @method Phaser.Input.Pointer#updateMotion\r\n * @private\r\n * @since 3.16.0\r\n */\r\n updateMotion: function ()\r\n {\r\n var cx = this.position.x;\r\n var cy = this.position.y;\r\n\r\n var mx = this.midPoint.x;\r\n var my = this.midPoint.y;\r\n\r\n if (cx === mx && cy === my)\r\n {\r\n // Nothing to do here\r\n return;\r\n }\r\n\r\n // Moving towards our goal ...\r\n var vx = SmoothStepInterpolation(this.motionFactor, mx, cx);\r\n var vy = SmoothStepInterpolation(this.motionFactor, my, cy);\r\n\r\n if (FuzzyEqual(vx, cx, 0.1))\r\n {\r\n vx = cx;\r\n }\r\n\r\n if (FuzzyEqual(vy, cy, 0.1))\r\n {\r\n vy = cy;\r\n }\r\n\r\n this.midPoint.set(vx, vy);\r\n\r\n var dx = cx - vx;\r\n var dy = cy - vy;\r\n\r\n this.velocity.set(dx, dy);\r\n\r\n this.angle = Angle(vx, vy, cx, cy);\r\n\r\n this.distance = Math.sqrt(dx * dx + dy * dy);\r\n },\r\n\r\n /**\r\n * Internal method to handle a Mouse Up Event.\r\n *\r\n * @method Phaser.Input.Pointer#up\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {MouseEvent} event - The Mouse Event to process.\r\n */\r\n up: function (event)\r\n {\r\n if ('buttons' in event)\r\n {\r\n this.buttons = event.buttons;\r\n }\r\n\r\n this.event = event;\r\n\r\n this.button = event.button;\r\n\r\n this.upElement = event.target;\r\n\r\n // Sets the local x/y properties\r\n this.manager.transformPointer(this, event.pageX, event.pageY, false);\r\n\r\n // 0: Main button pressed, usually the left button or the un-initialized state\r\n if (event.button === 0)\r\n {\r\n this.primaryDown = false;\r\n this.upX = this.x;\r\n this.upY = this.y;\r\n this.upTime = event.timeStamp;\r\n }\r\n\r\n this.isDown = false;\r\n\r\n this.wasTouch = false;\r\n },\r\n\r\n /**\r\n * Internal method to handle a Mouse Down Event.\r\n *\r\n * @method Phaser.Input.Pointer#down\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {MouseEvent} event - The Mouse Event to process.\r\n */\r\n down: function (event)\r\n {\r\n if ('buttons' in event)\r\n {\r\n this.buttons = event.buttons;\r\n }\r\n\r\n this.event = event;\r\n\r\n this.button = event.button;\r\n\r\n this.downElement = event.target;\r\n\r\n // Sets the local x/y properties\r\n this.manager.transformPointer(this, event.pageX, event.pageY, false);\r\n\r\n // 0: Main button pressed, usually the left button or the un-initialized state\r\n if (event.button === 0)\r\n {\r\n this.primaryDown = true;\r\n this.downX = this.x;\r\n this.downY = this.y;\r\n this.downTime = event.timeStamp;\r\n }\r\n\r\n this.isDown = true;\r\n\r\n this.wasTouch = false;\r\n },\r\n\r\n /**\r\n * Internal method to handle a Mouse Move Event.\r\n *\r\n * @method Phaser.Input.Pointer#move\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {MouseEvent} event - The Mouse Event to process.\r\n */\r\n move: function (event)\r\n {\r\n if ('buttons' in event)\r\n {\r\n this.buttons = event.buttons;\r\n }\r\n\r\n this.event = event;\r\n\r\n // Sets the local x/y properties\r\n this.manager.transformPointer(this, event.pageX, event.pageY, true);\r\n\r\n if (this.locked)\r\n {\r\n // Multiple DOM events may occur within one frame, but only one Phaser event will fire\r\n this.movementX = event.movementX || event.mozMovementX || event.webkitMovementX || 0;\r\n this.movementY = event.movementY || event.mozMovementY || event.webkitMovementY || 0;\r\n }\r\n\r\n this.moveTime = event.timeStamp;\r\n\r\n this.wasTouch = false;\r\n },\r\n\r\n /**\r\n * Internal method to handle a Mouse Wheel Event.\r\n *\r\n * @method Phaser.Input.Pointer#wheel\r\n * @private\r\n * @since 3.18.0\r\n *\r\n * @param {WheelEvent} event - The Wheel Event to process.\r\n */\r\n wheel: function (event)\r\n {\r\n if ('buttons' in event)\r\n {\r\n this.buttons = event.buttons;\r\n }\r\n\r\n this.event = event;\r\n\r\n // Sets the local x/y properties\r\n this.manager.transformPointer(this, event.pageX, event.pageY, false);\r\n\r\n this.deltaX = event.deltaX;\r\n this.deltaY = event.deltaY;\r\n this.deltaZ = event.deltaZ;\r\n\r\n this.wasTouch = false;\r\n },\r\n\r\n /**\r\n * Internal method to handle a Touch Start Event.\r\n *\r\n * @method Phaser.Input.Pointer#touchstart\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Touch} touch - The Changed Touch from the Touch Event.\r\n * @param {TouchEvent} event - The full Touch Event.\r\n */\r\n touchstart: function (touch, event)\r\n {\r\n if (touch['pointerId'])\r\n {\r\n this.pointerId = touch.pointerId;\r\n }\r\n\r\n this.identifier = touch.identifier;\r\n this.target = touch.target;\r\n this.active = true;\r\n\r\n this.buttons = 1;\r\n\r\n this.event = event;\r\n\r\n this.downElement = touch.target;\r\n\r\n // Sets the local x/y properties\r\n this.manager.transformPointer(this, touch.pageX, touch.pageY, false);\r\n\r\n this.primaryDown = true;\r\n this.downX = this.x;\r\n this.downY = this.y;\r\n this.downTime = event.timeStamp;\r\n\r\n this.isDown = true;\r\n\r\n this.wasTouch = true;\r\n this.wasCanceled = false;\r\n\r\n this.updateMotion();\r\n },\r\n\r\n /**\r\n * Internal method to handle a Touch Move Event.\r\n *\r\n * @method Phaser.Input.Pointer#touchmove\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Touch} touch - The Changed Touch from the Touch Event.\r\n * @param {TouchEvent} event - The full Touch Event.\r\n */\r\n touchmove: function (touch, event)\r\n {\r\n this.event = event;\r\n\r\n // Sets the local x/y properties\r\n this.manager.transformPointer(this, touch.pageX, touch.pageY, true);\r\n\r\n this.moveTime = event.timeStamp;\r\n\r\n this.wasTouch = true;\r\n\r\n this.updateMotion();\r\n },\r\n\r\n /**\r\n * Internal method to handle a Touch End Event.\r\n *\r\n * @method Phaser.Input.Pointer#touchend\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Touch} touch - The Changed Touch from the Touch Event.\r\n * @param {TouchEvent} event - The full Touch Event.\r\n */\r\n touchend: function (touch, event)\r\n {\r\n this.buttons = 0;\r\n\r\n this.event = event;\r\n\r\n this.upElement = touch.target;\r\n\r\n // Sets the local x/y properties\r\n this.manager.transformPointer(this, touch.pageX, touch.pageY, false);\r\n\r\n this.primaryDown = false;\r\n this.upX = this.x;\r\n this.upY = this.y;\r\n this.upTime = event.timeStamp;\r\n\r\n this.isDown = false;\r\n\r\n this.wasTouch = true;\r\n this.wasCanceled = false;\r\n \r\n this.active = false;\r\n\r\n this.updateMotion();\r\n },\r\n\r\n /**\r\n * Internal method to handle a Touch Cancel Event.\r\n *\r\n * @method Phaser.Input.Pointer#touchcancel\r\n * @private\r\n * @since 3.15.0\r\n *\r\n * @param {Touch} touch - The Changed Touch from the Touch Event.\r\n * @param {TouchEvent} event - The full Touch Event.\r\n */\r\n touchcancel: function (touch, event)\r\n {\r\n this.buttons = 0;\r\n\r\n this.event = event;\r\n\r\n this.upElement = touch.target;\r\n\r\n // Sets the local x/y properties\r\n this.manager.transformPointer(this, touch.pageX, touch.pageY, false);\r\n\r\n this.primaryDown = false;\r\n this.upX = this.x;\r\n this.upY = this.y;\r\n this.upTime = event.timeStamp;\r\n\r\n this.isDown = false;\r\n\r\n this.wasTouch = true;\r\n this.wasCanceled = true;\r\n \r\n this.active = false;\r\n },\r\n\r\n /**\r\n * Checks to see if any buttons are being held down on this Pointer.\r\n *\r\n * @method Phaser.Input.Pointer#noButtonDown\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if no buttons are being held down.\r\n */\r\n noButtonDown: function ()\r\n {\r\n return (this.buttons === 0);\r\n },\r\n\r\n /**\r\n * Checks to see if the left button is being held down on this Pointer.\r\n *\r\n * @method Phaser.Input.Pointer#leftButtonDown\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the left button is being held down.\r\n */\r\n leftButtonDown: function ()\r\n {\r\n return (this.buttons & 1) ? true : false;\r\n },\r\n\r\n /**\r\n * Checks to see if the right button is being held down on this Pointer.\r\n *\r\n * @method Phaser.Input.Pointer#rightButtonDown\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the right button is being held down.\r\n */\r\n rightButtonDown: function ()\r\n {\r\n return (this.buttons & 2) ? true : false;\r\n },\r\n\r\n /**\r\n * Checks to see if the middle button is being held down on this Pointer.\r\n *\r\n * @method Phaser.Input.Pointer#middleButtonDown\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the middle button is being held down.\r\n */\r\n middleButtonDown: function ()\r\n {\r\n return (this.buttons & 4) ? true : false;\r\n },\r\n\r\n /**\r\n * Checks to see if the back button is being held down on this Pointer.\r\n *\r\n * @method Phaser.Input.Pointer#backButtonDown\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the back button is being held down.\r\n */\r\n backButtonDown: function ()\r\n {\r\n return (this.buttons & 8) ? true : false;\r\n },\r\n\r\n /**\r\n * Checks to see if the forward button is being held down on this Pointer.\r\n *\r\n * @method Phaser.Input.Pointer#forwardButtonDown\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the forward button is being held down.\r\n */\r\n forwardButtonDown: function ()\r\n {\r\n return (this.buttons & 16) ? true : false;\r\n },\r\n\r\n /**\r\n * Checks to see if the left button was just released on this Pointer.\r\n *\r\n * @method Phaser.Input.Pointer#leftButtonReleased\r\n * @since 3.18.0\r\n *\r\n * @return {boolean} `true` if the left button was just released.\r\n */\r\n leftButtonReleased: function ()\r\n {\r\n return (this.button === 0 && !this.isDown);\r\n },\r\n\r\n /**\r\n * Checks to see if the right button was just released on this Pointer.\r\n *\r\n * @method Phaser.Input.Pointer#rightButtonReleased\r\n * @since 3.18.0\r\n *\r\n * @return {boolean} `true` if the right button was just released.\r\n */\r\n rightButtonReleased: function ()\r\n {\r\n return (this.button === 2 && !this.isDown);\r\n },\r\n\r\n /**\r\n * Checks to see if the middle button was just released on this Pointer.\r\n *\r\n * @method Phaser.Input.Pointer#middleButtonReleased\r\n * @since 3.18.0\r\n *\r\n * @return {boolean} `true` if the middle button was just released.\r\n */\r\n middleButtonReleased: function ()\r\n {\r\n return (this.button === 1 && !this.isDown);\r\n },\r\n\r\n /**\r\n * Checks to see if the back button was just released on this Pointer.\r\n *\r\n * @method Phaser.Input.Pointer#backButtonReleased\r\n * @since 3.18.0\r\n *\r\n * @return {boolean} `true` if the back button was just released.\r\n */\r\n backButtonReleased: function ()\r\n {\r\n return (this.button === 3 && !this.isDown);\r\n },\r\n\r\n /**\r\n * Checks to see if the forward button was just released on this Pointer.\r\n *\r\n * @method Phaser.Input.Pointer#forwardButtonReleased\r\n * @since 3.18.0\r\n *\r\n * @return {boolean} `true` if the forward button was just released.\r\n */\r\n forwardButtonReleased: function ()\r\n {\r\n return (this.button === 4 && !this.isDown);\r\n },\r\n\r\n /**\r\n * If the Pointer has a button pressed down at the time this method is called, it will return the\r\n * distance between the Pointer's `downX` and `downY` values and the current position.\r\n * \r\n * If no button is held down, it will return the last recorded distance, based on where\r\n * the Pointer was when the button was released.\r\n * \r\n * If you wish to get the distance being travelled currently, based on the velocity of the Pointer,\r\n * then see the `Pointer.distance` property.\r\n *\r\n * @method Phaser.Input.Pointer#getDistance\r\n * @since 3.13.0\r\n *\r\n * @return {number} The distance the Pointer moved.\r\n */\r\n getDistance: function ()\r\n {\r\n if (this.isDown)\r\n {\r\n return Distance(this.downX, this.downY, this.x, this.y);\r\n }\r\n else\r\n {\r\n return Distance(this.downX, this.downY, this.upX, this.upY);\r\n }\r\n },\r\n\r\n /**\r\n * If the Pointer has a button pressed down at the time this method is called, it will return the\r\n * horizontal distance between the Pointer's `downX` and `downY` values and the current position.\r\n * \r\n * If no button is held down, it will return the last recorded horizontal distance, based on where\r\n * the Pointer was when the button was released.\r\n *\r\n * @method Phaser.Input.Pointer#getDistanceX\r\n * @since 3.16.0\r\n *\r\n * @return {number} The horizontal distance the Pointer moved.\r\n */\r\n getDistanceX: function ()\r\n {\r\n if (this.isDown)\r\n {\r\n return Math.abs(this.downX - this.x);\r\n }\r\n else\r\n {\r\n return Math.abs(this.downX - this.upX);\r\n }\r\n },\r\n\r\n /**\r\n * If the Pointer has a button pressed down at the time this method is called, it will return the\r\n * vertical distance between the Pointer's `downX` and `downY` values and the current position.\r\n * \r\n * If no button is held down, it will return the last recorded vertical distance, based on where\r\n * the Pointer was when the button was released.\r\n *\r\n * @method Phaser.Input.Pointer#getDistanceY\r\n * @since 3.16.0\r\n *\r\n * @return {number} The vertical distance the Pointer moved.\r\n */\r\n getDistanceY: function ()\r\n {\r\n if (this.isDown)\r\n {\r\n return Math.abs(this.downY - this.y);\r\n }\r\n else\r\n {\r\n return Math.abs(this.downY - this.upY);\r\n }\r\n },\r\n\r\n /**\r\n * If the Pointer has a button pressed down at the time this method is called, it will return the\r\n * duration since the button was pressed down.\r\n * \r\n * If no button is held down, it will return the last recorded duration, based on the time\r\n * the Pointer button was released.\r\n *\r\n * @method Phaser.Input.Pointer#getDuration\r\n * @since 3.16.0\r\n *\r\n * @return {number} The duration the Pointer was held down for in milliseconds.\r\n */\r\n getDuration: function ()\r\n {\r\n if (this.isDown)\r\n {\r\n return (this.manager.time - this.downTime);\r\n }\r\n else\r\n {\r\n return (this.upTime - this.downTime);\r\n }\r\n },\r\n\r\n /**\r\n * If the Pointer has a button pressed down at the time this method is called, it will return the\r\n * angle between the Pointer's `downX` and `downY` values and the current position.\r\n * \r\n * If no button is held down, it will return the last recorded angle, based on where\r\n * the Pointer was when the button was released.\r\n * \r\n * The angle is based on the old position facing to the current position.\r\n * \r\n * If you wish to get the current angle, based on the velocity of the Pointer, then\r\n * see the `Pointer.angle` property.\r\n *\r\n * @method Phaser.Input.Pointer#getAngle\r\n * @since 3.16.0\r\n *\r\n * @return {number} The angle between the Pointer's coordinates in radians.\r\n */\r\n getAngle: function ()\r\n {\r\n if (this.isDown)\r\n {\r\n return Angle(this.downX, this.downY, this.x, this.y);\r\n }\r\n else\r\n {\r\n return Angle(this.downX, this.downY, this.upX, this.upY);\r\n }\r\n },\r\n\r\n /**\r\n * Takes the previous and current Pointer positions and then generates an array of interpolated values between\r\n * the two. The array will be populated up to the size of the `steps` argument.\r\n * \r\n * ```javaScript\r\n * var points = pointer.getInterpolatedPosition(4);\r\n * \r\n * // points[0] = { x: 0, y: 0 }\r\n * // points[1] = { x: 2, y: 1 }\r\n * // points[2] = { x: 3, y: 2 }\r\n * // points[3] = { x: 6, y: 3 }\r\n * ```\r\n * \r\n * Use this if you need to get smoothed values between the previous and current pointer positions. DOM pointer\r\n * events can often fire faster than the main browser loop, and this will help you avoid janky movement\r\n * especially if you have an object following a Pointer.\r\n * \r\n * Note that if you provide an output array it will only be populated up to the number of steps provided.\r\n * It will not clear any previous data that may have existed beyond the range of the steps count.\r\n * \r\n * Internally it uses the Smooth Step interpolation calculation.\r\n *\r\n * @method Phaser.Input.Pointer#getInterpolatedPosition\r\n * @since 3.11.0\r\n * \r\n * @param {integer} [steps=10] - The number of interpolation steps to use.\r\n * @param {array} [out] - An array to store the results in. If not provided a new one will be created.\r\n * \r\n * @return {array} An array of interpolated values.\r\n */\r\n getInterpolatedPosition: function (steps, out)\r\n {\r\n if (steps === undefined) { steps = 10; }\r\n if (out === undefined) { out = []; }\r\n\r\n var prevX = this.prevPosition.x;\r\n var prevY = this.prevPosition.y;\r\n\r\n var curX = this.position.x;\r\n var curY = this.position.y;\r\n\r\n for (var i = 0; i < steps; i++)\r\n {\r\n var t = (1 / steps) * i;\r\n\r\n out[i] = { x: SmoothStepInterpolation(t, prevX, curX), y: SmoothStepInterpolation(t, prevY, curY) };\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Destroys this Pointer instance and resets its external references.\r\n *\r\n * @method Phaser.Input.Pointer#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.camera = null;\r\n this.manager = null;\r\n this.position = null;\r\n },\r\n\r\n /**\r\n * The x position of this Pointer.\r\n * The value is in screen space.\r\n * See `worldX` to get a camera converted position.\r\n *\r\n * @name Phaser.Input.Pointer#x\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n x: {\r\n\r\n get: function ()\r\n {\r\n return this.position.x;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.position.x = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The y position of this Pointer.\r\n * The value is in screen space.\r\n * See `worldY` to get a camera converted position.\r\n *\r\n * @name Phaser.Input.Pointer#y\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n y: {\r\n\r\n get: function ()\r\n {\r\n return this.position.y;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.position.y = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Time when this Pointer was most recently updated by a DOM Event.\r\n * This comes directly from the `event.timeStamp` property.\r\n * If no event has yet taken place, it will return zero.\r\n *\r\n * @name Phaser.Input.Pointer#time\r\n * @type {number}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n time: {\r\n\r\n get: function ()\r\n {\r\n return (this.event) ? this.event.timeStamp : 0;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Pointer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/Pointer.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/const.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/input/const.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar INPUT_CONST = {\r\n\r\n /**\r\n * The mouse pointer is being held down.\r\n * \r\n * @name Phaser.Input.MOUSE_DOWN\r\n * @type {integer}\r\n * @since 3.10.0\r\n */\r\n MOUSE_DOWN: 0,\r\n\r\n /**\r\n * The mouse pointer is being moved.\r\n * \r\n * @name Phaser.Input.MOUSE_MOVE\r\n * @type {integer}\r\n * @since 3.10.0\r\n */\r\n MOUSE_MOVE: 1,\r\n\r\n /**\r\n * The mouse pointer is released.\r\n * \r\n * @name Phaser.Input.MOUSE_UP\r\n * @type {integer}\r\n * @since 3.10.0\r\n */\r\n MOUSE_UP: 2,\r\n\r\n /**\r\n * A touch pointer has been started.\r\n * \r\n * @name Phaser.Input.TOUCH_START\r\n * @type {integer}\r\n * @since 3.10.0\r\n */\r\n TOUCH_START: 3,\r\n\r\n /**\r\n * A touch pointer has been started.\r\n * \r\n * @name Phaser.Input.TOUCH_MOVE\r\n * @type {integer}\r\n * @since 3.10.0\r\n */\r\n TOUCH_MOVE: 4,\r\n\r\n /**\r\n * A touch pointer has been started.\r\n * \r\n * @name Phaser.Input.TOUCH_END\r\n * @type {integer}\r\n * @since 3.10.0\r\n */\r\n TOUCH_END: 5,\r\n\r\n /**\r\n * The pointer lock has changed.\r\n * \r\n * @name Phaser.Input.POINTER_LOCK_CHANGE\r\n * @type {integer}\r\n * @since 3.10.0\r\n */\r\n POINTER_LOCK_CHANGE: 6,\r\n\r\n /**\r\n * A touch pointer has been been cancelled by the browser.\r\n * \r\n * @name Phaser.Input.TOUCH_CANCEL\r\n * @type {integer}\r\n * @since 3.15.0\r\n */\r\n TOUCH_CANCEL: 7,\r\n\r\n /**\r\n * The mouse wheel changes.\r\n * \r\n * @name Phaser.Input.MOUSE_WHEEL\r\n * @type {integer}\r\n * @since 3.18.0\r\n */\r\n MOUSE_WHEEL: 8\r\n\r\n};\r\n\r\nmodule.exports = INPUT_CONST;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/const.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/BOOT_EVENT.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/input/events/BOOT_EVENT.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Input Plugin Boot Event.\r\n * \r\n * This internal event is dispatched by the Input Plugin when it boots, signalling to all of its systems to create themselves.\r\n *\r\n * @event Phaser.Input.Events#BOOT\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'boot';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/BOOT_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/DESTROY_EVENT.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/input/events/DESTROY_EVENT.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Input Plugin Destroy Event.\r\n * \r\n * This internal event is dispatched by the Input Plugin when it is destroyed, signalling to all of its systems to destroy themselves.\r\n *\r\n * @event Phaser.Input.Events#DESTROY\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'destroy';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/DESTROY_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/DRAG_END_EVENT.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/input/events/DRAG_END_EVENT.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pointer Drag End Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer stops dragging a Game Object.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('dragend', listener)`.\r\n * \r\n * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_END]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_END} event instead.\r\n *\r\n * @event Phaser.Input.Events#DRAG_END\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer stopped dragging.\r\n */\r\nmodule.exports = 'dragend';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/DRAG_END_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/DRAG_ENTER_EVENT.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/input/events/DRAG_ENTER_EVENT.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pointer Drag Enter Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object into a Drag Target.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('dragenter', listener)`.\r\n * \r\n * A Pointer can only drag a single Game Object at once.\r\n * \r\n * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_ENTER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_ENTER} event instead.\r\n *\r\n * @event Phaser.Input.Events#DRAG_ENTER\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging.\r\n * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved into.\r\n */\r\nmodule.exports = 'dragenter';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/DRAG_ENTER_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/DRAG_EVENT.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/input/events/DRAG_EVENT.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pointer Drag Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves while dragging a Game Object.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('drag', listener)`.\r\n * \r\n * A Pointer can only drag a single Game Object at once.\r\n * \r\n * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG} event instead.\r\n *\r\n * @event Phaser.Input.Events#DRAG\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging.\r\n * @param {number} dragX - The x coordinate where the Pointer is currently dragging the Game Object, in world space.\r\n * @param {number} dragY - The y coordinate where the Pointer is currently dragging the Game Object, in world space.\r\n */\r\nmodule.exports = 'drag';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/DRAG_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/DRAG_LEAVE_EVENT.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/input/events/DRAG_LEAVE_EVENT.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pointer Drag Leave Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object out of a Drag Target.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('dragleave', listener)`.\r\n * \r\n * A Pointer can only drag a single Game Object at once.\r\n * \r\n * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_LEAVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_LEAVE} event instead.\r\n *\r\n * @event Phaser.Input.Events#DRAG_LEAVE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging.\r\n * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has left.\r\n */\r\nmodule.exports = 'dragleave';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/DRAG_LEAVE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/DRAG_OVER_EVENT.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/input/events/DRAG_OVER_EVENT.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pointer Drag Over Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object over a Drag Target.\r\n * \r\n * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within\r\n * the drag target, it will emit this event instead.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('dragover', listener)`.\r\n * \r\n * A Pointer can only drag a single Game Object at once.\r\n * \r\n * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_OVER} event instead.\r\n *\r\n * @event Phaser.Input.Events#DRAG_OVER\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging.\r\n * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved over.\r\n */\r\nmodule.exports = 'dragover';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/DRAG_OVER_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/DRAG_START_EVENT.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/input/events/DRAG_START_EVENT.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pointer Drag Start Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer starts to drag any Game Object.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('dragstart', listener)`.\r\n * \r\n * A Pointer can only drag a single Game Object at once.\r\n * \r\n * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_START]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_START} event instead.\r\n *\r\n * @event Phaser.Input.Events#DRAG_START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging.\r\n */\r\nmodule.exports = 'dragstart';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/DRAG_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/DROP_EVENT.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/input/events/DROP_EVENT.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pointer Drop Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drops a Game Object on a Drag Target.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('drop', listener)`.\r\n * \r\n * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DROP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DROP} event instead.\r\n *\r\n * @event Phaser.Input.Events#DROP\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer was dragging.\r\n * @param {Phaser.GameObjects.GameObject} target - The Drag Target the `gameObject` has been dropped on.\r\n */\r\nmodule.exports = 'drop';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/DROP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_DOWN_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_DOWN_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Down Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down on _any_ interactive Game Object.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('gameobjectdown', listener)`.\r\n * \r\n * To receive this event, the Game Objects must have been set as interactive.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n * \r\n * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} event instead.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN}\r\n * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN}\r\n * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_DOWN\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was pressed down on.\r\n * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow.\r\n */\r\nmodule.exports = 'gameobjectdown';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_DOWN_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_END_EVENT.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_END_EVENT.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Drag End Event.\r\n * \r\n * This event is dispatched by an interactive Game Object if a pointer stops dragging it.\r\n * \r\n * Listen to this event from a Game Object using: `gameObject.on('dragend', listener)`.\r\n * Note that the scope of the listener is automatically set to be the Game Object instance itself.\r\n * \r\n * To receive this event, the Game Object must have been set as interactive and enabled for drag.\r\n * See [GameObject.setInteractive](Phaser.GameObjects.GameObject#setInteractive) for more details.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_DRAG_END\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {number} dragX - The x coordinate where the Pointer stopped dragging the Game Object, in world space.\r\n * @param {number} dragY - The y coordinate where the Pointer stopped dragging the Game Object, in world space.\r\n */\r\nmodule.exports = 'dragend';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_END_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_ENTER_EVENT.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_ENTER_EVENT.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Drag Enter Event.\r\n * \r\n * This event is dispatched by an interactive Game Object if a pointer drags it into a drag target.\r\n * \r\n * Listen to this event from a Game Object using: `gameObject.on('dragenter', listener)`.\r\n * Note that the scope of the listener is automatically set to be the Game Object instance itself.\r\n * \r\n * To receive this event, the Game Object must have been set as interactive and enabled for drag.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_DRAG_ENTER\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved into.\r\n */\r\nmodule.exports = 'dragenter';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_ENTER_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Drag Event.\r\n * \r\n * This event is dispatched by an interactive Game Object if a pointer moves while dragging it.\r\n * \r\n * Listen to this event from a Game Object using: `gameObject.on('drag', listener)`.\r\n * Note that the scope of the listener is automatically set to be the Game Object instance itself.\r\n * \r\n * To receive this event, the Game Object must have been set as interactive and enabled for drag.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_DRAG\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {number} dragX - The x coordinate where the Pointer is currently dragging the Game Object, in world space.\r\n * @param {number} dragY - The y coordinate where the Pointer is currently dragging the Game Object, in world space.\r\n */\r\nmodule.exports = 'drag';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_LEAVE_EVENT.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_LEAVE_EVENT.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Drag Leave Event.\r\n * \r\n * This event is dispatched by an interactive Game Object if a pointer drags it out of a drag target.\r\n * \r\n * Listen to this event from a Game Object using: `gameObject.on('dragleave', listener)`.\r\n * Note that the scope of the listener is automatically set to be the Game Object instance itself.\r\n * \r\n * To receive this event, the Game Object must have been set as interactive and enabled for drag.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_DRAG_LEAVE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has left.\r\n */\r\nmodule.exports = 'dragleave';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_LEAVE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_OVER_EVENT.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_OVER_EVENT.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Drag Over Event.\r\n * \r\n * This event is dispatched by an interactive Game Object if a pointer drags it over a drag target.\r\n * \r\n * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within\r\n * the drag target, it will emit this event instead.\r\n * \r\n * Listen to this event from a Game Object using: `gameObject.on('dragover', listener)`.\r\n * Note that the scope of the listener is automatically set to be the Game Object instance itself.\r\n * \r\n * To receive this event, the Game Object must have been set as interactive and enabled for drag.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_DRAG_OVER\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved over.\r\n */\r\nmodule.exports = 'dragover';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_OVER_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_START_EVENT.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_START_EVENT.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Drag Start Event.\r\n * \r\n * This event is dispatched by an interactive Game Object if a pointer starts to drag it.\r\n * \r\n * Listen to this event from a Game Object using: `gameObject.on('dragstart', listener)`.\r\n * Note that the scope of the listener is automatically set to be the Game Object instance itself.\r\n * \r\n * To receive this event, the Game Object must have been set as interactive and enabled for drag.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n * \r\n * There are lots of useful drag related properties that are set within the Game Object when dragging occurs.\r\n * For example, `gameObject.input.dragStartX`, `dragStartY` and so on.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_DRAG_START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {number} dragX - The x coordinate where the Pointer is currently dragging the Game Object, in world space.\r\n * @param {number} dragY - The y coordinate where the Pointer is currently dragging the Game Object, in world space.\r\n */\r\nmodule.exports = 'dragstart';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_DROP_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_DROP_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Drop Event.\r\n * \r\n * This event is dispatched by an interactive Game Object if a pointer drops it on a Drag Target.\r\n * \r\n * Listen to this event from a Game Object using: `gameObject.on('drop', listener)`.\r\n * Note that the scope of the listener is automatically set to be the Game Object instance itself.\r\n * \r\n * To receive this event, the Game Object must have been set as interactive and enabled for drag.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_DROP\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} target - The Drag Target the `gameObject` has been dropped on.\r\n */\r\nmodule.exports = 'drop';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_DROP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_MOVE_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_MOVE_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Move Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved across _any_ interactive Game Object.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('gameobjectmove', listener)`.\r\n * \r\n * To receive this event, the Game Objects must have been set as interactive.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n * \r\n * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} event instead.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE}\r\n * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE}\r\n * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_MOVE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was moved on.\r\n * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow.\r\n */\r\nmodule.exports = 'gameobjectmove';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_MOVE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_OUT_EVENT.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_OUT_EVENT.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Out Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of _any_ interactive Game Object.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('gameobjectout', listener)`.\r\n * \r\n * To receive this event, the Game Objects must have been set as interactive.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n * \r\n * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} event instead.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT}\r\n * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT}\r\n * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_OUT\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer moved out of.\r\n * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow.\r\n */\r\nmodule.exports = 'gameobjectout';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_OUT_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_OVER_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_OVER_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Over Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over _any_ interactive Game Object.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('gameobjectover', listener)`.\r\n * \r\n * To receive this event, the Game Objects must have been set as interactive.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n * \r\n * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} event instead.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER}\r\n * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER}\r\n * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_OVER\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer moved over.\r\n * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow.\r\n */\r\nmodule.exports = 'gameobjectover';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_OVER_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_DOWN_EVENT.js": /*!*******************************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_DOWN_EVENT.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Pointer Down Event.\r\n * \r\n * This event is dispatched by an interactive Game Object if a pointer is pressed down on it.\r\n * \r\n * Listen to this event from a Game Object using: `gameObject.on('pointerdown', listener)`.\r\n * Note that the scope of the listener is automatically set to be the Game Object instance itself.\r\n * \r\n * To receive this event, the Game Object must have been set as interactive.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN}\r\n * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN}\r\n * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_POINTER_DOWN\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.\r\n * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.\r\n * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow.\r\n */\r\nmodule.exports = 'pointerdown';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_DOWN_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_MOVE_EVENT.js": /*!*******************************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_MOVE_EVENT.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Pointer Move Event.\r\n * \r\n * This event is dispatched by an interactive Game Object if a pointer is moved while over it.\r\n * \r\n * Listen to this event from a Game Object using: `gameObject.on('pointermove', listener)`.\r\n * Note that the scope of the listener is automatically set to be the Game Object instance itself.\r\n * \r\n * To receive this event, the Game Object must have been set as interactive.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE}\r\n * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE}\r\n * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_POINTER_MOVE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.\r\n * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.\r\n * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow.\r\n */\r\nmodule.exports = 'pointermove';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_MOVE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_OUT_EVENT.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_OUT_EVENT.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Pointer Out Event.\r\n * \r\n * This event is dispatched by an interactive Game Object if a pointer moves out of it.\r\n * \r\n * Listen to this event from a Game Object using: `gameObject.on('pointerout', listener)`.\r\n * Note that the scope of the listener is automatically set to be the Game Object instance itself.\r\n * \r\n * To receive this event, the Game Object must have been set as interactive.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT}\r\n * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT}\r\n * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_POINTER_OUT\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow.\r\n */\r\nmodule.exports = 'pointerout';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_OUT_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_OVER_EVENT.js": /*!*******************************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_OVER_EVENT.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Pointer Over Event.\r\n * \r\n * This event is dispatched by an interactive Game Object if a pointer moves over it.\r\n * \r\n * Listen to this event from a Game Object using: `gameObject.on('pointerover', listener)`.\r\n * Note that the scope of the listener is automatically set to be the Game Object instance itself.\r\n * \r\n * To receive this event, the Game Object must have been set as interactive.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER}\r\n * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER}\r\n * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_POINTER_OVER\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.\r\n * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.\r\n * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow.\r\n */\r\nmodule.exports = 'pointerover';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_OVER_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_UP_EVENT.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_UP_EVENT.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Pointer Up Event.\r\n * \r\n * This event is dispatched by an interactive Game Object if a pointer is released while over it.\r\n * \r\n * Listen to this event from a Game Object using: `gameObject.on('pointerup', listener)`.\r\n * Note that the scope of the listener is automatically set to be the Game Object instance itself.\r\n * \r\n * To receive this event, the Game Object must have been set as interactive.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP}\r\n * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP}\r\n * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_POINTER_UP\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.\r\n * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.\r\n * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow.\r\n */\r\nmodule.exports = 'pointerup';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_UP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_WHEEL_EVENT.js": /*!********************************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_WHEEL_EVENT.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Pointer Wheel Event.\r\n * \r\n * This event is dispatched by an interactive Game Object if a pointer has its wheel moved while over it.\r\n * \r\n * Listen to this event from a Game Object using: `gameObject.on('wheel', listener)`.\r\n * Note that the scope of the listener is automatically set to be the Game Object instance itself.\r\n * \r\n * To receive this event, the Game Object must have been set as interactive.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL}\r\n * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL}\r\n * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_POINTER_WHEEL\r\n * @since 3.18.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {number} deltaX - The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device.\r\n * @param {number} deltaY - The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down.\r\n * @param {number} deltaZ - The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device.\r\n * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow.\r\n */\r\nmodule.exports = 'wheel';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_WHEEL_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_UP_EVENT.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_UP_EVENT.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Up Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released while over _any_ interactive Game Object.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('gameobjectup', listener)`.\r\n * \r\n * To receive this event, the Game Objects must have been set as interactive.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n * \r\n * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} event instead.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP}\r\n * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP}\r\n * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_UP\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was over when released.\r\n * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow.\r\n */\r\nmodule.exports = 'gameobjectup';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_UP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAMEOBJECT_WHEEL_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAMEOBJECT_WHEEL_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Wheel Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel moved while over _any_ interactive Game Object.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('gameobjectwheel', listener)`.\r\n * \r\n * To receive this event, the Game Objects must have been set as interactive.\r\n * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details.\r\n * \r\n * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} event instead.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL}\r\n * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL}\r\n * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#GAMEOBJECT_WHEEL\r\n * @since 3.18.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was over when the wheel changed.\r\n * @param {number} deltaX - The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device.\r\n * @param {number} deltaY - The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down.\r\n * @param {number} deltaZ - The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device.\r\n * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow.\r\n */\r\nmodule.exports = 'gameobjectwheel';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAMEOBJECT_WHEEL_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAME_OUT_EVENT.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAME_OUT_EVENT.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Input Plugin Game Out Event.\r\n * \r\n * This event is dispatched by the Input Plugin if the active pointer leaves the game canvas and is now\r\n * outside of it, elsewhere on the web page.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('gameout', listener)`.\r\n *\r\n * @event Phaser.Input.Events#GAME_OUT\r\n * @since 3.16.1\r\n * \r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {(MouseEvent|TouchEvent)} event - The DOM Event that triggered the canvas out.\r\n */\r\nmodule.exports = 'gameout';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAME_OUT_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/GAME_OVER_EVENT.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/input/events/GAME_OVER_EVENT.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Input Plugin Game Over Event.\r\n * \r\n * This event is dispatched by the Input Plugin if the active pointer enters the game canvas and is now\r\n * over of it, having previously been elsewhere on the web page.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('gameover', listener)`.\r\n *\r\n * @event Phaser.Input.Events#GAME_OVER\r\n * @since 3.16.1\r\n * \r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {(MouseEvent|TouchEvent)} event - The DOM Event that triggered the canvas over.\r\n */\r\nmodule.exports = 'gameover';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/GAME_OVER_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/MANAGER_BOOT_EVENT.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/input/events/MANAGER_BOOT_EVENT.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Input Manager Boot Event.\r\n * \r\n * This internal event is dispatched by the Input Manager when it boots.\r\n *\r\n * @event Phaser.Input.Events#MANAGER_BOOT\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'boot';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/MANAGER_BOOT_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/MANAGER_PROCESS_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/input/events/MANAGER_PROCESS_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Input Manager Process Event.\r\n * \r\n * This internal event is dispatched by the Input Manager when not using the legacy queue system,\r\n * and it wants the Input Plugins to update themselves.\r\n *\r\n * @event Phaser.Input.Events#MANAGER_PROCESS\r\n * @since 3.0.0\r\n * \r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'process';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/MANAGER_PROCESS_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/MANAGER_UPDATE_EVENT.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/input/events/MANAGER_UPDATE_EVENT.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Input Manager Update Event.\r\n * \r\n * This internal event is dispatched by the Input Manager as part of its update step.\r\n *\r\n * @event Phaser.Input.Events#MANAGER_UPDATE\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'update';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/MANAGER_UPDATE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/POINTERLOCK_CHANGE_EVENT.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/input/events/POINTERLOCK_CHANGE_EVENT.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Input Manager Pointer Lock Change Event.\r\n * \r\n * This event is dispatched by the Input Manager when it is processing a native Pointer Lock Change DOM Event.\r\n *\r\n * @event Phaser.Input.Events#POINTERLOCK_CHANGE\r\n * @since 3.0.0\r\n * \r\n * @param {Event} event - The native DOM Event.\r\n * @param {boolean} locked - The locked state of the Mouse Pointer.\r\n */\r\nmodule.exports = 'pointerlockchange';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/POINTERLOCK_CHANGE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/POINTER_DOWN_EVENT.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/input/events/POINTER_DOWN_EVENT.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pointer Down Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('pointerdown', listener)`.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN}\r\n * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN}\r\n * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#POINTER_DOWN\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created.\r\n */\r\nmodule.exports = 'pointerdown';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/POINTER_DOWN_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/POINTER_DOWN_OUTSIDE_EVENT.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/input/events/POINTER_DOWN_OUTSIDE_EVENT.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pointer Down Outside Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere outside of the game canvas.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('pointerdownoutside', listener)`.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN}\r\n * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN}\r\n * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#POINTER_DOWN_OUTSIDE\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n */\r\nmodule.exports = 'pointerdownoutside';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/POINTER_DOWN_OUTSIDE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/POINTER_MOVE_EVENT.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/input/events/POINTER_MOVE_EVENT.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pointer Move Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved anywhere.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('pointermove', listener)`.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE}\r\n * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE}\r\n * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#POINTER_MOVE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created.\r\n */\r\nmodule.exports = 'pointermove';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/POINTER_MOVE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/POINTER_OUT_EVENT.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/input/events/POINTER_OUT_EVENT.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pointer Out Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of any interactive Game Object.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('pointerout', listener)`.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT}\r\n * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT}\r\n * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#POINTER_OUT\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject[]} justOut - An array containing all interactive Game Objects that the pointer moved out of when the event was created.\r\n */\r\nmodule.exports = 'pointerout';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/POINTER_OUT_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/POINTER_OVER_EVENT.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/input/events/POINTER_OVER_EVENT.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pointer Over Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over any interactive Game Object.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('pointerover', listener)`.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER}\r\n * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER}\r\n * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#POINTER_OVER\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject[]} justOver - An array containing all interactive Game Objects that the pointer moved over when the event was created.\r\n */\r\nmodule.exports = 'pointerover';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/POINTER_OVER_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/POINTER_UP_EVENT.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/input/events/POINTER_UP_EVENT.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pointer Up Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('pointerup', listener)`.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP}\r\n * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP}\r\n * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#POINTER_UP\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created.\r\n */\r\nmodule.exports = 'pointerup';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/POINTER_UP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/POINTER_UP_OUTSIDE_EVENT.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/input/events/POINTER_UP_OUTSIDE_EVENT.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pointer Up Outside Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere outside of the game canvas.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('pointerupoutside', listener)`.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP}\r\n * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP}\r\n * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#POINTER_UP_OUTSIDE\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n */\r\nmodule.exports = 'pointerupoutside';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/POINTER_UP_OUTSIDE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/POINTER_WHEEL_EVENT.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/input/events/POINTER_WHEEL_EVENT.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pointer Wheel Input Event.\r\n * \r\n * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel updated.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.on('wheel', listener)`.\r\n * \r\n * The event hierarchy is as follows:\r\n * \r\n * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL}\r\n * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL}\r\n * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL}\r\n * \r\n * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop\r\n * the propagation of this event.\r\n *\r\n * @event Phaser.Input.Events#POINTER_WHEEL\r\n * @since 3.18.0\r\n * \r\n * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event.\r\n * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created.\r\n * @param {number} deltaX - The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device.\r\n * @param {number} deltaY - The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down.\r\n * @param {number} deltaZ - The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device.\r\n */\r\nmodule.exports = 'wheel';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/POINTER_WHEEL_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/PRE_UPDATE_EVENT.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/input/events/PRE_UPDATE_EVENT.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Input Plugin Pre-Update Event.\r\n * \r\n * This internal event is dispatched by the Input Plugin at the start of its `preUpdate` method.\r\n * This hook is designed specifically for input plugins, but can also be listened to from user-land code.\r\n *\r\n * @event Phaser.Input.Events#PRE_UPDATE\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'preupdate';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/PRE_UPDATE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/SHUTDOWN_EVENT.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/input/events/SHUTDOWN_EVENT.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Input Plugin Shutdown Event.\r\n * \r\n * This internal event is dispatched by the Input Plugin when it shuts down, signalling to all of its systems to shut themselves down.\r\n *\r\n * @event Phaser.Input.Events#SHUTDOWN\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'shutdown';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/SHUTDOWN_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/START_EVENT.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/input/events/START_EVENT.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Input Plugin Start Event.\r\n * \r\n * This internal event is dispatched by the Input Plugin when it has finished setting-up,\r\n * signalling to all of its internal systems to start.\r\n *\r\n * @event Phaser.Input.Events#START\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'start';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/UPDATE_EVENT.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/input/events/UPDATE_EVENT.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Input Plugin Update Event.\r\n * \r\n * This internal event is dispatched by the Input Plugin at the start of its `update` method.\r\n * This hook is designed specifically for input plugins, but can also be listened to from user-land code.\r\n *\r\n * @event Phaser.Input.Events#UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'update';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/UPDATE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/events/index.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/input/events/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Input.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BOOT: __webpack_require__(/*! ./BOOT_EVENT */ \"./node_modules/phaser/src/input/events/BOOT_EVENT.js\"),\r\n DESTROY: __webpack_require__(/*! ./DESTROY_EVENT */ \"./node_modules/phaser/src/input/events/DESTROY_EVENT.js\"),\r\n DRAG_END: __webpack_require__(/*! ./DRAG_END_EVENT */ \"./node_modules/phaser/src/input/events/DRAG_END_EVENT.js\"),\r\n DRAG_ENTER: __webpack_require__(/*! ./DRAG_ENTER_EVENT */ \"./node_modules/phaser/src/input/events/DRAG_ENTER_EVENT.js\"),\r\n DRAG: __webpack_require__(/*! ./DRAG_EVENT */ \"./node_modules/phaser/src/input/events/DRAG_EVENT.js\"),\r\n DRAG_LEAVE: __webpack_require__(/*! ./DRAG_LEAVE_EVENT */ \"./node_modules/phaser/src/input/events/DRAG_LEAVE_EVENT.js\"),\r\n DRAG_OVER: __webpack_require__(/*! ./DRAG_OVER_EVENT */ \"./node_modules/phaser/src/input/events/DRAG_OVER_EVENT.js\"),\r\n DRAG_START: __webpack_require__(/*! ./DRAG_START_EVENT */ \"./node_modules/phaser/src/input/events/DRAG_START_EVENT.js\"),\r\n DROP: __webpack_require__(/*! ./DROP_EVENT */ \"./node_modules/phaser/src/input/events/DROP_EVENT.js\"),\r\n GAME_OUT: __webpack_require__(/*! ./GAME_OUT_EVENT */ \"./node_modules/phaser/src/input/events/GAME_OUT_EVENT.js\"),\r\n GAME_OVER: __webpack_require__(/*! ./GAME_OVER_EVENT */ \"./node_modules/phaser/src/input/events/GAME_OVER_EVENT.js\"),\r\n GAMEOBJECT_DOWN: __webpack_require__(/*! ./GAMEOBJECT_DOWN_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_DOWN_EVENT.js\"),\r\n GAMEOBJECT_DRAG_END: __webpack_require__(/*! ./GAMEOBJECT_DRAG_END_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_END_EVENT.js\"),\r\n GAMEOBJECT_DRAG_ENTER: __webpack_require__(/*! ./GAMEOBJECT_DRAG_ENTER_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_ENTER_EVENT.js\"),\r\n GAMEOBJECT_DRAG: __webpack_require__(/*! ./GAMEOBJECT_DRAG_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_EVENT.js\"),\r\n GAMEOBJECT_DRAG_LEAVE: __webpack_require__(/*! ./GAMEOBJECT_DRAG_LEAVE_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_LEAVE_EVENT.js\"),\r\n GAMEOBJECT_DRAG_OVER: __webpack_require__(/*! ./GAMEOBJECT_DRAG_OVER_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_OVER_EVENT.js\"),\r\n GAMEOBJECT_DRAG_START: __webpack_require__(/*! ./GAMEOBJECT_DRAG_START_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_DRAG_START_EVENT.js\"),\r\n GAMEOBJECT_DROP: __webpack_require__(/*! ./GAMEOBJECT_DROP_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_DROP_EVENT.js\"),\r\n GAMEOBJECT_MOVE: __webpack_require__(/*! ./GAMEOBJECT_MOVE_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_MOVE_EVENT.js\"),\r\n GAMEOBJECT_OUT: __webpack_require__(/*! ./GAMEOBJECT_OUT_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_OUT_EVENT.js\"),\r\n GAMEOBJECT_OVER: __webpack_require__(/*! ./GAMEOBJECT_OVER_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_OVER_EVENT.js\"),\r\n GAMEOBJECT_POINTER_DOWN: __webpack_require__(/*! ./GAMEOBJECT_POINTER_DOWN_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_DOWN_EVENT.js\"),\r\n GAMEOBJECT_POINTER_MOVE: __webpack_require__(/*! ./GAMEOBJECT_POINTER_MOVE_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_MOVE_EVENT.js\"),\r\n GAMEOBJECT_POINTER_OUT: __webpack_require__(/*! ./GAMEOBJECT_POINTER_OUT_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_OUT_EVENT.js\"),\r\n GAMEOBJECT_POINTER_OVER: __webpack_require__(/*! ./GAMEOBJECT_POINTER_OVER_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_OVER_EVENT.js\"),\r\n GAMEOBJECT_POINTER_UP: __webpack_require__(/*! ./GAMEOBJECT_POINTER_UP_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_UP_EVENT.js\"),\r\n GAMEOBJECT_POINTER_WHEEL: __webpack_require__(/*! ./GAMEOBJECT_POINTER_WHEEL_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_POINTER_WHEEL_EVENT.js\"),\r\n GAMEOBJECT_UP: __webpack_require__(/*! ./GAMEOBJECT_UP_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_UP_EVENT.js\"),\r\n GAMEOBJECT_WHEEL: __webpack_require__(/*! ./GAMEOBJECT_WHEEL_EVENT */ \"./node_modules/phaser/src/input/events/GAMEOBJECT_WHEEL_EVENT.js\"),\r\n MANAGER_BOOT: __webpack_require__(/*! ./MANAGER_BOOT_EVENT */ \"./node_modules/phaser/src/input/events/MANAGER_BOOT_EVENT.js\"),\r\n MANAGER_PROCESS: __webpack_require__(/*! ./MANAGER_PROCESS_EVENT */ \"./node_modules/phaser/src/input/events/MANAGER_PROCESS_EVENT.js\"),\r\n MANAGER_UPDATE: __webpack_require__(/*! ./MANAGER_UPDATE_EVENT */ \"./node_modules/phaser/src/input/events/MANAGER_UPDATE_EVENT.js\"),\r\n POINTER_DOWN: __webpack_require__(/*! ./POINTER_DOWN_EVENT */ \"./node_modules/phaser/src/input/events/POINTER_DOWN_EVENT.js\"),\r\n POINTER_DOWN_OUTSIDE: __webpack_require__(/*! ./POINTER_DOWN_OUTSIDE_EVENT */ \"./node_modules/phaser/src/input/events/POINTER_DOWN_OUTSIDE_EVENT.js\"),\r\n POINTER_MOVE: __webpack_require__(/*! ./POINTER_MOVE_EVENT */ \"./node_modules/phaser/src/input/events/POINTER_MOVE_EVENT.js\"),\r\n POINTER_OUT: __webpack_require__(/*! ./POINTER_OUT_EVENT */ \"./node_modules/phaser/src/input/events/POINTER_OUT_EVENT.js\"),\r\n POINTER_OVER: __webpack_require__(/*! ./POINTER_OVER_EVENT */ \"./node_modules/phaser/src/input/events/POINTER_OVER_EVENT.js\"),\r\n POINTER_UP: __webpack_require__(/*! ./POINTER_UP_EVENT */ \"./node_modules/phaser/src/input/events/POINTER_UP_EVENT.js\"),\r\n POINTER_UP_OUTSIDE: __webpack_require__(/*! ./POINTER_UP_OUTSIDE_EVENT */ \"./node_modules/phaser/src/input/events/POINTER_UP_OUTSIDE_EVENT.js\"),\r\n POINTER_WHEEL: __webpack_require__(/*! ./POINTER_WHEEL_EVENT */ \"./node_modules/phaser/src/input/events/POINTER_WHEEL_EVENT.js\"),\r\n POINTERLOCK_CHANGE: __webpack_require__(/*! ./POINTERLOCK_CHANGE_EVENT */ \"./node_modules/phaser/src/input/events/POINTERLOCK_CHANGE_EVENT.js\"),\r\n PRE_UPDATE: __webpack_require__(/*! ./PRE_UPDATE_EVENT */ \"./node_modules/phaser/src/input/events/PRE_UPDATE_EVENT.js\"),\r\n SHUTDOWN: __webpack_require__(/*! ./SHUTDOWN_EVENT */ \"./node_modules/phaser/src/input/events/SHUTDOWN_EVENT.js\"),\r\n START: __webpack_require__(/*! ./START_EVENT */ \"./node_modules/phaser/src/input/events/START_EVENT.js\"),\r\n UPDATE: __webpack_require__(/*! ./UPDATE_EVENT */ \"./node_modules/phaser/src/input/events/UPDATE_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/Axis.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/Axis.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * Contains information about a specific Gamepad Axis.\r\n * Axis objects are created automatically by the Gamepad as they are needed.\r\n *\r\n * @class Axis\r\n * @memberof Phaser.Input.Gamepad\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Gamepad.Gamepad} pad - A reference to the Gamepad that this Axis belongs to.\r\n * @param {integer} index - The index of this Axis.\r\n */\r\nvar Axis = new Class({\r\n\r\n initialize:\r\n\r\n function Axis (pad, index)\r\n {\r\n /**\r\n * A reference to the Gamepad that this Axis belongs to.\r\n *\r\n * @name Phaser.Input.Gamepad.Axis#pad\r\n * @type {Phaser.Input.Gamepad.Gamepad}\r\n * @since 3.0.0\r\n */\r\n this.pad = pad;\r\n\r\n /**\r\n * An event emitter to use to emit the axis events.\r\n *\r\n * @name Phaser.Input.Gamepad.Axis#events\r\n * @type {Phaser.Events.EventEmitter}\r\n * @since 3.0.0\r\n */\r\n this.events = pad.events;\r\n\r\n /**\r\n * The index of this Axis.\r\n *\r\n * @name Phaser.Input.Gamepad.Axis#index\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.index = index;\r\n\r\n /**\r\n * The raw axis value, between -1 and 1 with 0 being dead center.\r\n * Use the method `getValue` to get a normalized value with the threshold applied.\r\n *\r\n * @name Phaser.Input.Gamepad.Axis#value\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.value = 0;\r\n\r\n /**\r\n * Movement tolerance threshold below which axis values are ignored in `getValue`.\r\n *\r\n * @name Phaser.Input.Gamepad.Axis#threshold\r\n * @type {number}\r\n * @default 0.1\r\n * @since 3.0.0\r\n */\r\n this.threshold = 0.1;\r\n },\r\n\r\n /**\r\n * Internal update handler for this Axis.\r\n * Called automatically by the Gamepad as part of its update.\r\n *\r\n * @method Phaser.Input.Gamepad.Axis#update\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value of the axis movement.\r\n */\r\n update: function (value)\r\n {\r\n this.value = value;\r\n },\r\n\r\n /**\r\n * Applies the `threshold` value to the axis and returns it.\r\n *\r\n * @method Phaser.Input.Gamepad.Axis#getValue\r\n * @since 3.0.0\r\n *\r\n * @return {number} The axis value, adjusted for the movement threshold.\r\n */\r\n getValue: function ()\r\n {\r\n return (Math.abs(this.value) < this.threshold) ? 0 : this.value;\r\n },\r\n\r\n /**\r\n * Destroys this Axis instance and releases external references it holds.\r\n *\r\n * @method Phaser.Input.Gamepad.Axis#destroy\r\n * @since 3.10.0\r\n */\r\n destroy: function ()\r\n {\r\n this.pad = null;\r\n this.events = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Axis;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/Axis.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/Button.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/Button.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/input/gamepad/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * Contains information about a specific button on a Gamepad.\r\n * Button objects are created automatically by the Gamepad as they are needed.\r\n *\r\n * @class Button\r\n * @memberof Phaser.Input.Gamepad\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Gamepad.Gamepad} pad - A reference to the Gamepad that this Button belongs to.\r\n * @param {integer} index - The index of this Button.\r\n */\r\nvar Button = new Class({\r\n\r\n initialize:\r\n\r\n function Button (pad, index)\r\n {\r\n /**\r\n * A reference to the Gamepad that this Button belongs to.\r\n *\r\n * @name Phaser.Input.Gamepad.Button#pad\r\n * @type {Phaser.Input.Gamepad.Gamepad}\r\n * @since 3.0.0\r\n */\r\n this.pad = pad;\r\n\r\n /**\r\n * An event emitter to use to emit the button events.\r\n *\r\n * @name Phaser.Input.Gamepad.Button#events\r\n * @type {Phaser.Events.EventEmitter}\r\n * @since 3.0.0\r\n */\r\n this.events = pad.manager;\r\n\r\n /**\r\n * The index of this Button.\r\n *\r\n * @name Phaser.Input.Gamepad.Button#index\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.index = index;\r\n\r\n /**\r\n * Between 0 and 1.\r\n *\r\n * @name Phaser.Input.Gamepad.Button#value\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.value = 0;\r\n\r\n /**\r\n * Can be set for analogue buttons to enable a 'pressure' threshold,\r\n * before a button is considered as being 'pressed'.\r\n *\r\n * @name Phaser.Input.Gamepad.Button#threshold\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.threshold = 1;\r\n\r\n /**\r\n * Is the Button being pressed down or not?\r\n *\r\n * @name Phaser.Input.Gamepad.Button#pressed\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.pressed = false;\r\n },\r\n\r\n /**\r\n * Internal update handler for this Button.\r\n * Called automatically by the Gamepad as part of its update.\r\n *\r\n * @method Phaser.Input.Gamepad.Button#update\r\n * @fires Phaser.Input.Gamepad.Events#BUTTON_DOWN\r\n * @fires Phaser.Input.Gamepad.Events#BUTTON_UP\r\n * @fires Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_DOWN\r\n * @fires Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_UP\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value of the button. Between 0 and 1.\r\n */\r\n update: function (value)\r\n {\r\n this.value = value;\r\n\r\n var pad = this.pad;\r\n var index = this.index;\r\n\r\n if (value >= this.threshold)\r\n {\r\n if (!this.pressed)\r\n {\r\n this.pressed = true;\r\n this.events.emit(Events.BUTTON_DOWN, pad, this, value);\r\n this.pad.emit(Events.GAMEPAD_BUTTON_DOWN, index, value, this);\r\n }\r\n }\r\n else if (this.pressed)\r\n {\r\n this.pressed = false;\r\n this.events.emit(Events.BUTTON_UP, pad, this, value);\r\n this.pad.emit(Events.GAMEPAD_BUTTON_UP, index, value, this);\r\n }\r\n },\r\n\r\n /**\r\n * Destroys this Button instance and releases external references it holds.\r\n *\r\n * @method Phaser.Input.Gamepad.Button#destroy\r\n * @since 3.10.0\r\n */\r\n destroy: function ()\r\n {\r\n this.pad = null;\r\n this.events = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Button;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/Button.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/Gamepad.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/Gamepad.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Axis = __webpack_require__(/*! ./Axis */ \"./node_modules/phaser/src/input/gamepad/Axis.js\");\r\nvar Button = __webpack_require__(/*! ./Button */ \"./node_modules/phaser/src/input/gamepad/Button.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Gamepad.\r\n *\r\n * These are created, updated and managed by the Gamepad Plugin.\r\n *\r\n * @class Gamepad\r\n * @extends Phaser.Events.EventEmitter\r\n * @memberof Phaser.Input.Gamepad\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Gamepad.GamepadPlugin} manager - A reference to the Gamepad Plugin.\r\n * @param {Phaser.Types.Input.Gamepad.Pad} pad - The Gamepad object, as extracted from GamepadEvent.\r\n */\r\nvar Gamepad = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function Gamepad (manager, pad)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * A reference to the Gamepad Plugin.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#manager\r\n * @type {Phaser.Input.Gamepad.GamepadPlugin}\r\n * @since 3.0.0\r\n */\r\n this.manager = manager;\r\n\r\n /**\r\n * A reference to the native Gamepad object that is connected to the browser.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#pad\r\n * @type {any}\r\n * @since 3.10.0\r\n */\r\n this.pad = pad;\r\n\r\n /**\r\n * A string containing some information about the controller.\r\n *\r\n * This is not strictly specified, but in Firefox it will contain three pieces of information\r\n * separated by dashes (-): two 4-digit hexadecimal strings containing the USB vendor and\r\n * product id of the controller, and the name of the controller as provided by the driver.\r\n * In Chrome it will contain the name of the controller as provided by the driver,\r\n * followed by vendor and product 4-digit hexadecimal strings.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#id\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.id = pad.id;\r\n\r\n /**\r\n * An integer that is unique for each Gamepad currently connected to the system.\r\n * This can be used to distinguish multiple controllers.\r\n * Note that disconnecting a device and then connecting a new device may reuse the previous index.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#index\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.index = pad.index;\r\n\r\n var buttons = [];\r\n\r\n for (var i = 0; i < pad.buttons.length; i++)\r\n {\r\n buttons.push(new Button(this, i));\r\n }\r\n\r\n /**\r\n * An array of Gamepad Button objects, corresponding to the different buttons available on the Gamepad.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#buttons\r\n * @type {Phaser.Input.Gamepad.Button[]}\r\n * @since 3.0.0\r\n */\r\n this.buttons = buttons;\r\n\r\n var axes = [];\r\n\r\n for (i = 0; i < pad.axes.length; i++)\r\n {\r\n axes.push(new Axis(this, i));\r\n }\r\n\r\n /**\r\n * An array of Gamepad Axis objects, corresponding to the different axes available on the Gamepad, if any.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#axes\r\n * @type {Phaser.Input.Gamepad.Axis[]}\r\n * @since 3.0.0\r\n */\r\n this.axes = axes;\r\n\r\n /**\r\n * The Gamepad's Haptic Actuator (Vibration / Rumble support).\r\n * This is highly experimental and only set if both present on the device,\r\n * and exposed by both the hardware and browser.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#vibration\r\n * @type {GamepadHapticActuator}\r\n * @since 3.10.0\r\n */\r\n this.vibration = pad.vibrationActuator;\r\n\r\n // https://w3c.github.io/gamepad/#remapping\r\n\r\n var _noButton = { value: 0, pressed: false };\r\n\r\n /**\r\n * A reference to the Left Button in the Left Cluster.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_LCLeft\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._LCLeft = (buttons[14]) ? buttons[14] : _noButton;\r\n\r\n /**\r\n * A reference to the Right Button in the Left Cluster.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_LCRight\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._LCRight = (buttons[15]) ? buttons[15] : _noButton;\r\n\r\n /**\r\n * A reference to the Top Button in the Left Cluster.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_LCTop\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._LCTop = (buttons[12]) ? buttons[12] : _noButton;\r\n\r\n /**\r\n * A reference to the Bottom Button in the Left Cluster.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_LCBottom\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._LCBottom = (buttons[13]) ? buttons[13] : _noButton;\r\n\r\n /**\r\n * A reference to the Left Button in the Right Cluster.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_RCLeft\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._RCLeft = (buttons[2]) ? buttons[2] : _noButton;\r\n\r\n /**\r\n * A reference to the Right Button in the Right Cluster.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_RCRight\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._RCRight = (buttons[1]) ? buttons[1] : _noButton;\r\n\r\n /**\r\n * A reference to the Top Button in the Right Cluster.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_RCTop\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._RCTop = (buttons[3]) ? buttons[3] : _noButton;\r\n\r\n /**\r\n * A reference to the Bottom Button in the Right Cluster.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_RCBottom\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._RCBottom = (buttons[0]) ? buttons[0] : _noButton;\r\n\r\n /**\r\n * A reference to the Top Left Front Button (L1 Shoulder Button)\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_FBLeftTop\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._FBLeftTop = (buttons[4]) ? buttons[4] : _noButton;\r\n\r\n /**\r\n * A reference to the Bottom Left Front Button (L2 Shoulder Button)\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_FBLeftBottom\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._FBLeftBottom = (buttons[6]) ? buttons[6] : _noButton;\r\n\r\n /**\r\n * A reference to the Top Right Front Button (R1 Shoulder Button)\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_FBRightTop\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._FBRightTop = (buttons[5]) ? buttons[5] : _noButton;\r\n\r\n /**\r\n * A reference to the Bottom Right Front Button (R2 Shoulder Button)\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_FBRightBottom\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._FBRightBottom = (buttons[7]) ? buttons[7] : _noButton;\r\n\r\n var _noAxis = { value: 0 };\r\n\r\n /**\r\n * A reference to the Horizontal Axis for the Left Stick.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_HAxisLeft\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._HAxisLeft = (axes[0]) ? axes[0] : _noAxis;\r\n\r\n /**\r\n * A reference to the Vertical Axis for the Left Stick.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_VAxisLeft\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._VAxisLeft = (axes[1]) ? axes[1] : _noAxis;\r\n\r\n /**\r\n * A reference to the Horizontal Axis for the Right Stick.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_HAxisRight\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._HAxisRight = (axes[2]) ? axes[2] : _noAxis;\r\n\r\n /**\r\n * A reference to the Vertical Axis for the Right Stick.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#_VAxisRight\r\n * @type {Phaser.Input.Gamepad.Button}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._VAxisRight = (axes[3]) ? axes[3] : _noAxis;\r\n\r\n /**\r\n * A Vector2 containing the most recent values from the Gamepad's left axis stick.\r\n * This is updated automatically as part of the Gamepad.update cycle.\r\n * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property.\r\n * The values are based on the Axis thresholds.\r\n * If the Gamepad does not have a left axis stick, the values will always be zero.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#leftStick\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.10.0\r\n */\r\n this.leftStick = new Vector2();\r\n\r\n /**\r\n * A Vector2 containing the most recent values from the Gamepad's right axis stick.\r\n * This is updated automatically as part of the Gamepad.update cycle.\r\n * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property.\r\n * The values are based on the Axis thresholds.\r\n * If the Gamepad does not have a right axis stick, the values will always be zero.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#rightStick\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.10.0\r\n */\r\n this.rightStick = new Vector2();\r\n },\r\n\r\n /**\r\n * Gets the total number of axis this Gamepad claims to support.\r\n *\r\n * @method Phaser.Input.Gamepad.Gamepad#getAxisTotal\r\n * @since 3.10.0\r\n *\r\n * @return {integer} The total number of axes this Gamepad claims to support.\r\n */\r\n getAxisTotal: function ()\r\n {\r\n return this.axes.length;\r\n },\r\n\r\n /**\r\n * Gets the value of an axis based on the given index.\r\n * The index must be valid within the range of axes supported by this Gamepad.\r\n * The return value will be a float between 0 and 1.\r\n *\r\n * @method Phaser.Input.Gamepad.Gamepad#getAxisValue\r\n * @since 3.10.0\r\n *\r\n * @param {integer} index - The index of the axes to get the value for.\r\n *\r\n * @return {number} The value of the axis, between 0 and 1.\r\n */\r\n getAxisValue: function (index)\r\n {\r\n return this.axes[index].getValue();\r\n },\r\n\r\n /**\r\n * Sets the threshold value of all axis on this Gamepad.\r\n * The value is a float between 0 and 1 and is the amount below which the axis is considered as not having been moved.\r\n *\r\n * @method Phaser.Input.Gamepad.Gamepad#setAxisThreshold\r\n * @since 3.10.0\r\n *\r\n * @param {number} value - A value between 0 and 1.\r\n */\r\n setAxisThreshold: function (value)\r\n {\r\n for (var i = 0; i < this.axes.length; i++)\r\n {\r\n this.axes[i].threshold = value;\r\n }\r\n },\r\n\r\n /**\r\n * Gets the total number of buttons this Gamepad claims to have.\r\n *\r\n * @method Phaser.Input.Gamepad.Gamepad#getButtonTotal\r\n * @since 3.10.0\r\n *\r\n * @return {integer} The total number of buttons this Gamepad claims to have.\r\n */\r\n getButtonTotal: function ()\r\n {\r\n return this.buttons.length;\r\n },\r\n\r\n /**\r\n * Gets the value of a button based on the given index.\r\n * The index must be valid within the range of buttons supported by this Gamepad.\r\n *\r\n * The return value will be either 0 or 1 for an analogue button, or a float between 0 and 1\r\n * for a pressure-sensitive digital button, such as the shoulder buttons on a Dual Shock.\r\n *\r\n * @method Phaser.Input.Gamepad.Gamepad#getButtonValue\r\n * @since 3.10.0\r\n *\r\n * @param {integer} index - The index of the button to get the value for.\r\n *\r\n * @return {number} The value of the button, between 0 and 1.\r\n */\r\n getButtonValue: function (index)\r\n {\r\n return this.buttons[index].value;\r\n },\r\n\r\n /**\r\n * Returns if the button is pressed down or not.\r\n * The index must be valid within the range of buttons supported by this Gamepad.\r\n *\r\n * @method Phaser.Input.Gamepad.Gamepad#isButtonDown\r\n * @since 3.10.0\r\n *\r\n * @param {integer} index - The index of the button to get the value for.\r\n *\r\n * @return {boolean} `true` if the button is considered as being pressed down, otherwise `false`.\r\n */\r\n isButtonDown: function (index)\r\n {\r\n return this.buttons[index].pressed;\r\n },\r\n\r\n /**\r\n * Internal update handler for this Gamepad.\r\n * Called automatically by the Gamepad Manager as part of its update.\r\n *\r\n * @method Phaser.Input.Gamepad.Gamepad#update\r\n * @private\r\n * @since 3.0.0\r\n */\r\n update: function (pad)\r\n {\r\n var i;\r\n\r\n // Sync the button values\r\n\r\n var localButtons = this.buttons;\r\n var gamepadButtons = pad.buttons;\r\n\r\n var len = localButtons.length;\r\n\r\n for (i = 0; i < len; i++)\r\n {\r\n localButtons[i].update(gamepadButtons[i].value);\r\n }\r\n\r\n // Sync the axis values\r\n\r\n var localAxes = this.axes;\r\n var gamepadAxes = pad.axes;\r\n\r\n len = localAxes.length;\r\n\r\n for (i = 0; i < len; i++)\r\n {\r\n localAxes[i].update(gamepadAxes[i]);\r\n }\r\n\r\n if (len >= 2)\r\n {\r\n this.leftStick.set(localAxes[0].getValue(), localAxes[1].getValue());\r\n\r\n if (len >= 4)\r\n {\r\n this.rightStick.set(localAxes[2].getValue(), localAxes[3].getValue());\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Destroys this Gamepad instance, its buttons and axes, and releases external references it holds.\r\n *\r\n * @method Phaser.Input.Gamepad.Gamepad#destroy\r\n * @since 3.10.0\r\n */\r\n destroy: function ()\r\n {\r\n this.removeAllListeners();\r\n\r\n this.manager = null;\r\n this.pad = null;\r\n\r\n var i;\r\n\r\n for (i = 0; i < this.buttons.length; i++)\r\n {\r\n this.buttons[i].destroy();\r\n }\r\n\r\n for (i = 0; i < this.axes.length; i++)\r\n {\r\n this.axes[i].destroy();\r\n }\r\n\r\n this.buttons = [];\r\n this.axes = [];\r\n },\r\n\r\n /**\r\n * Is this Gamepad currently connected or not?\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#connected\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n connected: {\r\n\r\n get: function ()\r\n {\r\n return this.pad.connected;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * A timestamp containing the most recent time this Gamepad was updated.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#timestamp\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n timestamp: {\r\n\r\n get: function ()\r\n {\r\n return this.pad.timestamp;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Is the Gamepad's Left button being pressed?\r\n * If the Gamepad doesn't have this button it will always return false.\r\n * This is the d-pad left button under standard Gamepad mapping.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#left\r\n * @type {boolean}\r\n * @since 3.10.0\r\n */\r\n left: {\r\n\r\n get: function ()\r\n {\r\n return this._LCLeft.pressed;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Is the Gamepad's Right button being pressed?\r\n * If the Gamepad doesn't have this button it will always return false.\r\n * This is the d-pad right button under standard Gamepad mapping.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#right\r\n * @type {boolean}\r\n * @since 3.10.0\r\n */\r\n right: {\r\n\r\n get: function ()\r\n {\r\n return this._LCRight.pressed;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Is the Gamepad's Up button being pressed?\r\n * If the Gamepad doesn't have this button it will always return false.\r\n * This is the d-pad up button under standard Gamepad mapping.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#up\r\n * @type {boolean}\r\n * @since 3.10.0\r\n */\r\n up: {\r\n\r\n get: function ()\r\n {\r\n return this._LCTop.pressed;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Is the Gamepad's Down button being pressed?\r\n * If the Gamepad doesn't have this button it will always return false.\r\n * This is the d-pad down button under standard Gamepad mapping.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#down\r\n * @type {boolean}\r\n * @since 3.10.0\r\n */\r\n down: {\r\n\r\n get: function ()\r\n {\r\n return this._LCBottom.pressed;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Is the Gamepad's bottom button in the right button cluster being pressed?\r\n * If the Gamepad doesn't have this button it will always return false.\r\n * On a Dual Shock controller it's the X button.\r\n * On an XBox controller it's the A button.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#A\r\n * @type {boolean}\r\n * @since 3.10.0\r\n */\r\n A: {\r\n\r\n get: function ()\r\n {\r\n return this._RCBottom.pressed;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Is the Gamepad's top button in the right button cluster being pressed?\r\n * If the Gamepad doesn't have this button it will always return false.\r\n * On a Dual Shock controller it's the Triangle button.\r\n * On an XBox controller it's the Y button.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#Y\r\n * @type {boolean}\r\n * @since 3.10.0\r\n */\r\n Y: {\r\n\r\n get: function ()\r\n {\r\n return this._RCTop.pressed;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Is the Gamepad's left button in the right button cluster being pressed?\r\n * If the Gamepad doesn't have this button it will always return false.\r\n * On a Dual Shock controller it's the Square button.\r\n * On an XBox controller it's the X button.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#X\r\n * @type {boolean}\r\n * @since 3.10.0\r\n */\r\n X: {\r\n\r\n get: function ()\r\n {\r\n return this._RCLeft.pressed;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Is the Gamepad's right button in the right button cluster being pressed?\r\n * If the Gamepad doesn't have this button it will always return false.\r\n * On a Dual Shock controller it's the Circle button.\r\n * On an XBox controller it's the B button.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#B\r\n * @type {boolean}\r\n * @since 3.10.0\r\n */\r\n B: {\r\n\r\n get: function ()\r\n {\r\n return this._RCRight.pressed;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns the value of the Gamepad's top left shoulder button.\r\n * If the Gamepad doesn't have this button it will always return zero.\r\n * The value is a float between 0 and 1, corresponding to how depressed the button is.\r\n * On a Dual Shock controller it's the L1 button.\r\n * On an XBox controller it's the LB button.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#L1\r\n * @type {number}\r\n * @since 3.10.0\r\n */\r\n L1: {\r\n\r\n get: function ()\r\n {\r\n return this._FBLeftTop.value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns the value of the Gamepad's bottom left shoulder button.\r\n * If the Gamepad doesn't have this button it will always return zero.\r\n * The value is a float between 0 and 1, corresponding to how depressed the button is.\r\n * On a Dual Shock controller it's the L2 button.\r\n * On an XBox controller it's the LT button.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#L2\r\n * @type {number}\r\n * @since 3.10.0\r\n */\r\n L2: {\r\n\r\n get: function ()\r\n {\r\n return this._FBLeftBottom.value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns the value of the Gamepad's top right shoulder button.\r\n * If the Gamepad doesn't have this button it will always return zero.\r\n * The value is a float between 0 and 1, corresponding to how depressed the button is.\r\n * On a Dual Shock controller it's the R1 button.\r\n * On an XBox controller it's the RB button.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#R1\r\n * @type {number}\r\n * @since 3.10.0\r\n */\r\n R1: {\r\n\r\n get: function ()\r\n {\r\n return this._FBRightTop.value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns the value of the Gamepad's bottom right shoulder button.\r\n * If the Gamepad doesn't have this button it will always return zero.\r\n * The value is a float between 0 and 1, corresponding to how depressed the button is.\r\n * On a Dual Shock controller it's the R2 button.\r\n * On an XBox controller it's the RT button.\r\n *\r\n * @name Phaser.Input.Gamepad.Gamepad#R2\r\n * @type {number}\r\n * @since 3.10.0\r\n */\r\n R2: {\r\n\r\n get: function ()\r\n {\r\n return this._FBRightBottom.value;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Gamepad;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/Gamepad.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/GamepadPlugin.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/GamepadPlugin.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/input/gamepad/events/index.js\");\r\nvar Gamepad = __webpack_require__(/*! ./Gamepad */ \"./node_modules/phaser/src/input/gamepad/Gamepad.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar InputPluginCache = __webpack_require__(/*! ../InputPluginCache */ \"./node_modules/phaser/src/input/InputPluginCache.js\");\r\nvar InputEvents = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/input/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Gamepad Plugin is an input plugin that belongs to the Scene-owned Input system.\r\n *\r\n * Its role is to listen for native DOM Gamepad Events and then process them.\r\n *\r\n * You do not need to create this class directly, the Input system will create an instance of it automatically.\r\n *\r\n * You can access it from within a Scene using `this.input.gamepad`.\r\n *\r\n * To listen for a gamepad being connected:\r\n *\r\n * ```javascript\r\n * this.input.gamepad.once('connected', function (pad) {\r\n * // 'pad' is a reference to the gamepad that was just connected\r\n * });\r\n * ```\r\n *\r\n * Note that the browser may require you to press a button on a gamepad before it will allow you to access it,\r\n * this is for security reasons. However, it may also trust the page already, in which case you won't get the\r\n * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads\r\n * already connected.\r\n *\r\n * Once you have received the connected event, or polled the gamepads and found them enabled, you can access\r\n * them via the built-in properties `GamepadPlugin.pad1` to `pad4`, for up to 4 game pads. With a reference\r\n * to the gamepads you can poll its buttons and axis sticks. See the properties and methods available on\r\n * the `Gamepad` class for more details.\r\n *\r\n * For more information about Gamepad support in browsers see the following resources:\r\n *\r\n * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API\r\n * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API\r\n * https://www.smashingmagazine.com/2015/11/gamepad-api-in-web-games/\r\n * http://html5gamepad.com/\r\n *\r\n * @class GamepadPlugin\r\n * @extends Phaser.Events.EventEmitter\r\n * @memberof Phaser.Input.Gamepad\r\n * @constructor\r\n * @since 3.10.0\r\n *\r\n * @param {Phaser.Input.InputPlugin} sceneInputPlugin - A reference to the Scene Input Plugin that the KeyboardPlugin belongs to.\r\n */\r\nvar GamepadPlugin = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function GamepadPlugin (sceneInputPlugin)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * A reference to the Scene that this Input Plugin is responsible for.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.10.0\r\n */\r\n this.scene = sceneInputPlugin.scene;\r\n\r\n /**\r\n * A reference to the Scene Systems Settings.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#settings\r\n * @type {Phaser.Types.Scenes.SettingsObject}\r\n * @since 3.10.0\r\n */\r\n this.settings = this.scene.sys.settings;\r\n\r\n /**\r\n * A reference to the Scene Input Plugin that created this Keyboard Plugin.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#sceneInputPlugin\r\n * @type {Phaser.Input.InputPlugin}\r\n * @since 3.10.0\r\n */\r\n this.sceneInputPlugin = sceneInputPlugin;\r\n\r\n /**\r\n * A boolean that controls if the Gamepad Manager is enabled or not.\r\n * Can be toggled on the fly.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#enabled\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.10.0\r\n */\r\n this.enabled = true;\r\n\r\n /**\r\n * The Gamepad Event target, as defined in the Game Config.\r\n * Typically the browser window, but can be any interactive DOM element.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#target\r\n * @type {any}\r\n * @since 3.10.0\r\n */\r\n this.target;\r\n\r\n /**\r\n * An array of the connected Gamepads.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#gamepads\r\n * @type {Phaser.Input.Gamepad.Gamepad[]}\r\n * @default []\r\n * @since 3.10.0\r\n */\r\n this.gamepads = [];\r\n\r\n /**\r\n * An internal event queue.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#queue\r\n * @type {GamepadEvent[]}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this.queue = [];\r\n\r\n /**\r\n * Internal event handler.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#onGamepadHandler\r\n * @type {function}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this.onGamepadHandler;\r\n\r\n /**\r\n * Internal Gamepad reference.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#_pad1\r\n * @type {Phaser.Input.Gamepad.Gamepad}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._pad1;\r\n\r\n /**\r\n * Internal Gamepad reference.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#_pad2\r\n * @type {Phaser.Input.Gamepad.Gamepad}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._pad2;\r\n\r\n /**\r\n * Internal Gamepad reference.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#_pad3\r\n * @type {Phaser.Input.Gamepad.Gamepad}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._pad3;\r\n\r\n /**\r\n * Internal Gamepad reference.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#_pad4\r\n * @type {Phaser.Input.Gamepad.Gamepad}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this._pad4;\r\n\r\n sceneInputPlugin.pluginEvents.once(InputEvents.BOOT, this.boot, this);\r\n sceneInputPlugin.pluginEvents.on(InputEvents.START, this.start, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Input.Gamepad.GamepadPlugin#boot\r\n * @private\r\n * @since 3.10.0\r\n */\r\n boot: function ()\r\n {\r\n var game = this.scene.sys.game;\r\n var settings = this.settings.input;\r\n var config = game.config;\r\n\r\n this.enabled = GetValue(settings, 'gamepad', config.inputGamepad) && game.device.input.gamepads;\r\n this.target = GetValue(settings, 'gamepad.target', config.inputGamepadEventTarget);\r\n\r\n this.sceneInputPlugin.pluginEvents.once(InputEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Input.Gamepad.GamepadPlugin#start\r\n * @private\r\n * @since 3.10.0\r\n */\r\n start: function ()\r\n {\r\n if (this.enabled)\r\n {\r\n this.startListeners();\r\n }\r\n\r\n this.sceneInputPlugin.pluginEvents.once(InputEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * Checks to see if both this plugin and the Scene to which it belongs is active.\r\n *\r\n * @method Phaser.Input.Gamepad.GamepadPlugin#isActive\r\n * @since 3.10.0\r\n *\r\n * @return {boolean} `true` if the plugin and the Scene it belongs to is active.\r\n */\r\n isActive: function ()\r\n {\r\n return (this.enabled && this.scene.sys.isActive());\r\n },\r\n\r\n /**\r\n * Starts the Gamepad Event listeners running.\r\n * This is called automatically and does not need to be manually invoked.\r\n *\r\n * @method Phaser.Input.Gamepad.GamepadPlugin#startListeners\r\n * @private\r\n * @since 3.10.0\r\n */\r\n startListeners: function ()\r\n {\r\n var _this = this;\r\n var target = this.target;\r\n\r\n var handler = function (event)\r\n {\r\n if (event.defaultPrevented || !_this.isActive())\r\n {\r\n // Do nothing if event already handled\r\n return;\r\n }\r\n\r\n _this.refreshPads();\r\n\r\n _this.queue.push(event);\r\n };\r\n\r\n this.onGamepadHandler = handler;\r\n\r\n target.addEventListener('gamepadconnected', handler, false);\r\n target.addEventListener('gamepaddisconnected', handler, false);\r\n\r\n // FF also supports gamepadbuttondown, gamepadbuttonup and gamepadaxismove but\r\n // nothing else does, and we can get those values via the gamepads anyway, so we will\r\n // until more browsers support this\r\n\r\n // Finally, listen for an update event from the Input Plugin\r\n this.sceneInputPlugin.pluginEvents.on(InputEvents.UPDATE, this.update, this);\r\n },\r\n\r\n /**\r\n * Stops the Gamepad Event listeners.\r\n * This is called automatically and does not need to be manually invoked.\r\n *\r\n * @method Phaser.Input.Gamepad.GamepadPlugin#stopListeners\r\n * @private\r\n * @since 3.10.0\r\n */\r\n stopListeners: function ()\r\n {\r\n this.target.removeEventListener('gamepadconnected', this.onGamepadHandler);\r\n this.target.removeEventListener('gamepaddisconnected', this.onGamepadHandler);\r\n\r\n this.sceneInputPlugin.pluginEvents.off(InputEvents.UPDATE, this.update);\r\n },\r\n\r\n /**\r\n * Disconnects all current Gamepads.\r\n *\r\n * @method Phaser.Input.Gamepad.GamepadPlugin#disconnectAll\r\n * @since 3.10.0\r\n */\r\n disconnectAll: function ()\r\n {\r\n for (var i = 0; i < this.gamepads.length; i++)\r\n {\r\n this.gamepads.connected = false;\r\n }\r\n },\r\n\r\n /**\r\n * Refreshes the list of connected Gamepads.\r\n *\r\n * This is called automatically when a gamepad is connected or disconnected,\r\n * and during the update loop.\r\n *\r\n * @method Phaser.Input.Gamepad.GamepadPlugin#refreshPads\r\n * @private\r\n * @since 3.10.0\r\n */\r\n refreshPads: function ()\r\n {\r\n var connectedPads = navigator.getGamepads();\r\n\r\n if (!connectedPads)\r\n {\r\n this.disconnectAll();\r\n }\r\n else\r\n {\r\n var currentPads = this.gamepads;\r\n\r\n for (var i = 0; i < connectedPads.length; i++)\r\n {\r\n var livePad = connectedPads[i];\r\n\r\n // Because sometimes they're null (yes, really)\r\n if (!livePad)\r\n {\r\n continue;\r\n }\r\n\r\n var id = livePad.id;\r\n var index = livePad.index;\r\n var currentPad = currentPads[index];\r\n\r\n if (!currentPad)\r\n {\r\n // A new Gamepad, not currently stored locally\r\n var newPad = new Gamepad(this, livePad);\r\n\r\n currentPads[index] = newPad;\r\n\r\n if (!this._pad1)\r\n {\r\n this._pad1 = newPad;\r\n }\r\n else if (!this._pad2)\r\n {\r\n this._pad2 = newPad;\r\n }\r\n else if (!this._pad3)\r\n {\r\n this._pad3 = newPad;\r\n }\r\n else if (!this._pad4)\r\n {\r\n this._pad4 = newPad;\r\n }\r\n }\r\n else if (currentPad.id !== id)\r\n {\r\n // A new Gamepad with a different vendor string, but it has got the same index as an old one\r\n currentPad.destroy();\r\n\r\n currentPads[index] = new Gamepad(this, livePad);\r\n }\r\n else\r\n {\r\n // If neither of these, it's a pad we've already got, so update it\r\n currentPad.update(livePad);\r\n }\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Returns an array of all currently connected Gamepads.\r\n *\r\n * @method Phaser.Input.Gamepad.GamepadPlugin#getAll\r\n * @since 3.10.0\r\n *\r\n * @return {Phaser.Input.Gamepad.Gamepad[]} An array of all currently connected Gamepads.\r\n */\r\n getAll: function ()\r\n {\r\n var out = [];\r\n var pads = this.gamepads;\r\n\r\n for (var i = 0; i < pads.length; i++)\r\n {\r\n if (pads[i])\r\n {\r\n out.push(pads[i]);\r\n }\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Looks-up a single Gamepad based on the given index value.\r\n *\r\n * @method Phaser.Input.Gamepad.GamepadPlugin#getPad\r\n * @since 3.10.0\r\n *\r\n * @param {number} index - The index of the Gamepad to get.\r\n *\r\n * @return {Phaser.Input.Gamepad.Gamepad} The Gamepad matching the given index, or undefined if none were found.\r\n */\r\n getPad: function (index)\r\n {\r\n var pads = this.gamepads;\r\n\r\n for (var i = 0; i < pads.length; i++)\r\n {\r\n if (pads[i] && pads[i].index === index)\r\n {\r\n return pads[i];\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * The internal update loop. Refreshes all connected gamepads and processes their events.\r\n *\r\n * Called automatically by the Input Manager, invoked from the Game step.\r\n *\r\n * @method Phaser.Input.Gamepad.GamepadPlugin#update\r\n * @private\r\n * @fires Phaser.Input.Gamepad.Events#CONNECTED\r\n * @fires Phaser.Input.Gamepad.Events#DISCONNECTED\r\n * @since 3.10.0\r\n */\r\n update: function ()\r\n {\r\n if (!this.enabled)\r\n {\r\n return;\r\n }\r\n\r\n this.refreshPads();\r\n\r\n var len = this.queue.length;\r\n\r\n if (len === 0)\r\n {\r\n return;\r\n }\r\n\r\n var queue = this.queue.splice(0, len);\r\n\r\n // Process the event queue, dispatching all of the events that have stored up\r\n for (var i = 0; i < len; i++)\r\n {\r\n var event = queue[i];\r\n var pad = this.getPad(event.gamepad.index);\r\n\r\n if (event.type === 'gamepadconnected')\r\n {\r\n this.emit(Events.CONNECTED, pad, event);\r\n }\r\n else if (event.type === 'gamepaddisconnected')\r\n {\r\n this.emit(Events.DISCONNECTED, pad, event);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Shuts the Gamepad Plugin down.\r\n * All this does is remove any listeners bound to it.\r\n *\r\n * @method Phaser.Input.Gamepad.GamepadPlugin#shutdown\r\n * @private\r\n * @since 3.10.0\r\n */\r\n shutdown: function ()\r\n {\r\n this.stopListeners();\r\n\r\n this.disconnectAll();\r\n\r\n this.removeAllListeners();\r\n },\r\n\r\n /**\r\n * Destroys this Gamepad Plugin, disconnecting all Gamepads and releasing internal references.\r\n *\r\n * @method Phaser.Input.Gamepad.GamepadPlugin#destroy\r\n * @private\r\n * @since 3.10.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n for (var i = 0; i < this.gamepads.length; i++)\r\n {\r\n if (this.gamepads[i])\r\n {\r\n this.gamepads[i].destroy();\r\n }\r\n }\r\n\r\n this.gamepads = [];\r\n\r\n this.scene = null;\r\n this.settings = null;\r\n this.sceneInputPlugin = null;\r\n this.target = null;\r\n },\r\n\r\n /**\r\n * The total number of connected game pads.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#total\r\n * @type {integer}\r\n * @since 3.10.0\r\n */\r\n total: {\r\n\r\n get: function ()\r\n {\r\n return this.gamepads.length;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * A reference to the first connected Gamepad.\r\n *\r\n * This will be undefined if either no pads are connected, or the browser\r\n * has not yet issued a gamepadconnect, which can happen even if a Gamepad\r\n * is plugged in, but hasn't yet had any buttons pressed on it.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#pad1\r\n * @type {Phaser.Input.Gamepad.Gamepad}\r\n * @since 3.10.0\r\n */\r\n pad1: {\r\n\r\n get: function ()\r\n {\r\n return this._pad1;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * A reference to the second connected Gamepad.\r\n *\r\n * This will be undefined if either no pads are connected, or the browser\r\n * has not yet issued a gamepadconnect, which can happen even if a Gamepad\r\n * is plugged in, but hasn't yet had any buttons pressed on it.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#pad2\r\n * @type {Phaser.Input.Gamepad.Gamepad}\r\n * @since 3.10.0\r\n */\r\n pad2: {\r\n\r\n get: function ()\r\n {\r\n return this._pad2;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * A reference to the third connected Gamepad.\r\n *\r\n * This will be undefined if either no pads are connected, or the browser\r\n * has not yet issued a gamepadconnect, which can happen even if a Gamepad\r\n * is plugged in, but hasn't yet had any buttons pressed on it.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#pad3\r\n * @type {Phaser.Input.Gamepad.Gamepad}\r\n * @since 3.10.0\r\n */\r\n pad3: {\r\n\r\n get: function ()\r\n {\r\n return this._pad3;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * A reference to the fourth connected Gamepad.\r\n *\r\n * This will be undefined if either no pads are connected, or the browser\r\n * has not yet issued a gamepadconnect, which can happen even if a Gamepad\r\n * is plugged in, but hasn't yet had any buttons pressed on it.\r\n *\r\n * @name Phaser.Input.Gamepad.GamepadPlugin#pad4\r\n * @type {Phaser.Input.Gamepad.Gamepad}\r\n * @since 3.10.0\r\n */\r\n pad4: {\r\n\r\n get: function ()\r\n {\r\n return this._pad4;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\n/**\r\n * An instance of the Gamepad Plugin class, if enabled via the `input.gamepad` Scene or Game Config property.\r\n * Use this to create access Gamepads connected to the browser and respond to gamepad buttons.\r\n *\r\n * @name Phaser.Input.InputPlugin#gamepad\r\n * @type {?Phaser.Input.Gamepad.GamepadPlugin}\r\n * @since 3.10.0\r\n */\r\nInputPluginCache.register('GamepadPlugin', GamepadPlugin, 'gamepad', 'gamepad', 'inputGamepad');\r\n\r\nmodule.exports = GamepadPlugin;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/GamepadPlugin.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/configs/SNES_USB_Controller.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/configs/SNES_USB_Controller.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Tatar SNES USB Controller Gamepad Configuration.\r\n * USB Gamepad (STANDARD GAMEPAD Vendor: 0079 Product: 0011)\r\n *\r\n * @name Phaser.Input.Gamepad.Configs.SNES_USB\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\nmodule.exports = {\r\n\r\n UP: 12,\r\n DOWN: 13,\r\n LEFT: 14,\r\n RIGHT: 15,\r\n\r\n SELECT: 8,\r\n START: 9,\r\n\r\n B: 0,\r\n A: 1,\r\n Y: 2,\r\n X: 3,\r\n\r\n LEFT_SHOULDER: 4,\r\n RIGHT_SHOULDER: 5\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/configs/SNES_USB_Controller.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/configs/Sony_PlayStation_DualShock_4.js": /*!***************************************************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/configs/Sony_PlayStation_DualShock_4.js ***! \***************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * PlayStation DualShock 4 Gamepad Configuration.\r\n * Sony PlayStation DualShock 4 (v2) wireless controller\r\n *\r\n * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\nmodule.exports = {\r\n\r\n UP: 12,\r\n DOWN: 13,\r\n LEFT: 14,\r\n RIGHT: 15,\r\n\r\n SHARE: 8,\r\n OPTIONS: 9,\r\n PS: 16,\r\n TOUCHBAR: 17,\r\n\r\n X: 0,\r\n CIRCLE: 1,\r\n SQUARE: 2,\r\n TRIANGLE: 3,\r\n\r\n L1: 4,\r\n R1: 5,\r\n L2: 6,\r\n R2: 7,\r\n L3: 10,\r\n R3: 11,\r\n\r\n LEFT_STICK_H: 0,\r\n LEFT_STICK_V: 1,\r\n RIGHT_STICK_H: 2,\r\n RIGHT_STICK_V: 3\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/configs/Sony_PlayStation_DualShock_4.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/configs/XBox360_Controller.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/configs/XBox360_Controller.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * XBox 360 Gamepad Configuration.\r\n *\r\n * @name Phaser.Input.Gamepad.Configs.XBOX_360\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\nmodule.exports = {\r\n\r\n UP: 12,\r\n DOWN: 13,\r\n LEFT: 14,\r\n RIGHT: 15,\r\n\r\n MENU: 16,\r\n\r\n A: 0,\r\n B: 1,\r\n X: 2,\r\n Y: 3,\r\n\r\n LB: 4,\r\n RB: 5,\r\n\r\n LT: 6,\r\n RT: 7,\r\n\r\n BACK: 8,\r\n START: 9,\r\n\r\n LS: 10,\r\n RS: 11,\r\n\r\n LEFT_STICK_H: 0,\r\n LEFT_STICK_V: 1,\r\n RIGHT_STICK_H: 2,\r\n RIGHT_STICK_V: 3\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/configs/XBox360_Controller.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/configs/index.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/configs/index.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Input.Gamepad.Configs\r\n */\r\n\r\nmodule.exports = {\r\n\r\n DUALSHOCK_4: __webpack_require__(/*! ./Sony_PlayStation_DualShock_4 */ \"./node_modules/phaser/src/input/gamepad/configs/Sony_PlayStation_DualShock_4.js\"),\r\n SNES_USB: __webpack_require__(/*! ./SNES_USB_Controller */ \"./node_modules/phaser/src/input/gamepad/configs/SNES_USB_Controller.js\"),\r\n XBOX_360: __webpack_require__(/*! ./XBox360_Controller */ \"./node_modules/phaser/src/input/gamepad/configs/XBox360_Controller.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/configs/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/events/BUTTON_DOWN_EVENT.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/events/BUTTON_DOWN_EVENT.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Gamepad Button Down Event.\r\n * \r\n * This event is dispatched by the Gamepad Plugin when a button has been pressed on any active Gamepad.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.gamepad.on('down', listener)`.\r\n * \r\n * You can also listen for a DOWN event from a Gamepad instance. See the [GAMEPAD_BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_DOWN} event for details.\r\n *\r\n * @event Phaser.Input.Gamepad.Events#BUTTON_DOWN\r\n * @since 3.10.0\r\n * \r\n * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad on which the button was pressed.\r\n * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was pressed.\r\n * @param {number} value - The value of the button at the time it was pressed. Between 0 and 1. Some Gamepads have pressure-sensitive buttons.\r\n */\r\nmodule.exports = 'down';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/events/BUTTON_DOWN_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/events/BUTTON_UP_EVENT.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/events/BUTTON_UP_EVENT.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Gamepad Button Up Event.\r\n * \r\n * This event is dispatched by the Gamepad Plugin when a button has been released on any active Gamepad.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.gamepad.on('up', listener)`.\r\n * \r\n * You can also listen for an UP event from a Gamepad instance. See the [GAMEPAD_BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_UP} event for details.\r\n *\r\n * @event Phaser.Input.Gamepad.Events#BUTTON_UP\r\n * @since 3.10.0\r\n * \r\n * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad on which the button was released.\r\n * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was released.\r\n * @param {number} value - The value of the button at the time it was released. Between 0 and 1. Some Gamepads have pressure-sensitive buttons.\r\n */\r\nmodule.exports = 'up';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/events/BUTTON_UP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/events/CONNECTED_EVENT.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/events/CONNECTED_EVENT.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Gamepad Connected Event.\r\n * \r\n * This event is dispatched by the Gamepad Plugin when a Gamepad has been connected.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.gamepad.once('connected', listener)`.\r\n * \r\n * Note that the browser may require you to press a button on a gamepad before it will allow you to access it,\r\n * this is for security reasons. However, it may also trust the page already, in which case you won't get the\r\n * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads\r\n * already connected.\r\n *\r\n * @event Phaser.Input.Gamepad.Events#CONNECTED\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad which was connected.\r\n * @param {Event} event - The native DOM Event that triggered the connection.\r\n */\r\nmodule.exports = 'connected';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/events/CONNECTED_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/events/DISCONNECTED_EVENT.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/events/DISCONNECTED_EVENT.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Gamepad Disconnected Event.\r\n * \r\n * This event is dispatched by the Gamepad Plugin when a Gamepad has been disconnected.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.gamepad.once('disconnected', listener)`.\r\n *\r\n * @event Phaser.Input.Gamepad.Events#DISCONNECTED\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad which was disconnected.\r\n * @param {Event} event - The native DOM Event that triggered the disconnection.\r\n */\r\nmodule.exports = 'disconnected';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/events/DISCONNECTED_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/events/GAMEPAD_BUTTON_DOWN_EVENT.js": /*!***********************************************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/events/GAMEPAD_BUTTON_DOWN_EVENT.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Gamepad Button Down Event.\r\n * \r\n * This event is dispatched by a Gamepad instance when a button has been pressed on it.\r\n * \r\n * Listen to this event from a Gamepad instance. Once way to get this is from the `pad1`, `pad2`, etc properties on the Gamepad Plugin:\r\n * `this.input.gamepad.pad1.on('down', listener)`.\r\n * \r\n * Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'.\r\n * \r\n * You can also listen for a DOWN event from the Gamepad Plugin. See the [BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_DOWN} event for details.\r\n *\r\n * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_DOWN\r\n * @since 3.10.0\r\n * \r\n * @param {integer} index - The index of the button that was pressed.\r\n * @param {number} value - The value of the button at the time it was pressed. Between 0 and 1. Some Gamepads have pressure-sensitive buttons.\r\n * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was pressed.\r\n */\r\nmodule.exports = 'down';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/events/GAMEPAD_BUTTON_DOWN_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/events/GAMEPAD_BUTTON_UP_EVENT.js": /*!*********************************************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/events/GAMEPAD_BUTTON_UP_EVENT.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Gamepad Button Up Event.\r\n * \r\n * This event is dispatched by a Gamepad instance when a button has been released on it.\r\n * \r\n * Listen to this event from a Gamepad instance. Once way to get this is from the `pad1`, `pad2`, etc properties on the Gamepad Plugin:\r\n * `this.input.gamepad.pad1.on('up', listener)`.\r\n * \r\n * Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'.\r\n * \r\n * You can also listen for an UP event from the Gamepad Plugin. See the [BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_UP} event for details.\r\n *\r\n * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_UP\r\n * @since 3.10.0\r\n * \r\n * @param {integer} index - The index of the button that was released.\r\n * @param {number} value - The value of the button at the time it was released. Between 0 and 1. Some Gamepads have pressure-sensitive buttons.\r\n * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was released.\r\n */\r\nmodule.exports = 'up';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/events/GAMEPAD_BUTTON_UP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/events/index.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/events/index.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Input.Gamepad.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BUTTON_DOWN: __webpack_require__(/*! ./BUTTON_DOWN_EVENT */ \"./node_modules/phaser/src/input/gamepad/events/BUTTON_DOWN_EVENT.js\"),\r\n BUTTON_UP: __webpack_require__(/*! ./BUTTON_UP_EVENT */ \"./node_modules/phaser/src/input/gamepad/events/BUTTON_UP_EVENT.js\"),\r\n CONNECTED: __webpack_require__(/*! ./CONNECTED_EVENT */ \"./node_modules/phaser/src/input/gamepad/events/CONNECTED_EVENT.js\"),\r\n DISCONNECTED: __webpack_require__(/*! ./DISCONNECTED_EVENT */ \"./node_modules/phaser/src/input/gamepad/events/DISCONNECTED_EVENT.js\"),\r\n GAMEPAD_BUTTON_DOWN: __webpack_require__(/*! ./GAMEPAD_BUTTON_DOWN_EVENT */ \"./node_modules/phaser/src/input/gamepad/events/GAMEPAD_BUTTON_DOWN_EVENT.js\"),\r\n GAMEPAD_BUTTON_UP: __webpack_require__(/*! ./GAMEPAD_BUTTON_UP_EVENT */ \"./node_modules/phaser/src/input/gamepad/events/GAMEPAD_BUTTON_UP_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/gamepad/index.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/input/gamepad/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Input.Gamepad\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Axis: __webpack_require__(/*! ./Axis */ \"./node_modules/phaser/src/input/gamepad/Axis.js\"),\r\n Button: __webpack_require__(/*! ./Button */ \"./node_modules/phaser/src/input/gamepad/Button.js\"),\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/input/gamepad/events/index.js\"),\r\n Gamepad: __webpack_require__(/*! ./Gamepad */ \"./node_modules/phaser/src/input/gamepad/Gamepad.js\"),\r\n GamepadPlugin: __webpack_require__(/*! ./GamepadPlugin */ \"./node_modules/phaser/src/input/gamepad/GamepadPlugin.js\"),\r\n \r\n Configs: __webpack_require__(/*! ./configs/ */ \"./node_modules/phaser/src/input/gamepad/configs/index.js\")\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/gamepad/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/index.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/input/index.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/input/const.js\");\r\nvar Extend = __webpack_require__(/*! ../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\n\r\n/**\r\n * @namespace Phaser.Input\r\n */\r\n\r\nvar Input = {\r\n\r\n CreateInteractiveObject: __webpack_require__(/*! ./CreateInteractiveObject */ \"./node_modules/phaser/src/input/CreateInteractiveObject.js\"),\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/input/events/index.js\"),\r\n Gamepad: __webpack_require__(/*! ./gamepad */ \"./node_modules/phaser/src/input/gamepad/index.js\"),\r\n InputManager: __webpack_require__(/*! ./InputManager */ \"./node_modules/phaser/src/input/InputManager.js\"),\r\n InputPlugin: __webpack_require__(/*! ./InputPlugin */ \"./node_modules/phaser/src/input/InputPlugin.js\"),\r\n InputPluginCache: __webpack_require__(/*! ./InputPluginCache */ \"./node_modules/phaser/src/input/InputPluginCache.js\"),\r\n Keyboard: __webpack_require__(/*! ./keyboard */ \"./node_modules/phaser/src/input/keyboard/index.js\"),\r\n Mouse: __webpack_require__(/*! ./mouse */ \"./node_modules/phaser/src/input/mouse/index.js\"),\r\n Pointer: __webpack_require__(/*! ./Pointer */ \"./node_modules/phaser/src/input/Pointer.js\"),\r\n Touch: __webpack_require__(/*! ./touch */ \"./node_modules/phaser/src/input/touch/index.js\")\r\n\r\n};\r\n\r\n// Merge in the consts\r\nInput = Extend(false, Input, CONST);\r\n\r\nmodule.exports = Input;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/KeyboardManager.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/KeyboardManager.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ArrayRemove = __webpack_require__(/*! ../../utils/array/Remove */ \"./node_modules/phaser/src/utils/array/Remove.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GameEvents = __webpack_require__(/*! ../../core/events */ \"./node_modules/phaser/src/core/events/index.js\");\r\nvar InputEvents = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/input/events/index.js\");\r\nvar KeyCodes = __webpack_require__(/*! ../../input/keyboard/keys/KeyCodes */ \"./node_modules/phaser/src/input/keyboard/keys/KeyCodes.js\");\r\nvar NOOP = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Keyboard Manager is a helper class that belongs to the global Input Manager.\r\n * \r\n * Its role is to listen for native DOM Keyboard Events and then store them for further processing by the Keyboard Plugin.\r\n * \r\n * You do not need to create this class directly, the Input Manager will create an instance of it automatically if keyboard\r\n * input has been enabled in the Game Config.\r\n *\r\n * @class KeyboardManager\r\n * @memberof Phaser.Input.Keyboard\r\n * @constructor\r\n * @since 3.16.0\r\n *\r\n * @param {Phaser.Input.InputManager} inputManager - A reference to the Input Manager.\r\n */\r\nvar KeyboardManager = new Class({\r\n\r\n initialize:\r\n\r\n function KeyboardManager (inputManager)\r\n {\r\n /**\r\n * A reference to the Input Manager.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardManager#manager\r\n * @type {Phaser.Input.InputManager}\r\n * @since 3.16.0\r\n */\r\n this.manager = inputManager;\r\n\r\n /**\r\n * An internal event queue.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardManager#queue\r\n * @type {KeyboardEvent[]}\r\n * @private\r\n * @since 3.16.0\r\n */\r\n this.queue = [];\r\n\r\n /**\r\n * A flag that controls if the non-modified keys, matching those stored in the `captures` array,\r\n * have `preventDefault` called on them or not.\r\n * \r\n * A non-modified key is one that doesn't have a modifier key held down with it. The modifier keys are\r\n * shift, control, alt and the meta key (Command on a Mac, the Windows Key on Windows).\r\n * Therefore, if the user presses shift + r, it won't prevent this combination, because of the modifier.\r\n * However, if the user presses just the r key on its own, it will have its event prevented.\r\n * \r\n * If you wish to stop capturing the keys, for example switching out to a DOM based element, then\r\n * you can toggle this property at run-time.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardManager#preventDefault\r\n * @type {boolean}\r\n * @since 3.16.0\r\n */\r\n this.preventDefault = true;\r\n\r\n /**\r\n * An array of Key Code values that will automatically have `preventDefault` called on them,\r\n * as long as the `KeyboardManager.preventDefault` boolean is set to `true`.\r\n * \r\n * By default the array is empty.\r\n * \r\n * The key must be non-modified when pressed in order to be captured.\r\n * \r\n * A non-modified key is one that doesn't have a modifier key held down with it. The modifier keys are\r\n * shift, control, alt and the meta key (Command on a Mac, the Windows Key on Windows).\r\n * Therefore, if the user presses shift + r, it won't prevent this combination, because of the modifier.\r\n * However, if the user presses just the r key on its own, it will have its event prevented.\r\n * \r\n * If you wish to stop capturing the keys, for example switching out to a DOM based element, then\r\n * you can toggle the `KeyboardManager.preventDefault` boolean at run-time.\r\n * \r\n * If you need more specific control, you can create Key objects and set the flag on each of those instead.\r\n * \r\n * This array can be populated via the Game Config by setting the `input.keyboard.capture` array, or you\r\n * can call the `addCapture` method. See also `removeCapture` and `clearCaptures`.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardManager#captures\r\n * @type {integer[]}\r\n * @since 3.16.0\r\n */\r\n this.captures = [];\r\n\r\n /**\r\n * A boolean that controls if the Keyboard Manager is enabled or not.\r\n * Can be toggled on the fly.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardManager#enabled\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.16.0\r\n */\r\n this.enabled = false;\r\n\r\n /**\r\n * The Keyboard Event target, as defined in the Game Config.\r\n * Typically the window in which the game is rendering, but can be any interactive DOM element.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardManager#target\r\n * @type {any}\r\n * @since 3.16.0\r\n */\r\n this.target;\r\n\r\n /**\r\n * The Key Down Event handler.\r\n * This function is sent the native DOM KeyEvent.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardManager#onKeyDown\r\n * @type {function}\r\n * @since 3.16.00\r\n */\r\n this.onKeyDown = NOOP;\r\n\r\n /**\r\n * The Key Up Event handler.\r\n * This function is sent the native DOM KeyEvent.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardManager#onKeyUp\r\n * @type {function}\r\n * @since 3.16.00\r\n */\r\n this.onKeyUp = NOOP;\r\n\r\n inputManager.events.once(InputEvents.MANAGER_BOOT, this.boot, this);\r\n },\r\n\r\n /**\r\n * The Keyboard Manager boot process.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardManager#boot\r\n * @private\r\n * @since 3.16.0\r\n */\r\n boot: function ()\r\n {\r\n var config = this.manager.config;\r\n\r\n this.enabled = config.inputKeyboard;\r\n this.target = config.inputKeyboardEventTarget;\r\n\r\n this.addCapture(config.inputKeyboardCapture);\r\n\r\n if (!this.target && window)\r\n {\r\n this.target = window;\r\n }\r\n\r\n if (this.enabled && this.target)\r\n {\r\n this.startListeners();\r\n }\r\n\r\n this.manager.game.events.on(GameEvents.POST_STEP, this.postUpdate, this);\r\n },\r\n\r\n /**\r\n * Starts the Keyboard Event listeners running.\r\n * This is called automatically and does not need to be manually invoked.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardManager#startListeners\r\n * @since 3.16.0\r\n */\r\n startListeners: function ()\r\n {\r\n var _this = this;\r\n\r\n this.onKeyDown = function (event)\r\n {\r\n if (event.defaultPrevented || !_this.enabled || !_this.manager)\r\n {\r\n // Do nothing if event already handled\r\n return;\r\n }\r\n\r\n _this.queue.push(event);\r\n\r\n if (!_this.manager.useQueue)\r\n {\r\n _this.manager.events.emit(InputEvents.MANAGER_PROCESS);\r\n }\r\n \r\n var modified = (event.altKey || event.ctrlKey || event.shiftKey || event.metaKey);\r\n\r\n if (_this.preventDefault && !modified && _this.captures.indexOf(event.keyCode) > -1)\r\n {\r\n event.preventDefault();\r\n }\r\n };\r\n\r\n this.onKeyUp = function (event)\r\n {\r\n if (event.defaultPrevented || !_this.enabled || !_this.manager)\r\n {\r\n // Do nothing if event already handled\r\n return;\r\n }\r\n\r\n _this.queue.push(event);\r\n\r\n if (!_this.manager.useQueue)\r\n {\r\n _this.manager.events.emit(InputEvents.MANAGER_PROCESS);\r\n }\r\n \r\n var modified = (event.altKey || event.ctrlKey || event.shiftKey || event.metaKey);\r\n\r\n if (_this.preventDefault && !modified && _this.captures.indexOf(event.keyCode) > -1)\r\n {\r\n event.preventDefault();\r\n }\r\n };\r\n\r\n var target = this.target;\r\n\r\n if (target)\r\n {\r\n target.addEventListener('keydown', this.onKeyDown, false);\r\n target.addEventListener('keyup', this.onKeyUp, false);\r\n\r\n this.enabled = true;\r\n }\r\n },\r\n\r\n /**\r\n * Stops the Key Event listeners.\r\n * This is called automatically and does not need to be manually invoked.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardManager#stopListeners\r\n * @since 3.16.0\r\n */\r\n stopListeners: function ()\r\n {\r\n var target = this.target;\r\n\r\n target.removeEventListener('keydown', this.onKeyDown, false);\r\n target.removeEventListener('keyup', this.onKeyUp, false);\r\n\r\n this.enabled = false;\r\n },\r\n\r\n /**\r\n * Clears the event queue.\r\n * Called automatically by the Input Manager.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardManager#postUpdate\r\n * @private\r\n * @since 3.16.0\r\n */\r\n postUpdate: function ()\r\n {\r\n this.queue = [];\r\n },\r\n\r\n /**\r\n * By default when a key is pressed Phaser will not stop the event from propagating up to the browser.\r\n * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll.\r\n *\r\n * This `addCapture` method enables consuming keyboard event for specific keys so it doesn't bubble up to the the browser\r\n * and cause the default browser behavior.\r\n * \r\n * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to say prevent\r\n * the SPACE BAR from triggering a page scroll, then it will prevent it for any Scene in your game, not just the calling one.\r\n * \r\n * You can pass in a single key code value, or an array of key codes, or a string:\r\n * \r\n * ```javascript\r\n * this.input.keyboard.addCapture(62);\r\n * ```\r\n * \r\n * An array of key codes:\r\n * \r\n * ```javascript\r\n * this.input.keyboard.addCapture([ 62, 63, 64 ]);\r\n * ```\r\n * \r\n * Or a string:\r\n * \r\n * ```javascript\r\n * this.input.keyboard.addCapture('W,S,A,D');\r\n * ```\r\n * \r\n * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'.\r\n * \r\n * You can also provide an array mixing both strings and key code integers.\r\n * \r\n * If there are active captures after calling this method, the `preventDefault` property is set to `true`.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardManager#addCapture\r\n * @since 3.16.0\r\n * \r\n * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to enable capture for, preventing them reaching the browser.\r\n */\r\n addCapture: function (keycode)\r\n {\r\n if (typeof keycode === 'string')\r\n {\r\n keycode = keycode.split(',');\r\n }\r\n\r\n if (!Array.isArray(keycode))\r\n {\r\n keycode = [ keycode ];\r\n }\r\n\r\n var captures = this.captures;\r\n\r\n for (var i = 0; i < keycode.length; i++)\r\n {\r\n var code = keycode[i];\r\n\r\n if (typeof code === 'string')\r\n {\r\n code = KeyCodes[code.trim().toUpperCase()];\r\n }\r\n\r\n if (captures.indexOf(code) === -1)\r\n {\r\n captures.push(code);\r\n }\r\n }\r\n\r\n this.preventDefault = captures.length > 0;\r\n },\r\n\r\n /**\r\n * Removes an existing key capture.\r\n * \r\n * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to remove\r\n * the capture of a key, then it will remove it for any Scene in your game, not just the calling one.\r\n * \r\n * You can pass in a single key code value, or an array of key codes, or a string:\r\n * \r\n * ```javascript\r\n * this.input.keyboard.removeCapture(62);\r\n * ```\r\n * \r\n * An array of key codes:\r\n * \r\n * ```javascript\r\n * this.input.keyboard.removeCapture([ 62, 63, 64 ]);\r\n * ```\r\n * \r\n * Or a string:\r\n * \r\n * ```javascript\r\n * this.input.keyboard.removeCapture('W,S,A,D');\r\n * ```\r\n * \r\n * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'.\r\n * \r\n * You can also provide an array mixing both strings and key code integers.\r\n * \r\n * If there are no captures left after calling this method, the `preventDefault` property is set to `false`.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardManager#removeCapture\r\n * @since 3.16.0\r\n * \r\n * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to disable capture for, allowing them reaching the browser again.\r\n */\r\n removeCapture: function (keycode)\r\n {\r\n if (typeof keycode === 'string')\r\n {\r\n keycode = keycode.split(',');\r\n }\r\n\r\n if (!Array.isArray(keycode))\r\n {\r\n keycode = [ keycode ];\r\n }\r\n\r\n var captures = this.captures;\r\n\r\n for (var i = 0; i < keycode.length; i++)\r\n {\r\n var code = keycode[i];\r\n\r\n if (typeof code === 'string')\r\n {\r\n code = KeyCodes[code.toUpperCase()];\r\n }\r\n\r\n ArrayRemove(captures, code);\r\n }\r\n\r\n this.preventDefault = captures.length > 0;\r\n },\r\n\r\n /**\r\n * Removes all keyboard captures and sets the `preventDefault` property to `false`.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardManager#clearCaptures\r\n * @since 3.16.0\r\n */\r\n clearCaptures: function ()\r\n {\r\n this.captures = [];\r\n\r\n this.preventDefault = false;\r\n },\r\n\r\n /**\r\n * Destroys this Keyboard Manager instance.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardManager#destroy\r\n * @since 3.16.0\r\n */\r\n destroy: function ()\r\n {\r\n this.stopListeners();\r\n\r\n this.clearCaptures();\r\n\r\n this.queue = [];\r\n\r\n this.manager.game.events.off(GameEvents.POST_RENDER, this.postUpdate, this);\r\n\r\n this.target = null;\r\n this.enabled = false;\r\n this.manager = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = KeyboardManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/KeyboardManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/KeyboardPlugin.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/KeyboardPlugin.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/input/keyboard/events/index.js\");\r\nvar GameEvents = __webpack_require__(/*! ../../core/events */ \"./node_modules/phaser/src/core/events/index.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar InputEvents = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/input/events/index.js\");\r\nvar InputPluginCache = __webpack_require__(/*! ../InputPluginCache */ \"./node_modules/phaser/src/input/InputPluginCache.js\");\r\nvar Key = __webpack_require__(/*! ./keys/Key */ \"./node_modules/phaser/src/input/keyboard/keys/Key.js\");\r\nvar KeyCodes = __webpack_require__(/*! ./keys/KeyCodes */ \"./node_modules/phaser/src/input/keyboard/keys/KeyCodes.js\");\r\nvar KeyCombo = __webpack_require__(/*! ./combo/KeyCombo */ \"./node_modules/phaser/src/input/keyboard/combo/KeyCombo.js\");\r\nvar KeyMap = __webpack_require__(/*! ./keys/KeyMap */ \"./node_modules/phaser/src/input/keyboard/keys/KeyMap.js\");\r\nvar SnapFloor = __webpack_require__(/*! ../../math/snap/SnapFloor */ \"./node_modules/phaser/src/math/snap/SnapFloor.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Keyboard Plugin is an input plugin that belongs to the Scene-owned Input system.\r\n * \r\n * Its role is to listen for native DOM Keyboard Events and then process them.\r\n * \r\n * You do not need to create this class directly, the Input system will create an instance of it automatically.\r\n * \r\n * You can access it from within a Scene using `this.input.keyboard`. For example, you can do:\r\n *\r\n * ```javascript\r\n * this.input.keyboard.on('keydown', callback, context);\r\n * ```\r\n *\r\n * Or, to listen for a specific key:\r\n * \r\n * ```javascript\r\n * this.input.keyboard.on('keydown-A', callback, context);\r\n * ```\r\n *\r\n * You can also create Key objects, which you can then poll in your game loop:\r\n *\r\n * ```javascript\r\n * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE);\r\n * ```\r\n * \r\n * If you have multiple parallel Scenes, each trying to get keyboard input, be sure to disable capture on them to stop them from\r\n * stealing input from another Scene in the list. You can do this with `this.input.keyboard.enabled = false` within the\r\n * Scene to stop all input, or `this.input.keyboard.preventDefault = false` to stop a Scene halting input on another Scene.\r\n *\r\n * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting.\r\n * See http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/ for more details.\r\n *\r\n * Also please be aware that certain browser extensions can disable or override Phaser keyboard handling.\r\n * For example the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key.\r\n * And there are others. So, please check your extensions before opening Phaser issues about keys that don't work.\r\n *\r\n * @class KeyboardPlugin\r\n * @extends Phaser.Events.EventEmitter\r\n * @memberof Phaser.Input.Keyboard\r\n * @constructor\r\n * @since 3.10.0\r\n *\r\n * @param {Phaser.Input.InputPlugin} sceneInputPlugin - A reference to the Scene Input Plugin that the KeyboardPlugin belongs to.\r\n */\r\nvar KeyboardPlugin = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function KeyboardPlugin (sceneInputPlugin)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * A reference to the core game, so we can listen for visibility events.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardPlugin#game\r\n * @type {Phaser.Game}\r\n * @since 3.16.0\r\n */\r\n this.game = sceneInputPlugin.systems.game;\r\n\r\n /**\r\n * A reference to the Scene that this Input Plugin is responsible for.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardPlugin#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.10.0\r\n */\r\n this.scene = sceneInputPlugin.scene;\r\n\r\n /**\r\n * A reference to the Scene Systems Settings.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardPlugin#settings\r\n * @type {Phaser.Types.Scenes.SettingsObject}\r\n * @since 3.10.0\r\n */\r\n this.settings = this.scene.sys.settings;\r\n\r\n /**\r\n * A reference to the Scene Input Plugin that created this Keyboard Plugin.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardPlugin#sceneInputPlugin\r\n * @type {Phaser.Input.InputPlugin}\r\n * @since 3.10.0\r\n */\r\n this.sceneInputPlugin = sceneInputPlugin;\r\n\r\n /**\r\n * A reference to the global Keyboard Manager.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardPlugin#manager\r\n * @type {Phaser.Input.InputPlugin}\r\n * @since 3.16.0\r\n */\r\n this.manager = sceneInputPlugin.manager.keyboard;\r\n\r\n /**\r\n * A boolean that controls if this Keyboard Plugin is enabled or not.\r\n * Can be toggled on the fly.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardPlugin#enabled\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.10.0\r\n */\r\n this.enabled = true;\r\n\r\n /**\r\n * An array of Key objects to process.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardPlugin#keys\r\n * @type {Phaser.Input.Keyboard.Key[]}\r\n * @since 3.10.0\r\n */\r\n this.keys = [];\r\n\r\n /**\r\n * An array of KeyCombo objects to process.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardPlugin#combos\r\n * @type {Phaser.Input.Keyboard.KeyCombo[]}\r\n * @since 3.10.0\r\n */\r\n this.combos = [];\r\n\r\n sceneInputPlugin.pluginEvents.once(InputEvents.BOOT, this.boot, this);\r\n sceneInputPlugin.pluginEvents.on(InputEvents.START, this.start, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#boot\r\n * @private\r\n * @since 3.10.0\r\n */\r\n boot: function ()\r\n {\r\n var settings = this.settings.input;\r\n\r\n this.enabled = GetValue(settings, 'keyboard', true);\r\n\r\n var captures = GetValue(settings, 'keyboard.capture', null);\r\n\r\n if (captures)\r\n {\r\n this.addCaptures(captures);\r\n }\r\n\r\n this.sceneInputPlugin.pluginEvents.once(InputEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#start\r\n * @private\r\n * @since 3.10.0\r\n */\r\n start: function ()\r\n {\r\n if (this.sceneInputPlugin.manager.useQueue)\r\n {\r\n this.sceneInputPlugin.pluginEvents.on(InputEvents.UPDATE, this.update, this);\r\n }\r\n else\r\n {\r\n this.sceneInputPlugin.manager.events.on(InputEvents.MANAGER_PROCESS, this.update, this);\r\n }\r\n\r\n this.sceneInputPlugin.pluginEvents.once(InputEvents.SHUTDOWN, this.shutdown, this);\r\n\r\n this.game.events.on(GameEvents.BLUR, this.resetKeys, this);\r\n },\r\n\r\n /**\r\n * Checks to see if both this plugin and the Scene to which it belongs is active.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#isActive\r\n * @since 3.10.0\r\n *\r\n * @return {boolean} `true` if the plugin and the Scene it belongs to is active.\r\n */\r\n isActive: function ()\r\n {\r\n return (this.enabled && this.scene.sys.isActive());\r\n },\r\n\r\n /**\r\n * By default when a key is pressed Phaser will not stop the event from propagating up to the browser.\r\n * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll.\r\n *\r\n * This `addCapture` method enables consuming keyboard events for specific keys, so they don't bubble up the browser\r\n * and cause the default behaviors.\r\n * \r\n * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to say prevent\r\n * the SPACE BAR from triggering a page scroll, then it will prevent it for any Scene in your game, not just the calling one.\r\n * \r\n * You can pass a single key code value:\r\n * \r\n * ```javascript\r\n * this.input.keyboard.addCapture(62);\r\n * ```\r\n * \r\n * An array of key codes:\r\n * \r\n * ```javascript\r\n * this.input.keyboard.addCapture([ 62, 63, 64 ]);\r\n * ```\r\n * \r\n * Or, a comma-delimited string:\r\n * \r\n * ```javascript\r\n * this.input.keyboard.addCapture('W,S,A,D');\r\n * ```\r\n * \r\n * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'.\r\n * \r\n * You can also provide an array mixing both strings and key code integers.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#addCapture\r\n * @since 3.16.0\r\n * \r\n * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to enable event capture for.\r\n *\r\n * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object.\r\n */\r\n addCapture: function (keycode)\r\n {\r\n this.manager.addCapture(keycode);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes an existing key capture.\r\n * \r\n * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to remove\r\n * the capture of a key, then it will remove it for any Scene in your game, not just the calling one.\r\n * \r\n * You can pass a single key code value:\r\n * \r\n * ```javascript\r\n * this.input.keyboard.removeCapture(62);\r\n * ```\r\n * \r\n * An array of key codes:\r\n * \r\n * ```javascript\r\n * this.input.keyboard.removeCapture([ 62, 63, 64 ]);\r\n * ```\r\n * \r\n * Or, a comma-delimited string:\r\n * \r\n * ```javascript\r\n * this.input.keyboard.removeCapture('W,S,A,D');\r\n * ```\r\n * \r\n * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'.\r\n * \r\n * You can also provide an array mixing both strings and key code integers.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#removeCapture\r\n * @since 3.16.0\r\n * \r\n * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to disable event capture for.\r\n *\r\n * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object.\r\n */\r\n removeCapture: function (keycode)\r\n {\r\n this.manager.removeCapture(keycode);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns an array that contains all of the keyboard captures currently enabled.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#getCaptures\r\n * @since 3.16.0\r\n * \r\n * @return {integer[]} An array of all the currently capturing key codes.\r\n */\r\n getCaptures: function ()\r\n {\r\n return this.manager.captures;\r\n },\r\n\r\n /**\r\n * Allows Phaser to prevent any key captures you may have defined from bubbling up the browser.\r\n * You can use this to re-enable event capturing if you had paused it via `disableGlobalCapture`.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#enableGlobalCapture\r\n * @since 3.16.0\r\n *\r\n * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object.\r\n */\r\n enableGlobalCapture: function ()\r\n {\r\n this.manager.preventDefault = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Disables Phaser from preventing any key captures you may have defined, without actually removing them.\r\n * You can use this to temporarily disable event capturing if, for example, you swap to a DOM element.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#disableGlobalCapture\r\n * @since 3.16.0\r\n *\r\n * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object.\r\n */\r\n disableGlobalCapture: function ()\r\n {\r\n this.manager.preventDefault = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes all keyboard captures.\r\n * \r\n * Note that this is a global change. It will clear all event captures across your game, not just for this specific Scene.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#clearCaptures\r\n * @since 3.16.0\r\n *\r\n * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object.\r\n */\r\n clearCaptures: function ()\r\n {\r\n this.manager.clearCaptures();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates and returns an object containing 4 hotkeys for Up, Down, Left and Right, and also Space Bar and shift.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#createCursorKeys\r\n * @since 3.10.0\r\n *\r\n * @return {Phaser.Types.Input.Keyboard.CursorKeys} An object containing the properties: `up`, `down`, `left`, `right`, `space` and `shift`.\r\n */\r\n createCursorKeys: function ()\r\n {\r\n return this.addKeys({\r\n up: KeyCodes.UP,\r\n down: KeyCodes.DOWN,\r\n left: KeyCodes.LEFT,\r\n right: KeyCodes.RIGHT,\r\n space: KeyCodes.SPACE,\r\n shift: KeyCodes.SHIFT\r\n });\r\n },\r\n\r\n /**\r\n * A practical way to create an object containing user selected hotkeys.\r\n *\r\n * For example:\r\n *\r\n * ```javascript\r\n * this.input.keyboard.addKeys({ 'up': Phaser.Input.Keyboard.KeyCodes.W, 'down': Phaser.Input.Keyboard.KeyCodes.S });\r\n * ```\r\n * \r\n * would return an object containing the properties (`up` and `down`) mapped to W and S {@link Phaser.Input.Keyboard.Key} objects.\r\n *\r\n * You can also pass in a comma-separated string:\r\n * \r\n * ```javascript\r\n * this.input.keyboard.addKeys('W,S,A,D');\r\n * ```\r\n *\r\n * Which will return an object with the properties W, S, A and D mapped to the relevant Key objects.\r\n *\r\n * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#addKeys\r\n * @since 3.10.0\r\n *\r\n * @param {(object|string)} keys - An object containing Key Codes, or a comma-separated string.\r\n * @param {boolean} [enableCapture=true] - Automatically call `preventDefault` on the native DOM browser event for the key codes being added.\r\n * @param {boolean} [emitOnRepeat=false] - Controls if the Key will continuously emit a 'down' event while being held down (true), or emit the event just once (false, the default).\r\n *\r\n * @return {object} An object containing Key objects mapped to the input properties.\r\n */\r\n addKeys: function (keys, enableCapture, emitOnRepeat)\r\n {\r\n if (enableCapture === undefined) { enableCapture = true; }\r\n if (emitOnRepeat === undefined) { emitOnRepeat = false; }\r\n\r\n var output = {};\r\n\r\n if (typeof keys === 'string')\r\n {\r\n keys = keys.split(',');\r\n\r\n for (var i = 0; i < keys.length; i++)\r\n {\r\n var currentKey = keys[i].trim();\r\n\r\n if (currentKey)\r\n {\r\n output[currentKey] = this.addKey(currentKey, enableCapture, emitOnRepeat);\r\n }\r\n }\r\n }\r\n else\r\n {\r\n for (var key in keys)\r\n {\r\n output[key] = this.addKey(keys[key], enableCapture, emitOnRepeat);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Adds a Key object to this Keyboard Plugin.\r\n *\r\n * The given argument can be either an existing Key object, a string, such as `A` or `SPACE`, or a key code value.\r\n *\r\n * If a Key object is given, and one already exists matching the same key code, the existing one is replaced with the new one.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#addKey\r\n * @since 3.10.0\r\n *\r\n * @param {(Phaser.Input.Keyboard.Key|string|integer)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value.\r\n * @param {boolean} [enableCapture=true] - Automatically call `preventDefault` on the native DOM browser event for the key codes being added.\r\n * @param {boolean} [emitOnRepeat=false] - Controls if the Key will continuously emit a 'down' event while being held down (true), or emit the event just once (false, the default).\r\n *\r\n * @return {Phaser.Input.Keyboard.Key} The newly created Key object, or a reference to it if it already existed in the keys array.\r\n */\r\n addKey: function (key, enableCapture, emitOnRepeat)\r\n {\r\n if (enableCapture === undefined) { enableCapture = true; }\r\n if (emitOnRepeat === undefined) { emitOnRepeat = false; }\r\n\r\n var keys = this.keys;\r\n\r\n if (key instanceof Key)\r\n {\r\n var idx = keys.indexOf(key);\r\n\r\n if (idx > -1)\r\n {\r\n keys[idx] = key;\r\n }\r\n else\r\n {\r\n keys[key.keyCode] = key;\r\n }\r\n\r\n if (enableCapture)\r\n {\r\n this.addCapture(key.keyCode);\r\n }\r\n\r\n key.setEmitOnRepeat(emitOnRepeat);\r\n\r\n return key;\r\n }\r\n\r\n if (typeof key === 'string')\r\n {\r\n key = KeyCodes[key.toUpperCase()];\r\n }\r\n\r\n if (!keys[key])\r\n {\r\n keys[key] = new Key(this, key);\r\n\r\n if (enableCapture)\r\n {\r\n this.addCapture(key);\r\n }\r\n\r\n keys[key].setEmitOnRepeat(emitOnRepeat);\r\n }\r\n\r\n return keys[key];\r\n },\r\n\r\n /**\r\n * Removes a Key object from this Keyboard Plugin.\r\n *\r\n * The given argument can be either a Key object, a string, such as `A` or `SPACE`, or a key code value.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#removeKey\r\n * @since 3.10.0\r\n *\r\n * @param {(Phaser.Input.Keyboard.Key|string|integer)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value.\r\n * @param {boolean} [destroy=false] - Call `Key.destroy` on the removed Key object?\r\n *\r\n * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object.\r\n */\r\n removeKey: function (key, destroy)\r\n {\r\n if (destroy === undefined) { destroy = false; }\r\n\r\n var keys = this.keys;\r\n var ref;\r\n\r\n if (key instanceof Key)\r\n {\r\n var idx = keys.indexOf(key);\r\n\r\n if (idx > -1)\r\n {\r\n ref = this.keys[idx];\r\n\r\n this.keys[idx] = undefined;\r\n }\r\n }\r\n else if (typeof key === 'string')\r\n {\r\n key = KeyCodes[key.toUpperCase()];\r\n }\r\n\r\n if (keys[key])\r\n {\r\n ref = keys[key];\r\n\r\n keys[key] = undefined;\r\n }\r\n\r\n if (ref)\r\n {\r\n ref.plugin = null;\r\n\r\n if (destroy)\r\n {\r\n ref.destroy();\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a new KeyCombo.\r\n * \r\n * A KeyCombo will listen for a specific string of keys from the Keyboard, and when it receives them\r\n * it will emit a `keycombomatch` event from this Keyboard Plugin.\r\n *\r\n * The keys to be listened for can be defined as:\r\n *\r\n * A string (i.e. 'ATARI')\r\n * An array of either integers (key codes) or strings, or a mixture of both\r\n * An array of objects (such as Key objects) with a public 'keyCode' property\r\n *\r\n * For example, to listen for the Konami code (up, up, down, down, left, right, left, right, b, a, enter)\r\n * you could pass the following array of key codes:\r\n *\r\n * ```javascript\r\n * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true });\r\n *\r\n * this.input.keyboard.on('keycombomatch', function (event) {\r\n * console.log('Konami Code entered!');\r\n * });\r\n * ```\r\n *\r\n * Or, to listen for the user entering the word PHASER:\r\n *\r\n * ```javascript\r\n * this.input.keyboard.createCombo('PHASER');\r\n * ```\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#createCombo\r\n * @since 3.10.0\r\n *\r\n * @param {(string|integer[]|object[])} keys - The keys that comprise this combo.\r\n * @param {Phaser.Types.Input.Keyboard.KeyComboConfig} [config] - A Key Combo configuration object.\r\n *\r\n * @return {Phaser.Input.Keyboard.KeyCombo} The new KeyCombo object.\r\n */\r\n createCombo: function (keys, config)\r\n {\r\n return new KeyCombo(this, keys, config);\r\n },\r\n\r\n /**\r\n * Checks if the given Key object is currently being held down.\r\n * \r\n * The difference between this method and checking the `Key.isDown` property directly is that you can provide\r\n * a duration to this method. For example, if you wanted a key press to fire a bullet, but you only wanted\r\n * it to be able to fire every 100ms, then you can call this method with a `duration` of 100 and it\r\n * will only return `true` every 100ms.\r\n * \r\n * If the Keyboard Plugin has been disabled, this method will always return `false`.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#checkDown\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.Input.Keyboard.Key} key - A Key object.\r\n * @param {number} [duration=0] - The duration which must have elapsed before this Key is considered as being down.\r\n * \r\n * @return {boolean} `true` if the Key is down within the duration specified, otherwise `false`.\r\n */\r\n checkDown: function (key, duration)\r\n {\r\n if (this.enabled && key.isDown)\r\n {\r\n var t = SnapFloor(this.time - key.timeDown, duration);\r\n\r\n if (t > key._tick)\r\n {\r\n key._tick = t;\r\n\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Internal update handler called by the Input Plugin, which is in turn invoked by the Game step.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#update\r\n * @private\r\n * @since 3.10.0\r\n */\r\n update: function ()\r\n {\r\n var queue = this.manager.queue;\r\n var len = queue.length;\r\n\r\n if (!this.isActive() || len === 0)\r\n {\r\n return;\r\n }\r\n\r\n var keys = this.keys;\r\n\r\n // Process the event queue, dispatching all of the events that have stored up\r\n for (var i = 0; i < len; i++)\r\n {\r\n var event = queue[i];\r\n var code = event.keyCode;\r\n var key = keys[code];\r\n var repeat = false;\r\n\r\n // Override the default functions (it's too late for the browser to use them anyway, so we may as well)\r\n if (event.cancelled === undefined)\r\n {\r\n // Event allowed to flow across all handlers in this Scene, and any other Scene in the Scene list\r\n event.cancelled = 0;\r\n\r\n // Won't reach any more local (Scene level) handlers\r\n event.stopImmediatePropagation = function ()\r\n {\r\n event.cancelled = 1;\r\n };\r\n \r\n // Won't reach any more handlers in any Scene further down the Scene list\r\n event.stopPropagation = function ()\r\n {\r\n event.cancelled = -1;\r\n };\r\n }\r\n\r\n if (event.cancelled === -1)\r\n {\r\n // This event has been stopped from broadcasting to any other Scene, so abort.\r\n continue;\r\n }\r\n\r\n if (event.type === 'keydown')\r\n {\r\n // Key specific callback first\r\n if (key)\r\n {\r\n repeat = key.isDown;\r\n\r\n key.onDown(event);\r\n }\r\n\r\n if (!event.cancelled && (!key || !repeat))\r\n {\r\n if (KeyMap[code])\r\n {\r\n this.emit(Events.KEY_DOWN + KeyMap[code], event);\r\n\r\n // Deprecated, kept in for compatibility with 3.15\r\n // To be removed by 3.20.\r\n this.emit('keydown_' + KeyMap[code], event);\r\n }\r\n\r\n if (!event.cancelled)\r\n {\r\n this.emit(Events.ANY_KEY_DOWN, event);\r\n }\r\n }\r\n }\r\n else\r\n {\r\n // Key specific callback first\r\n if (key)\r\n {\r\n key.onUp(event);\r\n }\r\n\r\n if (!event.cancelled)\r\n {\r\n if (KeyMap[code])\r\n {\r\n this.emit(Events.KEY_UP + KeyMap[code], event);\r\n\r\n // Deprecated, kept in for compatibility with 3.15\r\n // To be removed by 3.20.\r\n this.emit('keyup_' + KeyMap[code], event);\r\n }\r\n\r\n if (!event.cancelled)\r\n {\r\n this.emit(Events.ANY_KEY_UP, event);\r\n }\r\n }\r\n }\r\n\r\n // Reset the cancel state for other Scenes to use\r\n if (event.cancelled === 1)\r\n {\r\n event.cancelled = 0;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Resets all Key objects created by _this_ Keyboard Plugin back to their default un-pressed states.\r\n * This can only reset keys created via the `addKey`, `addKeys` or `createCursorKeys` methods.\r\n * If you have created a Key object directly you'll need to reset it yourself.\r\n * \r\n * This method is called automatically when the Keyboard Plugin shuts down, but can be\r\n * invoked directly at any time you require.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#resetKeys\r\n * @since 3.15.0\r\n *\r\n * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object.\r\n */\r\n resetKeys: function ()\r\n {\r\n var keys = this.keys;\r\n\r\n for (var i = 0; i < keys.length; i++)\r\n {\r\n // Because it's a sparsely populated array\r\n if (keys[i])\r\n {\r\n keys[i].reset();\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Shuts this Keyboard Plugin down. This performs the following tasks:\r\n * \r\n * 1 - Resets all keys created by this Keyboard plugin.\r\n * 2 - Stops and removes the keyboard event listeners.\r\n * 3 - Clears out any pending requests in the queue, without processing them.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#shutdown\r\n * @private\r\n * @since 3.10.0\r\n */\r\n shutdown: function ()\r\n {\r\n this.resetKeys();\r\n\r\n if (this.sceneInputPlugin.manager.useQueue)\r\n {\r\n this.sceneInputPlugin.pluginEvents.off(InputEvents.UPDATE, this.update, this);\r\n }\r\n else\r\n {\r\n this.sceneInputPlugin.manager.events.off(InputEvents.MANAGER_PROCESS, this.update, this);\r\n }\r\n\r\n this.game.events.off(GameEvents.BLUR, this.resetKeys);\r\n\r\n this.removeAllListeners();\r\n\r\n this.queue = [];\r\n },\r\n\r\n /**\r\n * Destroys this Keyboard Plugin instance and all references it holds, plus clears out local arrays.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyboardPlugin#destroy\r\n * @private\r\n * @since 3.10.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n var keys = this.keys;\r\n\r\n for (var i = 0; i < keys.length; i++)\r\n {\r\n // Because it's a sparsely populated array\r\n if (keys[i])\r\n {\r\n keys[i].destroy();\r\n }\r\n }\r\n\r\n this.keys = [];\r\n this.combos = [];\r\n this.queue = [];\r\n\r\n this.scene = null;\r\n this.settings = null;\r\n this.sceneInputPlugin = null;\r\n this.manager = null;\r\n },\r\n\r\n /**\r\n * Internal time value.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyboardPlugin#time\r\n * @type {number}\r\n * @private\r\n * @since 3.11.0\r\n */\r\n time: {\r\n\r\n get: function ()\r\n {\r\n return this.sceneInputPlugin.manager.time;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\n/**\r\n * An instance of the Keyboard Plugin class, if enabled via the `input.keyboard` Scene or Game Config property.\r\n * Use this to create Key objects and listen for keyboard specific events.\r\n *\r\n * @name Phaser.Input.InputPlugin#keyboard\r\n * @type {?Phaser.Input.Keyboard.KeyboardPlugin}\r\n * @since 3.10.0\r\n */\r\nInputPluginCache.register('KeyboardPlugin', KeyboardPlugin, 'keyboard', 'keyboard', 'inputKeyboard');\r\n\r\nmodule.exports = KeyboardPlugin;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/KeyboardPlugin.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/combo/AdvanceKeyCombo.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/combo/AdvanceKeyCombo.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Used internally by the KeyCombo class.\r\n * Return `true` if it reached the end of the combo, `false` if not.\r\n *\r\n * @function Phaser.Input.Keyboard.KeyCombo.AdvanceKeyCombo\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {KeyboardEvent} event - The native Keyboard Event.\r\n * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo object to advance.\r\n *\r\n * @return {boolean} `true` if it reached the end of the combo, `false` if not.\r\n */\r\nvar AdvanceKeyCombo = function (event, combo)\r\n{\r\n combo.timeLastMatched = event.timeStamp;\r\n combo.index++;\r\n\r\n if (combo.index === combo.size)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n combo.current = combo.keyCodes[combo.index];\r\n return false;\r\n }\r\n};\r\n\r\nmodule.exports = AdvanceKeyCombo;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/combo/AdvanceKeyCombo.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/combo/KeyCombo.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/combo/KeyCombo.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/input/keyboard/events/index.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar ProcessKeyCombo = __webpack_require__(/*! ./ProcessKeyCombo */ \"./node_modules/phaser/src/input/keyboard/combo/ProcessKeyCombo.js\");\r\nvar ResetKeyCombo = __webpack_require__(/*! ./ResetKeyCombo */ \"./node_modules/phaser/src/input/keyboard/combo/ResetKeyCombo.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A KeyCombo will listen for a specific string of keys from the Keyboard, and when it receives them\r\n * it will emit a `keycombomatch` event from the Keyboard Manager.\r\n *\r\n * The keys to be listened for can be defined as:\r\n *\r\n * A string (i.e. 'ATARI')\r\n * An array of either integers (key codes) or strings, or a mixture of both\r\n * An array of objects (such as Key objects) with a public 'keyCode' property\r\n *\r\n * For example, to listen for the Konami code (up, up, down, down, left, right, left, right, b, a, enter)\r\n * you could pass the following array of key codes:\r\n *\r\n * ```javascript\r\n * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true });\r\n *\r\n * this.input.keyboard.on('keycombomatch', function (event) {\r\n * console.log('Konami Code entered!');\r\n * });\r\n * ```\r\n *\r\n * Or, to listen for the user entering the word PHASER:\r\n *\r\n * ```javascript\r\n * this.input.keyboard.createCombo('PHASER');\r\n * ```\r\n *\r\n * @class KeyCombo\r\n * @memberof Phaser.Input.Keyboard\r\n * @constructor\r\n * @listens Phaser.Input.Keyboard.Events#ANY_KEY_DOWN\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Keyboard.KeyboardPlugin} keyboardPlugin - A reference to the Keyboard Plugin.\r\n * @param {(string|integer[]|object[])} keys - The keys that comprise this combo.\r\n * @param {Phaser.Types.Input.Keyboard.KeyComboConfig} [config] - A Key Combo configuration object.\r\n */\r\nvar KeyCombo = new Class({\r\n\r\n initialize:\r\n\r\n function KeyCombo (keyboardPlugin, keys, config)\r\n {\r\n if (config === undefined) { config = {}; }\r\n\r\n // Can't have a zero or single length combo (string or array based)\r\n if (keys.length < 2)\r\n {\r\n return false;\r\n }\r\n\r\n /**\r\n * A reference to the Keyboard Manager\r\n *\r\n * @name Phaser.Input.Keyboard.KeyCombo#manager\r\n * @type {Phaser.Input.Keyboard.KeyboardPlugin}\r\n * @since 3.0.0\r\n */\r\n this.manager = keyboardPlugin;\r\n\r\n /**\r\n * A flag that controls if this Key Combo is actively processing keys or not.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyCombo#enabled\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.enabled = true;\r\n\r\n /**\r\n * An array of the keycodes that comprise this combo.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyCombo#keyCodes\r\n * @type {array}\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.keyCodes = [];\r\n\r\n // if 'keys' is a string we need to get the keycode of each character in it\r\n\r\n for (var i = 0; i < keys.length; i++)\r\n {\r\n var char = keys[i];\r\n\r\n if (typeof char === 'string')\r\n {\r\n this.keyCodes.push(char.toUpperCase().charCodeAt(0));\r\n }\r\n else if (typeof char === 'number')\r\n {\r\n this.keyCodes.push(char);\r\n }\r\n else if (char.hasOwnProperty('keyCode'))\r\n {\r\n this.keyCodes.push(char.keyCode);\r\n }\r\n }\r\n\r\n /**\r\n * The current keyCode the combo is waiting for.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyCombo#current\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.current = this.keyCodes[0];\r\n\r\n /**\r\n * The current index of the key being waited for in the 'keys' string.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyCombo#index\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.index = 0;\r\n\r\n /**\r\n * The length of this combo (in keycodes)\r\n *\r\n * @name Phaser.Input.Keyboard.KeyCombo#size\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.size = this.keyCodes.length;\r\n\r\n /**\r\n * The time the previous key in the combo was matched.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyCombo#timeLastMatched\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.timeLastMatched = 0;\r\n\r\n /**\r\n * Has this Key Combo been matched yet?\r\n *\r\n * @name Phaser.Input.Keyboard.KeyCombo#matched\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.matched = false;\r\n\r\n /**\r\n * The time the entire combo was matched.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyCombo#timeMatched\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.timeMatched = 0;\r\n\r\n /**\r\n * If they press the wrong key do we reset the combo?\r\n *\r\n * @name Phaser.Input.Keyboard.KeyCombo#resetOnWrongKey\r\n * @type {boolean}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.resetOnWrongKey = GetFastValue(config, 'resetOnWrongKey', true);\r\n\r\n /**\r\n * The max delay in ms between each key press. Above this the combo is reset. 0 means disabled.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyCombo#maxKeyDelay\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.maxKeyDelay = GetFastValue(config, 'maxKeyDelay', 0);\r\n\r\n /**\r\n * If previously matched and they press the first key of the combo again, will it reset?\r\n *\r\n * @name Phaser.Input.Keyboard.KeyCombo#resetOnMatch\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.resetOnMatch = GetFastValue(config, 'resetOnMatch', false);\r\n\r\n /**\r\n * If the combo matches, will it delete itself?\r\n *\r\n * @name Phaser.Input.Keyboard.KeyCombo#deleteOnMatch\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.deleteOnMatch = GetFastValue(config, 'deleteOnMatch', false);\r\n\r\n var _this = this;\r\n\r\n var onKeyDownHandler = function (event)\r\n {\r\n if (_this.matched || !_this.enabled)\r\n {\r\n return;\r\n }\r\n\r\n var matched = ProcessKeyCombo(event, _this);\r\n\r\n if (matched)\r\n {\r\n _this.manager.emit(Events.COMBO_MATCH, _this, event);\r\n\r\n if (_this.resetOnMatch)\r\n {\r\n ResetKeyCombo(_this);\r\n }\r\n else if (_this.deleteOnMatch)\r\n {\r\n _this.destroy();\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * The internal Key Down handler.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyCombo#onKeyDown\r\n * @private\r\n * @type {KeyboardKeydownCallback}\r\n * @fires Phaser.Input.Keyboard.Events#COMBO_MATCH\r\n * @since 3.0.0\r\n */\r\n this.onKeyDown = onKeyDownHandler;\r\n\r\n this.manager.on(Events.ANY_KEY_DOWN, this.onKeyDown);\r\n },\r\n\r\n /**\r\n * How far complete is this combo? A value between 0 and 1.\r\n *\r\n * @name Phaser.Input.Keyboard.KeyCombo#progress\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n progress: {\r\n\r\n get: function ()\r\n {\r\n return this.index / this.size;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Destroys this Key Combo and all of its references.\r\n *\r\n * @method Phaser.Input.Keyboard.KeyCombo#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.enabled = false;\r\n this.keyCodes = [];\r\n\r\n this.manager.off(Events.ANY_KEY_DOWN, this.onKeyDown);\r\n\r\n this.manager = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = KeyCombo;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/combo/KeyCombo.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/combo/ProcessKeyCombo.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/combo/ProcessKeyCombo.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar AdvanceKeyCombo = __webpack_require__(/*! ./AdvanceKeyCombo */ \"./node_modules/phaser/src/input/keyboard/combo/AdvanceKeyCombo.js\");\r\n\r\n/**\r\n * Used internally by the KeyCombo class.\r\n *\r\n * @function Phaser.Input.Keyboard.KeyCombo.ProcessKeyCombo\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {KeyboardEvent} event - The native Keyboard Event.\r\n * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo object to be processed.\r\n *\r\n * @return {boolean} `true` if the combo was matched, otherwise `false`.\r\n */\r\nvar ProcessKeyCombo = function (event, combo)\r\n{\r\n if (combo.matched)\r\n {\r\n return true;\r\n }\r\n\r\n var comboMatched = false;\r\n var keyMatched = false;\r\n\r\n if (event.keyCode === combo.current)\r\n {\r\n // Key was correct\r\n\r\n if (combo.index > 0 && combo.maxKeyDelay > 0)\r\n {\r\n // We have to check to see if the delay between\r\n // the new key and the old one was too long (if enabled)\r\n\r\n var timeLimit = combo.timeLastMatched + combo.maxKeyDelay;\r\n\r\n // Check if they pressed it in time or not\r\n if (event.timeStamp <= timeLimit)\r\n {\r\n keyMatched = true;\r\n comboMatched = AdvanceKeyCombo(event, combo);\r\n }\r\n }\r\n else\r\n {\r\n keyMatched = true;\r\n\r\n // We don't check the time for the first key pressed, so just advance it\r\n comboMatched = AdvanceKeyCombo(event, combo);\r\n }\r\n }\r\n\r\n if (!keyMatched && combo.resetOnWrongKey)\r\n {\r\n // Wrong key was pressed\r\n combo.index = 0;\r\n combo.current = combo.keyCodes[0];\r\n }\r\n\r\n if (comboMatched)\r\n {\r\n combo.timeLastMatched = event.timeStamp;\r\n combo.matched = true;\r\n combo.timeMatched = event.timeStamp;\r\n }\r\n\r\n return comboMatched;\r\n};\r\n\r\nmodule.exports = ProcessKeyCombo;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/combo/ProcessKeyCombo.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/combo/ResetKeyCombo.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/combo/ResetKeyCombo.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Used internally by the KeyCombo class.\r\n *\r\n * @function Phaser.Input.Keyboard.KeyCombo.ResetKeyCombo\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo to reset.\r\n *\r\n * @return {Phaser.Input.Keyboard.KeyCombo} The KeyCombo.\r\n */\r\nvar ResetKeyCombo = function (combo)\r\n{\r\n combo.current = combo.keyCodes[0];\r\n combo.index = 0;\r\n combo.timeLastMatched = 0;\r\n combo.matched = false;\r\n combo.timeMatched = 0;\r\n\r\n return combo;\r\n};\r\n\r\nmodule.exports = ResetKeyCombo;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/combo/ResetKeyCombo.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/events/ANY_KEY_DOWN_EVENT.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/events/ANY_KEY_DOWN_EVENT.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Global Key Down Event.\r\n * \r\n * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.keyboard.on('keydown', listener)`.\r\n * \r\n * You can also listen for a specific key being pressed. See [Keyboard.Events.KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_DOWN} for details.\r\n * \r\n * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details.\r\n * \r\n * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting.\r\n * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details.\r\n *\r\n * Also, please be aware that some browser extensions can disable or override Phaser keyboard handling.\r\n * For example, the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key.\r\n * There are others. So, please check your extensions if you find you have specific keys that don't work.\r\n *\r\n * @event Phaser.Input.Keyboard.Events#ANY_KEY_DOWN\r\n * @since 3.0.0\r\n * \r\n * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was pressed, any modifiers, etc.\r\n */\r\nmodule.exports = 'keydown';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/events/ANY_KEY_DOWN_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/events/ANY_KEY_UP_EVENT.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/events/ANY_KEY_UP_EVENT.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Global Key Up Event.\r\n * \r\n * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released.\r\n * \r\n * Listen to this event from within a Scene using: `this.input.keyboard.on('keyup', listener)`.\r\n * \r\n * You can also listen for a specific key being released. See [Keyboard.Events.KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_UP} for details.\r\n * \r\n * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details.\r\n *\r\n * @event Phaser.Input.Keyboard.Events#ANY_KEY_UP\r\n * @since 3.0.0\r\n * \r\n * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was released, any modifiers, etc.\r\n */\r\nmodule.exports = 'keyup';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/events/ANY_KEY_UP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/events/COMBO_MATCH_EVENT.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/events/COMBO_MATCH_EVENT.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Key Combo Match Event.\r\n * \r\n * This event is dispatched by the Keyboard Plugin when a [Key Combo]{@link Phaser.Input.Keyboard.KeyCombo} is matched.\r\n * \r\n * Listen for this event from the Key Plugin after a combo has been created:\r\n * \r\n * ```javascript\r\n * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true });\r\n *\r\n * this.input.keyboard.on('keycombomatch', function (event) {\r\n * console.log('Konami Code entered!');\r\n * });\r\n * ```\r\n *\r\n * @event Phaser.Input.Keyboard.Events#COMBO_MATCH\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Keyboard.KeyCombo} keycombo - The Key Combo object that was matched.\r\n * @param {KeyboardEvent} event - The native DOM Keyboard Event of the final key in the combo. You can inspect this to learn more about any modifiers, etc.\r\n */\r\nmodule.exports = 'keycombomatch';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/events/COMBO_MATCH_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/events/DOWN_EVENT.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/events/DOWN_EVENT.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Key Down Event.\r\n * \r\n * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is pressed.\r\n * \r\n * Listen for this event from the Key object instance directly:\r\n * \r\n * ```javascript\r\n * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE);\r\n * \r\n * spaceBar.on('down', listener)\r\n * ```\r\n * \r\n * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details.\r\n *\r\n * @event Phaser.Input.Keyboard.Events#DOWN\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Keyboard.Key} key - The Key object that was pressed.\r\n * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about any modifiers, etc.\r\n */\r\nmodule.exports = 'down';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/events/DOWN_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/events/KEY_DOWN_EVENT.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/events/KEY_DOWN_EVENT.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Key Down Event.\r\n * \r\n * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down.\r\n * \r\n * Unlike the `ANY_KEY_DOWN` event, this one has a special dynamic event name. For example, to listen for the `A` key being pressed\r\n * use the following from within a Scene: `this.input.keyboard.on('keydown-A', listener)`. You can replace the `-A` part of the event\r\n * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: \r\n * `this.input.keyboard.on('keydown-SPACE', listener)`.\r\n * \r\n * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details.\r\n * \r\n * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details.\r\n * \r\n * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting.\r\n * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details.\r\n *\r\n * Also, please be aware that some browser extensions can disable or override Phaser keyboard handling.\r\n * For example, the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key.\r\n * There are others. So, please check your extensions if you find you have specific keys that don't work.\r\n *\r\n * @event Phaser.Input.Keyboard.Events#KEY_DOWN\r\n * @since 3.0.0\r\n * \r\n * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was pressed, any modifiers, etc.\r\n */\r\nmodule.exports = 'keydown-';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/events/KEY_DOWN_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/events/KEY_UP_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/events/KEY_UP_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Key Up Event.\r\n * \r\n * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released.\r\n * \r\n * Unlike the `ANY_KEY_UP` event, this one has a special dynamic event name. For example, to listen for the `A` key being released\r\n * use the following from within a Scene: `this.input.keyboard.on('keyup-A', listener)`. You can replace the `-A` part of the event\r\n * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: \r\n * `this.input.keyboard.on('keyup-SPACE', listener)`.\r\n * \r\n * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details.\r\n * \r\n * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details.\r\n *\r\n * @event Phaser.Input.Keyboard.Events#KEY_UP\r\n * @since 3.0.0\r\n * \r\n * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was released, any modifiers, etc.\r\n */\r\nmodule.exports = 'keyup-';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/events/KEY_UP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/events/UP_EVENT.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/events/UP_EVENT.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Key Up Event.\r\n * \r\n * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is released.\r\n * \r\n * Listen for this event from the Key object instance directly:\r\n * \r\n * ```javascript\r\n * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE);\r\n * \r\n * spaceBar.on('up', listener)\r\n * ```\r\n * \r\n * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details.\r\n *\r\n * @event Phaser.Input.Keyboard.Events#UP\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Input.Keyboard.Key} key - The Key object that was released.\r\n * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about any modifiers, etc.\r\n */\r\nmodule.exports = 'up';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/events/UP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/events/index.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/events/index.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Input.Keyboard.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n ANY_KEY_DOWN: __webpack_require__(/*! ./ANY_KEY_DOWN_EVENT */ \"./node_modules/phaser/src/input/keyboard/events/ANY_KEY_DOWN_EVENT.js\"),\r\n ANY_KEY_UP: __webpack_require__(/*! ./ANY_KEY_UP_EVENT */ \"./node_modules/phaser/src/input/keyboard/events/ANY_KEY_UP_EVENT.js\"),\r\n COMBO_MATCH: __webpack_require__(/*! ./COMBO_MATCH_EVENT */ \"./node_modules/phaser/src/input/keyboard/events/COMBO_MATCH_EVENT.js\"),\r\n DOWN: __webpack_require__(/*! ./DOWN_EVENT */ \"./node_modules/phaser/src/input/keyboard/events/DOWN_EVENT.js\"),\r\n KEY_DOWN: __webpack_require__(/*! ./KEY_DOWN_EVENT */ \"./node_modules/phaser/src/input/keyboard/events/KEY_DOWN_EVENT.js\"),\r\n KEY_UP: __webpack_require__(/*! ./KEY_UP_EVENT */ \"./node_modules/phaser/src/input/keyboard/events/KEY_UP_EVENT.js\"),\r\n UP: __webpack_require__(/*! ./UP_EVENT */ \"./node_modules/phaser/src/input/keyboard/events/UP_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/index.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Input.Keyboard\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/input/keyboard/events/index.js\"),\r\n\r\n KeyboardManager: __webpack_require__(/*! ./KeyboardManager */ \"./node_modules/phaser/src/input/keyboard/KeyboardManager.js\"),\r\n KeyboardPlugin: __webpack_require__(/*! ./KeyboardPlugin */ \"./node_modules/phaser/src/input/keyboard/KeyboardPlugin.js\"),\r\n\r\n Key: __webpack_require__(/*! ./keys/Key */ \"./node_modules/phaser/src/input/keyboard/keys/Key.js\"),\r\n KeyCodes: __webpack_require__(/*! ./keys/KeyCodes */ \"./node_modules/phaser/src/input/keyboard/keys/KeyCodes.js\"),\r\n\r\n KeyCombo: __webpack_require__(/*! ./combo/KeyCombo */ \"./node_modules/phaser/src/input/keyboard/combo/KeyCombo.js\"),\r\n\r\n JustDown: __webpack_require__(/*! ./keys/JustDown */ \"./node_modules/phaser/src/input/keyboard/keys/JustDown.js\"),\r\n JustUp: __webpack_require__(/*! ./keys/JustUp */ \"./node_modules/phaser/src/input/keyboard/keys/JustUp.js\"),\r\n DownDuration: __webpack_require__(/*! ./keys/DownDuration */ \"./node_modules/phaser/src/input/keyboard/keys/DownDuration.js\"),\r\n UpDuration: __webpack_require__(/*! ./keys/UpDuration */ \"./node_modules/phaser/src/input/keyboard/keys/UpDuration.js\")\r\n \r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/keys/DownDuration.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/keys/DownDuration.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns `true` if the Key was pressed down within the `duration` value given, based on the current\r\n * game clock time. Or `false` if it either isn't down, or was pressed down longer ago than the given duration.\r\n *\r\n * @function Phaser.Input.Keyboard.DownDuration\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Keyboard.Key} key - The Key object to test.\r\n * @param {integer} [duration=50] - The duration, in ms, within which the key must have been pressed down.\r\n *\r\n * @return {boolean} `true` if the Key was pressed down within `duration` ms ago, otherwise `false`.\r\n */\r\nvar DownDuration = function (key, duration)\r\n{\r\n if (duration === undefined) { duration = 50; }\r\n\r\n var current = key.plugin.game.loop.time - key.timeDown;\r\n\r\n return (key.isDown && current < duration);\r\n};\r\n\r\nmodule.exports = DownDuration;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/keys/DownDuration.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/keys/JustDown.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/keys/JustDown.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The justDown value allows you to test if this Key has just been pressed down or not.\r\n * \r\n * When you check this value it will return `true` if the Key is down, otherwise `false`.\r\n * \r\n * You can only call justDown once per key press. It will only return `true` once, until the Key is released and pressed down again.\r\n * This allows you to use it in situations where you want to check if this key is down without using an event, such as in a core game loop.\r\n *\r\n * @function Phaser.Input.Keyboard.JustDown\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Keyboard.Key} key - The Key to check to see if it's just down or not.\r\n *\r\n * @return {boolean} `true` if the Key was just pressed, otherwise `false`.\r\n */\r\nvar JustDown = function (key)\r\n{\r\n if (key._justDown)\r\n {\r\n key._justDown = false;\r\n\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n};\r\n\r\nmodule.exports = JustDown;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/keys/JustDown.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/keys/JustUp.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/keys/JustUp.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The justUp value allows you to test if this Key has just been released or not.\r\n * \r\n * When you check this value it will return `true` if the Key is up, otherwise `false`.\r\n * \r\n * You can only call JustUp once per key release. It will only return `true` once, until the Key is pressed down and released again.\r\n * This allows you to use it in situations where you want to check if this key is up without using an event, such as in a core game loop.\r\n *\r\n * @function Phaser.Input.Keyboard.JustUp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Keyboard.Key} key - The Key to check to see if it's just up or not.\r\n *\r\n * @return {boolean} `true` if the Key was just released, otherwise `false`.\r\n */\r\nvar JustUp = function (key)\r\n{\r\n if (key._justUp)\r\n {\r\n key._justUp = false;\r\n\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n};\r\n\r\nmodule.exports = JustUp;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/keys/JustUp.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/keys/Key.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/keys/Key.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/input/keyboard/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A generic Key object which can be passed to the Process functions (and so on)\r\n * keycode must be an integer\r\n *\r\n * @class Key\r\n * @extends Phaser.Events.EventEmitter\r\n * @memberof Phaser.Input.Keyboard\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Keyboard.KeyboardPlugin} plugin - The Keyboard Plugin instance that owns this Key object.\r\n * @param {integer} keyCode - The keycode of this key.\r\n */\r\nvar Key = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function Key (plugin, keyCode)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * The Keyboard Plugin instance that owns this Key object.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#plugin\r\n * @type {Phaser.Input.Keyboard.KeyboardPlugin}\r\n * @since 3.17.0\r\n */\r\n this.plugin = plugin;\r\n\r\n /**\r\n * The keycode of this key.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#keyCode\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.keyCode = keyCode;\r\n\r\n /**\r\n * The original DOM event.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#originalEvent\r\n * @type {KeyboardEvent}\r\n * @since 3.0.0\r\n */\r\n this.originalEvent = undefined;\r\n\r\n /**\r\n * Can this Key be processed?\r\n *\r\n * @name Phaser.Input.Keyboard.Key#enabled\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.enabled = true;\r\n\r\n /**\r\n * The \"down\" state of the key. This will remain `true` for as long as the keyboard thinks this key is held down.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#isDown\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.isDown = false;\r\n\r\n /**\r\n * The \"up\" state of the key. This will remain `true` for as long as the keyboard thinks this key is up.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#isUp\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.isUp = true;\r\n\r\n /**\r\n * The down state of the ALT key, if pressed at the same time as this key.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#altKey\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.altKey = false;\r\n\r\n /**\r\n * The down state of the CTRL key, if pressed at the same time as this key.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#ctrlKey\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.ctrlKey = false;\r\n\r\n /**\r\n * The down state of the SHIFT key, if pressed at the same time as this key.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#shiftKey\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.shiftKey = false;\r\n\r\n /**\r\n * The down state of the Meta key, if pressed at the same time as this key.\r\n * On a Mac the Meta Key is the Command key. On Windows keyboards, it's the Windows key.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#metaKey\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.16.0\r\n */\r\n this.metaKey = false;\r\n\r\n /**\r\n * The location of the modifier key. 0 for standard (or unknown), 1 for left, 2 for right, 3 for numpad.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#location\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.location = 0;\r\n\r\n /**\r\n * The timestamp when the key was last pressed down.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#timeDown\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.timeDown = 0;\r\n\r\n /**\r\n * The number of milliseconds this key was held down for in the previous down - up sequence.\r\n * This value isn't updated every game step, only when the Key changes state.\r\n * To get the current duration use the `getDuration` method.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#duration\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.duration = 0;\r\n\r\n /**\r\n * The timestamp when the key was last released.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#timeUp\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.timeUp = 0;\r\n\r\n /**\r\n * When a key is held down should it continuously fire the `down` event each time it repeats?\r\n * \r\n * By default it will emit the `down` event just once, but if you wish to receive the event\r\n * for each repeat as well, enable this property.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#emitOnRepeat\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.16.0\r\n */\r\n this.emitOnRepeat = false;\r\n\r\n /**\r\n * If a key is held down this holds down the number of times the key has 'repeated'.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#repeats\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.repeats = 0;\r\n\r\n /**\r\n * True if the key has just been pressed (NOTE: requires to be reset, see justDown getter)\r\n *\r\n * @name Phaser.Input.Keyboard.Key#_justDown\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this._justDown = false;\r\n\r\n /**\r\n * True if the key has just been pressed (NOTE: requires to be reset, see justDown getter)\r\n *\r\n * @name Phaser.Input.Keyboard.Key#_justUp\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this._justUp = false;\r\n\r\n /**\r\n * Internal tick counter.\r\n *\r\n * @name Phaser.Input.Keyboard.Key#_tick\r\n * @type {number}\r\n * @private\r\n * @since 3.11.0\r\n */\r\n this._tick = -1;\r\n },\r\n\r\n /**\r\n * Controls if this Key will continuously emit a `down` event while being held down (true),\r\n * or emit the event just once, on first press, and then skip future events (false).\r\n *\r\n * @method Phaser.Input.Keyboard.Key#setEmitOnRepeat\r\n * @since 3.16.0\r\n * \r\n * @param {boolean} value - Emit `down` events on repeated key down actions, or just once?\r\n * \r\n * @return {Phaser.Input.Keyboard.Key} This Key instance.\r\n */\r\n setEmitOnRepeat: function (value)\r\n {\r\n this.emitOnRepeat = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Processes the Key Down action for this Key.\r\n * Called automatically by the Keyboard Plugin.\r\n *\r\n * @method Phaser.Input.Keyboard.Key#onDown\r\n * @fires Phaser.Input.Keyboard.Events#DOWN\r\n * @since 3.16.0\r\n * \r\n * @param {KeyboardEvent} event - The native DOM Keyboard event.\r\n */\r\n onDown: function (event)\r\n {\r\n this.originalEvent = event;\r\n\r\n if (!this.enabled)\r\n {\r\n return;\r\n }\r\n\r\n this.altKey = event.altKey;\r\n this.ctrlKey = event.ctrlKey;\r\n this.shiftKey = event.shiftKey;\r\n this.metaKey = event.metaKey;\r\n this.location = event.location;\r\n \r\n this.repeats++;\r\n\r\n if (!this.isDown)\r\n {\r\n this.isDown = true;\r\n this.isUp = false;\r\n this.timeDown = event.timeStamp;\r\n this.duration = 0;\r\n this._justDown = true;\r\n this._justUp = false;\r\n\r\n this.emit(Events.DOWN, this, event);\r\n }\r\n else if (this.emitOnRepeat)\r\n {\r\n this.emit(Events.DOWN, this, event);\r\n }\r\n },\r\n\r\n /**\r\n * Processes the Key Up action for this Key.\r\n * Called automatically by the Keyboard Plugin.\r\n *\r\n * @method Phaser.Input.Keyboard.Key#onUp\r\n * @fires Phaser.Input.Keyboard.Events#UP\r\n * @since 3.16.0\r\n * \r\n * @param {KeyboardEvent} event - The native DOM Keyboard event.\r\n */\r\n onUp: function (event)\r\n {\r\n this.originalEvent = event;\r\n\r\n if (!this.enabled)\r\n {\r\n return;\r\n }\r\n \r\n this.isDown = false;\r\n this.isUp = true;\r\n this.timeUp = event.timeStamp;\r\n this.duration = this.timeUp - this.timeDown;\r\n this.repeats = 0;\r\n \r\n this._justDown = false;\r\n this._justUp = true;\r\n this._tick = -1;\r\n \r\n this.emit(Events.UP, this, event);\r\n },\r\n\r\n /**\r\n * Resets this Key object back to its default un-pressed state.\r\n *\r\n * @method Phaser.Input.Keyboard.Key#reset\r\n * @since 3.6.0\r\n * \r\n * @return {Phaser.Input.Keyboard.Key} This Key instance.\r\n */\r\n reset: function ()\r\n {\r\n this.preventDefault = true;\r\n this.enabled = true;\r\n this.isDown = false;\r\n this.isUp = true;\r\n this.altKey = false;\r\n this.ctrlKey = false;\r\n this.shiftKey = false;\r\n this.metaKey = false;\r\n this.timeDown = 0;\r\n this.duration = 0;\r\n this.timeUp = 0;\r\n this.repeats = 0;\r\n this._justDown = false;\r\n this._justUp = false;\r\n this._tick = -1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns the duration, in ms, that the Key has been held down for.\r\n * \r\n * If the key is not currently down it will return zero.\r\n * \r\n * The get the duration the Key was held down for in the previous up-down cycle,\r\n * use the `Key.duration` property value instead.\r\n *\r\n * @method Phaser.Input.Keyboard.Key#getDuration\r\n * @since 3.17.0\r\n * \r\n * @return {number} The duration, in ms, that the Key has been held down for if currently down.\r\n */\r\n getDuration: function ()\r\n {\r\n if (this.isDown)\r\n {\r\n return (this.plugin.game.loop.time - this.timeDown);\r\n }\r\n else\r\n {\r\n return 0;\r\n }\r\n },\r\n\r\n /**\r\n * Removes any bound event handlers and removes local references.\r\n *\r\n * @method Phaser.Input.Keyboard.Key#destroy\r\n * @since 3.16.0\r\n */\r\n destroy: function ()\r\n {\r\n this.removeAllListeners();\r\n\r\n this.originalEvent = null;\r\n\r\n this.plugin = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Key;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/keys/Key.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/keys/KeyCodes.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/keys/KeyCodes.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Keyboard Codes.\r\n *\r\n * @namespace Phaser.Input.Keyboard.KeyCodes\r\n * @memberof Phaser.Input.Keyboard\r\n * @since 3.0.0\r\n */\r\n\r\nvar KeyCodes = {\r\n\r\n /**\r\n * The BACKSPACE key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.BACKSPACE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n BACKSPACE: 8,\r\n\r\n /**\r\n * The TAB key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.TAB\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n TAB: 9,\r\n\r\n /**\r\n * The ENTER key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.ENTER\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n ENTER: 13,\r\n\r\n /**\r\n * The SHIFT key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.SHIFT\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n SHIFT: 16,\r\n\r\n /**\r\n * The CTRL key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.CTRL\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n CTRL: 17,\r\n\r\n /**\r\n * The ALT key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.ALT\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n ALT: 18,\r\n\r\n /**\r\n * The PAUSE key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.PAUSE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PAUSE: 19,\r\n\r\n /**\r\n * The CAPS_LOCK key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.CAPS_LOCK\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n CAPS_LOCK: 20,\r\n\r\n /**\r\n * The ESC key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.ESC\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n ESC: 27,\r\n\r\n /**\r\n * The SPACE key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.SPACE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n SPACE: 32,\r\n\r\n /**\r\n * The PAGE_UP key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.PAGE_UP\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PAGE_UP: 33,\r\n\r\n /**\r\n * The PAGE_DOWN key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.PAGE_DOWN\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PAGE_DOWN: 34,\r\n\r\n /**\r\n * The END key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.END\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n END: 35,\r\n\r\n /**\r\n * The HOME key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.HOME\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n HOME: 36,\r\n\r\n /**\r\n * The LEFT key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.LEFT\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LEFT: 37,\r\n\r\n /**\r\n * The UP key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.UP\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n UP: 38,\r\n\r\n /**\r\n * The RIGHT key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.RIGHT\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n RIGHT: 39,\r\n\r\n /**\r\n * The DOWN key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.DOWN\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n DOWN: 40,\r\n\r\n /**\r\n * The PRINT_SCREEN key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.PRINT_SCREEN\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PRINT_SCREEN: 42,\r\n\r\n /**\r\n * The INSERT key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.INSERT\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n INSERT: 45,\r\n\r\n /**\r\n * The DELETE key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.DELETE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n DELETE: 46,\r\n\r\n /**\r\n * The ZERO key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.ZERO\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n ZERO: 48,\r\n\r\n /**\r\n * The ONE key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.ONE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n ONE: 49,\r\n\r\n /**\r\n * The TWO key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.TWO\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n TWO: 50,\r\n\r\n /**\r\n * The THREE key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.THREE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n THREE: 51,\r\n\r\n /**\r\n * The FOUR key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.FOUR\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FOUR: 52,\r\n\r\n /**\r\n * The FIVE key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.FIVE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FIVE: 53,\r\n\r\n /**\r\n * The SIX key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.SIX\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n SIX: 54,\r\n\r\n /**\r\n * The SEVEN key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.SEVEN\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n SEVEN: 55,\r\n\r\n /**\r\n * The EIGHT key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.EIGHT\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n EIGHT: 56,\r\n\r\n /**\r\n * The NINE key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.NINE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n NINE: 57,\r\n\r\n /**\r\n * The NUMPAD_ZERO key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ZERO\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n NUMPAD_ZERO: 96,\r\n\r\n /**\r\n * The NUMPAD_ONE key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ONE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n NUMPAD_ONE: 97,\r\n\r\n /**\r\n * The NUMPAD_TWO key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_TWO\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n NUMPAD_TWO: 98,\r\n\r\n /**\r\n * The NUMPAD_THREE key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_THREE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n NUMPAD_THREE: 99,\r\n\r\n /**\r\n * The NUMPAD_FOUR key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FOUR\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n NUMPAD_FOUR: 100,\r\n\r\n /**\r\n * The NUMPAD_FIVE key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FIVE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n NUMPAD_FIVE: 101,\r\n\r\n /**\r\n * The NUMPAD_SIX key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SIX\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n NUMPAD_SIX: 102,\r\n\r\n /**\r\n * The NUMPAD_SEVEN key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SEVEN\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n NUMPAD_SEVEN: 103,\r\n\r\n /**\r\n * The NUMPAD_EIGHT key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_EIGHT\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n NUMPAD_EIGHT: 104,\r\n\r\n /**\r\n * The NUMPAD_NINE key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_NINE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n NUMPAD_NINE: 105,\r\n\r\n /**\r\n * The Numpad Addition (+) key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ADD\r\n * @type {integer}\r\n * @since 3.21.0\r\n */\r\n NUMPAD_ADD: 107,\r\n\r\n /**\r\n * The Numpad Subtraction (-) key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SUBTRACT\r\n * @type {integer}\r\n * @since 3.21.0\r\n */\r\n NUMPAD_SUBTRACT: 109,\r\n\r\n /**\r\n * The A key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.A\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n A: 65,\r\n\r\n /**\r\n * The B key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.B\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n B: 66,\r\n\r\n /**\r\n * The C key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.C\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n C: 67,\r\n\r\n /**\r\n * The D key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.D\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n D: 68,\r\n\r\n /**\r\n * The E key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.E\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n E: 69,\r\n\r\n /**\r\n * The F key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.F\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n F: 70,\r\n\r\n /**\r\n * The G key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.G\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n G: 71,\r\n\r\n /**\r\n * The H key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.H\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n H: 72,\r\n\r\n /**\r\n * The I key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.I\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n I: 73,\r\n\r\n /**\r\n * The J key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.J\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n J: 74,\r\n\r\n /**\r\n * The K key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.K\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n K: 75,\r\n\r\n /**\r\n * The L key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.L\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n L: 76,\r\n\r\n /**\r\n * The M key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.M\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n M: 77,\r\n\r\n /**\r\n * The N key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.N\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n N: 78,\r\n\r\n /**\r\n * The O key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.O\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n O: 79,\r\n\r\n /**\r\n * The P key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.P\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n P: 80,\r\n\r\n /**\r\n * The Q key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.Q\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n Q: 81,\r\n\r\n /**\r\n * The R key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.R\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n R: 82,\r\n\r\n /**\r\n * The S key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.S\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n S: 83,\r\n\r\n /**\r\n * The T key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.T\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n T: 84,\r\n\r\n /**\r\n * The U key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.U\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n U: 85,\r\n\r\n /**\r\n * The V key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.V\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n V: 86,\r\n\r\n /**\r\n * The W key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.W\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n W: 87,\r\n\r\n /**\r\n * The X key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.X\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n X: 88,\r\n\r\n /**\r\n * The Y key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.Y\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n Y: 89,\r\n\r\n /**\r\n * The Z key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.Z\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n Z: 90,\r\n\r\n /**\r\n * The F1 key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.F1\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n F1: 112,\r\n\r\n /**\r\n * The F2 key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.F2\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n F2: 113,\r\n\r\n /**\r\n * The F3 key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.F3\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n F3: 114,\r\n\r\n /**\r\n * The F4 key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.F4\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n F4: 115,\r\n\r\n /**\r\n * The F5 key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.F5\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n F5: 116,\r\n\r\n /**\r\n * The F6 key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.F6\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n F6: 117,\r\n\r\n /**\r\n * The F7 key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.F7\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n F7: 118,\r\n\r\n /**\r\n * The F8 key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.F8\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n F8: 119,\r\n\r\n /**\r\n * The F9 key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.F9\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n F9: 120,\r\n\r\n /**\r\n * The F10 key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.F10\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n F10: 121,\r\n\r\n /**\r\n * The F11 key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.F11\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n F11: 122,\r\n\r\n /**\r\n * The F12 key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.F12\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n F12: 123,\r\n\r\n /**\r\n * The SEMICOLON key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n SEMICOLON: 186,\r\n\r\n /**\r\n * The PLUS key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.PLUS\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PLUS: 187,\r\n\r\n /**\r\n * The COMMA key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.COMMA\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n COMMA: 188,\r\n\r\n /**\r\n * The MINUS key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.MINUS\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n MINUS: 189,\r\n\r\n /**\r\n * The PERIOD key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.PERIOD\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PERIOD: 190,\r\n\r\n /**\r\n * The FORWARD_SLASH key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.FORWARD_SLASH\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FORWARD_SLASH: 191,\r\n\r\n /**\r\n * The BACK_SLASH key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.BACK_SLASH\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n BACK_SLASH: 220,\r\n\r\n /**\r\n * The QUOTES key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.QUOTES\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n QUOTES: 222,\r\n\r\n /**\r\n * The BACKTICK key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.BACKTICK\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n BACKTICK: 192,\r\n\r\n /**\r\n * The OPEN_BRACKET key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.OPEN_BRACKET\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n OPEN_BRACKET: 219,\r\n\r\n /**\r\n * The CLOSED_BRACKET key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.CLOSED_BRACKET\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n CLOSED_BRACKET: 221,\r\n\r\n /**\r\n * The SEMICOLON_FIREFOX key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON_FIREFOX\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n SEMICOLON_FIREFOX: 59,\r\n\r\n /**\r\n * The COLON key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.COLON\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n COLON: 58,\r\n\r\n /**\r\n * The COMMA_FIREFOX_WINDOWS key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX_WINDOWS\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n COMMA_FIREFOX_WINDOWS: 60,\r\n\r\n /**\r\n * The COMMA_FIREFOX key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n COMMA_FIREFOX: 62,\r\n\r\n /**\r\n * The BRACKET_RIGHT_FIREFOX key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_RIGHT_FIREFOX\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n BRACKET_RIGHT_FIREFOX: 174,\r\n\r\n /**\r\n * The BRACKET_LEFT_FIREFOX key.\r\n * \r\n * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_LEFT_FIREFOX\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n BRACKET_LEFT_FIREFOX: 175\r\n};\r\n\r\nmodule.exports = KeyCodes;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/keys/KeyCodes.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/keys/KeyMap.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/keys/KeyMap.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar KeyCodes = __webpack_require__(/*! ./KeyCodes */ \"./node_modules/phaser/src/input/keyboard/keys/KeyCodes.js\");\r\n\r\nvar KeyMap = {};\r\n\r\nfor (var key in KeyCodes)\r\n{\r\n KeyMap[KeyCodes[key]] = key;\r\n}\r\n\r\nmodule.exports = KeyMap;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/keys/KeyMap.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/keyboard/keys/UpDuration.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/input/keyboard/keys/UpDuration.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns `true` if the Key was released within the `duration` value given, based on the current\r\n * game clock time. Or returns `false` if it either isn't up, or was released longer ago than the given duration.\r\n *\r\n * @function Phaser.Input.Keyboard.UpDuration\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Keyboard.Key} key - The Key object to test.\r\n * @param {integer} [duration=50] - The duration, in ms, within which the key must have been released.\r\n *\r\n * @return {boolean} `true` if the Key was released within `duration` ms ago, otherwise `false`.\r\n */\r\nvar UpDuration = function (key, duration)\r\n{\r\n if (duration === undefined) { duration = 50; }\r\n\r\n var current = key.plugin.game.loop.time - key.timeUp;\r\n\r\n return (key.isUp && current < duration);\r\n};\r\n\r\nmodule.exports = UpDuration;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/keyboard/keys/UpDuration.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/mouse/MouseManager.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/input/mouse/MouseManager.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Features = __webpack_require__(/*! ../../device/Features */ \"./node_modules/phaser/src/device/Features.js\");\r\nvar InputEvents = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/input/events/index.js\");\r\nvar NOOP = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent\r\n// https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\r\n\r\n/**\r\n * @classdesc\r\n * The Mouse Manager is a helper class that belongs to the Input Manager.\r\n * \r\n * Its role is to listen for native DOM Mouse Events and then pass them onto the Input Manager for further processing.\r\n * \r\n * You do not need to create this class directly, the Input Manager will create an instance of it automatically.\r\n *\r\n * @class MouseManager\r\n * @memberof Phaser.Input.Mouse\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.InputManager} inputManager - A reference to the Input Manager.\r\n */\r\nvar MouseManager = new Class({\r\n\r\n initialize:\r\n\r\n function MouseManager (inputManager)\r\n {\r\n /**\r\n * A reference to the Input Manager.\r\n *\r\n * @name Phaser.Input.Mouse.MouseManager#manager\r\n * @type {Phaser.Input.InputManager}\r\n * @since 3.0.0\r\n */\r\n this.manager = inputManager;\r\n\r\n /**\r\n * If true the DOM mouse events will have event.preventDefault applied to them, if false they will propagate fully.\r\n *\r\n * @name Phaser.Input.Mouse.MouseManager#capture\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.capture = true;\r\n\r\n /**\r\n * A boolean that controls if the Mouse Manager is enabled or not.\r\n * Can be toggled on the fly.\r\n *\r\n * @name Phaser.Input.Mouse.MouseManager#enabled\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.enabled = false;\r\n\r\n /**\r\n * The Mouse target, as defined in the Game Config.\r\n * Typically the canvas to which the game is rendering, but can be any interactive DOM element.\r\n *\r\n * @name Phaser.Input.Mouse.MouseManager#target\r\n * @type {any}\r\n * @since 3.0.0\r\n */\r\n this.target;\r\n\r\n /**\r\n * If the mouse has been pointer locked successfully this will be set to true.\r\n *\r\n * @name Phaser.Input.Mouse.MouseManager#locked\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.locked = false;\r\n\r\n /**\r\n * The Mouse Move Event handler.\r\n * This function is sent the native DOM MouseEvent.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Mouse.MouseManager#onMouseMove\r\n * @type {function}\r\n * @since 3.10.0\r\n */\r\n this.onMouseMove = NOOP;\r\n\r\n /**\r\n * The Mouse Down Event handler.\r\n * This function is sent the native DOM MouseEvent.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Mouse.MouseManager#onMouseDown\r\n * @type {function}\r\n * @since 3.10.0\r\n */\r\n this.onMouseDown = NOOP;\r\n\r\n /**\r\n * The Mouse Up Event handler.\r\n * This function is sent the native DOM MouseEvent.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Mouse.MouseManager#onMouseUp\r\n * @type {function}\r\n * @since 3.10.0\r\n */\r\n this.onMouseUp = NOOP;\r\n\r\n /**\r\n * The Mouse Down Event handler specifically for events on the Window.\r\n * This function is sent the native DOM MouseEvent.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Mouse.MouseManager#onMouseDownWindow\r\n * @type {function}\r\n * @since 3.17.0\r\n */\r\n this.onMouseDownWindow = NOOP;\r\n\r\n /**\r\n * The Mouse Up Event handler specifically for events on the Window.\r\n * This function is sent the native DOM MouseEvent.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Mouse.MouseManager#onMouseUpWindow\r\n * @type {function}\r\n * @since 3.17.0\r\n */\r\n this.onMouseUpWindow = NOOP;\r\n\r\n /**\r\n * The Mouse Over Event handler.\r\n * This function is sent the native DOM MouseEvent.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Mouse.MouseManager#onMouseOver\r\n * @type {function}\r\n * @since 3.16.0\r\n */\r\n this.onMouseOver = NOOP;\r\n\r\n /**\r\n * The Mouse Out Event handler.\r\n * This function is sent the native DOM MouseEvent.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Mouse.MouseManager#onMouseOut\r\n * @type {function}\r\n * @since 3.16.0\r\n */\r\n this.onMouseOut = NOOP;\r\n\r\n /**\r\n * The Mouse Wheel Event handler.\r\n * This function is sent the native DOM MouseEvent.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Mouse.MouseManager#onMouseWheel\r\n * @type {function}\r\n * @since 3.18.0\r\n */\r\n this.onMouseWheel = NOOP;\r\n\r\n /**\r\n * Internal pointerLockChange handler.\r\n * This function is sent the native DOM MouseEvent.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Mouse.MouseManager#pointerLockChange\r\n * @type {function}\r\n * @since 3.0.0\r\n */\r\n this.pointerLockChange = NOOP;\r\n\r\n inputManager.events.once(InputEvents.MANAGER_BOOT, this.boot, this);\r\n },\r\n\r\n /**\r\n * The Touch Manager boot process.\r\n *\r\n * @method Phaser.Input.Mouse.MouseManager#boot\r\n * @private\r\n * @since 3.0.0\r\n */\r\n boot: function ()\r\n {\r\n var config = this.manager.config;\r\n\r\n this.enabled = config.inputMouse;\r\n this.target = config.inputMouseEventTarget;\r\n this.capture = config.inputMouseCapture;\r\n\r\n if (!this.target)\r\n {\r\n this.target = this.manager.game.canvas;\r\n }\r\n else if (typeof this.target === 'string')\r\n {\r\n this.target = document.getElementById(this.target);\r\n }\r\n\r\n if (config.disableContextMenu)\r\n {\r\n this.disableContextMenu();\r\n }\r\n\r\n if (this.enabled && this.target)\r\n {\r\n this.startListeners();\r\n }\r\n },\r\n\r\n /**\r\n * Attempts to disable the context menu from appearing if you right-click on the browser.\r\n * \r\n * Works by listening for the `contextmenu` event and prevent defaulting it.\r\n * \r\n * Use this if you need to enable right-button mouse support in your game, and the browser\r\n * menu keeps getting in the way.\r\n *\r\n * @method Phaser.Input.Mouse.MouseManager#disableContextMenu\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Input.Mouse.MouseManager} This Mouse Manager instance.\r\n */\r\n disableContextMenu: function ()\r\n {\r\n document.body.addEventListener('contextmenu', function (event)\r\n {\r\n event.preventDefault();\r\n return false;\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * If the browser supports it, you can request that the pointer be locked to the browser window.\r\n *\r\n * This is classically known as 'FPS controls', where the pointer can't leave the browser until\r\n * the user presses an exit key.\r\n *\r\n * If the browser successfully enters a locked state, a `POINTER_LOCK_CHANGE_EVENT` will be dispatched,\r\n * from the games Input Manager, with an `isPointerLocked` property.\r\n *\r\n * It is important to note that pointer lock can only be enabled after an 'engagement gesture',\r\n * see: https://w3c.github.io/pointerlock/#dfn-engagement-gesture.\r\n *\r\n * @method Phaser.Input.Mouse.MouseManager#requestPointerLock\r\n * @since 3.0.0\r\n */\r\n requestPointerLock: function ()\r\n {\r\n if (Features.pointerLock)\r\n {\r\n var element = this.target;\r\n\r\n element.requestPointerLock = element.requestPointerLock || element.mozRequestPointerLock || element.webkitRequestPointerLock;\r\n\r\n element.requestPointerLock();\r\n }\r\n },\r\n\r\n /**\r\n * If the browser supports pointer lock, this will request that the pointer lock is released. If\r\n * the browser successfully enters a locked state, a 'POINTER_LOCK_CHANGE_EVENT' will be\r\n * dispatched - from the game's input manager - with an `isPointerLocked` property.\r\n *\r\n * @method Phaser.Input.Mouse.MouseManager#releasePointerLock\r\n * @since 3.0.0\r\n */\r\n releasePointerLock: function ()\r\n {\r\n if (Features.pointerLock)\r\n {\r\n document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock;\r\n document.exitPointerLock();\r\n }\r\n },\r\n\r\n /**\r\n * Starts the Mouse Event listeners running.\r\n * This is called automatically and does not need to be manually invoked.\r\n *\r\n * @method Phaser.Input.Mouse.MouseManager#startListeners\r\n * @since 3.0.0\r\n */\r\n startListeners: function ()\r\n {\r\n var _this = this;\r\n var canvas = this.manager.canvas;\r\n var autoFocus = (window && window.focus && this.manager.game.config.autoFocus);\r\n\r\n this.onMouseMove = function (event)\r\n {\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled)\r\n {\r\n _this.manager.onMouseMove(event);\r\n \r\n if (_this.capture)\r\n {\r\n event.preventDefault();\r\n }\r\n }\r\n };\r\n\r\n this.onMouseDown = function (event)\r\n {\r\n if (autoFocus)\r\n {\r\n window.focus();\r\n }\r\n\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled)\r\n {\r\n _this.manager.onMouseDown(event);\r\n \r\n if (_this.capture && event.target === canvas)\r\n {\r\n event.preventDefault();\r\n }\r\n }\r\n };\r\n\r\n this.onMouseDownWindow = function (event)\r\n {\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas)\r\n {\r\n // Only process the event if the target isn't the canvas\r\n _this.manager.onMouseDown(event);\r\n }\r\n };\r\n\r\n this.onMouseUp = function (event)\r\n {\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled)\r\n {\r\n _this.manager.onMouseUp(event);\r\n \r\n if (_this.capture && event.target === canvas)\r\n {\r\n event.preventDefault();\r\n }\r\n }\r\n };\r\n\r\n this.onMouseUpWindow = function (event)\r\n {\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas)\r\n {\r\n // Only process the event if the target isn't the canvas\r\n _this.manager.onMouseUp(event);\r\n }\r\n };\r\n\r\n this.onMouseOver = function (event)\r\n {\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled)\r\n {\r\n _this.manager.setCanvasOver(event);\r\n }\r\n };\r\n\r\n this.onMouseOut = function (event)\r\n {\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled)\r\n {\r\n _this.manager.setCanvasOut(event);\r\n }\r\n };\r\n\r\n this.onMouseWheel = function (event)\r\n {\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled)\r\n {\r\n _this.manager.onMouseWheel(event);\r\n }\r\n };\r\n\r\n var target = this.target;\r\n\r\n if (!target)\r\n {\r\n return;\r\n }\r\n\r\n var passive = { passive: true };\r\n var nonPassive = { passive: false };\r\n\r\n target.addEventListener('mousemove', this.onMouseMove, (this.capture) ? nonPassive : passive);\r\n target.addEventListener('mousedown', this.onMouseDown, (this.capture) ? nonPassive : passive);\r\n target.addEventListener('mouseup', this.onMouseUp, (this.capture) ? nonPassive : passive);\r\n target.addEventListener('mouseover', this.onMouseOver, (this.capture) ? nonPassive : passive);\r\n target.addEventListener('mouseout', this.onMouseOut, (this.capture) ? nonPassive : passive);\r\n target.addEventListener('wheel', this.onMouseWheel, (this.capture) ? nonPassive : passive);\r\n\r\n if (window && this.manager.game.config.inputWindowEvents)\r\n {\r\n window.addEventListener('mousedown', this.onMouseDownWindow, nonPassive);\r\n window.addEventListener('mouseup', this.onMouseUpWindow, nonPassive);\r\n }\r\n\r\n if (Features.pointerLock)\r\n {\r\n this.pointerLockChange = function (event)\r\n {\r\n var element = _this.target;\r\n\r\n _this.locked = (document.pointerLockElement === element || document.mozPointerLockElement === element || document.webkitPointerLockElement === element) ? true : false;\r\n\r\n _this.manager.onPointerLockChange(event);\r\n };\r\n\r\n document.addEventListener('pointerlockchange', this.pointerLockChange, true);\r\n document.addEventListener('mozpointerlockchange', this.pointerLockChange, true);\r\n document.addEventListener('webkitpointerlockchange', this.pointerLockChange, true);\r\n }\r\n\r\n this.enabled = true;\r\n },\r\n\r\n /**\r\n * Stops the Mouse Event listeners.\r\n * This is called automatically and does not need to be manually invoked.\r\n *\r\n * @method Phaser.Input.Mouse.MouseManager#stopListeners\r\n * @since 3.0.0\r\n */\r\n stopListeners: function ()\r\n {\r\n var target = this.target;\r\n\r\n target.removeEventListener('mousemove', this.onMouseMove);\r\n target.removeEventListener('mousedown', this.onMouseDown);\r\n target.removeEventListener('mouseup', this.onMouseUp);\r\n target.removeEventListener('mouseover', this.onMouseOver);\r\n target.removeEventListener('mouseout', this.onMouseOut);\r\n\r\n if (window)\r\n {\r\n window.removeEventListener('mousedown', this.onMouseDownWindow);\r\n window.removeEventListener('mouseup', this.onMouseUpWindow);\r\n }\r\n\r\n if (Features.pointerLock)\r\n {\r\n document.removeEventListener('pointerlockchange', this.pointerLockChange, true);\r\n document.removeEventListener('mozpointerlockchange', this.pointerLockChange, true);\r\n document.removeEventListener('webkitpointerlockchange', this.pointerLockChange, true);\r\n }\r\n },\r\n\r\n /**\r\n * Destroys this Mouse Manager instance.\r\n *\r\n * @method Phaser.Input.Mouse.MouseManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.stopListeners();\r\n\r\n this.target = null;\r\n this.enabled = false;\r\n this.manager = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = MouseManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/mouse/MouseManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/mouse/index.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/input/mouse/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Input.Mouse\r\n */\r\n\r\n/* eslint-disable */\r\nmodule.exports = {\r\n\r\n MouseManager: __webpack_require__(/*! ./MouseManager */ \"./node_modules/phaser/src/input/mouse/MouseManager.js\")\r\n \r\n};\r\n/* eslint-enable */\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/mouse/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/touch/TouchManager.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/input/touch/TouchManager.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar InputEvents = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/input/events/index.js\");\r\nvar NOOP = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\n// https://developer.mozilla.org/en-US/docs/Web/API/Touch_events\r\n// https://patrickhlauke.github.io/touch/tests/results/\r\n// https://www.html5rocks.com/en/mobile/touch/\r\n\r\n/**\r\n * @classdesc\r\n * The Touch Manager is a helper class that belongs to the Input Manager.\r\n * \r\n * Its role is to listen for native DOM Touch Events and then pass them onto the Input Manager for further processing.\r\n * \r\n * You do not need to create this class directly, the Input Manager will create an instance of it automatically.\r\n *\r\n * @class TouchManager\r\n * @memberof Phaser.Input.Touch\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.InputManager} inputManager - A reference to the Input Manager.\r\n */\r\nvar TouchManager = new Class({\r\n\r\n initialize:\r\n\r\n function TouchManager (inputManager)\r\n {\r\n /**\r\n * A reference to the Input Manager.\r\n *\r\n * @name Phaser.Input.Touch.TouchManager#manager\r\n * @type {Phaser.Input.InputManager}\r\n * @since 3.0.0\r\n */\r\n this.manager = inputManager;\r\n\r\n /**\r\n * If true the DOM events will have event.preventDefault applied to them, if false they will propagate fully.\r\n *\r\n * @name Phaser.Input.Touch.TouchManager#capture\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.capture = true;\r\n\r\n /**\r\n * A boolean that controls if the Touch Manager is enabled or not.\r\n * Can be toggled on the fly.\r\n *\r\n * @name Phaser.Input.Touch.TouchManager#enabled\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.enabled = false;\r\n\r\n /**\r\n * The Touch Event target, as defined in the Game Config.\r\n * Typically the canvas to which the game is rendering, but can be any interactive DOM element.\r\n *\r\n * @name Phaser.Input.Touch.TouchManager#target\r\n * @type {any}\r\n * @since 3.0.0\r\n */\r\n this.target;\r\n\r\n /**\r\n * The Touch Start event handler function.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Touch.TouchManager#onTouchStart\r\n * @type {function}\r\n * @since 3.0.0\r\n */\r\n this.onTouchStart = NOOP;\r\n\r\n /**\r\n * The Touch Start event handler function specifically for events on the Window.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Touch.TouchManager#onTouchStartWindow\r\n * @type {function}\r\n * @since 3.17.0\r\n */\r\n this.onTouchStartWindow = NOOP;\r\n\r\n /**\r\n * The Touch Move event handler function.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Touch.TouchManager#onTouchMove\r\n * @type {function}\r\n * @since 3.0.0\r\n */\r\n this.onTouchMove = NOOP;\r\n\r\n /**\r\n * The Touch End event handler function.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Touch.TouchManager#onTouchEnd\r\n * @type {function}\r\n * @since 3.0.0\r\n */\r\n this.onTouchEnd = NOOP;\r\n\r\n /**\r\n * The Touch End event handler function specifically for events on the Window.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Touch.TouchManager#onTouchEndWindow\r\n * @type {function}\r\n * @since 3.17.0\r\n */\r\n this.onTouchEndWindow = NOOP;\r\n\r\n /**\r\n * The Touch Cancel event handler function.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Touch.TouchManager#onTouchCancel\r\n * @type {function}\r\n * @since 3.15.0\r\n */\r\n this.onTouchCancel = NOOP;\r\n\r\n /**\r\n * The Touch Cancel event handler function specifically for events on the Window.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Touch.TouchManager#onTouchCancelWindow\r\n * @type {function}\r\n * @since 3.18.0\r\n */\r\n this.onTouchCancelWindow = NOOP;\r\n\r\n /**\r\n * The Touch Over event handler function.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Touch.TouchManager#onTouchOver\r\n * @type {function}\r\n * @since 3.16.0\r\n */\r\n this.onTouchOver = NOOP;\r\n\r\n /**\r\n * The Touch Out event handler function.\r\n * Initially empty and bound in the `startListeners` method.\r\n *\r\n * @name Phaser.Input.Touch.TouchManager#onTouchOut\r\n * @type {function}\r\n * @since 3.16.0\r\n */\r\n this.onTouchOut = NOOP;\r\n\r\n inputManager.events.once(InputEvents.MANAGER_BOOT, this.boot, this);\r\n },\r\n\r\n /**\r\n * The Touch Manager boot process.\r\n *\r\n * @method Phaser.Input.Touch.TouchManager#boot\r\n * @private\r\n * @since 3.0.0\r\n */\r\n boot: function ()\r\n {\r\n var config = this.manager.config;\r\n\r\n this.enabled = config.inputTouch;\r\n this.target = config.inputTouchEventTarget;\r\n this.capture = config.inputTouchCapture;\r\n\r\n if (!this.target)\r\n {\r\n this.target = this.manager.game.canvas;\r\n }\r\n\r\n if (config.disableContextMenu)\r\n {\r\n this.disableContextMenu();\r\n }\r\n\r\n if (this.enabled && this.target)\r\n {\r\n this.startListeners();\r\n }\r\n },\r\n\r\n /**\r\n * Attempts to disable the context menu from appearing if you touch-hold on the browser.\r\n * \r\n * Works by listening for the `contextmenu` event and prevent defaulting it.\r\n * \r\n * Use this if you need to disable the OS context menu on mobile.\r\n *\r\n * @method Phaser.Input.Touch.TouchManager#disableContextMenu\r\n * @since 3.20.0\r\n *\r\n * @return {Phaser.Input.Touch.TouchManager} This Touch Manager instance.\r\n */\r\n disableContextMenu: function ()\r\n {\r\n document.body.addEventListener('contextmenu', function (event)\r\n {\r\n event.preventDefault();\r\n return false;\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Starts the Touch Event listeners running as long as an input target is set.\r\n * \r\n * This method is called automatically if Touch Input is enabled in the game config,\r\n * which it is by default. However, you can call it manually should you need to\r\n * delay input capturing until later in the game.\r\n *\r\n * @method Phaser.Input.Touch.TouchManager#startListeners\r\n * @since 3.0.0\r\n */\r\n startListeners: function ()\r\n {\r\n var _this = this;\r\n var canvas = this.manager.canvas;\r\n var autoFocus = (window && window.focus && this.manager.game.config.autoFocus);\r\n\r\n this.onTouchStart = function (event)\r\n {\r\n if (autoFocus)\r\n {\r\n window.focus();\r\n }\r\n\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled)\r\n {\r\n _this.manager.onTouchStart(event);\r\n \r\n if (_this.capture && event.cancelable && event.target === canvas)\r\n {\r\n event.preventDefault();\r\n }\r\n }\r\n };\r\n\r\n this.onTouchStartWindow = function (event)\r\n {\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas)\r\n {\r\n // Only process the event if the target isn't the canvas\r\n _this.manager.onTouchStart(event);\r\n }\r\n };\r\n\r\n this.onTouchMove = function (event)\r\n {\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled)\r\n {\r\n _this.manager.onTouchMove(event);\r\n \r\n if (_this.capture && event.cancelable)\r\n {\r\n event.preventDefault();\r\n }\r\n }\r\n };\r\n\r\n this.onTouchEnd = function (event)\r\n {\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled)\r\n {\r\n _this.manager.onTouchEnd(event);\r\n \r\n if (_this.capture && event.cancelable && event.target === canvas)\r\n {\r\n event.preventDefault();\r\n }\r\n }\r\n };\r\n\r\n this.onTouchEndWindow = function (event)\r\n {\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas)\r\n {\r\n // Only process the event if the target isn't the canvas\r\n _this.manager.onTouchEnd(event);\r\n }\r\n };\r\n\r\n this.onTouchCancel = function (event)\r\n {\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled)\r\n {\r\n _this.manager.onTouchCancel(event);\r\n \r\n if (_this.capture)\r\n {\r\n event.preventDefault();\r\n }\r\n }\r\n };\r\n\r\n this.onTouchCancelWindow = function (event)\r\n {\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled)\r\n {\r\n _this.manager.onTouchCancel(event);\r\n }\r\n };\r\n\r\n this.onTouchOver = function (event)\r\n {\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled)\r\n {\r\n _this.manager.setCanvasOver(event);\r\n }\r\n };\r\n\r\n this.onTouchOut = function (event)\r\n {\r\n if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled)\r\n {\r\n _this.manager.setCanvasOut(event);\r\n }\r\n };\r\n\r\n var target = this.target;\r\n\r\n if (!target)\r\n {\r\n return;\r\n }\r\n\r\n var passive = { passive: true };\r\n var nonPassive = { passive: false };\r\n\r\n target.addEventListener('touchstart', this.onTouchStart, (this.capture) ? nonPassive : passive);\r\n target.addEventListener('touchmove', this.onTouchMove, (this.capture) ? nonPassive : passive);\r\n target.addEventListener('touchend', this.onTouchEnd, (this.capture) ? nonPassive : passive);\r\n target.addEventListener('touchcancel', this.onTouchCancel, (this.capture) ? nonPassive : passive);\r\n target.addEventListener('touchover', this.onTouchOver, (this.capture) ? nonPassive : passive);\r\n target.addEventListener('touchout', this.onTouchOut, (this.capture) ? nonPassive : passive);\r\n\r\n if (window && this.manager.game.config.inputWindowEvents)\r\n {\r\n window.addEventListener('touchstart', this.onTouchStartWindow, nonPassive);\r\n window.addEventListener('touchend', this.onTouchEndWindow, nonPassive);\r\n window.addEventListener('touchcancel', this.onTouchCancelWindow, nonPassive);\r\n }\r\n\r\n this.enabled = true;\r\n },\r\n\r\n /**\r\n * Stops the Touch Event listeners.\r\n * This is called automatically and does not need to be manually invoked.\r\n *\r\n * @method Phaser.Input.Touch.TouchManager#stopListeners\r\n * @since 3.0.0\r\n */\r\n stopListeners: function ()\r\n {\r\n var target = this.target;\r\n\r\n target.removeEventListener('touchstart', this.onTouchStart);\r\n target.removeEventListener('touchmove', this.onTouchMove);\r\n target.removeEventListener('touchend', this.onTouchEnd);\r\n target.removeEventListener('touchcancel', this.onTouchCancel);\r\n target.removeEventListener('touchover', this.onTouchOver);\r\n target.removeEventListener('touchout', this.onTouchOut);\r\n\r\n if (window)\r\n {\r\n window.removeEventListener('touchstart', this.onTouchStartWindow);\r\n window.removeEventListener('touchend', this.onTouchEndWindow);\r\n }\r\n },\r\n\r\n /**\r\n * Destroys this Touch Manager instance.\r\n *\r\n * @method Phaser.Input.Touch.TouchManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.stopListeners();\r\n\r\n this.target = null;\r\n this.enabled = false;\r\n this.manager = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = TouchManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/touch/TouchManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/input/touch/index.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/input/touch/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Input.Touch\r\n */\r\n\r\n/* eslint-disable */\r\nmodule.exports = {\r\n\r\n TouchManager: __webpack_require__(/*! ./TouchManager */ \"./node_modules/phaser/src/input/touch/TouchManager.js\")\r\n \r\n};\r\n/* eslint-enable */\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/input/touch/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/File.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/loader/File.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/loader/events/index.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar GetURL = __webpack_require__(/*! ./GetURL */ \"./node_modules/phaser/src/loader/GetURL.js\");\r\nvar MergeXHRSettings = __webpack_require__(/*! ./MergeXHRSettings */ \"./node_modules/phaser/src/loader/MergeXHRSettings.js\");\r\nvar XHRLoader = __webpack_require__(/*! ./XHRLoader */ \"./node_modules/phaser/src/loader/XHRLoader.js\");\r\nvar XHRSettings = __webpack_require__(/*! ./XHRSettings */ \"./node_modules/phaser/src/loader/XHRSettings.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The base File class used by all File Types that the Loader can support.\r\n * You shouldn't create an instance of a File directly, but should extend it with your own class, setting a custom type and processing methods.\r\n *\r\n * @class File\r\n * @memberof Phaser.Loader\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File.\r\n * @param {Phaser.Types.Loader.FileConfig} fileConfig - The file configuration object, as created by the file type.\r\n */\r\nvar File = new Class({\r\n\r\n initialize:\r\n\r\n function File (loader, fileConfig)\r\n {\r\n /**\r\n * A reference to the Loader that is going to load this file.\r\n *\r\n * @name Phaser.Loader.File#loader\r\n * @type {Phaser.Loader.LoaderPlugin}\r\n * @since 3.0.0\r\n */\r\n this.loader = loader;\r\n\r\n /**\r\n * A reference to the Cache, or Texture Manager, that is going to store this file if it loads.\r\n *\r\n * @name Phaser.Loader.File#cache\r\n * @type {(Phaser.Cache.BaseCache|Phaser.Textures.TextureManager)}\r\n * @since 3.7.0\r\n */\r\n this.cache = GetFastValue(fileConfig, 'cache', false);\r\n\r\n /**\r\n * The file type string (image, json, etc) for sorting within the Loader.\r\n *\r\n * @name Phaser.Loader.File#type\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.type = GetFastValue(fileConfig, 'type', false);\r\n\r\n /**\r\n * Unique cache key (unique within its file type)\r\n *\r\n * @name Phaser.Loader.File#key\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.key = GetFastValue(fileConfig, 'key', false);\r\n\r\n var loadKey = this.key;\r\n\r\n if (loader.prefix && loader.prefix !== '')\r\n {\r\n this.key = loader.prefix + loadKey;\r\n }\r\n\r\n if (!this.type || !this.key)\r\n {\r\n throw new Error('Error calling \\'Loader.' + this.type + '\\' invalid key provided.');\r\n }\r\n\r\n /**\r\n * The URL of the file, not including baseURL.\r\n * Automatically has Loader.path prepended to it.\r\n *\r\n * @name Phaser.Loader.File#url\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.url = GetFastValue(fileConfig, 'url');\r\n\r\n if (this.url === undefined)\r\n {\r\n this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', '');\r\n }\r\n else if (typeof(this.url) !== 'function')\r\n {\r\n this.url = loader.path + this.url;\r\n }\r\n\r\n /**\r\n * The final URL this file will load from, including baseURL and path.\r\n * Set automatically when the Loader calls 'load' on this file.\r\n *\r\n * @name Phaser.Loader.File#src\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.src = '';\r\n\r\n /**\r\n * The merged XHRSettings for this file.\r\n *\r\n * @name Phaser.Loader.File#xhrSettings\r\n * @type {Phaser.Types.Loader.XHRSettingsObject}\r\n * @since 3.0.0\r\n */\r\n this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined));\r\n\r\n if (GetFastValue(fileConfig, 'xhrSettings', false))\r\n {\r\n this.xhrSettings = MergeXHRSettings(this.xhrSettings, GetFastValue(fileConfig, 'xhrSettings', {}));\r\n }\r\n\r\n /**\r\n * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File.\r\n *\r\n * @name Phaser.Loader.File#xhrLoader\r\n * @type {?XMLHttpRequest}\r\n * @since 3.0.0\r\n */\r\n this.xhrLoader = null;\r\n\r\n /**\r\n * The current state of the file. One of the FILE_CONST values.\r\n *\r\n * @name Phaser.Loader.File#state\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING;\r\n\r\n /**\r\n * The total size of this file.\r\n * Set by onProgress and only if loading via XHR.\r\n *\r\n * @name Phaser.Loader.File#bytesTotal\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.bytesTotal = 0;\r\n\r\n /**\r\n * Updated as the file loads.\r\n * Only set if loading via XHR.\r\n *\r\n * @name Phaser.Loader.File#bytesLoaded\r\n * @type {number}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.bytesLoaded = -1;\r\n\r\n /**\r\n * A percentage value between 0 and 1 indicating how much of this file has loaded.\r\n * Only set if loading via XHR.\r\n *\r\n * @name Phaser.Loader.File#percentComplete\r\n * @type {number}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.percentComplete = -1;\r\n\r\n /**\r\n * For CORs based loading.\r\n * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set)\r\n *\r\n * @name Phaser.Loader.File#crossOrigin\r\n * @type {(string|undefined)}\r\n * @since 3.0.0\r\n */\r\n this.crossOrigin = undefined;\r\n\r\n /**\r\n * The processed file data, stored here after the file has loaded.\r\n *\r\n * @name Phaser.Loader.File#data\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.data = undefined;\r\n\r\n /**\r\n * A config object that can be used by file types to store transitional data.\r\n *\r\n * @name Phaser.Loader.File#config\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.config = GetFastValue(fileConfig, 'config', {});\r\n\r\n /**\r\n * If this is a multipart file, i.e. an atlas and its json together, then this is a reference\r\n * to the parent MultiFile. Set and used internally by the Loader or specific file types.\r\n *\r\n * @name Phaser.Loader.File#multiFile\r\n * @type {?Phaser.Loader.MultiFile}\r\n * @since 3.7.0\r\n */\r\n this.multiFile;\r\n\r\n /**\r\n * Does this file have an associated linked file? Such as an image and a normal map.\r\n * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't\r\n * actually bound by data, where-as a linkFile is.\r\n *\r\n * @name Phaser.Loader.File#linkFile\r\n * @type {?Phaser.Loader.File}\r\n * @since 3.7.0\r\n */\r\n this.linkFile;\r\n },\r\n\r\n /**\r\n * Links this File with another, so they depend upon each other for loading and processing.\r\n *\r\n * @method Phaser.Loader.File#setLink\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} fileB - The file to link to this one.\r\n */\r\n setLink: function (fileB)\r\n {\r\n this.linkFile = fileB;\r\n\r\n fileB.linkFile = this;\r\n },\r\n\r\n /**\r\n * Resets the XHRLoader instance this file is using.\r\n *\r\n * @method Phaser.Loader.File#resetXHR\r\n * @since 3.0.0\r\n */\r\n resetXHR: function ()\r\n {\r\n if (this.xhrLoader)\r\n {\r\n this.xhrLoader.onload = undefined;\r\n this.xhrLoader.onerror = undefined;\r\n this.xhrLoader.onprogress = undefined;\r\n }\r\n },\r\n\r\n /**\r\n * Called by the Loader, starts the actual file downloading.\r\n * During the load the methods onLoad, onError and onProgress are called, based on the XHR events.\r\n * You shouldn't normally call this method directly, it's meant to be invoked by the Loader.\r\n *\r\n * @method Phaser.Loader.File#load\r\n * @since 3.0.0\r\n */\r\n load: function ()\r\n {\r\n if (this.state === CONST.FILE_POPULATED)\r\n {\r\n // Can happen for example in a JSONFile if they've provided a JSON object instead of a URL\r\n this.loader.nextFile(this, true);\r\n }\r\n else\r\n {\r\n this.src = GetURL(this, this.loader.baseURL);\r\n\r\n if (this.src.indexOf('data:') === 0)\r\n {\r\n console.warn('Local data URIs are not supported: ' + this.key);\r\n }\r\n else\r\n {\r\n // The creation of this XHRLoader starts the load process going.\r\n // It will automatically call the following, based on the load outcome:\r\n // \r\n // xhr.onload = this.onLoad\r\n // xhr.onerror = this.onError\r\n // xhr.onprogress = this.onProgress\r\n\r\n this.xhrLoader = XHRLoader(this, this.loader.xhr);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Called when the file finishes loading, is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.File#onLoad\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event.\r\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load.\r\n */\r\n onLoad: function (xhr, event)\r\n {\r\n var localFileOk = ((xhr.responseURL && xhr.responseURL.indexOf('file://') === 0 && event.target.status === 0));\r\n\r\n var success = !(event.target && event.target.status !== 200) || localFileOk;\r\n\r\n // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called.\r\n if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599)\r\n {\r\n success = false;\r\n }\r\n\r\n this.resetXHR();\r\n\r\n this.loader.nextFile(this, success);\r\n },\r\n\r\n /**\r\n * Called if the file errors while loading, is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.File#onError\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event.\r\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this error.\r\n */\r\n onError: function ()\r\n {\r\n this.resetXHR();\r\n\r\n this.loader.nextFile(this, false);\r\n },\r\n\r\n /**\r\n * Called during the file load progress. Is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.File#onProgress\r\n * @fires Phaser.Loader.Events#FILE_PROGRESS\r\n * @since 3.0.0\r\n *\r\n * @param {ProgressEvent} event - The DOM ProgressEvent.\r\n */\r\n onProgress: function (event)\r\n {\r\n if (event.lengthComputable)\r\n {\r\n this.bytesLoaded = event.loaded;\r\n this.bytesTotal = event.total;\r\n\r\n this.percentComplete = Math.min((this.bytesLoaded / this.bytesTotal), 1);\r\n\r\n this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete);\r\n }\r\n },\r\n\r\n /**\r\n * Usually overridden by the FileTypes and is called by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage.\r\n *\r\n * @method Phaser.Loader.File#onProcess\r\n * @since 3.0.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.onProcessComplete();\r\n },\r\n\r\n /**\r\n * Called when the File has completed processing.\r\n * Checks on the state of its multifile, if set.\r\n *\r\n * @method Phaser.Loader.File#onProcessComplete\r\n * @since 3.7.0\r\n */\r\n onProcessComplete: function ()\r\n {\r\n this.state = CONST.FILE_COMPLETE;\r\n\r\n if (this.multiFile)\r\n {\r\n this.multiFile.onFileComplete(this);\r\n }\r\n\r\n this.loader.fileProcessComplete(this);\r\n },\r\n\r\n /**\r\n * Called when the File has completed processing but it generated an error.\r\n * Checks on the state of its multifile, if set.\r\n *\r\n * @method Phaser.Loader.File#onProcessError\r\n * @since 3.7.0\r\n */\r\n onProcessError: function ()\r\n {\r\n this.state = CONST.FILE_ERRORED;\r\n\r\n if (this.multiFile)\r\n {\r\n this.multiFile.onFileFailed(this);\r\n }\r\n\r\n this.loader.fileProcessComplete(this);\r\n },\r\n\r\n /**\r\n * Checks if a key matching the one used by this file exists in the target Cache or not.\r\n * This is called automatically by the LoaderPlugin to decide if the file can be safely\r\n * loaded or will conflict.\r\n *\r\n * @method Phaser.Loader.File#hasCacheConflict\r\n * @since 3.7.0\r\n *\r\n * @return {boolean} `true` if adding this file will cause a conflict, otherwise `false`.\r\n */\r\n hasCacheConflict: function ()\r\n {\r\n return (this.cache && this.cache.exists(this.key));\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n * This method is often overridden by specific file types.\r\n *\r\n * @method Phaser.Loader.File#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.cache)\r\n {\r\n this.cache.add(this.key, this.data);\r\n }\r\n\r\n this.pendingDestroy();\r\n },\r\n\r\n /**\r\n * Called once the file has been added to its cache and is now ready for deletion from the Loader.\r\n * It will emit a `filecomplete` event from the LoaderPlugin.\r\n *\r\n * @method Phaser.Loader.File#pendingDestroy\r\n * @fires Phaser.Loader.Events#FILE_COMPLETE\r\n * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE\r\n * @since 3.7.0\r\n */\r\n pendingDestroy: function (data)\r\n {\r\n if (data === undefined) { data = this.data; }\r\n\r\n var key = this.key;\r\n var type = this.type;\r\n\r\n this.loader.emit(Events.FILE_COMPLETE, key, type, data);\r\n this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data);\r\n\r\n this.loader.flagForRemoval(this);\r\n },\r\n\r\n /**\r\n * Destroy this File and any references it holds.\r\n *\r\n * @method Phaser.Loader.File#destroy\r\n * @since 3.7.0\r\n */\r\n destroy: function ()\r\n {\r\n this.loader = null;\r\n this.cache = null;\r\n this.xhrSettings = null;\r\n this.multiFile = null;\r\n this.linkFile = null;\r\n this.data = null;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Static method for creating object URL using URL API and setting it as image 'src' attribute.\r\n * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader.\r\n *\r\n * @method Phaser.Loader.File.createObjectURL\r\n * @static\r\n * @since 3.7.0\r\n * \r\n * @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL.\r\n * @param {Blob} blob - A Blob object to create an object URL for.\r\n * @param {string} defaultType - Default mime type used if blob type is not available.\r\n */\r\nFile.createObjectURL = function (image, blob, defaultType)\r\n{\r\n if (typeof URL === 'function')\r\n {\r\n image.src = URL.createObjectURL(blob);\r\n }\r\n else\r\n {\r\n var reader = new FileReader();\r\n\r\n reader.onload = function ()\r\n {\r\n image.removeAttribute('crossOrigin');\r\n image.src = 'data:' + (blob.type || defaultType) + ';base64,' + reader.result.split(',')[1];\r\n };\r\n\r\n reader.onerror = image.onerror;\r\n\r\n reader.readAsDataURL(blob);\r\n }\r\n};\r\n\r\n/**\r\n * Static method for releasing an existing object URL which was previously created\r\n * by calling {@link File#createObjectURL} method.\r\n *\r\n * @method Phaser.Loader.File.revokeObjectURL\r\n * @static\r\n * @since 3.7.0\r\n * \r\n * @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked.\r\n */\r\nFile.revokeObjectURL = function (image)\r\n{\r\n if (typeof URL === 'function')\r\n {\r\n URL.revokeObjectURL(image.src);\r\n }\r\n};\r\n\r\nmodule.exports = File;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/File.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/FileTypesManager.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/loader/FileTypesManager.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar types = {};\r\n\r\n/**\r\n * @namespace Phaser.Loader.FileTypesManager\r\n */\r\n\r\nvar FileTypesManager = {\r\n\r\n /**\r\n * Static method called when a LoaderPlugin is created.\r\n * \r\n * Loops through the local types object and injects all of them as\r\n * properties into the LoaderPlugin instance.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.install\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into.\r\n */\r\n install: function (loader)\r\n {\r\n for (var key in types)\r\n {\r\n loader[key] = types[key];\r\n }\r\n },\r\n\r\n /**\r\n * Static method called directly by the File Types.\r\n * \r\n * The key is a reference to the function used to load the files via the Loader, i.e. `image`.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.register\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key that will be used as the method name in the LoaderPlugin.\r\n * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked.\r\n */\r\n register: function (key, factoryFunction)\r\n {\r\n types[key] = factoryFunction;\r\n },\r\n\r\n /**\r\n * Removed all associated file types.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n types = {};\r\n }\r\n\r\n};\r\n\r\nmodule.exports = FileTypesManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/FileTypesManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/GetURL.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/loader/GetURL.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Given a File and a baseURL value this returns the URL the File will use to download from.\r\n *\r\n * @function Phaser.Loader.GetURL\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File object.\r\n * @param {string} baseURL - A default base URL.\r\n *\r\n * @return {string} The URL the File will use.\r\n */\r\nvar GetURL = function (file, baseURL)\r\n{\r\n if (!file.url)\r\n {\r\n return false;\r\n }\r\n\r\n if (file.url.match(/^(?:blob:|data:|http:\\/\\/|https:\\/\\/|\\/\\/)/))\r\n {\r\n return file.url;\r\n }\r\n else\r\n {\r\n return baseURL + file.url;\r\n }\r\n};\r\n\r\nmodule.exports = GetURL;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/GetURL.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/LoaderPlugin.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/loader/LoaderPlugin.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar CustomSet = __webpack_require__(/*! ../structs/Set */ \"./node_modules/phaser/src/structs/Set.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/loader/events/index.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ./FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar PluginCache = __webpack_require__(/*! ../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar SceneEvents = __webpack_require__(/*! ../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\nvar XHRSettings = __webpack_require__(/*! ./XHRSettings */ \"./node_modules/phaser/src/loader/XHRSettings.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Loader handles loading all external content such as Images, Sounds, Texture Atlases and data files.\r\n * You typically interact with it via `this.load` in your Scene. Scenes can have a `preload` method, which is always\r\n * called before the Scenes `create` method, allowing you to preload assets that the Scene may need.\r\n *\r\n * If you call any `this.load` methods from outside of `Scene.preload` then you need to start the Loader going\r\n * yourself by calling `Loader.start()`. It's only automatically started during the Scene preload.\r\n *\r\n * The Loader uses a combination of tag loading (eg. Audio elements) and XHR and provides progress and completion events.\r\n * Files are loaded in parallel by default. The amount of concurrent connections can be controlled in your Game Configuration.\r\n *\r\n * Once the Loader has started loading you are still able to add files to it. These can be injected as a result of a loader\r\n * event, the type of file being loaded (such as a pack file) or other external events. As long as the Loader hasn't finished\r\n * simply adding a new file to it, while running, will ensure it's added into the current queue.\r\n *\r\n * Every Scene has its own instance of the Loader and they are bound to the Scene in which they are created. However,\r\n * assets loaded by the Loader are placed into global game-level caches. For example, loading an XML file will place that\r\n * file inside `Game.cache.xml`, which is accessible from every Scene in your game, no matter who was responsible\r\n * for loading it. The same is true of Textures. A texture loaded in one Scene is instantly available to all other Scenes\r\n * in your game.\r\n *\r\n * The Loader works by using custom File Types. These are stored in the FileTypesManager, which injects them into the Loader\r\n * when it's instantiated. You can create your own custom file types by extending either the File or MultiFile classes.\r\n * See those files for more details.\r\n *\r\n * @class LoaderPlugin\r\n * @extends Phaser.Events.EventEmitter\r\n * @memberof Phaser.Loader\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene which owns this Loader instance.\r\n */\r\nvar LoaderPlugin = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function LoaderPlugin (scene)\r\n {\r\n EventEmitter.call(this);\r\n\r\n var gameConfig = scene.sys.game.config;\r\n var sceneConfig = scene.sys.settings.loader;\r\n\r\n /**\r\n * The Scene which owns this Loader instance.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A reference to the Scene Systems.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n /**\r\n * A reference to the global Cache Manager.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#cacheManager\r\n * @type {Phaser.Cache.CacheManager}\r\n * @since 3.7.0\r\n */\r\n this.cacheManager = scene.sys.cache;\r\n\r\n /**\r\n * A reference to the global Texture Manager.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#textureManager\r\n * @type {Phaser.Textures.TextureManager}\r\n * @since 3.7.0\r\n */\r\n this.textureManager = scene.sys.textures;\r\n\r\n /**\r\n * A reference to the global Scene Manager.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#sceneManager\r\n * @type {Phaser.Scenes.SceneManager}\r\n * @protected\r\n * @since 3.16.0\r\n */\r\n this.sceneManager = scene.sys.game.scene;\r\n\r\n // Inject the available filetypes into the Loader\r\n FileTypesManager.install(this);\r\n\r\n /**\r\n * An optional prefix that is automatically prepended to the start of every file key.\r\n * If prefix was `MENU.` and you load an image with the key 'Background' the resulting key would be `MENU.Background`.\r\n * You can set this directly, or call `Loader.setPrefix()`. It will then affect every file added to the Loader\r\n * from that point on. It does _not_ change any file already in the load queue.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#prefix\r\n * @type {string}\r\n * @default ''\r\n * @since 3.7.0\r\n */\r\n this.prefix = '';\r\n\r\n /**\r\n * The value of `path`, if set, is placed before any _relative_ file path given. For example:\r\n *\r\n * ```javascript\r\n * this.load.path = \"images/sprites/\";\r\n * this.load.image(\"ball\", \"ball.png\");\r\n * this.load.image(\"tree\", \"level1/oaktree.png\");\r\n * this.load.image(\"boom\", \"http://server.com/explode.png\");\r\n * ```\r\n *\r\n * Would load the `ball` file from `images/sprites/ball.png` and the tree from\r\n * `images/sprites/level1/oaktree.png` but the file `boom` would load from the URL\r\n * given as it's an absolute URL.\r\n *\r\n * Please note that the path is added before the filename but *after* the baseURL (if set.)\r\n *\r\n * If you set this property directly then it _must_ end with a \"/\". Alternatively, call `setPath()` and it'll do it for you.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#path\r\n * @type {string}\r\n * @default ''\r\n * @since 3.0.0\r\n */\r\n this.path = '';\r\n\r\n /**\r\n * If you want to append a URL before the path of any asset you can set this here.\r\n * \r\n * Useful if allowing the asset base url to be configured outside of the game code.\r\n * \r\n * If you set this property directly then it _must_ end with a \"/\". Alternatively, call `setBaseURL()` and it'll do it for you.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#baseURL\r\n * @type {string}\r\n * @default ''\r\n * @since 3.0.0\r\n */\r\n this.baseURL = '';\r\n\r\n this.setBaseURL(GetFastValue(sceneConfig, 'baseURL', gameConfig.loaderBaseURL));\r\n\r\n this.setPath(GetFastValue(sceneConfig, 'path', gameConfig.loaderPath));\r\n\r\n this.setPrefix(GetFastValue(sceneConfig, 'prefix', gameConfig.loaderPrefix));\r\n\r\n /**\r\n * The number of concurrent / parallel resources to try and fetch at once.\r\n *\r\n * Old browsers limit 6 requests per domain; modern ones, especially those with HTTP/2 don't limit it at all.\r\n *\r\n * The default is 32 but you can change this in your Game Config, or by changing this property before the Loader starts.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#maxParallelDownloads\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.maxParallelDownloads = GetFastValue(sceneConfig, 'maxParallelDownloads', gameConfig.loaderMaxParallelDownloads);\r\n\r\n /**\r\n * xhr specific global settings (can be overridden on a per-file basis)\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#xhr\r\n * @type {Phaser.Types.Loader.XHRSettingsObject}\r\n * @since 3.0.0\r\n */\r\n this.xhr = XHRSettings(\r\n GetFastValue(sceneConfig, 'responseType', gameConfig.loaderResponseType),\r\n GetFastValue(sceneConfig, 'async', gameConfig.loaderAsync),\r\n GetFastValue(sceneConfig, 'user', gameConfig.loaderUser),\r\n GetFastValue(sceneConfig, 'password', gameConfig.loaderPassword),\r\n GetFastValue(sceneConfig, 'timeout', gameConfig.loaderTimeout)\r\n );\r\n\r\n /**\r\n * The crossOrigin value applied to loaded images. Very often this needs to be set to 'anonymous'.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#crossOrigin\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.crossOrigin = GetFastValue(sceneConfig, 'crossOrigin', gameConfig.loaderCrossOrigin);\r\n\r\n /**\r\n * The total number of files to load. It may not always be accurate because you may add to the Loader during the process\r\n * of loading, especially if you load a Pack File. Therefore this value can change, but in most cases remains static.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#totalToLoad\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.totalToLoad = 0;\r\n\r\n /**\r\n * The progress of the current load queue, as a float value between 0 and 1.\r\n * This is updated automatically as files complete loading.\r\n * Note that it is possible for this value to go down again if you add content to the current load queue during a load.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#progress\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.progress = 0;\r\n\r\n /**\r\n * Files are placed in this Set when they're added to the Loader via `addFile`.\r\n * \r\n * They are moved to the `inflight` Set when they start loading, and assuming a successful\r\n * load, to the `queue` Set for further processing.\r\n *\r\n * By the end of the load process this Set will be empty.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#list\r\n * @type {Phaser.Structs.Set.}\r\n * @since 3.0.0\r\n */\r\n this.list = new CustomSet();\r\n\r\n /**\r\n * Files are stored in this Set while they're in the process of being loaded.\r\n * \r\n * Upon a successful load they are moved to the `queue` Set.\r\n * \r\n * By the end of the load process this Set will be empty.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#inflight\r\n * @type {Phaser.Structs.Set.}\r\n * @since 3.0.0\r\n */\r\n this.inflight = new CustomSet();\r\n\r\n /**\r\n * Files are stored in this Set while they're being processed.\r\n * \r\n * If the process is successful they are moved to their final destination, which could be\r\n * a Cache or the Texture Manager.\r\n * \r\n * At the end of the load process this Set will be empty.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#queue\r\n * @type {Phaser.Structs.Set.}\r\n * @since 3.0.0\r\n */\r\n this.queue = new CustomSet();\r\n\r\n /**\r\n * A temporary Set in which files are stored after processing,\r\n * awaiting destruction at the end of the load process.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#_deleteQueue\r\n * @type {Phaser.Structs.Set.}\r\n * @private\r\n * @since 3.7.0\r\n */\r\n this._deleteQueue = new CustomSet();\r\n\r\n /**\r\n * The total number of files that failed to load during the most recent load.\r\n * This value is reset when you call `Loader.start`.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#totalFailed\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.7.0\r\n */\r\n this.totalFailed = 0;\r\n\r\n /**\r\n * The total number of files that successfully loaded during the most recent load.\r\n * This value is reset when you call `Loader.start`.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#totalComplete\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.7.0\r\n */\r\n this.totalComplete = 0;\r\n\r\n /**\r\n * The current state of the Loader.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#state\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.state = CONST.LOADER_IDLE;\r\n\r\n /**\r\n * The current index being used by multi-file loaders to avoid key clashes.\r\n *\r\n * @name Phaser.Loader.LoaderPlugin#multiKeyIndex\r\n * @type {integer}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this.multiKeyIndex = 0;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n scene.sys.events.on(SceneEvents.START, this.pluginStart, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#boot\r\n * @private\r\n * @since 3.5.1\r\n */\r\n boot: function ()\r\n {\r\n this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#pluginStart\r\n * @private\r\n * @since 3.5.1\r\n */\r\n pluginStart: function ()\r\n {\r\n this.systems.events.once(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * If you want to append a URL before the path of any asset you can set this here.\r\n * \r\n * Useful if allowing the asset base url to be configured outside of the game code.\r\n * \r\n * Once a base URL is set it will affect every file loaded by the Loader from that point on. It does _not_ change any\r\n * file _already_ being loaded. To reset it, call this method with no arguments.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#setBaseURL\r\n * @since 3.0.0\r\n *\r\n * @param {string} [url] - The URL to use. Leave empty to reset.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} This Loader object.\r\n */\r\n setBaseURL: function (url)\r\n {\r\n if (url === undefined) { url = ''; }\r\n\r\n if (url !== '' && url.substr(-1) !== '/')\r\n {\r\n url = url.concat('/');\r\n }\r\n\r\n this.baseURL = url;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The value of `path`, if set, is placed before any _relative_ file path given. For example:\r\n *\r\n * ```javascript\r\n * this.load.setPath(\"images/sprites/\");\r\n * this.load.image(\"ball\", \"ball.png\");\r\n * this.load.image(\"tree\", \"level1/oaktree.png\");\r\n * this.load.image(\"boom\", \"http://server.com/explode.png\");\r\n * ```\r\n *\r\n * Would load the `ball` file from `images/sprites/ball.png` and the tree from\r\n * `images/sprites/level1/oaktree.png` but the file `boom` would load from the URL\r\n * given as it's an absolute URL.\r\n *\r\n * Please note that the path is added before the filename but *after* the baseURL (if set.)\r\n * \r\n * Once a path is set it will then affect every file added to the Loader from that point on. It does _not_ change any\r\n * file _already_ in the load queue. To reset it, call this method with no arguments.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#setPath\r\n * @since 3.0.0\r\n *\r\n * @param {string} [path] - The path to use. Leave empty to reset.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} This Loader object.\r\n */\r\n setPath: function (path)\r\n {\r\n if (path === undefined) { path = ''; }\r\n\r\n if (path !== '' && path.substr(-1) !== '/')\r\n {\r\n path = path.concat('/');\r\n }\r\n\r\n this.path = path;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * An optional prefix that is automatically prepended to the start of every file key.\r\n * \r\n * If prefix was `MENU.` and you load an image with the key 'Background' the resulting key would be `MENU.Background`.\r\n * \r\n * Once a prefix is set it will then affect every file added to the Loader from that point on. It does _not_ change any\r\n * file _already_ in the load queue. To reset it, call this method with no arguments.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#setPrefix\r\n * @since 3.7.0\r\n *\r\n * @param {string} [prefix] - The prefix to use. Leave empty to reset.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} This Loader object.\r\n */\r\n setPrefix: function (prefix)\r\n {\r\n if (prefix === undefined) { prefix = ''; }\r\n\r\n this.prefix = prefix;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Cross Origin Resource Sharing value used when loading files.\r\n * \r\n * Files can override this value on a per-file basis by specifying an alternative `crossOrigin` value in their file config.\r\n * \r\n * Once CORs is set it will then affect every file loaded by the Loader from that point on, as long as they don't have\r\n * their own CORs setting. To reset it, call this method with no arguments.\r\n *\r\n * For more details about CORs see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#setCORS\r\n * @since 3.0.0\r\n *\r\n * @param {string} [crossOrigin] - The value to use for the `crossOrigin` property in the load request.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} This Loader object.\r\n */\r\n setCORS: function (crossOrigin)\r\n {\r\n this.crossOrigin = crossOrigin;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds a file, or array of files, into the load queue.\r\n *\r\n * The file must be an instance of `Phaser.Loader.File`, or a class that extends it. The Loader will check that the key\r\n * used by the file won't conflict with any other key either in the loader, the inflight queue or the target cache.\r\n * If allowed it will then add the file into the pending list, read for the load to start. Or, if the load has already\r\n * started, ready for the next batch of files to be pulled from the list to the inflight queue.\r\n *\r\n * You should not normally call this method directly, but rather use one of the Loader methods like `image` or `atlas`,\r\n * however you can call this as long as the file given to it is well formed.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#addFile\r\n * @fires Phaser.Loader.Events#ADD\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Loader.File|Phaser.Loader.File[])} file - The file, or array of files, to be added to the load queue.\r\n */\r\n addFile: function (file)\r\n {\r\n if (!Array.isArray(file))\r\n {\r\n file = [ file ];\r\n }\r\n\r\n for (var i = 0; i < file.length; i++)\r\n {\r\n var item = file[i];\r\n\r\n // Does the file already exist in the cache or texture manager?\r\n // Or will it conflict with a file already in the queue or inflight?\r\n if (!this.keyExists(item))\r\n {\r\n this.list.set(item);\r\n\r\n this.emit(Events.ADD, item.key, item.type, this, item);\r\n\r\n if (this.isLoading())\r\n {\r\n this.totalToLoad++;\r\n this.updateProgress();\r\n }\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Checks the key and type of the given file to see if it will conflict with anything already\r\n * in a Cache, the Texture Manager, or the list or inflight queues.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#keyExists\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The file to check the key of.\r\n *\r\n * @return {boolean} `true` if adding this file will cause a cache or queue conflict, otherwise `false`.\r\n */\r\n keyExists: function (file)\r\n {\r\n var keyConflict = file.hasCacheConflict();\r\n\r\n if (!keyConflict)\r\n {\r\n this.list.iterate(function (item)\r\n {\r\n if (item.type === file.type && item.key === file.key)\r\n {\r\n keyConflict = true;\r\n\r\n return false;\r\n }\r\n\r\n });\r\n }\r\n\r\n if (!keyConflict && this.isLoading())\r\n {\r\n this.inflight.iterate(function (item)\r\n {\r\n if (item.type === file.type && item.key === file.key)\r\n {\r\n keyConflict = true;\r\n\r\n return false;\r\n }\r\n\r\n });\r\n\r\n this.queue.iterate(function (item)\r\n {\r\n if (item.type === file.type && item.key === file.key)\r\n {\r\n keyConflict = true;\r\n\r\n return false;\r\n }\r\n\r\n });\r\n }\r\n\r\n return keyConflict;\r\n },\r\n\r\n /**\r\n * Takes a well formed, fully parsed pack file object and adds its entries into the load queue. Usually you do not call\r\n * this method directly, but instead use `Loader.pack` and supply a path to a JSON file that holds the\r\n * pack data. However, if you've got the data prepared you can pass it to this method.\r\n *\r\n * You can also provide an optional key. If you do then it will only add the entries from that part of the pack into\r\n * to the load queue. If not specified it will add all entries it finds. For more details about the pack file format\r\n * see the `LoaderPlugin.pack` method.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#addPack\r\n * @since 3.7.0\r\n *\r\n * @param {any} data - The Pack File data to be parsed and each entry of it to added to the load queue.\r\n * @param {string} [packKey] - An optional key to use from the pack file data.\r\n *\r\n * @return {boolean} `true` if any files were added to the queue, otherwise `false`.\r\n */\r\n addPack: function (pack, packKey)\r\n {\r\n // if no packKey provided we'll add everything to the queue\r\n if (packKey && pack.hasOwnProperty(packKey))\r\n {\r\n pack = { packKey: pack[packKey] };\r\n }\r\n\r\n var total = 0;\r\n\r\n // Store the loader settings in case this pack replaces them\r\n var currentBaseURL = this.baseURL;\r\n var currentPath = this.path;\r\n var currentPrefix = this.prefix;\r\n\r\n // Here we go ...\r\n for (var key in pack)\r\n {\r\n var config = pack[key];\r\n\r\n // Any meta data to process?\r\n var baseURL = GetFastValue(config, 'baseURL', currentBaseURL);\r\n var path = GetFastValue(config, 'path', currentPath);\r\n var prefix = GetFastValue(config, 'prefix', currentPrefix);\r\n var files = GetFastValue(config, 'files', null);\r\n var defaultType = GetFastValue(config, 'defaultType', 'void');\r\n\r\n if (Array.isArray(files))\r\n {\r\n this.setBaseURL(baseURL);\r\n this.setPath(path);\r\n this.setPrefix(prefix);\r\n\r\n for (var i = 0; i < files.length; i++)\r\n {\r\n var file = files[i];\r\n var type = (file.hasOwnProperty('type')) ? file.type : defaultType;\r\n\r\n if (this[type])\r\n {\r\n this[type](file);\r\n total++;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Reset the loader settings\r\n this.setBaseURL(currentBaseURL);\r\n this.setPath(currentPath);\r\n this.setPrefix(currentPrefix);\r\n\r\n return (total > 0);\r\n },\r\n\r\n /**\r\n * Is the Loader actively loading, or processing loaded files?\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#isLoading\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the Loader is busy loading or processing, otherwise `false`.\r\n */\r\n isLoading: function ()\r\n {\r\n return (this.state === CONST.LOADER_LOADING || this.state === CONST.LOADER_PROCESSING);\r\n },\r\n\r\n /**\r\n * Is the Loader ready to start a new load?\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#isReady\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the Loader is ready to start a new load, otherwise `false`.\r\n */\r\n isReady: function ()\r\n {\r\n return (this.state === CONST.LOADER_IDLE || this.state === CONST.LOADER_COMPLETE);\r\n },\r\n\r\n /**\r\n * Starts the Loader running. This will reset the progress and totals and then emit a `start` event.\r\n * If there is nothing in the queue the Loader will immediately complete, otherwise it will start\r\n * loading the first batch of files.\r\n *\r\n * The Loader is started automatically if the queue is populated within your Scenes `preload` method.\r\n *\r\n * However, outside of this, you need to call this method to start it.\r\n *\r\n * If the Loader is already running this method will simply return.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#start\r\n * @fires Phaser.Loader.Events#START\r\n * @since 3.0.0\r\n */\r\n start: function ()\r\n {\r\n if (!this.isReady())\r\n {\r\n return;\r\n }\r\n\r\n this.progress = 0;\r\n\r\n this.totalFailed = 0;\r\n this.totalComplete = 0;\r\n this.totalToLoad = this.list.size;\r\n\r\n this.emit(Events.START, this);\r\n\r\n if (this.list.size === 0)\r\n {\r\n this.loadComplete();\r\n }\r\n else\r\n {\r\n this.state = CONST.LOADER_LOADING;\r\n\r\n this.inflight.clear();\r\n this.queue.clear();\r\n\r\n this.updateProgress();\r\n\r\n this.checkLoadQueue();\r\n\r\n this.systems.events.on(SceneEvents.UPDATE, this.update, this);\r\n }\r\n },\r\n\r\n /**\r\n * Called automatically during the load process.\r\n * It updates the `progress` value and then emits a progress event, which you can use to\r\n * display a loading bar in your game.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#updateProgress\r\n * @fires Phaser.Loader.Events#PROGRESS\r\n * @since 3.0.0\r\n */\r\n updateProgress: function ()\r\n {\r\n this.progress = 1 - ((this.list.size + this.inflight.size) / this.totalToLoad);\r\n\r\n this.emit(Events.PROGRESS, this.progress);\r\n },\r\n\r\n /**\r\n * Called automatically during the load process.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#update\r\n * @since 3.10.0\r\n */\r\n update: function ()\r\n {\r\n if (this.state === CONST.LOADER_LOADING && this.list.size > 0 && this.inflight.size < this.maxParallelDownloads)\r\n {\r\n this.checkLoadQueue();\r\n }\r\n },\r\n\r\n /**\r\n * An internal method called by the Loader.\r\n * \r\n * It will check to see if there are any more files in the pending list that need loading, and if so it will move\r\n * them from the list Set into the inflight Set, set their CORs flag and start them loading.\r\n * \r\n * It will carrying on doing this for each file in the pending list until it runs out, or hits the max allowed parallel downloads.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#checkLoadQueue\r\n * @private\r\n * @since 3.7.0\r\n */\r\n checkLoadQueue: function ()\r\n {\r\n this.list.each(function (file)\r\n {\r\n if (file.state === CONST.FILE_POPULATED || (file.state === CONST.FILE_PENDING && this.inflight.size < this.maxParallelDownloads))\r\n {\r\n this.inflight.set(file);\r\n\r\n this.list.delete(file);\r\n\r\n // If the file doesn't have its own crossOrigin set, we'll use the Loaders (which is undefined by default)\r\n if (!file.crossOrigin)\r\n {\r\n file.crossOrigin = this.crossOrigin;\r\n }\r\n\r\n file.load();\r\n }\r\n\r\n if (this.inflight.size === this.maxParallelDownloads)\r\n {\r\n // Tells the Set iterator to abort\r\n return false;\r\n }\r\n\r\n }, this);\r\n },\r\n\r\n /**\r\n * An internal method called automatically by the XHRLoader belong to a File.\r\n * \r\n * This method will remove the given file from the inflight Set and update the load progress.\r\n * If the file was successful its `onProcess` method is called, otherwise it is added to the delete queue.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#nextFile\r\n * @fires Phaser.Loader.Events#FILE_LOAD\r\n * @fires Phaser.Loader.Events#FILE_LOAD_ERROR\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that just finished loading, or errored during load.\r\n * @param {boolean} success - `true` if the file loaded successfully, otherwise `false`.\r\n */\r\n nextFile: function (file, success)\r\n {\r\n // Has the game been destroyed during load? If so, bail out now.\r\n if (!this.inflight)\r\n {\r\n return;\r\n }\r\n\r\n this.inflight.delete(file);\r\n\r\n this.updateProgress();\r\n\r\n if (success)\r\n {\r\n this.totalComplete++;\r\n\r\n this.queue.set(file);\r\n\r\n this.emit(Events.FILE_LOAD, file);\r\n\r\n file.onProcess();\r\n }\r\n else\r\n {\r\n this.totalFailed++;\r\n\r\n this._deleteQueue.set(file);\r\n\r\n this.emit(Events.FILE_LOAD_ERROR, file);\r\n\r\n this.fileProcessComplete(file);\r\n }\r\n },\r\n\r\n /**\r\n * An internal method that is called automatically by the File when it has finished processing.\r\n *\r\n * If the process was successful, and the File isn't part of a MultiFile, its `addToCache` method is called.\r\n *\r\n * It this then removed from the queue. If there are no more files to load `loadComplete` is called.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#fileProcessComplete\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The file that has finished processing.\r\n */\r\n fileProcessComplete: function (file)\r\n {\r\n // Has the game been destroyed during load? If so, bail out now.\r\n if (!this.scene || !this.systems || !this.systems.game || this.systems.game.pendingDestroy)\r\n {\r\n return;\r\n }\r\n\r\n // This file has failed, so move it to the failed Set\r\n if (file.state === CONST.FILE_ERRORED)\r\n {\r\n if (file.multiFile)\r\n {\r\n file.multiFile.onFileFailed(file);\r\n }\r\n }\r\n else if (file.state === CONST.FILE_COMPLETE)\r\n {\r\n if (file.multiFile)\r\n {\r\n if (file.multiFile.isReadyToProcess())\r\n {\r\n // If we got here then all files the link file needs are ready to add to the cache\r\n file.multiFile.addToCache();\r\n }\r\n }\r\n else\r\n {\r\n // If we got here, then the file processed, so let it add itself to its cache\r\n file.addToCache();\r\n }\r\n }\r\n\r\n // Remove it from the queue\r\n this.queue.delete(file);\r\n\r\n // Nothing left to do?\r\n\r\n if (this.list.size === 0 && this.inflight.size === 0 && this.queue.size === 0)\r\n {\r\n this.loadComplete();\r\n }\r\n },\r\n\r\n /**\r\n * Called at the end when the load queue is exhausted and all files have either loaded or errored.\r\n * By this point every loaded file will now be in its associated cache and ready for use.\r\n *\r\n * Also clears down the Sets, puts progress to 1 and clears the deletion queue.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#loadComplete\r\n * @fires Phaser.Loader.Events#COMPLETE\r\n * @fires Phaser.Loader.Events#POST_PROCESS\r\n * @since 3.7.0\r\n */\r\n loadComplete: function ()\r\n {\r\n this.emit(Events.POST_PROCESS, this);\r\n\r\n this.list.clear();\r\n this.inflight.clear();\r\n this.queue.clear();\r\n\r\n this.progress = 1;\r\n\r\n this.state = CONST.LOADER_COMPLETE;\r\n\r\n this.systems.events.off(SceneEvents.UPDATE, this.update, this);\r\n\r\n // Call 'destroy' on each file ready for deletion\r\n this._deleteQueue.iterateLocal('destroy');\r\n\r\n this._deleteQueue.clear();\r\n\r\n this.emit(Events.COMPLETE, this, this.totalComplete, this.totalFailed);\r\n },\r\n\r\n /**\r\n * Adds a File into the pending-deletion queue.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#flagForRemoval\r\n * @since 3.7.0\r\n * \r\n * @param {Phaser.Loader.File} file - The File to be queued for deletion when the Loader completes.\r\n */\r\n flagForRemoval: function (file)\r\n {\r\n this._deleteQueue.set(file);\r\n },\r\n\r\n /**\r\n * Converts the given JSON data into a file that the browser then prompts you to download so you can save it locally.\r\n *\r\n * The data must be well formed JSON and ready-parsed, not a JavaScript object.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#saveJSON\r\n * @since 3.0.0\r\n *\r\n * @param {*} data - The JSON data, ready parsed.\r\n * @param {string} [filename=file.json] - The name to save the JSON file as.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} This Loader plugin.\r\n */\r\n saveJSON: function (data, filename)\r\n {\r\n return this.save(JSON.stringify(data), filename);\r\n },\r\n\r\n /**\r\n * Causes the browser to save the given data as a file to its default Downloads folder.\r\n * \r\n * Creates a DOM level anchor link, assigns it as being a `download` anchor, sets the href\r\n * to be an ObjectURL based on the given data, and then invokes a click event.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#save\r\n * @since 3.0.0\r\n *\r\n * @param {*} data - The data to be saved. Will be passed through URL.createObjectURL.\r\n * @param {string} [filename=file.json] - The filename to save the file as.\r\n * @param {string} [filetype=application/json] - The file type to use when saving the file. Defaults to JSON.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} This Loader plugin.\r\n */\r\n save: function (data, filename, filetype)\r\n {\r\n if (filename === undefined) { filename = 'file.json'; }\r\n if (filetype === undefined) { filetype = 'application/json'; }\r\n\r\n var blob = new Blob([ data ], { type: filetype });\r\n\r\n var url = URL.createObjectURL(blob);\r\n\r\n var a = document.createElement('a');\r\n\r\n a.download = filename;\r\n a.textContent = 'Download ' + filename;\r\n a.href = url;\r\n a.click();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the Loader.\r\n *\r\n * This will clear all lists and reset the base URL, path and prefix.\r\n *\r\n * Warning: If the Loader is currently downloading files, or has files in its queue, they will be aborted.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#reset\r\n * @since 3.0.0\r\n */\r\n reset: function ()\r\n {\r\n this.list.clear();\r\n this.inflight.clear();\r\n this.queue.clear();\r\n\r\n var gameConfig = this.systems.game.config;\r\n var sceneConfig = this.systems.settings.loader;\r\n\r\n this.setBaseURL(GetFastValue(sceneConfig, 'baseURL', gameConfig.loaderBaseURL));\r\n this.setPath(GetFastValue(sceneConfig, 'path', gameConfig.loaderPath));\r\n this.setPrefix(GetFastValue(sceneConfig, 'prefix', gameConfig.loaderPrefix));\r\n\r\n this.state = CONST.LOADER_IDLE;\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#shutdown\r\n * @private\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n this.reset();\r\n\r\n this.state = CONST.LOADER_SHUTDOWN;\r\n\r\n this.systems.events.off(SceneEvents.UPDATE, this.update, this);\r\n this.systems.events.off(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#destroy\r\n * @private\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.state = CONST.LOADER_DESTROYED;\r\n\r\n this.systems.events.off(SceneEvents.UPDATE, this.update, this);\r\n this.systems.events.off(SceneEvents.START, this.pluginStart, this);\r\n\r\n this.list = null;\r\n this.inflight = null;\r\n this.queue = null;\r\n\r\n this.scene = null;\r\n this.systems = null;\r\n this.textureManager = null;\r\n this.cacheManager = null;\r\n this.sceneManager = null;\r\n }\r\n\r\n});\r\n\r\nPluginCache.register('Loader', LoaderPlugin, 'load');\r\n\r\nmodule.exports = LoaderPlugin;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/LoaderPlugin.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/MergeXHRSettings.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/loader/MergeXHRSettings.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Extend = __webpack_require__(/*! ../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\nvar XHRSettings = __webpack_require__(/*! ./XHRSettings */ \"./node_modules/phaser/src/loader/XHRSettings.js\");\r\n\r\n/**\r\n * Takes two XHRSettings Objects and creates a new XHRSettings object from them.\r\n *\r\n * The new object is seeded by the values given in the global settings, but any setting in\r\n * the local object overrides the global ones.\r\n *\r\n * @function Phaser.Loader.MergeXHRSettings\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object.\r\n *\r\n * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object.\r\n */\r\nvar MergeXHRSettings = function (global, local)\r\n{\r\n var output = (global === undefined) ? XHRSettings() : Extend({}, global);\r\n\r\n if (local)\r\n {\r\n for (var setting in local)\r\n {\r\n if (local[setting] !== undefined)\r\n {\r\n output[setting] = local[setting];\r\n }\r\n }\r\n }\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = MergeXHRSettings;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/MergeXHRSettings.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/MultiFile.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/loader/MultiFile.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after\r\n * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont.\r\n * \r\n * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods.\r\n *\r\n * @class MultiFile\r\n * @memberof Phaser.Loader\r\n * @constructor\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File.\r\n * @param {string} type - The file type string for sorting within the Loader.\r\n * @param {string} key - The key of the file within the loader.\r\n * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile.\r\n */\r\nvar MultiFile = new Class({\r\n\r\n initialize:\r\n\r\n function MultiFile (loader, type, key, files)\r\n {\r\n /**\r\n * A reference to the Loader that is going to load this file.\r\n *\r\n * @name Phaser.Loader.MultiFile#loader\r\n * @type {Phaser.Loader.LoaderPlugin}\r\n * @since 3.7.0\r\n */\r\n this.loader = loader;\r\n\r\n /**\r\n * The file type string for sorting within the Loader.\r\n *\r\n * @name Phaser.Loader.MultiFile#type\r\n * @type {string}\r\n * @since 3.7.0\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * Unique cache key (unique within its file type)\r\n *\r\n * @name Phaser.Loader.MultiFile#key\r\n * @type {string}\r\n * @since 3.7.0\r\n */\r\n this.key = key;\r\n\r\n /**\r\n * The current index being used by multi-file loaders to avoid key clashes.\r\n *\r\n * @name Phaser.Loader.MultiFile#multiKeyIndex\r\n * @type {integer}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this.multiKeyIndex = loader.multiKeyIndex++;\r\n\r\n /**\r\n * Array of files that make up this MultiFile.\r\n *\r\n * @name Phaser.Loader.MultiFile#files\r\n * @type {Phaser.Loader.File[]}\r\n * @since 3.7.0\r\n */\r\n this.files = files;\r\n\r\n /**\r\n * The completion status of this MultiFile.\r\n *\r\n * @name Phaser.Loader.MultiFile#complete\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.7.0\r\n */\r\n this.complete = false;\r\n\r\n /**\r\n * The number of files to load.\r\n *\r\n * @name Phaser.Loader.MultiFile#pending\r\n * @type {integer}\r\n * @since 3.7.0\r\n */\r\n\r\n this.pending = files.length;\r\n\r\n /**\r\n * The number of files that failed to load.\r\n *\r\n * @name Phaser.Loader.MultiFile#failed\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.7.0\r\n */\r\n this.failed = 0;\r\n\r\n /**\r\n * A storage container for transient data that the loading files need.\r\n *\r\n * @name Phaser.Loader.MultiFile#config\r\n * @type {any}\r\n * @since 3.7.0\r\n */\r\n this.config = {};\r\n\r\n /**\r\n * A reference to the Loaders baseURL at the time this MultiFile was created.\r\n * Used to populate child-files.\r\n *\r\n * @name Phaser.Loader.MultiFile#baseURL\r\n * @type {string}\r\n * @since 3.20.0\r\n */\r\n this.baseURL = loader.baseURL;\r\n\r\n /**\r\n * A reference to the Loaders path at the time this MultiFile was created.\r\n * Used to populate child-files.\r\n *\r\n * @name Phaser.Loader.MultiFile#path\r\n * @type {string}\r\n * @since 3.20.0\r\n */\r\n this.path = loader.path;\r\n\r\n /**\r\n * A reference to the Loaders prefix at the time this MultiFile was created.\r\n * Used to populate child-files.\r\n *\r\n * @name Phaser.Loader.MultiFile#prefix\r\n * @type {string}\r\n * @since 3.20.0\r\n */\r\n this.prefix = loader.prefix;\r\n\r\n // Link the files\r\n for (var i = 0; i < files.length; i++)\r\n {\r\n files[i].multiFile = this;\r\n }\r\n },\r\n\r\n /**\r\n * Checks if this MultiFile is ready to process its children or not.\r\n *\r\n * @method Phaser.Loader.MultiFile#isReadyToProcess\r\n * @since 3.7.0\r\n *\r\n * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`.\r\n */\r\n isReadyToProcess: function ()\r\n {\r\n return (this.pending === 0 && this.failed === 0 && !this.complete);\r\n },\r\n\r\n /**\r\n * Adds another child to this MultiFile, increases the pending count and resets the completion status.\r\n *\r\n * @method Phaser.Loader.MultiFile#addToMultiFile\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} files - The File to add to this MultiFile.\r\n *\r\n * @return {Phaser.Loader.MultiFile} This MultiFile instance.\r\n */\r\n addToMultiFile: function (file)\r\n {\r\n this.files.push(file);\r\n\r\n file.multiFile = this;\r\n\r\n this.pending++;\r\n\r\n this.complete = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Called by each File when it finishes loading.\r\n *\r\n * @method Phaser.Loader.MultiFile#onFileComplete\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has completed processing.\r\n */\r\n onFileComplete: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.pending--;\r\n }\r\n },\r\n\r\n /**\r\n * Called by each File that fails to load.\r\n *\r\n * @method Phaser.Loader.MultiFile#onFileFailed\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has failed to load.\r\n */\r\n onFileFailed: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.failed++;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = MultiFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/MultiFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/XHRLoader.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/loader/XHRLoader.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MergeXHRSettings = __webpack_require__(/*! ./MergeXHRSettings */ \"./node_modules/phaser/src/loader/MergeXHRSettings.js\");\r\n\r\n/**\r\n * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings\r\n * and starts the download of it. It uses the Files own XHRSettings and merges them\r\n * with the global XHRSettings object to set the xhr values before download.\r\n *\r\n * @function Phaser.Loader.XHRLoader\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File to download.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} globalXHRSettings - The global XHRSettings object.\r\n *\r\n * @return {XMLHttpRequest} The XHR object.\r\n */\r\nvar XHRLoader = function (file, globalXHRSettings)\r\n{\r\n var config = MergeXHRSettings(globalXHRSettings, file.xhrSettings);\r\n\r\n var xhr = new XMLHttpRequest();\r\n\r\n xhr.open('GET', file.src, config.async, config.user, config.password);\r\n\r\n xhr.responseType = file.xhrSettings.responseType;\r\n xhr.timeout = config.timeout;\r\n\r\n if (config.header && config.headerValue)\r\n {\r\n xhr.setRequestHeader(config.header, config.headerValue);\r\n }\r\n\r\n if (config.requestedWith)\r\n {\r\n xhr.setRequestHeader('X-Requested-With', config.requestedWith);\r\n }\r\n\r\n if (config.overrideMimeType)\r\n {\r\n xhr.overrideMimeType(config.overrideMimeType);\r\n }\r\n\r\n // After a successful request, the xhr.response property will contain the requested data as a DOMString, ArrayBuffer, Blob, or Document (depending on what was set for responseType.)\r\n\r\n xhr.onload = file.onLoad.bind(file, xhr);\r\n xhr.onerror = file.onError.bind(file, xhr);\r\n xhr.onprogress = file.onProgress.bind(file);\r\n\r\n // This is the only standard method, the ones above are browser additions (maybe not universal?)\r\n // xhr.onreadystatechange\r\n\r\n xhr.send();\r\n\r\n return xhr;\r\n};\r\n\r\nmodule.exports = XHRLoader;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/XHRLoader.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/XHRSettings.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/loader/XHRSettings.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Creates an XHRSettings Object with default values.\r\n *\r\n * @function Phaser.Loader.XHRSettings\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'.\r\n * @param {boolean} [async=true] - Should the XHR request use async or not?\r\n * @param {string} [user=''] - Optional username for the XHR request.\r\n * @param {string} [password=''] - Optional password for the XHR request.\r\n * @param {integer} [timeout=0] - Optional XHR timeout value.\r\n *\r\n * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader.\r\n */\r\nvar XHRSettings = function (responseType, async, user, password, timeout)\r\n{\r\n if (responseType === undefined) { responseType = ''; }\r\n if (async === undefined) { async = true; }\r\n if (user === undefined) { user = ''; }\r\n if (password === undefined) { password = ''; }\r\n if (timeout === undefined) { timeout = 0; }\r\n\r\n // Before sending a request, set the xhr.responseType to \"text\",\r\n // \"arraybuffer\", \"blob\", or \"document\", depending on your data needs.\r\n // Note, setting xhr.responseType = '' (or omitting) will default the response to \"text\".\r\n\r\n return {\r\n\r\n // Ignored by the Loader, only used by File.\r\n responseType: responseType,\r\n\r\n async: async,\r\n\r\n // credentials\r\n user: user,\r\n password: password,\r\n\r\n // timeout in ms (0 = no timeout)\r\n timeout: timeout,\r\n\r\n // setRequestHeader\r\n header: undefined,\r\n headerValue: undefined,\r\n requestedWith: false,\r\n\r\n // overrideMimeType\r\n overrideMimeType: undefined\r\n\r\n };\r\n};\r\n\r\nmodule.exports = XHRSettings;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/XHRSettings.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/const.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/loader/const.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FILE_CONST = {\r\n\r\n /**\r\n * The Loader is idle.\r\n * \r\n * @name Phaser.Loader.LOADER_IDLE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_IDLE: 0,\r\n\r\n /**\r\n * The Loader is actively loading.\r\n * \r\n * @name Phaser.Loader.LOADER_LOADING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_LOADING: 1,\r\n\r\n /**\r\n * The Loader is processing files is has loaded.\r\n * \r\n * @name Phaser.Loader.LOADER_PROCESSING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_PROCESSING: 2,\r\n\r\n /**\r\n * The Loader has completed loading and processing.\r\n * \r\n * @name Phaser.Loader.LOADER_COMPLETE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_COMPLETE: 3,\r\n\r\n /**\r\n * The Loader is shutting down.\r\n * \r\n * @name Phaser.Loader.LOADER_SHUTDOWN\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_SHUTDOWN: 4,\r\n\r\n /**\r\n * The Loader has been destroyed.\r\n * \r\n * @name Phaser.Loader.LOADER_DESTROYED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_DESTROYED: 5,\r\n\r\n /**\r\n * File is in the load queue but not yet started\r\n * \r\n * @name Phaser.Loader.FILE_PENDING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_PENDING: 10,\r\n\r\n /**\r\n * File has been started to load by the loader (onLoad called)\r\n * \r\n * @name Phaser.Loader.FILE_LOADING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_LOADING: 11,\r\n\r\n /**\r\n * File has loaded successfully, awaiting processing \r\n * \r\n * @name Phaser.Loader.FILE_LOADED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_LOADED: 12,\r\n\r\n /**\r\n * File failed to load\r\n * \r\n * @name Phaser.Loader.FILE_FAILED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_FAILED: 13,\r\n\r\n /**\r\n * File is being processed (onProcess callback)\r\n * \r\n * @name Phaser.Loader.FILE_PROCESSING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_PROCESSING: 14,\r\n\r\n /**\r\n * The File has errored somehow during processing.\r\n * \r\n * @name Phaser.Loader.FILE_ERRORED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_ERRORED: 16,\r\n\r\n /**\r\n * File has finished processing.\r\n * \r\n * @name Phaser.Loader.FILE_COMPLETE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_COMPLETE: 17,\r\n\r\n /**\r\n * File has been destroyed\r\n * \r\n * @name Phaser.Loader.FILE_DESTROYED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_DESTROYED: 18,\r\n\r\n /**\r\n * File was populated from local data and doesn't need an HTTP request\r\n * \r\n * @name Phaser.Loader.FILE_POPULATED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_POPULATED: 19\r\n\r\n};\r\n\r\nmodule.exports = FILE_CONST;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/const.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/events/ADD_EVENT.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/loader/events/ADD_EVENT.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Add File Event.\r\n * \r\n * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('addfile', listener)`.\r\n * \r\n * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them.\r\n *\r\n * @event Phaser.Loader.Events#ADD\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The unique key of the file that was added to the Loader.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} string of the file that was added to the Loader, i.e. `image`.\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n * @param {Phaser.Loader.File} file - A reference to the File which was added to the Loader.\r\n */\r\nmodule.exports = 'addfile';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/events/ADD_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/events/COMPLETE_EVENT.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/loader/events/COMPLETE_EVENT.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Complete Event.\r\n * \r\n * This event is dispatched when the Loader has fully processed everything in the load queue.\r\n * By this point every loaded file will now be in its associated cache and ready for use.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('complete', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n * @param {integer} totalComplete - The total number of files that successfully loaded.\r\n * @param {integer} totalFailed - The total number of files that failed to load.\r\n */\r\nmodule.exports = 'complete';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/events/COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/events/FILE_COMPLETE_EVENT.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/loader/events/FILE_COMPLETE_EVENT.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Complete Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when any file in the queue finishes loading.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`.\r\n * \r\n * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event.\r\n *\r\n * @event Phaser.Loader.Events#FILE_COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the file that just loaded and finished processing.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`.\r\n * @param {any} data - The raw data the file contained.\r\n */\r\nmodule.exports = 'filecomplete';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/events/FILE_COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Complete Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when any file in the queue finishes loading.\r\n * \r\n * It uses a special dynamic event name constructed from the key and type of the file.\r\n * \r\n * For example, if you have loaded an `image` with a key of `monster`, you can listen for it\r\n * using the following:\r\n *\r\n * ```javascript\r\n * this.load.on('filecomplete-image-monster', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n *\r\n * Or, if you have loaded a texture `atlas` with a key of `Level1`:\r\n * \r\n * ```javascript\r\n * this.load.on('filecomplete-atlas-Level1', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n * \r\n * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`:\r\n * \r\n * ```javascript\r\n * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n * \r\n * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event.\r\n *\r\n * @event Phaser.Loader.Events#FILE_KEY_COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the file that just loaded and finished processing.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`.\r\n * @param {any} data - The raw data the file contained.\r\n */\r\nmodule.exports = 'filecomplete-';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Error Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when a file fails to load.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('loaderror', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_LOAD_ERROR\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which errored during load.\r\n */\r\nmodule.exports = 'loaderror';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/events/FILE_LOAD_EVENT.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/loader/events/FILE_LOAD_EVENT.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when a file finishes loading,\r\n * but _before_ it is processed and added to the internal Phaser caches.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('load', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_LOAD\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which just finished loading.\r\n */\r\nmodule.exports = 'load';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/events/FILE_LOAD_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/events/FILE_PROGRESS_EVENT.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/loader/events/FILE_PROGRESS_EVENT.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Progress Event.\r\n * \r\n * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and\r\n * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_PROGRESS\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which errored during load.\r\n * @param {number} percentComplete - A value between 0 and 1 indicating how 'complete' this file is.\r\n */\r\nmodule.exports = 'fileprogress';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/events/FILE_PROGRESS_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/events/POST_PROCESS_EVENT.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/loader/events/POST_PROCESS_EVENT.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Post Process Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue.\r\n * It is dispatched before the internal lists are cleared and each File is destroyed.\r\n * \r\n * Use this hook to perform any last minute processing of files that can only happen once the\r\n * Loader has completed, but prior to it emitting the `complete` event.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('postprocess', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#POST_PROCESS\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n */\r\nmodule.exports = 'postprocess';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/events/POST_PROCESS_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/events/PROGRESS_EVENT.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/loader/events/PROGRESS_EVENT.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Progress Event.\r\n * \r\n * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('progress', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#PROGRESS\r\n * @since 3.0.0\r\n * \r\n * @param {number} progress - The current progress of the load. A value between 0 and 1.\r\n */\r\nmodule.exports = 'progress';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/events/PROGRESS_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/events/START_EVENT.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/loader/events/START_EVENT.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Start Event.\r\n * \r\n * This event is dispatched when the Loader starts running. At this point load progress is zero.\r\n * \r\n * This event is dispatched even if there aren't any files in the load queue.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('start', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n */\r\nmodule.exports = 'start';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/events/START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/events/index.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/loader/events/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Loader.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n ADD: __webpack_require__(/*! ./ADD_EVENT */ \"./node_modules/phaser/src/loader/events/ADD_EVENT.js\"),\r\n COMPLETE: __webpack_require__(/*! ./COMPLETE_EVENT */ \"./node_modules/phaser/src/loader/events/COMPLETE_EVENT.js\"),\r\n FILE_COMPLETE: __webpack_require__(/*! ./FILE_COMPLETE_EVENT */ \"./node_modules/phaser/src/loader/events/FILE_COMPLETE_EVENT.js\"),\r\n FILE_KEY_COMPLETE: __webpack_require__(/*! ./FILE_KEY_COMPLETE_EVENT */ \"./node_modules/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js\"),\r\n FILE_LOAD_ERROR: __webpack_require__(/*! ./FILE_LOAD_ERROR_EVENT */ \"./node_modules/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js\"),\r\n FILE_LOAD: __webpack_require__(/*! ./FILE_LOAD_EVENT */ \"./node_modules/phaser/src/loader/events/FILE_LOAD_EVENT.js\"),\r\n FILE_PROGRESS: __webpack_require__(/*! ./FILE_PROGRESS_EVENT */ \"./node_modules/phaser/src/loader/events/FILE_PROGRESS_EVENT.js\"),\r\n POST_PROCESS: __webpack_require__(/*! ./POST_PROCESS_EVENT */ \"./node_modules/phaser/src/loader/events/POST_PROCESS_EVENT.js\"),\r\n PROGRESS: __webpack_require__(/*! ./PROGRESS_EVENT */ \"./node_modules/phaser/src/loader/events/PROGRESS_EVENT.js\"),\r\n START: __webpack_require__(/*! ./START_EVENT */ \"./node_modules/phaser/src/loader/events/START_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/AnimationJSONFile.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/AnimationJSONFile.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar JSONFile = __webpack_require__(/*! ./JSONFile.js */ \"./node_modules/phaser/src/loader/filetypes/JSONFile.js\");\r\nvar LoaderEvents = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/loader/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Animation JSON File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#animation method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#animation.\r\n *\r\n * @class AnimationJSONFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\r\n */\r\nvar AnimationJSONFile = new Class({\r\n\r\n Extends: JSONFile,\r\n\r\n initialize:\r\n\r\n // 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\r\n // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing\r\n\r\n function AnimationJSONFile (loader, key, url, xhrSettings, dataKey)\r\n {\r\n JSONFile.call(this, loader, key, url, xhrSettings, dataKey);\r\n\r\n this.type = 'animationJSON';\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.AnimationJSONFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n // We need to hook into this event:\r\n this.loader.once(LoaderEvents.POST_PROCESS, this.onLoadComplete, this);\r\n\r\n // But the rest is the same as a normal JSON file\r\n JSONFile.prototype.onProcess.call(this);\r\n },\r\n\r\n /**\r\n * Called at the end of the load process, after the Loader has finished all files in its queue.\r\n *\r\n * @method Phaser.Loader.FileTypes.AnimationJSONFile#onLoadComplete\r\n * @since 3.7.0\r\n */\r\n onLoadComplete: function ()\r\n {\r\n this.loader.systems.anims.fromJSON(this.data);\r\n\r\n this.pendingDestroy();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an Animation JSON Data file, or array of Animation JSON files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.animation('baddieAnims', 'files/BaddieAnims.json');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring\r\n * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the JSON Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the JSON Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.animation({\r\n * key: 'baddieAnims',\r\n * url: 'files/BaddieAnims.json'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details.\r\n *\r\n * Once the file has finished loading it will automatically be passed to the global Animation Managers `fromJSON` method.\r\n * This will parse all of the JSON data and create animation data from it. This process happens at the very end\r\n * of the Loader, once every other file in the load queue has finished. The reason for this is to allow you to load\r\n * both animation data and the images it relies upon in the same load call.\r\n *\r\n * Once the animation data has been parsed you will be able to play animations using that data.\r\n * Please see the Animation Manager `fromJSON` method for more details about the format and playback.\r\n * \r\n * You can also access the raw animation data from its Cache using its key:\r\n * \r\n * ```javascript\r\n * this.load.animation('baddieAnims', 'files/BaddieAnims.json');\r\n * // and later in your game ...\r\n * var data = this.cache.json.get('baddieAnims');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and\r\n * this is what you would use to retrieve the text from the JSON Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * 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,\r\n * rather than the whole file. For example, if your JSON data had a structure like this:\r\n * \r\n * ```json\r\n * {\r\n * \"level1\": {\r\n * \"baddies\": {\r\n * \"aliens\": {},\r\n * \"boss\": {}\r\n * }\r\n * },\r\n * \"level2\": {},\r\n * \"level3\": {}\r\n * }\r\n * ```\r\n *\r\n * And if you only wanted to create animations from the `boss` data, then you could pass `level1.baddies.boss`as the `dataKey`.\r\n *\r\n * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#animation\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @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\".\r\n * @param {string} [dataKey] - When the Animation JSON file loads only this property will be stored in the Cache and used to create animation data.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('animation', function (key, url, dataKey, xhrSettings)\r\n{\r\n // Supports an Object file definition in the key argument\r\n // Or an array of objects in the key argument\r\n // Or a single entry where all arguments have been defined\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n this.addFile(new AnimationJSONFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new AnimationJSONFile(this, key, url, xhrSettings, dataKey));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = AnimationJSONFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/AnimationJSONFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/AtlasJSONFile.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/AtlasJSONFile.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar ImageFile = __webpack_require__(/*! ./ImageFile.js */ \"./node_modules/phaser/src/loader/filetypes/ImageFile.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\nvar JSONFile = __webpack_require__(/*! ./JSONFile.js */ \"./node_modules/phaser/src/loader/filetypes/JSONFile.js\");\r\nvar MultiFile = __webpack_require__(/*! ../MultiFile.js */ \"./node_modules/phaser/src/loader/MultiFile.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single JSON based Texture Atlas File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#atlas method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlas.\r\n * \r\n * https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm\r\n *\r\n * @class AtlasJSONFile\r\n * @extends Phaser.Loader.MultiFile\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\r\n * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas json data 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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings.\r\n */\r\nvar AtlasJSONFile = new Class({\r\n\r\n Extends: MultiFile,\r\n\r\n initialize:\r\n\r\n function AtlasJSONFile (loader, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings)\r\n {\r\n var image;\r\n var data;\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n\r\n image = new ImageFile(loader, {\r\n key: key,\r\n url: GetFastValue(config, 'textureURL'),\r\n extension: GetFastValue(config, 'textureExtension', 'png'),\r\n normalMap: GetFastValue(config, 'normalMap'),\r\n xhrSettings: GetFastValue(config, 'textureXhrSettings')\r\n });\r\n\r\n data = new JSONFile(loader, {\r\n key: key,\r\n url: GetFastValue(config, 'atlasURL'),\r\n extension: GetFastValue(config, 'atlasExtension', 'json'),\r\n xhrSettings: GetFastValue(config, 'atlasXhrSettings')\r\n });\r\n }\r\n else\r\n {\r\n image = new ImageFile(loader, key, textureURL, textureXhrSettings);\r\n data = new JSONFile(loader, key, atlasURL, atlasXhrSettings);\r\n }\r\n\r\n if (image.linkFile)\r\n {\r\n // Image has a normal map\r\n MultiFile.call(this, loader, 'atlasjson', key, [ image, data, image.linkFile ]);\r\n }\r\n else\r\n {\r\n MultiFile.call(this, loader, 'atlasjson', key, [ image, data ]);\r\n }\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.AtlasJSONFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.isReadyToProcess())\r\n {\r\n var image = this.files[0];\r\n var json = this.files[1];\r\n var normalMap = (this.files[2]) ? this.files[2].data : null;\r\n\r\n this.loader.textureManager.addAtlas(image.key, image.data, json.data, normalMap);\r\n\r\n json.addToCache();\r\n\r\n this.complete = true;\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a JSON based Texture Atlas, or array of atlases, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.atlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring\r\n * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.\r\n *\r\n * Phaser expects the atlas data to be provided in a JSON file, using either the JSON Hash or JSON Array format.\r\n * These files are created by software such as Texture Packer, Shoebox and Adobe Flash / Animate.\r\n * If you are using Texture Packer and have enabled multi-atlas support, then please use the Phaser Multi Atlas loader\r\n * instead of this one.\r\n * \r\n * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Texture Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.atlas({\r\n * key: 'mainmenu',\r\n * textureURL: 'images/MainMenu.png',\r\n * atlasURL: 'images/MainMenu.json'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig` for more details.\r\n *\r\n * Instead of passing a URL for the atlas JSON data you can also pass in a well formed JSON object instead.\r\n *\r\n * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key:\r\n * \r\n * ```javascript\r\n * this.load.atlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json');\r\n * // and later in your game ...\r\n * this.add.image(x, y, 'mainmenu', 'background');\r\n * ```\r\n *\r\n * To get a list of all available frames within an atlas please consult your Texture Atlas software.\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the image from the Texture Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\r\n * and no URL is given then the Loader will set the URL to be \"alien.png\". It will always add `.png` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,\r\n * then you can specify it by providing an array as the `url` where the second element is the normal map:\r\n * \r\n * ```javascript\r\n * this.load.atlas('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.json');\r\n * ```\r\n *\r\n * Or, if you are using a config object use the `normalMap` property:\r\n * \r\n * ```javascript\r\n * this.load.atlas({\r\n * key: 'mainmenu',\r\n * textureURL: 'images/MainMenu.png',\r\n * normalMap: 'images/MainMenu-n.png',\r\n * atlasURL: 'images/MainMenu.json'\r\n * });\r\n * ```\r\n *\r\n * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings.\r\n * Normal maps are a WebGL only feature.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Atlas JSON File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#atlas\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig|Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\r\n * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas json data 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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('atlas', function (key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings)\r\n{\r\n var multifile;\r\n\r\n // Supports an Object file definition in the key argument\r\n // Or an array of objects in the key argument\r\n // Or a single entry where all arguments have been defined\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n multifile = new AtlasJSONFile(this, key[i]);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n }\r\n else\r\n {\r\n multifile = new AtlasJSONFile(this, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = AtlasJSONFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/AtlasJSONFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/AtlasXMLFile.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/AtlasXMLFile.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar ImageFile = __webpack_require__(/*! ./ImageFile.js */ \"./node_modules/phaser/src/loader/filetypes/ImageFile.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\nvar MultiFile = __webpack_require__(/*! ../MultiFile.js */ \"./node_modules/phaser/src/loader/MultiFile.js\");\r\nvar XMLFile = __webpack_require__(/*! ./XMLFile.js */ \"./node_modules/phaser/src/loader/filetypes/XMLFile.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single XML based Texture Atlas File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#atlasXML method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlasXML.\r\n *\r\n * @class AtlasXMLFile\r\n * @extends Phaser.Loader.MultiFile\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\r\n * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was \"alien\" then the URL will be \"alien.xml\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas xml file. Used in replacement of the Loaders default XHR Settings.\r\n */\r\nvar AtlasXMLFile = new Class({\r\n\r\n Extends: MultiFile,\r\n\r\n initialize:\r\n\r\n function AtlasXMLFile (loader, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings)\r\n {\r\n var image;\r\n var data;\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n\r\n image = new ImageFile(loader, {\r\n key: key,\r\n url: GetFastValue(config, 'textureURL'),\r\n extension: GetFastValue(config, 'textureExtension', 'png'),\r\n normalMap: GetFastValue(config, 'normalMap'),\r\n xhrSettings: GetFastValue(config, 'textureXhrSettings')\r\n });\r\n\r\n data = new XMLFile(loader, {\r\n key: key,\r\n url: GetFastValue(config, 'atlasURL'),\r\n extension: GetFastValue(config, 'atlasExtension', 'xml'),\r\n xhrSettings: GetFastValue(config, 'atlasXhrSettings')\r\n });\r\n }\r\n else\r\n {\r\n image = new ImageFile(loader, key, textureURL, textureXhrSettings);\r\n data = new XMLFile(loader, key, atlasURL, atlasXhrSettings);\r\n }\r\n\r\n if (image.linkFile)\r\n {\r\n // Image has a normal map\r\n MultiFile.call(this, loader, 'atlasxml', key, [ image, data, image.linkFile ]);\r\n }\r\n else\r\n {\r\n MultiFile.call(this, loader, 'atlasxml', key, [ image, data ]);\r\n }\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.AtlasXMLFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.isReadyToProcess())\r\n {\r\n var image = this.files[0];\r\n var xml = this.files[1];\r\n var normalMap = (this.files[2]) ? this.files[2].data : null;\r\n\r\n this.loader.textureManager.addAtlasXML(image.key, image.data, xml.data, normalMap);\r\n\r\n xml.addToCache();\r\n\r\n this.complete = true;\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an XML based Texture Atlas, or array of atlases, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.atlasXML('mainmenu', 'images/MainMenu.png', 'images/MainMenu.xml');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring\r\n * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.\r\n *\r\n * Phaser expects the atlas data to be provided in an XML file format.\r\n * These files are created by software such as Shoebox and Adobe Flash / Animate.\r\n * \r\n * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Texture Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.atlasXML({\r\n * key: 'mainmenu',\r\n * textureURL: 'images/MainMenu.png',\r\n * atlasURL: 'images/MainMenu.xml'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig` for more details.\r\n *\r\n * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key:\r\n * \r\n * ```javascript\r\n * this.load.atlasXML('mainmenu', 'images/MainMenu.png', 'images/MainMenu.xml');\r\n * // and later in your game ...\r\n * this.add.image(x, y, 'mainmenu', 'background');\r\n * ```\r\n *\r\n * To get a list of all available frames within an atlas please consult your Texture Atlas software.\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the image from the Texture Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\r\n * and no URL is given then the Loader will set the URL to be \"alien.png\". It will always add `.png` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,\r\n * then you can specify it by providing an array as the `url` where the second element is the normal map:\r\n * \r\n * ```javascript\r\n * this.load.atlasXML('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.xml');\r\n * ```\r\n *\r\n * Or, if you are using a config object use the `normalMap` property:\r\n * \r\n * ```javascript\r\n * this.load.atlasXML({\r\n * key: 'mainmenu',\r\n * textureURL: 'images/MainMenu.png',\r\n * normalMap: 'images/MainMenu-n.png',\r\n * atlasURL: 'images/MainMenu.xml'\r\n * });\r\n * ```\r\n *\r\n * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings.\r\n * Normal maps are a WebGL only feature.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Atlas XML File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#atlasXML\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.7.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig|Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\r\n * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was \"alien\" then the URL will be \"alien.xml\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas xml file. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('atlasXML', function (key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings)\r\n{\r\n var multifile;\r\n\r\n // Supports an Object file definition in the key argument\r\n // Or an array of objects in the key argument\r\n // Or a single entry where all arguments have been defined\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n multifile = new AtlasXMLFile(this, key[i]);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n }\r\n else\r\n {\r\n multifile = new AtlasXMLFile(this, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = AtlasXMLFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/AtlasXMLFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/AudioFile.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/AudioFile.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../../const */ \"./node_modules/phaser/src/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar HTML5AudioFile = __webpack_require__(/*! ./HTML5AudioFile */ \"./node_modules/phaser/src/loader/filetypes/HTML5AudioFile.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Audio File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio.\r\n *\r\n * @class AudioFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.AudioFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {any} [urlConfig] - The absolute or relative URL to load this file from in a config object.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n * @param {AudioContext} [audioContext] - The AudioContext this file will use to process itself.\r\n */\r\nvar AudioFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n // URL is an object created by AudioFile.findAudioURL\r\n function AudioFile (loader, key, urlConfig, xhrSettings, audioContext)\r\n {\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n audioContext = GetFastValue(config, 'context', audioContext);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'audio',\r\n cache: loader.cacheManager.audio,\r\n extension: urlConfig.type,\r\n responseType: 'arraybuffer',\r\n key: key,\r\n url: urlConfig.url,\r\n xhrSettings: xhrSettings,\r\n config: { context: audioContext }\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.AudioFile#onProcess\r\n * @since 3.0.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n var _this = this;\r\n\r\n // interesting read https://github.com/WebAudio/web-audio-api/issues/1305\r\n this.config.context.decodeAudioData(this.xhrLoader.response,\r\n function (audioBuffer)\r\n {\r\n _this.data = audioBuffer;\r\n\r\n _this.onProcessComplete();\r\n },\r\n function (e)\r\n {\r\n // eslint-disable-next-line no-console\r\n console.error('Error decoding audio: ' + this.key + ' - ', e ? e.message : null);\r\n\r\n _this.onProcessError();\r\n }\r\n );\r\n\r\n this.config.context = null;\r\n }\r\n\r\n});\r\n\r\nAudioFile.create = function (loader, key, urls, config, xhrSettings)\r\n{\r\n var game = loader.systems.game;\r\n var audioConfig = game.config.audio;\r\n var deviceAudio = game.device.audio;\r\n\r\n // url may be inside key, which may be an object\r\n if (IsPlainObject(key))\r\n {\r\n urls = GetFastValue(key, 'url', []);\r\n config = GetFastValue(key, 'config', {});\r\n }\r\n\r\n var urlConfig = AudioFile.getAudioURL(game, urls);\r\n\r\n if (!urlConfig)\r\n {\r\n return null;\r\n }\r\n\r\n // https://developers.google.com/web/updates/2012/02/HTML5-audio-and-the-Web-Audio-API-are-BFFs\r\n // var stream = GetFastValue(config, 'stream', false);\r\n\r\n if (deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio))\r\n {\r\n return new AudioFile(loader, key, urlConfig, xhrSettings, game.sound.context);\r\n }\r\n else\r\n {\r\n return new HTML5AudioFile(loader, key, urlConfig, config);\r\n }\r\n};\r\n\r\nAudioFile.getAudioURL = function (game, urls)\r\n{\r\n if (!Array.isArray(urls))\r\n {\r\n urls = [ urls ];\r\n }\r\n\r\n for (var i = 0; i < urls.length; i++)\r\n {\r\n var url = GetFastValue(urls[i], 'url', urls[i]);\r\n\r\n if (url.indexOf('blob:') === 0 || url.indexOf('data:') === 0)\r\n {\r\n return url;\r\n }\r\n\r\n var audioType = url.match(/\\.([a-zA-Z0-9]+)($|\\?)/);\r\n\r\n audioType = GetFastValue(urls[i], 'type', (audioType) ? audioType[1] : '').toLowerCase();\r\n\r\n if (game.device.audio[audioType])\r\n {\r\n return {\r\n url: url,\r\n type: audioType\r\n };\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\n/**\r\n * Adds an Audio or HTML5Audio file, or array of audio files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.audio('title', [ 'music/Title.ogg', 'music/Title.mp3', 'music/Title.m4a' ]);\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global Audio Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Audio Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Audio Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.audio({\r\n * key: 'title',\r\n * url: [ 'music/Title.ogg', 'music/Title.mp3', 'music/Title.m4a' ]\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.AudioFileConfig` for more details.\r\n *\r\n * The URLs can be relative or absolute. If the URLs are relative the `Loader.baseURL` and `Loader.path` values will be prepended to them.\r\n *\r\n * Due to different browsers supporting different audio file types you should usually provide your audio files in a variety of formats.\r\n * ogg, mp3 and m4a are the most common. If you provide an array of URLs then the Loader will determine which _one_ file to load based on\r\n * browser support.\r\n *\r\n * If audio has been disabled in your game, either via the game config, or lack of support from the device, then no audio will be loaded.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Audio File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#audio\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.AudioFileConfig|Phaser.Types.Loader.FileTypes.AudioFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {(string|string[])} [urls] - The absolute or relative URL to load the audio files from.\r\n * @param {any} [config] - An object containing an `instances` property for HTML5Audio. Defaults to 1.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('audio', function (key, urls, config, xhrSettings)\r\n{\r\n var game = this.systems.game;\r\n var audioConfig = game.config.audio;\r\n var deviceAudio = game.device.audio;\r\n\r\n if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData))\r\n {\r\n // Sounds are disabled, so skip loading audio\r\n return this;\r\n }\r\n\r\n var audioFile;\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n audioFile = AudioFile.create(this, key[i]);\r\n\r\n if (audioFile)\r\n {\r\n this.addFile(audioFile);\r\n }\r\n }\r\n }\r\n else\r\n {\r\n audioFile = AudioFile.create(this, key, urls, config, xhrSettings);\r\n\r\n if (audioFile)\r\n {\r\n this.addFile(audioFile);\r\n }\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = AudioFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/AudioFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/AudioSpriteFile.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/AudioSpriteFile.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar AudioFile = __webpack_require__(/*! ./AudioFile.js */ \"./node_modules/phaser/src/loader/filetypes/AudioFile.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\nvar JSONFile = __webpack_require__(/*! ./JSONFile.js */ \"./node_modules/phaser/src/loader/filetypes/JSONFile.js\");\r\nvar MultiFile = __webpack_require__(/*! ../MultiFile.js */ \"./node_modules/phaser/src/loader/MultiFile.js\");\r\n\r\n/**\r\n * @classdesc\r\n * An Audio Sprite File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#audioSprite method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audioSprite.\r\n *\r\n * @class AudioSpriteFile\r\n * @extends Phaser.Loader.MultiFile\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} jsonURL - The absolute or relative URL to load the json file from. Or a well formed JSON object to use instead.\r\n * @param {{(string|string[])}} [audioURL] - The absolute or relative URL to load the audio file from. If empty it will be obtained by parsing the JSON file.\r\n * @param {any} [audioConfig] - The audio configuration options.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [audioXhrSettings] - An XHR Settings configuration object for the audio file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings.\r\n */\r\nvar AudioSpriteFile = new Class({\r\n\r\n Extends: MultiFile,\r\n\r\n initialize:\r\n\r\n function AudioSpriteFile (loader, key, jsonURL, audioURL, audioConfig, audioXhrSettings, jsonXhrSettings)\r\n {\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n jsonURL = GetFastValue(config, 'jsonURL');\r\n audioURL = GetFastValue(config, 'audioURL');\r\n audioConfig = GetFastValue(config, 'audioConfig');\r\n audioXhrSettings = GetFastValue(config, 'audioXhrSettings');\r\n jsonXhrSettings = GetFastValue(config, 'jsonXhrSettings');\r\n }\r\n\r\n var data;\r\n\r\n // No url? then we're going to do a json load and parse it from that\r\n if (!audioURL)\r\n {\r\n data = new JSONFile(loader, key, jsonURL, jsonXhrSettings);\r\n \r\n MultiFile.call(this, loader, 'audiosprite', key, [ data ]);\r\n\r\n this.config.resourceLoad = true;\r\n this.config.audioConfig = audioConfig;\r\n this.config.audioXhrSettings = audioXhrSettings;\r\n }\r\n else\r\n {\r\n var audio = AudioFile.create(loader, key, audioURL, audioConfig, audioXhrSettings);\r\n\r\n if (audio)\r\n {\r\n data = new JSONFile(loader, key, jsonURL, jsonXhrSettings);\r\n\r\n MultiFile.call(this, loader, 'audiosprite', key, [ audio, data ]);\r\n\r\n this.config.resourceLoad = false;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Called by each File when it finishes loading.\r\n *\r\n * @method Phaser.Loader.FileTypes.AudioSpriteFile#onFileComplete\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has completed processing.\r\n */\r\n onFileComplete: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.pending--;\r\n\r\n if (this.config.resourceLoad && file.type === 'json' && file.data.hasOwnProperty('resources'))\r\n {\r\n // Inspect the data for the files to now load\r\n var urls = file.data.resources;\r\n\r\n var audioConfig = GetFastValue(this.config, 'audioConfig');\r\n var audioXhrSettings = GetFastValue(this.config, 'audioXhrSettings');\r\n\r\n var audio = AudioFile.create(this.loader, file.key, urls, audioConfig, audioXhrSettings);\r\n\r\n if (audio)\r\n {\r\n this.addToMultiFile(audio);\r\n\r\n this.loader.addFile(audio);\r\n }\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.AudioSpriteFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.isReadyToProcess())\r\n {\r\n var fileA = this.files[0];\r\n var fileB = this.files[1];\r\n\r\n fileA.addToCache();\r\n fileB.addToCache();\r\n\r\n this.complete = true;\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a JSON based Audio Sprite, or array of audio sprites, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.audioSprite('kyobi', 'kyobi.json', [\r\n * 'kyobi.ogg',\r\n * 'kyobi.mp3',\r\n * 'kyobi.m4a'\r\n * ]);\r\n * }\r\n * ```\r\n * \r\n * Audio Sprites are a combination of audio files and a JSON configuration.\r\n * The JSON follows the format of that created by https://github.com/tonistiigi/audiosprite\r\n *\r\n * If the JSON file includes a 'resource' object then you can let Phaser parse it and load the audio\r\n * files automatically based on its content. To do this exclude the audio URLs from the load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.audioSprite('kyobi', 'kyobi.json');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring\r\n * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Audio Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Audio Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Audio Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.audioSprite({\r\n * key: 'kyobi',\r\n * jsonURL: 'audio/Kyobi.json',\r\n * audioURL: [\r\n * 'audio/Kyobi.ogg',\r\n * 'audio/Kyobi.mp3',\r\n * 'audio/Kyobi.m4a'\r\n * ]\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig` for more details.\r\n *\r\n * Instead of passing a URL for the audio JSON data you can also pass in a well formed JSON object instead.\r\n *\r\n * Once the audio has finished loading you can use it create an Audio Sprite by referencing its key:\r\n * \r\n * ```javascript\r\n * this.load.audioSprite('kyobi', 'kyobi.json');\r\n * // and later in your game ...\r\n * var music = this.sound.addAudioSprite('kyobi');\r\n * music.play('title');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the image from the Texture Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * Due to different browsers supporting different audio file types you should usually provide your audio files in a variety of formats.\r\n * ogg, mp3 and m4a are the most common. If you provide an array of URLs then the Loader will determine which _one_ file to load based on\r\n * browser support.\r\n *\r\n * If audio has been disabled in your game, either via the game config, or lack of support from the device, then no audio will be loaded.\r\n * \r\n * Note: The ability to load this type of file will only be available if the Audio Sprite File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#audioSprite\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig|Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig[])} key - The key to use for this file, or a file configuration object, or an array of objects.\r\n * @param {string} jsonURL - The absolute or relative URL to load the json file from. Or a well formed JSON object to use instead.\r\n * @param {(string|string[])} [audioURL] - The absolute or relative URL to load the audio file from. If empty it will be obtained by parsing the JSON file.\r\n * @param {any} [audioConfig] - The audio configuration options.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [audioXhrSettings] - An XHR Settings configuration object for the audio file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader.\r\n */\r\nFileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audioConfig, audioXhrSettings, jsonXhrSettings)\r\n{\r\n var game = this.systems.game;\r\n var gameAudioConfig = game.config.audio;\r\n var deviceAudio = game.device.audio;\r\n\r\n if ((gameAudioConfig && gameAudioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData))\r\n {\r\n // Sounds are disabled, so skip loading audio\r\n return this;\r\n }\r\n\r\n var multifile;\r\n\r\n // Supports an Object file definition in the key argument\r\n // Or an array of objects in the key argument\r\n // Or a single entry where all arguments have been defined\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n multifile = new AudioSpriteFile(this, key[i]);\r\n\r\n if (multifile.files)\r\n {\r\n this.addFile(multifile.files);\r\n }\r\n }\r\n }\r\n else\r\n {\r\n multifile = new AudioSpriteFile(this, key, jsonURL, audioURL, audioConfig, audioXhrSettings, jsonXhrSettings);\r\n\r\n if (multifile.files)\r\n {\r\n this.addFile(multifile.files);\r\n }\r\n }\r\n\r\n return this;\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/AudioSpriteFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/BinaryFile.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/BinaryFile.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Binary File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#binary method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#binary.\r\n *\r\n * @class BinaryFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.BinaryFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.bin`, i.e. if `key` was \"alien\" then the URL will be \"alien.bin\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n * @param {any} [dataType] - Optional type to cast the binary file to once loaded. For example, `Uint8Array`.\r\n */\r\nvar BinaryFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function BinaryFile (loader, key, url, xhrSettings, dataType)\r\n {\r\n var extension = 'bin';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n dataType = GetFastValue(config, 'dataType', dataType);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'binary',\r\n cache: loader.cacheManager.binary,\r\n extension: extension,\r\n responseType: 'arraybuffer',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: { dataType: dataType }\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.BinaryFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n var ctor = this.config.dataType;\r\n\r\n this.data = (ctor) ? new ctor(this.xhrLoader.response) : this.xhrLoader.response;\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a Binary file, or array of Binary files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.binary('doom', 'files/Doom.wad');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global Binary Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Binary Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Binary Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.binary({\r\n * key: 'doom',\r\n * url: 'files/Doom.wad',\r\n * dataType: Uint8Array\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.BinaryFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n * \r\n * ```javascript\r\n * this.load.binary('doom', 'files/Doom.wad');\r\n * // and later in your game ...\r\n * var data = this.cache.binary.get('doom');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Data` the final key will be `LEVEL1.Data` and\r\n * this is what you would use to retrieve the text from the Binary Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"doom\"\r\n * and no URL is given then the Loader will set the URL to be \"doom.bin\". It will always add `.bin` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Binary File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#binary\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.BinaryFileConfig|Phaser.Types.Loader.FileTypes.BinaryFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.bin`, i.e. if `key` was \"alien\" then the URL will be \"alien.bin\".\r\n * @param {any} [dataType] - Optional type to cast the binary file to once loaded. For example, `Uint8Array`.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('binary', function (key, url, dataType, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new BinaryFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new BinaryFile(this, key, url, xhrSettings, dataType));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = BinaryFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/BinaryFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/BitmapFontFile.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/BitmapFontFile.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar ImageFile = __webpack_require__(/*! ./ImageFile.js */ \"./node_modules/phaser/src/loader/filetypes/ImageFile.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\nvar MultiFile = __webpack_require__(/*! ../MultiFile.js */ \"./node_modules/phaser/src/loader/MultiFile.js\");\r\nvar ParseXMLBitmapFont = __webpack_require__(/*! ../../gameobjects/bitmaptext/ParseXMLBitmapFont.js */ \"./node_modules/phaser/src/gameobjects/bitmaptext/ParseXMLBitmapFont.js\");\r\nvar XMLFile = __webpack_require__(/*! ./XMLFile.js */ \"./node_modules/phaser/src/loader/filetypes/XMLFile.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Bitmap Font based File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#bitmapFont method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#bitmapFont.\r\n *\r\n * @class BitmapFontFile\r\n * @extends Phaser.Loader.MultiFile\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.BitmapFontFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string|string[]} [textureURL] - The absolute or relative URL to load the font image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\r\n * @param {string} [fontDataURL] - The absolute or relative URL to load the font xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was \"alien\" then the URL will be \"alien.xml\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the font image file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [fontDataXhrSettings] - An XHR Settings configuration object for the font data xml file. Used in replacement of the Loaders default XHR Settings.\r\n */\r\nvar BitmapFontFile = new Class({\r\n\r\n Extends: MultiFile,\r\n\r\n initialize:\r\n\r\n function BitmapFontFile (loader, key, textureURL, fontDataURL, textureXhrSettings, fontDataXhrSettings)\r\n {\r\n var image;\r\n var data;\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n\r\n image = new ImageFile(loader, {\r\n key: key,\r\n url: GetFastValue(config, 'textureURL'),\r\n extension: GetFastValue(config, 'textureExtension', 'png'),\r\n normalMap: GetFastValue(config, 'normalMap'),\r\n xhrSettings: GetFastValue(config, 'textureXhrSettings')\r\n });\r\n\r\n data = new XMLFile(loader, {\r\n key: key,\r\n url: GetFastValue(config, 'fontDataURL'),\r\n extension: GetFastValue(config, 'fontDataExtension', 'xml'),\r\n xhrSettings: GetFastValue(config, 'fontDataXhrSettings')\r\n });\r\n }\r\n else\r\n {\r\n image = new ImageFile(loader, key, textureURL, textureXhrSettings);\r\n data = new XMLFile(loader, key, fontDataURL, fontDataXhrSettings);\r\n }\r\n\r\n if (image.linkFile)\r\n {\r\n // Image has a normal map\r\n MultiFile.call(this, loader, 'bitmapfont', key, [ image, data, image.linkFile ]);\r\n }\r\n else\r\n {\r\n MultiFile.call(this, loader, 'bitmapfont', key, [ image, data ]);\r\n }\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.BitmapFontFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.isReadyToProcess())\r\n {\r\n var image = this.files[0];\r\n var xml = this.files[1];\r\n\r\n image.addToCache();\r\n xml.addToCache();\r\n\r\n this.loader.cacheManager.bitmapFont.add(image.key, { data: ParseXMLBitmapFont(xml.data), texture: image.key, frame: null });\r\n\r\n this.complete = true;\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an XML based Bitmap Font, or array of fonts, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.bitmapFont('goldenFont', 'images/GoldFont.png', 'images/GoldFont.xml');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring\r\n * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.\r\n *\r\n * Phaser expects the font data to be provided in an XML file format.\r\n * These files are created by software such as the [Angelcode Bitmap Font Generator](http://www.angelcode.com/products/bmfont/),\r\n * [Littera](http://kvazars.com/littera/) or [Glyph Designer](https://71squared.com/glyphdesigner)\r\n * \r\n * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Texture Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.bitmapFont({\r\n * key: 'goldenFont',\r\n * textureURL: 'images/GoldFont.png',\r\n * fontDataURL: 'images/GoldFont.xml'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.BitmapFontFileConfig` for more details.\r\n *\r\n * Once the atlas has finished loading you can use key of it when creating a Bitmap Text Game Object:\r\n * \r\n * ```javascript\r\n * this.load.bitmapFont('goldenFont', 'images/GoldFont.png', 'images/GoldFont.xml');\r\n * // and later in your game ...\r\n * this.add.bitmapText(x, y, 'goldenFont', 'Hello World');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use when creating a Bitmap Text object.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\r\n * and no URL is given then the Loader will set the URL to be \"alien.png\". It will always add `.png` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,\r\n * then you can specify it by providing an array as the `url` where the second element is the normal map:\r\n * \r\n * ```javascript\r\n * this.load.bitmapFont('goldenFont', [ 'images/GoldFont.png', 'images/GoldFont-n.png' ], 'images/GoldFont.xml');\r\n * ```\r\n *\r\n * Or, if you are using a config object use the `normalMap` property:\r\n * \r\n * ```javascript\r\n * this.load.bitmapFont({\r\n * key: 'goldenFont',\r\n * textureURL: 'images/GoldFont.png',\r\n * normalMap: 'images/GoldFont-n.png',\r\n * fontDataURL: 'images/GoldFont.xml'\r\n * });\r\n * ```\r\n *\r\n * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings.\r\n * Normal maps are a WebGL only feature.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Bitmap Font File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#bitmapFont\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.BitmapFontFileConfig|Phaser.Types.Loader.FileTypes.BitmapFontFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string|string[]} [textureURL] - The absolute or relative URL to load the font image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\r\n * @param {string} [fontDataURL] - The absolute or relative URL to load the font xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was \"alien\" then the URL will be \"alien.xml\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the font image file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [fontDataXhrSettings] - An XHR Settings configuration object for the font data xml file. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('bitmapFont', function (key, textureURL, fontDataURL, textureXhrSettings, fontDataXhrSettings)\r\n{\r\n var multifile;\r\n\r\n // Supports an Object file definition in the key argument\r\n // Or an array of objects in the key argument\r\n // Or a single entry where all arguments have been defined\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n multifile = new BitmapFontFile(this, key[i]);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n }\r\n else\r\n {\r\n multifile = new BitmapFontFile(this, key, textureURL, fontDataURL, textureXhrSettings, fontDataXhrSettings);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = BitmapFontFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/BitmapFontFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/CSSFile.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/CSSFile.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single CSS File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#css method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#css.\r\n *\r\n * @class CSSFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.17.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.CSSFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was \"alien\" then the URL will be \"alien.js\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar CSSFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function CSSFile (loader, key, url, xhrSettings)\r\n {\r\n var extension = 'css';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'script',\r\n cache: false,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.CSSFile#onProcess\r\n * @since 3.17.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = document.createElement('style');\r\n this.data.defer = false;\r\n this.data.innerHTML = this.xhrLoader.responseText;\r\n\r\n document.head.appendChild(this.data);\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a CSS file, or array of CSS files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.css('headers', 'styles/headers.css');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * The key must be a unique String and not already in-use by another file in the Loader.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.css({\r\n * key: 'headers',\r\n * url: 'styles/headers.css'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.CSSFileConfig` for more details.\r\n *\r\n * Once the file has finished loading it will automatically be converted into a style DOM element\r\n * via `document.createElement('style')`. It will have its `defer` property set to false and then the\r\n * resulting element will be appended to `document.head`. The CSS styles are then applied to the current document.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\r\n * and no URL is given then the Loader will set the URL to be \"alien.css\". It will always add `.css` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the CSS File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#css\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.17.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.CSSFileConfig|Phaser.Types.Loader.FileTypes.CSSFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.css`, i.e. if `key` was \"alien\" then the URL will be \"alien.css\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('css', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new CSSFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new CSSFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = CSSFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/CSSFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/GLSLFile.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/GLSLFile.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\nvar Shader = __webpack_require__(/*! ../../display/shader/BaseShader */ \"./node_modules/phaser/src/display/shader/BaseShader.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single GLSL File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#glsl method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#glsl.\r\n *\r\n * @class GLSLFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.GLSLFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was \"alien\" then the URL will be \"alien.txt\".\r\n * @param {string} [shaderType='fragment'] - The type of shader. Either `fragment` for a fragment shader, or `vertex` for a vertex shader. This is ignored if you load a shader bundle.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar GLSLFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function GLSLFile (loader, key, url, shaderType, xhrSettings)\r\n {\r\n var extension = 'glsl';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n shaderType = GetFastValue(config, 'shaderType', 'fragment');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n }\r\n else if (shaderType === undefined)\r\n {\r\n shaderType = 'fragment';\r\n }\r\n\r\n var fileConfig = {\r\n type: 'glsl',\r\n cache: loader.cacheManager.shader,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n config: {\r\n shaderType: shaderType\r\n },\r\n xhrSettings: xhrSettings\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.GLSLFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = this.xhrLoader.responseText;\r\n\r\n this.onProcessComplete();\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.GLSLFile#addToCache\r\n * @since 3.17.0\r\n */\r\n addToCache: function ()\r\n {\r\n var data = this.data.split('\\n');\r\n\r\n // Check to see if this is a shader bundle, or raw glsl file.\r\n var block = this.extractBlock(data, 0);\r\n\r\n if (block)\r\n {\r\n while (block)\r\n {\r\n var key = this.getShaderName(block.header);\r\n var shaderType = this.getShaderType(block.header);\r\n var uniforms = this.getShaderUniforms(block.header);\r\n var shaderSrc = block.shader;\r\n\r\n if (this.cache.has(key))\r\n {\r\n var shader = this.cache.get(key);\r\n\r\n if (shaderType === 'fragment')\r\n {\r\n shader.fragmentSrc = shaderSrc;\r\n }\r\n else\r\n {\r\n shader.vertexSrc = shaderSrc;\r\n }\r\n\r\n if (!shader.uniforms)\r\n {\r\n shader.uniforms = uniforms;\r\n }\r\n }\r\n else if (shaderType === 'fragment')\r\n {\r\n this.cache.add(key, new Shader(key, shaderSrc, '', uniforms));\r\n }\r\n else\r\n {\r\n this.cache.add(key, new Shader(key, '', shaderSrc, uniforms));\r\n }\r\n\r\n block = this.extractBlock(data, block.offset);\r\n }\r\n }\r\n else if (this.config.shaderType === 'fragment')\r\n {\r\n // Single shader\r\n this.cache.add(this.key, new Shader(this.key, this.data));\r\n }\r\n else\r\n {\r\n this.cache.add(this.key, new Shader(this.key, '', this.data));\r\n }\r\n\r\n this.pendingDestroy();\r\n },\r\n\r\n /**\r\n * Returns the name of the shader from the header block.\r\n *\r\n * @method Phaser.Loader.FileTypes.GLSLFile#getShaderName\r\n * @since 3.17.0\r\n * \r\n * @param {string[]} headerSource - The header data.\r\n * \r\n * @return {string} The shader name.\r\n */\r\n getShaderName: function (headerSource)\r\n {\r\n for (var i = 0; i < headerSource.length; i++)\r\n {\r\n var line = headerSource[i].trim();\r\n\r\n if (line.substring(0, 5) === 'name:')\r\n {\r\n return line.substring(5).trim();\r\n }\r\n }\r\n\r\n return this.key;\r\n },\r\n\r\n /**\r\n * Returns the type of the shader from the header block.\r\n *\r\n * @method Phaser.Loader.FileTypes.GLSLFile#getShaderType\r\n * @since 3.17.0\r\n * \r\n * @param {string[]} headerSource - The header data.\r\n * \r\n * @return {string} The shader type. Either 'fragment' or 'vertex'.\r\n */\r\n getShaderType: function (headerSource)\r\n {\r\n for (var i = 0; i < headerSource.length; i++)\r\n {\r\n var line = headerSource[i].trim();\r\n\r\n if (line.substring(0, 5) === 'type:')\r\n {\r\n return line.substring(5).trim();\r\n }\r\n }\r\n\r\n return this.config.shaderType;\r\n },\r\n\r\n /**\r\n * Returns the shader uniforms from the header block.\r\n *\r\n * @method Phaser.Loader.FileTypes.GLSLFile#getShaderUniforms\r\n * @since 3.17.0\r\n * \r\n * @param {string[]} headerSource - The header data.\r\n * \r\n * @return {any} The shader uniforms object.\r\n */\r\n getShaderUniforms: function (headerSource)\r\n {\r\n var uniforms = {};\r\n\r\n for (var i = 0; i < headerSource.length; i++)\r\n {\r\n var line = headerSource[i].trim();\r\n\r\n if (line.substring(0, 8) === 'uniform.')\r\n {\r\n var pos = line.indexOf(':');\r\n\r\n if (pos)\r\n {\r\n var key = line.substring(8, pos);\r\n\r\n try\r\n {\r\n uniforms[key] = JSON.parse(line.substring(pos + 1));\r\n }\r\n catch (e)\r\n {\r\n console.warn('Invalid uniform JSON: ' + key);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return uniforms;\r\n },\r\n\r\n /**\r\n * Processes the shader file and extracts the relevant data.\r\n *\r\n * @method Phaser.Loader.FileTypes.GLSLFile#extractBlock\r\n * @private\r\n * @since 3.17.0\r\n * \r\n * @param {string[]} data - The array of shader data to process.\r\n * @param {integer} offset - The offset to start processing from.\r\n * \r\n * @return {any} The processed shader block, or null.\r\n */\r\n extractBlock: function (data, offset)\r\n {\r\n var headerStart = -1;\r\n var headerEnd = -1;\r\n var blockEnd = -1;\r\n var headerOpen = false;\r\n var captureSource = false;\r\n var headerSource = [];\r\n var shaderSource = [];\r\n\r\n for (var i = offset; i < data.length; i++)\r\n {\r\n var line = data[i].trim();\r\n\r\n if (line === '---')\r\n {\r\n if (headerStart === -1)\r\n {\r\n headerStart = i;\r\n headerOpen = true;\r\n }\r\n else if (headerOpen)\r\n {\r\n headerEnd = i;\r\n headerOpen = false;\r\n captureSource = true;\r\n }\r\n else\r\n {\r\n // We've hit another --- delimiter, break out\r\n captureSource = false;\r\n break;\r\n }\r\n }\r\n else if (headerOpen)\r\n {\r\n headerSource.push(line);\r\n }\r\n else if (captureSource)\r\n {\r\n shaderSource.push(line);\r\n blockEnd = i;\r\n }\r\n }\r\n\r\n if (!headerOpen && headerEnd !== -1)\r\n {\r\n return { header: headerSource, shader: shaderSource.join('\\n'), offset: blockEnd };\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a GLSL file, or array of GLSL files, to the current load queue.\r\n * In Phaser 3 GLSL files are just plain Text files at the current moment in time.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.glsl('plasma', 'shaders/Plasma.glsl');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global Shader Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Shader Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Shader Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.glsl({\r\n * key: 'plasma',\r\n * shaderType: 'fragment',\r\n * url: 'shaders/Plasma.glsl'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.GLSLFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n * \r\n * ```javascript\r\n * this.load.glsl('plasma', 'shaders/Plasma.glsl');\r\n * // and later in your game ...\r\n * var data = this.cache.shader.get('plasma');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `FX.` and the key was `Plasma` the final key will be `FX.Plasma` and\r\n * this is what you would use to retrieve the text from the Shader Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"plasma\"\r\n * and no URL is given then the Loader will set the URL to be \"plasma.glsl\". It will always add `.glsl` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the GLSL File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#glsl\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.GLSLFileConfig|Phaser.Types.Loader.FileTypes.GLSLFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.glsl`, i.e. if `key` was \"alien\" then the URL will be \"alien.glsl\".\r\n * @param {string} [shaderType='fragment'] - The type of shader. Either `fragment` for a fragment shader, or `vertex` for a vertex shader. This is ignored if you load a shader bundle.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('glsl', function (key, url, shaderType, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new GLSLFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new GLSLFile(this, key, url, shaderType, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = GLSLFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/GLSLFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/HTML5AudioFile.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/HTML5AudioFile.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/loader/events/index.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar GetURL = __webpack_require__(/*! ../GetURL */ \"./node_modules/phaser/src/loader/GetURL.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Audio File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio.\r\n *\r\n * @class HTML5AudioFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.AudioFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} [urlConfig] - The absolute or relative URL to load this file from.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar HTML5AudioFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function HTML5AudioFile (loader, key, urlConfig, audioConfig)\r\n {\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n audioConfig = GetFastValue(config, 'config', audioConfig);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'audio',\r\n cache: loader.cacheManager.audio,\r\n extension: urlConfig.type,\r\n key: key,\r\n url: urlConfig.url,\r\n config: audioConfig\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n\r\n // New properties specific to this class\r\n this.locked = 'ontouchstart' in window;\r\n this.loaded = false;\r\n this.filesLoaded = 0;\r\n this.filesTotal = 0;\r\n },\r\n\r\n /**\r\n * Called when the file finishes loading.\r\n *\r\n * @method Phaser.Loader.FileTypes.HTML5AudioFile#onLoad\r\n * @since 3.0.0\r\n */\r\n onLoad: function ()\r\n {\r\n if (this.loaded)\r\n {\r\n return;\r\n }\r\n\r\n this.loaded = true;\r\n\r\n this.loader.nextFile(this, true);\r\n },\r\n\r\n /**\r\n * Called if the file errors while loading.\r\n *\r\n * @method Phaser.Loader.FileTypes.HTML5AudioFile#onError\r\n * @since 3.0.0\r\n */\r\n onError: function ()\r\n {\r\n for (var i = 0; i < this.data.length; i++)\r\n {\r\n var audio = this.data[i];\r\n\r\n audio.oncanplaythrough = null;\r\n audio.onerror = null;\r\n }\r\n\r\n this.loader.nextFile(this, false);\r\n },\r\n\r\n /**\r\n * Called during the file load progress. Is sent a DOM ProgressEvent.\r\n *\r\n * @method Phaser.Loader.FileTypes.HTML5AudioFile#onProgress\r\n * @fires Phaser.Loader.Events#FILE_PROGRESS\r\n * @since 3.0.0\r\n */\r\n onProgress: function (event)\r\n {\r\n var audio = event.target;\r\n\r\n audio.oncanplaythrough = null;\r\n audio.onerror = null;\r\n\r\n this.filesLoaded++;\r\n\r\n this.percentComplete = Math.min((this.filesLoaded / this.filesTotal), 1);\r\n\r\n this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete);\r\n\r\n if (this.filesLoaded === this.filesTotal)\r\n {\r\n this.onLoad();\r\n }\r\n },\r\n\r\n /**\r\n * Called by the Loader, starts the actual file downloading.\r\n * During the load the methods onLoad, onError and onProgress are called, based on the XHR events.\r\n * You shouldn't normally call this method directly, it's meant to be invoked by the Loader.\r\n *\r\n * @method Phaser.Loader.FileTypes.HTML5AudioFile#load\r\n * @since 3.0.0\r\n */\r\n load: function ()\r\n {\r\n this.data = [];\r\n\r\n var instances = (this.config && this.config.instances) || 1;\r\n\r\n this.filesTotal = instances;\r\n this.filesLoaded = 0;\r\n this.percentComplete = 0;\r\n\r\n for (var i = 0; i < instances; i++)\r\n {\r\n var audio = new Audio();\r\n audio.dataset = {};\r\n audio.dataset.name = this.key + ('0' + i).slice(-2);\r\n audio.dataset.used = 'false';\r\n\r\n if (this.locked)\r\n {\r\n audio.dataset.locked = 'true';\r\n }\r\n else\r\n {\r\n audio.dataset.locked = 'false';\r\n\r\n audio.preload = 'auto';\r\n audio.oncanplaythrough = this.onProgress.bind(this);\r\n audio.onerror = this.onError.bind(this);\r\n }\r\n\r\n this.data.push(audio);\r\n }\r\n\r\n for (i = 0; i < this.data.length; i++)\r\n {\r\n audio = this.data[i];\r\n audio.src = GetURL(this, this.loader.baseURL);\r\n\r\n if (!this.locked)\r\n {\r\n audio.load();\r\n }\r\n }\r\n\r\n if (this.locked)\r\n {\r\n // This is super-dangerous but works. Race condition potential high.\r\n // Is there another way?\r\n setTimeout(this.onLoad.bind(this));\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = HTML5AudioFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/HTML5AudioFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/HTMLFile.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/HTMLFile.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single HTML File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#html method and are not typically created directly.\r\n *\r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#html.\r\n *\r\n * @class HTMLFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.12.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.HTMLFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was \"alien\" then the URL will be \"alien.html\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar HTMLFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function HTMLFile (loader, key, url, xhrSettings)\r\n {\r\n var extension = 'html';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'text',\r\n cache: loader.cacheManager.html,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.HTMLFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = this.xhrLoader.responseText;\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an HTML file, or array of HTML files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n *\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.html('story', 'files/LoginForm.html');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global HTML Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the HTML Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the HTML Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n *\r\n * ```javascript\r\n * this.load.html({\r\n * key: 'login',\r\n * url: 'files/LoginForm.html'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.HTMLFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n *\r\n * ```javascript\r\n * this.load.html('login', 'files/LoginForm.html');\r\n * // and later in your game ...\r\n * var data = this.cache.html.get('login');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and\r\n * this is what you would use to retrieve the html from the HTML Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"story\"\r\n * and no URL is given then the Loader will set the URL to be \"story.html\". It will always add `.html` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the HTML File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#html\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.12.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.HTMLFileConfig|Phaser.Types.Loader.FileTypes.HTMLFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was \"alien\" then the URL will be \"alien.html\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('html', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new HTMLFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new HTMLFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = HTMLFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/HTMLFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/HTMLTextureFile.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/HTMLTextureFile.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single HTML File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#htmlTexture method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#htmlTexture.\r\n *\r\n * @class HTMLTextureFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.12.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\r\n * @param {integer} [width] - The width of the texture the HTML will be rendered to.\r\n * @param {integer} [height] - The height of the texture the HTML will be rendered to.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar HTMLTextureFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function HTMLTextureFile (loader, key, url, width, height, xhrSettings)\r\n {\r\n if (width === undefined) { width = 512; }\r\n if (height === undefined) { height = 512; }\r\n\r\n var extension = 'html';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n width = GetFastValue(config, 'width', width);\r\n height = GetFastValue(config, 'height', height);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'html',\r\n cache: loader.textureManager,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: {\r\n width: width,\r\n height: height\r\n }\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.HTMLTextureFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n var w = this.config.width;\r\n var h = this.config.height;\r\n\r\n var data = [];\r\n\r\n data.push('');\r\n data.push('');\r\n data.push('');\r\n data.push(this.xhrLoader.responseText);\r\n data.push('');\r\n data.push('');\r\n data.push('');\r\n\r\n var svg = [ data.join('\\n') ];\r\n var _this = this;\r\n\r\n try\r\n {\r\n var blob = new window.Blob(svg, { type: 'image/svg+xml;charset=utf-8' });\r\n }\r\n catch (e)\r\n {\r\n _this.state = CONST.FILE_ERRORED;\r\n\r\n _this.onProcessComplete();\r\n\r\n return;\r\n }\r\n\r\n this.data = new Image();\r\n\r\n this.data.crossOrigin = this.crossOrigin;\r\n\r\n this.data.onload = function ()\r\n {\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.onProcessComplete();\r\n };\r\n\r\n this.data.onerror = function ()\r\n {\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.onProcessError();\r\n };\r\n\r\n File.createObjectURL(this.data, blob, 'image/svg+xml');\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.HTMLTextureFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n var texture = this.cache.addImage(this.key, this.data);\r\n\r\n this.pendingDestroy(texture);\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an HTML File, or array of HTML Files, to the current load queue. When the files are loaded they\r\n * will be rendered to textures and stored in the Texture Manager.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.htmlTexture('instructions', 'content/intro.html', 256, 512);\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Texture Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.htmlTexture({\r\n * key: 'instructions',\r\n * url: 'content/intro.html',\r\n * width: 256,\r\n * height: 512\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key:\r\n * \r\n * ```javascript\r\n * this.load.htmlTexture('instructions', 'content/intro.html', 256, 512);\r\n * // and later in your game ...\r\n * this.add.image(x, y, 'instructions');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the image from the Texture Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\r\n * and no URL is given then the Loader will set the URL to be \"alien.html\". It will always add `.html` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * The width and height are the size of the texture to which the HTML will be rendered. It's not possible to determine these\r\n * automatically, so you will need to provide them, either as arguments or in the file config object.\r\n * When the HTML file has loaded a new SVG element is created with a size and viewbox set to the width and height given.\r\n * The SVG file has a body tag added to it, with the HTML file contents included. It then calls `window.Blob` on the SVG,\r\n * and if successful is added to the Texture Manager, otherwise it fails processing. The overall quality of the rendered\r\n * HTML depends on your browser, and some of them may not even support the svg / blob process used. Be aware that there are\r\n * limitations on what HTML can be inside an SVG. You can find out more details in this\r\n * [Mozilla MDN entry](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Drawing_DOM_objects_into_a_canvas).\r\n *\r\n * Note: The ability to load this type of file will only be available if the HTMLTextureFile File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#htmlTexture\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.12.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was \"alien\" then the URL will be \"alien.html\".\r\n * @param {integer} [width=512] - The width of the texture the HTML will be rendered to.\r\n * @param {integer} [height=512] - The height of the texture the HTML will be rendered to.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('htmlTexture', function (key, url, width, height, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new HTMLTextureFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new HTMLTextureFile(this, key, url, width, height, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = HTMLTextureFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/HTMLTextureFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/ImageFile.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/ImageFile.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Image File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image.\r\n *\r\n * @class ImageFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets.\r\n */\r\nvar ImageFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function ImageFile (loader, key, url, xhrSettings, frameConfig)\r\n {\r\n var extension = 'png';\r\n var normalMapURL;\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n normalMapURL = GetFastValue(config, 'normalMap');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n frameConfig = GetFastValue(config, 'frameConfig');\r\n }\r\n\r\n if (Array.isArray(url))\r\n {\r\n normalMapURL = url[1];\r\n url = url[0];\r\n }\r\n\r\n var fileConfig = {\r\n type: 'image',\r\n cache: loader.textureManager,\r\n extension: extension,\r\n responseType: 'blob',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: frameConfig\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n\r\n // Do we have a normal map to load as well?\r\n if (normalMapURL)\r\n {\r\n var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig);\r\n\r\n normalMap.type = 'normalMap';\r\n\r\n this.setLink(normalMap);\r\n\r\n loader.addFile(normalMap);\r\n }\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.ImageFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = new Image();\r\n\r\n this.data.crossOrigin = this.crossOrigin;\r\n\r\n var _this = this;\r\n\r\n this.data.onload = function ()\r\n {\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.onProcessComplete();\r\n };\r\n\r\n this.data.onerror = function ()\r\n {\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.onProcessError();\r\n };\r\n\r\n File.createObjectURL(this.data, this.xhrLoader.response, 'image/png');\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.ImageFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n var texture;\r\n var linkFile = this.linkFile;\r\n\r\n if (linkFile && linkFile.state === CONST.FILE_COMPLETE)\r\n {\r\n if (this.type === 'image')\r\n {\r\n texture = this.cache.addImage(this.key, this.data, linkFile.data);\r\n }\r\n else\r\n {\r\n texture = this.cache.addImage(linkFile.key, linkFile.data, this.data);\r\n }\r\n\r\n this.pendingDestroy(texture);\r\n\r\n linkFile.pendingDestroy(texture);\r\n }\r\n else if (!linkFile)\r\n {\r\n texture = this.cache.addImage(this.key, this.data);\r\n\r\n this.pendingDestroy(texture);\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an Image, or array of Images, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.image('logo', 'images/phaserLogo.png');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.\r\n * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback\r\n * of animated gifs to Canvas elements.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Texture Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.image({\r\n * key: 'logo',\r\n * url: 'images/AtariLogo.png'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key:\r\n * \r\n * ```javascript\r\n * this.load.image('logo', 'images/AtariLogo.png');\r\n * // and later in your game ...\r\n * this.add.image(x, y, 'logo');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the image from the Texture Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\r\n * and no URL is given then the Loader will set the URL to be \"alien.png\". It will always add `.png` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,\r\n * then you can specify it by providing an array as the `url` where the second element is the normal map:\r\n * \r\n * ```javascript\r\n * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]);\r\n * ```\r\n *\r\n * Or, if you are using a config object use the `normalMap` property:\r\n * \r\n * ```javascript\r\n * this.load.image({\r\n * key: 'logo',\r\n * url: 'images/AtariLogo.png',\r\n * normalMap: 'images/AtariLogo-n.png'\r\n * });\r\n * ```\r\n *\r\n * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings.\r\n * Normal maps are a WebGL only feature.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#image\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig|Phaser.Types.Loader.FileTypes.ImageFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('image', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new ImageFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new ImageFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = ImageFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/ImageFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/JSONFile.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/JSONFile.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single JSON File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json.\r\n *\r\n * @class JSONFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\r\n */\r\nvar JSONFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n // 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\r\n // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing\r\n\r\n function JSONFile (loader, key, url, xhrSettings, dataKey)\r\n {\r\n var extension = 'json';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n dataKey = GetFastValue(config, 'dataKey', dataKey);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'json',\r\n cache: loader.cacheManager.json,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: dataKey\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n\r\n if (IsPlainObject(url))\r\n {\r\n // Object provided instead of a URL, so no need to actually load it (populate data with value)\r\n if (dataKey)\r\n {\r\n this.data = GetValue(url, dataKey);\r\n }\r\n else\r\n {\r\n this.data = url;\r\n }\r\n\r\n this.state = CONST.FILE_POPULATED;\r\n }\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.JSONFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n if (this.state !== CONST.FILE_POPULATED)\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n var json = JSON.parse(this.xhrLoader.responseText);\r\n\r\n var key = this.config;\r\n\r\n if (typeof key === 'string')\r\n {\r\n this.data = GetValue(json, key, json);\r\n }\r\n else\r\n {\r\n this.data = json;\r\n }\r\n }\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a JSON file, or array of JSON files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.json('wavedata', 'files/AlienWaveData.json');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the JSON Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the JSON Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.json({\r\n * key: 'wavedata',\r\n * url: 'files/AlienWaveData.json'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n * \r\n * ```javascript\r\n * this.load.json('wavedata', 'files/AlienWaveData.json');\r\n * // and later in your game ...\r\n * var data = this.cache.json.get('wavedata');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and\r\n * this is what you would use to retrieve the text from the JSON Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * 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,\r\n * rather than the whole file. For example, if your JSON data had a structure like this:\r\n * \r\n * ```json\r\n * {\r\n * \"level1\": {\r\n * \"baddies\": {\r\n * \"aliens\": {},\r\n * \"boss\": {}\r\n * }\r\n * },\r\n * \"level2\": {},\r\n * \"level3\": {}\r\n * }\r\n * ```\r\n *\r\n * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`.\r\n *\r\n * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#json\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @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\".\r\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('json', function (key, url, dataKey, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new JSONFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = JSONFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/JSONFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/MultiAtlasFile.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/MultiAtlasFile.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar ImageFile = __webpack_require__(/*! ./ImageFile.js */ \"./node_modules/phaser/src/loader/filetypes/ImageFile.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\nvar JSONFile = __webpack_require__(/*! ./JSONFile.js */ \"./node_modules/phaser/src/loader/filetypes/JSONFile.js\");\r\nvar MultiFile = __webpack_require__(/*! ../MultiFile.js */ \"./node_modules/phaser/src/loader/MultiFile.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Multi Texture Atlas File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#multiatlas method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#multiatlas.\r\n *\r\n * @class MultiAtlasFile\r\n * @extends Phaser.Loader.MultiFile\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig)} key - The key of the file. Must be unique within both the Loader and the Texture Manager. Or a config object.\r\n * @param {string} [atlasURL] - The absolute or relative URL to load the multi atlas json file from.\r\n * @param {string} [path] - Optional path to use when loading the textures defined in the atlas data.\r\n * @param {string} [baseURL] - Optional Base URL to use when loading the textures defined in the atlas data.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - Extra XHR Settings specifically for the atlas json file.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - Extra XHR Settings specifically for the texture files.\r\n */\r\nvar MultiAtlasFile = new Class({\r\n\r\n Extends: MultiFile,\r\n\r\n initialize:\r\n\r\n function MultiAtlasFile (loader, key, atlasURL, path, baseURL, atlasXhrSettings, textureXhrSettings)\r\n {\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n\r\n if (GetFastValue(config, 'url', false))\r\n {\r\n atlasURL = GetFastValue(config, 'url');\r\n }\r\n else\r\n {\r\n atlasURL = GetFastValue(config, 'atlasURL');\r\n }\r\n\r\n atlasXhrSettings = GetFastValue(config, 'xhrSettings');\r\n path = GetFastValue(config, 'path');\r\n baseURL = GetFastValue(config, 'baseURL');\r\n textureXhrSettings = GetFastValue(config, 'textureXhrSettings');\r\n }\r\n\r\n var data = new JSONFile(loader, key, atlasURL, atlasXhrSettings);\r\n\r\n MultiFile.call(this, loader, 'multiatlas', key, [ data ]);\r\n\r\n this.config.path = path;\r\n this.config.baseURL = baseURL;\r\n this.config.textureXhrSettings = textureXhrSettings;\r\n },\r\n\r\n /**\r\n * Called by each File when it finishes loading.\r\n *\r\n * @method Phaser.Loader.FileTypes.MultiAtlasFile#onFileComplete\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has completed processing.\r\n */\r\n onFileComplete: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.pending--;\r\n\r\n if (file.type === 'json' && file.data.hasOwnProperty('textures'))\r\n {\r\n // Inspect the data for the files to now load\r\n var textures = file.data.textures;\r\n\r\n var config = this.config;\r\n var loader = this.loader;\r\n\r\n var currentBaseURL = loader.baseURL;\r\n var currentPath = loader.path;\r\n var currentPrefix = loader.prefix;\r\n\r\n var baseURL = GetFastValue(config, 'baseURL', this.baseURL);\r\n var path = GetFastValue(config, 'path', this.path);\r\n var prefix = GetFastValue(config, 'prefix', this.prefix);\r\n var textureXhrSettings = GetFastValue(config, 'textureXhrSettings');\r\n\r\n loader.setBaseURL(baseURL);\r\n loader.setPath(path);\r\n loader.setPrefix(prefix);\r\n\r\n for (var i = 0; i < textures.length; i++)\r\n {\r\n // \"image\": \"texture-packer-multi-atlas-0.png\",\r\n var textureURL = textures[i].image;\r\n\r\n var key = 'MA' + this.multiKeyIndex + '_' + textureURL;\r\n\r\n var image = new ImageFile(loader, key, textureURL, textureXhrSettings);\r\n\r\n this.addToMultiFile(image);\r\n\r\n loader.addFile(image);\r\n\r\n // \"normalMap\": \"texture-packer-multi-atlas-0_n.png\",\r\n if (textures[i].normalMap)\r\n {\r\n var normalMap = new ImageFile(loader, key, textures[i].normalMap, textureXhrSettings);\r\n\r\n normalMap.type = 'normalMap';\r\n\r\n image.setLink(normalMap);\r\n\r\n this.addToMultiFile(normalMap);\r\n\r\n loader.addFile(normalMap);\r\n }\r\n }\r\n\r\n // Reset the loader settings\r\n loader.setBaseURL(currentBaseURL);\r\n loader.setPath(currentPath);\r\n loader.setPrefix(currentPrefix);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.MultiAtlasFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.isReadyToProcess())\r\n {\r\n var fileJSON = this.files[0];\r\n\r\n var data = [];\r\n var images = [];\r\n var normalMaps = [];\r\n\r\n for (var i = 1; i < this.files.length; i++)\r\n {\r\n var file = this.files[i];\r\n\r\n if (file.type === 'normalMap')\r\n {\r\n continue;\r\n }\r\n\r\n var pos = file.key.indexOf('_');\r\n var key = file.key.substr(pos + 1);\r\n\r\n var image = file.data;\r\n\r\n // Now we need to find out which json entry this mapped to\r\n for (var t = 0; t < fileJSON.data.textures.length; t++)\r\n {\r\n var item = fileJSON.data.textures[t];\r\n\r\n if (item.image === key)\r\n {\r\n images.push(image);\r\n \r\n data.push(item);\r\n\r\n if (file.linkFile)\r\n {\r\n normalMaps.push(file.linkFile.data);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (normalMaps.length === 0)\r\n {\r\n normalMaps = undefined;\r\n }\r\n\r\n this.loader.textureManager.addAtlasJSONArray(this.key, images, data, normalMaps);\r\n\r\n this.complete = true;\r\n\r\n for (i = 0; i < this.files.length; i++)\r\n {\r\n this.files[i].pendingDestroy();\r\n }\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a Multi Texture Atlas, or array of multi atlases, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.multiatlas('level1', 'images/Level1.json');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring\r\n * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.\r\n *\r\n * Phaser expects the atlas data to be provided in a JSON file as exported from the application Texture Packer,\r\n * version 4.6.3 or above, where you have made sure to use the Phaser 3 Export option.\r\n *\r\n * The way it works internally is that you provide a URL to the JSON file. Phaser then loads this JSON, parses it and\r\n * extracts which texture files it also needs to load to complete the process. If the JSON also defines normal maps,\r\n * Phaser will load those as well.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Texture Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.multiatlas({\r\n * key: 'level1',\r\n * atlasURL: 'images/Level1.json'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig` for more details.\r\n *\r\n * Instead of passing a URL for the atlas JSON data you can also pass in a well formed JSON object instead.\r\n *\r\n * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key:\r\n * \r\n * ```javascript\r\n * this.load.multiatlas('level1', 'images/Level1.json');\r\n * // and later in your game ...\r\n * this.add.image(x, y, 'level1', 'background');\r\n * ```\r\n *\r\n * To get a list of all available frames within an atlas please consult your Texture Atlas software.\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the image from the Texture Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\r\n * and no URL is given then the Loader will set the URL to be \"alien.png\". It will always add `.png` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Multi Atlas File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#multiatlas\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.7.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig|Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas json data 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\".\r\n * @param {string} [path] - Optional path to use when loading the textures defined in the atlas data.\r\n * @param {string} [baseURL] - Optional Base URL to use when loading the textures defined in the atlas data.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('multiatlas', function (key, atlasURL, path, baseURL, atlasXhrSettings)\r\n{\r\n var multifile;\r\n\r\n // Supports an Object file definition in the key argument\r\n // Or an array of objects in the key argument\r\n // Or a single entry where all arguments have been defined\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n multifile = new MultiAtlasFile(this, key[i]);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n }\r\n else\r\n {\r\n multifile = new MultiAtlasFile(this, key, atlasURL, path, baseURL, atlasXhrSettings);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = MultiAtlasFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/MultiAtlasFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/MultiScriptFile.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/MultiScriptFile.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\nvar MultiFile = __webpack_require__(/*! ../MultiFile.js */ \"./node_modules/phaser/src/loader/MultiFile.js\");\r\nvar ScriptFile = __webpack_require__(/*! ./ScriptFile.js */ \"./node_modules/phaser/src/loader/filetypes/ScriptFile.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Multi Script File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#scripts method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scripts.\r\n *\r\n * @class MultiScriptFile\r\n * @extends Phaser.Loader.MultiFile\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.17.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.MultiScriptFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string[]} [url] - An array of absolute or relative URLs to load the script files from. They are processed in the order given in the array.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object for the script files. Used in replacement of the Loaders default XHR Settings.\r\n */\r\nvar MultiScriptFile = new Class({\r\n\r\n Extends: MultiFile,\r\n\r\n initialize:\r\n\r\n function MultiScriptFile (loader, key, url, xhrSettings)\r\n {\r\n var extension = 'js';\r\n var files = [];\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n }\r\n\r\n if (!Array.isArray(url))\r\n {\r\n url = [ url ];\r\n }\r\n\r\n for (var i = 0; i < url.length; i++)\r\n {\r\n var scriptFile = new ScriptFile(loader, {\r\n key: key + '_' + i.toString(),\r\n url: url[i],\r\n extension: extension,\r\n xhrSettings: xhrSettings\r\n });\r\n\r\n // Override the default onProcess function\r\n scriptFile.onProcess = function ()\r\n {\r\n this.onProcessComplete();\r\n };\r\n\r\n files.push(scriptFile);\r\n }\r\n\r\n MultiFile.call(this, loader, 'scripts', key, files);\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.MultiScriptFile#addToCache\r\n * @since 3.17.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.isReadyToProcess())\r\n {\r\n for (var i = 0; i < this.files.length; i++)\r\n {\r\n var file = this.files[i];\r\n\r\n file.data = document.createElement('script');\r\n file.data.language = 'javascript';\r\n file.data.type = 'text/javascript';\r\n file.data.defer = false;\r\n file.data.text = file.xhrLoader.responseText;\r\n \r\n document.head.appendChild(file.data);\r\n }\r\n\r\n this.complete = true;\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an array of Script files to the current load queue.\r\n * \r\n * The difference between this and the `ScriptFile` file type is that you give an array of scripts to this method,\r\n * and the scripts are then processed _exactly_ in that order. This allows you to load a bunch of scripts that\r\n * may have dependencies on each other without worrying about the async nature of traditional script loading.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.scripts('PostProcess', [\r\n * 'libs/shaders/CopyShader.js',\r\n * 'libs/postprocessing/EffectComposer.js',\r\n * 'libs/postprocessing/RenderPass.js',\r\n * 'libs/postprocessing/MaskPass.js',\r\n * 'libs/postprocessing/ShaderPass.js',\r\n * 'libs/postprocessing/AfterimagePass.js'\r\n * ]);\r\n * }\r\n * ```\r\n * \r\n * In the code above the script files will all be loaded in parallel but only processed (i.e. invoked) in the exact\r\n * order given in the array.\r\n *\r\n * The files are **not** loaded right away. They are added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the files are queued\r\n * it means you cannot use the files immediately after calling this method, but must wait for the files to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * The key must be a unique String and not already in-use by another file in the Loader.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.scripts({\r\n * key: 'PostProcess',\r\n * url: [\r\n * 'libs/shaders/CopyShader.js',\r\n * 'libs/postprocessing/EffectComposer.js',\r\n * 'libs/postprocessing/RenderPass.js',\r\n * 'libs/postprocessing/MaskPass.js',\r\n * 'libs/postprocessing/ShaderPass.js',\r\n * 'libs/postprocessing/AfterimagePass.js'\r\n * ]\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.MultiScriptFileConfig` for more details.\r\n *\r\n * Once all the files have finished loading they will automatically be converted into a script element\r\n * via `document.createElement('script')`. They will have their language set to JavaScript, `defer` set to\r\n * false and then the resulting element will be appended to `document.head`. Any code then in the\r\n * script will be executed. This is done in the exact order the files are specified in the url array.\r\n *\r\n * The URLs can be relative or absolute. If the URLs are relative the `Loader.baseURL` and `Loader.path` values will be prepended to them.\r\n *\r\n * Note: The ability to load this type of file will only be available if the MultiScript File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#scripts\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.17.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.MultiScriptFileConfig|Phaser.Types.Loader.FileTypes.MultiScriptFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string[]} [url] - An array of absolute or relative URLs to load the script files from. They are processed in the order given in the array.\r\n * @param {string} [extension='js'] - The default file extension to use if no url is provided.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for these files.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('scripts', function (key, url, xhrSettings)\r\n{\r\n var multifile;\r\n\r\n // Supports an Object file definition in the key argument\r\n // Or an array of objects in the key argument\r\n // Or a single entry where all arguments have been defined\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n multifile = new MultiScriptFile(this, key[i]);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n }\r\n else\r\n {\r\n multifile = new MultiScriptFile(this, key, url, xhrSettings);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = MultiScriptFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/MultiScriptFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/PackFile.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/PackFile.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar JSONFile = __webpack_require__(/*! ./JSONFile.js */ \"./node_modules/phaser/src/loader/filetypes/JSONFile.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single JSON Pack File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#pack method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#pack.\r\n *\r\n * @class PackFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.PackFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\r\n */\r\nvar PackFile = new Class({\r\n\r\n Extends: JSONFile,\r\n\r\n initialize:\r\n\r\n // 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\r\n // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing\r\n\r\n function PackFile (loader, key, url, xhrSettings, dataKey)\r\n {\r\n JSONFile.call(this, loader, key, url, xhrSettings, dataKey);\r\n\r\n this.type = 'packfile';\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.PackFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n if (this.state !== CONST.FILE_POPULATED)\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = JSON.parse(this.xhrLoader.responseText);\r\n }\r\n\r\n // Let's pass the pack file data over to the Loader ...\r\n this.loader.addPack(this.data, this.config);\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a JSON File Pack, or array of packs, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.pack('level1', 'data/Level1Files.json');\r\n * }\r\n * ```\r\n *\r\n * A File Pack is a JSON file (or object) that contains details about other files that should be added into the Loader.\r\n * Here is a small example:\r\n *\r\n * ```json\r\n * { \r\n * \"test1\": {\r\n * \"files\": [\r\n * {\r\n * \"type\": \"image\",\r\n * \"key\": \"taikodrummaster\",\r\n * \"url\": \"assets/pics/taikodrummaster.jpg\"\r\n * },\r\n * {\r\n * \"type\": \"image\",\r\n * \"key\": \"sukasuka-chtholly\",\r\n * \"url\": \"assets/pics/sukasuka-chtholly.png\"\r\n * }\r\n * ]\r\n * },\r\n * \"meta\": {\r\n * \"generated\": \"1401380327373\",\r\n * \"app\": \"Phaser 3 Asset Packer\",\r\n * \"url\": \"https://phaser.io\",\r\n * \"version\": \"1.0\",\r\n * \"copyright\": \"Photon Storm Ltd. 2018\"\r\n * }\r\n * }\r\n * ```\r\n *\r\n * The pack can be split into sections. In the example above you'll see a section called `test1. You can tell\r\n * the `load.pack` method to parse only a particular section of a pack. The pack is stored in the JSON Cache,\r\n * so you can pass it to the Loader to process additional sections as needed in your game, or you can just load\r\n * them all at once without specifying anything.\r\n *\r\n * The pack file can contain an entry for any type of file that Phaser can load. The object structures exactly\r\n * match that of the file type configs, and all properties available within the file type configs can be used\r\n * in the pack file too.\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring\r\n * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the JSON Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the JSON Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.pack({\r\n * key: 'level1',\r\n * url: 'data/Level1Files.json'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.PackFileConfig` for more details.\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and\r\n * this is what you would use to retrieve the text from the JSON Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * 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\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * 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,\r\n * rather than the whole file. For example, if your JSON data had a structure like this:\r\n * \r\n * ```json\r\n * {\r\n * \"level1\": {\r\n * \"baddies\": {\r\n * \"aliens\": {},\r\n * \"boss\": {}\r\n * }\r\n * },\r\n * \"level2\": {},\r\n * \"level3\": {}\r\n * }\r\n * ```\r\n *\r\n * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Pack File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#pack\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.7.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.PackFileConfig|Phaser.Types.Loader.FileTypes.PackFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @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\".\r\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('pack', function (key, url, packKey, xhrSettings)\r\n{\r\n // Supports an Object file definition in the key argument\r\n // Or an array of objects in the key argument\r\n // Or a single entry where all arguments have been defined\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n this.addFile(new PackFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new PackFile(this, key, url, xhrSettings, packKey));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = PackFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/PackFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/PluginFile.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/PluginFile.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Plugin Script File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#plugin method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#plugin.\r\n *\r\n * @class PluginFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.PluginFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was \"alien\" then the URL will be \"alien.js\".\r\n * @param {boolean} [start=false] - Automatically start the plugin after loading?\r\n * @param {string} [mapping] - If this plugin is to be injected into the Scene, this is the property key used.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar PluginFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function PluginFile (loader, key, url, start, mapping, xhrSettings)\r\n {\r\n var extension = 'js';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n start = GetFastValue(config, 'start');\r\n mapping = GetFastValue(config, 'mapping');\r\n }\r\n\r\n var fileConfig = {\r\n type: 'plugin',\r\n cache: false,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: {\r\n start: start,\r\n mapping: mapping\r\n }\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n\r\n // If the url variable refers to a class, add the plugin directly\r\n if (typeof url === 'function')\r\n {\r\n this.data = url;\r\n\r\n this.state = CONST.FILE_POPULATED;\r\n }\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.PluginFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n var pluginManager = this.loader.systems.plugins;\r\n var config = this.config;\r\n\r\n var start = GetFastValue(config, 'start', false);\r\n var mapping = GetFastValue(config, 'mapping', null);\r\n\r\n if (this.state === CONST.FILE_POPULATED)\r\n {\r\n pluginManager.install(this.key, this.data, start, mapping);\r\n }\r\n else\r\n {\r\n // Plugin added via a js file\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = document.createElement('script');\r\n this.data.language = 'javascript';\r\n this.data.type = 'text/javascript';\r\n this.data.defer = false;\r\n this.data.text = this.xhrLoader.responseText;\r\n\r\n document.head.appendChild(this.data);\r\n\r\n var plugin = pluginManager.install(this.key, window[this.key], start, mapping);\r\n\r\n if (start || mapping)\r\n {\r\n // Install into the current Scene Systems and Scene\r\n this.loader.systems[mapping] = plugin;\r\n this.loader.scene[mapping] = plugin;\r\n }\r\n }\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a Plugin Script file, or array of plugin files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.plugin('modplayer', 'plugins/ModPlayer.js');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * The key must be a unique String and not already in-use by another file in the Loader.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.plugin({\r\n * key: 'modplayer',\r\n * url: 'plugins/ModPlayer.js'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.PluginFileConfig` for more details.\r\n *\r\n * Once the file has finished loading it will automatically be converted into a script element\r\n * via `document.createElement('script')`. It will have its language set to JavaScript, `defer` set to\r\n * false and then the resulting element will be appended to `document.head`. Any code then in the\r\n * script will be executed. It will then be passed to the Phaser PluginCache.register method.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\r\n * and no URL is given then the Loader will set the URL to be \"alien.js\". It will always add `.js` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Plugin File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#plugin\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.PluginFileConfig|Phaser.Types.Loader.FileTypes.PluginFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {(string|function)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was \"alien\" then the URL will be \"alien.js\". Or, a plugin function.\r\n * @param {boolean} [start] - Automatically start the plugin after loading?\r\n * @param {string} [mapping] - If this plugin is to be injected into the Scene, this is the property key used.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('plugin', function (key, url, start, mapping, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new PluginFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new PluginFile(this, key, url, start, mapping, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = PluginFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/PluginFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/SVGFile.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/SVGFile.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single SVG File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#svg method and are not typically created directly.\r\n *\r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#svg.\r\n *\r\n * @class SVGFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.SVGFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.svg`, i.e. if `key` was \"alien\" then the URL will be \"alien.svg\".\r\n * @param {Phaser.Types.Loader.FileTypes.SVGSizeConfig} [svgConfig] - The svg size configuration object.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar SVGFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function SVGFile (loader, key, url, svgConfig, xhrSettings)\r\n {\r\n var extension = 'svg';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n svgConfig = GetFastValue(config, 'svgConfig', {});\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'svg',\r\n cache: loader.textureManager,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: {\r\n width: GetFastValue(svgConfig, 'width'),\r\n height: GetFastValue(svgConfig, 'height'),\r\n scale: GetFastValue(svgConfig, 'scale')\r\n }\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.SVGFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n var text = this.xhrLoader.responseText;\r\n var svg = [ text ];\r\n var width = this.config.width;\r\n var height = this.config.height;\r\n var scale = this.config.scale;\r\n\r\n resize: if (width && height || scale)\r\n {\r\n var xml = null;\r\n var parser = new DOMParser();\r\n xml = parser.parseFromString(text, 'text/xml');\r\n var svgXML = xml.getElementsByTagName('svg')[0];\r\n\r\n var hasViewBox = svgXML.hasAttribute('viewBox');\r\n var svgWidth = parseFloat(svgXML.getAttribute('width'));\r\n var svgHeight = parseFloat(svgXML.getAttribute('height'));\r\n\r\n if (!hasViewBox && svgWidth && svgHeight)\r\n {\r\n // If there's no viewBox attribute, set one\r\n svgXML.setAttribute('viewBox', '0 0 ' + svgWidth + ' ' + svgHeight);\r\n }\r\n else if (hasViewBox && !svgWidth && !svgHeight)\r\n {\r\n // Get the w/h from the viewbox\r\n var viewBox = svgXML.getAttribute('viewBox').split(/\\s+|,/);\r\n\r\n svgWidth = viewBox[2];\r\n svgHeight = viewBox[3];\r\n }\r\n\r\n if (scale)\r\n {\r\n if (svgWidth && svgHeight)\r\n {\r\n width = svgWidth * scale;\r\n height = svgHeight * scale;\r\n }\r\n else\r\n {\r\n break resize;\r\n }\r\n }\r\n\r\n svgXML.setAttribute('width', width.toString() + 'px');\r\n svgXML.setAttribute('height', height.toString() + 'px');\r\n\r\n svg = [ (new XMLSerializer()).serializeToString(svgXML) ];\r\n }\r\n\r\n try\r\n {\r\n var blob = new window.Blob(svg, { type: 'image/svg+xml;charset=utf-8' });\r\n }\r\n catch (e)\r\n {\r\n this.onProcessError();\r\n\r\n return;\r\n }\r\n\r\n this.data = new Image();\r\n\r\n this.data.crossOrigin = this.crossOrigin;\r\n\r\n var _this = this;\r\n var retry = false;\r\n\r\n this.data.onload = function ()\r\n {\r\n if (!retry)\r\n {\r\n File.revokeObjectURL(_this.data);\r\n }\r\n\r\n _this.onProcessComplete();\r\n };\r\n\r\n this.data.onerror = function ()\r\n {\r\n // Safari 8 re-try\r\n if (!retry)\r\n {\r\n retry = true;\r\n\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.data.src = 'data:image/svg+xml,' + encodeURIComponent(svg.join(''));\r\n }\r\n else\r\n {\r\n _this.onProcessError();\r\n }\r\n };\r\n\r\n File.createObjectURL(this.data, blob, 'image/svg+xml');\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.SVGFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n var texture = this.cache.addImage(this.key, this.data);\r\n\r\n this.pendingDestroy(texture);\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an SVG File, or array of SVG Files, to the current load queue. When the files are loaded they\r\n * will be rendered to bitmap textures and stored in the Texture Manager.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n *\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.svg('morty', 'images/Morty.svg');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Texture Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n *\r\n * ```javascript\r\n * this.load.svg({\r\n * key: 'morty',\r\n * url: 'images/Morty.svg'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.SVGFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key:\r\n *\r\n * ```javascript\r\n * this.load.svg('morty', 'images/Morty.svg');\r\n * // and later in your game ...\r\n * this.add.image(x, y, 'morty');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the image from the Texture Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\r\n * and no URL is given then the Loader will set the URL to be \"alien.html\". It will always add `.html` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n * \r\n * You can optionally pass an SVG Resize Configuration object when you load an SVG file. By default the SVG will be rendered to a texture\r\n * at the same size defined in the SVG file attributes. However, this isn't always desirable. You may wish to resize the SVG (either down\r\n * or up) to improve texture clarity, or reduce texture memory consumption. You can either specify an exact width and height to resize\r\n * the SVG to:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.svg('morty', 'images/Morty.svg', { width: 300, height: 600 });\r\n * }\r\n * ```\r\n * \r\n * Or when using a configuration object:\r\n * \r\n * ```javascript\r\n * this.load.svg({\r\n * key: 'morty',\r\n * url: 'images/Morty.svg',\r\n * svgConfig: {\r\n * width: 300,\r\n * height: 600\r\n * }\r\n * });\r\n * ```\r\n * \r\n * Alternatively, you can just provide a scale factor instead:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.svg('morty', 'images/Morty.svg', { scale: 2.5 });\r\n * }\r\n * ```\r\n * \r\n * Or when using a configuration object:\r\n * \r\n * ```javascript\r\n * this.load.svg({\r\n * key: 'morty',\r\n * url: 'images/Morty.svg',\r\n * svgConfig: {\r\n * scale: 2.5\r\n * }\r\n * });\r\n * ```\r\n * \r\n * If scale, width and height values are all given, the scale has priority and the width and height values are ignored.\r\n *\r\n * Note: The ability to load this type of file will only be available if the SVG File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#svg\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.SVGFileConfig|Phaser.Types.Loader.FileTypes.SVGFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.svg`, i.e. if `key` was \"alien\" then the URL will be \"alien.svg\".\r\n * @param {Phaser.Types.Loader.FileTypes.SVGSizeConfig} [svgConfig] - The svg size configuration object.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('svg', function (key, url, svgConfig, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new SVGFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new SVGFile(this, key, url, svgConfig, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = SVGFile;\r\n\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/SVGFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/SceneFile.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/SceneFile.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * An external Scene JavaScript File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#sceneFile method and are not typically created directly.\r\n *\r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#sceneFile.\r\n *\r\n * @class SceneFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.16.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.SceneFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was \"alien\" then the URL will be \"alien.js\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar SceneFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function SceneFile (loader, key, url, xhrSettings)\r\n {\r\n var extension = 'js';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'text',\r\n cache: loader.cacheManager.text,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.SceneFile#onProcess\r\n * @since 3.16.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = this.xhrLoader.responseText;\r\n\r\n this.onProcessComplete();\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.SceneFile#addToCache\r\n * @since 3.16.0\r\n */\r\n addToCache: function ()\r\n {\r\n var code = this.data.concat('(function(){\\n' + 'return new ' + this.key + '();\\n' + '}).call(this);');\r\n\r\n // Stops rollup from freaking out during build\r\n var eval2 = eval;\r\n\r\n this.loader.sceneManager.add(this.key, eval2(code));\r\n\r\n this.complete = true;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an external Scene file, or array of Scene files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n *\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.sceneFile('Level1', 'src/Level1.js');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Scene Manager upon a successful load.\r\n * \r\n * For a Scene File it's vitally important that the key matches the class name in the JavaScript file.\r\n * \r\n * For example here is the source file:\r\n * \r\n * ```javascript\r\n * class ExternalScene extends Phaser.Scene {\r\n * \r\n * constructor ()\r\n * {\r\n * super('myScene');\r\n * }\r\n * \r\n * }\r\n * ```\r\n * \r\n * Because the class is called `ExternalScene` that is the exact same key you must use when loading it:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.sceneFile('ExternalScene', 'src/yourScene.js');\r\n * }\r\n * ```\r\n * \r\n * The key that is used within the Scene Manager can either be set to the same, or you can override it in the Scene\r\n * constructor, as we've done in the example above, where the Scene key was changed to `myScene`.\r\n * \r\n * The key should be unique both in terms of files being loaded and Scenes already present in the Scene Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Scene Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n *\r\n * ```javascript\r\n * this.load.sceneFile({\r\n * key: 'Level1',\r\n * url: 'src/Level1.js'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.SceneFileConfig` for more details.\r\n *\r\n * Once the file has finished loading it will be added to the Scene Manager.\r\n *\r\n * ```javascript\r\n * this.load.sceneFile('Level1', 'src/Level1.js');\r\n * // and later in your game ...\r\n * this.scene.start('Level1');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `WORLD1.` and the key was `Story` the final key will be `WORLD1.Story` and\r\n * this is what you would use to retrieve the text from the Scene Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"story\"\r\n * and no URL is given then the Loader will set the URL to be \"story.js\". It will always add `.js` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Scene File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#sceneFile\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.16.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.SceneFileConfig|Phaser.Types.Loader.FileTypes.SceneFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was \"alien\" then the URL will be \"alien.js\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('sceneFile', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new SceneFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new SceneFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = SceneFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/SceneFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/ScenePluginFile.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/ScenePluginFile.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Scene Plugin Script File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#scenePlugin method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scenePlugin.\r\n *\r\n * @class ScenePluginFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.8.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.ScenePluginFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was \"alien\" then the URL will be \"alien.js\".\r\n * @param {string} [systemKey] - If this plugin is to be added to Scene.Systems, this is the property key for it.\r\n * @param {string} [sceneKey] - If this plugin is to be added to the Scene, this is the property key for it.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar ScenePluginFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function ScenePluginFile (loader, key, url, systemKey, sceneKey, xhrSettings)\r\n {\r\n var extension = 'js';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n systemKey = GetFastValue(config, 'systemKey');\r\n sceneKey = GetFastValue(config, 'sceneKey');\r\n }\r\n\r\n var fileConfig = {\r\n type: 'scenePlugin',\r\n cache: false,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: {\r\n systemKey: systemKey,\r\n sceneKey: sceneKey\r\n }\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n\r\n // If the url variable refers to a class, add the plugin directly\r\n if (typeof url === 'function')\r\n {\r\n this.data = url;\r\n\r\n this.state = CONST.FILE_POPULATED;\r\n }\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.ScenePluginFile#onProcess\r\n * @since 3.8.0\r\n */\r\n onProcess: function ()\r\n {\r\n var pluginManager = this.loader.systems.plugins;\r\n var config = this.config;\r\n\r\n var key = this.key;\r\n var systemKey = GetFastValue(config, 'systemKey', key);\r\n var sceneKey = GetFastValue(config, 'sceneKey', key);\r\n\r\n if (this.state === CONST.FILE_POPULATED)\r\n {\r\n pluginManager.installScenePlugin(systemKey, this.data, sceneKey, this.loader.scene, true);\r\n }\r\n else\r\n {\r\n // Plugin added via a js file\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = document.createElement('script');\r\n this.data.language = 'javascript';\r\n this.data.type = 'text/javascript';\r\n this.data.defer = false;\r\n this.data.text = this.xhrLoader.responseText;\r\n\r\n document.head.appendChild(this.data);\r\n\r\n pluginManager.installScenePlugin(systemKey, window[this.key], sceneKey, this.loader.scene, true);\r\n }\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a Scene Plugin Script file, or array of plugin files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.scenePlugin('ModPlayer', 'plugins/ModPlayer.js', 'modPlayer', 'mods');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * The key must be a unique String and not already in-use by another file in the Loader.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.scenePlugin({\r\n * key: 'modplayer',\r\n * url: 'plugins/ModPlayer.js'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.ScenePluginFileConfig` for more details.\r\n *\r\n * Once the file has finished loading it will automatically be converted into a script element\r\n * via `document.createElement('script')`. It will have its language set to JavaScript, `defer` set to\r\n * false and then the resulting element will be appended to `document.head`. Any code then in the\r\n * script will be executed. It will then be passed to the Phaser PluginCache.register method.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\r\n * and no URL is given then the Loader will set the URL to be \"alien.js\". It will always add `.js` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Script File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#scenePlugin\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.8.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.ScenePluginFileConfig|Phaser.Types.Loader.FileTypes.ScenePluginFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {(string|function)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was \"alien\" then the URL will be \"alien.js\". Or, set to a plugin function.\r\n * @param {string} [systemKey] - If this plugin is to be added to Scene.Systems, this is the property key for it.\r\n * @param {string} [sceneKey] - If this plugin is to be added to the Scene, this is the property key for it.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('scenePlugin', function (key, url, systemKey, sceneKey, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new ScenePluginFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new ScenePluginFile(this, key, url, systemKey, sceneKey, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = ScenePluginFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/ScenePluginFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/ScriptFile.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/ScriptFile.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Script File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#script method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#script.\r\n *\r\n * @class ScriptFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.ScriptFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was \"alien\" then the URL will be \"alien.js\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar ScriptFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function ScriptFile (loader, key, url, xhrSettings)\r\n {\r\n var extension = 'js';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'script',\r\n cache: false,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.ScriptFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = document.createElement('script');\r\n this.data.language = 'javascript';\r\n this.data.type = 'text/javascript';\r\n this.data.defer = false;\r\n this.data.text = this.xhrLoader.responseText;\r\n\r\n document.head.appendChild(this.data);\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a Script file, or array of Script files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.script('aliens', 'lib/aliens.js');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * The key must be a unique String and not already in-use by another file in the Loader.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.script({\r\n * key: 'aliens',\r\n * url: 'lib/aliens.js'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.ScriptFileConfig` for more details.\r\n *\r\n * Once the file has finished loading it will automatically be converted into a script element\r\n * via `document.createElement('script')`. It will have its language set to JavaScript, `defer` set to\r\n * false and then the resulting element will be appended to `document.head`. Any code then in the\r\n * script will be executed.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\r\n * and no URL is given then the Loader will set the URL to be \"alien.js\". It will always add `.js` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Script File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#script\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.ScriptFileConfig|Phaser.Types.Loader.FileTypes.ScriptFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was \"alien\" then the URL will be \"alien.js\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('script', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new ScriptFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new ScriptFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = ScriptFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/ScriptFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/SpriteSheetFile.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/SpriteSheetFile.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar ImageFile = __webpack_require__(/*! ./ImageFile.js */ \"./node_modules/phaser/src/loader/filetypes/ImageFile.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Sprite Sheet Image File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#spritesheet method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spritesheet.\r\n *\r\n * @class SpriteSheetFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\r\n * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar SpriteSheetFile = new Class({\r\n\r\n Extends: ImageFile,\r\n\r\n initialize:\r\n\r\n function SpriteSheetFile (loader, key, url, frameConfig, xhrSettings)\r\n {\r\n ImageFile.call(this, loader, key, url, xhrSettings, frameConfig);\r\n\r\n this.type = 'spritesheet';\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.SpriteSheetFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n var texture = this.cache.addSpriteSheet(this.key, this.data, this.config);\r\n\r\n this.pendingDestroy(texture);\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a Sprite Sheet Image, or array of Sprite Sheet Images, to the current load queue.\r\n *\r\n * The term 'Sprite Sheet' in Phaser means a fixed-size sheet. Where every frame in the sheet is the exact same size,\r\n * and you reference those frames using numbers, not frame names. This is not the same thing as a Texture Atlas, where\r\n * the frames are packed in a way where they take up the least amount of space, and are referenced by their names,\r\n * not numbers. Some articles and software use the term 'Sprite Sheet' to mean Texture Atlas, so please be aware of\r\n * what sort of file you're actually trying to load.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.spritesheet('bot', 'images/robot.png', { frameWidth: 32, frameHeight: 38 });\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.\r\n * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback\r\n * of animated gifs to Canvas elements.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Texture Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.spritesheet({\r\n * key: 'bot',\r\n * url: 'images/robot.png',\r\n * frameConfig: {\r\n * frameWidth: 32,\r\n * frameHeight: 38,\r\n * startFrame: 0,\r\n * endFrame: 8\r\n * }\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key:\r\n * \r\n * ```javascript\r\n * this.load.spritesheet('bot', 'images/robot.png', { frameWidth: 32, frameHeight: 38 });\r\n * // and later in your game ...\r\n * this.add.image(x, y, 'bot', 0);\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `PLAYER.` and the key was `Running` the final key will be `PLAYER.Running` and\r\n * this is what you would use to retrieve the image from the Texture Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\r\n * and no URL is given then the Loader will set the URL to be \"alien.png\". It will always add `.png` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,\r\n * then you can specify it by providing an array as the `url` where the second element is the normal map:\r\n * \r\n * ```javascript\r\n * this.load.spritesheet('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ], { frameWidth: 256, frameHeight: 80 });\r\n * ```\r\n *\r\n * Or, if you are using a config object use the `normalMap` property:\r\n * \r\n * ```javascript\r\n * this.load.spritesheet({\r\n * key: 'logo',\r\n * url: 'images/AtariLogo.png',\r\n * normalMap: 'images/AtariLogo-n.png',\r\n * frameConfig: {\r\n * frameWidth: 256,\r\n * frameHeight: 80\r\n * }\r\n * });\r\n * ```\r\n *\r\n * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings.\r\n * Normal maps are a WebGL only feature.\r\n * \r\n * Note: The ability to load this type of file will only be available if the Sprite Sheet File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#spritesheet\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig|Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\r\n * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. At a minimum it should have a `frameWidth` property.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('spritesheet', function (key, url, frameConfig, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new SpriteSheetFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new SpriteSheetFile(this, key, url, frameConfig, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = SpriteSheetFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/SpriteSheetFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/TextFile.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/TextFile.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Text File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly.\r\n *\r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text.\r\n *\r\n * @class TextFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was \"alien\" then the URL will be \"alien.txt\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar TextFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function TextFile (loader, key, url, xhrSettings)\r\n {\r\n var extension = 'txt';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'text',\r\n cache: loader.cacheManager.text,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.TextFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = this.xhrLoader.responseText;\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a Text file, or array of Text files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n *\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.text('story', 'files/IntroStory.txt');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Text Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Text Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n *\r\n * ```javascript\r\n * this.load.text({\r\n * key: 'story',\r\n * url: 'files/IntroStory.txt'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n *\r\n * ```javascript\r\n * this.load.text('story', 'files/IntroStory.txt');\r\n * // and later in your game ...\r\n * var data = this.cache.text.get('story');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and\r\n * this is what you would use to retrieve the text from the Text Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"story\"\r\n * and no URL is given then the Loader will set the URL to be \"story.txt\". It will always add `.txt` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#text\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig|Phaser.Types.Loader.FileTypes.TextFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was \"alien\" then the URL will be \"alien.txt\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('text', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new TextFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new TextFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = TextFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/TextFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/TilemapCSVFile.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/TilemapCSVFile.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\nvar TILEMAP_FORMATS = __webpack_require__(/*! ../../tilemaps/Formats */ \"./node_modules/phaser/src/tilemaps/Formats.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Tilemap CSV File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapCSV method and are not typically created directly.\r\n *\r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapCSV.\r\n *\r\n * @class TilemapCSVFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.csv`, i.e. if `key` was \"alien\" then the URL will be \"alien.csv\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar TilemapCSVFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function TilemapCSVFile (loader, key, url, xhrSettings)\r\n {\r\n var extension = 'csv';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'tilemapCSV',\r\n cache: loader.cacheManager.tilemap,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n\r\n this.tilemapFormat = TILEMAP_FORMATS.CSV;\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.TilemapCSVFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = this.xhrLoader.responseText;\r\n\r\n this.onProcessComplete();\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.TilemapCSVFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n var tiledata = { format: this.tilemapFormat, data: this.data };\r\n\r\n this.cache.add(this.key, tiledata);\r\n\r\n this.pendingDestroy(tiledata);\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a CSV Tilemap file, or array of CSV files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n *\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.tilemapCSV('level1', 'maps/Level1.csv');\r\n * }\r\n * ```\r\n *\r\n * Tilemap CSV data can be created in a text editor, or a 3rd party app that exports as CSV.\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Tilemap Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Tilemap Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Text Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n *\r\n * ```javascript\r\n * this.load.tilemapCSV({\r\n * key: 'level1',\r\n * url: 'maps/Level1.csv'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n *\r\n * ```javascript\r\n * this.load.tilemapCSV('level1', 'maps/Level1.csv');\r\n * // and later in your game ...\r\n * var map = this.make.tilemap({ key: 'level1' });\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and\r\n * this is what you would use to retrieve the text from the Tilemap Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"level\"\r\n * and no URL is given then the Loader will set the URL to be \"level.csv\". It will always add `.csv` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Tilemap CSV File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#tilemapCSV\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig|Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.csv`, i.e. if `key` was \"alien\" then the URL will be \"alien.csv\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('tilemapCSV', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new TilemapCSVFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new TilemapCSVFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = TilemapCSVFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/TilemapCSVFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/TilemapImpactFile.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/TilemapImpactFile.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar JSONFile = __webpack_require__(/*! ./JSONFile.js */ \"./node_modules/phaser/src/loader/filetypes/JSONFile.js\");\r\nvar TILEMAP_FORMATS = __webpack_require__(/*! ../../tilemaps/Formats */ \"./node_modules/phaser/src/tilemaps/Formats.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Impact.js Tilemap JSON File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapImpact method and are not typically created directly.\r\n *\r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapImpact.\r\n *\r\n * @class TilemapImpactFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar TilemapImpactFile = new Class({\r\n\r\n Extends: JSONFile,\r\n\r\n initialize:\r\n\r\n function TilemapImpactFile (loader, key, url, xhrSettings)\r\n {\r\n JSONFile.call(this, loader, key, url, xhrSettings);\r\n\r\n this.type = 'tilemapJSON';\r\n\r\n this.cache = loader.cacheManager.tilemap;\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.TilemapImpactFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n var tiledata = { format: TILEMAP_FORMATS.WELTMEISTER, data: this.data };\r\n\r\n this.cache.add(this.key, tiledata);\r\n\r\n this.pendingDestroy(tiledata);\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an Impact.js Tilemap file, or array of map files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n *\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.tilemapImpact('level1', 'maps/Level1.json');\r\n * }\r\n * ```\r\n *\r\n * Impact Tilemap data is created the Impact.js Map Editor called Weltmeister.\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Tilemap Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Tilemap Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Text Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n *\r\n * ```javascript\r\n * this.load.tilemapImpact({\r\n * key: 'level1',\r\n * url: 'maps/Level1.json'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n *\r\n * ```javascript\r\n * this.load.tilemapImpact('level1', 'maps/Level1.json');\r\n * // and later in your game ...\r\n * var map = this.make.tilemap({ key: 'level1' });\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and\r\n * this is what you would use to retrieve the text from the Tilemap Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"level\"\r\n * and no URL is given then the Loader will set the URL to be \"level.json\". It will always add `.json` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Tilemap Impact File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#tilemapImpact\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.7.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig|Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('tilemapImpact', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new TilemapImpactFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new TilemapImpactFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = TilemapImpactFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/TilemapImpactFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/TilemapJSONFile.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/TilemapJSONFile.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar JSONFile = __webpack_require__(/*! ./JSONFile.js */ \"./node_modules/phaser/src/loader/filetypes/JSONFile.js\");\r\nvar TILEMAP_FORMATS = __webpack_require__(/*! ../../tilemaps/Formats */ \"./node_modules/phaser/src/tilemaps/Formats.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Tiled Tilemap JSON File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapTiledJSON method and are not typically created directly.\r\n *\r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapTiledJSON.\r\n *\r\n * @class TilemapJSONFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar TilemapJSONFile = new Class({\r\n\r\n Extends: JSONFile,\r\n\r\n initialize:\r\n\r\n function TilemapJSONFile (loader, key, url, xhrSettings)\r\n {\r\n JSONFile.call(this, loader, key, url, xhrSettings);\r\n\r\n this.type = 'tilemapJSON';\r\n\r\n this.cache = loader.cacheManager.tilemap;\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.TilemapJSONFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n var tiledata = { format: TILEMAP_FORMATS.TILED_JSON, data: this.data };\r\n\r\n this.cache.add(this.key, tiledata);\r\n\r\n this.pendingDestroy(tiledata);\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a Tiled JSON Tilemap file, or array of map files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n *\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.tilemapTiledJSON('level1', 'maps/Level1.json');\r\n * }\r\n * ```\r\n *\r\n * The Tilemap data is created using the Tiled Map Editor and selecting JSON as the export format.\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Tilemap Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Tilemap Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Text Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n *\r\n * ```javascript\r\n * this.load.tilemapTiledJSON({\r\n * key: 'level1',\r\n * url: 'maps/Level1.json'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n *\r\n * ```javascript\r\n * this.load.tilemapTiledJSON('level1', 'maps/Level1.json');\r\n * // and later in your game ...\r\n * var map = this.make.tilemap({ key: 'level1' });\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and\r\n * this is what you would use to retrieve the text from the Tilemap Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"level\"\r\n * and no URL is given then the Loader will set the URL to be \"level.json\". It will always add `.json` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Tilemap JSON File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#tilemapTiledJSON\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig|Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @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\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('tilemapTiledJSON', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new TilemapJSONFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new TilemapJSONFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = TilemapJSONFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/TilemapJSONFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/UnityAtlasFile.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/UnityAtlasFile.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar ImageFile = __webpack_require__(/*! ./ImageFile.js */ \"./node_modules/phaser/src/loader/filetypes/ImageFile.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\nvar MultiFile = __webpack_require__(/*! ../MultiFile.js */ \"./node_modules/phaser/src/loader/MultiFile.js\");\r\nvar TextFile = __webpack_require__(/*! ./TextFile.js */ \"./node_modules/phaser/src/loader/filetypes/TextFile.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single text file based Unity Texture Atlas File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#unityAtlas method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#unityAtlas.\r\n *\r\n * @class UnityAtlasFile\r\n * @extends Phaser.Loader.MultiFile\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\r\n * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was \"alien\" then the URL will be \"alien.txt\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings.\r\n */\r\nvar UnityAtlasFile = new Class({\r\n\r\n Extends: MultiFile,\r\n\r\n initialize:\r\n\r\n function UnityAtlasFile (loader, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings)\r\n {\r\n var image;\r\n var data;\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n\r\n image = new ImageFile(loader, {\r\n key: key,\r\n url: GetFastValue(config, 'textureURL'),\r\n extension: GetFastValue(config, 'textureExtension', 'png'),\r\n normalMap: GetFastValue(config, 'normalMap'),\r\n xhrSettings: GetFastValue(config, 'textureXhrSettings')\r\n });\r\n\r\n data = new TextFile(loader, {\r\n key: key,\r\n url: GetFastValue(config, 'atlasURL'),\r\n extension: GetFastValue(config, 'atlasExtension', 'txt'),\r\n xhrSettings: GetFastValue(config, 'atlasXhrSettings')\r\n });\r\n }\r\n else\r\n {\r\n image = new ImageFile(loader, key, textureURL, textureXhrSettings);\r\n data = new TextFile(loader, key, atlasURL, atlasXhrSettings);\r\n }\r\n\r\n if (image.linkFile)\r\n {\r\n // Image has a normal map\r\n MultiFile.call(this, loader, 'unityatlas', key, [ image, data, image.linkFile ]);\r\n }\r\n else\r\n {\r\n MultiFile.call(this, loader, 'unityatlas', key, [ image, data ]);\r\n }\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.UnityAtlasFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.isReadyToProcess())\r\n {\r\n var image = this.files[0];\r\n var text = this.files[1];\r\n var normalMap = (this.files[2]) ? this.files[2].data : null;\r\n\r\n this.loader.textureManager.addUnityAtlas(image.key, image.data, text.data, normalMap);\r\n\r\n text.addToCache();\r\n\r\n this.complete = true;\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a Unity YAML based Texture Atlas, or array of atlases, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.txt');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring\r\n * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.\r\n *\r\n * Phaser expects the atlas data to be provided in a YAML formatted text file as exported from Unity.\r\n * \r\n * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Texture Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.unityAtlas({\r\n * key: 'mainmenu',\r\n * textureURL: 'images/MainMenu.png',\r\n * atlasURL: 'images/MainMenu.txt'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig` for more details.\r\n *\r\n * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key:\r\n * \r\n * ```javascript\r\n * this.load.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json');\r\n * // and later in your game ...\r\n * this.add.image(x, y, 'mainmenu', 'background');\r\n * ```\r\n *\r\n * To get a list of all available frames within an atlas please consult your Texture Atlas software.\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the image from the Texture Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\r\n * and no URL is given then the Loader will set the URL to be \"alien.png\". It will always add `.png` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,\r\n * then you can specify it by providing an array as the `url` where the second element is the normal map:\r\n * \r\n * ```javascript\r\n * this.load.unityAtlas('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.txt');\r\n * ```\r\n *\r\n * Or, if you are using a config object use the `normalMap` property:\r\n * \r\n * ```javascript\r\n * this.load.unityAtlas({\r\n * key: 'mainmenu',\r\n * textureURL: 'images/MainMenu.png',\r\n * normalMap: 'images/MainMenu-n.png',\r\n * atlasURL: 'images/MainMenu.txt'\r\n * });\r\n * ```\r\n *\r\n * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings.\r\n * Normal maps are a WebGL only feature.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Unity Atlas File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#unityAtlas\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig|Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\r\n * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was \"alien\" then the URL will be \"alien.txt\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('unityAtlas', function (key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings)\r\n{\r\n var multifile;\r\n\r\n // Supports an Object file definition in the key argument\r\n // Or an array of objects in the key argument\r\n // Or a single entry where all arguments have been defined\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n multifile = new UnityAtlasFile(this, key[i]);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n }\r\n else\r\n {\r\n multifile = new UnityAtlasFile(this, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = UnityAtlasFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/UnityAtlasFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/VideoFile.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/VideoFile.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../../const */ \"./node_modules/phaser/src/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetURL = __webpack_require__(/*! ../GetURL */ \"./node_modules/phaser/src/loader/GetURL.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single Video File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#video method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#video.\r\n *\r\n * @class VideoFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.20.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.VideoFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {any} [urlConfig] - The absolute or relative URL to load this file from in a config object.\r\n * @param {string} [loadEvent] - The load event to listen for when _not_ loading as a blob. Either 'loadeddata', 'canplay' or 'canplaythrough'.\r\n * @param {boolean} [asBlob] - Load the video as a data blob, or via the Video element?\r\n * @param {boolean} [noAudio] - Does the video have an audio track? If not you can enable auto-playing on it.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar VideoFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n // URL is an object created by VideoFile.getVideoURL\r\n function VideoFile (loader, key, urlConfig, loadEvent, asBlob, noAudio, xhrSettings)\r\n {\r\n if (loadEvent === undefined) { loadEvent = 'loadeddata'; }\r\n if (asBlob === undefined) { asBlob = false; }\r\n if (noAudio === undefined) { noAudio = false; }\r\n\r\n if (loadEvent !== 'loadeddata' && loadEvent !== 'canplay' && loadEvent !== 'canplaythrough')\r\n {\r\n loadEvent = 'loadeddata';\r\n }\r\n\r\n var fileConfig = {\r\n type: 'video',\r\n cache: loader.cacheManager.video,\r\n extension: urlConfig.type,\r\n responseType: 'blob',\r\n key: key,\r\n url: urlConfig.url,\r\n xhrSettings: xhrSettings,\r\n config: {\r\n loadEvent: loadEvent,\r\n asBlob: asBlob,\r\n noAudio: noAudio\r\n }\r\n };\r\n\r\n this.onLoadCallback = this.onVideoLoadHandler.bind(this);\r\n this.onErrorCallback = this.onVideoErrorHandler.bind(this);\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.VideoFile#onProcess\r\n * @since 3.20.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n if (!this.config.asBlob)\r\n {\r\n this.onProcessComplete();\r\n\r\n return;\r\n }\r\n\r\n // Load Video as blob\r\n\r\n var video = this.createVideoElement();\r\n\r\n this.data = video;\r\n\r\n var _this = this;\r\n\r\n this.data.onloadeddata = function ()\r\n {\r\n _this.onProcessComplete();\r\n };\r\n\r\n this.data.onerror = function ()\r\n {\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.onProcessError();\r\n };\r\n\r\n File.createObjectURL(video, this.xhrLoader.response, '');\r\n\r\n video.load();\r\n },\r\n\r\n /**\r\n * Creates a Video Element within the DOM.\r\n *\r\n * @method Phaser.Loader.FileTypes.VideoFile#createVideoElement\r\n * @private\r\n * @since 3.20.0\r\n * \r\n * @return {HTMLVideoElement} The newly created Video element.\r\n */\r\n createVideoElement: function ()\r\n {\r\n var video = document.createElement('video');\r\n \r\n video.controls = false;\r\n video.crossOrigin = this.loader.crossOrigin;\r\n\r\n if (this.config.noAudio)\r\n {\r\n video.muted = true;\r\n video.defaultMuted = true;\r\n\r\n video.setAttribute('autoplay', 'autoplay');\r\n }\r\n\r\n video.setAttribute('playsinline', 'playsinline');\r\n video.setAttribute('preload', 'auto');\r\n\r\n return video;\r\n },\r\n\r\n /**\r\n * Internal load event callback.\r\n *\r\n * @method Phaser.Loader.FileTypes.VideoFile#onVideoLoadHandler\r\n * @private\r\n * @since 3.20.0\r\n *\r\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load.\r\n */\r\n onVideoLoadHandler: function (event)\r\n {\r\n var video = event.target;\r\n\r\n video.removeEventListener(this.config.loadEvent, this.onLoadCallback, true);\r\n video.removeEventListener('error', this.onErrorCallback, true);\r\n\r\n this.data = video;\r\n\r\n this.resetXHR();\r\n\r\n this.loader.nextFile(this, true);\r\n },\r\n\r\n /**\r\n * Internal load error event callback.\r\n *\r\n * @method Phaser.Loader.FileTypes.VideoFile#onVideoErrorHandler\r\n * @private\r\n * @since 3.20.0\r\n *\r\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load.\r\n */\r\n onVideoErrorHandler: function (event)\r\n {\r\n var video = event.target;\r\n\r\n if (video)\r\n {\r\n video.removeEventListener(this.config.loadEvent, this.onLoadCallback, true);\r\n video.removeEventListener('error', this.onErrorCallback, true);\r\n }\r\n\r\n this.resetXHR();\r\n\r\n this.loader.nextFile(this, false);\r\n },\r\n\r\n /**\r\n * Called by the Loader, starts the actual file downloading.\r\n * During the load the methods onLoad, onError and onProgress are called, based on the XHR events.\r\n * You shouldn't normally call this method directly, it's meant to be invoked by the Loader.\r\n *\r\n * @method Phaser.Loader.FileTypes.VideoFile#load\r\n * @since 3.20.0\r\n */\r\n load: function ()\r\n {\r\n var loadEvent = this.config.loadEvent;\r\n\r\n if (this.config.asBlob)\r\n {\r\n File.prototype.load.call(this);\r\n }\r\n else\r\n {\r\n this.percentComplete = 0;\r\n\r\n var video = this.createVideoElement();\r\n\r\n video.addEventListener(loadEvent, this.onLoadCallback, true);\r\n video.addEventListener('error', this.onErrorCallback, true);\r\n\r\n video.src = GetURL(this, this.loader.baseURL);\r\n\r\n video.load();\r\n }\r\n }\r\n\r\n});\r\n\r\nVideoFile.create = function (loader, key, urls, loadEvent, asBlob, noAudio, xhrSettings)\r\n{\r\n var game = loader.systems.game;\r\n\r\n // url may be inside key, which may be an object\r\n if (IsPlainObject(key))\r\n {\r\n urls = GetFastValue(key, 'url', []);\r\n loadEvent = GetFastValue(key, 'loadEvent', 'loadeddata');\r\n asBlob = GetFastValue(key, 'asBlob', false);\r\n noAudio = GetFastValue(key, 'noAudio', false);\r\n xhrSettings = GetFastValue(key, 'xhrSettings');\r\n }\r\n\r\n var urlConfig = VideoFile.getVideoURL(game, urls);\r\n\r\n if (urlConfig)\r\n {\r\n return new VideoFile(loader, key, urlConfig, loadEvent, asBlob, noAudio, xhrSettings);\r\n }\r\n};\r\n\r\nVideoFile.getVideoURL = function (game, urls)\r\n{\r\n if (!Array.isArray(urls))\r\n {\r\n urls = [ urls ];\r\n }\r\n\r\n for (var i = 0; i < urls.length; i++)\r\n {\r\n var url = GetFastValue(urls[i], 'url', urls[i]);\r\n\r\n if (url.indexOf('blob:') === 0)\r\n {\r\n return url;\r\n }\r\n\r\n var videoType;\r\n\r\n if (url.indexOf('data:') === 0)\r\n {\r\n videoType = url.split(',')[0].match(/\\/(.*?);/);\r\n }\r\n else\r\n {\r\n videoType = url.match(/\\.([a-zA-Z0-9]+)($|\\?)/);\r\n }\r\n\r\n videoType = GetFastValue(urls[i], 'type', (videoType) ? videoType[1] : '').toLowerCase();\r\n\r\n if (game.device.video[videoType])\r\n {\r\n return {\r\n url: url,\r\n type: videoType\r\n };\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\n/**\r\n * Adds a Video file, or array of video files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.video('intro', [ 'video/level1.mp4', 'video/level1.webm', 'video/level1.mov' ]);\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global Video Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Video Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Video Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.video({\r\n * key: 'intro',\r\n * url: [ 'video/level1.mp4', 'video/level1.webm', 'video/level1.mov' ],\r\n * asBlob: false,\r\n * noAudio: true\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.VideoFileConfig` for more details.\r\n *\r\n * The URLs can be relative or absolute. If the URLs are relative the `Loader.baseURL` and `Loader.path` values will be prepended to them.\r\n *\r\n * Due to different browsers supporting different video file types you should usually provide your video files in a variety of formats.\r\n * mp4, mov and webm are the most common. If you provide an array of URLs then the Loader will determine which _one_ file to load based on\r\n * browser support, starting with the first in the array and progressing to the end.\r\n * \r\n * Unlike most asset-types, videos do not _need_ to be preloaded. You can create a Video Game Object and then call its `loadURL` method,\r\n * to load a video at run-time, rather than in advance.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Video File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#video\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.20.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.VideoFileConfig|Phaser.Types.Loader.FileTypes.VideoFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {(string|string[])} [urls] - The absolute or relative URL to load the video files from.\r\n * @param {string} [loadEvent='loadeddata'] - The load event to listen for when _not_ loading as a blob. Either `loadeddata`, `canplay` or `canplaythrough`.\r\n * @param {boolean} [asBlob=false] - Load the video as a data blob, or stream it via the Video element?\r\n * @param {boolean} [noAudio=false] - Does the video have an audio track? If not you can enable auto-playing on it.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('video', function (key, urls, loadEvent, asBlob, noAudio, xhrSettings)\r\n{\r\n var videoFile;\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n videoFile = VideoFile.create(this, key[i]);\r\n\r\n if (videoFile)\r\n {\r\n this.addFile(videoFile);\r\n }\r\n }\r\n }\r\n else\r\n {\r\n videoFile = VideoFile.create(this, key, urls, loadEvent, asBlob, noAudio, xhrSettings);\r\n\r\n if (videoFile)\r\n {\r\n this.addFile(videoFile);\r\n }\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = VideoFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/VideoFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/XMLFile.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/XMLFile.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar File = __webpack_require__(/*! ../File */ \"./node_modules/phaser/src/loader/File.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\nvar ParseXML = __webpack_require__(/*! ../../dom/ParseXML */ \"./node_modules/phaser/src/dom/ParseXML.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A single XML File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#xml method and are not typically created directly.\r\n * \r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#xml.\r\n *\r\n * @class XMLFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.XMLFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was \"alien\" then the URL will be \"alien.xml\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar XMLFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function XMLFile (loader, key, url, xhrSettings)\r\n {\r\n var extension = 'xml';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'xml',\r\n cache: loader.cacheManager.xml,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.XMLFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = ParseXML(this.xhrLoader.responseText);\r\n\r\n if (this.data)\r\n {\r\n this.onProcessComplete();\r\n }\r\n else\r\n {\r\n console.warn('Invalid XMLFile: ' + this.key);\r\n \r\n this.onProcessError();\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an XML file, or array of XML files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n * \r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.xml('wavedata', 'files/AlienWaveData.xml');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n * \r\n * The key must be a unique String. It is used to add the file to the global XML Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the XML Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the XML Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n * \r\n * ```javascript\r\n * this.load.xml({\r\n * key: 'wavedata',\r\n * url: 'files/AlienWaveData.xml'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.XMLFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n * \r\n * ```javascript\r\n * this.load.xml('wavedata', 'files/AlienWaveData.xml');\r\n * // and later in your game ...\r\n * var data = this.cache.xml.get('wavedata');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and\r\n * this is what you would use to retrieve the text from the XML Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * 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\"\r\n * and no URL is given then the Loader will set the URL to be \"data.xml\". It will always add `.xml` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the XML File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#xml\r\n * @fires Phaser.Loader.LoaderPlugin#addFileEvent\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.XMLFileConfig|Phaser.Types.Loader.FileTypes.XMLFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was \"alien\" then the URL will be \"alien.xml\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\nFileTypesManager.register('xml', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new XMLFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new XMLFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = XMLFile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/XMLFile.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/filetypes/index.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/loader/filetypes/index.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Loader.FileTypes\r\n */\r\n\r\nmodule.exports = {\r\n\r\n AnimationJSONFile: __webpack_require__(/*! ./AnimationJSONFile */ \"./node_modules/phaser/src/loader/filetypes/AnimationJSONFile.js\"),\r\n AtlasJSONFile: __webpack_require__(/*! ./AtlasJSONFile */ \"./node_modules/phaser/src/loader/filetypes/AtlasJSONFile.js\"),\r\n AtlasXMLFile: __webpack_require__(/*! ./AtlasXMLFile */ \"./node_modules/phaser/src/loader/filetypes/AtlasXMLFile.js\"),\r\n AudioFile: __webpack_require__(/*! ./AudioFile */ \"./node_modules/phaser/src/loader/filetypes/AudioFile.js\"),\r\n AudioSpriteFile: __webpack_require__(/*! ./AudioSpriteFile */ \"./node_modules/phaser/src/loader/filetypes/AudioSpriteFile.js\"),\r\n BinaryFile: __webpack_require__(/*! ./BinaryFile */ \"./node_modules/phaser/src/loader/filetypes/BinaryFile.js\"),\r\n BitmapFontFile: __webpack_require__(/*! ./BitmapFontFile */ \"./node_modules/phaser/src/loader/filetypes/BitmapFontFile.js\"),\r\n CSSFile: __webpack_require__(/*! ./CSSFile */ \"./node_modules/phaser/src/loader/filetypes/CSSFile.js\"),\r\n GLSLFile: __webpack_require__(/*! ./GLSLFile */ \"./node_modules/phaser/src/loader/filetypes/GLSLFile.js\"),\r\n HTML5AudioFile: __webpack_require__(/*! ./HTML5AudioFile */ \"./node_modules/phaser/src/loader/filetypes/HTML5AudioFile.js\"),\r\n HTMLFile: __webpack_require__(/*! ./HTMLFile */ \"./node_modules/phaser/src/loader/filetypes/HTMLFile.js\"),\r\n HTMLTextureFile: __webpack_require__(/*! ./HTMLTextureFile */ \"./node_modules/phaser/src/loader/filetypes/HTMLTextureFile.js\"),\r\n ImageFile: __webpack_require__(/*! ./ImageFile */ \"./node_modules/phaser/src/loader/filetypes/ImageFile.js\"),\r\n JSONFile: __webpack_require__(/*! ./JSONFile */ \"./node_modules/phaser/src/loader/filetypes/JSONFile.js\"),\r\n MultiAtlasFile: __webpack_require__(/*! ./MultiAtlasFile */ \"./node_modules/phaser/src/loader/filetypes/MultiAtlasFile.js\"),\r\n MultiScriptFile: __webpack_require__(/*! ./MultiScriptFile */ \"./node_modules/phaser/src/loader/filetypes/MultiScriptFile.js\"),\r\n PackFile: __webpack_require__(/*! ./PackFile */ \"./node_modules/phaser/src/loader/filetypes/PackFile.js\"),\r\n PluginFile: __webpack_require__(/*! ./PluginFile */ \"./node_modules/phaser/src/loader/filetypes/PluginFile.js\"),\r\n SceneFile: __webpack_require__(/*! ./SceneFile */ \"./node_modules/phaser/src/loader/filetypes/SceneFile.js\"),\r\n ScenePluginFile: __webpack_require__(/*! ./ScenePluginFile */ \"./node_modules/phaser/src/loader/filetypes/ScenePluginFile.js\"),\r\n ScriptFile: __webpack_require__(/*! ./ScriptFile */ \"./node_modules/phaser/src/loader/filetypes/ScriptFile.js\"),\r\n SpriteSheetFile: __webpack_require__(/*! ./SpriteSheetFile */ \"./node_modules/phaser/src/loader/filetypes/SpriteSheetFile.js\"),\r\n SVGFile: __webpack_require__(/*! ./SVGFile */ \"./node_modules/phaser/src/loader/filetypes/SVGFile.js\"),\r\n TextFile: __webpack_require__(/*! ./TextFile */ \"./node_modules/phaser/src/loader/filetypes/TextFile.js\"),\r\n TilemapCSVFile: __webpack_require__(/*! ./TilemapCSVFile */ \"./node_modules/phaser/src/loader/filetypes/TilemapCSVFile.js\"),\r\n TilemapImpactFile: __webpack_require__(/*! ./TilemapImpactFile */ \"./node_modules/phaser/src/loader/filetypes/TilemapImpactFile.js\"),\r\n TilemapJSONFile: __webpack_require__(/*! ./TilemapJSONFile */ \"./node_modules/phaser/src/loader/filetypes/TilemapJSONFile.js\"),\r\n UnityAtlasFile: __webpack_require__(/*! ./UnityAtlasFile */ \"./node_modules/phaser/src/loader/filetypes/UnityAtlasFile.js\"),\r\n VideoFile: __webpack_require__(/*! ./VideoFile */ \"./node_modules/phaser/src/loader/filetypes/VideoFile.js\"),\r\n XMLFile: __webpack_require__(/*! ./XMLFile */ \"./node_modules/phaser/src/loader/filetypes/XMLFile.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/filetypes/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/loader/index.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/loader/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/loader/const.js\");\r\nvar Extend = __webpack_require__(/*! ../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\n\r\n/**\r\n * @namespace Phaser.Loader\r\n */\r\n\r\nvar Loader = {\r\n\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/loader/events/index.js\"),\r\n\r\n FileTypes: __webpack_require__(/*! ./filetypes */ \"./node_modules/phaser/src/loader/filetypes/index.js\"),\r\n\r\n File: __webpack_require__(/*! ./File */ \"./node_modules/phaser/src/loader/File.js\"),\r\n FileTypesManager: __webpack_require__(/*! ./FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\"),\r\n GetURL: __webpack_require__(/*! ./GetURL */ \"./node_modules/phaser/src/loader/GetURL.js\"),\r\n LoaderPlugin: __webpack_require__(/*! ./LoaderPlugin */ \"./node_modules/phaser/src/loader/LoaderPlugin.js\"),\r\n MergeXHRSettings: __webpack_require__(/*! ./MergeXHRSettings */ \"./node_modules/phaser/src/loader/MergeXHRSettings.js\"),\r\n MultiFile: __webpack_require__(/*! ./MultiFile */ \"./node_modules/phaser/src/loader/MultiFile.js\"),\r\n XHRLoader: __webpack_require__(/*! ./XHRLoader */ \"./node_modules/phaser/src/loader/XHRLoader.js\"),\r\n XHRSettings: __webpack_require__(/*! ./XHRSettings */ \"./node_modules/phaser/src/loader/XHRSettings.js\")\r\n\r\n};\r\n\r\n// Merge in the consts\r\nLoader = Extend(false, Loader, CONST);\r\n\r\nmodule.exports = Loader;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/loader/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Average.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/math/Average.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the mean average of the given values.\r\n *\r\n * @function Phaser.Math.Average\r\n * @since 3.0.0\r\n *\r\n * @param {number[]} values - The values to average.\r\n *\r\n * @return {number} The average value.\r\n */\r\nvar Average = function (values)\r\n{\r\n var sum = 0;\r\n\r\n for (var i = 0; i < values.length; i++)\r\n {\r\n sum += (+values[i]);\r\n }\r\n\r\n return sum / values.length;\r\n};\r\n\r\nmodule.exports = Average;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Average.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Bernstein.js": /*!***************************************************!*\ !*** ./node_modules/phaser/src/math/Bernstein.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Factorial = __webpack_require__(/*! ./Factorial */ \"./node_modules/phaser/src/math/Factorial.js\");\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Math.Bernstein\r\n * @since 3.0.0\r\n *\r\n * @param {number} n - [description]\r\n * @param {number} i - [description]\r\n *\r\n * @return {number} [description]\r\n */\r\nvar Bernstein = function (n, i)\r\n{\r\n return Factorial(n) / Factorial(i) / Factorial(n - i);\r\n};\r\n\r\nmodule.exports = Bernstein;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Bernstein.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Between.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/math/Between.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random integer between the `min` and `max` values, inclusive.\r\n *\r\n * @function Phaser.Math.Between\r\n * @since 3.0.0\r\n *\r\n * @param {integer} min - The minimum value.\r\n * @param {integer} max - The maximum value.\r\n *\r\n * @return {integer} The random integer.\r\n */\r\nvar Between = function (min, max)\r\n{\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n};\r\n\r\nmodule.exports = Between;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Between.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/CatmullRom.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/math/CatmullRom.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates a Catmull-Rom value.\r\n *\r\n * @function Phaser.Math.CatmullRom\r\n * @since 3.0.0\r\n *\r\n * @param {number} t - [description]\r\n * @param {number} p0 - [description]\r\n * @param {number} p1 - [description]\r\n * @param {number} p2 - [description]\r\n * @param {number} p3 - [description]\r\n *\r\n * @return {number} The Catmull-Rom value.\r\n */\r\nvar CatmullRom = function (t, p0, p1, p2, p3)\r\n{\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n var t2 = t * t;\r\n var t3 = t * t2;\r\n\r\n return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;\r\n};\r\n\r\nmodule.exports = CatmullRom;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/CatmullRom.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/CeilTo.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/math/CeilTo.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Ceils to some place comparative to a `base`, default is 10 for decimal place.\r\n *\r\n * The `place` is represented by the power applied to `base` to get that place.\r\n *\r\n * @function Phaser.Math.CeilTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to round.\r\n * @param {number} [place=0] - The place to round to.\r\n * @param {integer} [base=10] - The base to round in. Default is 10 for decimal.\r\n *\r\n * @return {number} The rounded value.\r\n */\r\nvar CeilTo = function (value, place, base)\r\n{\r\n if (place === undefined) { place = 0; }\r\n if (base === undefined) { base = 10; }\r\n\r\n var p = Math.pow(base, -place);\r\n\r\n return Math.ceil(value * p) / p;\r\n};\r\n\r\nmodule.exports = CeilTo;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/CeilTo.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Clamp.js": /*!***********************************************!*\ !*** ./node_modules/phaser/src/math/Clamp.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Force a value within the boundaries by clamping it to the range `min`, `max`.\r\n *\r\n * @function Phaser.Math.Clamp\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to be clamped.\r\n * @param {number} min - The minimum bounds.\r\n * @param {number} max - The maximum bounds.\r\n *\r\n * @return {number} The clamped value.\r\n */\r\nvar Clamp = function (value, min, max)\r\n{\r\n return Math.max(min, Math.min(max, value));\r\n};\r\n\r\nmodule.exports = Clamp;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Clamp.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/DegToRad.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/math/DegToRad.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/math/const.js\");\r\n\r\n/**\r\n * Convert the given angle from degrees, to the equivalent angle in radians.\r\n *\r\n * @function Phaser.Math.DegToRad\r\n * @since 3.0.0\r\n *\r\n * @param {integer} degrees - The angle (in degrees) to convert to radians.\r\n *\r\n * @return {number} The given angle converted to radians.\r\n */\r\nvar DegToRad = function (degrees)\r\n{\r\n return degrees * CONST.DEG_TO_RAD;\r\n};\r\n\r\nmodule.exports = DegToRad;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/DegToRad.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Difference.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/math/Difference.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the positive difference of two given numbers.\r\n *\r\n * @function Phaser.Math.Difference\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first number in the calculation.\r\n * @param {number} b - The second number in the calculation.\r\n *\r\n * @return {number} The positive difference of the two given numbers.\r\n */\r\nvar Difference = function (a, b)\r\n{\r\n return Math.abs(a - b);\r\n};\r\n\r\nmodule.exports = Difference;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Difference.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Factorial.js": /*!***************************************************!*\ !*** ./node_modules/phaser/src/math/Factorial.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the factorial of a given number for integer values greater than 0.\r\n *\r\n * @function Phaser.Math.Factorial\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - A positive integer to calculate the factorial of.\r\n *\r\n * @return {number} The factorial of the given number.\r\n */\r\nvar Factorial = function (value)\r\n{\r\n if (value === 0)\r\n {\r\n return 1;\r\n }\r\n\r\n var res = value;\r\n\r\n while (--value)\r\n {\r\n res *= value;\r\n }\r\n\r\n return res;\r\n};\r\n\r\nmodule.exports = Factorial;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Factorial.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/FloatBetween.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/math/FloatBetween.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Generate a random floating point number between the two given bounds, minimum inclusive, maximum exclusive.\r\n *\r\n * @function Phaser.Math.FloatBetween\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The lower bound for the float, inclusive.\r\n * @param {number} max - The upper bound for the float exclusive.\r\n *\r\n * @return {number} A random float within the given range.\r\n */\r\nvar FloatBetween = function (min, max)\r\n{\r\n return Math.random() * (max - min) + min;\r\n};\r\n\r\nmodule.exports = FloatBetween;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/FloatBetween.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/FloorTo.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/math/FloorTo.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Floors to some place comparative to a `base`, default is 10 for decimal place.\r\n *\r\n * The `place` is represented by the power applied to `base` to get that place.\r\n *\r\n * @function Phaser.Math.FloorTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to round.\r\n * @param {integer} [place=0] - The place to round to.\r\n * @param {integer} [base=10] - The base to round in. Default is 10 for decimal.\r\n *\r\n * @return {number} The rounded value.\r\n */\r\nvar FloorTo = function (value, place, base)\r\n{\r\n if (place === undefined) { place = 0; }\r\n if (base === undefined) { base = 10; }\r\n\r\n var p = Math.pow(base, -place);\r\n\r\n return Math.floor(value * p) / p;\r\n};\r\n\r\nmodule.exports = FloorTo;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/FloorTo.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/FromPercent.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/math/FromPercent.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = __webpack_require__(/*! ./Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\n\r\n/**\r\n * Return a value based on the range between `min` and `max` and the percentage given.\r\n *\r\n * @function Phaser.Math.FromPercent\r\n * @since 3.0.0\r\n *\r\n * @param {number} percent - A value between 0 and 1 representing the percentage.\r\n * @param {number} min - The minimum value.\r\n * @param {number} [max] - The maximum value.\r\n *\r\n * @return {number} The value that is `percent` percent between `min` and `max`.\r\n */\r\nvar FromPercent = function (percent, min, max)\r\n{\r\n percent = Clamp(percent, 0, 1);\r\n\r\n return (max - min) * percent;\r\n};\r\n\r\nmodule.exports = FromPercent;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/FromPercent.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/GetSpeed.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/math/GetSpeed.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate a per-ms speed from a distance and time (given in seconds).\r\n *\r\n * @function Phaser.Math.GetSpeed\r\n * @since 3.0.0\r\n *\r\n * @param {number} distance - The distance.\r\n * @param {integer} time - The time, in seconds.\r\n *\r\n * @return {number} The speed, in distance per ms.\r\n *\r\n * @example\r\n * // 400px over 1 second is 0.4 px/ms\r\n * Phaser.Math.GetSpeed(400, 1) // -> 0.4\r\n */\r\nvar GetSpeed = function (distance, time)\r\n{\r\n return (distance / time) / 1000;\r\n};\r\n\r\nmodule.exports = GetSpeed;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/GetSpeed.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/IsEven.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/math/IsEven.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check if a given value is an even number.\r\n *\r\n * @function Phaser.Math.IsEven\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The number to perform the check with.\r\n *\r\n * @return {boolean} Whether the number is even or not.\r\n */\r\nvar IsEven = function (value)\r\n{\r\n // Use abstract equality == for \"is number\" test\r\n\r\n // eslint-disable-next-line eqeqeq\r\n return (value == parseFloat(value)) ? !(value % 2) : void 0;\r\n};\r\n\r\nmodule.exports = IsEven;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/IsEven.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/IsEvenStrict.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/math/IsEvenStrict.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check if a given value is an even number using a strict type check.\r\n *\r\n * @function Phaser.Math.IsEvenStrict\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The number to perform the check with.\r\n *\r\n * @return {boolean} Whether the number is even or not.\r\n */\r\nvar IsEvenStrict = function (value)\r\n{\r\n // Use strict equality === for \"is number\" test\r\n return (value === parseFloat(value)) ? !(value % 2) : void 0;\r\n};\r\n\r\nmodule.exports = IsEvenStrict;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/IsEvenStrict.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Linear.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/math/Linear.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates a linear (interpolation) value over t.\r\n *\r\n * @function Phaser.Math.Linear\r\n * @since 3.0.0\r\n *\r\n * @param {number} p0 - The first point.\r\n * @param {number} p1 - The second point.\r\n * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1.\r\n *\r\n * @return {number} The step t% of the way between p0 and p1.\r\n */\r\nvar Linear = function (p0, p1, t)\r\n{\r\n return (p1 - p0) * t + p0;\r\n};\r\n\r\nmodule.exports = Linear;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Linear.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Matrix3.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/math/Matrix3.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A three-dimensional matrix.\r\n *\r\n * Defaults to the identity matrix when instantiated.\r\n *\r\n * @class Matrix3\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from.\r\n */\r\nvar Matrix3 = new Class({\r\n\r\n initialize:\r\n\r\n function Matrix3 (m)\r\n {\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.Math.Matrix3#val\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.val = new Float32Array(9);\r\n\r\n if (m)\r\n {\r\n // Assume Matrix3 with val:\r\n this.copy(m);\r\n }\r\n else\r\n {\r\n // Default to identity\r\n this.identity();\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Matrix3.\r\n *\r\n * @method Phaser.Math.Matrix3#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} A clone of this Matrix3.\r\n */\r\n clone: function ()\r\n {\r\n return new Matrix3(this);\r\n },\r\n\r\n /**\r\n * This method is an alias for `Matrix3.copy`.\r\n *\r\n * @method Phaser.Math.Matrix3#set\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n set: function (src)\r\n {\r\n return this.copy(src);\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix into this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n copy: function (src)\r\n {\r\n var out = this.val;\r\n var a = src.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix4 into this Matrix3.\r\n *\r\n * @method Phaser.Math.Matrix3#fromMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n fromMat4: function (m)\r\n {\r\n var a = m.val;\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given array.\r\n *\r\n * @method Phaser.Math.Matrix3#fromArray\r\n * @since 3.0.0\r\n *\r\n * @param {array} a - The array to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n fromArray: function (a)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n identity: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transpose this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#transpose\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n transpose: function ()\r\n {\r\n var a = this.val;\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a12 = a[5];\r\n\r\n a[1] = a[3];\r\n a[2] = a[6];\r\n a[3] = a01;\r\n a[5] = a[7];\r\n a[6] = a02;\r\n a[7] = a12;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n invert: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n var b01 = a22 * a11 - a12 * a21;\r\n var b11 = -a22 * a10 + a12 * a20;\r\n var b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n var det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n a[0] = b01 * det;\r\n a[1] = (-a22 * a01 + a02 * a21) * det;\r\n a[2] = (a12 * a01 - a02 * a11) * det;\r\n a[3] = b11 * det;\r\n a[4] = (a22 * a00 - a02 * a20) * det;\r\n a[5] = (-a12 * a00 + a02 * a10) * det;\r\n a[6] = b21 * det;\r\n a[7] = (-a21 * a00 + a01 * a20) * det;\r\n a[8] = (a11 * a00 - a01 * a10) * det;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the adjoint, or adjugate, of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#adjoint\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n adjoint: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n a[0] = (a11 * a22 - a12 * a21);\r\n a[1] = (a02 * a21 - a01 * a22);\r\n a[2] = (a01 * a12 - a02 * a11);\r\n a[3] = (a12 * a20 - a10 * a22);\r\n a[4] = (a00 * a22 - a02 * a20);\r\n a[5] = (a02 * a10 - a00 * a12);\r\n a[6] = (a10 * a21 - a11 * a20);\r\n a[7] = (a01 * a20 - a00 * a21);\r\n a[8] = (a00 * a11 - a01 * a10);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the determinant of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#determinant\r\n * @since 3.0.0\r\n *\r\n * @return {number} The determinant of this Matrix.\r\n */\r\n determinant: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n multiply: function (src)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n var b = src.val;\r\n\r\n var b00 = b[0];\r\n var b01 = b[1];\r\n var b02 = b[2];\r\n var b10 = b[3];\r\n var b11 = b[4];\r\n var b12 = b[5];\r\n var b20 = b[6];\r\n var b21 = b[7];\r\n var b22 = b[8];\r\n\r\n a[0] = b00 * a00 + b01 * a10 + b02 * a20;\r\n a[1] = b00 * a01 + b01 * a11 + b02 * a21;\r\n a[2] = b00 * a02 + b01 * a12 + b02 * a22;\r\n\r\n a[3] = b10 * a00 + b11 * a10 + b12 * a20;\r\n a[4] = b10 * a01 + b11 * a11 + b12 * a21;\r\n a[5] = b10 * a02 + b11 * a12 + b12 * a22;\r\n\r\n a[6] = b20 * a00 + b21 * a10 + b22 * a20;\r\n a[7] = b20 * a01 + b21 * a11 + b22 * a21;\r\n a[8] = b20 * a02 + b21 * a12 + b22 * a22;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given Vector.\r\n *\r\n * @method Phaser.Math.Matrix3#translate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n translate: function (v)\r\n {\r\n var a = this.val;\r\n var x = v.x;\r\n var y = v.y;\r\n\r\n a[6] = x * a[0] + y * a[3] + a[6];\r\n a[7] = x * a[1] + y * a[4] + a[7];\r\n a[8] = x * a[2] + y * a[5] + a[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a rotation transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n rotate: function (rad)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n a[0] = c * a00 + s * a10;\r\n a[1] = c * a01 + s * a11;\r\n a[2] = c * a02 + s * a12;\r\n\r\n a[3] = c * a10 - s * a00;\r\n a[4] = c * a11 - s * a01;\r\n a[5] = c * a12 - s * a02;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * Uses the `x` and `y` components of the given Vector to scale the Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#scale\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n scale: function (v)\r\n {\r\n var a = this.val;\r\n var x = v.x;\r\n var y = v.y;\r\n\r\n a[0] = x * a[0];\r\n a[1] = x * a[1];\r\n a[2] = x * a[2];\r\n\r\n a[3] = y * a[3];\r\n a[4] = y * a[4];\r\n a[5] = y * a[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given Quaternion.\r\n *\r\n * @method Phaser.Math.Matrix3#fromQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n fromQuat: function (q)\r\n {\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n var out = this.val;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[3] = xy + wz;\r\n out[6] = xz - wy;\r\n\r\n out[1] = xy - wz;\r\n out[4] = 1 - (xx + zz);\r\n out[7] = yz + wx;\r\n\r\n out[2] = xz + wy;\r\n out[5] = yz - wx;\r\n out[8] = 1 - (xx + yy);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Math.Matrix3#normalFromMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} m - [description]\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n normalFromMat4: function (m)\r\n {\r\n var a = m.val;\r\n var out = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Matrix3;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Matrix3.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Matrix4.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/math/Matrix4.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\nvar EPSILON = 0.000001;\r\n\r\n/**\r\n * @classdesc\r\n * A four-dimensional matrix.\r\n *\r\n * @class Matrix4\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from.\r\n */\r\nvar Matrix4 = new Class({\r\n\r\n initialize:\r\n\r\n function Matrix4 (m)\r\n {\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.Math.Matrix4#val\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.val = new Float32Array(16);\r\n\r\n if (m)\r\n {\r\n // Assume Matrix4 with val:\r\n this.copy(m);\r\n }\r\n else\r\n {\r\n // Default to identity\r\n this.identity();\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Matrix4.\r\n *\r\n * @method Phaser.Math.Matrix4#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} A clone of this Matrix4.\r\n */\r\n clone: function ()\r\n {\r\n return new Matrix4(this);\r\n },\r\n\r\n // TODO - Should work with basic values\r\n\r\n /**\r\n * This method is an alias for `Matrix4.copy`.\r\n *\r\n * @method Phaser.Math.Matrix4#set\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n set: function (src)\r\n {\r\n return this.copy(src);\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix into this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n copy: function (src)\r\n {\r\n var out = this.val;\r\n var a = src.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given array.\r\n *\r\n * @method Phaser.Math.Matrix4#fromArray\r\n * @since 3.0.0\r\n *\r\n * @param {array} a - The array to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromArray: function (a)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix.\r\n *\r\n * Sets all values to `0`.\r\n *\r\n * @method Phaser.Math.Matrix4#zero\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n zero: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 0;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x`, `y` and `z` values of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#xyz\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n * @param {number} z - The z value.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n xyz: function (x, y, z)\r\n {\r\n this.identity();\r\n\r\n var out = this.val;\r\n\r\n out[12] = x;\r\n out[13] = y;\r\n out[14] = z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the scaling values of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scaling\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x scaling value.\r\n * @param {number} y - The y scaling value.\r\n * @param {number} z - The z scaling value.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scaling: function (x, y, z)\r\n {\r\n this.zero();\r\n\r\n var out = this.val;\r\n\r\n out[0] = x;\r\n out[5] = y;\r\n out[10] = z;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n identity: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transpose this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#transpose\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n transpose: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n var a23 = a[11];\r\n\r\n a[1] = a[4];\r\n a[2] = a[8];\r\n a[3] = a[12];\r\n a[4] = a01;\r\n a[6] = a[9];\r\n a[7] = a[13];\r\n a[8] = a02;\r\n a[9] = a12;\r\n a[11] = a[14];\r\n a[12] = a03;\r\n a[13] = a13;\r\n a[14] = a23;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n invert: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the adjoint, or adjugate, of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#adjoint\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n adjoint: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22));\r\n a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\r\n a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12));\r\n a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\r\n a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\r\n a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22));\r\n a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\r\n a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12));\r\n a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21));\r\n a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\r\n a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11));\r\n a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\r\n a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\r\n a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21));\r\n a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\r\n a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11));\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the determinant of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#determinant\r\n * @since 3.0.0\r\n *\r\n * @return {number} The determinant of this Matrix.\r\n */\r\n determinant: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n multiply: function (src)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b = src.val;\r\n\r\n // Cache only the current line of the second matrix\r\n var b0 = b[0];\r\n var b1 = b[1];\r\n var b2 = b[2];\r\n var b3 = b[3];\r\n\r\n a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n\r\n a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n\r\n a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n\r\n a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Math.Matrix4#multiplyLocal\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - [description]\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n multiplyLocal: function (src)\r\n {\r\n var a = [];\r\n var m1 = this.val;\r\n var m2 = src.val;\r\n\r\n a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12];\r\n a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13];\r\n a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14];\r\n a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15];\r\n\r\n a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12];\r\n a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13];\r\n a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14];\r\n a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15];\r\n\r\n a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12];\r\n a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13];\r\n a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14];\r\n a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15];\r\n\r\n a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12];\r\n a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13];\r\n a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14];\r\n a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15];\r\n\r\n return this.fromArray(a);\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given Vector.\r\n *\r\n * @method Phaser.Math.Matrix4#translate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n translate: function (v)\r\n {\r\n var x = v.x;\r\n var y = v.y;\r\n var z = v.z;\r\n var a = this.val;\r\n\r\n a[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n a[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n a[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n a[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given values.\r\n *\r\n * @method Phaser.Math.Matrix4#translateXYZ\r\n * @since 3.16.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n translateXYZ: function (x, y, z)\r\n {\r\n var a = this.val;\r\n\r\n a[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n a[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n a[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n a[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scale\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scale: function (v)\r\n {\r\n var x = v.x;\r\n var y = v.y;\r\n var z = v.z;\r\n var a = this.val;\r\n\r\n a[0] = a[0] * x;\r\n a[1] = a[1] * x;\r\n a[2] = a[2] * x;\r\n a[3] = a[3] * x;\r\n\r\n a[4] = a[4] * y;\r\n a[5] = a[5] * y;\r\n a[6] = a[6] * y;\r\n a[7] = a[7] * y;\r\n\r\n a[8] = a[8] * z;\r\n a[9] = a[9] * z;\r\n a[10] = a[10] * z;\r\n a[11] = a[11] * z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scaleXYZ\r\n * @since 3.16.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scaleXYZ: function (x, y, z)\r\n {\r\n var a = this.val;\r\n\r\n a[0] = a[0] * x;\r\n a[1] = a[1] * x;\r\n a[2] = a[2] * x;\r\n a[3] = a[3] * x;\r\n\r\n a[4] = a[4] * y;\r\n a[5] = a[5] * y;\r\n a[6] = a[6] * y;\r\n a[7] = a[7] * y;\r\n\r\n a[8] = a[8] * z;\r\n a[9] = a[9] * z;\r\n a[10] = a[10] * z;\r\n a[11] = a[11] * z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Derive a rotation matrix around the given axis.\r\n *\r\n * @method Phaser.Math.Matrix4#makeRotationAxis\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis.\r\n * @param {number} angle - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n makeRotationAxis: function (axis, angle)\r\n {\r\n // Based on http://www.gamedev.net/reference/articles/article1199.asp\r\n\r\n var c = Math.cos(angle);\r\n var s = Math.sin(angle);\r\n var t = 1 - c;\r\n var x = axis.x;\r\n var y = axis.y;\r\n var z = axis.z;\r\n var tx = t * x;\r\n var ty = t * y;\r\n\r\n this.fromArray([\r\n tx * x + c, tx * y - s * z, tx * z + s * y, 0,\r\n tx * y + s * z, ty * y + c, ty * z - s * x, 0,\r\n tx * z - s * y, ty * z + s * x, t * z * z + c, 0,\r\n 0, 0, 0, 1\r\n ]);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a rotation transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n * @param {Phaser.Math.Vector3} axis - The axis to rotate upon.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotate: function (rad, axis)\r\n {\r\n var a = this.val;\r\n var x = axis.x;\r\n var y = axis.y;\r\n var z = axis.z;\r\n var len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (Math.abs(len) < EPSILON)\r\n {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n var t = 1 - c;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n var b00 = x * x * t + c;\r\n var b01 = y * x * t + z * s;\r\n var b02 = z * x * t - y * s;\r\n\r\n var b10 = x * y * t - z * s;\r\n var b11 = y * y * t + c;\r\n var b12 = z * y * t + x * s;\r\n\r\n var b20 = x * z * t + y * s;\r\n var b21 = y * z * t - x * s;\r\n var b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n a[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n a[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n a[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n a[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n a[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n a[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n a[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n a[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n a[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n a[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n a[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n a[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its X axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateX\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateX: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[4] = a10 * c + a20 * s;\r\n a[5] = a11 * c + a21 * s;\r\n a[6] = a12 * c + a22 * s;\r\n a[7] = a13 * c + a23 * s;\r\n a[8] = a20 * c - a10 * s;\r\n a[9] = a21 * c - a11 * s;\r\n a[10] = a22 * c - a12 * s;\r\n a[11] = a23 * c - a13 * s;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its Y axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateY\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle to rotate by, in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateY: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[0] = a00 * c - a20 * s;\r\n a[1] = a01 * c - a21 * s;\r\n a[2] = a02 * c - a22 * s;\r\n a[3] = a03 * c - a23 * s;\r\n a[8] = a00 * s + a20 * c;\r\n a[9] = a01 * s + a21 * c;\r\n a[10] = a02 * s + a22 * c;\r\n a[11] = a03 * s + a23 * c;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its Z axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle to rotate by, in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateZ: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[0] = a00 * c + a10 * s;\r\n a[1] = a01 * c + a11 * s;\r\n a[2] = a02 * c + a12 * s;\r\n a[3] = a03 * c + a13 * s;\r\n a[4] = a10 * c - a00 * s;\r\n a[5] = a11 * c - a01 * s;\r\n a[6] = a12 * c - a02 * s;\r\n a[7] = a13 * c - a03 * s;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given rotation Quaternion and translation Vector.\r\n *\r\n * @method Phaser.Math.Matrix4#fromRotationTranslation\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from.\r\n * @param {Phaser.Math.Vector3} v - The Vector to set translation from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromRotationTranslation: function (q, v)\r\n {\r\n // Quaternion math\r\n var out = this.val;\r\n\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n\r\n out[12] = v.x;\r\n out[13] = v.y;\r\n out[14] = v.z;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given Quaternion.\r\n *\r\n * @method Phaser.Math.Matrix4#fromQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromQuat: function (q)\r\n {\r\n var out = this.val;\r\n\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a frustum matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#frustum\r\n * @since 3.0.0\r\n *\r\n * @param {number} left - The left bound of the frustum.\r\n * @param {number} right - The right bound of the frustum.\r\n * @param {number} bottom - The bottom bound of the frustum.\r\n * @param {number} top - The top bound of the frustum.\r\n * @param {number} near - The near bound of the frustum.\r\n * @param {number} far - The far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n frustum: function (left, right, bottom, top, near, far)\r\n {\r\n var out = this.val;\r\n\r\n var rl = 1 / (right - left);\r\n var tb = 1 / (top - bottom);\r\n var nf = 1 / (near - far);\r\n\r\n out[0] = (near * 2) * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = (near * 2) * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[10] = (far + near) * nf;\r\n out[11] = -1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (far * near * 2) * nf;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a perspective projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#perspective\r\n * @since 3.0.0\r\n *\r\n * @param {number} fovy - Vertical field of view in radians\r\n * @param {number} aspect - Aspect ratio. Typically viewport width /height.\r\n * @param {number} near - Near bound of the frustum.\r\n * @param {number} far - Far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n perspective: function (fovy, aspect, near, far)\r\n {\r\n var out = this.val;\r\n var f = 1.0 / Math.tan(fovy / 2);\r\n var nf = 1 / (near - far);\r\n\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = (far + near) * nf;\r\n out[11] = -1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (2 * far * near) * nf;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a perspective projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#perspectiveLH\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of the frustum.\r\n * @param {number} height - The height of the frustum.\r\n * @param {number} near - Near bound of the frustum.\r\n * @param {number} far - Far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n perspectiveLH: function (width, height, near, far)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = (2 * near) / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = (2 * near) / height;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = -far / (near - far);\r\n out[11] = 1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (near * far) / (near - far);\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate an orthogonal projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#ortho\r\n * @since 3.0.0\r\n *\r\n * @param {number} left - The left bound of the frustum.\r\n * @param {number} right - The right bound of the frustum.\r\n * @param {number} bottom - The bottom bound of the frustum.\r\n * @param {number} top - The top bound of the frustum.\r\n * @param {number} near - The near bound of the frustum.\r\n * @param {number} far - The far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n ortho: function (left, right, bottom, top, near, far)\r\n {\r\n var out = this.val;\r\n var lr = left - right;\r\n var bt = bottom - top;\r\n var nf = near - far;\r\n\r\n // Avoid division by zero\r\n lr = (lr === 0) ? lr : 1 / lr;\r\n bt = (bt === 0) ? bt : 1 / bt;\r\n nf = (nf === 0) ? nf : 1 / nf;\r\n\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a look-at matrix with the given eye position, focal point, and up axis.\r\n *\r\n * @method Phaser.Math.Matrix4#lookAt\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} eye - Position of the viewer\r\n * @param {Phaser.Math.Vector3} center - Point the viewer is looking at\r\n * @param {Phaser.Math.Vector3} up - vec3 pointing up.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n lookAt: function (eye, center, up)\r\n {\r\n var out = this.val;\r\n\r\n var eyex = eye.x;\r\n var eyey = eye.y;\r\n var eyez = eye.z;\r\n\r\n var upx = up.x;\r\n var upy = up.y;\r\n var upz = up.z;\r\n\r\n var centerx = center.x;\r\n var centery = center.y;\r\n var centerz = center.z;\r\n\r\n if (Math.abs(eyex - centerx) < EPSILON &&\r\n Math.abs(eyey - centery) < EPSILON &&\r\n Math.abs(eyez - centerz) < EPSILON)\r\n {\r\n return this.identity();\r\n }\r\n\r\n var z0 = eyex - centerx;\r\n var z1 = eyey - centery;\r\n var z2 = eyez - centerz;\r\n\r\n var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n var x0 = upy * z2 - upz * z1;\r\n var x1 = upz * z0 - upx * z2;\r\n var x2 = upx * z1 - upy * z0;\r\n\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n\r\n if (!len)\r\n {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n }\r\n else\r\n {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n var y0 = z1 * x2 - z2 * x1;\r\n var y1 = z2 * x0 - z0 * x2;\r\n var y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n\r\n if (!len)\r\n {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n }\r\n else\r\n {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values.\r\n *\r\n * @method Phaser.Math.Matrix4#yawPitchRoll\r\n * @since 3.0.0\r\n *\r\n * @param {number} yaw - [description]\r\n * @param {number} pitch - [description]\r\n * @param {number} roll - [description]\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n yawPitchRoll: function (yaw, pitch, roll)\r\n {\r\n this.zero();\r\n _tempMat1.zero();\r\n _tempMat2.zero();\r\n\r\n var m0 = this.val;\r\n var m1 = _tempMat1.val;\r\n var m2 = _tempMat2.val;\r\n\r\n // Rotate Z\r\n var s = Math.sin(roll);\r\n var c = Math.cos(roll);\r\n\r\n m0[10] = 1;\r\n m0[15] = 1;\r\n m0[0] = c;\r\n m0[1] = s;\r\n m0[4] = -s;\r\n m0[5] = c;\r\n\r\n // Rotate X\r\n s = Math.sin(pitch);\r\n c = Math.cos(pitch);\r\n\r\n m1[0] = 1;\r\n m1[15] = 1;\r\n m1[5] = c;\r\n m1[10] = c;\r\n m1[9] = -s;\r\n m1[6] = s;\r\n\r\n // Rotate Y\r\n s = Math.sin(yaw);\r\n c = Math.cos(yaw);\r\n\r\n m2[5] = 1;\r\n m2[15] = 1;\r\n m2[0] = c;\r\n m2[2] = -s;\r\n m2[8] = s;\r\n m2[10] = c;\r\n\r\n this.multiplyLocal(_tempMat1);\r\n this.multiplyLocal(_tempMat2);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#setWorldMatrix\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix.\r\n * @param {Phaser.Math.Vector3} position - The position of the world matrix.\r\n * @param {Phaser.Math.Vector3} scale - The scale of the world matrix.\r\n * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix.\r\n * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix)\r\n {\r\n this.yawPitchRoll(rotation.y, rotation.x, rotation.z);\r\n\r\n _tempMat1.scaling(scale.x, scale.y, scale.z);\r\n _tempMat2.xyz(position.x, position.y, position.z);\r\n\r\n this.multiplyLocal(_tempMat1);\r\n this.multiplyLocal(_tempMat2);\r\n\r\n if (viewMatrix !== undefined)\r\n {\r\n this.multiplyLocal(viewMatrix);\r\n }\r\n\r\n if (projectionMatrix !== undefined)\r\n {\r\n this.multiplyLocal(projectionMatrix);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nvar _tempMat1 = new Matrix4();\r\nvar _tempMat2 = new Matrix4();\r\n\r\nmodule.exports = Matrix4;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Matrix4.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/MaxAdd.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/math/MaxAdd.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Add an `amount` to a `value`, limiting the maximum result to `max`.\r\n *\r\n * @function Phaser.Math.MaxAdd\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to add to.\r\n * @param {number} amount - The amount to add.\r\n * @param {number} max - The maximum value to return.\r\n *\r\n * @return {number} The resulting value.\r\n */\r\nvar MaxAdd = function (value, amount, max)\r\n{\r\n return Math.min(value + amount, max);\r\n};\r\n\r\nmodule.exports = MaxAdd;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/MaxAdd.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/MinSub.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/math/MinSub.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Subtract an `amount` from `value`, limiting the minimum result to `min`.\r\n *\r\n * @function Phaser.Math.MinSub\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to subtract from.\r\n * @param {number} amount - The amount to subtract.\r\n * @param {number} min - The minimum value to return.\r\n *\r\n * @return {number} The resulting value.\r\n */\r\nvar MinSub = function (value, amount, min)\r\n{\r\n return Math.max(value - amount, min);\r\n};\r\n\r\nmodule.exports = MinSub;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/MinSub.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Percent.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/math/Percent.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Work out what percentage `value` is of the range between `min` and `max`.\r\n * If `max` isn't given then it will return the percentage of `value` to `min`.\r\n *\r\n * You can optionally specify an `upperMax` value, which is a mid-way point in the range that represents 100%, after which the % starts to go down to zero again.\r\n *\r\n * @function Phaser.Math.Percent\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to determine the percentage of.\r\n * @param {number} min - The minimum value.\r\n * @param {number} [max] - The maximum value.\r\n * @param {number} [upperMax] - The mid-way point in the range that represents 100%.\r\n *\r\n * @return {number} A value between 0 and 1 representing the percentage.\r\n */\r\nvar Percent = function (value, min, max, upperMax)\r\n{\r\n if (max === undefined) { max = min + 1; }\r\n\r\n var percentage = (value - min) / (max - min);\r\n\r\n if (percentage > 1)\r\n {\r\n if (upperMax !== undefined)\r\n {\r\n percentage = ((upperMax - value)) / (upperMax - max);\r\n\r\n if (percentage < 0)\r\n {\r\n percentage = 0;\r\n }\r\n }\r\n else\r\n {\r\n percentage = 1;\r\n }\r\n }\r\n else if (percentage < 0)\r\n {\r\n percentage = 0;\r\n }\r\n\r\n return percentage;\r\n};\r\n\r\nmodule.exports = Percent;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Percent.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Quaternion.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/math/Quaternion.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Vector3 = __webpack_require__(/*! ./Vector3 */ \"./node_modules/phaser/src/math/Vector3.js\");\r\nvar Matrix3 = __webpack_require__(/*! ./Matrix3 */ \"./node_modules/phaser/src/math/Matrix3.js\");\r\n\r\nvar EPSILON = 0.000001;\r\n\r\n// Some shared 'private' arrays\r\nvar siNext = new Int8Array([ 1, 2, 0 ]);\r\nvar tmp = new Float32Array([ 0, 0, 0 ]);\r\n\r\nvar xUnitVec3 = new Vector3(1, 0, 0);\r\nvar yUnitVec3 = new Vector3(0, 1, 0);\r\n\r\nvar tmpvec = new Vector3();\r\nvar tmpMat3 = new Matrix3();\r\n\r\n/**\r\n * @classdesc\r\n * A quaternion.\r\n *\r\n * @class Quaternion\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x component.\r\n * @param {number} [y] - The y component.\r\n * @param {number} [z] - The z component.\r\n * @param {number} [w] - The w component.\r\n */\r\nvar Quaternion = new Class({\r\n\r\n initialize:\r\n\r\n function Quaternion (x, y, z, w)\r\n {\r\n /**\r\n * The x component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The y component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The z component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The w component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#w\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Copy the components of a given Quaternion or Vector into this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#copy\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z;\r\n this.w = src.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the components of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#set\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components.\r\n * @param {number} [y=0] - The y component.\r\n * @param {number} [z=0] - The z component.\r\n * @param {number} [w=0] - The w component.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n set: function (x, y, z, w)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Quaternion#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n add: function (v)\r\n {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z;\r\n this.w += v.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Quaternion#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n subtract: function (v)\r\n {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z;\r\n this.w -= v.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Quaternion by the given value.\r\n *\r\n * @method Phaser.Math.Quaternion#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scale - The value to scale this Quaternion by.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n scale: function (scale)\r\n {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n this.w *= scale;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the length of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Quaternion.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Quaternion squared.\r\n *\r\n * @method Phaser.Math.Quaternion#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Quaternion, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return x * x + y * y + z * z + w * w;\r\n },\r\n\r\n /**\r\n * Normalize this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n var len = x * x + y * y + z * z + w * w;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n this.z = z * len;\r\n this.w = w * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Quaternion and the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#dot\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion.\r\n *\r\n * @return {number} The dot product of this Quaternion and the given Quaternion or Vector.\r\n */\r\n dot: function (v)\r\n {\r\n return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\r\n },\r\n\r\n /**\r\n * Linearly interpolate this Quaternion towards the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards.\r\n * @param {number} [t=0] - The percentage of interpolation.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n lerp: function (v, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n this.x = ax + t * (v.x - ax);\r\n this.y = ay + t * (v.y - ay);\r\n this.z = az + t * (v.z - az);\r\n this.w = aw + t * (v.w - aw);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Math.Quaternion#rotationTo\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} a - [description]\r\n * @param {Phaser.Math.Vector3} b - [description]\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotationTo: function (a, b)\r\n {\r\n var dot = a.x * b.x + a.y * b.y + a.z * b.z;\r\n\r\n if (dot < -0.999999)\r\n {\r\n if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON)\r\n {\r\n tmpvec.copy(yUnitVec3).cross(a);\r\n }\r\n\r\n tmpvec.normalize();\r\n\r\n return this.setAxisAngle(tmpvec, Math.PI);\r\n\r\n }\r\n else if (dot > 0.999999)\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.w = 1;\r\n\r\n return this;\r\n }\r\n else\r\n {\r\n tmpvec.copy(a).cross(b);\r\n\r\n this.x = tmpvec.x;\r\n this.y = tmpvec.y;\r\n this.z = tmpvec.z;\r\n this.w = 1 + dot;\r\n\r\n return this.normalize();\r\n }\r\n },\r\n\r\n /**\r\n * Set the axes of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#setAxes\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} view - The view axis.\r\n * @param {Phaser.Math.Vector3} right - The right axis.\r\n * @param {Phaser.Math.Vector3} up - The upwards axis.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n setAxes: function (view, right, up)\r\n {\r\n var m = tmpMat3.val;\r\n\r\n m[0] = right.x;\r\n m[3] = right.y;\r\n m[6] = right.z;\r\n\r\n m[1] = up.x;\r\n m[4] = up.y;\r\n m[7] = up.z;\r\n\r\n m[2] = -view.x;\r\n m[5] = -view.y;\r\n m[8] = -view.z;\r\n\r\n return this.fromMat3(tmpMat3).normalize();\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n identity: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.w = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the axis angle of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#setAxisAngle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} axis - The axis.\r\n * @param {number} rad - The angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n setAxisAngle: function (axis, rad)\r\n {\r\n rad = rad * 0.5;\r\n\r\n var s = Math.sin(rad);\r\n\r\n this.x = s * axis.x;\r\n this.y = s * axis.y;\r\n this.z = s * axis.z;\r\n this.w = Math.cos(rad);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiply this Quaternion by the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n multiply: function (b)\r\n {\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bx = b.x;\r\n var by = b.y;\r\n var bz = b.z;\r\n var bw = b.w;\r\n\r\n this.x = ax * bw + aw * bx + ay * bz - az * by;\r\n this.y = ay * bw + aw * by + az * bx - ax * bz;\r\n this.z = az * bw + aw * bz + ax * by - ay * bx;\r\n this.w = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#slerp\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards.\r\n * @param {number} t - The percentage of interpolation.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n slerp: function (b, t)\r\n {\r\n // benchmarks: http://jsperf.com/quaternion-slerp-implementations\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bx = b.x;\r\n var by = b.y;\r\n var bz = b.z;\r\n var bw = b.w;\r\n\r\n // calc cosine\r\n var cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n\r\n // adjust signs (if necessary)\r\n if (cosom < 0)\r\n {\r\n cosom = -cosom;\r\n bx = - bx;\r\n by = - by;\r\n bz = - bz;\r\n bw = - bw;\r\n }\r\n\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n var scale0 = 1 - t;\r\n var scale1 = t;\r\n\r\n // calculate coefficients\r\n if ((1 - cosom) > EPSILON)\r\n {\r\n // standard case (slerp)\r\n var omega = Math.acos(cosom);\r\n var sinom = Math.sin(omega);\r\n\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n }\r\n\r\n // calculate final values\r\n this.x = scale0 * ax + scale1 * bx;\r\n this.y = scale0 * ay + scale1 * by;\r\n this.z = scale0 * az + scale1 * bz;\r\n this.w = scale0 * aw + scale1 * bw;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n invert: function ()\r\n {\r\n var a0 = this.x;\r\n var a1 = this.y;\r\n var a2 = this.z;\r\n var a3 = this.w;\r\n\r\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n var invDot = (dot) ? 1 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n this.x = -a0 * invDot;\r\n this.y = -a1 * invDot;\r\n this.z = -a2 * invDot;\r\n this.w = a3 * invDot;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Convert this Quaternion into its conjugate.\r\n *\r\n * Sets the x, y and z components.\r\n *\r\n * @method Phaser.Math.Quaternion#conjugate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n conjugate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n this.z = -this.z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Quaternion on the X axis.\r\n *\r\n * @method Phaser.Math.Quaternion#rotateX\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotateX: function (rad)\r\n {\r\n rad *= 0.5;\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bx = Math.sin(rad);\r\n var bw = Math.cos(rad);\r\n\r\n this.x = ax * bw + aw * bx;\r\n this.y = ay * bw + az * bx;\r\n this.z = az * bw - ay * bx;\r\n this.w = aw * bw - ax * bx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Quaternion on the Y axis.\r\n *\r\n * @method Phaser.Math.Quaternion#rotateY\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotateY: function (rad)\r\n {\r\n rad *= 0.5;\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var by = Math.sin(rad);\r\n var bw = Math.cos(rad);\r\n\r\n this.x = ax * bw - az * by;\r\n this.y = ay * bw + aw * by;\r\n this.z = az * bw + ax * by;\r\n this.w = aw * bw - ay * by;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Quaternion on the Z axis.\r\n *\r\n * @method Phaser.Math.Quaternion#rotateZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotateZ: function (rad)\r\n {\r\n rad *= 0.5;\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bz = Math.sin(rad);\r\n var bw = Math.cos(rad);\r\n\r\n this.x = ax * bw + ay * bz;\r\n this.y = ay * bw - ax * bz;\r\n this.z = az * bw + aw * bz;\r\n this.w = aw * bw - az * bz;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Create a unit (or rotation) Quaternion from its x, y, and z components.\r\n *\r\n * Sets the w component.\r\n *\r\n * @method Phaser.Math.Quaternion#calculateW\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n calculateW: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n\r\n this.w = -Math.sqrt(1.0 - x * x - y * y - z * z);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Convert the given Matrix into this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#fromMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n fromMat3: function (mat)\r\n {\r\n // benchmarks:\r\n // http://jsperf.com/typed-array-access-speed\r\n // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion\r\n\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n var m = mat.val;\r\n var fTrace = m[0] + m[4] + m[8];\r\n var fRoot;\r\n\r\n if (fTrace > 0)\r\n {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n\r\n this.w = 0.5 * fRoot;\r\n\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n\r\n this.x = (m[7] - m[5]) * fRoot;\r\n this.y = (m[2] - m[6]) * fRoot;\r\n this.z = (m[3] - m[1]) * fRoot;\r\n }\r\n else\r\n {\r\n // |w| <= 1/2\r\n var i = 0;\r\n\r\n if (m[4] > m[0])\r\n {\r\n i = 1;\r\n }\r\n\r\n if (m[8] > m[i * 3 + i])\r\n {\r\n i = 2;\r\n }\r\n\r\n var j = siNext[i];\r\n var k = siNext[j];\r\n\r\n // This isn't quite as clean without array access\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\r\n tmp[i] = 0.5 * fRoot;\r\n\r\n fRoot = 0.5 / fRoot;\r\n\r\n tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n\r\n this.x = tmp[0];\r\n this.y = tmp[1];\r\n this.z = tmp[2];\r\n this.w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Quaternion;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Quaternion.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/RadToDeg.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/math/RadToDeg.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/math/const.js\");\r\n\r\n/**\r\n * Convert the given angle in radians, to the equivalent angle in degrees.\r\n *\r\n * @function Phaser.Math.RadToDeg\r\n * @since 3.0.0\r\n *\r\n * @param {number} radians - The angle in radians to convert ot degrees.\r\n *\r\n * @return {integer} The given angle converted to degrees.\r\n */\r\nvar RadToDeg = function (radians)\r\n{\r\n return radians * CONST.RAD_TO_DEG;\r\n};\r\n\r\nmodule.exports = RadToDeg;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/RadToDeg.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/RandomXY.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/math/RandomXY.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random unit vector.\r\n *\r\n * Computes random values for the given vector between -1 and 1 that can be used to represent a direction.\r\n *\r\n * Optionally accepts a scale value to scale the resulting vector by.\r\n *\r\n * @function Phaser.Math.RandomXY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} vector - The Vector to compute random values for.\r\n * @param {number} [scale=1] - The scale of the random values.\r\n *\r\n * @return {Phaser.Math.Vector2} The given Vector.\r\n */\r\nvar RandomXY = function (vector, scale)\r\n{\r\n if (scale === undefined) { scale = 1; }\r\n\r\n var r = Math.random() * 2 * Math.PI;\r\n\r\n vector.x = Math.cos(r) * scale;\r\n vector.y = Math.sin(r) * scale;\r\n\r\n return vector;\r\n};\r\n\r\nmodule.exports = RandomXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/RandomXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/RandomXYZ.js": /*!***************************************************!*\ !*** ./node_modules/phaser/src/math/RandomXYZ.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random position vector in a spherical area, optionally defined by the given radius.\r\n *\r\n * @function Phaser.Math.RandomXYZ\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} vec3 - The Vector to compute random values for.\r\n * @param {number} [radius=1] - The radius.\r\n *\r\n * @return {Phaser.Math.Vector3} The given Vector.\r\n */\r\nvar RandomXYZ = function (vec3, radius)\r\n{\r\n if (radius === undefined) { radius = 1; }\r\n\r\n var r = Math.random() * 2 * Math.PI;\r\n var z = (Math.random() * 2) - 1;\r\n var zScale = Math.sqrt(1 - z * z) * radius;\r\n\r\n vec3.x = Math.cos(r) * zScale;\r\n vec3.y = Math.sin(r) * zScale;\r\n vec3.z = z * radius;\r\n\r\n return vec3;\r\n};\r\n\r\nmodule.exports = RandomXYZ;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/RandomXYZ.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/RandomXYZW.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/math/RandomXYZW.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random four-dimensional vector.\r\n *\r\n * @function Phaser.Math.RandomXYZW\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} vec4 - The Vector to compute random values for.\r\n * @param {number} [scale=1] - The scale of the random values.\r\n *\r\n * @return {Phaser.Math.Vector4} The given Vector.\r\n */\r\nvar RandomXYZW = function (vec4, scale)\r\n{\r\n if (scale === undefined) { scale = 1; }\r\n\r\n // TODO: Not spherical; should fix this for more uniform distribution\r\n vec4.x = (Math.random() * 2 - 1) * scale;\r\n vec4.y = (Math.random() * 2 - 1) * scale;\r\n vec4.z = (Math.random() * 2 - 1) * scale;\r\n vec4.w = (Math.random() * 2 - 1) * scale;\r\n\r\n return vec4;\r\n};\r\n\r\nmodule.exports = RandomXYZW;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/RandomXYZW.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Rotate.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/math/Rotate.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a given point by a given angle around the origin (0, 0), in an anti-clockwise direction.\r\n *\r\n * @function Phaser.Math.Rotate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\r\n * @param {number} angle - The angle to be rotated by in an anticlockwise direction.\r\n *\r\n * @return {Phaser.Geom.Point} The given point, rotated by the given angle in an anticlockwise direction.\r\n */\r\nvar Rotate = function (point, angle)\r\n{\r\n var x = point.x;\r\n var y = point.y;\r\n\r\n point.x = (x * Math.cos(angle)) - (y * Math.sin(angle));\r\n point.y = (x * Math.sin(angle)) + (y * Math.cos(angle));\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = Rotate;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Rotate.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/RotateAround.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/math/RotateAround.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a `point` around `x` and `y` by the given `angle`.\r\n *\r\n * @function Phaser.Math.RotateAround\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\r\n * @param {number} x - The horizontal coordinate to rotate around.\r\n * @param {number} y - The vertical coordinate to rotate around.\r\n * @param {number} angle - The angle of rotation in radians.\r\n *\r\n * @return {Phaser.Geom.Point} The given point, rotated by the given angle around the given coordinates.\r\n */\r\nvar RotateAround = function (point, x, y, angle)\r\n{\r\n var c = Math.cos(angle);\r\n var s = Math.sin(angle);\r\n\r\n var tx = point.x - x;\r\n var ty = point.y - y;\r\n\r\n point.x = tx * c - ty * s + x;\r\n point.y = tx * s + ty * c + y;\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = RotateAround;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/RotateAround.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/RotateAroundDistance.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/math/RotateAroundDistance.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a `point` around `x` and `y` by the given `angle` and `distance`.\r\n *\r\n * @function Phaser.Math.RotateAroundDistance\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\r\n * @param {number} x - The horizontal coordinate to rotate around.\r\n * @param {number} y - The vertical coordinate to rotate around.\r\n * @param {number} angle - The angle of rotation in radians.\r\n * @param {number} distance - The distance from (x, y) to place the point at.\r\n *\r\n * @return {Phaser.Geom.Point} The given point.\r\n */\r\nvar RotateAroundDistance = function (point, x, y, angle, distance)\r\n{\r\n var t = angle + Math.atan2(point.y - y, point.x - x);\r\n\r\n point.x = x + (distance * Math.cos(t));\r\n point.y = y + (distance * Math.sin(t));\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = RotateAroundDistance;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/RotateAroundDistance.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/RotateVec3.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/math/RotateVec3.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector3 = __webpack_require__(/*! ../math/Vector3 */ \"./node_modules/phaser/src/math/Vector3.js\");\r\nvar Matrix4 = __webpack_require__(/*! ../math/Matrix4 */ \"./node_modules/phaser/src/math/Matrix4.js\");\r\nvar Quaternion = __webpack_require__(/*! ../math/Quaternion */ \"./node_modules/phaser/src/math/Quaternion.js\");\r\n\r\nvar tmpMat4 = new Matrix4();\r\nvar tmpQuat = new Quaternion();\r\nvar tmpVec3 = new Vector3();\r\n\r\n/**\r\n * Rotates a vector in place by axis angle.\r\n *\r\n * This is the same as transforming a point by an\r\n * axis-angle quaternion, but it has higher precision.\r\n *\r\n * @function Phaser.Math.RotateVec3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} vec - The vector to be rotated.\r\n * @param {Phaser.Math.Vector3} axis - The axis to rotate around.\r\n * @param {number} radians - The angle of rotation in radians.\r\n *\r\n * @return {Phaser.Math.Vector3} The given vector.\r\n */\r\nvar RotateVec3 = function (vec, axis, radians)\r\n{\r\n // Set the quaternion to our axis angle\r\n tmpQuat.setAxisAngle(axis, radians);\r\n\r\n // Create a rotation matrix from the axis angle\r\n tmpMat4.fromRotationTranslation(tmpQuat, tmpVec3.set(0, 0, 0));\r\n\r\n // Multiply our vector by the rotation matrix\r\n return vec.transformMat4(tmpMat4);\r\n};\r\n\r\nmodule.exports = RotateVec3;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/RotateVec3.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/RoundAwayFromZero.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/math/RoundAwayFromZero.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down.\r\n *\r\n * @function Phaser.Math.RoundAwayFromZero\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The number to round.\r\n *\r\n * @return {number} The rounded number, rounded away from zero.\r\n */\r\nvar RoundAwayFromZero = function (value)\r\n{\r\n // \"Opposite\" of truncate.\r\n return (value > 0) ? Math.ceil(value) : Math.floor(value);\r\n};\r\n\r\nmodule.exports = RoundAwayFromZero;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/RoundAwayFromZero.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/RoundTo.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/math/RoundTo.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Round a value to the given precision.\r\n * \r\n * For example:\r\n * \r\n * ```javascript\r\n * RoundTo(123.456, 0) = 123\r\n * RoundTo(123.456, 1) = 120\r\n * RoundTo(123.456, 2) = 100\r\n * ```\r\n * \r\n * To round the decimal, i.e. to round to precision, pass in a negative `place`:\r\n * \r\n * ```javascript\r\n * RoundTo(123.456789, 0) = 123\r\n * RoundTo(123.456789, -1) = 123.5\r\n * RoundTo(123.456789, -2) = 123.46\r\n * RoundTo(123.456789, -3) = 123.457\r\n * ```\r\n *\r\n * @function Phaser.Math.RoundTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to round.\r\n * @param {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal.\r\n * @param {integer} [base=10] - The base to round in. Default is 10 for decimal.\r\n *\r\n * @return {number} The rounded value.\r\n */\r\nvar RoundTo = function (value, place, base)\r\n{\r\n if (place === undefined) { place = 0; }\r\n if (base === undefined) { base = 10; }\r\n\r\n var p = Math.pow(base, -place);\r\n\r\n return Math.round(value * p) / p;\r\n};\r\n\r\nmodule.exports = RoundTo;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/RoundTo.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/SinCosTableGenerator.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/math/SinCosTableGenerator.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Generate a series of sine and cosine values.\r\n *\r\n * @function Phaser.Math.SinCosTableGenerator\r\n * @since 3.0.0\r\n *\r\n * @param {number} length - The number of values to generate.\r\n * @param {number} [sinAmp=1] - The sine value amplitude.\r\n * @param {number} [cosAmp=1] - The cosine value amplitude.\r\n * @param {number} [frequency=1] - The frequency of the values.\r\n *\r\n * @return {Phaser.Types.Math.SinCosTable} The generated values.\r\n */\r\nvar SinCosTableGenerator = function (length, sinAmp, cosAmp, frequency)\r\n{\r\n if (sinAmp === undefined) { sinAmp = 1; }\r\n if (cosAmp === undefined) { cosAmp = 1; }\r\n if (frequency === undefined) { frequency = 1; }\r\n\r\n frequency *= Math.PI / length;\r\n\r\n var cos = [];\r\n var sin = [];\r\n\r\n for (var c = 0; c < length; c++)\r\n {\r\n cosAmp -= sinAmp * frequency;\r\n sinAmp += cosAmp * frequency;\r\n\r\n cos[c] = cosAmp;\r\n sin[c] = sinAmp;\r\n }\r\n\r\n return {\r\n sin: sin,\r\n cos: cos,\r\n length: length\r\n };\r\n};\r\n\r\nmodule.exports = SinCosTableGenerator;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/SinCosTableGenerator.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/SmoothStep.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/math/SmoothStep.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate a smooth interpolation percentage of `x` between `min` and `max`.\r\n *\r\n * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge,\r\n * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial,\r\n * between 0 and 1 otherwise.\r\n *\r\n * @function Phaser.Math.SmoothStep\r\n * @since 3.0.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep}\r\n *\r\n * @param {number} x - The input value.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The percentage of interpolation, between 0 and 1.\r\n */\r\nvar SmoothStep = function (x, min, max)\r\n{\r\n if (x <= min)\r\n {\r\n return 0;\r\n }\r\n\r\n if (x >= max)\r\n {\r\n return 1;\r\n }\r\n\r\n x = (x - min) / (max - min);\r\n\r\n return x * x * (3 - 2 * x);\r\n};\r\n\r\nmodule.exports = SmoothStep;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/SmoothStep.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/SmootherStep.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/math/SmootherStep.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate a smoother interpolation percentage of `x` between `min` and `max`.\r\n *\r\n * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge,\r\n * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial,\r\n * between 0 and 1 otherwise.\r\n *\r\n * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}.\r\n *\r\n * @function Phaser.Math.SmootherStep\r\n * @since 3.0.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\r\n *\r\n * @param {number} x - The input value.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The percentage of interpolation, between 0 and 1.\r\n */\r\nvar SmootherStep = function (x, min, max)\r\n{\r\n x = Math.max(0, Math.min(1, (x - min) / (max - min)));\r\n\r\n return x * x * x * (x * (x * 6 - 15) + 10);\r\n};\r\n\r\nmodule.exports = SmootherStep;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/SmootherStep.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/ToXY.js": /*!**********************************************!*\ !*** ./node_modules/phaser/src/math/ToXY.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector2 = __webpack_require__(/*! ./Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid.\r\n * \r\n * For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2.\r\n * \r\n * If the given index is out of range an empty Vector2 is returned.\r\n *\r\n * @function Phaser.Math.ToXY\r\n * @since 3.19.0\r\n *\r\n * @param {integer} index - The position within the grid to get the x/y value for.\r\n * @param {integer} width - The width of the grid.\r\n * @param {integer} height - The height of the grid.\r\n * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index.\r\n */\r\nvar ToXY = function (index, width, height, out)\r\n{\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n var x = 0;\r\n var y = 0;\r\n var total = width * height;\r\n\r\n if (index > 0 && index <= total)\r\n {\r\n if (index > width - 1)\r\n {\r\n y = Math.floor(index / width);\r\n x = index - (y * width);\r\n }\r\n else\r\n {\r\n x = index;\r\n }\r\n\r\n out.set(x, y);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = ToXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/ToXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/TransformXY.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/math/TransformXY.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector2 = __webpack_require__(/*! ./Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * Takes the `x` and `y` coordinates and transforms them into the same space as\r\n * defined by the position, rotation and scale values.\r\n *\r\n * @function Phaser.Math.TransformXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate to be transformed.\r\n * @param {number} y - The y coordinate to be transformed.\r\n * @param {number} positionX - Horizontal position of the transform point.\r\n * @param {number} positionY - Vertical position of the transform point.\r\n * @param {number} rotation - Rotation of the transform point, in radians.\r\n * @param {number} scaleX - Horizontal scale of the transform point.\r\n * @param {number} scaleY - Vertical scale of the transform point.\r\n * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates.\r\n *\r\n * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point.\r\n */\r\nvar TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output)\r\n{\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n var radianSin = Math.sin(rotation);\r\n var radianCos = Math.cos(rotation);\r\n\r\n // Rotate and Scale\r\n var a = radianCos * scaleX;\r\n var b = radianSin * scaleX;\r\n var c = -radianSin * scaleY;\r\n var d = radianCos * scaleY;\r\n\r\n // Invert\r\n var id = 1 / ((a * d) + (c * -b));\r\n\r\n output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id);\r\n output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id);\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = TransformXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/TransformXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Vector2.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/math/Vector2.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 2D space.\r\n *\r\n * A two-component vector.\r\n *\r\n * @class Vector2\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number|Phaser.Types.Math.Vector2Like} [x] - The x component, or an object with `x` and `y` properties.\r\n * @param {number} [y] - The y component.\r\n */\r\nvar Vector2 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector2 (x, y)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector2#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector2#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n }\r\n else\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector2.\r\n *\r\n * @method Phaser.Math.Vector2#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} A clone of this Vector2.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector2(this.x, this.y);\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x || 0;\r\n this.y = src.y || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the component values of this Vector from a given Vector2Like object.\r\n *\r\n * @method Phaser.Math.Vector2#setFromObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setFromObject: function (obj)\r\n {\r\n this.x = obj.x || 0;\r\n this.y = obj.y || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x` and `y` components of the this Vector to the given `x` and `y` values.\r\n *\r\n * @method Phaser.Math.Vector2#set\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x value to set for this Vector.\r\n * @param {number} [y=x] - The y value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n set: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * This method is an alias for `Vector2.set`.\r\n *\r\n * @method Phaser.Math.Vector2#setTo\r\n * @since 3.4.0\r\n *\r\n * @param {number} x - The x value to set for this Vector.\r\n * @param {number} [y=x] - The y value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setTo: function (x, y)\r\n {\r\n return this.set(x, y);\r\n },\r\n\r\n /**\r\n * Sets the `x` and `y` values of this object from a given polar coordinate.\r\n *\r\n * @method Phaser.Math.Vector2#setToPolar\r\n * @since 3.0.0\r\n *\r\n * @param {number} azimuth - The angular coordinate, in radians.\r\n * @param {number} [radius=1] - The radial coordinate (length).\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setToPolar: function (azimuth, radius)\r\n {\r\n if (radius == null) { radius = 1; }\r\n\r\n this.x = Math.cos(azimuth) * radius;\r\n this.y = Math.sin(azimuth) * radius;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict equality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector2#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} v - The vector to compare with this Vector.\r\n *\r\n * @return {boolean} Whether the given Vector is equal to this Vector.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y));\r\n },\r\n\r\n /**\r\n * Calculate the angle between this Vector and the positive x-axis, in radians.\r\n *\r\n * @method Phaser.Math.Vector2#angle\r\n * @since 3.0.0\r\n *\r\n * @return {number} The angle between this Vector, and the positive x-axis, given in radians.\r\n */\r\n angle: function ()\r\n {\r\n // computes the angle in radians with respect to the positive x-axis\r\n\r\n var angle = Math.atan2(this.y, this.x);\r\n\r\n if (angle < 0)\r\n {\r\n angle += 2 * Math.PI;\r\n }\r\n\r\n return angle;\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector2#add\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n add: function (src)\r\n {\r\n this.x += src.x;\r\n this.y += src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector2#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n subtract: function (src)\r\n {\r\n this.x -= src.x;\r\n this.y -= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n multiply: function (src)\r\n {\r\n this.x *= src.x;\r\n this.y *= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector2#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n scale: function (value)\r\n {\r\n if (isFinite(value))\r\n {\r\n this.x *= value;\r\n this.y *= value;\r\n }\r\n else\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#divide\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n divide: function (src)\r\n {\r\n this.x /= src.x;\r\n this.y /= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Negate the `x` and `y` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#distance\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (src)\r\n {\r\n var dx = src.x - this.x;\r\n var dy = src.y - this.y;\r\n\r\n return Math.sqrt(dx * dx + dy * dy);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector2#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (src)\r\n {\r\n var dx = src.x - this.x;\r\n var dy = src.y - this.y;\r\n\r\n return dx * dx + dy * dy;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n\r\n return Math.sqrt(x * x + y * y);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector2#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n\r\n return x * x + y * y;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector2#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var len = x * x + y * y;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Right-hand normalize (make unit length) this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#normalizeRightHand\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n normalizeRightHand: function ()\r\n {\r\n var x = this.x;\r\n\r\n this.x = this.y * -1;\r\n this.y = x;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to dot product with this Vector2.\r\n *\r\n * @return {number} The dot product of this Vector and the given Vector.\r\n */\r\n dot: function (src)\r\n {\r\n return this.x * src.x + this.y * src.y;\r\n },\r\n\r\n /**\r\n * Calculate the cross product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#cross\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to cross with this Vector2.\r\n *\r\n * @return {number} The cross product of this Vector and the given Vector.\r\n */\r\n cross: function (src)\r\n {\r\n return this.x * src.y - this.y * src.x;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n lerp: function (src, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n\r\n this.x = ax + t * (src.x - ax);\r\n this.y = ay + t * (src.y - ay);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector2#transformMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n transformMat3: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[3] * y + m[6];\r\n this.y = m[1] * x + m[4] * y + m[7];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector2#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[12];\r\n this.y = m[1] * x + m[5] * y + m[13];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0).\r\n *\r\n * @method Phaser.Math.Vector2#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * A static zero Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.ZERO\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.1.0\r\n */\r\nVector2.ZERO = new Vector2();\r\n\r\n/**\r\n * A static right Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.RIGHT\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.RIGHT = new Vector2(1, 0);\r\n\r\n/**\r\n * A static left Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.LEFT\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.LEFT = new Vector2(-1, 0);\r\n\r\n/**\r\n * A static up Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.UP\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.UP = new Vector2(0, -1);\r\n\r\n/**\r\n * A static down Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.DOWN\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.DOWN = new Vector2(0, 1);\r\n\r\n/**\r\n * A static one Vector2 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.ONE\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.ONE = new Vector2(1, 1);\r\n\r\nmodule.exports = Vector2;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Vector2.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Vector3.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/math/Vector3.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 3D space.\r\n *\r\n * A three-component vector.\r\n *\r\n * @class Vector3\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x component.\r\n * @param {number} [y] - The y component.\r\n * @param {number} [z] - The z component.\r\n */\r\nvar Vector3 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector3 (x, y, z)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector3#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector3#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n /**\r\n * The z component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector3#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.z = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Set this Vector to point up.\r\n *\r\n * Sets the y component of the vector to 1, and the others to 0.\r\n *\r\n * @method Phaser.Math.Vector3#up\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n up: function ()\r\n {\r\n this.x = 0;\r\n this.y = 1;\r\n this.z = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector3.\r\n *\r\n * @method Phaser.Math.Vector3#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector3(this.x, this.y, this.z);\r\n },\r\n\r\n /**\r\n * Calculate the cross (vector) product of two given Vectors.\r\n *\r\n * @method Phaser.Math.Vector3#crossVectors\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} a - The first Vector to multiply.\r\n * @param {Phaser.Math.Vector3} b - The second Vector to multiply.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n crossVectors: function (a, b)\r\n {\r\n var ax = a.x;\r\n var ay = a.y;\r\n var az = a.z;\r\n var bx = b.x;\r\n var by = b.y;\r\n var bz = b.z;\r\n\r\n this.x = ay * bz - az * by;\r\n this.y = az * bx - ax * bz;\r\n this.z = ax * by - ay * bx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict equality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector3#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector3 to compare against.\r\n *\r\n * @return {boolean} True if the two vectors strictly match, otherwise false.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z));\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector3#copy\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values.\r\n *\r\n * @method Phaser.Math.Vector3#set\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components.\r\n * @param {number} [y] - The y value to set for this Vector.\r\n * @param {number} [z] - The z value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n set: function (x, y, z)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector3#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n add: function (v)\r\n {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector3#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n subtract: function (v)\r\n {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n multiply: function (v)\r\n {\r\n this.x *= v.x;\r\n this.y *= v.y;\r\n this.z *= v.z || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector3#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scale - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n scale: function (scale)\r\n {\r\n if (isFinite(scale))\r\n {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n }\r\n else\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#divide\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n divide: function (v)\r\n {\r\n this.x /= v.x;\r\n this.y /= v.y;\r\n this.z /= v.z || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Negate the `x`, `y` and `z` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector3#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n this.z = -this.z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#distance\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n\r\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector3#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n\r\n return dx * dx + dy * dy + dz * dz;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector3#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n\r\n return Math.sqrt(x * x + y * y + z * z);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector3#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n\r\n return x * x + y * y + z * z;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector3#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var len = x * x + y * y + z * z;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n this.z = z * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3.\r\n *\r\n * @return {number} The dot product of this Vector and `v`.\r\n */\r\n dot: function (v)\r\n {\r\n return this.x * v.x + this.y * v.y + this.z * v.z;\r\n },\r\n\r\n /**\r\n * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#cross\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector to cross product with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n cross: function (v)\r\n {\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var bx = v.x;\r\n var by = v.y;\r\n var bz = v.z;\r\n\r\n this.x = ay * bz - az * by;\r\n this.y = az * bx - ax * bz;\r\n this.z = ax * by - ay * bx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n lerp: function (v, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n\r\n this.x = ax + t * (v.x - ax);\r\n this.y = ay + t * (v.y - ay);\r\n this.z = az + t * (v.z - az);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector3#transformMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformMat3: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n this.x = x * m[0] + y * m[3] + z * m[6];\r\n this.y = x * m[1] + y * m[4] + z * m[7];\r\n this.z = x * m[2] + y * m[5] + z * m[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector3#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[8] * z + m[12];\r\n this.y = m[1] * x + m[5] * y + m[9] * z + m[13];\r\n this.z = m[2] * x + m[6] * y + m[10] * z + m[14];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transforms the coordinates of this Vector3 with the given Matrix4.\r\n *\r\n * @method Phaser.Math.Vector3#transformCoordinates\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformCoordinates: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12];\r\n var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13];\r\n var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14];\r\n var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15];\r\n\r\n this.x = tx / tw;\r\n this.y = ty / tw;\r\n this.z = tz / tw;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Quaternion.\r\n *\r\n * @method Phaser.Math.Vector3#transformQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformQuat: function (q)\r\n {\r\n // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var qx = q.x;\r\n var qy = q.y;\r\n var qz = q.z;\r\n var qw = q.w;\r\n\r\n // calculate quat * vec\r\n var ix = qw * x + qy * z - qz * y;\r\n var iy = qw * y + qz * x - qx * z;\r\n var iz = qw * z + qx * y - qy * x;\r\n var iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection,\r\n * e.g. unprojecting a 2D point into 3D space.\r\n *\r\n * @method Phaser.Math.Vector3#project\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n project: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n var a00 = m[0];\r\n var a01 = m[1];\r\n var a02 = m[2];\r\n var a03 = m[3];\r\n var a10 = m[4];\r\n var a11 = m[5];\r\n var a12 = m[6];\r\n var a13 = m[7];\r\n var a20 = m[8];\r\n var a21 = m[9];\r\n var a22 = m[10];\r\n var a23 = m[11];\r\n var a30 = m[12];\r\n var a31 = m[13];\r\n var a32 = m[14];\r\n var a33 = m[15];\r\n\r\n var lw = 1 / (x * a03 + y * a13 + z * a23 + a33);\r\n\r\n this.x = (x * a00 + y * a10 + z * a20 + a30) * lw;\r\n this.y = (x * a01 + y * a11 + z * a21 + a31) * lw;\r\n this.z = (x * a02 + y * a12 + z * a22 + a32) * lw;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Unproject this point from 2D space to 3D space.\r\n * The point should have its x and y properties set to\r\n * 2D screen space, and the z either at 0 (near plane)\r\n * or 1 (far plane). The provided matrix is assumed to already\r\n * be combined, i.e. projection * view * model.\r\n *\r\n * After this operation, this vector's (x, y, z) components will\r\n * represent the unprojected 3D coordinate.\r\n *\r\n * @method Phaser.Math.Vector3#unproject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels.\r\n * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n unproject: function (viewport, invProjectionView)\r\n {\r\n var viewX = viewport.x;\r\n var viewY = viewport.y;\r\n var viewWidth = viewport.z;\r\n var viewHeight = viewport.w;\r\n\r\n var x = this.x - viewX;\r\n var y = (viewHeight - this.y - 1) - viewY;\r\n var z = this.z;\r\n\r\n this.x = (2 * x) / viewWidth - 1;\r\n this.y = (2 * y) / viewHeight - 1;\r\n this.z = 2 * z - 1;\r\n\r\n return this.project(invProjectionView);\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0, 0).\r\n *\r\n * @method Phaser.Math.Vector3#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * A static zero Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.ZERO\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.ZERO = new Vector3();\r\n\r\n/**\r\n * A static right Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.RIGHT\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.RIGHT = new Vector3(1, 0, 0);\r\n\r\n/**\r\n * A static left Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.LEFT\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.LEFT = new Vector3(-1, 0, 0);\r\n\r\n/**\r\n * A static up Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.UP\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.UP = new Vector3(0, -1, 0);\r\n\r\n/**\r\n * A static down Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.DOWN\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.DOWN = new Vector3(0, 1, 0);\r\n\r\n/**\r\n * A static forward Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.FORWARD\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.FORWARD = new Vector3(0, 0, 1);\r\n\r\n/**\r\n * A static back Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.BACK\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.BACK = new Vector3(0, 0, -1);\r\n\r\n/**\r\n * A static one Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.ONE\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.ONE = new Vector3(1, 1, 1);\r\n\r\nmodule.exports = Vector3;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Vector3.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Vector4.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/math/Vector4.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 4D space.\r\n *\r\n * A four-component vector.\r\n *\r\n * @class Vector4\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x component.\r\n * @param {number} [y] - The y component.\r\n * @param {number} [z] - The z component.\r\n * @param {number} [w] - The w component.\r\n */\r\nvar Vector4 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector4 (x, y, z, w)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n /**\r\n * The z component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.z = 0;\r\n\r\n /**\r\n * The w component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#w\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.w = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector4.\r\n *\r\n * @method Phaser.Math.Vector4#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} A clone of this Vector4.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector4(this.x, this.y, this.z, this.w);\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector4#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z || 0;\r\n this.w = src.w || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict quality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector4#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} v - The vector to check equality with.\r\n *\r\n * @return {boolean} A boolean indicating whether the two Vectors are equal or not.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z) && (this.w === v.w));\r\n },\r\n\r\n /**\r\n * Set the `x`, `y`, `z` and `w` components of the this Vector to the given `x`, `y`, `z` and `w` values.\r\n *\r\n * @method Phaser.Math.Vector4#set\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y, z and w components.\r\n * @param {number} y - The y value to set for this Vector.\r\n * @param {number} z - The z value to set for this Vector.\r\n * @param {number} w - The z value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n set: function (x, y, z, w)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector4#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n add: function (v)\r\n {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z || 0;\r\n this.w += v.w || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector4#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n subtract: function (v)\r\n {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z || 0;\r\n this.w -= v.w || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector4#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scale - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n scale: function (scale)\r\n {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n this.w *= scale;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector4#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector4#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return x * x + y * y + z * z + w * w;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector4#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n var len = x * x + y * y + z * z + w * w;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n this.z = z * len;\r\n this.w = w * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} v - The Vector4 to dot product with this Vector4.\r\n *\r\n * @return {number} The dot product of this Vector and the given Vector.\r\n */\r\n dot: function (v)\r\n {\r\n return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} v - The Vector4 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n lerp: function (v, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n this.x = ax + t * (v.x - ax);\r\n this.y = ay + t * (v.y - ay);\r\n this.z = az + t * (v.z - az);\r\n this.w = aw + t * (v.w - aw);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n multiply: function (v)\r\n {\r\n this.x *= v.x;\r\n this.y *= v.y;\r\n this.z *= v.z || 1;\r\n this.w *= v.w || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#divide\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n divide: function (v)\r\n {\r\n this.x /= v.x;\r\n this.y /= v.y;\r\n this.z /= v.z || 1;\r\n this.w /= v.w || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#distance\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n var dw = v.w - this.w || 0;\r\n\r\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector4#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n var dw = v.w - this.w || 0;\r\n\r\n return dx * dx + dy * dy + dz * dz + dw * dw;\r\n },\r\n\r\n /**\r\n * Negate the `x`, `y`, `z` and `w` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector4#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n this.z = -this.z;\r\n this.w = -this.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector4#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector4 with.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n this.y = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n this.z = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n this.w = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Quaternion.\r\n *\r\n * @method Phaser.Math.Vector4#transformQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n transformQuat: function (q)\r\n {\r\n // TODO: is this really the same as Vector3?\r\n // Also, what about this: http://molecularmusings.wordpress.com/2013/05/24/a-faster-quaternion-vector-multiplication/\r\n // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var qx = q.x;\r\n var qy = q.y;\r\n var qz = q.z;\r\n var qw = q.w;\r\n\r\n // calculate quat * vec\r\n var ix = qw * x + qy * z - qz * y;\r\n var iy = qw * y + qz * x - qx * z;\r\n var iz = qw * z + qx * y - qy * x;\r\n var iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0, 0, 0).\r\n *\r\n * @method Phaser.Math.Vector4#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.w = 0;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\n// TODO: Check if these are required internally, if not, remove.\r\nVector4.prototype.sub = Vector4.prototype.subtract;\r\nVector4.prototype.mul = Vector4.prototype.multiply;\r\nVector4.prototype.div = Vector4.prototype.divide;\r\nVector4.prototype.dist = Vector4.prototype.distance;\r\nVector4.prototype.distSq = Vector4.prototype.distanceSq;\r\nVector4.prototype.len = Vector4.prototype.length;\r\nVector4.prototype.lenSq = Vector4.prototype.lengthSq;\r\n\r\nmodule.exports = Vector4;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Vector4.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Within.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/math/Within.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if the two values are within the given `tolerance` of each other.\r\n *\r\n * @function Phaser.Math.Within\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value to use in the calculation.\r\n * @param {number} b - The second value to use in the calculation.\r\n * @param {number} tolerance - The tolerance. Anything equal to or less than this value is considered as being within range.\r\n *\r\n * @return {boolean} Returns `true` if `a` is less than or equal to the tolerance of `b`.\r\n */\r\nvar Within = function (a, b, tolerance)\r\n{\r\n return (Math.abs(a - b) <= tolerance);\r\n};\r\n\r\nmodule.exports = Within;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Within.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/Wrap.js": /*!**********************************************!*\ !*** ./node_modules/phaser/src/math/Wrap.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Wrap the given `value` between `min` and `max.\r\n *\r\n * @function Phaser.Math.Wrap\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to wrap.\r\n * @param {number} min - The minimum value.\r\n * @param {number} max - The maximum value.\r\n *\r\n * @return {number} The wrapped value.\r\n */\r\nvar Wrap = function (value, min, max)\r\n{\r\n var range = max - min;\r\n\r\n return (min + ((((value - min) % range) + range) % range));\r\n};\r\n\r\nmodule.exports = Wrap;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/Wrap.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/angle/Between.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/math/angle/Between.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (x1, y1) -> (x2, y2).\r\n *\r\n * @function Phaser.Math.Angle.Between\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar Between = function (x1, y1, x2, y2)\r\n{\r\n return Math.atan2(y2 - y1, x2 - x1);\r\n};\r\n\r\nmodule.exports = Between;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/angle/Between.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/angle/BetweenPoints.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/math/angle/BetweenPoints.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).\r\n *\r\n * Calculates the angle of the vector from the first point to the second point.\r\n *\r\n * @function Phaser.Math.Angle.BetweenPoints\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point1 - The first point.\r\n * @param {(Phaser.Geom.Point|object)} point2 - The second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar BetweenPoints = function (point1, point2)\r\n{\r\n return Math.atan2(point2.y - point1.y, point2.x - point1.x);\r\n};\r\n\r\nmodule.exports = BetweenPoints;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/angle/BetweenPoints.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/angle/BetweenPointsY.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/math/angle/BetweenPointsY.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).\r\n *\r\n * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate\r\n * travels down the screen.\r\n *\r\n * @function Phaser.Math.Angle.BetweenPointsY\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point1 - The first point.\r\n * @param {(Phaser.Geom.Point|object)} point2 - The second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar BetweenPointsY = function (point1, point2)\r\n{\r\n return Math.atan2(point2.x - point1.x, point2.y - point1.y);\r\n};\r\n\r\nmodule.exports = BetweenPointsY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/angle/BetweenPointsY.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/angle/BetweenY.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/math/angle/BetweenY.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (x1, y1) -> (x2, y2).\r\n *\r\n * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate\r\n * travels down the screen.\r\n *\r\n * @function Phaser.Math.Angle.BetweenY\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar BetweenY = function (x1, y1, x2, y2)\r\n{\r\n return Math.atan2(x2 - x1, y2 - y1);\r\n};\r\n\r\nmodule.exports = BetweenY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/angle/BetweenY.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/angle/CounterClockwise.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/math/angle/CounterClockwise.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/math/const.js\");\r\n\r\n/**\r\n * Takes an angle in Phasers default clockwise format and converts it so that\r\n * 0 is North, 90 is West, 180 is South and 270 is East,\r\n * therefore running counter-clockwise instead of clockwise.\r\n * \r\n * You can pass in the angle from a Game Object using:\r\n * \r\n * ```javascript\r\n * var converted = CounterClockwise(gameobject.rotation);\r\n * ```\r\n * \r\n * All values for this function are in radians.\r\n *\r\n * @function Phaser.Math.Angle.CounterClockwise\r\n * @since 3.16.0\r\n *\r\n * @param {number} angle - The angle to convert, in radians.\r\n *\r\n * @return {number} The converted angle, in radians.\r\n */\r\nvar CounterClockwise = function (angle)\r\n{\r\n if (angle > Math.PI)\r\n {\r\n angle -= CONST.PI2;\r\n }\r\n\r\n return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2);\r\n};\r\n\r\nmodule.exports = CounterClockwise;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/angle/CounterClockwise.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/angle/Normalize.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/math/angle/Normalize.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Normalize an angle to the [0, 2pi] range.\r\n *\r\n * @function Phaser.Math.Angle.Normalize\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to normalize, in radians.\r\n *\r\n * @return {number} The normalized angle, in radians.\r\n */\r\nvar Normalize = function (angle)\r\n{\r\n angle = angle % (2 * Math.PI);\r\n\r\n if (angle >= 0)\r\n {\r\n return angle;\r\n }\r\n else\r\n {\r\n return angle + 2 * Math.PI;\r\n }\r\n};\r\n\r\nmodule.exports = Normalize;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/angle/Normalize.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/angle/Reverse.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/math/angle/Reverse.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Normalize = __webpack_require__(/*! ./Normalize */ \"./node_modules/phaser/src/math/angle/Normalize.js\");\r\n\r\n/**\r\n * Reverse the given angle.\r\n *\r\n * @function Phaser.Math.Angle.Reverse\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to reverse, in radians.\r\n *\r\n * @return {number} The reversed angle, in radians.\r\n */\r\nvar Reverse = function (angle)\r\n{\r\n return Normalize(angle + Math.PI);\r\n};\r\n\r\nmodule.exports = Reverse;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/angle/Reverse.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/angle/RotateTo.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/math/angle/RotateTo.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/math/const.js\");\r\n\r\n/**\r\n * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call.\r\n *\r\n * @function Phaser.Math.Angle.RotateTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} currentAngle - The current angle, in radians.\r\n * @param {number} targetAngle - The target angle to rotate to, in radians.\r\n * @param {number} [lerp=0.05] - The lerp value to add to the current angle.\r\n *\r\n * @return {number} The adjusted angle.\r\n */\r\nvar RotateTo = function (currentAngle, targetAngle, lerp)\r\n{\r\n if (lerp === undefined) { lerp = 0.05; }\r\n\r\n if (currentAngle === targetAngle)\r\n {\r\n return currentAngle;\r\n }\r\n\r\n if (Math.abs(targetAngle - currentAngle) <= lerp || Math.abs(targetAngle - currentAngle) >= (MATH_CONST.PI2 - lerp))\r\n {\r\n currentAngle = targetAngle;\r\n }\r\n else\r\n {\r\n if (Math.abs(targetAngle - currentAngle) > Math.PI)\r\n {\r\n if (targetAngle < currentAngle)\r\n {\r\n targetAngle += MATH_CONST.PI2;\r\n }\r\n else\r\n {\r\n targetAngle -= MATH_CONST.PI2;\r\n }\r\n }\r\n\r\n if (targetAngle > currentAngle)\r\n {\r\n currentAngle += lerp;\r\n }\r\n else if (targetAngle < currentAngle)\r\n {\r\n currentAngle -= lerp;\r\n }\r\n }\r\n\r\n return currentAngle;\r\n};\r\n\r\nmodule.exports = RotateTo;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/angle/RotateTo.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/angle/ShortestBetween.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/math/angle/ShortestBetween.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Gets the shortest angle between `angle1` and `angle2`.\r\n *\r\n * Both angles must be in the range -180 to 180, which is the same clamped\r\n * range that `sprite.angle` uses, so you can pass in two sprite angles to\r\n * this method and get the shortest angle back between the two of them.\r\n *\r\n * The angle returned will be in the same range. If the returned angle is\r\n * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's\r\n * a clockwise rotation.\r\n *\r\n * TODO: Wrap the angles in this function?\r\n *\r\n * @function Phaser.Math.Angle.ShortestBetween\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle1 - The first angle in the range -180 to 180.\r\n * @param {number} angle2 - The second angle in the range -180 to 180.\r\n *\r\n * @return {number} The shortest angle, in degrees. If greater than zero it's a counter-clockwise rotation.\r\n */\r\nvar ShortestBetween = function (angle1, angle2)\r\n{\r\n var difference = angle2 - angle1;\r\n\r\n if (difference === 0)\r\n {\r\n return 0;\r\n }\r\n\r\n var times = Math.floor((difference - (-180)) / 360);\r\n\r\n return difference - (times * 360);\r\n\r\n};\r\n\r\nmodule.exports = ShortestBetween;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/angle/ShortestBetween.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/angle/Wrap.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/math/angle/Wrap.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MathWrap = __webpack_require__(/*! ../Wrap */ \"./node_modules/phaser/src/math/Wrap.js\");\r\n\r\n/**\r\n * Wrap an angle.\r\n *\r\n * Wraps the angle to a value in the range of -PI to PI.\r\n *\r\n * @function Phaser.Math.Angle.Wrap\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to wrap, in radians.\r\n *\r\n * @return {number} The wrapped angle, in radians.\r\n */\r\nvar Wrap = function (angle)\r\n{\r\n return MathWrap(angle, -Math.PI, Math.PI);\r\n};\r\n\r\nmodule.exports = Wrap;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/angle/Wrap.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/angle/WrapDegrees.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/math/angle/WrapDegrees.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Wrap = __webpack_require__(/*! ../Wrap */ \"./node_modules/phaser/src/math/Wrap.js\");\r\n\r\n/**\r\n * Wrap an angle in degrees.\r\n *\r\n * Wraps the angle to a value in the range of -180 to 180.\r\n *\r\n * @function Phaser.Math.Angle.WrapDegrees\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to wrap, in degrees.\r\n *\r\n * @return {number} The wrapped angle, in degrees.\r\n */\r\nvar WrapDegrees = function (angle)\r\n{\r\n return Wrap(angle, -180, 180);\r\n};\r\n\r\nmodule.exports = WrapDegrees;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/angle/WrapDegrees.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/angle/index.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/math/angle/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Angle\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Between: __webpack_require__(/*! ./Between */ \"./node_modules/phaser/src/math/angle/Between.js\"),\r\n BetweenPoints: __webpack_require__(/*! ./BetweenPoints */ \"./node_modules/phaser/src/math/angle/BetweenPoints.js\"),\r\n BetweenPointsY: __webpack_require__(/*! ./BetweenPointsY */ \"./node_modules/phaser/src/math/angle/BetweenPointsY.js\"),\r\n BetweenY: __webpack_require__(/*! ./BetweenY */ \"./node_modules/phaser/src/math/angle/BetweenY.js\"),\r\n CounterClockwise: __webpack_require__(/*! ./CounterClockwise */ \"./node_modules/phaser/src/math/angle/CounterClockwise.js\"),\r\n Normalize: __webpack_require__(/*! ./Normalize */ \"./node_modules/phaser/src/math/angle/Normalize.js\"),\r\n Reverse: __webpack_require__(/*! ./Reverse */ \"./node_modules/phaser/src/math/angle/Reverse.js\"),\r\n RotateTo: __webpack_require__(/*! ./RotateTo */ \"./node_modules/phaser/src/math/angle/RotateTo.js\"),\r\n ShortestBetween: __webpack_require__(/*! ./ShortestBetween */ \"./node_modules/phaser/src/math/angle/ShortestBetween.js\"),\r\n Wrap: __webpack_require__(/*! ./Wrap */ \"./node_modules/phaser/src/math/angle/Wrap.js\"),\r\n WrapDegrees: __webpack_require__(/*! ./WrapDegrees */ \"./node_modules/phaser/src/math/angle/WrapDegrees.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/angle/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/const.js": /*!***********************************************!*\ !*** ./node_modules/phaser/src/math/const.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = {\r\n\r\n /**\r\n * The value of PI * 2.\r\n * \r\n * @name Phaser.Math.PI2\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n PI2: Math.PI * 2,\r\n\r\n /**\r\n * The value of PI * 0.5.\r\n * \r\n * @name Phaser.Math.TAU\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n TAU: Math.PI * 0.5,\r\n\r\n /**\r\n * An epsilon value (1.0e-6)\r\n * \r\n * @name Phaser.Math.EPSILON\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n EPSILON: 1.0e-6,\r\n\r\n /**\r\n * For converting degrees to radians (PI / 180)\r\n * \r\n * @name Phaser.Math.DEG_TO_RAD\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n DEG_TO_RAD: Math.PI / 180,\r\n\r\n /**\r\n * For converting radians to degrees (180 / PI)\r\n * \r\n * @name Phaser.Math.RAD_TO_DEG\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n RAD_TO_DEG: 180 / Math.PI,\r\n\r\n /**\r\n * An instance of the Random Number Generator.\r\n * This is not set until the Game boots.\r\n * \r\n * @name Phaser.Math.RND\r\n * @type {Phaser.Math.RandomDataGenerator}\r\n * @since 3.0.0\r\n */\r\n RND: null,\r\n\r\n /**\r\n * The minimum safe integer this browser supports.\r\n * We use a const for backward compatibility with Internet Explorer.\r\n * \r\n * @name Phaser.Math.MIN_SAFE_INTEGER\r\n * @type {number}\r\n * @since 3.21.0\r\n */\r\n MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER || -9007199254740991,\r\n\r\n /**\r\n * The maximum safe integer this browser supports.\r\n * We use a const for backward compatibility with Internet Explorer.\r\n * \r\n * @name Phaser.Math.MAX_SAFE_INTEGER\r\n * @type {number}\r\n * @since 3.21.0\r\n */\r\n MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER || 9007199254740991\r\n\r\n};\r\n\r\nmodule.exports = MATH_CONST;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/const.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/distance/DistanceBetween.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/math/distance/DistanceBetween.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two sets of coordinates (points).\r\n *\r\n * @function Phaser.Math.Distance.Between\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The distance between each point.\r\n */\r\nvar DistanceBetween = function (x1, y1, x2, y2)\r\n{\r\n var dx = x1 - x2;\r\n var dy = y1 - y2;\r\n\r\n return Math.sqrt(dx * dx + dy * dy);\r\n};\r\n\r\nmodule.exports = DistanceBetween;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/distance/DistanceBetween.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/distance/DistanceBetweenPoints.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/math/distance/DistanceBetweenPoints.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author samme\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two points.\r\n *\r\n * @function Phaser.Math.Distance.BetweenPoints\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Math.Vector2Like} a - The first point.\r\n * @param {Phaser.Types.Math.Vector2Like} b - The second point.\r\n *\r\n * @return {number} The distance between the points.\r\n */\r\nvar DistanceBetweenPoints = function (a, b)\r\n{\r\n var dx = a.x - b.x;\r\n var dy = a.y - b.y;\r\n\r\n return Math.sqrt(dx * dx + dy * dy);\r\n};\r\n\r\nmodule.exports = DistanceBetweenPoints;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/distance/DistanceBetweenPoints.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/distance/DistanceBetweenPointsSquared.js": /*!*******************************************************************************!*\ !*** ./node_modules/phaser/src/math/distance/DistanceBetweenPointsSquared.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author samme\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the squared distance between two points.\r\n *\r\n * @function Phaser.Math.Distance.BetweenPointsSquared\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Math.Vector2Like} a - The first point.\r\n * @param {Phaser.Types.Math.Vector2Like} b - The second point.\r\n *\r\n * @return {number} The squared distance between the points.\r\n */\r\nvar DistanceBetweenPointsSquared = function (a, b)\r\n{\r\n var dx = a.x - b.x;\r\n var dy = a.y - b.y;\r\n\r\n return dx * dx + dy * dy;\r\n};\r\n\r\nmodule.exports = DistanceBetweenPointsSquared;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/distance/DistanceBetweenPointsSquared.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/distance/DistanceChebyshev.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/math/distance/DistanceChebyshev.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author samme\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the Chebyshev distance between two sets of coordinates (points).\r\n *\r\n * Chebyshev distance (or chessboard distance) is the maximum of the horizontal and vertical distances.\r\n * It's the effective distance when movement can be horizontal, vertical, or diagonal.\r\n *\r\n * @function Phaser.Math.Distance.Chebyshev\r\n * @since 3.22.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The distance between each point.\r\n */\r\nvar ChebyshevDistance = function (x1, y1, x2, y2)\r\n{\r\n return Math.max(Math.abs(x1 - x2), Math.abs(y1 - y2));\r\n};\r\n\r\nmodule.exports = ChebyshevDistance;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/distance/DistanceChebyshev.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/distance/DistancePower.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/math/distance/DistancePower.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two sets of coordinates (points) to the power of `pow`.\r\n *\r\n * @function Phaser.Math.Distance.Power\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n * @param {number} pow - The exponent.\r\n *\r\n * @return {number} The distance between each point.\r\n */\r\nvar DistancePower = function (x1, y1, x2, y2, pow)\r\n{\r\n if (pow === undefined) { pow = 2; }\r\n\r\n return Math.sqrt(Math.pow(x2 - x1, pow) + Math.pow(y2 - y1, pow));\r\n};\r\n\r\nmodule.exports = DistancePower;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/distance/DistancePower.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/distance/DistanceSnake.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/math/distance/DistanceSnake.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author samme\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the snake distance between two sets of coordinates (points).\r\n *\r\n * Snake distance (rectilinear distance, Manhattan distance) is the sum of the horizontal and vertical distances.\r\n * It's the effective distance when movement is allowed only horizontally or vertically (but not both).\r\n *\r\n * @function Phaser.Math.Distance.Snake\r\n * @since 3.22.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The distance between each point.\r\n */\r\nvar SnakeDistance = function (x1, y1, x2, y2)\r\n{\r\n return Math.abs(x1 - x2) + Math.abs(y1 - y2);\r\n};\r\n\r\nmodule.exports = SnakeDistance;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/distance/DistanceSnake.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/distance/DistanceSquared.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/math/distance/DistanceSquared.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two sets of coordinates (points), squared.\r\n *\r\n * @function Phaser.Math.Distance.Squared\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The distance between each point, squared.\r\n */\r\nvar DistanceSquared = function (x1, y1, x2, y2)\r\n{\r\n var dx = x1 - x2;\r\n var dy = y1 - y2;\r\n\r\n return dx * dx + dy * dy;\r\n};\r\n\r\nmodule.exports = DistanceSquared;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/distance/DistanceSquared.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/distance/index.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/math/distance/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Distance\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Between: __webpack_require__(/*! ./DistanceBetween */ \"./node_modules/phaser/src/math/distance/DistanceBetween.js\"),\r\n BetweenPoints: __webpack_require__(/*! ./DistanceBetweenPoints */ \"./node_modules/phaser/src/math/distance/DistanceBetweenPoints.js\"),\r\n BetweenPointsSquared: __webpack_require__(/*! ./DistanceBetweenPointsSquared */ \"./node_modules/phaser/src/math/distance/DistanceBetweenPointsSquared.js\"),\r\n Chebyshev: __webpack_require__(/*! ./DistanceChebyshev */ \"./node_modules/phaser/src/math/distance/DistanceChebyshev.js\"),\r\n Power: __webpack_require__(/*! ./DistancePower */ \"./node_modules/phaser/src/math/distance/DistancePower.js\"),\r\n Snake: __webpack_require__(/*! ./DistanceSnake */ \"./node_modules/phaser/src/math/distance/DistanceSnake.js\"),\r\n Squared: __webpack_require__(/*! ./DistanceSquared */ \"./node_modules/phaser/src/math/distance/DistanceSquared.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/distance/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/EaseMap.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/EaseMap.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Back = __webpack_require__(/*! ./back */ \"./node_modules/phaser/src/math/easing/back/index.js\");\r\nvar Bounce = __webpack_require__(/*! ./bounce */ \"./node_modules/phaser/src/math/easing/bounce/index.js\");\r\nvar Circular = __webpack_require__(/*! ./circular */ \"./node_modules/phaser/src/math/easing/circular/index.js\");\r\nvar Cubic = __webpack_require__(/*! ./cubic */ \"./node_modules/phaser/src/math/easing/cubic/index.js\");\r\nvar Elastic = __webpack_require__(/*! ./elastic */ \"./node_modules/phaser/src/math/easing/elastic/index.js\");\r\nvar Expo = __webpack_require__(/*! ./expo */ \"./node_modules/phaser/src/math/easing/expo/index.js\");\r\nvar Linear = __webpack_require__(/*! ./linear */ \"./node_modules/phaser/src/math/easing/linear/index.js\");\r\nvar Quadratic = __webpack_require__(/*! ./quadratic */ \"./node_modules/phaser/src/math/easing/quadratic/index.js\");\r\nvar Quartic = __webpack_require__(/*! ./quartic */ \"./node_modules/phaser/src/math/easing/quartic/index.js\");\r\nvar Quintic = __webpack_require__(/*! ./quintic */ \"./node_modules/phaser/src/math/easing/quintic/index.js\");\r\nvar Sine = __webpack_require__(/*! ./sine */ \"./node_modules/phaser/src/math/easing/sine/index.js\");\r\nvar Stepped = __webpack_require__(/*! ./stepped */ \"./node_modules/phaser/src/math/easing/stepped/index.js\");\r\n\r\n// EaseMap\r\nmodule.exports = {\r\n\r\n Power0: Linear,\r\n Power1: Quadratic.Out,\r\n Power2: Cubic.Out,\r\n Power3: Quartic.Out,\r\n Power4: Quintic.Out,\r\n\r\n Linear: Linear,\r\n Quad: Quadratic.Out,\r\n Cubic: Cubic.Out,\r\n Quart: Quartic.Out,\r\n Quint: Quintic.Out,\r\n Sine: Sine.Out,\r\n Expo: Expo.Out,\r\n Circ: Circular.Out,\r\n Elastic: Elastic.Out,\r\n Back: Back.Out,\r\n Bounce: Bounce.Out,\r\n Stepped: Stepped,\r\n\r\n 'Quad.easeIn': Quadratic.In,\r\n 'Cubic.easeIn': Cubic.In,\r\n 'Quart.easeIn': Quartic.In,\r\n 'Quint.easeIn': Quintic.In,\r\n 'Sine.easeIn': Sine.In,\r\n 'Expo.easeIn': Expo.In,\r\n 'Circ.easeIn': Circular.In,\r\n 'Elastic.easeIn': Elastic.In,\r\n 'Back.easeIn': Back.In,\r\n 'Bounce.easeIn': Bounce.In,\r\n\r\n 'Quad.easeOut': Quadratic.Out,\r\n 'Cubic.easeOut': Cubic.Out,\r\n 'Quart.easeOut': Quartic.Out,\r\n 'Quint.easeOut': Quintic.Out,\r\n 'Sine.easeOut': Sine.Out,\r\n 'Expo.easeOut': Expo.Out,\r\n 'Circ.easeOut': Circular.Out,\r\n 'Elastic.easeOut': Elastic.Out,\r\n 'Back.easeOut': Back.Out,\r\n 'Bounce.easeOut': Bounce.Out,\r\n\r\n 'Quad.easeInOut': Quadratic.InOut,\r\n 'Cubic.easeInOut': Cubic.InOut,\r\n 'Quart.easeInOut': Quartic.InOut,\r\n 'Quint.easeInOut': Quintic.InOut,\r\n 'Sine.easeInOut': Sine.InOut,\r\n 'Expo.easeInOut': Expo.InOut,\r\n 'Circ.easeInOut': Circular.InOut,\r\n 'Elastic.easeInOut': Elastic.InOut,\r\n 'Back.easeInOut': Back.InOut,\r\n 'Bounce.easeInOut': Bounce.InOut\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/EaseMap.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/back/In.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/back/In.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Back ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Back.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [overshoot=1.70158] - The overshoot amount.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v, overshoot)\r\n{\r\n if (overshoot === undefined) { overshoot = 1.70158; }\r\n\r\n return v * v * ((overshoot + 1) * v - overshoot);\r\n};\r\n\r\nmodule.exports = In;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/back/In.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/back/InOut.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/back/InOut.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Back ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Back.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [overshoot=1.70158] - The overshoot amount.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v, overshoot)\r\n{\r\n if (overshoot === undefined) { overshoot = 1.70158; }\r\n\r\n var s = overshoot * 1.525;\r\n\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * (v * v * ((s + 1) * v - s));\r\n }\r\n else\r\n {\r\n return 0.5 * ((v -= 2) * v * ((s + 1) * v + s) + 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/back/InOut.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/back/Out.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/back/Out.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Back ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Back.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [overshoot=1.70158] - The overshoot amount.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v, overshoot)\r\n{\r\n if (overshoot === undefined) { overshoot = 1.70158; }\r\n\r\n return --v * v * ((overshoot + 1) * v + overshoot) + 1;\r\n};\r\n\r\nmodule.exports = Out;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/back/Out.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/back/index.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/back/index.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Back\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: __webpack_require__(/*! ./In */ \"./node_modules/phaser/src/math/easing/back/In.js\"),\r\n Out: __webpack_require__(/*! ./Out */ \"./node_modules/phaser/src/math/easing/back/Out.js\"),\r\n InOut: __webpack_require__(/*! ./InOut */ \"./node_modules/phaser/src/math/easing/back/InOut.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/back/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/bounce/In.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/bounce/In.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Bounce ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Bounce.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n v = 1 - v;\r\n\r\n if (v < 1 / 2.75)\r\n {\r\n return 1 - (7.5625 * v * v);\r\n }\r\n else if (v < 2 / 2.75)\r\n {\r\n return 1 - (7.5625 * (v -= 1.5 / 2.75) * v + 0.75);\r\n }\r\n else if (v < 2.5 / 2.75)\r\n {\r\n return 1 - (7.5625 * (v -= 2.25 / 2.75) * v + 0.9375);\r\n }\r\n else\r\n {\r\n return 1 - (7.5625 * (v -= 2.625 / 2.75) * v + 0.984375);\r\n }\r\n};\r\n\r\nmodule.exports = In;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/bounce/In.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/bounce/InOut.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/bounce/InOut.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Bounce ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Bounce.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n var reverse = false;\r\n\r\n if (v < 0.5)\r\n {\r\n v = 1 - (v * 2);\r\n reverse = true;\r\n }\r\n else\r\n {\r\n v = (v * 2) - 1;\r\n }\r\n\r\n if (v < 1 / 2.75)\r\n {\r\n v = 7.5625 * v * v;\r\n }\r\n else if (v < 2 / 2.75)\r\n {\r\n v = 7.5625 * (v -= 1.5 / 2.75) * v + 0.75;\r\n }\r\n else if (v < 2.5 / 2.75)\r\n {\r\n v = 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375;\r\n }\r\n else\r\n {\r\n v = 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375;\r\n }\r\n\r\n if (reverse)\r\n {\r\n return (1 - v) * 0.5;\r\n }\r\n else\r\n {\r\n return v * 0.5 + 0.5;\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/bounce/InOut.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/bounce/Out.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/bounce/Out.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Bounce ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Bounce.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n if (v < 1 / 2.75)\r\n {\r\n return 7.5625 * v * v;\r\n }\r\n else if (v < 2 / 2.75)\r\n {\r\n return 7.5625 * (v -= 1.5 / 2.75) * v + 0.75;\r\n }\r\n else if (v < 2.5 / 2.75)\r\n {\r\n return 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375;\r\n }\r\n else\r\n {\r\n return 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375;\r\n }\r\n};\r\n\r\nmodule.exports = Out;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/bounce/Out.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/bounce/index.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/bounce/index.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Bounce\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: __webpack_require__(/*! ./In */ \"./node_modules/phaser/src/math/easing/bounce/In.js\"),\r\n Out: __webpack_require__(/*! ./Out */ \"./node_modules/phaser/src/math/easing/bounce/Out.js\"),\r\n InOut: __webpack_require__(/*! ./InOut */ \"./node_modules/phaser/src/math/easing/bounce/InOut.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/bounce/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/circular/In.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/circular/In.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Circular ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Circular.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return 1 - Math.sqrt(1 - v * v);\r\n};\r\n\r\nmodule.exports = In;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/circular/In.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/circular/InOut.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/circular/InOut.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Circular ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Circular.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return -0.5 * (Math.sqrt(1 - v * v) - 1);\r\n }\r\n else\r\n {\r\n return 0.5 * (Math.sqrt(1 - (v -= 2) * v) + 1);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/circular/InOut.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/circular/Out.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/circular/Out.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Circular ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Circular.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return Math.sqrt(1 - (--v * v));\r\n};\r\n\r\nmodule.exports = Out;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/circular/Out.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/circular/index.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/circular/index.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Circular\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: __webpack_require__(/*! ./In */ \"./node_modules/phaser/src/math/easing/circular/In.js\"),\r\n Out: __webpack_require__(/*! ./Out */ \"./node_modules/phaser/src/math/easing/circular/Out.js\"),\r\n InOut: __webpack_require__(/*! ./InOut */ \"./node_modules/phaser/src/math/easing/circular/InOut.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/circular/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/cubic/In.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/cubic/In.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Cubic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Cubic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/cubic/In.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/cubic/InOut.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/cubic/InOut.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Cubic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Cubic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v * v;\r\n }\r\n else\r\n {\r\n return 0.5 * ((v -= 2) * v * v + 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/cubic/InOut.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/cubic/Out.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/cubic/Out.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Cubic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Cubic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return --v * v * v + 1;\r\n};\r\n\r\nmodule.exports = Out;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/cubic/Out.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/cubic/index.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/cubic/index.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Cubic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: __webpack_require__(/*! ./In */ \"./node_modules/phaser/src/math/easing/cubic/In.js\"),\r\n Out: __webpack_require__(/*! ./Out */ \"./node_modules/phaser/src/math/easing/cubic/Out.js\"),\r\n InOut: __webpack_require__(/*! ./InOut */ \"./node_modules/phaser/src/math/easing/cubic/InOut.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/cubic/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/elastic/In.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/elastic/In.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Elastic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Elastic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\r\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v, amplitude, period)\r\n{\r\n if (amplitude === undefined) { amplitude = 0.1; }\r\n if (period === undefined) { period = 0.1; }\r\n\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n var s = period / 4;\r\n\r\n if (amplitude < 1)\r\n {\r\n amplitude = 1;\r\n }\r\n else\r\n {\r\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\r\n }\r\n\r\n return -(amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period));\r\n }\r\n};\r\n\r\nmodule.exports = In;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/elastic/In.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/elastic/InOut.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/elastic/InOut.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Elastic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Elastic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\r\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v, amplitude, period)\r\n{\r\n if (amplitude === undefined) { amplitude = 0.1; }\r\n if (period === undefined) { period = 0.1; }\r\n\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n var s = period / 4;\r\n\r\n if (amplitude < 1)\r\n {\r\n amplitude = 1;\r\n }\r\n else\r\n {\r\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\r\n }\r\n\r\n if ((v *= 2) < 1)\r\n {\r\n return -0.5 * (amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period));\r\n }\r\n else\r\n {\r\n return amplitude * Math.pow(2, -10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period) * 0.5 + 1;\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/elastic/InOut.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/elastic/Out.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/elastic/Out.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Elastic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Elastic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\r\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v, amplitude, period)\r\n{\r\n if (amplitude === undefined) { amplitude = 0.1; }\r\n if (period === undefined) { period = 0.1; }\r\n\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n var s = period / 4;\r\n\r\n if (amplitude < 1)\r\n {\r\n amplitude = 1;\r\n }\r\n else\r\n {\r\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\r\n }\r\n\r\n return (amplitude * Math.pow(2, -10 * v) * Math.sin((v - s) * (2 * Math.PI) / period) + 1);\r\n }\r\n};\r\n\r\nmodule.exports = Out;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/elastic/Out.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/elastic/index.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/elastic/index.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Elastic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: __webpack_require__(/*! ./In */ \"./node_modules/phaser/src/math/easing/elastic/In.js\"),\r\n Out: __webpack_require__(/*! ./Out */ \"./node_modules/phaser/src/math/easing/elastic/Out.js\"),\r\n InOut: __webpack_require__(/*! ./InOut */ \"./node_modules/phaser/src/math/easing/elastic/InOut.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/elastic/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/expo/In.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/expo/In.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Exponential ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Expo.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return Math.pow(2, 10 * (v - 1)) - 0.001;\r\n};\r\n\r\nmodule.exports = In;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/expo/In.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/expo/InOut.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/expo/InOut.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Exponential ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Expo.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * Math.pow(2, 10 * (v - 1));\r\n }\r\n else\r\n {\r\n return 0.5 * (2 - Math.pow(2, -10 * (v - 1)));\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/expo/InOut.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/expo/Out.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/expo/Out.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Exponential ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Expo.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return 1 - Math.pow(2, -10 * v);\r\n};\r\n\r\nmodule.exports = Out;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/expo/Out.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/expo/index.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/expo/index.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Expo\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: __webpack_require__(/*! ./In */ \"./node_modules/phaser/src/math/easing/expo/In.js\"),\r\n Out: __webpack_require__(/*! ./Out */ \"./node_modules/phaser/src/math/easing/expo/Out.js\"),\r\n InOut: __webpack_require__(/*! ./InOut */ \"./node_modules/phaser/src/math/easing/expo/InOut.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/expo/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/index.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/math/easing/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Back: __webpack_require__(/*! ./back */ \"./node_modules/phaser/src/math/easing/back/index.js\"),\r\n Bounce: __webpack_require__(/*! ./bounce */ \"./node_modules/phaser/src/math/easing/bounce/index.js\"),\r\n Circular: __webpack_require__(/*! ./circular */ \"./node_modules/phaser/src/math/easing/circular/index.js\"),\r\n Cubic: __webpack_require__(/*! ./cubic */ \"./node_modules/phaser/src/math/easing/cubic/index.js\"),\r\n Elastic: __webpack_require__(/*! ./elastic */ \"./node_modules/phaser/src/math/easing/elastic/index.js\"),\r\n Expo: __webpack_require__(/*! ./expo */ \"./node_modules/phaser/src/math/easing/expo/index.js\"),\r\n Linear: __webpack_require__(/*! ./linear */ \"./node_modules/phaser/src/math/easing/linear/index.js\"),\r\n Quadratic: __webpack_require__(/*! ./quadratic */ \"./node_modules/phaser/src/math/easing/quadratic/index.js\"),\r\n Quartic: __webpack_require__(/*! ./quartic */ \"./node_modules/phaser/src/math/easing/quartic/index.js\"),\r\n Quintic: __webpack_require__(/*! ./quintic */ \"./node_modules/phaser/src/math/easing/quintic/index.js\"),\r\n Sine: __webpack_require__(/*! ./sine */ \"./node_modules/phaser/src/math/easing/sine/index.js\"),\r\n Stepped: __webpack_require__(/*! ./stepped */ \"./node_modules/phaser/src/math/easing/stepped/index.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/linear/Linear.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/linear/Linear.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Linear easing (no variation).\r\n *\r\n * @function Phaser.Math.Easing.Linear.Linear\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Linear = function (v)\r\n{\r\n return v;\r\n};\r\n\r\nmodule.exports = Linear;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/linear/Linear.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/linear/index.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/linear/index.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Linear\r\n */\r\n\r\nmodule.exports = __webpack_require__(/*! ./Linear */ \"./node_modules/phaser/src/math/easing/linear/Linear.js\");\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/linear/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/quadratic/In.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/quadratic/In.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quadratic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Quadratic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/quadratic/In.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/quadratic/InOut.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/quadratic/InOut.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quadratic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Quadratic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v;\r\n }\r\n else\r\n {\r\n return -0.5 * (--v * (v - 2) - 1);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/quadratic/InOut.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/quadratic/Out.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/quadratic/Out.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quadratic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Quadratic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return v * (2 - v);\r\n};\r\n\r\nmodule.exports = Out;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/quadratic/Out.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/quadratic/index.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/quadratic/index.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Quadratic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: __webpack_require__(/*! ./In */ \"./node_modules/phaser/src/math/easing/quadratic/In.js\"),\r\n Out: __webpack_require__(/*! ./Out */ \"./node_modules/phaser/src/math/easing/quadratic/Out.js\"),\r\n InOut: __webpack_require__(/*! ./InOut */ \"./node_modules/phaser/src/math/easing/quadratic/InOut.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/quadratic/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/quartic/In.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/quartic/In.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quartic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Quartic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v * v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/quartic/In.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/quartic/InOut.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/quartic/InOut.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quartic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Quartic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v * v * v;\r\n }\r\n else\r\n {\r\n return -0.5 * ((v -= 2) * v * v * v - 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/quartic/InOut.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/quartic/Out.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/quartic/Out.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quartic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Quartic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return 1 - (--v * v * v * v);\r\n};\r\n\r\nmodule.exports = Out;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/quartic/Out.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/quartic/index.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/quartic/index.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Quartic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: __webpack_require__(/*! ./In */ \"./node_modules/phaser/src/math/easing/quartic/In.js\"),\r\n Out: __webpack_require__(/*! ./Out */ \"./node_modules/phaser/src/math/easing/quartic/Out.js\"),\r\n InOut: __webpack_require__(/*! ./InOut */ \"./node_modules/phaser/src/math/easing/quartic/InOut.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/quartic/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/quintic/In.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/quintic/In.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quintic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Quintic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v * v * v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/quintic/In.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/quintic/InOut.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/quintic/InOut.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quintic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Quintic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v * v * v * v;\r\n }\r\n else\r\n {\r\n return 0.5 * ((v -= 2) * v * v * v * v + 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/quintic/InOut.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/quintic/Out.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/quintic/Out.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quintic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Quintic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return --v * v * v * v * v + 1;\r\n};\r\n\r\nmodule.exports = Out;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/quintic/Out.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/quintic/index.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/quintic/index.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Quintic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: __webpack_require__(/*! ./In */ \"./node_modules/phaser/src/math/easing/quintic/In.js\"),\r\n Out: __webpack_require__(/*! ./Out */ \"./node_modules/phaser/src/math/easing/quintic/Out.js\"),\r\n InOut: __webpack_require__(/*! ./InOut */ \"./node_modules/phaser/src/math/easing/quintic/InOut.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/quintic/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/sine/In.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/sine/In.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sinusoidal ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Sine.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return 1 - Math.cos(v * Math.PI / 2);\r\n }\r\n};\r\n\r\nmodule.exports = In;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/sine/In.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/sine/InOut.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/sine/InOut.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sinusoidal ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Sine.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return 0.5 * (1 - Math.cos(Math.PI * v));\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/sine/InOut.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/sine/Out.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/sine/Out.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sinusoidal ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Sine.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return Math.sin(v * Math.PI / 2);\r\n }\r\n};\r\n\r\nmodule.exports = Out;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/sine/Out.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/sine/index.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/math/easing/sine/index.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Sine\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: __webpack_require__(/*! ./In */ \"./node_modules/phaser/src/math/easing/sine/In.js\"),\r\n Out: __webpack_require__(/*! ./Out */ \"./node_modules/phaser/src/math/easing/sine/Out.js\"),\r\n InOut: __webpack_require__(/*! ./InOut */ \"./node_modules/phaser/src/math/easing/sine/InOut.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/sine/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/stepped/Stepped.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/stepped/Stepped.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Stepped easing.\r\n *\r\n * @function Phaser.Math.Easing.Stepped.Stepped\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [steps=1] - The number of steps in the ease.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Stepped = function (v, steps)\r\n{\r\n if (steps === undefined) { steps = 1; }\r\n\r\n if (v <= 0)\r\n {\r\n return 0;\r\n }\r\n else if (v >= 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return (((steps * v) | 0) + 1) * (1 / steps);\r\n }\r\n};\r\n\r\nmodule.exports = Stepped;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/stepped/Stepped.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/easing/stepped/index.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/math/easing/stepped/index.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Stepped\r\n */\r\n\r\nmodule.exports = __webpack_require__(/*! ./Stepped */ \"./node_modules/phaser/src/math/easing/stepped/Stepped.js\");\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/easing/stepped/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/fuzzy/Ceil.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/math/fuzzy/Ceil.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the fuzzy ceiling of the given value.\r\n *\r\n * @function Phaser.Math.Fuzzy.Ceil\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {number} The fuzzy ceiling of the value.\r\n */\r\nvar Ceil = function (value, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return Math.ceil(value - epsilon);\r\n};\r\n\r\nmodule.exports = Ceil;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/fuzzy/Ceil.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/fuzzy/Equal.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/math/fuzzy/Equal.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check whether the given values are fuzzily equal.\r\n *\r\n * Two numbers are fuzzily equal if their difference is less than `epsilon`.\r\n *\r\n * @function Phaser.Math.Fuzzy.Equal\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value.\r\n * @param {number} b - The second value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`.\r\n */\r\nvar Equal = function (a, b, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return Math.abs(a - b) < epsilon;\r\n};\r\n\r\nmodule.exports = Equal;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/fuzzy/Equal.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/fuzzy/Floor.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/math/fuzzy/Floor.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the fuzzy floor of the given value.\r\n *\r\n * @function Phaser.Math.Fuzzy.Floor\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {number} The floor of the value.\r\n */\r\nvar Floor = function (value, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return Math.floor(value + epsilon);\r\n};\r\n\r\nmodule.exports = Floor;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/fuzzy/Floor.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/fuzzy/GreaterThan.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/math/fuzzy/GreaterThan.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check whether `a` is fuzzily greater than `b`.\r\n *\r\n * `a` is fuzzily greater than `b` if it is more than `b - epsilon`.\r\n *\r\n * @function Phaser.Math.Fuzzy.GreaterThan\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value.\r\n * @param {number} b - The second value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {boolean} `true` if `a` is fuzzily greater than than `b`, otherwise `false`.\r\n */\r\nvar GreaterThan = function (a, b, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return a > b - epsilon;\r\n};\r\n\r\nmodule.exports = GreaterThan;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/fuzzy/GreaterThan.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/fuzzy/LessThan.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/math/fuzzy/LessThan.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check whether `a` is fuzzily less than `b`.\r\n *\r\n * `a` is fuzzily less than `b` if it is less than `b + epsilon`.\r\n *\r\n * @function Phaser.Math.Fuzzy.LessThan\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value.\r\n * @param {number} b - The second value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {boolean} `true` if `a` is fuzzily less than `b`, otherwise `false`.\r\n */\r\nvar LessThan = function (a, b, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return a < b + epsilon;\r\n};\r\n\r\nmodule.exports = LessThan;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/fuzzy/LessThan.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/fuzzy/index.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/math/fuzzy/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Fuzzy\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Ceil: __webpack_require__(/*! ./Ceil */ \"./node_modules/phaser/src/math/fuzzy/Ceil.js\"),\r\n Equal: __webpack_require__(/*! ./Equal */ \"./node_modules/phaser/src/math/fuzzy/Equal.js\"),\r\n Floor: __webpack_require__(/*! ./Floor */ \"./node_modules/phaser/src/math/fuzzy/Floor.js\"),\r\n GreaterThan: __webpack_require__(/*! ./GreaterThan */ \"./node_modules/phaser/src/math/fuzzy/GreaterThan.js\"),\r\n LessThan: __webpack_require__(/*! ./LessThan */ \"./node_modules/phaser/src/math/fuzzy/LessThan.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/fuzzy/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/index.js": /*!***********************************************!*\ !*** ./node_modules/phaser/src/math/index.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/math/const.js\");\r\nvar Extend = __webpack_require__(/*! ../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\n\r\n/**\r\n * @namespace Phaser.Math\r\n */\r\n\r\nvar PhaserMath = {\r\n\r\n // Collections of functions\r\n Angle: __webpack_require__(/*! ./angle/ */ \"./node_modules/phaser/src/math/angle/index.js\"),\r\n Distance: __webpack_require__(/*! ./distance/ */ \"./node_modules/phaser/src/math/distance/index.js\"),\r\n Easing: __webpack_require__(/*! ./easing/ */ \"./node_modules/phaser/src/math/easing/index.js\"),\r\n Fuzzy: __webpack_require__(/*! ./fuzzy/ */ \"./node_modules/phaser/src/math/fuzzy/index.js\"),\r\n Interpolation: __webpack_require__(/*! ./interpolation/ */ \"./node_modules/phaser/src/math/interpolation/index.js\"),\r\n Pow2: __webpack_require__(/*! ./pow2/ */ \"./node_modules/phaser/src/math/pow2/index.js\"),\r\n Snap: __webpack_require__(/*! ./snap/ */ \"./node_modules/phaser/src/math/snap/index.js\"),\r\n\r\n // Expose the RNG Class\r\n RandomDataGenerator: __webpack_require__(/*! ./random-data-generator/RandomDataGenerator */ \"./node_modules/phaser/src/math/random-data-generator/RandomDataGenerator.js\"),\r\n\r\n // Single functions\r\n Average: __webpack_require__(/*! ./Average */ \"./node_modules/phaser/src/math/Average.js\"),\r\n Bernstein: __webpack_require__(/*! ./Bernstein */ \"./node_modules/phaser/src/math/Bernstein.js\"),\r\n Between: __webpack_require__(/*! ./Between */ \"./node_modules/phaser/src/math/Between.js\"),\r\n CatmullRom: __webpack_require__(/*! ./CatmullRom */ \"./node_modules/phaser/src/math/CatmullRom.js\"),\r\n CeilTo: __webpack_require__(/*! ./CeilTo */ \"./node_modules/phaser/src/math/CeilTo.js\"),\r\n Clamp: __webpack_require__(/*! ./Clamp */ \"./node_modules/phaser/src/math/Clamp.js\"),\r\n DegToRad: __webpack_require__(/*! ./DegToRad */ \"./node_modules/phaser/src/math/DegToRad.js\"),\r\n Difference: __webpack_require__(/*! ./Difference */ \"./node_modules/phaser/src/math/Difference.js\"),\r\n Factorial: __webpack_require__(/*! ./Factorial */ \"./node_modules/phaser/src/math/Factorial.js\"),\r\n FloatBetween: __webpack_require__(/*! ./FloatBetween */ \"./node_modules/phaser/src/math/FloatBetween.js\"),\r\n FloorTo: __webpack_require__(/*! ./FloorTo */ \"./node_modules/phaser/src/math/FloorTo.js\"),\r\n FromPercent: __webpack_require__(/*! ./FromPercent */ \"./node_modules/phaser/src/math/FromPercent.js\"),\r\n GetSpeed: __webpack_require__(/*! ./GetSpeed */ \"./node_modules/phaser/src/math/GetSpeed.js\"),\r\n IsEven: __webpack_require__(/*! ./IsEven */ \"./node_modules/phaser/src/math/IsEven.js\"),\r\n IsEvenStrict: __webpack_require__(/*! ./IsEvenStrict */ \"./node_modules/phaser/src/math/IsEvenStrict.js\"),\r\n Linear: __webpack_require__(/*! ./Linear */ \"./node_modules/phaser/src/math/Linear.js\"),\r\n MaxAdd: __webpack_require__(/*! ./MaxAdd */ \"./node_modules/phaser/src/math/MaxAdd.js\"),\r\n MinSub: __webpack_require__(/*! ./MinSub */ \"./node_modules/phaser/src/math/MinSub.js\"),\r\n Percent: __webpack_require__(/*! ./Percent */ \"./node_modules/phaser/src/math/Percent.js\"),\r\n RadToDeg: __webpack_require__(/*! ./RadToDeg */ \"./node_modules/phaser/src/math/RadToDeg.js\"),\r\n RandomXY: __webpack_require__(/*! ./RandomXY */ \"./node_modules/phaser/src/math/RandomXY.js\"),\r\n RandomXYZ: __webpack_require__(/*! ./RandomXYZ */ \"./node_modules/phaser/src/math/RandomXYZ.js\"),\r\n RandomXYZW: __webpack_require__(/*! ./RandomXYZW */ \"./node_modules/phaser/src/math/RandomXYZW.js\"),\r\n Rotate: __webpack_require__(/*! ./Rotate */ \"./node_modules/phaser/src/math/Rotate.js\"),\r\n RotateAround: __webpack_require__(/*! ./RotateAround */ \"./node_modules/phaser/src/math/RotateAround.js\"),\r\n RotateAroundDistance: __webpack_require__(/*! ./RotateAroundDistance */ \"./node_modules/phaser/src/math/RotateAroundDistance.js\"),\r\n RoundAwayFromZero: __webpack_require__(/*! ./RoundAwayFromZero */ \"./node_modules/phaser/src/math/RoundAwayFromZero.js\"),\r\n RoundTo: __webpack_require__(/*! ./RoundTo */ \"./node_modules/phaser/src/math/RoundTo.js\"),\r\n SinCosTableGenerator: __webpack_require__(/*! ./SinCosTableGenerator */ \"./node_modules/phaser/src/math/SinCosTableGenerator.js\"),\r\n SmootherStep: __webpack_require__(/*! ./SmootherStep */ \"./node_modules/phaser/src/math/SmootherStep.js\"),\r\n SmoothStep: __webpack_require__(/*! ./SmoothStep */ \"./node_modules/phaser/src/math/SmoothStep.js\"),\r\n ToXY: __webpack_require__(/*! ./ToXY */ \"./node_modules/phaser/src/math/ToXY.js\"),\r\n TransformXY: __webpack_require__(/*! ./TransformXY */ \"./node_modules/phaser/src/math/TransformXY.js\"),\r\n Within: __webpack_require__(/*! ./Within */ \"./node_modules/phaser/src/math/Within.js\"),\r\n Wrap: __webpack_require__(/*! ./Wrap */ \"./node_modules/phaser/src/math/Wrap.js\"),\r\n\r\n // Vector classes\r\n Vector2: __webpack_require__(/*! ./Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\"),\r\n Vector3: __webpack_require__(/*! ./Vector3 */ \"./node_modules/phaser/src/math/Vector3.js\"),\r\n Vector4: __webpack_require__(/*! ./Vector4 */ \"./node_modules/phaser/src/math/Vector4.js\"),\r\n Matrix3: __webpack_require__(/*! ./Matrix3 */ \"./node_modules/phaser/src/math/Matrix3.js\"),\r\n Matrix4: __webpack_require__(/*! ./Matrix4 */ \"./node_modules/phaser/src/math/Matrix4.js\"),\r\n Quaternion: __webpack_require__(/*! ./Quaternion */ \"./node_modules/phaser/src/math/Quaternion.js\"),\r\n RotateVec3: __webpack_require__(/*! ./RotateVec3 */ \"./node_modules/phaser/src/math/RotateVec3.js\")\r\n\r\n};\r\n\r\n// Merge in the consts\r\n\r\nPhaserMath = Extend(false, PhaserMath, CONST);\r\n\r\n// Export it\r\n\r\nmodule.exports = PhaserMath;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/interpolation/BezierInterpolation.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/math/interpolation/BezierInterpolation.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Bernstein = __webpack_require__(/*! ../Bernstein */ \"./node_modules/phaser/src/math/Bernstein.js\");\r\n\r\n/**\r\n * A bezier interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.Bezier\r\n * @since 3.0.0\r\n *\r\n * @param {number[]} v - The input array of values to interpolate between.\r\n * @param {number} k - The percentage of interpolation, between 0 and 1.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar BezierInterpolation = function (v, k)\r\n{\r\n var b = 0;\r\n var n = v.length - 1;\r\n\r\n for (var i = 0; i <= n; i++)\r\n {\r\n b += Math.pow(1 - k, n - i) * Math.pow(k, i) * v[i] * Bernstein(n, i);\r\n }\r\n\r\n return b;\r\n};\r\n\r\nmodule.exports = BezierInterpolation;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/interpolation/BezierInterpolation.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/interpolation/CatmullRomInterpolation.js": /*!*******************************************************************************!*\ !*** ./node_modules/phaser/src/math/interpolation/CatmullRomInterpolation.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CatmullRom = __webpack_require__(/*! ../CatmullRom */ \"./node_modules/phaser/src/math/CatmullRom.js\");\r\n\r\n/**\r\n * A Catmull-Rom interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.CatmullRom\r\n * @since 3.0.0\r\n *\r\n * @param {number[]} v - The input array of values to interpolate between.\r\n * @param {number} k - The percentage of interpolation, between 0 and 1.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar CatmullRomInterpolation = function (v, k)\r\n{\r\n var m = v.length - 1;\r\n var f = m * k;\r\n var i = Math.floor(f);\r\n\r\n if (v[0] === v[m])\r\n {\r\n if (k < 0)\r\n {\r\n i = Math.floor(f = m * (1 + k));\r\n }\r\n\r\n return CatmullRom(f - i, v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m]);\r\n }\r\n else\r\n {\r\n if (k < 0)\r\n {\r\n return v[0] - (CatmullRom(-f, v[0], v[0], v[1], v[1]) - v[0]);\r\n }\r\n\r\n if (k > 1)\r\n {\r\n return v[m] - (CatmullRom(f - m, v[m], v[m], v[m - 1], v[m - 1]) - v[m]);\r\n }\r\n\r\n return CatmullRom(f - i, v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2]);\r\n }\r\n};\r\n\r\nmodule.exports = CatmullRomInterpolation;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/interpolation/CatmullRomInterpolation.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/interpolation/CubicBezierInterpolation.js": /*!********************************************************************************!*\ !*** ./node_modules/phaser/src/math/interpolation/CubicBezierInterpolation.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P0 (t, p)\r\n{\r\n var k = 1 - t;\r\n\r\n return k * k * k * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P1 (t, p)\r\n{\r\n var k = 1 - t;\r\n\r\n return 3 * k * k * t * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P2 (t, p)\r\n{\r\n return 3 * (1 - t) * t * t * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P3 (t, p)\r\n{\r\n return t * t * t * p;\r\n}\r\n\r\n/**\r\n * A cubic bezier interpolation method.\r\n *\r\n * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a\r\n *\r\n * @function Phaser.Math.Interpolation.CubicBezier\r\n * @since 3.0.0\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} p0 - The start point.\r\n * @param {number} p1 - The first control point.\r\n * @param {number} p2 - The second control point.\r\n * @param {number} p3 - The end point.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar CubicBezierInterpolation = function (t, p0, p1, p2, p3)\r\n{\r\n return P0(t, p0) + P1(t, p1) + P2(t, p2) + P3(t, p3);\r\n};\r\n\r\nmodule.exports = CubicBezierInterpolation;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/interpolation/CubicBezierInterpolation.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/interpolation/LinearInterpolation.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/math/interpolation/LinearInterpolation.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Linear = __webpack_require__(/*! ../Linear */ \"./node_modules/phaser/src/math/Linear.js\");\r\n\r\n/**\r\n * A linear interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.Linear\r\n * @since 3.0.0\r\n * @see {@link https://en.wikipedia.org/wiki/Linear_interpolation}\r\n *\r\n * @param {number[]} v - The input array of values to interpolate between.\r\n * @param {!number} k - The percentage of interpolation, between 0 and 1.\r\n *\r\n * @return {!number} The interpolated value.\r\n */\r\nvar LinearInterpolation = function (v, k)\r\n{\r\n var m = v.length - 1;\r\n var f = m * k;\r\n var i = Math.floor(f);\r\n\r\n if (k < 0)\r\n {\r\n return Linear(v[0], v[1], f);\r\n }\r\n else if (k > 1)\r\n {\r\n return Linear(v[m], v[m - 1], m - f);\r\n }\r\n else\r\n {\r\n return Linear(v[i], v[(i + 1 > m) ? m : i + 1], f - i);\r\n }\r\n};\r\n\r\nmodule.exports = LinearInterpolation;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/interpolation/LinearInterpolation.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/interpolation/QuadraticBezierInterpolation.js": /*!************************************************************************************!*\ !*** ./node_modules/phaser/src/math/interpolation/QuadraticBezierInterpolation.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P0 (t, p)\r\n{\r\n var k = 1 - t;\r\n\r\n return k * k * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P1 (t, p)\r\n{\r\n return 2 * (1 - t) * t * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P2 (t, p)\r\n{\r\n return t * t * p;\r\n}\r\n\r\n// https://github.com/mrdoob/three.js/blob/master/src/extras/core/Interpolations.js\r\n\r\n/**\r\n * A quadratic bezier interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.QuadraticBezier\r\n * @since 3.2.0\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} p0 - The start point.\r\n * @param {number} p1 - The control point.\r\n * @param {number} p2 - The end point.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar QuadraticBezierInterpolation = function (t, p0, p1, p2)\r\n{\r\n return P0(t, p0) + P1(t, p1) + P2(t, p2);\r\n};\r\n\r\nmodule.exports = QuadraticBezierInterpolation;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/interpolation/QuadraticBezierInterpolation.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/interpolation/SmoothStepInterpolation.js": /*!*******************************************************************************!*\ !*** ./node_modules/phaser/src/math/interpolation/SmoothStepInterpolation.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SmoothStep = __webpack_require__(/*! ../SmoothStep */ \"./node_modules/phaser/src/math/SmoothStep.js\");\r\n\r\n/**\r\n * A Smooth Step interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.SmoothStep\r\n * @since 3.9.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep}\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar SmoothStepInterpolation = function (t, min, max)\r\n{\r\n return min + (max - min) * SmoothStep(t, 0, 1);\r\n};\r\n\r\nmodule.exports = SmoothStepInterpolation;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/interpolation/SmoothStepInterpolation.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/interpolation/SmootherStepInterpolation.js": /*!*********************************************************************************!*\ !*** ./node_modules/phaser/src/math/interpolation/SmootherStepInterpolation.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SmootherStep = __webpack_require__(/*! ../SmootherStep */ \"./node_modules/phaser/src/math/SmootherStep.js\");\r\n\r\n/**\r\n * A Smoother Step interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.SmootherStep\r\n * @since 3.9.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar SmootherStepInterpolation = function (t, min, max)\r\n{\r\n return min + (max - min) * SmootherStep(t, 0, 1);\r\n};\r\n\r\nmodule.exports = SmootherStepInterpolation;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/interpolation/SmootherStepInterpolation.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/interpolation/index.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/math/interpolation/index.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Interpolation\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Bezier: __webpack_require__(/*! ./BezierInterpolation */ \"./node_modules/phaser/src/math/interpolation/BezierInterpolation.js\"),\r\n CatmullRom: __webpack_require__(/*! ./CatmullRomInterpolation */ \"./node_modules/phaser/src/math/interpolation/CatmullRomInterpolation.js\"),\r\n CubicBezier: __webpack_require__(/*! ./CubicBezierInterpolation */ \"./node_modules/phaser/src/math/interpolation/CubicBezierInterpolation.js\"),\r\n Linear: __webpack_require__(/*! ./LinearInterpolation */ \"./node_modules/phaser/src/math/interpolation/LinearInterpolation.js\"),\r\n QuadraticBezier: __webpack_require__(/*! ./QuadraticBezierInterpolation */ \"./node_modules/phaser/src/math/interpolation/QuadraticBezierInterpolation.js\"),\r\n SmoothStep: __webpack_require__(/*! ./SmoothStepInterpolation */ \"./node_modules/phaser/src/math/interpolation/SmoothStepInterpolation.js\"),\r\n SmootherStep: __webpack_require__(/*! ./SmootherStepInterpolation */ \"./node_modules/phaser/src/math/interpolation/SmootherStepInterpolation.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/interpolation/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/pow2/GetPowerOfTwo.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/math/pow2/GetPowerOfTwo.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns the nearest power of 2 to the given `value`.\r\n *\r\n * @function Phaser.Math.Pow2.GetNext\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value.\r\n *\r\n * @return {integer} The nearest power of 2 to `value`.\r\n */\r\nvar GetPowerOfTwo = function (value)\r\n{\r\n var index = Math.log(value) / 0.6931471805599453;\r\n\r\n return (1 << Math.ceil(index));\r\n};\r\n\r\nmodule.exports = GetPowerOfTwo;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/pow2/GetPowerOfTwo.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/pow2/IsSizePowerOfTwo.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/math/pow2/IsSizePowerOfTwo.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if the given `width` and `height` are a power of two.\r\n * Useful for checking texture dimensions.\r\n *\r\n * @function Phaser.Math.Pow2.IsSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width.\r\n * @param {number} height - The height.\r\n *\r\n * @return {boolean} `true` if `width` and `height` are a power of two, otherwise `false`.\r\n */\r\nvar IsSizePowerOfTwo = function (width, height)\r\n{\r\n return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0);\r\n};\r\n\r\nmodule.exports = IsSizePowerOfTwo;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/pow2/IsSizePowerOfTwo.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/pow2/IsValuePowerOfTwo.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/math/pow2/IsValuePowerOfTwo.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Tests the value and returns `true` if it is a power of two.\r\n *\r\n * @function Phaser.Math.Pow2.IsValue\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to check if it's a power of two.\r\n *\r\n * @return {boolean} Returns `true` if `value` is a power of two, otherwise `false`.\r\n */\r\nvar IsValuePowerOfTwo = function (value)\r\n{\r\n return (value > 0 && (value & (value - 1)) === 0);\r\n};\r\n\r\nmodule.exports = IsValuePowerOfTwo;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/pow2/IsValuePowerOfTwo.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/pow2/index.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/math/pow2/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Pow2\r\n */\r\n\r\nmodule.exports = {\r\n\r\n GetNext: __webpack_require__(/*! ./GetPowerOfTwo */ \"./node_modules/phaser/src/math/pow2/GetPowerOfTwo.js\"),\r\n IsSize: __webpack_require__(/*! ./IsSizePowerOfTwo */ \"./node_modules/phaser/src/math/pow2/IsSizePowerOfTwo.js\"),\r\n IsValue: __webpack_require__(/*! ./IsValuePowerOfTwo */ \"./node_modules/phaser/src/math/pow2/IsValuePowerOfTwo.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/pow2/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/random-data-generator/RandomDataGenerator.js": /*!***********************************************************************************!*\ !*** ./node_modules/phaser/src/math/random-data-generator/RandomDataGenerator.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A seeded Random Data Generator.\r\n * \r\n * Access via `Phaser.Math.RND` which is an instance of this class pre-defined\r\n * by Phaser. Or, create your own instance to use as you require.\r\n * \r\n * The `Math.RND` generator is seeded by the Game Config property value `seed`.\r\n * If no such config property exists, a random number is used.\r\n * \r\n * If you create your own instance of this class you should provide a seed for it.\r\n * If no seed is given it will use a 'random' one based on Date.now.\r\n *\r\n * @class RandomDataGenerator\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} [seeds] - The seeds to use for the random number generator.\r\n */\r\nvar RandomDataGenerator = new Class({\r\n\r\n initialize:\r\n\r\n function RandomDataGenerator (seeds)\r\n {\r\n if (seeds === undefined) { seeds = [ (Date.now() * Math.random()).toString() ]; }\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#c\r\n * @type {number}\r\n * @default 1\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.c = 1;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#s0\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.s0 = 0;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#s1\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.s1 = 0;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#s2\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.s2 = 0;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#n\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.2.0\r\n */\r\n this.n = 0;\r\n\r\n /**\r\n * Signs to choose from.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#signs\r\n * @type {number[]}\r\n * @since 3.0.0\r\n */\r\n this.signs = [ -1, 1 ];\r\n\r\n if (seeds)\r\n {\r\n this.init(seeds);\r\n }\r\n },\r\n\r\n /**\r\n * Private random helper.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#rnd\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @return {number} A random number.\r\n */\r\n rnd: function ()\r\n {\r\n var t = 2091639 * this.s0 + this.c * 2.3283064365386963e-10; // 2^-32\r\n\r\n this.c = t | 0;\r\n this.s0 = this.s1;\r\n this.s1 = this.s2;\r\n this.s2 = t - this.c;\r\n\r\n return this.s2;\r\n },\r\n\r\n /**\r\n * Internal method that creates a seed hash.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#hash\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {string} data - The value to hash.\r\n *\r\n * @return {number} The hashed value.\r\n */\r\n hash: function (data)\r\n {\r\n var h;\r\n var n = this.n;\r\n\r\n data = data.toString();\r\n\r\n for (var i = 0; i < data.length; i++)\r\n {\r\n n += data.charCodeAt(i);\r\n h = 0.02519603282416938 * n;\r\n n = h >>> 0;\r\n h -= n;\r\n h *= n;\r\n n = h >>> 0;\r\n h -= n;\r\n n += h * 0x100000000;// 2^32\r\n }\r\n\r\n this.n = n;\r\n\r\n return (n >>> 0) * 2.3283064365386963e-10;// 2^-32\r\n },\r\n\r\n /**\r\n * Initialize the state of the random data generator.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#init\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} seeds - The seeds to initialize the random data generator with.\r\n */\r\n init: function (seeds)\r\n {\r\n if (typeof seeds === 'string')\r\n {\r\n this.state(seeds);\r\n }\r\n else\r\n {\r\n this.sow(seeds);\r\n }\r\n },\r\n\r\n /**\r\n * Reset the seed of the random data generator.\r\n *\r\n * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#sow\r\n * @since 3.0.0\r\n *\r\n * @param {string[]} seeds - The array of seeds: the `toString()` of each value is used.\r\n */\r\n sow: function (seeds)\r\n {\r\n // Always reset to default seed\r\n this.n = 0xefc8249d;\r\n this.s0 = this.hash(' ');\r\n this.s1 = this.hash(' ');\r\n this.s2 = this.hash(' ');\r\n this.c = 1;\r\n\r\n if (!seeds)\r\n {\r\n return;\r\n }\r\n\r\n // Apply any seeds\r\n for (var i = 0; i < seeds.length && (seeds[i] != null); i++)\r\n {\r\n var seed = seeds[i];\r\n\r\n this.s0 -= this.hash(seed);\r\n this.s0 += ~~(this.s0 < 0);\r\n this.s1 -= this.hash(seed);\r\n this.s1 += ~~(this.s1 < 0);\r\n this.s2 -= this.hash(seed);\r\n this.s2 += ~~(this.s2 < 0);\r\n }\r\n },\r\n\r\n /**\r\n * Returns a random integer between 0 and 2^32.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#integer\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random integer between 0 and 2^32.\r\n */\r\n integer: function ()\r\n {\r\n // 2^32\r\n return this.rnd() * 0x100000000;\r\n },\r\n\r\n /**\r\n * Returns a random real number between 0 and 1.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#frac\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random real number between 0 and 1.\r\n */\r\n frac: function ()\r\n {\r\n // 2^-53\r\n return this.rnd() + (this.rnd() * 0x200000 | 0) * 1.1102230246251565e-16;\r\n },\r\n\r\n /**\r\n * Returns a random real number between 0 and 2^32.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#real\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random real number between 0 and 2^32.\r\n */\r\n real: function ()\r\n {\r\n return this.integer() + this.frac();\r\n },\r\n\r\n /**\r\n * Returns a random integer between and including min and max.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#integerInRange\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random number between min and max.\r\n */\r\n integerInRange: function (min, max)\r\n {\r\n return Math.floor(this.realInRange(0, max - min + 1) + min);\r\n },\r\n\r\n /**\r\n * Returns a random integer between and including min and max.\r\n * This method is an alias for RandomDataGenerator.integerInRange.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#between\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random number between min and max.\r\n */\r\n between: function (min, max)\r\n {\r\n return Math.floor(this.realInRange(0, max - min + 1) + min);\r\n },\r\n\r\n /**\r\n * Returns a random real number between min and max.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#realInRange\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random number between min and max.\r\n */\r\n realInRange: function (min, max)\r\n {\r\n return this.frac() * (max - min) + min;\r\n },\r\n\r\n /**\r\n * Returns a random real number between -1 and 1.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#normal\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random real number between -1 and 1.\r\n */\r\n normal: function ()\r\n {\r\n return 1 - (2 * this.frac());\r\n },\r\n\r\n /**\r\n * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#uuid\r\n * @since 3.0.0\r\n *\r\n * @return {string} A valid RFC4122 version4 ID hex string\r\n */\r\n uuid: function ()\r\n {\r\n var a = '';\r\n var b = '';\r\n\r\n for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-')\r\n {\r\n // eslint-disable-next-line no-empty\r\n }\r\n\r\n return b;\r\n },\r\n\r\n /**\r\n * Returns a random element from within the given array.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#pick\r\n * @since 3.0.0\r\n * \r\n * @generic T\r\n * @genericUse {T[]} - [array]\r\n * @genericUse {T} - [$return]\r\n *\r\n * @param {T[]} array - The array to pick a random element from.\r\n *\r\n * @return {T} A random member of the array.\r\n */\r\n pick: function (array)\r\n {\r\n return array[this.integerInRange(0, array.length - 1)];\r\n },\r\n\r\n /**\r\n * Returns a sign to be used with multiplication operator.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#sign\r\n * @since 3.0.0\r\n *\r\n * @return {number} -1 or +1.\r\n */\r\n sign: function ()\r\n {\r\n return this.pick(this.signs);\r\n },\r\n\r\n /**\r\n * Returns a random element from within the given array, favoring the earlier entries.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#weightedPick\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[]} - [array]\r\n * @genericUse {T} - [$return]\r\n *\r\n * @param {T[]} array - The array to pick a random element from.\r\n *\r\n * @return {T} A random member of the array.\r\n */\r\n weightedPick: function (array)\r\n {\r\n return array[~~(Math.pow(this.frac(), 2) * (array.length - 1) + 0.5)];\r\n },\r\n\r\n /**\r\n * Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#timestamp\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random timestamp between min and max.\r\n */\r\n timestamp: function (min, max)\r\n {\r\n return this.realInRange(min || 946684800000, max || 1577862000000);\r\n },\r\n\r\n /**\r\n * Returns a random angle between -180 and 180.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#angle\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random number between -180 and 180.\r\n */\r\n angle: function ()\r\n {\r\n return this.integerInRange(-180, 180);\r\n },\r\n\r\n /**\r\n * Returns a random rotation in radians, between -3.141 and 3.141\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#rotation\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random number between -3.141 and 3.141\r\n */\r\n rotation: function ()\r\n {\r\n return this.realInRange(-3.1415926, 3.1415926);\r\n },\r\n\r\n /**\r\n * Gets or Sets the state of the generator. This allows you to retain the values\r\n * that the generator is using between games, i.e. in a game save file.\r\n *\r\n * To seed this generator with a previously saved state you can pass it as the\r\n * `seed` value in your game config, or call this method directly after Phaser has booted.\r\n *\r\n * Call this method with no parameters to return the current state.\r\n *\r\n * If providing a state it should match the same format that this method\r\n * returns, which is a string with a header `!rnd` followed by the `c`,\r\n * `s0`, `s1` and `s2` values respectively, each comma-delimited.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#state\r\n * @since 3.0.0\r\n *\r\n * @param {string} [state] - Generator state to be set.\r\n *\r\n * @return {string} The current state of the generator.\r\n */\r\n state: function (state)\r\n {\r\n if (typeof state === 'string' && state.match(/^!rnd/))\r\n {\r\n state = state.split(',');\r\n\r\n this.c = parseFloat(state[1]);\r\n this.s0 = parseFloat(state[2]);\r\n this.s1 = parseFloat(state[3]);\r\n this.s2 = parseFloat(state[4]);\r\n }\r\n\r\n return [ '!rnd', this.c, this.s0, this.s1, this.s2 ].join(',');\r\n },\r\n\r\n /**\r\n * Shuffles the given array, using the current seed.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#shuffle\r\n * @since 3.7.0\r\n *\r\n * @generic T\r\n * @genericUse {T[]} - [array,$return]\r\n *\r\n * @param {T[]} [array] - The array to be shuffled.\r\n *\r\n * @return {T[]} The shuffled array.\r\n */\r\n shuffle: function (array)\r\n {\r\n var len = array.length - 1;\r\n\r\n for (var i = len; i > 0; i--)\r\n {\r\n var randomIndex = Math.floor(this.frac() * (i + 1));\r\n var itemAtIndex = array[randomIndex];\r\n\r\n array[randomIndex] = array[i];\r\n array[i] = itemAtIndex;\r\n }\r\n\r\n return array;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = RandomDataGenerator;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/random-data-generator/RandomDataGenerator.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/snap/SnapCeil.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/math/snap/SnapCeil.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Snap a value to nearest grid slice, using ceil.\r\n *\r\n * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`.\r\n * As will `14` snap to `15`... but `16` will snap to `20`.\r\n *\r\n * @function Phaser.Math.Snap.Ceil\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to snap.\r\n * @param {number} gap - The interval gap of the grid.\r\n * @param {number} [start=0] - Optional starting offset for gap.\r\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\r\n *\r\n * @return {number} The snapped value.\r\n */\r\nvar SnapCeil = function (value, gap, start, divide)\r\n{\r\n if (start === undefined) { start = 0; }\r\n\r\n if (gap === 0)\r\n {\r\n return value;\r\n }\r\n\r\n value -= start;\r\n value = gap * Math.ceil(value / gap);\r\n\r\n return (divide) ? (start + value) / gap : start + value;\r\n};\r\n\r\nmodule.exports = SnapCeil;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/snap/SnapCeil.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/snap/SnapFloor.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/math/snap/SnapFloor.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Snap a value to nearest grid slice, using floor.\r\n *\r\n * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`.\r\n * As will `14` snap to `10`... but `16` will snap to `15`.\r\n *\r\n * @function Phaser.Math.Snap.Floor\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to snap.\r\n * @param {number} gap - The interval gap of the grid.\r\n * @param {number} [start=0] - Optional starting offset for gap.\r\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\r\n *\r\n * @return {number} The snapped value.\r\n */\r\nvar SnapFloor = function (value, gap, start, divide)\r\n{\r\n if (start === undefined) { start = 0; }\r\n\r\n if (gap === 0)\r\n {\r\n return value;\r\n }\r\n\r\n value -= start;\r\n value = gap * Math.floor(value / gap);\r\n\r\n return (divide) ? (start + value) / gap : start + value;\r\n};\r\n\r\nmodule.exports = SnapFloor;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/snap/SnapFloor.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/snap/SnapTo.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/math/snap/SnapTo.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Snap a value to nearest grid slice, using rounding.\r\n *\r\n * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10` whereas `14` will snap to `15`.\r\n *\r\n * @function Phaser.Math.Snap.To\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to snap.\r\n * @param {number} gap - The interval gap of the grid.\r\n * @param {number} [start=0] - Optional starting offset for gap.\r\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\r\n *\r\n * @return {number} The snapped value.\r\n */\r\nvar SnapTo = function (value, gap, start, divide)\r\n{\r\n if (start === undefined) { start = 0; }\r\n\r\n if (gap === 0)\r\n {\r\n return value;\r\n }\r\n\r\n value -= start;\r\n value = gap * Math.round(value / gap);\r\n\r\n return (divide) ? (start + value) / gap : start + value;\r\n};\r\n\r\nmodule.exports = SnapTo;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/snap/SnapTo.js?"); /***/ }), /***/ "./node_modules/phaser/src/math/snap/index.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/math/snap/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Snap\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Ceil: __webpack_require__(/*! ./SnapCeil */ \"./node_modules/phaser/src/math/snap/SnapCeil.js\"),\r\n Floor: __webpack_require__(/*! ./SnapFloor */ \"./node_modules/phaser/src/math/snap/SnapFloor.js\"),\r\n To: __webpack_require__(/*! ./SnapTo */ \"./node_modules/phaser/src/math/snap/SnapTo.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/math/snap/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/phaser.js": /*!*******************************************!*\ !*** ./node_modules/phaser/src/phaser.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(global) {/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n__webpack_require__(/*! ./polyfills */ \"./node_modules/phaser/src/polyfills/index.js\");\r\n\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/const.js\");\r\nvar Extend = __webpack_require__(/*! ./utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\n\r\n/**\r\n * @namespace Phaser\r\n */\r\n\r\nvar Phaser = {\r\n\r\n Actions: __webpack_require__(/*! ./actions */ \"./node_modules/phaser/src/actions/index.js\"),\r\n Animations: __webpack_require__(/*! ./animations */ \"./node_modules/phaser/src/animations/index.js\"),\r\n BlendModes: __webpack_require__(/*! ./renderer/BlendModes */ \"./node_modules/phaser/src/renderer/BlendModes.js\"),\r\n Cache: __webpack_require__(/*! ./cache */ \"./node_modules/phaser/src/cache/index.js\"),\r\n Cameras: __webpack_require__(/*! ./cameras */ \"./node_modules/phaser/src/cameras/index.js\"),\r\n Core: __webpack_require__(/*! ./core */ \"./node_modules/phaser/src/core/index.js\"),\r\n Class: __webpack_require__(/*! ./utils/Class */ \"./node_modules/phaser/src/utils/Class.js\"),\r\n Create: __webpack_require__(/*! ./create */ \"./node_modules/phaser/src/create/index.js\"),\r\n Curves: __webpack_require__(/*! ./curves */ \"./node_modules/phaser/src/curves/index.js\"),\r\n Data: __webpack_require__(/*! ./data */ \"./node_modules/phaser/src/data/index.js\"),\r\n Display: __webpack_require__(/*! ./display */ \"./node_modules/phaser/src/display/index.js\"),\r\n DOM: __webpack_require__(/*! ./dom */ \"./node_modules/phaser/src/dom/index.js\"),\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/events/index.js\"),\r\n Game: __webpack_require__(/*! ./core/Game */ \"./node_modules/phaser/src/core/Game.js\"),\r\n GameObjects: __webpack_require__(/*! ./gameobjects */ \"./node_modules/phaser/src/gameobjects/index.js\"),\r\n Geom: __webpack_require__(/*! ./geom */ \"./node_modules/phaser/src/geom/index.js\"),\r\n Input: __webpack_require__(/*! ./input */ \"./node_modules/phaser/src/input/index.js\"),\r\n Loader: __webpack_require__(/*! ./loader */ \"./node_modules/phaser/src/loader/index.js\"),\r\n Math: __webpack_require__(/*! ./math */ \"./node_modules/phaser/src/math/index.js\"),\r\n Physics: __webpack_require__(/*! ./physics */ \"./node_modules/phaser/src/physics/index.js\"),\r\n Plugins: __webpack_require__(/*! ./plugins */ \"./node_modules/phaser/src/plugins/index.js\"),\r\n Renderer: __webpack_require__(/*! ./renderer */ \"./node_modules/phaser/src/renderer/index.js\"),\r\n Scale: __webpack_require__(/*! ./scale */ \"./node_modules/phaser/src/scale/index.js\"),\r\n ScaleModes: __webpack_require__(/*! ./renderer/ScaleModes */ \"./node_modules/phaser/src/renderer/ScaleModes.js\"),\r\n Scene: __webpack_require__(/*! ./scene/Scene */ \"./node_modules/phaser/src/scene/Scene.js\"),\r\n Scenes: __webpack_require__(/*! ./scene */ \"./node_modules/phaser/src/scene/index.js\"),\r\n Structs: __webpack_require__(/*! ./structs */ \"./node_modules/phaser/src/structs/index.js\"),\r\n Textures: __webpack_require__(/*! ./textures */ \"./node_modules/phaser/src/textures/index.js\"),\r\n Tilemaps: __webpack_require__(/*! ./tilemaps */ \"./node_modules/phaser/src/tilemaps/index.js\"),\r\n Time: __webpack_require__(/*! ./time */ \"./node_modules/phaser/src/time/index.js\"),\r\n Tweens: __webpack_require__(/*! ./tweens */ \"./node_modules/phaser/src/tweens/index.js\"),\r\n Utils: __webpack_require__(/*! ./utils */ \"./node_modules/phaser/src/utils/index.js\")\r\n\r\n};\r\n\r\n// Merge in the optional plugins\r\n\r\nif (typeof FEATURE_SOUND)\r\n{\r\n Phaser.Sound = __webpack_require__(/*! ./sound */ \"./node_modules/phaser/src/sound/index.js\");\r\n}\r\n\r\nif (typeof PLUGIN_CAMERA3D)\r\n{\r\n Phaser.Cameras.Sprite3D = __webpack_require__(/*! ../plugins/camera3d/src */ \"./node_modules/phaser/plugins/camera3d/src/index.js\");\r\n Phaser.GameObjects.Sprite3D = __webpack_require__(/*! ../plugins/camera3d/src/sprite3d/Sprite3D */ \"./node_modules/phaser/plugins/camera3d/src/sprite3d/Sprite3D.js\");\r\n Phaser.GameObjects.Factories.Sprite3D = __webpack_require__(/*! ../plugins/camera3d/src/sprite3d/Sprite3DFactory */ \"./node_modules/phaser/plugins/camera3d/src/sprite3d/Sprite3DFactory.js\");\r\n Phaser.GameObjects.Creators.Sprite3D = __webpack_require__(/*! ../plugins/camera3d/src/sprite3d/Sprite3DCreator */ \"./node_modules/phaser/plugins/camera3d/src/sprite3d/Sprite3DCreator.js\");\r\n}\r\n\r\nif (typeof PLUGIN_FBINSTANT)\r\n{\r\n Phaser.FacebookInstantGamesPlugin = __webpack_require__(/*! ../plugins/fbinstant/src/FacebookInstantGamesPlugin */ \"./node_modules/phaser/plugins/fbinstant/src/FacebookInstantGamesPlugin.js\");\r\n}\r\n\r\n// Merge in the consts\r\n\r\nPhaser = Extend(false, Phaser, CONST);\r\n\r\n/**\r\n * The root types namespace.\r\n * \r\n * @namespace Phaser.Types\r\n * @since 3.17.0\r\n */\r\n\r\n// Export it\r\n\r\nmodule.exports = Phaser;\r\n\r\nglobal.Phaser = Phaser;\r\n\r\n/*\r\n * \"Documentation is like pizza: when it is good, it is very, very good;\r\n * and when it is bad, it is better than nothing.\"\r\n * -- Dick Brandon\r\n */\r\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/phaser/src/phaser.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/ArcadeImage.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/ArcadeImage.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ./components */ \"./node_modules/phaser/src/physics/arcade/components/index.js\");\r\nvar Image = __webpack_require__(/*! ../../gameobjects/image/Image */ \"./node_modules/phaser/src/gameobjects/image/Image.js\");\r\n\r\n/**\r\n * @classdesc\r\n * An Arcade Physics Image is an Image with an Arcade Physics body and related components.\r\n * The body can be dynamic or static.\r\n *\r\n * The main difference between an Arcade Image and an Arcade Sprite is that you cannot animate an Arcade Image.\r\n *\r\n * @class Image\r\n * @extends Phaser.GameObjects.Image\r\n * @memberof Phaser.Physics.Arcade\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.Physics.Arcade.Components.Acceleration\r\n * @extends Phaser.Physics.Arcade.Components.Angular\r\n * @extends Phaser.Physics.Arcade.Components.Bounce\r\n * @extends Phaser.Physics.Arcade.Components.Debug\r\n * @extends Phaser.Physics.Arcade.Components.Drag\r\n * @extends Phaser.Physics.Arcade.Components.Enable\r\n * @extends Phaser.Physics.Arcade.Components.Friction\r\n * @extends Phaser.Physics.Arcade.Components.Gravity\r\n * @extends Phaser.Physics.Arcade.Components.Immovable\r\n * @extends Phaser.Physics.Arcade.Components.Mass\r\n * @extends Phaser.Physics.Arcade.Components.Size\r\n * @extends Phaser.Physics.Arcade.Components.Velocity\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Size\r\n * @extends Phaser.GameObjects.Components.Texture\r\n * @extends Phaser.GameObjects.Components.Tint\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n */\r\nvar ArcadeImage = new Class({\r\n\r\n Extends: Image,\r\n\r\n Mixins: [\r\n Components.Acceleration,\r\n Components.Angular,\r\n Components.Bounce,\r\n Components.Debug,\r\n Components.Drag,\r\n Components.Enable,\r\n Components.Friction,\r\n Components.Gravity,\r\n Components.Immovable,\r\n Components.Mass,\r\n Components.Size,\r\n Components.Velocity\r\n ],\r\n\r\n initialize:\r\n\r\n function ArcadeImage (scene, x, y, texture, frame)\r\n {\r\n Image.call(this, scene, x, y, texture, frame);\r\n\r\n /**\r\n * This Game Object's Physics Body.\r\n *\r\n * @name Phaser.Physics.Arcade.Image#body\r\n * @type {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.body = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ArcadeImage;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/ArcadeImage.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/ArcadePhysics.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/ArcadePhysics.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar DegToRad = __webpack_require__(/*! ../../math/DegToRad */ \"./node_modules/phaser/src/math/DegToRad.js\");\r\nvar DistanceBetween = __webpack_require__(/*! ../../math/distance/DistanceBetween */ \"./node_modules/phaser/src/math/distance/DistanceBetween.js\");\r\nvar DistanceSquared = __webpack_require__(/*! ../../math/distance/DistanceSquared */ \"./node_modules/phaser/src/math/distance/DistanceSquared.js\");\r\nvar Factory = __webpack_require__(/*! ./Factory */ \"./node_modules/phaser/src/physics/arcade/Factory.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar Merge = __webpack_require__(/*! ../../utils/object/Merge */ \"./node_modules/phaser/src/utils/object/Merge.js\");\r\nvar OverlapCirc = __webpack_require__(/*! ./components/OverlapCirc */ \"./node_modules/phaser/src/physics/arcade/components/OverlapCirc.js\");\r\nvar OverlapRect = __webpack_require__(/*! ./components/OverlapRect */ \"./node_modules/phaser/src/physics/arcade/components/OverlapRect.js\");\r\nvar PluginCache = __webpack_require__(/*! ../../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar SceneEvents = __webpack_require__(/*! ../../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\nvar World = __webpack_require__(/*! ./World */ \"./node_modules/phaser/src/physics/arcade/World.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Arcade Physics Plugin belongs to a Scene and sets up and manages the Scene's physics simulation.\r\n * It also holds some useful methods for moving and rotating Arcade Physics Bodies.\r\n *\r\n * You can access it from within a Scene using `this.physics`.\r\n *\r\n * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable\r\n * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other.\r\n * The separation that stops two objects penetrating may create a new penetration against a different object. If you\r\n * require a high level of stability please consider using an alternative physics system, such as Matter.js.\r\n *\r\n * @class ArcadePhysics\r\n * @memberof Phaser.Physics.Arcade\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene that this Plugin belongs to.\r\n */\r\nvar ArcadePhysics = new Class({\r\n\r\n initialize:\r\n\r\n function ArcadePhysics (scene)\r\n {\r\n /**\r\n * The Scene that this Plugin belongs to.\r\n *\r\n * @name Phaser.Physics.Arcade.ArcadePhysics#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * The Scene's Systems.\r\n *\r\n * @name Phaser.Physics.Arcade.ArcadePhysics#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n /**\r\n * A configuration object. Union of the `physics.arcade.*` properties of the GameConfig and SceneConfig objects.\r\n *\r\n * @name Phaser.Physics.Arcade.ArcadePhysics#config\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.config = this.getConfig();\r\n\r\n /**\r\n * The physics simulation.\r\n *\r\n * @name Phaser.Physics.Arcade.ArcadePhysics#world\r\n * @type {Phaser.Physics.Arcade.World}\r\n * @since 3.0.0\r\n */\r\n this.world;\r\n\r\n /**\r\n * An object holding the Arcade Physics factory methods.\r\n *\r\n * @name Phaser.Physics.Arcade.ArcadePhysics#add\r\n * @type {Phaser.Physics.Arcade.Factory}\r\n * @since 3.0.0\r\n */\r\n this.add;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n scene.sys.events.on(SceneEvents.START, this.start, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#boot\r\n * @private\r\n * @since 3.5.1\r\n */\r\n boot: function ()\r\n {\r\n this.world = new World(this.scene, this.config);\r\n this.add = new Factory(this.world);\r\n\r\n this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#start\r\n * @private\r\n * @since 3.5.0\r\n */\r\n start: function ()\r\n {\r\n if (!this.world)\r\n {\r\n this.world = new World(this.scene, this.config);\r\n this.add = new Factory(this.world);\r\n }\r\n\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.on(SceneEvents.UPDATE, this.world.update, this.world);\r\n eventEmitter.on(SceneEvents.POST_UPDATE, this.world.postUpdate, this.world);\r\n eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * Creates the physics configuration for the current Scene.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#getConfig\r\n * @since 3.0.0\r\n *\r\n * @return {object} The physics configuration.\r\n */\r\n getConfig: function ()\r\n {\r\n var gameConfig = this.systems.game.config.physics;\r\n var sceneConfig = this.systems.settings.physics;\r\n\r\n var config = Merge(\r\n GetFastValue(sceneConfig, 'arcade', {}),\r\n GetFastValue(gameConfig, 'arcade', {})\r\n );\r\n\r\n return config;\r\n },\r\n\r\n /**\r\n * Tests if Game Objects overlap. See {@link Phaser.Physics.Arcade.World#overlap}\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#overlap\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check.\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide.\r\n * @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`.\r\n * @param {*} [callbackContext] - The context in which to run the callbacks.\r\n *\r\n * @return {boolean} True if at least one Game Object overlaps another.\r\n *\r\n * @see Phaser.Physics.Arcade.World#overlap\r\n */\r\n overlap: function (object1, object2, overlapCallback, processCallback, callbackContext)\r\n {\r\n if (overlapCallback === undefined) { overlapCallback = null; }\r\n if (processCallback === undefined) { processCallback = null; }\r\n if (callbackContext === undefined) { callbackContext = overlapCallback; }\r\n\r\n return this.world.collideObjects(object1, object2, overlapCallback, processCallback, callbackContext, true);\r\n },\r\n\r\n /**\r\n * Performs a collision check and separation between the two physics enabled objects given, which can be single\r\n * Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups.\r\n *\r\n * If you don't require separation then use {@link #overlap} instead.\r\n *\r\n * If two Groups or arrays are passed, each member of one will be tested against each member of the other.\r\n *\r\n * If **only** one Group is passed (as `object1`), each member of the Group will be collided against the other members.\r\n *\r\n * If **only** one Array is passed, the array is iterated and every element in it is tested against the others.\r\n *\r\n * Two callbacks can be provided. The `collideCallback` is invoked if a collision occurs and the two colliding\r\n * objects are passed to it.\r\n *\r\n * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable\r\n * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other.\r\n * The separation that stops two objects penetrating may create a new penetration against a different object. If you\r\n * require a high level of stability please consider using an alternative physics system, such as Matter.js.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#collide\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check.\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide.\r\n * @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`.\r\n * @param {*} [callbackContext] - The context in which to run the callbacks.\r\n *\r\n * @return {boolean} True if any overlapping Game Objects were separated, otherwise false.\r\n *\r\n * @see Phaser.Physics.Arcade.World#collide\r\n */\r\n collide: function (object1, object2, collideCallback, processCallback, callbackContext)\r\n {\r\n if (collideCallback === undefined) { collideCallback = null; }\r\n if (processCallback === undefined) { processCallback = null; }\r\n if (callbackContext === undefined) { callbackContext = collideCallback; }\r\n\r\n return this.world.collideObjects(object1, object2, collideCallback, processCallback, callbackContext, false);\r\n },\r\n\r\n /**\r\n * This advanced method is specifically for testing for collision between a single Sprite and an array of Tile objects.\r\n *\r\n * You should generally use the `collide` method instead, with a Sprite vs. a Tilemap Layer, as that will perform\r\n * tile filtering and culling for you, as well as handle the interesting face collision automatically.\r\n *\r\n * This method is offered for those who would like to check for collision with specific Tiles in a layer, without\r\n * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic collisions\r\n * on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method,\r\n * you should filter them before passing them to this method.\r\n *\r\n * Important: Use of this method skips the `interesting faces` system that Tilemap Layers use. This means if you have\r\n * say a row or column of tiles, and you jump into, or walk over them, it's possible to get stuck on the edges of the\r\n * tiles as the interesting face calculations are skipped. However, for quick-fire small collision set tests on\r\n * dynamic maps, this method can prove very useful.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#collideTiles\r\n * @fires Phaser.Physics.Arcade.Events#TILE_COLLIDE\r\n * @since 3.17.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision.\r\n * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide.\r\n * @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`.\r\n * @param {any} [callbackContext] - The context in which to run the callbacks.\r\n *\r\n * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated.\r\n */\r\n collideTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext)\r\n {\r\n return this.world.collideTiles(sprite, tiles, collideCallback, processCallback, callbackContext);\r\n },\r\n\r\n /**\r\n * This advanced method is specifically for testing for overlaps between a single Sprite and an array of Tile objects.\r\n *\r\n * You should generally use the `overlap` method instead, with a Sprite vs. a Tilemap Layer, as that will perform\r\n * tile filtering and culling for you, as well as handle the interesting face collision automatically.\r\n *\r\n * This method is offered for those who would like to check for overlaps with specific Tiles in a layer, without\r\n * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic overlap\r\n * tests on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method,\r\n * you should filter them before passing them to this method.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#overlapTiles\r\n * @fires Phaser.Physics.Arcade.Events#TILE_OVERLAP\r\n * @since 3.17.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision.\r\n * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap.\r\n * @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`.\r\n * @param {any} [callbackContext] - The context in which to run the callbacks.\r\n *\r\n * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated.\r\n */\r\n overlapTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext)\r\n {\r\n return this.world.overlapTiles(sprite, tiles, collideCallback, processCallback, callbackContext);\r\n },\r\n\r\n /**\r\n * Pauses the simulation.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#pause\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Physics.Arcade.World} The simulation.\r\n */\r\n pause: function ()\r\n {\r\n return this.world.pause();\r\n },\r\n\r\n /**\r\n * Resumes the simulation (if paused).\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#resume\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Physics.Arcade.World} The simulation.\r\n */\r\n resume: function ()\r\n {\r\n return this.world.resume();\r\n },\r\n\r\n /**\r\n * Sets the acceleration.x/y property on the game object so it will move towards the x/y coordinates at the given rate (in pixels per second squared)\r\n *\r\n * You must give a maximum speed value, beyond which the game object won't go any faster.\r\n *\r\n * Note: The game object does not continuously track the target. If the target changes location during transit the game object will not modify its course.\r\n * Note: The game object doesn't stop moving once it reaches the destination coordinates.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#accelerateTo\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - Any Game Object with an Arcade Physics body.\r\n * @param {number} x - The x coordinate to accelerate towards.\r\n * @param {number} y - The y coordinate to accelerate towards.\r\n * @param {number} [speed=60] - The acceleration (change in speed) in pixels per second squared.\r\n * @param {number} [xSpeedMax=500] - The maximum x velocity the game object can reach.\r\n * @param {number} [ySpeedMax=500] - The maximum y velocity the game object can reach.\r\n *\r\n * @return {number} The angle (in radians) that the object should be visually set to in order to match its new velocity.\r\n */\r\n accelerateTo: function (gameObject, x, y, speed, xSpeedMax, ySpeedMax)\r\n {\r\n if (speed === undefined) { speed = 60; }\r\n\r\n var angle = Math.atan2(y - gameObject.y, x - gameObject.x);\r\n\r\n gameObject.body.acceleration.setToPolar(angle, speed);\r\n\r\n if (xSpeedMax !== undefined && ySpeedMax !== undefined)\r\n {\r\n gameObject.body.maxVelocity.set(xSpeedMax, ySpeedMax);\r\n }\r\n\r\n return angle;\r\n },\r\n\r\n /**\r\n * Sets the acceleration.x/y property on the game object so it will move towards the x/y coordinates at the given rate (in pixels per second squared)\r\n *\r\n * You must give a maximum speed value, beyond which the game object won't go any faster.\r\n *\r\n * Note: The game object does not continuously track the target. If the target changes location during transit the game object will not modify its course.\r\n * Note: The game object doesn't stop moving once it reaches the destination coordinates.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#accelerateToObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - Any Game Object with an Arcade Physics body.\r\n * @param {Phaser.GameObjects.GameObject} destination - The Game Object to move towards. Can be any object but must have visible x/y properties.\r\n * @param {number} [speed=60] - The acceleration (change in speed) in pixels per second squared.\r\n * @param {number} [xSpeedMax=500] - The maximum x velocity the game object can reach.\r\n * @param {number} [ySpeedMax=500] - The maximum y velocity the game object can reach.\r\n *\r\n * @return {number} The angle (in radians) that the object should be visually set to in order to match its new velocity.\r\n */\r\n accelerateToObject: function (gameObject, destination, speed, xSpeedMax, ySpeedMax)\r\n {\r\n return this.accelerateTo(gameObject, destination.x, destination.y, speed, xSpeedMax, ySpeedMax);\r\n },\r\n\r\n /**\r\n * Finds the Body or Game Object closest to a source point or object.\r\n *\r\n * If a `targets` argument is passed, this method finds the closest of those.\r\n * The targets can be Arcade Physics Game Objects, Dynamic Bodies, or Static Bodies.\r\n *\r\n * If no `targets` argument is passed, this method finds the closest Dynamic Body.\r\n *\r\n * If two or more targets are the exact same distance from the source point, only the first target\r\n * is returned.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#closest\r\n * @since 3.0.0\r\n *\r\n * @param {any} source - Any object with public `x` and `y` properties, such as a Game Object or Geometry object.\r\n * @param {(Phaser.Physics.Arcade.Body[]|Phaser.Physics.Arcade.StaticBody[]|Phaser.GameObjects.GameObject[])} [targets] - The targets.\r\n *\r\n * @return {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|Phaser.GameObjects.GameObject)} The target closest to the given source point.\r\n */\r\n closest: function (source, targets)\r\n {\r\n if (!targets)\r\n {\r\n targets = this.world.bodies.entries;\r\n }\r\n\r\n var min = Number.MAX_VALUE;\r\n var closest = null;\r\n var x = source.x;\r\n var y = source.y;\r\n var len = targets.length;\r\n\r\n for (var i = 0; i < len; i++)\r\n {\r\n var target = targets[i];\r\n var body = target.body || target;\r\n\r\n if (source === target || source === body || source === body.gameObject || source === body.center)\r\n {\r\n continue;\r\n }\r\n\r\n var distance = DistanceSquared(x, y, body.center.x, body.center.y);\r\n\r\n if (distance < min)\r\n {\r\n closest = target;\r\n min = distance;\r\n }\r\n }\r\n\r\n return closest;\r\n },\r\n\r\n /**\r\n * Finds the Body or Game Object farthest from a source point or object.\r\n *\r\n * If a `targets` argument is passed, this method finds the farthest of those.\r\n * The targets can be Arcade Physics Game Objects, Dynamic Bodies, or Static Bodies.\r\n *\r\n * If no `targets` argument is passed, this method finds the farthest Dynamic Body.\r\n *\r\n * If two or more targets are the exact same distance from the source point, only the first target\r\n * is returned.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#furthest\r\n * @since 3.0.0\r\n *\r\n * @param {any} source - Any object with public `x` and `y` properties, such as a Game Object or Geometry object.\r\n * @param {(Phaser.Physics.Arcade.Body[]|Phaser.Physics.Arcade.StaticBody[]|Phaser.GameObjects.GameObject[])} [targets] - The targets.\r\n *\r\n * @return {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|Phaser.GameObjects.GameObject)} The target farthest from the given source point.\r\n */\r\n furthest: function (source, targets)\r\n {\r\n if (!targets)\r\n {\r\n targets = this.world.bodies.entries;\r\n }\r\n\r\n var max = -1;\r\n var farthest = null;\r\n var x = source.x;\r\n var y = source.y;\r\n var len = targets.length;\r\n\r\n for (var i = 0; i < len; i++)\r\n {\r\n var target = targets[i];\r\n var body = target.body || target;\r\n\r\n if (source === target || source === body || source === body.gameObject || source === body.center)\r\n {\r\n continue;\r\n }\r\n\r\n var distance = DistanceSquared(x, y, body.center.x, body.center.y);\r\n\r\n if (distance > max)\r\n {\r\n farthest = target;\r\n max = distance;\r\n }\r\n\r\n }\r\n\r\n return farthest;\r\n },\r\n\r\n /**\r\n * Move the given display object towards the x/y coordinates at a steady velocity.\r\n * If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds.\r\n * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms.\r\n * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.\r\n * Note: The display object doesn't stop moving once it reaches the destination coordinates.\r\n * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all)\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#moveTo\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - Any Game Object with an Arcade Physics body.\r\n * @param {number} x - The x coordinate to move towards.\r\n * @param {number} y - The y coordinate to move towards.\r\n * @param {number} [speed=60] - The speed it will move, in pixels per second (default is 60 pixels/sec)\r\n * @param {number} [maxTime=0] - Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms.\r\n *\r\n * @return {number} The angle (in radians) that the object should be visually set to in order to match its new velocity.\r\n */\r\n moveTo: function (gameObject, x, y, speed, maxTime)\r\n {\r\n if (speed === undefined) { speed = 60; }\r\n if (maxTime === undefined) { maxTime = 0; }\r\n\r\n var angle = Math.atan2(y - gameObject.y, x - gameObject.x);\r\n\r\n if (maxTime > 0)\r\n {\r\n // We know how many pixels we need to move, but how fast?\r\n speed = DistanceBetween(gameObject.x, gameObject.y, x, y) / (maxTime / 1000);\r\n }\r\n\r\n gameObject.body.velocity.setToPolar(angle, speed);\r\n\r\n return angle;\r\n },\r\n\r\n /**\r\n * Move the given display object towards the destination object at a steady velocity.\r\n * If you specify a maxTime then it will adjust the speed (overwriting what you set) so it arrives at the destination in that number of seconds.\r\n * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms.\r\n * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.\r\n * Note: The display object doesn't stop moving once it reaches the destination coordinates.\r\n * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all)\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#moveToObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - Any Game Object with an Arcade Physics body.\r\n * @param {object} destination - Any object with public `x` and `y` properties, such as a Game Object or Geometry object.\r\n * @param {number} [speed=60] - The speed it will move, in pixels per second (default is 60 pixels/sec)\r\n * @param {number} [maxTime=0] - Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms.\r\n *\r\n * @return {number} The angle (in radians) that the object should be visually set to in order to match its new velocity.\r\n */\r\n moveToObject: function (gameObject, destination, speed, maxTime)\r\n {\r\n return this.moveTo(gameObject, destination.x, destination.y, speed, maxTime);\r\n },\r\n\r\n /**\r\n * Given the angle (in degrees) and speed calculate the velocity and return it as a vector, or set it to the given vector object.\r\n * One way to use this is: velocityFromAngle(angle, 200, sprite.body.velocity) which will set the values directly to the sprite's velocity and not create a new vector object.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#velocityFromAngle\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle in degrees calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative)\r\n * @param {number} [speed=60] - The speed it will move, in pixels per second squared.\r\n * @param {Phaser.Math.Vector2} [vec2] - The Vector2 in which the x and y properties will be set to the calculated velocity.\r\n *\r\n * @return {Phaser.Math.Vector2} The Vector2 that stores the velocity.\r\n */\r\n velocityFromAngle: function (angle, speed, vec2)\r\n {\r\n if (speed === undefined) { speed = 60; }\r\n if (vec2 === undefined) { vec2 = new Vector2(); }\r\n\r\n return vec2.setToPolar(DegToRad(angle), speed);\r\n },\r\n\r\n /**\r\n * Given the rotation (in radians) and speed calculate the velocity and return it as a vector, or set it to the given vector object.\r\n * One way to use this is: velocityFromRotation(rotation, 200, sprite.body.velocity) which will set the values directly to the sprite's velocity and not create a new vector object.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#velocityFromRotation\r\n * @since 3.0.0\r\n *\r\n * @param {number} rotation - The angle in radians.\r\n * @param {number} [speed=60] - The speed it will move, in pixels per second squared\r\n * @param {Phaser.Math.Vector2} [vec2] - The Vector2 in which the x and y properties will be set to the calculated velocity.\r\n *\r\n * @return {Phaser.Math.Vector2} The Vector2 that stores the velocity.\r\n */\r\n velocityFromRotation: function (rotation, speed, vec2)\r\n {\r\n if (speed === undefined) { speed = 60; }\r\n if (vec2 === undefined) { vec2 = new Vector2(); }\r\n\r\n return vec2.setToPolar(rotation, speed);\r\n },\r\n\r\n /**\r\n * This method will search the given rectangular area and return an array of all physics bodies that\r\n * overlap with it. It can return either Dynamic, Static bodies or a mixture of both.\r\n *\r\n * A body only has to intersect with the search area to be considered, it doesn't have to be fully\r\n * contained within it.\r\n *\r\n * If Arcade Physics is set to use the RTree (which it is by default) then the search for is extremely fast,\r\n * otherwise the search is O(N) for Dynamic Bodies.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#overlapRect\r\n * @since 3.17.0\r\n *\r\n * @param {number} x - The top-left x coordinate of the area to search within.\r\n * @param {number} y - The top-left y coordinate of the area to search within.\r\n * @param {number} width - The width of the area to search within.\r\n * @param {number} height - The height of the area to search within.\r\n * @param {boolean} [includeDynamic=true] - Should the search include Dynamic Bodies?\r\n * @param {boolean} [includeStatic=false] - Should the search include Static Bodies?\r\n *\r\n * @return {(Phaser.Physics.Arcade.Body[]|Phaser.Physics.Arcade.StaticBody[])} An array of bodies that overlap with the given area.\r\n */\r\n overlapRect: function (x, y, width, height, includeDynamic, includeStatic)\r\n {\r\n return OverlapRect(this.world, x, y, width, height, includeDynamic, includeStatic);\r\n },\r\n\r\n /**\r\n * This method will search the given circular area and return an array of all physics bodies that\r\n * overlap with it. It can return either Dynamic, Static bodies or a mixture of both.\r\n *\r\n * A body only has to intersect with the search area to be considered, it doesn't have to be fully\r\n * contained within it.\r\n *\r\n * If Arcade Physics is set to use the RTree (which it is by default) then the search is rather fast,\r\n * otherwise the search is O(N) for Dynamic Bodies.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#overlapCirc\r\n * @since 3.21.0\r\n *\r\n * @param {number} x - The x coordinate of the center of the area to search within.\r\n * @param {number} y - The y coordinate of the center of the area to search within.\r\n * @param {number} radius - The radius of the area to search within.\r\n * @param {boolean} [includeDynamic=true] - Should the search include Dynamic Bodies?\r\n * @param {boolean} [includeStatic=false] - Should the search include Static Bodies?\r\n *\r\n * @return {(Phaser.Physics.Arcade.Body[]|Phaser.Physics.Arcade.StaticBody[])} An array of bodies that overlap with the given area.\r\n */\r\n overlapCirc: function (x, y, radius, includeDynamic, includeStatic)\r\n {\r\n return OverlapCirc(this.world, x, y, radius, includeDynamic, includeStatic);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#shutdown\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n if (!this.world)\r\n {\r\n // Already destroyed\r\n return;\r\n }\r\n\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.off(SceneEvents.UPDATE, this.world.update, this.world);\r\n eventEmitter.off(SceneEvents.POST_UPDATE, this.world.postUpdate, this.world);\r\n eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n\r\n this.add.destroy();\r\n this.world.destroy();\r\n\r\n this.add = null;\r\n this.world = null;\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Phaser.Physics.Arcade.ArcadePhysics#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.scene.sys.events.off(SceneEvents.START, this.start, this);\r\n\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nPluginCache.register('ArcadePhysics', ArcadePhysics, 'arcadePhysics');\r\n\r\nmodule.exports = ArcadePhysics;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/ArcadePhysics.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/ArcadeSprite.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/ArcadeSprite.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ./components */ \"./node_modules/phaser/src/physics/arcade/components/index.js\");\r\nvar Sprite = __webpack_require__(/*! ../../gameobjects/sprite/Sprite */ \"./node_modules/phaser/src/gameobjects/sprite/Sprite.js\");\r\n\r\n/**\r\n * @classdesc\r\n * An Arcade Physics Sprite is a Sprite with an Arcade Physics body and related components.\r\n * The body can be dynamic or static.\r\n *\r\n * The main difference between an Arcade Sprite and an Arcade Image is that you cannot animate an Arcade Image.\r\n * If you do not require animation then you can safely use Arcade Images instead of Arcade Sprites.\r\n *\r\n * @class Sprite\r\n * @extends Phaser.GameObjects.Sprite\r\n * @memberof Phaser.Physics.Arcade\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.Physics.Arcade.Components.Acceleration\r\n * @extends Phaser.Physics.Arcade.Components.Angular\r\n * @extends Phaser.Physics.Arcade.Components.Bounce\r\n * @extends Phaser.Physics.Arcade.Components.Debug\r\n * @extends Phaser.Physics.Arcade.Components.Drag\r\n * @extends Phaser.Physics.Arcade.Components.Enable\r\n * @extends Phaser.Physics.Arcade.Components.Friction\r\n * @extends Phaser.Physics.Arcade.Components.Gravity\r\n * @extends Phaser.Physics.Arcade.Components.Immovable\r\n * @extends Phaser.Physics.Arcade.Components.Mass\r\n * @extends Phaser.Physics.Arcade.Components.Size\r\n * @extends Phaser.Physics.Arcade.Components.Velocity\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Size\r\n * @extends Phaser.GameObjects.Components.Texture\r\n * @extends Phaser.GameObjects.Components.Tint\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n */\r\nvar ArcadeSprite = new Class({\r\n\r\n Extends: Sprite,\r\n\r\n Mixins: [\r\n Components.Acceleration,\r\n Components.Angular,\r\n Components.Bounce,\r\n Components.Debug,\r\n Components.Drag,\r\n Components.Enable,\r\n Components.Friction,\r\n Components.Gravity,\r\n Components.Immovable,\r\n Components.Mass,\r\n Components.Size,\r\n Components.Velocity\r\n ],\r\n\r\n initialize:\r\n\r\n function ArcadeSprite (scene, x, y, texture, frame)\r\n {\r\n Sprite.call(this, scene, x, y, texture, frame);\r\n\r\n /**\r\n * This Game Object's Physics Body.\r\n *\r\n * @name Phaser.Physics.Arcade.Sprite#body\r\n * @type {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.body = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ArcadeSprite;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/ArcadeSprite.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/Body.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/Body.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Benjamin D. Richards \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/physics/arcade/const.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/physics/arcade/events/index.js\");\r\nvar RadToDeg = __webpack_require__(/*! ../../math/RadToDeg */ \"./node_modules/phaser/src/math/RadToDeg.js\");\r\nvar Rectangle = __webpack_require__(/*! ../../geom/rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar RectangleContains = __webpack_require__(/*! ../../geom/rectangle/Contains */ \"./node_modules/phaser/src/geom/rectangle/Contains.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Dynamic Arcade Body.\r\n *\r\n * Its static counterpart is {@link Phaser.Physics.Arcade.StaticBody}.\r\n *\r\n * @class Body\r\n * @memberof Phaser.Physics.Arcade\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.World} world - The Arcade Physics simulation this Body belongs to.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object this Body belongs to.\r\n */\r\nvar Body = new Class({\r\n\r\n initialize:\r\n\r\n function Body (world, gameObject)\r\n {\r\n var width = (gameObject.width) ? gameObject.width : 64;\r\n var height = (gameObject.height) ? gameObject.height : 64;\r\n\r\n /**\r\n * The Arcade Physics simulation this Body belongs to.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#world\r\n * @type {Phaser.Physics.Arcade.World}\r\n * @since 3.0.0\r\n */\r\n this.world = world;\r\n\r\n /**\r\n * The Game Object this Body belongs to.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#gameObject\r\n * @type {Phaser.GameObjects.GameObject}\r\n * @since 3.0.0\r\n */\r\n this.gameObject = gameObject;\r\n\r\n /**\r\n * Transformations applied to this Body.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#transform\r\n * @type {object}\r\n * @since 3.4.0\r\n */\r\n this.transform = {\r\n x: gameObject.x,\r\n y: gameObject.y,\r\n rotation: gameObject.angle,\r\n scaleX: gameObject.scaleX,\r\n scaleY: gameObject.scaleY,\r\n displayOriginX: gameObject.displayOriginX,\r\n displayOriginY: gameObject.displayOriginY\r\n };\r\n\r\n /**\r\n * Whether the Body's boundary is drawn to the debug display.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#debugShowBody\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.debugShowBody = world.defaults.debugShowBody;\r\n\r\n /**\r\n * Whether the Body's velocity is drawn to the debug display.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#debugShowVelocity\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.debugShowVelocity = world.defaults.debugShowVelocity;\r\n\r\n /**\r\n * The color of this Body on the debug display.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#debugBodyColor\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.debugBodyColor = world.defaults.bodyDebugColor;\r\n\r\n /**\r\n * Whether this Body is updated by the physics simulation.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#enable\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.enable = true;\r\n\r\n /**\r\n * Whether this Body's boundary is circular (true) or rectangular (false).\r\n *\r\n * @name Phaser.Physics.Arcade.Body#isCircle\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n * @see Phaser.Physics.Arcade.Body#setCircle\r\n */\r\n this.isCircle = false;\r\n\r\n /**\r\n * If this Body is circular, this is the unscaled radius of the Body's boundary, as set by setCircle(), in source pixels.\r\n * The true radius is equal to `halfWidth`.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#radius\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n * @see Phaser.Physics.Arcade.Body#setCircle\r\n */\r\n this.radius = 0;\r\n\r\n /**\r\n * The offset of this Body's position from its Game Object's position, in source pixels.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#offset\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n * @see Phaser.Physics.Arcade.Body#setOffset\r\n */\r\n this.offset = new Vector2();\r\n\r\n /**\r\n * The position of this Body within the simulation.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#position\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.position = new Vector2(gameObject.x, gameObject.y);\r\n\r\n /**\r\n * The position of this Body during the previous step.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#prev\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.prev = new Vector2(gameObject.x, gameObject.y);\r\n\r\n /**\r\n * The position of this Body during the previous frame.\r\n * \r\n * @name Phaser.Physics.Arcade.Body#prevFrame\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.20.0\r\n */\r\n this.prevFrame = new Vector2(gameObject.x, gameObject.y);\r\n\r\n /**\r\n * Whether this Body's `rotation` is affected by its angular acceleration and angular velocity.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#allowRotation\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.allowRotation = true;\r\n\r\n /**\r\n * This body's rotation, in degrees, based on its angular acceleration and angular velocity.\r\n * The Body's rotation controls the `angle` of its Game Object.\r\n * It doesn't rotate the Body's boundary, which is always an axis-aligned rectangle or a circle.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#rotation\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.rotation = gameObject.angle;\r\n\r\n /**\r\n * The Body rotation, in degrees, during the previous step.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#preRotation\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.preRotation = gameObject.angle;\r\n\r\n /**\r\n * The width of the Body boundary, in pixels.\r\n * If the Body is circular, this is also the diameter.\r\n * If you wish to change the width use the `Body.setSize` method.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#width\r\n * @type {number}\r\n * @readonly\r\n * @default 64\r\n * @since 3.0.0\r\n */\r\n this.width = width;\r\n\r\n /**\r\n * The height of the Body boundary, in pixels.\r\n * If the Body is circular, this is also the diameter.\r\n * If you wish to change the height use the `Body.setSize` method.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#height\r\n * @type {number}\r\n * @readonly\r\n * @default 64\r\n * @since 3.0.0\r\n */\r\n this.height = height;\r\n\r\n /**\r\n * The unscaled width of the Body, in source pixels, as set by setSize().\r\n * The default is the width of the Body's Game Object's texture frame.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#sourceWidth\r\n * @type {number}\r\n * @since 3.0.0\r\n * @see Phaser.Physics.Arcade.Body#setSize\r\n */\r\n this.sourceWidth = width;\r\n\r\n /**\r\n * The unscaled height of the Body, in source pixels, as set by setSize().\r\n * The default is the height of the Body's Game Object's texture frame.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#sourceHeight\r\n * @type {number}\r\n * @since 3.0.0\r\n * @see Phaser.Physics.Arcade.Body#setSize\r\n */\r\n this.sourceHeight = height;\r\n\r\n if (gameObject.frame)\r\n {\r\n this.sourceWidth = gameObject.frame.realWidth;\r\n this.sourceHeight = gameObject.frame.realHeight;\r\n }\r\n\r\n /**\r\n * Half the Body's width, in pixels.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#halfWidth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.halfWidth = Math.abs(width / 2);\r\n\r\n /**\r\n * Half the Body's height, in pixels.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#halfHeight\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.halfHeight = Math.abs(height / 2);\r\n\r\n /**\r\n * The center of the Body's boundary.\r\n * The midpoint of its `position` (top-left corner) and its bottom-right corner.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#center\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.center = new Vector2(gameObject.x + this.halfWidth, gameObject.y + this.halfHeight);\r\n\r\n /**\r\n * The Body's velocity, in pixels per second.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#velocity\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.velocity = new Vector2();\r\n\r\n /**\r\n * The Body's change in position (due to velocity) at the last step, in pixels.\r\n *\r\n * The size of this value depends on the simulation's step rate.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#newVelocity\r\n * @type {Phaser.Math.Vector2}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.newVelocity = new Vector2();\r\n\r\n /**\r\n * The Body's absolute maximum change in position, in pixels per step.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#deltaMax\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.deltaMax = new Vector2();\r\n\r\n /**\r\n * The Body's change in velocity, in pixels per second squared.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#acceleration\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.acceleration = new Vector2();\r\n\r\n /**\r\n * Whether this Body's velocity is affected by its `drag`.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#allowDrag\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.allowDrag = true;\r\n\r\n /**\r\n * Absolute loss of velocity due to movement, in pixels per second squared.\r\n * The x and y components are applied separately.\r\n *\r\n * When `useDamping` is true, this is 1 minus the damping factor.\r\n * A value of 1 means the Body loses no velocity.\r\n * A value of 0.95 means the Body loses 5% of its velocity per step.\r\n * A value of 0.5 means the Body loses 50% of its velocity per step.\r\n *\r\n * Drag is applied only when `acceleration` is zero.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#drag\r\n * @type {(Phaser.Math.Vector2|number)}\r\n * @since 3.0.0\r\n */\r\n this.drag = new Vector2();\r\n\r\n /**\r\n * Whether this Body's position is affected by gravity (local or world).\r\n *\r\n * @name Phaser.Physics.Arcade.Body#allowGravity\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n * @see Phaser.Physics.Arcade.Body#gravity\r\n * @see Phaser.Physics.Arcade.World#gravity\r\n */\r\n this.allowGravity = true;\r\n\r\n /**\r\n * Acceleration due to gravity (specific to this Body), in pixels per second squared.\r\n * Total gravity is the sum of this vector and the simulation's `gravity`.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#gravity\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n * @see Phaser.Physics.Arcade.World#gravity\r\n */\r\n this.gravity = new Vector2();\r\n\r\n /**\r\n * Rebound following a collision, relative to 1.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#bounce\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.bounce = new Vector2();\r\n\r\n /**\r\n * Rebound following a collision with the world boundary, relative to 1.\r\n * If null, `bounce` is used instead.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#worldBounce\r\n * @type {?Phaser.Math.Vector2}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.worldBounce = null;\r\n\r\n /**\r\n * The rectangle used for world boundary collisions.\r\n * \r\n * By default it is set to the world boundary rectangle. Or, if this Body was\r\n * created by a Physics Group, then whatever rectangle that Group defined.\r\n * \r\n * You can also change it by using the `Body.setBoundsRectangle` method.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#customBoundsRectangle\r\n * @type {?Phaser.Geom.Rectangle}\r\n * @since 3.20\r\n */\r\n this.customBoundsRectangle = world.bounds;\r\n\r\n // If true this Body will dispatch events\r\n\r\n /**\r\n * Whether the simulation emits a `worldbounds` event when this Body collides with the world boundary (and `collideWorldBounds` is also true).\r\n *\r\n * @name Phaser.Physics.Arcade.Body#onWorldBounds\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n * @see Phaser.Physics.Arcade.World#worldboundsEvent\r\n */\r\n this.onWorldBounds = false;\r\n\r\n /**\r\n * Whether the simulation emits a `collide` event when this Body collides with another.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#onCollide\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n * @see Phaser.Physics.Arcade.World#collideEvent\r\n */\r\n this.onCollide = false;\r\n\r\n /**\r\n * Whether the simulation emits an `overlap` event when this Body overlaps with another.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#onOverlap\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n * @see Phaser.Physics.Arcade.World#overlapEvent\r\n */\r\n this.onOverlap = false;\r\n\r\n /**\r\n * The Body's absolute maximum velocity, in pixels per second.\r\n * The horizontal and vertical components are applied separately.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#maxVelocity\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.maxVelocity = new Vector2(10000, 10000);\r\n\r\n /**\r\n * The maximum speed this Body is allowed to reach, in pixels per second.\r\n *\r\n * If not negative it limits the scalar value of speed.\r\n *\r\n * Any negative value means no maximum is being applied (the default).\r\n *\r\n * @name Phaser.Physics.Arcade.Body#maxSpeed\r\n * @type {number}\r\n * @default -1\r\n * @since 3.16.0\r\n */\r\n this.maxSpeed = -1;\r\n\r\n /**\r\n * 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.\r\n * The horizontal component (x) is applied only when two colliding Bodies are separated vertically.\r\n * The vertical component (y) is applied only when two colliding Bodies are separated horizontally.\r\n * The default value (1, 0) moves the riding Body horizontally in equal proportion to this Body and vertically not at all.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#friction\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.friction = new Vector2(1, 0);\r\n\r\n /**\r\n * If this Body is using `drag` for deceleration this property controls how the drag is applied.\r\n * If set to `true` drag will use a damping effect rather than a linear approach. If you are\r\n * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in\r\n * the game Asteroids) then you will get a far smoother and more visually correct deceleration\r\n * by using damping, avoiding the axis-drift that is prone with linear deceleration.\r\n *\r\n * If you enable this property then you should use far smaller `drag` values than with linear, as\r\n * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow\r\n * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#useDamping\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.10.0\r\n */\r\n this.useDamping = false;\r\n\r\n /**\r\n * The rate of change of this Body's `rotation`, in degrees per second.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#angularVelocity\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.angularVelocity = 0;\r\n\r\n /**\r\n * The Body's angular acceleration (change in angular velocity), in degrees per second squared.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#angularAcceleration\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.angularAcceleration = 0;\r\n\r\n /**\r\n * Loss of angular velocity due to angular movement, in degrees per second.\r\n *\r\n * Angular drag is applied only when angular acceleration is zero.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#angularDrag\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.angularDrag = 0;\r\n\r\n /**\r\n * The Body's maximum angular velocity, in degrees per second.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#maxAngular\r\n * @type {number}\r\n * @default 1000\r\n * @since 3.0.0\r\n */\r\n this.maxAngular = 1000;\r\n\r\n /**\r\n * The Body's inertia, relative to a default unit (1).\r\n * With `bounce`, this affects the exchange of momentum (velocities) during collisions.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#mass\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.mass = 1;\r\n\r\n /**\r\n * The calculated angle of this Body's velocity vector, in radians, during the last step.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#angle\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.angle = 0;\r\n\r\n /**\r\n * The calculated magnitude of the Body's velocity, in pixels per second, during the last step.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#speed\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.speed = 0;\r\n\r\n /**\r\n * The direction of the Body's velocity, as calculated during the last step.\r\n * If the Body is moving on both axes (diagonally), this describes motion on the vertical axis only.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#facing\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.facing = CONST.FACING_NONE;\r\n\r\n /**\r\n * Whether this Body can be moved by collisions with another Body.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#immovable\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.immovable = false;\r\n\r\n /**\r\n * Whether the Body's position and rotation are affected by its velocity, acceleration, drag, and gravity.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#moves\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.moves = true;\r\n\r\n /**\r\n * A flag disabling the default horizontal separation of colliding bodies.\r\n * Pass your own `collideCallback` to the collider.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#customSeparateX\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.customSeparateX = false;\r\n\r\n /**\r\n * A flag disabling the default vertical separation of colliding bodies.\r\n * Pass your own `collideCallback` to the collider.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#customSeparateY\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.customSeparateY = false;\r\n\r\n /**\r\n * The amount of horizontal overlap (before separation), if this Body is colliding with another.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#overlapX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.overlapX = 0;\r\n\r\n /**\r\n * The amount of vertical overlap (before separation), if this Body is colliding with another.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#overlapY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.overlapY = 0;\r\n\r\n /**\r\n * The amount of overlap (before separation), if this Body is circular and colliding with another circular body.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#overlapR\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.overlapR = 0;\r\n\r\n /**\r\n * Whether this Body is overlapped with another and both are not moving, on at least one axis.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#embedded\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.embedded = false;\r\n\r\n /**\r\n * Whether this Body interacts with the world boundary.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#collideWorldBounds\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.collideWorldBounds = false;\r\n\r\n /**\r\n * Whether this Body is checked for collisions and for which directions.\r\n * You can set `checkCollision.none = true` to disable collision checks.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#checkCollision\r\n * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision}\r\n * @since 3.0.0\r\n */\r\n this.checkCollision = { none: false, up: true, down: true, left: true, right: true };\r\n\r\n /**\r\n * Whether this Body is colliding with a Body or Static Body and in which direction.\r\n * In a collision where both bodies have zero velocity, `embedded` will be set instead.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#touching\r\n * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision}\r\n * @since 3.0.0\r\n *\r\n * @see Phaser.Physics.Arcade.Body#blocked\r\n * @see Phaser.Physics.Arcade.Body#embedded\r\n */\r\n this.touching = { none: true, up: false, down: false, left: false, right: false };\r\n\r\n /**\r\n * This Body's `touching` value during the previous step.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#wasTouching\r\n * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision}\r\n * @since 3.0.0\r\n *\r\n * @see Phaser.Physics.Arcade.Body#touching\r\n */\r\n this.wasTouching = { none: true, up: false, down: false, left: false, right: false };\r\n\r\n /**\r\n * Whether this Body is colliding with a Static Body, a tile, or the world boundary.\r\n * In a collision with a Static Body, if this Body has zero velocity then `embedded` will be set instead.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#blocked\r\n * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision}\r\n * @since 3.0.0\r\n *\r\n * @see Phaser.Physics.Arcade.Body#embedded\r\n * @see Phaser.Physics.Arcade.Body#touching\r\n */\r\n this.blocked = { none: true, up: false, down: false, left: false, right: false };\r\n\r\n /**\r\n * Whether to automatically synchronize this Body's dimensions to the dimensions of its Game Object's visual bounds.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#syncBounds\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n * @see Phaser.GameObjects.Components.GetBounds#getBounds\r\n */\r\n this.syncBounds = false;\r\n\r\n /**\r\n * The Body's physics type (dynamic or static).\r\n *\r\n * @name Phaser.Physics.Arcade.Body#physicsType\r\n * @type {integer}\r\n * @readonly\r\n * @default Phaser.Physics.Arcade.DYNAMIC_BODY\r\n * @since 3.0.0\r\n */\r\n this.physicsType = CONST.DYNAMIC_BODY;\r\n\r\n /**\r\n * Cached horizontal scale of the Body's Game Object.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#_sx\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._sx = gameObject.scaleX;\r\n\r\n /**\r\n * Cached vertical scale of the Body's Game Object.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#_sy\r\n * @type {number}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._sy = gameObject.scaleY;\r\n\r\n /**\r\n * The calculated change in the Body's horizontal position during the last step.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#_dx\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._dx = 0;\r\n\r\n /**\r\n * The calculated change in the Body's vertical position during the last step.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#_dy\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._dy = 0;\r\n\r\n /**\r\n * The final calculated change in the Body's horizontal position as of `postUpdate`.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#_tx\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.22.0\r\n */\r\n this._tx = 0;\r\n\r\n /**\r\n * The final calculated change in the Body's vertical position as of `postUpdate`.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#_ty\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.22.0\r\n */\r\n this._ty = 0;\r\n\r\n /**\r\n * Stores the Game Object's bounds.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#_bounds\r\n * @type {Phaser.Geom.Rectangle}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._bounds = new Rectangle();\r\n },\r\n\r\n /**\r\n * Updates the Body's `transform`, `width`, `height`, and `center` from its Game Object.\r\n * The Body's `position` isn't changed.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#updateBounds\r\n * @since 3.0.0\r\n */\r\n updateBounds: function ()\r\n {\r\n var sprite = this.gameObject;\r\n\r\n // Container?\r\n\r\n var transform = this.transform;\r\n\r\n if (sprite.parentContainer)\r\n {\r\n var matrix = sprite.getWorldTransformMatrix(this.world._tempMatrix, this.world._tempMatrix2);\r\n\r\n transform.x = matrix.tx;\r\n transform.y = matrix.ty;\r\n transform.rotation = RadToDeg(matrix.rotation);\r\n transform.scaleX = matrix.scaleX;\r\n transform.scaleY = matrix.scaleY;\r\n transform.displayOriginX = sprite.displayOriginX;\r\n transform.displayOriginY = sprite.displayOriginY;\r\n }\r\n else\r\n {\r\n transform.x = sprite.x;\r\n transform.y = sprite.y;\r\n transform.rotation = sprite.angle;\r\n transform.scaleX = sprite.scaleX;\r\n transform.scaleY = sprite.scaleY;\r\n transform.displayOriginX = sprite.displayOriginX;\r\n transform.displayOriginY = sprite.displayOriginY;\r\n }\r\n\r\n var recalc = false;\r\n\r\n if (this.syncBounds)\r\n {\r\n var b = sprite.getBounds(this._bounds);\r\n\r\n this.width = b.width;\r\n this.height = b.height;\r\n recalc = true;\r\n }\r\n else\r\n {\r\n var asx = Math.abs(transform.scaleX);\r\n var asy = Math.abs(transform.scaleY);\r\n\r\n if (this._sx !== asx || this._sy !== asy)\r\n {\r\n this.width = this.sourceWidth * asx;\r\n this.height = this.sourceHeight * asy;\r\n this._sx = asx;\r\n this._sy = asy;\r\n recalc = true;\r\n }\r\n }\r\n\r\n if (recalc)\r\n {\r\n this.halfWidth = Math.floor(this.width / 2);\r\n this.halfHeight = Math.floor(this.height / 2);\r\n this.updateCenter();\r\n }\r\n },\r\n\r\n /**\r\n * Updates the Body's `center` from its `position`, `width`, and `height`.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#updateCenter\r\n * @since 3.0.0\r\n */\r\n updateCenter: function ()\r\n {\r\n this.center.set(this.position.x + this.halfWidth, this.position.y + this.halfHeight);\r\n },\r\n\r\n /**\r\n * Prepares the Body for a physics step by resetting the `wasTouching`, `touching` and `blocked` states.\r\n *\r\n * This method is only called if the physics world is going to run a step this frame.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#resetFlags\r\n * @since 3.18.0\r\n */\r\n resetFlags: function ()\r\n {\r\n // Store and reset collision flags\r\n this.wasTouching.none = this.touching.none;\r\n this.wasTouching.up = this.touching.up;\r\n this.wasTouching.down = this.touching.down;\r\n this.wasTouching.left = this.touching.left;\r\n this.wasTouching.right = this.touching.right;\r\n\r\n this.touching.none = true;\r\n this.touching.up = false;\r\n this.touching.down = false;\r\n this.touching.left = false;\r\n this.touching.right = false;\r\n\r\n this.blocked.none = true;\r\n this.blocked.up = false;\r\n this.blocked.down = false;\r\n this.blocked.left = false;\r\n this.blocked.right = false;\r\n\r\n this.overlapR = 0;\r\n this.overlapX = 0;\r\n this.overlapY = 0;\r\n\r\n this.embedded = false;\r\n },\r\n\r\n /**\r\n * Syncs the position body position with the parent Game Object.\r\n *\r\n * This method is called every game frame, regardless if the world steps or not.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#preUpdate\r\n * @since 3.17.0\r\n *\r\n * @param {boolean} willStep - Will this Body run an update as well?\r\n * @param {number} delta - The delta time, in seconds, elapsed since the last frame.\r\n */\r\n preUpdate: function (willStep, delta)\r\n {\r\n if (willStep)\r\n {\r\n this.resetFlags();\r\n }\r\n\r\n this.updateBounds();\r\n\r\n var sprite = this.transform;\r\n\r\n this.position.x = sprite.x + sprite.scaleX * (this.offset.x - sprite.displayOriginX);\r\n this.position.y = sprite.y + sprite.scaleY * (this.offset.y - sprite.displayOriginY);\r\n\r\n this.updateCenter();\r\n\r\n this.rotation = sprite.rotation;\r\n\r\n this.preRotation = this.rotation;\r\n\r\n if (this.moves)\r\n {\r\n this.prev.x = this.position.x;\r\n this.prev.y = this.position.y;\r\n this.prevFrame.x = this.position.x;\r\n this.prevFrame.y = this.position.y;\r\n }\r\n\r\n if (willStep)\r\n {\r\n this.update(delta);\r\n }\r\n },\r\n\r\n /**\r\n * Performs a single physics step and updates the body velocity, angle, speed and other properties.\r\n *\r\n * This method can be called multiple times per game frame, depending on the physics step rate.\r\n *\r\n * The results are synced back to the Game Object in `postUpdate`.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#update\r\n * @fires Phaser.Physics.Arcade.Events#WORLD_BOUNDS\r\n * @since 3.0.0\r\n *\r\n * @param {number} delta - The delta time, in seconds, elapsed since the last frame.\r\n */\r\n update: function (delta)\r\n {\r\n this.prev.x = this.position.x;\r\n this.prev.y = this.position.y;\r\n\r\n if (this.moves)\r\n {\r\n this.world.updateMotion(this, delta);\r\n\r\n var vx = this.velocity.x;\r\n var vy = this.velocity.y;\r\n\r\n this.newVelocity.set(vx * delta, vy * delta);\r\n\r\n this.position.add(this.newVelocity);\r\n\r\n this.updateCenter();\r\n\r\n this.angle = Math.atan2(vy, vx);\r\n this.speed = Math.sqrt(vx * vx + vy * vy);\r\n\r\n // Now the update will throw collision checks at the Body\r\n // And finally we'll integrate the new position back to the Sprite in postUpdate\r\n\r\n if (this.collideWorldBounds && this.checkWorldBounds() && this.onWorldBounds)\r\n {\r\n this.world.emit(Events.WORLD_BOUNDS, this, this.blocked.up, this.blocked.down, this.blocked.left, this.blocked.right);\r\n }\r\n }\r\n\r\n this._dx = this.position.x - this.prev.x;\r\n this._dy = this.position.y - this.prev.y;\r\n },\r\n\r\n /**\r\n * Feeds the Body results back into the parent Game Object.\r\n *\r\n * This method is called every game frame, regardless if the world steps or not.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#postUpdate\r\n * @since 3.0.0\r\n */\r\n postUpdate: function ()\r\n {\r\n var dx = this.position.x - this.prevFrame.x;\r\n var dy = this.position.y - this.prevFrame.y;\r\n\r\n if (this.moves)\r\n {\r\n var mx = this.deltaMax.x;\r\n var my = this.deltaMax.y;\r\n\r\n if (mx !== 0 && dx !== 0)\r\n {\r\n if (dx < 0 && dx < -mx)\r\n {\r\n dx = -mx;\r\n }\r\n else if (dx > 0 && dx > mx)\r\n {\r\n dx = mx;\r\n }\r\n }\r\n\r\n if (my !== 0 && dy !== 0)\r\n {\r\n if (dy < 0 && dy < -my)\r\n {\r\n dy = -my;\r\n }\r\n else if (dy > 0 && dy > my)\r\n {\r\n dy = my;\r\n }\r\n }\r\n\r\n this.gameObject.x += dx;\r\n this.gameObject.y += dy;\r\n }\r\n\r\n if (dx < 0)\r\n {\r\n this.facing = CONST.FACING_LEFT;\r\n }\r\n else if (dx > 0)\r\n {\r\n this.facing = CONST.FACING_RIGHT;\r\n }\r\n\r\n if (dy < 0)\r\n {\r\n this.facing = CONST.FACING_UP;\r\n }\r\n else if (dy > 0)\r\n {\r\n this.facing = CONST.FACING_DOWN;\r\n }\r\n\r\n if (this.allowRotation)\r\n {\r\n this.gameObject.angle += this.deltaZ();\r\n }\r\n\r\n this._tx = dx;\r\n this._ty = dy;\r\n },\r\n\r\n /**\r\n * Sets a custom collision boundary rectangle. Use if you want to have a custom\r\n * boundary instead of the world boundaries.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setBoundsRectangle\r\n * @since 3.20\r\n *\r\n * @param {?Phaser.Geom.Rectangle} [bounds] - The new boundary rectangle. Pass `null` to use the World bounds.\r\n * \r\n * @return {this} This Body object.\r\n */\r\n setBoundsRectangle: function (bounds)\r\n {\r\n this.customBoundsRectangle = (!bounds) ? this.world.bounds : bounds;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Checks for collisions between this Body and the world boundary and separates them.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#checkWorldBounds\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} True if this Body is colliding with the world boundary.\r\n */\r\n checkWorldBounds: function ()\r\n {\r\n var pos = this.position;\r\n var bounds = this.customBoundsRectangle;\r\n var check = this.world.checkCollision;\r\n\r\n var bx = (this.worldBounce) ? -this.worldBounce.x : -this.bounce.x;\r\n var by = (this.worldBounce) ? -this.worldBounce.y : -this.bounce.y;\r\n\r\n var wasSet = false;\r\n\r\n if (pos.x < bounds.x && check.left)\r\n {\r\n pos.x = bounds.x;\r\n this.velocity.x *= bx;\r\n this.blocked.left = true;\r\n wasSet = true;\r\n }\r\n else if (this.right > bounds.right && check.right)\r\n {\r\n pos.x = bounds.right - this.width;\r\n this.velocity.x *= bx;\r\n this.blocked.right = true;\r\n wasSet = true;\r\n }\r\n\r\n if (pos.y < bounds.y && check.up)\r\n {\r\n pos.y = bounds.y;\r\n this.velocity.y *= by;\r\n this.blocked.up = true;\r\n wasSet = true;\r\n }\r\n else if (this.bottom > bounds.bottom && check.down)\r\n {\r\n pos.y = bounds.bottom - this.height;\r\n this.velocity.y *= by;\r\n this.blocked.down = true;\r\n wasSet = true;\r\n }\r\n\r\n if (wasSet)\r\n {\r\n this.blocked.none = false;\r\n }\r\n\r\n return wasSet;\r\n },\r\n\r\n /**\r\n * Sets the offset of the Body's position from its Game Object's position.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setOffset\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal offset, in source pixels.\r\n * @param {number} [y=x] - The vertical offset, in source pixels.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setOffset: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.offset.set(x, y);\r\n this.updateCenter();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sizes and positions this Body's boundary, as a rectangle.\r\n * Modifies the Body `offset` if `center` is true (the default).\r\n * Resets the width and height to match current frame, if no width and height provided and a frame is found.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setSize\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [width] - The width of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width.\r\n * @param {integer} [height] - The height of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height.\r\n * @param {boolean} [center=true] - Modify the Body's `offset`, placing the Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setSize: function (width, height, center)\r\n {\r\n if (center === undefined) { center = true; }\r\n\r\n var gameObject = this.gameObject;\r\n\r\n if (!width && gameObject.frame)\r\n {\r\n width = gameObject.frame.realWidth;\r\n }\r\n\r\n if (!height && gameObject.frame)\r\n {\r\n height = gameObject.frame.realHeight;\r\n }\r\n\r\n this.sourceWidth = width;\r\n this.sourceHeight = height;\r\n\r\n this.width = this.sourceWidth * this._sx;\r\n this.height = this.sourceHeight * this._sy;\r\n\r\n this.halfWidth = Math.floor(this.width / 2);\r\n this.halfHeight = Math.floor(this.height / 2);\r\n\r\n this.updateCenter();\r\n\r\n if (center && gameObject.getCenter)\r\n {\r\n var ox = gameObject.displayWidth / 2;\r\n var oy = gameObject.displayHeight / 2;\r\n\r\n this.offset.set(ox - this.halfWidth, oy - this.halfHeight);\r\n }\r\n\r\n this.isCircle = false;\r\n this.radius = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sizes and positions this Body's boundary, as a circle.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setCircle\r\n * @since 3.0.0\r\n *\r\n * @param {number} radius - The radius of the Body, in source pixels.\r\n * @param {number} [offsetX] - The horizontal offset of the Body from its Game Object, in source pixels.\r\n * @param {number} [offsetY] - The vertical offset of the Body from its Game Object, in source pixels.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setCircle: function (radius, offsetX, offsetY)\r\n {\r\n if (offsetX === undefined) { offsetX = this.offset.x; }\r\n if (offsetY === undefined) { offsetY = this.offset.y; }\r\n\r\n if (radius > 0)\r\n {\r\n this.isCircle = true;\r\n this.radius = radius;\r\n\r\n this.sourceWidth = radius * 2;\r\n this.sourceHeight = radius * 2;\r\n\r\n this.width = this.sourceWidth * this._sx;\r\n this.height = this.sourceHeight * this._sy;\r\n\r\n this.halfWidth = Math.floor(this.width / 2);\r\n this.halfHeight = Math.floor(this.height / 2);\r\n\r\n this.offset.set(offsetX, offsetY);\r\n\r\n this.updateCenter();\r\n }\r\n else\r\n {\r\n this.isCircle = false;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets this Body to the given coordinates. Also positions its parent Game Object to the same coordinates.\r\n * If the Body had any velocity or acceleration it is lost as a result of calling this.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#reset\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position to place the Game Object and Body.\r\n * @param {number} y - The vertical position to place the Game Object and Body.\r\n */\r\n reset: function (x, y)\r\n {\r\n this.stop();\r\n\r\n var gameObject = this.gameObject;\r\n\r\n gameObject.setPosition(x, y);\r\n\r\n if (gameObject.getTopLeft)\r\n {\r\n gameObject.getTopLeft(this.position);\r\n }\r\n else\r\n {\r\n this.position.set(x, y);\r\n }\r\n\r\n this.prev.copy(this.position);\r\n this.prevFrame.copy(this.position);\r\n\r\n this.rotation = gameObject.angle;\r\n this.preRotation = gameObject.angle;\r\n\r\n this.updateBounds();\r\n this.updateCenter();\r\n },\r\n\r\n /**\r\n * Sets acceleration, velocity, and speed to zero.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#stop\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n stop: function ()\r\n {\r\n this.velocity.set(0);\r\n this.acceleration.set(0);\r\n this.speed = 0;\r\n this.angularVelocity = 0;\r\n this.angularAcceleration = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Copies the coordinates of this Body's edges into an object.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#getBounds\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeBodyBounds} obj - An object to copy the values into.\r\n *\r\n * @return {Phaser.Types.Physics.Arcade.ArcadeBodyBounds} - An object with {x, y, right, bottom}.\r\n */\r\n getBounds: function (obj)\r\n {\r\n obj.x = this.x;\r\n obj.y = this.y;\r\n obj.right = this.right;\r\n obj.bottom = this.bottom;\r\n\r\n return obj;\r\n },\r\n\r\n /**\r\n * Tests if the coordinates are within this Body's boundary.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#hitTest\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal coordinate.\r\n * @param {number} y - The vertical coordinate.\r\n *\r\n * @return {boolean} True if (x, y) is within this Body.\r\n */\r\n hitTest: function (x, y)\r\n {\r\n if (!this.isCircle)\r\n {\r\n return RectangleContains(this, x, y);\r\n }\r\n\r\n // Check if x/y are within the bounds first\r\n if (this.radius > 0 && x >= this.left && x <= this.right && y >= this.top && y <= this.bottom)\r\n {\r\n var dx = (this.center.x - x) * (this.center.x - x);\r\n var dy = (this.center.y - y) * (this.center.y - y);\r\n\r\n return (dx + dy) <= (this.radius * this.radius);\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Whether this Body is touching a tile or the world boundary while moving down.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#onFloor\r\n * @since 3.0.0\r\n * @see Phaser.Physics.Arcade.Body#blocked\r\n *\r\n * @return {boolean} True if touching.\r\n */\r\n onFloor: function ()\r\n {\r\n return this.blocked.down;\r\n },\r\n\r\n /**\r\n * Whether this Body is touching a tile or the world boundary while moving up.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#onCeiling\r\n * @since 3.0.0\r\n * @see Phaser.Physics.Arcade.Body#blocked\r\n *\r\n * @return {boolean} True if touching.\r\n */\r\n onCeiling: function ()\r\n {\r\n return this.blocked.up;\r\n },\r\n\r\n /**\r\n * Whether this Body is touching a tile or the world boundary while moving left or right.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#onWall\r\n * @since 3.0.0\r\n * @see Phaser.Physics.Arcade.Body#blocked\r\n *\r\n * @return {boolean} True if touching.\r\n */\r\n onWall: function ()\r\n {\r\n return (this.blocked.left || this.blocked.right);\r\n },\r\n\r\n /**\r\n * The absolute (non-negative) change in this Body's horizontal position from the previous step.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#deltaAbsX\r\n * @since 3.0.0\r\n *\r\n * @return {number} The delta value.\r\n */\r\n deltaAbsX: function ()\r\n {\r\n return (this._dx > 0) ? this._dx : -this._dx;\r\n },\r\n\r\n /**\r\n * The absolute (non-negative) change in this Body's vertical position from the previous step.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#deltaAbsY\r\n * @since 3.0.0\r\n *\r\n * @return {number} The delta value.\r\n */\r\n deltaAbsY: function ()\r\n {\r\n return (this._dy > 0) ? this._dy : -this._dy;\r\n },\r\n\r\n /**\r\n * The change in this Body's horizontal position from the previous step.\r\n * This value is set during the Body's update phase.\r\n * \r\n * As a Body can update multiple times per step this may not hold the final\r\n * delta value for the Body. In this case, please see the `deltaXFinal` method.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#deltaX\r\n * @since 3.0.0\r\n *\r\n * @return {number} The delta value.\r\n */\r\n deltaX: function ()\r\n {\r\n return this._dx;\r\n },\r\n\r\n /**\r\n * The change in this Body's vertical position from the previous step.\r\n * This value is set during the Body's update phase.\r\n * \r\n * As a Body can update multiple times per step this may not hold the final\r\n * delta value for the Body. In this case, please see the `deltaYFinal` method.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#deltaY\r\n * @since 3.0.0\r\n *\r\n * @return {number} The delta value.\r\n */\r\n deltaY: function ()\r\n {\r\n return this._dy;\r\n },\r\n\r\n /**\r\n * The change in this Body's horizontal position from the previous game update.\r\n * \r\n * This value is set during the `postUpdate` phase and takes into account the\r\n * `deltaMax` and final position of the Body.\r\n * \r\n * Because this value is not calculated until `postUpdate`, you must listen for it\r\n * during a Scene `POST_UPDATE` or `RENDER` event, and not in `update`, as it will\r\n * not be calculated by that point. If you _do_ use these values in `update` they\r\n * will represent the delta from the _previous_ game frame.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#deltaXFinal\r\n * @since 3.22.0\r\n *\r\n * @return {number} The final delta x value.\r\n */\r\n deltaXFinal: function ()\r\n {\r\n return this._tx;\r\n },\r\n\r\n /**\r\n * The change in this Body's vertical position from the previous game update.\r\n * \r\n * This value is set during the `postUpdate` phase and takes into account the\r\n * `deltaMax` and final position of the Body.\r\n * \r\n * Because this value is not calculated until `postUpdate`, you must listen for it\r\n * during a Scene `POST_UPDATE` or `RENDER` event, and not in `update`, as it will\r\n * not be calculated by that point. If you _do_ use these values in `update` they\r\n * will represent the delta from the _previous_ game frame.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#deltaYFinal\r\n * @since 3.22.0\r\n *\r\n * @return {number} The final delta y value.\r\n */\r\n deltaYFinal: function ()\r\n {\r\n return this._ty;\r\n },\r\n\r\n /**\r\n * The change in this Body's rotation from the previous step, in degrees.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#deltaZ\r\n * @since 3.0.0\r\n *\r\n * @return {number} The delta value.\r\n */\r\n deltaZ: function ()\r\n {\r\n return this.rotation - this.preRotation;\r\n },\r\n\r\n /**\r\n * Disables this Body and marks it for deletion by the simulation.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.enable = false;\r\n\r\n if (this.world)\r\n {\r\n this.world.pendingDestroy.set(this);\r\n }\r\n },\r\n\r\n /**\r\n * Draws this Body's boundary and velocity, if enabled.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#drawDebug\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Graphics} graphic - The Graphics object to draw on.\r\n */\r\n drawDebug: function (graphic)\r\n {\r\n var pos = this.position;\r\n\r\n var x = pos.x + this.halfWidth;\r\n var y = pos.y + this.halfHeight;\r\n\r\n if (this.debugShowBody)\r\n {\r\n graphic.lineStyle(graphic.defaultStrokeWidth, this.debugBodyColor);\r\n\r\n if (this.isCircle)\r\n {\r\n graphic.strokeCircle(x, y, this.width / 2);\r\n }\r\n else\r\n {\r\n // Only draw the sides where checkCollision is true, similar to debugger in layer\r\n if (this.checkCollision.up)\r\n {\r\n graphic.lineBetween(pos.x, pos.y, pos.x + this.width, pos.y);\r\n }\r\n\r\n if (this.checkCollision.right)\r\n {\r\n graphic.lineBetween(pos.x + this.width, pos.y, pos.x + this.width, pos.y + this.height);\r\n }\r\n\r\n if (this.checkCollision.down)\r\n {\r\n graphic.lineBetween(pos.x, pos.y + this.height, pos.x + this.width, pos.y + this.height);\r\n }\r\n\r\n if (this.checkCollision.left)\r\n {\r\n graphic.lineBetween(pos.x, pos.y, pos.x, pos.y + this.height);\r\n }\r\n }\r\n }\r\n\r\n if (this.debugShowVelocity)\r\n {\r\n graphic.lineStyle(graphic.defaultStrokeWidth, this.world.defaults.velocityDebugColor, 1);\r\n graphic.lineBetween(x, y, x + this.velocity.x / 2, y + this.velocity.y / 2);\r\n }\r\n },\r\n\r\n /**\r\n * Whether this Body will be drawn to the debug display.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#willDrawDebug\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} True if either `debugShowBody` or `debugShowVelocity` are enabled.\r\n */\r\n willDrawDebug: function ()\r\n {\r\n return (this.debugShowBody || this.debugShowVelocity);\r\n },\r\n\r\n /**\r\n * Sets whether this Body collides with the world boundary.\r\n *\r\n * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Phaser.Math.Vector2 first.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setCollideWorldBounds\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [value=true] - `true` if this body should collide with the world bounds, otherwise `false`.\r\n * @param {number} [bounceX] - If given this will be replace the `worldBounce.x` value.\r\n * @param {number} [bounceY] - If given this will be replace the `worldBounce.y` value.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setCollideWorldBounds: function (value, bounceX, bounceY)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.collideWorldBounds = value;\r\n\r\n var setBounceX = (bounceX !== undefined);\r\n var setBounceY = (bounceY !== undefined);\r\n\r\n if (setBounceX || setBounceY)\r\n {\r\n if (!this.worldBounce)\r\n {\r\n this.worldBounce = new Vector2();\r\n }\r\n\r\n if (setBounceX)\r\n {\r\n this.worldBounce.x = bounceX;\r\n }\r\n\r\n if (setBounceY)\r\n {\r\n this.worldBounce.y = bounceY;\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's velocity.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setVelocity\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal velocity, in pixels per second.\r\n * @param {number} [y=x] - The vertical velocity, in pixels per second.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setVelocity: function (x, y)\r\n {\r\n this.velocity.set(x, y);\r\n\r\n x = this.velocity.x;\r\n y = this.velocity.y;\r\n\r\n this.speed = Math.sqrt(x * x + y * y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's horizontal velocity.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setVelocityX\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The velocity, in pixels per second.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setVelocityX: function (value)\r\n {\r\n this.velocity.x = value;\r\n\r\n var x = value;\r\n var y = this.velocity.y;\r\n\r\n this.speed = Math.sqrt(x * x + y * y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's vertical velocity.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setVelocityY\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The velocity, in pixels per second.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setVelocityY: function (value)\r\n {\r\n this.velocity.y = value;\r\n\r\n var x = this.velocity.x;\r\n var y = value;\r\n\r\n this.speed = Math.sqrt(x * x + y * y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's maximum velocity.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setMaxVelocity\r\n * @since 3.10.0\r\n *\r\n * @param {number} x - The horizontal velocity, in pixels per second.\r\n * @param {number} [y=x] - The vertical velocity, in pixels per second.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setMaxVelocity: function (x, y)\r\n {\r\n this.maxVelocity.set(x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the maximum speed the Body can move.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setMaxSpeed\r\n * @since 3.16.0\r\n *\r\n * @param {number} value - The maximum speed value, in pixels per second. Set to a negative value to disable.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setMaxSpeed: function (value)\r\n {\r\n this.maxSpeed = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's bounce.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setBounce\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal bounce, relative to 1.\r\n * @param {number} y - The vertical bounce, relative to 1.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setBounce: function (x, y)\r\n {\r\n this.bounce.set(x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's horizontal bounce.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setBounceX\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The bounce, relative to 1.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setBounceX: function (value)\r\n {\r\n this.bounce.x = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's vertical bounce.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setBounceY\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The bounce, relative to 1.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setBounceY: function (value)\r\n {\r\n this.bounce.y = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's acceleration.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setAcceleration\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal component, in pixels per second squared.\r\n * @param {number} y - The vertical component, in pixels per second squared.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setAcceleration: function (x, y)\r\n {\r\n this.acceleration.set(x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's horizontal acceleration.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setAccelerationX\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The acceleration, in pixels per second squared.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setAccelerationX: function (value)\r\n {\r\n this.acceleration.x = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's vertical acceleration.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setAccelerationY\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The acceleration, in pixels per second squared.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setAccelerationY: function (value)\r\n {\r\n this.acceleration.y = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Enables or disables drag.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setAllowDrag\r\n * @since 3.9.0\r\n * @see Phaser.Physics.Arcade.Body#allowDrag\r\n *\r\n * @param {boolean} [value=true] - `true` to allow drag on this body, or `false` to disable it.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setAllowDrag: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.allowDrag = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Enables or disables gravity's effect on this Body.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setAllowGravity\r\n * @since 3.9.0\r\n * @see Phaser.Physics.Arcade.Body#allowGravity\r\n *\r\n * @param {boolean} [value=true] - `true` to allow gravity on this body, or `false` to disable it.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setAllowGravity: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.allowGravity = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Enables or disables rotation.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setAllowRotation\r\n * @since 3.9.0\r\n * @see Phaser.Physics.Arcade.Body#allowRotation\r\n *\r\n * @param {boolean} [value=true] - `true` to allow rotation on this body, or `false` to disable it.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setAllowRotation: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.allowRotation = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's drag.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setDrag\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal component, in pixels per second squared.\r\n * @param {number} y - The vertical component, in pixels per second squared.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setDrag: function (x, y)\r\n {\r\n this.drag.set(x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's horizontal drag.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setDragX\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The drag, in pixels per second squared.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setDragX: function (value)\r\n {\r\n this.drag.x = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's vertical drag.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setDragY\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The drag, in pixels per second squared.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setDragY: function (value)\r\n {\r\n this.drag.y = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's gravity.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setGravity\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal component, in pixels per second squared.\r\n * @param {number} y - The vertical component, in pixels per second squared.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setGravity: function (x, y)\r\n {\r\n this.gravity.set(x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's horizontal gravity.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setGravityX\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The gravity, in pixels per second squared.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setGravityX: function (value)\r\n {\r\n this.gravity.x = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's vertical gravity.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setGravityY\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The gravity, in pixels per second squared.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setGravityY: function (value)\r\n {\r\n this.gravity.y = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's friction.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setFriction\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal component, relative to 1.\r\n * @param {number} y - The vertical component, relative to 1.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setFriction: function (x, y)\r\n {\r\n this.friction.set(x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's horizontal friction.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setFrictionX\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The friction value, relative to 1.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setFrictionX: function (value)\r\n {\r\n this.friction.x = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's vertical friction.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setFrictionY\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The friction value, relative to 1.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setFrictionY: function (value)\r\n {\r\n this.friction.y = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's angular velocity.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setAngularVelocity\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The velocity, in degrees per second.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setAngularVelocity: function (value)\r\n {\r\n this.angularVelocity = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's angular acceleration.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setAngularAcceleration\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The acceleration, in degrees per second squared.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setAngularAcceleration: function (value)\r\n {\r\n this.angularAcceleration = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's angular drag.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setAngularDrag\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The drag, in degrees per second squared.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setAngularDrag: function (value)\r\n {\r\n this.angularDrag = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's mass.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setMass\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The mass value, relative to 1.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setMass: function (value)\r\n {\r\n this.mass = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's `immovable` property.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setImmovable\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [value=true] - The value to assign to `immovable`.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setImmovable: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.immovable = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Body's `enable` property.\r\n *\r\n * @method Phaser.Physics.Arcade.Body#setEnable\r\n * @since 3.15.0\r\n *\r\n * @param {boolean} [value=true] - The value to assign to `enable`.\r\n *\r\n * @return {Phaser.Physics.Arcade.Body} This Body object.\r\n */\r\n setEnable: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.enable = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The Body's horizontal position (left edge).\r\n *\r\n * @name Phaser.Physics.Arcade.Body#x\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n x: {\r\n\r\n get: function ()\r\n {\r\n return this.position.x;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.position.x = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Body's vertical position (top edge).\r\n *\r\n * @name Phaser.Physics.Arcade.Body#y\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n y: {\r\n\r\n get: function ()\r\n {\r\n return this.position.y;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.position.y = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The left edge of the Body's boundary. Identical to x.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#left\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n left: {\r\n\r\n get: function ()\r\n {\r\n return this.position.x;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The right edge of the Body's boundary.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#right\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n right: {\r\n\r\n get: function ()\r\n {\r\n return this.position.x + this.width;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The top edge of the Body's boundary. Identical to y.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#top\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n top: {\r\n\r\n get: function ()\r\n {\r\n return this.position.y;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The bottom edge of this Body's boundary.\r\n *\r\n * @name Phaser.Physics.Arcade.Body#bottom\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n bottom: {\r\n\r\n get: function ()\r\n {\r\n return this.position.y + this.height;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Body;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/Body.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/Collider.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/Collider.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * An Arcade Physics Collider will automatically check for collision, or overlaps, between two objects\r\n * every step. If a collision, or overlap, occurs it will invoke the given callbacks.\r\n *\r\n * @class Collider\r\n * @memberof Phaser.Physics.Arcade\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.World} world - The Arcade physics World that will manage the collisions.\r\n * @param {boolean} overlapOnly - Whether to check for collisions or overlap.\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision.\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for collision.\r\n * @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide.\r\n * @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean.\r\n * @param {any} callbackContext - The scope in which to call the callbacks.\r\n */\r\nvar Collider = new Class({\r\n\r\n initialize:\r\n\r\n function Collider (world, overlapOnly, object1, object2, collideCallback, processCallback, callbackContext)\r\n {\r\n /**\r\n * The world in which the bodies will collide.\r\n *\r\n * @name Phaser.Physics.Arcade.Collider#world\r\n * @type {Phaser.Physics.Arcade.World}\r\n * @since 3.0.0\r\n */\r\n this.world = world;\r\n\r\n /**\r\n * The name of the collider (unused by Phaser).\r\n *\r\n * @name Phaser.Physics.Arcade.Collider#name\r\n * @type {string}\r\n * @since 3.1.0\r\n */\r\n this.name = '';\r\n\r\n /**\r\n * Whether the collider is active.\r\n *\r\n * @name Phaser.Physics.Arcade.Collider#active\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.active = true;\r\n\r\n /**\r\n * Whether to check for collisions or overlaps.\r\n *\r\n * @name Phaser.Physics.Arcade.Collider#overlapOnly\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.overlapOnly = overlapOnly;\r\n\r\n /**\r\n * The first object to check for collision.\r\n *\r\n * @name Phaser.Physics.Arcade.Collider#object1\r\n * @type {Phaser.Types.Physics.Arcade.ArcadeColliderType}\r\n * @since 3.0.0\r\n */\r\n this.object1 = object1;\r\n\r\n /**\r\n * The second object to check for collision.\r\n *\r\n * @name Phaser.Physics.Arcade.Collider#object2\r\n * @type {Phaser.Types.Physics.Arcade.ArcadeColliderType}\r\n * @since 3.0.0\r\n */\r\n this.object2 = object2;\r\n\r\n /**\r\n * The callback to invoke when the two objects collide.\r\n *\r\n * @name Phaser.Physics.Arcade.Collider#collideCallback\r\n * @type {ArcadePhysicsCallback}\r\n * @since 3.0.0\r\n */\r\n this.collideCallback = collideCallback;\r\n\r\n /**\r\n * If a processCallback exists it must return true or collision checking will be skipped.\r\n *\r\n * @name Phaser.Physics.Arcade.Collider#processCallback\r\n * @type {ArcadePhysicsCallback}\r\n * @since 3.0.0\r\n */\r\n this.processCallback = processCallback;\r\n\r\n /**\r\n * The context the collideCallback and processCallback will run in.\r\n *\r\n * @name Phaser.Physics.Arcade.Collider#callbackContext\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.callbackContext = callbackContext;\r\n },\r\n\r\n /**\r\n * A name for the Collider.\r\n * \r\n * Phaser does not use this value, it's for your own reference.\r\n *\r\n * @method Phaser.Physics.Arcade.Collider#setName\r\n * @since 3.1.0\r\n *\r\n * @param {string} name - The name to assign to the Collider.\r\n *\r\n * @return {Phaser.Physics.Arcade.Collider} This Collider instance.\r\n */\r\n setName: function (name)\r\n {\r\n this.name = name;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Called by World as part of its step processing, initial operation of collision checking.\r\n *\r\n * @method Phaser.Physics.Arcade.Collider#update\r\n * @since 3.0.0\r\n */\r\n update: function ()\r\n {\r\n this.world.collideObjects(\r\n this.object1,\r\n this.object2,\r\n this.collideCallback,\r\n this.processCallback,\r\n this.callbackContext,\r\n this.overlapOnly\r\n );\r\n },\r\n\r\n /**\r\n * Removes Collider from World and disposes of its resources.\r\n *\r\n * @method Phaser.Physics.Arcade.Collider#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.world.removeCollider(this);\r\n\r\n this.active = false;\r\n\r\n this.world = null;\r\n\r\n this.object1 = null;\r\n this.object2 = null;\r\n\r\n this.collideCallback = null;\r\n this.processCallback = null;\r\n this.callbackContext = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Collider;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/Collider.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/Factory.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/Factory.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ArcadeImage = __webpack_require__(/*! ./ArcadeImage */ \"./node_modules/phaser/src/physics/arcade/ArcadeImage.js\");\r\nvar ArcadeSprite = __webpack_require__(/*! ./ArcadeSprite */ \"./node_modules/phaser/src/physics/arcade/ArcadeSprite.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/physics/arcade/const.js\");\r\nvar PhysicsGroup = __webpack_require__(/*! ./PhysicsGroup */ \"./node_modules/phaser/src/physics/arcade/PhysicsGroup.js\");\r\nvar StaticPhysicsGroup = __webpack_require__(/*! ./StaticPhysicsGroup */ \"./node_modules/phaser/src/physics/arcade/StaticPhysicsGroup.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Arcade Physics Factory allows you to easily create Arcade Physics enabled Game Objects.\r\n * Objects that are created by this Factory are automatically added to the physics world.\r\n *\r\n * @class Factory\r\n * @memberof Phaser.Physics.Arcade\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.World} world - The Arcade Physics World instance.\r\n */\r\nvar Factory = new Class({\r\n\r\n initialize:\r\n\r\n function Factory (world)\r\n {\r\n /**\r\n * A reference to the Arcade Physics World.\r\n *\r\n * @name Phaser.Physics.Arcade.Factory#world\r\n * @type {Phaser.Physics.Arcade.World}\r\n * @since 3.0.0\r\n */\r\n this.world = world;\r\n\r\n /**\r\n * A reference to the Scene this Arcade Physics instance belongs to.\r\n *\r\n * @name Phaser.Physics.Arcade.Factory#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = world.scene;\r\n\r\n /**\r\n * A reference to the Scene.Systems this Arcade Physics instance belongs to.\r\n *\r\n * @name Phaser.Physics.Arcade.Factory#sys\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.sys = world.scene.sys;\r\n },\r\n\r\n /**\r\n * Creates a new Arcade Physics Collider object.\r\n *\r\n * @method Phaser.Physics.Arcade.Factory#collider\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object1 - The first object to check for collision.\r\n * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object2 - The second object to check for collision.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide.\r\n * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean.\r\n * @param {*} [callbackContext] - The scope in which to call the callbacks.\r\n *\r\n * @return {Phaser.Physics.Arcade.Collider} The Collider that was created.\r\n */\r\n collider: function (object1, object2, collideCallback, processCallback, callbackContext)\r\n {\r\n return this.world.addCollider(object1, object2, collideCallback, processCallback, callbackContext);\r\n },\r\n\r\n /**\r\n * Creates a new Arcade Physics Collider Overlap object.\r\n *\r\n * @method Phaser.Physics.Arcade.Factory#overlap\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object1 - The first object to check for overlap.\r\n * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object2 - The second object to check for overlap.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide.\r\n * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean.\r\n * @param {*} [callbackContext] - The scope in which to call the callbacks.\r\n *\r\n * @return {Phaser.Physics.Arcade.Collider} The Collider that was created.\r\n */\r\n overlap: function (object1, object2, collideCallback, processCallback, callbackContext)\r\n {\r\n return this.world.addOverlap(object1, object2, collideCallback, processCallback, callbackContext);\r\n },\r\n\r\n /**\r\n * Adds an Arcade Physics Body to the given Game Object.\r\n *\r\n * @method Phaser.Physics.Arcade.Factory#existing\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - A Game Object.\r\n * @param {boolean} [isStatic=false] - Create a Static body (true) or Dynamic body (false).\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object.\r\n */\r\n existing: function (gameObject, isStatic)\r\n {\r\n var type = (isStatic) ? CONST.STATIC_BODY : CONST.DYNAMIC_BODY;\r\n\r\n this.world.enableBody(gameObject, type);\r\n\r\n return gameObject;\r\n },\r\n\r\n /**\r\n * Creates a new Arcade Image object with a Static body.\r\n *\r\n * @method Phaser.Physics.Arcade.Factory#staticImage\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n *\r\n * @return {Phaser.Physics.Arcade.Image} The Image object that was created.\r\n */\r\n staticImage: function (x, y, key, frame)\r\n {\r\n var image = new ArcadeImage(this.scene, x, y, key, frame);\r\n\r\n this.sys.displayList.add(image);\r\n\r\n this.world.enableBody(image, CONST.STATIC_BODY);\r\n\r\n return image;\r\n },\r\n\r\n /**\r\n * Creates a new Arcade Image object with a Dynamic body.\r\n *\r\n * @method Phaser.Physics.Arcade.Factory#image\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n *\r\n * @return {Phaser.Physics.Arcade.Image} The Image object that was created.\r\n */\r\n image: function (x, y, key, frame)\r\n {\r\n var image = new ArcadeImage(this.scene, x, y, key, frame);\r\n\r\n this.sys.displayList.add(image);\r\n\r\n this.world.enableBody(image, CONST.DYNAMIC_BODY);\r\n\r\n return image;\r\n },\r\n\r\n /**\r\n * Creates a new Arcade Sprite object with a Static body.\r\n *\r\n * @method Phaser.Physics.Arcade.Factory#staticSprite\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n *\r\n * @return {Phaser.Physics.Arcade.Sprite} The Sprite object that was created.\r\n */\r\n staticSprite: function (x, y, key, frame)\r\n {\r\n var sprite = new ArcadeSprite(this.scene, x, y, key, frame);\r\n\r\n this.sys.displayList.add(sprite);\r\n this.sys.updateList.add(sprite);\r\n\r\n this.world.enableBody(sprite, CONST.STATIC_BODY);\r\n\r\n return sprite;\r\n },\r\n\r\n /**\r\n * Creates a new Arcade Sprite object with a Dynamic body.\r\n *\r\n * @method Phaser.Physics.Arcade.Factory#sprite\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n *\r\n * @return {Phaser.Physics.Arcade.Sprite} The Sprite object that was created.\r\n */\r\n sprite: function (x, y, key, frame)\r\n {\r\n var sprite = new ArcadeSprite(this.scene, x, y, key, frame);\r\n\r\n this.sys.displayList.add(sprite);\r\n this.sys.updateList.add(sprite);\r\n\r\n this.world.enableBody(sprite, CONST.DYNAMIC_BODY);\r\n\r\n return sprite;\r\n },\r\n\r\n /**\r\n * Creates a Static Physics Group object.\r\n * All Game Objects created by this Group will automatically be static Arcade Physics objects.\r\n *\r\n * @method Phaser.Physics.Arcade.Factory#staticGroup\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.\r\n * @param {Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} [config] - Settings for this group.\r\n *\r\n * @return {Phaser.Physics.Arcade.StaticGroup} The Static Group object that was created.\r\n */\r\n staticGroup: function (children, config)\r\n {\r\n return this.sys.updateList.add(new StaticPhysicsGroup(this.world, this.world.scene, children, config));\r\n },\r\n\r\n /**\r\n * Creates a Physics Group object.\r\n * All Game Objects created by this Group will automatically be dynamic Arcade Physics objects.\r\n *\r\n * @method Phaser.Physics.Arcade.Factory#group\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.Physics.Arcade.PhysicsGroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.\r\n * @param {Phaser.Types.Physics.Arcade.PhysicsGroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} [config] - Settings for this group.\r\n *\r\n * @return {Phaser.Physics.Arcade.Group} The Group object that was created.\r\n */\r\n group: function (children, config)\r\n {\r\n return this.sys.updateList.add(new PhysicsGroup(this.world, this.world.scene, children, config));\r\n },\r\n\r\n /**\r\n * Destroys this Factory.\r\n *\r\n * @method Phaser.Physics.Arcade.Factory#destroy\r\n * @since 3.5.0\r\n */\r\n destroy: function ()\r\n {\r\n this.world = null;\r\n this.scene = null;\r\n this.sys = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Factory;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/Factory.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/GetOverlapX.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/GetOverlapX.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/physics/arcade/const.js\");\r\n\r\n/**\r\n * Calculates and returns the horizontal overlap between two arcade physics bodies and sets their properties\r\n * accordingly, including: `touching.left`, `touching.right`, `touching.none` and `overlapX'.\r\n *\r\n * @function Phaser.Physics.Arcade.GetOverlapX\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Body} body1 - The first Body to separate.\r\n * @param {Phaser.Physics.Arcade.Body} body2 - The second Body to separate.\r\n * @param {boolean} overlapOnly - Is this an overlap only check, or part of separation?\r\n * @param {number} bias - A value added to the delta values during collision checks. Increase it to prevent sprite tunneling(sprites passing through another instead of colliding).\r\n *\r\n * @return {number} The amount of overlap.\r\n */\r\nvar GetOverlapX = function (body1, body2, overlapOnly, bias)\r\n{\r\n var overlap = 0;\r\n var maxOverlap = body1.deltaAbsX() + body2.deltaAbsX() + bias;\r\n\r\n if (body1._dx === 0 && body2._dx === 0)\r\n {\r\n // They overlap but neither of them are moving\r\n body1.embedded = true;\r\n body2.embedded = true;\r\n }\r\n else if (body1._dx > body2._dx)\r\n {\r\n // Body1 is moving right and / or Body2 is moving left\r\n overlap = body1.right - body2.x;\r\n\r\n if ((overlap > maxOverlap && !overlapOnly) || body1.checkCollision.right === false || body2.checkCollision.left === false)\r\n {\r\n overlap = 0;\r\n }\r\n else\r\n {\r\n body1.touching.none = false;\r\n body1.touching.right = true;\r\n\r\n body2.touching.none = false;\r\n body2.touching.left = true;\r\n\r\n if (body2.physicsType === CONST.STATIC_BODY)\r\n {\r\n body1.blocked.none = false;\r\n body1.blocked.right = true;\r\n }\r\n\r\n if (body1.physicsType === CONST.STATIC_BODY)\r\n {\r\n body2.blocked.none = false;\r\n body2.blocked.left = true;\r\n }\r\n }\r\n }\r\n else if (body1._dx < body2._dx)\r\n {\r\n // Body1 is moving left and/or Body2 is moving right\r\n overlap = body1.x - body2.width - body2.x;\r\n\r\n if ((-overlap > maxOverlap && !overlapOnly) || body1.checkCollision.left === false || body2.checkCollision.right === false)\r\n {\r\n overlap = 0;\r\n }\r\n else\r\n {\r\n body1.touching.none = false;\r\n body1.touching.left = true;\r\n\r\n body2.touching.none = false;\r\n body2.touching.right = true;\r\n\r\n if (body2.physicsType === CONST.STATIC_BODY)\r\n {\r\n body1.blocked.none = false;\r\n body1.blocked.left = true;\r\n }\r\n\r\n if (body1.physicsType === CONST.STATIC_BODY)\r\n {\r\n body2.blocked.none = false;\r\n body2.blocked.right = true;\r\n }\r\n }\r\n }\r\n\r\n // Resets the overlapX to zero if there is no overlap, or to the actual pixel value if there is\r\n body1.overlapX = overlap;\r\n body2.overlapX = overlap;\r\n\r\n return overlap;\r\n};\r\n\r\nmodule.exports = GetOverlapX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/GetOverlapX.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/GetOverlapY.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/GetOverlapY.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/physics/arcade/const.js\");\r\n\r\n/**\r\n * Calculates and returns the vertical overlap between two arcade physics bodies and sets their properties\r\n * accordingly, including: `touching.up`, `touching.down`, `touching.none` and `overlapY'.\r\n *\r\n * @function Phaser.Physics.Arcade.GetOverlapY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Body} body1 - The first Body to separate.\r\n * @param {Phaser.Physics.Arcade.Body} body2 - The second Body to separate.\r\n * @param {boolean} overlapOnly - Is this an overlap only check, or part of separation?\r\n * @param {number} bias - A value added to the delta values during collision checks. Increase it to prevent sprite tunneling(sprites passing through another instead of colliding).\r\n *\r\n * @return {number} The amount of overlap.\r\n */\r\nvar GetOverlapY = function (body1, body2, overlapOnly, bias)\r\n{\r\n var overlap = 0;\r\n var maxOverlap = body1.deltaAbsY() + body2.deltaAbsY() + bias;\r\n\r\n if (body1._dy === 0 && body2._dy === 0)\r\n {\r\n // They overlap but neither of them are moving\r\n body1.embedded = true;\r\n body2.embedded = true;\r\n }\r\n else if (body1._dy > body2._dy)\r\n {\r\n // Body1 is moving down and/or Body2 is moving up\r\n overlap = body1.bottom - body2.y;\r\n\r\n if ((overlap > maxOverlap && !overlapOnly) || body1.checkCollision.down === false || body2.checkCollision.up === false)\r\n {\r\n overlap = 0;\r\n }\r\n else\r\n {\r\n body1.touching.none = false;\r\n body1.touching.down = true;\r\n\r\n body2.touching.none = false;\r\n body2.touching.up = true;\r\n\r\n if (body2.physicsType === CONST.STATIC_BODY)\r\n {\r\n body1.blocked.none = false;\r\n body1.blocked.down = true;\r\n }\r\n\r\n if (body1.physicsType === CONST.STATIC_BODY)\r\n {\r\n body2.blocked.none = false;\r\n body2.blocked.up = true;\r\n }\r\n }\r\n }\r\n else if (body1._dy < body2._dy)\r\n {\r\n // Body1 is moving up and/or Body2 is moving down\r\n overlap = body1.y - body2.bottom;\r\n\r\n if ((-overlap > maxOverlap && !overlapOnly) || body1.checkCollision.up === false || body2.checkCollision.down === false)\r\n {\r\n overlap = 0;\r\n }\r\n else\r\n {\r\n body1.touching.none = false;\r\n body1.touching.up = true;\r\n\r\n body2.touching.none = false;\r\n body2.touching.down = true;\r\n\r\n if (body2.physicsType === CONST.STATIC_BODY)\r\n {\r\n body1.blocked.none = false;\r\n body1.blocked.up = true;\r\n }\r\n\r\n if (body1.physicsType === CONST.STATIC_BODY)\r\n {\r\n body2.blocked.none = false;\r\n body2.blocked.down = true;\r\n }\r\n }\r\n }\r\n\r\n // Resets the overlapY to zero if there is no overlap, or to the actual pixel value if there is\r\n body1.overlapY = overlap;\r\n body2.overlapY = overlap;\r\n\r\n return overlap;\r\n};\r\n\r\nmodule.exports = GetOverlapY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/GetOverlapY.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/PhysicsGroup.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/PhysicsGroup.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ArcadeSprite = __webpack_require__(/*! ./ArcadeSprite */ \"./node_modules/phaser/src/physics/arcade/ArcadeSprite.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/physics/arcade/const.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar Group = __webpack_require__(/*! ../../gameobjects/group/Group */ \"./node_modules/phaser/src/gameobjects/group/Group.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * An Arcade Physics Group object.\r\n *\r\n * All Game Objects created by this Group will automatically be given dynamic Arcade Physics bodies.\r\n *\r\n * Its static counterpart is {@link Phaser.Physics.Arcade.StaticGroup}.\r\n *\r\n * @class Group\r\n * @extends Phaser.GameObjects.Group\r\n * @memberof Phaser.Physics.Arcade\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.World} world - The physics simulation.\r\n * @param {Phaser.Scene} scene - The scene this group belongs to.\r\n * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.Physics.Arcade.PhysicsGroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.\r\n * @param {Phaser.Types.Physics.Arcade.PhysicsGroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} [config] - Settings for this group.\r\n */\r\nvar PhysicsGroup = new Class({\r\n\r\n Extends: Group,\r\n\r\n initialize:\r\n\r\n function PhysicsGroup (world, scene, children, config)\r\n {\r\n if (!children && !config)\r\n {\r\n config = {\r\n internalCreateCallback: this.createCallbackHandler,\r\n internalRemoveCallback: this.removeCallbackHandler\r\n };\r\n }\r\n else if (IsPlainObject(children))\r\n {\r\n // children is a plain object, so swizzle them:\r\n config = children;\r\n children = null;\r\n\r\n config.internalCreateCallback = this.createCallbackHandler;\r\n config.internalRemoveCallback = this.removeCallbackHandler;\r\n }\r\n else if (Array.isArray(children) && IsPlainObject(children[0]))\r\n {\r\n // children is an array of plain objects\r\n config = children[0];\r\n\r\n var _this = this;\r\n\r\n children.forEach(function (singleConfig)\r\n {\r\n singleConfig.internalCreateCallback = _this.createCallbackHandler;\r\n singleConfig.internalRemoveCallback = _this.removeCallbackHandler;\r\n });\r\n }\r\n else\r\n {\r\n // config is not defined and children is not a plain object nor an array of plain objects\r\n config = {\r\n internalCreateCallback: this.createCallbackHandler,\r\n internalRemoveCallback: this.removeCallbackHandler\r\n };\r\n }\r\n\r\n /**\r\n * The physics simulation.\r\n *\r\n * @name Phaser.Physics.Arcade.Group#world\r\n * @type {Phaser.Physics.Arcade.World}\r\n * @since 3.0.0\r\n */\r\n this.world = world;\r\n\r\n /**\r\n * The class to create new Group members from.\r\n *\r\n * This should be either `Phaser.Physics.Arcade.Image`, `Phaser.Physics.Arcade.Sprite`, or a class extending one of those.\r\n *\r\n * @name Phaser.Physics.Arcade.Group#classType\r\n * @type {Function}\r\n * @default ArcadeSprite\r\n * @since 3.0.0\r\n */\r\n config.classType = GetFastValue(config, 'classType', ArcadeSprite);\r\n\r\n /**\r\n * The physics type of the Group's members.\r\n *\r\n * @name Phaser.Physics.Arcade.Group#physicsType\r\n * @type {integer}\r\n * @default Phaser.Physics.Arcade.DYNAMIC_BODY\r\n * @since 3.0.0\r\n */\r\n this.physicsType = CONST.DYNAMIC_BODY;\r\n\r\n /**\r\n * Default physics properties applied to Game Objects added to the Group or created by the Group. Derived from the `config` argument.\r\n *\r\n * @name Phaser.Physics.Arcade.Group#defaults\r\n * @type {Phaser.Types.Physics.Arcade.PhysicsGroupDefaults}\r\n * @since 3.0.0\r\n */\r\n this.defaults = {\r\n setCollideWorldBounds: GetFastValue(config, 'collideWorldBounds', false),\r\n setBoundsRectangle: GetFastValue(config, 'customBoundsRectangle', null),\r\n setAccelerationX: GetFastValue(config, 'accelerationX', 0),\r\n setAccelerationY: GetFastValue(config, 'accelerationY', 0),\r\n setAllowDrag: GetFastValue(config, 'allowDrag', true),\r\n setAllowGravity: GetFastValue(config, 'allowGravity', true),\r\n setAllowRotation: GetFastValue(config, 'allowRotation', true),\r\n setBounceX: GetFastValue(config, 'bounceX', 0),\r\n setBounceY: GetFastValue(config, 'bounceY', 0),\r\n setDragX: GetFastValue(config, 'dragX', 0),\r\n setDragY: GetFastValue(config, 'dragY', 0),\r\n setEnable: GetFastValue(config, 'enable', true),\r\n setGravityX: GetFastValue(config, 'gravityX', 0),\r\n setGravityY: GetFastValue(config, 'gravityY', 0),\r\n setFrictionX: GetFastValue(config, 'frictionX', 0),\r\n setFrictionY: GetFastValue(config, 'frictionY', 0),\r\n setVelocityX: GetFastValue(config, 'velocityX', 0),\r\n setVelocityY: GetFastValue(config, 'velocityY', 0),\r\n setAngularVelocity: GetFastValue(config, 'angularVelocity', 0),\r\n setAngularAcceleration: GetFastValue(config, 'angularAcceleration', 0),\r\n setAngularDrag: GetFastValue(config, 'angularDrag', 0),\r\n setMass: GetFastValue(config, 'mass', 1),\r\n setImmovable: GetFastValue(config, 'immovable', false)\r\n };\r\n\r\n if (Array.isArray(children))\r\n {\r\n config = null;\r\n }\r\n\r\n Group.call(this, scene, children, config);\r\n\r\n /**\r\n * A textual representation of this Game Object.\r\n * Used internally by Phaser but is available for your own custom classes to populate.\r\n *\r\n * @name Phaser.Physics.Arcade.Group#type\r\n * @type {string}\r\n * @default 'PhysicsGroup'\r\n * @since 3.21.0\r\n */\r\n this.type = 'PhysicsGroup';\r\n },\r\n\r\n /**\r\n * Enables a Game Object's Body and assigns `defaults`. Called when a Group member is added or created.\r\n *\r\n * @method Phaser.Physics.Arcade.Group#createCallbackHandler\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object being added.\r\n */\r\n createCallbackHandler: function (child)\r\n {\r\n if (!child.body)\r\n {\r\n this.world.enableBody(child, CONST.DYNAMIC_BODY);\r\n }\r\n\r\n var body = child.body;\r\n\r\n for (var key in this.defaults)\r\n {\r\n body[key](this.defaults[key]);\r\n }\r\n },\r\n\r\n /**\r\n * Disables a Game Object's Body. Called when a Group member is removed.\r\n *\r\n * @method Phaser.Physics.Arcade.Group#removeCallbackHandler\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object being removed.\r\n */\r\n removeCallbackHandler: function (child)\r\n {\r\n if (child.body)\r\n {\r\n this.world.disableBody(child);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the velocity of each Group member.\r\n *\r\n * @method Phaser.Physics.Arcade.Group#setVelocity\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal velocity.\r\n * @param {number} y - The vertical velocity.\r\n * @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.\r\n *\r\n * @return {Phaser.Physics.Arcade.Group} This Physics Group object.\r\n */\r\n setVelocity: function (x, y, step)\r\n {\r\n if (step === undefined) { step = 0; }\r\n\r\n var items = this.getChildren();\r\n\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n items[i].body.velocity.set(x + (i * step), y + (i * step));\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal velocity of each Group member.\r\n *\r\n * @method Phaser.Physics.Arcade.Group#setVelocityX\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The velocity value.\r\n * @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (x), the second (x + step), and so on.\r\n *\r\n * @return {Phaser.Physics.Arcade.Group} This Physics Group object.\r\n */\r\n setVelocityX: function (value, step)\r\n {\r\n if (step === undefined) { step = 0; }\r\n\r\n var items = this.getChildren();\r\n\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n items[i].body.velocity.x = value + (i * step);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the vertical velocity of each Group member.\r\n *\r\n * @method Phaser.Physics.Arcade.Group#setVelocityY\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The velocity value.\r\n * @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (y), the second (y + step), and so on.\r\n *\r\n * @return {Phaser.Physics.Arcade.Group} This Physics Group object.\r\n */\r\n setVelocityY: function (value, step)\r\n {\r\n if (step === undefined) { step = 0; }\r\n\r\n var items = this.getChildren();\r\n\r\n for (var i = 0; i < items.length; i++)\r\n {\r\n items[i].body.velocity.y = value + (i * step);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = PhysicsGroup;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/PhysicsGroup.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/SeparateX.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/SeparateX.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetOverlapX = __webpack_require__(/*! ./GetOverlapX */ \"./node_modules/phaser/src/physics/arcade/GetOverlapX.js\");\r\n\r\n/**\r\n * Separates two overlapping bodies on the X-axis (horizontally).\r\n *\r\n * Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection.\r\n *\r\n * The bodies won't be separated if there is no horizontal overlap between them, if they are static, or if either one uses custom logic for its separation.\r\n *\r\n * @function Phaser.Physics.Arcade.SeparateX\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Body} body1 - The first Body to separate.\r\n * @param {Phaser.Physics.Arcade.Body} body2 - The second Body to separate.\r\n * @param {boolean} overlapOnly - If `true`, the bodies will only have their overlap data set and no separation will take place.\r\n * @param {number} bias - A value to add to the delta value during overlap checking. Used to prevent sprite tunneling.\r\n *\r\n * @return {boolean} `true` if the two bodies overlap horizontally, otherwise `false`.\r\n */\r\nvar SeparateX = function (body1, body2, overlapOnly, bias)\r\n{\r\n var overlap = GetOverlapX(body1, body2, overlapOnly, bias);\r\n\r\n // Can't separate two immovable bodies, or a body with its own custom separation logic\r\n if (overlapOnly || overlap === 0 || (body1.immovable && body2.immovable) || body1.customSeparateX || body2.customSeparateX)\r\n {\r\n // return true if there was some overlap, otherwise false\r\n return (overlap !== 0) || (body1.embedded && body2.embedded);\r\n }\r\n\r\n // Adjust their positions and velocities accordingly (if there was any overlap)\r\n var v1 = body1.velocity.x;\r\n var v2 = body2.velocity.x;\r\n\r\n if (!body1.immovable && !body2.immovable)\r\n {\r\n overlap *= 0.5;\r\n\r\n body1.x -= overlap;\r\n body2.x += overlap;\r\n\r\n var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1);\r\n var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1);\r\n var avg = (nv1 + nv2) * 0.5;\r\n\r\n nv1 -= avg;\r\n nv2 -= avg;\r\n\r\n body1.velocity.x = avg + nv1 * body1.bounce.x;\r\n body2.velocity.x = avg + nv2 * body2.bounce.x;\r\n }\r\n else if (!body1.immovable)\r\n {\r\n body1.x -= overlap;\r\n body1.velocity.x = v2 - v1 * body1.bounce.x;\r\n\r\n // This is special case code that handles things like vertically moving platforms you can ride\r\n if (body2.moves)\r\n {\r\n body1.y += (body2.y - body2.prev.y) * body2.friction.y;\r\n }\r\n }\r\n else\r\n {\r\n body2.x += overlap;\r\n body2.velocity.x = v1 - v2 * body2.bounce.x;\r\n\r\n // This is special case code that handles things like vertically moving platforms you can ride\r\n if (body1.moves)\r\n {\r\n body2.y += (body1.y - body1.prev.y) * body1.friction.y;\r\n }\r\n }\r\n\r\n // If we got this far then there WAS overlap, and separation is complete, so return true\r\n return true;\r\n};\r\n\r\nmodule.exports = SeparateX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/SeparateX.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/SeparateY.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/SeparateY.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetOverlapY = __webpack_require__(/*! ./GetOverlapY */ \"./node_modules/phaser/src/physics/arcade/GetOverlapY.js\");\r\n\r\n/**\r\n * Separates two overlapping bodies on the Y-axis (vertically).\r\n *\r\n * Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection.\r\n *\r\n * The bodies won't be separated if there is no vertical overlap between them, if they are static, or if either one uses custom logic for its separation.\r\n *\r\n * @function Phaser.Physics.Arcade.SeparateY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Body} body1 - The first Body to separate.\r\n * @param {Phaser.Physics.Arcade.Body} body2 - The second Body to separate.\r\n * @param {boolean} overlapOnly - If `true`, the bodies will only have their overlap data set and no separation will take place.\r\n * @param {number} bias - A value to add to the delta value during overlap checking. Used to prevent sprite tunneling.\r\n *\r\n * @return {boolean} `true` if the two bodies overlap vertically, otherwise `false`.\r\n */\r\nvar SeparateY = function (body1, body2, overlapOnly, bias)\r\n{\r\n var overlap = GetOverlapY(body1, body2, overlapOnly, bias);\r\n\r\n // Can't separate two immovable bodies, or a body with its own custom separation logic\r\n if (overlapOnly || overlap === 0 || (body1.immovable && body2.immovable) || body1.customSeparateY || body2.customSeparateY)\r\n {\r\n // return true if there was some overlap, otherwise false\r\n return (overlap !== 0) || (body1.embedded && body2.embedded);\r\n }\r\n\r\n // Adjust their positions and velocities accordingly (if there was any overlap)\r\n var v1 = body1.velocity.y;\r\n var v2 = body2.velocity.y;\r\n\r\n if (!body1.immovable && !body2.immovable)\r\n {\r\n overlap *= 0.5;\r\n\r\n body1.y -= overlap;\r\n body2.y += overlap;\r\n\r\n var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1);\r\n var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1);\r\n var avg = (nv1 + nv2) * 0.5;\r\n\r\n nv1 -= avg;\r\n nv2 -= avg;\r\n\r\n body1.velocity.y = avg + nv1 * body1.bounce.y;\r\n body2.velocity.y = avg + nv2 * body2.bounce.y;\r\n }\r\n else if (!body1.immovable)\r\n {\r\n body1.y -= overlap;\r\n body1.velocity.y = v2 - v1 * body1.bounce.y;\r\n\r\n // This is special case code that handles things like horizontal moving platforms you can ride\r\n if (body2.moves)\r\n {\r\n body1.x += (body2.x - body2.prev.x) * body2.friction.x;\r\n }\r\n }\r\n else\r\n {\r\n body2.y += overlap;\r\n body2.velocity.y = v1 - v2 * body2.bounce.y;\r\n\r\n // This is special case code that handles things like horizontal moving platforms you can ride\r\n if (body1.moves)\r\n {\r\n body2.x += (body1.x - body1.prev.x) * body1.friction.x;\r\n }\r\n }\r\n\r\n // If we got this far then there WAS overlap, and separation is complete, so return true\r\n return true;\r\n};\r\n\r\nmodule.exports = SeparateY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/SeparateY.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/StaticBody.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/StaticBody.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CircleContains = __webpack_require__(/*! ../../geom/circle/Contains */ \"./node_modules/phaser/src/geom/circle/Contains.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/physics/arcade/const.js\");\r\nvar RectangleContains = __webpack_require__(/*! ../../geom/rectangle/Contains */ \"./node_modules/phaser/src/geom/rectangle/Contains.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Static Arcade Physics Body.\r\n *\r\n * A Static Body never moves, and isn't automatically synchronized with its parent Game Object.\r\n * 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.\r\n *\r\n * A Static Body can collide with other Bodies, but is never moved by collisions.\r\n *\r\n * Its dynamic counterpart is {@link Phaser.Physics.Arcade.Body}.\r\n *\r\n * @class StaticBody\r\n * @memberof Phaser.Physics.Arcade\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.World} world - The Arcade Physics simulation this Static Body belongs to.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object this Static Body belongs to.\r\n */\r\nvar StaticBody = new Class({\r\n\r\n initialize:\r\n\r\n function StaticBody (world, gameObject)\r\n {\r\n var width = (gameObject.width) ? gameObject.width : 64;\r\n var height = (gameObject.height) ? gameObject.height : 64;\r\n\r\n /**\r\n * The Arcade Physics simulation this Static Body belongs to.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#world\r\n * @type {Phaser.Physics.Arcade.World}\r\n * @since 3.0.0\r\n */\r\n this.world = world;\r\n\r\n /**\r\n * The Game Object this Static Body belongs to.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#gameObject\r\n * @type {Phaser.GameObjects.GameObject}\r\n * @since 3.0.0\r\n */\r\n this.gameObject = gameObject;\r\n\r\n /**\r\n * Whether the Static Body's boundary is drawn to the debug display.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#debugShowBody\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.debugShowBody = world.defaults.debugShowStaticBody;\r\n\r\n /**\r\n * The color of this Static Body on the debug display.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#debugBodyColor\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.debugBodyColor = world.defaults.staticBodyDebugColor;\r\n\r\n /**\r\n * Whether this Static Body is updated by the physics simulation.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#enable\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.enable = true;\r\n\r\n /**\r\n * Whether this Static Body's boundary is circular (`true`) or rectangular (`false`).\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#isCircle\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.isCircle = false;\r\n\r\n /**\r\n * If this Static Body is circular, this is the unscaled radius of the Static Body's boundary, as set by {@link #setCircle}, in source pixels.\r\n * The true radius is equal to `halfWidth`.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#radius\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.radius = 0;\r\n\r\n /**\r\n * The offset of this Static Body's actual position from any updated position.\r\n *\r\n * Unlike a dynamic Body, a Static Body does not follow its Game Object. As such, this offset is only applied when resizing the Static Body.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#offset\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.offset = new Vector2();\r\n\r\n /**\r\n * The position of this Static Body within the simulation.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#position\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.position = new Vector2(gameObject.x - gameObject.displayOriginX, gameObject.y - gameObject.displayOriginY);\r\n\r\n /**\r\n * The width of the Static Body's boundary, in pixels.\r\n * If the Static Body is circular, this is also the Static Body's diameter.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.width = width;\r\n\r\n /**\r\n * The height of the Static Body's boundary, in pixels.\r\n * If the Static Body is circular, this is also the Static Body's diameter.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.height = height;\r\n\r\n /**\r\n * Half the Static Body's width, in pixels.\r\n * If the Static Body is circular, this is also the Static Body's radius.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#halfWidth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.halfWidth = Math.abs(this.width / 2);\r\n\r\n /**\r\n * Half the Static Body's height, in pixels.\r\n * If the Static Body is circular, this is also the Static Body's radius.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#halfHeight\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.halfHeight = Math.abs(this.height / 2);\r\n\r\n /**\r\n * The center of the Static Body's boundary.\r\n * This is the midpoint of its `position` (top-left corner) and its bottom-right corner.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#center\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.center = new Vector2(gameObject.x + this.halfWidth, gameObject.y + this.halfHeight);\r\n\r\n /**\r\n * A constant zero velocity used by the Arcade Physics simulation for calculations.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#velocity\r\n * @type {Phaser.Math.Vector2}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.velocity = Vector2.ZERO;\r\n\r\n /**\r\n * A constant `false` value expected by the Arcade Physics simulation.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#allowGravity\r\n * @type {boolean}\r\n * @readonly\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.allowGravity = false;\r\n\r\n /**\r\n * Gravitational force applied specifically to this Body. Values are in pixels per second squared. Always zero for a Static Body.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#gravity\r\n * @type {Phaser.Math.Vector2}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.gravity = Vector2.ZERO;\r\n\r\n /**\r\n * Rebound, or restitution, following a collision, relative to 1. Always zero for a Static Body.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#bounce\r\n * @type {Phaser.Math.Vector2}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.bounce = Vector2.ZERO;\r\n\r\n // If true this Body will dispatch events\r\n\r\n /**\r\n * Whether the simulation emits a `worldbounds` event when this StaticBody collides with the world boundary.\r\n * Always false for a Static Body. (Static Bodies never collide with the world boundary and never trigger a `worldbounds` event.)\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#onWorldBounds\r\n * @type {boolean}\r\n * @readonly\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.onWorldBounds = false;\r\n\r\n /**\r\n * Whether the simulation emits a `collide` event when this StaticBody collides with another.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#onCollide\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.onCollide = false;\r\n\r\n /**\r\n * Whether the simulation emits an `overlap` event when this StaticBody overlaps with another.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#onOverlap\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.onOverlap = false;\r\n\r\n /**\r\n * The StaticBody's inertia, relative to a default unit (1). With `bounce`, this affects the exchange of momentum (velocities) during collisions.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#mass\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.mass = 1;\r\n\r\n /**\r\n * Whether this object can be moved by collisions with another body.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#immovable\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.immovable = true;\r\n\r\n /**\r\n * A flag disabling the default horizontal separation of colliding bodies. Pass your own `collideHandler` to the collider.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#customSeparateX\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.customSeparateX = false;\r\n\r\n /**\r\n * A flag disabling the default vertical separation of colliding bodies. Pass your own `collideHandler` to the collider.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#customSeparateY\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.customSeparateY = false;\r\n\r\n /**\r\n * The amount of horizontal overlap (before separation), if this Body is colliding with another.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#overlapX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.overlapX = 0;\r\n\r\n /**\r\n * The amount of vertical overlap (before separation), if this Body is colliding with another.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#overlapY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.overlapY = 0;\r\n\r\n /**\r\n * The amount of overlap (before separation), if this StaticBody is circular and colliding with another circular body.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#overlapR\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.overlapR = 0;\r\n\r\n /**\r\n * Whether this StaticBody has ever overlapped with another while both were not moving.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#embedded\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.embedded = false;\r\n\r\n /**\r\n * Whether this StaticBody interacts with the world boundary.\r\n * Always false for a Static Body. (Static Bodies never collide with the world boundary.)\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#collideWorldBounds\r\n * @type {boolean}\r\n * @readonly\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.collideWorldBounds = false;\r\n\r\n /**\r\n * Whether this StaticBody is checked for collisions and for which directions. You can set `checkCollision.none = false` to disable collision checks.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#checkCollision\r\n * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision}\r\n * @since 3.0.0\r\n */\r\n this.checkCollision = { none: false, up: true, down: true, left: true, right: true };\r\n\r\n /**\r\n * Whether this StaticBody has ever collided with another body and in which direction.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#touching\r\n * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision}\r\n * @since 3.0.0\r\n */\r\n this.touching = { none: true, up: false, down: false, left: false, right: false };\r\n\r\n /**\r\n * Whether this StaticBody was colliding with another body during the last step or any previous step, and in which direction.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#wasTouching\r\n * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision}\r\n * @since 3.0.0\r\n */\r\n this.wasTouching = { none: true, up: false, down: false, left: false, right: false };\r\n\r\n /**\r\n * Whether this StaticBody has ever collided with a tile or the world boundary.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#blocked\r\n * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision}\r\n * @since 3.0.0\r\n */\r\n this.blocked = { none: true, up: false, down: false, left: false, right: false };\r\n\r\n /**\r\n * The StaticBody's physics type (static by default).\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#physicsType\r\n * @type {integer}\r\n * @default Phaser.Physics.Arcade.STATIC_BODY\r\n * @since 3.0.0\r\n */\r\n this.physicsType = CONST.STATIC_BODY;\r\n\r\n /**\r\n * The calculated change in the Body's horizontal position during the current step.\r\n * For a static body this is always zero.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#_dx\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.10.0\r\n */\r\n this._dx = 0;\r\n\r\n /**\r\n * The calculated change in the Body's vertical position during the current step.\r\n * For a static body this is always zero.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#_dy\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.10.0\r\n */\r\n this._dy = 0;\r\n },\r\n\r\n /**\r\n * Changes the Game Object this Body is bound to.\r\n * First it removes its reference from the old Game Object, then sets the new one.\r\n * You can optionally update the position and dimensions of this Body to reflect that of the new Game Object.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#setGameObject\r\n * @since 3.1.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The new Game Object that will own this Body.\r\n * @param {boolean} [update=true] - Reposition and resize this Body to match the new Game Object?\r\n *\r\n * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object.\r\n *\r\n * @see Phaser.Physics.Arcade.StaticBody#updateFromGameObject\r\n */\r\n setGameObject: function (gameObject, update)\r\n {\r\n if (gameObject && gameObject !== this.gameObject)\r\n {\r\n // Remove this body from the old game object\r\n this.gameObject.body = null;\r\n\r\n gameObject.body = this;\r\n\r\n // Update our reference\r\n this.gameObject = gameObject;\r\n }\r\n\r\n if (update)\r\n {\r\n this.updateFromGameObject();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Syncs the Body's position and size with its parent Game Object.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#updateFromGameObject\r\n * @since 3.1.0\r\n *\r\n * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object.\r\n */\r\n updateFromGameObject: function ()\r\n {\r\n this.world.staticTree.remove(this);\r\n\r\n var gameObject = this.gameObject;\r\n\r\n gameObject.getTopLeft(this.position);\r\n\r\n this.width = gameObject.displayWidth;\r\n this.height = gameObject.displayHeight;\r\n\r\n this.halfWidth = Math.abs(this.width / 2);\r\n this.halfHeight = Math.abs(this.height / 2);\r\n\r\n this.center.set(this.position.x + this.halfWidth, this.position.y + this.halfHeight);\r\n\r\n this.world.staticTree.insert(this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the offset of the body.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#setOffset\r\n * @since 3.4.0\r\n *\r\n * @param {number} x - The horizontal offset of the Body from the Game Object's center.\r\n * @param {number} y - The vertical offset of the Body from the Game Object's center.\r\n *\r\n * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object.\r\n */\r\n setOffset: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.world.staticTree.remove(this);\r\n\r\n this.position.x -= this.offset.x;\r\n this.position.y -= this.offset.y;\r\n\r\n this.offset.set(x, y);\r\n\r\n this.position.x += this.offset.x;\r\n this.position.y += this.offset.y;\r\n\r\n this.updateCenter();\r\n\r\n this.world.staticTree.insert(this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the size of the body.\r\n * Resets the width and height to match current frame, if no width and height provided and a frame is found.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#setSize\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [width] - The width of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width.\r\n * @param {integer} [height] - The height of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height.\r\n * @param {boolean} [center=true] - Modify the Body's `offset`, placing the Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method.\r\n *\r\n * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object.\r\n */\r\n setSize: function (width, height, center)\r\n {\r\n if (center === undefined) { center = true; }\r\n\r\n var gameObject = this.gameObject;\r\n\r\n if (!width && gameObject.frame)\r\n {\r\n width = gameObject.frame.realWidth;\r\n }\r\n\r\n if (!height && gameObject.frame)\r\n {\r\n height = gameObject.frame.realHeight;\r\n }\r\n\r\n this.world.staticTree.remove(this);\r\n\r\n this.width = width;\r\n this.height = height;\r\n\r\n this.halfWidth = Math.floor(width / 2);\r\n this.halfHeight = Math.floor(height / 2);\r\n\r\n if (center && gameObject.getCenter)\r\n {\r\n var ox = gameObject.displayWidth / 2;\r\n var oy = gameObject.displayHeight / 2;\r\n\r\n this.position.x -= this.offset.x;\r\n this.position.y -= this.offset.y;\r\n\r\n this.offset.set(ox - this.halfWidth, oy - this.halfHeight);\r\n\r\n this.position.x += this.offset.x;\r\n this.position.y += this.offset.y;\r\n }\r\n\r\n this.updateCenter();\r\n\r\n this.isCircle = false;\r\n this.radius = 0;\r\n\r\n this.world.staticTree.insert(this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets this Static Body to have a circular body and sets its sizes and position.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#setCircle\r\n * @since 3.0.0\r\n *\r\n * @param {number} radius - The radius of the StaticBody, in pixels.\r\n * @param {number} [offsetX] - The horizontal offset of the StaticBody from its Game Object, in pixels.\r\n * @param {number} [offsetY] - The vertical offset of the StaticBody from its Game Object, in pixels.\r\n *\r\n * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object.\r\n */\r\n setCircle: function (radius, offsetX, offsetY)\r\n {\r\n if (offsetX === undefined) { offsetX = this.offset.x; }\r\n if (offsetY === undefined) { offsetY = this.offset.y; }\r\n\r\n if (radius > 0)\r\n {\r\n this.world.staticTree.remove(this);\r\n\r\n this.isCircle = true;\r\n\r\n this.radius = radius;\r\n\r\n this.width = radius * 2;\r\n this.height = radius * 2;\r\n\r\n this.halfWidth = Math.floor(this.width / 2);\r\n this.halfHeight = Math.floor(this.height / 2);\r\n\r\n this.offset.set(offsetX, offsetY);\r\n\r\n this.updateCenter();\r\n\r\n this.world.staticTree.insert(this);\r\n }\r\n else\r\n {\r\n this.isCircle = false;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Updates the StaticBody's `center` from its `position` and dimensions.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#updateCenter\r\n * @since 3.0.0\r\n */\r\n updateCenter: function ()\r\n {\r\n this.center.set(this.position.x + this.halfWidth, this.position.y + this.halfHeight);\r\n },\r\n\r\n /**\r\n * Resets this Body to the given coordinates. Also positions its parent Game Object to the same coordinates.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#reset\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x coordinate to reset the body to. If not given will use the parent Game Object's coordinate.\r\n * @param {number} [y] - The y coordinate to reset the body to. If not given will use the parent Game Object's coordinate.\r\n */\r\n reset: function (x, y)\r\n {\r\n var gameObject = this.gameObject;\r\n\r\n if (x === undefined) { x = gameObject.x; }\r\n if (y === undefined) { y = gameObject.y; }\r\n\r\n this.world.staticTree.remove(this);\r\n\r\n gameObject.setPosition(x, y);\r\n\r\n gameObject.getTopLeft(this.position);\r\n\r\n this.updateCenter();\r\n\r\n this.world.staticTree.insert(this);\r\n },\r\n\r\n /**\r\n * NOOP function. A Static Body cannot be stopped.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#stop\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object.\r\n */\r\n stop: function ()\r\n {\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns the x and y coordinates of the top left and bottom right points of the StaticBody.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#getBounds\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeBodyBounds} obj - The object which will hold the coordinates of the bounds.\r\n *\r\n * @return {Phaser.Types.Physics.Arcade.ArcadeBodyBounds} The same object that was passed with `x`, `y`, `right` and `bottom` values matching the respective values of the StaticBody.\r\n */\r\n getBounds: function (obj)\r\n {\r\n obj.x = this.x;\r\n obj.y = this.y;\r\n obj.right = this.right;\r\n obj.bottom = this.bottom;\r\n\r\n return obj;\r\n },\r\n\r\n /**\r\n * Checks to see if a given x,y coordinate is colliding with this Static Body.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#hitTest\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate to check against this body.\r\n * @param {number} y - The y coordinate to check against this body.\r\n *\r\n * @return {boolean} `true` if the given coordinate lies within this body, otherwise `false`.\r\n */\r\n hitTest: function (x, y)\r\n {\r\n return (this.isCircle) ? CircleContains(this, x, y) : RectangleContains(this, x, y);\r\n },\r\n\r\n /**\r\n * NOOP\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#postUpdate\r\n * @since 3.12.0\r\n */\r\n postUpdate: function ()\r\n {\r\n },\r\n\r\n /**\r\n * The absolute (non-negative) change in this StaticBody's horizontal position from the previous step. Always zero.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#deltaAbsX\r\n * @since 3.0.0\r\n *\r\n * @return {number} Always zero for a Static Body.\r\n */\r\n deltaAbsX: function ()\r\n {\r\n return 0;\r\n },\r\n\r\n /**\r\n * The absolute (non-negative) change in this StaticBody's vertical position from the previous step. Always zero.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#deltaAbsY\r\n * @since 3.0.0\r\n *\r\n * @return {number} Always zero for a Static Body.\r\n */\r\n deltaAbsY: function ()\r\n {\r\n return 0;\r\n },\r\n\r\n /**\r\n * The change in this StaticBody's horizontal position from the previous step. Always zero.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#deltaX\r\n * @since 3.0.0\r\n *\r\n * @return {number} The change in this StaticBody's velocity from the previous step. Always zero.\r\n */\r\n deltaX: function ()\r\n {\r\n return 0;\r\n },\r\n\r\n /**\r\n * The change in this StaticBody's vertical position from the previous step. Always zero.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#deltaY\r\n * @since 3.0.0\r\n *\r\n * @return {number} The change in this StaticBody's velocity from the previous step. Always zero.\r\n */\r\n deltaY: function ()\r\n {\r\n return 0;\r\n },\r\n\r\n /**\r\n * The change in this StaticBody's rotation from the previous step. Always zero.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#deltaZ\r\n * @since 3.0.0\r\n *\r\n * @return {number} The change in this StaticBody's rotation from the previous step. Always zero.\r\n */\r\n deltaZ: function ()\r\n {\r\n return 0;\r\n },\r\n\r\n /**\r\n * Disables this Body and marks it for destruction during the next step.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.enable = false;\r\n\r\n this.world.pendingDestroy.set(this);\r\n },\r\n\r\n /**\r\n * Draws a graphical representation of the StaticBody for visual debugging purposes.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#drawDebug\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Graphics} graphic - The Graphics object to use for the debug drawing of the StaticBody.\r\n */\r\n drawDebug: function (graphic)\r\n {\r\n var pos = this.position;\r\n\r\n var x = pos.x + this.halfWidth;\r\n var y = pos.y + this.halfHeight;\r\n\r\n if (this.debugShowBody)\r\n {\r\n graphic.lineStyle(graphic.defaultStrokeWidth, this.debugBodyColor, 1);\r\n\r\n if (this.isCircle)\r\n {\r\n graphic.strokeCircle(x, y, this.width / 2);\r\n }\r\n else\r\n {\r\n graphic.strokeRect(pos.x, pos.y, this.width, this.height);\r\n }\r\n\r\n }\r\n },\r\n\r\n /**\r\n * Indicates whether the StaticBody is going to be showing a debug visualization during postUpdate.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#willDrawDebug\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} Whether or not the StaticBody is going to show the debug visualization during postUpdate.\r\n */\r\n willDrawDebug: function ()\r\n {\r\n return this.debugShowBody;\r\n },\r\n\r\n /**\r\n * Sets the Mass of the StaticBody. Will set the Mass to 0.1 if the value passed is less than or equal to zero.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticBody#setMass\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to set the Mass to. Values of zero or less are changed to 0.1.\r\n *\r\n * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object.\r\n */\r\n setMass: function (value)\r\n {\r\n if (value <= 0)\r\n {\r\n // Causes havoc otherwise\r\n value = 0.1;\r\n }\r\n\r\n this.mass = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The x coordinate of the StaticBody.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#x\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n x: {\r\n\r\n get: function ()\r\n {\r\n return this.position.x;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.world.staticTree.remove(this);\r\n\r\n this.position.x = value;\r\n\r\n this.world.staticTree.insert(this);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The y coordinate of the StaticBody.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#y\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n y: {\r\n\r\n get: function ()\r\n {\r\n return this.position.y;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.world.staticTree.remove(this);\r\n\r\n this.position.y = value;\r\n\r\n this.world.staticTree.insert(this);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns the left-most x coordinate of the area of the StaticBody.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#left\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n left: {\r\n\r\n get: function ()\r\n {\r\n return this.position.x;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The right-most x coordinate of the area of the StaticBody.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#right\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n right: {\r\n\r\n get: function ()\r\n {\r\n return this.position.x + this.width;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The highest y coordinate of the area of the StaticBody.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#top\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n top: {\r\n\r\n get: function ()\r\n {\r\n return this.position.y;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The lowest y coordinate of the area of the StaticBody. (y + height)\r\n *\r\n * @name Phaser.Physics.Arcade.StaticBody#bottom\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n bottom: {\r\n\r\n get: function ()\r\n {\r\n return this.position.y + this.height;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = StaticBody;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/StaticBody.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/StaticPhysicsGroup.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/StaticPhysicsGroup.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ArcadeSprite = __webpack_require__(/*! ./ArcadeSprite */ \"./node_modules/phaser/src/physics/arcade/ArcadeSprite.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/physics/arcade/const.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar Group = __webpack_require__(/*! ../../gameobjects/group/Group */ \"./node_modules/phaser/src/gameobjects/group/Group.js\");\r\nvar IsPlainObject = __webpack_require__(/*! ../../utils/object/IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n/**\r\n * @classdesc\r\n * An Arcade Physics Static Group object.\r\n *\r\n * All Game Objects created by this Group will automatically be given static Arcade Physics bodies.\r\n *\r\n * Its dynamic counterpart is {@link Phaser.Physics.Arcade.Group}.\r\n *\r\n * @class StaticGroup\r\n * @extends Phaser.GameObjects.Group\r\n * @memberof Phaser.Physics.Arcade\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.World} world - The physics simulation.\r\n * @param {Phaser.Scene} scene - The scene this group belongs to.\r\n * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.\r\n * @param {Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} [config] - Settings for this group.\r\n */\r\nvar StaticPhysicsGroup = new Class({\r\n\r\n Extends: Group,\r\n\r\n initialize:\r\n\r\n function StaticPhysicsGroup (world, scene, children, config)\r\n {\r\n if (!children && !config)\r\n {\r\n config = {\r\n internalCreateCallback: this.createCallbackHandler,\r\n internalRemoveCallback: this.removeCallbackHandler,\r\n createMultipleCallback: this.createMultipleCallbackHandler,\r\n classType: ArcadeSprite\r\n };\r\n }\r\n else if (IsPlainObject(children))\r\n {\r\n // children is a plain object, so swizzle them:\r\n config = children;\r\n children = null;\r\n\r\n config.internalCreateCallback = this.createCallbackHandler;\r\n config.internalRemoveCallback = this.removeCallbackHandler;\r\n config.createMultipleCallback = this.createMultipleCallbackHandler;\r\n config.classType = GetFastValue(config, 'classType', ArcadeSprite);\r\n }\r\n else if (Array.isArray(children) && IsPlainObject(children[0]))\r\n {\r\n // children is an array of plain objects\r\n config = children;\r\n children = null;\r\n\r\n config.forEach(function (singleConfig)\r\n {\r\n singleConfig.internalCreateCallback = this.createCallbackHandler;\r\n singleConfig.internalRemoveCallback = this.removeCallbackHandler;\r\n singleConfig.createMultipleCallback = this.createMultipleCallbackHandler;\r\n singleConfig.classType = GetFastValue(singleConfig, 'classType', ArcadeSprite);\r\n });\r\n }\r\n\r\n /**\r\n * The physics simulation.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticGroup#world\r\n * @type {Phaser.Physics.Arcade.World}\r\n * @since 3.0.0\r\n */\r\n this.world = world;\r\n\r\n /**\r\n * The scene this group belongs to.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticGroup#physicsType\r\n * @type {integer}\r\n * @default Phaser.Physics.Arcade.STATIC_BODY\r\n * @since 3.0.0\r\n */\r\n this.physicsType = CONST.STATIC_BODY;\r\n\r\n Group.call(this, scene, children, config);\r\n\r\n /**\r\n * A textual representation of this Game Object.\r\n * Used internally by Phaser but is available for your own custom classes to populate.\r\n *\r\n * @name Phaser.Physics.Arcade.StaticGroup#type\r\n * @type {string}\r\n * @default 'StaticPhysicsGroup'\r\n * @since 3.21.0\r\n */\r\n this.type = 'StaticPhysicsGroup';\r\n },\r\n\r\n /**\r\n * Adds a static physics body to the new group member (if it lacks one) and adds it to the simulation.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticGroup#createCallbackHandler\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The new group member.\r\n *\r\n * @see Phaser.Physics.Arcade.World#enableBody\r\n */\r\n createCallbackHandler: function (child)\r\n {\r\n if (!child.body)\r\n {\r\n this.world.enableBody(child, CONST.STATIC_BODY);\r\n }\r\n },\r\n\r\n /**\r\n * Disables the group member's physics body, removing it from the simulation.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticGroup#removeCallbackHandler\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The group member being removed.\r\n *\r\n * @see Phaser.Physics.Arcade.World#disableBody\r\n */\r\n removeCallbackHandler: function (child)\r\n {\r\n if (child.body)\r\n {\r\n this.world.disableBody(child);\r\n }\r\n },\r\n\r\n /**\r\n * Refreshes the group.\r\n *\r\n * @method Phaser.Physics.Arcade.StaticGroup#createMultipleCallbackHandler\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject[]} entries - The newly created group members.\r\n *\r\n * @see Phaser.Physics.Arcade.StaticGroup#refresh\r\n */\r\n createMultipleCallbackHandler: function ()\r\n {\r\n this.refresh();\r\n },\r\n\r\n /**\r\n * Resets each Body to the position of its parent Game Object.\r\n * Body sizes aren't changed (use {@link Phaser.Physics.Arcade.Components.Enable#refreshBody} for that).\r\n *\r\n * @method Phaser.Physics.Arcade.StaticGroup#refresh\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Physics.Arcade.StaticGroup} This group.\r\n *\r\n * @see Phaser.Physics.Arcade.StaticBody#reset\r\n */\r\n refresh: function ()\r\n {\r\n var children = this.children.entries;\r\n\r\n for (var i = 0; i < children.length; i++)\r\n {\r\n children[i].body.reset();\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = StaticPhysicsGroup;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/StaticPhysicsGroup.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/World.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/World.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Body = __webpack_require__(/*! ./Body */ \"./node_modules/phaser/src/physics/arcade/Body.js\");\r\nvar Clamp = __webpack_require__(/*! ../../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Collider = __webpack_require__(/*! ./Collider */ \"./node_modules/phaser/src/physics/arcade/Collider.js\");\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/physics/arcade/const.js\");\r\nvar DistanceBetween = __webpack_require__(/*! ../../math/distance/DistanceBetween */ \"./node_modules/phaser/src/math/distance/DistanceBetween.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/physics/arcade/events/index.js\");\r\nvar FuzzyEqual = __webpack_require__(/*! ../../math/fuzzy/Equal */ \"./node_modules/phaser/src/math/fuzzy/Equal.js\");\r\nvar FuzzyGreaterThan = __webpack_require__(/*! ../../math/fuzzy/GreaterThan */ \"./node_modules/phaser/src/math/fuzzy/GreaterThan.js\");\r\nvar FuzzyLessThan = __webpack_require__(/*! ../../math/fuzzy/LessThan */ \"./node_modules/phaser/src/math/fuzzy/LessThan.js\");\r\nvar GetOverlapX = __webpack_require__(/*! ./GetOverlapX */ \"./node_modules/phaser/src/physics/arcade/GetOverlapX.js\");\r\nvar GetOverlapY = __webpack_require__(/*! ./GetOverlapY */ \"./node_modules/phaser/src/physics/arcade/GetOverlapY.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar ProcessQueue = __webpack_require__(/*! ../../structs/ProcessQueue */ \"./node_modules/phaser/src/structs/ProcessQueue.js\");\r\nvar ProcessTileCallbacks = __webpack_require__(/*! ./tilemap/ProcessTileCallbacks */ \"./node_modules/phaser/src/physics/arcade/tilemap/ProcessTileCallbacks.js\");\r\nvar Rectangle = __webpack_require__(/*! ../../geom/rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar RTree = __webpack_require__(/*! ../../structs/RTree */ \"./node_modules/phaser/src/structs/RTree.js\");\r\nvar SeparateTile = __webpack_require__(/*! ./tilemap/SeparateTile */ \"./node_modules/phaser/src/physics/arcade/tilemap/SeparateTile.js\");\r\nvar SeparateX = __webpack_require__(/*! ./SeparateX */ \"./node_modules/phaser/src/physics/arcade/SeparateX.js\");\r\nvar SeparateY = __webpack_require__(/*! ./SeparateY */ \"./node_modules/phaser/src/physics/arcade/SeparateY.js\");\r\nvar Set = __webpack_require__(/*! ../../structs/Set */ \"./node_modules/phaser/src/structs/Set.js\");\r\nvar StaticBody = __webpack_require__(/*! ./StaticBody */ \"./node_modules/phaser/src/physics/arcade/StaticBody.js\");\r\nvar TileIntersectsBody = __webpack_require__(/*! ./tilemap/TileIntersectsBody */ \"./node_modules/phaser/src/physics/arcade/tilemap/TileIntersectsBody.js\");\r\nvar TransformMatrix = __webpack_require__(/*! ../../gameobjects/components/TransformMatrix */ \"./node_modules/phaser/src/gameobjects/components/TransformMatrix.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\nvar Wrap = __webpack_require__(/*! ../../math/Wrap */ \"./node_modules/phaser/src/math/Wrap.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Arcade Physics World.\r\n *\r\n * The World is responsible for creating, managing, colliding and updating all of the bodies within it.\r\n *\r\n * An instance of the World belongs to a Phaser.Scene and is accessed via the property `physics.world`.\r\n *\r\n * @class World\r\n * @extends Phaser.Events.EventEmitter\r\n * @memberof Phaser.Physics.Arcade\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this World instance belongs.\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeWorldConfig} config - An Arcade Physics Configuration object.\r\n */\r\nvar World = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function World (scene, config)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * The Scene this simulation belongs to.\r\n *\r\n * @name Phaser.Physics.Arcade.World#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * Dynamic Bodies in this simulation.\r\n *\r\n * @name Phaser.Physics.Arcade.World#bodies\r\n * @type {Phaser.Structs.Set.}\r\n * @since 3.0.0\r\n */\r\n this.bodies = new Set();\r\n\r\n /**\r\n * Static Bodies in this simulation.\r\n *\r\n * @name Phaser.Physics.Arcade.World#staticBodies\r\n * @type {Phaser.Structs.Set.}\r\n * @since 3.0.0\r\n */\r\n this.staticBodies = new Set();\r\n\r\n /**\r\n * Static Bodies marked for deletion.\r\n *\r\n * @name Phaser.Physics.Arcade.World#pendingDestroy\r\n * @type {Phaser.Structs.Set.<(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)>}\r\n * @since 3.1.0\r\n */\r\n this.pendingDestroy = new Set();\r\n\r\n /**\r\n * This simulation's collision processors.\r\n *\r\n * @name Phaser.Physics.Arcade.World#colliders\r\n * @type {Phaser.Structs.ProcessQueue.}\r\n * @since 3.0.0\r\n */\r\n this.colliders = new ProcessQueue();\r\n\r\n /**\r\n * Acceleration of Bodies due to gravity, in pixels per second.\r\n *\r\n * @name Phaser.Physics.Arcade.World#gravity\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.gravity = new Vector2(GetValue(config, 'gravity.x', 0), GetValue(config, 'gravity.y', 0));\r\n\r\n /**\r\n * A boundary constraining Bodies.\r\n *\r\n * @name Phaser.Physics.Arcade.World#bounds\r\n * @type {Phaser.Geom.Rectangle}\r\n * @since 3.0.0\r\n */\r\n this.bounds = new Rectangle(\r\n GetValue(config, 'x', 0),\r\n GetValue(config, 'y', 0),\r\n GetValue(config, 'width', scene.sys.scale.width),\r\n GetValue(config, 'height', scene.sys.scale.height)\r\n );\r\n\r\n /**\r\n * The boundary edges that Bodies can collide with.\r\n *\r\n * @name Phaser.Physics.Arcade.World#checkCollision\r\n * @type {Phaser.Types.Physics.Arcade.CheckCollisionObject}\r\n * @since 3.0.0\r\n */\r\n this.checkCollision = {\r\n up: GetValue(config, 'checkCollision.up', true),\r\n down: GetValue(config, 'checkCollision.down', true),\r\n left: GetValue(config, 'checkCollision.left', true),\r\n right: GetValue(config, 'checkCollision.right', true)\r\n };\r\n\r\n /**\r\n * The number of physics steps to be taken per second.\r\n *\r\n * This property is read-only. Use the `setFPS` method to modify it at run-time.\r\n *\r\n * @name Phaser.Physics.Arcade.World#fps\r\n * @readonly\r\n * @type {number}\r\n * @default 60\r\n * @since 3.10.0\r\n */\r\n this.fps = GetValue(config, 'fps', 60);\r\n\r\n /**\r\n * The amount of elapsed ms since the last frame.\r\n *\r\n * @name Phaser.Physics.Arcade.World#_elapsed\r\n * @private\r\n * @type {number}\r\n * @since 3.10.0\r\n */\r\n this._elapsed = 0;\r\n\r\n /**\r\n * Internal frame time value.\r\n *\r\n * @name Phaser.Physics.Arcade.World#_frameTime\r\n * @private\r\n * @type {number}\r\n * @since 3.10.0\r\n */\r\n this._frameTime = 1 / this.fps;\r\n\r\n /**\r\n * Internal frame time ms value.\r\n *\r\n * @name Phaser.Physics.Arcade.World#_frameTimeMS\r\n * @private\r\n * @type {number}\r\n * @since 3.10.0\r\n */\r\n this._frameTimeMS = 1000 * this._frameTime;\r\n\r\n /**\r\n * The number of steps that took place in the last frame.\r\n *\r\n * @name Phaser.Physics.Arcade.World#stepsLastFrame\r\n * @readonly\r\n * @type {number}\r\n * @since 3.10.0\r\n */\r\n this.stepsLastFrame = 0;\r\n\r\n /**\r\n * Scaling factor applied to the frame rate.\r\n *\r\n * - 1.0 = normal speed\r\n * - 2.0 = half speed\r\n * - 0.5 = double speed\r\n *\r\n * @name Phaser.Physics.Arcade.World#timeScale\r\n * @type {number}\r\n * @default 1\r\n * @since 3.10.0\r\n */\r\n this.timeScale = GetValue(config, 'timeScale', 1);\r\n\r\n /**\r\n * The maximum absolute difference of a Body's per-step velocity and its overlap with another Body that will result in separation on *each axis*.\r\n * Larger values favor separation.\r\n * Smaller values favor no separation.\r\n *\r\n * @name Phaser.Physics.Arcade.World#OVERLAP_BIAS\r\n * @type {number}\r\n * @default 4\r\n * @since 3.0.0\r\n */\r\n this.OVERLAP_BIAS = GetValue(config, 'overlapBias', 4);\r\n\r\n /**\r\n * The maximum absolute value of a Body's overlap with a tile that will result in separation on *each axis*.\r\n * Larger values favor separation.\r\n * Smaller values favor no separation.\r\n * The optimum value may be similar to the tile size.\r\n *\r\n * @name Phaser.Physics.Arcade.World#TILE_BIAS\r\n * @type {number}\r\n * @default 16\r\n * @since 3.0.0\r\n */\r\n this.TILE_BIAS = GetValue(config, 'tileBias', 16);\r\n\r\n /**\r\n * Always separate overlapping Bodies horizontally before vertically.\r\n * False (the default) means Bodies are first separated on the axis of greater gravity, or the vertical axis if neither is greater.\r\n *\r\n * @name Phaser.Physics.Arcade.World#forceX\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.forceX = GetValue(config, 'forceX', false);\r\n\r\n /**\r\n * Whether the simulation advances with the game loop.\r\n *\r\n * @name Phaser.Physics.Arcade.World#isPaused\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.isPaused = GetValue(config, 'isPaused', false);\r\n\r\n /**\r\n * Temporary total of colliding Bodies.\r\n *\r\n * @name Phaser.Physics.Arcade.World#_total\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._total = 0;\r\n\r\n /**\r\n * Enables the debug display.\r\n *\r\n * @name Phaser.Physics.Arcade.World#drawDebug\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.drawDebug = GetValue(config, 'debug', false);\r\n\r\n /**\r\n * The graphics object drawing the debug display.\r\n *\r\n * @name Phaser.Physics.Arcade.World#debugGraphic\r\n * @type {Phaser.GameObjects.Graphics}\r\n * @since 3.0.0\r\n */\r\n this.debugGraphic;\r\n\r\n /**\r\n * Default debug display settings for new Bodies.\r\n *\r\n * @name Phaser.Physics.Arcade.World#defaults\r\n * @type {Phaser.Types.Physics.Arcade.ArcadeWorldDefaults}\r\n * @since 3.0.0\r\n */\r\n this.defaults = {\r\n debugShowBody: GetValue(config, 'debugShowBody', true),\r\n debugShowStaticBody: GetValue(config, 'debugShowStaticBody', true),\r\n debugShowVelocity: GetValue(config, 'debugShowVelocity', true),\r\n bodyDebugColor: GetValue(config, 'debugBodyColor', 0xff00ff),\r\n staticBodyDebugColor: GetValue(config, 'debugStaticBodyColor', 0x0000ff),\r\n velocityDebugColor: GetValue(config, 'debugVelocityColor', 0x00ff00)\r\n };\r\n\r\n /**\r\n * The maximum number of items per node on the RTree.\r\n *\r\n * This is ignored if `useTree` is `false`. If you have a large number of bodies in\r\n * your world then you may find search performance improves by increasing this value,\r\n * to allow more items per node and less node division.\r\n *\r\n * @name Phaser.Physics.Arcade.World#maxEntries\r\n * @type {integer}\r\n * @default 16\r\n * @since 3.0.0\r\n */\r\n this.maxEntries = GetValue(config, 'maxEntries', 16);\r\n\r\n /**\r\n * Should this Arcade Physics World use an RTree for Dynamic and Static Physics bodies?\r\n *\r\n * An RTree is a fast way of spatially sorting of all the bodies in the world.\r\n * However, at certain limits, the cost of clearing and inserting the bodies into the\r\n * tree every frame becomes more expensive than the search speed gains it provides.\r\n *\r\n * If you have a large number of dynamic bodies in your world then it may be best to\r\n * disable the use of the RTree by setting this property to `false` in the physics config.\r\n *\r\n * The number it can cope with depends on browser and device, but a conservative estimate\r\n * of around 5,000 bodies should be considered the max before disabling it.\r\n *\r\n * This only applies to dynamic bodies. Static bodies are always kept in an RTree,\r\n * because they don't have to be cleared every frame, so you benefit from the\r\n * massive search speeds all the time.\r\n *\r\n * @name Phaser.Physics.Arcade.World#useTree\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.10.0\r\n */\r\n this.useTree = GetValue(config, 'useTree', true);\r\n\r\n /**\r\n * The spatial index of Dynamic Bodies.\r\n *\r\n * @name Phaser.Physics.Arcade.World#tree\r\n * @type {Phaser.Structs.RTree}\r\n * @since 3.0.0\r\n */\r\n this.tree = new RTree(this.maxEntries);\r\n\r\n /**\r\n * The spatial index of Static Bodies.\r\n *\r\n * @name Phaser.Physics.Arcade.World#staticTree\r\n * @type {Phaser.Structs.RTree}\r\n * @since 3.0.0\r\n */\r\n this.staticTree = new RTree(this.maxEntries);\r\n\r\n /**\r\n * Recycled input for tree searches.\r\n *\r\n * @name Phaser.Physics.Arcade.World#treeMinMax\r\n * @type {Phaser.Types.Physics.Arcade.ArcadeWorldTreeMinMax}\r\n * @since 3.0.0\r\n */\r\n this.treeMinMax = { minX: 0, minY: 0, maxX: 0, maxY: 0 };\r\n\r\n /**\r\n * A temporary Transform Matrix used by bodies for calculations without them needing their own local copy.\r\n *\r\n * @name Phaser.Physics.Arcade.World#_tempMatrix\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._tempMatrix = new TransformMatrix();\r\n\r\n /**\r\n * A temporary Transform Matrix used by bodies for calculations without them needing their own local copy.\r\n *\r\n * @name Phaser.Physics.Arcade.World#_tempMatrix2\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._tempMatrix2 = new TransformMatrix();\r\n\r\n if (this.drawDebug)\r\n {\r\n this.createDebugGraphic();\r\n }\r\n },\r\n\r\n /**\r\n * Adds an Arcade Physics Body to a Game Object, an array of Game Objects, or the children of a Group.\r\n *\r\n * The difference between this and the `enableBody` method is that you can pass arrays or Groups\r\n * to this method.\r\n *\r\n * You can specify if the bodies are to be Dynamic or Static. A dynamic body can move via velocity and\r\n * acceleration. A static body remains fixed in place and as such is able to use an optimized search\r\n * tree, making it ideal for static elements such as level objects. You can still collide and overlap\r\n * with static bodies.\r\n *\r\n * Normally, rather than calling this method directly, you'd use the helper methods available in the\r\n * Arcade Physics Factory, such as:\r\n *\r\n * ```javascript\r\n * this.physics.add.image(x, y, textureKey);\r\n * this.physics.add.sprite(x, y, textureKey);\r\n * ```\r\n *\r\n * Calling factory methods encapsulates the creation of a Game Object and the creation of its\r\n * body at the same time. If you are creating custom classes then you can pass them to this\r\n * method to have their bodies created.\r\n *\r\n * @method Phaser.Physics.Arcade.World#enable\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object - The object, or objects, on which to create the bodies.\r\n * @param {integer} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`.\r\n */\r\n enable: function (object, bodyType)\r\n {\r\n if (bodyType === undefined) { bodyType = CONST.DYNAMIC_BODY; }\r\n\r\n if (!Array.isArray(object))\r\n {\r\n object = [ object ];\r\n }\r\n\r\n for (var i = 0; i < object.length; i++)\r\n {\r\n var entry = object[i];\r\n\r\n if (entry.isParent)\r\n {\r\n var children = entry.getChildren();\r\n\r\n for (var c = 0; c < children.length; c++)\r\n {\r\n var child = children[c];\r\n\r\n if (child.isParent)\r\n {\r\n // Handle Groups nested inside of Groups\r\n this.enable(child, bodyType);\r\n }\r\n else\r\n {\r\n this.enableBody(child, bodyType);\r\n }\r\n }\r\n }\r\n else\r\n {\r\n this.enableBody(entry, bodyType);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Creates an Arcade Physics Body on a single Game Object.\r\n *\r\n * If the Game Object already has a body, this method will simply add it back into the simulation.\r\n *\r\n * You can specify if the body is Dynamic or Static. A dynamic body can move via velocity and\r\n * acceleration. A static body remains fixed in place and as such is able to use an optimized search\r\n * tree, making it ideal for static elements such as level objects. You can still collide and overlap\r\n * with static bodies.\r\n *\r\n * Normally, rather than calling this method directly, you'd use the helper methods available in the\r\n * Arcade Physics Factory, such as:\r\n *\r\n * ```javascript\r\n * this.physics.add.image(x, y, textureKey);\r\n * this.physics.add.sprite(x, y, textureKey);\r\n * ```\r\n *\r\n * Calling factory methods encapsulates the creation of a Game Object and the creation of its\r\n * body at the same time. If you are creating custom classes then you can pass them to this\r\n * method to have their bodies created.\r\n *\r\n * @method Phaser.Physics.Arcade.World#enableBody\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} object - The Game Object on which to create the body.\r\n * @param {integer} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object on which the body was created.\r\n */\r\n enableBody: function (object, bodyType)\r\n {\r\n if (bodyType === undefined) { bodyType = CONST.DYNAMIC_BODY; }\r\n\r\n if (!object.body)\r\n {\r\n if (bodyType === CONST.DYNAMIC_BODY)\r\n {\r\n object.body = new Body(this, object);\r\n }\r\n else if (bodyType === CONST.STATIC_BODY)\r\n {\r\n object.body = new StaticBody(this, object);\r\n }\r\n }\r\n\r\n this.add(object.body);\r\n\r\n return object;\r\n },\r\n\r\n /**\r\n * Adds an existing Arcade Physics Body or StaticBody to the simulation.\r\n *\r\n * The body is enabled and added to the local search trees.\r\n *\r\n * @method Phaser.Physics.Arcade.World#add\r\n * @since 3.10.0\r\n *\r\n * @param {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} body - The Body to be added to the simulation.\r\n *\r\n * @return {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} The Body that was added to the simulation.\r\n */\r\n add: function (body)\r\n {\r\n if (body.physicsType === CONST.DYNAMIC_BODY)\r\n {\r\n this.bodies.set(body);\r\n }\r\n else if (body.physicsType === CONST.STATIC_BODY)\r\n {\r\n this.staticBodies.set(body);\r\n\r\n this.staticTree.insert(body);\r\n }\r\n\r\n body.enable = true;\r\n\r\n return body;\r\n },\r\n\r\n /**\r\n * Disables the Arcade Physics Body of a Game Object, an array of Game Objects, or the children of a Group.\r\n *\r\n * The difference between this and the `disableBody` method is that you can pass arrays or Groups\r\n * to this method.\r\n *\r\n * The body itself is not deleted, it just has its `enable` property set to false, which\r\n * means you can re-enable it again at any point by passing it to enable `World.enable` or `World.add`.\r\n *\r\n * @method Phaser.Physics.Arcade.World#disable\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object - The object, or objects, on which to disable the bodies.\r\n */\r\n disable: function (object)\r\n {\r\n if (!Array.isArray(object))\r\n {\r\n object = [ object ];\r\n }\r\n\r\n for (var i = 0; i < object.length; i++)\r\n {\r\n var entry = object[i];\r\n\r\n if (entry.isParent)\r\n {\r\n var children = entry.getChildren();\r\n\r\n for (var c = 0; c < children.length; c++)\r\n {\r\n var child = children[c];\r\n\r\n if (child.isParent)\r\n {\r\n // Handle Groups nested inside of Groups\r\n this.disable(child);\r\n }\r\n else\r\n {\r\n this.disableBody(child.body);\r\n }\r\n }\r\n }\r\n else\r\n {\r\n this.disableBody(entry.body);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Disables an existing Arcade Physics Body or StaticBody and removes it from the simulation.\r\n *\r\n * The body is disabled and removed from the local search trees.\r\n *\r\n * The body itself is not deleted, it just has its `enable` property set to false, which\r\n * means you can re-enable it again at any point by passing it to enable `World.enable` or `World.add`.\r\n *\r\n * @method Phaser.Physics.Arcade.World#disableBody\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} body - The Body to be disabled.\r\n */\r\n disableBody: function (body)\r\n {\r\n this.remove(body);\r\n\r\n body.enable = false;\r\n },\r\n\r\n /**\r\n * Removes an existing Arcade Physics Body or StaticBody from the simulation.\r\n *\r\n * The body is disabled and removed from the local search trees.\r\n *\r\n * The body itself is not deleted, it just has its `enabled` property set to false, which\r\n * means you can re-enable it again at any point by passing it to enable `enable` or `add`.\r\n *\r\n * @method Phaser.Physics.Arcade.World#remove\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} body - The body to be removed from the simulation.\r\n */\r\n remove: function (body)\r\n {\r\n if (body.physicsType === CONST.DYNAMIC_BODY)\r\n {\r\n this.tree.remove(body);\r\n this.bodies.delete(body);\r\n }\r\n else if (body.physicsType === CONST.STATIC_BODY)\r\n {\r\n this.staticBodies.delete(body);\r\n this.staticTree.remove(body);\r\n }\r\n },\r\n\r\n /**\r\n * Creates a Graphics Game Object that the world will use to render the debug display to.\r\n *\r\n * This is called automatically when the World is instantiated if the `debug` config property\r\n * was set to `true`. However, you can call it at any point should you need to display the\r\n * debug Graphic from a fixed point.\r\n *\r\n * You can control which objects are drawn to the Graphics object, and the colors they use,\r\n * by setting the debug properties in the physics config.\r\n *\r\n * You should not typically use this in a production game. Use it to aid during debugging.\r\n *\r\n * @method Phaser.Physics.Arcade.World#createDebugGraphic\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Graphics} The Graphics object that was created for use by the World.\r\n */\r\n createDebugGraphic: function ()\r\n {\r\n var graphic = this.scene.sys.add.graphics({ x: 0, y: 0 });\r\n\r\n graphic.setDepth(Number.MAX_VALUE);\r\n\r\n this.debugGraphic = graphic;\r\n\r\n this.drawDebug = true;\r\n\r\n return graphic;\r\n },\r\n\r\n /**\r\n * Sets the position, size and properties of the World boundary.\r\n *\r\n * The World boundary is an invisible rectangle that defines the edges of the World.\r\n * If a Body is set to collide with the world bounds then it will automatically stop\r\n * when it reaches any of the edges. You can optionally set which edges of the boundary\r\n * should be checked against.\r\n *\r\n * @method Phaser.Physics.Arcade.World#setBounds\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The top-left x coordinate of the boundary.\r\n * @param {number} y - The top-left y coordinate of the boundary.\r\n * @param {number} width - The width of the boundary.\r\n * @param {number} height - The height of the boundary.\r\n * @param {boolean} [checkLeft] - Should bodies check against the left edge of the boundary?\r\n * @param {boolean} [checkRight] - Should bodies check against the right edge of the boundary?\r\n * @param {boolean} [checkUp] - Should bodies check against the top edge of the boundary?\r\n * @param {boolean} [checkDown] - Should bodies check against the bottom edge of the boundary?\r\n *\r\n * @return {Phaser.Physics.Arcade.World} This World object.\r\n */\r\n setBounds: function (x, y, width, height, checkLeft, checkRight, checkUp, checkDown)\r\n {\r\n this.bounds.setTo(x, y, width, height);\r\n\r\n if (checkLeft !== undefined)\r\n {\r\n this.setBoundsCollision(checkLeft, checkRight, checkUp, checkDown);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Enables or disables collisions on each edge of the World boundary.\r\n *\r\n * @method Phaser.Physics.Arcade.World#setBoundsCollision\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [left=true] - Should bodies check against the left edge of the boundary?\r\n * @param {boolean} [right=true] - Should bodies check against the right edge of the boundary?\r\n * @param {boolean} [up=true] - Should bodies check against the top edge of the boundary?\r\n * @param {boolean} [down=true] - Should bodies check against the bottom edge of the boundary?\r\n *\r\n * @return {Phaser.Physics.Arcade.World} This World object.\r\n */\r\n setBoundsCollision: function (left, right, up, down)\r\n {\r\n if (left === undefined) { left = true; }\r\n if (right === undefined) { right = true; }\r\n if (up === undefined) { up = true; }\r\n if (down === undefined) { down = true; }\r\n\r\n this.checkCollision.left = left;\r\n this.checkCollision.right = right;\r\n this.checkCollision.up = up;\r\n this.checkCollision.down = down;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Pauses the simulation.\r\n *\r\n * A paused simulation does not update any existing bodies, or run any Colliders.\r\n *\r\n * However, you can still enable and disable bodies within it, or manually run collide or overlap\r\n * checks.\r\n *\r\n * @method Phaser.Physics.Arcade.World#pause\r\n * @fires Phaser.Physics.Arcade.Events#PAUSE\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Physics.Arcade.World} This World object.\r\n */\r\n pause: function ()\r\n {\r\n this.isPaused = true;\r\n\r\n this.emit(Events.PAUSE);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resumes the simulation, if paused.\r\n *\r\n * @method Phaser.Physics.Arcade.World#resume\r\n * @fires Phaser.Physics.Arcade.Events#RESUME\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Physics.Arcade.World} This World object.\r\n */\r\n resume: function ()\r\n {\r\n this.isPaused = false;\r\n\r\n this.emit(Events.RESUME);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a new Collider object and adds it to the simulation.\r\n *\r\n * A Collider is a way to automatically perform collision checks between two objects,\r\n * calling the collide and process callbacks if they occur.\r\n *\r\n * Colliders are run as part of the World update, after all of the Bodies have updated.\r\n *\r\n * By creating a Collider you don't need then call `World.collide` in your `update` loop,\r\n * as it will be handled for you automatically.\r\n *\r\n * @method Phaser.Physics.Arcade.World#addCollider\r\n * @since 3.0.0\r\n * @see Phaser.Physics.Arcade.World#collide\r\n *\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision.\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for collision.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide.\r\n * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean.\r\n * @param {*} [callbackContext] - The scope in which to call the callbacks.\r\n *\r\n * @return {Phaser.Physics.Arcade.Collider} The Collider that was created.\r\n */\r\n addCollider: function (object1, object2, collideCallback, processCallback, callbackContext)\r\n {\r\n if (collideCallback === undefined) { collideCallback = null; }\r\n if (processCallback === undefined) { processCallback = null; }\r\n if (callbackContext === undefined) { callbackContext = collideCallback; }\r\n\r\n var collider = new Collider(this, false, object1, object2, collideCallback, processCallback, callbackContext);\r\n\r\n this.colliders.add(collider);\r\n\r\n return collider;\r\n },\r\n\r\n /**\r\n * Creates a new Overlap Collider object and adds it to the simulation.\r\n *\r\n * A Collider is a way to automatically perform overlap checks between two objects,\r\n * calling the collide and process callbacks if they occur.\r\n *\r\n * Colliders are run as part of the World update, after all of the Bodies have updated.\r\n *\r\n * By creating a Collider you don't need then call `World.overlap` in your `update` loop,\r\n * as it will be handled for you automatically.\r\n *\r\n * @method Phaser.Physics.Arcade.World#addOverlap\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for overlap.\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for overlap.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects overlap.\r\n * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects overlap. Must return a boolean.\r\n * @param {*} [callbackContext] - The scope in which to call the callbacks.\r\n *\r\n * @return {Phaser.Physics.Arcade.Collider} The Collider that was created.\r\n */\r\n addOverlap: function (object1, object2, collideCallback, processCallback, callbackContext)\r\n {\r\n if (collideCallback === undefined) { collideCallback = null; }\r\n if (processCallback === undefined) { processCallback = null; }\r\n if (callbackContext === undefined) { callbackContext = collideCallback; }\r\n\r\n var collider = new Collider(this, true, object1, object2, collideCallback, processCallback, callbackContext);\r\n\r\n this.colliders.add(collider);\r\n\r\n return collider;\r\n },\r\n\r\n /**\r\n * Removes a Collider from the simulation so it is no longer processed.\r\n *\r\n * This method does not destroy the Collider. If you wish to add it back at a later stage you can call\r\n * `World.colliders.add(Collider)`.\r\n *\r\n * If you no longer need the Collider you can call the `Collider.destroy` method instead, which will\r\n * automatically clear all of its references and then remove it from the World. If you call destroy on\r\n * a Collider you _don't_ need to pass it to this method too.\r\n *\r\n * @method Phaser.Physics.Arcade.World#removeCollider\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Collider} collider - The Collider to remove from the simulation.\r\n *\r\n * @return {Phaser.Physics.Arcade.World} This World object.\r\n */\r\n removeCollider: function (collider)\r\n {\r\n this.colliders.remove(collider);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the frame rate to run the simulation at.\r\n *\r\n * The frame rate value is used to simulate a fixed update time step. This fixed\r\n * time step allows for a straightforward implementation of a deterministic game state.\r\n *\r\n * This frame rate is independent of the frequency at which the game is rendering. The\r\n * higher you set the fps, the more physics simulation steps will occur per game step.\r\n * Conversely, the lower you set it, the less will take place.\r\n *\r\n * You can optionally advance the simulation directly yourself by calling the `step` method.\r\n *\r\n * @method Phaser.Physics.Arcade.World#setFPS\r\n * @since 3.10.0\r\n *\r\n * @param {integer} framerate - The frame rate to advance the simulation at.\r\n *\r\n * @return {this} This World object.\r\n */\r\n setFPS: function (framerate)\r\n {\r\n this.fps = framerate;\r\n this._frameTime = 1 / this.fps;\r\n this._frameTimeMS = 1000 * this._frameTime;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Advances the simulation based on the elapsed time and fps rate.\r\n *\r\n * This is called automatically by your Scene and does not need to be invoked directly.\r\n *\r\n * @method Phaser.Physics.Arcade.World#update\r\n * @protected\r\n * @fires Phaser.Physics.Arcade.Events#WORLD_STEP\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n update: function (time, delta)\r\n {\r\n if (this.isPaused || this.bodies.size === 0)\r\n {\r\n return;\r\n }\r\n\r\n var i;\r\n var fixedDelta = this._frameTime;\r\n var msPerFrame = this._frameTimeMS * this.timeScale;\r\n\r\n this._elapsed += delta;\r\n\r\n // Update all active bodies\r\n var body;\r\n var bodies = this.bodies.entries;\r\n\r\n // Will a step happen this frame?\r\n var willStep = (this._elapsed >= msPerFrame);\r\n\r\n for (i = 0; i < bodies.length; i++)\r\n {\r\n body = bodies[i];\r\n\r\n if (body.enable)\r\n {\r\n body.preUpdate(willStep, fixedDelta);\r\n }\r\n }\r\n\r\n // We know that a step will happen this frame, so let's bundle it all together to save branching and iteration costs\r\n if (willStep)\r\n {\r\n this._elapsed -= msPerFrame;\r\n this.stepsLastFrame = 1;\r\n\r\n // Optionally populate our dynamic collision tree\r\n if (this.useTree)\r\n {\r\n this.tree.clear();\r\n this.tree.load(bodies);\r\n }\r\n\r\n // Process any colliders\r\n var colliders = this.colliders.update();\r\n\r\n for (i = 0; i < colliders.length; i++)\r\n {\r\n var collider = colliders[i];\r\n\r\n if (collider.active)\r\n {\r\n collider.update();\r\n }\r\n }\r\n\r\n this.emit(Events.WORLD_STEP);\r\n }\r\n\r\n // Process any additional steps this frame\r\n while (this._elapsed >= msPerFrame)\r\n {\r\n this._elapsed -= msPerFrame;\r\n\r\n this.step(fixedDelta);\r\n }\r\n },\r\n\r\n /**\r\n * Advances the simulation by a time increment.\r\n *\r\n * @method Phaser.Physics.Arcade.World#step\r\n * @fires Phaser.Physics.Arcade.Events#WORLD_STEP\r\n * @since 3.10.0\r\n *\r\n * @param {number} delta - The delta time amount, in seconds, by which to advance the simulation.\r\n */\r\n step: function (delta)\r\n {\r\n // Update all active bodies\r\n var i;\r\n var body;\r\n var bodies = this.bodies.entries;\r\n var len = bodies.length;\r\n\r\n for (i = 0; i < len; i++)\r\n {\r\n body = bodies[i];\r\n\r\n if (body.enable)\r\n {\r\n body.update(delta);\r\n }\r\n }\r\n\r\n // Optionally populate our dynamic collision tree\r\n if (this.useTree)\r\n {\r\n this.tree.clear();\r\n this.tree.load(bodies);\r\n }\r\n\r\n // Process any colliders\r\n var colliders = this.colliders.update();\r\n\r\n for (i = 0; i < colliders.length; i++)\r\n {\r\n var collider = colliders[i];\r\n\r\n if (collider.active)\r\n {\r\n collider.update();\r\n }\r\n }\r\n\r\n this.emit(Events.WORLD_STEP);\r\n\r\n this.stepsLastFrame++;\r\n },\r\n\r\n /**\r\n * Updates bodies, draws the debug display, and handles pending queue operations.\r\n *\r\n * @method Phaser.Physics.Arcade.World#postUpdate\r\n * @since 3.0.0\r\n */\r\n postUpdate: function ()\r\n {\r\n var i;\r\n var body;\r\n var bodies = this.bodies.entries;\r\n var len = bodies.length;\r\n\r\n var dynamic = this.bodies;\r\n var staticBodies = this.staticBodies;\r\n\r\n // We don't need to postUpdate if there wasn't a step this frame\r\n if (this.stepsLastFrame)\r\n {\r\n this.stepsLastFrame = 0;\r\n\r\n for (i = 0; i < len; i++)\r\n {\r\n body = bodies[i];\r\n\r\n if (body.enable)\r\n {\r\n body.postUpdate();\r\n }\r\n }\r\n }\r\n\r\n if (this.drawDebug)\r\n {\r\n var graphics = this.debugGraphic;\r\n\r\n graphics.clear();\r\n\r\n for (i = 0; i < len; i++)\r\n {\r\n body = bodies[i];\r\n\r\n if (body.willDrawDebug())\r\n {\r\n body.drawDebug(graphics);\r\n }\r\n }\r\n\r\n bodies = staticBodies.entries;\r\n len = bodies.length;\r\n\r\n for (i = 0; i < len; i++)\r\n {\r\n body = bodies[i];\r\n\r\n if (body.willDrawDebug())\r\n {\r\n body.drawDebug(graphics);\r\n }\r\n }\r\n }\r\n\r\n var pending = this.pendingDestroy;\r\n\r\n if (pending.size > 0)\r\n {\r\n var dynamicTree = this.tree;\r\n var staticTree = this.staticTree;\r\n\r\n bodies = pending.entries;\r\n len = bodies.length;\r\n\r\n for (i = 0; i < len; i++)\r\n {\r\n body = bodies[i];\r\n\r\n if (body.physicsType === CONST.DYNAMIC_BODY)\r\n {\r\n dynamicTree.remove(body);\r\n dynamic.delete(body);\r\n }\r\n else if (body.physicsType === CONST.STATIC_BODY)\r\n {\r\n staticTree.remove(body);\r\n staticBodies.delete(body);\r\n }\r\n\r\n body.world = undefined;\r\n body.gameObject = undefined;\r\n }\r\n\r\n pending.clear();\r\n }\r\n },\r\n\r\n /**\r\n * Calculates a Body's velocity and updates its position.\r\n *\r\n * @method Phaser.Physics.Arcade.World#updateMotion\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Body} body - The Body to be updated.\r\n * @param {number} delta - The delta value to be used in the motion calculations, in seconds.\r\n */\r\n updateMotion: function (body, delta)\r\n {\r\n if (body.allowRotation)\r\n {\r\n this.computeAngularVelocity(body, delta);\r\n }\r\n\r\n this.computeVelocity(body, delta);\r\n },\r\n\r\n /**\r\n * Calculates a Body's angular velocity.\r\n *\r\n * @method Phaser.Physics.Arcade.World#computeAngularVelocity\r\n * @since 3.10.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Body} body - The Body to compute the velocity for.\r\n * @param {number} delta - The delta value to be used in the calculation, in seconds.\r\n */\r\n computeAngularVelocity: function (body, delta)\r\n {\r\n var velocity = body.angularVelocity;\r\n var acceleration = body.angularAcceleration;\r\n var drag = body.angularDrag;\r\n var max = body.maxAngular;\r\n\r\n if (acceleration)\r\n {\r\n velocity += acceleration * delta;\r\n }\r\n else if (body.allowDrag && drag)\r\n {\r\n drag *= delta;\r\n\r\n if (FuzzyGreaterThan(velocity - drag, 0, 0.1))\r\n {\r\n velocity -= drag;\r\n }\r\n else if (FuzzyLessThan(velocity + drag, 0, 0.1))\r\n {\r\n velocity += drag;\r\n }\r\n else\r\n {\r\n velocity = 0;\r\n }\r\n }\r\n\r\n velocity = Clamp(velocity, -max, max);\r\n\r\n var velocityDelta = velocity - body.angularVelocity;\r\n\r\n body.angularVelocity += velocityDelta;\r\n body.rotation += (body.angularVelocity * delta);\r\n },\r\n\r\n /**\r\n * Calculates a Body's per-axis velocity.\r\n *\r\n * @method Phaser.Physics.Arcade.World#computeVelocity\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Body} body - The Body to compute the velocity for.\r\n * @param {number} delta - The delta value to be used in the calculation, in seconds.\r\n */\r\n computeVelocity: function (body, delta)\r\n {\r\n var velocityX = body.velocity.x;\r\n var accelerationX = body.acceleration.x;\r\n var dragX = body.drag.x;\r\n var maxX = body.maxVelocity.x;\r\n\r\n var velocityY = body.velocity.y;\r\n var accelerationY = body.acceleration.y;\r\n var dragY = body.drag.y;\r\n var maxY = body.maxVelocity.y;\r\n\r\n var speed = body.speed;\r\n var maxSpeed = body.maxSpeed;\r\n var allowDrag = body.allowDrag;\r\n var useDamping = body.useDamping;\r\n\r\n if (body.allowGravity)\r\n {\r\n velocityX += (this.gravity.x + body.gravity.x) * delta;\r\n velocityY += (this.gravity.y + body.gravity.y) * delta;\r\n }\r\n\r\n if (accelerationX)\r\n {\r\n velocityX += accelerationX * delta;\r\n }\r\n else if (allowDrag && dragX)\r\n {\r\n if (useDamping)\r\n {\r\n // Damping based deceleration\r\n\r\n velocityX *= dragX;\r\n\r\n speed = Math.sqrt(velocityX * velocityX + velocityY * velocityY);\r\n\r\n if (FuzzyEqual(speed, 0, 0.001))\r\n {\r\n velocityX = 0;\r\n }\r\n }\r\n else\r\n {\r\n // Linear deceleration\r\n dragX *= delta;\r\n\r\n if (FuzzyGreaterThan(velocityX - dragX, 0, 0.01))\r\n {\r\n velocityX -= dragX;\r\n }\r\n else if (FuzzyLessThan(velocityX + dragX, 0, 0.01))\r\n {\r\n velocityX += dragX;\r\n }\r\n else\r\n {\r\n velocityX = 0;\r\n }\r\n }\r\n }\r\n\r\n if (accelerationY)\r\n {\r\n velocityY += accelerationY * delta;\r\n }\r\n else if (allowDrag && dragY)\r\n {\r\n if (useDamping)\r\n {\r\n // Damping based deceleration\r\n velocityY *= dragY;\r\n\r\n speed = Math.sqrt(velocityX * velocityX + velocityY * velocityY);\r\n\r\n if (FuzzyEqual(speed, 0, 0.001))\r\n {\r\n velocityY = 0;\r\n }\r\n }\r\n else\r\n {\r\n // Linear deceleration\r\n dragY *= delta;\r\n\r\n if (FuzzyGreaterThan(velocityY - dragY, 0, 0.01))\r\n {\r\n velocityY -= dragY;\r\n }\r\n else if (FuzzyLessThan(velocityY + dragY, 0, 0.01))\r\n {\r\n velocityY += dragY;\r\n }\r\n else\r\n {\r\n velocityY = 0;\r\n }\r\n }\r\n }\r\n\r\n velocityX = Clamp(velocityX, -maxX, maxX);\r\n velocityY = Clamp(velocityY, -maxY, maxY);\r\n\r\n body.velocity.set(velocityX, velocityY);\r\n\r\n if (maxSpeed > -1 && speed > maxSpeed)\r\n {\r\n body.velocity.normalize().scale(maxSpeed);\r\n speed = maxSpeed;\r\n }\r\n\r\n body.speed = speed;\r\n },\r\n\r\n /**\r\n * Separates two Bodies.\r\n *\r\n * @method Phaser.Physics.Arcade.World#separate\r\n * @fires Phaser.Physics.Arcade.Events#COLLIDE\r\n * @fires Phaser.Physics.Arcade.Events#OVERLAP\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Body} body1 - The first Body to be separated.\r\n * @param {Phaser.Physics.Arcade.Body} body2 - The second Body to be separated.\r\n * @param {ArcadePhysicsCallback} [processCallback] - The process callback.\r\n * @param {*} [callbackContext] - The context in which to invoke the callback.\r\n * @param {boolean} [overlapOnly] - If this a collide or overlap check?\r\n *\r\n * @return {boolean} True if separation occurred, otherwise false.\r\n */\r\n separate: function (body1, body2, processCallback, callbackContext, overlapOnly)\r\n {\r\n if (\r\n !body1.enable ||\r\n !body2.enable ||\r\n body1.checkCollision.none ||\r\n body2.checkCollision.none ||\r\n !this.intersects(body1, body2))\r\n {\r\n return false;\r\n }\r\n\r\n // They overlap. Is there a custom process callback? If it returns true then we can carry on, otherwise we should abort.\r\n if (processCallback && processCallback.call(callbackContext, body1.gameObject, body2.gameObject) === false)\r\n {\r\n return false;\r\n }\r\n\r\n // Circle vs. Circle quick bail out\r\n if (body1.isCircle && body2.isCircle)\r\n {\r\n return this.separateCircle(body1, body2, overlapOnly);\r\n }\r\n\r\n // We define the behavior of bodies in a collision circle and rectangle\r\n // If a collision occurs in the corner points of the rectangle, the body behave like circles\r\n\r\n // Either body1 or body2 is a circle\r\n if (body1.isCircle !== body2.isCircle)\r\n {\r\n var bodyRect = (body1.isCircle) ? body2 : body1;\r\n var bodyCircle = (body1.isCircle) ? body1 : body2;\r\n\r\n var rect = {\r\n x: bodyRect.x,\r\n y: bodyRect.y,\r\n right: bodyRect.right,\r\n bottom: bodyRect.bottom\r\n };\r\n\r\n var circle = bodyCircle.center;\r\n\r\n if (circle.y < rect.y || circle.y > rect.bottom)\r\n {\r\n if (circle.x < rect.x || circle.x > rect.right)\r\n {\r\n return this.separateCircle(body1, body2, overlapOnly);\r\n }\r\n }\r\n }\r\n\r\n var resultX = false;\r\n var resultY = false;\r\n\r\n // Do we separate on x or y first?\r\n if (this.forceX || Math.abs(this.gravity.y + body1.gravity.y) < Math.abs(this.gravity.x + body1.gravity.x))\r\n {\r\n resultX = SeparateX(body1, body2, overlapOnly, this.OVERLAP_BIAS);\r\n\r\n // Are they still intersecting? Let's do the other axis then\r\n if (this.intersects(body1, body2))\r\n {\r\n resultY = SeparateY(body1, body2, overlapOnly, this.OVERLAP_BIAS);\r\n }\r\n }\r\n else\r\n {\r\n resultY = SeparateY(body1, body2, overlapOnly, this.OVERLAP_BIAS);\r\n\r\n // Are they still intersecting? Let's do the other axis then\r\n if (this.intersects(body1, body2))\r\n {\r\n resultX = SeparateX(body1, body2, overlapOnly, this.OVERLAP_BIAS);\r\n }\r\n }\r\n\r\n var result = (resultX || resultY);\r\n\r\n if (result)\r\n {\r\n if (overlapOnly)\r\n {\r\n if (body1.onOverlap || body2.onOverlap)\r\n {\r\n this.emit(Events.OVERLAP, body1.gameObject, body2.gameObject, body1, body2);\r\n }\r\n }\r\n else if (body1.onCollide || body2.onCollide)\r\n {\r\n this.emit(Events.COLLIDE, body1.gameObject, body2.gameObject, body1, body2);\r\n }\r\n }\r\n\r\n return result;\r\n },\r\n\r\n /**\r\n * Separates two Bodies, when both are circular.\r\n *\r\n * @method Phaser.Physics.Arcade.World#separateCircle\r\n * @fires Phaser.Physics.Arcade.Events#COLLIDE\r\n * @fires Phaser.Physics.Arcade.Events#OVERLAP\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Body} body1 - The first Body to be separated.\r\n * @param {Phaser.Physics.Arcade.Body} body2 - The second Body to be separated.\r\n * @param {boolean} [overlapOnly] - If this a collide or overlap check?\r\n * @param {number} [bias] - A small value added to the calculations.\r\n *\r\n * @return {boolean} True if separation occurred, otherwise false.\r\n */\r\n separateCircle: function (body1, body2, overlapOnly, bias)\r\n {\r\n // Set the bounding box overlap values into the bodies themselves (hence we don't use the return values here)\r\n GetOverlapX(body1, body2, false, bias);\r\n GetOverlapY(body1, body2, false, bias);\r\n\r\n var overlap = 0;\r\n\r\n if (body1.isCircle !== body2.isCircle)\r\n {\r\n var rect = {\r\n x: (body2.isCircle) ? body1.position.x : body2.position.x,\r\n y: (body2.isCircle) ? body1.position.y : body2.position.y,\r\n right: (body2.isCircle) ? body1.right : body2.right,\r\n bottom: (body2.isCircle) ? body1.bottom : body2.bottom\r\n };\r\n\r\n var circle = {\r\n x: (body1.isCircle) ? body1.center.x : body2.center.x,\r\n y: (body1.isCircle) ? body1.center.y : body2.center.y,\r\n radius: (body1.isCircle) ? body1.halfWidth : body2.halfWidth\r\n };\r\n\r\n if (circle.y < rect.y)\r\n {\r\n if (circle.x < rect.x)\r\n {\r\n overlap = DistanceBetween(circle.x, circle.y, rect.x, rect.y) - circle.radius;\r\n }\r\n else if (circle.x > rect.right)\r\n {\r\n overlap = DistanceBetween(circle.x, circle.y, rect.right, rect.y) - circle.radius;\r\n }\r\n }\r\n else if (circle.y > rect.bottom)\r\n {\r\n if (circle.x < rect.x)\r\n {\r\n overlap = DistanceBetween(circle.x, circle.y, rect.x, rect.bottom) - circle.radius;\r\n }\r\n else if (circle.x > rect.right)\r\n {\r\n overlap = DistanceBetween(circle.x, circle.y, rect.right, rect.bottom) - circle.radius;\r\n }\r\n }\r\n\r\n overlap *= -1;\r\n }\r\n else\r\n {\r\n overlap = (body1.halfWidth + body2.halfWidth) - DistanceBetween(body1.center.x, body1.center.y, body2.center.x, body2.center.y);\r\n }\r\n\r\n // Can't separate two immovable bodies, or a body with its own custom separation logic\r\n if (overlapOnly || overlap === 0 || (body1.immovable && body2.immovable) || body1.customSeparateX || body2.customSeparateX)\r\n {\r\n if (overlap !== 0 && (body1.onOverlap || body2.onOverlap))\r\n {\r\n this.emit(Events.OVERLAP, body1.gameObject, body2.gameObject, body1, body2);\r\n }\r\n\r\n // return true if there was some overlap, otherwise false\r\n return (overlap !== 0);\r\n }\r\n\r\n var dx = body1.center.x - body2.center.x;\r\n var dy = body1.center.y - body2.center.y;\r\n var d = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));\r\n var nx = ((body2.center.x - body1.center.x) / d) || 0;\r\n var ny = ((body2.center.y - body1.center.y) / d) || 0;\r\n var p = 2 * (body1.velocity.x * nx + body1.velocity.y * ny - body2.velocity.x * nx - body2.velocity.y * ny) / (body1.mass + body2.mass);\r\n\r\n if (!body1.immovable)\r\n {\r\n body1.velocity.x = (body1.velocity.x - p * body1.mass * nx);\r\n body1.velocity.y = (body1.velocity.y - p * body1.mass * ny);\r\n }\r\n\r\n if (!body2.immovable)\r\n {\r\n body2.velocity.x = (body2.velocity.x + p * body2.mass * nx);\r\n body2.velocity.y = (body2.velocity.y + p * body2.mass * ny);\r\n }\r\n\r\n var dvx = body2.velocity.x - body1.velocity.x;\r\n var dvy = body2.velocity.y - body1.velocity.y;\r\n var angleCollision = Math.atan2(dvy, dvx);\r\n\r\n var delta = this._frameTime;\r\n\r\n if (!body1.immovable && !body2.immovable)\r\n {\r\n overlap /= 2;\r\n }\r\n\r\n if (!body1.immovable)\r\n {\r\n body1.x += (body1.velocity.x * delta) - overlap * Math.cos(angleCollision);\r\n body1.y += (body1.velocity.y * delta) - overlap * Math.sin(angleCollision);\r\n }\r\n\r\n if (!body2.immovable)\r\n {\r\n body2.x += (body2.velocity.x * delta) + overlap * Math.cos(angleCollision);\r\n body2.y += (body2.velocity.y * delta) + overlap * Math.sin(angleCollision);\r\n }\r\n\r\n body1.velocity.x *= body1.bounce.x;\r\n body1.velocity.y *= body1.bounce.y;\r\n body2.velocity.x *= body2.bounce.x;\r\n body2.velocity.y *= body2.bounce.y;\r\n\r\n if (body1.onCollide || body2.onCollide)\r\n {\r\n this.emit(Events.COLLIDE, body1.gameObject, body2.gameObject, body1, body2);\r\n }\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Checks to see if two Bodies intersect at all.\r\n *\r\n * @method Phaser.Physics.Arcade.World#intersects\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Body} body1 - The first body to check.\r\n * @param {Phaser.Physics.Arcade.Body} body2 - The second body to check.\r\n *\r\n * @return {boolean} True if the two bodies intersect, otherwise false.\r\n */\r\n intersects: function (body1, body2)\r\n {\r\n if (body1 === body2)\r\n {\r\n return false;\r\n }\r\n\r\n if (!body1.isCircle && !body2.isCircle)\r\n {\r\n // Rect vs. Rect\r\n return !(\r\n body1.right <= body2.position.x ||\r\n body1.bottom <= body2.position.y ||\r\n body1.position.x >= body2.right ||\r\n body1.position.y >= body2.bottom\r\n );\r\n }\r\n else if (body1.isCircle)\r\n {\r\n if (body2.isCircle)\r\n {\r\n // Circle vs. Circle\r\n return DistanceBetween(body1.center.x, body1.center.y, body2.center.x, body2.center.y) <= (body1.halfWidth + body2.halfWidth);\r\n }\r\n else\r\n {\r\n // Circle vs. Rect\r\n return this.circleBodyIntersects(body1, body2);\r\n }\r\n }\r\n else\r\n {\r\n // Rect vs. Circle\r\n return this.circleBodyIntersects(body2, body1);\r\n }\r\n },\r\n\r\n /**\r\n * Tests if a circular Body intersects with another Body.\r\n *\r\n * @method Phaser.Physics.Arcade.World#circleBodyIntersects\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Body} circle - The circular body to test.\r\n * @param {Phaser.Physics.Arcade.Body} body - The rectangular body to test.\r\n *\r\n * @return {boolean} True if the two bodies intersect, otherwise false.\r\n */\r\n circleBodyIntersects: function (circle, body)\r\n {\r\n var x = Clamp(circle.center.x, body.left, body.right);\r\n var y = Clamp(circle.center.y, body.top, body.bottom);\r\n\r\n var dx = (circle.center.x - x) * (circle.center.x - x);\r\n var dy = (circle.center.y - y) * (circle.center.y - y);\r\n\r\n return (dx + dy) <= (circle.halfWidth * circle.halfWidth);\r\n },\r\n\r\n /**\r\n * Tests if Game Objects overlap.\r\n *\r\n * @method Phaser.Physics.Arcade.World#overlap\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check.\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`.\r\n * @param {ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap.\r\n * @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`.\r\n * @param {*} [callbackContext] - The context in which to run the callbacks.\r\n *\r\n * @return {boolean} True if at least one Game Object overlaps another.\r\n */\r\n overlap: function (object1, object2, overlapCallback, processCallback, callbackContext)\r\n {\r\n if (overlapCallback === undefined) { overlapCallback = null; }\r\n if (processCallback === undefined) { processCallback = null; }\r\n if (callbackContext === undefined) { callbackContext = overlapCallback; }\r\n\r\n return this.collideObjects(object1, object2, overlapCallback, processCallback, callbackContext, true);\r\n },\r\n\r\n /**\r\n * Performs a collision check and separation between the two physics enabled objects given, which can be single\r\n * Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups.\r\n *\r\n * If you don't require separation then use {@link #overlap} instead.\r\n *\r\n * If two Groups or arrays are passed, each member of one will be tested against each member of the other.\r\n *\r\n * If **only** one Group is passed (as `object1`), each member of the Group will be collided against the other members.\r\n *\r\n * If **only** one Array is passed, the array is iterated and every element in it is tested against the others.\r\n *\r\n * Two callbacks can be provided. The `collideCallback` is invoked if a collision occurs and the two colliding\r\n * objects are passed to it.\r\n *\r\n * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable\r\n * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other.\r\n * The separation that stops two objects penetrating may create a new penetration against a different object. If you\r\n * require a high level of stability please consider using an alternative physics system, such as Matter.js.\r\n *\r\n * @method Phaser.Physics.Arcade.World#collide\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check.\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide.\r\n * @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`.\r\n * @param {any} [callbackContext] - The context in which to run the callbacks.\r\n *\r\n * @return {boolean} `true` if any overlapping Game Objects were separated, otherwise `false`.\r\n */\r\n collide: function (object1, object2, collideCallback, processCallback, callbackContext)\r\n {\r\n if (collideCallback === undefined) { collideCallback = null; }\r\n if (processCallback === undefined) { processCallback = null; }\r\n if (callbackContext === undefined) { callbackContext = collideCallback; }\r\n\r\n return this.collideObjects(object1, object2, collideCallback, processCallback, callbackContext, false);\r\n },\r\n\r\n /**\r\n * Internal helper function. Please use Phaser.Physics.Arcade.World#collide instead.\r\n *\r\n * @method Phaser.Physics.Arcade.World#collideObjects\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision.\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object to check for collision.\r\n * @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide.\r\n * @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean.\r\n * @param {any} callbackContext - The scope in which to call the callbacks.\r\n * @param {boolean} overlapOnly - Whether this is a collision or overlap check.\r\n *\r\n * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated.\r\n */\r\n collideObjects: function (object1, object2, collideCallback, processCallback, callbackContext, overlapOnly)\r\n {\r\n var i;\r\n var j;\r\n\r\n if (object1.isParent && object1.physicsType === undefined)\r\n {\r\n object1 = object1.children.entries;\r\n }\r\n\r\n if (object2 && object2.isParent && object2.physicsType === undefined)\r\n {\r\n object2 = object2.children.entries;\r\n }\r\n\r\n var object1isArray = Array.isArray(object1);\r\n var object2isArray = Array.isArray(object2);\r\n\r\n this._total = 0;\r\n\r\n if (!object1isArray && !object2isArray)\r\n {\r\n // Neither of them are arrays - do this first as it's the most common use-case\r\n this.collideHandler(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly);\r\n }\r\n else if (!object1isArray && object2isArray)\r\n {\r\n // Object 2 is an Array\r\n for (i = 0; i < object2.length; i++)\r\n {\r\n this.collideHandler(object1, object2[i], collideCallback, processCallback, callbackContext, overlapOnly);\r\n }\r\n }\r\n else if (object1isArray && !object2isArray)\r\n {\r\n // Object 1 is an Array\r\n if (!object2)\r\n {\r\n // Special case for array vs. self\r\n for (i = 0; i < object1.length; i++)\r\n {\r\n var child = object1[i];\r\n\r\n for (j = i + 1; j < object1.length; j++)\r\n {\r\n if (i === j)\r\n {\r\n continue;\r\n }\r\n\r\n this.collideHandler(child, object1[j], collideCallback, processCallback, callbackContext, overlapOnly);\r\n }\r\n }\r\n }\r\n else\r\n {\r\n for (i = 0; i < object1.length; i++)\r\n {\r\n this.collideHandler(object1[i], object2, collideCallback, processCallback, callbackContext, overlapOnly);\r\n }\r\n }\r\n }\r\n else\r\n {\r\n // They're both arrays\r\n for (i = 0; i < object1.length; i++)\r\n {\r\n for (j = 0; j < object2.length; j++)\r\n {\r\n this.collideHandler(object1[i], object2[j], collideCallback, processCallback, callbackContext, overlapOnly);\r\n }\r\n }\r\n }\r\n\r\n return (this._total > 0);\r\n },\r\n\r\n /**\r\n * Internal helper function. Please use Phaser.Physics.Arcade.World#collide and Phaser.Physics.Arcade.World#overlap instead.\r\n *\r\n * @method Phaser.Physics.Arcade.World#collideHandler\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check.\r\n * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object or array of objects to check, or `undefined`.\r\n * @param {ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide.\r\n * @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`.\r\n * @param {any} callbackContext - The context in which to run the callbacks.\r\n * @param {boolean} overlapOnly - Whether this is a collision or overlap check.\r\n *\r\n * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated.\r\n */\r\n collideHandler: function (object1, object2, collideCallback, processCallback, callbackContext, overlapOnly)\r\n {\r\n // Collide Group with Self\r\n // Only collide valid objects\r\n if (object2 === undefined && object1.isParent)\r\n {\r\n return this.collideGroupVsGroup(object1, object1, collideCallback, processCallback, callbackContext, overlapOnly);\r\n }\r\n\r\n // If neither of the objects are set then bail out\r\n if (!object1 || !object2)\r\n {\r\n return false;\r\n }\r\n\r\n // A Body\r\n if (object1.body)\r\n {\r\n if (object2.body)\r\n {\r\n return this.collideSpriteVsSprite(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly);\r\n }\r\n else if (object2.isParent)\r\n {\r\n return this.collideSpriteVsGroup(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly);\r\n }\r\n else if (object2.isTilemap)\r\n {\r\n return this.collideSpriteVsTilemapLayer(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly);\r\n }\r\n }\r\n\r\n // GROUPS\r\n else if (object1.isParent)\r\n {\r\n if (object2.body)\r\n {\r\n return this.collideSpriteVsGroup(object2, object1, collideCallback, processCallback, callbackContext, overlapOnly);\r\n }\r\n else if (object2.isParent)\r\n {\r\n return this.collideGroupVsGroup(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly);\r\n }\r\n else if (object2.isTilemap)\r\n {\r\n return this.collideGroupVsTilemapLayer(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly);\r\n }\r\n }\r\n\r\n // TILEMAP LAYERS\r\n else if (object1.isTilemap)\r\n {\r\n if (object2.body)\r\n {\r\n return this.collideSpriteVsTilemapLayer(object2, object1, collideCallback, processCallback, callbackContext, overlapOnly);\r\n }\r\n else if (object2.isParent)\r\n {\r\n return this.collideGroupVsTilemapLayer(object2, object1, collideCallback, processCallback, callbackContext, overlapOnly);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Internal handler for Sprite vs. Sprite collisions.\r\n * Please use Phaser.Physics.Arcade.World#collide instead.\r\n *\r\n * @method Phaser.Physics.Arcade.World#collideSpriteVsSprite\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} sprite1 - The first object to check for collision.\r\n * @param {Phaser.GameObjects.GameObject} sprite2 - The second object to check for collision.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide.\r\n * @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`.\r\n * @param {any} [callbackContext] - The context in which to run the callbacks.\r\n * @param {boolean} overlapOnly - Whether this is a collision or overlap check.\r\n *\r\n * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated.\r\n */\r\n collideSpriteVsSprite: function (sprite1, sprite2, collideCallback, processCallback, callbackContext, overlapOnly)\r\n {\r\n if (!sprite1.body || !sprite2.body)\r\n {\r\n return false;\r\n }\r\n\r\n if (this.separate(sprite1.body, sprite2.body, processCallback, callbackContext, overlapOnly))\r\n {\r\n if (collideCallback)\r\n {\r\n collideCallback.call(callbackContext, sprite1, sprite2);\r\n }\r\n\r\n this._total++;\r\n }\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Internal handler for Sprite vs. Group collisions.\r\n * Please use Phaser.Physics.Arcade.World#collide instead.\r\n *\r\n * @method Phaser.Physics.Arcade.World#collideSpriteVsGroup\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision.\r\n * @param {Phaser.GameObjects.Group} group - The second object to check for collision.\r\n * @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide.\r\n * @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean.\r\n * @param {any} callbackContext - The scope in which to call the callbacks.\r\n * @param {boolean} overlapOnly - Whether this is a collision or overlap check.\r\n *\r\n * @return {boolean} `true` if the Sprite collided with the given Group, otherwise `false`.\r\n */\r\n collideSpriteVsGroup: function (sprite, group, collideCallback, processCallback, callbackContext, overlapOnly)\r\n {\r\n var bodyA = sprite.body;\r\n\r\n if (group.length === 0 || !bodyA || !bodyA.enable)\r\n {\r\n return;\r\n }\r\n\r\n // Does sprite collide with anything?\r\n\r\n var i;\r\n var len;\r\n var bodyB;\r\n\r\n if (this.useTree)\r\n {\r\n var minMax = this.treeMinMax;\r\n\r\n minMax.minX = bodyA.left;\r\n minMax.minY = bodyA.top;\r\n minMax.maxX = bodyA.right;\r\n minMax.maxY = bodyA.bottom;\r\n\r\n var results = (group.physicsType === CONST.DYNAMIC_BODY) ? this.tree.search(minMax) : this.staticTree.search(minMax);\r\n\r\n len = results.length;\r\n\r\n for (i = 0; i < len; i++)\r\n {\r\n bodyB = results[i];\r\n\r\n if (bodyA === bodyB || !bodyB.enable || !group.contains(bodyB.gameObject))\r\n {\r\n // Skip if comparing against itself, or if bodyB isn't actually part of the Group\r\n continue;\r\n }\r\n\r\n if (this.separate(bodyA, bodyB, processCallback, callbackContext, overlapOnly))\r\n {\r\n if (collideCallback)\r\n {\r\n collideCallback.call(callbackContext, bodyA.gameObject, bodyB.gameObject);\r\n }\r\n\r\n this._total++;\r\n }\r\n }\r\n }\r\n else\r\n {\r\n var children = group.getChildren();\r\n var skipIndex = group.children.entries.indexOf(sprite);\r\n\r\n len = children.length;\r\n\r\n for (i = 0; i < len; i++)\r\n {\r\n bodyB = children[i].body;\r\n\r\n if (!bodyB || i === skipIndex || !bodyB.enable)\r\n {\r\n continue;\r\n }\r\n\r\n if (this.separate(bodyA, bodyB, processCallback, callbackContext, overlapOnly))\r\n {\r\n if (collideCallback)\r\n {\r\n collideCallback.call(callbackContext, bodyA.gameObject, bodyB.gameObject);\r\n }\r\n\r\n this._total++;\r\n }\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Internal handler for Group vs. Tilemap collisions.\r\n * Please use Phaser.Physics.Arcade.World#collide instead.\r\n *\r\n * @method Phaser.Physics.Arcade.World#collideGroupVsTilemapLayer\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Group} group - The first object to check for collision.\r\n * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The second object to check for collision.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide.\r\n * @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`.\r\n * @param {any} [callbackContext] - The context in which to run the callbacks.\r\n * @param {boolean} overlapOnly - Whether this is a collision or overlap check.\r\n *\r\n * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated.\r\n */\r\n collideGroupVsTilemapLayer: function (group, tilemapLayer, collideCallback, processCallback, callbackContext, overlapOnly)\r\n {\r\n var children = group.getChildren();\r\n\r\n if (children.length === 0)\r\n {\r\n return false;\r\n }\r\n\r\n var didCollide = false;\r\n\r\n for (var i = 0; i < children.length; i++)\r\n {\r\n if (children[i].body)\r\n {\r\n if (this.collideSpriteVsTilemapLayer(children[i], tilemapLayer, collideCallback, processCallback, callbackContext, overlapOnly))\r\n {\r\n didCollide = true;\r\n }\r\n }\r\n }\r\n\r\n return didCollide;\r\n },\r\n\r\n /**\r\n * This advanced method is specifically for testing for collision between a single Sprite and an array of Tile objects.\r\n *\r\n * You should generally use the `collide` method instead, with a Sprite vs. a Tilemap Layer, as that will perform\r\n * tile filtering and culling for you, as well as handle the interesting face collision automatically.\r\n *\r\n * This method is offered for those who would like to check for collision with specific Tiles in a layer, without\r\n * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic collisions\r\n * on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method,\r\n * you should filter them before passing them to this method.\r\n *\r\n * Important: Use of this method skips the `interesting faces` system that Tilemap Layers use. This means if you have\r\n * say a row or column of tiles, and you jump into, or walk over them, it's possible to get stuck on the edges of the\r\n * tiles as the interesting face calculations are skipped. However, for quick-fire small collision set tests on\r\n * dynamic maps, this method can prove very useful.\r\n *\r\n * @method Phaser.Physics.Arcade.World#collideTiles\r\n * @fires Phaser.Physics.Arcade.Events#TILE_COLLIDE\r\n * @since 3.17.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision.\r\n * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide.\r\n * @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`.\r\n * @param {any} [callbackContext] - The context in which to run the callbacks.\r\n *\r\n * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated.\r\n */\r\n collideTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext)\r\n {\r\n if (!sprite.body.enable || tiles.length === 0)\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return this.collideSpriteVsTilesHandler(sprite, tiles, collideCallback, processCallback, callbackContext, false, false);\r\n }\r\n },\r\n\r\n /**\r\n * This advanced method is specifically for testing for overlaps between a single Sprite and an array of Tile objects.\r\n *\r\n * You should generally use the `overlap` method instead, with a Sprite vs. a Tilemap Layer, as that will perform\r\n * tile filtering and culling for you, as well as handle the interesting face collision automatically.\r\n *\r\n * This method is offered for those who would like to check for overlaps with specific Tiles in a layer, without\r\n * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic overlap\r\n * tests on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method,\r\n * you should filter them before passing them to this method.\r\n *\r\n * @method Phaser.Physics.Arcade.World#overlapTiles\r\n * @fires Phaser.Physics.Arcade.Events#TILE_OVERLAP\r\n * @since 3.17.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision.\r\n * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap.\r\n * @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`.\r\n * @param {any} [callbackContext] - The context in which to run the callbacks.\r\n *\r\n * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated.\r\n */\r\n overlapTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext)\r\n {\r\n if (!sprite.body.enable || tiles.length === 0)\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return this.collideSpriteVsTilesHandler(sprite, tiles, collideCallback, processCallback, callbackContext, true, false);\r\n }\r\n },\r\n\r\n /**\r\n * Internal handler for Sprite vs. Tilemap collisions.\r\n * Please use Phaser.Physics.Arcade.World#collide instead.\r\n *\r\n * @method Phaser.Physics.Arcade.World#collideSpriteVsTilemapLayer\r\n * @fires Phaser.Physics.Arcade.Events#TILE_COLLIDE\r\n * @fires Phaser.Physics.Arcade.Events#TILE_OVERLAP\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision.\r\n * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The second object to check for collision.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide.\r\n * @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`.\r\n * @param {any} [callbackContext] - The context in which to run the callbacks.\r\n * @param {boolean} [overlapOnly] - Whether this is a collision or overlap check.\r\n *\r\n * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated.\r\n */\r\n collideSpriteVsTilemapLayer: function (sprite, tilemapLayer, collideCallback, processCallback, callbackContext, overlapOnly)\r\n {\r\n var body = sprite.body;\r\n\r\n if (!body.enable)\r\n {\r\n return false;\r\n }\r\n\r\n var x = body.position.x;\r\n var y = body.position.y;\r\n var w = body.width;\r\n var h = body.height;\r\n\r\n // TODO: this logic should be encapsulated within the Tilemap API at some point.\r\n // If the maps base tile size differs from the layer's tile size, we need to adjust the\r\n // selection area by the difference between the two.\r\n var layerData = tilemapLayer.layer;\r\n\r\n if (layerData.tileWidth > layerData.baseTileWidth)\r\n {\r\n // The x origin of a tile is the left side, so x and width need to be adjusted.\r\n var xDiff = (layerData.tileWidth - layerData.baseTileWidth) * tilemapLayer.scaleX;\r\n x -= xDiff;\r\n w += xDiff;\r\n }\r\n\r\n if (layerData.tileHeight > layerData.baseTileHeight)\r\n {\r\n // The y origin of a tile is the bottom side, so just the height needs to be adjusted.\r\n var yDiff = (layerData.tileHeight - layerData.baseTileHeight) * tilemapLayer.scaleY;\r\n h += yDiff;\r\n }\r\n\r\n var mapData = tilemapLayer.getTilesWithinWorldXY(x, y, w, h);\r\n\r\n if (mapData.length === 0)\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return this.collideSpriteVsTilesHandler(sprite, mapData, collideCallback, processCallback, callbackContext, overlapOnly, true);\r\n }\r\n },\r\n\r\n /**\r\n * Internal handler for Sprite vs. Tilemap collisions.\r\n * Please use Phaser.Physics.Arcade.World#collide instead.\r\n *\r\n * @method Phaser.Physics.Arcade.World#collideSpriteVsTilesHandler\r\n * @fires Phaser.Physics.Arcade.Events#TILE_COLLIDE\r\n * @fires Phaser.Physics.Arcade.Events#TILE_OVERLAP\r\n * @private\r\n * @since 3.17.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision.\r\n * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The second object to check for collision.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide.\r\n * @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`.\r\n * @param {any} [callbackContext] - The context in which to run the callbacks.\r\n * @param {boolean} [overlapOnly] - Whether this is a collision or overlap check.\r\n * @param {boolean} [isLayer] - Is this check coming from a TilemapLayer or an array of tiles?\r\n *\r\n * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated.\r\n */\r\n collideSpriteVsTilesHandler: function (sprite, tiles, collideCallback, processCallback, callbackContext, overlapOnly, isLayer)\r\n {\r\n var body = sprite.body;\r\n\r\n var tile;\r\n var tileWorldRect = { left: 0, right: 0, top: 0, bottom: 0 };\r\n var tilemapLayer;\r\n var collision = false;\r\n\r\n for (var i = 0; i < tiles.length; i++)\r\n {\r\n tile = tiles[i];\r\n\r\n tilemapLayer = tile.tilemapLayer;\r\n\r\n tileWorldRect.left = tilemapLayer.tileToWorldX(tile.x);\r\n tileWorldRect.top = tilemapLayer.tileToWorldY(tile.y);\r\n\r\n // If the map's base tile size differs from the layer's tile size, only the top of the rect\r\n // needs to be adjusted since its origin is (0, 1).\r\n if (tile.baseHeight !== tile.height)\r\n {\r\n tileWorldRect.top -= (tile.height - tile.baseHeight) * tilemapLayer.scaleY;\r\n }\r\n\r\n tileWorldRect.right = tileWorldRect.left + tile.width * tilemapLayer.scaleX;\r\n tileWorldRect.bottom = tileWorldRect.top + tile.height * tilemapLayer.scaleY;\r\n\r\n if (TileIntersectsBody(tileWorldRect, body)\r\n && (!processCallback || processCallback.call(callbackContext, sprite, tile))\r\n && ProcessTileCallbacks(tile, sprite)\r\n && (overlapOnly || SeparateTile(i, body, tile, tileWorldRect, tilemapLayer, this.TILE_BIAS, isLayer)))\r\n {\r\n this._total++;\r\n\r\n collision = true;\r\n\r\n if (collideCallback)\r\n {\r\n collideCallback.call(callbackContext, sprite, tile);\r\n }\r\n\r\n if (overlapOnly && body.onOverlap)\r\n {\r\n this.emit(Events.TILE_OVERLAP, sprite, tile, body);\r\n }\r\n else if (body.onCollide)\r\n {\r\n this.emit(Events.TILE_COLLIDE, sprite, tile, body);\r\n }\r\n }\r\n }\r\n\r\n return collision;\r\n },\r\n\r\n /**\r\n * Internal helper for Group vs. Group collisions.\r\n * Please use Phaser.Physics.Arcade.World#collide instead.\r\n *\r\n * @method Phaser.Physics.Arcade.World#collideGroupVsGroup\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Group} group1 - The first object to check for collision.\r\n * @param {Phaser.GameObjects.Group} group2 - The second object to check for collision.\r\n * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide.\r\n * @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`.\r\n * @param {any} [callbackContext] - The context in which to run the callbacks.\r\n * @param {boolean} overlapOnly - Whether this is a collision or overlap check.\r\n *\r\n * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated.\r\n */\r\n collideGroupVsGroup: function (group1, group2, collideCallback, processCallback, callbackContext, overlapOnly)\r\n {\r\n if (group1.length === 0 || group2.length === 0)\r\n {\r\n return;\r\n }\r\n\r\n var children = group1.getChildren();\r\n\r\n for (var i = 0; i < children.length; i++)\r\n {\r\n this.collideSpriteVsGroup(children[i], group2, collideCallback, processCallback, callbackContext, overlapOnly);\r\n }\r\n },\r\n\r\n /**\r\n * Wrap an object's coordinates (or several objects' coordinates) within {@link Phaser.Physics.Arcade.World#bounds}.\r\n *\r\n * If the object is outside any boundary edge (left, top, right, bottom), it will be moved to the same offset from the opposite edge (the interior).\r\n *\r\n * @method Phaser.Physics.Arcade.World#wrap\r\n * @since 3.3.0\r\n *\r\n * @param {*} object - A Game Object, a Group, an object with `x` and `y` coordinates, or an array of such objects.\r\n * @param {number} [padding=0] - An amount added to each boundary edge during the operation.\r\n */\r\n wrap: function (object, padding)\r\n {\r\n if (object.body)\r\n {\r\n this.wrapObject(object, padding);\r\n }\r\n else if (object.getChildren)\r\n {\r\n this.wrapArray(object.getChildren(), padding);\r\n }\r\n else if (Array.isArray(object))\r\n {\r\n this.wrapArray(object, padding);\r\n }\r\n else\r\n {\r\n this.wrapObject(object, padding);\r\n }\r\n },\r\n\r\n /**\r\n * Wrap each object's coordinates within {@link Phaser.Physics.Arcade.World#bounds}.\r\n *\r\n * @method Phaser.Physics.Arcade.World#wrapArray\r\n * @since 3.3.0\r\n *\r\n * @param {Array.<*>} objects - An array of objects to be wrapped.\r\n * @param {number} [padding=0] - An amount added to the boundary.\r\n */\r\n wrapArray: function (objects, padding)\r\n {\r\n for (var i = 0; i < objects.length; i++)\r\n {\r\n this.wrapObject(objects[i], padding);\r\n }\r\n },\r\n\r\n /**\r\n * Wrap an object's coordinates within {@link Phaser.Physics.Arcade.World#bounds}.\r\n *\r\n * @method Phaser.Physics.Arcade.World#wrapObject\r\n * @since 3.3.0\r\n *\r\n * @param {*} object - A Game Object, a Physics Body, or any object with `x` and `y` coordinates\r\n * @param {number} [padding=0] - An amount added to the boundary.\r\n */\r\n wrapObject: function (object, padding)\r\n {\r\n if (padding === undefined) { padding = 0; }\r\n\r\n object.x = Wrap(object.x, this.bounds.left - padding, this.bounds.right + padding);\r\n object.y = Wrap(object.y, this.bounds.top - padding, this.bounds.bottom + padding);\r\n },\r\n\r\n /**\r\n * Shuts down the simulation, clearing physics data and removing listeners.\r\n *\r\n * @method Phaser.Physics.Arcade.World#shutdown\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n this.tree.clear();\r\n this.staticTree.clear();\r\n this.bodies.clear();\r\n this.staticBodies.clear();\r\n this.colliders.destroy();\r\n\r\n this.removeAllListeners();\r\n },\r\n\r\n /**\r\n * Shuts down the simulation and disconnects it from the current scene.\r\n *\r\n * @method Phaser.Physics.Arcade.World#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.scene = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = World;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/World.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/components/Acceleration.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/components/Acceleration.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for setting the acceleration properties of an Arcade Physics Body.\r\n *\r\n * @namespace Phaser.Physics.Arcade.Components.Acceleration\r\n * @since 3.0.0\r\n */\r\nvar Acceleration = {\r\n\r\n /**\r\n * 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.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Acceleration#setAcceleration\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal acceleration\r\n * @param {number} [y=x] - The vertical acceleration\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setAcceleration: function (x, y)\r\n {\r\n this.body.acceleration.set(x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the body's horizontal acceleration.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Acceleration#setAccelerationX\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The horizontal acceleration\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setAccelerationX: function (value)\r\n {\r\n this.body.acceleration.x = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the body's vertical acceleration.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Acceleration#setAccelerationY\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The vertical acceleration\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setAccelerationY: function (value)\r\n {\r\n this.body.acceleration.y = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Acceleration;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/components/Acceleration.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/components/Angular.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/components/Angular.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for setting the angular acceleration properties of an Arcade Physics Body.\r\n *\r\n * @namespace Phaser.Physics.Arcade.Components.Angular\r\n * @since 3.0.0\r\n */\r\nvar Angular = {\r\n\r\n /**\r\n * Sets the angular velocity of the body.\r\n * \r\n * In Arcade Physics, bodies cannot rotate. They are always axis-aligned.\r\n * However, they can have angular motion, which is passed on to the Game Object bound to the body,\r\n * causing them to visually rotate, even though the body remains axis-aligned.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Angular#setAngularVelocity\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The amount of angular velocity.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setAngularVelocity: function (value)\r\n {\r\n this.body.angularVelocity = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the angular acceleration of the body.\r\n * \r\n * In Arcade Physics, bodies cannot rotate. They are always axis-aligned.\r\n * However, they can have angular motion, which is passed on to the Game Object bound to the body,\r\n * causing them to visually rotate, even though the body remains axis-aligned.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Angular#setAngularAcceleration\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The amount of angular acceleration.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setAngularAcceleration: function (value)\r\n {\r\n this.body.angularAcceleration = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the angular drag of the body. Drag is applied to the current velocity, providing a form of deceleration.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Angular#setAngularDrag\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The amount of drag.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setAngularDrag: function (value)\r\n {\r\n this.body.angularDrag = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Angular;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/components/Angular.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/components/Bounce.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/components/Bounce.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for setting the bounce properties of an Arcade Physics Body.\r\n *\r\n * @namespace Phaser.Physics.Arcade.Components.Bounce\r\n * @since 3.0.0\r\n */\r\nvar Bounce = {\r\n\r\n /**\r\n * Sets the bounce values of this body.\r\n * \r\n * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object.\r\n * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Bounce#setBounce\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1.\r\n * @param {number} [y=x] - The amount of vertical bounce to apply on collision. A float, typically between 0 and 1.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setBounce: function (x, y)\r\n {\r\n this.body.bounce.set(x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal bounce value for this body.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Bounce#setBounceX\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setBounceX: function (value)\r\n {\r\n this.body.bounce.x = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the vertical bounce value for this body.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Bounce#setBounceY\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The amount of vertical bounce to apply on collision. A float, typically between 0 and 1.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setBounceY: function (value)\r\n {\r\n this.body.bounce.y = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets whether this Body collides with the world boundary.\r\n * \r\n * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Phaser.Math.Vector2 first.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Bounce#setCollideWorldBounds\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [value=true] - `true` if this body should collide with the world bounds, otherwise `false`.\r\n * @param {number} [bounceX] - If given this will be replace the `worldBounce.x` value.\r\n * @param {number} [bounceY] - If given this will be replace the `worldBounce.y` value.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setCollideWorldBounds: function (value, bounceX, bounceY)\r\n {\r\n this.body.setCollideWorldBounds(value, bounceX, bounceY);\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Bounce;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/components/Bounce.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/components/Debug.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/components/Debug.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for setting the debug properties of an Arcade Physics Body.\r\n *\r\n * @namespace Phaser.Physics.Arcade.Components.Debug\r\n * @since 3.0.0\r\n */\r\nvar Debug = {\r\n\r\n /**\r\n * Sets the debug values of this body.\r\n * \r\n * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole.\r\n * Note that there is a performance cost in drawing debug displays. It should never be used in production.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Debug#setDebug\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} showBody - Set to `true` to have this body render its outline to the debug display.\r\n * @param {boolean} showVelocity - Set to `true` to have this body render a velocity marker to the debug display.\r\n * @param {number} bodyColor - The color of the body outline when rendered to the debug display.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setDebug: function (showBody, showVelocity, bodyColor)\r\n {\r\n this.debugShowBody = showBody;\r\n this.debugShowVelocity = showVelocity;\r\n this.debugBodyColor = bodyColor;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the color of the body outline when it renders to the debug display.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Debug#setDebugBodyColor\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The color of the body outline when rendered to the debug display.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setDebugBodyColor: function (value)\r\n {\r\n this.body.debugBodyColor = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set to `true` to have this body render its outline to the debug display.\r\n *\r\n * @name Phaser.Physics.Arcade.Components.Debug#debugShowBody\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n debugShowBody: {\r\n\r\n get: function ()\r\n {\r\n return this.body.debugShowBody;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.body.debugShowBody = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Set to `true` to have this body render a velocity marker to the debug display.\r\n *\r\n * @name Phaser.Physics.Arcade.Components.Debug#debugShowVelocity\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n debugShowVelocity: {\r\n\r\n get: function ()\r\n {\r\n return this.body.debugShowVelocity;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.body.debugShowVelocity = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The color of the body outline when it renders to the debug display.\r\n *\r\n * @name Phaser.Physics.Arcade.Components.Debug#debugBodyColor\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n debugBodyColor: {\r\n\r\n get: function ()\r\n {\r\n return this.body.debugBodyColor;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.body.debugBodyColor = value;\r\n }\r\n\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Debug;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/components/Debug.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/components/Drag.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/components/Drag.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for setting the drag properties of an Arcade Physics Body.\r\n *\r\n * @namespace Phaser.Physics.Arcade.Components.Drag\r\n * @since 3.0.0\r\n */\r\nvar Drag = {\r\n\r\n /**\r\n * Sets the body's horizontal and vertical drag. If the vertical drag value is not provided, the vertical drag is set to the same value as the horizontal drag.\r\n *\r\n * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time.\r\n * It is the absolute loss of velocity due to movement, in pixels per second squared.\r\n * The x and y components are applied separately.\r\n *\r\n * When `useDamping` is true, this is 1 minus the damping factor.\r\n * A value of 1 means the Body loses no velocity.\r\n * A value of 0.95 means the Body loses 5% of its velocity per step.\r\n * A value of 0.5 means the Body loses 50% of its velocity per step.\r\n *\r\n * Drag is applied only when `acceleration` is zero.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Drag#setDrag\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The amount of horizontal drag to apply.\r\n * @param {number} [y=x] - The amount of vertical drag to apply.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setDrag: function (x, y)\r\n {\r\n this.body.drag.set(x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the body's horizontal drag.\r\n *\r\n * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time.\r\n * It is the absolute loss of velocity due to movement, in pixels per second squared.\r\n * The x and y components are applied separately.\r\n *\r\n * When `useDamping` is true, this is 1 minus the damping factor.\r\n * A value of 1 means the Body loses no velocity.\r\n * A value of 0.95 means the Body loses 5% of its velocity per step.\r\n * A value of 0.5 means the Body loses 50% of its velocity per step.\r\n *\r\n * Drag is applied only when `acceleration` is zero.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Drag#setDragX\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The amount of horizontal drag to apply.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setDragX: function (value)\r\n {\r\n this.body.drag.x = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the body's vertical drag.\r\n *\r\n * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time.\r\n * It is the absolute loss of velocity due to movement, in pixels per second squared.\r\n * The x and y components are applied separately.\r\n *\r\n * When `useDamping` is true, this is 1 minus the damping factor.\r\n * A value of 1 means the Body loses no velocity.\r\n * A value of 0.95 means the Body loses 5% of its velocity per step.\r\n * A value of 0.5 means the Body loses 50% of its velocity per step.\r\n *\r\n * Drag is applied only when `acceleration` is zero.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Drag#setDragY\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The amount of vertical drag to apply.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setDragY: function (value)\r\n {\r\n this.body.drag.y = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * If this Body is using `drag` for deceleration this function controls how the drag is applied.\r\n * If set to `true` drag will use a damping effect rather than a linear approach. If you are\r\n * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in\r\n * the game Asteroids) then you will get a far smoother and more visually correct deceleration\r\n * by using damping, avoiding the axis-drift that is prone with linear deceleration.\r\n *\r\n * If you enable this property then you should use far smaller `drag` values than with linear, as\r\n * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow\r\n * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Drag#setDamping\r\n * @since 3.10.0\r\n *\r\n * @param {boolean} value - `true` to use damping for deceleration, or `false` to use linear deceleration.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setDamping: function (value)\r\n {\r\n this.body.useDamping = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Drag;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/components/Drag.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/components/Enable.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/components/Enable.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for setting the enable properties of an Arcade Physics Body.\r\n *\r\n * @namespace Phaser.Physics.Arcade.Components.Enable\r\n * @since 3.0.0\r\n */\r\nvar Enable = {\r\n\r\n /**\r\n * Enables this Game Object's Body.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Enable#enableBody\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} reset - Also reset the Body and place it at (x, y).\r\n * @param {number} x - The horizontal position to place the Game Object and Body.\r\n * @param {number} y - The horizontal position to place the Game Object and Body.\r\n * @param {boolean} enableGameObject - Also activate this Game Object.\r\n * @param {boolean} showGameObject - Also show this Game Object.\r\n *\r\n * @return {this} This Game Object.\r\n *\r\n * @see Phaser.Physics.Arcade.Body#enable\r\n * @see Phaser.Physics.Arcade.StaticBody#enable\r\n * @see Phaser.Physics.Arcade.Body#reset\r\n * @see Phaser.Physics.Arcade.StaticBody#reset\r\n * @see Phaser.GameObjects.GameObject#active\r\n * @see Phaser.GameObjects.GameObject#visible\r\n */\r\n enableBody: function (reset, x, y, enableGameObject, showGameObject)\r\n {\r\n if (reset)\r\n {\r\n this.body.reset(x, y);\r\n }\r\n\r\n if (enableGameObject)\r\n {\r\n this.body.gameObject.active = true;\r\n }\r\n\r\n if (showGameObject)\r\n {\r\n this.body.gameObject.visible = true;\r\n }\r\n\r\n this.body.enable = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stops and disables this Game Object's Body.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Enable#disableBody\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [disableGameObject=false] - Also deactivate this Game Object.\r\n * @param {boolean} [hideGameObject=false] - Also hide this Game Object.\r\n *\r\n * @return {this} This Game Object.\r\n *\r\n * @see Phaser.Physics.Arcade.Body#enable\r\n * @see Phaser.Physics.Arcade.StaticBody#enable\r\n * @see Phaser.GameObjects.GameObject#active\r\n * @see Phaser.GameObjects.GameObject#visible\r\n */\r\n disableBody: function (disableGameObject, hideGameObject)\r\n {\r\n if (disableGameObject === undefined) { disableGameObject = false; }\r\n if (hideGameObject === undefined) { hideGameObject = false; }\r\n\r\n this.body.stop();\r\n\r\n this.body.enable = false;\r\n\r\n if (disableGameObject)\r\n {\r\n this.body.gameObject.active = false;\r\n }\r\n\r\n if (hideGameObject)\r\n {\r\n this.body.gameObject.visible = false;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Syncs the Body's position and size with its parent Game Object.\r\n * You don't need to call this for Dynamic Bodies, as it happens automatically.\r\n * But for Static bodies it's a useful way of modifying the position of a Static Body\r\n * in the Physics World, based on its Game Object.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Enable#refreshBody\r\n * @since 3.1.0\r\n *\r\n * @return {this} This Game Object.\r\n *\r\n * @see Phaser.Physics.Arcade.StaticBody#updateFromGameObject\r\n */\r\n refreshBody: function ()\r\n {\r\n this.body.updateFromGameObject();\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Enable;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/components/Enable.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/components/Friction.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/components/Friction.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * 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.\r\n *\r\n * @namespace Phaser.Physics.Arcade.Components.Friction\r\n * @since 3.0.0\r\n */\r\nvar Friction = {\r\n\r\n /**\r\n * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving.\r\n * The higher than friction, the faster the body will slow down once force stops being applied to it.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Friction#setFriction\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The amount of horizontal friction to apply.\r\n * @param {number} [y=x] - The amount of vertical friction to apply.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setFriction: function (x, y)\r\n {\r\n this.body.friction.set(x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis.\r\n * The higher than friction, the faster the body will slow down once force stops being applied to it.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Friction#setFrictionX\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The amount of friction to apply.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setFrictionX: function (x)\r\n {\r\n this.body.friction.x = x;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving vertically in the Y axis.\r\n * The higher than friction, the faster the body will slow down once force stops being applied to it.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Friction#setFrictionY\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The amount of friction to apply.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setFrictionY: function (y)\r\n {\r\n this.body.friction.y = y;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Friction;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/components/Friction.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/components/Gravity.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/components/Gravity.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods for setting the gravity properties of an Arcade Physics Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.Physics.Arcade.Components.Gravity\r\n * @since 3.0.0\r\n */\r\nvar Gravity = {\r\n\r\n /**\r\n * 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.\r\n * \r\n * If only one value is provided, this value will be used for both the X and Y axis.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Gravity#setGravity\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The gravitational force to be applied to the X-axis.\r\n * @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.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setGravity: function (x, y)\r\n {\r\n this.body.gravity.set(x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Gravity#setGravityX\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The gravitational force to be applied to the X-axis.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setGravityX: function (x)\r\n {\r\n this.body.gravity.x = x;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Gravity#setGravityY\r\n * @since 3.0.0\r\n *\r\n * @param {number} y - The gravitational force to be applied to the Y-axis.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setGravityY: function (y)\r\n {\r\n this.body.gravity.y = y;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Gravity;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/components/Gravity.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/components/Immovable.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/components/Immovable.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for setting the immovable properties of an Arcade Physics Body.\r\n *\r\n * @namespace Phaser.Physics.Arcade.Components.Immovable\r\n * @since 3.0.0\r\n */\r\nvar Immovable = {\r\n\r\n /**\r\n * Sets Whether this Body can be moved by collisions with another Body.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Immovable#setImmovable\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [value=true] - Sets if this body can be moved by collisions with another Body.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setImmovable: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.body.immovable = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Immovable;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/components/Immovable.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/components/Mass.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/components/Mass.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for setting the mass properties of an Arcade Physics Body.\r\n *\r\n * @namespace Phaser.Physics.Arcade.Components.Mass\r\n * @since 3.0.0\r\n */\r\nvar Mass = {\r\n\r\n /**\r\n * Sets the mass of the physics body\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Mass#setMass\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - New value for the mass of the body.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setMass: function (value)\r\n {\r\n this.body.mass = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Mass;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/components/Mass.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/components/OverlapCirc.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/components/OverlapCirc.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var OverlapRect = __webpack_require__(/*! ./OverlapRect */ \"./node_modules/phaser/src/physics/arcade/components/OverlapRect.js\");\r\nvar Circle = __webpack_require__(/*! ../../../geom/circle/Circle */ \"./node_modules/phaser/src/geom/circle/Circle.js\");\r\nvar CircleToCircle = __webpack_require__(/*! ../../../geom/intersects/CircleToCircle */ \"./node_modules/phaser/src/geom/intersects/CircleToCircle.js\");\r\nvar CircleToRectangle = __webpack_require__(/*! ../../../geom/intersects/CircleToRectangle */ \"./node_modules/phaser/src/geom/intersects/CircleToRectangle.js\");\r\n\r\n/**\r\n * This method will search the given circular area and return an array of all physics bodies that\r\n * overlap with it. It can return either Dynamic, Static bodies or a mixture of both.\r\n *\r\n * A body only has to intersect with the search area to be considered, it doesn't have to be fully\r\n * contained within it.\r\n *\r\n * If Arcade Physics is set to use the RTree (which it is by default) then the search is rather fast,\r\n * otherwise the search is O(N) for Dynamic Bodies.\r\n *\r\n * @function Phaser.Physics.Arcade.Components.OverlapCirc\r\n * @since 3.21.0\r\n *\r\n * @param {number} x - The x coordinate of the center of the area to search within.\r\n * @param {number} y - The y coordinate of the center of the area to search within.\r\n * @param {number} radius - The radius of the area to search within.\r\n * @param {boolean} [includeDynamic=true] - Should the search include Dynamic Bodies?\r\n * @param {boolean} [includeStatic=false] - Should the search include Static Bodies?\r\n *\r\n * @return {(Phaser.Physics.Arcade.Body[]|Phaser.Physics.Arcade.StaticBody[])} An array of bodies that overlap with the given area.\r\n */\r\nvar OverlapCirc = function (world, x, y, radius, includeDynamic, includeStatic)\r\n{\r\n var bodiesInRect = OverlapRect(world, x - radius, y - radius, 2 * radius, 2 * radius, includeDynamic, includeStatic);\r\n\r\n if (bodiesInRect.length === 0)\r\n {\r\n return bodiesInRect;\r\n }\r\n\r\n var area = new Circle(x, y, radius);\r\n var circFromBody = new Circle();\r\n var bodiesInArea = [];\r\n\r\n for (var i = 0; i < bodiesInRect.length; i++)\r\n {\r\n var body = bodiesInRect[i];\r\n\r\n if (body.isCircle)\r\n {\r\n circFromBody.setTo(body.center.x, body.center.y, body.halfWidth);\r\n\r\n if (CircleToCircle(area, circFromBody))\r\n {\r\n bodiesInArea.push(body);\r\n }\r\n }\r\n else if (CircleToRectangle(area, body))\r\n {\r\n bodiesInArea.push(body);\r\n }\r\n }\r\n\r\n return bodiesInArea;\r\n};\r\n\r\nmodule.exports = OverlapCirc;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/components/OverlapCirc.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/components/OverlapRect.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/components/OverlapRect.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * This method will search the given rectangular area and return an array of all physics bodies that\r\n * overlap with it. It can return either Dynamic, Static bodies or a mixture of both.\r\n * \r\n * A body only has to intersect with the search area to be considered, it doesn't have to be fully\r\n * contained within it.\r\n * \r\n * If Arcade Physics is set to use the RTree (which it is by default) then the search for is extremely fast,\r\n * otherwise the search is O(N) for Dynamic Bodies.\r\n *\r\n * @function Phaser.Physics.Arcade.Components.OverlapRect\r\n * @since 3.17.0\r\n *\r\n * @param {number} x - The top-left x coordinate of the area to search within.\r\n * @param {number} y - The top-left y coordinate of the area to search within.\r\n * @param {number} width - The width of the area to search within.\r\n * @param {number} height - The height of the area to search within.\r\n * @param {boolean} [includeDynamic=true] - Should the search include Dynamic Bodies?\r\n * @param {boolean} [includeStatic=false] - Should the search include Static Bodies?\r\n *\r\n * @return {(Phaser.Physics.Arcade.Body[]|Phaser.Physics.Arcade.StaticBody[])} An array of bodies that overlap with the given area.\r\n */\r\nvar OverlapRect = function (world, x, y, width, height, includeDynamic, includeStatic)\r\n{\r\n if (includeDynamic === undefined) { includeDynamic = true; }\r\n if (includeStatic === undefined) { includeStatic = false; }\r\n\r\n var dynamicBodies = [];\r\n var staticBodies = [];\r\n\r\n var minMax = world.treeMinMax;\r\n\r\n minMax.minX = x;\r\n minMax.minY = y;\r\n minMax.maxX = x + width;\r\n minMax.maxY = y + height;\r\n\r\n if (includeStatic)\r\n {\r\n staticBodies = world.staticTree.search(minMax);\r\n }\r\n\r\n if (includeDynamic && world.useTree)\r\n {\r\n dynamicBodies = world.tree.search(minMax);\r\n }\r\n else if (includeDynamic)\r\n {\r\n var bodies = world.bodies;\r\n\r\n var fakeBody =\r\n {\r\n position: {\r\n x: x,\r\n y: y\r\n },\r\n left: x,\r\n top: y,\r\n right: x + width,\r\n bottom: y + height,\r\n isCircle: false\r\n };\r\n\r\n var intersects = world.intersects;\r\n\r\n bodies.iterate(function (target)\r\n {\r\n if (intersects(target, fakeBody))\r\n {\r\n dynamicBodies.push(target);\r\n }\r\n\r\n });\r\n }\r\n\r\n return staticBodies.concat(dynamicBodies);\r\n};\r\n\r\nmodule.exports = OverlapRect;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/components/OverlapRect.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/components/Size.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/components/Size.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods for setting the size of an Arcade Physics Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.Physics.Arcade.Components.Size\r\n * @since 3.0.0\r\n */\r\nvar Size = {\r\n\r\n /**\r\n * Sets the body offset. This allows you to adjust the difference between the center of the body\r\n * and the x and y coordinates of the parent Game Object.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Size#setOffset\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The amount to offset the body from the parent Game Object along the x-axis.\r\n * @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.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setOffset: function (x, y)\r\n {\r\n this.body.setOffset(x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the size of this physics body. Setting the size does not adjust the dimensions\r\n * of the parent Game Object.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Size#setSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The new width of the physics body, in pixels.\r\n * @param {number} height - The new height of the physics body, in pixels.\r\n * @param {boolean} [center=true] - Should the body be re-positioned so its center aligns with the parent Game Object?\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSize: function (width, height, center)\r\n {\r\n this.body.setSize(width, height, center);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets this physics body to use a circle for collision instead of a rectangle.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Size#setCircle\r\n * @since 3.0.0\r\n *\r\n * @param {number} radius - The radius of the physics body, in pixels.\r\n * @param {number} [offsetX] - The amount to offset the body from the parent Game Object along the x-axis.\r\n * @param {number} [offsetY] - The amount to offset the body from the parent Game Object along the y-axis.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setCircle: function (radius, offsetX, offsetY)\r\n {\r\n this.body.setCircle(radius, offsetX, offsetY);\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Size;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/components/Size.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/components/Velocity.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/components/Velocity.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods for modifying the velocity of an Arcade Physics body.\r\n *\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.Physics.Arcade.Components.Velocity\r\n * @since 3.0.0\r\n */\r\nvar Velocity = {\r\n\r\n /**\r\n * Sets the velocity of the Body.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Velocity#setVelocity\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal velocity of the body. Positive values move the body to the right, while negative values move it to the left.\r\n * @param {number} [y=x] - The vertical velocity of the body. Positive values move the body down, while negative values move it up.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setVelocity: function (x, y)\r\n {\r\n this.body.setVelocity(x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal component of the body's velocity.\r\n *\r\n * Positive values move the body to the right, while negative values move it to the left.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Velocity#setVelocityX\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The new horizontal velocity.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setVelocityX: function (x)\r\n {\r\n this.body.setVelocityX(x);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the vertical component of the body's velocity.\r\n *\r\n * Positive values move the body down, while negative values move it up.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Velocity#setVelocityY\r\n * @since 3.0.0\r\n *\r\n * @param {number} y - The new vertical velocity of the body.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setVelocityY: function (y)\r\n {\r\n this.body.setVelocityY(y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the maximum velocity of the body.\r\n *\r\n * @method Phaser.Physics.Arcade.Components.Velocity#setMaxVelocity\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The new maximum horizontal velocity.\r\n * @param {number} [y=x] - The new maximum vertical velocity.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setMaxVelocity: function (x, y)\r\n {\r\n this.body.maxVelocity.set(x, y);\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Velocity;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/components/Velocity.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/components/index.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/components/index.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Physics.Arcade.Components\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Acceleration: __webpack_require__(/*! ./Acceleration */ \"./node_modules/phaser/src/physics/arcade/components/Acceleration.js\"),\r\n Angular: __webpack_require__(/*! ./Angular */ \"./node_modules/phaser/src/physics/arcade/components/Angular.js\"),\r\n Bounce: __webpack_require__(/*! ./Bounce */ \"./node_modules/phaser/src/physics/arcade/components/Bounce.js\"),\r\n Debug: __webpack_require__(/*! ./Debug */ \"./node_modules/phaser/src/physics/arcade/components/Debug.js\"),\r\n Drag: __webpack_require__(/*! ./Drag */ \"./node_modules/phaser/src/physics/arcade/components/Drag.js\"),\r\n Enable: __webpack_require__(/*! ./Enable */ \"./node_modules/phaser/src/physics/arcade/components/Enable.js\"),\r\n Friction: __webpack_require__(/*! ./Friction */ \"./node_modules/phaser/src/physics/arcade/components/Friction.js\"),\r\n Gravity: __webpack_require__(/*! ./Gravity */ \"./node_modules/phaser/src/physics/arcade/components/Gravity.js\"),\r\n Immovable: __webpack_require__(/*! ./Immovable */ \"./node_modules/phaser/src/physics/arcade/components/Immovable.js\"),\r\n Mass: __webpack_require__(/*! ./Mass */ \"./node_modules/phaser/src/physics/arcade/components/Mass.js\"),\r\n Size: __webpack_require__(/*! ./Size */ \"./node_modules/phaser/src/physics/arcade/components/Size.js\"),\r\n Velocity: __webpack_require__(/*! ./Velocity */ \"./node_modules/phaser/src/physics/arcade/components/Velocity.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/components/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/const.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/const.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Arcade Physics consts.\r\n *\r\n * @ignore\r\n */\r\n\r\nvar CONST = {\r\n\r\n /**\r\n * Dynamic Body.\r\n *\r\n * @name Phaser.Physics.Arcade.DYNAMIC_BODY\r\n * @readonly\r\n * @type {number}\r\n * @since 3.0.0\r\n *\r\n * @see Phaser.Physics.Arcade.Body#physicsType\r\n * @see Phaser.Physics.Arcade.Group#physicsType\r\n */\r\n DYNAMIC_BODY: 0,\r\n\r\n /**\r\n * Static Body.\r\n *\r\n * @name Phaser.Physics.Arcade.STATIC_BODY\r\n * @readonly\r\n * @type {number}\r\n * @since 3.0.0\r\n *\r\n * @see Phaser.Physics.Arcade.Body#physicsType\r\n * @see Phaser.Physics.Arcade.StaticBody#physicsType\r\n */\r\n STATIC_BODY: 1,\r\n\r\n /**\r\n * Arcade Physics Group containing Dynamic Bodies.\r\n *\r\n * @name Phaser.Physics.Arcade.GROUP\r\n * @readonly\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n GROUP: 2,\r\n\r\n /**\r\n * A Tilemap Layer.\r\n *\r\n * @name Phaser.Physics.Arcade.TILEMAPLAYER\r\n * @readonly\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n TILEMAPLAYER: 3,\r\n\r\n /**\r\n * Facing no direction (initial value).\r\n *\r\n * @name Phaser.Physics.Arcade.FACING_NONE\r\n * @readonly\r\n * @type {number}\r\n * @since 3.0.0\r\n *\r\n * @see Phaser.Physics.Arcade.Body#facing\r\n */\r\n FACING_NONE: 10,\r\n\r\n /**\r\n * Facing up.\r\n *\r\n * @name Phaser.Physics.Arcade.FACING_UP\r\n * @readonly\r\n * @type {number}\r\n * @since 3.0.0\r\n *\r\n * @see Phaser.Physics.Arcade.Body#facing\r\n */\r\n FACING_UP: 11,\r\n\r\n /**\r\n * Facing down.\r\n *\r\n * @name Phaser.Physics.Arcade.FACING_DOWN\r\n * @readonly\r\n * @type {number}\r\n * @since 3.0.0\r\n *\r\n * @see Phaser.Physics.Arcade.Body#facing\r\n */\r\n FACING_DOWN: 12,\r\n\r\n /**\r\n * Facing left.\r\n *\r\n * @name Phaser.Physics.Arcade.FACING_LEFT\r\n * @readonly\r\n * @type {number}\r\n * @since 3.0.0\r\n *\r\n * @see Phaser.Physics.Arcade.Body#facing\r\n */\r\n FACING_LEFT: 13,\r\n\r\n /**\r\n * Facing right.\r\n *\r\n * @name Phaser.Physics.Arcade.FACING_RIGHT\r\n * @readonly\r\n * @type {number}\r\n * @since 3.0.0\r\n *\r\n * @see Phaser.Physics.Arcade.Body#facing\r\n */\r\n FACING_RIGHT: 14\r\n\r\n};\r\n\r\nmodule.exports = CONST;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/const.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/events/COLLIDE_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/events/COLLIDE_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Arcade Physics World Collide Event.\r\n * \r\n * This event is dispatched by an Arcade Physics World instance if two bodies collide _and_ at least\r\n * one of them has their [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`.\r\n * \r\n * It provides an alternative means to handling collide events rather than using the callback approach.\r\n * \r\n * Listen to it from a Scene using: `this.physics.world.on('collide', listener)`.\r\n * \r\n * Please note that 'collide' and 'overlap' are two different things in Arcade Physics.\r\n *\r\n * @event Phaser.Physics.Arcade.Events#COLLIDE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.GameObjects.GameObject} gameObject1 - The first Game Object involved in the collision. This is the parent of `body1`.\r\n * @param {Phaser.GameObjects.GameObject} gameObject2 - The second Game Object involved in the collision. This is the parent of `body2`.\r\n * @param {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody} body1 - The first Physics Body involved in the collision.\r\n * @param {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody} body2 - The second Physics Body involved in the collision.\r\n */\r\nmodule.exports = 'collide';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/events/COLLIDE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/events/OVERLAP_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/events/OVERLAP_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Arcade Physics World Overlap Event.\r\n * \r\n * This event is dispatched by an Arcade Physics World instance if two bodies overlap _and_ at least\r\n * one of them has their [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`.\r\n * \r\n * It provides an alternative means to handling overlap events rather than using the callback approach.\r\n * \r\n * Listen to it from a Scene using: `this.physics.world.on('overlap', listener)`.\r\n * \r\n * Please note that 'collide' and 'overlap' are two different things in Arcade Physics.\r\n *\r\n * @event Phaser.Physics.Arcade.Events#OVERLAP\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.GameObjects.GameObject} gameObject1 - The first Game Object involved in the overlap. This is the parent of `body1`.\r\n * @param {Phaser.GameObjects.GameObject} gameObject2 - The second Game Object involved in the overlap. This is the parent of `body2`.\r\n * @param {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody} body1 - The first Physics Body involved in the overlap.\r\n * @param {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody} body2 - The second Physics Body involved in the overlap.\r\n */\r\nmodule.exports = 'overlap';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/events/OVERLAP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/events/PAUSE_EVENT.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/events/PAUSE_EVENT.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Arcade Physics World Pause Event.\r\n * \r\n * This event is dispatched by an Arcade Physics World instance when it is paused.\r\n * \r\n * Listen to it from a Scene using: `this.physics.world.on('pause', listener)`.\r\n *\r\n * @event Phaser.Physics.Arcade.Events#PAUSE\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'pause';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/events/PAUSE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/events/RESUME_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/events/RESUME_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Arcade Physics World Resume Event.\r\n * \r\n * This event is dispatched by an Arcade Physics World instance when it resumes from a paused state.\r\n * \r\n * Listen to it from a Scene using: `this.physics.world.on('resume', listener)`.\r\n *\r\n * @event Phaser.Physics.Arcade.Events#RESUME\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'resume';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/events/RESUME_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/events/TILE_COLLIDE_EVENT.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/events/TILE_COLLIDE_EVENT.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Arcade Physics Tile Collide Event.\r\n * \r\n * This event is dispatched by an Arcade Physics World instance if a body collides with a Tile _and_\r\n * has its [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`.\r\n * \r\n * It provides an alternative means to handling collide events rather than using the callback approach.\r\n * \r\n * Listen to it from a Scene using: `this.physics.world.on('tilecollide', listener)`.\r\n * \r\n * Please note that 'collide' and 'overlap' are two different things in Arcade Physics.\r\n *\r\n * @event Phaser.Physics.Arcade.Events#TILE_COLLIDE\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object involved in the collision. This is the parent of `body`.\r\n * @param {Phaser.Tilemaps.Tile} tile - The tile the body collided with.\r\n * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body of the Game Object involved in the collision.\r\n */\r\nmodule.exports = 'tilecollide';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/events/TILE_COLLIDE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/events/TILE_OVERLAP_EVENT.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/events/TILE_OVERLAP_EVENT.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Arcade Physics Tile Overlap Event.\r\n * \r\n * This event is dispatched by an Arcade Physics World instance if a body overlaps with a Tile _and_\r\n * has its [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`.\r\n * \r\n * It provides an alternative means to handling overlap events rather than using the callback approach.\r\n * \r\n * Listen to it from a Scene using: `this.physics.world.on('tileoverlap', listener)`.\r\n * \r\n * Please note that 'collide' and 'overlap' are two different things in Arcade Physics.\r\n *\r\n * @event Phaser.Physics.Arcade.Events#TILE_OVERLAP\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object involved in the overlap. This is the parent of `body`.\r\n * @param {Phaser.Tilemaps.Tile} tile - The tile the body overlapped.\r\n * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body of the Game Object involved in the overlap.\r\n */\r\nmodule.exports = 'tileoverlap';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/events/TILE_OVERLAP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/events/WORLD_BOUNDS_EVENT.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/events/WORLD_BOUNDS_EVENT.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Arcade Physics World Bounds Event.\r\n * \r\n * This event is dispatched by an Arcade Physics World instance if a body makes contact with the world bounds _and_\r\n * it has its [onWorldBounds]{@link Phaser.Physics.Arcade.Body#onWorldBounds} property set to `true`.\r\n * \r\n * It provides an alternative means to handling collide events rather than using the callback approach.\r\n * \r\n * Listen to it from a Scene using: `this.physics.world.on('worldbounds', listener)`.\r\n *\r\n * @event Phaser.Physics.Arcade.Events#WORLD_BOUNDS\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body that hit the world bounds.\r\n * @param {boolean} up - Is the Body blocked up? I.e. collided with the top of the world bounds.\r\n * @param {boolean} down - Is the Body blocked down? I.e. collided with the bottom of the world bounds.\r\n * @param {boolean} left - Is the Body blocked left? I.e. collided with the left of the world bounds.\r\n * @param {boolean} right - Is the Body blocked right? I.e. collided with the right of the world bounds.\r\n */\r\nmodule.exports = 'worldbounds';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/events/WORLD_BOUNDS_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/events/WORLD_STEP_EVENT.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/events/WORLD_STEP_EVENT.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Arcade Physics World Step Event.\r\n * \r\n * This event is dispatched by an Arcade Physics World instance whenever a physics step is run.\r\n * It is emitted _after_ the bodies and colliders have been updated.\r\n * \r\n * In high framerate settings this can be multiple times per game frame.\r\n * \r\n * Listen to it from a Scene using: `this.physics.world.on('worldstep', listener)`.\r\n *\r\n * @event Phaser.Physics.Arcade.Events#WORLD_STEP\r\n * @since 3.18.0\r\n */\r\nmodule.exports = 'worldstep';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/events/WORLD_STEP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/events/index.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/events/index.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Physics.Arcade.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n COLLIDE: __webpack_require__(/*! ./COLLIDE_EVENT */ \"./node_modules/phaser/src/physics/arcade/events/COLLIDE_EVENT.js\"),\r\n OVERLAP: __webpack_require__(/*! ./OVERLAP_EVENT */ \"./node_modules/phaser/src/physics/arcade/events/OVERLAP_EVENT.js\"),\r\n PAUSE: __webpack_require__(/*! ./PAUSE_EVENT */ \"./node_modules/phaser/src/physics/arcade/events/PAUSE_EVENT.js\"),\r\n RESUME: __webpack_require__(/*! ./RESUME_EVENT */ \"./node_modules/phaser/src/physics/arcade/events/RESUME_EVENT.js\"),\r\n TILE_COLLIDE: __webpack_require__(/*! ./TILE_COLLIDE_EVENT */ \"./node_modules/phaser/src/physics/arcade/events/TILE_COLLIDE_EVENT.js\"),\r\n TILE_OVERLAP: __webpack_require__(/*! ./TILE_OVERLAP_EVENT */ \"./node_modules/phaser/src/physics/arcade/events/TILE_OVERLAP_EVENT.js\"),\r\n WORLD_BOUNDS: __webpack_require__(/*! ./WORLD_BOUNDS_EVENT */ \"./node_modules/phaser/src/physics/arcade/events/WORLD_BOUNDS_EVENT.js\"),\r\n WORLD_STEP: __webpack_require__(/*! ./WORLD_STEP_EVENT */ \"./node_modules/phaser/src/physics/arcade/events/WORLD_STEP_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/index.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/physics/arcade/const.js\");\r\nvar Extend = __webpack_require__(/*! ../../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\n\r\n/**\r\n * @callback ArcadePhysicsCallback\r\n *\r\n * @param {Phaser.GameObjects.GameObject} object1 - The first Body to separate.\r\n * @param {Phaser.GameObjects.GameObject} object2 - The second Body to separate.\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Physics.Arcade\r\n */\r\n\r\nvar Arcade = {\r\n\r\n ArcadePhysics: __webpack_require__(/*! ./ArcadePhysics */ \"./node_modules/phaser/src/physics/arcade/ArcadePhysics.js\"),\r\n Body: __webpack_require__(/*! ./Body */ \"./node_modules/phaser/src/physics/arcade/Body.js\"),\r\n Collider: __webpack_require__(/*! ./Collider */ \"./node_modules/phaser/src/physics/arcade/Collider.js\"),\r\n Components: __webpack_require__(/*! ./components */ \"./node_modules/phaser/src/physics/arcade/components/index.js\"),\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/physics/arcade/events/index.js\"),\r\n Factory: __webpack_require__(/*! ./Factory */ \"./node_modules/phaser/src/physics/arcade/Factory.js\"),\r\n Group: __webpack_require__(/*! ./PhysicsGroup */ \"./node_modules/phaser/src/physics/arcade/PhysicsGroup.js\"),\r\n Image: __webpack_require__(/*! ./ArcadeImage */ \"./node_modules/phaser/src/physics/arcade/ArcadeImage.js\"),\r\n Sprite: __webpack_require__(/*! ./ArcadeSprite */ \"./node_modules/phaser/src/physics/arcade/ArcadeSprite.js\"),\r\n StaticBody: __webpack_require__(/*! ./StaticBody */ \"./node_modules/phaser/src/physics/arcade/StaticBody.js\"),\r\n StaticGroup: __webpack_require__(/*! ./StaticPhysicsGroup */ \"./node_modules/phaser/src/physics/arcade/StaticPhysicsGroup.js\"),\r\n World: __webpack_require__(/*! ./World */ \"./node_modules/phaser/src/physics/arcade/World.js\")\r\n\r\n};\r\n\r\n// Merge in the consts\r\nArcade = Extend(false, Arcade, CONST);\r\n\r\nmodule.exports = Arcade;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/tilemap/ProcessTileCallbacks.js": /*!********************************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/tilemap/ProcessTileCallbacks.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * A function to process the collision callbacks between a single tile and an Arcade Physics enabled Game Object.\r\n *\r\n * @function Phaser.Physics.Arcade.Tilemap.ProcessTileCallbacks\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tilemaps.Tile} tile - The Tile to process.\r\n * @param {Phaser.GameObjects.Sprite} sprite - The Game Object to process with the Tile.\r\n *\r\n * @return {boolean} The result of the callback, `true` for further processing, or `false` to skip this pair.\r\n */\r\nvar ProcessTileCallbacks = function (tile, sprite)\r\n{\r\n // Tile callbacks take priority over layer level callbacks\r\n if (tile.collisionCallback)\r\n {\r\n return !tile.collisionCallback.call(tile.collisionCallbackContext, sprite, tile);\r\n }\r\n else if (tile.layer.callbacks[tile.index])\r\n {\r\n return !tile.layer.callbacks[tile.index].callback.call(\r\n tile.layer.callbacks[tile.index].callbackContext, sprite, tile\r\n );\r\n }\r\n\r\n return true;\r\n};\r\n\r\nmodule.exports = ProcessTileCallbacks;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/tilemap/ProcessTileCallbacks.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/tilemap/ProcessTileSeparationX.js": /*!**********************************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/tilemap/ProcessTileSeparationX.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Internal function to process the separation of a physics body from a tile.\r\n *\r\n * @function Phaser.Physics.Arcade.Tilemap.ProcessTileSeparationX\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate.\r\n * @param {number} x - The x separation amount.\r\n */\r\nvar ProcessTileSeparationX = function (body, x)\r\n{\r\n if (x < 0)\r\n {\r\n body.blocked.none = false;\r\n body.blocked.left = true;\r\n }\r\n else if (x > 0)\r\n {\r\n body.blocked.none = false;\r\n body.blocked.right = true;\r\n }\r\n\r\n body.position.x -= x;\r\n\r\n if (body.bounce.x === 0)\r\n {\r\n body.velocity.x = 0;\r\n }\r\n else\r\n {\r\n body.velocity.x = -body.velocity.x * body.bounce.x;\r\n }\r\n};\r\n\r\nmodule.exports = ProcessTileSeparationX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/tilemap/ProcessTileSeparationX.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/tilemap/ProcessTileSeparationY.js": /*!**********************************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/tilemap/ProcessTileSeparationY.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Internal function to process the separation of a physics body from a tile.\r\n *\r\n * @function Phaser.Physics.Arcade.Tilemap.ProcessTileSeparationY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate.\r\n * @param {number} y - The y separation amount.\r\n */\r\nvar ProcessTileSeparationY = function (body, y)\r\n{\r\n if (y < 0)\r\n {\r\n body.blocked.none = false;\r\n body.blocked.up = true;\r\n }\r\n else if (y > 0)\r\n {\r\n body.blocked.none = false;\r\n body.blocked.down = true;\r\n }\r\n\r\n body.position.y -= y;\r\n\r\n if (body.bounce.y === 0)\r\n {\r\n body.velocity.y = 0;\r\n }\r\n else\r\n {\r\n body.velocity.y = -body.velocity.y * body.bounce.y;\r\n }\r\n};\r\n\r\nmodule.exports = ProcessTileSeparationY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/tilemap/ProcessTileSeparationY.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/tilemap/SeparateTile.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/tilemap/SeparateTile.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar TileCheckX = __webpack_require__(/*! ./TileCheckX */ \"./node_modules/phaser/src/physics/arcade/tilemap/TileCheckX.js\");\r\nvar TileCheckY = __webpack_require__(/*! ./TileCheckY */ \"./node_modules/phaser/src/physics/arcade/tilemap/TileCheckY.js\");\r\nvar TileIntersectsBody = __webpack_require__(/*! ./TileIntersectsBody */ \"./node_modules/phaser/src/physics/arcade/tilemap/TileIntersectsBody.js\");\r\n\r\n/**\r\n * The core separation function to separate a physics body and a tile.\r\n *\r\n * @function Phaser.Physics.Arcade.Tilemap.SeparateTile\r\n * @since 3.0.0\r\n *\r\n * @param {number} i - The index of the tile within the map data.\r\n * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate.\r\n * @param {Phaser.Tilemaps.Tile} tile - The tile to collide against.\r\n * @param {Phaser.Geom.Rectangle} tileWorldRect - A rectangle-like object defining the dimensions of the tile.\r\n * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The tilemapLayer to collide against.\r\n * @param {number} tileBias - The tile bias value. Populated by the `World.TILE_BIAS` constant.\r\n * @param {boolean} isLayer - Is this check coming from a TilemapLayer or an array of tiles?\r\n *\r\n * @return {boolean} `true` if the body was separated, otherwise `false`.\r\n */\r\nvar SeparateTile = function (i, body, tile, tileWorldRect, tilemapLayer, tileBias, isLayer)\r\n{\r\n var tileLeft = tileWorldRect.left;\r\n var tileTop = tileWorldRect.top;\r\n var tileRight = tileWorldRect.right;\r\n var tileBottom = tileWorldRect.bottom;\r\n var faceHorizontal = tile.faceLeft || tile.faceRight;\r\n var faceVertical = tile.faceTop || tile.faceBottom;\r\n\r\n if (!isLayer)\r\n {\r\n faceHorizontal = true;\r\n faceVertical = true;\r\n }\r\n\r\n // We don't need to go any further if this tile doesn't actually have any colliding faces. This\r\n // could happen if the tile was meant to be collided with re: a callback, but otherwise isn't\r\n // needed for separation.\r\n if (!faceHorizontal && !faceVertical)\r\n {\r\n return false;\r\n }\r\n\r\n var ox = 0;\r\n var oy = 0;\r\n var minX = 0;\r\n var minY = 1;\r\n\r\n if (body.deltaAbsX() > body.deltaAbsY())\r\n {\r\n // Moving faster horizontally, check X axis first\r\n minX = -1;\r\n }\r\n else if (body.deltaAbsX() < body.deltaAbsY())\r\n {\r\n // Moving faster vertically, check Y axis first\r\n minY = -1;\r\n }\r\n\r\n if (body.deltaX() !== 0 && body.deltaY() !== 0 && faceHorizontal && faceVertical)\r\n {\r\n // We only need do this if both axes have colliding faces AND we're moving in both\r\n // directions\r\n minX = Math.min(Math.abs(body.position.x - tileRight), Math.abs(body.right - tileLeft));\r\n minY = Math.min(Math.abs(body.position.y - tileBottom), Math.abs(body.bottom - tileTop));\r\n }\r\n\r\n if (minX < minY)\r\n {\r\n if (faceHorizontal)\r\n {\r\n ox = TileCheckX(body, tile, tileLeft, tileRight, tileBias, isLayer);\r\n\r\n // That's horizontal done, check if we still intersects? If not then we can return now\r\n if (ox !== 0 && !TileIntersectsBody(tileWorldRect, body))\r\n {\r\n return true;\r\n }\r\n }\r\n\r\n if (faceVertical)\r\n {\r\n oy = TileCheckY(body, tile, tileTop, tileBottom, tileBias, isLayer);\r\n }\r\n }\r\n else\r\n {\r\n if (faceVertical)\r\n {\r\n oy = TileCheckY(body, tile, tileTop, tileBottom, tileBias, isLayer);\r\n\r\n // That's vertical done, check if we still intersects? If not then we can return now\r\n if (oy !== 0 && !TileIntersectsBody(tileWorldRect, body))\r\n {\r\n return true;\r\n }\r\n }\r\n\r\n if (faceHorizontal)\r\n {\r\n ox = TileCheckX(body, tile, tileLeft, tileRight, tileBias, isLayer);\r\n }\r\n }\r\n\r\n return (ox !== 0 || oy !== 0);\r\n};\r\n\r\nmodule.exports = SeparateTile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/tilemap/SeparateTile.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/tilemap/TileCheckX.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/tilemap/TileCheckX.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ProcessTileSeparationX = __webpack_require__(/*! ./ProcessTileSeparationX */ \"./node_modules/phaser/src/physics/arcade/tilemap/ProcessTileSeparationX.js\");\r\n\r\n/**\r\n * Check the body against the given tile on the X axis.\r\n * Used internally by the SeparateTile function.\r\n *\r\n * @function Phaser.Physics.Arcade.Tilemap.TileCheckX\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate.\r\n * @param {Phaser.Tilemaps.Tile} tile - The tile to check.\r\n * @param {number} tileLeft - The left position of the tile within the tile world.\r\n * @param {number} tileRight - The right position of the tile within the tile world.\r\n * @param {number} tileBias - The tile bias value. Populated by the `World.TILE_BIAS` constant.\r\n * @param {boolean} isLayer - Is this check coming from a TilemapLayer or an array of tiles?\r\n *\r\n * @return {number} The amount of separation that occurred.\r\n */\r\nvar TileCheckX = function (body, tile, tileLeft, tileRight, tileBias, isLayer)\r\n{\r\n var ox = 0;\r\n\r\n var faceLeft = tile.faceLeft;\r\n var faceRight = tile.faceRight;\r\n var collideLeft = tile.collideLeft;\r\n var collideRight = tile.collideRight;\r\n\r\n if (!isLayer)\r\n {\r\n faceLeft = true;\r\n faceRight = true;\r\n collideLeft = true;\r\n collideRight = true;\r\n }\r\n\r\n if (body.deltaX() < 0 && collideRight && body.checkCollision.left)\r\n {\r\n // Body is moving LEFT\r\n if (faceRight && body.x < tileRight)\r\n {\r\n ox = body.x - tileRight;\r\n\r\n if (ox < -tileBias)\r\n {\r\n ox = 0;\r\n }\r\n }\r\n }\r\n else if (body.deltaX() > 0 && collideLeft && body.checkCollision.right)\r\n {\r\n // Body is moving RIGHT\r\n if (faceLeft && body.right > tileLeft)\r\n {\r\n ox = body.right - tileLeft;\r\n\r\n if (ox > tileBias)\r\n {\r\n ox = 0;\r\n }\r\n }\r\n }\r\n\r\n if (ox !== 0)\r\n {\r\n if (body.customSeparateX)\r\n {\r\n body.overlapX = ox;\r\n }\r\n else\r\n {\r\n ProcessTileSeparationX(body, ox);\r\n }\r\n }\r\n\r\n return ox;\r\n};\r\n\r\nmodule.exports = TileCheckX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/tilemap/TileCheckX.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/tilemap/TileCheckY.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/tilemap/TileCheckY.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ProcessTileSeparationY = __webpack_require__(/*! ./ProcessTileSeparationY */ \"./node_modules/phaser/src/physics/arcade/tilemap/ProcessTileSeparationY.js\");\r\n\r\n/**\r\n * Check the body against the given tile on the Y axis.\r\n * Used internally by the SeparateTile function.\r\n *\r\n * @function Phaser.Physics.Arcade.Tilemap.TileCheckY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate.\r\n * @param {Phaser.Tilemaps.Tile} tile - The tile to check.\r\n * @param {number} tileTop - The top position of the tile within the tile world.\r\n * @param {number} tileBottom - The bottom position of the tile within the tile world.\r\n * @param {number} tileBias - The tile bias value. Populated by the `World.TILE_BIAS` constant.\r\n * @param {boolean} isLayer - Is this check coming from a TilemapLayer or an array of tiles?\r\n *\r\n * @return {number} The amount of separation that occurred.\r\n */\r\nvar TileCheckY = function (body, tile, tileTop, tileBottom, tileBias, isLayer)\r\n{\r\n var oy = 0;\r\n\r\n var faceTop = tile.faceTop;\r\n var faceBottom = tile.faceBottom;\r\n var collideUp = tile.collideUp;\r\n var collideDown = tile.collideDown;\r\n\r\n if (!isLayer)\r\n {\r\n faceTop = true;\r\n faceBottom = true;\r\n collideUp = true;\r\n collideDown = true;\r\n }\r\n\r\n if (body.deltaY() < 0 && collideDown && body.checkCollision.up)\r\n {\r\n // Body is moving UP\r\n if (faceBottom && body.y < tileBottom)\r\n {\r\n oy = body.y - tileBottom;\r\n\r\n if (oy < -tileBias)\r\n {\r\n oy = 0;\r\n }\r\n }\r\n }\r\n else if (body.deltaY() > 0 && collideUp && body.checkCollision.down)\r\n {\r\n // Body is moving DOWN\r\n if (faceTop && body.bottom > tileTop)\r\n {\r\n oy = body.bottom - tileTop;\r\n\r\n if (oy > tileBias)\r\n {\r\n oy = 0;\r\n }\r\n }\r\n }\r\n\r\n if (oy !== 0)\r\n {\r\n if (body.customSeparateY)\r\n {\r\n body.overlapY = oy;\r\n }\r\n else\r\n {\r\n ProcessTileSeparationY(body, oy);\r\n }\r\n }\r\n\r\n return oy;\r\n};\r\n\r\nmodule.exports = TileCheckY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/tilemap/TileCheckY.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/arcade/tilemap/TileIntersectsBody.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/physics/arcade/tilemap/TileIntersectsBody.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks for intersection between the given tile rectangle-like object and an Arcade Physics body.\r\n *\r\n * @function Phaser.Physics.Arcade.Tilemap.TileIntersectsBody\r\n * @since 3.0.0\r\n *\r\n * @param {{ left: number, right: number, top: number, bottom: number }} tileWorldRect - A rectangle object that defines the tile placement in the world.\r\n * @param {Phaser.Physics.Arcade.Body} body - The body to check for intersection against.\r\n *\r\n * @return {boolean} Returns `true` of the tile intersects with the body, otherwise `false`.\r\n */\r\nvar TileIntersectsBody = function (tileWorldRect, body)\r\n{\r\n // Currently, all bodies are treated as rectangles when colliding with a Tile.\r\n\r\n return !(\r\n body.right <= tileWorldRect.left ||\r\n body.bottom <= tileWorldRect.top ||\r\n body.position.x >= tileWorldRect.right ||\r\n body.position.y >= tileWorldRect.bottom\r\n );\r\n};\r\n\r\nmodule.exports = TileIntersectsBody;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/arcade/tilemap/TileIntersectsBody.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/Body.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/Body.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar COLLIDES = __webpack_require__(/*! ./COLLIDES */ \"./node_modules/phaser/src/physics/impact/COLLIDES.js\");\r\nvar GetVelocity = __webpack_require__(/*! ./GetVelocity */ \"./node_modules/phaser/src/physics/impact/GetVelocity.js\");\r\nvar TYPE = __webpack_require__(/*! ./TYPE */ \"./node_modules/phaser/src/physics/impact/TYPE.js\");\r\nvar UpdateMotion = __webpack_require__(/*! ./UpdateMotion */ \"./node_modules/phaser/src/physics/impact/UpdateMotion.js\");\r\n\r\n/**\r\n * @callback Phaser.Types.Physics.Impact.BodyUpdateCallback\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body} body - [description]\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * An Impact.js compatible physics body.\r\n * This re-creates the properties you'd get on an Entity and the math needed to update them.\r\n *\r\n * @class Body\r\n * @memberof Phaser.Physics.Impact\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.World} world - [description]\r\n * @param {number} x - [description]\r\n * @param {number} y - [description]\r\n * @param {number} [sx=16] - [description]\r\n * @param {number} [sy=16] - [description]\r\n */\r\nvar Body = new Class({\r\n\r\n initialize:\r\n\r\n function Body (world, x, y, sx, sy)\r\n {\r\n if (sx === undefined) { sx = 16; }\r\n if (sy === undefined) { sy = sx; }\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#world\r\n * @type {Phaser.Physics.Impact.World}\r\n * @since 3.0.0\r\n */\r\n this.world = world;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#gameObject\r\n * @type {Phaser.GameObjects.GameObject}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.gameObject = null;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#enabled\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.enabled = true;\r\n\r\n /**\r\n * The ImpactBody, ImpactSprite or ImpactImage object that owns this Body, if any.\r\n *\r\n * @name Phaser.Physics.Impact.Body#parent\r\n * @type {?(Phaser.Physics.Impact.ImpactBody|Phaser.Physics.Impact.ImpactImage|Phaser.Physics.Impact.ImpactSprite)}\r\n * @since 3.0.0\r\n */\r\n this.parent;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#id\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.id = world.getNextID();\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#name\r\n * @type {string}\r\n * @default ''\r\n * @since 3.0.0\r\n */\r\n this.name = '';\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#size\r\n * @type {Phaser.Types.Math.Vector2Like}\r\n * @since 3.0.0\r\n */\r\n this.size = { x: sx, y: sy };\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#offset\r\n * @type {Phaser.Types.Math.Vector2Like}\r\n * @since 3.0.0\r\n */\r\n this.offset = { x: 0, y: 0 };\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#pos\r\n * @type {Phaser.Types.Math.Vector2Like}\r\n * @since 3.0.0\r\n */\r\n this.pos = { x: x, y: y };\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#last\r\n * @type {Phaser.Types.Math.Vector2Like}\r\n * @since 3.0.0\r\n */\r\n this.last = { x: x, y: y };\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#vel\r\n * @type {Phaser.Types.Math.Vector2Like}\r\n * @since 3.0.0\r\n */\r\n this.vel = { x: 0, y: 0 };\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#accel\r\n * @type {Phaser.Types.Math.Vector2Like}\r\n * @since 3.0.0\r\n */\r\n this.accel = { x: 0, y: 0 };\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#friction\r\n * @type {Phaser.Types.Math.Vector2Like}\r\n * @since 3.0.0\r\n */\r\n this.friction = { x: 0, y: 0 };\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#maxVel\r\n * @type {Phaser.Types.Math.Vector2Like}\r\n * @since 3.0.0\r\n */\r\n this.maxVel = { x: world.defaults.maxVelocityX, y: world.defaults.maxVelocityY };\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#standing\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.standing = false;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#gravityFactor\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.gravityFactor = world.defaults.gravityFactor;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#bounciness\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.bounciness = world.defaults.bounciness;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#minBounceVelocity\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.minBounceVelocity = world.defaults.minBounceVelocity;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#accelGround\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.accelGround = 0;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#accelAir\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.accelAir = 0;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#jumpSpeed\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.jumpSpeed = 0;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#type\r\n * @type {Phaser.Physics.Impact.TYPE}\r\n * @since 3.0.0\r\n */\r\n this.type = TYPE.NONE;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#checkAgainst\r\n * @type {Phaser.Physics.Impact.TYPE}\r\n * @since 3.0.0\r\n */\r\n this.checkAgainst = TYPE.NONE;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#collides\r\n * @type {Phaser.Physics.Impact.COLLIDES}\r\n * @since 3.0.0\r\n */\r\n this.collides = COLLIDES.NEVER;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#debugShowBody\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.debugShowBody = world.defaults.debugShowBody;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#debugShowVelocity\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.debugShowVelocity = world.defaults.debugShowVelocity;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#debugBodyColor\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.debugBodyColor = world.defaults.bodyDebugColor;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Body#updateCallback\r\n * @type {?Phaser.Types.Physics.Impact.BodyUpdateCallback}\r\n * @since 3.0.0\r\n */\r\n this.updateCallback;\r\n\r\n /**\r\n * min 44 deg, max 136 deg\r\n *\r\n * @name Phaser.Physics.Impact.Body#slopeStanding\r\n * @type {{ min: number, max: number }}\r\n * @since 3.0.0\r\n */\r\n this.slopeStanding = { min: 0.767944870877505, max: 2.3736477827122884 };\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Body#reset\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - [description]\r\n * @param {number} y - [description]\r\n */\r\n reset: function (x, y)\r\n {\r\n this.pos = { x: x, y: y };\r\n this.last = { x: x, y: y };\r\n this.vel = { x: 0, y: 0 };\r\n this.accel = { x: 0, y: 0 };\r\n this.friction = { x: 0, y: 0 };\r\n this.maxVel = { x: 100, y: 100 };\r\n\r\n this.standing = false;\r\n\r\n this.gravityFactor = 1;\r\n this.bounciness = 0;\r\n this.minBounceVelocity = 40;\r\n\r\n this.accelGround = 0;\r\n this.accelAir = 0;\r\n this.jumpSpeed = 0;\r\n\r\n this.type = TYPE.NONE;\r\n this.checkAgainst = TYPE.NONE;\r\n this.collides = COLLIDES.NEVER;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Body#update\r\n * @since 3.0.0\r\n *\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\n update: function (delta)\r\n {\r\n var pos = this.pos;\r\n\r\n this.last.x = pos.x;\r\n this.last.y = pos.y;\r\n\r\n this.vel.y += this.world.gravity * delta * this.gravityFactor;\r\n\r\n this.vel.x = GetVelocity(delta, this.vel.x, this.accel.x, this.friction.x, this.maxVel.x);\r\n this.vel.y = GetVelocity(delta, this.vel.y, this.accel.y, this.friction.y, this.maxVel.y);\r\n\r\n var mx = this.vel.x * delta;\r\n var my = this.vel.y * delta;\r\n\r\n var res = this.world.collisionMap.trace(pos.x, pos.y, mx, my, this.size.x, this.size.y);\r\n\r\n if (this.handleMovementTrace(res))\r\n {\r\n UpdateMotion(this, res);\r\n }\r\n\r\n var go = this.gameObject;\r\n\r\n if (go)\r\n {\r\n go.x = (pos.x - this.offset.x) + go.displayOriginX * go.scaleX;\r\n go.y = (pos.y - this.offset.y) + go.displayOriginY * go.scaleY;\r\n }\r\n\r\n if (this.updateCallback)\r\n {\r\n this.updateCallback(this);\r\n }\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Body#drawDebug\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Graphics} graphic - [description]\r\n */\r\n drawDebug: function (graphic)\r\n {\r\n var pos = this.pos;\r\n\r\n if (this.debugShowBody)\r\n {\r\n graphic.lineStyle(1, this.debugBodyColor, 1);\r\n graphic.strokeRect(pos.x, pos.y, this.size.x, this.size.y);\r\n }\r\n\r\n if (this.debugShowVelocity)\r\n {\r\n var x = pos.x + this.size.x / 2;\r\n var y = pos.y + this.size.y / 2;\r\n\r\n graphic.lineStyle(1, this.world.defaults.velocityDebugColor, 1);\r\n graphic.lineBetween(x, y, x + this.vel.x, y + this.vel.y);\r\n }\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Body#willDrawDebug\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} [description]\r\n */\r\n willDrawDebug: function ()\r\n {\r\n return (this.debugShowBody || this.debugShowVelocity);\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Body#skipHash\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} [description]\r\n */\r\n skipHash: function ()\r\n {\r\n return (!this.enabled || (this.type === 0 && this.checkAgainst === 0 && this.collides === 0));\r\n },\r\n\r\n /**\r\n * Determines whether the body collides with the `other` one or not.\r\n *\r\n * @method Phaser.Physics.Impact.Body#touches\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body} other - [description]\r\n *\r\n * @return {boolean} [description]\r\n */\r\n touches: function (other)\r\n {\r\n return !(\r\n this.pos.x >= other.pos.x + other.size.x ||\r\n this.pos.x + this.size.x <= other.pos.x ||\r\n this.pos.y >= other.pos.y + other.size.y ||\r\n this.pos.y + this.size.y <= other.pos.y\r\n );\r\n },\r\n\r\n /**\r\n * Reset the size and position of the physics body.\r\n *\r\n * @method Phaser.Physics.Impact.Body#resetSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate to position the body.\r\n * @param {number} y - The y coordinate to position the body.\r\n * @param {number} width - The width of the body.\r\n * @param {number} height - The height of the body.\r\n *\r\n * @return {Phaser.Physics.Impact.Body} This Body object.\r\n */\r\n resetSize: function (x, y, width, height)\r\n {\r\n this.pos.x = x;\r\n this.pos.y = y;\r\n this.size.x = width;\r\n this.size.y = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Export this body object to JSON.\r\n *\r\n * @method Phaser.Physics.Impact.Body#toJSON\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.Physics.Impact.JSONImpactBody} JSON representation of this body object.\r\n */\r\n toJSON: function ()\r\n {\r\n var output = {\r\n name: this.name,\r\n size: { x: this.size.x, y: this.size.y },\r\n pos: { x: this.pos.x, y: this.pos.y },\r\n vel: { x: this.vel.x, y: this.vel.y },\r\n accel: { x: this.accel.x, y: this.accel.y },\r\n friction: { x: this.friction.x, y: this.friction.y },\r\n maxVel: { x: this.maxVel.x, y: this.maxVel.y },\r\n gravityFactor: this.gravityFactor,\r\n bounciness: this.bounciness,\r\n minBounceVelocity: this.minBounceVelocity,\r\n type: this.type,\r\n checkAgainst: this.checkAgainst,\r\n collides: this.collides\r\n };\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Body#fromJSON\r\n * @todo Code it!\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - [description]\r\n */\r\n fromJSON: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Can be overridden by user code\r\n *\r\n * @method Phaser.Physics.Impact.Body#check\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body} other - [description]\r\n */\r\n check: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Can be overridden by user code\r\n *\r\n * @method Phaser.Physics.Impact.Body#collideWith\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body} other - [description]\r\n * @param {string} axis - [description]\r\n */\r\n collideWith: function (other, axis)\r\n {\r\n if (this.parent && this.parent._collideCallback)\r\n {\r\n this.parent._collideCallback.call(this.parent._callbackScope, this, other, axis);\r\n }\r\n },\r\n\r\n /**\r\n * Can be overridden by user code but must return a boolean.\r\n *\r\n * @method Phaser.Physics.Impact.Body#handleMovementTrace\r\n * @since 3.0.0\r\n *\r\n * @param {number} res - [description]\r\n *\r\n * @return {boolean} [description]\r\n */\r\n handleMovementTrace: function ()\r\n {\r\n return true;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Body#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.world.remove(this);\r\n\r\n this.enabled = false;\r\n\r\n this.world = null;\r\n\r\n this.gameObject = null;\r\n\r\n this.parent = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Body;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/Body.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/COLLIDES.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/COLLIDES.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Collision Types - Determine if and how entities collide with each other.\r\n *\r\n * In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the \"weak\" entity moves,\r\n * while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE\r\n * collisions, both entities are moved. LITE or PASSIVE entities don't collide\r\n * with other LITE or PASSIVE entities at all. The behavior for FIXED vs.\r\n * FIXED collisions is undefined.\r\n *\r\n * @namespace Phaser.Physics.Impact.COLLIDES\r\n * @memberof Phaser.Physics.Impact\r\n * @since 3.0.0\r\n */\r\n\r\nmodule.exports = {\r\n\r\n /**\r\n * Never collides.\r\n *\r\n * @name Phaser.Physics.Impact.COLLIDES.NEVER\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n NEVER: 0,\r\n\r\n /**\r\n * Lite collision.\r\n *\r\n * @name Phaser.Physics.Impact.COLLIDES.LITE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LITE: 1,\r\n\r\n /**\r\n * Passive collision.\r\n *\r\n * @name Phaser.Physics.Impact.COLLIDES.PASSIVE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n PASSIVE: 2,\r\n\r\n /**\r\n * Active collision.\r\n *\r\n * @name Phaser.Physics.Impact.COLLIDES.ACTIVE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n ACTIVE: 4,\r\n\r\n /**\r\n * Fixed collision.\r\n *\r\n * @name Phaser.Physics.Impact.COLLIDES.FIXED\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n FIXED: 8\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/COLLIDES.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/CollisionMap.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/CollisionMap.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar DefaultDefs = __webpack_require__(/*! ./DefaultDefs */ \"./node_modules/phaser/src/physics/impact/DefaultDefs.js\");\r\n\r\n/**\r\n * @classdesc\r\n * [description]\r\n *\r\n * @class CollisionMap\r\n * @memberof Phaser.Physics.Impact\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tilesize=32] - [description]\r\n * @param {array} [data] - [description]\r\n */\r\nvar CollisionMap = new Class({\r\n\r\n initialize:\r\n\r\n function CollisionMap (tilesize, data)\r\n {\r\n if (tilesize === undefined) { tilesize = 32; }\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.CollisionMap#tilesize\r\n * @type {integer}\r\n * @default 32\r\n * @since 3.0.0\r\n */\r\n this.tilesize = tilesize;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.CollisionMap#data\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.data = (Array.isArray(data)) ? data : [];\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.CollisionMap#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.width = (Array.isArray(data)) ? data[0].length : 0;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.CollisionMap#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.height = (Array.isArray(data)) ? data.length : 0;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.CollisionMap#lastSlope\r\n * @type {integer}\r\n * @default 55\r\n * @since 3.0.0\r\n */\r\n this.lastSlope = 55;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.CollisionMap#tiledef\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.tiledef = DefaultDefs;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.CollisionMap#trace\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - [description]\r\n * @param {number} y - [description]\r\n * @param {number} vx - [description]\r\n * @param {number} vy - [description]\r\n * @param {number} objectWidth - [description]\r\n * @param {number} objectHeight - [description]\r\n *\r\n * @return {boolean} [description]\r\n */\r\n trace: function (x, y, vx, vy, objectWidth, objectHeight)\r\n {\r\n // Set up the trace-result\r\n var res = {\r\n collision: { x: false, y: false, slope: false },\r\n pos: { x: x + vx, y: y + vy },\r\n tile: { x: 0, y: 0 }\r\n };\r\n\r\n if (!this.data)\r\n {\r\n return res;\r\n }\r\n \r\n var steps = Math.ceil(Math.max(Math.abs(vx), Math.abs(vy)) / this.tilesize);\r\n\r\n if (steps > 1)\r\n {\r\n var sx = vx / steps;\r\n var sy = vy / steps;\r\n \r\n for (var i = 0; i < steps && (sx || sy); i++)\r\n {\r\n this.step(res, x, y, sx, sy, objectWidth, objectHeight, vx, vy, i);\r\n \r\n x = res.pos.x;\r\n y = res.pos.y;\r\n\r\n if (res.collision.x)\r\n {\r\n sx = 0;\r\n vx = 0;\r\n }\r\n\r\n if (res.collision.y)\r\n {\r\n sy = 0;\r\n vy = 0;\r\n }\r\n\r\n if (res.collision.slope)\r\n {\r\n break;\r\n }\r\n }\r\n }\r\n else\r\n {\r\n this.step(res, x, y, vx, vy, objectWidth, objectHeight, vx, vy, 0);\r\n }\r\n \r\n return res;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.CollisionMap#step\r\n * @since 3.0.0\r\n *\r\n * @param {object} res - [description]\r\n * @param {number} x - [description]\r\n * @param {number} y - [description]\r\n * @param {number} vx - [description]\r\n * @param {number} vy - [description]\r\n * @param {number} width - [description]\r\n * @param {number} height - [description]\r\n * @param {number} rvx - [description]\r\n * @param {number} rvy - [description]\r\n * @param {number} step - [description]\r\n */\r\n step: function (res, x, y, vx, vy, width, height, rvx, rvy, step)\r\n {\r\n var t = 0;\r\n var tileX;\r\n var tileY;\r\n var tilesize = this.tilesize;\r\n var mapWidth = this.width;\r\n var mapHeight = this.height;\r\n \r\n // Horizontal\r\n if (vx)\r\n {\r\n var pxOffsetX = (vx > 0 ? width : 0);\r\n var tileOffsetX = (vx < 0 ? tilesize : 0);\r\n \r\n var firstTileY = Math.max(Math.floor(y / tilesize), 0);\r\n var lastTileY = Math.min(Math.ceil((y + height) / tilesize), mapHeight);\r\n \r\n tileX = Math.floor((res.pos.x + pxOffsetX) / tilesize);\r\n\r\n var prevTileX = Math.floor((x + pxOffsetX) / tilesize);\r\n\r\n if (step > 0 || tileX === prevTileX || prevTileX < 0 || prevTileX >= mapWidth)\r\n {\r\n prevTileX = -1;\r\n }\r\n \r\n if (tileX >= 0 && tileX < mapWidth)\r\n {\r\n for (tileY = firstTileY; tileY < lastTileY; tileY++)\r\n {\r\n if (prevTileX !== -1)\r\n {\r\n t = this.data[tileY][prevTileX];\r\n\r\n if (t > 1 && t <= this.lastSlope && this.checkDef(res, t, x, y, rvx, rvy, width, height, prevTileX, tileY))\r\n {\r\n break;\r\n }\r\n }\r\n \r\n t = this.data[tileY][tileX];\r\n\r\n if (t === 1 || t > this.lastSlope || (t > 1 && this.checkDef(res, t, x, y, rvx, rvy, width, height, tileX, tileY)))\r\n {\r\n if (t > 1 && t <= this.lastSlope && res.collision.slope)\r\n {\r\n break;\r\n }\r\n \r\n res.collision.x = true;\r\n res.tile.x = t;\r\n res.pos.x = (tileX * tilesize) - pxOffsetX + tileOffsetX;\r\n x = res.pos.x;\r\n rvx = 0;\r\n\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n \r\n // Vertical\r\n if (vy)\r\n {\r\n var pxOffsetY = (vy > 0 ? height : 0);\r\n var tileOffsetY = (vy < 0 ? tilesize : 0);\r\n \r\n var firstTileX = Math.max(Math.floor(res.pos.x / tilesize), 0);\r\n var lastTileX = Math.min(Math.ceil((res.pos.x + width) / tilesize), mapWidth);\r\n \r\n tileY = Math.floor((res.pos.y + pxOffsetY) / tilesize);\r\n \r\n var prevTileY = Math.floor((y + pxOffsetY) / tilesize);\r\n\r\n if (step > 0 || tileY === prevTileY || prevTileY < 0 || prevTileY >= mapHeight)\r\n {\r\n prevTileY = -1;\r\n }\r\n \r\n if (tileY >= 0 && tileY < mapHeight)\r\n {\r\n for (tileX = firstTileX; tileX < lastTileX; tileX++)\r\n {\r\n if (prevTileY !== -1)\r\n {\r\n t = this.data[prevTileY][tileX];\r\n\r\n if (t > 1 && t <= this.lastSlope && this.checkDef(res, t, x, y, rvx, rvy, width, height, tileX, prevTileY))\r\n {\r\n break;\r\n }\r\n }\r\n \r\n t = this.data[tileY][tileX];\r\n\r\n if (t === 1 || t > this.lastSlope || (t > 1 && this.checkDef(res, t, x, y, rvx, rvy, width, height, tileX, tileY)))\r\n {\r\n if (t > 1 && t <= this.lastSlope && res.collision.slope)\r\n {\r\n break;\r\n }\r\n \r\n res.collision.y = true;\r\n res.tile.y = t;\r\n res.pos.y = tileY * tilesize - pxOffsetY + tileOffsetY;\r\n\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.CollisionMap#checkDef\r\n * @since 3.0.0\r\n *\r\n * @param {object} res - [description]\r\n * @param {number} t - [description]\r\n * @param {number} x - [description]\r\n * @param {number} y - [description]\r\n * @param {number} vx - [description]\r\n * @param {number} vy - [description]\r\n * @param {number} width - [description]\r\n * @param {number} height - [description]\r\n * @param {number} tileX - [description]\r\n * @param {number} tileY - [description]\r\n *\r\n * @return {boolean} [description]\r\n */\r\n checkDef: function (res, t, x, y, vx, vy, width, height, tileX, tileY)\r\n {\r\n var def = this.tiledef[t];\r\n\r\n if (!def)\r\n {\r\n return false;\r\n }\r\n\r\n var tilesize = this.tilesize;\r\n \r\n var lx = (tileX + def[0]) * tilesize;\r\n var ly = (tileY + def[1]) * tilesize;\r\n var lvx = (def[2] - def[0]) * tilesize;\r\n var lvy = (def[3] - def[1]) * tilesize;\r\n var solid = def[4];\r\n \r\n var tx = x + vx + (lvy < 0 ? width : 0) - lx;\r\n var ty = y + vy + (lvx > 0 ? height : 0) - ly;\r\n \r\n if (lvx * ty - lvy * tx > 0)\r\n {\r\n if (vx * -lvy + vy * lvx < 0)\r\n {\r\n return solid;\r\n }\r\n \r\n var length = Math.sqrt(lvx * lvx + lvy * lvy);\r\n var nx = lvy / length;\r\n var ny = -lvx / length;\r\n \r\n var proj = tx * nx + ty * ny;\r\n var px = nx * proj;\r\n var py = ny * proj;\r\n \r\n if (px * px + py * py >= vx * vx + vy * vy)\r\n {\r\n return solid || (lvx * (ty - vy) - lvy * (tx - vx) < 0.5);\r\n }\r\n \r\n res.pos.x = x + vx - px;\r\n res.pos.y = y + vy - py;\r\n res.collision.slope = { x: lvx, y: lvy, nx: nx, ny: ny };\r\n\r\n return true;\r\n }\r\n \r\n return false;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = CollisionMap;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/CollisionMap.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/DefaultDefs.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/DefaultDefs.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar H = 0.5;\r\nvar N = 1 / 3;\r\nvar M = 2 / 3;\r\n\r\n// Tile ID to Slope defs.\r\n// First 4 elements = line data, final = solid or non-solid behind the line\r\n \r\nmodule.exports = {\r\n\r\n 2: [ 0, 1, 1, 0, true ],\r\n 3: [ 0, 1, 1, H, true ],\r\n 4: [ 0, H, 1, 0, true ],\r\n 5: [ 0, 1, 1, M, true ],\r\n 6: [ 0, M, 1, N, true ],\r\n 7: [ 0, N, 1, 0, true ],\r\n 8: [ H, 1, 0, 0, true ],\r\n 9: [ 1, 0, H, 1, true ],\r\n 10: [ H, 1, 1, 0, true ],\r\n 11: [ 0, 0, H, 1, true ],\r\n 12: [ 0, 0, 1, 0, false ],\r\n 13: [ 1, 1, 0, 0, true ],\r\n 14: [ 1, H, 0, 0, true ],\r\n 15: [ 1, 1, 0, H, true ],\r\n 16: [ 1, N, 0, 0, true ],\r\n 17: [ 1, M, 0, N, true ],\r\n 18: [ 1, 1, 0, M, true ],\r\n 19: [ 1, 1, H, 0, true ],\r\n 20: [ H, 0, 0, 1, true ],\r\n 21: [ 0, 1, H, 0, true ],\r\n 22: [ H, 0, 1, 1, true ],\r\n 23: [ 1, 1, 0, 1, false ],\r\n 24: [ 0, 0, 1, 1, true ],\r\n 25: [ 0, 0, 1, H, true ],\r\n 26: [ 0, H, 1, 1, true ],\r\n 27: [ 0, 0, 1, N, true ],\r\n 28: [ 0, N, 1, M, true ],\r\n 29: [ 0, M, 1, 1, true ],\r\n 30: [ N, 1, 0, 0, true ],\r\n 31: [ 1, 0, M, 1, true ],\r\n 32: [ M, 1, 1, 0, true ],\r\n 33: [ 0, 0, N, 1, true ],\r\n 34: [ 1, 0, 1, 1, false ],\r\n 35: [ 1, 0, 0, 1, true ],\r\n 36: [ 1, H, 0, 1, true ],\r\n 37: [ 1, 0, 0, H, true ],\r\n 38: [ 1, M, 0, 1, true ],\r\n 39: [ 1, N, 0, M, true ],\r\n 40: [ 1, 0, 0, N, true ],\r\n 41: [ M, 1, N, 0, true ],\r\n 42: [ M, 0, N, 1, true ],\r\n 43: [ N, 1, M, 0, true ],\r\n 44: [ N, 0, M, 1, true ],\r\n 45: [ 0, 1, 0, 0, false ],\r\n 52: [ 1, 1, M, 0, true ],\r\n 53: [ N, 0, 0, 1, true ],\r\n 54: [ 0, 1, N, 0, true ],\r\n 55: [ M, 0, 1, 1, true ]\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/DefaultDefs.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/Factory.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/Factory.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar ImpactBody = __webpack_require__(/*! ./ImpactBody */ \"./node_modules/phaser/src/physics/impact/ImpactBody.js\");\r\nvar ImpactImage = __webpack_require__(/*! ./ImpactImage */ \"./node_modules/phaser/src/physics/impact/ImpactImage.js\");\r\nvar ImpactSprite = __webpack_require__(/*! ./ImpactSprite */ \"./node_modules/phaser/src/physics/impact/ImpactSprite.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Impact Physics Factory allows you to easily create Impact Physics enabled Game Objects.\r\n * Objects that are created by this Factory are automatically added to the physics world.\r\n *\r\n * @class Factory\r\n * @memberof Phaser.Physics.Impact\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.World} world - A reference to the Impact Physics world.\r\n */\r\nvar Factory = new Class({\r\n\r\n initialize:\r\n\r\n function Factory (world)\r\n {\r\n /**\r\n * A reference to the Impact Physics world.\r\n *\r\n * @name Phaser.Physics.Impact.Factory#world\r\n * @type {Phaser.Physics.Impact.World}\r\n * @since 3.0.0\r\n */\r\n this.world = world;\r\n\r\n /**\r\n * A reference to the Scene.Systems this Impact Physics instance belongs to.\r\n *\r\n * @name Phaser.Physics.Impact.Factory#sys\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.sys = world.scene.sys;\r\n },\r\n\r\n /**\r\n * Creates a new ImpactBody object and adds it to the physics simulation.\r\n *\r\n * @method Phaser.Physics.Impact.Factory#body\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of the body in the physics world.\r\n * @param {number} y - The vertical position of the body in the physics world.\r\n * @param {number} width - The width of the body.\r\n * @param {number} height - The height of the body.\r\n *\r\n * @return {Phaser.Physics.Impact.ImpactBody} The ImpactBody object that was created.\r\n */\r\n body: function (x, y, width, height)\r\n {\r\n return new ImpactBody(this.world, x, y, width, height);\r\n },\r\n\r\n /**\r\n * Adds an Impact Physics Body to the given Game Object.\r\n *\r\n * @method Phaser.Physics.Impact.Factory#existing\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to receive the physics body.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object.\r\n */\r\n existing: function (gameObject)\r\n {\r\n var x = gameObject.x - gameObject.frame.centerX;\r\n var y = gameObject.y - gameObject.frame.centerY;\r\n var w = gameObject.width;\r\n var h = gameObject.height;\r\n\r\n gameObject.body = this.world.create(x, y, w, h);\r\n\r\n gameObject.body.parent = gameObject;\r\n gameObject.body.gameObject = gameObject;\r\n\r\n return gameObject;\r\n },\r\n\r\n /**\r\n * Creates a new ImpactImage object and adds it to the physics world.\r\n *\r\n * @method Phaser.Physics.Impact.Factory#image\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n *\r\n * @return {Phaser.Physics.Impact.ImpactImage} The ImpactImage object that was created.\r\n */\r\n image: function (x, y, key, frame)\r\n {\r\n var image = new ImpactImage(this.world, x, y, key, frame);\r\n\r\n this.sys.displayList.add(image);\r\n\r\n return image;\r\n },\r\n\r\n /**\r\n * Creates a new ImpactSprite object and adds it to the physics world.\r\n *\r\n * @method Phaser.Physics.Impact.Factory#sprite\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n *\r\n * @return {Phaser.Physics.Impact.ImpactSprite} The ImpactSprite object that was created.\r\n */\r\n sprite: function (x, y, key, frame)\r\n {\r\n var sprite = new ImpactSprite(this.world, x, y, key, frame);\r\n\r\n this.sys.displayList.add(sprite);\r\n this.sys.updateList.add(sprite);\r\n\r\n return sprite;\r\n },\r\n\r\n /**\r\n * Destroys this Factory.\r\n *\r\n * @method Phaser.Physics.Impact.Factory#destroy\r\n * @since 3.5.0\r\n */\r\n destroy: function ()\r\n {\r\n this.world = null;\r\n this.sys = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Factory;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/Factory.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/GetVelocity.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/GetVelocity.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = __webpack_require__(/*! ../../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Physics.Impact.GetVelocity\r\n * @since 3.0.0\r\n *\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n * @param {number} vel - [description]\r\n * @param {number} accel - [description]\r\n * @param {number} friction - [description]\r\n * @param {number} max - [description]\r\n *\r\n * @return {number} [description]\r\n */\r\nvar GetVelocity = function (delta, vel, accel, friction, max)\r\n{\r\n if (accel)\r\n {\r\n return Clamp(vel + accel * delta, -max, max);\r\n }\r\n else if (friction)\r\n {\r\n var frictionDelta = friction * delta;\r\n \r\n if (vel - frictionDelta > 0)\r\n {\r\n return vel - frictionDelta;\r\n }\r\n else if (vel + frictionDelta < 0)\r\n {\r\n return vel + frictionDelta;\r\n }\r\n else\r\n {\r\n return 0;\r\n }\r\n }\r\n\r\n return Clamp(vel, -max, max);\r\n};\r\n\r\nmodule.exports = GetVelocity;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/GetVelocity.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/ImpactBody.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/ImpactBody.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ./components */ \"./node_modules/phaser/src/physics/impact/components/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * [description]\r\n *\r\n * @class ImpactBody\r\n * @memberof Phaser.Physics.Impact\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.Physics.Impact.Components.Acceleration\r\n * @extends Phaser.Physics.Impact.Components.BodyScale\r\n * @extends Phaser.Physics.Impact.Components.BodyType\r\n * @extends Phaser.Physics.Impact.Components.Bounce\r\n * @extends Phaser.Physics.Impact.Components.CheckAgainst\r\n * @extends Phaser.Physics.Impact.Components.Collides\r\n * @extends Phaser.Physics.Impact.Components.Debug\r\n * @extends Phaser.Physics.Impact.Components.Friction\r\n * @extends Phaser.Physics.Impact.Components.Gravity\r\n * @extends Phaser.Physics.Impact.Components.Offset\r\n * @extends Phaser.Physics.Impact.Components.SetGameObject\r\n * @extends Phaser.Physics.Impact.Components.Velocity\r\n *\r\n * @param {Phaser.Physics.Impact.World} world - [description]\r\n * @param {number} x - x - The horizontal position of this physics body in the world.\r\n * @param {number} y - y - The vertical position of this physics body in the world.\r\n * @param {number} width - The width of the physics body in the world.\r\n * @param {number} height - [description]\r\n */\r\nvar ImpactBody = new Class({\r\n\r\n Mixins: [\r\n Components.Acceleration,\r\n Components.BodyScale,\r\n Components.BodyType,\r\n Components.Bounce,\r\n Components.CheckAgainst,\r\n Components.Collides,\r\n Components.Debug,\r\n Components.Friction,\r\n Components.Gravity,\r\n Components.Offset,\r\n Components.SetGameObject,\r\n Components.Velocity\r\n ],\r\n\r\n initialize:\r\n\r\n function ImpactBody (world, x, y, width, height)\r\n {\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactBody#body\r\n * @type {Phaser.Physics.Impact.Body}\r\n * @since 3.0.0\r\n */\r\n this.body = world.create(x, y, width, height);\r\n\r\n this.body.parent = this;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactBody#size\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.size = this.body.size;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactBody#offset\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.offset = this.body.offset;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactBody#vel\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.vel = this.body.vel;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactBody#accel\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.accel = this.body.accel;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactBody#friction\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.friction = this.body.friction;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactBody#maxVel\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.maxVel = this.body.maxVel;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ImpactBody;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/ImpactBody.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/ImpactImage.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/ImpactImage.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ./components */ \"./node_modules/phaser/src/physics/impact/components/index.js\");\r\nvar Image = __webpack_require__(/*! ../../gameobjects/image/Image */ \"./node_modules/phaser/src/gameobjects/image/Image.js\");\r\n\r\n/**\r\n * @classdesc\r\n * An Impact Physics Image Game Object.\r\n * \r\n * An Image is a light-weight Game Object useful for the display of static images in your game,\r\n * such as logos, backgrounds, scenery or other non-animated elements. Images can have input\r\n * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an\r\n * Image and a Sprite is that you cannot animate an Image as they do not have the Animation component.\r\n *\r\n * @class ImpactImage\r\n * @extends Phaser.GameObjects.Image\r\n * @memberof Phaser.Physics.Impact\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.Physics.Impact.Components.Acceleration\r\n * @extends Phaser.Physics.Impact.Components.BodyScale\r\n * @extends Phaser.Physics.Impact.Components.BodyType\r\n * @extends Phaser.Physics.Impact.Components.Bounce\r\n * @extends Phaser.Physics.Impact.Components.CheckAgainst\r\n * @extends Phaser.Physics.Impact.Components.Collides\r\n * @extends Phaser.Physics.Impact.Components.Debug\r\n * @extends Phaser.Physics.Impact.Components.Friction\r\n * @extends Phaser.Physics.Impact.Components.Gravity\r\n * @extends Phaser.Physics.Impact.Components.Offset\r\n * @extends Phaser.Physics.Impact.Components.SetGameObject\r\n * @extends Phaser.Physics.Impact.Components.Velocity\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Size\r\n * @extends Phaser.GameObjects.Components.Texture\r\n * @extends Phaser.GameObjects.Components.Tint\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Physics.Impact.World} world - The physics world of the Impact physics system.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n */\r\nvar ImpactImage = new Class({\r\n\r\n Extends: Image,\r\n\r\n Mixins: [\r\n Components.Acceleration,\r\n Components.BodyScale,\r\n Components.BodyType,\r\n Components.Bounce,\r\n Components.CheckAgainst,\r\n Components.Collides,\r\n Components.Debug,\r\n Components.Friction,\r\n Components.Gravity,\r\n Components.Offset,\r\n Components.SetGameObject,\r\n Components.Velocity\r\n ],\r\n\r\n initialize:\r\n\r\n function ImpactImage (world, x, y, texture, frame)\r\n {\r\n Image.call(this, world.scene, x, y, texture, frame);\r\n\r\n /**\r\n * The Physics Body linked to an ImpactImage.\r\n *\r\n * @name Phaser.Physics.Impact.ImpactImage#body\r\n * @type {Phaser.Physics.Impact.Body}\r\n * @since 3.0.0\r\n */\r\n this.body = world.create(x - this.frame.centerX, y - this.frame.centerY, this.width, this.height);\r\n\r\n this.body.parent = this;\r\n this.body.gameObject = this;\r\n\r\n /**\r\n * The size of the physics Body.\r\n *\r\n * @name Phaser.Physics.Impact.ImpactImage#size\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.size = this.body.size;\r\n\r\n /**\r\n * The X and Y offset of the Body from the left and top of the Image.\r\n *\r\n * @name Phaser.Physics.Impact.ImpactImage#offset\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.offset = this.body.offset;\r\n\r\n /**\r\n * The velocity, or rate of change the Body's position. Measured in pixels per second.\r\n *\r\n * @name Phaser.Physics.Impact.ImpactImage#vel\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.vel = this.body.vel;\r\n\r\n /**\r\n * The acceleration is the rate of change of the velocity. Measured in pixels per second squared.\r\n *\r\n * @name Phaser.Physics.Impact.ImpactImage#accel\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.accel = this.body.accel;\r\n\r\n /**\r\n * Friction between colliding bodies.\r\n *\r\n * @name Phaser.Physics.Impact.ImpactImage#friction\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.friction = this.body.friction;\r\n\r\n /**\r\n * The maximum velocity of the body.\r\n *\r\n * @name Phaser.Physics.Impact.ImpactImage#maxVel\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.maxVel = this.body.maxVel;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ImpactImage;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/ImpactImage.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/ImpactPhysics.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/ImpactPhysics.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Factory = __webpack_require__(/*! ./Factory */ \"./node_modules/phaser/src/physics/impact/Factory.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar Merge = __webpack_require__(/*! ../../utils/object/Merge */ \"./node_modules/phaser/src/utils/object/Merge.js\");\r\nvar PluginCache = __webpack_require__(/*! ../../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar SceneEvents = __webpack_require__(/*! ../../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\nvar World = __webpack_require__(/*! ./World */ \"./node_modules/phaser/src/physics/impact/World.js\");\r\n\r\n/**\r\n * @classdesc\r\n * [description]\r\n *\r\n * @class ImpactPhysics\r\n * @memberof Phaser.Physics.Impact\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - [description]\r\n */\r\nvar ImpactPhysics = new Class({\r\n\r\n initialize:\r\n\r\n function ImpactPhysics (scene)\r\n {\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactPhysics#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactPhysics#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactPhysics#config\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.config = this.getConfig();\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactPhysics#world\r\n * @type {Phaser.Physics.Impact.World}\r\n * @since 3.0.0\r\n */\r\n this.world;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactPhysics#add\r\n * @type {Phaser.Physics.Impact.Factory}\r\n * @since 3.0.0\r\n */\r\n this.add;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n scene.sys.events.on(SceneEvents.START, this.start, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Physics.Impact.ImpactPhysics#boot\r\n * @private\r\n * @since 3.5.1\r\n */\r\n boot: function ()\r\n {\r\n this.world = new World(this.scene, this.config);\r\n this.add = new Factory(this.world);\r\n\r\n this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Physics.Impact.ImpactPhysics#start\r\n * @private\r\n * @since 3.5.0\r\n */\r\n start: function ()\r\n {\r\n if (!this.world)\r\n {\r\n this.world = new World(this.scene, this.config);\r\n this.add = new Factory(this.world);\r\n }\r\n\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.on(SceneEvents.UPDATE, this.world.update, this.world);\r\n eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.ImpactPhysics#getConfig\r\n * @since 3.0.0\r\n *\r\n * @return {object} [description]\r\n */\r\n getConfig: function ()\r\n {\r\n var gameConfig = this.systems.game.config.physics;\r\n var sceneConfig = this.systems.settings.physics;\r\n\r\n var config = Merge(\r\n GetFastValue(sceneConfig, 'impact', {}),\r\n GetFastValue(gameConfig, 'impact', {})\r\n );\r\n\r\n return config;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.ImpactPhysics#pause\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Physics.Impact.World} The Impact World object.\r\n */\r\n pause: function ()\r\n {\r\n return this.world.pause();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.ImpactPhysics#resume\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Physics.Impact.World} The Impact World object.\r\n */\r\n resume: function ()\r\n {\r\n return this.world.resume();\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Phaser.Physics.Impact.ImpactPhysics#shutdown\r\n * @private\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.off(SceneEvents.UPDATE, this.world.update, this.world);\r\n eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n\r\n this.add.destroy();\r\n this.world.destroy();\r\n\r\n this.add = null;\r\n this.world = null;\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Phaser.Physics.Impact.ImpactPhysics#destroy\r\n * @private\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.scene.sys.events.off(SceneEvents.START, this.start, this);\r\n\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nPluginCache.register('ImpactPhysics', ImpactPhysics, 'impactPhysics');\r\n\r\nmodule.exports = ImpactPhysics;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/ImpactPhysics.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/ImpactSprite.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/ImpactSprite.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ./components */ \"./node_modules/phaser/src/physics/impact/components/index.js\");\r\nvar Sprite = __webpack_require__(/*! ../../gameobjects/sprite/Sprite */ \"./node_modules/phaser/src/gameobjects/sprite/Sprite.js\");\r\n\r\n/**\r\n * @classdesc\r\n * An Impact Physics Sprite Game Object.\r\n *\r\n * A Sprite Game Object is used for the display of both static and animated images in your game.\r\n * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled\r\n * and animated.\r\n *\r\n * The main difference between a Sprite and an Image Game Object is that you cannot animate Images.\r\n * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation\r\n * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases.\r\n *\r\n * @class ImpactSprite\r\n * @extends Phaser.GameObjects.Sprite\r\n * @memberof Phaser.Physics.Impact\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.Physics.Impact.Components.Acceleration\r\n * @extends Phaser.Physics.Impact.Components.BodyScale\r\n * @extends Phaser.Physics.Impact.Components.BodyType\r\n * @extends Phaser.Physics.Impact.Components.Bounce\r\n * @extends Phaser.Physics.Impact.Components.CheckAgainst\r\n * @extends Phaser.Physics.Impact.Components.Collides\r\n * @extends Phaser.Physics.Impact.Components.Debug\r\n * @extends Phaser.Physics.Impact.Components.Friction\r\n * @extends Phaser.Physics.Impact.Components.Gravity\r\n * @extends Phaser.Physics.Impact.Components.Offset\r\n * @extends Phaser.Physics.Impact.Components.SetGameObject\r\n * @extends Phaser.Physics.Impact.Components.Velocity\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Size\r\n * @extends Phaser.GameObjects.Components.Texture\r\n * @extends Phaser.GameObjects.Components.Tint\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Physics.Impact.World} world - [description]\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n */\r\nvar ImpactSprite = new Class({\r\n\r\n Extends: Sprite,\r\n\r\n Mixins: [\r\n Components.Acceleration,\r\n Components.BodyScale,\r\n Components.BodyType,\r\n Components.Bounce,\r\n Components.CheckAgainst,\r\n Components.Collides,\r\n Components.Debug,\r\n Components.Friction,\r\n Components.Gravity,\r\n Components.Offset,\r\n Components.SetGameObject,\r\n Components.Velocity\r\n ],\r\n\r\n initialize:\r\n\r\n function ImpactSprite (world, x, y, texture, frame)\r\n {\r\n Sprite.call(this, world.scene, x, y, texture, frame);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactSprite#body\r\n * @type {Phaser.Physics.Impact.Body}\r\n * @since 3.0.0\r\n */\r\n this.body = world.create(x - this.frame.centerX, y - this.frame.centerY, this.width, this.height);\r\n\r\n this.body.parent = this;\r\n this.body.gameObject = this;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactSprite#size\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.size = this.body.size;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactSprite#offset\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.offset = this.body.offset;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactSprite#vel\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.vel = this.body.vel;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactSprite#accel\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.accel = this.body.accel;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactSprite#friction\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.friction = this.body.friction;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.ImpactSprite#maxVel\r\n * @type {{x: number, y: number}}\r\n * @since 3.0.0\r\n */\r\n this.maxVel = this.body.maxVel;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ImpactSprite;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/ImpactSprite.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/SeparateX.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/SeparateX.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Physics.Impact.SeparateX\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.World} world - [description]\r\n * @param {Phaser.Physics.Impact.Body} left - [description]\r\n * @param {Phaser.Physics.Impact.Body} right - [description]\r\n * @param {Phaser.Physics.Impact.Body} [weak] - [description]\r\n */\r\nvar SeparateX = function (world, left, right, weak)\r\n{\r\n var nudge = left.pos.x + left.size.x - right.pos.x;\r\n \r\n // We have a weak entity, so just move this one\r\n if (weak)\r\n {\r\n var strong = (left === weak) ? right : left;\r\n\r\n weak.vel.x = -weak.vel.x * weak.bounciness + strong.vel.x;\r\n \r\n var resWeak = world.collisionMap.trace(weak.pos.x, weak.pos.y, weak === left ? -nudge : nudge, 0, weak.size.x, weak.size.y);\r\n\r\n weak.pos.x = resWeak.pos.x;\r\n }\r\n else\r\n {\r\n var v2 = (left.vel.x - right.vel.x) / 2;\r\n\r\n left.vel.x = -v2;\r\n right.vel.x = v2;\r\n \r\n var resLeft = world.collisionMap.trace(left.pos.x, left.pos.y, -nudge / 2, 0, left.size.x, left.size.y);\r\n\r\n left.pos.x = Math.floor(resLeft.pos.x);\r\n \r\n var resRight = world.collisionMap.trace(right.pos.x, right.pos.y, nudge / 2, 0, right.size.x, right.size.y);\r\n\r\n right.pos.x = Math.ceil(resRight.pos.x);\r\n }\r\n};\r\n\r\nmodule.exports = SeparateX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/SeparateX.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/SeparateY.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/SeparateY.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Physics.Impact.SeparateY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.World} world - [description]\r\n * @param {Phaser.Physics.Impact.Body} top - [description]\r\n * @param {Phaser.Physics.Impact.Body} bottom - [description]\r\n * @param {Phaser.Physics.Impact.Body} [weak] - [description]\r\n */\r\nvar SeparateY = function (world, top, bottom, weak)\r\n{\r\n var nudge = (top.pos.y + top.size.y - bottom.pos.y);\r\n var nudgeX;\r\n var resTop;\r\n \r\n if (weak)\r\n {\r\n var strong = (top === weak) ? bottom : top;\r\n\r\n weak.vel.y = -weak.vel.y * weak.bounciness + strong.vel.y;\r\n \r\n // Riding on a platform?\r\n nudgeX = 0;\r\n\r\n if (weak === top && Math.abs(weak.vel.y - strong.vel.y) < weak.minBounceVelocity)\r\n {\r\n weak.standing = true;\r\n nudgeX = strong.vel.x * world.delta;\r\n }\r\n \r\n var resWeak = world.collisionMap.trace(weak.pos.x, weak.pos.y, nudgeX, weak === top ? -nudge : nudge, weak.size.x, weak.size.y);\r\n\r\n weak.pos.y = resWeak.pos.y;\r\n weak.pos.x = resWeak.pos.x;\r\n }\r\n else if (world.gravity && (bottom.standing || top.vel.y > 0))\r\n {\r\n resTop = world.collisionMap.trace(top.pos.x, top.pos.y, 0, -(top.pos.y + top.size.y - bottom.pos.y), top.size.x, top.size.y);\r\n\r\n top.pos.y = resTop.pos.y;\r\n \r\n if (top.bounciness > 0 && top.vel.y > top.minBounceVelocity)\r\n {\r\n top.vel.y *= -top.bounciness;\r\n }\r\n else\r\n {\r\n top.standing = true;\r\n top.vel.y = 0;\r\n }\r\n }\r\n else\r\n {\r\n var v2 = (top.vel.y - bottom.vel.y) / 2;\r\n\r\n top.vel.y = -v2;\r\n bottom.vel.y = v2;\r\n \r\n nudgeX = bottom.vel.x * world.delta;\r\n\r\n resTop = world.collisionMap.trace(top.pos.x, top.pos.y, nudgeX, -nudge / 2, top.size.x, top.size.y);\r\n\r\n top.pos.y = resTop.pos.y;\r\n \r\n var resBottom = world.collisionMap.trace(bottom.pos.x, bottom.pos.y, 0, nudge / 2, bottom.size.x, bottom.size.y);\r\n\r\n bottom.pos.y = resBottom.pos.y;\r\n }\r\n};\r\n\r\nmodule.exports = SeparateY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/SeparateY.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/Solver.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/Solver.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar COLLIDES = __webpack_require__(/*! ./COLLIDES */ \"./node_modules/phaser/src/physics/impact/COLLIDES.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/physics/impact/events/index.js\");\r\nvar SeparateX = __webpack_require__(/*! ./SeparateX */ \"./node_modules/phaser/src/physics/impact/SeparateX.js\");\r\nvar SeparateY = __webpack_require__(/*! ./SeparateY */ \"./node_modules/phaser/src/physics/impact/SeparateY.js\");\r\n\r\n/**\r\n * Impact Physics Solver\r\n *\r\n * @function Phaser.Physics.Impact.Solver\r\n * @fires Phaser.Physics.Impact.Events#COLLIDE\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.World} world - The Impact simulation to run the solver in.\r\n * @param {Phaser.Physics.Impact.Body} bodyA - The first body in the collision.\r\n * @param {Phaser.Physics.Impact.Body} bodyB - The second body in the collision.\r\n */\r\nvar Solver = function (world, bodyA, bodyB)\r\n{\r\n var weak = null;\r\n\r\n if (bodyA.collides === COLLIDES.LITE || bodyB.collides === COLLIDES.FIXED)\r\n {\r\n weak = bodyA;\r\n }\r\n else if (bodyB.collides === COLLIDES.LITE || bodyA.collides === COLLIDES.FIXED)\r\n {\r\n weak = bodyB;\r\n }\r\n\r\n if (bodyA.last.x + bodyA.size.x > bodyB.last.x && bodyA.last.x < bodyB.last.x + bodyB.size.x)\r\n {\r\n if (bodyA.last.y < bodyB.last.y)\r\n {\r\n SeparateY(world, bodyA, bodyB, weak);\r\n }\r\n else\r\n {\r\n SeparateY(world, bodyB, bodyA, weak);\r\n }\r\n\r\n bodyA.collideWith(bodyB, 'y');\r\n bodyB.collideWith(bodyA, 'y');\r\n\r\n world.emit(Events.COLLIDE, bodyA, bodyB, 'y');\r\n }\r\n else if (bodyA.last.y + bodyA.size.y > bodyB.last.y && bodyA.last.y < bodyB.last.y + bodyB.size.y)\r\n {\r\n if (bodyA.last.x < bodyB.last.x)\r\n {\r\n SeparateX(world, bodyA, bodyB, weak);\r\n }\r\n else\r\n {\r\n SeparateX(world, bodyB, bodyA, weak);\r\n }\r\n\r\n bodyA.collideWith(bodyB, 'x');\r\n bodyB.collideWith(bodyA, 'x');\r\n\r\n world.emit(Events.COLLIDE, bodyA, bodyB, 'x');\r\n }\r\n};\r\n\r\nmodule.exports = Solver;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/Solver.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/TYPE.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/TYPE.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Collision Types - Determine if and how entities collide with each other.\r\n *\r\n * In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the \"weak\" entity moves,\r\n * while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE\r\n * collisions, both entities are moved. LITE or PASSIVE entities don't collide\r\n * with other LITE or PASSIVE entities at all. The behavior for FIXED vs.\r\n * FIXED collisions is undefined.\r\n *\r\n * @namespace Phaser.Physics.Impact.TYPE\r\n * @memberof Phaser.Physics.Impact\r\n * @since 3.0.0\r\n */\r\nmodule.exports = {\r\n\r\n /**\r\n * Collides with nothing.\r\n *\r\n * @name Phaser.Physics.Impact.TYPE.NONE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n NONE: 0,\r\n\r\n /**\r\n * Type A. Collides with Type B.\r\n *\r\n * @name Phaser.Physics.Impact.TYPE.A\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n A: 1,\r\n\r\n /**\r\n * Type B. Collides with Type A.\r\n *\r\n * @name Phaser.Physics.Impact.TYPE.B\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n B: 2,\r\n\r\n /**\r\n * Collides with both types A and B.\r\n *\r\n * @name Phaser.Physics.Impact.TYPE.BOTH\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n BOTH: 3\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/TYPE.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/UpdateMotion.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/UpdateMotion.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Set up the trace-result\r\n * var res = {\r\n * collision: {x: false, y: false, slope: false},\r\n * pos: {x: x, y: y},\r\n * tile: {x: 0, y: 0}\r\n * };\r\n *\r\n * @function Phaser.Physics.Impact.UpdateMotion\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body} body - [description]\r\n * @param {object} res - [description]\r\n */\r\nvar UpdateMotion = function (body, res)\r\n{\r\n body.standing = false;\r\n\r\n // Y\r\n if (res.collision.y)\r\n {\r\n if (body.bounciness > 0 && Math.abs(body.vel.y) > body.minBounceVelocity)\r\n {\r\n body.vel.y *= -body.bounciness;\r\n }\r\n else\r\n {\r\n if (body.vel.y > 0)\r\n {\r\n body.standing = true;\r\n }\r\n\r\n body.vel.y = 0;\r\n }\r\n }\r\n\r\n // X\r\n if (res.collision.x)\r\n {\r\n if (body.bounciness > 0 && Math.abs(body.vel.x) > body.minBounceVelocity)\r\n {\r\n body.vel.x *= -body.bounciness;\r\n }\r\n else\r\n {\r\n body.vel.x = 0;\r\n }\r\n }\r\n\r\n // SLOPE\r\n if (res.collision.slope)\r\n {\r\n var s = res.collision.slope;\r\n \r\n if (body.bounciness > 0)\r\n {\r\n var proj = body.vel.x * s.nx + body.vel.y * s.ny;\r\n\r\n body.vel.x = (body.vel.x - s.nx * proj * 2) * body.bounciness;\r\n body.vel.y = (body.vel.y - s.ny * proj * 2) * body.bounciness;\r\n }\r\n else\r\n {\r\n var lengthSquared = s.x * s.x + s.y * s.y;\r\n var dot = (body.vel.x * s.x + body.vel.y * s.y) / lengthSquared;\r\n \r\n body.vel.x = s.x * dot;\r\n body.vel.y = s.y * dot;\r\n \r\n var angle = Math.atan2(s.x, s.y);\r\n\r\n if (angle > body.slopeStanding.min && angle < body.slopeStanding.max)\r\n {\r\n body.standing = true;\r\n }\r\n }\r\n }\r\n\r\n body.pos.x = res.pos.x;\r\n body.pos.y = res.pos.y;\r\n};\r\n\r\nmodule.exports = UpdateMotion;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/UpdateMotion.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/World.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/World.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Body = __webpack_require__(/*! ./Body */ \"./node_modules/phaser/src/physics/impact/Body.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar COLLIDES = __webpack_require__(/*! ./COLLIDES */ \"./node_modules/phaser/src/physics/impact/COLLIDES.js\");\r\nvar CollisionMap = __webpack_require__(/*! ./CollisionMap */ \"./node_modules/phaser/src/physics/impact/CollisionMap.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/physics/impact/events/index.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar HasValue = __webpack_require__(/*! ../../utils/object/HasValue */ \"./node_modules/phaser/src/utils/object/HasValue.js\");\r\nvar Set = __webpack_require__(/*! ../../structs/Set */ \"./node_modules/phaser/src/structs/Set.js\");\r\nvar Solver = __webpack_require__(/*! ./Solver */ \"./node_modules/phaser/src/physics/impact/Solver.js\");\r\nvar TILEMAP_FORMATS = __webpack_require__(/*! ../../tilemaps/Formats */ \"./node_modules/phaser/src/tilemaps/Formats.js\");\r\nvar TYPE = __webpack_require__(/*! ./TYPE */ \"./node_modules/phaser/src/physics/impact/TYPE.js\");\r\n\r\n/**\r\n * @classdesc\r\n * [description]\r\n *\r\n * @class World\r\n * @extends Phaser.Events.EventEmitter\r\n * @memberof Phaser.Physics.Impact\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Impact World instance belongs.\r\n * @param {Phaser.Types.Physics.Impact.WorldConfig} config - [description]\r\n */\r\nvar World = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function World (scene, config)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.World#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.World#bodies\r\n * @type {Phaser.Structs.Set.}\r\n * @since 3.0.0\r\n */\r\n this.bodies = new Set();\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.World#gravity\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.gravity = GetFastValue(config, 'gravity', 0);\r\n\r\n /**\r\n * Spatial hash cell dimensions\r\n *\r\n * @name Phaser.Physics.Impact.World#cellSize\r\n * @type {integer}\r\n * @default 64\r\n * @since 3.0.0\r\n */\r\n this.cellSize = GetFastValue(config, 'cellSize', 64);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.World#collisionMap\r\n * @type {Phaser.Physics.Impact.CollisionMap}\r\n * @since 3.0.0\r\n */\r\n this.collisionMap = new CollisionMap();\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.World#timeScale\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.timeScale = GetFastValue(config, 'timeScale', 1);\r\n\r\n /**\r\n * Impacts maximum time step is 20 fps.\r\n *\r\n * @name Phaser.Physics.Impact.World#maxStep\r\n * @type {number}\r\n * @default 0.05\r\n * @since 3.0.0\r\n */\r\n this.maxStep = GetFastValue(config, 'maxStep', 0.05);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.World#enabled\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.enabled = true;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.World#drawDebug\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.drawDebug = GetFastValue(config, 'debug', false);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.World#debugGraphic\r\n * @type {Phaser.GameObjects.Graphics}\r\n * @since 3.0.0\r\n */\r\n this.debugGraphic;\r\n\r\n var _maxVelocity = GetFastValue(config, 'maxVelocity', 100);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.World#defaults\r\n * @type {Phaser.Types.Physics.Impact.WorldDefaults}\r\n * @since 3.0.0\r\n */\r\n this.defaults = {\r\n debugShowBody: GetFastValue(config, 'debugShowBody', true),\r\n debugShowVelocity: GetFastValue(config, 'debugShowVelocity', true),\r\n bodyDebugColor: GetFastValue(config, 'debugBodyColor', 0xff00ff),\r\n velocityDebugColor: GetFastValue(config, 'debugVelocityColor', 0x00ff00),\r\n maxVelocityX: GetFastValue(config, 'maxVelocityX', _maxVelocity),\r\n maxVelocityY: GetFastValue(config, 'maxVelocityY', _maxVelocity),\r\n minBounceVelocity: GetFastValue(config, 'minBounceVelocity', 40),\r\n gravityFactor: GetFastValue(config, 'gravityFactor', 1),\r\n bounciness: GetFastValue(config, 'bounciness', 0)\r\n };\r\n\r\n /**\r\n * An object containing the 4 wall bodies that bound the physics world.\r\n *\r\n * @name Phaser.Physics.Impact.World#walls\r\n * @type {Phaser.Types.Physics.Impact.WorldWalls}\r\n * @since 3.0.0\r\n */\r\n this.walls = { left: null, right: null, top: null, bottom: null };\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.World#delta\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.delta = 0;\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.World#_lastId\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._lastId = 0;\r\n\r\n if (GetFastValue(config, 'setBounds', false))\r\n {\r\n var boundsConfig = config['setBounds'];\r\n\r\n if (typeof boundsConfig === 'boolean')\r\n {\r\n this.setBounds();\r\n }\r\n else\r\n {\r\n var x = GetFastValue(boundsConfig, 'x', 0);\r\n var y = GetFastValue(boundsConfig, 'y', 0);\r\n var width = GetFastValue(boundsConfig, 'width', scene.sys.scale.width);\r\n var height = GetFastValue(boundsConfig, 'height', scene.sys.scale.height);\r\n var thickness = GetFastValue(boundsConfig, 'thickness', 64);\r\n var left = GetFastValue(boundsConfig, 'left', true);\r\n var right = GetFastValue(boundsConfig, 'right', true);\r\n var top = GetFastValue(boundsConfig, 'top', true);\r\n var bottom = GetFastValue(boundsConfig, 'bottom', true);\r\n\r\n this.setBounds(x, y, width, height, thickness, left, right, top, bottom);\r\n }\r\n }\r\n\r\n if (this.drawDebug)\r\n {\r\n this.createDebugGraphic();\r\n }\r\n },\r\n\r\n /**\r\n * Sets the collision map for the world either from a Weltmeister JSON level in the cache or from\r\n * a 2D array. If loading from a Weltmeister level, the map must have a layer called \"collision\".\r\n *\r\n * @method Phaser.Physics.Impact.World#setCollisionMap\r\n * @since 3.0.0\r\n *\r\n * @param {(string|integer[][])} key - Either a string key that corresponds to a Weltmeister level\r\n * in the cache, or a 2D array of collision IDs.\r\n * @param {integer} tileSize - The size of a tile. This is optional if loading from a Weltmeister\r\n * level in the cache.\r\n *\r\n * @return {?Phaser.Physics.Impact.CollisionMap} The newly created CollisionMap, or null if the method failed to\r\n * create the CollisionMap.\r\n */\r\n setCollisionMap: function (key, tileSize)\r\n {\r\n if (typeof key === 'string')\r\n {\r\n var tilemapData = this.scene.cache.tilemap.get(key);\r\n\r\n if (!tilemapData || tilemapData.format !== TILEMAP_FORMATS.WELTMEISTER)\r\n {\r\n console.warn('The specified key does not correspond to a Weltmeister tilemap: ' + key);\r\n return null;\r\n }\r\n\r\n var layers = tilemapData.data.layer;\r\n var collisionLayer;\r\n for (var i = 0; i < layers.length; i++)\r\n {\r\n if (layers[i].name === 'collision')\r\n {\r\n collisionLayer = layers[i];\r\n break;\r\n }\r\n }\r\n\r\n if (tileSize === undefined) { tileSize = collisionLayer.tilesize; }\r\n\r\n this.collisionMap = new CollisionMap(tileSize, collisionLayer.data);\r\n }\r\n else if (Array.isArray(key))\r\n {\r\n this.collisionMap = new CollisionMap(tileSize, key);\r\n }\r\n else\r\n {\r\n console.warn('Invalid Weltmeister collision map data: ' + key);\r\n }\r\n\r\n return this.collisionMap;\r\n },\r\n\r\n /**\r\n * Sets the collision map for the world from a tilemap layer. Only tiles that are marked as\r\n * colliding will be used. You can specify the mapping from tiles to slope IDs in a couple of\r\n * ways. The easiest is to use Tiled and the slopeTileProperty option. Alternatively, you can\r\n * manually create a slopeMap that stores the mapping between tile indices and slope IDs.\r\n *\r\n * @method Phaser.Physics.Impact.World#setCollisionMapFromTilemapLayer\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The tilemap layer to use.\r\n * @param {Phaser.Types.Physics.Impact.CollisionOptions} [options] - Options for controlling the mapping from tiles to slope IDs.\r\n *\r\n * @return {Phaser.Physics.Impact.CollisionMap} The newly created CollisionMap.\r\n */\r\n setCollisionMapFromTilemapLayer: function (tilemapLayer, options)\r\n {\r\n if (options === undefined) { options = {}; }\r\n var slopeProperty = GetFastValue(options, 'slopeProperty', null);\r\n var slopeMap = GetFastValue(options, 'slopeMap', null);\r\n var collidingSlope = GetFastValue(options, 'defaultCollidingSlope', null);\r\n var nonCollidingSlope = GetFastValue(options, 'defaultNonCollidingSlope', 0);\r\n\r\n var layerData = tilemapLayer.layer;\r\n var tileSize = layerData.baseTileWidth;\r\n var collisionData = [];\r\n\r\n for (var ty = 0; ty < layerData.height; ty++)\r\n {\r\n collisionData[ty] = [];\r\n\r\n for (var tx = 0; tx < layerData.width; tx++)\r\n {\r\n var tile = layerData.data[ty][tx];\r\n\r\n if (tile && tile.collides)\r\n {\r\n if (slopeProperty !== null && HasValue(tile.properties, slopeProperty))\r\n {\r\n collisionData[ty][tx] = parseInt(tile.properties[slopeProperty], 10);\r\n }\r\n else if (slopeMap !== null && HasValue(slopeMap, tile.index))\r\n {\r\n collisionData[ty][tx] = slopeMap[tile.index];\r\n }\r\n else if (collidingSlope !== null)\r\n {\r\n collisionData[ty][tx] = collidingSlope;\r\n }\r\n else\r\n {\r\n collisionData[ty][tx] = tile.index;\r\n }\r\n }\r\n else\r\n {\r\n collisionData[ty][tx] = nonCollidingSlope;\r\n }\r\n }\r\n }\r\n\r\n this.collisionMap = new CollisionMap(tileSize, collisionData);\r\n\r\n return this.collisionMap;\r\n },\r\n\r\n /**\r\n * Sets the bounds of the Physics world to match the given world pixel dimensions.\r\n * You can optionally set which 'walls' to create: left, right, top or bottom.\r\n * If none of the walls are given it will default to use the walls settings it had previously.\r\n * I.e. if you previously told it to not have the left or right walls, and you then adjust the world size\r\n * the newly created bounds will also not have the left and right walls.\r\n * Explicitly state them in the parameters to override this.\r\n *\r\n * @method Phaser.Physics.Impact.World#setBounds\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x coordinate of the top-left corner of the bounds.\r\n * @param {number} [y] - The y coordinate of the top-left corner of the bounds.\r\n * @param {number} [width] - The width of the bounds.\r\n * @param {number} [height] - The height of the bounds.\r\n * @param {number} [thickness=64] - [description]\r\n * @param {boolean} [left=true] - If true will create the left bounds wall.\r\n * @param {boolean} [right=true] - If true will create the right bounds wall.\r\n * @param {boolean} [top=true] - If true will create the top bounds wall.\r\n * @param {boolean} [bottom=true] - If true will create the bottom bounds wall.\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n setBounds: function (x, y, width, height, thickness, left, right, top, bottom)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = this.scene.sys.scale.width; }\r\n if (height === undefined) { height = this.scene.sys.scale.height; }\r\n if (thickness === undefined) { thickness = 64; }\r\n if (left === undefined) { left = true; }\r\n if (right === undefined) { right = true; }\r\n if (top === undefined) { top = true; }\r\n if (bottom === undefined) { bottom = true; }\r\n\r\n this.updateWall(left, 'left', x - thickness, y, thickness, height);\r\n this.updateWall(right, 'right', x + width, y, thickness, height);\r\n this.updateWall(top, 'top', x, y - thickness, width, thickness);\r\n this.updateWall(bottom, 'bottom', x, y + height, width, thickness);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * position = 'left', 'right', 'top' or 'bottom'\r\n *\r\n * @method Phaser.Physics.Impact.World#updateWall\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} add - [description]\r\n * @param {string} position - [description]\r\n * @param {number} x - [description]\r\n * @param {number} y - [description]\r\n * @param {number} width - [description]\r\n * @param {number} height - [description]\r\n */\r\n updateWall: function (add, position, x, y, width, height)\r\n {\r\n var wall = this.walls[position];\r\n\r\n if (add)\r\n {\r\n if (wall)\r\n {\r\n wall.resetSize(x, y, width, height);\r\n }\r\n else\r\n {\r\n this.walls[position] = this.create(x, y, width, height);\r\n this.walls[position].name = position;\r\n this.walls[position].gravityFactor = 0;\r\n this.walls[position].collides = COLLIDES.FIXED;\r\n }\r\n }\r\n else\r\n {\r\n if (wall)\r\n {\r\n this.bodies.remove(wall);\r\n }\r\n\r\n this.walls[position] = null;\r\n }\r\n },\r\n\r\n /**\r\n * Creates a Graphics Game Object used for debug display and enables the world for debug drawing.\r\n *\r\n * @method Phaser.Physics.Impact.World#createDebugGraphic\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Graphics} The Graphics object created that will have the debug visuals drawn to it.\r\n */\r\n createDebugGraphic: function ()\r\n {\r\n var graphic = this.scene.sys.add.graphics({ x: 0, y: 0 });\r\n\r\n graphic.setDepth(Number.MAX_VALUE);\r\n\r\n this.debugGraphic = graphic;\r\n\r\n this.drawDebug = true;\r\n\r\n return graphic;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#getNextID\r\n * @since 3.0.0\r\n *\r\n * @return {integer} [description]\r\n */\r\n getNextID: function ()\r\n {\r\n return this._lastId++;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#create\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - [description]\r\n * @param {number} y - [description]\r\n * @param {number} sizeX - [description]\r\n * @param {number} sizeY - [description]\r\n *\r\n * @return {Phaser.Physics.Impact.Body} The Body that was added to this World.\r\n */\r\n create: function (x, y, sizeX, sizeY)\r\n {\r\n var body = new Body(this, x, y, sizeX, sizeY);\r\n\r\n this.bodies.set(body);\r\n\r\n return body;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#remove\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body} object - The Body to remove from this World.\r\n */\r\n remove: function (object)\r\n {\r\n this.bodies.delete(object);\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#pause\r\n * @fires Phaser.Physics.Impact.Events#PAUSE\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n pause: function ()\r\n {\r\n this.enabled = false;\r\n\r\n this.emit(Events.PAUSE);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#resume\r\n * @fires Phaser.Physics.Impact.Events#RESUME\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n resume: function ()\r\n {\r\n this.enabled = true;\r\n\r\n this.emit(Events.RESUME);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#update\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\n update: function (time, delta)\r\n {\r\n if (!this.enabled || this.bodies.size === 0)\r\n {\r\n return;\r\n }\r\n\r\n // Impact uses a divided delta value that is clamped to the maxStep (20fps) maximum\r\n\r\n var clampedDelta = Math.min(delta / 1000, this.maxStep) * this.timeScale;\r\n\r\n this.delta = clampedDelta;\r\n\r\n // Update all active bodies\r\n\r\n var i;\r\n var body;\r\n var bodies = this.bodies.entries;\r\n var len = bodies.length;\r\n var hash = {};\r\n var size = this.cellSize;\r\n\r\n for (i = 0; i < len; i++)\r\n {\r\n body = bodies[i];\r\n\r\n if (body.enabled)\r\n {\r\n body.update(clampedDelta);\r\n }\r\n }\r\n\r\n // Run collision against them all now they're in the new positions from the update\r\n\r\n for (i = 0; i < len; i++)\r\n {\r\n body = bodies[i];\r\n\r\n if (body && !body.skipHash())\r\n {\r\n this.checkHash(body, hash, size);\r\n }\r\n }\r\n\r\n if (this.drawDebug)\r\n {\r\n var graphics = this.debugGraphic;\r\n\r\n graphics.clear();\r\n\r\n for (i = 0; i < len; i++)\r\n {\r\n body = bodies[i];\r\n\r\n if (body && body.willDrawDebug())\r\n {\r\n body.drawDebug(graphics);\r\n }\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Check the body against the spatial hash.\r\n *\r\n * @method Phaser.Physics.Impact.World#checkHash\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body} body - [description]\r\n * @param {object} hash - [description]\r\n * @param {number} size - [description]\r\n */\r\n checkHash: function (body, hash, size)\r\n {\r\n var checked = {};\r\n\r\n var xmin = Math.floor(body.pos.x / size);\r\n var ymin = Math.floor(body.pos.y / size);\r\n var xmax = Math.floor((body.pos.x + body.size.x) / size) + 1;\r\n var ymax = Math.floor((body.pos.y + body.size.y) / size) + 1;\r\n\r\n for (var x = xmin; x < xmax; x++)\r\n {\r\n for (var y = ymin; y < ymax; y++)\r\n {\r\n if (!hash[x])\r\n {\r\n hash[x] = {};\r\n hash[x][y] = [ body ];\r\n }\r\n else if (!hash[x][y])\r\n {\r\n hash[x][y] = [ body ];\r\n }\r\n else\r\n {\r\n var cell = hash[x][y];\r\n\r\n for (var c = 0; c < cell.length; c++)\r\n {\r\n if (body.touches(cell[c]) && !checked[cell[c].id])\r\n {\r\n checked[cell[c].id] = true;\r\n\r\n this.checkBodies(body, cell[c]);\r\n }\r\n }\r\n\r\n cell.push(body);\r\n }\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#checkBodies\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body} bodyA - [description]\r\n * @param {Phaser.Physics.Impact.Body} bodyB - [description]\r\n */\r\n checkBodies: function (bodyA, bodyB)\r\n {\r\n // 2 fixed bodies won't do anything\r\n if (bodyA.collides === COLLIDES.FIXED && bodyB.collides === COLLIDES.FIXED)\r\n {\r\n return;\r\n }\r\n\r\n // bitwise checks\r\n if (bodyA.checkAgainst & bodyB.type)\r\n {\r\n bodyA.check(bodyB);\r\n }\r\n\r\n if (bodyB.checkAgainst & bodyA.type)\r\n {\r\n bodyB.check(bodyA);\r\n }\r\n\r\n if (bodyA.collides && bodyB.collides && bodyA.collides + bodyB.collides > COLLIDES.ACTIVE)\r\n {\r\n Solver(this, bodyA, bodyB);\r\n }\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#setCollidesNever\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the collides value on.\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n setCollidesNever: function (bodies)\r\n {\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n bodies[i].collides = COLLIDES.NEVER;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#setLite\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the collides value on.\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n setLite: function (bodies)\r\n {\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n bodies[i].collides = COLLIDES.LITE;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#setPassive\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the collides value on.\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n setPassive: function (bodies)\r\n {\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n bodies[i].collides = COLLIDES.PASSIVE;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#setActive\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the collides value on.\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n setActive: function (bodies)\r\n {\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n bodies[i].collides = COLLIDES.ACTIVE;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#setFixed\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the collides value on.\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n setFixed: function (bodies)\r\n {\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n bodies[i].collides = COLLIDES.FIXED;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#setTypeNone\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on.\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n setTypeNone: function (bodies)\r\n {\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n bodies[i].type = TYPE.NONE;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#setTypeA\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on.\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n setTypeA: function (bodies)\r\n {\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n bodies[i].type = TYPE.A;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#setTypeB\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on.\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n setTypeB: function (bodies)\r\n {\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n bodies[i].type = TYPE.B;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#setAvsB\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on.\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n setAvsB: function (bodies)\r\n {\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n bodies[i].type = TYPE.A;\r\n bodies[i].checkAgainst = TYPE.B;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#setBvsA\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on.\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n setBvsA: function (bodies)\r\n {\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n bodies[i].type = TYPE.B;\r\n bodies[i].checkAgainst = TYPE.A;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#setCheckAgainstNone\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on.\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n setCheckAgainstNone: function (bodies)\r\n {\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n bodies[i].checkAgainst = TYPE.NONE;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#setCheckAgainstA\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on.\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n setCheckAgainstA: function (bodies)\r\n {\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n bodies[i].checkAgainst = TYPE.A;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#setCheckAgainstB\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on.\r\n *\r\n * @return {Phaser.Physics.Impact.World} This World object.\r\n */\r\n setCheckAgainstB: function (bodies)\r\n {\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n bodies[i].checkAgainst = TYPE.B;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#shutdown\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n this.removeAllListeners();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.World#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.removeAllListeners();\r\n\r\n this.scene = null;\r\n\r\n this.bodies.clear();\r\n\r\n this.bodies = null;\r\n\r\n this.collisionMap = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = World;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/World.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/components/Acceleration.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/components/Acceleration.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Impact Acceleration component.\r\n * Should be applied as a mixin.\r\n *\r\n * @namespace Phaser.Physics.Impact.Components.Acceleration\r\n * @since 3.0.0\r\n */\r\nvar Acceleration = {\r\n\r\n /**\r\n * Sets the horizontal acceleration of this body.\r\n *\r\n * @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationX\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The amount of acceleration to apply.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setAccelerationX: function (x)\r\n {\r\n this.accel.x = x;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the vertical acceleration of this body.\r\n *\r\n * @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationY\r\n * @since 3.0.0\r\n *\r\n * @param {number} y - The amount of acceleration to apply.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setAccelerationY: function (y)\r\n {\r\n this.accel.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal and vertical acceleration of this body.\r\n *\r\n * @method Phaser.Physics.Impact.Components.Acceleration#setAcceleration\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The amount of horizontal acceleration to apply.\r\n * @param {number} y - The amount of vertical acceleration to apply.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setAcceleration: function (x, y)\r\n {\r\n this.accel.x = x;\r\n this.accel.y = y;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Acceleration;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/components/Acceleration.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/components/BodyScale.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/components/BodyScale.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Impact Body Scale component.\r\n * Should be applied as a mixin.\r\n *\r\n * @namespace Phaser.Physics.Impact.Components.BodyScale\r\n * @since 3.0.0\r\n */\r\nvar BodyScale = {\r\n\r\n /**\r\n * Sets the size of the physics body.\r\n *\r\n * @method Phaser.Physics.Impact.Components.BodyScale#setBodySize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of the body in pixels.\r\n * @param {number} [height=width] - The height of the body in pixels.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setBodySize: function (width, height)\r\n {\r\n if (height === undefined) { height = width; }\r\n\r\n this.body.size.x = Math.round(width);\r\n this.body.size.y = Math.round(height);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the scale of the physics body.\r\n *\r\n * @method Phaser.Physics.Impact.Components.BodyScale#setBodyScale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scaleX - The horizontal scale of the body.\r\n * @param {number} [scaleY] - The vertical scale of the body. If not given, will use the horizontal scale value.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setBodyScale: function (scaleX, scaleY)\r\n {\r\n if (scaleY === undefined) { scaleY = scaleX; }\r\n\r\n var gameObject = this.body.gameObject;\r\n\r\n if (gameObject)\r\n {\r\n gameObject.setScale(scaleX, scaleY);\r\n\r\n return this.setBodySize(gameObject.width * gameObject.scaleX, gameObject.height * gameObject.scaleY);\r\n }\r\n else\r\n {\r\n return this.setBodySize(this.body.size.x * scaleX, this.body.size.y * scaleY);\r\n }\r\n }\r\n\r\n};\r\n\r\nmodule.exports = BodyScale;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/components/BodyScale.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/components/BodyType.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/components/BodyType.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar TYPE = __webpack_require__(/*! ../TYPE */ \"./node_modules/phaser/src/physics/impact/TYPE.js\");\r\n\r\n/**\r\n * The Impact Body Type component.\r\n * Should be applied as a mixin.\r\n *\r\n * @namespace Phaser.Physics.Impact.Components.BodyType\r\n * @since 3.0.0\r\n */\r\nvar BodyType = {\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.BodyType#getBodyType\r\n * @since 3.0.0\r\n *\r\n * @return {number} [description]\r\n */\r\n getBodyType: function ()\r\n {\r\n return this.body.type;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.BodyType#setTypeNone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setTypeNone: function ()\r\n {\r\n this.body.type = TYPE.NONE;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.BodyType#setTypeA\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setTypeA: function ()\r\n {\r\n this.body.type = TYPE.A;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.BodyType#setTypeB\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setTypeB: function ()\r\n {\r\n this.body.type = TYPE.B;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = BodyType;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/components/BodyType.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/components/Bounce.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/components/Bounce.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Impact Bounce component.\r\n * Should be applied as a mixin.\r\n *\r\n * @namespace Phaser.Physics.Impact.Components.Bounce\r\n * @since 3.0.0\r\n */\r\nvar Bounce = {\r\n\r\n /**\r\n * Sets the impact physics bounce, or restitution, value.\r\n *\r\n * @method Phaser.Physics.Impact.Components.Bounce#setBounce\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - A value between 0 (no rebound) and 1 (full rebound)\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setBounce: function (value)\r\n {\r\n this.body.bounciness = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the minimum velocity the body is allowed to be moving to be considered for rebound.\r\n *\r\n * @method Phaser.Physics.Impact.Components.Bounce#setMinBounceVelocity\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The minimum allowed velocity.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setMinBounceVelocity: function (value)\r\n {\r\n this.body.minBounceVelocity = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The bounce, or restitution, value of this body.\r\n * A value between 0 (no rebound) and 1 (full rebound)\r\n *\r\n * @name Phaser.Physics.Impact.Components.Bounce#bounce\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bounce: {\r\n\r\n get: function ()\r\n {\r\n return this.body.bounciness;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.body.bounciness = value;\r\n }\r\n\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Bounce;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/components/Bounce.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/components/CheckAgainst.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/components/CheckAgainst.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar TYPE = __webpack_require__(/*! ../TYPE */ \"./node_modules/phaser/src/physics/impact/TYPE.js\");\r\n\r\n/**\r\n * The Impact Check Against component.\r\n * Should be applied as a mixin.\r\n *\r\n * @namespace Phaser.Physics.Impact.Components.CheckAgainst\r\n * @since 3.0.0\r\n */\r\nvar CheckAgainst = {\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.CheckAgainst#setAvsB\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setAvsB: function ()\r\n {\r\n this.setTypeA();\r\n\r\n return this.setCheckAgainstB();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.CheckAgainst#setBvsA\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setBvsA: function ()\r\n {\r\n this.setTypeB();\r\n\r\n return this.setCheckAgainstA();\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstNone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setCheckAgainstNone: function ()\r\n {\r\n this.body.checkAgainst = TYPE.NONE;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstA\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setCheckAgainstA: function ()\r\n {\r\n this.body.checkAgainst = TYPE.A;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstB\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setCheckAgainstB: function ()\r\n {\r\n this.body.checkAgainst = TYPE.B;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Components.CheckAgainst#checkAgainst\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n checkAgainst: {\r\n\r\n get: function ()\r\n {\r\n return this.body.checkAgainst;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.body.checkAgainst = value;\r\n }\r\n\r\n }\r\n\r\n};\r\n\r\nmodule.exports = CheckAgainst;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/components/CheckAgainst.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/components/Collides.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/components/Collides.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar COLLIDES = __webpack_require__(/*! ../COLLIDES */ \"./node_modules/phaser/src/physics/impact/COLLIDES.js\");\r\n\r\n/**\r\n * @callback CollideCallback\r\n *\r\n * @param {Phaser.Physics.Impact.Body} body - [description]\r\n * @param {Phaser.Physics.Impact.Body} other - [description]\r\n * @param {string} axis - [description]\r\n */\r\n\r\n/**\r\n * The Impact Collides component.\r\n * Should be applied as a mixin.\r\n *\r\n * @namespace Phaser.Physics.Impact.Components.Collides\r\n * @since 3.0.0\r\n */\r\nvar Collides = {\r\n\r\n _collideCallback: null,\r\n _callbackScope: null,\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.Collides#setCollideCallback\r\n * @since 3.0.0\r\n *\r\n * @param {CollideCallback} callback - [description]\r\n * @param {*} scope - [description]\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setCollideCallback: function (callback, scope)\r\n {\r\n this._collideCallback = callback;\r\n\r\n if (scope)\r\n {\r\n this._callbackScope = scope;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.Collides#setCollidesNever\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setCollidesNever: function ()\r\n {\r\n this.body.collides = COLLIDES.NEVER;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.Collides#setLiteCollision\r\n * @since 3.6.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setLiteCollision: function ()\r\n {\r\n this.body.collides = COLLIDES.LITE;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.Collides#setPassiveCollision\r\n * @since 3.6.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setPassiveCollision: function ()\r\n {\r\n this.body.collides = COLLIDES.PASSIVE;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.Collides#setActiveCollision\r\n * @since 3.6.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setActiveCollision: function ()\r\n {\r\n this.body.collides = COLLIDES.ACTIVE;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.Collides#setFixedCollision\r\n * @since 3.6.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setFixedCollision: function ()\r\n {\r\n this.body.collides = COLLIDES.FIXED;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Components.Collides#collides\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n collides: {\r\n\r\n get: function ()\r\n {\r\n return this.body.collides;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.body.collides = value;\r\n }\r\n\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Collides;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/components/Collides.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/components/Debug.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/components/Debug.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Impact Debug component.\r\n * Should be applied as a mixin.\r\n *\r\n * @namespace Phaser.Physics.Impact.Components.Debug\r\n * @since 3.0.0\r\n */\r\nvar Debug = {\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.Debug#setDebug\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} showBody - [description]\r\n * @param {boolean} showVelocity - [description]\r\n * @param {number} bodyColor - [description]\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setDebug: function (showBody, showVelocity, bodyColor)\r\n {\r\n this.debugShowBody = showBody;\r\n this.debugShowVelocity = showVelocity;\r\n this.debugBodyColor = bodyColor;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.Debug#setDebugBodyColor\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - [description]\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setDebugBodyColor: function (value)\r\n {\r\n this.body.debugBodyColor = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Components.Debug#debugShowBody\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n debugShowBody: {\r\n\r\n get: function ()\r\n {\r\n return this.body.debugShowBody;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.body.debugShowBody = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Components.Debug#debugShowVelocity\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n debugShowVelocity: {\r\n\r\n get: function ()\r\n {\r\n return this.body.debugShowVelocity;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.body.debugShowVelocity = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Components.Debug#debugBodyColor\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n debugBodyColor: {\r\n\r\n get: function ()\r\n {\r\n return this.body.debugBodyColor;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.body.debugBodyColor = value;\r\n }\r\n\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Debug;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/components/Debug.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/components/Friction.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/components/Friction.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Impact Friction component.\r\n * Should be applied as a mixin.\r\n *\r\n * @namespace Phaser.Physics.Impact.Components.Friction\r\n * @since 3.0.0\r\n */\r\nvar Friction = {\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.Friction#setFrictionX\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - [description]\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setFrictionX: function (x)\r\n {\r\n this.friction.x = x;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.Friction#setFrictionY\r\n * @since 3.0.0\r\n *\r\n * @param {number} y - [description]\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setFrictionY: function (y)\r\n {\r\n this.friction.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.Friction#setFriction\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - [description]\r\n * @param {number} y - [description]\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setFriction: function (x, y)\r\n {\r\n this.friction.x = x;\r\n this.friction.y = y;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Friction;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/components/Friction.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/components/Gravity.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/components/Gravity.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Impact Gravity component.\r\n * Should be applied as a mixin.\r\n *\r\n * @namespace Phaser.Physics.Impact.Components.Gravity\r\n * @since 3.0.0\r\n */\r\nvar Gravity = {\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.Gravity#setGravity\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - [description]\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setGravity: function (value)\r\n {\r\n this.body.gravityFactor = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Physics.Impact.Components.Gravity#gravity\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n gravity: {\r\n\r\n get: function ()\r\n {\r\n return this.body.gravityFactor;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.body.gravityFactor = value;\r\n }\r\n\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Gravity;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/components/Gravity.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/components/Offset.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/components/Offset.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Impact Offset component.\r\n * Should be applied as a mixin.\r\n *\r\n * @namespace Phaser.Physics.Impact.Components.Offset\r\n * @since 3.0.0\r\n */\r\nvar Offset = {\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.Offset#setOffset\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - [description]\r\n * @param {number} y - [description]\r\n * @param {number} [width] - [description]\r\n * @param {number} [height] - [description]\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setOffset: function (x, y, width, height)\r\n {\r\n this.body.offset.x = x;\r\n this.body.offset.y = y;\r\n\r\n if (width)\r\n {\r\n this.setBodySize(width, height);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Offset;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/components/Offset.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/components/SetGameObject.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/components/SetGameObject.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Impact Set Game Object component.\r\n * Should be applied as a mixin.\r\n *\r\n * @namespace Phaser.Physics.Impact.Components.SetGameObject\r\n * @since 3.0.0\r\n */\r\nvar SetGameObject = {\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.SetGameObject#setGameObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - [description]\r\n * @param {boolean} [sync=true] - [description]\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setGameObject: function (gameObject, sync)\r\n {\r\n if (sync === undefined) { sync = true; }\r\n\r\n if (gameObject)\r\n {\r\n this.body.gameObject = gameObject;\r\n\r\n if (sync)\r\n {\r\n this.syncGameObject();\r\n }\r\n }\r\n else\r\n {\r\n this.body.gameObject = null;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Physics.Impact.Components.SetGameObject#syncGameObject\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n syncGameObject: function ()\r\n {\r\n var gameObject = this.body.gameObject;\r\n\r\n if (gameObject)\r\n {\r\n this.setBodySize(gameObject.width * gameObject.scaleX, gameObject.height * gameObject.scaleY);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = SetGameObject;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/components/SetGameObject.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/components/Velocity.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/components/Velocity.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Impact Velocity component.\r\n * Should be applied as a mixin.\r\n *\r\n * @namespace Phaser.Physics.Impact.Components.Velocity\r\n * @since 3.0.0\r\n */\r\nvar Velocity = {\r\n\r\n /**\r\n * Sets the horizontal velocity of the physics body.\r\n *\r\n * @method Phaser.Physics.Impact.Components.Velocity#setVelocityX\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal velocity value.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setVelocityX: function (x)\r\n {\r\n this.vel.x = x;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the vertical velocity of the physics body.\r\n *\r\n * @method Phaser.Physics.Impact.Components.Velocity#setVelocityY\r\n * @since 3.0.0\r\n *\r\n * @param {number} y - The vertical velocity value.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setVelocityY: function (y)\r\n {\r\n this.vel.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal and vertical velocities of the physics body.\r\n *\r\n * @method Phaser.Physics.Impact.Components.Velocity#setVelocity\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal velocity value.\r\n * @param {number} [y=x] - The vertical velocity value. If not given, defaults to the horizontal value.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setVelocity: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.vel.x = x;\r\n this.vel.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the maximum velocity this body can travel at.\r\n *\r\n * @method Phaser.Physics.Impact.Components.Velocity#setMaxVelocity\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The maximum allowed horizontal velocity.\r\n * @param {number} [y=x] - The maximum allowed vertical velocity. If not given, defaults to the horizontal value.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setMaxVelocity: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.maxVel.x = x;\r\n this.maxVel.y = y;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Velocity;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/components/Velocity.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/components/index.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/components/index.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Physics.Impact.Components\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Acceleration: __webpack_require__(/*! ./Acceleration */ \"./node_modules/phaser/src/physics/impact/components/Acceleration.js\"),\r\n BodyScale: __webpack_require__(/*! ./BodyScale */ \"./node_modules/phaser/src/physics/impact/components/BodyScale.js\"),\r\n BodyType: __webpack_require__(/*! ./BodyType */ \"./node_modules/phaser/src/physics/impact/components/BodyType.js\"),\r\n Bounce: __webpack_require__(/*! ./Bounce */ \"./node_modules/phaser/src/physics/impact/components/Bounce.js\"),\r\n CheckAgainst: __webpack_require__(/*! ./CheckAgainst */ \"./node_modules/phaser/src/physics/impact/components/CheckAgainst.js\"),\r\n Collides: __webpack_require__(/*! ./Collides */ \"./node_modules/phaser/src/physics/impact/components/Collides.js\"),\r\n Debug: __webpack_require__(/*! ./Debug */ \"./node_modules/phaser/src/physics/impact/components/Debug.js\"),\r\n Friction: __webpack_require__(/*! ./Friction */ \"./node_modules/phaser/src/physics/impact/components/Friction.js\"),\r\n Gravity: __webpack_require__(/*! ./Gravity */ \"./node_modules/phaser/src/physics/impact/components/Gravity.js\"),\r\n Offset: __webpack_require__(/*! ./Offset */ \"./node_modules/phaser/src/physics/impact/components/Offset.js\"),\r\n SetGameObject: __webpack_require__(/*! ./SetGameObject */ \"./node_modules/phaser/src/physics/impact/components/SetGameObject.js\"),\r\n Velocity: __webpack_require__(/*! ./Velocity */ \"./node_modules/phaser/src/physics/impact/components/Velocity.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/components/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/events/COLLIDE_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/events/COLLIDE_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Impact Physics World Collide Event.\r\n * \r\n * This event is dispatched by an Impact Physics World instance if two bodies collide.\r\n * \r\n * Listen to it from a Scene using: `this.impact.world.on('collide', listener)`.\r\n *\r\n * @event Phaser.Physics.Impact.Events#COLLIDE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Physics.Impact.Body} bodyA - The first body involved in the collision.\r\n * @param {Phaser.Physics.Impact.Body} bodyB - The second body involved in the collision.\r\n * @param {string} axis - The collision axis. Either `x` or `y`.\r\n */\r\nmodule.exports = 'collide';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/events/COLLIDE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/events/PAUSE_EVENT.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/events/PAUSE_EVENT.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Impact Physics World Pause Event.\r\n * \r\n * This event is dispatched by an Impact Physics World instance when it is paused.\r\n * \r\n * Listen to it from a Scene using: `this.impact.world.on('pause', listener)`.\r\n *\r\n * @event Phaser.Physics.Impact.Events#PAUSE\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'pause';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/events/PAUSE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/events/RESUME_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/events/RESUME_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Impact Physics World Resume Event.\r\n * \r\n * This event is dispatched by an Impact Physics World instance when it resumes from a paused state.\r\n * \r\n * Listen to it from a Scene using: `this.impact.world.on('resume', listener)`.\r\n *\r\n * @event Phaser.Physics.Impact.Events#RESUME\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'resume';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/events/RESUME_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/events/index.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/events/index.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Physics.Impact.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n COLLIDE: __webpack_require__(/*! ./COLLIDE_EVENT */ \"./node_modules/phaser/src/physics/impact/events/COLLIDE_EVENT.js\"),\r\n PAUSE: __webpack_require__(/*! ./PAUSE_EVENT */ \"./node_modules/phaser/src/physics/impact/events/PAUSE_EVENT.js\"),\r\n RESUME: __webpack_require__(/*! ./RESUME_EVENT */ \"./node_modules/phaser/src/physics/impact/events/RESUME_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/impact/index.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/physics/impact/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * An Impact.js compatible physics world, body and solver, for those who are used\r\n * to the Impact way of defining and controlling physics bodies. Also works with\r\n * the new Loader support for Weltmeister map data.\r\n *\r\n * World updated to run off the Phaser main loop.\r\n * Body extended to support additional setter functions.\r\n *\r\n * To create the map data you'll need Weltmeister, which comes with Impact\r\n * and can be purchased from http://impactjs.com\r\n *\r\n * My thanks to Dominic Szablewski for his permission to support Impact in Phaser.\r\n *\r\n * @namespace Phaser.Physics.Impact\r\n */\r\nmodule.exports = {\r\n\r\n Body: __webpack_require__(/*! ./Body */ \"./node_modules/phaser/src/physics/impact/Body.js\"),\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/physics/impact/events/index.js\"),\r\n COLLIDES: __webpack_require__(/*! ./COLLIDES */ \"./node_modules/phaser/src/physics/impact/COLLIDES.js\"),\r\n CollisionMap: __webpack_require__(/*! ./CollisionMap */ \"./node_modules/phaser/src/physics/impact/CollisionMap.js\"),\r\n Factory: __webpack_require__(/*! ./Factory */ \"./node_modules/phaser/src/physics/impact/Factory.js\"),\r\n Image: __webpack_require__(/*! ./ImpactImage */ \"./node_modules/phaser/src/physics/impact/ImpactImage.js\"),\r\n ImpactBody: __webpack_require__(/*! ./ImpactBody */ \"./node_modules/phaser/src/physics/impact/ImpactBody.js\"),\r\n ImpactPhysics: __webpack_require__(/*! ./ImpactPhysics */ \"./node_modules/phaser/src/physics/impact/ImpactPhysics.js\"),\r\n Sprite: __webpack_require__(/*! ./ImpactSprite */ \"./node_modules/phaser/src/physics/impact/ImpactSprite.js\"),\r\n TYPE: __webpack_require__(/*! ./TYPE */ \"./node_modules/phaser/src/physics/impact/TYPE.js\"),\r\n World: __webpack_require__(/*! ./World */ \"./node_modules/phaser/src/physics/impact/World.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/impact/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/index.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/physics/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Physics\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Types.Physics\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Arcade: __webpack_require__(/*! ./arcade */ \"./node_modules/phaser/src/physics/arcade/index.js\"),\r\n Impact: __webpack_require__(/*! ./impact */ \"./node_modules/phaser/src/physics/impact/index.js\"),\r\n Matter: __webpack_require__(/*! ./matter-js */ \"./node_modules/phaser/src/physics/matter-js/index.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/BodyBounds.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/BodyBounds.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * \r\n * The Body Bounds class contains methods to help you extract the world coordinates from various points around\r\n * the bounds of a Matter Body. Because Matter bodies are positioned based on their center of mass, and not a\r\n * dimension based center, you often need to get the bounds coordinates in order to properly align them in the world.\r\n * \r\n * You can access this class via the MatterPhysics class from a Scene, i.e.:\r\n * \r\n * ```javascript\r\n * this.matter.bodyBounds.getTopLeft(body);\r\n * ```\r\n * \r\n * See also the `MatterPhysics.alignBody` method.\r\n *\r\n * @class BodyBounds\r\n * @memberof Phaser.Physics.Matter\r\n * @constructor\r\n * @since 3.22.0\r\n */\r\nvar BodyBounds = new Class({\r\n\r\n initialize:\r\n\r\n function BodyBounds ()\r\n {\r\n /**\r\n * A Vector2 that stores the temporary bounds center value during calculations by methods in this class.\r\n *\r\n * @name Phaser.Physics.Matter.BodyBounds#boundsCenter\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.22.0\r\n */\r\n this.boundsCenter = new Vector2();\r\n\r\n /**\r\n * A Vector2 that stores the temporary center diff values during calculations by methods in this class.\r\n *\r\n * @name Phaser.Physics.Matter.BodyBounds#centerDiff\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.22.0\r\n */\r\n this.centerDiff = new Vector2();\r\n },\r\n\r\n /**\r\n * Parses the given body to get the bounds diff values from it.\r\n * \r\n * They're stored in this class in the temporary properties `boundsCenter` and `centerDiff`.\r\n * \r\n * This method is called automatically by all other methods in this class.\r\n *\r\n * @method Phaser.Physics.Matter.BodyBounds#parseBody\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBody} body - The Body to get the bounds position from.\r\n *\r\n * @return {boolean} `true` if it was able to get the bounds, otherwise `false`.\r\n */\r\n parseBody: function (body)\r\n {\r\n body = (body.hasOwnProperty('body')) ? body.body : body;\r\n\r\n if (!body.hasOwnProperty('bounds') || !body.hasOwnProperty('centerOfMass'))\r\n {\r\n return false;\r\n }\r\n\r\n var boundsCenter = this.boundsCenter;\r\n var centerDiff = this.centerDiff;\r\n\r\n var boundsWidth = body.bounds.max.x - body.bounds.min.x;\r\n var boundsHeight = body.bounds.max.y - body.bounds.min.y;\r\n\r\n var bodyCenterX = boundsWidth * body.centerOfMass.x;\r\n var bodyCenterY = boundsHeight * body.centerOfMass.y;\r\n\r\n boundsCenter.set(boundsWidth / 2, boundsHeight / 2);\r\n centerDiff.set(bodyCenterX - boundsCenter.x, bodyCenterY - boundsCenter.y);\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Takes a Body and returns the world coordinates of the top-left of its _bounds_.\r\n * \r\n * Body bounds are updated by Matter each step and factor in scale and rotation.\r\n * This will return the world coordinate based on the bodies _current_ position and bounds.\r\n *\r\n * @method Phaser.Physics.Matter.BodyBounds#getTopLeft\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBody} body - The Body to get the position from.\r\n * @param {number} [x=0] - Optional horizontal offset to add to the returned coordinates.\r\n * @param {number} [y=0] - Optional vertical offset to add to the returned coordinates.\r\n *\r\n * @return {(Phaser.Math.Vector2|false)} A Vector2 containing the coordinates, or `false` if it was unable to parse the body.\r\n */\r\n getTopLeft: function (body, x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n if (this.parseBody(body))\r\n {\r\n var center = this.boundsCenter;\r\n var diff = this.centerDiff;\r\n\r\n return new Vector2(\r\n x + center.x + diff.x,\r\n y + center.y + diff.y\r\n );\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Takes a Body and returns the world coordinates of the top-center of its _bounds_.\r\n * \r\n * Body bounds are updated by Matter each step and factor in scale and rotation.\r\n * This will return the world coordinate based on the bodies _current_ position and bounds.\r\n *\r\n * @method Phaser.Physics.Matter.BodyBounds#getTopCenter\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBody} body - The Body to get the position from.\r\n * @param {number} [x=0] - Optional horizontal offset to add to the returned coordinates.\r\n * @param {number} [y=0] - Optional vertical offset to add to the returned coordinates.\r\n *\r\n * @return {(Phaser.Math.Vector2|false)} A Vector2 containing the coordinates, or `false` if it was unable to parse the body.\r\n */\r\n getTopCenter: function (body, x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n if (this.parseBody(body))\r\n {\r\n var center = this.boundsCenter;\r\n var diff = this.centerDiff;\r\n\r\n return new Vector2(\r\n x + diff.x,\r\n y + center.y + diff.y\r\n );\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Takes a Body and returns the world coordinates of the top-right of its _bounds_.\r\n * \r\n * Body bounds are updated by Matter each step and factor in scale and rotation.\r\n * This will return the world coordinate based on the bodies _current_ position and bounds.\r\n *\r\n * @method Phaser.Physics.Matter.BodyBounds#getTopRight\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBody} body - The Body to get the position from.\r\n * @param {number} [x=0] - Optional horizontal offset to add to the returned coordinates.\r\n * @param {number} [y=0] - Optional vertical offset to add to the returned coordinates.\r\n *\r\n * @return {(Phaser.Math.Vector2|false)} A Vector2 containing the coordinates, or `false` if it was unable to parse the body.\r\n */\r\n getTopRight: function (body, x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n if (this.parseBody(body))\r\n {\r\n var center = this.boundsCenter;\r\n var diff = this.centerDiff;\r\n\r\n return new Vector2(\r\n x - (center.x - diff.x),\r\n y + center.y + diff.y\r\n );\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Takes a Body and returns the world coordinates of the left-center of its _bounds_.\r\n * \r\n * Body bounds are updated by Matter each step and factor in scale and rotation.\r\n * This will return the world coordinate based on the bodies _current_ position and bounds.\r\n *\r\n * @method Phaser.Physics.Matter.BodyBounds#getLeftCenter\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBody} body - The Body to get the position from.\r\n * @param {number} [x=0] - Optional horizontal offset to add to the returned coordinates.\r\n * @param {number} [y=0] - Optional vertical offset to add to the returned coordinates.\r\n *\r\n * @return {(Phaser.Math.Vector2|false)} A Vector2 containing the coordinates, or `false` if it was unable to parse the body.\r\n */\r\n getLeftCenter: function (body, x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n if (this.parseBody(body))\r\n {\r\n var center = this.boundsCenter;\r\n var diff = this.centerDiff;\r\n\r\n return new Vector2(\r\n x + center.x + diff.x,\r\n y + diff.y\r\n );\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Takes a Body and returns the world coordinates of the center of its _bounds_.\r\n * \r\n * Body bounds are updated by Matter each step and factor in scale and rotation.\r\n * This will return the world coordinate based on the bodies _current_ position and bounds.\r\n *\r\n * @method Phaser.Physics.Matter.BodyBounds#getCenter\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBody} body - The Body to get the position from.\r\n * @param {number} [x=0] - Optional horizontal offset to add to the returned coordinates.\r\n * @param {number} [y=0] - Optional vertical offset to add to the returned coordinates.\r\n *\r\n * @return {(Phaser.Math.Vector2|false)} A Vector2 containing the coordinates, or `false` if it was unable to parse the body.\r\n */\r\n getCenter: function (body, x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n if (this.parseBody(body))\r\n {\r\n var diff = this.centerDiff;\r\n\r\n return new Vector2(\r\n x + diff.x,\r\n y + diff.y\r\n );\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Takes a Body and returns the world coordinates of the right-center of its _bounds_.\r\n * \r\n * Body bounds are updated by Matter each step and factor in scale and rotation.\r\n * This will return the world coordinate based on the bodies _current_ position and bounds.\r\n *\r\n * @method Phaser.Physics.Matter.BodyBounds#getRightCenter\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBody} body - The Body to get the position from.\r\n * @param {number} [x=0] - Optional horizontal offset to add to the returned coordinates.\r\n * @param {number} [y=0] - Optional vertical offset to add to the returned coordinates.\r\n *\r\n * @return {(Phaser.Math.Vector2|false)} A Vector2 containing the coordinates, or `false` if it was unable to parse the body.\r\n */\r\n getRightCenter: function (body, x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n if (this.parseBody(body))\r\n {\r\n var center = this.boundsCenter;\r\n var diff = this.centerDiff;\r\n\r\n return new Vector2(\r\n x - (center.x - diff.x),\r\n y + diff.y\r\n );\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Takes a Body and returns the world coordinates of the bottom-left of its _bounds_.\r\n * \r\n * Body bounds are updated by Matter each step and factor in scale and rotation.\r\n * This will return the world coordinate based on the bodies _current_ position and bounds.\r\n *\r\n * @method Phaser.Physics.Matter.BodyBounds#getBottomLeft\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBody} body - The Body to get the position from.\r\n * @param {number} [x=0] - Optional horizontal offset to add to the returned coordinates.\r\n * @param {number} [y=0] - Optional vertical offset to add to the returned coordinates.\r\n *\r\n * @return {(Phaser.Math.Vector2|false)} A Vector2 containing the coordinates, or `false` if it was unable to parse the body.\r\n */\r\n getBottomLeft: function (body, x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n if (this.parseBody(body))\r\n {\r\n var center = this.boundsCenter;\r\n var diff = this.centerDiff;\r\n\r\n return new Vector2(\r\n x + center.x + diff.x,\r\n y - (center.y - diff.y)\r\n );\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Takes a Body and returns the world coordinates of the bottom-center of its _bounds_.\r\n * \r\n * Body bounds are updated by Matter each step and factor in scale and rotation.\r\n * This will return the world coordinate based on the bodies _current_ position and bounds.\r\n *\r\n * @method Phaser.Physics.Matter.BodyBounds#getBottomCenter\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBody} body - The Body to get the position from.\r\n * @param {number} [x=0] - Optional horizontal offset to add to the returned coordinates.\r\n * @param {number} [y=0] - Optional vertical offset to add to the returned coordinates.\r\n *\r\n * @return {(Phaser.Math.Vector2|false)} A Vector2 containing the coordinates, or `false` if it was unable to parse the body.\r\n */\r\n getBottomCenter: function (body, x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n if (this.parseBody(body))\r\n {\r\n var center = this.boundsCenter;\r\n var diff = this.centerDiff;\r\n\r\n return new Vector2(\r\n x + diff.x,\r\n y - (center.y - diff.y)\r\n );\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Takes a Body and returns the world coordinates of the bottom-right of its _bounds_.\r\n * \r\n * Body bounds are updated by Matter each step and factor in scale and rotation.\r\n * This will return the world coordinate based on the bodies _current_ position and bounds.\r\n *\r\n * @method Phaser.Physics.Matter.BodyBounds#getBottomRight\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBody} body - The Body to get the position from.\r\n * @param {number} [x=0] - Optional horizontal offset to add to the returned coordinates.\r\n * @param {number} [y=0] - Optional vertical offset to add to the returned coordinates.\r\n *\r\n * @return {(Phaser.Math.Vector2|false)} A Vector2 containing the coordinates, or `false` if it was unable to parse the body.\r\n */\r\n getBottomRight: function (body, x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n if (this.parseBody(body))\r\n {\r\n var center = this.boundsCenter;\r\n var diff = this.centerDiff;\r\n\r\n return new Vector2(\r\n x - (center.x - diff.x),\r\n y - (center.y - diff.y)\r\n );\r\n }\r\n\r\n return false;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = BodyBounds;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/BodyBounds.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/CustomMain.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/CustomMain.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Physics.Matter.Matter\r\n */\r\n\r\nvar Matter = __webpack_require__(/*! ./lib/core/Matter */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Matter.js\");\r\n\r\nMatter.Body = __webpack_require__(/*! ./lib/body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\nMatter.Composite = __webpack_require__(/*! ./lib/body/Composite */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Composite.js\");\r\nMatter.World = __webpack_require__(/*! ./lib/body/World */ \"./node_modules/phaser/src/physics/matter-js/lib/body/World.js\");\r\n\r\nMatter.Detector = __webpack_require__(/*! ./lib/collision/Detector */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Detector.js\");\r\nMatter.Grid = __webpack_require__(/*! ./lib/collision/Grid */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Grid.js\");\r\nMatter.Pairs = __webpack_require__(/*! ./lib/collision/Pairs */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Pairs.js\");\r\nMatter.Pair = __webpack_require__(/*! ./lib/collision/Pair */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Pair.js\");\r\nMatter.Query = __webpack_require__(/*! ./lib/collision/Query */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Query.js\");\r\nMatter.Resolver = __webpack_require__(/*! ./lib/collision/Resolver */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Resolver.js\");\r\nMatter.SAT = __webpack_require__(/*! ./lib/collision/SAT */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/SAT.js\");\r\n\r\nMatter.Constraint = __webpack_require__(/*! ./lib/constraint/Constraint */ \"./node_modules/phaser/src/physics/matter-js/lib/constraint/Constraint.js\");\r\n\r\nMatter.Common = __webpack_require__(/*! ./lib/core/Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\nMatter.Engine = __webpack_require__(/*! ./lib/core/Engine */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Engine.js\");\r\nMatter.Events = __webpack_require__(/*! ./lib/core/Events */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Events.js\");\r\nMatter.Sleeping = __webpack_require__(/*! ./lib/core/Sleeping */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Sleeping.js\");\r\nMatter.Plugin = __webpack_require__(/*! ./lib/core/Plugin */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Plugin.js\");\r\n\r\nMatter.Bodies = __webpack_require__(/*! ./lib/factory/Bodies */ \"./node_modules/phaser/src/physics/matter-js/lib/factory/Bodies.js\");\r\nMatter.Composites = __webpack_require__(/*! ./lib/factory/Composites */ \"./node_modules/phaser/src/physics/matter-js/lib/factory/Composites.js\");\r\n\r\nMatter.Axes = __webpack_require__(/*! ./lib/geometry/Axes */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Axes.js\");\r\nMatter.Bounds = __webpack_require__(/*! ./lib/geometry/Bounds */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Bounds.js\");\r\nMatter.Svg = __webpack_require__(/*! ./lib/geometry/Svg */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Svg.js\");\r\nMatter.Vector = __webpack_require__(/*! ./lib/geometry/Vector */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vector.js\");\r\nMatter.Vertices = __webpack_require__(/*! ./lib/geometry/Vertices */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js\");\r\n\r\n// aliases\r\n\r\nMatter.World.add = Matter.Composite.add;\r\nMatter.World.remove = Matter.Composite.remove;\r\nMatter.World.addComposite = Matter.Composite.addComposite;\r\nMatter.World.addBody = Matter.Composite.addBody;\r\nMatter.World.addConstraint = Matter.Composite.addConstraint;\r\nMatter.World.clear = Matter.Composite.clear;\r\n\r\nmodule.exports = Matter;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/CustomMain.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/Factory.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/Factory.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Bodies = __webpack_require__(/*! ./lib/factory/Bodies */ \"./node_modules/phaser/src/physics/matter-js/lib/factory/Bodies.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Composites = __webpack_require__(/*! ./lib/factory/Composites */ \"./node_modules/phaser/src/physics/matter-js/lib/factory/Composites.js\");\r\nvar Constraint = __webpack_require__(/*! ./lib/constraint/Constraint */ \"./node_modules/phaser/src/physics/matter-js/lib/constraint/Constraint.js\");\r\nvar Svg = __webpack_require__(/*! ./lib/geometry/Svg */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Svg.js\");\r\nvar MatterGameObject = __webpack_require__(/*! ./MatterGameObject */ \"./node_modules/phaser/src/physics/matter-js/MatterGameObject.js\");\r\nvar MatterImage = __webpack_require__(/*! ./MatterImage */ \"./node_modules/phaser/src/physics/matter-js/MatterImage.js\");\r\nvar MatterSprite = __webpack_require__(/*! ./MatterSprite */ \"./node_modules/phaser/src/physics/matter-js/MatterSprite.js\");\r\nvar MatterTileBody = __webpack_require__(/*! ./MatterTileBody */ \"./node_modules/phaser/src/physics/matter-js/MatterTileBody.js\");\r\nvar PhysicsEditorParser = __webpack_require__(/*! ./PhysicsEditorParser */ \"./node_modules/phaser/src/physics/matter-js/PhysicsEditorParser.js\");\r\nvar PhysicsJSONParser = __webpack_require__(/*! ./PhysicsJSONParser */ \"./node_modules/phaser/src/physics/matter-js/PhysicsJSONParser.js\");\r\nvar PointerConstraint = __webpack_require__(/*! ./PointerConstraint */ \"./node_modules/phaser/src/physics/matter-js/PointerConstraint.js\");\r\nvar Vertices = __webpack_require__(/*! ./lib/geometry/Vertices */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Matter Factory is responsible for quickly creating a variety of different types of\r\n * bodies, constraints and Game Objects and adding them into the physics world.\r\n * \r\n * You access the factory from within a Scene using `add`:\r\n * \r\n * ```javascript\r\n * this.matter.add.rectangle(x, y, width, height);\r\n * ```\r\n * \r\n * Use of the Factory is optional. All of the objects it creates can also be created\r\n * directly via your own code or constructors. It is provided as a means to keep your\r\n * code concise.\r\n *\r\n * @class Factory\r\n * @memberof Phaser.Physics.Matter\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Physics.Matter.World} world - The Matter World which this Factory adds to.\r\n */\r\nvar Factory = new Class({\r\n\r\n initialize:\r\n\r\n function Factory (world)\r\n {\r\n /**\r\n * The Matter World which this Factory adds to.\r\n *\r\n * @name Phaser.Physics.Matter.Factory#world\r\n * @type {Phaser.Physics.Matter.World}\r\n * @since 3.0.0\r\n */\r\n this.world = world;\r\n\r\n /**\r\n * The Scene which this Factory's Matter World belongs to.\r\n *\r\n * @name Phaser.Physics.Matter.Factory#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = world.scene;\r\n\r\n /**\r\n * A reference to the Scene.Systems this Matter Physics instance belongs to.\r\n *\r\n * @name Phaser.Physics.Matter.Factory#sys\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.sys = world.scene.sys;\r\n },\r\n\r\n /**\r\n * Creates a new rigid rectangular Body and adds it to the World.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#rectangle\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The X coordinate of the center of the Body.\r\n * @param {number} y - The Y coordinate of the center of the Body.\r\n * @param {number} width - The width of the Body.\r\n * @param {number} height - The height of the Body.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n *\r\n * @return {MatterJS.BodyType} A Matter JS Body.\r\n */\r\n rectangle: function (x, y, width, height, options)\r\n {\r\n var body = Bodies.rectangle(x, y, width, height, options);\r\n\r\n this.world.add(body);\r\n\r\n return body;\r\n },\r\n\r\n /**\r\n * Creates a new rigid trapezoidal Body and adds it to the World.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#trapezoid\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The X coordinate of the center of the Body.\r\n * @param {number} y - The Y coordinate of the center of the Body.\r\n * @param {number} width - The width of the trapezoid Body.\r\n * @param {number} height - The height of the trapezoid Body.\r\n * @param {number} slope - The slope of the trapezoid. 0 creates a rectangle, while 1 creates a triangle. Positive values make the top side shorter, while negative values make the bottom side shorter.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n *\r\n * @return {MatterJS.BodyType} A Matter JS Body.\r\n */\r\n trapezoid: function (x, y, width, height, slope, options)\r\n {\r\n var body = Bodies.trapezoid(x, y, width, height, slope, options);\r\n\r\n this.world.add(body);\r\n\r\n return body;\r\n },\r\n\r\n /**\r\n * Creates a new rigid circular Body and adds it to the World.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#circle\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The X coordinate of the center of the Body.\r\n * @param {number} y - The Y coordinate of the center of the Body.\r\n * @param {number} radius - The radius of the circle.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n * @param {number} [maxSides] - The maximum amount of sides to use for the polygon which will approximate this circle.\r\n *\r\n * @return {MatterJS.BodyType} A Matter JS Body.\r\n */\r\n circle: function (x, y, radius, options, maxSides)\r\n {\r\n var body = Bodies.circle(x, y, radius, options, maxSides);\r\n\r\n this.world.add(body);\r\n\r\n return body;\r\n },\r\n\r\n /**\r\n * Creates a new rigid polygonal Body and adds it to the World.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#polygon\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The X coordinate of the center of the Body.\r\n * @param {number} y - The Y coordinate of the center of the Body.\r\n * @param {number} sides - The number of sides the polygon will have.\r\n * @param {number} radius - The \"radius\" of the polygon, i.e. the distance from its center to any vertex. This is also the radius of its circumcircle.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n *\r\n * @return {MatterJS.BodyType} A Matter JS Body.\r\n */\r\n polygon: function (x, y, sides, radius, options)\r\n {\r\n var body = Bodies.polygon(x, y, sides, radius, options);\r\n\r\n this.world.add(body);\r\n\r\n return body;\r\n },\r\n\r\n /**\r\n * Creates a body using the supplied vertices (or an array containing multiple sets of vertices) and adds it to the World.\r\n * If the vertices are convex, they will pass through as supplied. Otherwise, if the vertices are concave, they will be decomposed. Note that this process is not guaranteed to support complex sets of vertices, e.g. ones with holes.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#fromVertices\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The X coordinate of the center of the Body.\r\n * @param {number} y - The Y coordinate of the center of the Body.\r\n * @param {(string|array)} vertexSets - The vertices data. Either a path string or an array of vertices.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n * @param {boolean} [flagInternal=false] - Flag internal edges (coincident part edges)\r\n * @param {number} [removeCollinear=0.01] - Whether Matter.js will discard collinear edges (to improve performance).\r\n * @param {number} [minimumArea=10] - During decomposition discard parts that have an area less than this.\r\n *\r\n * @return {MatterJS.BodyType} A Matter JS Body.\r\n */\r\n fromVertices: function (x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea)\r\n {\r\n if (typeof vertexSets === 'string')\r\n {\r\n vertexSets = Vertices.fromPath(vertexSets);\r\n }\r\n\r\n var body = Bodies.fromVertices(x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea);\r\n\r\n this.world.add(body);\r\n\r\n return body;\r\n },\r\n\r\n /**\r\n * Creates a body using data exported from the application PhysicsEditor (https://www.codeandweb.com/physicseditor)\r\n * \r\n * The PhysicsEditor file should be loaded as JSON:\r\n * \r\n * ```javascript\r\n * preload ()\r\n * {\r\n * this.load.json('vehicles', 'assets/vehicles.json);\r\n * }\r\n * \r\n * create ()\r\n * {\r\n * const vehicleShapes = this.cache.json.get('vehicles');\r\n * this.matter.add.fromPhysicsEditor(400, 300, vehicleShapes.truck);\r\n * }\r\n * ```\r\n * \r\n * Do not pass the entire JSON file to this method, but instead pass one of the shapes contained within it.\r\n * \r\n * If you pas in an `options` object, any settings in there will override those in the PhysicsEditor config object.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#fromPhysicsEditor\r\n * @since 3.22.0\r\n *\r\n * @param {number} x - The horizontal world location of the body.\r\n * @param {number} y - The vertical world location of the body.\r\n * @param {any} config - The JSON data exported from PhysicsEditor.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n * @param {boolean} [addToWorld=true] - Should the newly created body be immediately added to the World?\r\n *\r\n * @return {MatterJS.BodyType} A Matter JS Body.\r\n */\r\n fromPhysicsEditor: function (x, y, config, options, addToWorld)\r\n {\r\n if (addToWorld === undefined) { addToWorld = true; }\r\n\r\n var body = PhysicsEditorParser.parseBody(x, y, config, options);\r\n\r\n if (addToWorld && !this.world.has(body))\r\n {\r\n this.world.add(body);\r\n }\r\n\r\n return body;\r\n },\r\n\r\n /**\r\n * Creates a body using the path data from an SVG file.\r\n * \r\n * SVG Parsing requires the pathseg polyfill from https://github.com/progers/pathseg\r\n * \r\n * The SVG file should be loaded as XML, as this method requires the ability to extract\r\n * the path data from it. I.e.:\r\n * \r\n * ```javascript\r\n * preload ()\r\n * {\r\n * this.load.xml('face', 'assets/face.svg);\r\n * }\r\n * \r\n * create ()\r\n * {\r\n * this.matter.add.fromSVG(400, 300, this.cache.xml.get('face'));\r\n * }\r\n * ```\r\n *\r\n * @method Phaser.Physics.Matter.Factory#fromSVG\r\n * @since 3.22.0\r\n *\r\n * @param {number} x - The X coordinate of the body.\r\n * @param {number} y - The Y coordinate of the body.\r\n * @param {object} xml - The SVG Path data.\r\n * @param {number} [scale=1] - Scale the vertices by this amount after creation.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n * @param {boolean} [addToWorld=true] - Should the newly created body be immediately added to the World?\r\n *\r\n * @return {MatterJS.BodyType} A Matter JS Body.\r\n */\r\n fromSVG: function (x, y, xml, scale, options, addToWorld)\r\n {\r\n if (scale === undefined) { scale = 1; }\r\n if (options === undefined) { options = {}; }\r\n if (addToWorld === undefined) { addToWorld = true; }\r\n\r\n var path = xml.getElementsByTagName('path');\r\n var vertexSets = [];\r\n\r\n for (var i = 0; i < path.length; i++)\r\n {\r\n var points = Svg.pathToVertices(path[i], 30);\r\n\r\n if (scale !== 1)\r\n {\r\n Vertices.scale(points, scale, scale);\r\n }\r\n\r\n vertexSets.push(points);\r\n }\r\n\r\n var body = Bodies.fromVertices(x, y, vertexSets, options);\r\n\r\n if (addToWorld)\r\n {\r\n this.world.add(body);\r\n }\r\n\r\n return body;\r\n },\r\n\r\n /**\r\n * Creates a body using the supplied physics data, as provided by a JSON file.\r\n * \r\n * The data file should be loaded as JSON:\r\n * \r\n * ```javascript\r\n * preload ()\r\n * {\r\n * this.load.json('ninjas', 'assets/ninjas.json);\r\n * }\r\n * \r\n * create ()\r\n * {\r\n * const ninjaShapes = this.cache.json.get('ninjas');\r\n * \r\n * this.matter.add.fromJSON(400, 300, ninjaShapes.shinobi);\r\n * }\r\n * ```\r\n * \r\n * Do not pass the entire JSON file to this method, but instead pass one of the shapes contained within it.\r\n * \r\n * If you pas in an `options` object, any settings in there will override those in the config object.\r\n * \r\n * The structure of the JSON file is as follows:\r\n * \r\n * ```text\r\n * {\r\n * 'generator_info': // The name of the application that created the JSON data\r\n * 'shapeName': {\r\n * 'type': // The type of body\r\n * 'label': // Optional body label\r\n * 'vertices': // An array, or an array of arrays, containing the vertex data in x/y object pairs\r\n * }\r\n * }\r\n * ```\r\n * \r\n * At the time of writing, only the Phaser Physics Tracer App exports in this format.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#fromJSON\r\n * @since 3.22.0\r\n *\r\n * @param {number} x - The X coordinate of the body.\r\n * @param {number} y - The Y coordinate of the body.\r\n * @param {any} config - The JSON physics data.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n * @param {boolean} [addToWorld=true] - Should the newly created body be immediately added to the World?\r\n *\r\n * @return {MatterJS.BodyType} A Matter JS Body.\r\n */\r\n fromJSON: function (x, y, config, options, addToWorld)\r\n {\r\n if (options === undefined) { options = {}; }\r\n if (addToWorld === undefined) { addToWorld = true; }\r\n\r\n var body = PhysicsJSONParser.parseBody(x, y, config, options);\r\n\r\n if (body && addToWorld)\r\n {\r\n this.world.add(body);\r\n }\r\n\r\n return body;\r\n },\r\n\r\n /**\r\n * Create a new composite containing Matter Image objects created in a grid arrangement.\r\n * This function uses the body bounds to prevent overlaps.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#imageStack\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} frame - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value.\r\n * @param {number} x - The horizontal position of this composite in the world.\r\n * @param {number} y - The vertical position of this composite in the world.\r\n * @param {number} columns - The number of columns in the grid.\r\n * @param {number} rows - The number of rows in the grid.\r\n * @param {number} [columnGap=0] - The distance between each column.\r\n * @param {number} [rowGap=0] - The distance between each row.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n *\r\n * @return {MatterJS.CompositeType} A Matter JS Composite Stack.\r\n */\r\n imageStack: function (key, frame, x, y, columns, rows, columnGap, rowGap, options)\r\n {\r\n if (columnGap === undefined) { columnGap = 0; }\r\n if (rowGap === undefined) { rowGap = 0; }\r\n if (options === undefined) { options = {}; }\r\n\r\n var world = this.world;\r\n var displayList = this.sys.displayList;\r\n\r\n options.addToWorld = false;\r\n\r\n var stack = Composites.stack(x, y, columns, rows, columnGap, rowGap, function (x, y)\r\n {\r\n var image = new MatterImage(world, x, y, key, frame, options);\r\n\r\n displayList.add(image);\r\n\r\n return image.body;\r\n });\r\n\r\n world.add(stack);\r\n\r\n return stack;\r\n },\r\n\r\n /**\r\n * Create a new composite containing bodies created in the callback in a grid arrangement.\r\n * \r\n * This function uses the body bounds to prevent overlaps.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#stack\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this composite in the world.\r\n * @param {number} y - The vertical position of this composite in the world.\r\n * @param {number} columns - The number of columns in the grid.\r\n * @param {number} rows - The number of rows in the grid.\r\n * @param {number} columnGap - The distance between each column.\r\n * @param {number} rowGap - The distance between each row.\r\n * @param {function} callback - The callback that creates the stack.\r\n *\r\n * @return {MatterJS.CompositeType} A new composite containing objects created in the callback.\r\n */\r\n stack: function (x, y, columns, rows, columnGap, rowGap, callback)\r\n {\r\n var stack = Composites.stack(x, y, columns, rows, columnGap, rowGap, callback);\r\n\r\n this.world.add(stack);\r\n\r\n return stack;\r\n },\r\n\r\n /**\r\n * Create a new composite containing bodies created in the callback in a pyramid arrangement.\r\n * This function uses the body bounds to prevent overlaps.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#pyramid\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this composite in the world.\r\n * @param {number} y - The vertical position of this composite in the world.\r\n * @param {number} columns - The number of columns in the pyramid.\r\n * @param {number} rows - The number of rows in the pyramid.\r\n * @param {number} columnGap - The distance between each column.\r\n * @param {number} rowGap - The distance between each row.\r\n * @param {function} callback - The callback function to be invoked.\r\n *\r\n * @return {MatterJS.CompositeType} A Matter JS Composite pyramid.\r\n */\r\n pyramid: function (x, y, columns, rows, columnGap, rowGap, callback)\r\n {\r\n var stack = Composites.pyramid(x, y, columns, rows, columnGap, rowGap, callback);\r\n\r\n this.world.add(stack);\r\n\r\n return stack;\r\n },\r\n\r\n /**\r\n * Chains all bodies in the given composite together using constraints.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#chain\r\n * @since 3.0.0\r\n *\r\n * @param {MatterJS.CompositeType} composite - The composite in which all bodies will be chained together sequentially.\r\n * @param {number} xOffsetA - The horizontal offset of the BodyA constraint. This is a percentage based on the body size, not a world position.\r\n * @param {number} yOffsetA - The vertical offset of the BodyA constraint. This is a percentage based on the body size, not a world position.\r\n * @param {number} xOffsetB - The horizontal offset of the BodyB constraint. This is a percentage based on the body size, not a world position.\r\n * @param {number} yOffsetB - The vertical offset of the BodyB constraint. This is a percentage based on the body size, not a world position.\r\n * @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.\r\n *\r\n * @return {MatterJS.CompositeType} The original composite that was passed to this method.\r\n */\r\n chain: function (composite, xOffsetA, yOffsetA, xOffsetB, yOffsetB, options)\r\n {\r\n return Composites.chain(composite, xOffsetA, yOffsetA, xOffsetB, yOffsetB, options);\r\n },\r\n\r\n /**\r\n * Connects bodies in the composite with constraints in a grid pattern, with optional cross braces.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#mesh\r\n * @since 3.0.0\r\n *\r\n * @param {MatterJS.CompositeType} composite - The composite in which all bodies will be chained together.\r\n * @param {number} columns - The number of columns in the mesh.\r\n * @param {number} rows - The number of rows in the mesh.\r\n * @param {boolean} crossBrace - Create cross braces for the mesh as well?\r\n * @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.\r\n *\r\n * @return {MatterJS.CompositeType} The original composite that was passed to this method.\r\n */\r\n mesh: function (composite, columns, rows, crossBrace, options)\r\n {\r\n return Composites.mesh(composite, columns, rows, crossBrace, options);\r\n },\r\n\r\n /**\r\n * Creates a composite with a Newton's Cradle setup of bodies and constraints.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#newtonsCradle\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of the start of the cradle.\r\n * @param {number} y - The vertical position of the start of the cradle.\r\n * @param {number} number - The number of balls in the cradle.\r\n * @param {number} size - The radius of each ball in the cradle.\r\n * @param {number} length - The length of the 'string' the balls hang from.\r\n *\r\n * @return {MatterJS.CompositeType} A Newton's cradle composite.\r\n */\r\n newtonsCradle: function (x, y, number, size, length)\r\n {\r\n var composite = Composites.newtonsCradle(x, y, number, size, length);\r\n\r\n this.world.add(composite);\r\n\r\n return composite;\r\n },\r\n\r\n /**\r\n * Creates a composite with simple car setup of bodies and constraints.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#car\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of the car in the world.\r\n * @param {number} y - The vertical position of the car in the world.\r\n * @param {number} width - The width of the car chasis.\r\n * @param {number} height - The height of the car chasis.\r\n * @param {number} wheelSize - The radius of the car wheels.\r\n *\r\n * @return {MatterJS.CompositeType} A new composite car body.\r\n */\r\n car: function (x, y, width, height, wheelSize)\r\n {\r\n var composite = Composites.car(x, y, width, height, wheelSize);\r\n\r\n this.world.add(composite);\r\n\r\n return composite;\r\n },\r\n\r\n /**\r\n * Creates a simple soft body like object.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#softBody\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this composite in the world.\r\n * @param {number} y - The vertical position of this composite in the world.\r\n * @param {number} columns - The number of columns in the Composite.\r\n * @param {number} rows - The number of rows in the Composite.\r\n * @param {number} columnGap - The distance between each column.\r\n * @param {number} rowGap - The distance between each row.\r\n * @param {boolean} crossBrace - `true` to create cross braces between the bodies, or `false` to create just straight braces.\r\n * @param {number} particleRadius - The radius of this circlular composite.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [particleOptions] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n * @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [constraintOptions] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.\r\n *\r\n * @return {MatterJS.CompositeType} A new composite simple soft body.\r\n */\r\n softBody: function (x, y, columns, rows, columnGap, rowGap, crossBrace, particleRadius, particleOptions, constraintOptions)\r\n {\r\n var composite = Composites.softBody(x, y, columns, rows, columnGap, rowGap, crossBrace, particleRadius, particleOptions, constraintOptions);\r\n\r\n this.world.add(composite);\r\n\r\n return composite;\r\n },\r\n\r\n /**\r\n * This method is an alias for `Factory.constraint`.\r\n * \r\n * Constraints (or joints) are used for specifying that a fixed distance must be maintained\r\n * between two bodies, or a body and a fixed world-space position.\r\n * \r\n * The stiffness of constraints can be modified to create springs or elastic.\r\n * \r\n * To simulate a revolute constraint (or pin joint) set `length: 0` and a high `stiffness`\r\n * value (e.g. `0.7` or above).\r\n * \r\n * If the constraint is unstable, try lowering the `stiffness` value and / or increasing\r\n * `constraintIterations` within the Matter Config.\r\n * \r\n * For compound bodies, constraints must be applied to the parent body and not one of its parts.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#joint\r\n * @since 3.0.0\r\n *\r\n * @param {MatterJS.BodyType} bodyA - The first possible `Body` that this constraint is attached to.\r\n * @param {MatterJS.BodyType} bodyB - The second possible `Body` that this constraint is attached to.\r\n * @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`.\r\n * @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring.\r\n * @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.\r\n *\r\n * @return {MatterJS.ConstraintType} A Matter JS Constraint.\r\n */\r\n joint: function (bodyA, bodyB, length, stiffness, options)\r\n {\r\n return this.constraint(bodyA, bodyB, length, stiffness, options);\r\n },\r\n\r\n /**\r\n * This method is an alias for `Factory.constraint`.\r\n * \r\n * Constraints (or joints) are used for specifying that a fixed distance must be maintained\r\n * between two bodies, or a body and a fixed world-space position.\r\n * \r\n * The stiffness of constraints can be modified to create springs or elastic.\r\n * \r\n * To simulate a revolute constraint (or pin joint) set `length: 0` and a high `stiffness`\r\n * value (e.g. `0.7` or above).\r\n * \r\n * If the constraint is unstable, try lowering the `stiffness` value and / or increasing\r\n * `constraintIterations` within the Matter Config.\r\n * \r\n * For compound bodies, constraints must be applied to the parent body and not one of its parts.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#spring\r\n * @since 3.0.0\r\n *\r\n * @param {MatterJS.BodyType} bodyA - The first possible `Body` that this constraint is attached to.\r\n * @param {MatterJS.BodyType} bodyB - The second possible `Body` that this constraint is attached to.\r\n * @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`.\r\n * @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring.\r\n * @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.\r\n *\r\n * @return {MatterJS.ConstraintType} A Matter JS Constraint.\r\n */\r\n spring: function (bodyA, bodyB, length, stiffness, options)\r\n {\r\n return this.constraint(bodyA, bodyB, length, stiffness, options);\r\n },\r\n\r\n /**\r\n * Constraints (or joints) are used for specifying that a fixed distance must be maintained\r\n * between two bodies, or a body and a fixed world-space position.\r\n * \r\n * The stiffness of constraints can be modified to create springs or elastic.\r\n * \r\n * To simulate a revolute constraint (or pin joint) set `length: 0` and a high `stiffness`\r\n * value (e.g. `0.7` or above).\r\n * \r\n * If the constraint is unstable, try lowering the `stiffness` value and / or increasing\r\n * `constraintIterations` within the Matter Config.\r\n * \r\n * For compound bodies, constraints must be applied to the parent body and not one of its parts.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#constraint\r\n * @since 3.0.0\r\n *\r\n * @param {MatterJS.BodyType} bodyA - The first possible `Body` that this constraint is attached to.\r\n * @param {MatterJS.BodyType} bodyB - The second possible `Body` that this constraint is attached to.\r\n * @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`.\r\n * @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring.\r\n * @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.\r\n *\r\n * @return {MatterJS.ConstraintType} A Matter JS Constraint.\r\n */\r\n constraint: function (bodyA, bodyB, length, stiffness, options)\r\n {\r\n if (stiffness === undefined) { stiffness = 1; }\r\n if (options === undefined) { options = {}; }\r\n\r\n options.bodyA = (bodyA.type === 'body') ? bodyA : bodyA.body;\r\n options.bodyB = (bodyB.type === 'body') ? bodyB : bodyB.body;\r\n\r\n if (!isNaN(length))\r\n {\r\n options.length = length;\r\n }\r\n\r\n options.stiffness = stiffness;\r\n\r\n var constraint = Constraint.create(options);\r\n\r\n this.world.add(constraint);\r\n\r\n return constraint;\r\n },\r\n\r\n /**\r\n * Constraints (or joints) are used for specifying that a fixed distance must be maintained\r\n * between two bodies, or a body and a fixed world-space position.\r\n * \r\n * A world constraint has only one body, you should specify a `pointA` position in\r\n * the constraint options parameter to attach the constraint to the world.\r\n * \r\n * The stiffness of constraints can be modified to create springs or elastic.\r\n * \r\n * To simulate a revolute constraint (or pin joint) set `length: 0` and a high `stiffness`\r\n * value (e.g. `0.7` or above).\r\n * \r\n * If the constraint is unstable, try lowering the `stiffness` value and / or increasing\r\n * `constraintIterations` within the Matter Config.\r\n * \r\n * For compound bodies, constraints must be applied to the parent body and not one of its parts.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#worldConstraint\r\n * @since 3.0.0\r\n *\r\n * @param {MatterJS.BodyType} body - The Matter `Body` that this constraint is attached to.\r\n * @param {number} [length] - A number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`.\r\n * @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring.\r\n * @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.\r\n *\r\n * @return {MatterJS.ConstraintType} A Matter JS Constraint.\r\n */\r\n worldConstraint: function (body, length, stiffness, options)\r\n {\r\n if (stiffness === undefined) { stiffness = 1; }\r\n if (options === undefined) { options = {}; }\r\n\r\n options.bodyB = (body.type === 'body') ? body : body.body;\r\n\r\n if (!isNaN(length))\r\n {\r\n options.length = length;\r\n }\r\n\r\n options.stiffness = stiffness;\r\n\r\n var constraint = Constraint.create(options);\r\n\r\n this.world.add(constraint);\r\n\r\n return constraint;\r\n },\r\n\r\n /**\r\n * This method is an alias for `Factory.pointerConstraint`.\r\n * \r\n * A Pointer Constraint is a special type of constraint that allows you to click\r\n * and drag bodies in a Matter World. It monitors the active Pointers in a Scene,\r\n * and when one is pressed down it checks to see if that hit any part of any active\r\n * body in the world. If it did, and the body has input enabled, it will begin to\r\n * drag it until either released, or you stop it via the `stopDrag` method.\r\n * \r\n * You can adjust the stiffness, length and other properties of the constraint via\r\n * the `options` object on creation.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#mouseSpring\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.\r\n *\r\n * @return {MatterJS.ConstraintType} A Matter JS Constraint.\r\n */\r\n mouseSpring: function (options)\r\n {\r\n return this.pointerConstraint(options);\r\n },\r\n\r\n /**\r\n * A Pointer Constraint is a special type of constraint that allows you to click\r\n * and drag bodies in a Matter World. It monitors the active Pointers in a Scene,\r\n * and when one is pressed down it checks to see if that hit any part of any active\r\n * body in the world. If it did, and the body has input enabled, it will begin to\r\n * drag it until either released, or you stop it via the `stopDrag` method.\r\n * \r\n * You can adjust the stiffness, length and other properties of the constraint via\r\n * the `options` object on creation.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#pointerConstraint\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.\r\n *\r\n * @return {MatterJS.ConstraintType} A Matter JS Constraint.\r\n */\r\n pointerConstraint: function (options)\r\n {\r\n if (options === undefined) { options = {}; }\r\n\r\n if (!options.hasOwnProperty('render'))\r\n {\r\n options.render = { visible: false };\r\n }\r\n\r\n var pointerConstraint = new PointerConstraint(this.scene, this.world, options);\r\n\r\n this.world.add(pointerConstraint.constraint);\r\n\r\n return pointerConstraint;\r\n },\r\n\r\n /**\r\n * Creates a Matter Physics Image Game Object.\r\n * \r\n * An Image is a light-weight Game Object useful for the display of static images in your game,\r\n * such as logos, backgrounds, scenery or other non-animated elements. Images can have input\r\n * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an\r\n * Image and a Sprite is that you cannot animate an Image as they do not have the Animation component.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#image\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n *\r\n * @return {Phaser.Physics.Matter.Image} The Matter Image Game Object.\r\n */\r\n image: function (x, y, key, frame, options)\r\n {\r\n var image = new MatterImage(this.world, x, y, key, frame, options);\r\n\r\n this.sys.displayList.add(image);\r\n\r\n return image;\r\n },\r\n\r\n /**\r\n * Creates a wrapper around a Tile that provides access to a corresponding Matter body. A tile can only\r\n * have one Matter body associated with it. You can either pass in an existing Matter body for\r\n * the tile or allow the constructor to create the corresponding body for you. If the Tile has a\r\n * collision group (defined in Tiled), those shapes will be used to create the body. If not, the\r\n * tile's rectangle bounding box will be used.\r\n *\r\n * The corresponding body will be accessible on the Tile itself via Tile.physics.matterBody.\r\n *\r\n * Note: not all Tiled collision shapes are supported. See\r\n * Phaser.Physics.Matter.TileBody#setFromTileCollision for more information.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#tileBody\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tilemaps.Tile} tile - The target tile that should have a Matter body.\r\n * @param {Phaser.Types.Physics.Matter.MatterTileOptions} [options] - Options to be used when creating the Matter body.\r\n *\r\n * @return {Phaser.Physics.Matter.TileBody} The Matter Tile Body Game Object.\r\n */\r\n tileBody: function (tile, options)\r\n {\r\n return new MatterTileBody(this.world, tile, options);\r\n },\r\n\r\n /**\r\n * Creates a Matter Physics Sprite Game Object.\r\n *\r\n * A Sprite Game Object is used for the display of both static and animated images in your game.\r\n * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled\r\n * and animated.\r\n *\r\n * The main difference between a Sprite and an Image Game Object is that you cannot animate Images.\r\n * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation\r\n * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#sprite\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n *\r\n * @return {Phaser.Physics.Matter.Sprite} The Matter Sprite Game Object.\r\n */\r\n sprite: function (x, y, key, frame, options)\r\n {\r\n var sprite = new MatterSprite(this.world, x, y, key, frame, options);\r\n\r\n this.sys.displayList.add(sprite);\r\n this.sys.updateList.add(sprite);\r\n\r\n return sprite;\r\n },\r\n\r\n /**\r\n * Takes an existing Game Object and injects all of the Matter Components into it.\r\n * \r\n * This enables you to use component methods such as `setVelocity` or `isSensor` directly from\r\n * this Game Object.\r\n * \r\n * You can also pass in either a Matter Body Configuration object, or a Matter Body instance\r\n * to link with this Game Object.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#gameObject\r\n * @since 3.3.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to inject the Matter Components in to.\r\n * @param {(Phaser.Types.Physics.Matter.MatterBodyConfig|MatterJS.Body)} [options] - A Matter Body configuration object, or an instance of a Matter Body.\r\n * @param {boolean} [addToWorld=true] - Add this Matter Body to the World?\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that had the Matter Components injected into it.\r\n */\r\n gameObject: function (gameObject, options, addToWorld)\r\n {\r\n return MatterGameObject(this.world, gameObject, options, addToWorld);\r\n },\r\n\r\n /**\r\n * Destroys this Factory.\r\n *\r\n * @method Phaser.Physics.Matter.Factory#destroy\r\n * @since 3.5.0\r\n */\r\n destroy: function ()\r\n {\r\n this.world = null;\r\n this.scene = null;\r\n this.sys = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Factory;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/Factory.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/MatterGameObject.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/MatterGameObject.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Components = __webpack_require__(/*! ./components */ \"./node_modules/phaser/src/physics/matter-js/components/index.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * Internal function to check if the object has a getter or setter.\r\n *\r\n * @function hasGetterOrSetter\r\n * @private\r\n *\r\n * @param {object} def - The object to check.\r\n *\r\n * @return {boolean} True if it has a getter or setter, otherwise false.\r\n */\r\nfunction hasGetterOrSetter (def)\r\n{\r\n return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function');\r\n}\r\n\r\n/**\r\n * A Matter Game Object is a generic object that allows you to combine any Phaser Game Object,\r\n * including those you have extended or created yourself, with all of the Matter Components.\r\n * \r\n * This enables you to use component methods such as `setVelocity` or `isSensor` directly from\r\n * this Game Object.\r\n *\r\n * @function Phaser.Physics.Matter.MatterGameObject\r\n * @since 3.3.0\r\n *\r\n * @param {Phaser.Physics.Matter.World} world - The Matter world to add the body to.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will have the Matter body applied to it.\r\n * @param {(Phaser.Types.Physics.Matter.MatterBodyConfig|MatterJS.Body)} [options] - A Matter Body configuration object, or an instance of a Matter Body.\r\n * @param {boolean} [addToWorld=true] - Should the newly created body be immediately added to the World?\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object that was created with the Matter body.\r\n */\r\nvar MatterGameObject = function (world, gameObject, options, addToWorld)\r\n{\r\n if (options === undefined) { options = {}; }\r\n if (addToWorld === undefined) { addToWorld = true; }\r\n\r\n var x = gameObject.x;\r\n var y = gameObject.y;\r\n\r\n // Temp body pos to avoid body null checks\r\n gameObject.body = {\r\n temp: true,\r\n position: {\r\n x: x,\r\n y: y\r\n }\r\n };\r\n\r\n var mixins = [\r\n Components.Bounce,\r\n Components.Collision,\r\n Components.Force,\r\n Components.Friction,\r\n Components.Gravity,\r\n Components.Mass,\r\n Components.Sensor,\r\n Components.SetBody,\r\n Components.Sleep,\r\n Components.Static,\r\n Components.Transform,\r\n Components.Velocity\r\n ];\r\n\r\n // First let's inject all of the components into the Game Object\r\n mixins.forEach(function (mixin)\r\n {\r\n for (var key in mixin)\r\n {\r\n if (hasGetterOrSetter(mixin[key]))\r\n {\r\n Object.defineProperty(gameObject, key, {\r\n get: mixin[key].get,\r\n set: mixin[key].set\r\n });\r\n }\r\n else\r\n {\r\n Object.defineProperty(gameObject, key, {value: mixin[key]});\r\n }\r\n }\r\n\r\n });\r\n\r\n gameObject.world = world;\r\n\r\n gameObject._tempVec2 = new Vector2(x, y);\r\n\r\n if (options.hasOwnProperty('type') && options.type === 'body')\r\n {\r\n gameObject.setExistingBody(options, addToWorld);\r\n }\r\n else\r\n {\r\n var shape = GetFastValue(options, 'shape', null);\r\n\r\n if (!shape)\r\n {\r\n shape = 'rectangle';\r\n }\r\n\r\n options.addToWorld = addToWorld;\r\n \r\n gameObject.setBody(shape, options);\r\n }\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = MatterGameObject;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/MatterGameObject.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/MatterImage.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/MatterImage.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ./components */ \"./node_modules/phaser/src/physics/matter-js/components/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../../gameobjects/GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar Image = __webpack_require__(/*! ../../gameobjects/image/Image */ \"./node_modules/phaser/src/gameobjects/image/Image.js\");\r\nvar Pipeline = __webpack_require__(/*! ../../gameobjects/components/Pipeline */ \"./node_modules/phaser/src/gameobjects/components/Pipeline.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Matter Physics Image Game Object.\r\n * \r\n * An Image is a light-weight Game Object useful for the display of static images in your game,\r\n * such as logos, backgrounds, scenery or other non-animated elements. Images can have input\r\n * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an\r\n * Image and a Sprite is that you cannot animate an Image as they do not have the Animation component.\r\n *\r\n * @class Image\r\n * @extends Phaser.GameObjects.Image\r\n * @memberof Phaser.Physics.Matter\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.Physics.Matter.Components.Bounce\r\n * @extends Phaser.Physics.Matter.Components.Collision\r\n * @extends Phaser.Physics.Matter.Components.Force\r\n * @extends Phaser.Physics.Matter.Components.Friction\r\n * @extends Phaser.Physics.Matter.Components.Gravity\r\n * @extends Phaser.Physics.Matter.Components.Mass\r\n * @extends Phaser.Physics.Matter.Components.Sensor\r\n * @extends Phaser.Physics.Matter.Components.SetBody\r\n * @extends Phaser.Physics.Matter.Components.Sleep\r\n * @extends Phaser.Physics.Matter.Components.Static\r\n * @extends Phaser.Physics.Matter.Components.Transform\r\n * @extends Phaser.Physics.Matter.Components.Velocity\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Size\r\n * @extends Phaser.GameObjects.Components.Texture\r\n * @extends Phaser.GameObjects.Components.Tint\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Physics.Matter.World} world - A reference to the Matter.World instance that this body belongs to.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n */\r\nvar MatterImage = new Class({\r\n\r\n Extends: Image,\r\n\r\n Mixins: [\r\n Components.Bounce,\r\n Components.Collision,\r\n Components.Force,\r\n Components.Friction,\r\n Components.Gravity,\r\n Components.Mass,\r\n Components.Sensor,\r\n Components.SetBody,\r\n Components.Sleep,\r\n Components.Static,\r\n Components.Transform,\r\n Components.Velocity,\r\n Pipeline\r\n ],\r\n\r\n initialize:\r\n\r\n function MatterImage (world, x, y, texture, frame, options)\r\n {\r\n GameObject.call(this, world.scene, 'Image');\r\n\r\n this.setTexture(texture, frame);\r\n this.setSizeToFrame();\r\n this.setOrigin();\r\n\r\n /**\r\n * A reference to the Matter.World instance that this body belongs to.\r\n *\r\n * @name Phaser.Physics.Matter.Image#world\r\n * @type {Phaser.Physics.Matter.World}\r\n * @since 3.0.0\r\n */\r\n this.world = world;\r\n\r\n /**\r\n * An internal temp vector used for velocity and force calculations.\r\n *\r\n * @name Phaser.Physics.Matter.Image#_tempVec2\r\n * @type {Phaser.Math.Vector2}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._tempVec2 = new Vector2(x, y);\r\n\r\n var shape = GetFastValue(options, 'shape', null);\r\n\r\n if (shape)\r\n {\r\n this.setBody(shape, options);\r\n }\r\n else\r\n {\r\n this.setRectangle(this.width, this.height, options);\r\n }\r\n\r\n this.setPosition(x, y);\r\n\r\n this.initPipeline('TextureTintPipeline');\r\n }\r\n\r\n});\r\n\r\nmodule.exports = MatterImage;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/MatterImage.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/MatterPhysics.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/MatterPhysics.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ALIGN_CONST = __webpack_require__(/*! ../../display/align/const */ \"./node_modules/phaser/src/display/align/const.js\");\r\nvar Axes = __webpack_require__(/*! ./lib/geometry/Axes */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Axes.js\");\r\nvar Bodies = __webpack_require__(/*! ./lib/factory/Bodies */ \"./node_modules/phaser/src/physics/matter-js/lib/factory/Bodies.js\");\r\nvar Body = __webpack_require__(/*! ./lib/body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\nvar BodyBounds = __webpack_require__(/*! ./BodyBounds */ \"./node_modules/phaser/src/physics/matter-js/BodyBounds.js\");\r\nvar Bounds = __webpack_require__(/*! ./lib/geometry/Bounds */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Bounds.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Composite = __webpack_require__(/*! ./lib/body/Composite */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Composite.js\");\r\nvar Composites = __webpack_require__(/*! ./lib/factory/Composites */ \"./node_modules/phaser/src/physics/matter-js/lib/factory/Composites.js\");\r\nvar Constraint = __webpack_require__(/*! ./lib/constraint/Constraint */ \"./node_modules/phaser/src/physics/matter-js/lib/constraint/Constraint.js\");\r\nvar Detector = __webpack_require__(/*! ./lib/collision/Detector */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Detector.js\");\r\nvar DistanceBetween = __webpack_require__(/*! ../../math/distance/DistanceBetween */ \"./node_modules/phaser/src/math/distance/DistanceBetween.js\");\r\nvar Factory = __webpack_require__(/*! ./Factory */ \"./node_modules/phaser/src/physics/matter-js/Factory.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar Grid = __webpack_require__(/*! ./lib/collision/Grid */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Grid.js\");\r\nvar MatterAttractors = __webpack_require__(/*! ./lib/plugins/MatterAttractors */ \"./node_modules/phaser/src/physics/matter-js/lib/plugins/MatterAttractors.js\");\r\nvar MatterCollisionEvents = __webpack_require__(/*! ./lib/plugins/MatterCollisionEvents */ \"./node_modules/phaser/src/physics/matter-js/lib/plugins/MatterCollisionEvents.js\");\r\nvar MatterLib = __webpack_require__(/*! ./lib/core/Matter */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Matter.js\");\r\nvar MatterWrap = __webpack_require__(/*! ./lib/plugins/MatterWrap */ \"./node_modules/phaser/src/physics/matter-js/lib/plugins/MatterWrap.js\");\r\nvar Merge = __webpack_require__(/*! ../../utils/object/Merge */ \"./node_modules/phaser/src/utils/object/Merge.js\");\r\nvar Pair = __webpack_require__(/*! ./lib/collision/Pair */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Pair.js\");\r\nvar Pairs = __webpack_require__(/*! ./lib/collision/Pairs */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Pairs.js\");\r\nvar Plugin = __webpack_require__(/*! ./lib/core/Plugin */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Plugin.js\");\r\nvar PluginCache = __webpack_require__(/*! ../../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar Query = __webpack_require__(/*! ./lib/collision/Query */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Query.js\");\r\nvar Resolver = __webpack_require__(/*! ./lib/collision/Resolver */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Resolver.js\");\r\nvar SAT = __webpack_require__(/*! ./lib/collision/SAT */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/SAT.js\");\r\nvar SceneEvents = __webpack_require__(/*! ../../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\nvar Svg = __webpack_require__(/*! ./lib/geometry/Svg */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Svg.js\");\r\nvar Vector = __webpack_require__(/*! ./lib/geometry/Vector */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vector.js\");\r\nvar Vertices = __webpack_require__(/*! ./lib/geometry/Vertices */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js\");\r\nvar World = __webpack_require__(/*! ./World */ \"./node_modules/phaser/src/physics/matter-js/World.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Phaser Matter plugin provides the ability to use the Matter JS Physics Engine within your Phaser games.\r\n * \r\n * Unlike Arcade Physics, the other physics system provided with Phaser, Matter JS is a full-body physics system.\r\n * It features:\r\n * \r\n * * Rigid bodies\r\n * * Compound bodies\r\n * * Composite bodies\r\n * * Concave and convex hulls\r\n * * Physical properties (mass, area, density etc.)\r\n * * Restitution (elastic and inelastic collisions)\r\n * * Collisions (broad-phase, mid-phase and narrow-phase)\r\n * * Stable stacking and resting\r\n * * Conservation of momentum\r\n * * Friction and resistance\r\n * * Constraints\r\n * * Gravity\r\n * * Sleeping and static bodies\r\n * * Rounded corners (chamfering)\r\n * * Views (translate, zoom)\r\n * * Collision queries (raycasting, region tests)\r\n * * Time scaling (slow-mo, speed-up)\r\n * \r\n * Configuration of Matter is handled via the Matter World Config object, which can be passed in either the\r\n * Phaser Game Config, or Phaser Scene Config. Here is a basic example:\r\n * \r\n * ```js\r\n * physics: {\r\n * default: 'matter',\r\n * matter: {\r\n * enableSleeping: true,\r\n * gravity: {\r\n * y: 0\r\n * },\r\n * debug: {\r\n * showBody: true,\r\n * showStaticBody: true\r\n * }\r\n * }\r\n * }\r\n * ```\r\n * \r\n * This class acts as an interface between a Phaser Scene and a single instance of the Matter Engine.\r\n * \r\n * Use it to access the most common Matter features and helper functions.\r\n * \r\n * You can find details, documentation and examples on the Matter JS website: https://brm.io/matter-js/\r\n *\r\n * @class MatterPhysics\r\n * @memberof Phaser.Physics.Matter\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Phaser Scene that owns this Matter Physics instance.\r\n */\r\nvar MatterPhysics = new Class({\r\n\r\n initialize:\r\n\r\n function MatterPhysics (scene)\r\n {\r\n /**\r\n * The Phaser Scene that owns this Matter Physics instance\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A reference to the Scene Systems that belong to the Scene owning this Matter Physics instance.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n /**\r\n * The parsed Matter Configuration object.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#config\r\n * @type {Phaser.Types.Physics.Matter.MatterWorldConfig}\r\n * @since 3.0.0\r\n */\r\n this.config = this.getConfig();\r\n\r\n /**\r\n * An instance of the Matter World class. This class is responsible for the updating of the\r\n * Matter Physics world, as well as handling debug drawing functions.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#world\r\n * @type {Phaser.Physics.Matter.World}\r\n * @since 3.0.0\r\n */\r\n this.world;\r\n\r\n /**\r\n * An instance of the Matter Factory. This class provides lots of functions for creating a\r\n * wide variety of physics objects and adds them automatically to the Matter World.\r\n * \r\n * You can use this class to cut-down on the amount of code required in your game, however,\r\n * use of the Factory is entirely optional and should be seen as a development aid. It's\r\n * perfectly possible to create and add components to the Matter world without using it.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#add\r\n * @type {Phaser.Physics.Matter.Factory}\r\n * @since 3.0.0\r\n */\r\n this.add;\r\n\r\n /**\r\n * An instance of the Body Bounds class. This class contains functions used for getting the\r\n * world position from various points around the bounds of a physics body.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#bodyBounds\r\n * @type {Phaser.Physics.Matter.BodyBounds}\r\n * @since 3.22.0\r\n */\r\n this.bodyBounds;\r\n\r\n // Body\r\n\r\n /**\r\n * A reference to the `Matter.Body` module.\r\n * \r\n * The `Matter.Body` module contains methods for creating and manipulating body models.\r\n * A `Matter.Body` is a rigid body that can be simulated by a `Matter.Engine`.\r\n * Factories for commonly used body configurations (such as rectangles, circles and other polygons) can be found in the `Bodies` module.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#body\r\n * @type {MatterJS.BodyFactory}\r\n * @since 3.18.0\r\n */\r\n this.body = Body;\r\n\r\n /**\r\n * A reference to the `Matter.Composite` module.\r\n * \r\n * The `Matter.Composite` module contains methods for creating and manipulating composite bodies.\r\n * A composite body is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`, therefore composites form a tree structure.\r\n * It is important to use the functions in this module to modify composites, rather than directly modifying their properties.\r\n * Note that the `Matter.World` object is also a type of `Matter.Composite` and as such all composite methods here can also operate on a `Matter.World`.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#composite\r\n * @type {MatterJS.CompositeFactory}\r\n * @since 3.22.0\r\n */\r\n this.composite = Composite;\r\n\r\n // Collision:\r\n\r\n /**\r\n * A reference to the `Matter.Detector` module.\r\n * \r\n * The `Matter.Detector` module contains methods for detecting collisions given a set of pairs.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#detector\r\n * @type {MatterJS.DetectorFactory}\r\n * @since 3.22.0\r\n */\r\n this.detector = Detector;\r\n\r\n /**\r\n * A reference to the `Matter.Grid` module.\r\n * \r\n * The `Matter.Grid` module contains methods for creating and manipulating collision broadphase grid structures.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#grid\r\n * @type {MatterJS.GridFactory}\r\n * @since 3.22.0\r\n */\r\n this.grid = Grid;\r\n\r\n /**\r\n * A reference to the `Matter.Pair` module.\r\n * \r\n * The `Matter.Pair` module contains methods for creating and manipulating collision pairs.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#pair\r\n * @type {MatterJS.PairFactory}\r\n * @since 3.22.0\r\n */\r\n this.pair = Pair;\r\n\r\n /**\r\n * A reference to the `Matter.Pairs` module.\r\n * \r\n * The `Matter.Pairs` module contains methods for creating and manipulating collision pair sets.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#pairs\r\n * @type {MatterJS.PairsFactory}\r\n * @since 3.22.0\r\n */\r\n this.pairs = Pairs;\r\n\r\n /**\r\n * A reference to the `Matter.Query` module.\r\n * \r\n * The `Matter.Query` module contains methods for performing collision queries.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#query\r\n * @type {MatterJS.QueryFactory}\r\n * @since 3.22.0\r\n */\r\n this.query = Query;\r\n\r\n /**\r\n * A reference to the `Matter.Resolver` module.\r\n * \r\n * The `Matter.Resolver` module contains methods for resolving collision pairs.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#resolver\r\n * @type {MatterJS.ResolverFactory}\r\n * @since 3.22.0\r\n */\r\n this.resolver = Resolver;\r\n\r\n /**\r\n * A reference to the `Matter.SAT` module.\r\n * \r\n * The `Matter.SAT` module contains methods for detecting collisions using the Separating Axis Theorem.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#sat\r\n * @type {MatterJS.SATFactory}\r\n * @since 3.22.0\r\n */\r\n this.sat = SAT;\r\n\r\n // Constraint\r\n\r\n /**\r\n * A reference to the `Matter.Constraint` module.\r\n * \r\n * The `Matter.Constraint` module contains methods for creating and manipulating constraints.\r\n * Constraints are used for specifying that a fixed distance must be maintained between two bodies (or a body and a fixed world-space position).\r\n * The stiffness of constraints can be modified to create springs or elastic.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#constraint\r\n * @type {MatterJS.ConstraintFactory}\r\n * @since 3.22.0\r\n */\r\n this.constraint = Constraint;\r\n\r\n // Factory\r\n\r\n /**\r\n * A reference to the `Matter.Bodies` module.\r\n * \r\n * The `Matter.Bodies` module contains factory methods for creating rigid bodies\r\n * with commonly used body configurations (such as rectangles, circles and other polygons).\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#bodies\r\n * @type {MatterJS.BodiesFactory}\r\n * @since 3.18.0\r\n */\r\n this.bodies = Bodies;\r\n\r\n /**\r\n * A reference to the `Matter.Composites` module.\r\n * \r\n * The `Matter.Composites` module contains factory methods for creating composite bodies\r\n * with commonly used configurations (such as stacks and chains).\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#composites\r\n * @type {MatterJS.CompositesFactory}\r\n * @since 3.22.0\r\n */\r\n this.composites = Composites;\r\n\r\n // Geometry\r\n\r\n /**\r\n * A reference to the `Matter.Axes` module.\r\n * \r\n * The `Matter.Axes` module contains methods for creating and manipulating sets of axes.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#axes\r\n * @type {MatterJS.AxesFactory}\r\n * @since 3.22.0\r\n */\r\n this.axes = Axes;\r\n\r\n /**\r\n * A reference to the `Matter.Bounds` module.\r\n * \r\n * The `Matter.Bounds` module contains methods for creating and manipulating axis-aligned bounding boxes (AABB).\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#bounds\r\n * @type {MatterJS.BoundsFactory}\r\n * @since 3.22.0\r\n */\r\n this.bounds = Bounds;\r\n\r\n /**\r\n * A reference to the `Matter.Svg` module.\r\n * \r\n * The `Matter.Svg` module contains methods for converting SVG images into an array of vector points.\r\n *\r\n * To use this module you also need the SVGPathSeg polyfill: https://github.com/progers/pathseg\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#svg\r\n * @type {MatterJS.SvgFactory}\r\n * @since 3.22.0\r\n */\r\n this.svg = Svg;\r\n\r\n /**\r\n * A reference to the `Matter.Vector` module.\r\n * \r\n * The `Matter.Vector` module contains methods for creating and manipulating vectors.\r\n * Vectors are the basis of all the geometry related operations in the engine.\r\n * A `Matter.Vector` object is of the form `{ x: 0, y: 0 }`.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#vector\r\n * @type {MatterJS.VectorFactory}\r\n * @since 3.22.0\r\n */\r\n this.vector = Vector;\r\n\r\n /**\r\n * A reference to the `Matter.Vertices` module.\r\n * \r\n * The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices.\r\n * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`.\r\n * A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull).\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#vertices\r\n * @type {MatterJS.VerticesFactory}\r\n * @since 3.22.0\r\n */\r\n this.vertices = Vertices;\r\n\r\n /**\r\n * A reference to the `Matter.Vertices` module.\r\n * \r\n * The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices.\r\n * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`.\r\n * A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull).\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#verts\r\n * @type {MatterJS.VerticesFactory}\r\n * @since 3.14.0\r\n */\r\n this.verts = Vertices;\r\n\r\n /**\r\n * An internal temp vector used for velocity and force calculations.\r\n *\r\n * @name Phaser.Physics.Matter.MatterPhysics#_tempVec2\r\n * @type {MatterJS.Vector}\r\n * @private\r\n * @since 3.22.0\r\n */\r\n this._tempVec2 = Vector.create();\r\n\r\n // Matter plugins\r\n\r\n if (GetValue(this.config, 'plugins.collisionevents', true))\r\n {\r\n this.enableCollisionEventsPlugin();\r\n }\r\n\r\n if (GetValue(this.config, 'plugins.attractors', false))\r\n {\r\n this.enableAttractorPlugin();\r\n }\r\n\r\n if (GetValue(this.config, 'plugins.wrap', false))\r\n {\r\n this.enableWrapPlugin();\r\n }\r\n\r\n Resolver._restingThresh = GetValue(this.config, 'restingThresh', 4);\r\n Resolver._restingThreshTangent = GetValue(this.config, 'restingThreshTangent', 6);\r\n Resolver._positionDampen = GetValue(this.config, 'positionDampen', 0.9);\r\n Resolver._positionWarming = GetValue(this.config, 'positionWarming', 0.8);\r\n Resolver._frictionNormalMultiplier = GetValue(this.config, 'frictionNormalMultiplier', 5);\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n scene.sys.events.on(SceneEvents.START, this.start, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#boot\r\n * @private\r\n * @since 3.5.1\r\n */\r\n boot: function ()\r\n {\r\n this.world = new World(this.scene, this.config);\r\n this.add = new Factory(this.world);\r\n this.bodyBounds = new BodyBounds();\r\n\r\n this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#start\r\n * @private\r\n * @since 3.5.0\r\n */\r\n start: function ()\r\n {\r\n if (!this.world)\r\n {\r\n this.world = new World(this.scene, this.config);\r\n this.add = new Factory(this.world);\r\n }\r\n\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.on(SceneEvents.UPDATE, this.world.update, this.world);\r\n eventEmitter.on(SceneEvents.POST_UPDATE, this.world.postUpdate, this.world);\r\n eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * This internal method is called when this class starts and retrieves the final Matter World Config.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#getConfig\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Types.Physics.Matter.MatterWorldConfig} The Matter World Config.\r\n */\r\n getConfig: function ()\r\n {\r\n var gameConfig = this.systems.game.config.physics;\r\n var sceneConfig = this.systems.settings.physics;\r\n\r\n var config = Merge(\r\n GetFastValue(sceneConfig, 'matter', {}),\r\n GetFastValue(gameConfig, 'matter', {})\r\n );\r\n\r\n return config;\r\n },\r\n\r\n /**\r\n * Enables the Matter Attractors Plugin.\r\n * \r\n * The attractors plugin that makes it easy to apply continual forces on bodies.\r\n * It's possible to simulate effects such as wind, gravity and magnetism.\r\n * \r\n * https://github.com/liabru/matter-attractors\r\n * \r\n * This method is called automatically if `plugins.attractors` is set in the Matter World Config.\r\n * However, you can also call it directly from within your game.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#enableAttractorPlugin\r\n * @since 3.0.0\r\n * \r\n * @return {this} This Matter Physics instance.\r\n */\r\n enableAttractorPlugin: function ()\r\n {\r\n Plugin.register(MatterAttractors);\r\n Plugin.use(MatterLib, MatterAttractors);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Enables the Matter Wrap Plugin.\r\n * \r\n * The coordinate wrapping plugin that automatically wraps the position of bodies such that they always stay\r\n * within the given bounds. Upon crossing a boundary the body will appear on the opposite side of the bounds,\r\n * while maintaining its velocity.\r\n * \r\n * https://github.com/liabru/matter-wrap\r\n * \r\n * This method is called automatically if `plugins.wrap` is set in the Matter World Config.\r\n * However, you can also call it directly from within your game.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#enableWrapPlugin\r\n * @since 3.0.0\r\n * \r\n * @return {this} This Matter Physics instance.\r\n */\r\n enableWrapPlugin: function ()\r\n {\r\n Plugin.register(MatterWrap);\r\n Plugin.use(MatterLib, MatterWrap);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Enables the Matter Collision Events Plugin.\r\n * \r\n * Note that this plugin is enabled by default. So you should only ever need to call this\r\n * method if you have specifically disabled the plugin in your Matter World Config.\r\n * You can disable it by setting `plugins.collisionevents: false` in your Matter World Config.\r\n * \r\n * This plugin triggers three new events on Matter.Body:\r\n * \r\n * 1. `onCollide`\r\n * 2. `onCollideEnd`\r\n * 3. `onCollideActive`\r\n * \r\n * These events correspond to the Matter.js events `collisionStart`, `collisionActive` and `collisionEnd`, respectively.\r\n * You can listen to these events via Matter.Events or they will also be emitted from the Matter World.\r\n * \r\n * This plugin also extends Matter.Body with three convenience functions:\r\n * \r\n * `Matter.Body.setOnCollide(callback)`\r\n * `Matter.Body.setOnCollideEnd(callback)`\r\n * `Matter.Body.setOnCollideActive(callback)`\r\n * \r\n * You can register event callbacks by providing a function of type (pair: Matter.Pair) => void\r\n * \r\n * https://github.com/dxu/matter-collision-events\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#enableCollisionEventsPlugin\r\n * @since 3.22.0\r\n * \r\n * @return {this} This Matter Physics instance.\r\n */\r\n enableCollisionEventsPlugin: function ()\r\n {\r\n Plugin.register(MatterCollisionEvents);\r\n Plugin.use(MatterLib, MatterCollisionEvents);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Pauses the Matter World instance and sets `enabled` to `false`.\r\n * \r\n * A paused world will not run any simulations for the duration it is paused.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#pause\r\n * @fires Phaser.Physics.Matter.Events#PAUSE\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Physics.Matter.World} The Matter World object.\r\n */\r\n pause: function ()\r\n {\r\n return this.world.pause();\r\n },\r\n\r\n /**\r\n * Resumes this Matter World instance from a paused state and sets `enabled` to `true`.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#resume\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Physics.Matter.World} The Matter World object.\r\n */\r\n resume: function ()\r\n {\r\n return this.world.resume();\r\n },\r\n\r\n /**\r\n * Sets the Matter Engine to run at fixed timestep of 60Hz and enables `autoUpdate`.\r\n * If you have set a custom `getDelta` function then this will override it.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#set60Hz\r\n * @since 3.4.0\r\n *\r\n * @return {this} This Matter Physics instance.\r\n */\r\n set60Hz: function ()\r\n {\r\n this.world.getDelta = this.world.update60Hz;\r\n this.world.autoUpdate = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the Matter Engine to run at fixed timestep of 30Hz and enables `autoUpdate`.\r\n * If you have set a custom `getDelta` function then this will override it.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#set30Hz\r\n * @since 3.4.0\r\n *\r\n * @return {this} This Matter Physics instance.\r\n */\r\n set30Hz: function ()\r\n {\r\n this.world.getDelta = this.world.update30Hz;\r\n this.world.autoUpdate = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Manually advances the physics simulation by one iteration.\r\n * \r\n * You can optionally pass in the `delta` and `correction` values to be used by Engine.update.\r\n * If undefined they use the Matter defaults of 60Hz and no correction.\r\n * \r\n * Calling `step` directly bypasses any checks of `enabled` or `autoUpdate`.\r\n * \r\n * It also ignores any custom `getDelta` functions, as you should be passing the delta\r\n * value in to this call.\r\n *\r\n * You can adjust the number of iterations that Engine.update performs internally.\r\n * Use the Scene Matter Physics config object to set the following properties:\r\n *\r\n * positionIterations (defaults to 6)\r\n * velocityIterations (defaults to 4)\r\n * constraintIterations (defaults to 2)\r\n *\r\n * Adjusting these values can help performance in certain situations, depending on the physics requirements\r\n * of your game.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#step\r\n * @since 3.4.0\r\n *\r\n * @param {number} [delta=16.666] - The delta value.\r\n * @param {number} [correction=1] - Optional delta correction value.\r\n */\r\n step: function (delta, correction)\r\n {\r\n this.world.step(delta, correction);\r\n },\r\n\r\n /**\r\n * Checks if the vertices of the given body, or an array of bodies, contains the given point, or not.\r\n * \r\n * You can pass in either a single body, or an array of bodies to be checked. This method will\r\n * return `true` if _any_ of the bodies in the array contain the point. See the `intersectPoint` method if you need\r\n * to get a list of intersecting bodies.\r\n * \r\n * The point should be transformed into the Matter World coordinate system in advance. This happens by\r\n * default with Input Pointers, but if you wish to use points from another system you may need to\r\n * transform them before passing them.\r\n * \r\n * @method Phaser.Physics.Matter.MatterPhysics#containsPoint\r\n * @since 3.22.0\r\n *\r\n * @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} body - The body, or an array of bodies, to check against the point.\r\n * @param {number} x - The horizontal coordinate of the point.\r\n * @param {number} y - The vertical coordinate of the point.\r\n * \r\n * @return {boolean} `true` if the point is within one of the bodies given, otherwise `false`.\r\n */\r\n containsPoint: function (body, x, y)\r\n {\r\n body = this.getMatterBodies(body);\r\n\r\n var position = Vector.create(x, y);\r\n\r\n var result = Query.point(body, position);\r\n\r\n return (result.length > 0) ? true : false;\r\n },\r\n\r\n /**\r\n * Checks the given coordinates to see if any vertices of the given bodies contain it.\r\n * \r\n * If no bodies are provided it will search all bodies in the Matter World, including within Composites.\r\n * \r\n * The coordinates should be transformed into the Matter World coordinate system in advance. This happens by\r\n * default with Input Pointers, but if you wish to use coordinates from another system you may need to\r\n * transform them before passing them.\r\n * \r\n * @method Phaser.Physics.Matter.MatterPhysics#intersectPoint\r\n * @since 3.22.0\r\n *\r\n * @param {number} x - The horizontal coordinate of the point.\r\n * @param {number} y - The vertical coordinate of the point.\r\n * @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - An array of bodies to check. If not provided it will search all bodies in the world.\r\n * \r\n * @return {Phaser.Types.Physics.Matter.MatterBody[]} An array of bodies which contain the given point.\r\n */\r\n intersectPoint: function (x, y, bodies)\r\n {\r\n bodies = this.getMatterBodies(bodies);\r\n\r\n var position = Vector.create(x, y);\r\n\r\n var output = [];\r\n\r\n var result = Query.point(bodies, position);\r\n\r\n result.forEach(function (body)\r\n {\r\n if (output.indexOf(body) === -1)\r\n {\r\n output.push(body);\r\n }\r\n });\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Checks the given rectangular area to see if any vertices of the given bodies intersect with it.\r\n * Or, if the `outside` parameter is set to `true`, it checks to see which bodies do not\r\n * intersect with it.\r\n * \r\n * If no bodies are provided it will search all bodies in the Matter World, including within Composites.\r\n * \r\n * @method Phaser.Physics.Matter.MatterPhysics#intersectRect\r\n * @since 3.22.0\r\n *\r\n * @param {number} x - The horizontal coordinate of the top-left of the area.\r\n * @param {number} y - The vertical coordinate of the top-left of the area.\r\n * @param {number} width - The width of the area.\r\n * @param {number} height - The height of the area.\r\n * @param {boolean} [outside=false] - If `false` it checks for vertices inside the area, if `true` it checks for vertices outside the area.\r\n * @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - An array of bodies to check. If not provided it will search all bodies in the world.\r\n * \r\n * @return {Phaser.Types.Physics.Matter.MatterBody[]} An array of bodies that intersect with the given area.\r\n */\r\n intersectRect: function (x, y, width, height, outside, bodies)\r\n {\r\n if (outside === undefined) { outside = false; }\r\n\r\n bodies = this.getMatterBodies(bodies);\r\n\r\n var bounds = {\r\n min: { x: x, y: y },\r\n max: { x: x + width, y: y + height }\r\n };\r\n\r\n var output = [];\r\n\r\n var result = Query.region(bodies, bounds, outside);\r\n\r\n result.forEach(function (body)\r\n {\r\n if (output.indexOf(body) === -1)\r\n {\r\n output.push(body);\r\n }\r\n });\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Checks the given ray segment to see if any vertices of the given bodies intersect with it.\r\n * \r\n * If no bodies are provided it will search all bodies in the Matter World.\r\n * \r\n * The width of the ray can be specified via the `rayWidth` parameter.\r\n * \r\n * @method Phaser.Physics.Matter.MatterPhysics#intersectRay\r\n * @since 3.22.0\r\n *\r\n * @param {number} x1 - The horizontal coordinate of the start of the ray segment.\r\n * @param {number} y1 - The vertical coordinate of the start of the ray segment.\r\n * @param {number} x2 - The horizontal coordinate of the end of the ray segment.\r\n * @param {number} y2 - The vertical coordinate of the end of the ray segment.\r\n * @param {number} [rayWidth=1] - The width of the ray segment.\r\n * @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - An array of bodies to check. If not provided it will search all bodies in the world.\r\n * \r\n * @return {Phaser.Types.Physics.Matter.MatterBody[]} An array of bodies whos vertices intersect with the ray segment.\r\n */\r\n intersectRay: function (x1, y1, x2, y2, rayWidth, bodies)\r\n {\r\n if (rayWidth === undefined) { rayWidth = 1; }\r\n \r\n bodies = this.getMatterBodies(bodies);\r\n\r\n var result = [];\r\n var collisions = Query.ray(bodies, Vector.create(x1, y1), Vector.create(x2, y2), rayWidth);\r\n\r\n for (var i = 0; i < collisions.length; i++)\r\n {\r\n result.push(collisions[i].body);\r\n }\r\n\r\n return result;\r\n },\r\n\r\n /**\r\n * Checks the given Matter Body to see if it intersects with any of the given bodies.\r\n * \r\n * If no bodies are provided it will check against all bodies in the Matter World.\r\n * \r\n * @method Phaser.Physics.Matter.MatterPhysics#intersectBody\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBody} body - The target body.\r\n * @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - An array of bodies to check the target body against. If not provided it will search all bodies in the world.\r\n * \r\n * @return {Phaser.Types.Physics.Matter.MatterBody[]} An array of bodies whos vertices intersect with target body.\r\n */\r\n intersectBody: function (body, bodies)\r\n {\r\n bodies = this.getMatterBodies(bodies);\r\n\r\n var result = [];\r\n var collisions = Query.collides(body, bodies);\r\n\r\n for (var i = 0; i < collisions.length; i++)\r\n {\r\n var pair = collisions[i];\r\n\r\n if (pair.bodyA === body)\r\n {\r\n result.push(pair.bodyB);\r\n }\r\n else\r\n {\r\n result.push(pair.bodyA);\r\n }\r\n }\r\n\r\n return result;\r\n },\r\n\r\n /**\r\n * Checks to see if the target body, or an array of target bodies, intersects with any of the given bodies.\r\n * \r\n * If intersection occurs this method will return `true` and, if provided, invoke the callbacks.\r\n * \r\n * If no bodies are provided for the second parameter the target will check again all bodies in the Matter World.\r\n * \r\n * Note that bodies can only overlap if they are in non-colliding collision groups or categories.\r\n * \r\n * If you provide a `processCallback` then the two bodies that overlap are sent to it. This callback\r\n * must return a boolean and is used to allow you to perform additional processing tests before a final\r\n * outcome is decided. If it returns `true` then the bodies are finally passed to the `overlapCallback`, if set.\r\n * \r\n * If you provide an `overlapCallback` then the matching pairs of overlapping bodies will be sent to it.\r\n * \r\n * Both callbacks have the following signature: `function (bodyA, bodyB, collisionInfo)` where `bodyA` is always\r\n * the target body. The `collisionInfo` object contains additional data, such as the angle and depth of penetration.\r\n * \r\n * @method Phaser.Physics.Matter.MatterPhysics#overlap\r\n * @since 3.22.0\r\n *\r\n * @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} target - The target body, or array of target bodies, to check.\r\n * @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - The second body, or array of bodies, to check. If falsey it will check against all bodies in the world.\r\n * @param {ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the bodies overlap.\r\n * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two bodies if they overlap. If this is set then `overlapCallback` will only be invoked if this callback returns `true`.\r\n * @param {*} [callbackContext] - The context, or scope, in which to run the callbacks.\r\n * \r\n * @return {boolean} `true` if the target body intersects with _any_ of the bodies given, otherwise `false`.\r\n */\r\n overlap: function (target, bodies, overlapCallback, processCallback, callbackContext)\r\n {\r\n if (overlapCallback === undefined) { overlapCallback = null; }\r\n if (processCallback === undefined) { processCallback = null; }\r\n if (callbackContext === undefined) { callbackContext = overlapCallback; }\r\n\r\n if (!Array.isArray(target))\r\n {\r\n target = [ target ];\r\n }\r\n\r\n target = this.getMatterBodies(target);\r\n bodies = this.getMatterBodies(bodies);\r\n\r\n var match = false;\r\n\r\n for (var i = 0; i < target.length; i++)\r\n {\r\n var entry = target[i];\r\n\r\n var collisions = Query.collides(entry, bodies);\r\n\r\n for (var c = 0; c < collisions.length; c++)\r\n {\r\n var info = collisions[c];\r\n var bodyB = (info.bodyA.id === entry.id) ? info.bodyB : info.bodyA;\r\n\r\n if (!processCallback || processCallback.call(callbackContext, entry, bodyB, info))\r\n {\r\n match = true;\r\n\r\n if (overlapCallback)\r\n {\r\n overlapCallback.call(callbackContext, entry, bodyB, info);\r\n }\r\n else if (!processCallback)\r\n {\r\n // If there are no callbacks we don't need to test every body, just exit when the first is found\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return match;\r\n },\r\n\r\n /**\r\n * Sets the collision filter category of all given Matter Bodies to the given value.\r\n * \r\n * This number must be a power of two between 2^0 (= 1) and 2^31.\r\n * \r\n * Bodies with different collision groups (see {@link #setCollisionGroup}) will only collide if their collision\r\n * categories are included in their collision masks (see {@link #setCollidesWith}).\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#setCollisionCategory\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBody[]} bodies - An array of bodies to update. If falsey it will use all bodies in the world.\r\n * @param {number} value - Unique category bitfield.\r\n *\r\n * @return {this} This Matter Physics instance.\r\n */\r\n setCollisionCategory: function (bodies, value)\r\n {\r\n bodies = this.getMatterBodies(bodies);\r\n\r\n bodies.forEach(function (body)\r\n {\r\n body.collisionFilter.category = value;\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the collision filter group of all given Matter Bodies to the given value.\r\n * \r\n * If the group value is zero, or if two Matter Bodies have different group values,\r\n * they will collide according to the usual collision filter rules (see {@link #setCollisionCategory} and {@link #setCollisionGroup}).\r\n * \r\n * If two Matter Bodies have the same positive group value, they will always collide;\r\n * if they have the same negative group value they will never collide.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#setCollisionGroup\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBody[]} bodies - An array of bodies to update. If falsey it will use all bodies in the world.\r\n * @param {number} value - Unique group index.\r\n *\r\n * @return {this} This Matter Physics instance.\r\n */\r\n setCollisionGroup: function (bodies, value)\r\n {\r\n bodies = this.getMatterBodies(bodies);\r\n\r\n bodies.forEach(function (body)\r\n {\r\n body.collisionFilter.group = value;\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the collision filter mask of all given Matter Bodies to the given value.\r\n * \r\n * Two Matter Bodies with different collision groups will only collide if each one includes the others\r\n * category in its mask based on a bitwise AND operation: `(categoryA & maskB) !== 0` and \r\n * `(categoryB & maskA) !== 0` are both true.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#setCollidesWith\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBody[]} bodies - An array of bodies to update. If falsey it will use all bodies in the world.\r\n * @param {(number|number[])} categories - A unique category bitfield, or an array of them.\r\n *\r\n * @return {this} This Matter Physics instance.\r\n */\r\n setCollidesWith: function (bodies, categories)\r\n {\r\n bodies = this.getMatterBodies(bodies);\r\n\r\n var flags = 0;\r\n\r\n if (!Array.isArray(categories))\r\n {\r\n flags = categories;\r\n }\r\n else\r\n {\r\n for (var i = 0; i < categories.length; i++)\r\n {\r\n flags |= categories[i];\r\n }\r\n }\r\n\r\n bodies.forEach(function (body)\r\n {\r\n body.collisionFilter.mask = flags;\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes an array and returns a new array made from all of the Matter Bodies found in the original array.\r\n * \r\n * For example, passing in Matter Game Objects, such as a bunch of Matter Sprites, to this method, would\r\n * return an array containing all of their native Matter Body objects.\r\n * \r\n * If the `bodies` argument is falsey, it will return all bodies in the world.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#getMatterBodies\r\n * @since 3.22.0\r\n *\r\n * @param {array} [bodies] - An array of objects to extract the bodies from. If falsey, it will return all bodies in the world.\r\n *\r\n * @return {MatterJS.BodyType[]} An array of native Matter Body objects.\r\n */\r\n getMatterBodies: function (bodies)\r\n {\r\n if (!bodies)\r\n {\r\n return this.world.getAllBodies();\r\n }\r\n\r\n if (!Array.isArray(bodies))\r\n {\r\n bodies = [ bodies ];\r\n }\r\n\r\n var output = [];\r\n\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n var body = (bodies[i].hasOwnProperty('body')) ? bodies[i].body : bodies[i];\r\n\r\n output.push(body);\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Sets both the horizontal and vertical linear velocity of the physics bodies.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#setVelocity\r\n * @since 3.22.0\r\n *\r\n * @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.\r\n * @param {number} x - The horizontal linear velocity value.\r\n * @param {number} y - The vertical linear velocity value.\r\n *\r\n * @return {this} This Matter Physics instance.\r\n */\r\n setVelocity: function (bodies, x, y)\r\n {\r\n bodies = this.getMatterBodies(bodies);\r\n\r\n var vec2 = this._tempVec2;\r\n\r\n vec2.x = x;\r\n vec2.y = y;\r\n\r\n bodies.forEach(function (body)\r\n {\r\n Body.setVelocity(body, vec2);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets just the horizontal linear velocity of the physics bodies.\r\n * The vertical velocity of the body is unchanged.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#setVelocityX\r\n * @since 3.22.0\r\n *\r\n * @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.\r\n * @param {number} x - The horizontal linear velocity value.\r\n *\r\n * @return {this} This Matter Physics instance.\r\n */\r\n setVelocityX: function (bodies, x)\r\n {\r\n bodies = this.getMatterBodies(bodies);\r\n\r\n var vec2 = this._tempVec2;\r\n\r\n vec2.x = x;\r\n\r\n bodies.forEach(function (body)\r\n {\r\n vec2.y = body.velocity.y;\r\n Body.setVelocity(body, vec2);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets just the vertical linear velocity of the physics bodies.\r\n * The horizontal velocity of the body is unchanged.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#setVelocityY\r\n * @since 3.22.0\r\n *\r\n * @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.\r\n * @param {number} y - The vertical linear velocity value.\r\n *\r\n * @return {this} This Matter Physics instance.\r\n */\r\n setVelocityY: function (bodies, y)\r\n {\r\n bodies = this.getMatterBodies(bodies);\r\n\r\n var vec2 = this._tempVec2;\r\n\r\n vec2.y = y;\r\n\r\n bodies.forEach(function (body)\r\n {\r\n vec2.x = body.velocity.x;\r\n Body.setVelocity(body, vec2);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the angular velocity of the bodies instantly.\r\n * Position, angle, force etc. are unchanged.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#setAngularVelocity\r\n * @since 3.22.0\r\n *\r\n * @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.\r\n * @param {number} value - The angular velocity.\r\n *\r\n * @return {this} This Matter Physics instance.\r\n */\r\n setAngularVelocity: function (bodies, value)\r\n {\r\n bodies = this.getMatterBodies(bodies);\r\n\r\n bodies.forEach(function (body)\r\n {\r\n Body.setAngularVelocity(body, value);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Applies a force to a body, at the bodies current position, including resulting torque.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#applyForce\r\n * @since 3.22.0\r\n *\r\n * @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.\r\n * @param {Phaser.Types.Math.Vector2Like} force - A Vector that specifies the force to apply.\r\n *\r\n * @return {this} This Matter Physics instance.\r\n */\r\n applyForce: function (bodies, force)\r\n {\r\n bodies = this.getMatterBodies(bodies);\r\n\r\n var vec2 = this._tempVec2;\r\n\r\n bodies.forEach(function (body)\r\n {\r\n vec2.x = body.position.x;\r\n vec2.y = body.position.y;\r\n\r\n Body.applyForce(body, vec2, force);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Applies a force to a body, from the given world position, including resulting torque.\r\n * If no angle is given, the current body angle is used.\r\n * \r\n * Use very small speed values, such as 0.1, depending on the mass and required velocity.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#applyForceFromPosition\r\n * @since 3.22.0\r\n *\r\n * @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.\r\n * @param {Phaser.Types.Math.Vector2Like} position - A Vector that specifies the world-space position to apply the force at.\r\n * @param {number} speed - A speed value to be applied to a directional force.\r\n * @param {number} [angle] - The angle, in radians, to apply the force from. Leave undefined to use the current body angle.\r\n *\r\n * @return {this} This Matter Physics instance.\r\n */\r\n applyForceFromPosition: function (bodies, position, speed, angle)\r\n {\r\n bodies = this.getMatterBodies(bodies);\r\n\r\n var vec2 = this._tempVec2;\r\n\r\n bodies.forEach(function (body)\r\n {\r\n if (angle === undefined)\r\n {\r\n angle = body.angle;\r\n }\r\n\r\n vec2.x = speed * Math.cos(angle);\r\n vec2.y = speed * Math.sin(angle);\r\n\r\n Body.applyForce(body, position, vec2);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a force to a body based on the given angle and speed.\r\n * If no angle is given, the current body angle is used.\r\n * \r\n * Use very small speed values, such as 0.1, depending on the mass and required velocity.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#applyForceFromAngle\r\n * @since 3.22.0\r\n *\r\n * @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.\r\n * @param {number} speed - A speed value to be applied to a directional force.\r\n * @param {number} [angle] - The angle, in radians, to apply the force from. Leave undefined to use the current body angle.\r\n *\r\n * @return {this} This Matter Physics instance.\r\n */\r\n applyForceFromAngle: function (bodies, speed, angle)\r\n {\r\n bodies = this.getMatterBodies(bodies);\r\n\r\n var vec2 = this._tempVec2;\r\n\r\n bodies.forEach(function (body)\r\n {\r\n if (angle === undefined)\r\n {\r\n angle = body.angle;\r\n }\r\n\r\n vec2.x = speed * Math.cos(angle);\r\n vec2.y = speed * Math.sin(angle);\r\n\r\n Body.applyForce(body, { x: body.position.x, y: body.position.y }, vec2);\r\n });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns the length of the given constraint, which is the distance between the two points.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#getConstraintLength\r\n * @since 3.22.0\r\n *\r\n * @param {MatterJS.ConstraintType} constraint - The constraint to get the length from.\r\n *\r\n * @return {number} The length of the constraint.\r\n */\r\n getConstraintLength: function (constraint)\r\n {\r\n var aX = constraint.pointA.x;\r\n var aY = constraint.pointA.y;\r\n var bX = constraint.pointB.x;\r\n var bY = constraint.pointB.y;\r\n\r\n if (constraint.bodyA)\r\n {\r\n aX += constraint.bodyA.position.x;\r\n aY += constraint.bodyA.position.y;\r\n }\r\n\r\n if (constraint.bodyB)\r\n {\r\n bX += constraint.bodyB.position.x;\r\n bY += constraint.bodyB.position.y;\r\n }\r\n\r\n return DistanceBetween(aX, aY, bX, bY);\r\n },\r\n\r\n /**\r\n * Aligns a Body, or Matter Game Object, against the given coordinates.\r\n * \r\n * The alignment takes place using the body bounds, which take into consideration things\r\n * like body scale and rotation.\r\n * \r\n * Although a Body has a `position` property, it is based on the center of mass for the body,\r\n * not a dimension based center. This makes aligning bodies difficult, especially if they have\r\n * rotated or scaled. This method will derive the correct position based on the body bounds and\r\n * its center of mass offset, in order to align the body with the given coordinate.\r\n * \r\n * For example, if you wanted to align a body so it sat in the bottom-center of the\r\n * Scene, and the world was 800 x 600 in size:\r\n * \r\n * ```javascript\r\n * this.matter.alignBody(body, 400, 600, Phaser.Display.Align.BOTTOM_CENTER);\r\n * ```\r\n * \r\n * You pass in 400 for the x coordinate, because that is the center of the world, and 600 for\r\n * the y coordinate, as that is the base of the world.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#alignBody\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBody} body - The Body to align.\r\n * @param {number} x - The horizontal position to align the body to.\r\n * @param {number} y - The vertical position to align the body to.\r\n * @param {integer} align - One of the `Phaser.Display.Align` constants, such as `Phaser.Display.Align.TOP_LEFT`.\r\n *\r\n * @return {this} This Matter Physics instance.\r\n */\r\n alignBody: function (body, x, y, align)\r\n {\r\n body = (body.hasOwnProperty('body')) ? body.body : body;\r\n\r\n var pos;\r\n\r\n switch (align)\r\n {\r\n case ALIGN_CONST.TOP_LEFT:\r\n case ALIGN_CONST.LEFT_TOP:\r\n pos = this.bodyBounds.getTopLeft(body, x, y);\r\n break;\r\n\r\n case ALIGN_CONST.TOP_CENTER:\r\n pos = this.bodyBounds.getTopCenter(body, x, y);\r\n break;\r\n \r\n case ALIGN_CONST.TOP_RIGHT:\r\n case ALIGN_CONST.RIGHT_TOP:\r\n pos = this.bodyBounds.getTopRight(body, x, y);\r\n break;\r\n\r\n case ALIGN_CONST.LEFT_CENTER:\r\n pos = this.bodyBounds.getLeftCenter(body, x, y);\r\n break;\r\n\r\n case ALIGN_CONST.CENTER:\r\n pos = this.bodyBounds.getCenter(body, x, y);\r\n break;\r\n\r\n case ALIGN_CONST.RIGHT_CENTER:\r\n pos = this.bodyBounds.getRightCenter(body, x, y);\r\n break;\r\n\r\n case ALIGN_CONST.LEFT_BOTTOM:\r\n case ALIGN_CONST.BOTTOM_LEFT:\r\n pos = this.bodyBounds.getBottomLeft(body, x, y);\r\n break;\r\n\r\n case ALIGN_CONST.BOTTOM_CENTER:\r\n pos = this.bodyBounds.getBottomCenter(body, x, y);\r\n break;\r\n\r\n case ALIGN_CONST.BOTTOM_RIGHT:\r\n case ALIGN_CONST.RIGHT_BOTTOM:\r\n pos = this.bodyBounds.getBottomRight(body, x, y);\r\n break;\r\n }\r\n\r\n if (pos)\r\n {\r\n Body.setPosition(body, pos);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#shutdown\r\n * @private\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n var eventEmitter = this.systems.events;\r\n\r\n if (this.world)\r\n {\r\n eventEmitter.off(SceneEvents.UPDATE, this.world.update, this.world);\r\n eventEmitter.off(SceneEvents.POST_UPDATE, this.world.postUpdate, this.world);\r\n }\r\n\r\n eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n\r\n if (this.add)\r\n {\r\n this.add.destroy();\r\n }\r\n\r\n if (this.world)\r\n {\r\n this.world.destroy();\r\n }\r\n\r\n this.add = null;\r\n this.world = null;\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Phaser.Physics.Matter.MatterPhysics#destroy\r\n * @private\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.scene.sys.events.off(SceneEvents.START, this.start, this);\r\n\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nPluginCache.register('MatterPhysics', MatterPhysics, 'matterPhysics');\r\n\r\nmodule.exports = MatterPhysics;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/MatterPhysics.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/MatterSprite.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/MatterSprite.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar AnimationComponent = __webpack_require__(/*! ../../gameobjects/components/Animation */ \"./node_modules/phaser/src/gameobjects/components/Animation.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ./components */ \"./node_modules/phaser/src/physics/matter-js/components/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../../gameobjects/GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar Pipeline = __webpack_require__(/*! ../../gameobjects/components/Pipeline */ \"./node_modules/phaser/src/gameobjects/components/Pipeline.js\");\r\nvar Sprite = __webpack_require__(/*! ../../gameobjects/sprite/Sprite */ \"./node_modules/phaser/src/gameobjects/sprite/Sprite.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Matter Physics Sprite Game Object.\r\n *\r\n * A Sprite Game Object is used for the display of both static and animated images in your game.\r\n * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled\r\n * and animated.\r\n *\r\n * The main difference between a Sprite and an Image Game Object is that you cannot animate Images.\r\n * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation\r\n * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases.\r\n *\r\n * @class Sprite\r\n * @extends Phaser.GameObjects.Sprite\r\n * @memberof Phaser.Physics.Matter\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.Physics.Matter.Components.Bounce\r\n * @extends Phaser.Physics.Matter.Components.Collision\r\n * @extends Phaser.Physics.Matter.Components.Force\r\n * @extends Phaser.Physics.Matter.Components.Friction\r\n * @extends Phaser.Physics.Matter.Components.Gravity\r\n * @extends Phaser.Physics.Matter.Components.Mass\r\n * @extends Phaser.Physics.Matter.Components.Sensor\r\n * @extends Phaser.Physics.Matter.Components.SetBody\r\n * @extends Phaser.Physics.Matter.Components.Sleep\r\n * @extends Phaser.Physics.Matter.Components.Static\r\n * @extends Phaser.Physics.Matter.Components.Transform\r\n * @extends Phaser.Physics.Matter.Components.Velocity\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Size\r\n * @extends Phaser.GameObjects.Components.Texture\r\n * @extends Phaser.GameObjects.Components.Tint\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Physics.Matter.World} world - A reference to the Matter.World instance that this body belongs to.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n */\r\nvar MatterSprite = new Class({\r\n\r\n Extends: Sprite,\r\n\r\n Mixins: [\r\n Components.Bounce,\r\n Components.Collision,\r\n Components.Force,\r\n Components.Friction,\r\n Components.Gravity,\r\n Components.Mass,\r\n Components.Sensor,\r\n Components.SetBody,\r\n Components.Sleep,\r\n Components.Static,\r\n Components.Transform,\r\n Components.Velocity,\r\n Pipeline\r\n ],\r\n\r\n initialize:\r\n\r\n function MatterSprite (world, x, y, texture, frame, options)\r\n {\r\n GameObject.call(this, world.scene, 'Sprite');\r\n\r\n this.anims = new AnimationComponent(this);\r\n\r\n this.setTexture(texture, frame);\r\n this.setSizeToFrame();\r\n this.setOrigin();\r\n\r\n /**\r\n * A reference to the Matter.World instance that this body belongs to.\r\n *\r\n * @name Phaser.Physics.Matter.Sprite#world\r\n * @type {Phaser.Physics.Matter.World}\r\n * @since 3.0.0\r\n */\r\n this.world = world;\r\n\r\n /**\r\n * An internal temp vector used for velocity and force calculations.\r\n *\r\n * @name Phaser.Physics.Matter.Sprite#_tempVec2\r\n * @type {Phaser.Math.Vector2}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._tempVec2 = new Vector2(x, y);\r\n\r\n var shape = GetFastValue(options, 'shape', null);\r\n\r\n if (shape)\r\n {\r\n this.setBody(shape, options);\r\n }\r\n else\r\n {\r\n this.setRectangle(this.width, this.height, options);\r\n }\r\n\r\n this.setPosition(x, y);\r\n\r\n this.initPipeline('TextureTintPipeline');\r\n }\r\n\r\n});\r\n\r\nmodule.exports = MatterSprite;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/MatterSprite.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/MatterTileBody.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/MatterTileBody.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Bodies = __webpack_require__(/*! ./lib/factory/Bodies */ \"./node_modules/phaser/src/physics/matter-js/lib/factory/Bodies.js\");\r\nvar Body = __webpack_require__(/*! ./lib/body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ./components */ \"./node_modules/phaser/src/physics/matter-js/components/index.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar HasValue = __webpack_require__(/*! ../../utils/object/HasValue */ \"./node_modules/phaser/src/utils/object/HasValue.js\");\r\nvar Vertices = __webpack_require__(/*! ./lib/geometry/Vertices */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A wrapper around a Tile that provides access to a corresponding Matter body. A tile can only\r\n * have one Matter body associated with it. You can either pass in an existing Matter body for\r\n * the tile or allow the constructor to create the corresponding body for you. If the Tile has a\r\n * collision group (defined in Tiled), those shapes will be used to create the body. If not, the\r\n * tile's rectangle bounding box will be used.\r\n *\r\n * The corresponding body will be accessible on the Tile itself via Tile.physics.matterBody.\r\n *\r\n * Note: not all Tiled collision shapes are supported. See\r\n * Phaser.Physics.Matter.TileBody#setFromTileCollision for more information.\r\n *\r\n * @class TileBody\r\n * @memberof Phaser.Physics.Matter\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.Physics.Matter.Components.Bounce\r\n * @extends Phaser.Physics.Matter.Components.Collision\r\n * @extends Phaser.Physics.Matter.Components.Friction\r\n * @extends Phaser.Physics.Matter.Components.Gravity\r\n * @extends Phaser.Physics.Matter.Components.Mass\r\n * @extends Phaser.Physics.Matter.Components.Sensor\r\n * @extends Phaser.Physics.Matter.Components.Sleep\r\n * @extends Phaser.Physics.Matter.Components.Static\r\n *\r\n * @param {Phaser.Physics.Matter.World} world - The Matter world instance this body belongs to.\r\n * @param {Phaser.Tilemaps.Tile} tile - The target tile that should have a Matter body.\r\n * @param {Phaser.Types.Physics.Matter.MatterTileOptions} [options] - Options to be used when creating the Matter body.\r\n */\r\nvar MatterTileBody = new Class({\r\n\r\n Mixins: [\r\n Components.Bounce,\r\n Components.Collision,\r\n Components.Friction,\r\n Components.Gravity,\r\n Components.Mass,\r\n Components.Sensor,\r\n Components.Sleep,\r\n Components.Static\r\n ],\r\n\r\n initialize:\r\n\r\n function MatterTileBody (world, tile, options)\r\n {\r\n /**\r\n * The tile object the body is associated with.\r\n *\r\n * @name Phaser.Physics.Matter.TileBody#tile\r\n * @type {Phaser.Tilemaps.Tile}\r\n * @since 3.0.0\r\n */\r\n this.tile = tile;\r\n\r\n /**\r\n * The Matter world the body exists within.\r\n *\r\n * @name Phaser.Physics.Matter.TileBody#world\r\n * @type {Phaser.Physics.Matter.World}\r\n * @since 3.0.0\r\n */\r\n this.world = world;\r\n\r\n // Install a reference to 'this' on the tile and ensure there can only be one matter body\r\n // associated with the tile\r\n if (tile.physics.matterBody)\r\n {\r\n tile.physics.matterBody.destroy();\r\n }\r\n\r\n tile.physics.matterBody = this;\r\n\r\n // Set the body either from an existing body (if provided), the shapes in the tileset\r\n // collision layer (if it exists) or a rectangle matching the tile.\r\n var body = GetFastValue(options, 'body', null);\r\n\r\n var addToWorld = GetFastValue(options, 'addToWorld', true);\r\n\r\n if (!body)\r\n {\r\n var collisionGroup = tile.getCollisionGroup();\r\n var collisionObjects = GetFastValue(collisionGroup, 'objects', []);\r\n\r\n if (collisionObjects.length > 0)\r\n {\r\n this.setFromTileCollision(options);\r\n }\r\n else\r\n {\r\n this.setFromTileRectangle(options);\r\n }\r\n }\r\n else\r\n {\r\n this.setBody(body, addToWorld);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the current body to a rectangle that matches the bounds of the tile.\r\n *\r\n * @method Phaser.Physics.Matter.TileBody#setFromTileRectangle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyTileOptions} [options] - Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts.\r\n * \r\n * @return {Phaser.Physics.Matter.TileBody} This TileBody object.\r\n */\r\n setFromTileRectangle: function (options)\r\n {\r\n if (options === undefined) { options = {}; }\r\n if (!HasValue(options, 'isStatic')) { options.isStatic = true; }\r\n if (!HasValue(options, 'addToWorld')) { options.addToWorld = true; }\r\n\r\n var bounds = this.tile.getBounds();\r\n var cx = bounds.x + (bounds.width / 2);\r\n var cy = bounds.y + (bounds.height / 2);\r\n var body = Bodies.rectangle(cx, cy, bounds.width, bounds.height, options);\r\n\r\n this.setBody(body, options.addToWorld);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the current body from the collision group associated with the Tile. This is typically\r\n * set up in Tiled's collision editor.\r\n *\r\n * Note: Matter doesn't support all shapes from Tiled. Rectangles and polygons are directly\r\n * supported. Ellipses are converted into circle bodies. Polylines are treated as if they are\r\n * closed polygons. If a tile has multiple shapes, a multi-part body will be created. Concave\r\n * shapes are supported if poly-decomp library is included. Decomposition is not guaranteed to\r\n * work for complex shapes (e.g. holes), so it's often best to manually decompose a concave\r\n * polygon into multiple convex polygons yourself.\r\n *\r\n * @method Phaser.Physics.Matter.TileBody#setFromTileCollision\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyTileOptions} [options] - Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts.\r\n * \r\n * @return {Phaser.Physics.Matter.TileBody} This TileBody object.\r\n */\r\n setFromTileCollision: function (options)\r\n {\r\n if (options === undefined) { options = {}; }\r\n if (!HasValue(options, 'isStatic')) { options.isStatic = true; }\r\n if (!HasValue(options, 'addToWorld')) { options.addToWorld = true; }\r\n\r\n var sx = this.tile.tilemapLayer.scaleX;\r\n var sy = this.tile.tilemapLayer.scaleY;\r\n var tileX = this.tile.getLeft();\r\n var tileY = this.tile.getTop();\r\n var collisionGroup = this.tile.getCollisionGroup();\r\n var collisionObjects = GetFastValue(collisionGroup, 'objects', []);\r\n\r\n var parts = [];\r\n\r\n for (var i = 0; i < collisionObjects.length; i++)\r\n {\r\n var object = collisionObjects[i];\r\n var ox = tileX + (object.x * sx);\r\n var oy = tileY + (object.y * sy);\r\n var ow = object.width * sx;\r\n var oh = object.height * sy;\r\n var body = null;\r\n\r\n if (object.rectangle)\r\n {\r\n body = Bodies.rectangle(ox + ow / 2, oy + oh / 2, ow, oh, options);\r\n }\r\n else if (object.ellipse)\r\n {\r\n body = Bodies.circle(ox + ow / 2, oy + oh / 2, ow / 2, options);\r\n }\r\n else if (object.polygon || object.polyline)\r\n {\r\n // Polygons and polylines are both treated as closed polygons\r\n var originalPoints = object.polygon ? object.polygon : object.polyline;\r\n\r\n var points = originalPoints.map(function (p)\r\n {\r\n return { x: p.x * sx, y: p.y * sy };\r\n });\r\n\r\n var vertices = Vertices.create(points);\r\n\r\n // Points are relative to the object's origin (first point placed in Tiled), but\r\n // matter expects points to be relative to the center of mass. This only applies to\r\n // convex shapes. When a concave shape is decomposed, multiple parts are created and\r\n // the individual parts are positioned relative to (ox, oy).\r\n //\r\n // Update: 8th January 2019 - the latest version of Matter needs the Vertices adjusted,\r\n // regardless if convex or concave.\r\n\r\n var center = Vertices.centre(vertices);\r\n\r\n ox += center.x;\r\n oy += center.y;\r\n\r\n body = Bodies.fromVertices(ox, oy, vertices, options);\r\n }\r\n\r\n if (body)\r\n {\r\n parts.push(body);\r\n }\r\n }\r\n\r\n if (parts.length === 1)\r\n {\r\n this.setBody(parts[0], options.addToWorld);\r\n }\r\n else if (parts.length > 1)\r\n {\r\n options.parts = parts;\r\n this.setBody(Body.create(options), options.addToWorld);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the current body to the given body. This will remove the previous body, if one already\r\n * exists.\r\n *\r\n * @method Phaser.Physics.Matter.TileBody#setBody\r\n * @since 3.0.0\r\n *\r\n * @param {MatterJS.BodyType} body - The new Matter body to use.\r\n * @param {boolean} [addToWorld=true] - Whether or not to add the body to the Matter world.\r\n * \r\n * @return {Phaser.Physics.Matter.TileBody} This TileBody object.\r\n */\r\n setBody: function (body, addToWorld)\r\n {\r\n if (addToWorld === undefined) { addToWorld = true; }\r\n\r\n if (this.body)\r\n {\r\n this.removeBody();\r\n }\r\n\r\n this.body = body;\r\n this.body.gameObject = this;\r\n\r\n if (addToWorld)\r\n {\r\n this.world.add(this.body);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes the current body from the TileBody and from the Matter world\r\n *\r\n * @method Phaser.Physics.Matter.TileBody#removeBody\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Physics.Matter.TileBody} This TileBody object.\r\n */\r\n removeBody: function ()\r\n {\r\n if (this.body)\r\n {\r\n this.world.remove(this.body);\r\n this.body.gameObject = undefined;\r\n this.body = undefined;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes the current body from the tile and the world.\r\n *\r\n * @method Phaser.Physics.Matter.TileBody#destroy\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Physics.Matter.TileBody} This TileBody object.\r\n */\r\n destroy: function ()\r\n {\r\n this.removeBody();\r\n this.tile.physics.matterBody = undefined;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = MatterTileBody;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/MatterTileBody.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/PhysicsEditorParser.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/PhysicsEditorParser.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Joachim Grill \r\n * @author Richard Davey \r\n * @copyright 2018 CodeAndWeb GmbH\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Bodies = __webpack_require__(/*! ./lib/factory/Bodies */ \"./node_modules/phaser/src/physics/matter-js/lib/factory/Bodies.js\");\r\nvar Body = __webpack_require__(/*! ./lib/body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\nvar Common = __webpack_require__(/*! ./lib/core/Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar Vertices = __webpack_require__(/*! ./lib/geometry/Vertices */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js\");\r\n\r\n/**\r\n * Use PhysicsEditorParser.parseBody() to build a Matter body object, based on a physics data file\r\n * created and exported with PhysicsEditor (https://www.codeandweb.com/physicseditor).\r\n *\r\n * @namespace Phaser.Physics.Matter.PhysicsEditorParser\r\n * @since 3.10.0\r\n */\r\nvar PhysicsEditorParser = {\r\n\r\n /**\r\n * Parses a body element exported by PhysicsEditor.\r\n *\r\n * @function Phaser.Physics.Matter.PhysicsEditorParser.parseBody\r\n * @since 3.10.0\r\n *\r\n * @param {number} x - The horizontal world location of the body.\r\n * @param {number} y - The vertical world location of the body.\r\n * @param {object} config - The body configuration and fixture (child body) definitions, as exported by PhysicsEditor.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n * \r\n * @return {MatterJS.BodyType} A compound Matter JS Body.\r\n */\r\n parseBody: function (x, y, config, options)\r\n {\r\n if (options === undefined) { options = {}; }\r\n\r\n var fixtureConfigs = GetFastValue(config, 'fixtures', []);\r\n var fixtures = [];\r\n\r\n for (var fc = 0; fc < fixtureConfigs.length; fc++)\r\n {\r\n var fixtureParts = this.parseFixture(fixtureConfigs[fc]);\r\n\r\n for (var i = 0; i < fixtureParts.length; i++)\r\n {\r\n fixtures.push(fixtureParts[i]);\r\n }\r\n }\r\n\r\n var matterConfig = Common.clone(config, true);\r\n\r\n Common.extend(matterConfig, options, true);\r\n\r\n delete matterConfig.fixtures;\r\n delete matterConfig.type;\r\n\r\n var body = Body.create(matterConfig);\r\n\r\n Body.setParts(body, fixtures);\r\n \r\n Body.setPosition(body, { x: x, y: y });\r\n\r\n return body;\r\n },\r\n\r\n /**\r\n * Parses an element of the \"fixtures\" list exported by PhysicsEditor\r\n *\r\n * @function Phaser.Physics.Matter.PhysicsEditorParser.parseFixture\r\n * @since 3.10.0\r\n *\r\n * @param {object} fixtureConfig - The fixture object to parse.\r\n * \r\n * @return {MatterJS.BodyType[]} - An array of Matter JS Bodies.\r\n */\r\n parseFixture: function (fixtureConfig)\r\n {\r\n var matterConfig = Common.extend({}, false, fixtureConfig);\r\n\r\n delete matterConfig.circle;\r\n delete matterConfig.vertices;\r\n\r\n var fixtures;\r\n\r\n if (fixtureConfig.circle)\r\n {\r\n var x = GetFastValue(fixtureConfig.circle, 'x');\r\n var y = GetFastValue(fixtureConfig.circle, 'y');\r\n var r = GetFastValue(fixtureConfig.circle, 'radius');\r\n fixtures = [ Bodies.circle(x, y, r, matterConfig) ];\r\n }\r\n else if (fixtureConfig.vertices)\r\n {\r\n fixtures = this.parseVertices(fixtureConfig.vertices, matterConfig);\r\n }\r\n\r\n return fixtures;\r\n },\r\n\r\n /**\r\n * Parses the \"vertices\" lists exported by PhysicsEditor.\r\n *\r\n * @function Phaser.Physics.Matter.PhysicsEditorParser.parseVertices\r\n * @since 3.10.0\r\n *\r\n * @param {array} vertexSets - The vertex lists to parse.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n * \r\n * @return {MatterJS.BodyType[]} - An array of Matter JS Bodies.\r\n */\r\n parseVertices: function (vertexSets, options)\r\n {\r\n if (options === undefined) { options = {}; }\r\n\r\n var parts = [];\r\n\r\n for (var v = 0; v < vertexSets.length; v++)\r\n {\r\n Vertices.clockwiseSort(vertexSets[v]);\r\n\r\n parts.push(Body.create(Common.extend({\r\n position: Vertices.centre(vertexSets[v]),\r\n vertices: vertexSets[v]\r\n }, options)));\r\n }\r\n\r\n // flag coincident part edges\r\n return Bodies.flagCoincidentParts(parts);\r\n }\r\n};\r\n\r\nmodule.exports = PhysicsEditorParser;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/PhysicsEditorParser.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/PhysicsJSONParser.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/PhysicsJSONParser.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Bodies = __webpack_require__(/*! ./lib/factory/Bodies */ \"./node_modules/phaser/src/physics/matter-js/lib/factory/Bodies.js\");\r\nvar Body = __webpack_require__(/*! ./lib/body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\n\r\n/**\r\n * Creates a body using the supplied physics data, as provided by a JSON file.\r\n * \r\n * The data file should be loaded as JSON:\r\n * \r\n * ```javascript\r\n * preload ()\r\n * {\r\n * this.load.json('ninjas', 'assets/ninjas.json);\r\n * }\r\n * \r\n * create ()\r\n * {\r\n * const ninjaShapes = this.cache.json.get('ninjas');\r\n * \r\n * this.matter.add.fromJSON(400, 300, ninjaShapes.shinobi);\r\n * }\r\n * ```\r\n * \r\n * Do not pass the entire JSON file to this method, but instead pass one of the shapes contained within it.\r\n * \r\n * If you pas in an `options` object, any settings in there will override those in the config object.\r\n * \r\n * The structure of the JSON file is as follows:\r\n * \r\n * ```text\r\n * {\r\n * 'generator_info': // The name of the application that created the JSON data\r\n * 'shapeName': {\r\n * 'type': // The type of body\r\n * 'label': // Optional body label\r\n * 'vertices': // An array, or an array of arrays, containing the vertex data in x/y object pairs\r\n * }\r\n * }\r\n * ```\r\n * \r\n * At the time of writing, only the Phaser Physics Tracer App exports in this format.\r\n *\r\n * @namespace Phaser.Physics.Matter.PhysicsJSONParser\r\n * @since 3.22.0\r\n */\r\nvar PhysicsJSONParser = {\r\n\r\n /**\r\n * Parses a body element from the given JSON data.\r\n *\r\n * @function Phaser.Physics.Matter.PhysicsJSONParser.parseBody\r\n * @since 3.22.0\r\n *\r\n * @param {number} x - The horizontal world location of the body.\r\n * @param {number} y - The vertical world location of the body.\r\n * @param {object} config - The body configuration data.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n * \r\n * @return {MatterJS.BodyType} A Matter JS Body.\r\n */\r\n parseBody: function (x, y, config, options)\r\n {\r\n if (options === undefined) { options = {}; }\r\n\r\n var body;\r\n var vertexSets = config.vertices;\r\n\r\n if (vertexSets.length === 1)\r\n {\r\n // Just a single Body\r\n options.vertices = vertexSets[0];\r\n\r\n body = Body.create(options);\r\n\r\n Bodies.flagCoincidentParts(body.parts);\r\n }\r\n else\r\n {\r\n var parts = [];\r\n\r\n for (var i = 0; i < vertexSets.length; i++)\r\n {\r\n var part = Body.create({\r\n vertices: vertexSets[i]\r\n });\r\n\r\n parts.push(part);\r\n }\r\n\r\n Bodies.flagCoincidentParts(parts);\r\n\r\n options.parts = parts;\r\n\r\n body = Body.create(options);\r\n }\r\n\r\n body.label = config.label;\r\n\r\n Body.setPosition(body, { x: x, y: y });\r\n\r\n return body;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = PhysicsJSONParser;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/PhysicsJSONParser.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/PointerConstraint.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/PointerConstraint.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Bounds = __webpack_require__(/*! ./lib/geometry/Bounds */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Bounds.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Composite = __webpack_require__(/*! ./lib/body/Composite */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Composite.js\");\r\nvar Constraint = __webpack_require__(/*! ./lib/constraint/Constraint */ \"./node_modules/phaser/src/physics/matter-js/lib/constraint/Constraint.js\");\r\nvar Detector = __webpack_require__(/*! ./lib/collision/Detector */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Detector.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/physics/matter-js/events/index.js\");\r\nvar InputEvents = __webpack_require__(/*! ../../input/events */ \"./node_modules/phaser/src/input/events/index.js\");\r\nvar Merge = __webpack_require__(/*! ../../utils/object/Merge */ \"./node_modules/phaser/src/utils/object/Merge.js\");\r\nvar Sleeping = __webpack_require__(/*! ./lib/core/Sleeping */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Sleeping.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\nvar Vertices = __webpack_require__(/*! ./lib/geometry/Vertices */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Pointer Constraint is a special type of constraint that allows you to click\r\n * and drag bodies in a Matter World. It monitors the active Pointers in a Scene,\r\n * and when one is pressed down it checks to see if that hit any part of any active\r\n * body in the world. If it did, and the body has input enabled, it will begin to\r\n * drag it until either released, or you stop it via the `stopDrag` method.\r\n * \r\n * You can adjust the stiffness, length and other properties of the constraint via\r\n * the `options` object on creation.\r\n *\r\n * @class PointerConstraint\r\n * @memberof Phaser.Physics.Matter\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene to which this Pointer Constraint belongs.\r\n * @param {Phaser.Physics.Matter.World} world - A reference to the Matter World instance to which this Constraint belongs.\r\n * @param {object} [options] - A Constraint configuration object.\r\n */\r\nvar PointerConstraint = new Class({\r\n\r\n initialize:\r\n\r\n function PointerConstraint (scene, world, options)\r\n {\r\n if (options === undefined) { options = {}; }\r\n\r\n // Defaults\r\n var defaults = {\r\n label: 'Pointer Constraint',\r\n pointA: { x: 0, y: 0 },\r\n pointB: { x: 0, y: 0 },\r\n length: 0.01,\r\n stiffness: 0.1,\r\n angularStiffness: 1,\r\n collisionFilter: {\r\n category: 0x0001,\r\n mask: 0xFFFFFFFF,\r\n group: 0\r\n }\r\n };\r\n\r\n /**\r\n * A reference to the Scene to which this Pointer Constraint belongs.\r\n * This is the same Scene as the Matter World instance.\r\n *\r\n * @name Phaser.Physics.Matter.PointerConstraint#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A reference to the Matter World instance to which this Constraint belongs.\r\n *\r\n * @name Phaser.Physics.Matter.PointerConstraint#world\r\n * @type {Phaser.Physics.Matter.World}\r\n * @since 3.0.0\r\n */\r\n this.world = world;\r\n\r\n /**\r\n * The Camera the Pointer was interacting with when the input\r\n * down event was processed.\r\n *\r\n * @name Phaser.Physics.Matter.PointerConstraint#camera\r\n * @type {Phaser.Cameras.Scene2D.Camera}\r\n * @since 3.0.0\r\n */\r\n this.camera = null;\r\n\r\n /**\r\n * A reference to the Input Pointer that activated this Constraint.\r\n * This is set in the `onDown` handler.\r\n *\r\n * @name Phaser.Physics.Matter.PointerConstraint#pointer\r\n * @type {Phaser.Input.Pointer}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.pointer = null;\r\n\r\n /**\r\n * Is this Constraint active or not?\r\n * \r\n * An active constraint will be processed each update. An inactive one will be skipped.\r\n * Use this to toggle a Pointer Constraint on and off.\r\n *\r\n * @name Phaser.Physics.Matter.PointerConstraint#active\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.active = true;\r\n\r\n /**\r\n * The internal transformed position.\r\n *\r\n * @name Phaser.Physics.Matter.PointerConstraint#position\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n this.position = new Vector2();\r\n\r\n /**\r\n * The body that is currently being dragged, if any.\r\n *\r\n * @name Phaser.Physics.Matter.PointerConstraint#body\r\n * @type {?MatterJS.BodyType}\r\n * @since 3.16.2\r\n */\r\n this.body = null;\r\n\r\n /**\r\n * The part of the body that was clicked on to start the drag.\r\n *\r\n * @name Phaser.Physics.Matter.PointerConstraint#part\r\n * @type {?MatterJS.BodyType}\r\n * @since 3.16.2\r\n */\r\n this.part = null;\r\n\r\n /**\r\n * The native Matter Constraint that is used to attach to bodies.\r\n *\r\n * @name Phaser.Physics.Matter.PointerConstraint#constraint\r\n * @type {MatterJS.ConstraintType}\r\n * @since 3.0.0\r\n */\r\n this.constraint = Constraint.create(Merge(options, defaults));\r\n\r\n this.world.on(Events.BEFORE_UPDATE, this.update, this);\r\n\r\n scene.sys.input.on(InputEvents.POINTER_DOWN, this.onDown, this);\r\n scene.sys.input.on(InputEvents.POINTER_UP, this.onUp, this);\r\n },\r\n\r\n /**\r\n * A Pointer has been pressed down onto the Scene.\r\n * \r\n * If this Constraint doesn't have an active Pointer then a hit test is set to\r\n * run against all active bodies in the world during the _next_ call to `update`.\r\n * If a body is found, it is bound to this constraint and the drag begins.\r\n *\r\n * @method Phaser.Physics.Matter.PointerConstraint#onDown\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - A reference to the Pointer that was pressed.\r\n */\r\n onDown: function (pointer)\r\n {\r\n if (!this.pointer)\r\n {\r\n this.pointer = pointer;\r\n this.camera = pointer.camera;\r\n }\r\n },\r\n\r\n /**\r\n * A Pointer has been released from the Scene. If it was the one this constraint was using, it's cleared.\r\n *\r\n * @method Phaser.Physics.Matter.PointerConstraint#onUp\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Input.Pointer} pointer - A reference to the Pointer that was pressed.\r\n */\r\n onUp: function (pointer)\r\n {\r\n if (pointer === this.pointer)\r\n {\r\n this.pointer = null;\r\n }\r\n },\r\n\r\n /**\r\n * Scans all active bodies in the current Matter World to see if any of them\r\n * are hit by the Pointer. The _first one_ found to hit is set as the active contraint\r\n * body.\r\n *\r\n * @method Phaser.Physics.Matter.PointerConstraint#getBody\r\n * @fires Phaser.Physics.Matter.Events#DRAG_START\r\n * @since 3.16.2\r\n * \r\n * @return {boolean} `true` if a body was found and set, otherwise `false`.\r\n */\r\n getBody: function (pointer)\r\n {\r\n var pos = this.position;\r\n var constraint = this.constraint;\r\n\r\n this.camera.getWorldPoint(pointer.x, pointer.y, pos);\r\n\r\n var bodies = Composite.allBodies(this.world.localWorld);\r\n\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n var body = bodies[i];\r\n\r\n if (!body.ignorePointer &&\r\n Bounds.contains(body.bounds, pos) &&\r\n Detector.canCollide(body.collisionFilter, constraint.collisionFilter))\r\n {\r\n if (this.hitTestBody(body, pos))\r\n {\r\n this.world.emit(Events.DRAG_START, body, this.part, this);\r\n\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Scans the current body to determine if a part of it was clicked on.\r\n * If a part is found the body is set as the `constraint.bodyB` property,\r\n * as well as the `body` property of this class. The part is also set.\r\n *\r\n * @method Phaser.Physics.Matter.PointerConstraint#hitTestBody\r\n * @since 3.16.2\r\n *\r\n * @param {MatterJS.BodyType} body - The Matter Body to check.\r\n * @param {Phaser.Math.Vector2} position - A translated hit test position.\r\n *\r\n * @return {boolean} `true` if a part of the body was hit, otherwise `false`.\r\n */\r\n hitTestBody: function (body, position)\r\n {\r\n var constraint = this.constraint;\r\n var partsLength = body.parts.length;\r\n\r\n var start = (partsLength > 1) ? 1 : 0;\r\n\r\n for (var i = start; i < partsLength; i++)\r\n {\r\n var part = body.parts[i];\r\n\r\n if (Vertices.contains(part.vertices, position))\r\n {\r\n constraint.pointA = position;\r\n constraint.pointB = { x: position.x - body.position.x, y: position.y - body.position.y };\r\n\r\n constraint.bodyB = body;\r\n constraint.angleB = body.angle;\r\n\r\n Sleeping.set(body, false);\r\n\r\n this.part = part;\r\n this.body = body;\r\n\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Internal update handler. Called in the Matter BEFORE_UPDATE step.\r\n *\r\n * @method Phaser.Physics.Matter.PointerConstraint#update\r\n * @fires Phaser.Physics.Matter.Events#DRAG\r\n * @since 3.0.0\r\n */\r\n update: function ()\r\n {\r\n var pointer = this.pointer;\r\n var body = this.body;\r\n\r\n if (!this.active || !pointer)\r\n {\r\n if (body)\r\n {\r\n this.stopDrag();\r\n }\r\n\r\n return;\r\n }\r\n\r\n if (!pointer.isDown && body)\r\n {\r\n this.stopDrag();\r\n\r\n return;\r\n }\r\n else if (pointer.isDown)\r\n {\r\n if (!body && !this.getBody(pointer))\r\n {\r\n return;\r\n }\r\n\r\n body = this.body;\r\n\r\n var pos = this.position;\r\n var constraint = this.constraint;\r\n \r\n this.camera.getWorldPoint(pointer.x, pointer.y, pos);\r\n \r\n // Drag update\r\n constraint.pointA.x = pos.x;\r\n constraint.pointA.y = pos.y;\r\n\r\n Sleeping.set(body, false);\r\n\r\n this.world.emit(Events.DRAG, body, this);\r\n }\r\n },\r\n\r\n /**\r\n * Stops the Pointer Constraint from dragging the body any further.\r\n * \r\n * This is called automatically if the Pointer is released while actively\r\n * dragging a body. Or, you can call it manually to release a body from a\r\n * constraint without having to first release the pointer.\r\n *\r\n * @method Phaser.Physics.Matter.PointerConstraint#stopDrag\r\n * @fires Phaser.Physics.Matter.Events#DRAG_END\r\n * @since 3.16.2\r\n */\r\n stopDrag: function ()\r\n {\r\n var body = this.body;\r\n var constraint = this.constraint;\r\n\r\n constraint.bodyB = null;\r\n constraint.pointB = null;\r\n\r\n this.pointer = null;\r\n this.body = null;\r\n this.part = null;\r\n\r\n if (body)\r\n {\r\n this.world.emit(Events.DRAG_END, body, this);\r\n }\r\n },\r\n\r\n /**\r\n * Destroys this Pointer Constraint instance and all of its references.\r\n *\r\n * @method Phaser.Physics.Matter.PointerConstraint#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.world.removeConstraint(this.constraint);\r\n\r\n this.pointer = null;\r\n this.constraint = null;\r\n this.body = null;\r\n this.part = null;\r\n\r\n this.world.off(Events.BEFORE_UPDATE, this.update);\r\n\r\n this.scene.sys.input.off(InputEvents.POINTER_DOWN, this.onDown, this);\r\n this.scene.sys.input.off(InputEvents.POINTER_UP, this.onUp, this);\r\n }\r\n\r\n});\r\n\r\nmodule.exports = PointerConstraint;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/PointerConstraint.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/World.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/World.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Bodies = __webpack_require__(/*! ./lib/factory/Bodies */ \"./node_modules/phaser/src/physics/matter-js/lib/factory/Bodies.js\");\r\nvar Body = __webpack_require__(/*! ./lib/body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Common = __webpack_require__(/*! ./lib/core/Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\nvar Composite = __webpack_require__(/*! ./lib/body/Composite */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Composite.js\");\r\nvar Engine = __webpack_require__(/*! ./lib/core/Engine */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Engine.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/physics/matter-js/events/index.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar MatterBody = __webpack_require__(/*! ./lib/body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\nvar MatterEvents = __webpack_require__(/*! ./lib/core/Events */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Events.js\");\r\nvar MatterTileBody = __webpack_require__(/*! ./MatterTileBody */ \"./node_modules/phaser/src/physics/matter-js/MatterTileBody.js\");\r\nvar MatterWorld = __webpack_require__(/*! ./lib/body/World */ \"./node_modules/phaser/src/physics/matter-js/lib/body/World.js\");\r\nvar Vector = __webpack_require__(/*! ./lib/geometry/Vector */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vector.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Matter World class is responsible for managing one single instance of a Matter Physics World for Phaser.\r\n * \r\n * Access this via `this.matter.world` from within a Scene.\r\n * \r\n * This class creates a Matter JS World Composite along with the Matter JS Engine during instantiation. It also\r\n * handles delta timing, bounds, body and constraint creation and debug drawing.\r\n * \r\n * If you wish to access the Matter JS World object directly, see the `localWorld` property.\r\n * If you wish to access the Matter Engine directly, see the `engine` property.\r\n * \r\n * This class is an Event Emitter and will proxy _all_ Matter JS events, as they are received.\r\n *\r\n * @class World\r\n * @extends Phaser.Events.EventEmitter\r\n * @memberof Phaser.Physics.Matter\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Matter World instance belongs.\r\n * @param {Phaser.Types.Physics.Matter.MatterWorldConfig} config - The Matter World configuration object.\r\n */\r\nvar World = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function World (scene, config)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * The Scene to which this Matter World instance belongs.\r\n *\r\n * @name Phaser.Physics.Matter.World#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * An instance of the MatterJS Engine.\r\n *\r\n * @name Phaser.Physics.Matter.World#engine\r\n * @type {MatterJS.Engine}\r\n * @since 3.0.0\r\n */\r\n this.engine = Engine.create(config);\r\n\r\n /**\r\n * A `World` composite object that will contain all simulated bodies and constraints.\r\n *\r\n * @name Phaser.Physics.Matter.World#localWorld\r\n * @type {MatterJS.World}\r\n * @since 3.0.0\r\n */\r\n this.localWorld = this.engine.world;\r\n\r\n var gravity = GetValue(config, 'gravity', null);\r\n\r\n if (gravity)\r\n {\r\n this.setGravity(gravity.x, gravity.y, gravity.scale);\r\n }\r\n else if (gravity === false)\r\n {\r\n this.setGravity(0, 0, 0);\r\n }\r\n\r\n /**\r\n * An object containing the 4 wall bodies that bound the physics world.\r\n *\r\n * @name Phaser.Physics.Matter.World#walls\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.walls = { left: null, right: null, top: null, bottom: null };\r\n\r\n /**\r\n * A flag that toggles if the world is enabled or not.\r\n *\r\n * @name Phaser.Physics.Matter.World#enabled\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.enabled = GetValue(config, 'enabled', true);\r\n\r\n /**\r\n * The correction argument is an optional Number that specifies the time correction factor to apply to the update.\r\n * This can help improve the accuracy of the simulation in cases where delta is changing between updates.\r\n * The value of correction is defined as delta / lastDelta, i.e. the percentage change of delta over the last step.\r\n * Therefore the value is always 1 (no correction) when delta is constant (or when no correction is desired, which is the default).\r\n * See the paper on Time Corrected Verlet for more information.\r\n *\r\n * @name Phaser.Physics.Matter.World#correction\r\n * @type {number}\r\n * @default 1\r\n * @since 3.4.0\r\n */\r\n this.correction = GetValue(config, 'correction', 1);\r\n\r\n /**\r\n * This function is called every time the core game loop steps, which is bound to the\r\n * Request Animation Frame frequency unless otherwise modified.\r\n * \r\n * The function is passed two values: `time` and `delta`, both of which come from the game step values.\r\n * \r\n * It must return a number. This number is used as the delta value passed to Matter.Engine.update.\r\n * \r\n * You can override this function with your own to define your own timestep.\r\n * \r\n * If you need to update the Engine multiple times in a single game step then call\r\n * `World.update` as many times as required. Each call will trigger the `getDelta` function.\r\n * If you wish to have full control over when the Engine updates then see the property `autoUpdate`.\r\n *\r\n * You can also adjust the number of iterations that Engine.update performs.\r\n * Use the Scene Matter Physics config object to set the following properties:\r\n *\r\n * positionIterations (defaults to 6)\r\n * velocityIterations (defaults to 4)\r\n * constraintIterations (defaults to 2)\r\n *\r\n * Adjusting these values can help performance in certain situations, depending on the physics requirements\r\n * of your game.\r\n *\r\n * @name Phaser.Physics.Matter.World#getDelta\r\n * @type {function}\r\n * @since 3.4.0\r\n */\r\n this.getDelta = GetValue(config, 'getDelta', this.update60Hz);\r\n\r\n var runnerConfig = GetFastValue(config, 'runner', {});\r\n\r\n var hasFPS = GetFastValue(runnerConfig, 'fps', false);\r\n\r\n var fps = GetFastValue(runnerConfig, 'fps', 60);\r\n\r\n var delta = GetFastValue(runnerConfig, 'delta', 1000 / fps);\r\n var deltaMin = GetFastValue(runnerConfig, 'deltaMin', 1000 / fps);\r\n var deltaMax = GetFastValue(runnerConfig, 'deltaMax', 1000 / (fps * 0.5));\r\n\r\n if (!hasFPS)\r\n {\r\n fps = 1000 / delta;\r\n }\r\n\r\n /**\r\n * The Matter JS Runner Configuration object.\r\n * \r\n * This object is populated via the Matter Configuration object's `runner` property and is\r\n * updated constantly during the game step.\r\n *\r\n * @name Phaser.Physics.Matter.World#runner\r\n * @type {Phaser.Types.Physics.Matter.MatterRunnerConfig}\r\n * @since 3.22.0\r\n */\r\n this.runner = {\r\n fps: fps,\r\n correction: GetFastValue(runnerConfig, 'correction', 1),\r\n deltaSampleSize: GetFastValue(runnerConfig, 'deltaSampleSize', 60),\r\n counterTimestamp: 0,\r\n frameCounter: 0,\r\n deltaHistory: [],\r\n timePrev: null,\r\n timeScalePrev: 1,\r\n frameRequestId: null,\r\n isFixed: GetFastValue(runnerConfig, 'isFixed', false),\r\n delta: delta,\r\n deltaMin: deltaMin,\r\n deltaMax: deltaMax\r\n };\r\n\r\n /**\r\n * Automatically call Engine.update every time the game steps.\r\n * If you disable this then you are responsible for calling `World.step` directly from your game.\r\n * If you call `set60Hz` or `set30Hz` then `autoUpdate` is reset to `true`.\r\n *\r\n * @name Phaser.Physics.Matter.World#autoUpdate\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.4.0\r\n */\r\n this.autoUpdate = GetValue(config, 'autoUpdate', true);\r\n\r\n var debugConfig = GetValue(config, 'debug', false);\r\n\r\n /**\r\n * A flag that controls if the debug graphics will be drawn to or not.\r\n *\r\n * @name Phaser.Physics.Matter.World#drawDebug\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.drawDebug = (typeof(debugConfig) === 'object') ? true : debugConfig;\r\n\r\n /**\r\n * An instance of the Graphics object the debug bodies are drawn to, if enabled.\r\n *\r\n * @name Phaser.Physics.Matter.World#debugGraphic\r\n * @type {Phaser.GameObjects.Graphics}\r\n * @since 3.0.0\r\n */\r\n this.debugGraphic;\r\n\r\n /**\r\n * The debug configuration object.\r\n * \r\n * The values stored in this object are read from the Matter World Config `debug` property.\r\n * \r\n * When a new Body or Constraint is _added to the World_, they are given the values stored in this object,\r\n * unless they have their own `render` object set that will override them.\r\n * \r\n * Note that while you can modify the values of properties in this object at run-time, it will not change\r\n * any of the Matter objects _already added_. It will only impact objects newly added to the world, or one\r\n * that is removed and then re-added at a later time.\r\n *\r\n * @name Phaser.Physics.Matter.World#debugConfig\r\n * @type {Phaser.Types.Physics.Matter.MatterDebugConfig}\r\n * @since 3.22.0\r\n */\r\n this.debugConfig = {\r\n showAxes: GetFastValue(debugConfig, 'showAxes', false),\r\n showAngleIndicator: GetFastValue(debugConfig, 'showAngleIndicator', false),\r\n angleColor: GetFastValue(debugConfig, 'angleColor', 0xe81153),\r\n\r\n showBroadphase: GetFastValue(debugConfig, 'showBroadphase', false),\r\n broadphaseColor: GetFastValue(debugConfig, 'broadphaseColor', 0xffb400),\r\n\r\n showBounds: GetFastValue(debugConfig, 'showBounds', false),\r\n boundsColor: GetFastValue(debugConfig, 'boundsColor', 0xffffff),\r\n\r\n showVelocity: GetFastValue(debugConfig, 'showVelocity', false),\r\n velocityColor: GetFastValue(debugConfig, 'velocityColor', 0x00aeef),\r\n\r\n showCollisions: GetFastValue(debugConfig, 'showCollisions', false),\r\n collisionColor: GetFastValue(debugConfig, 'collisionColor', 0xf5950c),\r\n\r\n showSeparations: GetFastValue(debugConfig, 'showSeparations', false),\r\n separationColor: GetFastValue(debugConfig, 'separationColor', 0xffa500),\r\n\r\n showBody: GetFastValue(debugConfig, 'showBody', true),\r\n showStaticBody: GetFastValue(debugConfig, 'showStaticBody', true),\r\n showInternalEdges: GetFastValue(debugConfig, 'showInternalEdges', false),\r\n\r\n renderFill: GetFastValue(debugConfig, 'renderFill', false),\r\n renderLine: GetFastValue(debugConfig, 'renderLine', true),\r\n\r\n fillColor: GetFastValue(debugConfig, 'fillColor', 0x106909),\r\n fillOpacity: GetFastValue(debugConfig, 'fillOpacity', 1),\r\n lineColor: GetFastValue(debugConfig, 'lineColor', 0x28de19),\r\n lineOpacity: GetFastValue(debugConfig, 'lineOpacity', 1),\r\n lineThickness: GetFastValue(debugConfig, 'lineThickness', 1),\r\n\r\n staticFillColor: GetFastValue(debugConfig, 'staticFillColor', 0x0d177b),\r\n staticLineColor: GetFastValue(debugConfig, 'staticLineColor', 0x1327e4),\r\n\r\n showSleeping: GetFastValue(debugConfig, 'showSleeping', false),\r\n staticBodySleepOpacity: GetFastValue(debugConfig, 'staticBodySleepOpacity', 0.7),\r\n sleepFillColor: GetFastValue(debugConfig, 'sleepFillColor', 0x464646),\r\n sleepLineColor: GetFastValue(debugConfig, 'sleepLineColor', 0x999a99),\r\n\r\n showSensors: GetFastValue(debugConfig, 'showSensors', true),\r\n sensorFillColor: GetFastValue(debugConfig, 'sensorFillColor', 0x0d177b),\r\n sensorLineColor: GetFastValue(debugConfig, 'sensorLineColor', 0x1327e4),\r\n\r\n showPositions: GetFastValue(debugConfig, 'showPositions', true),\r\n positionSize: GetFastValue(debugConfig, 'positionSize', 4),\r\n positionColor: GetFastValue(debugConfig, 'positionColor', 0xe042da),\r\n\r\n showJoint: GetFastValue(debugConfig, 'showJoint', true),\r\n jointColor: GetFastValue(debugConfig, 'jointColor', 0xe0e042),\r\n jointLineOpacity: GetFastValue(debugConfig, 'jointLineOpacity', 1),\r\n jointLineThickness: GetFastValue(debugConfig, 'jointLineThickness', 2),\r\n\r\n pinSize: GetFastValue(debugConfig, 'pinSize', 4),\r\n pinColor: GetFastValue(debugConfig, 'pinColor', 0x42e0e0),\r\n\r\n springColor: GetFastValue(debugConfig, 'springColor', 0xe042e0),\r\n\r\n anchorColor: GetFastValue(debugConfig, 'anchorColor', 0xefefef),\r\n anchorSize: GetFastValue(debugConfig, 'anchorSize', 4),\r\n\r\n showConvexHulls: GetFastValue(debugConfig, 'showConvexHulls', false),\r\n hullColor: GetFastValue(debugConfig, 'hullColor', 0xd703d0)\r\n };\r\n\r\n if (this.drawDebug)\r\n {\r\n this.createDebugGraphic();\r\n }\r\n\r\n this.setEventsProxy();\r\n\r\n // Create the walls\r\n\r\n if (GetFastValue(config, 'setBounds', false))\r\n {\r\n var boundsConfig = config['setBounds'];\r\n\r\n if (typeof boundsConfig === 'boolean')\r\n {\r\n this.setBounds();\r\n }\r\n else\r\n {\r\n var x = GetFastValue(boundsConfig, 'x', 0);\r\n var y = GetFastValue(boundsConfig, 'y', 0);\r\n var width = GetFastValue(boundsConfig, 'width', scene.sys.scale.width);\r\n var height = GetFastValue(boundsConfig, 'height', scene.sys.scale.height);\r\n var thickness = GetFastValue(boundsConfig, 'thickness', 64);\r\n var left = GetFastValue(boundsConfig, 'left', true);\r\n var right = GetFastValue(boundsConfig, 'right', true);\r\n var top = GetFastValue(boundsConfig, 'top', true);\r\n var bottom = GetFastValue(boundsConfig, 'bottom', true);\r\n\r\n this.setBounds(x, y, width, height, thickness, left, right, top, bottom);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Sets the debug render style for the children of the given Matter Composite.\r\n * \r\n * Composites themselves do not render, but they can contain bodies, constraints and other composites that may do.\r\n * So the children of this composite are passed to the `setBodyRenderStyle`, `setCompositeRenderStyle` and\r\n * `setConstraintRenderStyle` methods accordingly.\r\n * \r\n * @method Phaser.Physics.Matter.World#setCompositeRenderStyle\r\n * @since 3.22.0\r\n *\r\n * @param {MatterJS.CompositeType} composite - The Matter Composite to set the render style on.\r\n * \r\n * @return {this} This Matter World instance for method chaining.\r\n */\r\n setCompositeRenderStyle: function (composite)\r\n {\r\n var bodies = composite.bodies;\r\n var constraints = composite.constraints;\r\n var composites = composite.composites;\r\n\r\n var i;\r\n var obj;\r\n var render;\r\n\r\n for (i = 0; i < bodies.length; i++)\r\n {\r\n obj = bodies[i];\r\n render = obj.render;\r\n\r\n this.setBodyRenderStyle(obj, render.lineColor, render.lineOpacity, render.lineThickness, render.fillColor, render.fillOpacity);\r\n }\r\n\r\n for (i = 0; i < constraints.length; i++)\r\n {\r\n obj = constraints[i];\r\n render = obj.render;\r\n\r\n this.setConstraintRenderStyle(obj, render.lineColor, render.lineOpacity, render.lineThickness, render.pinSize, render.anchorColor, render.anchorSize);\r\n }\r\n\r\n for (i = 0; i < composites.length; i++)\r\n {\r\n obj = composites[i];\r\n\r\n this.setCompositeRenderStyle(obj);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the debug render style for the given Matter Body.\r\n * \r\n * If you are using this on a Phaser Game Object, such as a Matter Sprite, then pass in the body property\r\n * to this method, not the Game Object itself.\r\n * \r\n * If you wish to skip a parameter, so it retains its current value, pass `false` for it.\r\n * \r\n * If you wish to reset the Body render colors to the defaults found in the World Debug Config, then call\r\n * this method with just the `body` parameter provided and no others.\r\n * \r\n * @method Phaser.Physics.Matter.World#setBodyRenderStyle\r\n * @since 3.22.0\r\n *\r\n * @param {MatterJS.BodyType} body - The Matter Body to set the render style on.\r\n * @param {number} [lineColor] - The line color. If `null` it will use the World Debug Config value.\r\n * @param {number} [lineOpacity] - The line opacity, between 0 and 1. If `null` it will use the World Debug Config value.\r\n * @param {number} [lineThickness] - The line thickness. If `null` it will use the World Debug Config value.\r\n * @param {number} [fillColor] - The fill color. If `null` it will use the World Debug Config value.\r\n * @param {number} [fillOpacity] - The fill opacity, between 0 and 1. If `null` it will use the World Debug Config value.\r\n * \r\n * @return {this} This Matter World instance for method chaining.\r\n */\r\n setBodyRenderStyle: function (body, lineColor, lineOpacity, lineThickness, fillColor, fillOpacity)\r\n {\r\n var render = body.render;\r\n var config = this.debugConfig;\r\n\r\n if (!render)\r\n {\r\n return this;\r\n }\r\n\r\n if (lineColor === undefined || lineColor === null)\r\n {\r\n lineColor = (body.isStatic) ? config.staticLineColor : config.lineColor;\r\n }\r\n\r\n if (lineOpacity === undefined || lineOpacity === null)\r\n {\r\n lineOpacity = config.lineOpacity;\r\n }\r\n\r\n if (lineThickness === undefined || lineThickness === null)\r\n {\r\n lineThickness = config.lineThickness;\r\n }\r\n\r\n if (fillColor === undefined || fillColor === null)\r\n {\r\n fillColor = (body.isStatic) ? config.staticFillColor : config.fillColor;\r\n }\r\n\r\n if (fillOpacity === undefined || fillOpacity === null)\r\n {\r\n fillOpacity = config.fillOpacity;\r\n }\r\n\r\n if (lineColor !== false)\r\n {\r\n render.lineColor = lineColor;\r\n }\r\n\r\n if (lineOpacity !== false)\r\n {\r\n render.lineOpacity = lineOpacity;\r\n }\r\n\r\n if (lineThickness !== false)\r\n {\r\n render.lineThickness = lineThickness;\r\n }\r\n\r\n if (fillColor !== false)\r\n {\r\n render.fillColor = fillColor;\r\n }\r\n\r\n if (fillOpacity !== false)\r\n {\r\n render.fillOpacity = fillOpacity;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the debug render style for the given Matter Constraint.\r\n * \r\n * If you are using this on a Phaser Game Object, then pass in the body property\r\n * to this method, not the Game Object itself.\r\n * \r\n * If you wish to skip a parameter, so it retains its current value, pass `false` for it.\r\n * \r\n * If you wish to reset the Constraint render colors to the defaults found in the World Debug Config, then call\r\n * this method with just the `constraint` parameter provided and no others.\r\n * \r\n * @method Phaser.Physics.Matter.World#setConstraintRenderStyle\r\n * @since 3.22.0\r\n *\r\n * @param {MatterJS.ConstraintType} constraint - The Matter Constraint to set the render style on.\r\n * @param {number} [lineColor] - The line color. If `null` it will use the World Debug Config value.\r\n * @param {number} [lineOpacity] - The line opacity, between 0 and 1. If `null` it will use the World Debug Config value.\r\n * @param {number} [lineThickness] - The line thickness. If `null` it will use the World Debug Config value.\r\n * @param {number} [pinSize] - If this constraint is a pin, this sets the size of the pin circle. If `null` it will use the World Debug Config value.\r\n * @param {number} [anchorColor] - The color used when rendering this constraints anchors. If `null` it will use the World Debug Config value.\r\n * @param {number} [anchorSize] - The size of the anchor circle, if this constraint has anchors. If `null` it will use the World Debug Config value.\r\n * \r\n * @return {this} This Matter World instance for method chaining.\r\n */\r\n setConstraintRenderStyle: function (constraint, lineColor, lineOpacity, lineThickness, pinSize, anchorColor, anchorSize)\r\n {\r\n var render = constraint.render;\r\n var config = this.debugConfig;\r\n\r\n if (!render)\r\n {\r\n return this;\r\n }\r\n\r\n // Reset them\r\n if (lineColor === undefined || lineColor === null)\r\n {\r\n var type = render.type;\r\n\r\n if (type === 'line')\r\n {\r\n lineColor = config.jointColor;\r\n }\r\n else if (type === 'pin')\r\n {\r\n lineColor = config.pinColor;\r\n }\r\n else if (type === 'spring')\r\n {\r\n lineColor = config.springColor;\r\n }\r\n }\r\n\r\n if (lineOpacity === undefined || lineOpacity === null)\r\n {\r\n lineOpacity = config.jointLineOpacity;\r\n }\r\n\r\n if (lineThickness === undefined || lineThickness === null)\r\n {\r\n lineThickness = config.jointLineThickness;\r\n }\r\n\r\n if (pinSize === undefined || pinSize === null)\r\n {\r\n pinSize = config.pinSize;\r\n }\r\n\r\n if (anchorColor === undefined || anchorColor === null)\r\n {\r\n anchorColor = config.anchorColor;\r\n }\r\n\r\n if (anchorSize === undefined || anchorSize === null)\r\n {\r\n anchorSize = config.anchorSize;\r\n }\r\n\r\n if (lineColor !== false)\r\n {\r\n render.lineColor = lineColor;\r\n }\r\n\r\n if (lineOpacity !== false)\r\n {\r\n render.lineOpacity = lineOpacity;\r\n }\r\n\r\n if (lineThickness !== false)\r\n {\r\n render.lineThickness = lineThickness;\r\n }\r\n\r\n if (pinSize !== false)\r\n {\r\n render.pinSize = pinSize;\r\n }\r\n\r\n if (anchorColor !== false)\r\n {\r\n render.anchorColor = anchorColor;\r\n }\r\n\r\n if (anchorSize !== false)\r\n {\r\n render.anchorSize = anchorSize;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * This internal method acts as a proxy between all of the Matter JS events and then re-emits them\r\n * via this class.\r\n *\r\n * @method Phaser.Physics.Matter.World#setEventsProxy\r\n * @since 3.0.0\r\n */\r\n setEventsProxy: function ()\r\n {\r\n var _this = this;\r\n var engine = this.engine;\r\n var world = this.localWorld;\r\n\r\n // Inject debug styles\r\n\r\n if (this.drawDebug)\r\n {\r\n MatterEvents.on(world, 'compositeModified', function (composite)\r\n {\r\n _this.setCompositeRenderStyle(composite);\r\n });\r\n\r\n MatterEvents.on(world, 'beforeAdd', function (event)\r\n {\r\n var objects = [].concat(event.object);\r\n \r\n for (var i = 0; i < objects.length; i++)\r\n {\r\n var obj = objects[i];\r\n var render = obj.render;\r\n \r\n if (obj.type === 'body')\r\n {\r\n _this.setBodyRenderStyle(obj, render.lineColor, render.lineOpacity, render.lineThickness, render.fillColor, render.fillOpacity);\r\n }\r\n else if (obj.type === 'composite')\r\n {\r\n _this.setCompositeRenderStyle(obj);\r\n }\r\n else if (obj.type === 'constraint')\r\n {\r\n _this.setConstraintRenderStyle(obj, render.lineColor, render.lineOpacity, render.lineThickness, render.pinSize, render.anchorColor, render.anchorSize);\r\n }\r\n }\r\n });\r\n }\r\n\r\n MatterEvents.on(world, 'beforeAdd', function (event)\r\n {\r\n _this.emit(Events.BEFORE_ADD, event);\r\n });\r\n\r\n MatterEvents.on(world, 'afterAdd', function (event)\r\n {\r\n _this.emit(Events.AFTER_ADD, event);\r\n });\r\n\r\n MatterEvents.on(world, 'beforeRemove', function (event)\r\n {\r\n _this.emit(Events.BEFORE_REMOVE, event);\r\n });\r\n\r\n MatterEvents.on(world, 'afterRemove', function (event)\r\n {\r\n _this.emit(Events.AFTER_REMOVE, event);\r\n });\r\n\r\n MatterEvents.on(engine, 'beforeUpdate', function (event)\r\n {\r\n _this.emit(Events.BEFORE_UPDATE, event);\r\n });\r\n\r\n MatterEvents.on(engine, 'afterUpdate', function (event)\r\n {\r\n _this.emit(Events.AFTER_UPDATE, event);\r\n });\r\n\r\n MatterEvents.on(engine, 'collisionStart', function (event)\r\n {\r\n var pairs = event.pairs;\r\n var bodyA;\r\n var bodyB;\r\n\r\n if (pairs.length > 0)\r\n {\r\n bodyA = pairs[0].bodyA;\r\n bodyB = pairs[0].bodyB;\r\n }\r\n\r\n _this.emit(Events.COLLISION_START, event, bodyA, bodyB);\r\n });\r\n\r\n MatterEvents.on(engine, 'collisionActive', function (event)\r\n {\r\n var pairs = event.pairs;\r\n var bodyA;\r\n var bodyB;\r\n\r\n if (pairs.length > 0)\r\n {\r\n bodyA = pairs[0].bodyA;\r\n bodyB = pairs[0].bodyB;\r\n }\r\n\r\n _this.emit(Events.COLLISION_ACTIVE, event, bodyA, bodyB);\r\n });\r\n\r\n MatterEvents.on(engine, 'collisionEnd', function (event)\r\n {\r\n var pairs = event.pairs;\r\n var bodyA;\r\n var bodyB;\r\n\r\n if (pairs.length > 0)\r\n {\r\n bodyA = pairs[0].bodyA;\r\n bodyB = pairs[0].bodyB;\r\n }\r\n\r\n _this.emit(Events.COLLISION_END, event, bodyA, bodyB);\r\n });\r\n },\r\n\r\n /**\r\n * Sets the bounds of the Physics world to match the given world pixel dimensions.\r\n * You can optionally set which 'walls' to create: left, right, top or bottom.\r\n * If none of the walls are given it will default to use the walls settings it had previously.\r\n * I.e. if you previously told it to not have the left or right walls, and you then adjust the world size\r\n * the newly created bounds will also not have the left and right walls.\r\n * Explicitly state them in the parameters to override this.\r\n *\r\n * @method Phaser.Physics.Matter.World#setBounds\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The x coordinate of the top-left corner of the bounds.\r\n * @param {number} [y=0] - The y coordinate of the top-left corner of the bounds.\r\n * @param {number} [width] - The width of the bounds.\r\n * @param {number} [height] - The height of the bounds.\r\n * @param {number} [thickness=64] - The thickness of each wall, in pixels.\r\n * @param {boolean} [left=true] - If true will create the left bounds wall.\r\n * @param {boolean} [right=true] - If true will create the right bounds wall.\r\n * @param {boolean} [top=true] - If true will create the top bounds wall.\r\n * @param {boolean} [bottom=true] - If true will create the bottom bounds wall.\r\n *\r\n * @return {Phaser.Physics.Matter.World} This Matter World object.\r\n */\r\n setBounds: function (x, y, width, height, thickness, left, right, top, bottom)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = this.scene.sys.scale.width; }\r\n if (height === undefined) { height = this.scene.sys.scale.height; }\r\n if (thickness === undefined) { thickness = 64; }\r\n if (left === undefined) { left = true; }\r\n if (right === undefined) { right = true; }\r\n if (top === undefined) { top = true; }\r\n if (bottom === undefined) { bottom = true; }\r\n\r\n this.updateWall(left, 'left', x - thickness, y - thickness, thickness, height + (thickness * 2));\r\n this.updateWall(right, 'right', x + width, y - thickness, thickness, height + (thickness * 2));\r\n this.updateWall(top, 'top', x, y - thickness, width, thickness);\r\n this.updateWall(bottom, 'bottom', x, y + height, width, thickness);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Updates the 4 rectangle bodies that were created, if `setBounds` was set in the Matter config, to use\r\n * the new positions and sizes. This method is usually only called internally via the `setBounds` method.\r\n *\r\n * @method Phaser.Physics.Matter.World#updateWall\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} add - `true` if the walls are being added or updated, `false` to remove them from the world.\r\n * @param {string} [position] - Either `left`, `right`, `top` or `bottom`. Only optional if `add` is `false`.\r\n * @param {number} [x] - The horizontal position to place the walls at. Only optional if `add` is `false`.\r\n * @param {number} [y] - The vertical position to place the walls at. Only optional if `add` is `false`.\r\n * @param {number} [width] - The width of the walls, in pixels. Only optional if `add` is `false`.\r\n * @param {number} [height] - The height of the walls, in pixels. Only optional if `add` is `false`.\r\n */\r\n updateWall: function (add, position, x, y, width, height)\r\n {\r\n var wall = this.walls[position];\r\n\r\n if (add)\r\n {\r\n if (wall)\r\n {\r\n MatterWorld.remove(this.localWorld, wall);\r\n }\r\n\r\n // adjust center\r\n x += (width / 2);\r\n y += (height / 2);\r\n\r\n this.walls[position] = this.create(x, y, width, height, { isStatic: true, friction: 0, frictionStatic: 0 });\r\n }\r\n else\r\n {\r\n if (wall)\r\n {\r\n MatterWorld.remove(this.localWorld, wall);\r\n }\r\n\r\n this.walls[position] = null;\r\n }\r\n },\r\n\r\n /**\r\n * Creates a Phaser.GameObjects.Graphics object that is used to render all of the debug bodies and joints to.\r\n * \r\n * This method is called automatically by the constructor, if debugging has been enabled.\r\n * \r\n * The created Graphics object is automatically added to the Scene at 0x0 and given a depth of `Number.MAX_VALUE`,\r\n * so it renders above all else in the Scene.\r\n * \r\n * The Graphics object is assigned to the `debugGraphic` property of this class and `drawDebug` is enabled.\r\n *\r\n * @method Phaser.Physics.Matter.World#createDebugGraphic\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.GameObjects.Graphics} The newly created Graphics object.\r\n */\r\n createDebugGraphic: function ()\r\n {\r\n var graphic = this.scene.sys.add.graphics({ x: 0, y: 0 });\r\n\r\n graphic.setDepth(Number.MAX_VALUE);\r\n\r\n this.debugGraphic = graphic;\r\n\r\n this.drawDebug = true;\r\n\r\n return graphic;\r\n },\r\n\r\n /**\r\n * Sets the world gravity and gravity scale to 0.\r\n *\r\n * @method Phaser.Physics.Matter.World#disableGravity\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Matter World object.\r\n */\r\n disableGravity: function ()\r\n {\r\n this.localWorld.gravity.x = 0;\r\n this.localWorld.gravity.y = 0;\r\n this.localWorld.gravity.scale = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the worlds gravity to the values given.\r\n * \r\n * Gravity effects all bodies in the world, unless they have the `ignoreGravity` flag set.\r\n *\r\n * @method Phaser.Physics.Matter.World#setGravity\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The world gravity x component.\r\n * @param {number} [y=1] - The world gravity y component.\r\n * @param {number} [scale=0.001] - The gravity scale factor.\r\n *\r\n * @return {this} This Matter World object.\r\n */\r\n setGravity: function (x, y, scale)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 1; }\r\n\r\n this.localWorld.gravity.x = x;\r\n this.localWorld.gravity.y = y;\r\n\r\n if (scale !== undefined)\r\n {\r\n this.localWorld.gravity.scale = scale;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a rectangle Matter body and adds it to the world.\r\n *\r\n * @method Phaser.Physics.Matter.World#create\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal position of the body in the world.\r\n * @param {number} y - The vertical position of the body in the world.\r\n * @param {number} width - The width of the body.\r\n * @param {number} height - The height of the body.\r\n * @param {object} options - Optional Matter configuration object.\r\n *\r\n * @return {MatterJS.BodyType} The Matter.js body that was created.\r\n */\r\n create: function (x, y, width, height, options)\r\n {\r\n var body = Bodies.rectangle(x, y, width, height, options);\r\n\r\n MatterWorld.add(this.localWorld, body);\r\n\r\n return body;\r\n },\r\n\r\n /**\r\n * Adds a Matter JS object, or array of objects, to the world.\r\n * \r\n * The objects should be valid Matter JS entities, such as a Body, Composite or Constraint.\r\n * \r\n * Triggers `beforeAdd` and `afterAdd` events.\r\n *\r\n * @method Phaser.Physics.Matter.World#add\r\n * @since 3.0.0\r\n *\r\n * @param {(object|object[])} object - Can be single object, or an array, and can be a body, composite or constraint.\r\n *\r\n * @return {this} This Matter World object.\r\n */\r\n add: function (object)\r\n {\r\n MatterWorld.add(this.localWorld, object);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes a Matter JS object, or array of objects, from the world.\r\n * \r\n * The objects should be valid Matter JS entities, such as a Body, Composite or Constraint.\r\n * \r\n * Triggers `beforeRemove` and `afterRemove` events.\r\n *\r\n * @method Phaser.Physics.Matter.World#remove\r\n * @since 3.0.0\r\n *\r\n * @param {(object|object[])} object - Can be single object, or an array, and can be a body, composite or constraint.\r\n * @param {boolean} [deep=false] - Optionally search the objects children and recursively remove those as well.\r\n *\r\n * @return {this} This Matter World object.\r\n */\r\n remove: function (object, deep)\r\n {\r\n if (!Array.isArray(object))\r\n {\r\n object = [ object ];\r\n }\r\n\r\n for (var i = 0; i < object.length; i++)\r\n {\r\n var entity = object[i];\r\n\r\n var body = (entity.body) ? entity.body : entity;\r\n\r\n Composite.remove(this.localWorld, body, deep);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes a Matter JS constraint, or array of constraints, from the world.\r\n * \r\n * Triggers `beforeRemove` and `afterRemove` events.\r\n *\r\n * @method Phaser.Physics.Matter.World#removeConstraint\r\n * @since 3.0.0\r\n *\r\n * @param {(MatterJS.ConstraintType|MatterJS.ConstraintType[])} constraint - A Matter JS Constraint, or an array of constraints, to be removed.\r\n * @param {boolean} [deep=false] - Optionally search the objects children and recursively remove those as well.\r\n *\r\n * @return {this} This Matter World object.\r\n */\r\n removeConstraint: function (constraint, deep)\r\n {\r\n Composite.remove(this.localWorld, constraint, deep);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds `MatterTileBody` instances for all the colliding tiles within the given tilemap layer.\r\n * \r\n * Set the appropriate tiles in your layer to collide before calling this method!\r\n *\r\n * @method Phaser.Physics.Matter.World#convertTilemapLayer\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer -\r\n * An array of tiles.\r\n * @param {object} [options] - Options to be passed to the MatterTileBody constructor. {@see Phaser.Physics.Matter.TileBody}\r\n *\r\n * @return {this} This Matter World object.\r\n */\r\n convertTilemapLayer: function (tilemapLayer, options)\r\n {\r\n var layerData = tilemapLayer.layer;\r\n var tiles = tilemapLayer.getTilesWithin(0, 0, layerData.width, layerData.height, { isColliding: true });\r\n\r\n this.convertTiles(tiles, options);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds `MatterTileBody` instances for the given tiles. This adds bodies regardless of whether the\r\n * tiles are set to collide or not.\r\n *\r\n * @method Phaser.Physics.Matter.World#convertTiles\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tilemaps.Tile[]} tiles - An array of tiles.\r\n * @param {object} [options] - Options to be passed to the MatterTileBody constructor. {@see Phaser.Physics.Matter.TileBody}\r\n *\r\n * @return {this} This Matter World object.\r\n */\r\n convertTiles: function (tiles, options)\r\n {\r\n if (tiles.length === 0)\r\n {\r\n return this;\r\n }\r\n\r\n for (var i = 0; i < tiles.length; i++)\r\n {\r\n new MatterTileBody(this, tiles[i], options);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns the next unique group index for which bodies will collide.\r\n * If `isNonColliding` is `true`, returns the next unique group index for which bodies will not collide.\r\n *\r\n * @method Phaser.Physics.Matter.World#nextGroup\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [isNonColliding=false] - If `true`, returns the next unique group index for which bodies will _not_ collide.\r\n *\r\n * @return {number} Unique category bitfield\r\n */\r\n nextGroup: function (isNonColliding)\r\n {\r\n return MatterBody.nextGroup(isNonColliding);\r\n },\r\n\r\n /**\r\n * Returns the next unique category bitfield (starting after the initial default category 0x0001).\r\n * There are 32 available.\r\n *\r\n * @method Phaser.Physics.Matter.World#nextCategory\r\n * @since 3.0.0\r\n *\r\n * @return {number} Unique category bitfield\r\n */\r\n nextCategory: function ()\r\n {\r\n return MatterBody.nextCategory();\r\n },\r\n\r\n /**\r\n * Pauses this Matter World instance and sets `enabled` to `false`.\r\n * \r\n * A paused world will not run any simulations for the duration it is paused.\r\n *\r\n * @method Phaser.Physics.Matter.World#pause\r\n * @fires Phaser.Physics.Matter.Events#PAUSE\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Matter World object.\r\n */\r\n pause: function ()\r\n {\r\n this.enabled = false;\r\n\r\n this.emit(Events.PAUSE);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resumes this Matter World instance from a paused state and sets `enabled` to `true`.\r\n *\r\n * @method Phaser.Physics.Matter.World#resume\r\n * @fires Phaser.Physics.Matter.Events#RESUME\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Matter World object.\r\n */\r\n resume: function ()\r\n {\r\n this.enabled = true;\r\n\r\n this.emit(Events.RESUME);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The internal update method. This is called automatically by the parent Scene.\r\n * \r\n * Moves the simulation forward in time by delta ms. Uses `World.correction` value as an optional number that\r\n * specifies the time correction factor to apply to the update. This can help improve the accuracy of the\r\n * simulation in cases where delta is changing between updates. The value of correction is defined as `delta / lastDelta`,\r\n * i.e. the percentage change of delta over the last step. Therefore the value is always 1 (no correction) when\r\n * delta is constant (or when no correction is desired, which is the default).\r\n * See the paper on Time Corrected Verlet for more information.\r\n * \r\n * Triggers `beforeUpdate` and `afterUpdate` events. Triggers `collisionStart`, `collisionActive` and `collisionEnd` events.\r\n * \r\n * If the World is paused, `update` is still run, but exits early and does not update the Matter Engine.\r\n *\r\n * @method Phaser.Physics.Matter.World#update\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\n update: function (time, delta)\r\n {\r\n if (!this.enabled || !this.autoUpdate)\r\n {\r\n return;\r\n }\r\n\r\n var engine = this.engine;\r\n var runner = this.runner;\r\n\r\n var timing = engine.timing;\r\n var correction = this.correction;\r\n\r\n if (runner.isFixed)\r\n {\r\n // fixed timestep\r\n delta = this.getDelta(time, delta);\r\n }\r\n else\r\n {\r\n // dynamic timestep based on wall clock between calls\r\n delta = (time - runner.timePrev) || runner.delta;\r\n runner.timePrev = time;\r\n\r\n // optimistically filter delta over a few frames, to improve stability\r\n runner.deltaHistory.push(delta);\r\n runner.deltaHistory = runner.deltaHistory.slice(-runner.deltaSampleSize);\r\n delta = Math.min.apply(null, runner.deltaHistory);\r\n \r\n // limit delta\r\n delta = delta < runner.deltaMin ? runner.deltaMin : delta;\r\n delta = delta > runner.deltaMax ? runner.deltaMax : delta;\r\n\r\n // correction for delta\r\n correction = delta / runner.delta;\r\n\r\n // update engine timing object\r\n runner.delta = delta;\r\n }\r\n\r\n // time correction for time scaling\r\n if (runner.timeScalePrev !== 0)\r\n {\r\n correction *= timing.timeScale / runner.timeScalePrev;\r\n }\r\n\r\n if (timing.timeScale === 0)\r\n {\r\n correction = 0;\r\n }\r\n\r\n runner.timeScalePrev = timing.timeScale;\r\n runner.correction = correction;\r\n\r\n // fps counter\r\n runner.frameCounter += 1;\r\n\r\n if (time - runner.counterTimestamp >= 1000)\r\n {\r\n runner.fps = runner.frameCounter * ((time - runner.counterTimestamp) / 1000);\r\n runner.counterTimestamp = time;\r\n runner.frameCounter = 0;\r\n }\r\n\r\n Engine.update(engine, delta, correction);\r\n },\r\n\r\n /**\r\n * Manually advances the physics simulation by one iteration.\r\n * \r\n * You can optionally pass in the `delta` and `correction` values to be used by Engine.update.\r\n * If undefined they use the Matter defaults of 60Hz and no correction.\r\n * \r\n * Calling `step` directly bypasses any checks of `enabled` or `autoUpdate`.\r\n * \r\n * It also ignores any custom `getDelta` functions, as you should be passing the delta\r\n * value in to this call.\r\n *\r\n * You can adjust the number of iterations that Engine.update performs internally.\r\n * Use the Scene Matter Physics config object to set the following properties:\r\n *\r\n * positionIterations (defaults to 6)\r\n * velocityIterations (defaults to 4)\r\n * constraintIterations (defaults to 2)\r\n *\r\n * Adjusting these values can help performance in certain situations, depending on the physics requirements\r\n * of your game.\r\n *\r\n * @method Phaser.Physics.Matter.World#step\r\n * @since 3.4.0\r\n *\r\n * @param {number} [delta=16.666] - The delta value.\r\n * @param {number} [correction=1] - Optional delta correction value.\r\n */\r\n step: function (delta, correction)\r\n {\r\n Engine.update(this.engine, delta, correction);\r\n },\r\n\r\n /**\r\n * Runs the Matter Engine.update at a fixed timestep of 60Hz.\r\n *\r\n * @method Phaser.Physics.Matter.World#update60Hz\r\n * @since 3.4.0\r\n *\r\n * @return {number} The delta value to be passed to Engine.update.\r\n */\r\n update60Hz: function ()\r\n {\r\n return 1000 / 60;\r\n },\r\n\r\n /**\r\n * Runs the Matter Engine.update at a fixed timestep of 30Hz.\r\n *\r\n * @method Phaser.Physics.Matter.World#update30Hz\r\n * @since 3.4.0\r\n *\r\n * @return {number} The delta value to be passed to Engine.update.\r\n */\r\n update30Hz: function ()\r\n {\r\n return 1000 / 30;\r\n },\r\n\r\n /**\r\n * Returns `true` if the given body can be found within the World.\r\n *\r\n * @method Phaser.Physics.Matter.World#has\r\n * @since 3.22.0\r\n * \r\n * @param {(MatterJS.Body|Phaser.GameObjects.GameObject)} body - The Matter Body, or Game Object, to search for within the world.\r\n * \r\n * @return {MatterJS.BodyType[]} An array of all the Matter JS Bodies in this World.\r\n */\r\n has: function (body)\r\n {\r\n var src = (body.hasOwnProperty('body')) ? body.body : body;\r\n\r\n return (Composite.get(this.localWorld, src.id, src.type) !== null);\r\n },\r\n\r\n /**\r\n * Returns all the bodies in the Matter World, including all bodies in children, recursively.\r\n *\r\n * @method Phaser.Physics.Matter.World#getAllBodies\r\n * @since 3.22.0\r\n * \r\n * @return {MatterJS.BodyType[]} An array of all the Matter JS Bodies in this World.\r\n */\r\n getAllBodies: function ()\r\n {\r\n return Composite.allBodies(this.localWorld);\r\n },\r\n\r\n /**\r\n * Returns all the constraints in the Matter World, including all constraints in children, recursively.\r\n *\r\n * @method Phaser.Physics.Matter.World#getAllConstraints\r\n * @since 3.22.0\r\n * \r\n * @return {MatterJS.ConstraintType[]} An array of all the Matter JS Constraints in this World.\r\n */\r\n getAllConstraints: function ()\r\n {\r\n return Composite.allConstraints(this.localWorld);\r\n },\r\n\r\n /**\r\n * Returns all the composites in the Matter World, including all composites in children, recursively.\r\n *\r\n * @method Phaser.Physics.Matter.World#getAllComposites\r\n * @since 3.22.0\r\n * \r\n * @return {MatterJS.CompositeType[]} An array of all the Matter JS Composites in this World.\r\n */\r\n getAllComposites: function ()\r\n {\r\n return Composite.allComposites(this.localWorld);\r\n },\r\n\r\n /**\r\n * Handles the rendering of bodies and debug information to the debug Graphics object, if enabled.\r\n * \r\n * This method is called automatically by the Scene after all processing has taken place.\r\n *\r\n * @method Phaser.Physics.Matter.World#postUpdate\r\n * @private\r\n * @since 3.0.0\r\n */\r\n postUpdate: function ()\r\n {\r\n if (!this.drawDebug)\r\n {\r\n return;\r\n }\r\n\r\n var config = this.debugConfig;\r\n var engine = this.engine;\r\n var graphics = this.debugGraphic;\r\n\r\n var bodies = Composite.allBodies(this.localWorld);\r\n\r\n this.debugGraphic.clear();\r\n\r\n if (config.showBroadphase && engine.broadphase.controller)\r\n {\r\n this.renderGrid(engine.broadphase, graphics, config.broadphaseColor, 0.5);\r\n }\r\n\r\n if (config.showBounds)\r\n {\r\n this.renderBodyBounds(bodies, graphics, config.boundsColor, 0.5);\r\n }\r\n\r\n if (config.showBody || config.showStaticBody)\r\n {\r\n this.renderBodies(bodies);\r\n }\r\n\r\n if (config.showJoint)\r\n {\r\n this.renderJoints();\r\n }\r\n\r\n if (config.showAxes || config.showAngleIndicator)\r\n {\r\n this.renderBodyAxes(bodies, graphics, config.showAxes, config.angleColor, 0.5);\r\n }\r\n\r\n if (config.showVelocity)\r\n {\r\n this.renderBodyVelocity(bodies, graphics, config.velocityColor, 1, 2);\r\n }\r\n\r\n if (config.showSeparations)\r\n {\r\n this.renderSeparations(engine.pairs.list, graphics, config.separationColor);\r\n }\r\n\r\n if (config.showCollisions)\r\n {\r\n this.renderCollisions(engine.pairs.list, graphics, config.collisionColor);\r\n }\r\n },\r\n\r\n /**\r\n * Renders the Engine Broadphase Controller Grid to the given Graphics instance.\r\n * \r\n * The debug renderer calls this method if the `showBroadphase` config value is set.\r\n * \r\n * This method is used internally by the Matter Debug Renderer, but is also exposed publically should\r\n * you wish to render the Grid to your own Graphics instance.\r\n * \r\n * @method Phaser.Physics.Matter.World#renderGrid\r\n * @since 3.22.0\r\n * \r\n * @param {MatterJS.Grid} grid - The Matter Grid to be rendered.\r\n * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to.\r\n * @param {number} lineColor - The line color.\r\n * @param {number} lineOpacity - The line opacity, between 0 and 1.\r\n * \r\n * @return {this} This Matter World instance for method chaining.\r\n */\r\n renderGrid: function (grid, graphics, lineColor, lineOpacity)\r\n {\r\n graphics.lineStyle(1, lineColor, lineOpacity);\r\n\r\n var bucketKeys = Common.keys(grid.buckets);\r\n\r\n for (var i = 0; i < bucketKeys.length; i++)\r\n {\r\n var bucketId = bucketKeys[i];\r\n\r\n if (grid.buckets[bucketId].length < 2)\r\n {\r\n continue;\r\n }\r\n\r\n var region = bucketId.split(/C|R/);\r\n\r\n graphics.strokeRect(\r\n parseInt(region[1], 10) * grid.bucketWidth,\r\n parseInt(region[2], 10) * grid.bucketHeight,\r\n grid.bucketWidth,\r\n grid.bucketHeight\r\n );\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Renders the list of Pair separations to the given Graphics instance.\r\n * \r\n * The debug renderer calls this method if the `showSeparations` config value is set.\r\n * \r\n * This method is used internally by the Matter Debug Renderer, but is also exposed publically should\r\n * you wish to render the Grid to your own Graphics instance.\r\n * \r\n * @method Phaser.Physics.Matter.World#renderSeparations\r\n * @since 3.22.0\r\n * \r\n * @param {MatterJS.Pair[]} pairs - An array of Matter Pairs to be rendered.\r\n * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to.\r\n * @param {number} lineColor - The line color.\r\n * \r\n * @return {this} This Matter World instance for method chaining.\r\n */\r\n renderSeparations: function (pairs, graphics, lineColor)\r\n {\r\n graphics.lineStyle(1, lineColor, 1);\r\n\r\n for (var i = 0; i < pairs.length; i++)\r\n {\r\n var pair = pairs[i];\r\n\r\n if (!pair.isActive)\r\n {\r\n continue;\r\n }\r\n\r\n var collision = pair.collision;\r\n var bodyA = collision.bodyA;\r\n var bodyB = collision.bodyB;\r\n var posA = bodyA.position;\r\n var posB = bodyB.position;\r\n var penetration = collision.penetration;\r\n\r\n var k = (!bodyA.isStatic && !bodyB.isStatic) ? 4 : 1;\r\n \r\n if (bodyB.isStatic)\r\n {\r\n k = 0;\r\n }\r\n\r\n graphics.lineBetween(\r\n posB.x,\r\n posB.y,\r\n posB.x - (penetration.x * k),\r\n posB.y - (penetration.y * k)\r\n );\r\n\r\n k = (!bodyA.isStatic && !bodyB.isStatic) ? 4 : 1;\r\n\r\n if (bodyA.isStatic)\r\n {\r\n k = 0;\r\n }\r\n\r\n graphics.lineBetween(\r\n posA.x,\r\n posA.y,\r\n posA.x - (penetration.x * k),\r\n posA.y - (penetration.y * k)\r\n );\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Renders the list of collision points and normals to the given Graphics instance.\r\n * \r\n * The debug renderer calls this method if the `showCollisions` config value is set.\r\n * \r\n * This method is used internally by the Matter Debug Renderer, but is also exposed publically should\r\n * you wish to render the Grid to your own Graphics instance.\r\n * \r\n * @method Phaser.Physics.Matter.World#renderCollisions\r\n * @since 3.22.0\r\n * \r\n * @param {MatterJS.Pair[]} pairs - An array of Matter Pairs to be rendered.\r\n * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to.\r\n * @param {number} lineColor - The line color.\r\n * \r\n * @return {this} This Matter World instance for method chaining.\r\n */\r\n renderCollisions: function (pairs, graphics, lineColor)\r\n {\r\n graphics.lineStyle(1, lineColor, 0.5);\r\n graphics.fillStyle(lineColor, 1);\r\n\r\n var i;\r\n var pair;\r\n\r\n // Collision Positions\r\n\r\n for (i = 0; i < pairs.length; i++)\r\n {\r\n pair = pairs[i];\r\n\r\n if (!pair.isActive)\r\n {\r\n continue;\r\n }\r\n\r\n for (var j = 0; j < pair.activeContacts.length; j++)\r\n {\r\n var contact = pair.activeContacts[j];\r\n var vertex = contact.vertex;\r\n\r\n graphics.fillRect(vertex.x - 2, vertex.y - 2, 5, 5);\r\n }\r\n }\r\n\r\n // Collision Normals\r\n\r\n for (i = 0; i < pairs.length; i++)\r\n {\r\n pair = pairs[i];\r\n\r\n if (!pair.isActive)\r\n {\r\n continue;\r\n }\r\n\r\n var collision = pair.collision;\r\n var contacts = pair.activeContacts;\r\n\r\n if (contacts.length > 0)\r\n {\r\n var normalPosX = contacts[0].vertex.x;\r\n var normalPosY = contacts[0].vertex.y;\r\n\r\n if (contacts.length === 2)\r\n {\r\n normalPosX = (contacts[0].vertex.x + contacts[1].vertex.x) / 2;\r\n normalPosY = (contacts[0].vertex.y + contacts[1].vertex.y) / 2;\r\n }\r\n\r\n if (collision.bodyB === collision.supports[0].body || collision.bodyA.isStatic)\r\n {\r\n graphics.lineBetween(\r\n normalPosX - collision.normal.x * 8,\r\n normalPosY - collision.normal.y * 8,\r\n normalPosX,\r\n normalPosY\r\n );\r\n }\r\n else\r\n {\r\n graphics.lineBetween(\r\n normalPosX + collision.normal.x * 8,\r\n normalPosY + collision.normal.y * 8,\r\n normalPosX,\r\n normalPosY\r\n );\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Renders the bounds of an array of Bodies to the given Graphics instance.\r\n * \r\n * If the body is a compound body, it will render the bounds for the parent compound.\r\n * \r\n * The debug renderer calls this method if the `showBounds` config value is set.\r\n * \r\n * This method is used internally by the Matter Debug Renderer, but is also exposed publically should\r\n * you wish to render bounds to your own Graphics instance.\r\n *\r\n * @method Phaser.Physics.Matter.World#renderBodyBounds\r\n * @since 3.22.0\r\n * \r\n * @param {array} bodies - An array of bodies from the localWorld.\r\n * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to.\r\n * @param {number} lineColor - The line color.\r\n * @param {number} lineOpacity - The line opacity, between 0 and 1.\r\n */\r\n renderBodyBounds: function (bodies, graphics, lineColor, lineOpacity)\r\n {\r\n graphics.lineStyle(1, lineColor, lineOpacity);\r\n\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n var body = bodies[i];\r\n\r\n // 1) Don't show invisible bodies\r\n if (!body.render.visible)\r\n {\r\n continue;\r\n }\r\n\r\n var bounds = body.bounds;\r\n\r\n if (bounds)\r\n {\r\n graphics.strokeRect(\r\n bounds.min.x,\r\n bounds.min.y,\r\n bounds.max.x - bounds.min.x,\r\n bounds.max.y - bounds.min.y\r\n );\r\n }\r\n else\r\n {\r\n var parts = body.parts;\r\n\r\n for (var j = parts.length > 1 ? 1 : 0; j < parts.length; j++)\r\n {\r\n var part = parts[j];\r\n \r\n graphics.strokeRect(\r\n part.bounds.min.x,\r\n part.bounds.min.y,\r\n part.bounds.max.x - part.bounds.min.x,\r\n part.bounds.max.y - part.bounds.min.y\r\n );\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Renders either all axes, or a single axis indicator, for an array of Bodies, to the given Graphics instance.\r\n * \r\n * The debug renderer calls this method if the `showAxes` or `showAngleIndicator` config values are set.\r\n * \r\n * This method is used internally by the Matter Debug Renderer, but is also exposed publically should\r\n * you wish to render bounds to your own Graphics instance.\r\n *\r\n * @method Phaser.Physics.Matter.World#renderBodyAxes\r\n * @since 3.22.0\r\n * \r\n * @param {array} bodies - An array of bodies from the localWorld.\r\n * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to.\r\n * @param {boolean} showAxes - If `true` it will render all body axes. If `false` it will render a single axis indicator.\r\n * @param {number} lineColor - The line color.\r\n * @param {number} lineOpacity - The line opacity, between 0 and 1.\r\n */\r\n renderBodyAxes: function (bodies, graphics, showAxes, lineColor, lineOpacity)\r\n {\r\n graphics.lineStyle(1, lineColor, lineOpacity);\r\n\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n var body = bodies[i];\r\n var parts = body.parts;\r\n\r\n // 1) Don't show invisible bodies\r\n if (!body.render.visible)\r\n {\r\n continue;\r\n }\r\n\r\n var part;\r\n var j;\r\n var k;\r\n\r\n if (showAxes)\r\n {\r\n for (j = parts.length > 1 ? 1 : 0; j < parts.length; j++)\r\n {\r\n part = parts[j];\r\n \r\n for (k = 0; k < part.axes.length; k++)\r\n {\r\n var axis = part.axes[k];\r\n\r\n graphics.lineBetween(\r\n part.position.x,\r\n part.position.y,\r\n part.position.x + axis.x * 20,\r\n part.position.y + axis.y * 20\r\n );\r\n }\r\n }\r\n }\r\n else\r\n {\r\n for (j = parts.length > 1 ? 1 : 0; j < parts.length; j++)\r\n {\r\n part = parts[j];\r\n \r\n for (k = 0; k < part.axes.length; k++)\r\n {\r\n graphics.lineBetween(\r\n part.position.x,\r\n part.position.y,\r\n (part.vertices[0].x + part.vertices[part.vertices.length - 1].x) / 2,\r\n (part.vertices[0].y + part.vertices[part.vertices.length - 1].y) / 2\r\n );\r\n }\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Renders a velocity indicator for an array of Bodies, to the given Graphics instance.\r\n * \r\n * The debug renderer calls this method if the `showVelocity` config value is set.\r\n * \r\n * This method is used internally by the Matter Debug Renderer, but is also exposed publically should\r\n * you wish to render bounds to your own Graphics instance.\r\n *\r\n * @method Phaser.Physics.Matter.World#renderBodyVelocity\r\n * @since 3.22.0\r\n * \r\n * @param {array} bodies - An array of bodies from the localWorld.\r\n * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to.\r\n * @param {number} lineColor - The line color.\r\n * @param {number} lineOpacity - The line opacity, between 0 and 1.\r\n * @param {number} lineThickness - The line thickness.\r\n */\r\n renderBodyVelocity: function (bodies, graphics, lineColor, lineOpacity, lineThickness)\r\n {\r\n graphics.lineStyle(lineThickness, lineColor, lineOpacity);\r\n\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n var body = bodies[i];\r\n\r\n // 1) Don't show invisible bodies\r\n if (!body.render.visible)\r\n {\r\n continue;\r\n }\r\n\r\n graphics.lineBetween(\r\n body.position.x,\r\n body.position.y,\r\n body.position.x + (body.position.x - body.positionPrev.x) * 2,\r\n body.position.y + (body.position.y - body.positionPrev.y) * 2\r\n );\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Renders the given array of Bodies to the debug graphics instance.\r\n * \r\n * Called automatically by the `postUpdate` method.\r\n *\r\n * @method Phaser.Physics.Matter.World#renderBodies\r\n * @private\r\n * @since 3.14.0\r\n * \r\n * @param {array} bodies - An array of bodies from the localWorld.\r\n */\r\n renderBodies: function (bodies)\r\n {\r\n var graphics = this.debugGraphic;\r\n\r\n var config = this.debugConfig;\r\n\r\n var showBody = config.showBody;\r\n var showStaticBody = config.showStaticBody;\r\n var showSleeping = config.showSleeping;\r\n var showInternalEdges = config.showInternalEdges;\r\n var showConvexHulls = config.showConvexHulls;\r\n\r\n var renderFill = config.renderFill;\r\n var renderLine = config.renderLine;\r\n\r\n var staticBodySleepOpacity = config.staticBodySleepOpacity;\r\n var sleepFillColor = config.sleepFillColor;\r\n var sleepLineColor = config.sleepLineColor;\r\n\r\n var hullColor = config.hullColor;\r\n\r\n for (var i = 0; i < bodies.length; i++)\r\n {\r\n var body = bodies[i];\r\n\r\n // 1) Don't show invisible bodies\r\n if (!body.render.visible)\r\n {\r\n continue;\r\n }\r\n\r\n // 2) Don't show static bodies, OR\r\n // 3) Don't show dynamic bodies\r\n if ((!showStaticBody && body.isStatic) || (!showBody && !body.isStatic))\r\n {\r\n continue;\r\n }\r\n\r\n var lineColor = body.render.lineColor;\r\n var lineOpacity = body.render.lineOpacity;\r\n var lineThickness = body.render.lineThickness;\r\n var fillColor = body.render.fillColor;\r\n var fillOpacity = body.render.fillOpacity;\r\n\r\n if (showSleeping && body.isSleeping)\r\n {\r\n if (body.isStatic)\r\n {\r\n lineOpacity *= staticBodySleepOpacity;\r\n fillOpacity *= staticBodySleepOpacity;\r\n }\r\n else\r\n {\r\n lineColor = sleepLineColor;\r\n fillColor = sleepFillColor;\r\n }\r\n }\r\n\r\n if (!renderFill)\r\n {\r\n fillColor = null;\r\n }\r\n\r\n if (!renderLine)\r\n {\r\n lineColor = null;\r\n }\r\n\r\n this.renderBody(body, graphics, showInternalEdges, lineColor, lineOpacity, lineThickness, fillColor, fillOpacity);\r\n\r\n var partsLength = body.parts.length;\r\n\r\n if (showConvexHulls && partsLength > 1)\r\n {\r\n this.renderConvexHull(body, graphics, hullColor, lineThickness);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Renders a single Matter Body to the given Phaser Graphics Game Object.\r\n * \r\n * This method is used internally by the Matter Debug Renderer, but is also exposed publically should\r\n * you wish to render a Body to your own Graphics instance.\r\n * \r\n * If you don't wish to render a line around the body, set the `lineColor` parameter to `null`.\r\n * Equally, if you don't wish to render a fill, set the `fillColor` parameter to `null`.\r\n * \r\n * @method Phaser.Physics.Matter.World#renderBody\r\n * @since 3.22.0\r\n * \r\n * @param {MatterJS.BodyType} body - The Matter Body to be rendered.\r\n * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to.\r\n * @param {boolean} showInternalEdges - Render internal edges of the polygon?\r\n * @param {number} [lineColor] - The line color.\r\n * @param {number} [lineOpacity] - The line opacity, between 0 and 1.\r\n * @param {number} [lineThickness=1] - The line thickness.\r\n * @param {number} [fillColor] - The fill color.\r\n * @param {number} [fillOpacity] - The fill opacity, between 0 and 1.\r\n * \r\n * @return {this} This Matter World instance for method chaining.\r\n */\r\n renderBody: function (body, graphics, showInternalEdges, lineColor, lineOpacity, lineThickness, fillColor, fillOpacity)\r\n {\r\n if (lineColor === undefined) { lineColor = null; }\r\n if (lineOpacity === undefined) { lineOpacity = null; }\r\n if (lineThickness === undefined) { lineThickness = 1; }\r\n if (fillColor === undefined) { fillColor = null; }\r\n if (fillOpacity === undefined) { fillOpacity = null; }\r\n\r\n var config = this.debugConfig;\r\n\r\n var sensorFillColor = config.sensorFillColor;\r\n var sensorLineColor = config.sensorLineColor;\r\n\r\n // Handle compound parts\r\n var parts = body.parts;\r\n var partsLength = parts.length;\r\n\r\n for (var k = (partsLength > 1) ? 1 : 0; k < partsLength; k++)\r\n {\r\n var part = parts[k];\r\n var render = part.render;\r\n var opacity = render.opacity;\r\n\r\n if (!render.visible || opacity === 0 || (part.isSensor && !config.showSensors))\r\n {\r\n continue;\r\n }\r\n\r\n // Part polygon\r\n var circleRadius = part.circleRadius;\r\n\r\n graphics.beginPath();\r\n\r\n if (part.isSensor)\r\n {\r\n if (fillColor !== null)\r\n {\r\n graphics.fillStyle(sensorFillColor, fillOpacity * opacity);\r\n }\r\n \r\n if (lineColor !== null)\r\n {\r\n graphics.lineStyle(lineThickness, sensorLineColor, lineOpacity * opacity);\r\n }\r\n }\r\n else\r\n {\r\n if (fillColor !== null)\r\n {\r\n graphics.fillStyle(fillColor, fillOpacity * opacity);\r\n }\r\n \r\n if (lineColor !== null)\r\n {\r\n graphics.lineStyle(lineThickness, lineColor, lineOpacity * opacity);\r\n }\r\n }\r\n\r\n if (circleRadius)\r\n {\r\n graphics.arc(part.position.x, part.position.y, circleRadius, 0, 2 * Math.PI);\r\n }\r\n else\r\n {\r\n var vertices = part.vertices;\r\n var vertLength = vertices.length;\r\n\r\n graphics.moveTo(vertices[0].x, vertices[0].y);\r\n\r\n for (var j = 1; j < vertLength; j++)\r\n {\r\n var vert = vertices[j];\r\n\r\n if (!vertices[j - 1].isInternal || showInternalEdges)\r\n {\r\n graphics.lineTo(vert.x, vert.y);\r\n }\r\n else\r\n {\r\n graphics.moveTo(vert.x, vert.y);\r\n }\r\n\r\n if (j < vertLength && vert.isInternal && !showInternalEdges)\r\n {\r\n var nextIndex = (j + 1) % vertLength;\r\n\r\n graphics.moveTo(vertices[nextIndex].x, vertices[nextIndex].y);\r\n }\r\n }\r\n \r\n graphics.closePath();\r\n }\r\n\r\n if (fillColor !== null)\r\n {\r\n graphics.fillPath();\r\n }\r\n\r\n if (lineColor !== null)\r\n {\r\n graphics.strokePath();\r\n }\r\n }\r\n\r\n if (config.showPositions && !body.isStatic)\r\n {\r\n var px = body.position.x;\r\n var py = body.position.y;\r\n var hs = Math.ceil(config.positionSize / 2);\r\n\r\n graphics.fillStyle(config.positionColor, 1);\r\n graphics.fillRect(px - hs, py - hs, config.positionSize, config.positionSize);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Renders the Convex Hull for a single Matter Body to the given Phaser Graphics Game Object.\r\n * \r\n * This method is used internally by the Matter Debug Renderer, but is also exposed publically should\r\n * you wish to render a Body hull to your own Graphics instance.\r\n * \r\n * @method Phaser.Physics.Matter.World#renderConvexHull\r\n * @since 3.22.0\r\n * \r\n * @param {MatterJS.BodyType} body - The Matter Body to be rendered.\r\n * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to.\r\n * @param {number} hullColor - The color used to render the hull.\r\n * @param {number} [lineThickness=1] - The hull line thickness.\r\n * \r\n * @return {this} This Matter World instance for method chaining.\r\n */\r\n renderConvexHull: function (body, graphics, hullColor, lineThickness)\r\n {\r\n if (lineThickness === undefined) { lineThickness = 1; }\r\n\r\n var parts = body.parts;\r\n var partsLength = parts.length;\r\n\r\n // Render Convex Hulls\r\n if (partsLength > 1)\r\n {\r\n var verts = body.vertices;\r\n\r\n graphics.lineStyle(lineThickness, hullColor);\r\n\r\n graphics.beginPath();\r\n\r\n graphics.moveTo(verts[0].x, verts[0].y);\r\n\r\n for (var v = 1; v < verts.length; v++)\r\n {\r\n graphics.lineTo(verts[v].x, verts[v].y);\r\n }\r\n \r\n graphics.lineTo(verts[0].x, verts[0].y);\r\n\r\n graphics.strokePath();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Renders all of the constraints in the world (unless they are specifically set to invisible).\r\n * \r\n * Called automatically by the `postUpdate` method.\r\n *\r\n * @method Phaser.Physics.Matter.World#renderJoints\r\n * @private\r\n * @since 3.14.0\r\n */\r\n renderJoints: function ()\r\n {\r\n var graphics = this.debugGraphic;\r\n\r\n // Render constraints \r\n var constraints = Composite.allConstraints(this.localWorld);\r\n\r\n for (var i = 0; i < constraints.length; i++)\r\n {\r\n var config = constraints[i].render;\r\n\r\n var lineColor = config.lineColor;\r\n var lineOpacity = config.lineOpacity;\r\n var lineThickness = config.lineThickness;\r\n var pinSize = config.pinSize;\r\n var anchorColor = config.anchorColor;\r\n var anchorSize = config.anchorSize;\r\n\r\n this.renderConstraint(constraints[i], graphics, lineColor, lineOpacity, lineThickness, pinSize, anchorColor, anchorSize);\r\n }\r\n },\r\n\r\n /**\r\n * Renders a single Matter Constraint, such as a Pin or a Spring, to the given Phaser Graphics Game Object.\r\n * \r\n * This method is used internally by the Matter Debug Renderer, but is also exposed publically should\r\n * you wish to render a Constraint to your own Graphics instance.\r\n * \r\n * @method Phaser.Physics.Matter.World#renderConstraint\r\n * @since 3.22.0\r\n * \r\n * @param {MatterJS.ConstraintType} constraint - The Matter Constraint to render.\r\n * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to.\r\n * @param {number} lineColor - The line color.\r\n * @param {number} lineOpacity - The line opacity, between 0 and 1.\r\n * @param {number} lineThickness - The line thickness.\r\n * @param {number} pinSize - If this constraint is a pin, this sets the size of the pin circle.\r\n * @param {number} anchorColor - The color used when rendering this constraints anchors. Set to `null` to not render anchors.\r\n * @param {number} anchorSize - The size of the anchor circle, if this constraint has anchors and is rendering them.\r\n * \r\n * @return {this} This Matter World instance for method chaining.\r\n */\r\n renderConstraint: function (constraint, graphics, lineColor, lineOpacity, lineThickness, pinSize, anchorColor, anchorSize)\r\n {\r\n var render = constraint.render;\r\n\r\n if (!render.visible || !constraint.pointA || !constraint.pointB)\r\n {\r\n return this;\r\n }\r\n\r\n graphics.lineStyle(lineThickness, lineColor, lineOpacity);\r\n\r\n var bodyA = constraint.bodyA;\r\n var bodyB = constraint.bodyB;\r\n var start;\r\n var end;\r\n\r\n if (bodyA)\r\n {\r\n start = Vector.add(bodyA.position, constraint.pointA);\r\n }\r\n else\r\n {\r\n start = constraint.pointA;\r\n }\r\n\r\n if (render.type === 'pin')\r\n {\r\n graphics.strokeCircle(start.x, start.y, pinSize);\r\n }\r\n else\r\n {\r\n if (bodyB)\r\n {\r\n end = Vector.add(bodyB.position, constraint.pointB);\r\n }\r\n else\r\n {\r\n end = constraint.pointB;\r\n }\r\n\r\n graphics.beginPath();\r\n graphics.moveTo(start.x, start.y);\r\n\r\n if (render.type === 'spring')\r\n {\r\n var delta = Vector.sub(end, start);\r\n var normal = Vector.perp(Vector.normalise(delta));\r\n var coils = Math.ceil(Common.clamp(constraint.length / 5, 12, 20));\r\n var offset;\r\n\r\n for (var j = 1; j < coils; j += 1)\r\n {\r\n offset = (j % 2 === 0) ? 1 : -1;\r\n\r\n graphics.lineTo(\r\n start.x + delta.x * (j / coils) + normal.x * offset * 4,\r\n start.y + delta.y * (j / coils) + normal.y * offset * 4\r\n );\r\n }\r\n }\r\n\r\n graphics.lineTo(end.x, end.y);\r\n }\r\n\r\n graphics.strokePath();\r\n\r\n if (render.anchors && anchorSize > 0)\r\n {\r\n graphics.fillStyle(anchorColor);\r\n graphics.fillCircle(start.x, start.y, anchorSize);\r\n graphics.fillCircle(end.x, end.y, anchorSize);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the internal collision IDs that Matter.JS uses for Body collision groups.\r\n * \r\n * You should call this before destroying your game if you need to restart the game\r\n * again on the same page, without first reloading the page. Or, if you wish to\r\n * consistently destroy a Scene that contains Matter.js and then run it again\r\n * later in the same game.\r\n *\r\n * @method Phaser.Physics.Matter.World#resetCollisionIDs\r\n * @since 3.17.0\r\n */\r\n resetCollisionIDs: function ()\r\n {\r\n Body._nextCollidingGroupId = 1;\r\n Body._nextNonCollidingGroupId = -1;\r\n Body._nextCategory = 0x0001;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Will remove all Matter physics event listeners and clear the matter physics world,\r\n * engine and any debug graphics, if any.\r\n *\r\n * @method Phaser.Physics.Matter.World#shutdown\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n MatterEvents.off(this.engine);\r\n\r\n this.removeAllListeners();\r\n\r\n MatterWorld.clear(this.localWorld, false);\r\n\r\n Engine.clear(this.engine);\r\n\r\n if (this.drawDebug)\r\n {\r\n this.debugGraphic.destroy();\r\n }\r\n },\r\n\r\n /**\r\n * Will remove all Matter physics event listeners and clear the matter physics world,\r\n * engine and any debug graphics, if any.\r\n *\r\n * After destroying the world it cannot be re-used again.\r\n *\r\n * @method Phaser.Physics.Matter.World#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n }\r\n\r\n});\r\n\r\nmodule.exports = World;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/World.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/components/Bounce.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/components/Bounce.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * A component to set restitution on objects.\r\n *\r\n * @namespace Phaser.Physics.Matter.Components.Bounce\r\n * @since 3.0.0\r\n */\r\nvar Bounce = {\r\n\r\n /**\r\n * Sets the restitution on the physics object.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Bounce#setBounce\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - A Number that defines the restitution (elasticity) of the body. The value is always positive and is in the range (0, 1). A value of 0 means collisions may be perfectly inelastic and no bouncing may occur. A value of 0.8 means the body may bounce back with approximately 80% of its kinetic energy. Note that collision response is based on pairs of bodies, and that restitution values are combined with the following formula: `Math.max(bodyA.restitution, bodyB.restitution)`\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setBounce: function (value)\r\n {\r\n this.body.restitution = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Bounce;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/components/Bounce.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/components/Collision.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/components/Collision.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Contains methods for changing the collision filter of a Matter Body. Should be used as a mixin and not called directly.\r\n *\r\n * @namespace Phaser.Physics.Matter.Components.Collision\r\n * @since 3.0.0\r\n */\r\nvar Collision = {\r\n\r\n /**\r\n * Sets the collision category of this Game Object's Matter Body. This number must be a power of two between 2^0 (= 1) and 2^31.\r\n * Two bodies with different collision groups (see {@link #setCollisionGroup}) will only collide if their collision\r\n * categories are included in their collision masks (see {@link #setCollidesWith}).\r\n *\r\n * @method Phaser.Physics.Matter.Components.Collision#setCollisionCategory\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - Unique category bitfield.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setCollisionCategory: function (value)\r\n {\r\n this.body.collisionFilter.category = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the collision group of this Game Object's Matter Body. If this is zero or two Matter Bodies have different values,\r\n * they will collide according to the usual rules (see {@link #setCollisionCategory} and {@link #setCollisionGroup}).\r\n * If two Matter Bodies have the same positive value, they will always collide; if they have the same negative value,\r\n * they will never collide.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Collision#setCollisionGroup\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - Unique group index.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setCollisionGroup: function (value)\r\n {\r\n this.body.collisionFilter.group = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the collision mask for this Game Object's Matter Body. Two Matter Bodies with different collision groups will only\r\n * collide if each one includes the other's category in its mask based on a bitwise AND, i.e. `(categoryA & maskB) !== 0`\r\n * and `(categoryB & maskA) !== 0` are both true.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Collision#setCollidesWith\r\n * @since 3.0.0\r\n *\r\n * @param {(number|number[])} categories - A unique category bitfield, or an array of them.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setCollidesWith: function (categories)\r\n {\r\n var flags = 0;\r\n\r\n if (!Array.isArray(categories))\r\n {\r\n flags = categories;\r\n }\r\n else\r\n {\r\n for (var i = 0; i < categories.length; i++)\r\n {\r\n flags |= categories[i];\r\n }\r\n }\r\n\r\n this.body.collisionFilter.mask = flags;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object.\r\n * \r\n * This does not change the bodies collision category, group or filter. Those must be set in addition\r\n * to the callback.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Collision#setOnCollide\r\n * @since 3.22.0\r\n *\r\n * @param {function} callback - The callback to invoke when this body starts colliding with another.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setOnCollide: function (callback)\r\n {\r\n this.body.onCollideCallback = callback;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object.\r\n * \r\n * This does not change the bodies collision category, group or filter. Those must be set in addition\r\n * to the callback.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Collision#setOnCollideEnd\r\n * @since 3.22.0\r\n *\r\n * @param {function} callback - The callback to invoke when this body stops colliding with another.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setOnCollideEnd: function (callback)\r\n {\r\n this.body.onCollideEndCallback = callback;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object.\r\n * \r\n * This does not change the bodies collision category, group or filter. Those must be set in addition\r\n * to the callback.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Collision#setOnCollideActive\r\n * @since 3.22.0\r\n *\r\n * @param {function} callback - The callback to invoke for the duration of this body colliding with another.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setOnCollideActive: function (callback)\r\n {\r\n this.body.onCollideActiveCallback = callback;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The callback is sent a reference to the other body, along with a `Phaser.Types.Physics.Matter.MatterCollisionData` object.\r\n * \r\n * This does not change the bodies collision category, group or filter. Those must be set in addition\r\n * to the callback.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Collision#setOnCollideWith\r\n * @since 3.22.0\r\n *\r\n * @param {(MatterJS.Body|MatterJS.Body[])} body - The body, or an array of bodies, to test for collisions with.\r\n * @param {function} callback - The callback to invoke when this body collides with the given body or bodies.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setOnCollideWith: function (body, callback)\r\n {\r\n if (!Array.isArray(body))\r\n {\r\n body = [ body ];\r\n }\r\n\r\n for (var i = 0; i < body.length; i++)\r\n {\r\n var src = (body[i].hasOwnProperty('body')) ? body[i].body : body[i];\r\n\r\n this.body.setOnCollideWith(src, callback);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Collision;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/components/Collision.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/components/Force.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/components/Force.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Body = __webpack_require__(/*! ../lib/body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\n\r\n/**\r\n * A component to apply force to Matter.js bodies.\r\n *\r\n * @namespace Phaser.Physics.Matter.Components.Force\r\n * @since 3.0.0\r\n */\r\nvar Force = {\r\n\r\n // force = vec2 / point\r\n\r\n /**\r\n * Applies a force to a body.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Force#applyForce\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} force - A Vector that specifies the force to apply.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n applyForce: function (force)\r\n {\r\n this._tempVec2.set(this.body.position.x, this.body.position.y);\r\n\r\n Body.applyForce(this.body, this._tempVec2, force);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Applies a force to a body from a given position.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Force#applyForceFrom\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} position - The position in which the force comes from.\r\n * @param {Phaser.Math.Vector2} force - A Vector that specifies the force to apply.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n applyForceFrom: function (position, force)\r\n {\r\n Body.applyForce(this.body, position, force);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply thrust to the forward position of the body.\r\n * \r\n * Use very small values, such as 0.1, depending on the mass and required speed.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Force#thrust\r\n * @since 3.0.0\r\n *\r\n * @param {number} speed - A speed value to be applied to a directional force.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n thrust: function (speed)\r\n {\r\n var angle = this.body.angle;\r\n\r\n this._tempVec2.set(speed * Math.cos(angle), speed * Math.sin(angle));\r\n\r\n Body.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply thrust to the left position of the body.\r\n * \r\n * Use very small values, such as 0.1, depending on the mass and required speed.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Force#thrustLeft\r\n * @since 3.0.0\r\n *\r\n * @param {number} speed - A speed value to be applied to a directional force.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n thrustLeft: function (speed)\r\n {\r\n var angle = this.body.angle - Math.PI / 2;\r\n\r\n this._tempVec2.set(speed * Math.cos(angle), speed * Math.sin(angle));\r\n\r\n Body.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply thrust to the right position of the body.\r\n * \r\n * Use very small values, such as 0.1, depending on the mass and required speed.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Force#thrustRight\r\n * @since 3.0.0\r\n *\r\n * @param {number} speed - A speed value to be applied to a directional force.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n thrustRight: function (speed)\r\n {\r\n var angle = this.body.angle + Math.PI / 2;\r\n\r\n this._tempVec2.set(speed * Math.cos(angle), speed * Math.sin(angle));\r\n\r\n Body.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply thrust to the back position of the body.\r\n * \r\n * Use very small values, such as 0.1, depending on the mass and required speed.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Force#thrustBack\r\n * @since 3.0.0\r\n *\r\n * @param {number} speed - A speed value to be applied to a directional force.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n thrustBack: function (speed)\r\n {\r\n var angle = this.body.angle - Math.PI;\r\n\r\n this._tempVec2.set(speed * Math.cos(angle), speed * Math.sin(angle));\r\n\r\n Body.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2);\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Force;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/components/Force.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/components/Friction.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/components/Friction.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Contains methods for changing the friction of a Game Object's Matter Body. Should be used a mixin, not called directly.\r\n *\r\n * @namespace Phaser.Physics.Matter.Components.Friction\r\n * @since 3.0.0\r\n */\r\nvar Friction = {\r\n\r\n /**\r\n * Sets new friction values for this Game Object's Matter Body.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Friction#setFriction\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The new friction of the body, between 0 and 1, where 0 allows the Body to slide indefinitely, while 1 allows it to stop almost immediately after a force is applied.\r\n * @param {number} [air] - If provided, the new air resistance of the Body. The higher the value, the faster the Body will slow as it moves through space. 0 means the body has no air resistance.\r\n * @param {number} [fstatic] - If provided, the new static friction of the Body. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. 0 means the body will never \"stick\" when it is nearly stationary.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setFriction: function (value, air, fstatic)\r\n {\r\n this.body.friction = value;\r\n\r\n if (air !== undefined)\r\n {\r\n this.body.frictionAir = air;\r\n }\r\n\r\n if (fstatic !== undefined)\r\n {\r\n this.body.frictionStatic = fstatic;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a new air resistance for this Game Object's Matter Body.\r\n * A value of 0 means the Body will never slow as it moves through space.\r\n * The higher the value, the faster a Body slows when moving through space.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Friction#setFrictionAir\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The new air resistance for the Body.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setFrictionAir: function (value)\r\n {\r\n this.body.frictionAir = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a new static friction for this Game Object's Matter Body.\r\n * A value of 0 means the Body will never \"stick\" when it is nearly stationary.\r\n * The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Friction#setFrictionStatic\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The new static friction for the Body.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setFrictionStatic: function (value)\r\n {\r\n this.body.frictionStatic = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Friction;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/components/Friction.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/components/Gravity.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/components/Gravity.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * A component to manipulate world gravity for Matter.js bodies.\r\n *\r\n * @namespace Phaser.Physics.Matter.Components.Gravity\r\n * @since 3.0.0\r\n */\r\nvar Gravity = {\r\n\r\n /**\r\n * A togglable function for ignoring world gravity in real-time on the current body.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Gravity#setIgnoreGravity\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - Set to true to ignore the effect of world gravity, or false to not ignore it.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setIgnoreGravity: function (value)\r\n {\r\n this.body.ignoreGravity = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Gravity;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/components/Gravity.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/components/Mass.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/components/Mass.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Body = __webpack_require__(/*! ../lib/body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * Allows accessing the mass, density, and center of mass of a Matter-enabled Game Object. Should be used as a mixin and not directly.\r\n *\r\n * @namespace Phaser.Physics.Matter.Components.Mass\r\n * @since 3.0.0\r\n */\r\nvar Mass = {\r\n\r\n /**\r\n * Sets the mass of the Game Object's Matter Body.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Mass#setMass\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The new mass of the body.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setMass: function (value)\r\n {\r\n Body.setMass(this.body, value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets density of the body.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Mass#setDensity\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The new density of the body.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setDensity: function (value)\r\n {\r\n Body.setDensity(this.body, value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The body's center of mass.\r\n * \r\n * Calling this creates a new `Vector2 each time to avoid mutation.\r\n * \r\n * If you only need to read the value and won't change it, you can get it from `GameObject.body.centerOfMass`.\r\n *\r\n * @name Phaser.Physics.Matter.Components.Mass#centerOfMass\r\n * @type {Phaser.Math.Vector2}\r\n * @readonly\r\n * @since 3.10.0\r\n *\r\n * @return {Phaser.Math.Vector2} The center of mass.\r\n */\r\n centerOfMass: {\r\n\r\n get: function ()\r\n {\r\n return new Vector2(this.body.centerOfMass.x, this.body.centerOfMass.y);\r\n }\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Mass;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/components/Mass.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/components/Sensor.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/components/Sensor.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Enables a Matter-enabled Game Object to be a sensor. Should be used as a mixin and not directly.\r\n *\r\n * @namespace Phaser.Physics.Matter.Components.Sensor\r\n * @since 3.0.0\r\n */\r\nvar Sensor = {\r\n\r\n /**\r\n * Set the body belonging to this Game Object to be a sensor.\r\n * Sensors trigger collision events, but don't react with colliding body physically.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Sensor#setSensor\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - `true` to set the body as a sensor, or `false` to disable it.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setSensor: function (value)\r\n {\r\n this.body.isSensor = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Is the body belonging to this Game Object a sensor or not?\r\n *\r\n * @method Phaser.Physics.Matter.Components.Sensor#isSensor\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the body is a sensor, otherwise `false`.\r\n */\r\n isSensor: function ()\r\n {\r\n return this.body.isSensor;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Sensor;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/components/Sensor.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/components/SetBody.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/components/SetBody.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Bodies = __webpack_require__(/*! ../lib/factory/Bodies */ \"./node_modules/phaser/src/physics/matter-js/lib/factory/Bodies.js\");\r\nvar Body = __webpack_require__(/*! ../lib/body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\nvar FuzzyEquals = __webpack_require__(/*! ../../../math/fuzzy/Equal */ \"./node_modules/phaser/src/math/fuzzy/Equal.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar PhysicsEditorParser = __webpack_require__(/*! ../PhysicsEditorParser */ \"./node_modules/phaser/src/physics/matter-js/PhysicsEditorParser.js\");\r\nvar PhysicsJSONParser = __webpack_require__(/*! ../PhysicsJSONParser */ \"./node_modules/phaser/src/physics/matter-js/PhysicsJSONParser.js\");\r\nvar Vertices = __webpack_require__(/*! ../lib/geometry/Vertices */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js\");\r\n\r\n/**\r\n * Enables a Matter-enabled Game Object to set its Body. Should be used as a mixin and not directly.\r\n *\r\n * @namespace Phaser.Physics.Matter.Components.SetBody\r\n * @since 3.0.0\r\n */\r\nvar SetBody = {\r\n\r\n /**\r\n * Set the body on a Game Object to a rectangle.\r\n * \r\n * Calling this methods resets previous properties you may have set on the body, including\r\n * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed.\r\n *\r\n * @method Phaser.Physics.Matter.Components.SetBody#setRectangle\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - Width of the rectangle.\r\n * @param {number} height - Height of the rectangle.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setRectangle: function (width, height, options)\r\n {\r\n return this.setBody({ type: 'rectangle', width: width, height: height }, options);\r\n },\r\n\r\n /**\r\n * Set the body on a Game Object to a circle.\r\n * \r\n * Calling this methods resets previous properties you may have set on the body, including\r\n * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed.\r\n *\r\n * @method Phaser.Physics.Matter.Components.SetBody#setCircle\r\n * @since 3.0.0\r\n *\r\n * @param {number} radius - The radius of the circle.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setCircle: function (radius, options)\r\n {\r\n return this.setBody({ type: 'circle', radius: radius }, options);\r\n },\r\n\r\n /**\r\n * Set the body on the Game Object to a polygon shape.\r\n * \r\n * Calling this methods resets previous properties you may have set on the body, including\r\n * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed.\r\n *\r\n * @method Phaser.Physics.Matter.Components.SetBody#setPolygon\r\n * @since 3.0.0\r\n *\r\n * @param {number} sides - The number of sides the polygon will have.\r\n * @param {number} radius - The \"radius\" of the polygon, i.e. the distance from its center to any vertex. This is also the radius of its circumcircle.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setPolygon: function (radius, sides, options)\r\n {\r\n return this.setBody({ type: 'polygon', sides: sides, radius: radius }, options);\r\n },\r\n\r\n /**\r\n * Set the body on the Game Object to a trapezoid shape.\r\n * \r\n * Calling this methods resets previous properties you may have set on the body, including\r\n * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed.\r\n *\r\n * @method Phaser.Physics.Matter.Components.SetBody#setTrapezoid\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of the trapezoid Body.\r\n * @param {number} height - The height of the trapezoid Body.\r\n * @param {number} slope - The slope of the trapezoid. 0 creates a rectangle, while 1 creates a triangle. Positive values make the top side shorter, while negative values make the bottom side shorter.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setTrapezoid: function (width, height, slope, options)\r\n {\r\n return this.setBody({ type: 'trapezoid', width: width, height: height, slope: slope }, options);\r\n },\r\n\r\n /**\r\n * Set this Game Object to use the given existing Matter Body.\r\n * \r\n * The body is first removed from the world before being added to this Game Object.\r\n *\r\n * @method Phaser.Physics.Matter.Components.SetBody#setExistingBody\r\n * @since 3.0.0\r\n *\r\n * @param {MatterJS.BodyType} body - The Body this Game Object should use.\r\n * @param {boolean} [addToWorld=true] - Should the body be immediately added to the World?\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setExistingBody: function (body, addToWorld)\r\n {\r\n if (addToWorld === undefined) { addToWorld = true; }\r\n\r\n if (this.body)\r\n {\r\n this.world.remove(this.body, true);\r\n }\r\n\r\n this.body = body;\r\n\r\n for (var i = 0; i < body.parts.length; i++)\r\n {\r\n body.parts[i].gameObject = this;\r\n }\r\n\r\n var _this = this;\r\n\r\n body.destroy = function destroy ()\r\n {\r\n _this.world.remove(_this.body, true);\r\n _this.body.gameObject = null;\r\n };\r\n\r\n if (addToWorld)\r\n {\r\n if (this.world.has(body))\r\n {\r\n // Because it could be part of another Composite\r\n this.world.remove(body, true);\r\n }\r\n\r\n this.world.add(body);\r\n }\r\n\r\n if (this._originComponent)\r\n {\r\n var rx = body.render.sprite.xOffset;\r\n var ry = body.render.sprite.yOffset;\r\n\r\n var comx = body.centerOfMass.x;\r\n var comy = body.centerOfMass.y;\r\n\r\n if (FuzzyEquals(comx, 0.5) && FuzzyEquals(comy, 0.5))\r\n {\r\n this.setOrigin(rx + 0.5, ry + 0.5);\r\n }\r\n else\r\n {\r\n var cx = body.centerOffset.x;\r\n var cy = body.centerOffset.y;\r\n\r\n this.setOrigin(rx + (cx / this.displayWidth), ry + (cy / this.displayHeight));\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set this Game Object to create and use a new Body based on the configuration object given.\r\n * \r\n * Calling this method resets previous properties you may have set on the body, including\r\n * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed.\r\n *\r\n * @method Phaser.Physics.Matter.Components.SetBody#setBody\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Physics.Matter.MatterSetBodyConfig)} config - Either a string, such as `circle`, or a Matter Set Body Configuration object.\r\n * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setBody: function (config, options)\r\n {\r\n if (!config)\r\n {\r\n return this;\r\n }\r\n\r\n var body;\r\n\r\n // Allow them to do: shape: 'circle' instead of shape: { type: 'circle' }\r\n if (typeof config === 'string')\r\n {\r\n // Using defaults\r\n config = { type: config };\r\n }\r\n\r\n var shapeType = GetFastValue(config, 'type', 'rectangle');\r\n var bodyX = GetFastValue(config, 'x', this._tempVec2.x);\r\n var bodyY = GetFastValue(config, 'y', this._tempVec2.y);\r\n var bodyWidth = GetFastValue(config, 'width', this.width);\r\n var bodyHeight = GetFastValue(config, 'height', this.height);\r\n\r\n switch (shapeType)\r\n {\r\n case 'rectangle':\r\n body = Bodies.rectangle(bodyX, bodyY, bodyWidth, bodyHeight, options);\r\n break;\r\n\r\n case 'circle':\r\n var radius = GetFastValue(config, 'radius', Math.max(bodyWidth, bodyHeight) / 2);\r\n var maxSides = GetFastValue(config, 'maxSides', 25);\r\n body = Bodies.circle(bodyX, bodyY, radius, options, maxSides);\r\n break;\r\n\r\n case 'trapezoid':\r\n var slope = GetFastValue(config, 'slope', 0.5);\r\n body = Bodies.trapezoid(bodyX, bodyY, bodyWidth, bodyHeight, slope, options);\r\n break;\r\n\r\n case 'polygon':\r\n var sides = GetFastValue(config, 'sides', 5);\r\n var pRadius = GetFastValue(config, 'radius', Math.max(bodyWidth, bodyHeight) / 2);\r\n body = Bodies.polygon(bodyX, bodyY, sides, pRadius, options);\r\n break;\r\n\r\n case 'fromVertices':\r\n case 'fromVerts':\r\n\r\n var verts = GetFastValue(config, 'verts', null);\r\n\r\n if (verts)\r\n {\r\n // Has the verts array come from Vertices.fromPath, or is it raw?\r\n if (typeof verts === 'string')\r\n {\r\n verts = Vertices.fromPath(verts);\r\n }\r\n\r\n if (this.body && !this.body.hasOwnProperty('temp'))\r\n {\r\n Body.setVertices(this.body, verts);\r\n\r\n body = this.body;\r\n }\r\n else\r\n {\r\n var flagInternal = GetFastValue(config, 'flagInternal', false);\r\n var removeCollinear = GetFastValue(config, 'removeCollinear', 0.01);\r\n var minimumArea = GetFastValue(config, 'minimumArea', 10);\r\n \r\n body = Bodies.fromVertices(bodyX, bodyY, verts, options, flagInternal, removeCollinear, minimumArea);\r\n }\r\n }\r\n\r\n break;\r\n\r\n case 'fromPhysicsEditor':\r\n body = PhysicsEditorParser.parseBody(bodyX, bodyY, config, options);\r\n break;\r\n\r\n case 'fromPhysicsTracer':\r\n body = PhysicsJSONParser.parseBody(bodyX, bodyY, config, options);\r\n break;\r\n }\r\n\r\n if (body)\r\n {\r\n this.setExistingBody(body, config.addToWorld);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = SetBody;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/components/SetBody.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/components/Sleep.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/components/Sleep.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/physics/matter-js/events/index.js\");\r\nvar Sleeping = __webpack_require__(/*! ../lib/core/Sleeping */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Sleeping.js\");\r\nvar MatterEvents = __webpack_require__(/*! ../lib/core/Events */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Events.js\");\r\n\r\n/**\r\n * Enables a Matter-enabled Game Object to be able to go to sleep. Should be used as a mixin and not directly.\r\n *\r\n * @namespace Phaser.Physics.Matter.Components.Sleep\r\n * @since 3.0.0\r\n */\r\nvar Sleep = {\r\n\r\n /**\r\n * Sets this Body to sleep.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Sleep#setToSleep\r\n * @since 3.22.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setToSleep: function ()\r\n {\r\n Sleeping.set(this.body, true);\r\n },\r\n\r\n /**\r\n * Wakes this Body if asleep.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Sleep#setAwake\r\n * @since 3.22.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setAwake: function ()\r\n {\r\n Sleeping.set(this.body, false);\r\n },\r\n\r\n /**\r\n * Sets the number of updates in which this body must have near-zero velocity before it is set as sleeping (if sleeping is enabled by the engine).\r\n *\r\n * @method Phaser.Physics.Matter.Components.Sleep#setSleepThreshold\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=60] - A `Number` that defines the number of updates in which this body must have near-zero velocity before it is set as sleeping.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSleepThreshold: function (value)\r\n {\r\n if (value === undefined) { value = 60; }\r\n\r\n this.body.sleepThreshold = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Enable sleep and wake events for this body.\r\n * \r\n * By default when a body goes to sleep, or wakes up, it will not emit any events.\r\n * \r\n * The events are emitted by the Matter World instance and can be listened to via\r\n * the `SLEEP_START` and `SLEEP_END` events.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Sleep#setSleepEvents\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} start - `true` if you want the sleep start event to be emitted for this body.\r\n * @param {boolean} end - `true` if you want the sleep end event to be emitted for this body.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSleepEvents: function (start, end)\r\n {\r\n this.setSleepStartEvent(start);\r\n this.setSleepEndEvent(end);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Enables or disables the Sleep Start event for this body.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Sleep#setSleepStartEvent\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - `true` to enable the sleep event, or `false` to disable it.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSleepStartEvent: function (value)\r\n {\r\n if (value)\r\n {\r\n var world = this.world;\r\n\r\n MatterEvents.on(this.body, 'sleepStart', function (event)\r\n {\r\n world.emit(Events.SLEEP_START, event, this);\r\n });\r\n }\r\n else\r\n {\r\n MatterEvents.off(this.body, 'sleepStart');\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Enables or disables the Sleep End event for this body.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Sleep#setSleepEndEvent\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - `true` to enable the sleep event, or `false` to disable it.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSleepEndEvent: function (value)\r\n {\r\n if (value)\r\n {\r\n var world = this.world;\r\n\r\n MatterEvents.on(this.body, 'sleepEnd', function (event)\r\n {\r\n world.emit(Events.SLEEP_END, event, this);\r\n });\r\n }\r\n else\r\n {\r\n MatterEvents.off(this.body, 'sleepEnd');\r\n }\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Sleep;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/components/Sleep.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/components/Static.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/components/Static.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Body = __webpack_require__(/*! ../lib/body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\n\r\n/**\r\n * Provides methods used for getting and setting the static state of a physics body.\r\n *\r\n * @namespace Phaser.Physics.Matter.Components.Static\r\n * @since 3.0.0\r\n */\r\nvar Static = {\r\n\r\n /**\r\n * Changes the physics body to be either static `true` or dynamic `false`.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Static#setStatic\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - `true` to set the body as being static, or `false` to make it dynamic.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setStatic: function (value)\r\n {\r\n Body.setStatic(this.body, value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns `true` if the body is static, otherwise `false` for a dynamic body.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Static#isStatic\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the body is static, otherwise `false`.\r\n */\r\n isStatic: function ()\r\n {\r\n return this.body.isStatic;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Static;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/components/Static.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/components/Transform.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/components/Transform.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Body = __webpack_require__(/*! ../lib/body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\nvar MATH_CONST = __webpack_require__(/*! ../../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\nvar WrapAngle = __webpack_require__(/*! ../../../math/angle/Wrap */ \"./node_modules/phaser/src/math/angle/Wrap.js\");\r\nvar WrapAngleDegrees = __webpack_require__(/*! ../../../math/angle/WrapDegrees */ \"./node_modules/phaser/src/math/angle/WrapDegrees.js\");\r\n\r\n// global bitmask flag for GameObject.renderMask (used by Scale)\r\nvar _FLAG = 4; // 0100\r\n\r\n// Transform Component\r\n\r\n/**\r\n * Provides methods used for getting and setting the position, scale and rotation of a Game Object.\r\n *\r\n * @namespace Phaser.Physics.Matter.Components.Transform\r\n * @since 3.0.0\r\n */\r\nvar Transform = {\r\n\r\n /**\r\n * The x position of this Game Object.\r\n *\r\n * @name Phaser.Physics.Matter.Components.Transform#x\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n x: {\r\n\r\n get: function ()\r\n {\r\n return this.body.position.x;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._tempVec2.set(value, this.y);\r\n\r\n Body.setPosition(this.body, this._tempVec2);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The y position of this Game Object.\r\n *\r\n * @name Phaser.Physics.Matter.Components.Transform#y\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n y: {\r\n\r\n get: function ()\r\n {\r\n return this.body.position.y;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._tempVec2.set(this.x, value);\r\n\r\n Body.setPosition(this.body, this._tempVec2);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The horizontal scale of this Game Object.\r\n *\r\n * @name Phaser.Physics.Matter.Components.Transform#scaleX\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleX;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var factorX = 1 / this._scaleX;\r\n var factorY = 1 / this._scaleY;\r\n \r\n this._scaleX = value;\r\n\r\n if (this._scaleX === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n\r\n // Reset Matter scale back to 1 (sigh)\r\n Body.scale(this.body, factorX, factorY);\r\n\r\n Body.scale(this.body, value, this._scaleY);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical scale of this Game Object.\r\n *\r\n * @name Phaser.Physics.Matter.Components.Transform#scaleY\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleY;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var factorX = 1 / this._scaleX;\r\n var factorY = 1 / this._scaleY;\r\n\r\n this._scaleY = value;\r\n\r\n if (this._scaleY === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n\r\n Body.scale(this.body, factorX, factorY);\r\n\r\n Body.scale(this.body, this._scaleX, value);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Use `angle` to set or get rotation of the physics body associated to this GameObject.\r\n * Unlike rotation, when using set the value can be in degrees, which will be converted to radians internally.\r\n *\r\n * @name Phaser.Physics.Matter.Components.Transform#angle\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n angle: {\r\n\r\n get: function ()\r\n {\r\n return WrapAngleDegrees(this.body.angle * MATH_CONST.RAD_TO_DEG);\r\n },\r\n\r\n set: function (value)\r\n {\r\n // value is in degrees\r\n this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD;\r\n }\r\n },\r\n\r\n /**\r\n * Use `rotation` to set or get the rotation of the physics body associated with this GameObject.\r\n * The value when set must be in radians.\r\n *\r\n * @name Phaser.Physics.Matter.Components.Transform#rotation\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n rotation: {\r\n\r\n get: function ()\r\n {\r\n return this.body.angle;\r\n },\r\n\r\n set: function (value)\r\n {\r\n // value is in radians\r\n this._rotation = WrapAngle(value);\r\n\r\n Body.setAngle(this.body, this._rotation);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the position of the physics body along x and y axes.\r\n * Both the parameters to this function are optional and if not passed any they default to 0.\r\n * Velocity, angle, force etc. are unchanged.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Transform#setPosition\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The horizontal position of the body.\r\n * @param {number} [y=x] - The vertical position of the body.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setPosition: function (x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = x; }\r\n\r\n this._tempVec2.set(x, y);\r\n\r\n Body.setPosition(this.body, this._tempVec2);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Immediately sets the angle of the Body.\r\n * Angular velocity, position, force etc. are unchanged.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Transform#setRotation\r\n * @since 3.0.0\r\n *\r\n * @param {number} [radians=0] - The angle of the body, in radians.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setRotation: function (radians)\r\n {\r\n if (radians === undefined) { radians = 0; }\r\n\r\n this._rotation = WrapAngle(radians);\r\n\r\n Body.setAngle(this.body, radians);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Setting fixed rotation sets the Body inertia to Infinity, which stops it\r\n * from being able to rotate when forces are applied to it.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Transform#setFixedRotation\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setFixedRotation: function ()\r\n {\r\n Body.setInertia(this.body, Infinity);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Immediately sets the angle of the Body.\r\n * Angular velocity, position, force etc. are unchanged.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Transform#setAngle\r\n * @since 3.0.0\r\n *\r\n * @param {number} [degrees=0] - The angle to set, in degrees.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setAngle: function (degrees)\r\n {\r\n if (degrees === undefined) { degrees = 0; }\r\n\r\n this.angle = degrees;\r\n\r\n Body.setAngle(this.body, this.rotation);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the scale of this Game Object.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Transform#setScale\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=1] - The horizontal scale of this Game Object.\r\n * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the x value.\r\n * @param {Phaser.Math.Vector2} [point] - The point (Vector2) from which scaling will occur.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setScale: function (x, y, point)\r\n {\r\n if (x === undefined) { x = 1; }\r\n if (y === undefined) { y = x; }\r\n\r\n var factorX = 1 / this._scaleX;\r\n var factorY = 1 / this._scaleY;\r\n\r\n this._scaleX = x;\r\n this._scaleY = y;\r\n\r\n Body.scale(this.body, factorX, factorY, point);\r\n\r\n Body.scale(this.body, x, y, point);\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Transform;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/components/Transform.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/components/Velocity.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/components/Velocity.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Body = __webpack_require__(/*! ../lib/body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\n\r\n/**\r\n * Contains methods for changing the velocity of a Matter Body. Should be used as a mixin and not called directly.\r\n *\r\n * @namespace Phaser.Physics.Matter.Components.Velocity\r\n * @since 3.0.0\r\n */\r\nvar Velocity = {\r\n\r\n /**\r\n * Sets the angular velocity of the body instantly.\r\n * Position, angle, force etc. are unchanged.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Velocity#setAngularVelocity\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The angular velocity.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setAngularVelocity: function (value)\r\n {\r\n Body.setAngularVelocity(this.body, value);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal velocity of the physics body.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Velocity#setVelocityX\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal velocity value.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setVelocityX: function (x)\r\n {\r\n this._tempVec2.set(x, this.body.velocity.y);\r\n\r\n Body.setVelocity(this.body, this._tempVec2);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets vertical velocity of the physics body.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Velocity#setVelocityY\r\n * @since 3.0.0\r\n *\r\n * @param {number} y - The vertical velocity value.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setVelocityY: function (y)\r\n {\r\n this._tempVec2.set(this.body.velocity.x, y);\r\n\r\n Body.setVelocity(this.body, this._tempVec2);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets both the horizontal and vertical velocity of the physics body.\r\n *\r\n * @method Phaser.Physics.Matter.Components.Velocity#setVelocity\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal velocity value.\r\n * @param {number} [y=x] - The vertical velocity value, it can be either positive or negative. If not given, it will be the same as the `x` value.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} This Game Object.\r\n */\r\n setVelocity: function (x, y)\r\n {\r\n this._tempVec2.set(x, y);\r\n\r\n Body.setVelocity(this.body, this._tempVec2);\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Velocity;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/components/Velocity.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/components/index.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/components/index.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Physics.Matter.Components\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Bounce: __webpack_require__(/*! ./Bounce */ \"./node_modules/phaser/src/physics/matter-js/components/Bounce.js\"),\r\n Collision: __webpack_require__(/*! ./Collision */ \"./node_modules/phaser/src/physics/matter-js/components/Collision.js\"),\r\n Force: __webpack_require__(/*! ./Force */ \"./node_modules/phaser/src/physics/matter-js/components/Force.js\"),\r\n Friction: __webpack_require__(/*! ./Friction */ \"./node_modules/phaser/src/physics/matter-js/components/Friction.js\"),\r\n Gravity: __webpack_require__(/*! ./Gravity */ \"./node_modules/phaser/src/physics/matter-js/components/Gravity.js\"),\r\n Mass: __webpack_require__(/*! ./Mass */ \"./node_modules/phaser/src/physics/matter-js/components/Mass.js\"),\r\n Static: __webpack_require__(/*! ./Static */ \"./node_modules/phaser/src/physics/matter-js/components/Static.js\"),\r\n Sensor: __webpack_require__(/*! ./Sensor */ \"./node_modules/phaser/src/physics/matter-js/components/Sensor.js\"),\r\n SetBody: __webpack_require__(/*! ./SetBody */ \"./node_modules/phaser/src/physics/matter-js/components/SetBody.js\"),\r\n Sleep: __webpack_require__(/*! ./Sleep */ \"./node_modules/phaser/src/physics/matter-js/components/Sleep.js\"),\r\n Transform: __webpack_require__(/*! ./Transform */ \"./node_modules/phaser/src/physics/matter-js/components/Transform.js\"),\r\n Velocity: __webpack_require__(/*! ./Velocity */ \"./node_modules/phaser/src/physics/matter-js/components/Velocity.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/components/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/AFTER_ADD_EVENT.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/AFTER_ADD_EVENT.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @typedef {object} Phaser.Physics.Matter.Events.AfterAddEvent\r\n *\r\n * @property {any[]} object - An array of the object(s) that have been added. May be a single body, constraint, composite or a mixture of these.\r\n * @property {any} source - The source object of the event.\r\n * @property {string} name - The name of the event.\r\n */\r\n\r\n/**\r\n * The Matter Physics After Add Event.\r\n * \r\n * This event is dispatched by a Matter Physics World instance at the end of the process when a new Body\r\n * or Constraint has just been added to the world.\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('afteradd', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#AFTER_ADD\r\n * @since 3.22.0\r\n * \r\n * @param {Phaser.Physics.Matter.Events.AfterAddEvent} event - The Add Event object.\r\n */\r\nmodule.exports = 'afteradd';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/AFTER_ADD_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/AFTER_REMOVE_EVENT.js": /*!********************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/AFTER_REMOVE_EVENT.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @typedef {object} Phaser.Physics.Matter.Events.AfterRemoveEvent\r\n *\r\n * @property {any[]} object - An array of the object(s) that were removed. May be a single body, constraint, composite or a mixture of these.\r\n * @property {any} source - The source object of the event.\r\n * @property {string} name - The name of the event.\r\n */\r\n\r\n/**\r\n * The Matter Physics After Remove Event.\r\n * \r\n * This event is dispatched by a Matter Physics World instance at the end of the process when a \r\n * Body or Constraint was removed from the world.\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('afterremove', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#AFTER_REMOVE\r\n * @since 3.22.0\r\n * \r\n * @param {Phaser.Physics.Matter.Events.AfterRemoveEvent} event - The Remove Event object.\r\n */\r\nmodule.exports = 'afterremove';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/AFTER_REMOVE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/AFTER_UPDATE_EVENT.js": /*!********************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/AFTER_UPDATE_EVENT.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @typedef {object} Phaser.Physics.Matter.Events.AfterUpdateEvent\r\n *\r\n * @property {number} timestamp - The Matter Engine `timing.timestamp` value for the event.\r\n * @property {any} source - The source object of the event.\r\n * @property {string} name - The name of the event.\r\n */\r\n\r\n/**\r\n * The Matter Physics After Update Event.\r\n * \r\n * This event is dispatched by a Matter Physics World instance after the engine has updated and all collision events have resolved.\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('afterupdate', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#AFTER_UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Physics.Matter.Events.AfterUpdateEvent} event - The Update Event object.\r\n */\r\nmodule.exports = 'afterupdate';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/AFTER_UPDATE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/BEFORE_ADD_EVENT.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/BEFORE_ADD_EVENT.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @typedef {object} Phaser.Physics.Matter.Events.BeforeAddEvent\r\n *\r\n * @property {any[]} object - An array of the object(s) to be added. May be a single body, constraint, composite or a mixture of these.\r\n * @property {any} source - The source object of the event.\r\n * @property {string} name - The name of the event.\r\n */\r\n\r\n/**\r\n * The Matter Physics Before Add Event.\r\n * \r\n * This event is dispatched by a Matter Physics World instance at the start of the process when a new Body\r\n * or Constraint is being added to the world.\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('beforeadd', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#BEFORE_ADD\r\n * @since 3.22.0\r\n * \r\n * @param {Phaser.Physics.Matter.Events.BeforeAddEvent} event - The Add Event object.\r\n */\r\nmodule.exports = 'beforeadd';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/BEFORE_ADD_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/BEFORE_REMOVE_EVENT.js": /*!*********************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/BEFORE_REMOVE_EVENT.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @typedef {object} Phaser.Physics.Matter.Events.BeforeRemoveEvent\r\n *\r\n * @property {any[]} object - An array of the object(s) to be removed. May be a single body, constraint, composite or a mixture of these.\r\n * @property {any} source - The source object of the event.\r\n * @property {string} name - The name of the event.\r\n */\r\n\r\n/**\r\n * The Matter Physics Before Remove Event.\r\n * \r\n * This event is dispatched by a Matter Physics World instance at the start of the process when a \r\n * Body or Constraint is being removed from the world.\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('beforeremove', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#BEFORE_REMOVE\r\n * @since 3.22.0\r\n * \r\n * @param {Phaser.Physics.Matter.Events.BeforeRemoveEvent} event - The Remove Event object.\r\n */\r\nmodule.exports = 'beforeremove';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/BEFORE_REMOVE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/BEFORE_UPDATE_EVENT.js": /*!*********************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/BEFORE_UPDATE_EVENT.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @typedef {object} Phaser.Physics.Matter.Events.BeforeUpdateEvent\r\n *\r\n * @property {number} timestamp - The Matter Engine `timing.timestamp` value for the event.\r\n * @property {any} source - The source object of the event.\r\n * @property {string} name - The name of the event.\r\n */\r\n\r\n/**\r\n * The Matter Physics Before Update Event.\r\n * \r\n * This event is dispatched by a Matter Physics World instance right before all the collision processing takes place.\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('beforeupdate', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#BEFORE_UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Physics.Matter.Events.BeforeUpdateEvent} event - The Update Event object.\r\n */\r\nmodule.exports = 'beforeupdate';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/BEFORE_UPDATE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/COLLISION_ACTIVE_EVENT.js": /*!************************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/COLLISION_ACTIVE_EVENT.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @typedef {object} Phaser.Physics.Matter.Events.CollisionActiveEvent\r\n *\r\n * @property {Phaser.Types.Physics.Matter.MatterCollisionData[]} pairs - A list of all affected pairs in the collision.\r\n * @property {number} timestamp - The Matter Engine `timing.timestamp` value for the event.\r\n * @property {any} source - The source object of the event.\r\n * @property {string} name - The name of the event.\r\n */\r\n\r\n/**\r\n * The Matter Physics Collision Active Event.\r\n * \r\n * This event is dispatched by a Matter Physics World instance after the engine has updated.\r\n * It provides a list of all pairs that are colliding in the current tick (if any).\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('collisionactive', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#COLLISION_ACTIVE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Physics.Matter.Events.CollisionActiveEvent} event - The Collision Event object.\r\n * @param {MatterJS.BodyType} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.\r\n * @param {MatterJS.BodyType} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.\r\n */\r\nmodule.exports = 'collisionactive';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/COLLISION_ACTIVE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/COLLISION_END_EVENT.js": /*!*********************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/COLLISION_END_EVENT.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @typedef {object} Phaser.Physics.Matter.Events.CollisionEndEvent\r\n *\r\n * @property {Phaser.Types.Physics.Matter.MatterCollisionData[]} pairs - A list of all affected pairs in the collision.\r\n * @property {number} timestamp - The Matter Engine `timing.timestamp` value for the event.\r\n * @property {any} source - The source object of the event.\r\n * @property {string} name - The name of the event.\r\n */\r\n\r\n/**\r\n * The Matter Physics Collision End Event.\r\n * \r\n * This event is dispatched by a Matter Physics World instance after the engine has updated.\r\n * It provides a list of all pairs that have finished colliding in the current tick (if any).\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('collisionend', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#COLLISION_END\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Physics.Matter.Events.CollisionEndEvent} event - The Collision Event object.\r\n * @param {MatterJS.BodyType} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.\r\n * @param {MatterJS.BodyType} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.\r\n */\r\nmodule.exports = 'collisionend';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/COLLISION_END_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/COLLISION_START_EVENT.js": /*!***********************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/COLLISION_START_EVENT.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @typedef {object} Phaser.Physics.Matter.Events.CollisionStartEvent\r\n *\r\n * @property {Phaser.Types.Physics.Matter.MatterCollisionData[]} pairs - A list of all affected pairs in the collision.\r\n * @property {number} timestamp - The Matter Engine `timing.timestamp` value for the event.\r\n * @property {any} source - The source object of the event.\r\n * @property {string} name - The name of the event.\r\n */\r\n\r\n/**\r\n * The Matter Physics Collision Start Event.\r\n * \r\n * This event is dispatched by a Matter Physics World instance after the engine has updated.\r\n * It provides a list of all pairs that have started to collide in the current tick (if any).\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('collisionstart', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#COLLISION_START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Physics.Matter.Events.CollisionStartEvent} event - The Collision Event object.\r\n * @param {MatterJS.BodyType} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.\r\n * @param {MatterJS.BodyType} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.\r\n */\r\nmodule.exports = 'collisionstart';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/COLLISION_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/DRAG_END_EVENT.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/DRAG_END_EVENT.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Matter Physics Drag End Event.\r\n * \r\n * This event is dispatched by a Matter Physics World instance when a Pointer Constraint\r\n * stops dragging a body.\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('dragend', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#DRAG_END\r\n * @since 3.16.2\r\n * \r\n * @param {MatterJS.BodyType} body - The Body that has stopped being dragged. This is a Matter Body, not a Phaser Game Object.\r\n * @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that was dragging the body.\r\n */\r\nmodule.exports = 'dragend';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/DRAG_END_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/DRAG_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/DRAG_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Matter Physics Drag Event.\r\n * \r\n * This event is dispatched by a Matter Physics World instance when a Pointer Constraint\r\n * is actively dragging a body. It is emitted each time the pointer moves.\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('drag', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#DRAG\r\n * @since 3.16.2\r\n * \r\n * @param {MatterJS.BodyType} body - The Body that is being dragged. This is a Matter Body, not a Phaser Game Object.\r\n * @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that is dragging the body.\r\n */\r\nmodule.exports = 'drag';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/DRAG_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/DRAG_START_EVENT.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/DRAG_START_EVENT.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Matter Physics Drag Start Event.\r\n * \r\n * This event is dispatched by a Matter Physics World instance when a Pointer Constraint\r\n * starts dragging a body.\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('dragstart', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#DRAG_START\r\n * @since 3.16.2\r\n * \r\n * @param {MatterJS.BodyType} body - The Body that has started being dragged. This is a Matter Body, not a Phaser Game Object.\r\n * @param {MatterJS.BodyType} part - The part of the body that was clicked on.\r\n * @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that is dragging the body.\r\n */\r\nmodule.exports = 'dragstart';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/DRAG_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/PAUSE_EVENT.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/PAUSE_EVENT.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Matter Physics World Pause Event.\r\n * \r\n * This event is dispatched by an Matter Physics World instance when it is paused.\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('pause', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#PAUSE\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'pause';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/PAUSE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/RESUME_EVENT.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/RESUME_EVENT.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Matter Physics World Resume Event.\r\n * \r\n * This event is dispatched by an Matter Physics World instance when it resumes from a paused state.\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('resume', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#RESUME\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'resume';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/RESUME_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/SLEEP_END_EVENT.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/SLEEP_END_EVENT.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @typedef {object} Phaser.Physics.Matter.Events.SleepEndEvent\r\n *\r\n * @property {any} source - The source object of the event.\r\n * @property {string} name - The name of the event.\r\n */\r\n\r\n/**\r\n * The Matter Physics Sleep End Event.\r\n * \r\n * This event is dispatched by a Matter Physics World instance when a Body stop sleeping.\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('sleepend', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#SLEEP_END\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Physics.Matter.Events.SleepEndEvent} event - The Sleep Event object.\r\n * @param {MatterJS.BodyType} body - The body that has stopped sleeping.\r\n */\r\nmodule.exports = 'sleepend';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/SLEEP_END_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/SLEEP_START_EVENT.js": /*!*******************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/SLEEP_START_EVENT.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @typedef {object} Phaser.Physics.Matter.Events.SleepStartEvent\r\n *\r\n * @property {any} source - The source object of the event.\r\n * @property {string} name - The name of the event.\r\n */\r\n\r\n/**\r\n * The Matter Physics Sleep Start Event.\r\n * \r\n * This event is dispatched by a Matter Physics World instance when a Body goes to sleep.\r\n * \r\n * Listen to it from a Scene using: `this.matter.world.on('sleepstart', listener)`.\r\n *\r\n * @event Phaser.Physics.Matter.Events#SLEEP_START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Physics.Matter.Events.SleepStartEvent} event - The Sleep Event object.\r\n * @param {MatterJS.BodyType} body - The body that has gone to sleep.\r\n */\r\nmodule.exports = 'sleepstart';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/SLEEP_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/events/index.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/events/index.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Physics.Matter.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n AFTER_ADD: __webpack_require__(/*! ./AFTER_ADD_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/AFTER_ADD_EVENT.js\"),\r\n AFTER_REMOVE: __webpack_require__(/*! ./AFTER_REMOVE_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/AFTER_REMOVE_EVENT.js\"),\r\n AFTER_UPDATE: __webpack_require__(/*! ./AFTER_UPDATE_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/AFTER_UPDATE_EVENT.js\"),\r\n BEFORE_ADD: __webpack_require__(/*! ./BEFORE_ADD_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/BEFORE_ADD_EVENT.js\"),\r\n BEFORE_REMOVE: __webpack_require__(/*! ./BEFORE_REMOVE_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/BEFORE_REMOVE_EVENT.js\"),\r\n BEFORE_UPDATE: __webpack_require__(/*! ./BEFORE_UPDATE_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/BEFORE_UPDATE_EVENT.js\"),\r\n COLLISION_ACTIVE: __webpack_require__(/*! ./COLLISION_ACTIVE_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/COLLISION_ACTIVE_EVENT.js\"),\r\n COLLISION_END: __webpack_require__(/*! ./COLLISION_END_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/COLLISION_END_EVENT.js\"),\r\n COLLISION_START: __webpack_require__(/*! ./COLLISION_START_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/COLLISION_START_EVENT.js\"),\r\n DRAG_END: __webpack_require__(/*! ./DRAG_END_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/DRAG_END_EVENT.js\"),\r\n DRAG: __webpack_require__(/*! ./DRAG_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/DRAG_EVENT.js\"),\r\n DRAG_START: __webpack_require__(/*! ./DRAG_START_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/DRAG_START_EVENT.js\"),\r\n PAUSE: __webpack_require__(/*! ./PAUSE_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/PAUSE_EVENT.js\"),\r\n RESUME: __webpack_require__(/*! ./RESUME_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/RESUME_EVENT.js\"),\r\n SLEEP_END: __webpack_require__(/*! ./SLEEP_END_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/SLEEP_END_EVENT.js\"),\r\n SLEEP_START: __webpack_require__(/*! ./SLEEP_START_EVENT */ \"./node_modules/phaser/src/physics/matter-js/events/SLEEP_START_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/index.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/index.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Physics.Matter\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BodyBounds: __webpack_require__(/*! ./BodyBounds */ \"./node_modules/phaser/src/physics/matter-js/BodyBounds.js\"),\r\n Factory: __webpack_require__(/*! ./Factory */ \"./node_modules/phaser/src/physics/matter-js/Factory.js\"),\r\n Image: __webpack_require__(/*! ./MatterImage */ \"./node_modules/phaser/src/physics/matter-js/MatterImage.js\"),\r\n Matter: __webpack_require__(/*! ./CustomMain */ \"./node_modules/phaser/src/physics/matter-js/CustomMain.js\"),\r\n MatterPhysics: __webpack_require__(/*! ./MatterPhysics */ \"./node_modules/phaser/src/physics/matter-js/MatterPhysics.js\"),\r\n PolyDecomp: __webpack_require__(/*! ./poly-decomp */ \"./node_modules/phaser/src/physics/matter-js/poly-decomp/index.js\"),\r\n Sprite: __webpack_require__(/*! ./MatterSprite */ \"./node_modules/phaser/src/physics/matter-js/MatterSprite.js\"),\r\n TileBody: __webpack_require__(/*! ./MatterTileBody */ \"./node_modules/phaser/src/physics/matter-js/MatterTileBody.js\"),\r\n PhysicsEditorParser: __webpack_require__(/*! ./PhysicsEditorParser */ \"./node_modules/phaser/src/physics/matter-js/PhysicsEditorParser.js\"),\r\n PhysicsJSONParser: __webpack_require__(/*! ./PhysicsJSONParser */ \"./node_modules/phaser/src/physics/matter-js/PhysicsJSONParser.js\"),\r\n World: __webpack_require__(/*! ./World */ \"./node_modules/phaser/src/physics/matter-js/World.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/body/Body.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/body/Body.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * The `Matter.Body` module contains methods for creating and manipulating body models.\r\n * A `Matter.Body` is a rigid body that can be simulated by a `Matter.Engine`.\r\n * Factories for commonly used body configurations (such as rectangles, circles and other polygons) can be found in the module `Matter.Bodies`.\r\n *\r\n * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\r\n * @class Body\r\n */\r\n\r\nvar Body = {};\r\n\r\nmodule.exports = Body;\r\n\r\nvar Vertices = __webpack_require__(/*! ../geometry/Vertices */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js\");\r\nvar Vector = __webpack_require__(/*! ../geometry/Vector */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vector.js\");\r\nvar Sleeping = __webpack_require__(/*! ../core/Sleeping */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Sleeping.js\");\r\nvar Common = __webpack_require__(/*! ../core/Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\nvar Bounds = __webpack_require__(/*! ../geometry/Bounds */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Bounds.js\");\r\nvar Axes = __webpack_require__(/*! ../geometry/Axes */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Axes.js\");\r\n\r\n(function() {\r\n\r\n Body._inertiaScale = 4;\r\n Body._nextCollidingGroupId = 1;\r\n Body._nextNonCollidingGroupId = -1;\r\n Body._nextCategory = 0x0001;\r\n\r\n /**\r\n * Creates a new rigid body model. The options parameter is an object that specifies any properties you wish to override the defaults.\r\n * All properties have default values, and many are pre-calculated automatically based on other properties.\r\n * Vertices must be specified in clockwise order.\r\n * See the properties section below for detailed information on what you can pass via the `options` object.\r\n * @method create\r\n * @param {} options\r\n * @return {body} body\r\n */\r\n Body.create = function(options) {\r\n var defaults = {\r\n id: Common.nextId(),\r\n type: 'body',\r\n label: 'Body',\r\n parts: [],\r\n plugin: {},\r\n angle: 0,\r\n vertices: null, // Phaser change: no point calling fromPath if they pass in vertices anyway\r\n position: { x: 0, y: 0 },\r\n force: { x: 0, y: 0 },\r\n torque: 0,\r\n positionImpulse: { x: 0, y: 0 },\r\n previousPositionImpulse: { x: 0, y: 0 },\r\n constraintImpulse: { x: 0, y: 0, angle: 0 },\r\n totalContacts: 0,\r\n speed: 0,\r\n angularSpeed: 0,\r\n velocity: { x: 0, y: 0 },\r\n angularVelocity: 0,\r\n isSensor: false,\r\n isStatic: false,\r\n isSleeping: false,\r\n motion: 0,\r\n sleepThreshold: 60,\r\n density: 0.001,\r\n restitution: 0,\r\n friction: 0.1,\r\n frictionStatic: 0.5,\r\n frictionAir: 0.01,\r\n collisionFilter: {\r\n category: 0x0001,\r\n mask: 0xFFFFFFFF,\r\n group: 0\r\n },\r\n slop: 0.05,\r\n timeScale: 1,\r\n events: null,\r\n bounds: null,\r\n chamfer: null,\r\n circleRadius: 0,\r\n positionPrev: null,\r\n anglePrev: 0,\r\n parent: null,\r\n axes: null,\r\n area: 0,\r\n mass: 0,\r\n inverseMass: 0,\r\n inertia: 0,\r\n inverseInertia: 0,\r\n _original: null,\r\n render: {\r\n visible: true,\r\n opacity: 1,\r\n sprite: {\r\n xOffset: 0,\r\n yOffset: 0\r\n },\r\n fillColor: null, // custom Phaser property\r\n fillOpacity: null, // custom Phaser property\r\n lineColor: null, // custom Phaser property\r\n lineOpacity: null, // custom Phaser property\r\n lineThickness: null // custom Phaser property\r\n },\r\n gameObject: null, // custom Phaser property\r\n scale: { x: 1, y: 1 }, // custom Phaser property\r\n centerOfMass: { x: 0, y: 0 }, // custom Phaser property (float, 0 - 1)\r\n centerOffset: { x: 0, y: 0 }, // custom Phaser property (pixel values)\r\n gravityScale: { x: 1, y: 1 }, // custom Phaser property\r\n ignoreGravity: false, // custom Phaser property\r\n ignorePointer: false, // custom Phaser property\r\n onCollideCallback: null, // custom Phaser property\r\n onCollideEndCallback: null, // custom Phaser property\r\n onCollideActiveCallback: null, // custom Phaser property\r\n onCollideWith: {} // custom Phaser property\r\n };\r\n\r\n if (!options.hasOwnProperty('position') && options.hasOwnProperty('vertices'))\r\n {\r\n options.position = Vertices.centre(options.vertices);\r\n }\r\n else if (!options.hasOwnProperty('vertices'))\r\n {\r\n defaults.vertices = Vertices.fromPath('L 0 0 L 40 0 L 40 40 L 0 40');\r\n }\r\n\r\n var body = Common.extend(defaults, options);\r\n\r\n _initProperties(body, options);\r\n\r\n // Helper function\r\n body.setOnCollideWith = function (body, callback)\r\n {\r\n if (callback)\r\n {\r\n this.onCollideWith[body.id] = callback;\r\n }\r\n else\r\n {\r\n delete this.onCollideWith[body.id];\r\n }\r\n\r\n return this;\r\n }\r\n\r\n return body;\r\n };\r\n\r\n /**\r\n * Returns the next unique group index for which bodies will collide.\r\n * If `isNonColliding` is `true`, returns the next unique group index for which bodies will _not_ collide.\r\n * See `body.collisionFilter` for more information.\r\n * @method nextGroup\r\n * @param {bool} [isNonColliding=false]\r\n * @return {Number} Unique group index\r\n */\r\n Body.nextGroup = function(isNonColliding) {\r\n if (isNonColliding)\r\n return Body._nextNonCollidingGroupId--;\r\n\r\n return Body._nextCollidingGroupId++;\r\n };\r\n\r\n /**\r\n * Returns the next unique category bitfield (starting after the initial default category `0x0001`).\r\n * There are 32 available. See `body.collisionFilter` for more information.\r\n * @method nextCategory\r\n * @return {Number} Unique category bitfield\r\n */\r\n Body.nextCategory = function() {\r\n Body._nextCategory = Body._nextCategory << 1;\r\n return Body._nextCategory;\r\n };\r\n\r\n /**\r\n * Initialises body properties.\r\n * @method _initProperties\r\n * @private\r\n * @param {body} body\r\n * @param {} [options]\r\n */\r\n var _initProperties = function(body, options) {\r\n options = options || {};\r\n\r\n // init required properties (order is important)\r\n Body.set(body, {\r\n bounds: body.bounds || Bounds.create(body.vertices),\r\n positionPrev: body.positionPrev || Vector.clone(body.position),\r\n anglePrev: body.anglePrev || body.angle,\r\n vertices: body.vertices,\r\n parts: body.parts || [body],\r\n isStatic: body.isStatic,\r\n isSleeping: body.isSleeping,\r\n parent: body.parent || body\r\n });\r\n\r\n var bounds = body.bounds;\r\n\r\n Vertices.rotate(body.vertices, body.angle, body.position);\r\n Axes.rotate(body.axes, body.angle);\r\n Bounds.update(bounds, body.vertices, body.velocity);\r\n\r\n // allow options to override the automatically calculated properties\r\n Body.set(body, {\r\n axes: options.axes || body.axes,\r\n area: options.area || body.area,\r\n mass: options.mass || body.mass,\r\n inertia: options.inertia || body.inertia\r\n });\r\n\r\n if (body.parts.length === 1)\r\n {\r\n var centerOfMass = body.centerOfMass;\r\n var centerOffset = body.centerOffset;\r\n \r\n var bodyWidth = bounds.max.x - bounds.min.x;\r\n var bodyHeight = bounds.max.y - bounds.min.y;\r\n \r\n centerOfMass.x = -(bounds.min.x - body.position.x) / bodyWidth;\r\n centerOfMass.y = -(bounds.min.y - body.position.y) / bodyHeight;\r\n \r\n centerOffset.x = bodyWidth * centerOfMass.x;\r\n centerOffset.y = bodyHeight * centerOfMass.y;\r\n }\r\n };\r\n\r\n /**\r\n * Given a property and a value (or map of), sets the property(s) on the body, using the appropriate setter functions if they exist.\r\n * Prefer to use the actual setter functions in performance critical situations.\r\n * @method set\r\n * @param {body} body\r\n * @param {} settings A property name (or map of properties and values) to set on the body.\r\n * @param {} value The value to set if `settings` is a single property name.\r\n */\r\n Body.set = function(body, settings, value) {\r\n var property;\r\n\r\n if (typeof settings === 'string') {\r\n property = settings;\r\n settings = {};\r\n settings[property] = value;\r\n }\r\n\r\n for (property in settings) {\r\n if (!Object.prototype.hasOwnProperty.call(settings, property))\r\n continue;\r\n\r\n value = settings[property];\r\n switch (property) {\r\n\r\n case 'isStatic':\r\n Body.setStatic(body, value);\r\n break;\r\n case 'isSleeping':\r\n Sleeping.set(body, value);\r\n break;\r\n case 'mass':\r\n Body.setMass(body, value);\r\n break;\r\n case 'density':\r\n Body.setDensity(body, value);\r\n break;\r\n case 'inertia':\r\n Body.setInertia(body, value);\r\n break;\r\n case 'vertices':\r\n Body.setVertices(body, value);\r\n break;\r\n case 'position':\r\n Body.setPosition(body, value);\r\n break;\r\n case 'angle':\r\n Body.setAngle(body, value);\r\n break;\r\n case 'velocity':\r\n Body.setVelocity(body, value);\r\n break;\r\n case 'angularVelocity':\r\n Body.setAngularVelocity(body, value);\r\n break;\r\n case 'parts':\r\n Body.setParts(body, value);\r\n break;\r\n case 'centre':\r\n Body.setCentre(body, value);\r\n break;\r\n default:\r\n body[property] = value;\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Sets the body as static, including isStatic flag and setting mass and inertia to Infinity.\r\n * @method setStatic\r\n * @param {body} body\r\n * @param {bool} isStatic\r\n */\r\n Body.setStatic = function(body, isStatic) {\r\n for (var i = 0; i < body.parts.length; i++) {\r\n var part = body.parts[i];\r\n part.isStatic = isStatic;\r\n\r\n if (isStatic) {\r\n part._original = {\r\n restitution: part.restitution,\r\n friction: part.friction,\r\n mass: part.mass,\r\n inertia: part.inertia,\r\n density: part.density,\r\n inverseMass: part.inverseMass,\r\n inverseInertia: part.inverseInertia\r\n };\r\n\r\n part.restitution = 0;\r\n part.friction = 1;\r\n part.mass = part.inertia = part.density = Infinity;\r\n part.inverseMass = part.inverseInertia = 0;\r\n\r\n part.positionPrev.x = part.position.x;\r\n part.positionPrev.y = part.position.y;\r\n part.anglePrev = part.angle;\r\n part.angularVelocity = 0;\r\n part.speed = 0;\r\n part.angularSpeed = 0;\r\n part.motion = 0;\r\n } else if (part._original) {\r\n part.restitution = part._original.restitution;\r\n part.friction = part._original.friction;\r\n part.mass = part._original.mass;\r\n part.inertia = part._original.inertia;\r\n part.density = part._original.density;\r\n part.inverseMass = part._original.inverseMass;\r\n part.inverseInertia = part._original.inverseInertia;\r\n\r\n part._original = null;\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Sets the mass of the body. Inverse mass, density and inertia are automatically updated to reflect the change.\r\n * @method setMass\r\n * @param {body} body\r\n * @param {number} mass\r\n */\r\n Body.setMass = function(body, mass) {\r\n var moment = body.inertia / (body.mass / 6);\r\n body.inertia = moment * (mass / 6);\r\n body.inverseInertia = 1 / body.inertia;\r\n\r\n body.mass = mass;\r\n body.inverseMass = 1 / body.mass;\r\n body.density = body.mass / body.area;\r\n };\r\n\r\n /**\r\n * Sets the density of the body. Mass and inertia are automatically updated to reflect the change.\r\n * @method setDensity\r\n * @param {body} body\r\n * @param {number} density\r\n */\r\n Body.setDensity = function(body, density) {\r\n Body.setMass(body, density * body.area);\r\n body.density = density;\r\n };\r\n\r\n /**\r\n * Sets the moment of inertia (i.e. second moment of area) of the body. \r\n * Inverse inertia is automatically updated to reflect the change. Mass is not changed.\r\n * @method setInertia\r\n * @param {body} body\r\n * @param {number} inertia\r\n */\r\n Body.setInertia = function(body, inertia) {\r\n body.inertia = inertia;\r\n body.inverseInertia = 1 / body.inertia;\r\n };\r\n\r\n /**\r\n * Sets the body's vertices and updates body properties accordingly, including inertia, area and mass (with respect to `body.density`).\r\n * Vertices will be automatically transformed to be orientated around their centre of mass as the origin.\r\n * They are then automatically translated to world space based on `body.position`.\r\n *\r\n * The `vertices` argument should be passed as an array of `Matter.Vector` points (or a `Matter.Vertices` array).\r\n * Vertices must form a convex hull, concave hulls are not supported.\r\n *\r\n * @method setVertices\r\n * @param {body} body\r\n * @param {vector[]} vertices\r\n */\r\n Body.setVertices = function(body, vertices) {\r\n // change vertices\r\n if (vertices[0].body === body) {\r\n body.vertices = vertices;\r\n } else {\r\n body.vertices = Vertices.create(vertices, body);\r\n }\r\n\r\n // update properties\r\n body.axes = Axes.fromVertices(body.vertices);\r\n body.area = Vertices.area(body.vertices);\r\n Body.setMass(body, body.density * body.area);\r\n\r\n // orient vertices around the centre of mass at origin (0, 0)\r\n var centre = Vertices.centre(body.vertices);\r\n Vertices.translate(body.vertices, centre, -1);\r\n\r\n // update inertia while vertices are at origin (0, 0)\r\n Body.setInertia(body, Body._inertiaScale * Vertices.inertia(body.vertices, body.mass));\r\n\r\n // update geometry\r\n Vertices.translate(body.vertices, body.position);\r\n\r\n Bounds.update(body.bounds, body.vertices, body.velocity);\r\n };\r\n\r\n /**\r\n * Sets the parts of the `body` and updates mass, inertia and centroid.\r\n * Each part will have its parent set to `body`.\r\n * By default the convex hull will be automatically computed and set on `body`, unless `autoHull` is set to `false.`\r\n * Note that this method will ensure that the first part in `body.parts` will always be the `body`.\r\n * @method setParts\r\n * @param {body} body\r\n * @param [body] parts\r\n * @param {bool} [autoHull=true]\r\n */\r\n Body.setParts = function(body, parts, autoHull) {\r\n var i;\r\n\r\n // add all the parts, ensuring that the first part is always the parent body\r\n parts = parts.slice(0);\r\n body.parts.length = 0;\r\n body.parts.push(body);\r\n body.parent = body;\r\n\r\n for (i = 0; i < parts.length; i++) {\r\n var part = parts[i];\r\n if (part !== body) {\r\n part.parent = body;\r\n body.parts.push(part);\r\n }\r\n }\r\n\r\n if (body.parts.length === 1)\r\n return;\r\n\r\n autoHull = typeof autoHull !== 'undefined' ? autoHull : true;\r\n\r\n // find the convex hull of all parts to set on the parent body\r\n if (autoHull) {\r\n var vertices = [];\r\n for (i = 0; i < parts.length; i++) {\r\n vertices = vertices.concat(parts[i].vertices);\r\n }\r\n\r\n Vertices.clockwiseSort(vertices);\r\n\r\n var hull = Vertices.hull(vertices),\r\n hullCentre = Vertices.centre(hull);\r\n\r\n Body.setVertices(body, hull);\r\n Vertices.translate(body.vertices, hullCentre);\r\n }\r\n\r\n // sum the properties of all compound parts of the parent body\r\n var total = Body._totalProperties(body);\r\n\r\n // Phaser addition\r\n var cx = total.centre.x;\r\n var cy = total.centre.y;\r\n\r\n var bounds = body.bounds;\r\n var centerOfMass = body.centerOfMass;\r\n var centerOffset = body.centerOffset;\r\n\r\n Bounds.update(bounds, body.vertices, body.velocity);\r\n\r\n centerOfMass.x = -(bounds.min.x - cx) / (bounds.max.x - bounds.min.x);\r\n centerOfMass.y = -(bounds.min.y - cy) / (bounds.max.y - bounds.min.y);\r\n\r\n centerOffset.x = cx;\r\n centerOffset.y = cy;\r\n\r\n body.area = total.area;\r\n body.parent = body;\r\n body.position.x = cx;\r\n body.position.y = cy;\r\n body.positionPrev.x = cx;\r\n body.positionPrev.y = cy;\r\n\r\n Body.setMass(body, total.mass);\r\n Body.setInertia(body, total.inertia);\r\n Body.setPosition(body, total.centre);\r\n };\r\n\r\n /**\r\n * Set the centre of mass of the body. \r\n * The `centre` is a vector in world-space unless `relative` is set, in which case it is a translation.\r\n * The centre of mass is the point the body rotates about and can be used to simulate non-uniform density.\r\n * This is equal to moving `body.position` but not the `body.vertices`.\r\n * Invalid if the `centre` falls outside the body's convex hull.\r\n * @method setCentre\r\n * @param {body} body\r\n * @param {vector} centre\r\n * @param {bool} relative\r\n */\r\n Body.setCentre = function(body, centre, relative) {\r\n if (!relative) {\r\n body.positionPrev.x = centre.x - (body.position.x - body.positionPrev.x);\r\n body.positionPrev.y = centre.y - (body.position.y - body.positionPrev.y);\r\n body.position.x = centre.x;\r\n body.position.y = centre.y;\r\n } else {\r\n body.positionPrev.x += centre.x;\r\n body.positionPrev.y += centre.y;\r\n body.position.x += centre.x;\r\n body.position.y += centre.y;\r\n }\r\n };\r\n\r\n /**\r\n * Sets the position of the body instantly. Velocity, angle, force etc. are unchanged.\r\n * @method setPosition\r\n * @param {body} body\r\n * @param {vector} position\r\n */\r\n Body.setPosition = function(body, position) {\r\n var delta = Vector.sub(position, body.position);\r\n body.positionPrev.x += delta.x;\r\n body.positionPrev.y += delta.y;\r\n\r\n for (var i = 0; i < body.parts.length; i++) {\r\n var part = body.parts[i];\r\n part.position.x += delta.x;\r\n part.position.y += delta.y;\r\n Vertices.translate(part.vertices, delta);\r\n Bounds.update(part.bounds, part.vertices, body.velocity);\r\n }\r\n };\r\n\r\n /**\r\n * Sets the angle of the body instantly. Angular velocity, position, force etc. are unchanged.\r\n * @method setAngle\r\n * @param {body} body\r\n * @param {number} angle\r\n */\r\n Body.setAngle = function(body, angle) {\r\n var delta = angle - body.angle;\r\n body.anglePrev += delta;\r\n\r\n for (var i = 0; i < body.parts.length; i++) {\r\n var part = body.parts[i];\r\n part.angle += delta;\r\n Vertices.rotate(part.vertices, delta, body.position);\r\n Axes.rotate(part.axes, delta);\r\n Bounds.update(part.bounds, part.vertices, body.velocity);\r\n if (i > 0) {\r\n Vector.rotateAbout(part.position, delta, body.position, part.position);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Sets the linear velocity of the body instantly. Position, angle, force etc. are unchanged. See also `Body.applyForce`.\r\n * @method setVelocity\r\n * @param {body} body\r\n * @param {vector} velocity\r\n */\r\n Body.setVelocity = function(body, velocity) {\r\n body.positionPrev.x = body.position.x - velocity.x;\r\n body.positionPrev.y = body.position.y - velocity.y;\r\n body.velocity.x = velocity.x;\r\n body.velocity.y = velocity.y;\r\n body.speed = Vector.magnitude(body.velocity);\r\n };\r\n\r\n /**\r\n * Sets the angular velocity of the body instantly. Position, angle, force etc. are unchanged. See also `Body.applyForce`.\r\n * @method setAngularVelocity\r\n * @param {body} body\r\n * @param {number} velocity\r\n */\r\n Body.setAngularVelocity = function(body, velocity) {\r\n body.anglePrev = body.angle - velocity;\r\n body.angularVelocity = velocity;\r\n body.angularSpeed = Math.abs(body.angularVelocity);\r\n };\r\n\r\n /**\r\n * Moves a body by a given vector relative to its current position, without imparting any velocity.\r\n * @method translate\r\n * @param {body} body\r\n * @param {vector} translation\r\n */\r\n Body.translate = function(body, translation) {\r\n Body.setPosition(body, Vector.add(body.position, translation));\r\n };\r\n\r\n /**\r\n * Rotates a body by a given angle relative to its current angle, without imparting any angular velocity.\r\n * @method rotate\r\n * @param {body} body\r\n * @param {number} rotation\r\n * @param {vector} [point]\r\n */\r\n Body.rotate = function(body, rotation, point) {\r\n if (!point) {\r\n Body.setAngle(body, body.angle + rotation);\r\n } else {\r\n var cos = Math.cos(rotation),\r\n sin = Math.sin(rotation),\r\n dx = body.position.x - point.x,\r\n dy = body.position.y - point.y;\r\n \r\n Body.setPosition(body, {\r\n x: point.x + (dx * cos - dy * sin),\r\n y: point.y + (dx * sin + dy * cos)\r\n });\r\n\r\n Body.setAngle(body, body.angle + rotation);\r\n }\r\n };\r\n\r\n /**\r\n * Scales the body, including updating physical properties (mass, area, axes, inertia), from a world-space point (default is body centre).\r\n * @method scale\r\n * @param {body} body\r\n * @param {number} scaleX\r\n * @param {number} scaleY\r\n * @param {vector} [point]\r\n */\r\n Body.scale = function(body, scaleX, scaleY, point) {\r\n var totalArea = 0,\r\n totalInertia = 0;\r\n\r\n point = point || body.position;\r\n\r\n for (var i = 0; i < body.parts.length; i++) {\r\n var part = body.parts[i];\r\n\r\n part.scale.x = scaleX;\r\n part.scale.y = scaleY;\r\n\r\n // scale vertices\r\n Vertices.scale(part.vertices, scaleX, scaleY, point);\r\n\r\n // update properties\r\n part.axes = Axes.fromVertices(part.vertices);\r\n part.area = Vertices.area(part.vertices);\r\n Body.setMass(part, body.density * part.area);\r\n\r\n // update inertia (requires vertices to be at origin)\r\n Vertices.translate(part.vertices, { x: -part.position.x, y: -part.position.y });\r\n Body.setInertia(part, Body._inertiaScale * Vertices.inertia(part.vertices, part.mass));\r\n Vertices.translate(part.vertices, { x: part.position.x, y: part.position.y });\r\n\r\n if (i > 0) {\r\n totalArea += part.area;\r\n totalInertia += part.inertia;\r\n }\r\n\r\n // scale position\r\n part.position.x = point.x + (part.position.x - point.x) * scaleX;\r\n part.position.y = point.y + (part.position.y - point.y) * scaleY;\r\n\r\n // update bounds\r\n Bounds.update(part.bounds, part.vertices, body.velocity);\r\n }\r\n\r\n // handle parent body\r\n if (body.parts.length > 1) {\r\n body.area = totalArea;\r\n\r\n if (!body.isStatic) {\r\n Body.setMass(body, body.density * totalArea);\r\n Body.setInertia(body, totalInertia);\r\n }\r\n }\r\n\r\n // handle circles\r\n if (body.circleRadius) { \r\n if (scaleX === scaleY) {\r\n body.circleRadius *= scaleX;\r\n } else {\r\n // body is no longer a circle\r\n body.circleRadius = null;\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Performs a simulation step for the given `body`, including updating position and angle using Verlet integration.\r\n * @method update\r\n * @param {body} body\r\n * @param {number} deltaTime\r\n * @param {number} timeScale\r\n * @param {number} correction\r\n */\r\n Body.update = function(body, deltaTime, timeScale, correction) {\r\n var deltaTimeSquared = Math.pow(deltaTime * timeScale * body.timeScale, 2);\r\n\r\n // from the previous step\r\n var frictionAir = 1 - body.frictionAir * timeScale * body.timeScale,\r\n velocityPrevX = body.position.x - body.positionPrev.x,\r\n velocityPrevY = body.position.y - body.positionPrev.y;\r\n\r\n // update velocity with Verlet integration\r\n body.velocity.x = (velocityPrevX * frictionAir * correction) + (body.force.x / body.mass) * deltaTimeSquared;\r\n body.velocity.y = (velocityPrevY * frictionAir * correction) + (body.force.y / body.mass) * deltaTimeSquared;\r\n\r\n body.positionPrev.x = body.position.x;\r\n body.positionPrev.y = body.position.y;\r\n body.position.x += body.velocity.x;\r\n body.position.y += body.velocity.y;\r\n\r\n // update angular velocity with Verlet integration\r\n body.angularVelocity = ((body.angle - body.anglePrev) * frictionAir * correction) + (body.torque / body.inertia) * deltaTimeSquared;\r\n body.anglePrev = body.angle;\r\n body.angle += body.angularVelocity;\r\n\r\n // track speed and acceleration\r\n body.speed = Vector.magnitude(body.velocity);\r\n body.angularSpeed = Math.abs(body.angularVelocity);\r\n\r\n // transform the body geometry\r\n for (var i = 0; i < body.parts.length; i++) {\r\n var part = body.parts[i];\r\n\r\n Vertices.translate(part.vertices, body.velocity);\r\n \r\n if (i > 0) {\r\n part.position.x += body.velocity.x;\r\n part.position.y += body.velocity.y;\r\n }\r\n\r\n if (body.angularVelocity !== 0) {\r\n Vertices.rotate(part.vertices, body.angularVelocity, body.position);\r\n Axes.rotate(part.axes, body.angularVelocity);\r\n if (i > 0) {\r\n Vector.rotateAbout(part.position, body.angularVelocity, body.position, part.position);\r\n }\r\n }\r\n\r\n Bounds.update(part.bounds, part.vertices, body.velocity);\r\n }\r\n };\r\n\r\n /**\r\n * Applies a force to a body from a given world-space position, including resulting torque.\r\n * @method applyForce\r\n * @param {body} body\r\n * @param {vector} position\r\n * @param {vector} force\r\n */\r\n Body.applyForce = function(body, position, force) {\r\n body.force.x += force.x;\r\n body.force.y += force.y;\r\n var offset = { x: position.x - body.position.x, y: position.y - body.position.y };\r\n body.torque += offset.x * force.y - offset.y * force.x;\r\n };\r\n\r\n /**\r\n * Returns the sums of the properties of all compound parts of the parent body.\r\n * @method _totalProperties\r\n * @private\r\n * @param {body} body\r\n * @return {}\r\n */\r\n Body._totalProperties = function(body) {\r\n // from equations at:\r\n // https://ecourses.ou.edu/cgi-bin/ebook.cgi?doc=&topic=st&chap_sec=07.2&page=theory\r\n // http://output.to/sideway/default.asp?qno=121100087\r\n\r\n var properties = {\r\n mass: 0,\r\n area: 0,\r\n inertia: 0,\r\n centre: { x: 0, y: 0 }\r\n };\r\n\r\n // sum the properties of all compound parts of the parent body\r\n for (var i = body.parts.length === 1 ? 0 : 1; i < body.parts.length; i++) {\r\n var part = body.parts[i],\r\n mass = part.mass !== Infinity ? part.mass : 1;\r\n\r\n properties.mass += mass;\r\n properties.area += part.area;\r\n properties.inertia += part.inertia;\r\n properties.centre = Vector.add(properties.centre, Vector.mult(part.position, mass));\r\n }\r\n\r\n properties.centre = Vector.div(properties.centre, properties.mass);\r\n\r\n return properties;\r\n };\r\n\r\n /*\r\n *\r\n * Events Documentation\r\n *\r\n */\r\n\r\n /**\r\n * Fired when a body starts sleeping (where `this` is the body).\r\n *\r\n * @event sleepStart\r\n * @this {body} The body that has started sleeping\r\n * @param {} event An event object\r\n * @param {} event.source The source object of the event\r\n * @param {} event.name The name of the event\r\n */\r\n\r\n /**\r\n * Fired when a body ends sleeping (where `this` is the body).\r\n *\r\n * @event sleepEnd\r\n * @this {body} The body that has ended sleeping\r\n * @param {} event An event object\r\n * @param {} event.source The source object of the event\r\n * @param {} event.name The name of the event\r\n */\r\n\r\n /*\r\n *\r\n * Properties Documentation\r\n *\r\n */\r\n\r\n /**\r\n * An integer `Number` uniquely identifying number generated in `Body.create` by `Common.nextId`.\r\n *\r\n * @property id\r\n * @type number\r\n */\r\n\r\n /**\r\n * A `String` denoting the type of object.\r\n *\r\n * @property type\r\n * @type string\r\n * @default \"body\"\r\n * @readOnly\r\n */\r\n\r\n /**\r\n * An arbitrary `String` name to help the user identify and manage bodies.\r\n *\r\n * @property label\r\n * @type string\r\n * @default \"Body\"\r\n */\r\n\r\n /**\r\n * An array of bodies that make up this body. \r\n * The first body in the array must always be a self reference to the current body instance.\r\n * All bodies in the `parts` array together form a single rigid compound body.\r\n * Parts are allowed to overlap, have gaps or holes or even form concave bodies.\r\n * Parts themselves should never be added to a `World`, only the parent body should be.\r\n * Use `Body.setParts` when setting parts to ensure correct updates of all properties.\r\n *\r\n * @property parts\r\n * @type body[]\r\n */\r\n\r\n /**\r\n * An object reserved for storing plugin-specific properties.\r\n *\r\n * @property plugin\r\n * @type {}\r\n */\r\n\r\n /**\r\n * A self reference if the body is _not_ a part of another body.\r\n * Otherwise this is a reference to the body that this is a part of.\r\n * See `body.parts`.\r\n *\r\n * @property parent\r\n * @type body\r\n */\r\n\r\n /**\r\n * A `Number` specifying the angle of the body, in radians.\r\n *\r\n * @property angle\r\n * @type number\r\n * @default 0\r\n */\r\n\r\n /**\r\n * An array of `Vector` objects that specify the convex hull of the rigid body.\r\n * These should be provided about the origin `(0, 0)`. E.g.\r\n *\r\n * [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }]\r\n *\r\n * When passed via `Body.create`, the vertices are translated relative to `body.position` (i.e. world-space, and constantly updated by `Body.update` during simulation).\r\n * The `Vector` objects are also augmented with additional properties required for efficient collision detection. \r\n *\r\n * Other properties such as `inertia` and `bounds` are automatically calculated from the passed vertices (unless provided via `options`).\r\n * Concave hulls are not currently supported. The module `Matter.Vertices` contains useful methods for working with vertices.\r\n *\r\n * @property vertices\r\n * @type vector[]\r\n */\r\n\r\n /**\r\n * A `Vector` that specifies the current world-space position of the body.\r\n *\r\n * @property position\r\n * @type vector\r\n * @default { x: 0, y: 0 }\r\n */\r\n\r\n /**\r\n * A `Vector` that holds the current scale values as set by `Body.setScale`.\r\n *\r\n * @property scale\r\n * @type vector\r\n * @default { x: 1, y: 1 }\r\n */\r\n\r\n /**\r\n * A `Vector` that specifies the force to apply in the current step. It is zeroed after every `Body.update`. See also `Body.applyForce`.\r\n *\r\n * @property force\r\n * @type vector\r\n * @default { x: 0, y: 0 }\r\n */\r\n\r\n /**\r\n * A `Number` that specifies the torque (turning force) to apply in the current step. It is zeroed after every `Body.update`.\r\n *\r\n * @property torque\r\n * @type number\r\n * @default 0\r\n */\r\n\r\n /**\r\n * A `Number` that _measures_ the current speed of the body after the last `Body.update`. It is read-only and always positive (it's the magnitude of `body.velocity`).\r\n *\r\n * @readOnly\r\n * @property speed\r\n * @type number\r\n * @default 0\r\n */\r\n\r\n /**\r\n * A `Number` that _measures_ the current angular speed of the body after the last `Body.update`. It is read-only and always positive (it's the magnitude of `body.angularVelocity`).\r\n *\r\n * @readOnly\r\n * @property angularSpeed\r\n * @type number\r\n * @default 0\r\n */\r\n\r\n /**\r\n * A `Vector` that _measures_ the current velocity of the body after the last `Body.update`. It is read-only. \r\n * If you need to modify a body's velocity directly, you should either apply a force or simply change the body's `position` (as the engine uses position-Verlet integration).\r\n *\r\n * @readOnly\r\n * @property velocity\r\n * @type vector\r\n * @default { x: 0, y: 0 }\r\n */\r\n\r\n /**\r\n * A `Number` that _measures_ the current angular velocity of the body after the last `Body.update`. It is read-only. \r\n * If you need to modify a body's angular velocity directly, you should apply a torque or simply change the body's `angle` (as the engine uses position-Verlet integration).\r\n *\r\n * @readOnly\r\n * @property angularVelocity\r\n * @type number\r\n * @default 0\r\n */\r\n\r\n /**\r\n * A flag that indicates whether a body is considered static. A static body can never change position or angle and is completely fixed.\r\n * If you need to set a body as static after its creation, you should use `Body.setStatic` as this requires more than just setting this flag.\r\n *\r\n * @property isStatic\r\n * @type boolean\r\n * @default false\r\n */\r\n\r\n /**\r\n * A flag that indicates whether a body is a sensor. Sensor triggers collision events, but doesn't react with colliding body physically.\r\n *\r\n * @property isSensor\r\n * @type boolean\r\n * @default false\r\n */\r\n\r\n /**\r\n * A flag that indicates whether the body is considered sleeping. A sleeping body acts similar to a static body, except it is only temporary and can be awoken.\r\n * If you need to set a body as sleeping, you should use `Sleeping.set` as this requires more than just setting this flag.\r\n *\r\n * @property isSleeping\r\n * @type boolean\r\n * @default false\r\n */\r\n\r\n /**\r\n * A `Number` that _measures_ the amount of movement a body currently has (a combination of `speed` and `angularSpeed`). It is read-only and always positive.\r\n * It is used and updated by the `Matter.Sleeping` module during simulation to decide if a body has come to rest.\r\n *\r\n * @readOnly\r\n * @property motion\r\n * @type number\r\n * @default 0\r\n */\r\n\r\n /**\r\n * A `Number` that defines the number of updates in which this body must have near-zero velocity before it is set as sleeping by the `Matter.Sleeping` module (if sleeping is enabled by the engine).\r\n *\r\n * @property sleepThreshold\r\n * @type number\r\n * @default 60\r\n */\r\n\r\n /**\r\n * A `Number` that defines the density of the body, that is its mass per unit area.\r\n * If you pass the density via `Body.create` the `mass` property is automatically calculated for you based on the size (area) of the object.\r\n * This is generally preferable to simply setting mass and allows for more intuitive definition of materials (e.g. rock has a higher density than wood).\r\n *\r\n * @property density\r\n * @type number\r\n * @default 0.001\r\n */\r\n\r\n /**\r\n * A `Number` that defines the mass of the body, although it may be more appropriate to specify the `density` property instead.\r\n * If you modify this value, you must also modify the `body.inverseMass` property (`1 / mass`).\r\n *\r\n * @property mass\r\n * @type number\r\n */\r\n\r\n /**\r\n * A `Number` that defines the inverse mass of the body (`1 / mass`).\r\n * If you modify this value, you must also modify the `body.mass` property.\r\n *\r\n * @property inverseMass\r\n * @type number\r\n */\r\n\r\n /**\r\n * A `Number` that defines the moment of inertia (i.e. second moment of area) of the body.\r\n * It is automatically calculated from the given convex hull (`vertices` array) and density in `Body.create`.\r\n * If you modify this value, you must also modify the `body.inverseInertia` property (`1 / inertia`).\r\n *\r\n * @property inertia\r\n * @type number\r\n */\r\n\r\n /**\r\n * A `Number` that defines the inverse moment of inertia of the body (`1 / inertia`).\r\n * If you modify this value, you must also modify the `body.inertia` property.\r\n *\r\n * @property inverseInertia\r\n * @type number\r\n */\r\n\r\n /**\r\n * A `Number` that defines the restitution (elasticity) of the body. The value is always positive and is in the range `(0, 1)`.\r\n * A value of `0` means collisions may be perfectly inelastic and no bouncing may occur. \r\n * A value of `0.8` means the body may bounce back with approximately 80% of its kinetic energy.\r\n * Note that collision response is based on _pairs_ of bodies, and that `restitution` values are _combined_ with the following formula:\r\n *\r\n * Math.max(bodyA.restitution, bodyB.restitution)\r\n *\r\n * @property restitution\r\n * @type number\r\n * @default 0\r\n */\r\n\r\n /**\r\n * A `Number` that defines the friction of the body. The value is always positive and is in the range `(0, 1)`.\r\n * A value of `0` means that the body may slide indefinitely.\r\n * A value of `1` means the body may come to a stop almost instantly after a force is applied.\r\n *\r\n * The effects of the value may be non-linear. \r\n * High values may be unstable depending on the body.\r\n * The engine uses a Coulomb friction model including static and kinetic friction.\r\n * Note that collision response is based on _pairs_ of bodies, and that `friction` values are _combined_ with the following formula:\r\n *\r\n * Math.min(bodyA.friction, bodyB.friction)\r\n *\r\n * @property friction\r\n * @type number\r\n * @default 0.1\r\n */\r\n\r\n /**\r\n * A `Number` that defines the static friction of the body (in the Coulomb friction model). \r\n * A value of `0` means the body will never 'stick' when it is nearly stationary and only dynamic `friction` is used.\r\n * The higher the value (e.g. `10`), the more force it will take to initially get the body moving when nearly stationary.\r\n * This value is multiplied with the `friction` property to make it easier to change `friction` and maintain an appropriate amount of static friction.\r\n *\r\n * @property frictionStatic\r\n * @type number\r\n * @default 0.5\r\n */\r\n\r\n /**\r\n * A `Number` that defines the air friction of the body (air resistance). \r\n * A value of `0` means the body will never slow as it moves through space.\r\n * The higher the value, the faster a body slows when moving through space.\r\n * The effects of the value are non-linear. \r\n *\r\n * @property frictionAir\r\n * @type number\r\n * @default 0.01\r\n */\r\n\r\n /**\r\n * An `Object` that specifies the collision filtering properties of this body.\r\n *\r\n * Collisions between two bodies will obey the following rules:\r\n * - If the two bodies have the same non-zero value of `collisionFilter.group`,\r\n * they will always collide if the value is positive, and they will never collide\r\n * if the value is negative.\r\n * - If the two bodies have different values of `collisionFilter.group` or if one\r\n * (or both) of the bodies has a value of 0, then the category/mask rules apply as follows:\r\n *\r\n * Each body belongs to a collision category, given by `collisionFilter.category`. This\r\n * value is used as a bit field and the category should have only one bit set, meaning that\r\n * the value of this property is a power of two in the range [1, 2^31]. Thus, there are 32\r\n * different collision categories available.\r\n *\r\n * Each body also defines a collision bitmask, given by `collisionFilter.mask` which specifies\r\n * the categories it collides with (the value is the bitwise AND value of all these categories).\r\n *\r\n * Using the category/mask rules, two bodies `A` and `B` collide if each includes the other's\r\n * category in its mask, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0`\r\n * are both true.\r\n *\r\n * @property collisionFilter\r\n * @type object\r\n */\r\n\r\n /**\r\n * An Integer `Number`, that specifies the collision group this body belongs to.\r\n * See `body.collisionFilter` for more information.\r\n *\r\n * @property collisionFilter.group\r\n * @type object\r\n * @default 0\r\n */\r\n\r\n /**\r\n * A bit field that specifies the collision category this body belongs to.\r\n * The category value should have only one bit set, for example `0x0001`.\r\n * This means there are up to 32 unique collision categories available.\r\n * See `body.collisionFilter` for more information.\r\n *\r\n * @property collisionFilter.category\r\n * @type object\r\n * @default 1\r\n */\r\n\r\n /**\r\n * A bit mask that specifies the collision categories this body may collide with.\r\n * See `body.collisionFilter` for more information.\r\n *\r\n * @property collisionFilter.mask\r\n * @type object\r\n * @default -1\r\n */\r\n\r\n /**\r\n * A `Number` that specifies a tolerance on how far a body is allowed to 'sink' or rotate into other bodies.\r\n * Avoid changing this value unless you understand the purpose of `slop` in physics engines.\r\n * The default should generally suffice, although very large bodies may require larger values for stable stacking.\r\n *\r\n * @property slop\r\n * @type number\r\n * @default 0.05\r\n */\r\n\r\n /**\r\n * 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.\r\n *\r\n * @property timeScale\r\n * @type number\r\n * @default 1\r\n */\r\n\r\n /**\r\n * An `Object` that defines the rendering properties to be consumed by the module `Matter.Render`.\r\n *\r\n * @property render\r\n * @type object\r\n */\r\n\r\n /**\r\n * A flag that indicates if the body should be rendered.\r\n *\r\n * @property render.visible\r\n * @type boolean\r\n * @default true\r\n */\r\n\r\n /**\r\n * Sets the opacity to use when rendering.\r\n *\r\n * @property render.opacity\r\n * @type number\r\n * @default 1\r\n */\r\n\r\n /**\r\n * An `Object` that defines the sprite properties to use when rendering, if any.\r\n *\r\n * @property render.sprite\r\n * @type object\r\n */\r\n\r\n /**\r\n * A `Number` that defines the offset in the x-axis for the sprite (normalised by texture width).\r\n *\r\n * @property render.sprite.xOffset\r\n * @type number\r\n * @default 0\r\n */\r\n\r\n /**\r\n * A `Number` that defines the offset in the y-axis for the sprite (normalised by texture height).\r\n *\r\n * @property render.sprite.yOffset\r\n * @type number\r\n * @default 0\r\n */\r\n\r\n /**\r\n * A hex color value that defines the fill color to use when rendering the body.\r\n *\r\n * @property render.fillColor\r\n * @type number\r\n */\r\n\r\n /**\r\n * A value that defines the fill opacity to use when rendering the body.\r\n *\r\n * @property render.fillOpacity\r\n * @type number\r\n */\r\n\r\n /**\r\n * A hex color value that defines the line color to use when rendering the body.\r\n *\r\n * @property render.lineColor\r\n * @type number\r\n */\r\n\r\n /**\r\n * A value that defines the line opacity to use when rendering the body.\r\n *\r\n * @property render.lineOpacity\r\n * @type number\r\n */\r\n\r\n /**\r\n * A `Number` that defines the line width to use when rendering the body outline.\r\n *\r\n * @property render.lineThickness\r\n * @type number\r\n */\r\n\r\n /**\r\n * An array of unique axis vectors (edge normals) used for collision detection.\r\n * These are automatically calculated from the given convex hull (`vertices` array) in `Body.create`.\r\n * They are constantly updated by `Body.update` during the simulation.\r\n *\r\n * @property axes\r\n * @type vector[]\r\n */\r\n \r\n /**\r\n * A `Number` that _measures_ the area of the body's convex hull, calculated at creation by `Body.create`.\r\n *\r\n * @property area\r\n * @type string\r\n * @default \r\n */\r\n\r\n /**\r\n * A `Bounds` object that defines the AABB region for the body.\r\n * It is automatically calculated from the given convex hull (`vertices` array) in `Body.create` and constantly updated by `Body.update` during simulation.\r\n *\r\n * @property bounds\r\n * @type bounds\r\n */\r\n\r\n /**\r\n * A reference to the Phaser Game Object this body belongs to, if any.\r\n *\r\n * @property gameObject\r\n * @type Phaser.GameObjects.GameObject\r\n */\r\n\r\n /**\r\n * The center of mass of the Body.\r\n *\r\n * @property centerOfMass\r\n * @type vector\r\n * @default { x: 0, y: 0 }\r\n */\r\n\r\n /**\r\n * The center of the body in pixel values.\r\n * Used by Phaser for texture aligment.\r\n *\r\n * @property centerOffset\r\n * @type vector\r\n * @default { x: 0, y: 0 }\r\n */\r\n\r\n /**\r\n * Will this Body ignore World gravity during the Engine update?\r\n *\r\n * @property ignoreGravity\r\n * @type boolean\r\n * @default false\r\n */\r\n\r\n /**\r\n * Scale the influence of World gravity when applied to this body.\r\n *\r\n * @property gravityScale\r\n * @type vector\r\n * @default { x: 1, y: 1 }\r\n */\r\n\r\n /**\r\n * Will this Body ignore Phaser Pointer input events?\r\n *\r\n * @property ignorePointer\r\n * @type boolean\r\n * @default false\r\n */\r\n\r\n /**\r\n * A callback that is invoked when this Body starts colliding with any other Body.\r\n * \r\n * You can register callbacks by providing a function of type `( pair: Matter.Pair) => void`.\r\n *\r\n * @property onCollideCallback\r\n * @type function\r\n * @default null\r\n */\r\n\r\n /**\r\n * A callback that is invoked when this Body stops colliding with any other Body.\r\n * \r\n * You can register callbacks by providing a function of type `( pair: Matter.Pair) => void`.\r\n *\r\n * @property onCollideEndCallback\r\n * @type function\r\n * @default null\r\n */\r\n\r\n /**\r\n * A callback that is invoked for the duration that this Body is colliding with any other Body.\r\n * \r\n * You can register callbacks by providing a function of type `( pair: Matter.Pair) => void`.\r\n *\r\n * @property onCollideActiveCallback\r\n * @type function\r\n * @default null\r\n */\r\n\r\n /**\r\n * A collision callback dictionary used by the `Body.setOnCollideWith` function.\r\n *\r\n * @property onCollideWith\r\n * @type object\r\n * @default null\r\n */\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/body/Body.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/body/Composite.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/body/Composite.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Composite` module contains methods for creating and manipulating composite bodies.\r\n* A composite body is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`, therefore composites form a tree structure.\r\n* It is important to use the functions in this module to modify composites, rather than directly modifying their properties.\r\n* Note that the `Matter.World` object is also a type of `Matter.Composite` and as such all composite methods here can also operate on a `Matter.World`.\r\n*\r\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\r\n*\r\n* @class Composite\r\n*/\r\n\r\nvar Composite = {};\r\n\r\nmodule.exports = Composite;\r\n\r\nvar Events = __webpack_require__(/*! ../core/Events */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Events.js\");\r\nvar Common = __webpack_require__(/*! ../core/Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\nvar Bounds = __webpack_require__(/*! ../geometry/Bounds */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Bounds.js\");\r\nvar Body = __webpack_require__(/*! ./Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\n\r\n(function() {\r\n\r\n /**\r\n * Creates a new composite. The options parameter is an object that specifies any properties you wish to override the defaults.\r\n * See the properites section below for detailed information on what you can pass via the `options` object.\r\n * @method create\r\n * @param {} [options]\r\n * @return {composite} A new composite\r\n */\r\n Composite.create = function(options) {\r\n return Common.extend({ \r\n id: Common.nextId(),\r\n type: 'composite',\r\n parent: null,\r\n isModified: false,\r\n bodies: [], \r\n constraints: [], \r\n composites: [],\r\n label: 'Composite',\r\n plugin: {}\r\n }, options);\r\n };\r\n\r\n /**\r\n * Sets the composite's `isModified` flag. \r\n * If `updateParents` is true, all parents will be set (default: false).\r\n * If `updateChildren` is true, all children will be set (default: false).\r\n * @method setModified\r\n * @param {composite} composite\r\n * @param {boolean} isModified\r\n * @param {boolean} [updateParents=false]\r\n * @param {boolean} [updateChildren=false]\r\n */\r\n Composite.setModified = function(composite, isModified, updateParents, updateChildren) {\r\n\r\n Events.trigger(composite, 'compositeModified', composite);\r\n\r\n composite.isModified = isModified;\r\n\r\n if (updateParents && composite.parent) {\r\n Composite.setModified(composite.parent, isModified, updateParents, updateChildren);\r\n }\r\n\r\n if (updateChildren) {\r\n for(var i = 0; i < composite.composites.length; i++) {\r\n var childComposite = composite.composites[i];\r\n Composite.setModified(childComposite, isModified, updateParents, updateChildren);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Generic add function. Adds one or many body(s), constraint(s) or a composite(s) to the given composite.\r\n * Triggers `beforeAdd` and `afterAdd` events on the `composite`.\r\n * @method add\r\n * @param {composite} composite\r\n * @param {} object\r\n * @return {composite} The original composite with the objects added\r\n */\r\n Composite.add = function(composite, object) {\r\n var objects = [].concat(object);\r\n\r\n Events.trigger(composite, 'beforeAdd', { object: object });\r\n\r\n for (var i = 0; i < objects.length; i++) {\r\n var obj = objects[i];\r\n\r\n switch (obj.type) {\r\n\r\n case 'body':\r\n // skip adding compound parts\r\n if (obj.parent !== obj) {\r\n Common.warn('Composite.add: skipped adding a compound body part (you must add its parent instead)');\r\n break;\r\n }\r\n\r\n Composite.addBody(composite, obj);\r\n break;\r\n case 'constraint':\r\n Composite.addConstraint(composite, obj);\r\n break;\r\n case 'composite':\r\n Composite.addComposite(composite, obj);\r\n break;\r\n case 'mouseConstraint':\r\n Composite.addConstraint(composite, obj.constraint);\r\n break;\r\n\r\n }\r\n }\r\n\r\n Events.trigger(composite, 'afterAdd', { object: object });\r\n\r\n return composite;\r\n };\r\n\r\n /**\r\n * Generic remove function. Removes one or many body(s), constraint(s) or a composite(s) to the given composite.\r\n * Optionally searching its children recursively.\r\n * Triggers `beforeRemove` and `afterRemove` events on the `composite`.\r\n * @method remove\r\n * @param {composite} composite\r\n * @param {} object\r\n * @param {boolean} [deep=false]\r\n * @return {composite} The original composite with the objects removed\r\n */\r\n Composite.remove = function(composite, object, deep) {\r\n var objects = [].concat(object);\r\n\r\n Events.trigger(composite, 'beforeRemove', { object: object });\r\n\r\n for (var i = 0; i < objects.length; i++) {\r\n var obj = objects[i];\r\n\r\n switch (obj.type) {\r\n\r\n case 'body':\r\n Composite.removeBody(composite, obj, deep);\r\n break;\r\n case 'constraint':\r\n Composite.removeConstraint(composite, obj, deep);\r\n break;\r\n case 'composite':\r\n Composite.removeComposite(composite, obj, deep);\r\n break;\r\n case 'mouseConstraint':\r\n Composite.removeConstraint(composite, obj.constraint);\r\n break;\r\n\r\n }\r\n }\r\n\r\n Events.trigger(composite, 'afterRemove', { object: object });\r\n\r\n return composite;\r\n };\r\n\r\n /**\r\n * Adds a composite to the given composite.\r\n * @private\r\n * @method addComposite\r\n * @param {composite} compositeA\r\n * @param {composite} compositeB\r\n * @return {composite} The original compositeA with the objects from compositeB added\r\n */\r\n Composite.addComposite = function(compositeA, compositeB) {\r\n compositeA.composites.push(compositeB);\r\n compositeB.parent = compositeA;\r\n Composite.setModified(compositeA, true, true, false);\r\n return compositeA;\r\n };\r\n\r\n /**\r\n * Removes a composite from the given composite, and optionally searching its children recursively.\r\n * @private\r\n * @method removeComposite\r\n * @param {composite} compositeA\r\n * @param {composite} compositeB\r\n * @param {boolean} [deep=false]\r\n * @return {composite} The original compositeA with the composite removed\r\n */\r\n Composite.removeComposite = function(compositeA, compositeB, deep) {\r\n var position = compositeA.composites.indexOf(compositeB);\r\n if (position !== -1) {\r\n Composite.removeCompositeAt(compositeA, position);\r\n Composite.setModified(compositeA, true, true, false);\r\n }\r\n\r\n if (deep) {\r\n for (var i = 0; i < compositeA.composites.length; i++){\r\n Composite.removeComposite(compositeA.composites[i], compositeB, true);\r\n }\r\n }\r\n\r\n return compositeA;\r\n };\r\n\r\n /**\r\n * Removes a composite from the given composite.\r\n * @private\r\n * @method removeCompositeAt\r\n * @param {composite} composite\r\n * @param {number} position\r\n * @return {composite} The original composite with the composite removed\r\n */\r\n Composite.removeCompositeAt = function(composite, position) {\r\n composite.composites.splice(position, 1);\r\n Composite.setModified(composite, true, true, false);\r\n return composite;\r\n };\r\n\r\n /**\r\n * Adds a body to the given composite.\r\n * @private\r\n * @method addBody\r\n * @param {composite} composite\r\n * @param {body} body\r\n * @return {composite} The original composite with the body added\r\n */\r\n Composite.addBody = function(composite, body) {\r\n composite.bodies.push(body);\r\n Composite.setModified(composite, true, true, false);\r\n return composite;\r\n };\r\n\r\n /**\r\n * Removes a body from the given composite, and optionally searching its children recursively.\r\n * @private\r\n * @method removeBody\r\n * @param {composite} composite\r\n * @param {body} body\r\n * @param {boolean} [deep=false]\r\n * @return {composite} The original composite with the body removed\r\n */\r\n Composite.removeBody = function(composite, body, deep) {\r\n var position = composite.bodies.indexOf(body);\r\n if (position !== -1) {\r\n Composite.removeBodyAt(composite, position);\r\n Composite.setModified(composite, true, true, false);\r\n }\r\n\r\n if (deep) {\r\n for (var i = 0; i < composite.composites.length; i++){\r\n Composite.removeBody(composite.composites[i], body, true);\r\n }\r\n }\r\n\r\n return composite;\r\n };\r\n\r\n /**\r\n * Removes a body from the given composite.\r\n * @private\r\n * @method removeBodyAt\r\n * @param {composite} composite\r\n * @param {number} position\r\n * @return {composite} The original composite with the body removed\r\n */\r\n Composite.removeBodyAt = function(composite, position) {\r\n composite.bodies.splice(position, 1);\r\n Composite.setModified(composite, true, true, false);\r\n return composite;\r\n };\r\n\r\n /**\r\n * Adds a constraint to the given composite.\r\n * @private\r\n * @method addConstraint\r\n * @param {composite} composite\r\n * @param {constraint} constraint\r\n * @return {composite} The original composite with the constraint added\r\n */\r\n Composite.addConstraint = function(composite, constraint) {\r\n composite.constraints.push(constraint);\r\n Composite.setModified(composite, true, true, false);\r\n return composite;\r\n };\r\n\r\n /**\r\n * Removes a constraint from the given composite, and optionally searching its children recursively.\r\n * @private\r\n * @method removeConstraint\r\n * @param {composite} composite\r\n * @param {constraint} constraint\r\n * @param {boolean} [deep=false]\r\n * @return {composite} The original composite with the constraint removed\r\n */\r\n Composite.removeConstraint = function(composite, constraint, deep) {\r\n var position = composite.constraints.indexOf(constraint);\r\n if (position !== -1) {\r\n Composite.removeConstraintAt(composite, position);\r\n }\r\n\r\n if (deep) {\r\n for (var i = 0; i < composite.composites.length; i++){\r\n Composite.removeConstraint(composite.composites[i], constraint, true);\r\n }\r\n }\r\n\r\n return composite;\r\n };\r\n\r\n /**\r\n * Removes a body from the given composite.\r\n * @private\r\n * @method removeConstraintAt\r\n * @param {composite} composite\r\n * @param {number} position\r\n * @return {composite} The original composite with the constraint removed\r\n */\r\n Composite.removeConstraintAt = function(composite, position) {\r\n composite.constraints.splice(position, 1);\r\n Composite.setModified(composite, true, true, false);\r\n return composite;\r\n };\r\n\r\n /**\r\n * Removes all bodies, constraints and composites from the given composite.\r\n * Optionally clearing its children recursively.\r\n * @method clear\r\n * @param {composite} composite\r\n * @param {boolean} keepStatic\r\n * @param {boolean} [deep=false]\r\n */\r\n Composite.clear = function(composite, keepStatic, deep) {\r\n if (deep) {\r\n for (var i = 0; i < composite.composites.length; i++){\r\n Composite.clear(composite.composites[i], keepStatic, true);\r\n }\r\n }\r\n \r\n if (keepStatic) {\r\n composite.bodies = composite.bodies.filter(function(body) { return body.isStatic; });\r\n } else {\r\n composite.bodies.length = 0;\r\n }\r\n\r\n composite.constraints.length = 0;\r\n composite.composites.length = 0;\r\n Composite.setModified(composite, true, true, false);\r\n\r\n return composite;\r\n };\r\n\r\n /**\r\n * Returns all bodies in the given composite, including all bodies in its children, recursively.\r\n * @method allBodies\r\n * @param {composite} composite\r\n * @return {body[]} All the bodies\r\n */\r\n Composite.allBodies = function(composite) {\r\n var bodies = [].concat(composite.bodies);\r\n\r\n for (var i = 0; i < composite.composites.length; i++)\r\n bodies = bodies.concat(Composite.allBodies(composite.composites[i]));\r\n\r\n return bodies;\r\n };\r\n\r\n /**\r\n * Returns all constraints in the given composite, including all constraints in its children, recursively.\r\n * @method allConstraints\r\n * @param {composite} composite\r\n * @return {constraint[]} All the constraints\r\n */\r\n Composite.allConstraints = function(composite) {\r\n var constraints = [].concat(composite.constraints);\r\n\r\n for (var i = 0; i < composite.composites.length; i++)\r\n constraints = constraints.concat(Composite.allConstraints(composite.composites[i]));\r\n\r\n return constraints;\r\n };\r\n\r\n /**\r\n * Returns all composites in the given composite, including all composites in its children, recursively.\r\n * @method allComposites\r\n * @param {composite} composite\r\n * @return {composite[]} All the composites\r\n */\r\n Composite.allComposites = function(composite) {\r\n var composites = [].concat(composite.composites);\r\n\r\n for (var i = 0; i < composite.composites.length; i++)\r\n composites = composites.concat(Composite.allComposites(composite.composites[i]));\r\n\r\n return composites;\r\n };\r\n\r\n /**\r\n * Searches the composite recursively for an object matching the type and id supplied, null if not found.\r\n * @method get\r\n * @param {composite} composite\r\n * @param {number} id\r\n * @param {string} type\r\n * @return {object} The requested object, if found\r\n */\r\n Composite.get = function(composite, id, type) {\r\n var objects,\r\n object;\r\n\r\n switch (type) {\r\n case 'body':\r\n objects = Composite.allBodies(composite);\r\n break;\r\n case 'constraint':\r\n objects = Composite.allConstraints(composite);\r\n break;\r\n case 'composite':\r\n objects = Composite.allComposites(composite).concat(composite);\r\n break;\r\n }\r\n\r\n if (!objects)\r\n return null;\r\n\r\n object = objects.filter(function(object) { \r\n return object.id.toString() === id.toString(); \r\n });\r\n\r\n return object.length === 0 ? null : object[0];\r\n };\r\n\r\n /**\r\n * Moves the given object(s) from compositeA to compositeB (equal to a remove followed by an add).\r\n * @method move\r\n * @param {compositeA} compositeA\r\n * @param {object[]} objects\r\n * @param {compositeB} compositeB\r\n * @return {composite} Returns compositeA\r\n */\r\n Composite.move = function(compositeA, objects, compositeB) {\r\n Composite.remove(compositeA, objects);\r\n Composite.add(compositeB, objects);\r\n return compositeA;\r\n };\r\n\r\n /**\r\n * Assigns new ids for all objects in the composite, recursively.\r\n * @method rebase\r\n * @param {composite} composite\r\n * @return {composite} Returns composite\r\n */\r\n Composite.rebase = function(composite) {\r\n var objects = Composite.allBodies(composite)\r\n .concat(Composite.allConstraints(composite))\r\n .concat(Composite.allComposites(composite));\r\n\r\n for (var i = 0; i < objects.length; i++) {\r\n objects[i].id = Common.nextId();\r\n }\r\n\r\n Composite.setModified(composite, true, true, false);\r\n\r\n return composite;\r\n };\r\n\r\n /**\r\n * Translates all children in the composite by a given vector relative to their current positions, \r\n * without imparting any velocity.\r\n * @method translate\r\n * @param {composite} composite\r\n * @param {vector} translation\r\n * @param {bool} [recursive=true]\r\n */\r\n Composite.translate = function(composite, translation, recursive) {\r\n var bodies = recursive ? Composite.allBodies(composite) : composite.bodies;\r\n\r\n for (var i = 0; i < bodies.length; i++) {\r\n Body.translate(bodies[i], translation);\r\n }\r\n\r\n Composite.setModified(composite, true, true, false);\r\n\r\n return composite;\r\n };\r\n\r\n /**\r\n * Rotates all children in the composite by a given angle about the given point, without imparting any angular velocity.\r\n * @method rotate\r\n * @param {composite} composite\r\n * @param {number} rotation\r\n * @param {vector} point\r\n * @param {bool} [recursive=true]\r\n */\r\n Composite.rotate = function(composite, rotation, point, recursive) {\r\n var cos = Math.cos(rotation),\r\n sin = Math.sin(rotation),\r\n bodies = recursive ? Composite.allBodies(composite) : composite.bodies;\r\n\r\n for (var i = 0; i < bodies.length; i++) {\r\n var body = bodies[i],\r\n dx = body.position.x - point.x,\r\n dy = body.position.y - point.y;\r\n \r\n Body.setPosition(body, {\r\n x: point.x + (dx * cos - dy * sin),\r\n y: point.y + (dx * sin + dy * cos)\r\n });\r\n\r\n Body.rotate(body, rotation);\r\n }\r\n\r\n Composite.setModified(composite, true, true, false);\r\n\r\n return composite;\r\n };\r\n\r\n /**\r\n * Scales all children in the composite, including updating physical properties (mass, area, axes, inertia), from a world-space point.\r\n * @method scale\r\n * @param {composite} composite\r\n * @param {number} scaleX\r\n * @param {number} scaleY\r\n * @param {vector} point\r\n * @param {bool} [recursive=true]\r\n */\r\n Composite.scale = function(composite, scaleX, scaleY, point, recursive) {\r\n var bodies = recursive ? Composite.allBodies(composite) : composite.bodies;\r\n\r\n for (var i = 0; i < bodies.length; i++) {\r\n var body = bodies[i],\r\n dx = body.position.x - point.x,\r\n dy = body.position.y - point.y;\r\n \r\n Body.setPosition(body, {\r\n x: point.x + dx * scaleX,\r\n y: point.y + dy * scaleY\r\n });\r\n\r\n Body.scale(body, scaleX, scaleY);\r\n }\r\n\r\n Composite.setModified(composite, true, true, false);\r\n\r\n return composite;\r\n };\r\n\r\n /**\r\n * Returns the union of the bounds of all of the composite's bodies.\r\n * @method bounds\r\n * @param {composite} composite The composite.\r\n * @returns {bounds} The composite bounds.\r\n */\r\n Composite.bounds = function(composite) {\r\n var bodies = Composite.allBodies(composite),\r\n vertices = [];\r\n\r\n for (var i = 0; i < bodies.length; i += 1) {\r\n var body = bodies[i];\r\n vertices.push(body.bounds.min, body.bounds.max);\r\n }\r\n\r\n return Bounds.create(vertices);\r\n };\r\n\r\n /*\r\n *\r\n * Events Documentation\r\n *\r\n */\r\n\r\n /**\r\n * Fired when a call to `Composite.add` is made, before objects have been added.\r\n *\r\n * @event beforeAdd\r\n * @param {} event An event object\r\n * @param {} event.object The object(s) to be added (may be a single body, constraint, composite or a mixed array of these)\r\n * @param {} event.source The source object of the event\r\n * @param {} event.name The name of the event\r\n */\r\n\r\n /**\r\n * Fired when a call to `Composite.add` is made, after objects have been added.\r\n *\r\n * @event afterAdd\r\n * @param {} event An event object\r\n * @param {} event.object The object(s) that have been added (may be a single body, constraint, composite or a mixed array of these)\r\n * @param {} event.source The source object of the event\r\n * @param {} event.name The name of the event\r\n */\r\n\r\n /**\r\n * Fired when a call to `Composite.remove` is made, before objects have been removed.\r\n *\r\n * @event beforeRemove\r\n * @param {} event An event object\r\n * @param {} event.object The object(s) to be removed (may be a single body, constraint, composite or a mixed array of these)\r\n * @param {} event.source The source object of the event\r\n * @param {} event.name The name of the event\r\n */\r\n\r\n /**\r\n * Fired when a call to `Composite.remove` is made, after objects have been removed.\r\n *\r\n * @event afterRemove\r\n * @param {} event An event object\r\n * @param {} event.object The object(s) that have been removed (may be a single body, constraint, composite or a mixed array of these)\r\n * @param {} event.source The source object of the event\r\n * @param {} event.name The name of the event\r\n */\r\n\r\n /*\r\n *\r\n * Properties Documentation\r\n *\r\n */\r\n\r\n /**\r\n * An integer `Number` uniquely identifying number generated in `Composite.create` by `Common.nextId`.\r\n *\r\n * @property id\r\n * @type number\r\n */\r\n\r\n /**\r\n * A `String` denoting the type of object.\r\n *\r\n * @property type\r\n * @type string\r\n * @default \"composite\"\r\n * @readOnly\r\n */\r\n\r\n /**\r\n * An arbitrary `String` name to help the user identify and manage composites.\r\n *\r\n * @property label\r\n * @type string\r\n * @default \"Composite\"\r\n */\r\n\r\n /**\r\n * A flag that specifies whether the composite has been modified during the current step.\r\n * Most `Matter.Composite` methods will automatically set this flag to `true` to inform the engine of changes to be handled.\r\n * If you need to change it manually, you should use the `Composite.setModified` method.\r\n *\r\n * @property isModified\r\n * @type boolean\r\n * @default false\r\n */\r\n\r\n /**\r\n * The `Composite` that is the parent of this composite. It is automatically managed by the `Matter.Composite` methods.\r\n *\r\n * @property parent\r\n * @type composite\r\n * @default null\r\n */\r\n\r\n /**\r\n * An array of `Body` that are _direct_ children of this composite.\r\n * To add or remove bodies you should use `Composite.add` and `Composite.remove` methods rather than directly modifying this property.\r\n * If you wish to recursively find all descendants, you should use the `Composite.allBodies` method.\r\n *\r\n * @property bodies\r\n * @type body[]\r\n * @default []\r\n */\r\n\r\n /**\r\n * An array of `Constraint` that are _direct_ children of this composite.\r\n * To add or remove constraints you should use `Composite.add` and `Composite.remove` methods rather than directly modifying this property.\r\n * If you wish to recursively find all descendants, you should use the `Composite.allConstraints` method.\r\n *\r\n * @property constraints\r\n * @type constraint[]\r\n * @default []\r\n */\r\n\r\n /**\r\n * An array of `Composite` that are _direct_ children of this composite.\r\n * To add or remove composites you should use `Composite.add` and `Composite.remove` methods rather than directly modifying this property.\r\n * If you wish to recursively find all descendants, you should use the `Composite.allComposites` method.\r\n *\r\n * @property composites\r\n * @type composite[]\r\n * @default []\r\n */\r\n\r\n /**\r\n * An object reserved for storing plugin-specific properties.\r\n *\r\n * @property plugin\r\n * @type {}\r\n */\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/body/Composite.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/body/World.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/body/World.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.World` module contains methods for creating and manipulating the world composite.\r\n* A `Matter.World` is a `Matter.Composite` body, which is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`.\r\n* A `Matter.World` has a few additional properties including `gravity` and `bounds`.\r\n* It is important to use the functions in the `Matter.Composite` module to modify the world composite, rather than directly modifying its properties.\r\n* There are also a few methods here that alias those in `Matter.Composite` for easier readability.\r\n*\r\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\r\n*\r\n* @class World\r\n* @extends Composite\r\n*/\r\n\r\nvar World = {};\r\n\r\nmodule.exports = World;\r\n\r\nvar Composite = __webpack_require__(/*! ./Composite */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Composite.js\");\r\nvar Constraint = __webpack_require__(/*! ../constraint/Constraint */ \"./node_modules/phaser/src/physics/matter-js/lib/constraint/Constraint.js\");\r\nvar Common = __webpack_require__(/*! ../core/Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\n\r\n(function() {\r\n\r\n /**\r\n * Creates a new world composite. The options parameter is an object that specifies any properties you wish to override the defaults.\r\n * See the properties section below for detailed information on what you can pass via the `options` object.\r\n * @method create\r\n * @constructor\r\n * @param {} options\r\n * @return {world} A new world\r\n */\r\n World.create = function(options) {\r\n var composite = Composite.create();\r\n\r\n var defaults = {\r\n label: 'World',\r\n gravity: {\r\n x: 0,\r\n y: 1,\r\n scale: 0.001\r\n },\r\n bounds: { \r\n min: { x: -Infinity, y: -Infinity }, \r\n max: { x: Infinity, y: Infinity } \r\n }\r\n };\r\n \r\n return Common.extend(composite, defaults, options);\r\n };\r\n\r\n /*\r\n *\r\n * Properties Documentation\r\n *\r\n */\r\n\r\n /**\r\n * The gravity to apply on the world.\r\n *\r\n * @property gravity\r\n * @type object\r\n */\r\n\r\n /**\r\n * The gravity x component.\r\n *\r\n * @property gravity.x\r\n * @type object\r\n * @default 0\r\n */\r\n\r\n /**\r\n * The gravity y component.\r\n *\r\n * @property gravity.y\r\n * @type object\r\n * @default 1\r\n */\r\n\r\n /**\r\n * The gravity scale factor.\r\n *\r\n * @property gravity.scale\r\n * @type object\r\n * @default 0.001\r\n */\r\n\r\n /**\r\n * A `Bounds` object that defines the world bounds for collision detection.\r\n *\r\n * @property bounds\r\n * @type bounds\r\n * @default { min: { x: -Infinity, y: -Infinity }, max: { x: Infinity, y: Infinity } }\r\n */\r\n\r\n // World is a Composite body\r\n // see src/module/Outro.js for these aliases:\r\n \r\n /**\r\n * An alias for Composite.add\r\n * @method add\r\n * @param {world} world\r\n * @param {} object\r\n * @return {composite} The original world with the objects added\r\n */\r\n\r\n /**\r\n * An alias for Composite.remove\r\n * @method remove\r\n * @param {world} world\r\n * @param {} object\r\n * @param {boolean} [deep=false]\r\n * @return {composite} The original world with the objects removed\r\n */\r\n\r\n /**\r\n * An alias for Composite.clear\r\n * @method clear\r\n * @param {world} world\r\n * @param {boolean} keepStatic\r\n */\r\n\r\n /**\r\n * An alias for Composite.addComposite\r\n * @method addComposite\r\n * @param {world} world\r\n * @param {composite} composite\r\n * @return {world} The original world with the objects from composite added\r\n */\r\n \r\n /**\r\n * An alias for Composite.addBody\r\n * @method addBody\r\n * @param {world} world\r\n * @param {body} body\r\n * @return {world} The original world with the body added\r\n */\r\n\r\n /**\r\n * An alias for Composite.addConstraint\r\n * @method addConstraint\r\n * @param {world} world\r\n * @param {constraint} constraint\r\n * @return {world} The original world with the constraint added\r\n */\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/body/World.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/collision/Detector.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/collision/Detector.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Detector` module contains methods for detecting collisions given a set of pairs.\r\n*\r\n* @class Detector\r\n*/\r\n\r\n// TODO: speculative contacts\r\n\r\nvar Detector = {};\r\n\r\nmodule.exports = Detector;\r\n\r\nvar SAT = __webpack_require__(/*! ./SAT */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/SAT.js\");\r\nvar Pair = __webpack_require__(/*! ./Pair */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Pair.js\");\r\nvar Bounds = __webpack_require__(/*! ../geometry/Bounds */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Bounds.js\");\r\n\r\n(function() {\r\n\r\n /**\r\n * Finds all collisions given a list of pairs.\r\n * @method collisions\r\n * @param {pair[]} broadphasePairs\r\n * @param {engine} engine\r\n * @return {array} collisions\r\n */\r\n Detector.collisions = function(broadphasePairs, engine) {\r\n var collisions = [],\r\n pairsTable = engine.pairs.table;\r\n\r\n // @if DEBUG\r\n var metrics = engine.metrics;\r\n // @endif\r\n \r\n for (var i = 0; i < broadphasePairs.length; i++) {\r\n var bodyA = broadphasePairs[i][0], \r\n bodyB = broadphasePairs[i][1];\r\n\r\n if ((bodyA.isStatic || bodyA.isSleeping) && (bodyB.isStatic || bodyB.isSleeping))\r\n continue;\r\n \r\n if (!Detector.canCollide(bodyA.collisionFilter, bodyB.collisionFilter))\r\n continue;\r\n\r\n // @if DEBUG\r\n metrics.midphaseTests += 1;\r\n // @endif\r\n\r\n // mid phase\r\n if (Bounds.overlaps(bodyA.bounds, bodyB.bounds)) {\r\n for (var j = bodyA.parts.length > 1 ? 1 : 0; j < bodyA.parts.length; j++) {\r\n var partA = bodyA.parts[j];\r\n\r\n for (var k = bodyB.parts.length > 1 ? 1 : 0; k < bodyB.parts.length; k++) {\r\n var partB = bodyB.parts[k];\r\n\r\n if ((partA === bodyA && partB === bodyB) || Bounds.overlaps(partA.bounds, partB.bounds)) {\r\n // find a previous collision we could reuse\r\n var pairId = Pair.id(partA, partB),\r\n pair = pairsTable[pairId],\r\n previousCollision;\r\n\r\n if (pair && pair.isActive) {\r\n previousCollision = pair.collision;\r\n } else {\r\n previousCollision = null;\r\n }\r\n\r\n // narrow phase\r\n var collision = SAT.collides(partA, partB, previousCollision);\r\n\r\n // @if DEBUG\r\n metrics.narrowphaseTests += 1;\r\n if (collision.reused)\r\n metrics.narrowReuseCount += 1;\r\n // @endif\r\n\r\n if (collision.collided) {\r\n collisions.push(collision);\r\n // @if DEBUG\r\n metrics.narrowDetections += 1;\r\n // @endif\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return collisions;\r\n };\r\n\r\n /**\r\n * Returns `true` if both supplied collision filters will allow a collision to occur.\r\n * See `body.collisionFilter` for more information.\r\n * @method canCollide\r\n * @param {} filterA\r\n * @param {} filterB\r\n * @return {bool} `true` if collision can occur\r\n */\r\n Detector.canCollide = function(filterA, filterB) {\r\n if (filterA.group === filterB.group && filterA.group !== 0)\r\n return filterA.group > 0;\r\n\r\n return (filterA.mask & filterB.category) !== 0 && (filterB.mask & filterA.category) !== 0;\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/collision/Detector.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/collision/Grid.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/collision/Grid.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Grid` module contains methods for creating and manipulating collision broadphase grid structures.\r\n*\r\n* @class Grid\r\n*/\r\n\r\nvar Grid = {};\r\n\r\nmodule.exports = Grid;\r\n\r\nvar Pair = __webpack_require__(/*! ./Pair */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Pair.js\");\r\nvar Detector = __webpack_require__(/*! ./Detector */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Detector.js\");\r\nvar Common = __webpack_require__(/*! ../core/Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\n\r\n(function() {\r\n\r\n /**\r\n * Creates a new grid.\r\n * @method create\r\n * @param {} options\r\n * @return {grid} A new grid\r\n */\r\n Grid.create = function(options) {\r\n var defaults = {\r\n controller: Grid,\r\n detector: Detector.collisions,\r\n buckets: {},\r\n pairs: {},\r\n pairsList: [],\r\n bucketWidth: 48,\r\n bucketHeight: 48\r\n };\r\n\r\n return Common.extend(defaults, options);\r\n };\r\n\r\n /**\r\n * The width of a single grid bucket.\r\n *\r\n * @property bucketWidth\r\n * @type number\r\n * @default 48\r\n */\r\n\r\n /**\r\n * The height of a single grid bucket.\r\n *\r\n * @property bucketHeight\r\n * @type number\r\n * @default 48\r\n */\r\n\r\n /**\r\n * Updates the grid.\r\n * @method update\r\n * @param {grid} grid\r\n * @param {body[]} bodies\r\n * @param {engine} engine\r\n * @param {boolean} forceUpdate\r\n */\r\n Grid.update = function(grid, bodies, engine, forceUpdate) {\r\n var i, col, row,\r\n world = engine.world,\r\n buckets = grid.buckets,\r\n bucket,\r\n bucketId,\r\n gridChanged = false;\r\n\r\n // @if DEBUG\r\n var metrics = engine.metrics;\r\n metrics.broadphaseTests = 0;\r\n // @endif\r\n\r\n for (i = 0; i < bodies.length; i++) {\r\n var body = bodies[i];\r\n\r\n if (body.isSleeping && !forceUpdate)\r\n continue;\r\n\r\n // don't update out of world bodies\r\n if (body.bounds.max.x < world.bounds.min.x || body.bounds.min.x > world.bounds.max.x\r\n || body.bounds.max.y < world.bounds.min.y || body.bounds.min.y > world.bounds.max.y)\r\n continue;\r\n\r\n var newRegion = Grid._getRegion(grid, body);\r\n\r\n // if the body has changed grid region\r\n if (!body.region || newRegion.id !== body.region.id || forceUpdate) {\r\n\r\n // @if DEBUG\r\n metrics.broadphaseTests += 1;\r\n // @endif\r\n\r\n if (!body.region || forceUpdate)\r\n body.region = newRegion;\r\n\r\n var union = Grid._regionUnion(newRegion, body.region);\r\n\r\n // update grid buckets affected by region change\r\n // iterate over the union of both regions\r\n for (col = union.startCol; col <= union.endCol; col++) {\r\n for (row = union.startRow; row <= union.endRow; row++) {\r\n bucketId = Grid._getBucketId(col, row);\r\n bucket = buckets[bucketId];\r\n\r\n var isInsideNewRegion = (col >= newRegion.startCol && col <= newRegion.endCol\r\n && row >= newRegion.startRow && row <= newRegion.endRow);\r\n\r\n var isInsideOldRegion = (col >= body.region.startCol && col <= body.region.endCol\r\n && row >= body.region.startRow && row <= body.region.endRow);\r\n\r\n // remove from old region buckets\r\n if (!isInsideNewRegion && isInsideOldRegion) {\r\n if (isInsideOldRegion) {\r\n if (bucket)\r\n Grid._bucketRemoveBody(grid, bucket, body);\r\n }\r\n }\r\n\r\n // add to new region buckets\r\n if (body.region === newRegion || (isInsideNewRegion && !isInsideOldRegion) || forceUpdate) {\r\n if (!bucket)\r\n bucket = Grid._createBucket(buckets, bucketId);\r\n Grid._bucketAddBody(grid, bucket, body);\r\n }\r\n }\r\n }\r\n\r\n // set the new region\r\n body.region = newRegion;\r\n\r\n // flag changes so we can update pairs\r\n gridChanged = true;\r\n }\r\n }\r\n\r\n // update pairs list only if pairs changed (i.e. a body changed region)\r\n if (gridChanged)\r\n grid.pairsList = Grid._createActivePairsList(grid);\r\n };\r\n\r\n /**\r\n * Clears the grid.\r\n * @method clear\r\n * @param {grid} grid\r\n */\r\n Grid.clear = function(grid) {\r\n grid.buckets = {};\r\n grid.pairs = {};\r\n grid.pairsList = [];\r\n };\r\n\r\n /**\r\n * Finds the union of two regions.\r\n * @method _regionUnion\r\n * @private\r\n * @param {} regionA\r\n * @param {} regionB\r\n * @return {} region\r\n */\r\n Grid._regionUnion = function(regionA, regionB) {\r\n var startCol = Math.min(regionA.startCol, regionB.startCol),\r\n endCol = Math.max(regionA.endCol, regionB.endCol),\r\n startRow = Math.min(regionA.startRow, regionB.startRow),\r\n endRow = Math.max(regionA.endRow, regionB.endRow);\r\n\r\n return Grid._createRegion(startCol, endCol, startRow, endRow);\r\n };\r\n\r\n /**\r\n * Gets the region a given body falls in for a given grid.\r\n * @method _getRegion\r\n * @private\r\n * @param {} grid\r\n * @param {} body\r\n * @return {} region\r\n */\r\n Grid._getRegion = function(grid, body) {\r\n var bounds = body.bounds,\r\n startCol = Math.floor(bounds.min.x / grid.bucketWidth),\r\n endCol = Math.floor(bounds.max.x / grid.bucketWidth),\r\n startRow = Math.floor(bounds.min.y / grid.bucketHeight),\r\n endRow = Math.floor(bounds.max.y / grid.bucketHeight);\r\n\r\n return Grid._createRegion(startCol, endCol, startRow, endRow);\r\n };\r\n\r\n /**\r\n * Creates a region.\r\n * @method _createRegion\r\n * @private\r\n * @param {} startCol\r\n * @param {} endCol\r\n * @param {} startRow\r\n * @param {} endRow\r\n * @return {} region\r\n */\r\n Grid._createRegion = function(startCol, endCol, startRow, endRow) {\r\n return { \r\n id: startCol + ',' + endCol + ',' + startRow + ',' + endRow,\r\n startCol: startCol, \r\n endCol: endCol, \r\n startRow: startRow, \r\n endRow: endRow \r\n };\r\n };\r\n\r\n /**\r\n * Gets the bucket id at the given position.\r\n * @method _getBucketId\r\n * @private\r\n * @param {} column\r\n * @param {} row\r\n * @return {string} bucket id\r\n */\r\n Grid._getBucketId = function(column, row) {\r\n return 'C' + column + 'R' + row;\r\n };\r\n\r\n /**\r\n * Creates a bucket.\r\n * @method _createBucket\r\n * @private\r\n * @param {} buckets\r\n * @param {} bucketId\r\n * @return {} bucket\r\n */\r\n Grid._createBucket = function(buckets, bucketId) {\r\n var bucket = buckets[bucketId] = [];\r\n return bucket;\r\n };\r\n\r\n /**\r\n * Adds a body to a bucket.\r\n * @method _bucketAddBody\r\n * @private\r\n * @param {} grid\r\n * @param {} bucket\r\n * @param {} body\r\n */\r\n Grid._bucketAddBody = function(grid, bucket, body) {\r\n // add new pairs\r\n for (var i = 0; i < bucket.length; i++) {\r\n var bodyB = bucket[i];\r\n\r\n if (body.id === bodyB.id || (body.isStatic && bodyB.isStatic))\r\n continue;\r\n\r\n // keep track of the number of buckets the pair exists in\r\n // important for Grid.update to work\r\n var pairId = Pair.id(body, bodyB),\r\n pair = grid.pairs[pairId];\r\n\r\n if (pair) {\r\n pair[2] += 1;\r\n } else {\r\n grid.pairs[pairId] = [body, bodyB, 1];\r\n }\r\n }\r\n\r\n // add to bodies (after pairs, otherwise pairs with self)\r\n bucket.push(body);\r\n };\r\n\r\n /**\r\n * Removes a body from a bucket.\r\n * @method _bucketRemoveBody\r\n * @private\r\n * @param {} grid\r\n * @param {} bucket\r\n * @param {} body\r\n */\r\n Grid._bucketRemoveBody = function(grid, bucket, body) {\r\n // remove from bucket\r\n bucket.splice(bucket.indexOf(body), 1);\r\n\r\n // update pair counts\r\n for (var i = 0; i < bucket.length; i++) {\r\n // keep track of the number of buckets the pair exists in\r\n // important for _createActivePairsList to work\r\n var bodyB = bucket[i],\r\n pairId = Pair.id(body, bodyB),\r\n pair = grid.pairs[pairId];\r\n\r\n if (pair)\r\n pair[2] -= 1;\r\n }\r\n };\r\n\r\n /**\r\n * Generates a list of the active pairs in the grid.\r\n * @method _createActivePairsList\r\n * @private\r\n * @param {} grid\r\n * @return [] pairs\r\n */\r\n Grid._createActivePairsList = function(grid) {\r\n var pairKeys,\r\n pair,\r\n pairs = [];\r\n\r\n // grid.pairs is used as a hashmap\r\n pairKeys = Common.keys(grid.pairs);\r\n\r\n // iterate over grid.pairs\r\n for (var k = 0; k < pairKeys.length; k++) {\r\n pair = grid.pairs[pairKeys[k]];\r\n\r\n // if pair exists in at least one bucket\r\n // it is a pair that needs further collision testing so push it\r\n if (pair[2] > 0) {\r\n pairs.push(pair);\r\n } else {\r\n delete grid.pairs[pairKeys[k]];\r\n }\r\n }\r\n\r\n return pairs;\r\n };\r\n \r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/collision/Grid.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/collision/Pair.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/collision/Pair.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n* The `Matter.Pair` module contains methods for creating and manipulating collision pairs.\r\n*\r\n* @class Pair\r\n*/\r\n\r\nvar Pair = {};\r\n\r\nmodule.exports = Pair;\r\n\r\n(function() {\r\n \r\n /**\r\n * Creates a pair.\r\n * @method create\r\n * @param {collision} collision\r\n * @param {number} timestamp\r\n * @return {pair} A new pair\r\n */\r\n Pair.create = function(collision, timestamp) {\r\n var bodyA = collision.bodyA,\r\n bodyB = collision.bodyB;\r\n\r\n var pair = {\r\n id: Pair.id(bodyA, bodyB),\r\n bodyA: bodyA,\r\n bodyB: bodyB,\r\n activeContacts: [],\r\n separation: 0,\r\n isActive: true,\r\n confirmedActive: true,\r\n isSensor: bodyA.isSensor || bodyB.isSensor,\r\n timeCreated: timestamp,\r\n timeUpdated: timestamp,\r\n collision: null,\r\n inverseMass: 0,\r\n friction: 0,\r\n frictionStatic: 0,\r\n restitution: 0,\r\n slop: 0\r\n };\r\n\r\n Pair.update(pair, collision, timestamp);\r\n\r\n return pair;\r\n };\r\n\r\n /**\r\n * Updates a pair given a collision.\r\n * @method update\r\n * @param {pair} pair\r\n * @param {collision} collision\r\n * @param {number} timestamp\r\n */\r\n Pair.update = function(pair, collision, timestamp) {\r\n pair.collision = collision;\r\n\r\n if (collision.collided) {\r\n var supports = collision.supports,\r\n activeContacts = pair.activeContacts,\r\n parentA = collision.parentA,\r\n parentB = collision.parentB;\r\n\r\n pair.inverseMass = parentA.inverseMass + parentB.inverseMass;\r\n pair.friction = Math.min(parentA.friction, parentB.friction);\r\n pair.frictionStatic = Math.max(parentA.frictionStatic, parentB.frictionStatic);\r\n pair.restitution = Math.max(parentA.restitution, parentB.restitution);\r\n pair.slop = Math.max(parentA.slop, parentB.slop);\r\n\r\n for (var i = 0; i < supports.length; i++) {\r\n activeContacts[i] = supports[i].contact;\r\n }\r\n\r\n // optimise array size\r\n var supportCount = supports.length;\r\n if (supportCount < activeContacts.length) {\r\n activeContacts.length = supportCount;\r\n }\r\n\r\n pair.separation = collision.depth;\r\n Pair.setActive(pair, true, timestamp);\r\n } else {\r\n if (pair.isActive === true)\r\n Pair.setActive(pair, false, timestamp);\r\n }\r\n };\r\n \r\n /**\r\n * Set a pair as active or inactive.\r\n * @method setActive\r\n * @param {pair} pair\r\n * @param {bool} isActive\r\n * @param {number} timestamp\r\n */\r\n Pair.setActive = function(pair, isActive, timestamp) {\r\n if (isActive) {\r\n pair.isActive = true;\r\n pair.timeUpdated = timestamp;\r\n } else {\r\n pair.isActive = false;\r\n pair.activeContacts.length = 0;\r\n }\r\n };\r\n\r\n /**\r\n * Get the id for the given pair.\r\n * @method id\r\n * @param {body} bodyA\r\n * @param {body} bodyB\r\n * @return {string} Unique pairId\r\n */\r\n Pair.id = function(bodyA, bodyB) {\r\n if (bodyA.id < bodyB.id) {\r\n return 'A' + bodyA.id + 'B' + bodyB.id;\r\n } else {\r\n return 'A' + bodyB.id + 'B' + bodyA.id;\r\n }\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/collision/Pair.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/collision/Pairs.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/collision/Pairs.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Pairs` module contains methods for creating and manipulating collision pair sets.\r\n*\r\n* @class Pairs\r\n*/\r\n\r\nvar Pairs = {};\r\n\r\nmodule.exports = Pairs;\r\n\r\nvar Pair = __webpack_require__(/*! ./Pair */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Pair.js\");\r\nvar Common = __webpack_require__(/*! ../core/Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\n\r\n(function() {\r\n \r\n Pairs._pairMaxIdleLife = 1000;\r\n\r\n /**\r\n * Creates a new pairs structure.\r\n * @method create\r\n * @param {object} options\r\n * @return {pairs} A new pairs structure\r\n */\r\n Pairs.create = function(options) {\r\n return Common.extend({ \r\n table: {},\r\n list: [],\r\n collisionStart: [],\r\n collisionActive: [],\r\n collisionEnd: []\r\n }, options);\r\n };\r\n\r\n /**\r\n * Updates pairs given a list of collisions.\r\n * @method update\r\n * @param {object} pairs\r\n * @param {collision[]} collisions\r\n * @param {number} timestamp\r\n */\r\n Pairs.update = function(pairs, collisions, timestamp) {\r\n var pairsList = pairs.list,\r\n pairsTable = pairs.table,\r\n collisionStart = pairs.collisionStart,\r\n collisionEnd = pairs.collisionEnd,\r\n collisionActive = pairs.collisionActive,\r\n collision,\r\n pairId,\r\n pair,\r\n i;\r\n\r\n // clear collision state arrays, but maintain old reference\r\n collisionStart.length = 0;\r\n collisionEnd.length = 0;\r\n collisionActive.length = 0;\r\n\r\n for (i = 0; i < pairsList.length; i++) {\r\n pairsList[i].confirmedActive = false;\r\n }\r\n\r\n for (i = 0; i < collisions.length; i++) {\r\n collision = collisions[i];\r\n\r\n if (collision.collided) {\r\n pairId = Pair.id(collision.bodyA, collision.bodyB);\r\n\r\n pair = pairsTable[pairId];\r\n \r\n if (pair) {\r\n // pair already exists (but may or may not be active)\r\n if (pair.isActive) {\r\n // pair exists and is active\r\n collisionActive.push(pair);\r\n } else {\r\n // pair exists but was inactive, so a collision has just started again\r\n collisionStart.push(pair);\r\n }\r\n\r\n // update the pair\r\n Pair.update(pair, collision, timestamp);\r\n pair.confirmedActive = true;\r\n } else {\r\n // pair did not exist, create a new pair\r\n pair = Pair.create(collision, timestamp);\r\n pairsTable[pairId] = pair;\r\n\r\n // push the new pair\r\n collisionStart.push(pair);\r\n pairsList.push(pair);\r\n }\r\n }\r\n }\r\n\r\n // deactivate previously active pairs that are now inactive\r\n for (i = 0; i < pairsList.length; i++) {\r\n pair = pairsList[i];\r\n if (pair.isActive && !pair.confirmedActive) {\r\n Pair.setActive(pair, false, timestamp);\r\n collisionEnd.push(pair);\r\n }\r\n }\r\n };\r\n \r\n /**\r\n * Finds and removes pairs that have been inactive for a set amount of time.\r\n * @method removeOld\r\n * @param {object} pairs\r\n * @param {number} timestamp\r\n */\r\n Pairs.removeOld = function(pairs, timestamp) {\r\n var pairsList = pairs.list,\r\n pairsTable = pairs.table,\r\n indexesToRemove = [],\r\n pair,\r\n collision,\r\n pairIndex,\r\n i;\r\n\r\n for (i = 0; i < pairsList.length; i++) {\r\n pair = pairsList[i];\r\n collision = pair.collision;\r\n \r\n // never remove sleeping pairs\r\n if (collision.bodyA.isSleeping || collision.bodyB.isSleeping) {\r\n pair.timeUpdated = timestamp;\r\n continue;\r\n }\r\n\r\n // if pair is inactive for too long, mark it to be removed\r\n if (timestamp - pair.timeUpdated > Pairs._pairMaxIdleLife) {\r\n indexesToRemove.push(i);\r\n }\r\n }\r\n\r\n // remove marked pairs\r\n for (i = 0; i < indexesToRemove.length; i++) {\r\n pairIndex = indexesToRemove[i] - i;\r\n pair = pairsList[pairIndex];\r\n delete pairsTable[pair.id];\r\n pairsList.splice(pairIndex, 1);\r\n }\r\n };\r\n\r\n /**\r\n * Clears the given pairs structure.\r\n * @method clear\r\n * @param {pairs} pairs\r\n * @return {pairs} pairs\r\n */\r\n Pairs.clear = function(pairs) {\r\n pairs.table = {};\r\n pairs.list.length = 0;\r\n pairs.collisionStart.length = 0;\r\n pairs.collisionActive.length = 0;\r\n pairs.collisionEnd.length = 0;\r\n return pairs;\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/collision/Pairs.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/collision/Query.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/collision/Query.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Query` module contains methods for performing collision queries.\r\n*\r\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\r\n*\r\n* @class Query\r\n*/\r\n\r\nvar Query = {};\r\n\r\nmodule.exports = Query;\r\n\r\nvar Vector = __webpack_require__(/*! ../geometry/Vector */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vector.js\");\r\nvar SAT = __webpack_require__(/*! ./SAT */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/SAT.js\");\r\nvar Bounds = __webpack_require__(/*! ../geometry/Bounds */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Bounds.js\");\r\nvar Bodies = __webpack_require__(/*! ../factory/Bodies */ \"./node_modules/phaser/src/physics/matter-js/lib/factory/Bodies.js\");\r\nvar Vertices = __webpack_require__(/*! ../geometry/Vertices */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js\");\r\n\r\n(function() {\r\n\r\n /**\r\n * Returns a list of collisions between `body` and `bodies`.\r\n * @method collides\r\n * @param {body} body\r\n * @param {body[]} bodies\r\n * @return {object[]} Collisions\r\n */\r\n Query.collides = function(body, bodies) {\r\n var collisions = [];\r\n\r\n for (var i = 0; i < bodies.length; i++) {\r\n var bodyA = bodies[i];\r\n\r\n // Phaser addition - skip same body checks\r\n if (body === bodyA)\r\n {\r\n continue;\r\n }\r\n \r\n if (Bounds.overlaps(bodyA.bounds, body.bounds)) {\r\n for (var j = bodyA.parts.length === 1 ? 0 : 1; j < bodyA.parts.length; j++) {\r\n var part = bodyA.parts[j];\r\n\r\n if (Bounds.overlaps(part.bounds, body.bounds)) {\r\n var collision = SAT.collides(part, body);\r\n\r\n if (collision.collided) {\r\n collisions.push(collision);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return collisions;\r\n };\r\n\r\n /**\r\n * Casts a ray segment against a set of bodies and returns all collisions, ray width is optional. Intersection points are not provided.\r\n * @method ray\r\n * @param {body[]} bodies\r\n * @param {vector} startPoint\r\n * @param {vector} endPoint\r\n * @param {number} [rayWidth]\r\n * @return {object[]} Collisions\r\n */\r\n Query.ray = function(bodies, startPoint, endPoint, rayWidth) {\r\n rayWidth = rayWidth || 1e-100;\r\n\r\n var rayAngle = Vector.angle(startPoint, endPoint),\r\n rayLength = Vector.magnitude(Vector.sub(startPoint, endPoint)),\r\n rayX = (endPoint.x + startPoint.x) * 0.5,\r\n rayY = (endPoint.y + startPoint.y) * 0.5,\r\n ray = Bodies.rectangle(rayX, rayY, rayLength, rayWidth, { angle: rayAngle }),\r\n collisions = Query.collides(ray, bodies);\r\n\r\n for (var i = 0; i < collisions.length; i += 1) {\r\n var collision = collisions[i];\r\n collision.body = collision.bodyB = collision.bodyA; \r\n }\r\n\r\n return collisions;\r\n };\r\n\r\n /**\r\n * Returns all bodies whose bounds are inside (or outside if set) the given set of bounds, from the given set of bodies.\r\n * @method region\r\n * @param {body[]} bodies\r\n * @param {bounds} bounds\r\n * @param {bool} [outside=false]\r\n * @return {body[]} The bodies matching the query\r\n */\r\n Query.region = function(bodies, bounds, outside) {\r\n var result = [];\r\n\r\n for (var i = 0; i < bodies.length; i++) {\r\n var body = bodies[i],\r\n overlaps = Bounds.overlaps(body.bounds, bounds);\r\n if ((overlaps && !outside) || (!overlaps && outside))\r\n result.push(body);\r\n }\r\n\r\n return result;\r\n };\r\n\r\n /**\r\n * Returns all bodies whose vertices contain the given point, from the given set of bodies.\r\n * @method point\r\n * @param {body[]} bodies\r\n * @param {vector} point\r\n * @return {body[]} The bodies matching the query\r\n */\r\n Query.point = function(bodies, point) {\r\n var result = [];\r\n\r\n for (var i = 0; i < bodies.length; i++) {\r\n var body = bodies[i];\r\n \r\n if (Bounds.contains(body.bounds, point)) {\r\n for (var j = body.parts.length === 1 ? 0 : 1; j < body.parts.length; j++) {\r\n var part = body.parts[j];\r\n\r\n if (Bounds.contains(part.bounds, point)\r\n && Vertices.contains(part.vertices, point)) {\r\n result.push(body);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/collision/Query.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/collision/Resolver.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/collision/Resolver.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Resolver` module contains methods for resolving collision pairs.\r\n*\r\n* @class Resolver\r\n*/\r\n\r\nvar Resolver = {};\r\n\r\nmodule.exports = Resolver;\r\n\r\nvar Vertices = __webpack_require__(/*! ../geometry/Vertices */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js\");\r\nvar Vector = __webpack_require__(/*! ../geometry/Vector */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vector.js\");\r\nvar Common = __webpack_require__(/*! ../core/Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\nvar Bounds = __webpack_require__(/*! ../geometry/Bounds */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Bounds.js\");\r\n\r\n(function() {\r\n\r\n Resolver._restingThresh = 4;\r\n Resolver._restingThreshTangent = 6;\r\n Resolver._positionDampen = 0.9;\r\n Resolver._positionWarming = 0.8;\r\n Resolver._frictionNormalMultiplier = 5;\r\n\r\n /**\r\n * Prepare pairs for position solving.\r\n * @method preSolvePosition\r\n * @param {pair[]} pairs\r\n */\r\n Resolver.preSolvePosition = function(pairs) {\r\n var i,\r\n pair,\r\n activeCount;\r\n\r\n // find total contacts on each body\r\n for (i = 0; i < pairs.length; i++) {\r\n pair = pairs[i];\r\n \r\n if (!pair.isActive)\r\n continue;\r\n \r\n activeCount = pair.activeContacts.length;\r\n pair.collision.parentA.totalContacts += activeCount;\r\n pair.collision.parentB.totalContacts += activeCount;\r\n }\r\n };\r\n\r\n /**\r\n * Find a solution for pair positions.\r\n * @method solvePosition\r\n * @param {pair[]} pairs\r\n * @param {body[]} bodies\r\n * @param {number} timeScale\r\n */\r\n Resolver.solvePosition = function(pairs, bodies, timeScale) {\r\n var i,\r\n normalX,\r\n normalY,\r\n pair,\r\n collision,\r\n bodyA,\r\n bodyB,\r\n normal,\r\n separation,\r\n penetration,\r\n positionImpulseA,\r\n positionImpulseB,\r\n contactShare,\r\n bodyBtoAX,\r\n bodyBtoAY,\r\n positionImpulse,\r\n impulseCoefficient = timeScale * Resolver._positionDampen;\r\n\r\n for (i = 0; i < bodies.length; i++) {\r\n var body = bodies[i];\r\n body.previousPositionImpulse.x = body.positionImpulse.x;\r\n body.previousPositionImpulse.y = body.positionImpulse.y;\r\n }\r\n\r\n // find impulses required to resolve penetration\r\n for (i = 0; i < pairs.length; i++) {\r\n pair = pairs[i];\r\n \r\n if (!pair.isActive || pair.isSensor)\r\n continue;\r\n\r\n collision = pair.collision;\r\n bodyA = collision.parentA;\r\n bodyB = collision.parentB;\r\n normal = collision.normal;\r\n\r\n positionImpulseA = bodyA.previousPositionImpulse;\r\n positionImpulseB = bodyB.previousPositionImpulse;\r\n\r\n penetration = collision.penetration;\r\n\r\n bodyBtoAX = positionImpulseB.x - positionImpulseA.x + penetration.x;\r\n bodyBtoAY = positionImpulseB.y - positionImpulseA.y + penetration.y;\r\n\r\n normalX = normal.x;\r\n normalY = normal.y;\r\n\r\n separation = normalX * bodyBtoAX + normalY * bodyBtoAY;\r\n pair.separation = separation;\r\n\r\n positionImpulse = (separation - pair.slop) * impulseCoefficient;\r\n\r\n if (bodyA.isStatic || bodyB.isStatic)\r\n positionImpulse *= 2;\r\n \r\n if (!(bodyA.isStatic || bodyA.isSleeping)) {\r\n contactShare = positionImpulse / bodyA.totalContacts;\r\n bodyA.positionImpulse.x += normalX * contactShare;\r\n bodyA.positionImpulse.y += normalY * contactShare;\r\n }\r\n\r\n if (!(bodyB.isStatic || bodyB.isSleeping)) {\r\n contactShare = positionImpulse / bodyB.totalContacts;\r\n bodyB.positionImpulse.x -= normalX * contactShare;\r\n bodyB.positionImpulse.y -= normalY * contactShare;\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Apply position resolution.\r\n * @method postSolvePosition\r\n * @param {body[]} bodies\r\n */\r\n Resolver.postSolvePosition = function(bodies) {\r\n for (var i = 0; i < bodies.length; i++) {\r\n var body = bodies[i];\r\n\r\n // reset contact count\r\n body.totalContacts = 0;\r\n\r\n if (body.positionImpulse.x !== 0 || body.positionImpulse.y !== 0) {\r\n // update body geometry\r\n for (var j = 0; j < body.parts.length; j++) {\r\n var part = body.parts[j];\r\n Vertices.translate(part.vertices, body.positionImpulse);\r\n Bounds.update(part.bounds, part.vertices, body.velocity);\r\n part.position.x += body.positionImpulse.x;\r\n part.position.y += body.positionImpulse.y;\r\n }\r\n\r\n // move the body without changing velocity\r\n body.positionPrev.x += body.positionImpulse.x;\r\n body.positionPrev.y += body.positionImpulse.y;\r\n\r\n if (Vector.dot(body.positionImpulse, body.velocity) < 0) {\r\n // reset cached impulse if the body has velocity along it\r\n body.positionImpulse.x = 0;\r\n body.positionImpulse.y = 0;\r\n } else {\r\n // warm the next iteration\r\n body.positionImpulse.x *= Resolver._positionWarming;\r\n body.positionImpulse.y *= Resolver._positionWarming;\r\n }\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Prepare pairs for velocity solving.\r\n * @method preSolveVelocity\r\n * @param {pair[]} pairs\r\n */\r\n Resolver.preSolveVelocity = function(pairs) {\r\n var i,\r\n j,\r\n pair,\r\n contacts,\r\n collision,\r\n bodyA,\r\n bodyB,\r\n normal,\r\n tangent,\r\n contact,\r\n contactVertex,\r\n normalImpulse,\r\n tangentImpulse,\r\n offset,\r\n impulse = Vector._temp[0],\r\n tempA = Vector._temp[1];\r\n \r\n for (i = 0; i < pairs.length; i++) {\r\n pair = pairs[i];\r\n \r\n if (!pair.isActive || pair.isSensor)\r\n continue;\r\n \r\n contacts = pair.activeContacts;\r\n collision = pair.collision;\r\n bodyA = collision.parentA;\r\n bodyB = collision.parentB;\r\n normal = collision.normal;\r\n tangent = collision.tangent;\r\n\r\n // resolve each contact\r\n for (j = 0; j < contacts.length; j++) {\r\n contact = contacts[j];\r\n contactVertex = contact.vertex;\r\n normalImpulse = contact.normalImpulse;\r\n tangentImpulse = contact.tangentImpulse;\r\n\r\n if (normalImpulse !== 0 || tangentImpulse !== 0) {\r\n // total impulse from contact\r\n impulse.x = (normal.x * normalImpulse) + (tangent.x * tangentImpulse);\r\n impulse.y = (normal.y * normalImpulse) + (tangent.y * tangentImpulse);\r\n \r\n // apply impulse from contact\r\n if (!(bodyA.isStatic || bodyA.isSleeping)) {\r\n offset = Vector.sub(contactVertex, bodyA.position, tempA);\r\n bodyA.positionPrev.x += impulse.x * bodyA.inverseMass;\r\n bodyA.positionPrev.y += impulse.y * bodyA.inverseMass;\r\n bodyA.anglePrev += Vector.cross(offset, impulse) * bodyA.inverseInertia;\r\n }\r\n\r\n if (!(bodyB.isStatic || bodyB.isSleeping)) {\r\n offset = Vector.sub(contactVertex, bodyB.position, tempA);\r\n bodyB.positionPrev.x -= impulse.x * bodyB.inverseMass;\r\n bodyB.positionPrev.y -= impulse.y * bodyB.inverseMass;\r\n bodyB.anglePrev -= Vector.cross(offset, impulse) * bodyB.inverseInertia;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Find a solution for pair velocities.\r\n * @method solveVelocity\r\n * @param {pair[]} pairs\r\n * @param {number} timeScale\r\n */\r\n Resolver.solveVelocity = function(pairs, timeScale) {\r\n var timeScaleSquared = timeScale * timeScale,\r\n impulse = Vector._temp[0],\r\n tempA = Vector._temp[1],\r\n tempB = Vector._temp[2],\r\n tempC = Vector._temp[3],\r\n tempD = Vector._temp[4],\r\n tempE = Vector._temp[5];\r\n \r\n for (var i = 0; i < pairs.length; i++) {\r\n var pair = pairs[i];\r\n \r\n if (!pair.isActive || pair.isSensor)\r\n continue;\r\n \r\n var collision = pair.collision,\r\n bodyA = collision.parentA,\r\n bodyB = collision.parentB,\r\n normal = collision.normal,\r\n tangent = collision.tangent,\r\n contacts = pair.activeContacts,\r\n contactShare = 1 / contacts.length;\r\n\r\n // update body velocities\r\n bodyA.velocity.x = bodyA.position.x - bodyA.positionPrev.x;\r\n bodyA.velocity.y = bodyA.position.y - bodyA.positionPrev.y;\r\n bodyB.velocity.x = bodyB.position.x - bodyB.positionPrev.x;\r\n bodyB.velocity.y = bodyB.position.y - bodyB.positionPrev.y;\r\n bodyA.angularVelocity = bodyA.angle - bodyA.anglePrev;\r\n bodyB.angularVelocity = bodyB.angle - bodyB.anglePrev;\r\n\r\n // resolve each contact\r\n for (var j = 0; j < contacts.length; j++) {\r\n var contact = contacts[j],\r\n contactVertex = contact.vertex,\r\n offsetA = Vector.sub(contactVertex, bodyA.position, tempA),\r\n offsetB = Vector.sub(contactVertex, bodyB.position, tempB),\r\n velocityPointA = Vector.add(bodyA.velocity, Vector.mult(Vector.perp(offsetA), bodyA.angularVelocity), tempC),\r\n velocityPointB = Vector.add(bodyB.velocity, Vector.mult(Vector.perp(offsetB), bodyB.angularVelocity), tempD), \r\n relativeVelocity = Vector.sub(velocityPointA, velocityPointB, tempE),\r\n normalVelocity = Vector.dot(normal, relativeVelocity);\r\n\r\n var tangentVelocity = Vector.dot(tangent, relativeVelocity),\r\n tangentSpeed = Math.abs(tangentVelocity),\r\n tangentVelocityDirection = Common.sign(tangentVelocity);\r\n\r\n // raw impulses\r\n var normalImpulse = (1 + pair.restitution) * normalVelocity,\r\n normalForce = Common.clamp(pair.separation + normalVelocity, 0, 1) * Resolver._frictionNormalMultiplier;\r\n\r\n // coulomb friction\r\n var tangentImpulse = tangentVelocity,\r\n maxFriction = Infinity;\r\n\r\n if (tangentSpeed > pair.friction * pair.frictionStatic * normalForce * timeScaleSquared) {\r\n maxFriction = tangentSpeed;\r\n tangentImpulse = Common.clamp(\r\n pair.friction * tangentVelocityDirection * timeScaleSquared,\r\n -maxFriction, maxFriction\r\n );\r\n }\r\n\r\n // modify impulses accounting for mass, inertia and offset\r\n var oAcN = Vector.cross(offsetA, normal),\r\n oBcN = Vector.cross(offsetB, normal),\r\n share = contactShare / (bodyA.inverseMass + bodyB.inverseMass + bodyA.inverseInertia * oAcN * oAcN + bodyB.inverseInertia * oBcN * oBcN);\r\n\r\n normalImpulse *= share;\r\n tangentImpulse *= share;\r\n\r\n // handle high velocity and resting collisions separately\r\n if (normalVelocity < 0 && normalVelocity * normalVelocity > Resolver._restingThresh * timeScaleSquared) {\r\n // high normal velocity so clear cached contact normal impulse\r\n contact.normalImpulse = 0;\r\n } else {\r\n // solve resting collision constraints using Erin Catto's method (GDC08)\r\n // impulse constraint tends to 0\r\n var contactNormalImpulse = contact.normalImpulse;\r\n contact.normalImpulse = Math.min(contact.normalImpulse + normalImpulse, 0);\r\n normalImpulse = contact.normalImpulse - contactNormalImpulse;\r\n }\r\n\r\n // handle high velocity and resting collisions separately\r\n if (tangentVelocity * tangentVelocity > Resolver._restingThreshTangent * timeScaleSquared) {\r\n // high tangent velocity so clear cached contact tangent impulse\r\n contact.tangentImpulse = 0;\r\n } else {\r\n // solve resting collision constraints using Erin Catto's method (GDC08)\r\n // tangent impulse tends to -tangentSpeed or +tangentSpeed\r\n var contactTangentImpulse = contact.tangentImpulse;\r\n contact.tangentImpulse = Common.clamp(contact.tangentImpulse + tangentImpulse, -maxFriction, maxFriction);\r\n tangentImpulse = contact.tangentImpulse - contactTangentImpulse;\r\n }\r\n\r\n // total impulse from contact\r\n impulse.x = (normal.x * normalImpulse) + (tangent.x * tangentImpulse);\r\n impulse.y = (normal.y * normalImpulse) + (tangent.y * tangentImpulse);\r\n \r\n // apply impulse from contact\r\n if (!(bodyA.isStatic || bodyA.isSleeping)) {\r\n bodyA.positionPrev.x += impulse.x * bodyA.inverseMass;\r\n bodyA.positionPrev.y += impulse.y * bodyA.inverseMass;\r\n bodyA.anglePrev += Vector.cross(offsetA, impulse) * bodyA.inverseInertia;\r\n }\r\n\r\n if (!(bodyB.isStatic || bodyB.isSleeping)) {\r\n bodyB.positionPrev.x -= impulse.x * bodyB.inverseMass;\r\n bodyB.positionPrev.y -= impulse.y * bodyB.inverseMass;\r\n bodyB.anglePrev -= Vector.cross(offsetB, impulse) * bodyB.inverseInertia;\r\n }\r\n }\r\n }\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/collision/Resolver.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/collision/SAT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/collision/SAT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.SAT` module contains methods for detecting collisions using the Separating Axis Theorem.\r\n*\r\n* @class SAT\r\n*/\r\n\r\n// TODO: true circles and curves\r\n\r\nvar SAT = {};\r\n\r\nmodule.exports = SAT;\r\n\r\nvar Vertices = __webpack_require__(/*! ../geometry/Vertices */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js\");\r\nvar Vector = __webpack_require__(/*! ../geometry/Vector */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vector.js\");\r\n\r\n(function() {\r\n\r\n /**\r\n * Detect collision between two bodies using the Separating Axis Theorem.\r\n * @method collides\r\n * @param {body} bodyA\r\n * @param {body} bodyB\r\n * @param {collision} previousCollision\r\n * @return {collision} collision\r\n */\r\n SAT.collides = function(bodyA, bodyB, previousCollision) {\r\n var overlapAB,\r\n overlapBA, \r\n minOverlap,\r\n collision,\r\n canReusePrevCol = false;\r\n\r\n if (previousCollision) {\r\n // estimate total motion\r\n var parentA = bodyA.parent,\r\n parentB = bodyB.parent,\r\n motion = parentA.speed * parentA.speed + parentA.angularSpeed * parentA.angularSpeed\r\n + parentB.speed * parentB.speed + parentB.angularSpeed * parentB.angularSpeed;\r\n\r\n // we may be able to (partially) reuse collision result \r\n // but only safe if collision was resting\r\n canReusePrevCol = previousCollision && previousCollision.collided && motion < 0.2;\r\n\r\n // reuse collision object\r\n collision = previousCollision;\r\n } else {\r\n collision = { collided: false, bodyA: bodyA, bodyB: bodyB };\r\n }\r\n\r\n if (previousCollision && canReusePrevCol) {\r\n // if we can reuse the collision result\r\n // we only need to test the previously found axis\r\n var axisBodyA = collision.axisBody,\r\n axisBodyB = axisBodyA === bodyA ? bodyB : bodyA,\r\n axes = [axisBodyA.axes[previousCollision.axisNumber]];\r\n\r\n minOverlap = SAT._overlapAxes(axisBodyA.vertices, axisBodyB.vertices, axes);\r\n collision.reused = true;\r\n\r\n if (minOverlap.overlap <= 0) {\r\n collision.collided = false;\r\n return collision;\r\n }\r\n } else {\r\n // if we can't reuse a result, perform a full SAT test\r\n\r\n overlapAB = SAT._overlapAxes(bodyA.vertices, bodyB.vertices, bodyA.axes);\r\n\r\n if (overlapAB.overlap <= 0) {\r\n collision.collided = false;\r\n return collision;\r\n }\r\n\r\n overlapBA = SAT._overlapAxes(bodyB.vertices, bodyA.vertices, bodyB.axes);\r\n\r\n if (overlapBA.overlap <= 0) {\r\n collision.collided = false;\r\n return collision;\r\n }\r\n\r\n if (overlapAB.overlap < overlapBA.overlap) {\r\n minOverlap = overlapAB;\r\n collision.axisBody = bodyA;\r\n } else {\r\n minOverlap = overlapBA;\r\n collision.axisBody = bodyB;\r\n }\r\n\r\n // important for reuse later\r\n collision.axisNumber = minOverlap.axisNumber;\r\n }\r\n\r\n collision.bodyA = bodyA.id < bodyB.id ? bodyA : bodyB;\r\n collision.bodyB = bodyA.id < bodyB.id ? bodyB : bodyA;\r\n collision.collided = true;\r\n collision.depth = minOverlap.overlap;\r\n collision.parentA = collision.bodyA.parent;\r\n collision.parentB = collision.bodyB.parent;\r\n \r\n bodyA = collision.bodyA;\r\n bodyB = collision.bodyB;\r\n\r\n // ensure normal is facing away from bodyA\r\n if (Vector.dot(minOverlap.axis, Vector.sub(bodyB.position, bodyA.position)) < 0) {\r\n collision.normal = {\r\n x: minOverlap.axis.x,\r\n y: minOverlap.axis.y\r\n };\r\n } else {\r\n collision.normal = {\r\n x: -minOverlap.axis.x,\r\n y: -minOverlap.axis.y\r\n };\r\n }\r\n\r\n collision.tangent = Vector.perp(collision.normal);\r\n\r\n collision.penetration = collision.penetration || {};\r\n collision.penetration.x = collision.normal.x * collision.depth;\r\n collision.penetration.y = collision.normal.y * collision.depth; \r\n\r\n // find support points, there is always either exactly one or two\r\n var verticesB = SAT._findSupports(bodyA, bodyB, collision.normal),\r\n supports = [];\r\n\r\n // find the supports from bodyB that are inside bodyA\r\n if (Vertices.contains(bodyA.vertices, verticesB[0]))\r\n supports.push(verticesB[0]);\r\n\r\n if (Vertices.contains(bodyA.vertices, verticesB[1]))\r\n supports.push(verticesB[1]);\r\n\r\n // find the supports from bodyA that are inside bodyB\r\n if (supports.length < 2) {\r\n var verticesA = SAT._findSupports(bodyB, bodyA, Vector.neg(collision.normal));\r\n \r\n if (Vertices.contains(bodyB.vertices, verticesA[0]))\r\n supports.push(verticesA[0]);\r\n\r\n if (supports.length < 2 && Vertices.contains(bodyB.vertices, verticesA[1]))\r\n supports.push(verticesA[1]);\r\n }\r\n\r\n // account for the edge case of overlapping but no vertex containment\r\n if (supports.length < 1)\r\n supports = [verticesB[0]];\r\n \r\n collision.supports = supports;\r\n\r\n return collision;\r\n };\r\n\r\n /**\r\n * Find the overlap between two sets of vertices.\r\n * @method _overlapAxes\r\n * @private\r\n * @param {} verticesA\r\n * @param {} verticesB\r\n * @param {} axes\r\n * @return result\r\n */\r\n SAT._overlapAxes = function(verticesA, verticesB, axes) {\r\n var projectionA = Vector._temp[0], \r\n projectionB = Vector._temp[1],\r\n result = { overlap: Number.MAX_VALUE },\r\n overlap,\r\n axis;\r\n\r\n for (var i = 0; i < axes.length; i++) {\r\n axis = axes[i];\r\n\r\n SAT._projectToAxis(projectionA, verticesA, axis);\r\n SAT._projectToAxis(projectionB, verticesB, axis);\r\n\r\n overlap = Math.min(projectionA.max - projectionB.min, projectionB.max - projectionA.min);\r\n\r\n if (overlap <= 0) {\r\n result.overlap = overlap;\r\n return result;\r\n }\r\n\r\n if (overlap < result.overlap) {\r\n result.overlap = overlap;\r\n result.axis = axis;\r\n result.axisNumber = i;\r\n }\r\n }\r\n\r\n return result;\r\n };\r\n\r\n /**\r\n * Projects vertices on an axis and returns an interval.\r\n * @method _projectToAxis\r\n * @private\r\n * @param {} projection\r\n * @param {} vertices\r\n * @param {} axis\r\n */\r\n SAT._projectToAxis = function(projection, vertices, axis) {\r\n var min = Vector.dot(vertices[0], axis),\r\n max = min;\r\n\r\n for (var i = 1; i < vertices.length; i += 1) {\r\n var dot = Vector.dot(vertices[i], axis);\r\n\r\n if (dot > max) { \r\n max = dot; \r\n } else if (dot < min) { \r\n min = dot; \r\n }\r\n }\r\n\r\n projection.min = min;\r\n projection.max = max;\r\n };\r\n \r\n /**\r\n * Finds supporting vertices given two bodies along a given direction using hill-climbing.\r\n * @method _findSupports\r\n * @private\r\n * @param {} bodyA\r\n * @param {} bodyB\r\n * @param {} normal\r\n * @return [vector]\r\n */\r\n SAT._findSupports = function(bodyA, bodyB, normal) {\r\n var nearestDistance = Number.MAX_VALUE,\r\n vertexToBody = Vector._temp[0],\r\n vertices = bodyB.vertices,\r\n bodyAPosition = bodyA.position,\r\n distance,\r\n vertex,\r\n vertexA,\r\n vertexB;\r\n\r\n // find closest vertex on bodyB\r\n for (var i = 0; i < vertices.length; i++) {\r\n vertex = vertices[i];\r\n vertexToBody.x = vertex.x - bodyAPosition.x;\r\n vertexToBody.y = vertex.y - bodyAPosition.y;\r\n distance = -Vector.dot(normal, vertexToBody);\r\n\r\n if (distance < nearestDistance) {\r\n nearestDistance = distance;\r\n vertexA = vertex;\r\n }\r\n }\r\n\r\n // find next closest vertex using the two connected to it\r\n var prevIndex = vertexA.index - 1 >= 0 ? vertexA.index - 1 : vertices.length - 1;\r\n vertex = vertices[prevIndex];\r\n vertexToBody.x = vertex.x - bodyAPosition.x;\r\n vertexToBody.y = vertex.y - bodyAPosition.y;\r\n nearestDistance = -Vector.dot(normal, vertexToBody);\r\n vertexB = vertex;\r\n\r\n var nextIndex = (vertexA.index + 1) % vertices.length;\r\n vertex = vertices[nextIndex];\r\n vertexToBody.x = vertex.x - bodyAPosition.x;\r\n vertexToBody.y = vertex.y - bodyAPosition.y;\r\n distance = -Vector.dot(normal, vertexToBody);\r\n if (distance < nearestDistance) {\r\n vertexB = vertex;\r\n }\r\n\r\n return [vertexA, vertexB];\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/collision/SAT.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/constraint/Constraint.js": /*!********************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/constraint/Constraint.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Constraint` module contains methods for creating and manipulating constraints.\r\n* Constraints are used for specifying that a fixed distance must be maintained between two bodies (or a body and a fixed world-space position).\r\n* The stiffness of constraints can be modified to create springs or elastic.\r\n*\r\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\r\n*\r\n* @class Constraint\r\n*/\r\n\r\nvar Constraint = {};\r\n\r\nmodule.exports = Constraint;\r\n\r\nvar Vertices = __webpack_require__(/*! ../geometry/Vertices */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js\");\r\nvar Vector = __webpack_require__(/*! ../geometry/Vector */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vector.js\");\r\nvar Sleeping = __webpack_require__(/*! ../core/Sleeping */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Sleeping.js\");\r\nvar Bounds = __webpack_require__(/*! ../geometry/Bounds */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Bounds.js\");\r\nvar Axes = __webpack_require__(/*! ../geometry/Axes */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Axes.js\");\r\nvar Common = __webpack_require__(/*! ../core/Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\n\r\n(function() {\r\n\r\n Constraint._warming = 0.4;\r\n Constraint._torqueDampen = 1;\r\n Constraint._minLength = 0.000001;\r\n\r\n /**\r\n * Creates a new constraint.\r\n * All properties have default values, and many are pre-calculated automatically based on other properties.\r\n * To simulate a revolute constraint (or pin joint) set `length: 0` and a high `stiffness` value (e.g. `0.7` or above).\r\n * If the constraint is unstable, try lowering the `stiffness` value and / or increasing `engine.constraintIterations`.\r\n * For compound bodies, constraints must be applied to the parent body (not one of its parts).\r\n * See the properties section below for detailed information on what you can pass via the `options` object.\r\n * @method create\r\n * @param {} options\r\n * @return {constraint} constraint\r\n */\r\n Constraint.create = function(options) {\r\n var constraint = options;\r\n\r\n // if bodies defined but no points, use body centre\r\n if (constraint.bodyA && !constraint.pointA)\r\n constraint.pointA = { x: 0, y: 0 };\r\n if (constraint.bodyB && !constraint.pointB)\r\n constraint.pointB = { x: 0, y: 0 };\r\n\r\n // calculate static length using initial world space points\r\n var initialPointA = constraint.bodyA ? Vector.add(constraint.bodyA.position, constraint.pointA) : constraint.pointA,\r\n initialPointB = constraint.bodyB ? Vector.add(constraint.bodyB.position, constraint.pointB) : constraint.pointB,\r\n length = Vector.magnitude(Vector.sub(initialPointA, initialPointB));\r\n \r\n constraint.length = typeof constraint.length !== 'undefined' ? constraint.length : length;\r\n\r\n // option defaults\r\n constraint.id = constraint.id || Common.nextId();\r\n constraint.label = constraint.label || 'Constraint';\r\n constraint.type = 'constraint';\r\n constraint.stiffness = constraint.stiffness || (constraint.length > 0 ? 1 : 0.7);\r\n constraint.damping = constraint.damping || 0;\r\n constraint.angularStiffness = constraint.angularStiffness || 0;\r\n constraint.angleA = constraint.bodyA ? constraint.bodyA.angle : constraint.angleA;\r\n constraint.angleB = constraint.bodyB ? constraint.bodyB.angle : constraint.angleB;\r\n constraint.plugin = {};\r\n\r\n // render\r\n var render = {\r\n visible: true,\r\n type: 'line',\r\n anchors: true,\r\n lineColor: null, // custom Phaser property\r\n lineOpacity: null, // custom Phaser property\r\n lineThickness: null, // custom Phaser property\r\n pinSize: null, // custom Phaser property\r\n anchorColor: null, // custom Phaser property\r\n anchorSize: null // custom Phaser property\r\n };\r\n\r\n if (constraint.length === 0 && constraint.stiffness > 0.1) {\r\n render.type = 'pin';\r\n render.anchors = false;\r\n } else if (constraint.stiffness < 0.9) {\r\n render.type = 'spring';\r\n }\r\n\r\n constraint.render = Common.extend(render, constraint.render);\r\n\r\n return constraint;\r\n };\r\n\r\n /**\r\n * Prepares for solving by constraint warming.\r\n * @private\r\n * @method preSolveAll\r\n * @param {body[]} bodies\r\n */\r\n Constraint.preSolveAll = function(bodies) {\r\n for (var i = 0; i < bodies.length; i += 1) {\r\n var body = bodies[i],\r\n impulse = body.constraintImpulse;\r\n\r\n if (body.isStatic || (impulse.x === 0 && impulse.y === 0 && impulse.angle === 0)) {\r\n continue;\r\n }\r\n\r\n body.position.x += impulse.x;\r\n body.position.y += impulse.y;\r\n body.angle += impulse.angle;\r\n }\r\n };\r\n\r\n /**\r\n * Solves all constraints in a list of collisions.\r\n * @private\r\n * @method solveAll\r\n * @param {constraint[]} constraints\r\n * @param {number} timeScale\r\n */\r\n Constraint.solveAll = function(constraints, timeScale) {\r\n // Solve fixed constraints first.\r\n for (var i = 0; i < constraints.length; i += 1) {\r\n var constraint = constraints[i],\r\n fixedA = !constraint.bodyA || (constraint.bodyA && constraint.bodyA.isStatic),\r\n fixedB = !constraint.bodyB || (constraint.bodyB && constraint.bodyB.isStatic);\r\n\r\n if (fixedA || fixedB) {\r\n Constraint.solve(constraints[i], timeScale);\r\n }\r\n }\r\n\r\n // Solve free constraints last.\r\n for (i = 0; i < constraints.length; i += 1) {\r\n constraint = constraints[i];\r\n fixedA = !constraint.bodyA || (constraint.bodyA && constraint.bodyA.isStatic);\r\n fixedB = !constraint.bodyB || (constraint.bodyB && constraint.bodyB.isStatic);\r\n\r\n if (!fixedA && !fixedB) {\r\n Constraint.solve(constraints[i], timeScale);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Solves a distance constraint with Gauss-Siedel method.\r\n * @private\r\n * @method solve\r\n * @param {constraint} constraint\r\n * @param {number} timeScale\r\n */\r\n Constraint.solve = function(constraint, timeScale) {\r\n var bodyA = constraint.bodyA,\r\n bodyB = constraint.bodyB,\r\n pointA = constraint.pointA,\r\n pointB = constraint.pointB;\r\n\r\n if (!bodyA && !bodyB)\r\n return;\r\n\r\n // update reference angle\r\n if (bodyA && !bodyA.isStatic) {\r\n Vector.rotate(pointA, bodyA.angle - constraint.angleA, pointA);\r\n constraint.angleA = bodyA.angle;\r\n }\r\n \r\n // update reference angle\r\n if (bodyB && !bodyB.isStatic) {\r\n Vector.rotate(pointB, bodyB.angle - constraint.angleB, pointB);\r\n constraint.angleB = bodyB.angle;\r\n }\r\n\r\n var pointAWorld = pointA,\r\n pointBWorld = pointB;\r\n\r\n if (bodyA) pointAWorld = Vector.add(bodyA.position, pointA);\r\n if (bodyB) pointBWorld = Vector.add(bodyB.position, pointB);\r\n\r\n if (!pointAWorld || !pointBWorld)\r\n return;\r\n\r\n var delta = Vector.sub(pointAWorld, pointBWorld),\r\n currentLength = Vector.magnitude(delta);\r\n\r\n // prevent singularity\r\n if (currentLength < Constraint._minLength) {\r\n currentLength = Constraint._minLength;\r\n }\r\n\r\n // solve distance constraint with Gauss-Siedel method\r\n var difference = (currentLength - constraint.length) / currentLength,\r\n stiffness = constraint.stiffness < 1 ? constraint.stiffness * timeScale : constraint.stiffness,\r\n force = Vector.mult(delta, difference * stiffness),\r\n massTotal = (bodyA ? bodyA.inverseMass : 0) + (bodyB ? bodyB.inverseMass : 0),\r\n inertiaTotal = (bodyA ? bodyA.inverseInertia : 0) + (bodyB ? bodyB.inverseInertia : 0),\r\n resistanceTotal = massTotal + inertiaTotal,\r\n torque,\r\n share,\r\n normal,\r\n normalVelocity,\r\n relativeVelocity;\r\n\r\n if (constraint.damping) {\r\n var zero = Vector.create();\r\n normal = Vector.div(delta, currentLength);\r\n\r\n relativeVelocity = Vector.sub(\r\n bodyB && Vector.sub(bodyB.position, bodyB.positionPrev) || zero,\r\n bodyA && Vector.sub(bodyA.position, bodyA.positionPrev) || zero\r\n );\r\n\r\n normalVelocity = Vector.dot(normal, relativeVelocity);\r\n }\r\n\r\n if (bodyA && !bodyA.isStatic) {\r\n share = bodyA.inverseMass / massTotal;\r\n\r\n // keep track of applied impulses for post solving\r\n bodyA.constraintImpulse.x -= force.x * share;\r\n bodyA.constraintImpulse.y -= force.y * share;\r\n\r\n // apply forces\r\n bodyA.position.x -= force.x * share;\r\n bodyA.position.y -= force.y * share;\r\n\r\n // apply damping\r\n if (constraint.damping) {\r\n bodyA.positionPrev.x -= constraint.damping * normal.x * normalVelocity * share;\r\n bodyA.positionPrev.y -= constraint.damping * normal.y * normalVelocity * share;\r\n }\r\n\r\n // apply torque\r\n torque = (Vector.cross(pointA, force) / resistanceTotal) * Constraint._torqueDampen * bodyA.inverseInertia * (1 - constraint.angularStiffness);\r\n bodyA.constraintImpulse.angle -= torque;\r\n bodyA.angle -= torque;\r\n }\r\n\r\n if (bodyB && !bodyB.isStatic) {\r\n share = bodyB.inverseMass / massTotal;\r\n\r\n // keep track of applied impulses for post solving\r\n bodyB.constraintImpulse.x += force.x * share;\r\n bodyB.constraintImpulse.y += force.y * share;\r\n \r\n // apply forces\r\n bodyB.position.x += force.x * share;\r\n bodyB.position.y += force.y * share;\r\n\r\n // apply damping\r\n if (constraint.damping) {\r\n bodyB.positionPrev.x += constraint.damping * normal.x * normalVelocity * share;\r\n bodyB.positionPrev.y += constraint.damping * normal.y * normalVelocity * share;\r\n }\r\n\r\n // apply torque\r\n torque = (Vector.cross(pointB, force) / resistanceTotal) * Constraint._torqueDampen * bodyB.inverseInertia * (1 - constraint.angularStiffness);\r\n bodyB.constraintImpulse.angle += torque;\r\n bodyB.angle += torque;\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Performs body updates required after solving constraints.\r\n * @private\r\n * @method postSolveAll\r\n * @param {body[]} bodies\r\n */\r\n Constraint.postSolveAll = function(bodies) {\r\n for (var i = 0; i < bodies.length; i++) {\r\n var body = bodies[i],\r\n impulse = body.constraintImpulse;\r\n\r\n if (body.isStatic || (impulse.x === 0 && impulse.y === 0 && impulse.angle === 0)) {\r\n continue;\r\n }\r\n\r\n Sleeping.set(body, false);\r\n\r\n // update geometry and reset\r\n for (var j = 0; j < body.parts.length; j++) {\r\n var part = body.parts[j];\r\n \r\n Vertices.translate(part.vertices, impulse);\r\n\r\n if (j > 0) {\r\n part.position.x += impulse.x;\r\n part.position.y += impulse.y;\r\n }\r\n\r\n if (impulse.angle !== 0) {\r\n Vertices.rotate(part.vertices, impulse.angle, body.position);\r\n Axes.rotate(part.axes, impulse.angle);\r\n if (j > 0) {\r\n Vector.rotateAbout(part.position, impulse.angle, body.position, part.position);\r\n }\r\n }\r\n\r\n Bounds.update(part.bounds, part.vertices, body.velocity);\r\n }\r\n\r\n // dampen the cached impulse for warming next step\r\n impulse.angle *= Constraint._warming;\r\n impulse.x *= Constraint._warming;\r\n impulse.y *= Constraint._warming;\r\n }\r\n };\r\n\r\n /**\r\n * Returns the world-space position of `constraint.pointA`, accounting for `constraint.bodyA`.\r\n * @method pointAWorld\r\n * @param {constraint} constraint\r\n * @returns {vector} the world-space position\r\n */\r\n Constraint.pointAWorld = function(constraint) {\r\n return {\r\n x: (constraint.bodyA ? constraint.bodyA.position.x : 0) + constraint.pointA.x,\r\n y: (constraint.bodyA ? constraint.bodyA.position.y : 0) + constraint.pointA.y\r\n };\r\n };\r\n\r\n /**\r\n * Returns the world-space position of `constraint.pointB`, accounting for `constraint.bodyB`.\r\n * @method pointBWorld\r\n * @param {constraint} constraint\r\n * @returns {vector} the world-space position\r\n */\r\n Constraint.pointBWorld = function(constraint) {\r\n return {\r\n x: (constraint.bodyB ? constraint.bodyB.position.x : 0) + constraint.pointB.x,\r\n y: (constraint.bodyB ? constraint.bodyB.position.y : 0) + constraint.pointB.y\r\n };\r\n };\r\n\r\n /*\r\n *\r\n * Properties Documentation\r\n *\r\n */\r\n\r\n /**\r\n * An integer `Number` uniquely identifying number generated in `Composite.create` by `Common.nextId`.\r\n *\r\n * @property id\r\n * @type number\r\n */\r\n\r\n /**\r\n * A `String` denoting the type of object.\r\n *\r\n * @property type\r\n * @type string\r\n * @default \"constraint\"\r\n * @readOnly\r\n */\r\n\r\n /**\r\n * An arbitrary `String` name to help the user identify and manage bodies.\r\n *\r\n * @property label\r\n * @type string\r\n * @default \"Constraint\"\r\n */\r\n\r\n /**\r\n * An `Object` that defines the rendering properties to be consumed by the module `Matter.Render`.\r\n *\r\n * @property render\r\n * @type object\r\n */\r\n\r\n /**\r\n * A flag that indicates if the constraint should be rendered.\r\n *\r\n * @property render.visible\r\n * @type boolean\r\n * @default true\r\n */\r\n\r\n /**\r\n * A `Number` that defines the line width to use when rendering the constraint outline.\r\n * A value of `0` means no outline will be rendered.\r\n *\r\n * @property render.lineWidth\r\n * @type number\r\n * @default 2\r\n */\r\n\r\n /**\r\n * A `String` that defines the stroke style to use when rendering the constraint outline.\r\n * It is the same as when using a canvas, so it accepts CSS style property values.\r\n *\r\n * @property render.strokeStyle\r\n * @type string\r\n * @default a random colour\r\n */\r\n\r\n /**\r\n * A `String` that defines the constraint rendering type. \r\n * The possible values are 'line', 'pin', 'spring'.\r\n * An appropriate render type will be automatically chosen unless one is given in options.\r\n *\r\n * @property render.type\r\n * @type string\r\n * @default 'line'\r\n */\r\n\r\n /**\r\n * A `Boolean` that defines if the constraint's anchor points should be rendered.\r\n *\r\n * @property render.anchors\r\n * @type boolean\r\n * @default true\r\n */\r\n\r\n /**\r\n * The first possible `Body` that this constraint is attached to.\r\n *\r\n * @property bodyA\r\n * @type body\r\n * @default null\r\n */\r\n\r\n /**\r\n * The second possible `Body` that this constraint is attached to.\r\n *\r\n * @property bodyB\r\n * @type body\r\n * @default null\r\n */\r\n\r\n /**\r\n * A `Vector` that specifies the offset of the constraint from center of the `constraint.bodyA` if defined, otherwise a world-space position.\r\n *\r\n * @property pointA\r\n * @type vector\r\n * @default { x: 0, y: 0 }\r\n */\r\n\r\n /**\r\n * A `Vector` that specifies the offset of the constraint from center of the `constraint.bodyB` if defined, otherwise a world-space position.\r\n *\r\n * @property pointB\r\n * @type vector\r\n * @default { x: 0, y: 0 }\r\n */\r\n\r\n /**\r\n * A `Number` that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`.\r\n * A value of `1` means the constraint should be very stiff.\r\n * A value of `0.2` means the constraint acts like a soft spring.\r\n *\r\n * @property stiffness\r\n * @type number\r\n * @default 1\r\n */\r\n\r\n /**\r\n * A `Number` that specifies the damping of the constraint, \r\n * i.e. the amount of resistance applied to each body based on their velocities to limit the amount of oscillation.\r\n * Damping will only be apparent when the constraint also has a very low `stiffness`.\r\n * A value of `0.1` means the constraint will apply heavy damping, resulting in little to no oscillation.\r\n * A value of `0` means the constraint will apply no damping.\r\n *\r\n * @property damping\r\n * @type number\r\n * @default 0\r\n */\r\n\r\n /**\r\n * A `Number` that specifies the target resting length of the constraint. \r\n * It is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`.\r\n *\r\n * @property length\r\n * @type number\r\n */\r\n\r\n /**\r\n * An object reserved for storing plugin-specific properties.\r\n *\r\n * @property plugin\r\n * @type {}\r\n */\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/constraint/Constraint.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/core/Common.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/core/Common.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n* The `Matter.Common` module contains utility functions that are common to all modules.\r\n*\r\n* @class Common\r\n*/\r\n\r\nvar Common = {};\r\n\r\nmodule.exports = Common;\r\n\r\n(function() {\r\n\r\n Common._nextId = 0;\r\n Common._seed = 0;\r\n Common._nowStartTime = +(new Date());\r\n\r\n /**\r\n * Extends the object in the first argument using the object in the second argument.\r\n * @method extend\r\n * @param {} obj\r\n * @param {boolean} deep\r\n * @return {} obj extended\r\n */\r\n Common.extend = function(obj, deep) {\r\n var argsStart,\r\n args,\r\n deepClone;\r\n\r\n if (typeof deep === 'boolean') {\r\n argsStart = 2;\r\n deepClone = deep;\r\n } else {\r\n argsStart = 1;\r\n deepClone = true;\r\n }\r\n\r\n for (var i = argsStart; i < arguments.length; i++) {\r\n var source = arguments[i];\r\n\r\n if (source) {\r\n for (var prop in source) {\r\n if (deepClone && source[prop] && source[prop].constructor === Object) {\r\n if (!obj[prop] || obj[prop].constructor === Object) {\r\n obj[prop] = obj[prop] || {};\r\n Common.extend(obj[prop], deepClone, source[prop]);\r\n } else {\r\n obj[prop] = source[prop];\r\n }\r\n } else {\r\n obj[prop] = source[prop];\r\n }\r\n }\r\n }\r\n }\r\n \r\n return obj;\r\n };\r\n\r\n /**\r\n * Creates a new clone of the object, if deep is true references will also be cloned.\r\n * @method clone\r\n * @param {} obj\r\n * @param {bool} deep\r\n * @return {} obj cloned\r\n */\r\n Common.clone = function(obj, deep) {\r\n return Common.extend({}, deep, obj);\r\n };\r\n\r\n /**\r\n * Returns the list of keys for the given object.\r\n * @method keys\r\n * @param {} obj\r\n * @return {string[]} keys\r\n */\r\n Common.keys = function(obj) {\r\n if (Object.keys)\r\n return Object.keys(obj);\r\n\r\n // avoid hasOwnProperty for performance\r\n var keys = [];\r\n for (var key in obj)\r\n keys.push(key);\r\n return keys;\r\n };\r\n\r\n /**\r\n * Returns the list of values for the given object.\r\n * @method values\r\n * @param {} obj\r\n * @return {array} Array of the objects property values\r\n */\r\n Common.values = function(obj) {\r\n var values = [];\r\n \r\n if (Object.keys) {\r\n var keys = Object.keys(obj);\r\n for (var i = 0; i < keys.length; i++) {\r\n values.push(obj[keys[i]]);\r\n }\r\n return values;\r\n }\r\n \r\n // avoid hasOwnProperty for performance\r\n for (var key in obj)\r\n values.push(obj[key]);\r\n return values;\r\n };\r\n\r\n /**\r\n * Gets a value from `base` relative to the `path` string.\r\n * @method get\r\n * @param {} obj The base object\r\n * @param {string} path The path relative to `base`, e.g. 'Foo.Bar.baz'\r\n * @param {number} [begin] Path slice begin\r\n * @param {number} [end] Path slice end\r\n * @return {} The object at the given path\r\n */\r\n Common.get = function(obj, path, begin, end) {\r\n path = path.split('.').slice(begin, end);\r\n\r\n for (var i = 0; i < path.length; i += 1) {\r\n obj = obj[path[i]];\r\n }\r\n\r\n return obj;\r\n };\r\n\r\n /**\r\n * Sets a value on `base` relative to the given `path` string.\r\n * @method set\r\n * @param {} obj The base object\r\n * @param {string} path The path relative to `base`, e.g. 'Foo.Bar.baz'\r\n * @param {} val The value to set\r\n * @param {number} [begin] Path slice begin\r\n * @param {number} [end] Path slice end\r\n * @return {} Pass through `val` for chaining\r\n */\r\n Common.set = function(obj, path, val, begin, end) {\r\n var parts = path.split('.').slice(begin, end);\r\n Common.get(obj, path, 0, -1)[parts[parts.length - 1]] = val;\r\n return val;\r\n };\r\n\r\n /**\r\n * Shuffles the given array in-place.\r\n * The function uses a seeded random generator.\r\n * @method shuffle\r\n * @param {array} array\r\n * @return {array} array shuffled randomly\r\n */\r\n Common.shuffle = function(array) {\r\n for (var i = array.length - 1; i > 0; i--) {\r\n var j = Math.floor(Common.random() * (i + 1));\r\n var temp = array[i];\r\n array[i] = array[j];\r\n array[j] = temp;\r\n }\r\n return array;\r\n };\r\n\r\n /**\r\n * Randomly chooses a value from a list with equal probability.\r\n * The function uses a seeded random generator.\r\n * @method choose\r\n * @param {array} choices\r\n * @return {object} A random choice object from the array\r\n */\r\n Common.choose = function(choices) {\r\n return choices[Math.floor(Common.random() * choices.length)];\r\n };\r\n\r\n /**\r\n * Returns true if the object is a HTMLElement, otherwise false.\r\n * @method isElement\r\n * @param {object} obj\r\n * @return {boolean} True if the object is a HTMLElement, otherwise false\r\n */\r\n Common.isElement = function(obj) {\r\n if (typeof HTMLElement !== 'undefined') {\r\n return obj instanceof HTMLElement;\r\n }\r\n\r\n return !!(obj && obj.nodeType && obj.nodeName);\r\n };\r\n\r\n /**\r\n * Returns true if the object is an array.\r\n * @method isArray\r\n * @param {object} obj\r\n * @return {boolean} True if the object is an array, otherwise false\r\n */\r\n Common.isArray = function(obj) {\r\n return Object.prototype.toString.call(obj) === '[object Array]';\r\n };\r\n\r\n /**\r\n * Returns true if the object is a function.\r\n * @method isFunction\r\n * @param {object} obj\r\n * @return {boolean} True if the object is a function, otherwise false\r\n */\r\n Common.isFunction = function(obj) {\r\n return typeof obj === \"function\";\r\n };\r\n\r\n /**\r\n * Returns true if the object is a plain object.\r\n * @method isPlainObject\r\n * @param {object} obj\r\n * @return {boolean} True if the object is a plain object, otherwise false\r\n */\r\n Common.isPlainObject = function(obj) {\r\n return typeof obj === 'object' && obj.constructor === Object;\r\n };\r\n\r\n /**\r\n * Returns true if the object is a string.\r\n * @method isString\r\n * @param {object} obj\r\n * @return {boolean} True if the object is a string, otherwise false\r\n */\r\n Common.isString = function(obj) {\r\n return toString.call(obj) === '[object String]';\r\n };\r\n \r\n /**\r\n * Returns the given value clamped between a minimum and maximum value.\r\n * @method clamp\r\n * @param {number} value\r\n * @param {number} min\r\n * @param {number} max\r\n * @return {number} The value clamped between min and max inclusive\r\n */\r\n Common.clamp = function(value, min, max) {\r\n if (value < min)\r\n return min;\r\n if (value > max)\r\n return max;\r\n return value;\r\n };\r\n \r\n /**\r\n * Returns the sign of the given value.\r\n * @method sign\r\n * @param {number} value\r\n * @return {number} -1 if negative, +1 if 0 or positive\r\n */\r\n Common.sign = function(value) {\r\n return value < 0 ? -1 : 1;\r\n };\r\n \r\n /**\r\n * Returns the current timestamp since the time origin (e.g. from page load).\r\n * The result will be high-resolution including decimal places if available.\r\n * @method now\r\n * @return {number} the current timestamp\r\n */\r\n Common.now = function() {\r\n if (typeof window !== 'undefined' && window.performance) {\r\n if (window.performance.now) {\r\n return window.performance.now();\r\n } else if (window.performance.webkitNow) {\r\n return window.performance.webkitNow();\r\n }\r\n }\r\n\r\n return (new Date()) - Common._nowStartTime;\r\n };\r\n \r\n /**\r\n * Returns a random value between a minimum and a maximum value inclusive.\r\n * The function uses a seeded random generator.\r\n * @method random\r\n * @param {number} min\r\n * @param {number} max\r\n * @return {number} A random number between min and max inclusive\r\n */\r\n Common.random = function(min, max) {\r\n min = (typeof min !== \"undefined\") ? min : 0;\r\n max = (typeof max !== \"undefined\") ? max : 1;\r\n return min + _seededRandom() * (max - min);\r\n };\r\n\r\n var _seededRandom = function() {\r\n // https://en.wikipedia.org/wiki/Linear_congruential_generator\r\n Common._seed = (Common._seed * 9301 + 49297) % 233280;\r\n return Common._seed / 233280;\r\n };\r\n\r\n /**\r\n * Converts a CSS hex colour string into an integer.\r\n * @method colorToNumber\r\n * @param {string} colorString\r\n * @return {number} An integer representing the CSS hex string\r\n */\r\n Common.colorToNumber = function(colorString) {\r\n colorString = colorString.replace('#','');\r\n\r\n if (colorString.length == 3) {\r\n colorString = colorString.charAt(0) + colorString.charAt(0)\r\n + colorString.charAt(1) + colorString.charAt(1)\r\n + colorString.charAt(2) + colorString.charAt(2);\r\n }\r\n\r\n return parseInt(colorString, 16);\r\n };\r\n\r\n /**\r\n * The console logging level to use, where each level includes all levels above and excludes the levels below.\r\n * The default level is 'debug' which shows all console messages. \r\n *\r\n * Possible level values are:\r\n * - 0 = None\r\n * - 1 = Debug\r\n * - 2 = Info\r\n * - 3 = Warn\r\n * - 4 = Error\r\n * @property Common.logLevel\r\n * @type {Number}\r\n * @default 1\r\n */\r\n Common.logLevel = 1;\r\n\r\n /**\r\n * Shows a `console.log` message only if the current `Common.logLevel` allows it.\r\n * The message will be prefixed with 'matter-js' to make it easily identifiable.\r\n * @method log\r\n * @param ...objs {} The objects to log.\r\n */\r\n Common.log = function() {\r\n if (console && Common.logLevel > 0 && Common.logLevel <= 3) {\r\n console.log.apply(console, ['matter-js:'].concat(Array.prototype.slice.call(arguments)));\r\n }\r\n };\r\n\r\n /**\r\n * Shows a `console.info` message only if the current `Common.logLevel` allows it.\r\n * The message will be prefixed with 'matter-js' to make it easily identifiable.\r\n * @method info\r\n * @param ...objs {} The objects to log.\r\n */\r\n Common.info = function() {\r\n if (console && Common.logLevel > 0 && Common.logLevel <= 2) {\r\n console.info.apply(console, ['matter-js:'].concat(Array.prototype.slice.call(arguments)));\r\n }\r\n };\r\n\r\n /**\r\n * Shows a `console.warn` message only if the current `Common.logLevel` allows it.\r\n * The message will be prefixed with 'matter-js' to make it easily identifiable.\r\n * @method warn\r\n * @param ...objs {} The objects to log.\r\n */\r\n Common.warn = function() {\r\n if (console && Common.logLevel > 0 && Common.logLevel <= 3) {\r\n console.warn.apply(console, ['matter-js:'].concat(Array.prototype.slice.call(arguments)));\r\n }\r\n };\r\n\r\n /**\r\n * Returns the next unique sequential ID.\r\n * @method nextId\r\n * @return {Number} Unique sequential ID\r\n */\r\n Common.nextId = function() {\r\n return Common._nextId++;\r\n };\r\n\r\n /**\r\n * A cross browser compatible indexOf implementation.\r\n * @method indexOf\r\n * @param {array} haystack\r\n * @param {object} needle\r\n * @return {number} The position of needle in haystack, otherwise -1.\r\n */\r\n Common.indexOf = function(haystack, needle) {\r\n if (haystack.indexOf)\r\n return haystack.indexOf(needle);\r\n\r\n for (var i = 0; i < haystack.length; i++) {\r\n if (haystack[i] === needle)\r\n return i;\r\n }\r\n\r\n return -1;\r\n };\r\n\r\n /**\r\n * A cross browser compatible array map implementation.\r\n * @method map\r\n * @param {array} list\r\n * @param {function} func\r\n * @return {array} Values from list transformed by func.\r\n */\r\n Common.map = function(list, func) {\r\n if (list.map) {\r\n return list.map(func);\r\n }\r\n\r\n var mapped = [];\r\n\r\n for (var i = 0; i < list.length; i += 1) {\r\n mapped.push(func(list[i]));\r\n }\r\n\r\n return mapped;\r\n };\r\n\r\n /**\r\n * Takes a directed graph and returns the partially ordered set of vertices in topological order.\r\n * Circular dependencies are allowed.\r\n * @method topologicalSort\r\n * @param {object} graph\r\n * @return {array} Partially ordered set of vertices in topological order.\r\n */\r\n Common.topologicalSort = function(graph) {\r\n // https://github.com/mgechev/javascript-algorithms\r\n // Copyright (c) Minko Gechev (MIT license)\r\n // Modifications: tidy formatting and naming\r\n var result = [],\r\n visited = [],\r\n temp = [];\r\n\r\n for (var node in graph) {\r\n if (!visited[node] && !temp[node]) {\r\n Common._topologicalSort(node, visited, temp, graph, result);\r\n }\r\n }\r\n\r\n return result;\r\n };\r\n\r\n Common._topologicalSort = function(node, visited, temp, graph, result) {\r\n var neighbors = graph[node] || [];\r\n temp[node] = true;\r\n\r\n for (var i = 0; i < neighbors.length; i += 1) {\r\n var neighbor = neighbors[i];\r\n\r\n if (temp[neighbor]) {\r\n // skip circular dependencies\r\n continue;\r\n }\r\n\r\n if (!visited[neighbor]) {\r\n Common._topologicalSort(neighbor, visited, temp, graph, result);\r\n }\r\n }\r\n\r\n temp[node] = false;\r\n visited[node] = true;\r\n\r\n result.push(node);\r\n };\r\n\r\n /**\r\n * Takes _n_ functions as arguments and returns a new function that calls them in order.\r\n * The arguments applied when calling the new function will also be applied to every function passed.\r\n * The value of `this` refers to the last value returned in the chain that was not `undefined`.\r\n * Therefore if a passed function does not return a value, the previously returned value is maintained.\r\n * After all passed functions have been called the new function returns the last returned value (if any).\r\n * If any of the passed functions are a chain, then the chain will be flattened.\r\n * @method chain\r\n * @param ...funcs {function} The functions to chain.\r\n * @return {function} A new function that calls the passed functions in order.\r\n */\r\n Common.chain = function() {\r\n var funcs = [];\r\n\r\n for (var i = 0; i < arguments.length; i += 1) {\r\n var func = arguments[i];\r\n\r\n if (func._chained) {\r\n // flatten already chained functions\r\n funcs.push.apply(funcs, func._chained);\r\n } else {\r\n funcs.push(func);\r\n }\r\n }\r\n\r\n var chain = function() {\r\n // https://github.com/GoogleChrome/devtools-docs/issues/53#issuecomment-51941358\r\n var lastResult,\r\n args = new Array(arguments.length);\r\n\r\n for (var i = 0, l = arguments.length; i < l; i++) {\r\n args[i] = arguments[i];\r\n }\r\n\r\n for (i = 0; i < funcs.length; i += 1) {\r\n var result = funcs[i].apply(lastResult, args);\r\n\r\n if (typeof result !== 'undefined') {\r\n lastResult = result;\r\n }\r\n }\r\n\r\n return lastResult;\r\n };\r\n\r\n chain._chained = funcs;\r\n\r\n return chain;\r\n };\r\n\r\n /**\r\n * Chains a function to excute before the original function on the given `path` relative to `base`.\r\n * See also docs for `Common.chain`.\r\n * @method chainPathBefore\r\n * @param {} base The base object\r\n * @param {string} path The path relative to `base`\r\n * @param {function} func The function to chain before the original\r\n * @return {function} The chained function that replaced the original\r\n */\r\n Common.chainPathBefore = function(base, path, func) {\r\n return Common.set(base, path, Common.chain(\r\n func,\r\n Common.get(base, path)\r\n ));\r\n };\r\n\r\n /**\r\n * Chains a function to excute after the original function on the given `path` relative to `base`.\r\n * See also docs for `Common.chain`.\r\n * @method chainPathAfter\r\n * @param {} base The base object\r\n * @param {string} path The path relative to `base`\r\n * @param {function} func The function to chain after the original\r\n * @return {function} The chained function that replaced the original\r\n */\r\n Common.chainPathAfter = function(base, path, func) {\r\n return Common.set(base, path, Common.chain(\r\n Common.get(base, path),\r\n func\r\n ));\r\n };\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/core/Common.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/core/Engine.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/core/Engine.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Engine` module contains methods for creating and manipulating engines.\r\n* An engine is a controller that manages updating the simulation of the world.\r\n* See `Matter.Runner` for an optional game loop utility.\r\n*\r\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\r\n*\r\n* @class Engine\r\n*/\r\n\r\nvar Engine = {};\r\n\r\nmodule.exports = Engine;\r\n\r\nvar World = __webpack_require__(/*! ../body/World */ \"./node_modules/phaser/src/physics/matter-js/lib/body/World.js\");\r\nvar Sleeping = __webpack_require__(/*! ./Sleeping */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Sleeping.js\");\r\nvar Resolver = __webpack_require__(/*! ../collision/Resolver */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Resolver.js\");\r\nvar Pairs = __webpack_require__(/*! ../collision/Pairs */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Pairs.js\");\r\nvar Metrics = __webpack_require__(/*! ./Metrics */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Metrics.js\");\r\nvar Grid = __webpack_require__(/*! ../collision/Grid */ \"./node_modules/phaser/src/physics/matter-js/lib/collision/Grid.js\");\r\nvar Events = __webpack_require__(/*! ./Events */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Events.js\");\r\nvar Composite = __webpack_require__(/*! ../body/Composite */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Composite.js\");\r\nvar Constraint = __webpack_require__(/*! ../constraint/Constraint */ \"./node_modules/phaser/src/physics/matter-js/lib/constraint/Constraint.js\");\r\nvar Common = __webpack_require__(/*! ./Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\nvar Body = __webpack_require__(/*! ../body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\n\r\n(function() {\r\n\r\n /**\r\n * Creates a new engine. The options parameter is an object that specifies any properties you wish to override the defaults.\r\n * All properties have default values, and many are pre-calculated automatically based on other properties.\r\n * See the properties section below for detailed information on what you can pass via the `options` object.\r\n * @method create\r\n * @param {object} [options]\r\n * @return {engine} engine\r\n */\r\n Engine.create = function(element, options) {\r\n // options may be passed as the first (and only) argument\r\n options = Common.isElement(element) ? options : element;\r\n element = Common.isElement(element) ? element : null;\r\n options = options || {};\r\n\r\n if (element || options.render) {\r\n Common.warn('Engine.create: engine.render is deprecated (see docs)');\r\n }\r\n\r\n var defaults = {\r\n positionIterations: 6,\r\n velocityIterations: 4,\r\n constraintIterations: 2,\r\n enableSleeping: false,\r\n events: [],\r\n plugin: {},\r\n timing: {\r\n timestamp: 0,\r\n timeScale: 1\r\n },\r\n broadphase: {\r\n controller: Grid\r\n }\r\n };\r\n\r\n var engine = Common.extend(defaults, options);\r\n\r\n engine.world = options.world || World.create(engine.world);\r\n engine.pairs = Pairs.create();\r\n engine.broadphase = engine.broadphase.controller.create(engine.broadphase);\r\n engine.metrics = engine.metrics || { extended: false };\r\n\r\n // @if DEBUG\r\n engine.metrics = Metrics.create(engine.metrics);\r\n // @endif\r\n\r\n return engine;\r\n };\r\n\r\n /**\r\n * Moves the simulation forward in time by `delta` ms.\r\n * The `correction` argument is an optional `Number` that specifies the time correction factor to apply to the update.\r\n * This can help improve the accuracy of the simulation in cases where `delta` is changing between updates.\r\n * The value of `correction` is defined as `delta / lastDelta`, i.e. the percentage change of `delta` over the last step.\r\n * Therefore the value is always `1` (no correction) when `delta` constant (or when no correction is desired, which is the default).\r\n * See the paper on Time Corrected Verlet for more information.\r\n *\r\n * Triggers `beforeUpdate` and `afterUpdate` events.\r\n * Triggers `collisionStart`, `collisionActive` and `collisionEnd` events.\r\n * @method update\r\n * @param {engine} engine\r\n * @param {number} [delta=16.666]\r\n * @param {number} [correction=1]\r\n */\r\n Engine.update = function(engine, delta, correction) {\r\n delta = delta || 1000 / 60;\r\n correction = correction || 1;\r\n\r\n var world = engine.world,\r\n timing = engine.timing,\r\n broadphase = engine.broadphase,\r\n broadphasePairs = [],\r\n i;\r\n\r\n // increment timestamp\r\n timing.timestamp += delta * timing.timeScale;\r\n\r\n // create an event object\r\n var event = {\r\n timestamp: timing.timestamp\r\n };\r\n\r\n Events.trigger(engine, 'beforeUpdate', event);\r\n\r\n // get lists of all bodies and constraints, no matter what composites they are in\r\n var allBodies = Composite.allBodies(world),\r\n allConstraints = Composite.allConstraints(world);\r\n\r\n // @if DEBUG\r\n // reset metrics logging\r\n Metrics.reset(engine.metrics);\r\n // @endif\r\n\r\n // if sleeping enabled, call the sleeping controller\r\n if (engine.enableSleeping)\r\n Sleeping.update(allBodies, timing.timeScale);\r\n\r\n // applies gravity to all bodies\r\n Engine._bodiesApplyGravity(allBodies, world.gravity);\r\n\r\n // update all body position and rotation by integration\r\n Engine._bodiesUpdate(allBodies, delta, timing.timeScale, correction, world.bounds);\r\n\r\n // update all constraints (first pass)\r\n Constraint.preSolveAll(allBodies);\r\n for (i = 0; i < engine.constraintIterations; i++) {\r\n Constraint.solveAll(allConstraints, timing.timeScale);\r\n }\r\n Constraint.postSolveAll(allBodies);\r\n\r\n // broadphase pass: find potential collision pairs\r\n if (broadphase.controller) {\r\n // if world is dirty, we must flush the whole grid\r\n if (world.isModified)\r\n broadphase.controller.clear(broadphase);\r\n\r\n // update the grid buckets based on current bodies\r\n broadphase.controller.update(broadphase, allBodies, engine, world.isModified);\r\n broadphasePairs = broadphase.pairsList;\r\n } else {\r\n // if no broadphase set, we just pass all bodies\r\n broadphasePairs = allBodies;\r\n }\r\n\r\n // clear all composite modified flags\r\n if (world.isModified) {\r\n Composite.setModified(world, false, false, true);\r\n }\r\n\r\n // narrowphase pass: find actual collisions, then create or update collision pairs\r\n var collisions = broadphase.detector(broadphasePairs, engine);\r\n\r\n // update collision pairs\r\n var pairs = engine.pairs,\r\n timestamp = timing.timestamp;\r\n Pairs.update(pairs, collisions, timestamp);\r\n Pairs.removeOld(pairs, timestamp);\r\n\r\n // wake up bodies involved in collisions\r\n if (engine.enableSleeping)\r\n Sleeping.afterCollisions(pairs.list, timing.timeScale);\r\n\r\n // trigger collision events\r\n if (pairs.collisionStart.length > 0)\r\n Events.trigger(engine, 'collisionStart', { pairs: pairs.collisionStart });\r\n\r\n // iteratively resolve position between collisions\r\n Resolver.preSolvePosition(pairs.list);\r\n for (i = 0; i < engine.positionIterations; i++) {\r\n Resolver.solvePosition(pairs.list, allBodies, timing.timeScale);\r\n }\r\n Resolver.postSolvePosition(allBodies);\r\n\r\n // update all constraints (second pass)\r\n Constraint.preSolveAll(allBodies);\r\n for (i = 0; i < engine.constraintIterations; i++) {\r\n Constraint.solveAll(allConstraints, timing.timeScale);\r\n }\r\n Constraint.postSolveAll(allBodies);\r\n\r\n // iteratively resolve velocity between collisions\r\n Resolver.preSolveVelocity(pairs.list);\r\n for (i = 0; i < engine.velocityIterations; i++) {\r\n Resolver.solveVelocity(pairs.list, timing.timeScale);\r\n }\r\n\r\n // trigger collision events\r\n if (pairs.collisionActive.length > 0)\r\n Events.trigger(engine, 'collisionActive', { pairs: pairs.collisionActive });\r\n\r\n if (pairs.collisionEnd.length > 0)\r\n Events.trigger(engine, 'collisionEnd', { pairs: pairs.collisionEnd });\r\n\r\n // @if DEBUG\r\n // update metrics log\r\n Metrics.update(engine.metrics, engine);\r\n // @endif\r\n\r\n // clear force buffers\r\n Engine._bodiesClearForces(allBodies);\r\n\r\n Events.trigger(engine, 'afterUpdate', event);\r\n\r\n return engine;\r\n };\r\n \r\n /**\r\n * Merges two engines by keeping the configuration of `engineA` but replacing the world with the one from `engineB`.\r\n * @method merge\r\n * @param {engine} engineA\r\n * @param {engine} engineB\r\n */\r\n Engine.merge = function(engineA, engineB) {\r\n Common.extend(engineA, engineB);\r\n \r\n if (engineB.world) {\r\n engineA.world = engineB.world;\r\n\r\n Engine.clear(engineA);\r\n\r\n var bodies = Composite.allBodies(engineA.world);\r\n\r\n for (var i = 0; i < bodies.length; i++) {\r\n var body = bodies[i];\r\n Sleeping.set(body, false);\r\n body.id = Common.nextId();\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Clears the engine including the world, pairs and broadphase.\r\n * @method clear\r\n * @param {engine} engine\r\n */\r\n Engine.clear = function(engine) {\r\n var world = engine.world;\r\n \r\n Pairs.clear(engine.pairs);\r\n\r\n var broadphase = engine.broadphase;\r\n if (broadphase.controller) {\r\n var bodies = Composite.allBodies(world);\r\n broadphase.controller.clear(broadphase);\r\n broadphase.controller.update(broadphase, bodies, engine, true);\r\n }\r\n };\r\n\r\n /**\r\n * Zeroes the `body.force` and `body.torque` force buffers.\r\n * @method _bodiesClearForces\r\n * @private\r\n * @param {body[]} bodies\r\n */\r\n Engine._bodiesClearForces = function(bodies) {\r\n for (var i = 0; i < bodies.length; i++) {\r\n var body = bodies[i];\r\n\r\n // reset force buffers\r\n body.force.x = 0;\r\n body.force.y = 0;\r\n body.torque = 0;\r\n }\r\n };\r\n\r\n /**\r\n * Applys a mass dependant force to all given bodies.\r\n * @method _bodiesApplyGravity\r\n * @private\r\n * @param {body[]} bodies\r\n * @param {vector} gravity\r\n */\r\n Engine._bodiesApplyGravity = function(bodies, gravity) {\r\n var gravityScale = typeof gravity.scale !== 'undefined' ? gravity.scale : 0.001;\r\n\r\n if ((gravity.x === 0 && gravity.y === 0) || gravityScale === 0) {\r\n return;\r\n }\r\n \r\n for (var i = 0; i < bodies.length; i++) {\r\n var body = bodies[i];\r\n\r\n if (body.ignoreGravity || body.isStatic || body.isSleeping)\r\n continue;\r\n\r\n // apply gravity\r\n body.force.x += (body.mass * gravity.x * gravityScale) * body.gravityScale.x;\r\n body.force.y += (body.mass * gravity.y * gravityScale) * body.gravityScale.y;\r\n }\r\n };\r\n\r\n /**\r\n * Applys `Body.update` to all given `bodies`.\r\n * @method _bodiesUpdate\r\n * @private\r\n * @param {body[]} bodies\r\n * @param {number} deltaTime \r\n * The amount of time elapsed between updates\r\n * @param {number} timeScale\r\n * @param {number} correction \r\n * The Verlet correction factor (deltaTime / lastDeltaTime)\r\n * @param {bounds} worldBounds\r\n */\r\n Engine._bodiesUpdate = function(bodies, deltaTime, timeScale, correction, worldBounds) {\r\n for (var i = 0; i < bodies.length; i++) {\r\n var body = bodies[i];\r\n\r\n if (body.isStatic || body.isSleeping)\r\n continue;\r\n\r\n Body.update(body, deltaTime, timeScale, correction);\r\n }\r\n };\r\n\r\n /**\r\n * An alias for `Runner.run`, see `Matter.Runner` for more information.\r\n * @method run\r\n * @param {engine} engine\r\n */\r\n\r\n /**\r\n * Fired just before an update\r\n *\r\n * @event beforeUpdate\r\n * @param {} event An event object\r\n * @param {number} event.timestamp The engine.timing.timestamp of the event\r\n * @param {} event.source The source object of the event\r\n * @param {} event.name The name of the event\r\n */\r\n\r\n /**\r\n * Fired after engine update and all collision events\r\n *\r\n * @event afterUpdate\r\n * @param {} event An event object\r\n * @param {number} event.timestamp The engine.timing.timestamp of the event\r\n * @param {} event.source The source object of the event\r\n * @param {} event.name The name of the event\r\n */\r\n\r\n /**\r\n * Fired after engine update, provides a list of all pairs that have started to collide in the current tick (if any)\r\n *\r\n * @event collisionStart\r\n * @param {} event An event object\r\n * @param {} event.pairs List of affected pairs\r\n * @param {number} event.timestamp The engine.timing.timestamp of the event\r\n * @param {} event.source The source object of the event\r\n * @param {} event.name The name of the event\r\n */\r\n\r\n /**\r\n * Fired after engine update, provides a list of all pairs that are colliding in the current tick (if any)\r\n *\r\n * @event collisionActive\r\n * @param {} event An event object\r\n * @param {} event.pairs List of affected pairs\r\n * @param {number} event.timestamp The engine.timing.timestamp of the event\r\n * @param {} event.source The source object of the event\r\n * @param {} event.name The name of the event\r\n */\r\n\r\n /**\r\n * Fired after engine update, provides a list of all pairs that have ended collision in the current tick (if any)\r\n *\r\n * @event collisionEnd\r\n * @param {} event An event object\r\n * @param {} event.pairs List of affected pairs\r\n * @param {number} event.timestamp The engine.timing.timestamp of the event\r\n * @param {} event.source The source object of the event\r\n * @param {} event.name The name of the event\r\n */\r\n\r\n /*\r\n *\r\n * Properties Documentation\r\n *\r\n */\r\n\r\n /**\r\n * An integer `Number` that specifies the number of position iterations to perform each update.\r\n * The higher the value, the higher quality the simulation will be at the expense of performance.\r\n *\r\n * @property positionIterations\r\n * @type number\r\n * @default 6\r\n */\r\n\r\n /**\r\n * An integer `Number` that specifies the number of velocity iterations to perform each update.\r\n * The higher the value, the higher quality the simulation will be at the expense of performance.\r\n *\r\n * @property velocityIterations\r\n * @type number\r\n * @default 4\r\n */\r\n\r\n /**\r\n * An integer `Number` that specifies the number of constraint iterations to perform each update.\r\n * The higher the value, the higher quality the simulation will be at the expense of performance.\r\n * The default value of `2` is usually very adequate.\r\n *\r\n * @property constraintIterations\r\n * @type number\r\n * @default 2\r\n */\r\n\r\n /**\r\n * A flag that specifies whether the engine should allow sleeping via the `Matter.Sleeping` module.\r\n * Sleeping can improve stability and performance, but often at the expense of accuracy.\r\n *\r\n * @property enableSleeping\r\n * @type boolean\r\n * @default false\r\n */\r\n\r\n /**\r\n * An `Object` containing properties regarding the timing systems of the engine. \r\n *\r\n * @property timing\r\n * @type object\r\n */\r\n\r\n /**\r\n * A `Number` that specifies the global scaling factor of time for all bodies.\r\n * A value of `0` freezes the simulation.\r\n * A value of `0.1` gives a slow-motion effect.\r\n * A value of `1.2` gives a speed-up effect.\r\n *\r\n * @property timing.timeScale\r\n * @type number\r\n * @default 1\r\n */\r\n\r\n /**\r\n * A `Number` that specifies the current simulation-time in milliseconds starting from `0`. \r\n * It is incremented on every `Engine.update` by the given `delta` argument. \r\n *\r\n * @property timing.timestamp\r\n * @type number\r\n * @default 0\r\n */\r\n\r\n /**\r\n * An instance of a `Render` controller. The default value is a `Matter.Render` instance created by `Engine.create`.\r\n * One may also develop a custom renderer module based on `Matter.Render` and pass an instance of it to `Engine.create` via `options.render`.\r\n *\r\n * A minimal custom renderer object must define at least three functions: `create`, `clear` and `world` (see `Matter.Render`).\r\n * It is also possible to instead pass the _module_ reference via `options.render.controller` and `Engine.create` will instantiate one for you.\r\n *\r\n * @property render\r\n * @type render\r\n * @deprecated see Demo.js for an example of creating a renderer\r\n * @default a Matter.Render instance\r\n */\r\n\r\n /**\r\n * An instance of a broadphase controller. The default value is a `Matter.Grid` instance created by `Engine.create`.\r\n *\r\n * @property broadphase\r\n * @type grid\r\n * @default a Matter.Grid instance\r\n */\r\n\r\n /**\r\n * A `World` composite object that will contain all simulated bodies and constraints.\r\n *\r\n * @property world\r\n * @type world\r\n * @default a Matter.World instance\r\n */\r\n\r\n /**\r\n * An object reserved for storing plugin-specific properties.\r\n *\r\n * @property plugin\r\n * @type {}\r\n */\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/core/Engine.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/core/Events.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/core/Events.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Events` module contains methods to fire and listen to events on other objects.\r\n*\r\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\r\n*\r\n* @class Events\r\n*/\r\n\r\nvar Events = {};\r\n\r\nmodule.exports = Events;\r\n\r\nvar Common = __webpack_require__(/*! ./Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\n\r\n(function() {\r\n\r\n /**\r\n * Subscribes a callback function to the given object's `eventName`.\r\n * @method on\r\n * @param {} object\r\n * @param {string} eventNames\r\n * @param {function} callback\r\n */\r\n Events.on = function(object, eventNames, callback) {\r\n var names = eventNames.split(' '),\r\n name;\r\n\r\n for (var i = 0; i < names.length; i++) {\r\n name = names[i];\r\n object.events = object.events || {};\r\n object.events[name] = object.events[name] || [];\r\n object.events[name].push(callback);\r\n }\r\n\r\n return callback;\r\n };\r\n\r\n /**\r\n * Removes the given event callback. If no callback, clears all callbacks in `eventNames`. If no `eventNames`, clears all events.\r\n * @method off\r\n * @param {} object\r\n * @param {string} eventNames\r\n * @param {function} callback\r\n */\r\n Events.off = function(object, eventNames, callback) {\r\n if (!eventNames) {\r\n object.events = {};\r\n return;\r\n }\r\n\r\n // handle Events.off(object, callback)\r\n if (typeof eventNames === 'function') {\r\n callback = eventNames;\r\n eventNames = Common.keys(object.events).join(' ');\r\n }\r\n\r\n var names = eventNames.split(' ');\r\n\r\n for (var i = 0; i < names.length; i++) {\r\n var callbacks = object.events[names[i]],\r\n newCallbacks = [];\r\n\r\n if (callback && callbacks) {\r\n for (var j = 0; j < callbacks.length; j++) {\r\n if (callbacks[j] !== callback)\r\n newCallbacks.push(callbacks[j]);\r\n }\r\n }\r\n\r\n object.events[names[i]] = newCallbacks;\r\n }\r\n };\r\n\r\n /**\r\n * Fires all the callbacks subscribed to the given object's `eventName`, in the order they subscribed, if any.\r\n * @method trigger\r\n * @param {} object\r\n * @param {string} eventNames\r\n * @param {} event\r\n */\r\n Events.trigger = function(object, eventNames, event) {\r\n var names,\r\n name,\r\n callbacks,\r\n eventClone;\r\n\r\n var events = object.events;\r\n \r\n if (events && Common.keys(events).length > 0) {\r\n if (!event)\r\n event = {};\r\n\r\n names = eventNames.split(' ');\r\n\r\n for (var i = 0; i < names.length; i++) {\r\n name = names[i];\r\n callbacks = events[name];\r\n\r\n if (callbacks) {\r\n eventClone = Common.clone(event, false);\r\n eventClone.name = name;\r\n eventClone.source = object;\r\n\r\n for (var j = 0; j < callbacks.length; j++) {\r\n callbacks[j].apply(object, [eventClone]);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/core/Events.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/core/Matter.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/core/Matter.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter` module is the top level namespace. It also includes a function for installing plugins on top of the library.\r\n*\r\n* @class Matter\r\n*/\r\n\r\nvar Matter = {};\r\n\r\nmodule.exports = Matter;\r\n\r\nvar Plugin = __webpack_require__(/*! ./Plugin */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Plugin.js\");\r\nvar Common = __webpack_require__(/*! ./Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\n\r\n(function() {\r\n\r\n /**\r\n * The library name.\r\n * @property name\r\n * @readOnly\r\n * @type {String}\r\n */\r\n Matter.name = 'matter-js';\r\n\r\n /**\r\n * The library version.\r\n * @property version\r\n * @readOnly\r\n * @type {String}\r\n */\r\n Matter.version = '0.14.2';\r\n\r\n /**\r\n * A list of plugin dependencies to be installed. These are normally set and installed through `Matter.use`.\r\n * Alternatively you may set `Matter.uses` manually and install them by calling `Plugin.use(Matter)`.\r\n * @property uses\r\n * @type {Array}\r\n */\r\n Matter.uses = [];\r\n\r\n /**\r\n * The plugins that have been installed through `Matter.Plugin.install`. Read only.\r\n * @property used\r\n * @readOnly\r\n * @type {Array}\r\n */\r\n Matter.used = [];\r\n\r\n /**\r\n * Installs the given plugins on the `Matter` namespace.\r\n * This is a short-hand for `Plugin.use`, see it for more information.\r\n * Call this function once at the start of your code, with all of the plugins you wish to install as arguments.\r\n * Avoid calling this function multiple times unless you intend to manually control installation order.\r\n * @method use\r\n * @param ...plugin {Function} The plugin(s) to install on `base` (multi-argument).\r\n */\r\n Matter.use = function() {\r\n Plugin.use(Matter, Array.prototype.slice.call(arguments));\r\n };\r\n\r\n /**\r\n * Chains a function to excute before the original function on the given `path` relative to `Matter`.\r\n * See also docs for `Common.chain`.\r\n * @method before\r\n * @param {string} path The path relative to `Matter`\r\n * @param {function} func The function to chain before the original\r\n * @return {function} The chained function that replaced the original\r\n */\r\n Matter.before = function(path, func) {\r\n path = path.replace(/^Matter./, '');\r\n return Common.chainPathBefore(Matter, path, func);\r\n };\r\n\r\n /**\r\n * Chains a function to excute after the original function on the given `path` relative to `Matter`.\r\n * See also docs for `Common.chain`.\r\n * @method after\r\n * @param {string} path The path relative to `Matter`\r\n * @param {function} func The function to chain after the original\r\n * @return {function} The chained function that replaced the original\r\n */\r\n Matter.after = function(path, func) {\r\n path = path.replace(/^Matter./, '');\r\n return Common.chainPathAfter(Matter, path, func);\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/core/Matter.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/core/Metrics.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/core/Metrics.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("// @if DEBUG\r\n/**\r\n* _Internal Class_, not generally used outside of the engine's internals.\r\n*\r\n*/\r\n\r\nvar Metrics = {};\r\n\r\nmodule.exports = Metrics;\r\n\r\nvar Composite = __webpack_require__(/*! ../body/Composite */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Composite.js\");\r\nvar Common = __webpack_require__(/*! ./Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\n\r\n(function() {\r\n\r\n /**\r\n * Creates a new metrics.\r\n * @method create\r\n * @private\r\n * @return {metrics} A new metrics\r\n */\r\n Metrics.create = function(options) {\r\n var defaults = {\r\n extended: false,\r\n narrowDetections: 0,\r\n narrowphaseTests: 0,\r\n narrowReuse: 0,\r\n narrowReuseCount: 0,\r\n midphaseTests: 0,\r\n broadphaseTests: 0,\r\n narrowEff: 0.0001,\r\n midEff: 0.0001,\r\n broadEff: 0.0001,\r\n collisions: 0,\r\n buckets: 0,\r\n bodies: 0,\r\n pairs: 0\r\n };\r\n\r\n return Common.extend(defaults, false, options);\r\n };\r\n\r\n /**\r\n * Resets metrics.\r\n * @method reset\r\n * @private\r\n * @param {metrics} metrics\r\n */\r\n Metrics.reset = function(metrics) {\r\n if (metrics.extended) {\r\n metrics.narrowDetections = 0;\r\n metrics.narrowphaseTests = 0;\r\n metrics.narrowReuse = 0;\r\n metrics.narrowReuseCount = 0;\r\n metrics.midphaseTests = 0;\r\n metrics.broadphaseTests = 0;\r\n metrics.narrowEff = 0;\r\n metrics.midEff = 0;\r\n metrics.broadEff = 0;\r\n metrics.collisions = 0;\r\n metrics.buckets = 0;\r\n metrics.pairs = 0;\r\n metrics.bodies = 0;\r\n }\r\n };\r\n\r\n /**\r\n * Updates metrics.\r\n * @method update\r\n * @private\r\n * @param {metrics} metrics\r\n * @param {engine} engine\r\n */\r\n Metrics.update = function(metrics, engine) {\r\n if (metrics.extended) {\r\n var world = engine.world,\r\n bodies = Composite.allBodies(world);\r\n\r\n metrics.collisions = metrics.narrowDetections;\r\n metrics.pairs = engine.pairs.list.length;\r\n metrics.bodies = bodies.length;\r\n metrics.midEff = (metrics.narrowDetections / (metrics.midphaseTests || 1)).toFixed(2);\r\n metrics.narrowEff = (metrics.narrowDetections / (metrics.narrowphaseTests || 1)).toFixed(2);\r\n metrics.broadEff = (1 - (metrics.broadphaseTests / (bodies.length || 1))).toFixed(2);\r\n metrics.narrowReuse = (metrics.narrowReuseCount / (metrics.narrowphaseTests || 1)).toFixed(2);\r\n //var broadphase = engine.broadphase[engine.broadphase.current];\r\n //if (broadphase.instance)\r\n // metrics.buckets = Common.keys(broadphase.instance.buckets).length;\r\n }\r\n };\r\n\r\n})();\r\n// @endif\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/core/Metrics.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/core/Plugin.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/core/Plugin.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Plugin` module contains functions for registering and installing plugins on modules.\r\n*\r\n* @class Plugin\r\n*/\r\n\r\nvar Plugin = {};\r\n\r\nmodule.exports = Plugin;\r\n\r\nvar Common = __webpack_require__(/*! ./Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\n\r\n(function() {\r\n\r\n Plugin._registry = {};\r\n\r\n /**\r\n * Registers a plugin object so it can be resolved later by name.\r\n * @method register\r\n * @param plugin {} The plugin to register.\r\n * @return {object} The plugin.\r\n */\r\n Plugin.register = function(plugin) {\r\n if (!Plugin.isPlugin(plugin)) {\r\n Common.warn('Plugin.register:', Plugin.toString(plugin), 'does not implement all required fields.');\r\n }\r\n\r\n if (plugin.name in Plugin._registry) {\r\n var registered = Plugin._registry[plugin.name],\r\n pluginVersion = Plugin.versionParse(plugin.version).number,\r\n registeredVersion = Plugin.versionParse(registered.version).number;\r\n\r\n if (pluginVersion > registeredVersion) {\r\n Common.warn('Plugin.register:', Plugin.toString(registered), 'was upgraded to', Plugin.toString(plugin));\r\n Plugin._registry[plugin.name] = plugin;\r\n } else if (pluginVersion < registeredVersion) {\r\n Common.warn('Plugin.register:', Plugin.toString(registered), 'can not be downgraded to', Plugin.toString(plugin));\r\n } else if (plugin !== registered) {\r\n Common.warn('Plugin.register:', Plugin.toString(plugin), 'is already registered to different plugin object');\r\n }\r\n } else {\r\n Plugin._registry[plugin.name] = plugin;\r\n }\r\n\r\n return plugin;\r\n };\r\n\r\n /**\r\n * Resolves a dependency to a plugin object from the registry if it exists. \r\n * The `dependency` may contain a version, but only the name matters when resolving.\r\n * @method resolve\r\n * @param dependency {string} The dependency.\r\n * @return {object} The plugin if resolved, otherwise `undefined`.\r\n */\r\n Plugin.resolve = function(dependency) {\r\n return Plugin._registry[Plugin.dependencyParse(dependency).name];\r\n };\r\n\r\n /**\r\n * Returns a pretty printed plugin name and version.\r\n * @method toString\r\n * @param plugin {} The plugin.\r\n * @return {string} Pretty printed plugin name and version.\r\n */\r\n Plugin.toString = function(plugin) {\r\n return typeof plugin === 'string' ? plugin : (plugin.name || 'anonymous') + '@' + (plugin.version || plugin.range || '0.0.0');\r\n };\r\n\r\n /**\r\n * Returns `true` if the object meets the minimum standard to be considered a plugin.\r\n * This means it must define the following properties:\r\n * - `name`\r\n * - `version`\r\n * - `install`\r\n * @method isPlugin\r\n * @param obj {} The obj to test.\r\n * @return {boolean} `true` if the object can be considered a plugin otherwise `false`.\r\n */\r\n Plugin.isPlugin = function(obj) {\r\n return obj && obj.name && obj.version && obj.install;\r\n };\r\n\r\n /**\r\n * Returns `true` if a plugin with the given `name` been installed on `module`.\r\n * @method isUsed\r\n * @param module {} The module.\r\n * @param name {string} The plugin name.\r\n * @return {boolean} `true` if a plugin with the given `name` been installed on `module`, otherwise `false`.\r\n */\r\n Plugin.isUsed = function(module, name) {\r\n return module.used.indexOf(name) > -1;\r\n };\r\n\r\n /**\r\n * Returns `true` if `plugin.for` is applicable to `module` by comparing against `module.name` and `module.version`.\r\n * If `plugin.for` is not specified then it is assumed to be applicable.\r\n * The value of `plugin.for` is a string of the format `'module-name'` or `'module-name@version'`.\r\n * @method isFor\r\n * @param plugin {} The plugin.\r\n * @param module {} The module.\r\n * @return {boolean} `true` if `plugin.for` is applicable to `module`, otherwise `false`.\r\n */\r\n Plugin.isFor = function(plugin, module) {\r\n var parsed = plugin.for && Plugin.dependencyParse(plugin.for);\r\n return !plugin.for || (module.name === parsed.name && Plugin.versionSatisfies(module.version, parsed.range));\r\n };\r\n\r\n /**\r\n * Installs the plugins by calling `plugin.install` on each plugin specified in `plugins` if passed, otherwise `module.uses`.\r\n * For installing plugins on `Matter` see the convenience function `Matter.use`.\r\n * Plugins may be specified either by their name or a reference to the plugin object.\r\n * Plugins themselves may specify further dependencies, but each plugin is installed only once.\r\n * Order is important, a topological sort is performed to find the best resulting order of installation.\r\n * This sorting attempts to satisfy every dependency's requested ordering, but may not be exact in all cases.\r\n * This function logs the resulting status of each dependency in the console, along with any warnings.\r\n * - A green tick ✅ indicates a dependency was resolved and installed.\r\n * - An orange diamond 🔶 indicates a dependency was resolved but a warning was thrown for it or one if its dependencies.\r\n * - A red cross ❌ indicates a dependency could not be resolved.\r\n * Avoid calling this function multiple times on the same module unless you intend to manually control installation order.\r\n * @method use\r\n * @param module {} The module install plugins on.\r\n * @param [plugins=module.uses] {} The plugins to install on module (optional, defaults to `module.uses`).\r\n */\r\n Plugin.use = function(module, plugins) {\r\n module.uses = (module.uses || []).concat(plugins || []);\r\n\r\n if (module.uses.length === 0) {\r\n Common.warn('Plugin.use:', Plugin.toString(module), 'does not specify any dependencies to install.');\r\n return;\r\n }\r\n\r\n var dependencies = Plugin.dependencies(module),\r\n sortedDependencies = Common.topologicalSort(dependencies),\r\n status = [];\r\n\r\n for (var i = 0; i < sortedDependencies.length; i += 1) {\r\n if (sortedDependencies[i] === module.name) {\r\n continue;\r\n }\r\n\r\n var plugin = Plugin.resolve(sortedDependencies[i]);\r\n\r\n if (!plugin) {\r\n status.push('❌ ' + sortedDependencies[i]);\r\n continue;\r\n }\r\n\r\n if (Plugin.isUsed(module, plugin.name)) {\r\n continue;\r\n }\r\n\r\n if (!Plugin.isFor(plugin, module)) {\r\n Common.warn('Plugin.use:', Plugin.toString(plugin), 'is for', plugin.for, 'but installed on', Plugin.toString(module) + '.');\r\n plugin._warned = true;\r\n }\r\n\r\n if (plugin.install) {\r\n plugin.install(module);\r\n } else {\r\n Common.warn('Plugin.use:', Plugin.toString(plugin), 'does not specify an install function.');\r\n plugin._warned = true;\r\n }\r\n\r\n if (plugin._warned) {\r\n status.push('🔶 ' + Plugin.toString(plugin));\r\n delete plugin._warned;\r\n } else {\r\n status.push('✅ ' + Plugin.toString(plugin));\r\n }\r\n\r\n module.used.push(plugin.name);\r\n }\r\n\r\n if (status.length > 0 && !plugin.silent) {\r\n Common.info(status.join(' '));\r\n }\r\n };\r\n\r\n /**\r\n * Recursively finds all of a module's dependencies and returns a flat dependency graph.\r\n * @method dependencies\r\n * @param module {} The module.\r\n * @return {object} A dependency graph.\r\n */\r\n Plugin.dependencies = function(module, tracked) {\r\n var parsedBase = Plugin.dependencyParse(module),\r\n name = parsedBase.name;\r\n\r\n tracked = tracked || {};\r\n\r\n if (name in tracked) {\r\n return;\r\n }\r\n\r\n module = Plugin.resolve(module) || module;\r\n\r\n tracked[name] = Common.map(module.uses || [], function(dependency) {\r\n if (Plugin.isPlugin(dependency)) {\r\n Plugin.register(dependency);\r\n }\r\n\r\n var parsed = Plugin.dependencyParse(dependency),\r\n resolved = Plugin.resolve(dependency);\r\n\r\n if (resolved && !Plugin.versionSatisfies(resolved.version, parsed.range)) {\r\n Common.warn(\r\n 'Plugin.dependencies:', Plugin.toString(resolved), 'does not satisfy',\r\n Plugin.toString(parsed), 'used by', Plugin.toString(parsedBase) + '.'\r\n );\r\n\r\n resolved._warned = true;\r\n module._warned = true;\r\n } else if (!resolved) {\r\n Common.warn(\r\n 'Plugin.dependencies:', Plugin.toString(dependency), 'used by',\r\n Plugin.toString(parsedBase), 'could not be resolved.'\r\n );\r\n\r\n module._warned = true;\r\n }\r\n\r\n return parsed.name;\r\n });\r\n\r\n for (var i = 0; i < tracked[name].length; i += 1) {\r\n Plugin.dependencies(tracked[name][i], tracked);\r\n }\r\n\r\n return tracked;\r\n };\r\n\r\n /**\r\n * Parses a dependency string into its components.\r\n * The `dependency` is a string of the format `'module-name'` or `'module-name@version'`.\r\n * See documentation for `Plugin.versionParse` for a description of the format.\r\n * This function can also handle dependencies that are already resolved (e.g. a module object).\r\n * @method dependencyParse\r\n * @param dependency {string} The dependency of the format `'module-name'` or `'module-name@version'`.\r\n * @return {object} The dependency parsed into its components.\r\n */\r\n Plugin.dependencyParse = function(dependency) {\r\n if (Common.isString(dependency)) {\r\n var pattern = /^[\\w-]+(@(\\*|[\\^~]?\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z-]+)?))?$/;\r\n\r\n if (!pattern.test(dependency)) {\r\n Common.warn('Plugin.dependencyParse:', dependency, 'is not a valid dependency string.');\r\n }\r\n\r\n return {\r\n name: dependency.split('@')[0],\r\n range: dependency.split('@')[1] || '*'\r\n };\r\n }\r\n\r\n return {\r\n name: dependency.name,\r\n range: dependency.range || dependency.version\r\n };\r\n };\r\n\r\n /**\r\n * Parses a version string into its components. \r\n * Versions are strictly of the format `x.y.z` (as in [semver](http://semver.org/)).\r\n * Versions may optionally have a prerelease tag in the format `x.y.z-alpha`.\r\n * Ranges are a strict subset of [npm ranges](https://docs.npmjs.com/misc/semver#advanced-range-syntax).\r\n * Only the following range types are supported:\r\n * - Tilde ranges e.g. `~1.2.3`\r\n * - Caret ranges e.g. `^1.2.3`\r\n * - Exact version e.g. `1.2.3`\r\n * - Any version `*`\r\n * @method versionParse\r\n * @param range {string} The version string.\r\n * @return {object} The version range parsed into its components.\r\n */\r\n Plugin.versionParse = function(range) {\r\n var pattern = /^\\*|[\\^~]?\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z-]+)?$/;\r\n\r\n if (!pattern.test(range)) {\r\n Common.warn('Plugin.versionParse:', range, 'is not a valid version or range.');\r\n }\r\n\r\n var identifiers = range.split('-');\r\n range = identifiers[0];\r\n\r\n var isRange = isNaN(Number(range[0])),\r\n version = isRange ? range.substr(1) : range,\r\n parts = Common.map(version.split('.'), function(part) {\r\n return Number(part);\r\n });\r\n\r\n return {\r\n isRange: isRange,\r\n version: version,\r\n range: range,\r\n operator: isRange ? range[0] : '',\r\n parts: parts,\r\n prerelease: identifiers[1],\r\n number: parts[0] * 1e8 + parts[1] * 1e4 + parts[2]\r\n };\r\n };\r\n\r\n /**\r\n * Returns `true` if `version` satisfies the given `range`.\r\n * See documentation for `Plugin.versionParse` for a description of the format.\r\n * If a version or range is not specified, then any version (`*`) is assumed to satisfy.\r\n * @method versionSatisfies\r\n * @param version {string} The version string.\r\n * @param range {string} The range string.\r\n * @return {boolean} `true` if `version` satisfies `range`, otherwise `false`.\r\n */\r\n Plugin.versionSatisfies = function(version, range) {\r\n range = range || '*';\r\n\r\n var rangeParsed = Plugin.versionParse(range),\r\n rangeParts = rangeParsed.parts,\r\n versionParsed = Plugin.versionParse(version),\r\n versionParts = versionParsed.parts;\r\n\r\n if (rangeParsed.isRange) {\r\n if (rangeParsed.operator === '*' || version === '*') {\r\n return true;\r\n }\r\n\r\n if (rangeParsed.operator === '~') {\r\n return versionParts[0] === rangeParts[0] && versionParts[1] === rangeParts[1] && versionParts[2] >= rangeParts[2];\r\n }\r\n\r\n if (rangeParsed.operator === '^') {\r\n if (rangeParts[0] > 0) {\r\n return versionParts[0] === rangeParts[0] && versionParsed.number >= rangeParsed.number;\r\n }\r\n\r\n if (rangeParts[1] > 0) {\r\n return versionParts[1] === rangeParts[1] && versionParts[2] >= rangeParts[2];\r\n }\r\n\r\n return versionParts[2] === rangeParts[2];\r\n }\r\n }\r\n\r\n return version === range || version === '*';\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/core/Plugin.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/core/Sleeping.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/core/Sleeping.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Sleeping` module contains methods to manage the sleeping state of bodies.\r\n*\r\n* @class Sleeping\r\n*/\r\n\r\nvar Sleeping = {};\r\n\r\nmodule.exports = Sleeping;\r\n\r\nvar Events = __webpack_require__(/*! ./Events */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Events.js\");\r\n\r\n(function() {\r\n\r\n Sleeping._motionWakeThreshold = 0.18;\r\n Sleeping._motionSleepThreshold = 0.08;\r\n Sleeping._minBias = 0.9;\r\n\r\n /**\r\n * Puts bodies to sleep or wakes them up depending on their motion.\r\n * @method update\r\n * @param {body[]} bodies\r\n * @param {number} timeScale\r\n */\r\n Sleeping.update = function(bodies, timeScale) {\r\n var timeFactor = timeScale * timeScale * timeScale;\r\n\r\n // update bodies sleeping status\r\n for (var i = 0; i < bodies.length; i++) {\r\n var body = bodies[i],\r\n motion = body.speed * body.speed + body.angularSpeed * body.angularSpeed;\r\n\r\n // wake up bodies if they have a force applied\r\n if (body.force.x !== 0 || body.force.y !== 0) {\r\n Sleeping.set(body, false);\r\n continue;\r\n }\r\n\r\n var minMotion = Math.min(body.motion, motion),\r\n maxMotion = Math.max(body.motion, motion);\r\n \r\n // biased average motion estimation between frames\r\n body.motion = Sleeping._minBias * minMotion + (1 - Sleeping._minBias) * maxMotion;\r\n \r\n if (body.sleepThreshold > 0 && body.motion < Sleeping._motionSleepThreshold * timeFactor) {\r\n body.sleepCounter += 1;\r\n \r\n if (body.sleepCounter >= body.sleepThreshold)\r\n Sleeping.set(body, true);\r\n } else if (body.sleepCounter > 0) {\r\n body.sleepCounter -= 1;\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Given a set of colliding pairs, wakes the sleeping bodies involved.\r\n * @method afterCollisions\r\n * @param {pair[]} pairs\r\n * @param {number} timeScale\r\n */\r\n Sleeping.afterCollisions = function(pairs, timeScale) {\r\n var timeFactor = timeScale * timeScale * timeScale;\r\n\r\n // wake up bodies involved in collisions\r\n for (var i = 0; i < pairs.length; i++) {\r\n var pair = pairs[i];\r\n \r\n // don't wake inactive pairs\r\n if (!pair.isActive)\r\n continue;\r\n\r\n var collision = pair.collision,\r\n bodyA = collision.bodyA.parent, \r\n bodyB = collision.bodyB.parent;\r\n \r\n // don't wake if at least one body is static\r\n if ((bodyA.isSleeping && bodyB.isSleeping) || bodyA.isStatic || bodyB.isStatic)\r\n continue;\r\n \r\n if (bodyA.isSleeping || bodyB.isSleeping) {\r\n var sleepingBody = (bodyA.isSleeping && !bodyA.isStatic) ? bodyA : bodyB,\r\n movingBody = sleepingBody === bodyA ? bodyB : bodyA;\r\n\r\n if (!sleepingBody.isStatic && movingBody.motion > Sleeping._motionWakeThreshold * timeFactor) {\r\n Sleeping.set(sleepingBody, false);\r\n }\r\n }\r\n }\r\n };\r\n \r\n /**\r\n * Set a body as sleeping or awake.\r\n * @method set\r\n * @param {body} body\r\n * @param {boolean} isSleeping\r\n */\r\n Sleeping.set = function(body, isSleeping) {\r\n var wasSleeping = body.isSleeping;\r\n\r\n if (isSleeping) {\r\n body.isSleeping = true;\r\n body.sleepCounter = body.sleepThreshold;\r\n\r\n body.positionImpulse.x = 0;\r\n body.positionImpulse.y = 0;\r\n\r\n body.positionPrev.x = body.position.x;\r\n body.positionPrev.y = body.position.y;\r\n\r\n body.anglePrev = body.angle;\r\n body.speed = 0;\r\n body.angularSpeed = 0;\r\n body.motion = 0;\r\n\r\n if (!wasSleeping) {\r\n Events.trigger(body, 'sleepStart');\r\n }\r\n } else {\r\n body.isSleeping = false;\r\n body.sleepCounter = 0;\r\n\r\n if (wasSleeping) {\r\n Events.trigger(body, 'sleepEnd');\r\n }\r\n }\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/core/Sleeping.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/factory/Bodies.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/factory/Bodies.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Bodies` module contains factory methods for creating rigid body models \r\n* with commonly used body configurations (such as rectangles, circles and other polygons).\r\n*\r\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\r\n*\r\n* @class Bodies\r\n*/\r\n\r\n// TODO: true circle bodies\r\n\r\nvar Bodies = {};\r\n\r\nmodule.exports = Bodies;\r\n\r\nvar Vertices = __webpack_require__(/*! ../geometry/Vertices */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js\");\r\nvar Common = __webpack_require__(/*! ../core/Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\nvar Body = __webpack_require__(/*! ../body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\nvar Bounds = __webpack_require__(/*! ../geometry/Bounds */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Bounds.js\");\r\nvar Vector = __webpack_require__(/*! ../geometry/Vector */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vector.js\");\r\nvar decomp = __webpack_require__(/*! ../../poly-decomp */ \"./node_modules/phaser/src/physics/matter-js/poly-decomp/index.js\");\r\n\r\n(function() {\r\n\r\n /**\r\n * Creates a new rigid body model with a rectangle hull. \r\n * The options parameter is an object that specifies any properties you wish to override the defaults.\r\n * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.\r\n * @method rectangle\r\n * @param {number} x\r\n * @param {number} y\r\n * @param {number} width\r\n * @param {number} height\r\n * @param {object} [options]\r\n * @return {body} A new rectangle body\r\n */\r\n Bodies.rectangle = function(x, y, width, height, options) {\r\n options = options || {};\r\n\r\n var rectangle = { \r\n label: 'Rectangle Body',\r\n position: { x: x, y: y },\r\n vertices: Vertices.fromPath('L 0 0 L ' + width + ' 0 L ' + width + ' ' + height + ' L 0 ' + height)\r\n };\r\n\r\n if (options.chamfer) {\r\n var chamfer = options.chamfer;\r\n rectangle.vertices = Vertices.chamfer(rectangle.vertices, chamfer.radius, \r\n chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);\r\n delete options.chamfer;\r\n }\r\n\r\n return Body.create(Common.extend({}, rectangle, options));\r\n };\r\n \r\n /**\r\n * Creates a new rigid body model with a trapezoid hull. \r\n * The options parameter is an object that specifies any properties you wish to override the defaults.\r\n * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.\r\n * @method trapezoid\r\n * @param {number} x\r\n * @param {number} y\r\n * @param {number} width\r\n * @param {number} height\r\n * @param {number} slope\r\n * @param {object} [options]\r\n * @return {body} A new trapezoid body\r\n */\r\n Bodies.trapezoid = function(x, y, width, height, slope, options) {\r\n options = options || {};\r\n\r\n slope *= 0.5;\r\n var roof = (1 - (slope * 2)) * width;\r\n \r\n var x1 = width * slope,\r\n x2 = x1 + roof,\r\n x3 = x2 + x1,\r\n verticesPath;\r\n\r\n if (slope < 0.5) {\r\n verticesPath = 'L 0 0 L ' + x1 + ' ' + (-height) + ' L ' + x2 + ' ' + (-height) + ' L ' + x3 + ' 0';\r\n } else {\r\n verticesPath = 'L 0 0 L ' + x2 + ' ' + (-height) + ' L ' + x3 + ' 0';\r\n }\r\n\r\n var trapezoid = { \r\n label: 'Trapezoid Body',\r\n position: { x: x, y: y },\r\n vertices: Vertices.fromPath(verticesPath)\r\n };\r\n\r\n if (options.chamfer) {\r\n var chamfer = options.chamfer;\r\n trapezoid.vertices = Vertices.chamfer(trapezoid.vertices, chamfer.radius, \r\n chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);\r\n delete options.chamfer;\r\n }\r\n\r\n return Body.create(Common.extend({}, trapezoid, options));\r\n };\r\n\r\n /**\r\n * Creates a new rigid body model with a circle hull. \r\n * The options parameter is an object that specifies any properties you wish to override the defaults.\r\n * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.\r\n * @method circle\r\n * @param {number} x\r\n * @param {number} y\r\n * @param {number} radius\r\n * @param {object} [options]\r\n * @param {number} [maxSides]\r\n * @return {body} A new circle body\r\n */\r\n Bodies.circle = function(x, y, radius, options, maxSides) {\r\n options = options || {};\r\n\r\n var circle = {\r\n label: 'Circle Body',\r\n circleRadius: radius\r\n };\r\n \r\n // approximate circles with polygons until true circles implemented in SAT\r\n maxSides = maxSides || 25;\r\n var sides = Math.ceil(Math.max(10, Math.min(maxSides, radius)));\r\n\r\n // optimisation: always use even number of sides (half the number of unique axes)\r\n if (sides % 2 === 1)\r\n sides += 1;\r\n\r\n return Bodies.polygon(x, y, sides, radius, Common.extend({}, circle, options));\r\n };\r\n\r\n /**\r\n * Creates a new rigid body model with a regular polygon hull with the given number of sides. \r\n * The options parameter is an object that specifies any properties you wish to override the defaults.\r\n * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.\r\n * @method polygon\r\n * @param {number} x\r\n * @param {number} y\r\n * @param {number} sides\r\n * @param {number} radius\r\n * @param {object} [options]\r\n * @return {body} A new regular polygon body\r\n */\r\n Bodies.polygon = function(x, y, sides, radius, options) {\r\n options = options || {};\r\n\r\n if (sides < 3)\r\n return Bodies.circle(x, y, radius, options);\r\n\r\n var theta = 2 * Math.PI / sides,\r\n path = '',\r\n offset = theta * 0.5;\r\n\r\n for (var i = 0; i < sides; i += 1) {\r\n var angle = offset + (i * theta),\r\n xx = Math.cos(angle) * radius,\r\n yy = Math.sin(angle) * radius;\r\n\r\n path += 'L ' + xx.toFixed(3) + ' ' + yy.toFixed(3) + ' ';\r\n }\r\n\r\n var polygon = { \r\n label: 'Polygon Body',\r\n position: { x: x, y: y },\r\n vertices: Vertices.fromPath(path)\r\n };\r\n\r\n if (options.chamfer) {\r\n var chamfer = options.chamfer;\r\n polygon.vertices = Vertices.chamfer(polygon.vertices, chamfer.radius, \r\n chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);\r\n delete options.chamfer;\r\n }\r\n\r\n return Body.create(Common.extend({}, polygon, options));\r\n };\r\n\r\n /**\r\n * Creates a body using the supplied vertices (or an array containing multiple sets of vertices).\r\n * If the vertices are convex, they will pass through as supplied.\r\n * Otherwise if the vertices are concave, they will be decomposed if [poly-decomp.js](https://github.com/schteppe/poly-decomp.js) is available.\r\n * Note that this process is not guaranteed to support complex sets of vertices (e.g. those with holes may fail).\r\n * By default the decomposition will discard collinear edges (to improve performance).\r\n * It can also optionally discard any parts that have an area less than `minimumArea`.\r\n * If the vertices can not be decomposed, the result will fall back to using the convex hull.\r\n * The options parameter is an object that specifies any `Matter.Body` properties you wish to override the defaults.\r\n * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.\r\n * @method fromVertices\r\n * @param {number} x\r\n * @param {number} y\r\n * @param [[vector]] vertexSets\r\n * @param {object} [options]\r\n * @param {bool} [flagInternal=false]\r\n * @param {number} [removeCollinear=0.01]\r\n * @param {number} [minimumArea=10]\r\n * @return {body}\r\n */\r\n Bodies.fromVertices = function(x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea) {\r\n var body,\r\n parts,\r\n isConvex,\r\n vertices,\r\n i,\r\n j,\r\n k,\r\n v,\r\n z;\r\n\r\n options = options || {};\r\n parts = [];\r\n\r\n flagInternal = typeof flagInternal !== 'undefined' ? flagInternal : false;\r\n removeCollinear = typeof removeCollinear !== 'undefined' ? removeCollinear : 0.01;\r\n minimumArea = typeof minimumArea !== 'undefined' ? minimumArea : 10;\r\n\r\n if (!decomp) {\r\n Common.warn('Bodies.fromVertices: poly-decomp.js required. Could not decompose vertices. Fallback to convex hull.');\r\n }\r\n\r\n // ensure vertexSets is an array of arrays\r\n if (!Common.isArray(vertexSets[0])) {\r\n vertexSets = [vertexSets];\r\n }\r\n\r\n for (v = 0; v < vertexSets.length; v += 1) {\r\n vertices = vertexSets[v];\r\n isConvex = Vertices.isConvex(vertices);\r\n\r\n if (isConvex || !decomp) {\r\n if (isConvex) {\r\n vertices = Vertices.clockwiseSort(vertices);\r\n } else {\r\n // fallback to convex hull when decomposition is not possible\r\n vertices = Vertices.hull(vertices);\r\n }\r\n\r\n parts.push({\r\n position: { x: x, y: y },\r\n vertices: vertices\r\n });\r\n } else {\r\n // initialise a decomposition\r\n var concave = vertices.map(function(vertex) {\r\n return [vertex.x, vertex.y];\r\n });\r\n\r\n // vertices are concave and simple, we can decompose into parts\r\n decomp.makeCCW(concave);\r\n if (removeCollinear !== false)\r\n decomp.removeCollinearPoints(concave, removeCollinear);\r\n\r\n // use the quick decomposition algorithm (Bayazit)\r\n var decomposed = decomp.quickDecomp(concave);\r\n\r\n // for each decomposed chunk\r\n for (i = 0; i < decomposed.length; i++) {\r\n var chunk = decomposed[i];\r\n\r\n // convert vertices into the correct structure\r\n var chunkVertices = chunk.map(function(vertices) {\r\n return {\r\n x: vertices[0],\r\n y: vertices[1]\r\n };\r\n });\r\n\r\n // skip small chunks\r\n if (minimumArea > 0 && Vertices.area(chunkVertices) < minimumArea)\r\n continue;\r\n\r\n // create a compound part\r\n parts.push({\r\n position: Vertices.centre(chunkVertices),\r\n vertices: chunkVertices\r\n });\r\n }\r\n }\r\n }\r\n\r\n // create body parts\r\n for (i = 0; i < parts.length; i++) {\r\n parts[i] = Body.create(Common.extend(parts[i], options));\r\n }\r\n\r\n if (flagInternal)\r\n {\r\n Bodies.flagCoincidentParts(parts, 5);\r\n }\r\n\r\n if (parts.length > 1) {\r\n // create the parent body to be returned, that contains generated compound parts\r\n body = Body.create(Common.extend({ parts: parts.slice(0) }, options));\r\n Body.setPosition(body, { x: x, y: y });\r\n\r\n return body;\r\n } else {\r\n return parts[0];\r\n }\r\n };\r\n\r\n /**\r\n * Takes an array of Body objects and flags all internal edges (coincident parts) based on the maxDistance\r\n * value. The array is changed in-place and returned, so you can pass this function a `Body.parts` property.\r\n * \r\n * @method flagCoincidentParts\r\n * @param {body[]} parts - The Body parts, or array of bodies, to flag.\r\n * @param {number} [maxDistance=5]\r\n * @return {body[]} The modified `parts` parameter.\r\n */\r\n Bodies.flagCoincidentParts = function (parts, maxDistance)\r\n {\r\n if (maxDistance === undefined) { maxDistance = 5; }\r\n\r\n for (var i = 0; i < parts.length; i++)\r\n {\r\n var partA = parts[i];\r\n\r\n for (var j = i + 1; j < parts.length; j++)\r\n {\r\n var partB = parts[j];\r\n\r\n if (Bounds.overlaps(partA.bounds, partB.bounds))\r\n {\r\n var pav = partA.vertices;\r\n var pbv = partB.vertices;\r\n\r\n // iterate vertices of both parts\r\n for (var k = 0; k < partA.vertices.length; k++)\r\n {\r\n for (var z = 0; z < partB.vertices.length; z++)\r\n {\r\n // find distances between the vertices\r\n var da = Vector.magnitudeSquared(Vector.sub(pav[(k + 1) % pav.length], pbv[z]));\r\n var db = Vector.magnitudeSquared(Vector.sub(pav[k], pbv[(z + 1) % pbv.length]));\r\n\r\n // if both vertices are very close, consider the edge concident (internal)\r\n if (da < maxDistance && db < maxDistance)\r\n {\r\n pav[k].isInternal = true;\r\n pbv[z].isInternal = true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return parts;\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/factory/Bodies.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/factory/Composites.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/factory/Composites.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Composites` module contains factory methods for creating composite bodies\r\n* with commonly used configurations (such as stacks and chains).\r\n*\r\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\r\n*\r\n* @class Composites\r\n*/\r\n\r\nvar Composites = {};\r\n\r\nmodule.exports = Composites;\r\n\r\nvar Composite = __webpack_require__(/*! ../body/Composite */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Composite.js\");\r\nvar Constraint = __webpack_require__(/*! ../constraint/Constraint */ \"./node_modules/phaser/src/physics/matter-js/lib/constraint/Constraint.js\");\r\nvar Common = __webpack_require__(/*! ../core/Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\nvar Body = __webpack_require__(/*! ../body/Body */ \"./node_modules/phaser/src/physics/matter-js/lib/body/Body.js\");\r\nvar Bodies = __webpack_require__(/*! ./Bodies */ \"./node_modules/phaser/src/physics/matter-js/lib/factory/Bodies.js\");\r\n\r\n(function() {\r\n\r\n /**\r\n * Create a new composite containing bodies created in the callback in a grid arrangement.\r\n * This function uses the body's bounds to prevent overlaps.\r\n * @method stack\r\n * @param {number} xx\r\n * @param {number} yy\r\n * @param {number} columns\r\n * @param {number} rows\r\n * @param {number} columnGap\r\n * @param {number} rowGap\r\n * @param {function} callback\r\n * @return {composite} A new composite containing objects created in the callback\r\n */\r\n Composites.stack = function(xx, yy, columns, rows, columnGap, rowGap, callback) {\r\n var stack = Composite.create({ label: 'Stack' }),\r\n x = xx,\r\n y = yy,\r\n lastBody,\r\n i = 0;\r\n\r\n for (var row = 0; row < rows; row++) {\r\n var maxHeight = 0;\r\n \r\n for (var column = 0; column < columns; column++) {\r\n var body = callback(x, y, column, row, lastBody, i);\r\n \r\n if (body) {\r\n var bodyHeight = body.bounds.max.y - body.bounds.min.y,\r\n bodyWidth = body.bounds.max.x - body.bounds.min.x; \r\n\r\n if (bodyHeight > maxHeight)\r\n maxHeight = bodyHeight;\r\n \r\n Body.translate(body, { x: bodyWidth * 0.5, y: bodyHeight * 0.5 });\r\n\r\n x = body.bounds.max.x + columnGap;\r\n\r\n Composite.addBody(stack, body);\r\n \r\n lastBody = body;\r\n i += 1;\r\n } else {\r\n x += columnGap;\r\n }\r\n }\r\n \r\n y += maxHeight + rowGap;\r\n x = xx;\r\n }\r\n\r\n return stack;\r\n };\r\n \r\n /**\r\n * Chains all bodies in the given composite together using constraints.\r\n * @method chain\r\n * @param {composite} composite\r\n * @param {number} xOffsetA\r\n * @param {number} yOffsetA\r\n * @param {number} xOffsetB\r\n * @param {number} yOffsetB\r\n * @param {object} options\r\n * @return {composite} A new composite containing objects chained together with constraints\r\n */\r\n Composites.chain = function(composite, xOffsetA, yOffsetA, xOffsetB, yOffsetB, options) {\r\n var bodies = composite.bodies;\r\n \r\n for (var i = 1; i < bodies.length; i++) {\r\n var bodyA = bodies[i - 1],\r\n bodyB = bodies[i],\r\n bodyAHeight = bodyA.bounds.max.y - bodyA.bounds.min.y,\r\n bodyAWidth = bodyA.bounds.max.x - bodyA.bounds.min.x, \r\n bodyBHeight = bodyB.bounds.max.y - bodyB.bounds.min.y,\r\n bodyBWidth = bodyB.bounds.max.x - bodyB.bounds.min.x;\r\n \r\n var defaults = {\r\n bodyA: bodyA,\r\n pointA: { x: bodyAWidth * xOffsetA, y: bodyAHeight * yOffsetA },\r\n bodyB: bodyB,\r\n pointB: { x: bodyBWidth * xOffsetB, y: bodyBHeight * yOffsetB }\r\n };\r\n \r\n var constraint = Common.extend(defaults, options);\r\n \r\n Composite.addConstraint(composite, Constraint.create(constraint));\r\n }\r\n\r\n composite.label += ' Chain';\r\n \r\n return composite;\r\n };\r\n\r\n /**\r\n * Connects bodies in the composite with constraints in a grid pattern, with optional cross braces.\r\n * @method mesh\r\n * @param {composite} composite\r\n * @param {number} columns\r\n * @param {number} rows\r\n * @param {boolean} crossBrace\r\n * @param {object} options\r\n * @return {composite} The composite containing objects meshed together with constraints\r\n */\r\n Composites.mesh = function(composite, columns, rows, crossBrace, options) {\r\n var bodies = composite.bodies,\r\n row,\r\n col,\r\n bodyA,\r\n bodyB,\r\n bodyC;\r\n \r\n for (row = 0; row < rows; row++) {\r\n for (col = 1; col < columns; col++) {\r\n bodyA = bodies[(col - 1) + (row * columns)];\r\n bodyB = bodies[col + (row * columns)];\r\n Composite.addConstraint(composite, Constraint.create(Common.extend({ bodyA: bodyA, bodyB: bodyB }, options)));\r\n }\r\n\r\n if (row > 0) {\r\n for (col = 0; col < columns; col++) {\r\n bodyA = bodies[col + ((row - 1) * columns)];\r\n bodyB = bodies[col + (row * columns)];\r\n Composite.addConstraint(composite, Constraint.create(Common.extend({ bodyA: bodyA, bodyB: bodyB }, options)));\r\n\r\n if (crossBrace && col > 0) {\r\n bodyC = bodies[(col - 1) + ((row - 1) * columns)];\r\n Composite.addConstraint(composite, Constraint.create(Common.extend({ bodyA: bodyC, bodyB: bodyB }, options)));\r\n }\r\n\r\n if (crossBrace && col < columns - 1) {\r\n bodyC = bodies[(col + 1) + ((row - 1) * columns)];\r\n Composite.addConstraint(composite, Constraint.create(Common.extend({ bodyA: bodyC, bodyB: bodyB }, options)));\r\n }\r\n }\r\n }\r\n }\r\n\r\n composite.label += ' Mesh';\r\n \r\n return composite;\r\n };\r\n \r\n /**\r\n * Create a new composite containing bodies created in the callback in a pyramid arrangement.\r\n * This function uses the body's bounds to prevent overlaps.\r\n * @method pyramid\r\n * @param {number} xx\r\n * @param {number} yy\r\n * @param {number} columns\r\n * @param {number} rows\r\n * @param {number} columnGap\r\n * @param {number} rowGap\r\n * @param {function} callback\r\n * @return {composite} A new composite containing objects created in the callback\r\n */\r\n Composites.pyramid = function(xx, yy, columns, rows, columnGap, rowGap, callback) {\r\n return Composites.stack(xx, yy, columns, rows, columnGap, rowGap, function(x, y, column, row, lastBody, i) {\r\n var actualRows = Math.min(rows, Math.ceil(columns / 2)),\r\n lastBodyWidth = lastBody ? lastBody.bounds.max.x - lastBody.bounds.min.x : 0;\r\n \r\n if (row > actualRows)\r\n return;\r\n \r\n // reverse row order\r\n row = actualRows - row;\r\n \r\n var start = row,\r\n end = columns - 1 - row;\r\n\r\n if (column < start || column > end)\r\n return;\r\n \r\n // retroactively fix the first body's position, since width was unknown\r\n if (i === 1) {\r\n Body.translate(lastBody, { x: (column + (columns % 2 === 1 ? 1 : -1)) * lastBodyWidth, y: 0 });\r\n }\r\n\r\n var xOffset = lastBody ? column * lastBodyWidth : 0;\r\n \r\n return callback(xx + xOffset + column * columnGap, y, column, row, lastBody, i);\r\n });\r\n };\r\n\r\n /**\r\n * Creates a composite with a Newton's Cradle setup of bodies and constraints.\r\n * @method newtonsCradle\r\n * @param {number} xx\r\n * @param {number} yy\r\n * @param {number} number\r\n * @param {number} size\r\n * @param {number} length\r\n * @return {composite} A new composite newtonsCradle body\r\n */\r\n Composites.newtonsCradle = function(xx, yy, number, size, length) {\r\n var newtonsCradle = Composite.create({ label: 'Newtons Cradle' });\r\n\r\n for (var i = 0; i < number; i++) {\r\n var separation = 1.9,\r\n circle = Bodies.circle(xx + i * (size * separation), yy + length, size, \r\n { inertia: Infinity, restitution: 1, friction: 0, frictionAir: 0.0001, slop: 1 }),\r\n constraint = Constraint.create({ pointA: { x: xx + i * (size * separation), y: yy }, bodyB: circle });\r\n\r\n Composite.addBody(newtonsCradle, circle);\r\n Composite.addConstraint(newtonsCradle, constraint);\r\n }\r\n\r\n return newtonsCradle;\r\n };\r\n \r\n /**\r\n * Creates a composite with simple car setup of bodies and constraints.\r\n * @method car\r\n * @param {number} xx\r\n * @param {number} yy\r\n * @param {number} width\r\n * @param {number} height\r\n * @param {number} wheelSize\r\n * @return {composite} A new composite car body\r\n */\r\n Composites.car = function(xx, yy, width, height, wheelSize) {\r\n var group = Body.nextGroup(true),\r\n wheelBase = 20,\r\n wheelAOffset = -width * 0.5 + wheelBase,\r\n wheelBOffset = width * 0.5 - wheelBase,\r\n wheelYOffset = 0;\r\n \r\n var car = Composite.create({ label: 'Car' }),\r\n body = Bodies.rectangle(xx, yy, width, height, { \r\n collisionFilter: {\r\n group: group\r\n },\r\n chamfer: {\r\n radius: height * 0.5\r\n },\r\n density: 0.0002\r\n });\r\n \r\n var wheelA = Bodies.circle(xx + wheelAOffset, yy + wheelYOffset, wheelSize, { \r\n collisionFilter: {\r\n group: group\r\n },\r\n friction: 0.8\r\n });\r\n \r\n var wheelB = Bodies.circle(xx + wheelBOffset, yy + wheelYOffset, wheelSize, { \r\n collisionFilter: {\r\n group: group\r\n },\r\n friction: 0.8\r\n });\r\n \r\n var axelA = Constraint.create({\r\n bodyB: body,\r\n pointB: { x: wheelAOffset, y: wheelYOffset },\r\n bodyA: wheelA,\r\n stiffness: 1,\r\n length: 0\r\n });\r\n \r\n var axelB = Constraint.create({\r\n bodyB: body,\r\n pointB: { x: wheelBOffset, y: wheelYOffset },\r\n bodyA: wheelB,\r\n stiffness: 1,\r\n length: 0\r\n });\r\n \r\n Composite.addBody(car, body);\r\n Composite.addBody(car, wheelA);\r\n Composite.addBody(car, wheelB);\r\n Composite.addConstraint(car, axelA);\r\n Composite.addConstraint(car, axelB);\r\n\r\n return car;\r\n };\r\n\r\n /**\r\n * Creates a simple soft body like object.\r\n * @method softBody\r\n * @param {number} xx\r\n * @param {number} yy\r\n * @param {number} columns\r\n * @param {number} rows\r\n * @param {number} columnGap\r\n * @param {number} rowGap\r\n * @param {boolean} crossBrace\r\n * @param {number} particleRadius\r\n * @param {} particleOptions\r\n * @param {} constraintOptions\r\n * @return {composite} A new composite softBody\r\n */\r\n Composites.softBody = function(xx, yy, columns, rows, columnGap, rowGap, crossBrace, particleRadius, particleOptions, constraintOptions) {\r\n particleOptions = Common.extend({ inertia: Infinity }, particleOptions);\r\n constraintOptions = Common.extend({ stiffness: 0.2, render: { type: 'line', anchors: false } }, constraintOptions);\r\n\r\n var softBody = Composites.stack(xx, yy, columns, rows, columnGap, rowGap, function(x, y) {\r\n return Bodies.circle(x, y, particleRadius, particleOptions);\r\n });\r\n\r\n Composites.mesh(softBody, columns, rows, crossBrace, constraintOptions);\r\n\r\n softBody.label = 'Soft Body';\r\n\r\n return softBody;\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/factory/Composites.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/geometry/Axes.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/geometry/Axes.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Axes` module contains methods for creating and manipulating sets of axes.\r\n*\r\n* @class Axes\r\n*/\r\n\r\nvar Axes = {};\r\n\r\nmodule.exports = Axes;\r\n\r\nvar Vector = __webpack_require__(/*! ../geometry/Vector */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vector.js\");\r\nvar Common = __webpack_require__(/*! ../core/Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\n\r\n(function() {\r\n\r\n /**\r\n * Creates a new set of axes from the given vertices.\r\n * @method fromVertices\r\n * @param {vertices} vertices\r\n * @return {axes} A new axes from the given vertices\r\n */\r\n Axes.fromVertices = function(vertices) {\r\n var axes = {};\r\n\r\n // find the unique axes, using edge normal gradients\r\n for (var i = 0; i < vertices.length; i++) {\r\n var j = (i + 1) % vertices.length, \r\n normal = Vector.normalise({ \r\n x: vertices[j].y - vertices[i].y, \r\n y: vertices[i].x - vertices[j].x\r\n }),\r\n gradient = (normal.y === 0) ? Infinity : (normal.x / normal.y);\r\n \r\n // limit precision\r\n gradient = gradient.toFixed(3).toString();\r\n axes[gradient] = normal;\r\n }\r\n\r\n return Common.values(axes);\r\n };\r\n\r\n /**\r\n * Rotates a set of axes by the given angle.\r\n * @method rotate\r\n * @param {axes} axes\r\n * @param {number} angle\r\n */\r\n Axes.rotate = function(axes, angle) {\r\n if (angle === 0)\r\n return;\r\n \r\n var cos = Math.cos(angle),\r\n sin = Math.sin(angle);\r\n\r\n for (var i = 0; i < axes.length; i++) {\r\n var axis = axes[i],\r\n xx;\r\n xx = axis.x * cos - axis.y * sin;\r\n axis.y = axis.x * sin + axis.y * cos;\r\n axis.x = xx;\r\n }\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/geometry/Axes.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/geometry/Bounds.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/geometry/Bounds.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n* The `Matter.Bounds` module contains methods for creating and manipulating axis-aligned bounding boxes (AABB).\r\n*\r\n* @class Bounds\r\n*/\r\n\r\nvar Bounds = {};\r\n\r\nmodule.exports = Bounds;\r\n\r\n(function() {\r\n\r\n /**\r\n * Creates a new axis-aligned bounding box (AABB) for the given vertices.\r\n * @method create\r\n * @param {vertices} vertices\r\n * @return {bounds} A new bounds object\r\n */\r\n Bounds.create = function(vertices) {\r\n var bounds = { \r\n min: { x: 0, y: 0 }, \r\n max: { x: 0, y: 0 }\r\n };\r\n\r\n if (vertices)\r\n Bounds.update(bounds, vertices);\r\n \r\n return bounds;\r\n };\r\n\r\n /**\r\n * Updates bounds using the given vertices and extends the bounds given a velocity.\r\n * @method update\r\n * @param {bounds} bounds\r\n * @param {vertices} vertices\r\n * @param {vector} velocity\r\n */\r\n Bounds.update = function(bounds, vertices, velocity) {\r\n bounds.min.x = Infinity;\r\n bounds.max.x = -Infinity;\r\n bounds.min.y = Infinity;\r\n bounds.max.y = -Infinity;\r\n\r\n for (var i = 0; i < vertices.length; i++) {\r\n var vertex = vertices[i];\r\n if (vertex.x > bounds.max.x) bounds.max.x = vertex.x;\r\n if (vertex.x < bounds.min.x) bounds.min.x = vertex.x;\r\n if (vertex.y > bounds.max.y) bounds.max.y = vertex.y;\r\n if (vertex.y < bounds.min.y) bounds.min.y = vertex.y;\r\n }\r\n \r\n if (velocity) {\r\n if (velocity.x > 0) {\r\n bounds.max.x += velocity.x;\r\n } else {\r\n bounds.min.x += velocity.x;\r\n }\r\n \r\n if (velocity.y > 0) {\r\n bounds.max.y += velocity.y;\r\n } else {\r\n bounds.min.y += velocity.y;\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Returns true if the bounds contains the given point.\r\n * @method contains\r\n * @param {bounds} bounds\r\n * @param {vector} point\r\n * @return {boolean} True if the bounds contain the point, otherwise false\r\n */\r\n Bounds.contains = function(bounds, point) {\r\n return point.x >= bounds.min.x && point.x <= bounds.max.x \r\n && point.y >= bounds.min.y && point.y <= bounds.max.y;\r\n };\r\n\r\n /**\r\n * Returns true if the two bounds intersect.\r\n * @method overlaps\r\n * @param {bounds} boundsA\r\n * @param {bounds} boundsB\r\n * @return {boolean} True if the bounds overlap, otherwise false\r\n */\r\n Bounds.overlaps = function(boundsA, boundsB) {\r\n return (boundsA.min.x <= boundsB.max.x && boundsA.max.x >= boundsB.min.x\r\n && boundsA.max.y >= boundsB.min.y && boundsA.min.y <= boundsB.max.y);\r\n };\r\n\r\n /**\r\n * Translates the bounds by the given vector.\r\n * @method translate\r\n * @param {bounds} bounds\r\n * @param {vector} vector\r\n */\r\n Bounds.translate = function(bounds, vector) {\r\n bounds.min.x += vector.x;\r\n bounds.max.x += vector.x;\r\n bounds.min.y += vector.y;\r\n bounds.max.y += vector.y;\r\n };\r\n\r\n /**\r\n * Shifts the bounds to the given position.\r\n * @method shift\r\n * @param {bounds} bounds\r\n * @param {vector} position\r\n */\r\n Bounds.shift = function(bounds, position) {\r\n var deltaX = bounds.max.x - bounds.min.x,\r\n deltaY = bounds.max.y - bounds.min.y;\r\n \r\n bounds.min.x = position.x;\r\n bounds.max.x = position.x + deltaX;\r\n bounds.min.y = position.y;\r\n bounds.max.y = position.y + deltaY;\r\n };\r\n \r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/geometry/Bounds.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/geometry/Svg.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/geometry/Svg.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Svg` module contains methods for converting SVG images into an array of vector points.\r\n*\r\n* To use this module you also need the SVGPathSeg polyfill: https://github.com/progers/pathseg\r\n*\r\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\r\n*\r\n* @class Svg\r\n*/\r\n\r\nvar Svg = {};\r\n\r\nmodule.exports = Svg;\r\n\r\nvar Bounds = __webpack_require__(/*! ../geometry/Bounds */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Bounds.js\");\r\nvar Common = __webpack_require__(/*! ../core/Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\n\r\n(function() {\r\n\r\n /**\r\n * Converts an SVG path into an array of vector points.\r\n * If the input path forms a concave shape, you must decompose the result into convex parts before use.\r\n * See `Bodies.fromVertices` which provides support for this.\r\n * Note that this function is not guaranteed to support complex paths (such as those with holes).\r\n * You must load the `pathseg.js` polyfill on newer browsers.\r\n * @method pathToVertices\r\n * @param {SVGPathElement} path\r\n * @param {Number} [sampleLength=15]\r\n * @return {Vector[]} points\r\n */\r\n Svg.pathToVertices = function(path, sampleLength) {\r\n if (typeof window !== 'undefined' && !('SVGPathSeg' in window)) {\r\n Common.warn('Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.');\r\n }\r\n\r\n // https://github.com/wout/svg.topoly.js/blob/master/svg.topoly.js\r\n var i, il, total, point, segment, segments, \r\n segmentsQueue, lastSegment, \r\n lastPoint, segmentIndex, points = [],\r\n lx, ly, length = 0, x = 0, y = 0;\r\n\r\n sampleLength = sampleLength || 15;\r\n\r\n var addPoint = function(px, py, pathSegType) {\r\n // all odd-numbered path types are relative except PATHSEG_CLOSEPATH (1)\r\n var isRelative = pathSegType % 2 === 1 && pathSegType > 1;\r\n\r\n // when the last point doesn't equal the current point add the current point\r\n if (!lastPoint || px != lastPoint.x || py != lastPoint.y) {\r\n if (lastPoint && isRelative) {\r\n lx = lastPoint.x;\r\n ly = lastPoint.y;\r\n } else {\r\n lx = 0;\r\n ly = 0;\r\n }\r\n\r\n var point = {\r\n x: lx + px,\r\n y: ly + py\r\n };\r\n\r\n // set last point\r\n if (isRelative || !lastPoint) {\r\n lastPoint = point;\r\n }\r\n\r\n points.push(point);\r\n\r\n x = lx + px;\r\n y = ly + py;\r\n }\r\n };\r\n\r\n var addSegmentPoint = function(segment) {\r\n var segType = segment.pathSegTypeAsLetter.toUpperCase();\r\n\r\n // skip path ends\r\n if (segType === 'Z') \r\n return;\r\n\r\n // map segment to x and y\r\n switch (segType) {\r\n\r\n case 'M':\r\n case 'L':\r\n case 'T':\r\n case 'C':\r\n case 'S':\r\n case 'Q':\r\n x = segment.x;\r\n y = segment.y;\r\n break;\r\n case 'H':\r\n x = segment.x;\r\n break;\r\n case 'V':\r\n y = segment.y;\r\n break;\r\n }\r\n\r\n addPoint(x, y, segment.pathSegType);\r\n };\r\n\r\n // ensure path is absolute\r\n Svg._svgPathToAbsolute(path);\r\n\r\n // get total length\r\n total = path.getTotalLength();\r\n\r\n // queue segments\r\n segments = [];\r\n for (i = 0; i < path.pathSegList.numberOfItems; i += 1)\r\n segments.push(path.pathSegList.getItem(i));\r\n\r\n segmentsQueue = segments.concat();\r\n\r\n // sample through path\r\n while (length < total) {\r\n // get segment at position\r\n segmentIndex = path.getPathSegAtLength(length);\r\n segment = segments[segmentIndex];\r\n\r\n // new segment\r\n if (segment != lastSegment) {\r\n while (segmentsQueue.length && segmentsQueue[0] != segment)\r\n addSegmentPoint(segmentsQueue.shift());\r\n\r\n lastSegment = segment;\r\n }\r\n\r\n // add points in between when curving\r\n // TODO: adaptive sampling\r\n switch (segment.pathSegTypeAsLetter.toUpperCase()) {\r\n\r\n case 'C':\r\n case 'T':\r\n case 'S':\r\n case 'Q':\r\n case 'A':\r\n point = path.getPointAtLength(length);\r\n addPoint(point.x, point.y, 0);\r\n break;\r\n\r\n }\r\n\r\n // increment by sample value\r\n length += sampleLength;\r\n }\r\n\r\n // add remaining segments not passed by sampling\r\n for (i = 0, il = segmentsQueue.length; i < il; ++i)\r\n addSegmentPoint(segmentsQueue[i]);\r\n\r\n return points;\r\n };\r\n\r\n Svg._svgPathToAbsolute = function(path) {\r\n // http://phrogz.net/convert-svg-path-to-all-absolute-commands\r\n // Copyright (c) Gavin Kistner\r\n // http://phrogz.net/js/_ReuseLicense.txt\r\n // Modifications: tidy formatting and naming\r\n var x0, y0, x1, y1, x2, y2, segs = path.pathSegList,\r\n x = 0, y = 0, len = segs.numberOfItems;\r\n\r\n for (var i = 0; i < len; ++i) {\r\n var seg = segs.getItem(i),\r\n segType = seg.pathSegTypeAsLetter;\r\n\r\n if (/[MLHVCSQTA]/.test(segType)) {\r\n if ('x' in seg) x = seg.x;\r\n if ('y' in seg) y = seg.y;\r\n } else {\r\n if ('x1' in seg) x1 = x + seg.x1;\r\n if ('x2' in seg) x2 = x + seg.x2;\r\n if ('y1' in seg) y1 = y + seg.y1;\r\n if ('y2' in seg) y2 = y + seg.y2;\r\n if ('x' in seg) x += seg.x;\r\n if ('y' in seg) y += seg.y;\r\n\r\n switch (segType) {\r\n\r\n case 'm':\r\n segs.replaceItem(path.createSVGPathSegMovetoAbs(x, y), i);\r\n break;\r\n case 'l':\r\n segs.replaceItem(path.createSVGPathSegLinetoAbs(x, y), i);\r\n break;\r\n case 'h':\r\n segs.replaceItem(path.createSVGPathSegLinetoHorizontalAbs(x), i);\r\n break;\r\n case 'v':\r\n segs.replaceItem(path.createSVGPathSegLinetoVerticalAbs(y), i);\r\n break;\r\n case 'c':\r\n segs.replaceItem(path.createSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2), i);\r\n break;\r\n case 's':\r\n segs.replaceItem(path.createSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2), i);\r\n break;\r\n case 'q':\r\n segs.replaceItem(path.createSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1), i);\r\n break;\r\n case 't':\r\n segs.replaceItem(path.createSVGPathSegCurvetoQuadraticSmoothAbs(x, y), i);\r\n break;\r\n case 'a':\r\n segs.replaceItem(path.createSVGPathSegArcAbs(x, y, seg.r1, seg.r2, seg.angle, seg.largeArcFlag, seg.sweepFlag), i);\r\n break;\r\n case 'z':\r\n case 'Z':\r\n x = x0;\r\n y = y0;\r\n break;\r\n\r\n }\r\n }\r\n\r\n if (segType == 'M' || segType == 'm') {\r\n x0 = x;\r\n y0 = y;\r\n }\r\n }\r\n };\r\n\r\n})();\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/geometry/Svg.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/geometry/Vector.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/geometry/Vector.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n* The `Matter.Vector` module contains methods for creating and manipulating vectors.\r\n* Vectors are the basis of all the geometry related operations in the engine.\r\n* A `Matter.Vector` object is of the form `{ x: 0, y: 0 }`.\r\n*\r\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\r\n*\r\n* @class Vector\r\n*/\r\n\r\n// TODO: consider params for reusing vector objects\r\n\r\nvar Vector = {};\r\n\r\nmodule.exports = Vector;\r\n\r\n(function() {\r\n\r\n /**\r\n * Creates a new vector.\r\n * @method create\r\n * @param {number} x\r\n * @param {number} y\r\n * @return {vector} A new vector\r\n */\r\n Vector.create = function(x, y) {\r\n return { x: x || 0, y: y || 0 };\r\n };\r\n\r\n /**\r\n * Returns a new vector with `x` and `y` copied from the given `vector`.\r\n * @method clone\r\n * @param {vector} vector\r\n * @return {vector} A new cloned vector\r\n */\r\n Vector.clone = function(vector) {\r\n return { x: vector.x, y: vector.y };\r\n };\r\n\r\n /**\r\n * Returns the magnitude (length) of a vector.\r\n * @method magnitude\r\n * @param {vector} vector\r\n * @return {number} The magnitude of the vector\r\n */\r\n Vector.magnitude = function(vector) {\r\n return Math.sqrt((vector.x * vector.x) + (vector.y * vector.y));\r\n };\r\n\r\n /**\r\n * Returns the magnitude (length) of a vector (therefore saving a `sqrt` operation).\r\n * @method magnitudeSquared\r\n * @param {vector} vector\r\n * @return {number} The squared magnitude of the vector\r\n */\r\n Vector.magnitudeSquared = function(vector) {\r\n return (vector.x * vector.x) + (vector.y * vector.y);\r\n };\r\n\r\n /**\r\n * Rotates the vector about (0, 0) by specified angle.\r\n * @method rotate\r\n * @param {vector} vector\r\n * @param {number} angle\r\n * @param {vector} [output]\r\n * @return {vector} The vector rotated about (0, 0)\r\n */\r\n Vector.rotate = function(vector, angle, output) {\r\n var cos = Math.cos(angle), sin = Math.sin(angle);\r\n if (!output) output = {};\r\n var x = vector.x * cos - vector.y * sin;\r\n output.y = vector.x * sin + vector.y * cos;\r\n output.x = x;\r\n return output;\r\n };\r\n\r\n /**\r\n * Rotates the vector about a specified point by specified angle.\r\n * @method rotateAbout\r\n * @param {vector} vector\r\n * @param {number} angle\r\n * @param {vector} point\r\n * @param {vector} [output]\r\n * @return {vector} A new vector rotated about the point\r\n */\r\n Vector.rotateAbout = function(vector, angle, point, output) {\r\n var cos = Math.cos(angle), sin = Math.sin(angle);\r\n if (!output) output = {};\r\n var x = point.x + ((vector.x - point.x) * cos - (vector.y - point.y) * sin);\r\n output.y = point.y + ((vector.x - point.x) * sin + (vector.y - point.y) * cos);\r\n output.x = x;\r\n return output;\r\n };\r\n\r\n /**\r\n * Normalises a vector (such that its magnitude is `1`).\r\n * @method normalise\r\n * @param {vector} vector\r\n * @return {vector} A new vector normalised\r\n */\r\n Vector.normalise = function(vector) {\r\n var magnitude = Vector.magnitude(vector);\r\n if (magnitude === 0)\r\n return { x: 0, y: 0 };\r\n return { x: vector.x / magnitude, y: vector.y / magnitude };\r\n };\r\n\r\n /**\r\n * Returns the dot-product of two vectors.\r\n * @method dot\r\n * @param {vector} vectorA\r\n * @param {vector} vectorB\r\n * @return {number} The dot product of the two vectors\r\n */\r\n Vector.dot = function(vectorA, vectorB) {\r\n return (vectorA.x * vectorB.x) + (vectorA.y * vectorB.y);\r\n };\r\n\r\n /**\r\n * Returns the cross-product of two vectors.\r\n * @method cross\r\n * @param {vector} vectorA\r\n * @param {vector} vectorB\r\n * @return {number} The cross product of the two vectors\r\n */\r\n Vector.cross = function(vectorA, vectorB) {\r\n return (vectorA.x * vectorB.y) - (vectorA.y * vectorB.x);\r\n };\r\n\r\n /**\r\n * Returns the cross-product of three vectors.\r\n * @method cross3\r\n * @param {vector} vectorA\r\n * @param {vector} vectorB\r\n * @param {vector} vectorC\r\n * @return {number} The cross product of the three vectors\r\n */\r\n Vector.cross3 = function(vectorA, vectorB, vectorC) {\r\n return (vectorB.x - vectorA.x) * (vectorC.y - vectorA.y) - (vectorB.y - vectorA.y) * (vectorC.x - vectorA.x);\r\n };\r\n\r\n /**\r\n * Adds the two vectors.\r\n * @method add\r\n * @param {vector} vectorA\r\n * @param {vector} vectorB\r\n * @param {vector} [output]\r\n * @return {vector} A new vector of vectorA and vectorB added\r\n */\r\n Vector.add = function(vectorA, vectorB, output) {\r\n if (!output) output = {};\r\n output.x = vectorA.x + vectorB.x;\r\n output.y = vectorA.y + vectorB.y;\r\n return output;\r\n };\r\n\r\n /**\r\n * Subtracts the two vectors.\r\n * @method sub\r\n * @param {vector} vectorA\r\n * @param {vector} vectorB\r\n * @param {vector} [output]\r\n * @return {vector} A new vector of vectorA and vectorB subtracted\r\n */\r\n Vector.sub = function(vectorA, vectorB, output) {\r\n if (!output) output = {};\r\n output.x = vectorA.x - vectorB.x;\r\n output.y = vectorA.y - vectorB.y;\r\n return output;\r\n };\r\n\r\n /**\r\n * Multiplies a vector and a scalar.\r\n * @method mult\r\n * @param {vector} vector\r\n * @param {number} scalar\r\n * @return {vector} A new vector multiplied by scalar\r\n */\r\n Vector.mult = function(vector, scalar) {\r\n return { x: vector.x * scalar, y: vector.y * scalar };\r\n };\r\n\r\n /**\r\n * Divides a vector and a scalar.\r\n * @method div\r\n * @param {vector} vector\r\n * @param {number} scalar\r\n * @return {vector} A new vector divided by scalar\r\n */\r\n Vector.div = function(vector, scalar) {\r\n return { x: vector.x / scalar, y: vector.y / scalar };\r\n };\r\n\r\n /**\r\n * Returns the perpendicular vector. Set `negate` to true for the perpendicular in the opposite direction.\r\n * @method perp\r\n * @param {vector} vector\r\n * @param {bool} [negate=false]\r\n * @return {vector} The perpendicular vector\r\n */\r\n Vector.perp = function(vector, negate) {\r\n negate = negate === true ? -1 : 1;\r\n return { x: negate * -vector.y, y: negate * vector.x };\r\n };\r\n\r\n /**\r\n * Negates both components of a vector such that it points in the opposite direction.\r\n * @method neg\r\n * @param {vector} vector\r\n * @return {vector} The negated vector\r\n */\r\n Vector.neg = function(vector) {\r\n return { x: -vector.x, y: -vector.y };\r\n };\r\n\r\n /**\r\n * Returns the angle between the vector `vectorB - vectorA` and the x-axis in radians.\r\n * @method angle\r\n * @param {vector} vectorA\r\n * @param {vector} vectorB\r\n * @return {number} The angle in radians\r\n */\r\n Vector.angle = function(vectorA, vectorB) {\r\n return Math.atan2(vectorB.y - vectorA.y, vectorB.x - vectorA.x);\r\n };\r\n\r\n /**\r\n * Temporary vector pool (not thread-safe).\r\n * @property _temp\r\n * @type {vector[]}\r\n * @private\r\n */\r\n Vector._temp = [\r\n Vector.create(), Vector.create(), \r\n Vector.create(), Vector.create(), \r\n Vector.create(), Vector.create()\r\n ];\r\n\r\n})();\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/geometry/Vector.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices.\r\n* A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`.\r\n* A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull).\r\n*\r\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\r\n*\r\n* @class Vertices\r\n*/\r\n\r\nvar Vertices = {};\r\n\r\nmodule.exports = Vertices;\r\n\r\nvar Vector = __webpack_require__(/*! ../geometry/Vector */ \"./node_modules/phaser/src/physics/matter-js/lib/geometry/Vector.js\");\r\nvar Common = __webpack_require__(/*! ../core/Common */ \"./node_modules/phaser/src/physics/matter-js/lib/core/Common.js\");\r\n\r\n(function() {\r\n\r\n /**\r\n * Creates a new set of `Matter.Body` compatible vertices.\r\n * The `points` argument accepts an array of `Matter.Vector` points orientated around the origin `(0, 0)`, for example:\r\n *\r\n * [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }]\r\n *\r\n * The `Vertices.create` method returns a new array of vertices, which are similar to Matter.Vector objects,\r\n * but with some additional references required for efficient collision detection routines.\r\n *\r\n * Vertices must be specified in clockwise order.\r\n *\r\n * Note that the `body` argument is not optional, a `Matter.Body` reference must be provided.\r\n *\r\n * @method create\r\n * @param {vector[]} points\r\n * @param {body} body\r\n */\r\n Vertices.create = function(points, body) {\r\n var vertices = [];\r\n\r\n for (var i = 0; i < points.length; i++) {\r\n var point = points[i],\r\n vertex = {\r\n x: point.x,\r\n y: point.y,\r\n index: i,\r\n body: body,\r\n isInternal: false,\r\n contact: null,\r\n offset: null\r\n };\r\n\r\n vertex.contact = {\r\n vertex: vertex,\r\n normalImpulse: 0,\r\n tangentImpulse: 0\r\n };\r\n\r\n vertices.push(vertex);\r\n }\r\n\r\n return vertices;\r\n };\r\n\r\n /**\r\n * Parses a string containing ordered x y pairs separated by spaces (and optionally commas), \r\n * into a `Matter.Vertices` object for the given `Matter.Body`.\r\n * For parsing SVG paths, see `Svg.pathToVertices`.\r\n * @method fromPath\r\n * @param {string} path\r\n * @param {body} body\r\n * @return {vertices} vertices\r\n */\r\n Vertices.fromPath = function(path, body) {\r\n var pathPattern = /L?\\s*([-\\d.e]+)[\\s,]*([-\\d.e]+)*/ig,\r\n points = [];\r\n\r\n path.replace(pathPattern, function(match, x, y) {\r\n points.push({ x: parseFloat(x), y: parseFloat(y) });\r\n });\r\n\r\n return Vertices.create(points, body);\r\n };\r\n\r\n /**\r\n * Returns the centre (centroid) of the set of vertices.\r\n * @method centre\r\n * @param {vertices} vertices\r\n * @return {vector} The centre point\r\n */\r\n Vertices.centre = function(vertices) {\r\n var area = Vertices.area(vertices, true),\r\n centre = { x: 0, y: 0 },\r\n cross,\r\n temp,\r\n j;\r\n\r\n for (var i = 0; i < vertices.length; i++) {\r\n j = (i + 1) % vertices.length;\r\n cross = Vector.cross(vertices[i], vertices[j]);\r\n temp = Vector.mult(Vector.add(vertices[i], vertices[j]), cross);\r\n centre = Vector.add(centre, temp);\r\n }\r\n\r\n return Vector.div(centre, 6 * area);\r\n };\r\n\r\n /**\r\n * Returns the average (mean) of the set of vertices.\r\n * @method mean\r\n * @param {vertices} vertices\r\n * @return {vector} The average point\r\n */\r\n Vertices.mean = function(vertices) {\r\n var average = { x: 0, y: 0 };\r\n\r\n for (var i = 0; i < vertices.length; i++) {\r\n average.x += vertices[i].x;\r\n average.y += vertices[i].y;\r\n }\r\n\r\n return Vector.div(average, vertices.length);\r\n };\r\n\r\n /**\r\n * Returns the area of the set of vertices.\r\n * @method area\r\n * @param {vertices} vertices\r\n * @param {bool} signed\r\n * @return {number} The area\r\n */\r\n Vertices.area = function(vertices, signed) {\r\n var area = 0,\r\n j = vertices.length - 1;\r\n\r\n for (var i = 0; i < vertices.length; i++) {\r\n area += (vertices[j].x - vertices[i].x) * (vertices[j].y + vertices[i].y);\r\n j = i;\r\n }\r\n\r\n if (signed)\r\n return area / 2;\r\n\r\n return Math.abs(area) / 2;\r\n };\r\n\r\n /**\r\n * Returns the moment of inertia (second moment of area) of the set of vertices given the total mass.\r\n * @method inertia\r\n * @param {vertices} vertices\r\n * @param {number} mass\r\n * @return {number} The polygon's moment of inertia\r\n */\r\n Vertices.inertia = function(vertices, mass) {\r\n var numerator = 0,\r\n denominator = 0,\r\n v = vertices,\r\n cross,\r\n j;\r\n\r\n // find the polygon's moment of inertia, using second moment of area\r\n // from equations at http://www.physicsforums.com/showthread.php?t=25293\r\n for (var n = 0; n < v.length; n++) {\r\n j = (n + 1) % v.length;\r\n cross = Math.abs(Vector.cross(v[j], v[n]));\r\n numerator += cross * (Vector.dot(v[j], v[j]) + Vector.dot(v[j], v[n]) + Vector.dot(v[n], v[n]));\r\n denominator += cross;\r\n }\r\n\r\n return (mass / 6) * (numerator / denominator);\r\n };\r\n\r\n /**\r\n * Translates the set of vertices in-place.\r\n * @method translate\r\n * @param {vertices} vertices\r\n * @param {vector} vector\r\n * @param {number} scalar\r\n */\r\n Vertices.translate = function(vertices, vector, scalar) {\r\n var i;\r\n if (scalar) {\r\n for (i = 0; i < vertices.length; i++) {\r\n vertices[i].x += vector.x * scalar;\r\n vertices[i].y += vector.y * scalar;\r\n }\r\n } else {\r\n for (i = 0; i < vertices.length; i++) {\r\n vertices[i].x += vector.x;\r\n vertices[i].y += vector.y;\r\n }\r\n }\r\n\r\n return vertices;\r\n };\r\n\r\n /**\r\n * Rotates the set of vertices in-place.\r\n * @method rotate\r\n * @param {vertices} vertices\r\n * @param {number} angle\r\n * @param {vector} point\r\n */\r\n Vertices.rotate = function(vertices, angle, point) {\r\n if (angle === 0)\r\n return;\r\n\r\n var cos = Math.cos(angle),\r\n sin = Math.sin(angle);\r\n\r\n for (var i = 0; i < vertices.length; i++) {\r\n var vertice = vertices[i],\r\n dx = vertice.x - point.x,\r\n dy = vertice.y - point.y;\r\n \r\n vertice.x = point.x + (dx * cos - dy * sin);\r\n vertice.y = point.y + (dx * sin + dy * cos);\r\n }\r\n\r\n return vertices;\r\n };\r\n\r\n /**\r\n * Returns `true` if the `point` is inside the set of `vertices`.\r\n * @method contains\r\n * @param {vertices} vertices\r\n * @param {vector} point\r\n * @return {boolean} True if the vertices contains point, otherwise false\r\n */\r\n Vertices.contains = function(vertices, point) {\r\n for (var i = 0; i < vertices.length; i++) {\r\n var vertice = vertices[i],\r\n nextVertice = vertices[(i + 1) % vertices.length];\r\n if ((point.x - vertice.x) * (nextVertice.y - vertice.y) + (point.y - vertice.y) * (vertice.x - nextVertice.x) > 0) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n };\r\n\r\n /**\r\n * Scales the vertices from a point (default is centre) in-place.\r\n * @method scale\r\n * @param {vertices} vertices\r\n * @param {number} scaleX\r\n * @param {number} scaleY\r\n * @param {vector} point\r\n */\r\n Vertices.scale = function(vertices, scaleX, scaleY, point) {\r\n if (scaleX === 1 && scaleY === 1)\r\n return vertices;\r\n\r\n point = point || Vertices.centre(vertices);\r\n\r\n var vertex,\r\n delta;\r\n\r\n for (var i = 0; i < vertices.length; i++) {\r\n vertex = vertices[i];\r\n delta = Vector.sub(vertex, point);\r\n vertices[i].x = point.x + delta.x * scaleX;\r\n vertices[i].y = point.y + delta.y * scaleY;\r\n }\r\n\r\n return vertices;\r\n };\r\n\r\n /**\r\n * Chamfers a set of vertices by giving them rounded corners, returns a new set of vertices.\r\n * The radius parameter is a single number or an array to specify the radius for each vertex.\r\n * @method chamfer\r\n * @param {vertices} vertices\r\n * @param {number[]} radius\r\n * @param {number} quality\r\n * @param {number} qualityMin\r\n * @param {number} qualityMax\r\n */\r\n Vertices.chamfer = function(vertices, radius, quality, qualityMin, qualityMax) {\r\n if (typeof radius === 'number') {\r\n radius = [radius];\r\n } else {\r\n radius = radius || [8];\r\n }\r\n\r\n // quality defaults to -1, which is auto\r\n quality = (typeof quality !== 'undefined') ? quality : -1;\r\n qualityMin = qualityMin || 2;\r\n qualityMax = qualityMax || 14;\r\n\r\n var newVertices = [];\r\n\r\n for (var i = 0; i < vertices.length; i++) {\r\n var prevVertex = vertices[i - 1 >= 0 ? i - 1 : vertices.length - 1],\r\n vertex = vertices[i],\r\n nextVertex = vertices[(i + 1) % vertices.length],\r\n currentRadius = radius[i < radius.length ? i : radius.length - 1];\r\n\r\n if (currentRadius === 0) {\r\n newVertices.push(vertex);\r\n continue;\r\n }\r\n\r\n var prevNormal = Vector.normalise({ \r\n x: vertex.y - prevVertex.y, \r\n y: prevVertex.x - vertex.x\r\n });\r\n\r\n var nextNormal = Vector.normalise({ \r\n x: nextVertex.y - vertex.y, \r\n y: vertex.x - nextVertex.x\r\n });\r\n\r\n var diagonalRadius = Math.sqrt(2 * Math.pow(currentRadius, 2)),\r\n radiusVector = Vector.mult(Common.clone(prevNormal), currentRadius),\r\n midNormal = Vector.normalise(Vector.mult(Vector.add(prevNormal, nextNormal), 0.5)),\r\n scaledVertex = Vector.sub(vertex, Vector.mult(midNormal, diagonalRadius));\r\n\r\n var precision = quality;\r\n\r\n if (quality === -1) {\r\n // automatically decide precision\r\n precision = Math.pow(currentRadius, 0.32) * 1.75;\r\n }\r\n\r\n precision = Common.clamp(precision, qualityMin, qualityMax);\r\n\r\n // use an even value for precision, more likely to reduce axes by using symmetry\r\n if (precision % 2 === 1)\r\n precision += 1;\r\n\r\n var alpha = Math.acos(Vector.dot(prevNormal, nextNormal)),\r\n theta = alpha / precision;\r\n\r\n for (var j = 0; j < precision; j++) {\r\n newVertices.push(Vector.add(Vector.rotate(radiusVector, theta * j), scaledVertex));\r\n }\r\n }\r\n\r\n return newVertices;\r\n };\r\n\r\n /**\r\n * Sorts the input vertices into clockwise order in place.\r\n * @method clockwiseSort\r\n * @param {vertices} vertices\r\n * @return {vertices} vertices\r\n */\r\n Vertices.clockwiseSort = function(vertices) {\r\n var centre = Vertices.mean(vertices);\r\n\r\n vertices.sort(function(vertexA, vertexB) {\r\n return Vector.angle(centre, vertexA) - Vector.angle(centre, vertexB);\r\n });\r\n\r\n return vertices;\r\n };\r\n\r\n /**\r\n * Returns true if the vertices form a convex shape (vertices must be in clockwise order).\r\n * @method isConvex\r\n * @param {vertices} vertices\r\n * @return {bool} `true` if the `vertices` are convex, `false` if not (or `null` if not computable).\r\n */\r\n Vertices.isConvex = function(vertices) {\r\n // http://paulbourke.net/geometry/polygonmesh/\r\n // Copyright (c) Paul Bourke (use permitted)\r\n\r\n var flag = 0,\r\n n = vertices.length,\r\n i,\r\n j,\r\n k,\r\n z;\r\n\r\n if (n < 3)\r\n return null;\r\n\r\n for (i = 0; i < n; i++) {\r\n j = (i + 1) % n;\r\n k = (i + 2) % n;\r\n z = (vertices[j].x - vertices[i].x) * (vertices[k].y - vertices[j].y);\r\n z -= (vertices[j].y - vertices[i].y) * (vertices[k].x - vertices[j].x);\r\n\r\n if (z < 0) {\r\n flag |= 1;\r\n } else if (z > 0) {\r\n flag |= 2;\r\n }\r\n\r\n if (flag === 3) {\r\n return false;\r\n }\r\n }\r\n\r\n if (flag !== 0){\r\n return true;\r\n } else {\r\n return null;\r\n }\r\n };\r\n\r\n /**\r\n * Returns the convex hull of the input vertices as a new array of points.\r\n * @method hull\r\n * @param {vertices} vertices\r\n * @return [vertex] vertices\r\n */\r\n Vertices.hull = function(vertices) {\r\n // http://geomalgorithms.com/a10-_hull-1.html\r\n\r\n var upper = [],\r\n lower = [], \r\n vertex,\r\n i;\r\n\r\n // sort vertices on x-axis (y-axis for ties)\r\n vertices = vertices.slice(0);\r\n vertices.sort(function(vertexA, vertexB) {\r\n var dx = vertexA.x - vertexB.x;\r\n return dx !== 0 ? dx : vertexA.y - vertexB.y;\r\n });\r\n\r\n // build lower hull\r\n for (i = 0; i < vertices.length; i += 1) {\r\n vertex = vertices[i];\r\n\r\n while (lower.length >= 2 \r\n && Vector.cross3(lower[lower.length - 2], lower[lower.length - 1], vertex) <= 0) {\r\n lower.pop();\r\n }\r\n\r\n lower.push(vertex);\r\n }\r\n\r\n // build upper hull\r\n for (i = vertices.length - 1; i >= 0; i -= 1) {\r\n vertex = vertices[i];\r\n\r\n while (upper.length >= 2 \r\n && Vector.cross3(upper[upper.length - 2], upper[upper.length - 1], vertex) <= 0) {\r\n upper.pop();\r\n }\r\n\r\n upper.push(vertex);\r\n }\r\n\r\n // concatenation of the lower and upper hulls gives the convex hull\r\n // omit last points because they are repeated at the beginning of the other list\r\n upper.pop();\r\n lower.pop();\r\n\r\n return upper.concat(lower);\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/geometry/Vertices.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/plugins/MatterAttractors.js": /*!***********************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/plugins/MatterAttractors.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Matter = __webpack_require__(/*! ../../CustomMain */ \"./node_modules/phaser/src/physics/matter-js/CustomMain.js\");\r\n\r\n/**\r\n * An attractors plugin for matter.js.\r\n * See the readme for usage and examples.\r\n * @module MatterAttractors\r\n */\r\nvar MatterAttractors = {\r\n // plugin meta\r\n name: 'matter-attractors', // PLUGIN_NAME\r\n version: '0.1.7', // PLUGIN_VERSION\r\n for: 'matter-js@^0.14.2',\r\n silent: true, // no console log please\r\n\r\n // installs the plugin where `base` is `Matter`\r\n // you should not need to call this directly.\r\n install: function(base) {\r\n base.after('Body.create', function() {\r\n MatterAttractors.Body.init(this);\r\n });\r\n\r\n base.before('Engine.update', function(engine) {\r\n MatterAttractors.Engine.update(engine);\r\n });\r\n },\r\n\r\n Body: {\r\n /**\r\n * Initialises the `body` to support attractors.\r\n * This is called automatically by the plugin.\r\n * @function MatterAttractors.Body.init\r\n * @param {Matter.Body} body The body to init.\r\n * @returns {void} No return value.\r\n */\r\n init: function(body) {\r\n body.plugin.attractors = body.plugin.attractors || [];\r\n }\r\n },\r\n\r\n Engine: {\r\n /**\r\n * Applies all attractors for all bodies in the `engine`.\r\n * This is called automatically by the plugin.\r\n * @function MatterAttractors.Engine.update\r\n * @param {Matter.Engine} engine The engine to update.\r\n * @returns {void} No return value.\r\n */\r\n update: function(engine) {\r\n var world = engine.world,\r\n bodies = Matter.Composite.allBodies(world);\r\n\r\n for (var i = 0; i < bodies.length; i += 1) {\r\n var bodyA = bodies[i],\r\n attractors = bodyA.plugin.attractors;\r\n\r\n if (attractors && attractors.length > 0) {\r\n for (var j = i + 1; j < bodies.length; j += 1) {\r\n var bodyB = bodies[j];\r\n\r\n for (var k = 0; k < attractors.length; k += 1) {\r\n var attractor = attractors[k],\r\n forceVector = attractor;\r\n\r\n if (Matter.Common.isFunction(attractor)) {\r\n forceVector = attractor(bodyA, bodyB);\r\n }\r\n\r\n if (forceVector) {\r\n Matter.Body.applyForce(bodyB, bodyB.position, forceVector);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Defines some useful common attractor functions that can be used\r\n * by pushing them to your body's `body.plugin.attractors` array.\r\n * @namespace MatterAttractors.Attractors\r\n * @property {number} gravityConstant The gravitational constant used by the gravity attractor.\r\n */\r\n Attractors: {\r\n gravityConstant: 0.001,\r\n\r\n /**\r\n * An attractor function that applies Newton's law of gravitation.\r\n * Use this by pushing `MatterAttractors.Attractors.gravity` to your body's `body.plugin.attractors` array.\r\n * The gravitational constant defaults to `0.001` which you can change\r\n * at `MatterAttractors.Attractors.gravityConstant`.\r\n * @function MatterAttractors.Attractors.gravity\r\n * @param {Matter.Body} bodyA The first body.\r\n * @param {Matter.Body} bodyB The second body.\r\n * @returns {void} No return value.\r\n */\r\n gravity: function(bodyA, bodyB) {\r\n // use Newton's law of gravitation\r\n var bToA = Matter.Vector.sub(bodyB.position, bodyA.position),\r\n distanceSq = Matter.Vector.magnitudeSquared(bToA) || 0.0001,\r\n normal = Matter.Vector.normalise(bToA),\r\n magnitude = -MatterAttractors.Attractors.gravityConstant * (bodyA.mass * bodyB.mass / distanceSq),\r\n force = Matter.Vector.mult(normal, magnitude);\r\n\r\n // to apply forces to both bodies\r\n Matter.Body.applyForce(bodyA, bodyA.position, Matter.Vector.neg(force));\r\n Matter.Body.applyForce(bodyB, bodyB.position, force);\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = MatterAttractors;\r\n\r\n/**\r\n * @namespace Matter.Body\r\n * @see http://brm.io/matter-js/docs/classes/Body.html\r\n */\r\n\r\n/**\r\n * This plugin adds a new property `body.plugin.attractors` to instances of `Matter.Body`.\r\n * This is an array of callback functions that will be called automatically\r\n * for every pair of bodies, on every engine update.\r\n * @property {Function[]} body.plugin.attractors\r\n * @memberof Matter.Body\r\n */\r\n\r\n/**\r\n * An attractor function calculates the force to be applied\r\n * to `bodyB`, it should either:\r\n * - return the force vector to be applied to `bodyB`\r\n * - or apply the force to the body(s) itself\r\n * @callback AttractorFunction\r\n * @param {Matter.Body} bodyA\r\n * @param {Matter.Body} bodyB\r\n * @returns {(Vector|undefined)} a force vector (optional)\r\n */\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/plugins/MatterAttractors.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/plugins/MatterCollisionEvents.js": /*!****************************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/plugins/MatterCollisionEvents.js ***! \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author @dxu https://github.com/dxu/matter-collision-events\r\n * @author Richard Davey \r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MatterCollisionEvents = {\r\n\r\n name: 'matter-collision-events',\r\n version: '0.1.6',\r\n for: 'matter-js@^0.14.2',\r\n silent: true,\r\n\r\n install: function (matter)\r\n {\r\n matter.after('Engine.create', function ()\r\n {\r\n matter.Events.on(this, 'collisionStart', function (event)\r\n {\r\n event.pairs.map(function (pair)\r\n {\r\n var bodyA = pair.bodyA;\r\n var bodyB = pair.bodyB;\r\n\r\n if (bodyA.gameObject)\r\n {\r\n bodyA.gameObject.emit('collide', bodyA, bodyB, pair);\r\n }\r\n\r\n if (bodyB.gameObject)\r\n {\r\n bodyB.gameObject.emit('collide', bodyB, bodyA, pair);\r\n }\r\n\r\n matter.Events.trigger(bodyA, 'onCollide', { pair: pair });\r\n matter.Events.trigger(bodyB, 'onCollide', { pair: pair });\r\n\r\n if (bodyA.onCollideCallback)\r\n {\r\n bodyA.onCollideCallback(pair);\r\n }\r\n\r\n if (bodyB.onCollideCallback)\r\n {\r\n bodyB.onCollideCallback(pair);\r\n }\r\n\r\n if (bodyA.onCollideWith[bodyB.id])\r\n {\r\n bodyA.onCollideWith[bodyB.id](bodyB, pair);\r\n }\r\n\r\n if (bodyB.onCollideWith[bodyA.id])\r\n {\r\n bodyB.onCollideWith[bodyA.id](bodyA, pair);\r\n }\r\n });\r\n });\r\n\r\n matter.Events.on(this, 'collisionActive', function (event)\r\n {\r\n event.pairs.map(function (pair)\r\n {\r\n var bodyA = pair.bodyA;\r\n var bodyB = pair.bodyB;\r\n\r\n if (bodyA.gameObject)\r\n {\r\n bodyA.gameObject.emit('collideActive', bodyA, bodyB, pair);\r\n }\r\n\r\n if (bodyB.gameObject)\r\n {\r\n bodyB.gameObject.emit('collideActive', bodyB, bodyA, pair);\r\n }\r\n\r\n matter.Events.trigger(bodyA, 'onCollideActive', { pair: pair });\r\n matter.Events.trigger(bodyB, 'onCollideActive', { pair: pair });\r\n\r\n if (bodyA.onCollideActiveCallback)\r\n {\r\n bodyA.onCollideActiveCallback(pair);\r\n }\r\n\r\n if (bodyB.onCollideActiveCallback)\r\n {\r\n bodyB.onCollideActiveCallback(pair);\r\n }\r\n });\r\n });\r\n\r\n matter.Events.on(this, 'collisionEnd', function (event)\r\n {\r\n event.pairs.map(function (pair)\r\n {\r\n var bodyA = pair.bodyA;\r\n var bodyB = pair.bodyB;\r\n\r\n if (bodyA.gameObject)\r\n {\r\n bodyA.gameObject.emit('collideEnd', bodyA, bodyB, pair);\r\n }\r\n\r\n if (bodyB.gameObject)\r\n {\r\n bodyB.gameObject.emit('collideEnd', bodyB, bodyA, pair);\r\n }\r\n\r\n matter.Events.trigger(bodyA, 'onCollideEnd', { pair: pair });\r\n matter.Events.trigger(bodyB, 'onCollideEnd', { pair: pair });\r\n\r\n if (bodyA.onCollideEndCallback)\r\n {\r\n bodyA.onCollideEndCallback(pair);\r\n }\r\n\r\n if (bodyB.onCollideEndCallback)\r\n {\r\n bodyB.onCollideEndCallback(pair);\r\n }\r\n });\r\n });\r\n });\r\n }\r\n};\r\n\r\nmodule.exports = MatterCollisionEvents;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/plugins/MatterCollisionEvents.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/lib/plugins/MatterWrap.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/lib/plugins/MatterWrap.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Matter = __webpack_require__(/*! ../../CustomMain */ \"./node_modules/phaser/src/physics/matter-js/CustomMain.js\");\r\n\r\n/**\r\n * A coordinate wrapping plugin for matter.js.\r\n * See the readme for usage and examples.\r\n * @module MatterWrap\r\n */\r\nvar MatterWrap = {\r\n // plugin meta\r\n name: 'matter-wrap', // PLUGIN_NAME\r\n version: '0.1.4', // PLUGIN_VERSION\r\n for: 'matter-js@^0.14.2',\r\n silent: true, // no console log please\r\n\r\n // installs the plugin where `base` is `Matter`\r\n // you should not need to call this directly.\r\n install: function(base) {\r\n base.after('Engine.update', function() {\r\n MatterWrap.Engine.update(this);\r\n });\r\n },\r\n\r\n Engine: {\r\n /**\r\n * Updates the engine by wrapping bodies and composites inside `engine.world`.\r\n * This is called automatically by the plugin.\r\n * @function MatterWrap.Engine.update\r\n * @param {Matter.Engine} engine The engine to update.\r\n * @returns {void} No return value.\r\n */\r\n update: function(engine) {\r\n var world = engine.world,\r\n bodies = Matter.Composite.allBodies(world),\r\n composites = Matter.Composite.allComposites(world);\r\n\r\n for (var i = 0; i < bodies.length; i += 1) {\r\n var body = bodies[i];\r\n\r\n if (body.plugin.wrap) {\r\n MatterWrap.Body.wrap(body, body.plugin.wrap);\r\n }\r\n }\r\n\r\n for (i = 0; i < composites.length; i += 1) {\r\n var composite = composites[i];\r\n\r\n if (composite.plugin.wrap) {\r\n MatterWrap.Composite.wrap(composite, composite.plugin.wrap);\r\n }\r\n }\r\n }\r\n },\r\n\r\n Bounds: {\r\n /**\r\n * Returns a translation vector that wraps the `objectBounds` inside the `bounds`.\r\n * @function MatterWrap.Bounds.wrap\r\n * @param {Matter.Bounds} objectBounds The bounds of the object to wrap inside the bounds.\r\n * @param {Matter.Bounds} bounds The bounds to wrap the body inside.\r\n * @returns {?Matter.Vector} A translation vector (only if wrapping is required).\r\n */\r\n wrap: function(objectBounds, bounds) {\r\n var x = null,\r\n y = null;\r\n\r\n if (typeof bounds.min.x !== 'undefined' && typeof bounds.max.x !== 'undefined') {\r\n if (objectBounds.min.x > bounds.max.x) {\r\n x = bounds.min.x - objectBounds.max.x;\r\n } else if (objectBounds.max.x < bounds.min.x) {\r\n x = bounds.max.x - objectBounds.min.x;\r\n }\r\n }\r\n\r\n if (typeof bounds.min.y !== 'undefined' && typeof bounds.max.y !== 'undefined') {\r\n if (objectBounds.min.y > bounds.max.y) {\r\n y = bounds.min.y - objectBounds.max.y;\r\n } else if (objectBounds.max.y < bounds.min.y) {\r\n y = bounds.max.y - objectBounds.min.y;\r\n }\r\n }\r\n\r\n if (x !== null || y !== null) {\r\n return {\r\n x: x || 0,\r\n y: y || 0\r\n };\r\n }\r\n }\r\n },\r\n\r\n Body: {\r\n /**\r\n * Wraps the `body` position such that it always stays within the given bounds. \r\n * Upon crossing a boundary the body will appear on the opposite side of the bounds, \r\n * while maintaining its velocity.\r\n * This is called automatically by the plugin.\r\n * @function MatterWrap.Body.wrap\r\n * @param {Matter.Body} body The body to wrap.\r\n * @param {Matter.Bounds} bounds The bounds to wrap the body inside.\r\n * @returns {?Matter.Vector} The translation vector that was applied (only if wrapping was required).\r\n */\r\n wrap: function(body, bounds) {\r\n var translation = MatterWrap.Bounds.wrap(body.bounds, bounds);\r\n\r\n if (translation) {\r\n Matter.Body.translate(body, translation);\r\n }\r\n\r\n return translation;\r\n }\r\n },\r\n\r\n Composite: {\r\n /**\r\n * Returns the union of the bounds of all of the composite's bodies\r\n * (not accounting for constraints).\r\n * @function MatterWrap.Composite.bounds\r\n * @param {Matter.Composite} composite The composite.\r\n * @returns {Matter.Bounds} The composite bounds.\r\n */\r\n bounds: function(composite) {\r\n var bodies = Matter.Composite.allBodies(composite),\r\n vertices = [];\r\n \r\n for (var i = 0; i < bodies.length; i += 1) {\r\n var body = bodies[i];\r\n vertices.push(body.bounds.min, body.bounds.max);\r\n }\r\n\r\n return Matter.Bounds.create(vertices);\r\n },\r\n\r\n /**\r\n * Wraps the `composite` position such that it always stays within the given bounds. \r\n * Upon crossing a boundary the composite will appear on the opposite side of the bounds, \r\n * while maintaining its velocity.\r\n * This is called automatically by the plugin.\r\n * @function MatterWrap.Composite.wrap\r\n * @param {Matter.Composite} composite The composite to wrap.\r\n * @param {Matter.Bounds} bounds The bounds to wrap the composite inside.\r\n * @returns {?Matter.Vector} The translation vector that was applied (only if wrapping was required).\r\n */\r\n wrap: function(composite, bounds) {\r\n var translation = MatterWrap.Bounds.wrap(\r\n MatterWrap.Composite.bounds(composite), \r\n bounds\r\n );\r\n\r\n if (translation) {\r\n Matter.Composite.translate(composite, translation);\r\n }\r\n\r\n return translation;\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = MatterWrap;\r\n\r\n/**\r\n * @namespace Matter.Body\r\n * @see http://brm.io/matter-js/docs/classes/Body.html\r\n */\r\n\r\n/**\r\n * This plugin adds a new property `body.plugin.wrap` to instances of `Matter.Body`. \r\n * This is a `Matter.Bounds` instance that specifies the wrapping region.\r\n * @property {Matter.Bounds} body.plugin.wrap\r\n * @memberof Matter.Body\r\n */\r\n\r\n/**\r\n * This plugin adds a new property `composite.plugin.wrap` to instances of `Matter.Composite`. \r\n * This is a `Matter.Bounds` instance that specifies the wrapping region.\r\n * @property {Matter.Bounds} composite.plugin.wrap\r\n * @memberof Matter.Composite\r\n */\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/lib/plugins/MatterWrap.js?"); /***/ }), /***/ "./node_modules/phaser/src/physics/matter-js/poly-decomp/index.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/physics/matter-js/poly-decomp/index.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Stefan Hedman (http://steffe.se)\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// v0.3.0\r\n\r\nmodule.exports = {\r\n decomp: polygonDecomp,\r\n quickDecomp: polygonQuickDecomp,\r\n isSimple: polygonIsSimple,\r\n removeCollinearPoints: polygonRemoveCollinearPoints,\r\n removeDuplicatePoints: polygonRemoveDuplicatePoints,\r\n makeCCW: polygonMakeCCW\r\n};\r\n\r\n/**\r\n * Compute the intersection between two lines.\r\n * @static\r\n * @method lineInt\r\n * @param {Array} l1 Line vector 1\r\n * @param {Array} l2 Line vector 2\r\n * @param {Number} precision Precision to use when checking if the lines are parallel\r\n * @return {Array} The intersection point.\r\n */\r\nfunction lineInt(l1,l2,precision){\r\n precision = precision || 0;\r\n var i = [0,0]; // point\r\n var a1, b1, c1, a2, b2, c2, det; // scalars\r\n a1 = l1[1][1] - l1[0][1];\r\n b1 = l1[0][0] - l1[1][0];\r\n c1 = a1 * l1[0][0] + b1 * l1[0][1];\r\n a2 = l2[1][1] - l2[0][1];\r\n b2 = l2[0][0] - l2[1][0];\r\n c2 = a2 * l2[0][0] + b2 * l2[0][1];\r\n det = a1 * b2 - a2*b1;\r\n if (!scalar_eq(det, 0, precision)) { // lines are not parallel\r\n i[0] = (b2 * c1 - b1 * c2) / det;\r\n i[1] = (a1 * c2 - a2 * c1) / det;\r\n }\r\n return i;\r\n}\r\n\r\n/**\r\n * Checks if two line segments intersects.\r\n * @method segmentsIntersect\r\n * @param {Array} p1 The start vertex of the first line segment.\r\n * @param {Array} p2 The end vertex of the first line segment.\r\n * @param {Array} q1 The start vertex of the second line segment.\r\n * @param {Array} q2 The end vertex of the second line segment.\r\n * @return {Boolean} True if the two line segments intersect\r\n */\r\nfunction lineSegmentsIntersect(p1, p2, q1, q2){\r\n\tvar dx = p2[0] - p1[0];\r\n\tvar dy = p2[1] - p1[1];\r\n\tvar da = q2[0] - q1[0];\r\n\tvar db = q2[1] - q1[1];\r\n\r\n\t// segments are parallel\r\n\tif((da*dy - db*dx) === 0){\r\n\t\treturn false;\r\n\t}\r\n\r\n\tvar s = (dx * (q1[1] - p1[1]) + dy * (p1[0] - q1[0])) / (da * dy - db * dx);\r\n\tvar t = (da * (p1[1] - q1[1]) + db * (q1[0] - p1[0])) / (db * dx - da * dy);\r\n\r\n\treturn (s>=0 && s<=1 && t>=0 && t<=1);\r\n}\r\n\r\n/**\r\n * Get the area of a triangle spanned by the three given points. Note that the area will be negative if the points are not given in counter-clockwise order.\r\n * @static\r\n * @method area\r\n * @param {Array} a\r\n * @param {Array} b\r\n * @param {Array} c\r\n * @return {Number}\r\n */\r\nfunction triangleArea(a,b,c){\r\n return (((b[0] - a[0])*(c[1] - a[1]))-((c[0] - a[0])*(b[1] - a[1])));\r\n}\r\n\r\nfunction isLeft(a,b,c){\r\n return triangleArea(a,b,c) > 0;\r\n}\r\n\r\nfunction isLeftOn(a,b,c) {\r\n return triangleArea(a, b, c) >= 0;\r\n}\r\n\r\nfunction isRight(a,b,c) {\r\n return triangleArea(a, b, c) < 0;\r\n}\r\n\r\nfunction isRightOn(a,b,c) {\r\n return triangleArea(a, b, c) <= 0;\r\n}\r\n\r\nvar tmpPoint1 = [],\r\n tmpPoint2 = [];\r\n\r\n/**\r\n * Check if three points are collinear\r\n * @method collinear\r\n * @param {Array} a\r\n * @param {Array} b\r\n * @param {Array} c\r\n * @param {Number} [thresholdAngle=0] Threshold angle to use when comparing the vectors. The function will return true if the angle between the resulting vectors is less than this value. Use zero for max precision.\r\n * @return {Boolean}\r\n */\r\nfunction collinear(a,b,c,thresholdAngle) {\r\n if(!thresholdAngle){\r\n return triangleArea(a, b, c) === 0;\r\n } else {\r\n var ab = tmpPoint1,\r\n bc = tmpPoint2;\r\n\r\n ab[0] = b[0]-a[0];\r\n ab[1] = b[1]-a[1];\r\n bc[0] = c[0]-b[0];\r\n bc[1] = c[1]-b[1];\r\n\r\n var dot = ab[0]*bc[0] + ab[1]*bc[1],\r\n magA = Math.sqrt(ab[0]*ab[0] + ab[1]*ab[1]),\r\n magB = Math.sqrt(bc[0]*bc[0] + bc[1]*bc[1]),\r\n angle = Math.acos(dot/(magA*magB));\r\n return angle < thresholdAngle;\r\n }\r\n}\r\n\r\nfunction sqdist(a,b){\r\n var dx = b[0] - a[0];\r\n var dy = b[1] - a[1];\r\n return dx * dx + dy * dy;\r\n}\r\n\r\n/**\r\n * Get a vertex at position i. It does not matter if i is out of bounds, this function will just cycle.\r\n * @method at\r\n * @param {Number} i\r\n * @return {Array}\r\n */\r\nfunction polygonAt(polygon, i){\r\n var s = polygon.length;\r\n return polygon[i < 0 ? i % s + s : i % s];\r\n}\r\n\r\n/**\r\n * Clear the polygon data\r\n * @method clear\r\n * @return {Array}\r\n */\r\nfunction polygonClear(polygon){\r\n polygon.length = 0;\r\n}\r\n\r\n/**\r\n * Append points \"from\" to \"to\"-1 from an other polygon \"poly\" onto this one.\r\n * @method append\r\n * @param {Polygon} poly The polygon to get points from.\r\n * @param {Number} from The vertex index in \"poly\".\r\n * @param {Number} to The end vertex index in \"poly\". Note that this vertex is NOT included when appending.\r\n * @return {Array}\r\n */\r\nfunction polygonAppend(polygon, poly, from, to){\r\n for(var i=from; i v[br][0])) {\r\n br = i;\r\n }\r\n }\r\n\r\n // reverse poly if clockwise\r\n if (!isLeft(polygonAt(polygon, br - 1), polygonAt(polygon, br), polygonAt(polygon, br + 1))) {\r\n polygonReverse(polygon);\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}\r\n\r\n/**\r\n * Reverse the vertices in the polygon\r\n * @method reverse\r\n */\r\nfunction polygonReverse(polygon){\r\n var tmp = [];\r\n var N = polygon.length;\r\n for(var i=0; i!==N; i++){\r\n tmp.push(polygon.pop());\r\n }\r\n for(var i=0; i!==N; i++){\r\n\t\tpolygon[i] = tmp[i];\r\n }\r\n}\r\n\r\n/**\r\n * Check if a point in the polygon is a reflex point\r\n * @method isReflex\r\n * @param {Number} i\r\n * @return {Boolean}\r\n */\r\nfunction polygonIsReflex(polygon, i){\r\n return isRight(polygonAt(polygon, i - 1), polygonAt(polygon, i), polygonAt(polygon, i + 1));\r\n}\r\n\r\nvar tmpLine1=[],\r\n tmpLine2=[];\r\n\r\n/**\r\n * Check if two vertices in the polygon can see each other\r\n * @method canSee\r\n * @param {Number} a Vertex index 1\r\n * @param {Number} b Vertex index 2\r\n * @return {Boolean}\r\n */\r\nfunction polygonCanSee(polygon, a,b) {\r\n var p, dist, l1=tmpLine1, l2=tmpLine2;\r\n\r\n if (isLeftOn(polygonAt(polygon, a + 1), polygonAt(polygon, a), polygonAt(polygon, b)) && isRightOn(polygonAt(polygon, a - 1), polygonAt(polygon, a), polygonAt(polygon, b))) {\r\n return false;\r\n }\r\n dist = sqdist(polygonAt(polygon, a), polygonAt(polygon, b));\r\n for (var i = 0; i !== polygon.length; ++i) { // for each edge\r\n if ((i + 1) % polygon.length === a || i === a){ // ignore incident edges\r\n continue;\r\n }\r\n if (isLeftOn(polygonAt(polygon, a), polygonAt(polygon, b), polygonAt(polygon, i + 1)) && isRightOn(polygonAt(polygon, a), polygonAt(polygon, b), polygonAt(polygon, i))) { // if diag intersects an edge\r\n l1[0] = polygonAt(polygon, a);\r\n l1[1] = polygonAt(polygon, b);\r\n l2[0] = polygonAt(polygon, i);\r\n l2[1] = polygonAt(polygon, i + 1);\r\n p = lineInt(l1,l2);\r\n if (sqdist(polygonAt(polygon, a), p) < dist) { // if edge is blocking visibility to b\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n}\r\n\r\n/**\r\n * Check if two vertices in the polygon can see each other\r\n * @method canSee2\r\n * @param {Number} a Vertex index 1\r\n * @param {Number} b Vertex index 2\r\n * @return {Boolean}\r\n */\r\nfunction polygonCanSee2(polygon, a,b) {\r\n // for each edge\r\n for (var i = 0; i !== polygon.length; ++i) {\r\n // ignore incident edges\r\n if (i === a || i === b || (i + 1) % polygon.length === a || (i + 1) % polygon.length === b){\r\n continue;\r\n }\r\n if( lineSegmentsIntersect(polygonAt(polygon, a), polygonAt(polygon, b), polygonAt(polygon, i), polygonAt(polygon, i+1)) ){\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n\r\n/**\r\n * Copy the polygon from vertex i to vertex j.\r\n * @method copy\r\n * @param {Number} i\r\n * @param {Number} j\r\n * @param {Polygon} [targetPoly] Optional target polygon to save in.\r\n * @return {Polygon} The resulting copy.\r\n */\r\nfunction polygonCopy(polygon, i,j,targetPoly){\r\n var p = targetPoly || [];\r\n polygonClear(p);\r\n if (i < j) {\r\n // Insert all vertices from i to j\r\n for(var k=i; k<=j; k++){\r\n p.push(polygon[k]);\r\n }\r\n\r\n } else {\r\n\r\n // Insert vertices 0 to j\r\n for(var k=0; k<=j; k++){\r\n p.push(polygon[k]);\r\n }\r\n\r\n // Insert vertices i to end\r\n for(var k=i; k 0){\r\n return polygonSlice(polygon, edges);\r\n } else {\r\n return [polygon];\r\n }\r\n}\r\n\r\n/**\r\n * Slices the polygon given one or more cut edges. If given one, this function will return two polygons (false on failure). If many, an array of polygons.\r\n * @method slice\r\n * @param {Array} cutEdges A list of edges, as returned by .getCutEdges()\r\n * @return {Array}\r\n */\r\nfunction polygonSlice(polygon, cutEdges){\r\n if(cutEdges.length === 0){\r\n\t\treturn [polygon];\r\n }\r\n if(cutEdges instanceof Array && cutEdges.length && cutEdges[0] instanceof Array && cutEdges[0].length===2 && cutEdges[0][0] instanceof Array){\r\n\r\n var polys = [polygon];\r\n\r\n for(var i=0; i maxlevel){\r\n console.warn(\"quickDecomp: max level (\"+maxlevel+\") reached.\");\r\n return result;\r\n }\r\n\r\n for (var i = 0; i < polygon.length; ++i) {\r\n if (polygonIsReflex(poly, i)) {\r\n reflexVertices.push(poly[i]);\r\n upperDist = lowerDist = Number.MAX_VALUE;\r\n\r\n\r\n for (var j = 0; j < polygon.length; ++j) {\r\n if (isLeft(polygonAt(poly, i - 1), polygonAt(poly, i), polygonAt(poly, j)) && isRightOn(polygonAt(poly, i - 1), polygonAt(poly, i), polygonAt(poly, j - 1))) { // if line intersects with an edge\r\n p = getIntersectionPoint(polygonAt(poly, i - 1), polygonAt(poly, i), polygonAt(poly, j), polygonAt(poly, j - 1)); // find the point of intersection\r\n if (isRight(polygonAt(poly, i + 1), polygonAt(poly, i), p)) { // make sure it's inside the poly\r\n d = sqdist(poly[i], p);\r\n if (d < lowerDist) { // keep only the closest intersection\r\n lowerDist = d;\r\n lowerInt = p;\r\n lowerIndex = j;\r\n }\r\n }\r\n }\r\n if (isLeft(polygonAt(poly, i + 1), polygonAt(poly, i), polygonAt(poly, j + 1)) && isRightOn(polygonAt(poly, i + 1), polygonAt(poly, i), polygonAt(poly, j))) {\r\n p = getIntersectionPoint(polygonAt(poly, i + 1), polygonAt(poly, i), polygonAt(poly, j), polygonAt(poly, j + 1));\r\n if (isLeft(polygonAt(poly, i - 1), polygonAt(poly, i), p)) {\r\n d = sqdist(poly[i], p);\r\n if (d < upperDist) {\r\n upperDist = d;\r\n upperInt = p;\r\n upperIndex = j;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // if there are no vertices to connect to, choose a point in the middle\r\n if (lowerIndex === (upperIndex + 1) % polygon.length) {\r\n //console.log(\"Case 1: Vertex(\"+i+\"), lowerIndex(\"+lowerIndex+\"), upperIndex(\"+upperIndex+\"), poly.size(\"+polygon.length+\")\");\r\n p[0] = (lowerInt[0] + upperInt[0]) / 2;\r\n p[1] = (lowerInt[1] + upperInt[1]) / 2;\r\n steinerPoints.push(p);\r\n\r\n if (i < upperIndex) {\r\n //lowerPoly.insert(lowerPoly.end(), poly.begin() + i, poly.begin() + upperIndex + 1);\r\n polygonAppend(lowerPoly, poly, i, upperIndex+1);\r\n lowerPoly.push(p);\r\n upperPoly.push(p);\r\n if (lowerIndex !== 0){\r\n //upperPoly.insert(upperPoly.end(), poly.begin() + lowerIndex, poly.end());\r\n polygonAppend(upperPoly, poly,lowerIndex,poly.length);\r\n }\r\n //upperPoly.insert(upperPoly.end(), poly.begin(), poly.begin() + i + 1);\r\n polygonAppend(upperPoly, poly,0,i+1);\r\n } else {\r\n if (i !== 0){\r\n //lowerPoly.insert(lowerPoly.end(), poly.begin() + i, poly.end());\r\n polygonAppend(lowerPoly, poly,i,poly.length);\r\n }\r\n //lowerPoly.insert(lowerPoly.end(), poly.begin(), poly.begin() + upperIndex + 1);\r\n polygonAppend(lowerPoly, poly,0,upperIndex+1);\r\n lowerPoly.push(p);\r\n upperPoly.push(p);\r\n //upperPoly.insert(upperPoly.end(), poly.begin() + lowerIndex, poly.begin() + i + 1);\r\n polygonAppend(upperPoly, poly,lowerIndex,i+1);\r\n }\r\n } else {\r\n // connect to the closest point within the triangle\r\n //console.log(\"Case 2: Vertex(\"+i+\"), closestIndex(\"+closestIndex+\"), poly.size(\"+polygon.length+\")\\n\");\r\n\r\n if (lowerIndex > upperIndex) {\r\n upperIndex += polygon.length;\r\n }\r\n closestDist = Number.MAX_VALUE;\r\n\r\n if(upperIndex < lowerIndex){\r\n return result;\r\n }\r\n\r\n for (var j = lowerIndex; j <= upperIndex; ++j) {\r\n if (\r\n isLeftOn(polygonAt(poly, i - 1), polygonAt(poly, i), polygonAt(poly, j)) &&\r\n isRightOn(polygonAt(poly, i + 1), polygonAt(poly, i), polygonAt(poly, j))\r\n ) {\r\n d = sqdist(polygonAt(poly, i), polygonAt(poly, j));\r\n if (d < closestDist && polygonCanSee2(poly, i, j)) {\r\n closestDist = d;\r\n closestIndex = j % polygon.length;\r\n }\r\n }\r\n }\r\n\r\n if (i < closestIndex) {\r\n polygonAppend(lowerPoly, poly,i,closestIndex+1);\r\n if (closestIndex !== 0){\r\n polygonAppend(upperPoly, poly,closestIndex,v.length);\r\n }\r\n polygonAppend(upperPoly, poly,0,i+1);\r\n } else {\r\n if (i !== 0){\r\n polygonAppend(lowerPoly, poly,i,v.length);\r\n }\r\n polygonAppend(lowerPoly, poly,0,closestIndex+1);\r\n polygonAppend(upperPoly, poly,closestIndex,i+1);\r\n }\r\n }\r\n\r\n // solve smallest poly first\r\n if (lowerPoly.length < upperPoly.length) {\r\n polygonQuickDecomp(lowerPoly,result,reflexVertices,steinerPoints,delta,maxlevel,level);\r\n polygonQuickDecomp(upperPoly,result,reflexVertices,steinerPoints,delta,maxlevel,level);\r\n } else {\r\n polygonQuickDecomp(upperPoly,result,reflexVertices,steinerPoints,delta,maxlevel,level);\r\n polygonQuickDecomp(lowerPoly,result,reflexVertices,steinerPoints,delta,maxlevel,level);\r\n }\r\n\r\n return result;\r\n }\r\n }\r\n result.push(polygon);\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Remove collinear points in the polygon.\r\n * @method removeCollinearPoints\r\n * @param {Number} [precision] The threshold angle to use when determining whether two edges are collinear. Use zero for finest precision.\r\n * @return {Number} The number of points removed\r\n */\r\nfunction polygonRemoveCollinearPoints(polygon, precision){\r\n var num = 0;\r\n for(var i=polygon.length-1; polygon.length>3 && i>=0; --i){\r\n if(collinear(polygonAt(polygon, i-1),polygonAt(polygon, i),polygonAt(polygon, i+1),precision)){\r\n // Remove the middle point\r\n polygon.splice(i%polygon.length,1);\r\n num++;\r\n }\r\n }\r\n return num;\r\n}\r\n\r\n/**\r\n * Remove duplicate points in the polygon.\r\n * @method removeDuplicatePoints\r\n * @param {Number} [precision] The threshold to use when determining whether two points are the same. Use zero for best precision.\r\n */\r\nfunction polygonRemoveDuplicatePoints(polygon, precision){\r\n for(var i=polygon.length-1; i>=1; --i){\r\n var pi = polygon[i];\r\n for(var j=i-1; j>=0; --j){\r\n if(points_eq(pi, polygon[j], precision)){\r\n polygon.splice(i,1);\r\n continue;\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Check if two scalars are equal\r\n * @static\r\n * @method eq\r\n * @param {Number} a\r\n * @param {Number} b\r\n * @param {Number} [precision]\r\n * @return {Boolean}\r\n */\r\nfunction scalar_eq(a,b,precision){\r\n precision = precision || 0;\r\n return Math.abs(a-b) <= precision;\r\n}\r\n\r\n/**\r\n * Check if two points are equal\r\n * @static\r\n * @method points_eq\r\n * @param {Array} a\r\n * @param {Array} b\r\n * @param {Number} [precision]\r\n * @return {Boolean}\r\n */\r\nfunction points_eq(a,b,precision){\r\n return scalar_eq(a[0],b[0],precision) && scalar_eq(a[1],b[1],precision);\r\n}\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/physics/matter-js/poly-decomp/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/plugins/BasePlugin.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/plugins/BasePlugin.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* @author Richard Davey \r\n* @copyright 2020 Photon Storm Ltd.\r\n* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}\r\n*/\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Global Plugin is installed just once into the Game owned Plugin Manager.\r\n * It can listen for Game events and respond to them.\r\n *\r\n * @class BasePlugin\r\n * @memberof Phaser.Plugins\r\n * @constructor\r\n * @since 3.8.0\r\n *\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager.\r\n */\r\nvar BasePlugin = new Class({\r\n\r\n initialize:\r\n\r\n function BasePlugin (pluginManager)\r\n {\r\n /**\r\n * A handy reference to the Plugin Manager that is responsible for this plugin.\r\n * Can be used as a route to gain access to game systems and events.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#pluginManager\r\n * @type {Phaser.Plugins.PluginManager}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.pluginManager = pluginManager;\r\n\r\n /**\r\n * A reference to the Game instance this plugin is running under.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#game\r\n * @type {Phaser.Game}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.game = pluginManager.game;\r\n },\r\n\r\n /**\r\n * The PluginManager calls this method on a Global Plugin when the plugin is first instantiated.\r\n * It will never be called again on this instance.\r\n * In here you can set-up whatever you need for this plugin to run.\r\n * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this.\r\n * On a Scene Plugin, this method is never called. Use {@link Phaser.Plugins.ScenePlugin#boot} instead.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#init\r\n * @since 3.8.0\r\n *\r\n * @param {?any} [data] - A value specified by the user, if any, from the `data` property of the plugin's configuration object (if started at game boot) or passed in the PluginManager's `install` method (if started manually).\r\n */\r\n init: function ()\r\n {\r\n },\r\n\r\n /**\r\n * The PluginManager calls this method on a Global Plugin when the plugin is started.\r\n * If a plugin is stopped, and then started again, this will get called again.\r\n * Typically called immediately after `BasePlugin.init`.\r\n * On a Scene Plugin, this method is never called.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#start\r\n * @since 3.8.0\r\n */\r\n start: function ()\r\n {\r\n // Here are the game-level events you can listen to.\r\n // At the very least you should offer a destroy handler for when the game closes down.\r\n\r\n // var eventEmitter = this.game.events;\r\n\r\n // eventEmitter.once('destroy', this.gameDestroy, this);\r\n // eventEmitter.on('pause', this.gamePause, this);\r\n // eventEmitter.on('resume', this.gameResume, this);\r\n // eventEmitter.on('resize', this.gameResize, this);\r\n // eventEmitter.on('prestep', this.gamePreStep, this);\r\n // eventEmitter.on('step', this.gameStep, this);\r\n // eventEmitter.on('poststep', this.gamePostStep, this);\r\n // eventEmitter.on('prerender', this.gamePreRender, this);\r\n // eventEmitter.on('postrender', this.gamePostRender, this);\r\n },\r\n\r\n /**\r\n * The PluginManager calls this method on a Global Plugin when the plugin is stopped.\r\n * The game code has requested that your plugin stop doing whatever it does.\r\n * It is now considered as 'inactive' by the PluginManager.\r\n * Handle that process here (i.e. stop listening for events, etc)\r\n * If the plugin is started again then `BasePlugin.start` will be called again.\r\n * On a Scene Plugin, this method is never called.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#stop\r\n * @since 3.8.0\r\n */\r\n stop: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Game instance has been destroyed.\r\n * You must release everything in here, all references, all objects, free it all up.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#destroy\r\n * @since 3.8.0\r\n */\r\n destroy: function ()\r\n {\r\n this.pluginManager = null;\r\n this.game = null;\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = BasePlugin;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/plugins/BasePlugin.js?"); /***/ }), /***/ "./node_modules/phaser/src/plugins/DefaultPlugins.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/plugins/DefaultPlugins.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @typedef {object} Phaser.Plugins.DefaultPlugins\r\n * \r\n * @property {array} Global - These are the Global Managers that are created by the Phaser.Game instance.\r\n * @property {array} CoreScene - These are the core plugins that are installed into every Scene.Systems instance, no matter what.\r\n * @property {array} DefaultScene - These plugins are created in Scene.Systems in addition to the CoreScenePlugins.\r\n */\r\n\r\nvar DefaultPlugins = {\r\n\r\n /**\r\n * These are the Global Managers that are created by the Phaser.Game instance.\r\n * They are referenced from Scene.Systems so that plugins can use them.\r\n * \r\n * @name Phaser.Plugins.Global\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n Global: [\r\n\r\n 'game',\r\n 'anims',\r\n 'cache',\r\n 'plugins',\r\n 'registry',\r\n 'scale',\r\n 'sound',\r\n 'textures'\r\n\r\n ],\r\n\r\n /**\r\n * These are the core plugins that are installed into every Scene.Systems instance, no matter what.\r\n * They are optionally exposed in the Scene as well (see the InjectionMap for details)\r\n * \r\n * They are created in the order in which they appear in this array and EventEmitter is always first.\r\n * \r\n * @name Phaser.Plugins.CoreScene\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n CoreScene: [\r\n\r\n 'EventEmitter',\r\n\r\n 'CameraManager',\r\n 'GameObjectCreator',\r\n 'GameObjectFactory',\r\n 'ScenePlugin',\r\n 'DisplayList',\r\n 'UpdateList'\r\n\r\n ],\r\n\r\n /**\r\n * These plugins are created in Scene.Systems in addition to the CoreScenePlugins.\r\n * \r\n * You can elect not to have these plugins by either creating a DefaultPlugins object as part\r\n * of the Game Config, by creating a Plugins object as part of a Scene Config, or by modifying this array\r\n * and building your own bundle.\r\n * \r\n * They are optionally exposed in the Scene as well (see the InjectionMap for details)\r\n * \r\n * They are always created in the order in which they appear in the array.\r\n * \r\n * @name Phaser.Plugins.DefaultScene\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n DefaultScene: [\r\n\r\n 'Clock',\r\n 'DataManagerPlugin',\r\n 'InputPlugin',\r\n 'Loader',\r\n 'TweenManager',\r\n 'LightsPlugin'\r\n\r\n ]\r\n\r\n};\r\n\r\nif (typeof PLUGIN_CAMERA3D)\r\n{\r\n DefaultPlugins.DefaultScene.push('CameraManager3D');\r\n}\r\n\r\nif (typeof PLUGIN_FBINSTANT)\r\n{\r\n DefaultPlugins.Global.push('facebook');\r\n}\r\n\r\nmodule.exports = DefaultPlugins;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/plugins/DefaultPlugins.js?"); /***/ }), /***/ "./node_modules/phaser/src/plugins/PluginCache.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/plugins/PluginCache.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Contains the plugins that Phaser uses globally and locally.\r\n// These are the source objects, not instantiated.\r\nvar corePlugins = {};\r\n\r\n// Contains the plugins that the dev has loaded into their game\r\n// These are the source objects, not instantiated.\r\nvar customPlugins = {};\r\n\r\nvar PluginCache = {};\r\n\r\n/**\r\n * @namespace Phaser.Plugins.PluginCache\r\n */\r\n\r\n/**\r\n * Static method called directly by the Core internal Plugins.\r\n * Key is a reference used to get the plugin from the plugins object (i.e. InputPlugin)\r\n * Plugin is the object to instantiate to create the plugin\r\n * Mapping is what the plugin is injected into the Scene.Systems as (i.e. input)\r\n *\r\n * @method Phaser.Plugins.PluginCache.register\r\n * @since 3.8.0\r\n * \r\n * @param {string} key - A reference used to get this plugin from the plugin cache.\r\n * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated.\r\n * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used.\r\n * @param {boolean} [custom=false] - Core Scene plugin or a Custom Scene plugin?\r\n */\r\nPluginCache.register = function (key, plugin, mapping, custom)\r\n{\r\n if (custom === undefined) { custom = false; }\r\n\r\n corePlugins[key] = { plugin: plugin, mapping: mapping, custom: custom };\r\n};\r\n\r\n/**\r\n * Stores a custom plugin in the global plugin cache.\r\n * The key must be unique, within the scope of the cache.\r\n *\r\n * @method Phaser.Plugins.PluginCache.registerCustom\r\n * @since 3.8.0\r\n * \r\n * @param {string} key - A reference used to get this plugin from the plugin cache.\r\n * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated.\r\n * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used.\r\n * @param {?any} data - A value to be passed to the plugin's `init` method.\r\n */\r\nPluginCache.registerCustom = function (key, plugin, mapping, data)\r\n{\r\n customPlugins[key] = { plugin: plugin, mapping: mapping, data: data };\r\n};\r\n\r\n/**\r\n * Checks if the given key is already being used in the core plugin cache.\r\n *\r\n * @method Phaser.Plugins.PluginCache.hasCore\r\n * @since 3.8.0\r\n * \r\n * @param {string} key - The key to check for.\r\n *\r\n * @return {boolean} `true` if the key is already in use in the core cache, otherwise `false`.\r\n */\r\nPluginCache.hasCore = function (key)\r\n{\r\n return corePlugins.hasOwnProperty(key);\r\n};\r\n\r\n/**\r\n * Checks if the given key is already being used in the custom plugin cache.\r\n *\r\n * @method Phaser.Plugins.PluginCache.hasCustom\r\n * @since 3.8.0\r\n * \r\n * @param {string} key - The key to check for.\r\n *\r\n * @return {boolean} `true` if the key is already in use in the custom cache, otherwise `false`.\r\n */\r\nPluginCache.hasCustom = function (key)\r\n{\r\n return customPlugins.hasOwnProperty(key);\r\n};\r\n\r\n/**\r\n * Returns the core plugin object from the cache based on the given key.\r\n *\r\n * @method Phaser.Plugins.PluginCache.getCore\r\n * @since 3.8.0\r\n * \r\n * @param {string} key - The key of the core plugin to get.\r\n *\r\n * @return {Phaser.Types.Plugins.CorePluginContainer} The core plugin object.\r\n */\r\nPluginCache.getCore = function (key)\r\n{\r\n return corePlugins[key];\r\n};\r\n\r\n/**\r\n * Returns the custom plugin object from the cache based on the given key.\r\n *\r\n * @method Phaser.Plugins.PluginCache.getCustom\r\n * @since 3.8.0\r\n * \r\n * @param {string} key - The key of the custom plugin to get.\r\n *\r\n * @return {Phaser.Types.Plugins.CustomPluginContainer} The custom plugin object.\r\n */\r\nPluginCache.getCustom = function (key)\r\n{\r\n return customPlugins[key];\r\n};\r\n\r\n/**\r\n * Returns an object from the custom cache based on the given key that can be instantiated.\r\n *\r\n * @method Phaser.Plugins.PluginCache.getCustomClass\r\n * @since 3.8.0\r\n * \r\n * @param {string} key - The key of the custom plugin to get.\r\n *\r\n * @return {function} The custom plugin object.\r\n */\r\nPluginCache.getCustomClass = function (key)\r\n{\r\n return (customPlugins.hasOwnProperty(key)) ? customPlugins[key].plugin : null;\r\n};\r\n\r\n/**\r\n * Removes a core plugin based on the given key.\r\n *\r\n * @method Phaser.Plugins.PluginCache.remove\r\n * @since 3.8.0\r\n * \r\n * @param {string} key - The key of the core plugin to remove.\r\n */\r\nPluginCache.remove = function (key)\r\n{\r\n if (corePlugins.hasOwnProperty(key))\r\n {\r\n delete corePlugins[key];\r\n }\r\n};\r\n\r\n/**\r\n * Removes a custom plugin based on the given key.\r\n *\r\n * @method Phaser.Plugins.PluginCache.removeCustom\r\n * @since 3.8.0\r\n * \r\n * @param {string} key - The key of the custom plugin to remove.\r\n */\r\nPluginCache.removeCustom = function (key)\r\n{\r\n if (customPlugins.hasOwnProperty(key))\r\n {\r\n delete customPlugins[key];\r\n }\r\n};\r\n\r\n/**\r\n * Removes all Core Plugins.\r\n * \r\n * This includes all of the internal system plugins that Phaser needs, like the Input Plugin and Loader Plugin.\r\n * So be sure you only call this if you do not wish to run Phaser again.\r\n *\r\n * @method Phaser.Plugins.PluginCache.destroyCorePlugins\r\n * @since 3.12.0\r\n */\r\nPluginCache.destroyCorePlugins = function ()\r\n{\r\n for (var key in corePlugins)\r\n {\r\n if (corePlugins.hasOwnProperty(key))\r\n {\r\n delete corePlugins[key];\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Removes all Custom Plugins.\r\n *\r\n * @method Phaser.Plugins.PluginCache.destroyCustomPlugins\r\n * @since 3.12.0\r\n */\r\nPluginCache.destroyCustomPlugins = function ()\r\n{\r\n for (var key in customPlugins)\r\n {\r\n if (customPlugins.hasOwnProperty(key))\r\n {\r\n delete customPlugins[key];\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = PluginCache;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/plugins/PluginCache.js?"); /***/ }), /***/ "./node_modules/phaser/src/plugins/PluginManager.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/plugins/PluginManager.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GameEvents = __webpack_require__(/*! ../core/events */ \"./node_modules/phaser/src/core/events/index.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar FileTypesManager = __webpack_require__(/*! ../loader/FileTypesManager */ \"./node_modules/phaser/src/loader/FileTypesManager.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../gameobjects/GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../gameobjects/GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar PluginCache = __webpack_require__(/*! ./PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar Remove = __webpack_require__(/*! ../utils/array/Remove */ \"./node_modules/phaser/src/utils/array/Remove.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The PluginManager is responsible for installing and adding plugins to Phaser.\r\n *\r\n * It is a global system and therefore belongs to the Game instance, not a specific Scene.\r\n *\r\n * It works in conjunction with the PluginCache. Core internal plugins automatically register themselves \r\n * with the Cache, but it's the Plugin Manager that is responsible for injecting them into the Scenes.\r\n *\r\n * There are two types of plugin:\r\n *\r\n * 1. A Global Plugin\r\n * 2. A Scene Plugin\r\n *\r\n * A Global Plugin is a plugin that lives within the Plugin Manager rather than a Scene. You can get\r\n * access to it by calling `PluginManager.get` and providing a key. Any Scene that requests a plugin in\r\n * this way will all get access to the same plugin instance, allowing you to use a single plugin across\r\n * multiple Scenes.\r\n *\r\n * A Scene Plugin is a plugin dedicated to running within a Scene. These are different to Global Plugins\r\n * in that their instances do not live within the Plugin Manager, but within the Scene Systems class instead.\r\n * And that every Scene created is given its own unique instance of a Scene Plugin. Examples of core Scene\r\n * Plugins include the Input Plugin, the Tween Plugin and the physics Plugins.\r\n *\r\n * You can add a plugin to Phaser in three different ways:\r\n *\r\n * 1. Preload it\r\n * 2. Include it in your source code and install it via the Game Config\r\n * 3. Include it in your source code and install it within a Scene\r\n *\r\n * For examples of all of these approaches please see the Phaser 3 Examples Repo `plugins` folder.\r\n *\r\n * For information on creating your own plugin please see the Phaser 3 Plugin Template.\r\n *\r\n * @class PluginManager\r\n * @memberof Phaser.Plugins\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - The game instance that owns this Plugin Manager.\r\n */\r\nvar PluginManager = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function PluginManager (game)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * The game instance that owns this Plugin Manager.\r\n *\r\n * @name Phaser.Plugins.PluginManager#game\r\n * @type {Phaser.Game}\r\n * @since 3.0.0\r\n */\r\n this.game = game;\r\n\r\n /**\r\n * The global plugins currently running and managed by this Plugin Manager.\r\n * A plugin must have been started at least once in order to appear in this list.\r\n *\r\n * @name Phaser.Plugins.PluginManager#plugins\r\n * @type {Phaser.Types.Plugins.GlobalPlugin[]}\r\n * @since 3.8.0\r\n */\r\n this.plugins = [];\r\n\r\n /**\r\n * A list of plugin keys that should be installed into Scenes as well as the Core Plugins.\r\n *\r\n * @name Phaser.Plugins.PluginManager#scenePlugins\r\n * @type {string[]}\r\n * @since 3.8.0\r\n */\r\n this.scenePlugins = [];\r\n\r\n /**\r\n * A temporary list of plugins to install when the game has booted.\r\n *\r\n * @name Phaser.Plugins.PluginManager#_pendingGlobal\r\n * @private\r\n * @type {array}\r\n * @since 3.8.0\r\n */\r\n this._pendingGlobal = [];\r\n\r\n /**\r\n * A temporary list of scene plugins to install when the game has booted.\r\n *\r\n * @name Phaser.Plugins.PluginManager#_pendingScene\r\n * @private\r\n * @type {array}\r\n * @since 3.8.0\r\n */\r\n this._pendingScene = [];\r\n\r\n if (game.isBooted)\r\n {\r\n this.boot();\r\n }\r\n else\r\n {\r\n game.events.once(GameEvents.BOOT, this.boot, this);\r\n }\r\n },\r\n\r\n /**\r\n * Run once the game has booted and installs all of the plugins configured in the Game Config.\r\n *\r\n * @method Phaser.Plugins.PluginManager#boot\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n boot: function ()\r\n {\r\n var i;\r\n var entry;\r\n var key;\r\n var plugin;\r\n var start;\r\n var mapping;\r\n var data;\r\n var config = this.game.config;\r\n\r\n // Any plugins to install?\r\n var list = config.installGlobalPlugins;\r\n\r\n // Any plugins added outside of the game config, but before the game booted?\r\n list = list.concat(this._pendingGlobal);\r\n\r\n for (i = 0; i < list.length; i++)\r\n {\r\n entry = list[i];\r\n\r\n // { key: 'TestPlugin', plugin: TestPlugin, start: true, mapping: 'test', data: { msg: 'The plugin is alive' } }\r\n\r\n key = GetFastValue(entry, 'key', null);\r\n plugin = GetFastValue(entry, 'plugin', null);\r\n start = GetFastValue(entry, 'start', false);\r\n mapping = GetFastValue(entry, 'mapping', null);\r\n data = GetFastValue(entry, 'data', null);\r\n\r\n if (key)\r\n {\r\n if (plugin)\r\n {\r\n this.install(key, plugin, start, mapping, data);\r\n }\r\n else\r\n {\r\n console.warn('Missing `plugin` for key: ' + key);\r\n }\r\n \r\n }\r\n }\r\n\r\n // Any scene plugins to install?\r\n list = config.installScenePlugins;\r\n\r\n // Any plugins added outside of the game config, but before the game booted?\r\n list = list.concat(this._pendingScene);\r\n\r\n for (i = 0; i < list.length; i++)\r\n {\r\n entry = list[i];\r\n\r\n // { key: 'moveSpritePlugin', plugin: MoveSpritePlugin, , mapping: 'move' }\r\n\r\n key = GetFastValue(entry, 'key', null);\r\n plugin = GetFastValue(entry, 'plugin', null);\r\n mapping = GetFastValue(entry, 'mapping', null);\r\n\r\n if (key)\r\n {\r\n if (plugin)\r\n {\r\n this.installScenePlugin(key, plugin, mapping);\r\n }\r\n else\r\n {\r\n console.warn('Missing `plugin` for key: ' + key);\r\n }\r\n }\r\n }\r\n\r\n this._pendingGlobal = [];\r\n this._pendingScene = [];\r\n\r\n this.game.events.once(GameEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * Called by the Scene Systems class. Tells the plugin manager to install all Scene plugins into it.\r\n *\r\n * First it will install global references, i.e. references from the Game systems into the Scene Systems (and Scene if mapped.)\r\n * Then it will install Core Scene Plugins followed by Scene Plugins registered with the PluginManager.\r\n * Finally it will install any references to Global Plugins that have a Scene mapping property into the Scene itself.\r\n *\r\n * @method Phaser.Plugins.PluginManager#addToScene\r\n * @protected\r\n * @since 3.8.0\r\n *\r\n * @param {Phaser.Scenes.Systems} sys - The Scene Systems class to install all the plugins in to.\r\n * @param {array} globalPlugins - An array of global plugins to install.\r\n * @param {array} scenePlugins - An array of scene plugins to install.\r\n */\r\n addToScene: function (sys, globalPlugins, scenePlugins)\r\n {\r\n var i;\r\n var pluginKey;\r\n var pluginList;\r\n var game = this.game;\r\n var scene = sys.scene;\r\n var map = sys.settings.map;\r\n var isBooted = sys.settings.isBooted;\r\n\r\n // Reference the GlobalPlugins from Game into Scene.Systems\r\n for (i = 0; i < globalPlugins.length; i++)\r\n {\r\n pluginKey = globalPlugins[i];\r\n\r\n if (game[pluginKey])\r\n {\r\n sys[pluginKey] = game[pluginKey];\r\n\r\n // Scene level injection\r\n if (map.hasOwnProperty(pluginKey))\r\n {\r\n scene[map[pluginKey]] = sys[pluginKey];\r\n }\r\n }\r\n else if (pluginKey === 'game' && map.hasOwnProperty(pluginKey))\r\n {\r\n scene[map[pluginKey]] = game;\r\n }\r\n }\r\n\r\n for (var s = 0; s < scenePlugins.length; s++)\r\n {\r\n pluginList = scenePlugins[s];\r\n\r\n for (i = 0; i < pluginList.length; i++)\r\n {\r\n pluginKey = pluginList[i];\r\n\r\n if (!PluginCache.hasCore(pluginKey))\r\n {\r\n continue;\r\n }\r\n\r\n var source = PluginCache.getCore(pluginKey);\r\n\r\n var plugin = new source.plugin(scene, this);\r\n \r\n sys[source.mapping] = plugin;\r\n\r\n // Scene level injection\r\n if (source.custom)\r\n {\r\n scene[source.mapping] = plugin;\r\n }\r\n else if (map.hasOwnProperty(source.mapping))\r\n {\r\n scene[map[source.mapping]] = plugin;\r\n }\r\n\r\n // Scene is already booted, usually because this method is being called at run-time, so boot the plugin\r\n if (isBooted)\r\n {\r\n plugin.boot();\r\n }\r\n }\r\n }\r\n\r\n // And finally, inject any 'global scene plugins'\r\n pluginList = this.plugins;\r\n\r\n for (i = 0; i < pluginList.length; i++)\r\n {\r\n var entry = pluginList[i];\r\n\r\n if (entry.mapping)\r\n {\r\n scene[entry.mapping] = entry.plugin;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Called by the Scene Systems class. Returns a list of plugins to be installed.\r\n *\r\n * @method Phaser.Plugins.PluginManager#getDefaultScenePlugins\r\n * @protected\r\n * @since 3.8.0\r\n *\r\n * @return {string[]} A list keys of all the Scene Plugins to install.\r\n */\r\n getDefaultScenePlugins: function ()\r\n {\r\n var list = this.game.config.defaultPlugins;\r\n\r\n // Merge in custom Scene plugins\r\n list = list.concat(this.scenePlugins);\r\n\r\n return list;\r\n },\r\n\r\n /**\r\n * Installs a new Scene Plugin into the Plugin Manager and optionally adds it\r\n * to the given Scene as well. A Scene Plugin added to the manager in this way\r\n * will be automatically installed into all new Scenes using the key and mapping given.\r\n *\r\n * The `key` property is what the plugin is injected into Scene.Systems as.\r\n * The `mapping` property is optional, and if specified is what the plugin is installed into\r\n * the Scene as. For example:\r\n *\r\n * ```javascript\r\n * this.plugins.installScenePlugin('powerupsPlugin', pluginCode, 'powerups');\r\n * \r\n * // and from within the scene:\r\n * this.sys.powerupsPlugin; // key value\r\n * this.powerups; // mapping value\r\n * ```\r\n *\r\n * This method is called automatically by Phaser if you install your plugins using either the\r\n * Game Configuration object, or by preloading them via the Loader.\r\n *\r\n * @method Phaser.Plugins.PluginManager#installScenePlugin\r\n * @since 3.8.0\r\n *\r\n * @param {string} key - The property key that will be used to add this plugin to Scene.Systems.\r\n * @param {function} plugin - The plugin code. This should be the non-instantiated version.\r\n * @param {string} [mapping] - If this plugin is injected into the Phaser.Scene class, this is the property key to use.\r\n * @param {Phaser.Scene} [addToScene] - Optionally automatically add this plugin to the given Scene.\r\n * @param {boolean} [fromLoader=false] - Is this being called by the Loader?\r\n */\r\n installScenePlugin: function (key, plugin, mapping, addToScene, fromLoader)\r\n {\r\n if (fromLoader === undefined) { fromLoader = false; }\r\n\r\n if (typeof plugin !== 'function')\r\n {\r\n console.warn('Invalid Scene Plugin: ' + key);\r\n return;\r\n }\r\n\r\n if (!PluginCache.hasCore(key))\r\n {\r\n // Plugin is freshly loaded\r\n PluginCache.register(key, plugin, mapping, true);\r\n\r\n this.scenePlugins.push(key);\r\n }\r\n else if (!fromLoader && PluginCache.hasCore(key))\r\n {\r\n // Plugin wasn't from the loader but already exists\r\n console.warn('Scene Plugin key in use: ' + key);\r\n return;\r\n }\r\n\r\n if (addToScene)\r\n {\r\n var instance = new plugin(addToScene, this);\r\n\r\n addToScene.sys[key] = instance;\r\n\r\n if (mapping && mapping !== '')\r\n {\r\n addToScene[mapping] = instance;\r\n }\r\n\r\n instance.boot();\r\n }\r\n },\r\n\r\n /**\r\n * Installs a new Global Plugin into the Plugin Manager and optionally starts it running.\r\n * A global plugin belongs to the Plugin Manager, rather than a specific Scene, and can be accessed\r\n * and used by all Scenes in your game.\r\n *\r\n * The `key` property is what you use to access this plugin from the Plugin Manager.\r\n *\r\n * ```javascript\r\n * this.plugins.install('powerupsPlugin', pluginCode);\r\n * \r\n * // and from within the scene:\r\n * this.plugins.get('powerupsPlugin');\r\n * ```\r\n *\r\n * This method is called automatically by Phaser if you install your plugins using either the\r\n * Game Configuration object, or by preloading them via the Loader.\r\n *\r\n * The same plugin can be installed multiple times into the Plugin Manager by simply giving each\r\n * instance its own unique key.\r\n *\r\n * @method Phaser.Plugins.PluginManager#install\r\n * @since 3.8.0\r\n * \r\n * @param {string} key - The unique handle given to this plugin within the Plugin Manager.\r\n * @param {function} plugin - The plugin code. This should be the non-instantiated version.\r\n * @param {boolean} [start=false] - Automatically start the plugin running? This is always `true` if you provide a mapping value.\r\n * @param {string} [mapping] - If this plugin is injected into the Phaser.Scene class, this is the property key to use.\r\n * @param {any} [data] - A value passed to the plugin's `init` method.\r\n *\r\n * @return {?Phaser.Plugins.BasePlugin} The plugin that was started, or `null` if `start` was false, or game isn't yet booted.\r\n */\r\n install: function (key, plugin, start, mapping, data)\r\n {\r\n if (start === undefined) { start = false; }\r\n if (mapping === undefined) { mapping = null; }\r\n if (data === undefined) { data = null; }\r\n\r\n if (typeof plugin !== 'function')\r\n {\r\n console.warn('Invalid Plugin: ' + key);\r\n return null;\r\n }\r\n\r\n if (PluginCache.hasCustom(key))\r\n {\r\n console.warn('Plugin key in use: ' + key);\r\n return null;\r\n }\r\n\r\n if (mapping !== null)\r\n {\r\n start = true;\r\n }\r\n\r\n if (!this.game.isBooted)\r\n {\r\n this._pendingGlobal.push({ key: key, plugin: plugin, start: start, mapping: mapping, data: data });\r\n }\r\n else\r\n {\r\n // Add it to the plugin store\r\n PluginCache.registerCustom(key, plugin, mapping, data);\r\n\r\n if (start)\r\n {\r\n return this.start(key);\r\n }\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Gets an index of a global plugin based on the given key.\r\n *\r\n * @method Phaser.Plugins.PluginManager#getIndex\r\n * @protected\r\n * @since 3.8.0\r\n *\r\n * @param {string} key - The unique plugin key.\r\n *\r\n * @return {integer} The index of the plugin within the plugins array.\r\n */\r\n getIndex: function (key)\r\n {\r\n var list = this.plugins;\r\n\r\n for (var i = 0; i < list.length; i++)\r\n {\r\n var entry = list[i];\r\n\r\n if (entry.key === key)\r\n {\r\n return i;\r\n }\r\n }\r\n\r\n return -1;\r\n },\r\n\r\n /**\r\n * Gets a global plugin based on the given key.\r\n *\r\n * @method Phaser.Plugins.PluginManager#getEntry\r\n * @protected\r\n * @since 3.8.0\r\n *\r\n * @param {string} key - The unique plugin key.\r\n *\r\n * @return {Phaser.Types.Plugins.GlobalPlugin} The plugin entry.\r\n */\r\n getEntry: function (key)\r\n {\r\n var idx = this.getIndex(key);\r\n\r\n if (idx !== -1)\r\n {\r\n return this.plugins[idx];\r\n }\r\n },\r\n\r\n /**\r\n * Checks if the given global plugin, based on its key, is active or not.\r\n *\r\n * @method Phaser.Plugins.PluginManager#isActive\r\n * @since 3.8.0\r\n *\r\n * @param {string} key - The unique plugin key.\r\n *\r\n * @return {boolean} `true` if the plugin is active, otherwise `false`.\r\n */\r\n isActive: function (key)\r\n {\r\n var entry = this.getEntry(key);\r\n\r\n return (entry && entry.active);\r\n },\r\n\r\n /**\r\n * Starts a global plugin running.\r\n *\r\n * If the plugin was previously active then calling `start` will reset it to an active state and then\r\n * call its `start` method.\r\n *\r\n * If the plugin has never been run before a new instance of it will be created within the Plugin Manager,\r\n * its active state set and then both of its `init` and `start` methods called, in that order.\r\n *\r\n * If the plugin is already running under the given key then nothing happens.\r\n *\r\n * @method Phaser.Plugins.PluginManager#start\r\n * @since 3.8.0\r\n *\r\n * @param {string} key - The key of the plugin to start.\r\n * @param {string} [runAs] - Run the plugin under a new key. This allows you to run one plugin multiple times.\r\n *\r\n * @return {?Phaser.Plugins.BasePlugin} The plugin that was started, or `null` if invalid key given or plugin is already stopped.\r\n */\r\n start: function (key, runAs)\r\n {\r\n if (runAs === undefined) { runAs = key; }\r\n\r\n var entry = this.getEntry(runAs);\r\n\r\n // Plugin already running under this key?\r\n if (entry && !entry.active)\r\n {\r\n // It exists, we just need to start it up again\r\n entry.active = true;\r\n entry.plugin.start();\r\n }\r\n else if (!entry)\r\n {\r\n entry = this.createEntry(key, runAs);\r\n }\r\n\r\n return (entry) ? entry.plugin : null;\r\n },\r\n\r\n /**\r\n * Creates a new instance of a global plugin, adds an entry into the plugins array and returns it.\r\n *\r\n * @method Phaser.Plugins.PluginManager#createEntry\r\n * @private\r\n * @since 3.9.0\r\n *\r\n * @param {string} key - The key of the plugin to create an instance of.\r\n * @param {string} [runAs] - Run the plugin under a new key. This allows you to run one plugin multiple times.\r\n *\r\n * @return {?Phaser.Plugins.BasePlugin} The plugin that was started, or `null` if invalid key given.\r\n */\r\n createEntry: function (key, runAs)\r\n {\r\n var entry = PluginCache.getCustom(key);\r\n\r\n if (entry)\r\n {\r\n var instance = new entry.plugin(this);\r\n\r\n entry = {\r\n key: runAs,\r\n plugin: instance,\r\n active: true,\r\n mapping: entry.mapping,\r\n data: entry.data\r\n };\r\n\r\n this.plugins.push(entry);\r\n\r\n instance.init(entry.data);\r\n instance.start();\r\n }\r\n\r\n return entry;\r\n },\r\n\r\n /**\r\n * Stops a global plugin from running.\r\n *\r\n * If the plugin is active then its active state will be set to false and the plugins `stop` method\r\n * will be called.\r\n *\r\n * If the plugin is not already running, nothing will happen.\r\n *\r\n * @method Phaser.Plugins.PluginManager#stop\r\n * @since 3.8.0\r\n *\r\n * @param {string} key - The key of the plugin to stop.\r\n *\r\n * @return {Phaser.Plugins.PluginManager} The Plugin Manager.\r\n */\r\n stop: function (key)\r\n {\r\n var entry = this.getEntry(key);\r\n\r\n if (entry && entry.active)\r\n {\r\n entry.active = false;\r\n entry.plugin.stop();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets a global plugin from the Plugin Manager based on the given key and returns it.\r\n *\r\n * If it cannot find an active plugin based on the key, but there is one in the Plugin Cache with the same key,\r\n * then it will create a new instance of the cached plugin and return that.\r\n *\r\n * @method Phaser.Plugins.PluginManager#get\r\n * @since 3.8.0\r\n *\r\n * @param {string} key - The key of the plugin to get.\r\n * @param {boolean} [autoStart=true] - Automatically start a new instance of the plugin if found in the cache, but not actively running.\r\n *\r\n * @return {?(Phaser.Plugins.BasePlugin|function)} The plugin, or `null` if no plugin was found matching the key.\r\n */\r\n get: function (key, autoStart)\r\n {\r\n if (autoStart === undefined) { autoStart = true; }\r\n\r\n var entry = this.getEntry(key);\r\n\r\n if (entry)\r\n {\r\n return entry.plugin;\r\n }\r\n else\r\n {\r\n var plugin = this.getClass(key);\r\n\r\n if (plugin && autoStart)\r\n {\r\n entry = this.createEntry(key, key);\r\n\r\n return (entry) ? entry.plugin : null;\r\n }\r\n else if (plugin)\r\n {\r\n return plugin;\r\n }\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Returns the plugin class from the cache.\r\n * Used internally by the Plugin Manager.\r\n *\r\n * @method Phaser.Plugins.PluginManager#getClass\r\n * @since 3.8.0\r\n *\r\n * @param {string} key - The key of the plugin to get.\r\n *\r\n * @return {Phaser.Plugins.BasePlugin} A Plugin object\r\n */\r\n getClass: function (key)\r\n {\r\n return PluginCache.getCustomClass(key);\r\n },\r\n\r\n /**\r\n * Removes a global plugin from the Plugin Manager and Plugin Cache.\r\n *\r\n * It is up to you to remove all references to this plugin that you may hold within your game code.\r\n *\r\n * @method Phaser.Plugins.PluginManager#removeGlobalPlugin\r\n * @since 3.8.0\r\n *\r\n * @param {string} key - The key of the plugin to remove.\r\n */\r\n removeGlobalPlugin: function (key)\r\n {\r\n var entry = this.getEntry(key);\r\n\r\n if (entry)\r\n {\r\n Remove(this.plugins, entry);\r\n }\r\n\r\n PluginCache.removeCustom(key);\r\n },\r\n\r\n /**\r\n * Removes a scene plugin from the Plugin Manager and Plugin Cache.\r\n *\r\n * This will not remove the plugin from any active Scenes that are already using it.\r\n *\r\n * It is up to you to remove all references to this plugin that you may hold within your game code.\r\n *\r\n * @method Phaser.Plugins.PluginManager#removeScenePlugin\r\n * @since 3.8.0\r\n *\r\n * @param {string} key - The key of the plugin to remove.\r\n */\r\n removeScenePlugin: function (key)\r\n {\r\n Remove(this.scenePlugins, key);\r\n\r\n PluginCache.remove(key);\r\n },\r\n\r\n /**\r\n * Registers a new type of Game Object with the global Game Object Factory and / or Creator.\r\n * This is usually called from within your Plugin code and is a helpful short-cut for creating\r\n * new Game Objects.\r\n *\r\n * The key is the property that will be injected into the factories and used to create the\r\n * Game Object. For example:\r\n *\r\n * ```javascript\r\n * this.plugins.registerGameObject('clown', clownFactoryCallback, clownCreatorCallback);\r\n * // later in your game code:\r\n * this.add.clown();\r\n * this.make.clown();\r\n * ```\r\n * \r\n * The callbacks are what are called when the factories try to create a Game Object\r\n * matching the given key. It's important to understand that the callbacks are invoked within\r\n * the context of the GameObjectFactory. In this context there are several properties available\r\n * to use:\r\n * \r\n * this.scene - A reference to the Scene that owns the GameObjectFactory.\r\n * this.displayList - A reference to the Display List the Scene owns.\r\n * this.updateList - A reference to the Update List the Scene owns.\r\n * \r\n * See the GameObjectFactory and GameObjectCreator classes for more details.\r\n * Any public property or method listed is available from your callbacks under `this`.\r\n *\r\n * @method Phaser.Plugins.PluginManager#registerGameObject\r\n * @since 3.8.0\r\n *\r\n * @param {string} key - The key of the Game Object that the given callbacks will create, i.e. `image`, `sprite`.\r\n * @param {function} [factoryCallback] - The callback to invoke when the Game Object Factory is called.\r\n * @param {function} [creatorCallback] - The callback to invoke when the Game Object Creator is called.\r\n */\r\n registerGameObject: function (key, factoryCallback, creatorCallback)\r\n {\r\n if (factoryCallback)\r\n {\r\n GameObjectFactory.register(key, factoryCallback);\r\n }\r\n\r\n if (creatorCallback)\r\n {\r\n GameObjectCreator.register(key, creatorCallback);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes a previously registered Game Object from the global Game Object Factory and / or Creator.\r\n * This is usually called from within your Plugin destruction code to help clean-up after your plugin has been removed.\r\n *\r\n * @method Phaser.Plugins.PluginManager#removeGameObject\r\n * @since 3.19.0\r\n *\r\n * @param {string} key - The key of the Game Object to be removed from the factories.\r\n * @param {boolean} [removeFromFactory=true] - Should the Game Object be removed from the Game Object Factory?\r\n * @param {boolean} [removeFromCreator=true] - Should the Game Object be removed from the Game Object Creator?\r\n */\r\n removeGameObject: function (key, removeFromFactory, removeFromCreator)\r\n {\r\n if (removeFromFactory === undefined) { removeFromFactory = true; }\r\n if (removeFromCreator === undefined) { removeFromCreator = true; }\r\n\r\n if (removeFromFactory)\r\n {\r\n GameObjectFactory.remove(key);\r\n }\r\n\r\n if (removeFromCreator)\r\n {\r\n GameObjectCreator.remove(key);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Registers a new file type with the global File Types Manager, making it available to all Loader\r\n * Plugins created after this.\r\n * \r\n * This is usually called from within your Plugin code and is a helpful short-cut for creating\r\n * new loader file types.\r\n *\r\n * The key is the property that will be injected into the Loader Plugin and used to load the\r\n * files. For example:\r\n *\r\n * ```javascript\r\n * this.plugins.registerFileType('wad', doomWadLoaderCallback);\r\n * // later in your preload code:\r\n * this.load.wad();\r\n * ```\r\n * \r\n * The callback is what is called when the loader tries to load a file matching the given key.\r\n * It's important to understand that the callback is invoked within\r\n * the context of the LoaderPlugin. In this context there are several properties / methods available\r\n * to use:\r\n * \r\n * this.addFile - A method to add the new file to the load queue.\r\n * this.scene - The Scene that owns the Loader Plugin instance.\r\n *\r\n * See the LoaderPlugin class for more details. Any public property or method listed is available from\r\n * your callback under `this`.\r\n *\r\n * @method Phaser.Plugins.PluginManager#registerFileType\r\n * @since 3.8.0\r\n *\r\n * @param {string} key - The key of the Game Object that the given callbacks will create, i.e. `image`, `sprite`.\r\n * @param {function} callback - The callback to invoke when the Game Object Factory is called.\r\n * @param {Phaser.Scene} [addToScene] - Optionally add this file type into the Loader Plugin owned by the given Scene.\r\n */\r\n registerFileType: function (key, callback, addToScene)\r\n {\r\n FileTypesManager.register(key, callback);\r\n\r\n if (addToScene && addToScene.sys.load)\r\n {\r\n addToScene.sys.load[key] = callback;\r\n }\r\n },\r\n\r\n /**\r\n * Destroys this Plugin Manager and all associated plugins.\r\n * It will iterate all plugins found and call their `destroy` methods.\r\n * \r\n * The PluginCache will remove all custom plugins.\r\n *\r\n * @method Phaser.Plugins.PluginManager#destroy\r\n * @since 3.8.0\r\n */\r\n destroy: function ()\r\n {\r\n for (var i = 0; i < this.plugins.length; i++)\r\n {\r\n this.plugins[i].plugin.destroy();\r\n }\r\n\r\n PluginCache.destroyCustomPlugins();\r\n\r\n if (this.game.noReturn)\r\n {\r\n PluginCache.destroyCorePlugins();\r\n }\r\n\r\n this.game = null;\r\n this.plugins = [];\r\n this.scenePlugins = [];\r\n }\r\n\r\n});\r\n\r\n/*\r\n * \"Sometimes, the elegant implementation is just a function.\r\n * Not a method. Not a class. Not a framework. Just a function.\"\r\n * -- John Carmack\r\n */\r\n\r\nmodule.exports = PluginManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/plugins/PluginManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/plugins/ScenePlugin.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/plugins/ScenePlugin.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n* @author Richard Davey \r\n* @copyright 2020 Photon Storm Ltd.\r\n* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}\r\n*/\r\n\r\nvar BasePlugin = __webpack_require__(/*! ./BasePlugin */ \"./node_modules/phaser/src/plugins/BasePlugin.js\");\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar SceneEvents = __webpack_require__(/*! ../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Scene Level Plugin is installed into every Scene and belongs to that Scene.\r\n * It can listen for Scene events and respond to them.\r\n * It can map itself to a Scene property, or into the Scene Systems, or both.\r\n *\r\n * @class ScenePlugin\r\n * @memberof Phaser.Plugins\r\n * @extends Phaser.Plugins.BasePlugin\r\n * @constructor\r\n * @since 3.8.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin.\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager.\r\n */\r\nvar ScenePlugin = new Class({\r\n\r\n Extends: BasePlugin,\r\n\r\n initialize:\r\n\r\n function ScenePlugin (scene, pluginManager)\r\n {\r\n BasePlugin.call(this, pluginManager);\r\n\r\n /**\r\n * A reference to the Scene that has installed this plugin.\r\n * Only set if it's a Scene Plugin, otherwise `null`.\r\n * This property is only set when the plugin is instantiated and added to the Scene, not before.\r\n * You can use it during the `boot` method.\r\n *\r\n * @name Phaser.Plugins.ScenePlugin#scene\r\n * @type {?Phaser.Scene}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A reference to the Scene Systems of the Scene that has installed this plugin.\r\n * Only set if it's a Scene Plugin, otherwise `null`.\r\n * This property is only set when the plugin is instantiated and added to the Scene, not before.\r\n * You can use it during the `boot` method.\r\n *\r\n * @name Phaser.Plugins.ScenePlugin#systems\r\n * @type {?Phaser.Scenes.Systems}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n },\r\n\r\n /**\r\n * This method is called when the Scene boots. It is only ever called once.\r\n *\r\n * By this point the plugin properties `scene` and `systems` will have already been set.\r\n *\r\n * In here you can listen for {@link Phaser.Scenes.Events Scene events} and set-up whatever you need for this plugin to run.\r\n * Here are the Scene events you can listen to:\r\n *\r\n * - start\r\n * - ready\r\n * - preupdate\r\n * - update\r\n * - postupdate\r\n * - resize\r\n * - pause\r\n * - resume\r\n * - sleep\r\n * - wake\r\n * - transitioninit\r\n * - transitionstart\r\n * - transitioncomplete\r\n * - transitionout\r\n * - shutdown\r\n * - destroy\r\n *\r\n * At the very least you should offer a destroy handler for when the Scene closes down, i.e:\r\n *\r\n * ```javascript\r\n * var eventEmitter = this.systems.events;\r\n * eventEmitter.once('destroy', this.sceneDestroy, this);\r\n * ```\r\n *\r\n * @method Phaser.Plugins.ScenePlugin#boot\r\n * @since 3.8.0\r\n */\r\n boot: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Game instance has been destroyed.\r\n * \r\n * You must release everything in here, all references, all objects, free it all up.\r\n *\r\n * @method Phaser.Plugins.ScenePlugin#destroy\r\n * @since 3.8.0\r\n */\r\n destroy: function ()\r\n {\r\n this.pluginManager = null;\r\n this.game = null;\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ScenePlugin;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/plugins/ScenePlugin.js?"); /***/ }), /***/ "./node_modules/phaser/src/plugins/index.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/plugins/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Plugins\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BasePlugin: __webpack_require__(/*! ./BasePlugin */ \"./node_modules/phaser/src/plugins/BasePlugin.js\"),\r\n DefaultPlugins: __webpack_require__(/*! ./DefaultPlugins */ \"./node_modules/phaser/src/plugins/DefaultPlugins.js\"),\r\n PluginCache: __webpack_require__(/*! ./PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\"),\r\n PluginManager: __webpack_require__(/*! ./PluginManager */ \"./node_modules/phaser/src/plugins/PluginManager.js\"),\r\n ScenePlugin: __webpack_require__(/*! ./ScenePlugin */ \"./node_modules/phaser/src/plugins/ScenePlugin.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/plugins/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/polyfills/Array.forEach.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/polyfills/Array.forEach.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n* A polyfill for Array.forEach\r\n* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\r\n*/\r\nif (!Array.prototype.forEach)\r\n{\r\n Array.prototype.forEach = function (fun /*, thisArg */)\r\n {\r\n 'use strict';\r\n\r\n if (this === void 0 || this === null)\r\n {\r\n throw new TypeError();\r\n }\r\n\r\n var t = Object(this);\r\n var len = t.length >>> 0;\r\n\r\n if (typeof fun !== 'function')\r\n {\r\n throw new TypeError();\r\n }\r\n\r\n var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\r\n\r\n for (var i = 0; i < len; i++)\r\n {\r\n if (i in t)\r\n {\r\n fun.call(thisArg, t[i], i, t);\r\n }\r\n }\r\n };\r\n}\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/polyfills/Array.forEach.js?"); /***/ }), /***/ "./node_modules/phaser/src/polyfills/Array.isArray.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/polyfills/Array.isArray.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n* A polyfill for Array.isArray\r\n*/\r\nif (!Array.isArray)\r\n{\r\n Array.isArray = function (arg)\r\n {\r\n return Object.prototype.toString.call(arg) === '[object Array]';\r\n };\r\n}\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/polyfills/Array.isArray.js?"); /***/ }), /***/ "./node_modules/phaser/src/polyfills/AudioContextMonkeyPatch.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/polyfills/AudioContextMonkeyPatch.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/* Copyright 2013 Chris Wilson\r\n\r\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n*/\r\n\r\n/*\r\n\r\nThis monkeypatch library is intended to be included in projects that are\r\nwritten to the proper AudioContext spec (instead of webkitAudioContext),\r\nand that use the new naming and proper bits of the Web Audio API (e.g.\r\nusing BufferSourceNode.start() instead of BufferSourceNode.noteOn()), but may\r\nhave to run on systems that only support the deprecated bits.\r\n\r\nThis library should be harmless to include if the browser supports\r\nunprefixed \"AudioContext\", and/or if it supports the new names.\r\n\r\nThe patches this library handles:\r\nif window.AudioContext is unsupported, it will be aliased to webkitAudioContext().\r\nif AudioBufferSourceNode.start() is unimplemented, it will be routed to noteOn() or\r\nnoteGrainOn(), depending on parameters.\r\n\r\nThe following aliases only take effect if the new names are not already in place:\r\n\r\nAudioBufferSourceNode.stop() is aliased to noteOff()\r\nAudioContext.createGain() is aliased to createGainNode()\r\nAudioContext.createDelay() is aliased to createDelayNode()\r\nAudioContext.createScriptProcessor() is aliased to createJavaScriptNode()\r\nAudioContext.createPeriodicWave() is aliased to createWaveTable()\r\nOscillatorNode.start() is aliased to noteOn()\r\nOscillatorNode.stop() is aliased to noteOff()\r\nOscillatorNode.setPeriodicWave() is aliased to setWaveTable()\r\nAudioParam.setTargetAtTime() is aliased to setTargetValueAtTime()\r\n\r\nThis library does NOT patch the enumerated type changes, as it is\r\nrecommended in the specification that implementations support both integer\r\nand string types for AudioPannerNode.panningModel, AudioPannerNode.distanceModel\r\nBiquadFilterNode.type and OscillatorNode.type.\r\n\r\n*/\r\n\r\n(function () {\r\n\r\n function fixSetTarget(param) {\r\n if (!param)\t// if NYI, just return\r\n return;\r\n if (!param.setTargetAtTime)\r\n param.setTargetAtTime = param.setTargetValueAtTime;\r\n }\r\n\r\n if (window.hasOwnProperty('webkitAudioContext') &&\r\n !window.hasOwnProperty('AudioContext')) {\r\n window.AudioContext = webkitAudioContext;\r\n\r\n if (!AudioContext.prototype.hasOwnProperty('createGain'))\r\n AudioContext.prototype.createGain = AudioContext.prototype.createGainNode;\r\n if (!AudioContext.prototype.hasOwnProperty('createDelay'))\r\n AudioContext.prototype.createDelay = AudioContext.prototype.createDelayNode;\r\n if (!AudioContext.prototype.hasOwnProperty('createScriptProcessor'))\r\n AudioContext.prototype.createScriptProcessor = AudioContext.prototype.createJavaScriptNode;\r\n if (!AudioContext.prototype.hasOwnProperty('createPeriodicWave'))\r\n AudioContext.prototype.createPeriodicWave = AudioContext.prototype.createWaveTable;\r\n\r\n\r\n AudioContext.prototype.internal_createGain = AudioContext.prototype.createGain;\r\n AudioContext.prototype.createGain = function() {\r\n var node = this.internal_createGain();\r\n fixSetTarget(node.gain);\r\n return node;\r\n };\r\n\r\n AudioContext.prototype.internal_createDelay = AudioContext.prototype.createDelay;\r\n AudioContext.prototype.createDelay = function(maxDelayTime) {\r\n var node = maxDelayTime ? this.internal_createDelay(maxDelayTime) : this.internal_createDelay();\r\n fixSetTarget(node.delayTime);\r\n return node;\r\n };\r\n\r\n AudioContext.prototype.internal_createBufferSource = AudioContext.prototype.createBufferSource;\r\n AudioContext.prototype.createBufferSource = function() {\r\n var node = this.internal_createBufferSource();\r\n if (!node.start) {\r\n node.start = function ( when, offset, duration ) {\r\n if ( offset || duration )\r\n this.noteGrainOn( when || 0, offset, duration );\r\n else\r\n this.noteOn( when || 0 );\r\n };\r\n } else {\r\n node.internal_start = node.start;\r\n node.start = function( when, offset, duration ) {\r\n if( typeof duration !== 'undefined' )\r\n node.internal_start( when || 0, offset, duration );\r\n else\r\n node.internal_start( when || 0, offset || 0 );\r\n };\r\n }\r\n if (!node.stop) {\r\n node.stop = function ( when ) {\r\n this.noteOff( when || 0 );\r\n };\r\n } else {\r\n node.internal_stop = node.stop;\r\n node.stop = function( when ) {\r\n node.internal_stop( when || 0 );\r\n };\r\n }\r\n fixSetTarget(node.playbackRate);\r\n return node;\r\n };\r\n\r\n AudioContext.prototype.internal_createDynamicsCompressor = AudioContext.prototype.createDynamicsCompressor;\r\n AudioContext.prototype.createDynamicsCompressor = function() {\r\n var node = this.internal_createDynamicsCompressor();\r\n fixSetTarget(node.threshold);\r\n fixSetTarget(node.knee);\r\n fixSetTarget(node.ratio);\r\n fixSetTarget(node.reduction);\r\n fixSetTarget(node.attack);\r\n fixSetTarget(node.release);\r\n return node;\r\n };\r\n\r\n AudioContext.prototype.internal_createBiquadFilter = AudioContext.prototype.createBiquadFilter;\r\n AudioContext.prototype.createBiquadFilter = function() {\r\n var node = this.internal_createBiquadFilter();\r\n fixSetTarget(node.frequency);\r\n fixSetTarget(node.detune);\r\n fixSetTarget(node.Q);\r\n fixSetTarget(node.gain);\r\n return node;\r\n };\r\n\r\n if (AudioContext.prototype.hasOwnProperty( 'createOscillator' )) {\r\n AudioContext.prototype.internal_createOscillator = AudioContext.prototype.createOscillator;\r\n AudioContext.prototype.createOscillator = function() {\r\n var node = this.internal_createOscillator();\r\n if (!node.start) {\r\n node.start = function ( when ) {\r\n this.noteOn( when || 0 );\r\n };\r\n } else {\r\n node.internal_start = node.start;\r\n node.start = function ( when ) {\r\n node.internal_start( when || 0);\r\n };\r\n }\r\n if (!node.stop) {\r\n node.stop = function ( when ) {\r\n this.noteOff( when || 0 );\r\n };\r\n } else {\r\n node.internal_stop = node.stop;\r\n node.stop = function( when ) {\r\n node.internal_stop( when || 0 );\r\n };\r\n }\r\n if (!node.setPeriodicWave)\r\n node.setPeriodicWave = node.setWaveTable;\r\n fixSetTarget(node.frequency);\r\n fixSetTarget(node.detune);\r\n return node;\r\n };\r\n }\r\n }\r\n\r\n if (window.hasOwnProperty('webkitOfflineAudioContext') &&\r\n !window.hasOwnProperty('OfflineAudioContext')) {\r\n window.OfflineAudioContext = webkitOfflineAudioContext;\r\n }\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/polyfills/AudioContextMonkeyPatch.js?"); /***/ }), /***/ "./node_modules/phaser/src/polyfills/Math.trunc.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/polyfills/Math.trunc.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("// ES6 Math.trunc - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc\r\nif (!Math.trunc) {\r\n Math.trunc = function trunc(x) {\r\n return x < 0 ? Math.ceil(x) : Math.floor(x);\r\n };\r\n}\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/polyfills/Math.trunc.js?"); /***/ }), /***/ "./node_modules/phaser/src/polyfills/Uint32Array.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/polyfills/Uint32Array.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n* Low-budget Float32Array knock-off, suitable for use with P2.js in IE9\r\n* Source: http://www.html5gamedevs.com/topic/5988-phaser-12-ie9/\r\n* Cameron Foale (http://www.kibibu.com)\r\n*/\r\nif (typeof window.Uint32Array !== 'function' && typeof window.Uint32Array !== 'object')\r\n{\r\n var CheapArray = function (fakeType)\r\n {\r\n var proto = new Array(); // jshint ignore:line\r\n\r\n window[fakeType] = function(arg) {\r\n\r\n if (typeof(arg) === 'number')\r\n {\r\n Array.call(this, arg);\r\n\r\n this.length = arg;\r\n\r\n for (var i = 0; i < this.length; i++)\r\n {\r\n this[i] = 0;\r\n }\r\n }\r\n else\r\n {\r\n Array.call(this, arg.length);\r\n\r\n this.length = arg.length;\r\n\r\n for (var i = 0; i < this.length; i++)\r\n {\r\n this[i] = arg[i];\r\n }\r\n }\r\n };\r\n\r\n window[fakeType].prototype = proto;\r\n window[fakeType].constructor = window[fakeType];\r\n };\r\n\r\n CheapArray('Float32Array'); // jshint ignore:line\r\n CheapArray('Uint32Array'); // jshint ignore:line\r\n CheapArray('Uint16Array'); // jshint ignore:line\r\n CheapArray('Int16Array'); // jshint ignore:line\r\n CheapArray('ArrayBuffer'); // jshint ignore:line\r\n}\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/polyfills/Uint32Array.js?"); /***/ }), /***/ "./node_modules/phaser/src/polyfills/console.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/polyfills/console.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * Also fix for the absent console in IE9\r\n */\r\nif (!window.console)\r\n{\r\n window.console = {};\r\n window.console.log = window.console.assert = function(){};\r\n window.console.warn = window.console.assert = function(){};\r\n}\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/polyfills/console.js?"); /***/ }), /***/ "./node_modules/phaser/src/polyfills/index.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/polyfills/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("__webpack_require__(/*! ./Array.forEach */ \"./node_modules/phaser/src/polyfills/Array.forEach.js\");\r\n__webpack_require__(/*! ./Array.isArray */ \"./node_modules/phaser/src/polyfills/Array.isArray.js\");\r\n__webpack_require__(/*! ./AudioContextMonkeyPatch */ \"./node_modules/phaser/src/polyfills/AudioContextMonkeyPatch.js\");\r\n__webpack_require__(/*! ./console */ \"./node_modules/phaser/src/polyfills/console.js\");\r\n__webpack_require__(/*! ./Math.trunc */ \"./node_modules/phaser/src/polyfills/Math.trunc.js\");\r\n__webpack_require__(/*! ./performance.now */ \"./node_modules/phaser/src/polyfills/performance.now.js\");\r\n__webpack_require__(/*! ./requestAnimationFrame */ \"./node_modules/phaser/src/polyfills/requestAnimationFrame.js\");\r\n__webpack_require__(/*! ./Uint32Array */ \"./node_modules/phaser/src/polyfills/Uint32Array.js\");\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/polyfills/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/polyfills/performance.now.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/polyfills/performance.now.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * performance.now\r\n */\r\n(function () {\r\n\r\n if ('performance' in window === false)\r\n {\r\n window.performance = {};\r\n }\r\n\r\n // Thanks IE8\r\n Date.now = (Date.now || function () {\r\n return new Date().getTime();\r\n });\r\n\r\n if ('now' in window.performance === false)\r\n {\r\n var nowOffset = Date.now();\r\n\r\n if (performance.timing && performance.timing.navigationStart)\r\n {\r\n nowOffset = performance.timing.navigationStart;\r\n }\r\n\r\n window.performance.now = function now ()\r\n {\r\n return Date.now() - nowOffset;\r\n }\r\n }\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/polyfills/performance.now.js?"); /***/ }), /***/ "./node_modules/phaser/src/polyfills/requestAnimationFrame.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/polyfills/requestAnimationFrame.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("// References:\r\n// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\r\n// https://gist.github.com/1579671\r\n// http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision\r\n// https://gist.github.com/timhall/4078614\r\n// https://github.com/Financial-Times/polyfill-service/tree/master/polyfills/requestAnimationFrame\r\n\r\n// requestAnimationFrame\r\nvar lastTime = Date.now();\r\n\r\nvar vendors = [ 'ms', 'moz', 'webkit', 'o' ];\r\n\r\nfor (var x = 0; x < vendors.length && !window.requestAnimationFrame; x++)\r\n{\r\n window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];\r\n window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];\r\n}\r\n\r\nif (!window.requestAnimationFrame)\r\n{\r\n window.requestAnimationFrame = function (callback)\r\n {\r\n if (typeof callback !== 'function')\r\n {\r\n throw new TypeError(callback + 'is not a function');\r\n }\r\n\r\n var currentTime = Date.now();\r\n var delay = 16 + lastTime - currentTime;\r\n\r\n if (delay < 0)\r\n {\r\n delay = 0;\r\n }\r\n\r\n lastTime = currentTime;\r\n\r\n return setTimeout(function () {\r\n lastTime = Date.now();\r\n callback(performance.now());\r\n }, delay);\r\n };\r\n}\r\n\r\nif (!window.cancelAnimationFrame)\r\n{\r\n window.cancelAnimationFrame = function(id)\r\n {\r\n clearTimeout(id);\r\n };\r\n}\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/polyfills/requestAnimationFrame.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/BlendModes.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/renderer/BlendModes.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Phaser Blend Modes.\r\n * \r\n * @namespace Phaser.BlendModes\r\n * @since 3.0.0\r\n */\r\n\r\nmodule.exports = {\r\n\r\n /**\r\n * Skips the Blend Mode check in the renderer.\r\n * \r\n * @name Phaser.BlendModes.SKIP_CHECK\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SKIP_CHECK: -1,\r\n\r\n /**\r\n * Normal blend mode. For Canvas and WebGL.\r\n * This is the default setting and draws new shapes on top of the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.NORMAL\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n NORMAL: 0,\r\n\r\n /**\r\n * Add blend mode. For Canvas and WebGL.\r\n * Where both shapes overlap the color is determined by adding color values.\r\n * \r\n * @name Phaser.BlendModes.ADD\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n ADD: 1,\r\n\r\n /**\r\n * Multiply blend mode. For Canvas and WebGL.\r\n * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result.\r\n * \r\n * @name Phaser.BlendModes.MULTIPLY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n MULTIPLY: 2,\r\n\r\n /**\r\n * Screen blend mode. For Canvas and WebGL.\r\n * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply)\r\n * \r\n * @name Phaser.BlendModes.SCREEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SCREEN: 3,\r\n\r\n /**\r\n * Overlay blend mode. For Canvas only.\r\n * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter.\r\n * \r\n * @name Phaser.BlendModes.OVERLAY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n OVERLAY: 4,\r\n\r\n /**\r\n * Darken blend mode. For Canvas only.\r\n * Retains the darkest pixels of both layers.\r\n * \r\n * @name Phaser.BlendModes.DARKEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DARKEN: 5,\r\n\r\n /**\r\n * Lighten blend mode. For Canvas only.\r\n * Retains the lightest pixels of both layers.\r\n * \r\n * @name Phaser.BlendModes.LIGHTEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LIGHTEN: 6,\r\n\r\n /**\r\n * Color Dodge blend mode. For Canvas only.\r\n * Divides the bottom layer by the inverted top layer.\r\n * \r\n * @name Phaser.BlendModes.COLOR_DODGE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR_DODGE: 7,\r\n\r\n /**\r\n * Color Burn blend mode. For Canvas only.\r\n * Divides the inverted bottom layer by the top layer, and then inverts the result.\r\n * \r\n * @name Phaser.BlendModes.COLOR_BURN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR_BURN: 8,\r\n\r\n /**\r\n * Hard Light blend mode. For Canvas only.\r\n * A combination of multiply and screen like overlay, but with top and bottom layer swapped.\r\n * \r\n * @name Phaser.BlendModes.HARD_LIGHT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n HARD_LIGHT: 9,\r\n\r\n /**\r\n * Soft Light blend mode. For Canvas only.\r\n * A softer version of hard-light. Pure black or white does not result in pure black or white.\r\n * \r\n * @name Phaser.BlendModes.SOFT_LIGHT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOFT_LIGHT: 10,\r\n\r\n /**\r\n * Difference blend mode. For Canvas only.\r\n * Subtracts the bottom layer from the top layer or the other way round to always get a positive value.\r\n * \r\n * @name Phaser.BlendModes.DIFFERENCE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DIFFERENCE: 11,\r\n\r\n /**\r\n * Exclusion blend mode. For Canvas only.\r\n * Like difference, but with lower contrast.\r\n * \r\n * @name Phaser.BlendModes.EXCLUSION\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n EXCLUSION: 12,\r\n\r\n /**\r\n * Hue blend mode. For Canvas only.\r\n * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer.\r\n * \r\n * @name Phaser.BlendModes.HUE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n HUE: 13,\r\n\r\n /**\r\n * Saturation blend mode. For Canvas only.\r\n * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.SATURATION\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SATURATION: 14,\r\n\r\n /**\r\n * Color blend mode. For Canvas only.\r\n * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.COLOR\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR: 15,\r\n\r\n /**\r\n * Luminosity blend mode. For Canvas only.\r\n * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.LUMINOSITY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LUMINOSITY: 16,\r\n\r\n /**\r\n * Alpha erase blend mode. For Canvas and WebGL.\r\n * \r\n * @name Phaser.BlendModes.ERASE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n ERASE: 17,\r\n\r\n /**\r\n * Source-in blend mode. For Canvas only.\r\n * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_IN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_IN: 18,\r\n\r\n /**\r\n * Source-out blend mode. For Canvas only.\r\n * The new shape is drawn where it doesn't overlap the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_OUT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_OUT: 19,\r\n\r\n /**\r\n * Source-out blend mode. For Canvas only.\r\n * The new shape is only drawn where it overlaps the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_ATOP\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_ATOP: 20,\r\n\r\n /**\r\n * Destination-over blend mode. For Canvas only.\r\n * New shapes are drawn behind the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_OVER\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_OVER: 21,\r\n\r\n /**\r\n * Destination-in blend mode. For Canvas only.\r\n * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_IN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_IN: 22,\r\n\r\n /**\r\n * Destination-out blend mode. For Canvas only.\r\n * The existing content is kept where it doesn't overlap the new shape.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_OUT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_OUT: 23,\r\n\r\n /**\r\n * Destination-out blend mode. For Canvas only.\r\n * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_ATOP\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_ATOP: 24,\r\n\r\n /**\r\n * Lighten blend mode. For Canvas only.\r\n * Where both shapes overlap the color is determined by adding color values.\r\n * \r\n * @name Phaser.BlendModes.LIGHTER\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LIGHTER: 25,\r\n\r\n /**\r\n * Copy blend mode. For Canvas only.\r\n * Only the new shape is shown.\r\n * \r\n * @name Phaser.BlendModes.COPY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COPY: 26,\r\n\r\n /**\r\n * Xor blend mode. For Canvas only.\r\n * Shapes are made transparent where both overlap and drawn normal everywhere else.\r\n * \r\n * @name Phaser.BlendModes.XOR\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n XOR: 27\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/BlendModes.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/ScaleModes.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/renderer/ScaleModes.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Phaser Scale Modes.\r\n * \r\n * @namespace Phaser.ScaleModes\r\n * @since 3.0.0\r\n */\r\n\r\nvar ScaleModes = {\r\n\r\n /**\r\n * Default Scale Mode (Linear).\r\n * \r\n * @name Phaser.ScaleModes.DEFAULT\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n DEFAULT: 0,\r\n\r\n /**\r\n * Linear Scale Mode.\r\n * \r\n * @name Phaser.ScaleModes.LINEAR\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n LINEAR: 0,\r\n\r\n /**\r\n * Nearest Scale Mode.\r\n * \r\n * @name Phaser.ScaleModes.NEAREST\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n NEAREST: 1\r\n\r\n};\r\n\r\nmodule.exports = ScaleModes;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/ScaleModes.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/canvas/CanvasRenderer.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/renderer/canvas/CanvasRenderer.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CanvasSnapshot = __webpack_require__(/*! ../snapshot/CanvasSnapshot */ \"./node_modules/phaser/src/renderer/snapshot/CanvasSnapshot.js\");\r\nvar CameraEvents = __webpack_require__(/*! ../../cameras/2d/events */ \"./node_modules/phaser/src/cameras/2d/events/index.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../../const */ \"./node_modules/phaser/src/const.js\");\r\nvar GetBlendModes = __webpack_require__(/*! ./utils/GetBlendModes */ \"./node_modules/phaser/src/renderer/canvas/utils/GetBlendModes.js\");\r\nvar ScaleEvents = __webpack_require__(/*! ../../scale/events */ \"./node_modules/phaser/src/scale/events/index.js\");\r\nvar TransformMatrix = __webpack_require__(/*! ../../gameobjects/components/TransformMatrix */ \"./node_modules/phaser/src/gameobjects/components/TransformMatrix.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Canvas Renderer is responsible for managing 2D canvas rendering contexts, including the one used by the Game's canvas. It tracks the internal state of a given context and can renderer textured Game Objects to it, taking into account alpha, blending, and scaling.\r\n *\r\n * @class CanvasRenderer\r\n * @memberof Phaser.Renderer.Canvas\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - The Phaser Game instance that owns this renderer.\r\n */\r\nvar CanvasRenderer = new Class({\r\n\r\n initialize:\r\n\r\n function CanvasRenderer (game)\r\n {\r\n /**\r\n * The Phaser Game instance that owns this renderer.\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#game\r\n * @type {Phaser.Game}\r\n * @since 3.0.0\r\n */\r\n this.game = game;\r\n\r\n /**\r\n * A constant which allows the renderer to be easily identified as a Canvas Renderer.\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#type\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.type = CONST.CANVAS;\r\n\r\n /**\r\n * The total number of Game Objects which were rendered in a frame.\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#drawCount\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.drawCount = 0;\r\n\r\n /**\r\n * The width of the canvas being rendered to.\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#width\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.width = 0;\r\n\r\n /**\r\n * The height of the canvas being rendered to.\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#height\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.height = 0;\r\n\r\n /**\r\n * The local configuration settings of the CanvasRenderer.\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#config\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.config = {\r\n clearBeforeRender: game.config.clearBeforeRender,\r\n backgroundColor: game.config.backgroundColor,\r\n resolution: game.config.resolution,\r\n antialias: game.config.antialias,\r\n roundPixels: game.config.roundPixels\r\n };\r\n\r\n /**\r\n * The canvas element which the Game uses.\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#gameCanvas\r\n * @type {HTMLCanvasElement}\r\n * @since 3.0.0\r\n */\r\n this.gameCanvas = game.canvas;\r\n\r\n var contextOptions = {\r\n alpha: game.config.transparent,\r\n desynchronized: game.config.desynchronized\r\n };\r\n\r\n /**\r\n * The canvas context used to render all Cameras in all Scenes during the game loop.\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#gameContext\r\n * @type {CanvasRenderingContext2D}\r\n * @since 3.0.0\r\n */\r\n this.gameContext = (this.game.config.context) ? this.game.config.context : this.gameCanvas.getContext('2d', contextOptions);\r\n\r\n /**\r\n * The canvas context currently used by the CanvasRenderer for all rendering operations.\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#currentContext\r\n * @type {CanvasRenderingContext2D}\r\n * @since 3.0.0\r\n */\r\n this.currentContext = this.gameContext;\r\n\r\n /**\r\n * Should the Canvas use Image Smoothing or not when drawing Sprites?\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#antialias\r\n * @type {boolean}\r\n * @since 3.20.0\r\n */\r\n this.antialias = game.config.antialias;\r\n\r\n /**\r\n * The blend modes supported by the Canvas Renderer.\r\n *\r\n * This object maps the {@link Phaser.BlendModes} to canvas compositing operations.\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#blendModes\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.blendModes = GetBlendModes();\r\n\r\n /**\r\n * Details about the currently scheduled snapshot.\r\n * \r\n * 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.\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#snapshotState\r\n * @type {Phaser.Types.Renderer.Snapshot.SnapshotState}\r\n * @since 3.16.0\r\n */\r\n this.snapshotState = {\r\n x: 0,\r\n y: 0,\r\n width: 1,\r\n height: 1,\r\n getPixel: false,\r\n callback: null,\r\n type: 'image/png',\r\n encoder: 0.92\r\n };\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix1\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.12.0\r\n */\r\n this._tempMatrix1 = new TransformMatrix();\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix2\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.12.0\r\n */\r\n this._tempMatrix2 = new TransformMatrix();\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix3\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.12.0\r\n */\r\n this._tempMatrix3 = new TransformMatrix();\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix4\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.12.0\r\n */\r\n this._tempMatrix4 = new TransformMatrix();\r\n\r\n this.init();\r\n },\r\n\r\n /**\r\n * Prepares the game canvas for rendering.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#init\r\n * @since 3.0.0\r\n */\r\n init: function ()\r\n {\r\n this.game.scale.on(ScaleEvents.RESIZE, this.onResize, this);\r\n\r\n var baseSize = this.game.scale.baseSize;\r\n\r\n this.resize(baseSize.width, baseSize.height);\r\n },\r\n\r\n /**\r\n * The event handler that manages the `resize` event dispatched by the Scale Manager.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#onResize\r\n * @since 3.16.0\r\n *\r\n * @param {Phaser.Structs.Size} gameSize - The default Game Size object. This is the un-modified game dimensions.\r\n * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this.\r\n * @param {Phaser.Structs.Size} displaySize - The display Size object. The size of the canvas style width / height attributes.\r\n * @param {number} [resolution] - The Scale Manager resolution setting.\r\n */\r\n onResize: function (gameSize, baseSize)\r\n {\r\n // Has the underlying canvas size changed?\r\n if (baseSize.width !== this.width || baseSize.height !== this.height)\r\n {\r\n this.resize(baseSize.width, baseSize.height);\r\n }\r\n },\r\n\r\n /**\r\n * Resize the main game canvas.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#resize\r\n * @since 3.0.0\r\n *\r\n * @param {number} [width] - The new width of the renderer.\r\n * @param {number} [height] - The new height of the renderer.\r\n */\r\n resize: function (width, height)\r\n {\r\n this.width = width;\r\n this.height = height;\r\n },\r\n\r\n /**\r\n * Resets the transformation matrix of the current context to the identity matrix, thus resetting any transformation.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#resetTransform\r\n * @since 3.0.0\r\n */\r\n resetTransform: function ()\r\n {\r\n this.currentContext.setTransform(1, 0, 0, 1, 0, 0);\r\n },\r\n\r\n /**\r\n * Sets the blend mode (compositing operation) of the current context.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#setBlendMode\r\n * @since 3.0.0\r\n *\r\n * @param {string} blendMode - The new blend mode which should be used.\r\n *\r\n * @return {this} This CanvasRenderer object.\r\n */\r\n setBlendMode: function (blendMode)\r\n {\r\n this.currentContext.globalCompositeOperation = blendMode;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Changes the Canvas Rendering Context that all draw operations are performed against.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#setContext\r\n * @since 3.12.0\r\n *\r\n * @param {?CanvasRenderingContext2D} [ctx] - The new Canvas Rendering Context to draw everything to. Leave empty to reset to the Game Canvas.\r\n *\r\n * @return {this} The Canvas Renderer instance.\r\n */\r\n setContext: function (ctx)\r\n {\r\n this.currentContext = (ctx) ? ctx : this.gameContext;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the global alpha of the current context.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#setAlpha\r\n * @since 3.0.0\r\n *\r\n * @param {number} alpha - The new alpha to use, where 0 is fully transparent and 1 is fully opaque.\r\n *\r\n * @return {this} This CanvasRenderer object.\r\n */\r\n setAlpha: function (alpha)\r\n {\r\n this.currentContext.globalAlpha = alpha;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Called at the start of the render loop.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#preRender\r\n * @since 3.0.0\r\n */\r\n preRender: function ()\r\n {\r\n var ctx = this.gameContext;\r\n var config = this.config;\r\n\r\n var width = this.width;\r\n var height = this.height;\r\n\r\n ctx.globalAlpha = 1;\r\n ctx.globalCompositeOperation = 'source-over';\r\n ctx.setTransform(1, 0, 0, 1, 0, 0);\r\n\r\n if (config.clearBeforeRender)\r\n {\r\n ctx.clearRect(0, 0, width, height);\r\n }\r\n\r\n if (!config.transparent)\r\n {\r\n ctx.fillStyle = config.backgroundColor.rgba;\r\n ctx.fillRect(0, 0, width, height);\r\n }\r\n\r\n ctx.save();\r\n\r\n this.drawCount = 0;\r\n },\r\n\r\n /**\r\n * Renders the Scene to the given Camera.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#render\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to render.\r\n * @param {Phaser.GameObjects.DisplayList} children - The Game Objects within the Scene to be rendered.\r\n * @param {number} interpolationPercentage - The interpolation percentage to apply. Currently unused.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with.\r\n */\r\n render: function (scene, children, interpolationPercentage, camera)\r\n {\r\n var list = children.list;\r\n var childCount = list.length;\r\n\r\n var cx = camera._cx;\r\n var cy = camera._cy;\r\n var cw = camera._cw;\r\n var ch = camera._ch;\r\n\r\n var ctx = (camera.renderToTexture) ? camera.context : scene.sys.context;\r\n\r\n // Save context pre-clip\r\n ctx.save();\r\n\r\n if (this.game.scene.customViewports)\r\n {\r\n ctx.beginPath();\r\n ctx.rect(cx, cy, cw, ch);\r\n ctx.clip();\r\n }\r\n\r\n this.currentContext = ctx;\r\n\r\n var mask = camera.mask;\r\n\r\n if (mask)\r\n {\r\n mask.preRenderCanvas(this, null, camera._maskCamera);\r\n }\r\n\r\n if (!camera.transparent)\r\n {\r\n ctx.fillStyle = camera.backgroundColor.rgba;\r\n ctx.fillRect(cx, cy, cw, ch);\r\n }\r\n\r\n ctx.globalAlpha = camera.alpha;\r\n\r\n ctx.globalCompositeOperation = 'source-over';\r\n\r\n this.drawCount += list.length;\r\n\r\n if (camera.renderToTexture)\r\n {\r\n camera.emit(CameraEvents.PRE_RENDER, camera);\r\n }\r\n\r\n camera.matrix.copyToContext(ctx);\r\n\r\n for (var i = 0; i < childCount; i++)\r\n {\r\n var child = list[i];\r\n\r\n if (!child.willRender(camera))\r\n {\r\n continue;\r\n }\r\n\r\n if (child.mask)\r\n {\r\n child.mask.preRenderCanvas(this, child, camera);\r\n }\r\n\r\n child.renderCanvas(this, child, interpolationPercentage, camera);\r\n\r\n if (child.mask)\r\n {\r\n child.mask.postRenderCanvas(this, child, camera);\r\n }\r\n }\r\n\r\n ctx.setTransform(1, 0, 0, 1, 0, 0);\r\n ctx.globalCompositeOperation = 'source-over';\r\n ctx.globalAlpha = 1;\r\n\r\n camera.flashEffect.postRenderCanvas(ctx);\r\n camera.fadeEffect.postRenderCanvas(ctx);\r\n\r\n camera.dirty = false;\r\n\r\n if (mask)\r\n {\r\n mask.postRenderCanvas(this);\r\n }\r\n\r\n // Restore pre-clip context\r\n ctx.restore();\r\n\r\n if (camera.renderToTexture)\r\n {\r\n camera.emit(CameraEvents.POST_RENDER, camera);\r\n\r\n scene.sys.context.drawImage(camera.canvas, cx, cy);\r\n }\r\n },\r\n\r\n /**\r\n * Restores the game context's global settings and takes a snapshot if one is scheduled.\r\n *\r\n * The post-render step happens after all Cameras in all Scenes have been rendered.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#postRender\r\n * @since 3.0.0\r\n */\r\n postRender: function ()\r\n {\r\n var ctx = this.gameContext;\r\n\r\n ctx.restore();\r\n\r\n var state = this.snapshotState;\r\n\r\n if (state.callback)\r\n {\r\n CanvasSnapshot(this.gameCanvas, state);\r\n\r\n state.callback = null;\r\n }\r\n },\r\n\r\n /**\r\n * Takes a snapshot of the given area of the given canvas.\r\n * \r\n * Unlike the other snapshot methods, this one is processed immediately and doesn't wait for the next render.\r\n * \r\n * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets\r\n * more expensive the larger the canvas size gets, so please be careful how you employ this in your game.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshotCanvas\r\n * @since 3.19.0\r\n *\r\n * @param {HTMLCanvasElement} canvas - The canvas to grab from.\r\n * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created.\r\n * @param {boolean} [getPixel=false] - Grab a single pixel as a Color object, or an area as an Image object?\r\n * @param {integer} [x=0] - The x coordinate to grab from.\r\n * @param {integer} [y=0] - The y coordinate to grab from.\r\n * @param {integer} [width=canvas.width] - The width of the area to grab.\r\n * @param {integer} [height=canvas.height] - The height of the area to grab.\r\n * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`.\r\n * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`.\r\n *\r\n * @return {this} This Canvas Renderer.\r\n */\r\n snapshotCanvas: function (canvas, callback, getPixel, x, y, width, height, type, encoderOptions)\r\n {\r\n if (getPixel === undefined) { getPixel = false; }\r\n\r\n this.snapshotArea(x, y, width, height, callback, type, encoderOptions);\r\n\r\n var state = this.snapshotState;\r\n\r\n state.getPixel = getPixel;\r\n\r\n CanvasSnapshot(this.canvas, state);\r\n\r\n state.callback = null;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered.\r\n * \r\n * To capture a specific area see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`.\r\n * \r\n * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then\r\n * calling this method will override it.\r\n * \r\n * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets\r\n * more expensive the larger the canvas size gets, so please be careful how you employ this in your game.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created.\r\n * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`.\r\n * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`.\r\n *\r\n * @return {this} This WebGL Renderer.\r\n */\r\n snapshot: function (callback, type, encoderOptions)\r\n {\r\n return this.snapshotArea(0, 0, this.gameCanvas.width, this.gameCanvas.height, callback, type, encoderOptions);\r\n },\r\n\r\n /**\r\n * Schedules a snapshot of the given area of the game viewport to be taken after the current frame is rendered.\r\n * \r\n * To capture the whole game viewport see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`.\r\n * \r\n * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then\r\n * calling this method will override it.\r\n * \r\n * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets\r\n * more expensive the larger the canvas size gets, so please be careful how you employ this in your game.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshotArea\r\n * @since 3.16.0\r\n *\r\n * @param {integer} x - The x coordinate to grab from.\r\n * @param {integer} y - The y coordinate to grab from.\r\n * @param {integer} width - The width of the area to grab.\r\n * @param {integer} height - The height of the area to grab.\r\n * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created.\r\n * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`.\r\n * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`.\r\n *\r\n * @return {this} This WebGL Renderer.\r\n */\r\n snapshotArea: function (x, y, width, height, callback, type, encoderOptions)\r\n {\r\n var state = this.snapshotState;\r\n\r\n state.callback = callback;\r\n state.type = type;\r\n state.encoder = encoderOptions;\r\n state.getPixel = false;\r\n state.x = x;\r\n state.y = y;\r\n state.width = Math.min(width, this.gameCanvas.width);\r\n state.height = Math.min(height, this.gameCanvas.height);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Schedules a snapshot of the given pixel from the game viewport to be taken after the current frame is rendered.\r\n * \r\n * To capture the whole game viewport see the `snapshot` method. To capture a specific area, see `snapshotArea`.\r\n * \r\n * Only one snapshot can be active _per frame_. If you have already called `snapshotArea`, for example, then\r\n * calling this method will override it.\r\n * \r\n * Unlike the other two snapshot methods, this one will return a `Color` object containing the color data for\r\n * the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute,\r\n * using less memory.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshotPixel\r\n * @since 3.16.0\r\n *\r\n * @param {integer} x - The x coordinate of the pixel to get.\r\n * @param {integer} y - The y coordinate of the pixel to get.\r\n * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted.\r\n *\r\n * @return {this} This WebGL Renderer.\r\n */\r\n snapshotPixel: function (x, y, callback)\r\n {\r\n this.snapshotArea(x, y, 1, 1, callback);\r\n\r\n this.snapshotState.getPixel = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes a Sprite Game Object, or any object that extends it, and draws it to the current context.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#batchSprite\r\n * @since 3.12.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} sprite - The texture based Game Object to draw.\r\n * @param {Phaser.Textures.Frame} frame - The frame to draw, doesn't have to be that owned by the Game Object.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the rendering transform.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - The transform matrix of the parent container, if set.\r\n */\r\n batchSprite: function (sprite, frame, camera, parentTransformMatrix)\r\n {\r\n var alpha = camera.alpha * sprite.alpha;\r\n\r\n if (alpha === 0)\r\n {\r\n // Nothing to see, so abort early\r\n return;\r\n }\r\n \r\n var ctx = this.currentContext;\r\n\r\n var camMatrix = this._tempMatrix1;\r\n var spriteMatrix = this._tempMatrix2;\r\n var calcMatrix = this._tempMatrix3;\r\n\r\n var cd = frame.canvasData;\r\n\r\n var frameX = cd.x;\r\n var frameY = cd.y;\r\n var frameWidth = frame.cutWidth;\r\n var frameHeight = frame.cutHeight;\r\n var customPivot = frame.customPivot;\r\n\r\n var res = frame.source.resolution;\r\n\r\n var displayOriginX = sprite.displayOriginX;\r\n var displayOriginY = sprite.displayOriginY;\r\n\r\n var x = -displayOriginX + frame.x;\r\n var y = -displayOriginY + frame.y;\r\n\r\n if (sprite.isCropped)\r\n {\r\n var crop = sprite._crop;\r\n\r\n if (crop.flipX !== sprite.flipX || crop.flipY !== sprite.flipY)\r\n {\r\n frame.updateCropUVs(crop, sprite.flipX, sprite.flipY);\r\n }\r\n\r\n frameWidth = crop.cw;\r\n frameHeight = crop.ch;\r\n \r\n frameX = crop.cx;\r\n frameY = crop.cy;\r\n\r\n x = -displayOriginX + crop.x;\r\n y = -displayOriginY + crop.y;\r\n\r\n if (sprite.flipX)\r\n {\r\n if (x >= 0)\r\n {\r\n x = -(x + frameWidth);\r\n }\r\n else if (x < 0)\r\n {\r\n x = (Math.abs(x) - frameWidth);\r\n }\r\n }\r\n \r\n if (sprite.flipY)\r\n {\r\n if (y >= 0)\r\n {\r\n y = -(y + frameHeight);\r\n }\r\n else if (y < 0)\r\n {\r\n y = (Math.abs(y) - frameHeight);\r\n }\r\n }\r\n }\r\n\r\n var flipX = 1;\r\n var flipY = 1;\r\n\r\n if (sprite.flipX)\r\n {\r\n if (!customPivot)\r\n {\r\n x += (-frame.realWidth + (displayOriginX * 2));\r\n }\r\n\r\n flipX = -1;\r\n }\r\n\r\n // Auto-invert the flipY if this is coming from a GLTexture\r\n if (sprite.flipY)\r\n {\r\n if (!customPivot)\r\n {\r\n y += (-frame.realHeight + (displayOriginY * 2));\r\n }\r\n\r\n flipY = -1;\r\n }\r\n\r\n spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX * flipX, sprite.scaleY * flipY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentTransformMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * sprite.scrollFactorX, -camera.scrollY * sprite.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n spriteMatrix.e = sprite.x;\r\n spriteMatrix.f = sprite.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n spriteMatrix.e -= camera.scrollX * sprite.scrollFactorX;\r\n spriteMatrix.f -= camera.scrollY * sprite.scrollFactorY;\r\n \r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n\r\n ctx.save();\r\n \r\n calcMatrix.setToContext(ctx);\r\n\r\n ctx.globalCompositeOperation = this.blendModes[sprite.blendMode];\r\n\r\n ctx.globalAlpha = alpha;\r\n\r\n ctx.imageSmoothingEnabled = !(!this.antialias || frame.source.scaleMode);\r\n\r\n ctx.drawImage(frame.source.image, frameX, frameY, frameWidth, frameHeight, x, y, frameWidth / res, frameHeight / res);\r\n\r\n ctx.restore();\r\n },\r\n\r\n /**\r\n * Destroys all object references in the Canvas Renderer.\r\n *\r\n * @method Phaser.Renderer.Canvas.CanvasRenderer#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.gameCanvas = null;\r\n this.gameContext = null;\r\n\r\n this.game = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = CanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/canvas/CanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/canvas/index.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/renderer/canvas/index.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Renderer.Canvas\r\n */\r\n\r\nmodule.exports = {\r\n\r\n CanvasRenderer: __webpack_require__(/*! ./CanvasRenderer */ \"./node_modules/phaser/src/renderer/canvas/CanvasRenderer.js\"),\r\n GetBlendModes: __webpack_require__(/*! ./utils/GetBlendModes */ \"./node_modules/phaser/src/renderer/canvas/utils/GetBlendModes.js\"),\r\n SetTransform: __webpack_require__(/*! ./utils/SetTransform */ \"./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/canvas/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/canvas/utils/GetBlendModes.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/renderer/canvas/utils/GetBlendModes.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar modes = __webpack_require__(/*! ../../BlendModes */ \"./node_modules/phaser/src/renderer/BlendModes.js\");\r\nvar CanvasFeatures = __webpack_require__(/*! ../../../device/CanvasFeatures */ \"./node_modules/phaser/src/device/CanvasFeatures.js\");\r\n\r\n/**\r\n * Returns an array which maps the default blend modes to supported Canvas blend modes.\r\n *\r\n * If the browser doesn't support a blend mode, it will default to the normal `source-over` blend mode.\r\n *\r\n * @function Phaser.Renderer.Canvas.GetBlendModes\r\n * @since 3.0.0\r\n *\r\n * @return {array} Which Canvas blend mode corresponds to which default Phaser blend mode.\r\n */\r\nvar GetBlendModes = function ()\r\n{\r\n var output = [];\r\n var useNew = CanvasFeatures.supportNewBlendModes;\r\n var so = 'source-over';\r\n\r\n output[modes.NORMAL] = so;\r\n output[modes.ADD] = 'lighter';\r\n output[modes.MULTIPLY] = (useNew) ? 'multiply' : so;\r\n output[modes.SCREEN] = (useNew) ? 'screen' : so;\r\n output[modes.OVERLAY] = (useNew) ? 'overlay' : so;\r\n output[modes.DARKEN] = (useNew) ? 'darken' : so;\r\n output[modes.LIGHTEN] = (useNew) ? 'lighten' : so;\r\n output[modes.COLOR_DODGE] = (useNew) ? 'color-dodge' : so;\r\n output[modes.COLOR_BURN] = (useNew) ? 'color-burn' : so;\r\n output[modes.HARD_LIGHT] = (useNew) ? 'hard-light' : so;\r\n output[modes.SOFT_LIGHT] = (useNew) ? 'soft-light' : so;\r\n output[modes.DIFFERENCE] = (useNew) ? 'difference' : so;\r\n output[modes.EXCLUSION] = (useNew) ? 'exclusion' : so;\r\n output[modes.HUE] = (useNew) ? 'hue' : so;\r\n output[modes.SATURATION] = (useNew) ? 'saturation' : so;\r\n output[modes.COLOR] = (useNew) ? 'color' : so;\r\n output[modes.LUMINOSITY] = (useNew) ? 'luminosity' : so;\r\n output[modes.ERASE] = 'destination-out';\r\n output[modes.SOURCE_IN] = 'source-in';\r\n output[modes.SOURCE_OUT] = 'source-out';\r\n output[modes.SOURCE_ATOP] = 'source-atop';\r\n output[modes.DESTINATION_OVER] = 'destination-over';\r\n output[modes.DESTINATION_IN] = 'destination-in';\r\n output[modes.DESTINATION_OUT] = 'destination-out';\r\n output[modes.DESTINATION_ATOP] = 'destination-atop';\r\n output[modes.LIGHTER] = 'lighter';\r\n output[modes.COPY] = 'copy';\r\n output[modes.XOR] = 'xor';\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = GetBlendModes;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/canvas/utils/GetBlendModes.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes a reference to the Canvas Renderer, a Canvas Rendering Context, a Game Object, a Camera and a parent matrix\r\n * and then performs the following steps:\r\n * \r\n * 1. Checks the alpha of the source combined with the Camera alpha. If 0 or less it aborts.\r\n * 2. Takes the Camera and Game Object matrix and multiplies them, combined with the parent matrix if given.\r\n * 3. Sets the blend mode of the context to be that used by the Game Object.\r\n * 4. Sets the alpha value of the context to be that used by the Game Object combined with the Camera.\r\n * 5. Saves the context state.\r\n * 6. Sets the final matrix values into the context via setTransform.\r\n * 7. If Renderer.antialias, or the frame.source.scaleMode is set, then imageSmoothingEnabled is set.\r\n * \r\n * This function is only meant to be used internally. Most of the Canvas Renderer classes use it.\r\n *\r\n * @function Phaser.Renderer.Canvas.SetTransform\r\n * @since 3.12.0\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {CanvasRenderingContext2D} ctx - The canvas context to set the transform on.\r\n * @param {Phaser.GameObjects.GameObject} src - The Game Object being rendered. Can be any type that extends the base class.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A parent transform matrix to apply to the Game Object before rendering.\r\n * \r\n * @return {boolean} `true` if the Game Object context was set, otherwise `false`.\r\n */\r\nvar SetTransform = function (renderer, ctx, src, camera, parentMatrix)\r\n{\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (alpha <= 0)\r\n {\r\n // Nothing to see, so don't waste time calculating stuff\r\n return false;\r\n }\r\n\r\n var camMatrix = renderer._tempMatrix1.copyFromArray(camera.matrix.matrix);\r\n var gameObjectMatrix = renderer._tempMatrix2.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n var calcMatrix = renderer._tempMatrix3;\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n gameObjectMatrix.e = src.x;\r\n gameObjectMatrix.f = src.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(gameObjectMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n gameObjectMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n gameObjectMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(gameObjectMatrix, calcMatrix);\r\n }\r\n\r\n // Blend Mode\r\n ctx.globalCompositeOperation = renderer.blendModes[src.blendMode];\r\n\r\n // Alpha\r\n ctx.globalAlpha = alpha;\r\n\r\n ctx.save();\r\n\r\n calcMatrix.setToContext(ctx);\r\n\r\n ctx.imageSmoothingEnabled = !(!renderer.antialias || (src.frame && src.frame.source.scaleMode));\r\n\r\n return true;\r\n};\r\n\r\nmodule.exports = SetTransform;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/canvas/utils/SetTransform.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/index.js": /*!***************************************************!*\ !*** ./node_modules/phaser/src/renderer/index.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Renderer\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Types.Renderer\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Canvas: __webpack_require__(/*! ./canvas */ \"./node_modules/phaser/src/renderer/canvas/index.js\"),\r\n Snapshot: __webpack_require__(/*! ./snapshot */ \"./node_modules/phaser/src/renderer/snapshot/index.js\"),\r\n WebGL: __webpack_require__(/*! ./webgl */ \"./node_modules/phaser/src/renderer/webgl/index.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/snapshot/CanvasSnapshot.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/renderer/snapshot/CanvasSnapshot.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CanvasPool = __webpack_require__(/*! ../../display/canvas/CanvasPool */ \"./node_modules/phaser/src/display/canvas/CanvasPool.js\");\r\nvar Color = __webpack_require__(/*! ../../display/color/Color */ \"./node_modules/phaser/src/display/color/Color.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\n\r\n/**\r\n * Takes a snapshot of an area from the current frame displayed by a canvas.\r\n * \r\n * This is then copied to an Image object. When this loads, the results are sent\r\n * to the callback provided in the Snapshot Configuration object.\r\n *\r\n * @function Phaser.Renderer.Snapshot.Canvas\r\n * @since 3.0.0\r\n *\r\n * @param {HTMLCanvasElement} sourceCanvas - The canvas to take a snapshot of.\r\n * @param {Phaser.Types.Renderer.Snapshot.SnapshotState} config - The snapshot configuration object.\r\n */\r\nvar CanvasSnapshot = function (canvas, config)\r\n{\r\n var callback = GetFastValue(config, 'callback');\r\n var type = GetFastValue(config, 'type', 'image/png');\r\n var encoderOptions = GetFastValue(config, 'encoder', 0.92);\r\n var x = Math.abs(Math.round(GetFastValue(config, 'x', 0)));\r\n var y = Math.abs(Math.round(GetFastValue(config, 'y', 0)));\r\n var width = GetFastValue(config, 'width', canvas.width);\r\n var height = GetFastValue(config, 'height', canvas.height);\r\n var getPixel = GetFastValue(config, 'getPixel', false);\r\n\r\n if (getPixel)\r\n {\r\n var context = canvas.getContext('2d');\r\n var imageData = context.getImageData(x, y, 1, 1);\r\n var data = imageData.data;\r\n\r\n callback.call(null, new Color(data[0], data[1], data[2], data[3] / 255));\r\n }\r\n else if (x !== 0 || y !== 0 || width !== canvas.width || height !== canvas.height)\r\n {\r\n // Area Grab\r\n var copyCanvas = CanvasPool.createWebGL(this, width, height);\r\n var ctx = copyCanvas.getContext('2d');\r\n\r\n ctx.drawImage(canvas, x, y, width, height, 0, 0, width, height);\r\n\r\n var image1 = new Image();\r\n \r\n image1.onerror = function ()\r\n {\r\n callback.call(null);\r\n\r\n CanvasPool.remove(copyCanvas);\r\n };\r\n\r\n image1.onload = function ()\r\n {\r\n callback.call(null, image1);\r\n\r\n CanvasPool.remove(copyCanvas);\r\n };\r\n\r\n image1.src = copyCanvas.toDataURL(type, encoderOptions);\r\n }\r\n else\r\n {\r\n // Full Grab\r\n var image2 = new Image();\r\n \r\n image2.onerror = function ()\r\n {\r\n callback.call(null);\r\n };\r\n\r\n image2.onload = function ()\r\n {\r\n callback.call(null, image2);\r\n };\r\n\r\n image2.src = canvas.toDataURL(type, encoderOptions);\r\n }\r\n};\r\n\r\nmodule.exports = CanvasSnapshot;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/snapshot/CanvasSnapshot.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/snapshot/WebGLSnapshot.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/renderer/snapshot/WebGLSnapshot.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CanvasPool = __webpack_require__(/*! ../../display/canvas/CanvasPool */ \"./node_modules/phaser/src/display/canvas/CanvasPool.js\");\r\nvar Color = __webpack_require__(/*! ../../display/color/Color */ \"./node_modules/phaser/src/display/color/Color.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\n\r\n/**\r\n * Takes a snapshot of an area from the current frame displayed by a WebGL canvas.\r\n * \r\n * This is then copied to an Image object. When this loads, the results are sent\r\n * to the callback provided in the Snapshot Configuration object.\r\n *\r\n * @function Phaser.Renderer.Snapshot.WebGL\r\n * @since 3.0.0\r\n *\r\n * @param {HTMLCanvasElement} sourceCanvas - The canvas to take a snapshot of.\r\n * @param {Phaser.Types.Renderer.Snapshot.SnapshotState} config - The snapshot configuration object.\r\n */\r\nvar WebGLSnapshot = function (sourceCanvas, config)\r\n{\r\n var gl = sourceCanvas.getContext('experimental-webgl');\r\n\r\n var callback = GetFastValue(config, 'callback');\r\n var type = GetFastValue(config, 'type', 'image/png');\r\n var encoderOptions = GetFastValue(config, 'encoder', 0.92);\r\n var x = GetFastValue(config, 'x', 0);\r\n var y = GetFastValue(config, 'y', 0);\r\n\r\n var getPixel = GetFastValue(config, 'getPixel', false);\r\n\r\n var isFramebuffer = GetFastValue(config, 'isFramebuffer', false);\r\n\r\n var bufferWidth = (isFramebuffer) ? GetFastValue(config, 'bufferWidth', 1) : gl.drawingBufferWidth;\r\n var bufferHeight = (isFramebuffer) ? GetFastValue(config, 'bufferHeight', 1) : gl.drawingBufferHeight;\r\n\r\n if (getPixel)\r\n {\r\n var pixel = new Uint8Array(4);\r\n\r\n var destY = (isFramebuffer) ? y : bufferHeight - y;\r\n\r\n gl.readPixels(x, destY, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel);\r\n\r\n callback.call(null, new Color(pixel[0], pixel[1], pixel[2], pixel[3] / 255));\r\n }\r\n else\r\n {\r\n var width = GetFastValue(config, 'width', bufferWidth);\r\n var height = GetFastValue(config, 'height', bufferHeight);\r\n\r\n var total = width * height * 4;\r\n\r\n var pixels = new Uint8Array(total);\r\n\r\n gl.readPixels(x, bufferHeight - y - height, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);\r\n \r\n var canvas = CanvasPool.createWebGL(this, width, height);\r\n var ctx = canvas.getContext('2d');\r\n\r\n var imageData = ctx.getImageData(0, 0, width, height);\r\n \r\n var data = imageData.data;\r\n\r\n for (var py = 0; py < height; py++)\r\n {\r\n for (var px = 0; px < width; px++)\r\n {\r\n var sourceIndex = ((height - py) * width + px) * 4;\r\n var destIndex = (isFramebuffer) ? total - ((py * width + (width - px)) * 4) : (py * width + px) * 4;\r\n\r\n data[destIndex + 0] = pixels[sourceIndex + 0];\r\n data[destIndex + 1] = pixels[sourceIndex + 1];\r\n data[destIndex + 2] = pixels[sourceIndex + 2];\r\n data[destIndex + 3] = pixels[sourceIndex + 3];\r\n }\r\n }\r\n\r\n ctx.putImageData(imageData, 0, 0);\r\n \r\n var image = new Image();\r\n\r\n image.onerror = function ()\r\n {\r\n callback.call(null);\r\n\r\n CanvasPool.remove(canvas);\r\n };\r\n\r\n image.onload = function ()\r\n {\r\n callback.call(null, image);\r\n\r\n CanvasPool.remove(canvas);\r\n };\r\n\r\n image.src = canvas.toDataURL(type, encoderOptions);\r\n }\r\n};\r\n\r\nmodule.exports = WebGLSnapshot;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/snapshot/WebGLSnapshot.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/snapshot/index.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/renderer/snapshot/index.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Renderer.Snapshot\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Canvas: __webpack_require__(/*! ./CanvasSnapshot */ \"./node_modules/phaser/src/renderer/snapshot/CanvasSnapshot.js\"),\r\n WebGL: __webpack_require__(/*! ./WebGLSnapshot */ \"./node_modules/phaser/src/renderer/snapshot/WebGLSnapshot.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/snapshot/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/webgl/Utils.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/renderer/webgl/Utils.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Renderer.WebGL.Utils\r\n * @since 3.0.0\r\n */\r\nmodule.exports = {\r\n\r\n /**\r\n * Packs four floats on a range from 0.0 to 1.0 into a single Uint32\r\n *\r\n * @function Phaser.Renderer.WebGL.Utils.getTintFromFloats\r\n * @since 3.0.0\r\n * \r\n * @param {number} r - Red component in a range from 0.0 to 1.0 \r\n * @param {number} g - Green component in a range from 0.0 to 1.0\r\n * @param {number} b - Blue component in a range from 0.0 to 1.0\r\n * @param {number} a - Alpha component in a range from 0.0 to 1.0\r\n * \r\n * @return {number} [description]\r\n */\r\n getTintFromFloats: function (r, g, b, a)\r\n {\r\n var ur = ((r * 255.0)|0) & 0xFF;\r\n var ug = ((g * 255.0)|0) & 0xFF;\r\n var ub = ((b * 255.0)|0) & 0xFF;\r\n var ua = ((a * 255.0)|0) & 0xFF;\r\n\r\n return ((ua << 24) | (ur << 16) | (ug << 8) | ub) >>> 0;\r\n },\r\n\r\n /**\r\n * Packs a Uint24, representing RGB components, with a Float32, representing\r\n * the alpha component, with a range between 0.0 and 1.0 and return a Uint32\r\n *\r\n * @function Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha\r\n * @since 3.0.0\r\n * \r\n * @param {number} rgb - Uint24 representing RGB components\r\n * @param {number} a - Float32 representing Alpha component\r\n * \r\n * @return {number} Packed RGBA as Uint32\r\n */\r\n getTintAppendFloatAlpha: function (rgb, a)\r\n {\r\n var ua = ((a * 255.0)|0) & 0xFF;\r\n return ((ua << 24) | rgb) >>> 0;\r\n },\r\n\r\n /**\r\n * Packs a Uint24, representing RGB components, with a Float32, representing\r\n * the alpha component, with a range between 0.0 and 1.0 and return a \r\n * swizzled Uint32\r\n *\r\n * @function Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlphaAndSwap\r\n * @since 3.0.0\r\n * \r\n * @param {number} rgb - Uint24 representing RGB components\r\n * @param {number} a - Float32 representing Alpha component\r\n * \r\n * @return {number} Packed RGBA as Uint32\r\n */\r\n getTintAppendFloatAlphaAndSwap: function (rgb, a)\r\n {\r\n var ur = ((rgb >> 16)|0) & 0xff;\r\n var ug = ((rgb >> 8)|0) & 0xff;\r\n var ub = (rgb|0) & 0xff;\r\n var ua = ((a * 255.0)|0) & 0xFF;\r\n\r\n return ((ua << 24) | (ub << 16) | (ug << 8) | ur) >>> 0;\r\n },\r\n\r\n /**\r\n * Unpacks a Uint24 RGB into an array of floats of ranges of 0.0 and 1.0\r\n *\r\n * @function Phaser.Renderer.WebGL.Utils.getFloatsFromUintRGB\r\n * @since 3.0.0\r\n * \r\n * @param {number} rgb - RGB packed as a Uint24\r\n * \r\n * @return {array} Array of floats representing each component as a float \r\n */\r\n getFloatsFromUintRGB: function (rgb)\r\n {\r\n var ur = ((rgb >> 16)|0) & 0xff;\r\n var ug = ((rgb >> 8)|0) & 0xff;\r\n var ub = (rgb|0) & 0xff;\r\n\r\n return [ ur / 255.0, ug / 255.0, ub / 255.0 ];\r\n },\r\n\r\n /**\r\n * Counts how many attributes of 32 bits a vertex has\r\n *\r\n * @function Phaser.Renderer.WebGL.Utils.getComponentCount\r\n * @since 3.0.0\r\n * \r\n * @param {array} attributes - Array of attributes \r\n * @param {WebGLRenderingContext} glContext - WebGLContext used for check types\r\n * \r\n * @return {number} Count of 32 bit attributes in vertex\r\n */\r\n getComponentCount: function (attributes, glContext)\r\n {\r\n var count = 0;\r\n\r\n for (var index = 0; index < attributes.length; ++index)\r\n {\r\n var element = attributes[index];\r\n \r\n if (element.type === glContext.FLOAT)\r\n {\r\n count += element.size;\r\n }\r\n else\r\n {\r\n count += 1; // We'll force any other type to be 32 bit. for now\r\n }\r\n }\r\n\r\n return count;\r\n }\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/webgl/Utils.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/webgl/WebGLPipeline.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/renderer/webgl/WebGLPipeline.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Utils = __webpack_require__(/*! ./Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * @classdesc\r\n * WebGLPipeline is a class that describes the way elements will be renderered\r\n * in WebGL, specially focused on batching vertices (batching is not provided).\r\n * Pipelines are mostly used for describing 2D rendering passes but it's\r\n * flexible enough to be used for any type of rendering including 3D.\r\n * Internally WebGLPipeline will handle things like compiling shaders,\r\n * creating vertex buffers, assigning primitive topology and binding\r\n * vertex attributes.\r\n *\r\n * The config properties are:\r\n * - game: Current game instance.\r\n * - renderer: Current WebGL renderer.\r\n * - gl: Current WebGL context.\r\n * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES.\r\n * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants).\r\n * - vertShader: Source for vertex shader as a string.\r\n * - fragShader: Source for fragment shader as a string.\r\n * - vertexCapacity: The amount of vertices that shall be allocated\r\n * - vertexSize: The size of a single vertex in bytes.\r\n * - vertices: An optional buffer of vertices\r\n * - attributes: An array describing the vertex attributes\r\n *\r\n * The vertex attributes properties are:\r\n * - name : String - Name of the attribute in the vertex shader\r\n * - size : integer - How many components describe the attribute. For ex: vec3 = size of 3, float = size of 1\r\n * - type : GLenum - WebGL type (gl.BYTE, gl.SHORT, gl.UNSIGNED_BYTE, gl.UNSIGNED_SHORT, gl.FLOAT)\r\n * - normalized : boolean - Is the attribute normalized\r\n * - offset : integer - The offset in bytes to the current attribute in the vertex. Equivalent to offsetof(vertex, attrib) in C\r\n * Here you can find more information of how to describe an attribute:\r\n * - https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttribPointer\r\n *\r\n * @class WebGLPipeline\r\n * @memberof Phaser.Renderer.WebGL\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - The configuration object for this WebGL Pipeline, as described above.\r\n */\r\nvar WebGLPipeline = new Class({\r\n\r\n initialize:\r\n\r\n function WebGLPipeline (config)\r\n {\r\n /**\r\n * Name of the Pipeline. Used for identifying\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#name\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.name = 'WebGLPipeline';\r\n\r\n /**\r\n * The Game which owns this WebGL Pipeline.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#game\r\n * @type {Phaser.Game}\r\n * @since 3.0.0\r\n */\r\n this.game = config.game;\r\n\r\n /**\r\n * The canvas which this WebGL Pipeline renders to.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#view\r\n * @type {HTMLCanvasElement}\r\n * @since 3.0.0\r\n */\r\n this.view = config.game.canvas;\r\n\r\n /**\r\n * Used to store the current game resolution\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#resolution\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.resolution = 1;\r\n\r\n /**\r\n * Width of the current viewport\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.width = 0;\r\n\r\n /**\r\n * Height of the current viewport\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.height = 0;\r\n\r\n /**\r\n * The WebGL context this WebGL Pipeline uses.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#gl\r\n * @type {WebGLRenderingContext}\r\n * @since 3.0.0\r\n */\r\n this.gl = config.gl;\r\n\r\n /**\r\n * How many vertices have been fed to the current pipeline.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexCount\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.vertexCount = 0;\r\n\r\n /**\r\n * The limit of vertices that the pipeline can hold\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexCapacity\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.vertexCapacity = config.vertexCapacity;\r\n\r\n /**\r\n * The WebGL Renderer which owns this WebGL Pipeline.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#renderer\r\n * @type {Phaser.Renderer.WebGL.WebGLRenderer}\r\n * @since 3.0.0\r\n */\r\n this.renderer = config.renderer;\r\n\r\n /**\r\n * Raw byte buffer of vertices.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexData\r\n * @type {ArrayBuffer}\r\n * @since 3.0.0\r\n */\r\n this.vertexData = (config.vertices ? config.vertices : new ArrayBuffer(config.vertexCapacity * config.vertexSize));\r\n\r\n /**\r\n * The handle to a WebGL vertex buffer object.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexBuffer\r\n * @type {WebGLBuffer}\r\n * @since 3.0.0\r\n */\r\n this.vertexBuffer = this.renderer.createVertexBuffer((config.vertices ? config.vertices : this.vertexData.byteLength), this.gl.STREAM_DRAW);\r\n\r\n /**\r\n * The handle to a WebGL program\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#program\r\n * @type {WebGLProgram}\r\n * @since 3.0.0\r\n */\r\n this.program = this.renderer.createProgram(config.vertShader, config.fragShader);\r\n\r\n /**\r\n * Array of objects that describe the vertex attributes\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#attributes\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.attributes = config.attributes;\r\n\r\n /**\r\n * The size in bytes of the vertex\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexSize\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.vertexSize = config.vertexSize;\r\n\r\n /**\r\n * The primitive topology which the pipeline will use to submit draw calls\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#topology\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.topology = config.topology;\r\n\r\n /**\r\n * Uint8 view to the vertex raw buffer. Used for uploading vertex buffer resources\r\n * to the GPU.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#bytes\r\n * @type {Uint8Array}\r\n * @since 3.0.0\r\n */\r\n this.bytes = new Uint8Array(this.vertexData);\r\n\r\n /**\r\n * This will store the amount of components of 32 bit length\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexComponentCount\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.vertexComponentCount = Utils.getComponentCount(config.attributes, this.gl);\r\n\r\n /**\r\n * Indicates if the current pipeline is flushing the contents to the GPU.\r\n * When the variable is set the flush function will be locked.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#flushLocked\r\n * @type {boolean}\r\n * @since 3.1.0\r\n */\r\n this.flushLocked = false;\r\n\r\n /**\r\n * Indicates if the current pipeline is active or not for this frame only.\r\n * Reset in the onRender method.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLPipeline#active\r\n * @type {boolean}\r\n * @since 3.10.0\r\n */\r\n this.active = false;\r\n },\r\n\r\n /**\r\n * Called when the Game has fully booted and the Renderer has finished setting up.\r\n *\r\n * By this stage all Game level systems are now in place and you can perform any final\r\n * tasks that the pipeline may need that relied on game systems such as the Texture Manager.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#boot\r\n * @since 3.11.0\r\n */\r\n boot: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Adds a description of vertex attribute to the pipeline\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#addAttribute\r\n * @since 3.2.0\r\n *\r\n * @param {string} name - Name of the vertex attribute\r\n * @param {integer} size - Vertex component size\r\n * @param {integer} type - Type of the attribute\r\n * @param {boolean} normalized - Is the value normalized to a range\r\n * @param {integer} offset - Byte offset to the beginning of the first element in the vertex\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n addAttribute: function (name, size, type, normalized, offset)\r\n {\r\n this.attributes.push({\r\n name: name,\r\n size: size,\r\n type: this.renderer.glFormats[type],\r\n normalized: normalized,\r\n offset: offset\r\n });\r\n\r\n this.vertexComponentCount = Utils.getComponentCount(\r\n this.attributes,\r\n this.gl\r\n );\r\n return this;\r\n },\r\n\r\n /**\r\n * Check if the current batch of vertices is full.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#shouldFlush\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the current batch should be flushed, otherwise `false`.\r\n */\r\n shouldFlush: function ()\r\n {\r\n return (this.vertexCount >= this.vertexCapacity);\r\n },\r\n\r\n /**\r\n * Resizes the properties used to describe the viewport\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#resize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The new width of this WebGL Pipeline.\r\n * @param {number} height - The new height of this WebGL Pipeline.\r\n * @param {number} resolution - The resolution this WebGL Pipeline should be resized to.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n resize: function (width, height, resolution)\r\n {\r\n this.width = width * resolution;\r\n this.height = height * resolution;\r\n this.resolution = resolution;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Binds the pipeline resources, including programs, vertex buffers and binds attributes\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#bind\r\n * @since 3.0.0\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n bind: function ()\r\n {\r\n var gl = this.gl;\r\n var vertexBuffer = this.vertexBuffer;\r\n var attributes = this.attributes;\r\n var program = this.program;\r\n var renderer = this.renderer;\r\n var vertexSize = this.vertexSize;\r\n\r\n renderer.setProgram(program);\r\n renderer.setVertexBuffer(vertexBuffer);\r\n\r\n for (var index = 0; index < attributes.length; ++index)\r\n {\r\n var element = attributes[index];\r\n var location = gl.getAttribLocation(program, element.name);\r\n\r\n if (location >= 0)\r\n {\r\n gl.enableVertexAttribArray(location);\r\n gl.vertexAttribPointer(location, element.size, element.type, element.normalized, vertexSize, element.offset);\r\n }\r\n else if (location !== -1)\r\n {\r\n gl.disableVertexAttribArray(location);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set whenever this WebGL Pipeline is bound to a WebGL Renderer.\r\n *\r\n * This method is called every time the WebGL Pipeline is attempted to be bound, even if it already is the current pipeline.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#onBind\r\n * @since 3.0.0\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n onBind: function ()\r\n {\r\n // This is for updating uniform data it's called on each bind attempt.\r\n return this;\r\n },\r\n\r\n /**\r\n * Called before each frame is rendered, but after the canvas has been cleared.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#onPreRender\r\n * @since 3.0.0\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n onPreRender: function ()\r\n {\r\n // called once every frame\r\n return this;\r\n },\r\n\r\n /**\r\n * Called before a Scene's Camera is rendered.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#onRender\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene being rendered.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered with.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n onRender: function ()\r\n {\r\n // called for each camera\r\n return this;\r\n },\r\n\r\n /**\r\n * Called after each frame has been completely rendered and snapshots have been taken.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#onPostRender\r\n * @since 3.0.0\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n onPostRender: function ()\r\n {\r\n // called once every frame\r\n return this;\r\n },\r\n\r\n /**\r\n * Uploads the vertex data and emits a draw call\r\n * for the current batch of vertices.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#flush\r\n * @since 3.0.0\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n flush: function ()\r\n {\r\n if (this.flushLocked) { return this; }\r\n\r\n this.flushLocked = true;\r\n\r\n var gl = this.gl;\r\n var vertexCount = this.vertexCount;\r\n var topology = this.topology;\r\n var vertexSize = this.vertexSize;\r\n\r\n if (vertexCount === 0)\r\n {\r\n this.flushLocked = false;\r\n return;\r\n }\r\n\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize));\r\n gl.drawArrays(topology, 0, vertexCount);\r\n\r\n this.vertexCount = 0;\r\n this.flushLocked = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes all object references in this WebGL Pipeline and removes its program from the WebGL context.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#destroy\r\n * @since 3.0.0\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n destroy: function ()\r\n {\r\n var gl = this.gl;\r\n\r\n gl.deleteProgram(this.program);\r\n gl.deleteBuffer(this.vertexBuffer);\r\n\r\n delete this.program;\r\n delete this.vertexBuffer;\r\n delete this.gl;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a uniform value of the current pipeline program.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat1\r\n * @since 3.2.0\r\n *\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {number} x - The new value of the `float` uniform.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n setFloat1: function (name, x)\r\n {\r\n this.renderer.setFloat1(this.program, name, x);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a uniform value of the current pipeline program.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat2\r\n * @since 3.2.0\r\n *\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {number} x - The new X component of the `vec2` uniform.\r\n * @param {number} y - The new Y component of the `vec2` uniform.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n setFloat2: function (name, x, y)\r\n {\r\n this.renderer.setFloat2(this.program, name, x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a uniform value of the current pipeline program.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat3\r\n * @since 3.2.0\r\n *\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {number} x - The new X component of the `vec3` uniform.\r\n * @param {number} y - The new Y component of the `vec3` uniform.\r\n * @param {number} z - The new Z component of the `vec3` uniform.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n setFloat3: function (name, x, y, z)\r\n {\r\n this.renderer.setFloat3(this.program, name, x, y, z);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a uniform value of the current pipeline program.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat4\r\n * @since 3.2.0\r\n *\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {number} x - X component of the uniform\r\n * @param {number} y - Y component of the uniform\r\n * @param {number} z - Z component of the uniform\r\n * @param {number} w - W component of the uniform\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n setFloat4: function (name, x, y, z, w)\r\n {\r\n this.renderer.setFloat4(this.program, name, x, y, z, w);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a uniform value of the current pipeline program.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat1v\r\n * @since 3.13.0\r\n *\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {Float32Array} arr - The new value to be used for the uniform variable.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n setFloat1v: function (name, arr)\r\n {\r\n this.renderer.setFloat1v(this.program, name, arr);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a uniform value of the current pipeline program.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat2v\r\n * @since 3.13.0\r\n *\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {Float32Array} arr - The new value to be used for the uniform variable.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n setFloat2v: function (name, arr)\r\n {\r\n this.renderer.setFloat2v(this.program, name, arr);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a uniform value of the current pipeline program.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat3v\r\n * @since 3.13.0\r\n *\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {Float32Array} arr - The new value to be used for the uniform variable.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n setFloat3v: function (name, arr)\r\n {\r\n this.renderer.setFloat3v(this.program, name, arr);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a uniform value of the current pipeline program.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat4v\r\n * @since 3.13.0\r\n *\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {Float32Array} arr - The new value to be used for the uniform variable.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n setFloat4v: function (name, arr)\r\n {\r\n this.renderer.setFloat4v(this.program, name, arr);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a uniform value of the current pipeline program.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt1\r\n * @since 3.2.0\r\n *\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {integer} x - The new value of the `int` uniform.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n setInt1: function (name, x)\r\n {\r\n this.renderer.setInt1(this.program, name, x);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a uniform value of the current pipeline program.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt2\r\n * @since 3.2.0\r\n *\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {integer} x - The new X component of the `ivec2` uniform.\r\n * @param {integer} y - The new Y component of the `ivec2` uniform.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n setInt2: function (name, x, y)\r\n {\r\n this.renderer.setInt2(this.program, name, x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a uniform value of the current pipeline program.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt3\r\n * @since 3.2.0\r\n *\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {integer} x - The new X component of the `ivec3` uniform.\r\n * @param {integer} y - The new Y component of the `ivec3` uniform.\r\n * @param {integer} z - The new Z component of the `ivec3` uniform.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n setInt3: function (name, x, y, z)\r\n {\r\n this.renderer.setInt3(this.program, name, x, y, z);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a uniform value of the current pipeline program.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt4\r\n * @since 3.2.0\r\n *\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {integer} x - X component of the uniform\r\n * @param {integer} y - Y component of the uniform\r\n * @param {integer} z - Z component of the uniform\r\n * @param {integer} w - W component of the uniform\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n setInt4: function (name, x, y, z, w)\r\n {\r\n this.renderer.setInt4(this.program, name, x, y, z, w);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a uniform value of the current pipeline program.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix2\r\n * @since 3.2.0\r\n *\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`.\r\n * @param {Float32Array} matrix - The new values for the `mat2` uniform.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n setMatrix2: function (name, transpose, matrix)\r\n {\r\n this.renderer.setMatrix2(this.program, name, transpose, matrix);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a uniform value of the current pipeline program.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix3\r\n * @since 3.2.0\r\n *\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`.\r\n * @param {Float32Array} matrix - The new values for the `mat3` uniform.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n setMatrix3: function (name, transpose, matrix)\r\n {\r\n this.renderer.setMatrix3(this.program, name, transpose, matrix);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a uniform value of the current pipeline program.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix4\r\n * @since 3.2.0\r\n *\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {boolean} transpose - Should the matrix be transpose\r\n * @param {Float32Array} matrix - Matrix data\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n setMatrix4: function (name, transpose, matrix)\r\n {\r\n this.renderer.setMatrix4(this.program, name, transpose, matrix);\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = WebGLPipeline;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/webgl/WebGLPipeline.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/webgl/WebGLRenderer.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/renderer/webgl/WebGLRenderer.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BaseCamera = __webpack_require__(/*! ../../cameras/2d/BaseCamera */ \"./node_modules/phaser/src/cameras/2d/BaseCamera.js\");\r\nvar CameraEvents = __webpack_require__(/*! ../../cameras/2d/events */ \"./node_modules/phaser/src/cameras/2d/events/index.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ../../const */ \"./node_modules/phaser/src/const.js\");\r\nvar GameEvents = __webpack_require__(/*! ../../core/events */ \"./node_modules/phaser/src/core/events/index.js\");\r\nvar IsSizePowerOfTwo = __webpack_require__(/*! ../../math/pow2/IsSizePowerOfTwo */ \"./node_modules/phaser/src/math/pow2/IsSizePowerOfTwo.js\");\r\nvar NOOP = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar ScaleEvents = __webpack_require__(/*! ../../scale/events */ \"./node_modules/phaser/src/scale/events/index.js\");\r\nvar SpliceOne = __webpack_require__(/*! ../../utils/array/SpliceOne */ \"./node_modules/phaser/src/utils/array/SpliceOne.js\");\r\nvar TextureEvents = __webpack_require__(/*! ../../textures/events */ \"./node_modules/phaser/src/textures/events/index.js\");\r\nvar TransformMatrix = __webpack_require__(/*! ../../gameobjects/components/TransformMatrix */ \"./node_modules/phaser/src/gameobjects/components/TransformMatrix.js\");\r\nvar Utils = __webpack_require__(/*! ./Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\nvar WebGLSnapshot = __webpack_require__(/*! ../snapshot/WebGLSnapshot */ \"./node_modules/phaser/src/renderer/snapshot/WebGLSnapshot.js\");\r\n\r\n// Default Pipelines\r\nvar BitmapMaskPipeline = __webpack_require__(/*! ./pipelines/BitmapMaskPipeline */ \"./node_modules/phaser/src/renderer/webgl/pipelines/BitmapMaskPipeline.js\");\r\nvar ForwardDiffuseLightPipeline = __webpack_require__(/*! ./pipelines/ForwardDiffuseLightPipeline */ \"./node_modules/phaser/src/renderer/webgl/pipelines/ForwardDiffuseLightPipeline.js\");\r\nvar TextureTintPipeline = __webpack_require__(/*! ./pipelines/TextureTintPipeline */ \"./node_modules/phaser/src/renderer/webgl/pipelines/TextureTintPipeline.js\");\r\n\r\n/**\r\n * @callback WebGLContextCallback\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer which owns the context.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * WebGLRenderer is a class that contains the needed functionality to keep the\r\n * WebGLRenderingContext state clean. The main idea of the WebGLRenderer is to keep track of\r\n * any context change that happens for WebGL rendering inside of Phaser. This means\r\n * if raw webgl functions are called outside the WebGLRenderer of the Phaser WebGL\r\n * rendering ecosystem they might pollute the current WebGLRenderingContext state producing\r\n * unexpected behavior. It's recommended that WebGL interaction is done through\r\n * WebGLRenderer and/or WebGLPipeline.\r\n *\r\n * @class WebGLRenderer\r\n * @memberof Phaser.Renderer.WebGL\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - The Game instance which owns this WebGL Renderer.\r\n */\r\nvar WebGLRenderer = new Class({\r\n\r\n initialize:\r\n\r\n function WebGLRenderer (game)\r\n {\r\n var gameConfig = game.config;\r\n\r\n var contextCreationConfig = {\r\n alpha: gameConfig.transparent,\r\n desynchronized: gameConfig.desynchronized,\r\n depth: false,\r\n antialias: gameConfig.antialiasGL,\r\n premultipliedAlpha: gameConfig.premultipliedAlpha,\r\n stencil: true,\r\n failIfMajorPerformanceCaveat: gameConfig.failIfMajorPerformanceCaveat,\r\n powerPreference: gameConfig.powerPreference\r\n };\r\n\r\n /**\r\n * The local configuration settings of this WebGL Renderer.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#config\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.config = {\r\n clearBeforeRender: gameConfig.clearBeforeRender,\r\n antialias: gameConfig.antialias,\r\n backgroundColor: gameConfig.backgroundColor,\r\n contextCreation: contextCreationConfig,\r\n resolution: gameConfig.resolution,\r\n roundPixels: gameConfig.roundPixels,\r\n maxTextures: gameConfig.maxTextures,\r\n maxTextureSize: gameConfig.maxTextureSize,\r\n batchSize: gameConfig.batchSize,\r\n maxLights: gameConfig.maxLights,\r\n mipmapFilter: gameConfig.mipmapFilter\r\n };\r\n\r\n /**\r\n * The Game instance which owns this WebGL Renderer.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#game\r\n * @type {Phaser.Game}\r\n * @since 3.0.0\r\n */\r\n this.game = game;\r\n\r\n /**\r\n * A constant which allows the renderer to be easily identified as a WebGL Renderer.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#type\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.type = CONST.WEBGL;\r\n\r\n /**\r\n * The width of the canvas being rendered to.\r\n * This is populated in the onResize event handler.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#width\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.width = 0;\r\n\r\n /**\r\n * The height of the canvas being rendered to.\r\n * This is populated in the onResize event handler.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#height\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.height = 0;\r\n\r\n /**\r\n * The canvas which this WebGL Renderer draws to.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#canvas\r\n * @type {HTMLCanvasElement}\r\n * @since 3.0.0\r\n */\r\n this.canvas = game.canvas;\r\n\r\n /**\r\n * An array of blend modes supported by the WebGL Renderer.\r\n * \r\n * This array includes the default blend modes as well as any custom blend modes added through {@link #addBlendMode}.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#blendModes\r\n * @type {array}\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.blendModes = [];\r\n\r\n /**\r\n * Keeps track of any WebGLTexture created with the current WebGLRenderingContext\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#nativeTextures\r\n * @type {array}\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.nativeTextures = [];\r\n\r\n /**\r\n * This property is set to `true` if the WebGL context of the renderer is lost.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#contextLost\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.contextLost = false;\r\n\r\n /**\r\n * This object will store all pipelines created through addPipeline\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#pipelines\r\n * @type {object}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.pipelines = null;\r\n\r\n /**\r\n * Details about the currently scheduled snapshot.\r\n * \r\n * 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.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#snapshotState\r\n * @type {Phaser.Types.Renderer.Snapshot.SnapshotState}\r\n * @since 3.0.0\r\n */\r\n this.snapshotState = {\r\n x: 0,\r\n y: 0,\r\n width: 1,\r\n height: 1,\r\n getPixel: false,\r\n callback: null,\r\n type: 'image/png',\r\n encoder: 0.92,\r\n isFramebuffer: false,\r\n bufferWidth: 0,\r\n bufferHeight: 0\r\n };\r\n\r\n // Internal Renderer State (Textures, Framebuffers, Pipelines, Buffers, etc)\r\n\r\n /**\r\n * Cached value for the last texture unit that was used\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#currentActiveTextureUnit\r\n * @type {integer}\r\n * @since 3.1.0\r\n */\r\n this.currentActiveTextureUnit = 0;\r\n\r\n /**\r\n * An array of the last texture handles that were bound to the WebGLRenderingContext\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#currentTextures\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.currentTextures = new Array(16);\r\n\r\n /**\r\n * Current framebuffer in use\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#currentFramebuffer\r\n * @type {WebGLFramebuffer}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.currentFramebuffer = null;\r\n\r\n /**\r\n * Current WebGLPipeline in use\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#currentPipeline\r\n * @type {Phaser.Renderer.WebGL.WebGLPipeline}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.currentPipeline = null;\r\n\r\n /**\r\n * Current WebGLProgram in use\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#currentProgram\r\n * @type {WebGLProgram}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.currentProgram = null;\r\n\r\n /**\r\n * Current WebGLBuffer (Vertex buffer) in use\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#currentVertexBuffer\r\n * @type {WebGLBuffer}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.currentVertexBuffer = null;\r\n\r\n /**\r\n * Current WebGLBuffer (Index buffer) in use\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#currentIndexBuffer\r\n * @type {WebGLBuffer}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.currentIndexBuffer = null;\r\n\r\n /**\r\n * Current blend mode in use\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#currentBlendMode\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.currentBlendMode = Infinity;\r\n\r\n /**\r\n * Indicates if the the scissor state is enabled in WebGLRenderingContext\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#currentScissorEnabled\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.currentScissorEnabled = false;\r\n\r\n /**\r\n * Stores the current scissor data\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#currentScissor\r\n * @type {Uint32Array}\r\n * @since 3.0.0\r\n */\r\n this.currentScissor = null;\r\n\r\n /**\r\n * Stack of scissor data\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#scissorStack\r\n * @type {Uint32Array}\r\n * @since 3.0.0\r\n */\r\n this.scissorStack = [];\r\n\r\n /**\r\n * The handler to invoke when the context is lost.\r\n * This should not be changed and is set in the boot method.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#contextLostHandler\r\n * @type {function}\r\n * @since 3.19.0\r\n */\r\n this.contextLostHandler = NOOP;\r\n\r\n /**\r\n * The handler to invoke when the context is restored.\r\n * This should not be changed and is set in the boot method.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#contextRestoredHandler\r\n * @type {function}\r\n * @since 3.19.0\r\n */\r\n this.contextRestoredHandler = NOOP;\r\n\r\n /**\r\n * The underlying WebGL context of the renderer.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#gl\r\n * @type {WebGLRenderingContext}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.gl = null;\r\n\r\n /**\r\n * Array of strings that indicate which WebGL extensions are supported by the browser\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#supportedExtensions\r\n * @type {object}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.supportedExtensions = null;\r\n\r\n /**\r\n * Extensions loaded into the current context\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#extensions\r\n * @type {object}\r\n * @default {}\r\n * @since 3.0.0\r\n */\r\n this.extensions = {};\r\n\r\n /**\r\n * Stores the current WebGL component formats for further use\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#glFormats\r\n * @type {array}\r\n * @default []\r\n * @since 3.2.0\r\n */\r\n this.glFormats = [];\r\n\r\n /**\r\n * Stores the supported WebGL texture compression formats.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#compression\r\n * @type {array}\r\n * @since 3.8.0\r\n */\r\n this.compression = {\r\n ETC1: false,\r\n PVRTC: false,\r\n S3TC: false\r\n };\r\n\r\n /**\r\n * Cached drawing buffer height to reduce gl calls.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#drawingBufferHeight\r\n * @type {number}\r\n * @readonly\r\n * @since 3.11.0\r\n */\r\n this.drawingBufferHeight = 0;\r\n\r\n /**\r\n * A blank 32x32 transparent texture, as used by the Graphics system where needed.\r\n * This is set in the `boot` method.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#blankTexture\r\n * @type {WebGLTexture}\r\n * @readonly\r\n * @since 3.12.0\r\n */\r\n this.blankTexture = null;\r\n\r\n /**\r\n * A default Camera used in calls when no other camera has been provided.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#defaultCamera\r\n * @type {Phaser.Cameras.Scene2D.BaseCamera}\r\n * @since 3.12.0\r\n */\r\n this.defaultCamera = new BaseCamera(0, 0, 0, 0);\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix1\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.12.0\r\n */\r\n this._tempMatrix1 = new TransformMatrix();\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix2\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.12.0\r\n */\r\n this._tempMatrix2 = new TransformMatrix();\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix3\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.12.0\r\n */\r\n this._tempMatrix3 = new TransformMatrix();\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix4\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.12.0\r\n */\r\n this._tempMatrix4 = new TransformMatrix();\r\n\r\n /**\r\n * The total number of masks currently stacked.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#maskCount\r\n * @type {integer}\r\n * @since 3.17.0\r\n */\r\n this.maskCount = 0;\r\n\r\n /**\r\n * The mask stack.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#maskStack\r\n * @type {Phaser.Display.Masks.GeometryMask[]}\r\n * @since 3.17.0\r\n */\r\n this.maskStack = [];\r\n\r\n /**\r\n * Internal property that tracks the currently set mask.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#currentMask\r\n * @type {any}\r\n * @since 3.17.0\r\n */\r\n this.currentMask = { mask: null, camera: null };\r\n\r\n /**\r\n * Internal property that tracks the currently set camera mask.\r\n *\r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#currentCameraMask\r\n * @type {any}\r\n * @since 3.17.0\r\n */\r\n this.currentCameraMask = { mask: null, camera: null };\r\n\r\n /**\r\n * Internal gl function mapping for uniform look-up.\r\n * https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform\r\n * \r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#glFuncMap\r\n * @type {any}\r\n * @since 3.17.0\r\n */\r\n this.glFuncMap = null;\r\n\r\n /**\r\n * The `type` of the Game Object being currently rendered.\r\n * This can be used by advanced render functions for batching look-ahead.\r\n * \r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#currentType\r\n * @type {string}\r\n * @since 3.19.0\r\n */\r\n this.currentType = '';\r\n\r\n /**\r\n * Is the `type` of the Game Object being currently rendered different than the\r\n * type of the object before it in the display list? I.e. it's a 'new' type.\r\n * \r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#newType\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.newType = false;\r\n\r\n /**\r\n * Does the `type` of the next Game Object in the display list match that\r\n * of the object being currently rendered?\r\n * \r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#nextTypeMatch\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.nextTypeMatch = false;\r\n\r\n /**\r\n * The mipmap magFilter to be used when creating textures.\r\n * \r\n * You can specify this as a string in the game config, i.e.:\r\n * \r\n * `renderer: { mipmapFilter: 'NEAREST_MIPMAP_LINEAR' }`\r\n * \r\n * The 6 options for WebGL1 are, in order from least to most computationally expensive:\r\n * \r\n * NEAREST (for pixel art)\r\n * LINEAR (the default)\r\n * NEAREST_MIPMAP_NEAREST\r\n * LINEAR_MIPMAP_NEAREST\r\n * NEAREST_MIPMAP_LINEAR\r\n * LINEAR_MIPMAP_LINEAR\r\n * \r\n * Mipmaps only work with textures that are fully power-of-two in size.\r\n * \r\n * For more details see https://webglfundamentals.org/webgl/lessons/webgl-3d-textures.html\r\n * \r\n * @name Phaser.Renderer.WebGL.WebGLRenderer#mipmapFilter\r\n * @type {GLenum}\r\n * @since 3.21.0\r\n */\r\n this.mipmapFilter = null;\r\n\r\n this.init(this.config);\r\n },\r\n\r\n /**\r\n * Creates a new WebGLRenderingContext and initializes all internal state.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#init\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - The configuration object for the renderer.\r\n *\r\n * @return {this} This WebGLRenderer instance.\r\n */\r\n init: function (config)\r\n {\r\n var gl;\r\n var game = this.game;\r\n var canvas = this.canvas;\r\n var clearColor = config.backgroundColor;\r\n\r\n // Did they provide their own context?\r\n if (game.config.context)\r\n {\r\n gl = game.config.context;\r\n }\r\n else\r\n {\r\n gl = canvas.getContext('webgl', config.contextCreation) || canvas.getContext('experimental-webgl', config.contextCreation);\r\n }\r\n\r\n if (!gl || gl.isContextLost())\r\n {\r\n this.contextLost = true;\r\n\r\n throw new Error('WebGL unsupported');\r\n }\r\n\r\n this.gl = gl;\r\n\r\n var _this = this;\r\n\r\n this.contextLostHandler = function (event)\r\n {\r\n _this.contextLost = true;\r\n\r\n _this.game.events.emit(GameEvents.CONTEXT_LOST, _this);\r\n\r\n event.preventDefault();\r\n };\r\n\r\n this.contextRestoredHandler = function ()\r\n {\r\n _this.contextLost = false;\r\n\r\n _this.init(_this.config);\r\n\r\n _this.game.events.emit(GameEvents.CONTEXT_RESTORED, _this);\r\n };\r\n\r\n canvas.addEventListener('webglcontextlost', this.contextLostHandler, false);\r\n canvas.addEventListener('webglcontextrestored', this.contextRestoredHandler, false);\r\n\r\n // Set it back into the Game, so developers can access it from there too\r\n game.context = gl;\r\n\r\n for (var i = 0; i <= 27; i++)\r\n {\r\n this.blendModes.push({ func: [ gl.ONE, gl.ONE_MINUS_SRC_ALPHA ], equation: gl.FUNC_ADD });\r\n }\r\n\r\n // ADD\r\n this.blendModes[1].func = [ gl.ONE, gl.DST_ALPHA ];\r\n\r\n // MULTIPLY\r\n this.blendModes[2].func = [ gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA ];\r\n\r\n // SCREEN\r\n this.blendModes[3].func = [ gl.ONE, gl.ONE_MINUS_SRC_COLOR ];\r\n\r\n // ERASE\r\n this.blendModes[17] = { func: [ gl.ZERO, gl.ONE_MINUS_SRC_ALPHA ], equation: gl.FUNC_REVERSE_SUBTRACT };\r\n\r\n this.glFormats[0] = gl.BYTE;\r\n this.glFormats[1] = gl.SHORT;\r\n this.glFormats[2] = gl.UNSIGNED_BYTE;\r\n this.glFormats[3] = gl.UNSIGNED_SHORT;\r\n this.glFormats[4] = gl.FLOAT;\r\n\r\n // Set the gl function map\r\n this.glFuncMap = {\r\n\r\n mat2: { func: gl.uniformMatrix2fv, length: 1, matrix: true },\r\n mat3: { func: gl.uniformMatrix3fv, length: 1, matrix: true },\r\n mat4: { func: gl.uniformMatrix4fv, length: 1, matrix: true },\r\n\r\n '1f': { func: gl.uniform1f, length: 1 },\r\n '1fv': { func: gl.uniform1fv, length: 1 },\r\n '1i': { func: gl.uniform1i, length: 1 },\r\n '1iv': { func: gl.uniform1iv, length: 1 },\r\n\r\n '2f': { func: gl.uniform2f, length: 2 },\r\n '2fv': { func: gl.uniform2fv, length: 1 },\r\n '2i': { func: gl.uniform2i, length: 2 },\r\n '2iv': { func: gl.uniform2iv, length: 1 },\r\n\r\n '3f': { func: gl.uniform3f, length: 3 },\r\n '3fv': { func: gl.uniform3fv, length: 1 },\r\n '3i': { func: gl.uniform3i, length: 3 },\r\n '3iv': { func: gl.uniform3iv, length: 1 },\r\n\r\n '4f': { func: gl.uniform4f, length: 4 },\r\n '4fv': { func: gl.uniform4fv, length: 1 },\r\n '4i': { func: gl.uniform4i, length: 4 },\r\n '4iv': { func: gl.uniform4iv, length: 1 }\r\n\r\n };\r\n\r\n // Load supported extensions\r\n var exts = gl.getSupportedExtensions();\r\n\r\n if (!config.maxTextures)\r\n {\r\n config.maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\r\n }\r\n\r\n if (!config.maxTextureSize)\r\n {\r\n config.maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\r\n }\r\n\r\n var extString = 'WEBGL_compressed_texture_';\r\n var wkExtString = 'WEBKIT_' + extString;\r\n\r\n this.compression.ETC1 = gl.getExtension(extString + 'etc1') || gl.getExtension(wkExtString + 'etc1');\r\n this.compression.PVRTC = gl.getExtension(extString + 'pvrtc') || gl.getExtension(wkExtString + 'pvrtc');\r\n this.compression.S3TC = gl.getExtension(extString + 's3tc') || gl.getExtension(wkExtString + 's3tc');\r\n\r\n this.supportedExtensions = exts;\r\n\r\n // Setup initial WebGL state\r\n gl.disable(gl.DEPTH_TEST);\r\n gl.disable(gl.CULL_FACE);\r\n\r\n gl.enable(gl.BLEND);\r\n\r\n gl.clearColor(clearColor.redGL, clearColor.greenGL, clearColor.blueGL, clearColor.alphaGL);\r\n\r\n // Mipmaps\r\n this.mipmapFilter = gl[config.mipmapFilter];\r\n\r\n // Initialize all textures to null\r\n for (var index = 0; index < this.currentTextures.length; ++index)\r\n {\r\n this.currentTextures[index] = null;\r\n }\r\n\r\n // Clear previous pipelines and reload default ones\r\n this.pipelines = {};\r\n\r\n this.addPipeline('TextureTintPipeline', new TextureTintPipeline({ game: game, renderer: this }));\r\n this.addPipeline('BitmapMaskPipeline', new BitmapMaskPipeline({ game: game, renderer: this }));\r\n this.addPipeline('Light2D', new ForwardDiffuseLightPipeline({ game: game, renderer: this, maxLights: config.maxLights }));\r\n\r\n this.setBlendMode(CONST.BlendModes.NORMAL);\r\n\r\n game.textures.once(TextureEvents.READY, this.boot, this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal boot handler. Calls 'boot' on each pipeline.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#boot\r\n * @private\r\n * @since 3.11.0\r\n */\r\n boot: function ()\r\n {\r\n for (var pipelineName in this.pipelines)\r\n {\r\n this.pipelines[pipelineName].boot();\r\n }\r\n\r\n var blank = this.game.textures.getFrame('__DEFAULT');\r\n\r\n this.pipelines.TextureTintPipeline.currentFrame = blank;\r\n\r\n this.blankTexture = blank;\r\n\r\n var gl = this.gl;\r\n\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\r\n\r\n gl.enable(gl.SCISSOR_TEST);\r\n\r\n this.setPipeline(this.pipelines.TextureTintPipeline);\r\n\r\n this.game.scale.on(ScaleEvents.RESIZE, this.onResize, this);\r\n\r\n var baseSize = this.game.scale.baseSize;\r\n\r\n this.resize(baseSize.width, baseSize.height, this.game.scale.resolution);\r\n },\r\n\r\n /**\r\n * The event handler that manages the `resize` event dispatched by the Scale Manager.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#onResize\r\n * @since 3.16.0\r\n *\r\n * @param {Phaser.Structs.Size} gameSize - The default Game Size object. This is the un-modified game dimensions.\r\n * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this.\r\n * @param {Phaser.Structs.Size} displaySize - The display Size object. The size of the canvas style width / height attributes.\r\n * @param {number} [resolution] - The Scale Manager resolution setting.\r\n */\r\n onResize: function (gameSize, baseSize, displaySize, resolution)\r\n {\r\n // Has the underlying canvas size changed?\r\n if (baseSize.width !== this.width || baseSize.height !== this.height || resolution !== this.resolution)\r\n {\r\n this.resize(baseSize.width, baseSize.height, resolution);\r\n }\r\n },\r\n\r\n /**\r\n * Resizes the drawing buffer to match that required by the Scale Manager.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#resize\r\n * @since 3.0.0\r\n *\r\n * @param {number} [width] - The new width of the renderer.\r\n * @param {number} [height] - The new height of the renderer.\r\n * @param {number} [resolution] - The new resolution of the renderer.\r\n *\r\n * @return {this} This WebGLRenderer instance.\r\n */\r\n resize: function (width, height, resolution)\r\n {\r\n var gl = this.gl;\r\n var pipelines = this.pipelines;\r\n\r\n this.width = width;\r\n this.height = height;\r\n this.resolution = resolution;\r\n\r\n gl.viewport(0, 0, width, height);\r\n\r\n // Update all registered pipelines\r\n for (var pipelineName in pipelines)\r\n {\r\n pipelines[pipelineName].resize(width, height, resolution);\r\n }\r\n\r\n this.drawingBufferHeight = gl.drawingBufferHeight;\r\n\r\n gl.scissor(0, (gl.drawingBufferHeight - height), width, height);\r\n\r\n this.defaultCamera.setSize(width, height);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Checks if a WebGL extension is supported\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#hasExtension\r\n * @since 3.0.0\r\n *\r\n * @param {string} extensionName - Name of the WebGL extension\r\n *\r\n * @return {boolean} `true` if the extension is supported, otherwise `false`.\r\n */\r\n hasExtension: function (extensionName)\r\n {\r\n return this.supportedExtensions ? this.supportedExtensions.indexOf(extensionName) : false;\r\n },\r\n\r\n /**\r\n * Loads a WebGL extension\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#getExtension\r\n * @since 3.0.0\r\n *\r\n * @param {string} extensionName - The name of the extension to load.\r\n *\r\n * @return {object} WebGL extension if the extension is supported\r\n */\r\n getExtension: function (extensionName)\r\n {\r\n if (!this.hasExtension(extensionName)) { return null; }\r\n\r\n if (!(extensionName in this.extensions))\r\n {\r\n this.extensions[extensionName] = this.gl.getExtension(extensionName);\r\n }\r\n\r\n return this.extensions[extensionName];\r\n },\r\n\r\n /**\r\n * Flushes the current pipeline if the pipeline is bound\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#flush\r\n * @since 3.0.0\r\n */\r\n flush: function ()\r\n {\r\n if (this.currentPipeline)\r\n {\r\n this.currentPipeline.flush();\r\n }\r\n },\r\n\r\n /**\r\n * Checks if a pipeline is present in the current WebGLRenderer\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#hasPipeline\r\n * @since 3.0.0\r\n *\r\n * @param {string} pipelineName - The name of the pipeline.\r\n *\r\n * @return {boolean} `true` if the given pipeline is loaded, otherwise `false`.\r\n */\r\n hasPipeline: function (pipelineName)\r\n {\r\n return (pipelineName in this.pipelines);\r\n },\r\n\r\n /**\r\n * Returns the pipeline by name if the pipeline exists\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#getPipeline\r\n * @since 3.0.0\r\n *\r\n * @param {string} pipelineName - The name of the pipeline.\r\n *\r\n * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline instance, or `null` if not found.\r\n */\r\n getPipeline: function (pipelineName)\r\n {\r\n return (this.hasPipeline(pipelineName)) ? this.pipelines[pipelineName] : null;\r\n },\r\n\r\n /**\r\n * Removes a pipeline by name.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#removePipeline\r\n * @since 3.0.0\r\n *\r\n * @param {string} pipelineName - The name of the pipeline to be removed.\r\n *\r\n * @return {this} This WebGLRenderer instance.\r\n */\r\n removePipeline: function (pipelineName)\r\n {\r\n delete this.pipelines[pipelineName];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds a pipeline instance into the collection of pipelines\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#addPipeline\r\n * @since 3.0.0\r\n *\r\n * @param {string} pipelineName - A unique string-based key for the pipeline.\r\n * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipelineInstance - A pipeline instance which must extend WebGLPipeline.\r\n *\r\n * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline instance that was passed.\r\n */\r\n addPipeline: function (pipelineName, pipelineInstance)\r\n {\r\n if (!this.hasPipeline(pipelineName))\r\n {\r\n this.pipelines[pipelineName] = pipelineInstance;\r\n }\r\n else\r\n {\r\n console.warn('Pipeline exists: ' + pipelineName);\r\n }\r\n\r\n pipelineInstance.name = pipelineName;\r\n\r\n this.pipelines[pipelineName].resize(this.width, this.height, this.config.resolution);\r\n\r\n return pipelineInstance;\r\n },\r\n\r\n /**\r\n * Pushes a new scissor state. This is used to set nested scissor states.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#pushScissor\r\n * @since 3.0.0\r\n *\r\n * @param {integer} x - The x position of the scissor.\r\n * @param {integer} y - The y position of the scissor.\r\n * @param {integer} width - The width of the scissor.\r\n * @param {integer} height - The height of the scissor.\r\n * @param {integer} [drawingBufferHeight] - Optional drawingBufferHeight override value.\r\n *\r\n * @return {integer[]} An array containing the scissor values.\r\n */\r\n pushScissor: function (x, y, width, height, drawingBufferHeight)\r\n {\r\n if (drawingBufferHeight === undefined) { drawingBufferHeight = this.drawingBufferHeight; }\r\n\r\n var scissorStack = this.scissorStack;\r\n\r\n var scissor = [ x, y, width, height ];\r\n\r\n scissorStack.push(scissor);\r\n\r\n this.setScissor(x, y, width, height, drawingBufferHeight);\r\n\r\n this.currentScissor = scissor;\r\n\r\n return scissor;\r\n },\r\n\r\n /**\r\n * Sets the current scissor state.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setScissor\r\n * @since 3.0.0\r\n * \r\n * @param {integer} x - The x position of the scissor.\r\n * @param {integer} y - The y position of the scissor.\r\n * @param {integer} width - The width of the scissor.\r\n * @param {integer} height - The height of the scissor.\r\n * @param {integer} [drawingBufferHeight] - Optional drawingBufferHeight override value.\r\n */\r\n setScissor: function (x, y, width, height, drawingBufferHeight)\r\n {\r\n if (drawingBufferHeight === undefined) { drawingBufferHeight = this.drawingBufferHeight; }\r\n\r\n var gl = this.gl;\r\n\r\n var current = this.currentScissor;\r\n\r\n var setScissor = (width > 0 && height > 0);\r\n\r\n if (current && setScissor)\r\n {\r\n var cx = current[0];\r\n var cy = current[1];\r\n var cw = current[2];\r\n var ch = current[3];\r\n\r\n setScissor = (cx !== x || cy !== y || cw !== width || ch !== height);\r\n }\r\n\r\n if (setScissor)\r\n {\r\n this.flush();\r\n\r\n // https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/scissor\r\n gl.scissor(x, (drawingBufferHeight - y - height), width, height);\r\n }\r\n },\r\n\r\n /**\r\n * Pops the last scissor state and sets it.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#popScissor\r\n * @since 3.0.0\r\n */\r\n popScissor: function ()\r\n {\r\n var scissorStack = this.scissorStack;\r\n\r\n // Remove the current scissor\r\n scissorStack.pop();\r\n\r\n // Reset the previous scissor\r\n var scissor = scissorStack[scissorStack.length - 1];\r\n\r\n if (scissor)\r\n {\r\n this.setScissor(scissor[0], scissor[1], scissor[2], scissor[3]);\r\n }\r\n\r\n this.currentScissor = scissor;\r\n },\r\n\r\n /**\r\n * Binds a WebGLPipeline and sets it as the current pipeline to be used.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setPipeline\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipelineInstance - The pipeline instance to be activated.\r\n * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any.\r\n *\r\n * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline that was activated.\r\n */\r\n setPipeline: function (pipelineInstance, gameObject)\r\n {\r\n if (this.currentPipeline !== pipelineInstance ||\r\n this.currentPipeline.vertexBuffer !== this.currentVertexBuffer ||\r\n this.currentPipeline.program !== this.currentProgram)\r\n {\r\n this.flush();\r\n this.currentPipeline = pipelineInstance;\r\n this.currentPipeline.bind();\r\n }\r\n\r\n this.currentPipeline.onBind(gameObject);\r\n\r\n return this.currentPipeline;\r\n },\r\n\r\n /**\r\n * Is there an active stencil mask?\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#hasActiveStencilMask\r\n * @since 3.17.0\r\n * \r\n * @return {boolean} `true` if there is an active stencil mask, otherwise `false`.\r\n */\r\n hasActiveStencilMask: function ()\r\n {\r\n var mask = this.currentMask.mask;\r\n var camMask = this.currentCameraMask.mask;\r\n\r\n return ((mask && mask.isStencil) || (camMask && camMask.isStencil));\r\n },\r\n\r\n /**\r\n * Use this to reset the gl context to the state that Phaser requires to continue rendering.\r\n * Calling this will:\r\n * \r\n * * Disable `DEPTH_TEST`, `CULL_FACE` and `STENCIL_TEST`.\r\n * * Clear the depth buffer and stencil buffers.\r\n * * Reset the viewport size.\r\n * * Reset the blend mode.\r\n * * Bind a blank texture as the active texture on texture unit zero.\r\n * * Rebinds the given pipeline instance.\r\n * \r\n * You should call this having previously called `clearPipeline` and then wishing to return\r\n * control to Phaser again.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#rebindPipeline\r\n * @since 3.16.0\r\n * \r\n * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipelineInstance - The pipeline instance to be activated.\r\n */\r\n rebindPipeline: function (pipelineInstance)\r\n {\r\n var gl = this.gl;\r\n\r\n gl.disable(gl.DEPTH_TEST);\r\n gl.disable(gl.CULL_FACE);\r\n\r\n if (this.hasActiveStencilMask())\r\n {\r\n gl.clear(gl.DEPTH_BUFFER_BIT);\r\n }\r\n else\r\n {\r\n // If there wasn't a stencil mask set before this call, we can disable it safely\r\n gl.disable(gl.STENCIL_TEST);\r\n gl.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);\r\n }\r\n\r\n gl.viewport(0, 0, this.width, this.height);\r\n\r\n this.setBlendMode(0, true);\r\n\r\n gl.activeTexture(gl.TEXTURE0);\r\n gl.bindTexture(gl.TEXTURE_2D, this.blankTexture.glTexture);\r\n\r\n this.currentActiveTextureUnit = 0;\r\n this.currentTextures[0] = this.blankTexture.glTexture;\r\n\r\n this.currentPipeline = pipelineInstance;\r\n this.currentPipeline.bind();\r\n this.currentPipeline.onBind();\r\n },\r\n\r\n /**\r\n * Flushes the current WebGLPipeline being used and then clears it, along with the\r\n * the current shader program and vertex buffer. Then resets the blend mode to NORMAL.\r\n * Call this before jumping to your own gl context handler, and then call `rebindPipeline` when\r\n * you wish to return control to Phaser again.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#clearPipeline\r\n * @since 3.16.0\r\n */\r\n clearPipeline: function ()\r\n {\r\n this.flush();\r\n\r\n this.currentPipeline = null;\r\n this.currentProgram = null;\r\n this.currentVertexBuffer = null;\r\n this.currentIndexBuffer = null;\r\n\r\n this.setBlendMode(0, true);\r\n },\r\n\r\n /**\r\n * Sets the blend mode to the value given.\r\n *\r\n * If the current blend mode is different from the one given, the pipeline is flushed and the new\r\n * blend mode is enabled.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setBlendMode\r\n * @since 3.0.0\r\n *\r\n * @param {integer} blendModeId - The blend mode to be set. Can be a `BlendModes` const or an integer value.\r\n * @param {boolean} [force=false] - Force the blend mode to be set, regardless of the currently set blend mode.\r\n *\r\n * @return {boolean} `true` if the blend mode was changed as a result of this call, forcing a flush, otherwise `false`.\r\n */\r\n setBlendMode: function (blendModeId, force)\r\n {\r\n if (force === undefined) { force = false; }\r\n\r\n var gl = this.gl;\r\n var blendMode = this.blendModes[blendModeId];\r\n\r\n if (force || (blendModeId !== CONST.BlendModes.SKIP_CHECK && this.currentBlendMode !== blendModeId))\r\n {\r\n this.flush();\r\n\r\n gl.enable(gl.BLEND);\r\n gl.blendEquation(blendMode.equation);\r\n\r\n if (blendMode.func.length > 2)\r\n {\r\n gl.blendFuncSeparate(blendMode.func[0], blendMode.func[1], blendMode.func[2], blendMode.func[3]);\r\n }\r\n else\r\n {\r\n gl.blendFunc(blendMode.func[0], blendMode.func[1]);\r\n }\r\n\r\n this.currentBlendMode = blendModeId;\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Creates a new custom blend mode for the renderer.\r\n * \r\n * See https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Blending_modes\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#addBlendMode\r\n * @since 3.0.0\r\n *\r\n * @param {GLenum[]} 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()}.\r\n * @param {GLenum} 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()}.\r\n *\r\n * @return {integer} The index of the new blend mode, used for referencing it in the future.\r\n */\r\n addBlendMode: function (func, equation)\r\n {\r\n var index = this.blendModes.push({ func: func, equation: equation });\r\n\r\n return index - 1;\r\n },\r\n\r\n /**\r\n * Updates the function bound to a given custom blend mode.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#updateBlendMode\r\n * @since 3.0.0\r\n *\r\n * @param {integer} index - The index of the custom blend mode.\r\n * @param {function} func - The function to use for the blend mode.\r\n * @param {function} equation - The equation to use for the blend mode.\r\n *\r\n * @return {this} This WebGLRenderer instance.\r\n */\r\n updateBlendMode: function (index, func, equation)\r\n {\r\n if (this.blendModes[index])\r\n {\r\n this.blendModes[index].func = func;\r\n\r\n if (equation)\r\n {\r\n this.blendModes[index].equation = equation;\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes a custom blend mode from the renderer.\r\n * Any Game Objects still using this blend mode will error, so be sure to clear them first.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#removeBlendMode\r\n * @since 3.0.0\r\n *\r\n * @param {integer} index - The index of the custom blend mode to be removed.\r\n *\r\n * @return {this} This WebGLRenderer instance.\r\n */\r\n removeBlendMode: function (index)\r\n {\r\n if (index > 17 && this.blendModes[index])\r\n {\r\n this.blendModes.splice(index, 1);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the current active texture for texture unit zero to be a blank texture.\r\n * This only happens if there isn't a texture already in use by texture unit zero.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setBlankTexture\r\n * @private\r\n * @since 3.12.0\r\n *\r\n * @param {boolean} [force=false] - Force a blank texture set, regardless of what's already bound?\r\n */\r\n setBlankTexture: function (force)\r\n {\r\n if (force === undefined) { force = false; }\r\n\r\n if (force || this.currentActiveTextureUnit !== 0 || !this.currentTextures[0])\r\n {\r\n this.setTexture2D(this.blankTexture.glTexture, 0);\r\n }\r\n },\r\n\r\n /**\r\n * Binds a texture at a texture unit. If a texture is already\r\n * bound to that unit it will force a flush on the current pipeline.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setTexture2D\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLTexture} texture - The WebGL texture that needs to be bound.\r\n * @param {integer} textureUnit - The texture unit to which the texture will be bound.\r\n * @param {boolean} [flush=true] - Will the current pipeline be flushed if this is a new texture, or not?\r\n *\r\n * @return {this} This WebGLRenderer instance.\r\n */\r\n setTexture2D: function (texture, textureUnit, flush)\r\n {\r\n if (flush === undefined) { flush = true; }\r\n\r\n var gl = this.gl;\r\n\r\n if (texture !== this.currentTextures[textureUnit])\r\n {\r\n if (flush)\r\n {\r\n this.flush();\r\n }\r\n\r\n if (this.currentActiveTextureUnit !== textureUnit)\r\n {\r\n gl.activeTexture(gl.TEXTURE0 + textureUnit);\r\n\r\n this.currentActiveTextureUnit = textureUnit;\r\n }\r\n\r\n gl.bindTexture(gl.TEXTURE_2D, texture);\r\n\r\n this.currentTextures[textureUnit] = texture;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Binds a framebuffer. If there was another framebuffer already bound it will force a pipeline flush.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setFramebuffer\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLFramebuffer} framebuffer - The framebuffer that needs to be bound.\r\n * @param {boolean} [updateScissor=false] - If a framebuffer is given, set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack.\r\n *\r\n * @return {this} This WebGLRenderer instance.\r\n */\r\n setFramebuffer: function (framebuffer, updateScissor)\r\n {\r\n if (updateScissor === undefined) { updateScissor = false; }\r\n\r\n var gl = this.gl;\r\n\r\n var width = this.width;\r\n var height = this.height;\r\n\r\n if (framebuffer !== this.currentFramebuffer)\r\n {\r\n if (framebuffer && framebuffer.renderTexture)\r\n {\r\n width = framebuffer.renderTexture.width;\r\n height = framebuffer.renderTexture.height;\r\n }\r\n else\r\n {\r\n this.flush();\r\n }\r\n\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\r\n\r\n gl.viewport(0, 0, width, height);\r\n\r\n if (updateScissor)\r\n {\r\n if (framebuffer)\r\n {\r\n this.drawingBufferHeight = height;\r\n\r\n this.pushScissor(0, 0, width, height);\r\n }\r\n else\r\n {\r\n this.drawingBufferHeight = this.height;\r\n\r\n this.popScissor();\r\n }\r\n }\r\n\r\n this.currentFramebuffer = framebuffer;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Binds a program. If there was another program already bound it will force a pipeline flush.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setProgram\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLProgram} program - The program that needs to be bound.\r\n *\r\n * @return {this} This WebGLRenderer instance.\r\n */\r\n setProgram: function (program)\r\n {\r\n var gl = this.gl;\r\n\r\n if (program !== this.currentProgram)\r\n {\r\n this.flush();\r\n\r\n gl.useProgram(program);\r\n\r\n this.currentProgram = program;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Bounds a vertex buffer. If there is a vertex buffer already bound it'll force a pipeline flush.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setVertexBuffer\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLBuffer} vertexBuffer - The buffer that needs to be bound.\r\n *\r\n * @return {this} This WebGLRenderer instance.\r\n */\r\n setVertexBuffer: function (vertexBuffer)\r\n {\r\n var gl = this.gl;\r\n\r\n if (vertexBuffer !== this.currentVertexBuffer)\r\n {\r\n this.flush();\r\n\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\r\n\r\n this.currentVertexBuffer = vertexBuffer;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Bounds a index buffer. If there is a index buffer already bound it'll force a pipeline flush.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setIndexBuffer\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLBuffer} indexBuffer - The buffer the needs to be bound.\r\n *\r\n * @return {this} This WebGLRenderer instance.\r\n */\r\n setIndexBuffer: function (indexBuffer)\r\n {\r\n var gl = this.gl;\r\n\r\n if (indexBuffer !== this.currentIndexBuffer)\r\n {\r\n this.flush();\r\n\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\r\n\r\n this.currentIndexBuffer = indexBuffer;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a texture from an image source. If the source is not valid it creates an empty texture.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#createTextureFromSource\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The source of the texture.\r\n * @param {integer} width - The width of the texture.\r\n * @param {integer} height - The height of the texture.\r\n * @param {integer} scaleMode - The scale mode to be used by the texture.\r\n *\r\n * @return {?WebGLTexture} The WebGL Texture that was created, or `null` if it couldn't be created.\r\n */\r\n createTextureFromSource: function (source, width, height, scaleMode)\r\n {\r\n var gl = this.gl;\r\n var minFilter = gl.NEAREST;\r\n var magFilter = gl.NEAREST;\r\n var wrap = gl.CLAMP_TO_EDGE;\r\n var texture = null;\r\n\r\n width = source ? source.width : width;\r\n height = source ? source.height : height;\r\n\r\n var pow = IsSizePowerOfTwo(width, height);\r\n\r\n if (pow)\r\n {\r\n wrap = gl.REPEAT;\r\n }\r\n\r\n if (scaleMode === CONST.ScaleModes.LINEAR && this.config.antialias)\r\n {\r\n minFilter = (pow) ? this.mipmapFilter : gl.LINEAR;\r\n magFilter = gl.LINEAR;\r\n }\r\n\r\n if (!source && typeof width === 'number' && typeof height === 'number')\r\n {\r\n texture = this.createTexture2D(0, minFilter, magFilter, wrap, wrap, gl.RGBA, null, width, height);\r\n }\r\n else\r\n {\r\n texture = this.createTexture2D(0, minFilter, magFilter, wrap, wrap, gl.RGBA, source);\r\n }\r\n\r\n return texture;\r\n },\r\n\r\n /**\r\n * A wrapper for creating a WebGLTexture. If no pixel data is passed it will create an empty texture.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#createTexture2D\r\n * @since 3.0.0\r\n *\r\n * @param {integer} mipLevel - Mip level of the texture.\r\n * @param {integer} minFilter - Filtering of the texture.\r\n * @param {integer} magFilter - Filtering of the texture.\r\n * @param {integer} wrapT - Wrapping mode of the texture.\r\n * @param {integer} wrapS - Wrapping mode of the texture.\r\n * @param {integer} format - Which format does the texture use.\r\n * @param {?object} pixels - pixel data.\r\n * @param {integer} width - Width of the texture in pixels.\r\n * @param {integer} height - Height of the texture in pixels.\r\n * @param {boolean} [pma=true] - Does the texture have premultiplied alpha?\r\n * @param {boolean} [forceSize=false] - If `true` it will use the width and height passed to this method, regardless of the pixels dimension.\r\n * @param {boolean} [flipY=false] - Sets the `UNPACK_FLIP_Y_WEBGL` flag the WebGL Texture uses during upload.\r\n *\r\n * @return {WebGLTexture} The WebGLTexture that was created.\r\n */\r\n createTexture2D: function (mipLevel, minFilter, magFilter, wrapT, wrapS, format, pixels, width, height, pma, forceSize, flipY)\r\n {\r\n pma = (pma === undefined || pma === null) ? true : pma;\r\n if (forceSize === undefined) { forceSize = false; }\r\n if (flipY === undefined) { flipY = false; }\r\n\r\n var gl = this.gl;\r\n var texture = gl.createTexture();\r\n\r\n this.setTexture2D(texture, 0);\r\n\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT);\r\n\r\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, pma);\r\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);\r\n\r\n if (pixels === null || pixels === undefined)\r\n {\r\n gl.texImage2D(gl.TEXTURE_2D, mipLevel, format, width, height, 0, format, gl.UNSIGNED_BYTE, null);\r\n }\r\n else\r\n {\r\n if (!forceSize)\r\n {\r\n width = pixels.width;\r\n height = pixels.height;\r\n }\r\n\r\n gl.texImage2D(gl.TEXTURE_2D, mipLevel, format, format, gl.UNSIGNED_BYTE, pixels);\r\n }\r\n\r\n if (IsSizePowerOfTwo(width, height))\r\n {\r\n gl.generateMipmap(gl.TEXTURE_2D);\r\n }\r\n\r\n this.setTexture2D(null, 0);\r\n\r\n texture.isAlphaPremultiplied = pma;\r\n texture.isRenderTexture = false;\r\n texture.width = width;\r\n texture.height = height;\r\n\r\n this.nativeTextures.push(texture);\r\n\r\n return texture;\r\n },\r\n\r\n /**\r\n * Wrapper for creating WebGLFramebuffer.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#createFramebuffer\r\n * @since 3.0.0\r\n *\r\n * @param {integer} width - Width in pixels of the framebuffer\r\n * @param {integer} height - Height in pixels of the framebuffer\r\n * @param {WebGLTexture} renderTexture - The color texture to where the color pixels are written\r\n * @param {boolean} addDepthStencilBuffer - Indicates if the current framebuffer support depth and stencil buffers\r\n *\r\n * @return {WebGLFramebuffer} Raw WebGLFramebuffer\r\n */\r\n createFramebuffer: function (width, height, renderTexture, addDepthStencilBuffer)\r\n {\r\n var gl = this.gl;\r\n var framebuffer = gl.createFramebuffer();\r\n var complete = 0;\r\n\r\n this.setFramebuffer(framebuffer);\r\n\r\n if (addDepthStencilBuffer)\r\n {\r\n var depthStencilBuffer = gl.createRenderbuffer();\r\n gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);\r\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);\r\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer);\r\n }\r\n\r\n renderTexture.isRenderTexture = true;\r\n renderTexture.isAlphaPremultiplied = false;\r\n\r\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, renderTexture, 0);\r\n\r\n complete = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\r\n\r\n if (complete !== gl.FRAMEBUFFER_COMPLETE)\r\n {\r\n var errors = {\r\n 36054: 'Incomplete Attachment',\r\n 36055: 'Missing Attachment',\r\n 36057: 'Incomplete Dimensions',\r\n 36061: 'Framebuffer Unsupported'\r\n };\r\n\r\n throw new Error('Framebuffer incomplete. Framebuffer status: ' + errors[complete]);\r\n }\r\n\r\n framebuffer.renderTexture = renderTexture;\r\n\r\n this.setFramebuffer(null);\r\n\r\n return framebuffer;\r\n },\r\n\r\n /**\r\n * Wrapper for creating a WebGLProgram\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#createProgram\r\n * @since 3.0.0\r\n *\r\n * @param {string} vertexShader - Source to the vertex shader\r\n * @param {string} fragmentShader - Source to the fragment shader\r\n *\r\n * @return {WebGLProgram} Raw WebGLProgram\r\n */\r\n createProgram: function (vertexShader, fragmentShader)\r\n {\r\n var gl = this.gl;\r\n var program = gl.createProgram();\r\n var vs = gl.createShader(gl.VERTEX_SHADER);\r\n var fs = gl.createShader(gl.FRAGMENT_SHADER);\r\n\r\n gl.shaderSource(vs, vertexShader);\r\n gl.shaderSource(fs, fragmentShader);\r\n gl.compileShader(vs);\r\n gl.compileShader(fs);\r\n\r\n if (!gl.getShaderParameter(vs, gl.COMPILE_STATUS))\r\n {\r\n throw new Error('Failed to compile Vertex Shader:\\n' + gl.getShaderInfoLog(vs));\r\n }\r\n if (!gl.getShaderParameter(fs, gl.COMPILE_STATUS))\r\n {\r\n throw new Error('Failed to compile Fragment Shader:\\n' + gl.getShaderInfoLog(fs));\r\n }\r\n\r\n gl.attachShader(program, vs);\r\n gl.attachShader(program, fs);\r\n gl.linkProgram(program);\r\n\r\n if (!gl.getProgramParameter(program, gl.LINK_STATUS))\r\n {\r\n throw new Error('Failed to link program:\\n' + gl.getProgramInfoLog(program));\r\n }\r\n\r\n return program;\r\n },\r\n\r\n /**\r\n * Wrapper for creating a vertex buffer.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#createVertexBuffer\r\n * @since 3.0.0\r\n *\r\n * @param {ArrayBuffer} initialDataOrSize - It's either ArrayBuffer or an integer indicating the size of the vbo\r\n * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW\r\n *\r\n * @return {WebGLBuffer} Raw vertex buffer\r\n */\r\n createVertexBuffer: function (initialDataOrSize, bufferUsage)\r\n {\r\n var gl = this.gl;\r\n var vertexBuffer = gl.createBuffer();\r\n\r\n this.setVertexBuffer(vertexBuffer);\r\n\r\n gl.bufferData(gl.ARRAY_BUFFER, initialDataOrSize, bufferUsage);\r\n\r\n this.setVertexBuffer(null);\r\n\r\n return vertexBuffer;\r\n },\r\n\r\n /**\r\n * Wrapper for creating a vertex buffer.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#createIndexBuffer\r\n * @since 3.0.0\r\n *\r\n * @param {ArrayBuffer} initialDataOrSize - Either ArrayBuffer or an integer indicating the size of the vbo.\r\n * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW.\r\n *\r\n * @return {WebGLBuffer} Raw index buffer\r\n */\r\n createIndexBuffer: function (initialDataOrSize, bufferUsage)\r\n {\r\n var gl = this.gl;\r\n var indexBuffer = gl.createBuffer();\r\n\r\n this.setIndexBuffer(indexBuffer);\r\n\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, initialDataOrSize, bufferUsage);\r\n\r\n this.setIndexBuffer(null);\r\n\r\n return indexBuffer;\r\n },\r\n\r\n /**\r\n * Removes the given texture from the nativeTextures array and then deletes it from the GPU.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteTexture\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLTexture} texture - The WebGL Texture to be deleted.\r\n *\r\n * @return {this} This WebGLRenderer instance.\r\n */\r\n deleteTexture: function (texture)\r\n {\r\n var index = this.nativeTextures.indexOf(texture);\r\n\r\n if (index !== -1)\r\n {\r\n SpliceOne(this.nativeTextures, index);\r\n }\r\n\r\n this.gl.deleteTexture(texture);\r\n\r\n if (this.currentTextures[0] === texture && !this.game.pendingDestroy)\r\n {\r\n // texture we just deleted is in use, so bind a blank texture\r\n this.setBlankTexture(true);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Deletes a WebGLFramebuffer from the GL instance.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteFramebuffer\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLFramebuffer} framebuffer - The Framebuffer to be deleted.\r\n *\r\n * @return {this} This WebGLRenderer instance.\r\n */\r\n deleteFramebuffer: function (framebuffer)\r\n {\r\n this.gl.deleteFramebuffer(framebuffer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Deletes a WebGLProgram from the GL instance.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteProgram\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLProgram} program - The shader program to be deleted.\r\n *\r\n * @return {this} This WebGLRenderer instance.\r\n */\r\n deleteProgram: function (program)\r\n {\r\n this.gl.deleteProgram(program);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Deletes a WebGLBuffer from the GL instance.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteBuffer\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLBuffer} vertexBuffer - The WebGLBuffer to be deleted.\r\n *\r\n * @return {this} This WebGLRenderer instance.\r\n */\r\n deleteBuffer: function (buffer)\r\n {\r\n this.gl.deleteBuffer(buffer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Controls the pre-render operations for the given camera.\r\n * Handles any clipping needed by the camera and renders the background color if a color is visible.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#preRenderCamera\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to pre-render.\r\n */\r\n preRenderCamera: function (camera)\r\n {\r\n var cx = camera._cx;\r\n var cy = camera._cy;\r\n var cw = camera._cw;\r\n var ch = camera._ch;\r\n\r\n var TextureTintPipeline = this.pipelines.TextureTintPipeline;\r\n\r\n var color = camera.backgroundColor;\r\n\r\n if (camera.renderToTexture)\r\n {\r\n this.flush();\r\n\r\n this.pushScissor(cx, cy, cw, -ch);\r\n\r\n this.setFramebuffer(camera.framebuffer);\r\n\r\n var gl = this.gl;\r\n\r\n gl.clearColor(0, 0, 0, 0);\r\n\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n\r\n TextureTintPipeline.projOrtho(cx, cw + cx, cy, ch + cy, -1000, 1000);\r\n\r\n if (camera.mask)\r\n {\r\n this.currentCameraMask.mask = camera.mask;\r\n this.currentCameraMask.camera = camera._maskCamera;\r\n\r\n camera.mask.preRenderWebGL(this, camera, camera._maskCamera);\r\n }\r\n\r\n if (color.alphaGL > 0)\r\n {\r\n TextureTintPipeline.drawFillRect(\r\n cx, cy, cw + cx, ch + cy,\r\n Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1),\r\n color.alphaGL\r\n );\r\n }\r\n \r\n camera.emit(CameraEvents.PRE_RENDER, camera);\r\n }\r\n else\r\n {\r\n this.pushScissor(cx, cy, cw, ch);\r\n\r\n if (camera.mask)\r\n {\r\n this.currentCameraMask.mask = camera.mask;\r\n this.currentCameraMask.camera = camera._maskCamera;\r\n\r\n camera.mask.preRenderWebGL(this, camera, camera._maskCamera);\r\n }\r\n\r\n if (color.alphaGL > 0)\r\n {\r\n TextureTintPipeline.drawFillRect(\r\n cx, cy, cw , ch,\r\n Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1),\r\n color.alphaGL\r\n );\r\n }\r\n }\r\n },\r\n\r\n getCurrentStencilMask: function ()\r\n {\r\n var prev = null;\r\n var stack = this.maskStack;\r\n var cameraMask = this.currentCameraMask;\r\n\r\n if (stack.length > 0)\r\n {\r\n prev = stack[stack.length - 1];\r\n }\r\n else if (cameraMask.mask && cameraMask.mask.isStencil)\r\n {\r\n prev = cameraMask;\r\n }\r\n\r\n return prev;\r\n },\r\n\r\n /**\r\n * Controls the post-render operations for the given camera.\r\n * Renders the foreground camera effects like flash and fading. It resets the current scissor state.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#postRenderCamera\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to post-render.\r\n */\r\n postRenderCamera: function (camera)\r\n {\r\n var TextureTintPipeline = this.pipelines.TextureTintPipeline;\r\n\r\n camera.flashEffect.postRenderWebGL(TextureTintPipeline, Utils.getTintFromFloats);\r\n camera.fadeEffect.postRenderWebGL(TextureTintPipeline, Utils.getTintFromFloats);\r\n\r\n camera.dirty = false;\r\n\r\n this.popScissor();\r\n\r\n if (camera.renderToTexture)\r\n {\r\n TextureTintPipeline.flush();\r\n\r\n this.setFramebuffer(null);\r\n\r\n camera.emit(CameraEvents.POST_RENDER, camera);\r\n\r\n TextureTintPipeline.projOrtho(0, TextureTintPipeline.width, TextureTintPipeline.height, 0, -1000.0, 1000.0);\r\n\r\n var getTint = Utils.getTintAppendFloatAlpha;\r\n\r\n var pipeline = (camera.pipeline) ? camera.pipeline : TextureTintPipeline;\r\n\r\n pipeline.batchTexture(\r\n camera,\r\n camera.glTexture,\r\n camera.width, camera.height,\r\n camera.x, camera.y,\r\n camera.width, camera.height,\r\n camera.zoom, camera.zoom,\r\n camera.rotation,\r\n camera.flipX, !camera.flipY,\r\n 1, 1,\r\n 0, 0,\r\n 0, 0, camera.width, camera.height,\r\n getTint(camera._tintTL, camera._alphaTL),\r\n getTint(camera._tintTR, camera._alphaTR),\r\n getTint(camera._tintBL, camera._alphaBL),\r\n getTint(camera._tintBR, camera._alphaBR),\r\n (camera._isTinted && camera.tintFill),\r\n 0, 0,\r\n this.defaultCamera,\r\n null\r\n );\r\n\r\n // Force clear the current texture so that items next in the batch (like Graphics) don't try and use it\r\n this.setBlankTexture(true);\r\n }\r\n\r\n if (camera.mask)\r\n {\r\n this.currentCameraMask.mask = null;\r\n\r\n camera.mask.postRenderWebGL(this, camera._maskCamera);\r\n }\r\n },\r\n\r\n /**\r\n * Clears the current vertex buffer and updates pipelines.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#preRender\r\n * @since 3.0.0\r\n */\r\n preRender: function ()\r\n {\r\n if (this.contextLost) { return; }\r\n\r\n var gl = this.gl;\r\n var pipelines = this.pipelines;\r\n\r\n // Make sure we are bound to the main frame buffer\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\r\n\r\n if (this.config.clearBeforeRender)\r\n {\r\n var clearColor = this.config.backgroundColor;\r\n\r\n gl.clearColor(clearColor.redGL, clearColor.greenGL, clearColor.blueGL, clearColor.alphaGL);\r\n\r\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);\r\n }\r\n\r\n gl.enable(gl.SCISSOR_TEST);\r\n\r\n for (var key in pipelines)\r\n {\r\n pipelines[key].onPreRender();\r\n }\r\n\r\n // TODO - Find a way to stop needing to create these arrays every frame\r\n // and equally not need a huge array buffer created to hold them\r\n\r\n this.currentScissor = [ 0, 0, this.width, this.height ];\r\n this.scissorStack = [ this.currentScissor ];\r\n\r\n if (this.game.scene.customViewports)\r\n {\r\n gl.scissor(0, (this.drawingBufferHeight - this.height), this.width, this.height);\r\n }\r\n\r\n this.currentMask.mask = null;\r\n this.currentCameraMask.mask = null;\r\n this.maskStack.length = 0;\r\n\r\n this.setPipeline(this.pipelines.TextureTintPipeline);\r\n },\r\n\r\n /**\r\n * The core render step for a Scene Camera.\r\n * \r\n * Iterates through the given Game Object's array and renders them with the given Camera.\r\n * \r\n * This is called by the `CameraManager.render` method. The Camera Manager instance belongs to a Scene, and is invoked\r\n * by the Scene Systems.render method.\r\n * \r\n * This method is not called if `Camera.visible` is `false`, or `Camera.alpha` is zero.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#render\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to render.\r\n * @param {Phaser.GameObjects.GameObject} children - The Game Object's within the Scene to be rendered.\r\n * @param {number} interpolationPercentage - The interpolation percentage to apply. Currently un-used.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with.\r\n */\r\n render: function (scene, children, interpolationPercentage, camera)\r\n {\r\n if (this.contextLost) { return; }\r\n\r\n var list = children.list;\r\n var childCount = list.length;\r\n var pipelines = this.pipelines;\r\n\r\n for (var key in pipelines)\r\n {\r\n pipelines[key].onRender(scene, camera);\r\n }\r\n\r\n // Apply scissor for cam region + render background color, if not transparent\r\n this.preRenderCamera(camera);\r\n\r\n // Nothing to render, so bail out\r\n if (childCount === 0)\r\n {\r\n this.setBlendMode(CONST.BlendModes.NORMAL);\r\n\r\n // Applies camera effects and pops the scissor, if set\r\n this.postRenderCamera(camera);\r\n\r\n return;\r\n }\r\n\r\n // Reset the current type\r\n this.currentType = '';\r\n \r\n var current = this.currentMask;\r\n\r\n for (var i = 0; i < childCount; i++)\r\n {\r\n var child = list[i];\r\n\r\n if (!child.willRender(camera))\r\n {\r\n continue;\r\n }\r\n\r\n if (child.blendMode !== this.currentBlendMode)\r\n {\r\n this.setBlendMode(child.blendMode);\r\n }\r\n\r\n var mask = child.mask;\r\n\r\n current = this.currentMask;\r\n\r\n if (current.mask && current.mask !== mask)\r\n {\r\n // Render out the previously set mask\r\n current.mask.postRenderWebGL(this, current.camera);\r\n }\r\n\r\n if (mask && current.mask !== mask)\r\n {\r\n mask.preRenderWebGL(this, child, camera);\r\n }\r\n\r\n var type = child.type;\r\n\r\n if (type !== this.currentType)\r\n {\r\n this.newType = true;\r\n this.currentType = type;\r\n }\r\n\r\n this.nextTypeMatch = (i < childCount - 1) ? (list[i + 1].type === this.currentType) : false;\r\n\r\n child.renderWebGL(this, child, interpolationPercentage, camera);\r\n\r\n this.newType = false;\r\n }\r\n\r\n current = this.currentMask;\r\n\r\n if (current.mask)\r\n {\r\n // Render out the previously set mask, if it was the last item in the display list\r\n current.mask.postRenderWebGL(this, current.camera);\r\n }\r\n\r\n this.setBlendMode(CONST.BlendModes.NORMAL);\r\n\r\n // Applies camera effects and pops the scissor, if set\r\n this.postRenderCamera(camera);\r\n },\r\n\r\n /**\r\n * The post-render step happens after all Cameras in all Scenes have been rendered.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#postRender\r\n * @since 3.0.0\r\n */\r\n postRender: function ()\r\n {\r\n if (this.contextLost) { return; }\r\n\r\n this.flush();\r\n\r\n // Unbind custom framebuffer here\r\n\r\n var state = this.snapshotState;\r\n\r\n if (state.callback)\r\n {\r\n WebGLSnapshot(this.canvas, state);\r\n\r\n state.callback = null;\r\n }\r\n\r\n var pipelines = this.pipelines;\r\n\r\n for (var key in pipelines)\r\n {\r\n pipelines[key].onPostRender();\r\n }\r\n },\r\n\r\n /**\r\n * Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered.\r\n * \r\n * To capture a specific area see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`.\r\n * \r\n * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then\r\n * calling this method will override it.\r\n * \r\n * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView.\r\n * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it,\r\n * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process,\r\n * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created.\r\n * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`.\r\n * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`.\r\n *\r\n * @return {this} This WebGL Renderer.\r\n */\r\n snapshot: function (callback, type, encoderOptions)\r\n {\r\n return this.snapshotArea(0, 0, this.gl.drawingBufferWidth, this.gl.drawingBufferHeight, callback, type, encoderOptions);\r\n },\r\n\r\n /**\r\n * Schedules a snapshot of the given area of the game viewport to be taken after the current frame is rendered.\r\n * \r\n * To capture the whole game viewport see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`.\r\n * \r\n * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then\r\n * calling this method will override it.\r\n * \r\n * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView.\r\n * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it,\r\n * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process,\r\n * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshotArea\r\n * @since 3.16.0\r\n *\r\n * @param {integer} x - The x coordinate to grab from.\r\n * @param {integer} y - The y coordinate to grab from.\r\n * @param {integer} width - The width of the area to grab.\r\n * @param {integer} height - The height of the area to grab.\r\n * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created.\r\n * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`.\r\n * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`.\r\n *\r\n * @return {this} This WebGL Renderer.\r\n */\r\n snapshotArea: function (x, y, width, height, callback, type, encoderOptions)\r\n {\r\n var state = this.snapshotState;\r\n\r\n state.callback = callback;\r\n state.type = type;\r\n state.encoder = encoderOptions;\r\n state.getPixel = false;\r\n state.x = x;\r\n state.y = y;\r\n state.width = Math.min(width, this.gl.drawingBufferWidth);\r\n state.height = Math.min(height, this.gl.drawingBufferHeight);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Schedules a snapshot of the given pixel from the game viewport to be taken after the current frame is rendered.\r\n * \r\n * To capture the whole game viewport see the `snapshot` method. To capture a specific area, see `snapshotArea`.\r\n * \r\n * Only one snapshot can be active _per frame_. If you have already called `snapshotArea`, for example, then\r\n * calling this method will override it.\r\n * \r\n * Unlike the other two snapshot methods, this one will return a `Color` object containing the color data for\r\n * the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute,\r\n * using less memory.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshotPixel\r\n * @since 3.16.0\r\n *\r\n * @param {integer} x - The x coordinate of the pixel to get.\r\n * @param {integer} y - The y coordinate of the pixel to get.\r\n * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted.\r\n *\r\n * @return {this} This WebGL Renderer.\r\n */\r\n snapshotPixel: function (x, y, callback)\r\n {\r\n this.snapshotArea(x, y, 1, 1, callback);\r\n\r\n this.snapshotState.getPixel = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes a snapshot of the given area of the given frame buffer.\r\n * \r\n * Unlike the other snapshot methods, this one is processed immediately and doesn't wait for the next render.\r\n * \r\n * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView.\r\n * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it,\r\n * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process,\r\n * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshotFramebuffer\r\n * @since 3.19.0\r\n *\r\n * @param {WebGLFramebuffer} framebuffer - The framebuffer to grab from.\r\n * @param {integer} bufferWidth - The width of the framebuffer.\r\n * @param {integer} bufferHeight - The height of the framebuffer.\r\n * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created.\r\n * @param {boolean} [getPixel=false] - Grab a single pixel as a Color object, or an area as an Image object?\r\n * @param {integer} [x=0] - The x coordinate to grab from.\r\n * @param {integer} [y=0] - The y coordinate to grab from.\r\n * @param {integer} [width=bufferWidth] - The width of the area to grab.\r\n * @param {integer} [height=bufferHeight] - The height of the area to grab.\r\n * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`.\r\n * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`.\r\n *\r\n * @return {this} This WebGL Renderer.\r\n */\r\n snapshotFramebuffer: function (framebuffer, bufferWidth, bufferHeight, callback, getPixel, x, y, width, height, type, encoderOptions)\r\n {\r\n if (getPixel === undefined) { getPixel = false; }\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = bufferWidth; }\r\n if (height === undefined) { height = bufferHeight; }\r\n\r\n var currentFramebuffer = this.currentFramebuffer;\r\n\r\n this.snapshotArea(x, y, width, height, callback, type, encoderOptions);\r\n\r\n var state = this.snapshotState;\r\n\r\n state.getPixel = getPixel;\r\n\r\n state.isFramebuffer = true;\r\n state.bufferWidth = bufferWidth;\r\n state.bufferHeight = bufferHeight;\r\n\r\n this.setFramebuffer(framebuffer);\r\n\r\n WebGLSnapshot(this.canvas, state);\r\n\r\n this.setFramebuffer(currentFramebuffer);\r\n\r\n state.callback = null;\r\n state.isFramebuffer = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a new WebGL Texture based on the given Canvas Element.\r\n * \r\n * If the `dstTexture` parameter is given, the WebGL Texture is updated, rather than created fresh.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#canvasToTexture\r\n * @since 3.0.0\r\n * \r\n * @param {HTMLCanvasElement} srcCanvas - The Canvas to create the WebGL Texture from\r\n * @param {WebGLTexture} [dstTexture] - The destination WebGL Texture to set.\r\n * @param {boolean} [noRepeat=false] - Should this canvas be allowed to set `REPEAT` (such as for Text objects?)\r\n * @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`?\r\n * \r\n * @return {WebGLTexture} The newly created, or updated, WebGL Texture.\r\n */\r\n canvasToTexture: function (srcCanvas, dstTexture, noRepeat, flipY)\r\n {\r\n if (noRepeat === undefined) { noRepeat = false; }\r\n if (flipY === undefined) { flipY = false; }\r\n\r\n if (!dstTexture)\r\n {\r\n return this.createCanvasTexture(srcCanvas, noRepeat, flipY);\r\n }\r\n else\r\n {\r\n return this.updateCanvasTexture(srcCanvas, dstTexture, flipY);\r\n }\r\n },\r\n\r\n /**\r\n * Creates a new WebGL Texture based on the given Canvas Element.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#createCanvasTexture\r\n * @since 3.20.0\r\n * \r\n * @param {HTMLCanvasElement} srcCanvas - The Canvas to create the WebGL Texture from\r\n * @param {boolean} [noRepeat=false] - Should this canvas be allowed to set `REPEAT` (such as for Text objects?)\r\n * @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`?\r\n * \r\n * @return {WebGLTexture} The newly created WebGL Texture.\r\n */\r\n createCanvasTexture: function (srcCanvas, noRepeat, flipY)\r\n {\r\n if (noRepeat === undefined) { noRepeat = false; }\r\n if (flipY === undefined) { flipY = false; }\r\n\r\n var gl = this.gl;\r\n var minFilter = gl.NEAREST;\r\n var magFilter = gl.NEAREST;\r\n\r\n var width = srcCanvas.width;\r\n var height = srcCanvas.height;\r\n\r\n var wrapping = gl.CLAMP_TO_EDGE;\r\n\r\n var pow = IsSizePowerOfTwo(width, height);\r\n\r\n if (!noRepeat && pow)\r\n {\r\n wrapping = gl.REPEAT;\r\n }\r\n\r\n if (this.config.antialias)\r\n {\r\n minFilter = (pow) ? this.mipmapFilter : gl.LINEAR;\r\n magFilter = gl.LINEAR;\r\n }\r\n\r\n return this.createTexture2D(0, minFilter, magFilter, wrapping, wrapping, gl.RGBA, srcCanvas, width, height, true, false, flipY);\r\n },\r\n\r\n /**\r\n * Updates a WebGL Texture based on the given Canvas Element.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#updateCanvasTexture\r\n * @since 3.20.0\r\n * \r\n * @param {HTMLCanvasElement} srcCanvas - The Canvas to update the WebGL Texture from.\r\n * @param {WebGLTexture} dstTexture - The destination WebGL Texture to update.\r\n * @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`?\r\n * \r\n * @return {WebGLTexture} The updated WebGL Texture.\r\n */\r\n updateCanvasTexture: function (srcCanvas, dstTexture, flipY)\r\n {\r\n if (flipY === undefined) { flipY = false; }\r\n\r\n var gl = this.gl;\r\n\r\n var width = srcCanvas.width;\r\n var height = srcCanvas.height;\r\n\r\n if (width > 0 && height > 0)\r\n {\r\n this.setTexture2D(dstTexture, 0);\r\n\r\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);\r\n\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, srcCanvas);\r\n \r\n dstTexture.width = width;\r\n dstTexture.height = height;\r\n \r\n this.setTexture2D(null, 0);\r\n }\r\n\r\n return dstTexture;\r\n },\r\n\r\n /**\r\n * Creates a new WebGL Texture based on the given HTML Video Element.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#createVideoTexture\r\n * @since 3.20.0\r\n * \r\n * @param {HTMLVideoElement} srcVideo - The Video to create the WebGL Texture from\r\n * @param {boolean} [noRepeat=false] - Should this canvas be allowed to set `REPEAT`?\r\n * @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`?\r\n * \r\n * @return {WebGLTexture} The newly created WebGL Texture.\r\n */\r\n createVideoTexture: function (srcVideo, noRepeat, flipY)\r\n {\r\n if (noRepeat === undefined) { noRepeat = false; }\r\n if (flipY === undefined) { flipY = false; }\r\n\r\n var gl = this.gl;\r\n var minFilter = gl.NEAREST;\r\n var magFilter = gl.NEAREST;\r\n\r\n var width = srcVideo.videoWidth;\r\n var height = srcVideo.videoHeight;\r\n\r\n var wrapping = gl.CLAMP_TO_EDGE;\r\n\r\n var pow = IsSizePowerOfTwo(width, height);\r\n\r\n if (!noRepeat && pow)\r\n {\r\n wrapping = gl.REPEAT;\r\n }\r\n\r\n if (this.config.antialias)\r\n {\r\n minFilter = (pow) ? this.mipmapFilter : gl.LINEAR;\r\n magFilter = gl.LINEAR;\r\n }\r\n\r\n return this.createTexture2D(0, minFilter, magFilter, wrapping, wrapping, gl.RGBA, srcVideo, width, height, true, true, flipY);\r\n },\r\n\r\n /**\r\n * Updates a WebGL Texture based on the given HTML Video Element.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#updateVideoTexture\r\n * @since 3.20.0\r\n * \r\n * @param {HTMLVideoElement} srcVideo - The Video to update the WebGL Texture with.\r\n * @param {WebGLTexture} dstTexture - The destination WebGL Texture to update.\r\n * @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`?\r\n * \r\n * @return {WebGLTexture} The updated WebGL Texture.\r\n */\r\n updateVideoTexture: function (srcVideo, dstTexture, flipY)\r\n {\r\n if (flipY === undefined) { flipY = false; }\r\n\r\n var gl = this.gl;\r\n\r\n var width = srcVideo.videoWidth;\r\n var height = srcVideo.videoHeight;\r\n\r\n if (width > 0 && height > 0)\r\n {\r\n this.setTexture2D(dstTexture, 0);\r\n\r\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);\r\n\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, srcVideo);\r\n\r\n dstTexture.width = width;\r\n dstTexture.height = height;\r\n\r\n this.setTexture2D(null, 0);\r\n }\r\n\r\n return dstTexture;\r\n },\r\n\r\n /**\r\n * Sets the minification and magnification filter for a texture.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setTextureFilter\r\n * @since 3.0.0\r\n *\r\n * @param {integer} texture - The texture to set the filter for.\r\n * @param {integer} filter - The filter to set. 0 for linear filtering, 1 for nearest neighbor (blocky) filtering.\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n setTextureFilter: function (texture, filter)\r\n {\r\n var gl = this.gl;\r\n var glFilter = [ gl.LINEAR, gl.NEAREST ][filter];\r\n\r\n this.setTexture2D(texture, 0);\r\n\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, glFilter);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, glFilter);\r\n\r\n this.setTexture2D(null, 0);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat1\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {number} x - [description]\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n setFloat1: function (program, name, x)\r\n {\r\n this.setProgram(program);\r\n\r\n this.gl.uniform1f(this.gl.getUniformLocation(program, name), x);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat2\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {number} x - [description]\r\n * @param {number} y - [description]\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n setFloat2: function (program, name, x, y)\r\n {\r\n this.setProgram(program);\r\n\r\n this.gl.uniform2f(this.gl.getUniformLocation(program, name), x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat3\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {number} x - [description]\r\n * @param {number} y - [description]\r\n * @param {number} z - [description]\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n setFloat3: function (program, name, x, y, z)\r\n {\r\n this.setProgram(program);\r\n\r\n this.gl.uniform3f(this.gl.getUniformLocation(program, name), x, y, z);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets uniform of a WebGLProgram\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat4\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {number} x - X component\r\n * @param {number} y - Y component\r\n * @param {number} z - Z component\r\n * @param {number} w - W component\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n setFloat4: function (program, name, x, y, z, w)\r\n {\r\n this.setProgram(program);\r\n\r\n this.gl.uniform4f(this.gl.getUniformLocation(program, name), x, y, z, w);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the value of a uniform variable in the given WebGLProgram.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat1v\r\n * @since 3.13.0\r\n *\r\n * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {Float32Array} arr - The new value to be used for the uniform variable.\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n setFloat1v: function (program, name, arr)\r\n {\r\n this.setProgram(program);\r\n\r\n this.gl.uniform1fv(this.gl.getUniformLocation(program, name), arr);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the value of a uniform variable in the given WebGLProgram.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat2v\r\n * @since 3.13.0\r\n *\r\n * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {Float32Array} arr - The new value to be used for the uniform variable.\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n setFloat2v: function (program, name, arr)\r\n {\r\n this.setProgram(program);\r\n\r\n this.gl.uniform2fv(this.gl.getUniformLocation(program, name), arr);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the value of a uniform variable in the given WebGLProgram.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat3v\r\n * @since 3.13.0\r\n *\r\n * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {Float32Array} arr - The new value to be used for the uniform variable.\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n setFloat3v: function (program, name, arr)\r\n {\r\n this.setProgram(program);\r\n\r\n this.gl.uniform3fv(this.gl.getUniformLocation(program, name), arr);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the value of a uniform variable in the given WebGLProgram.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat4v\r\n * @since 3.13.0\r\n *\r\n * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {Float32Array} arr - The new value to be used for the uniform variable.\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n\r\n setFloat4v: function (program, name, arr)\r\n {\r\n this.setProgram(program);\r\n\r\n this.gl.uniform4fv(this.gl.getUniformLocation(program, name), arr);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the value of a uniform variable in the given WebGLProgram.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt1\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {integer} x - [description]\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n setInt1: function (program, name, x)\r\n {\r\n this.setProgram(program);\r\n\r\n this.gl.uniform1i(this.gl.getUniformLocation(program, name), x);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the value of a uniform variable in the given WebGLProgram.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt2\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {integer} x - The new X component\r\n * @param {integer} y - The new Y component\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n setInt2: function (program, name, x, y)\r\n {\r\n this.setProgram(program);\r\n\r\n this.gl.uniform2i(this.gl.getUniformLocation(program, name), x, y);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the value of a uniform variable in the given WebGLProgram.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt3\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {integer} x - The new X component\r\n * @param {integer} y - The new Y component\r\n * @param {integer} z - The new Z component\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n setInt3: function (program, name, x, y, z)\r\n {\r\n this.setProgram(program);\r\n\r\n this.gl.uniform3i(this.gl.getUniformLocation(program, name), x, y, z);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the value of a uniform variable in the given WebGLProgram.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt4\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {integer} x - X component\r\n * @param {integer} y - Y component\r\n * @param {integer} z - Z component\r\n * @param {integer} w - W component\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n setInt4: function (program, name, x, y, z, w)\r\n {\r\n this.setProgram(program);\r\n\r\n this.gl.uniform4i(this.gl.getUniformLocation(program, name), x, y, z, w);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the value of a 2x2 matrix uniform variable in the given WebGLProgram.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setMatrix2\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {boolean} transpose - The value indicating whether to transpose the matrix. Must be false.\r\n * @param {Float32Array} matrix - The new matrix value.\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n setMatrix2: function (program, name, transpose, matrix)\r\n {\r\n this.setProgram(program);\r\n\r\n this.gl.uniformMatrix2fv(this.gl.getUniformLocation(program, name), transpose, matrix);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setMatrix3\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {boolean} transpose - [description]\r\n * @param {Float32Array} matrix - [description]\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n setMatrix3: function (program, name, transpose, matrix)\r\n {\r\n this.setProgram(program);\r\n\r\n this.gl.uniformMatrix3fv(this.gl.getUniformLocation(program, name), transpose, matrix);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets uniform of a WebGLProgram\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#setMatrix4\r\n * @since 3.0.0\r\n *\r\n * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up.\r\n * @param {string} name - The name of the uniform to look-up and modify.\r\n * @param {boolean} transpose - Is the matrix transposed\r\n * @param {Float32Array} matrix - Matrix data\r\n *\r\n * @return {this} This WebGL Renderer instance.\r\n */\r\n setMatrix4: function (program, name, transpose, matrix)\r\n {\r\n this.setProgram(program);\r\n\r\n this.gl.uniformMatrix4fv(this.gl.getUniformLocation(program, name), transpose, matrix);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns the maximum number of texture units that can be used in a fragment shader.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#getMaxTextures\r\n * @since 3.8.0\r\n *\r\n * @return {integer} The maximum number of textures WebGL supports.\r\n */\r\n getMaxTextures: function ()\r\n {\r\n return this.config.maxTextures;\r\n },\r\n\r\n /**\r\n * Returns the largest texture size (either width or height) that can be created.\r\n * Note that VRAM may not allow a texture of any given size, it just expresses\r\n * hardware / driver support for a given size.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#getMaxTextureSize\r\n * @since 3.8.0\r\n *\r\n * @return {integer} The maximum supported texture size.\r\n */\r\n getMaxTextureSize: function ()\r\n {\r\n return this.config.maxTextureSize;\r\n },\r\n\r\n /**\r\n * Destroy this WebGLRenderer, cleaning up all related resources such as pipelines, native textures, etc.\r\n *\r\n * @method Phaser.Renderer.WebGL.WebGLRenderer#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n // Clear-up anything that should be cleared :)\r\n\r\n for (var i = 0; i < this.nativeTextures.length; i++)\r\n {\r\n this.gl.deleteTexture(this.nativeTextures[i]);\r\n }\r\n\r\n this.nativeTextures = [];\r\n\r\n for (var key in this.pipelines)\r\n {\r\n this.pipelines[key].destroy();\r\n\r\n delete this.pipelines[key];\r\n }\r\n\r\n this.defaultCamera.destroy();\r\n\r\n this.currentMask = null;\r\n this.currentCameraMask = null;\r\n\r\n this.canvas.removeEventListener('webglcontextlost', this.contextLostHandler, false);\r\n this.canvas.removeEventListener('webglcontextrestored', this.contextRestoredHandler, false);\r\n\r\n this.game = null;\r\n this.gl = null;\r\n this.canvas = null;\r\n\r\n this.maskStack = [];\r\n\r\n this.contextLost = true;\r\n\r\n this.extensions = {};\r\n }\r\n\r\n});\r\n\r\nmodule.exports = WebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/webgl/WebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/webgl/index.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/renderer/webgl/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Renderer.WebGL\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Utils: __webpack_require__(/*! ./Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\"),\r\n WebGLPipeline: __webpack_require__(/*! ./WebGLPipeline */ \"./node_modules/phaser/src/renderer/webgl/WebGLPipeline.js\"),\r\n WebGLRenderer: __webpack_require__(/*! ./WebGLRenderer */ \"./node_modules/phaser/src/renderer/webgl/WebGLRenderer.js\"),\r\n Pipelines: __webpack_require__(/*! ./pipelines */ \"./node_modules/phaser/src/renderer/webgl/pipelines/index.js\"),\r\n\r\n // Constants\r\n BYTE: 0,\r\n SHORT: 1,\r\n UNSIGNED_BYTE: 2,\r\n UNSIGNED_SHORT: 3,\r\n FLOAT: 4\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/webgl/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/webgl/pipelines/BitmapMaskPipeline.js": /*!********************************************************************************!*\ !*** ./node_modules/phaser/src/renderer/webgl/pipelines/BitmapMaskPipeline.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar ShaderSourceFS = __webpack_require__(/*! ../shaders/BitmapMask-frag.js */ \"./node_modules/phaser/src/renderer/webgl/shaders/BitmapMask-frag.js\");\r\nvar ShaderSourceVS = __webpack_require__(/*! ../shaders/BitmapMask-vert.js */ \"./node_modules/phaser/src/renderer/webgl/shaders/BitmapMask-vert.js\");\r\nvar WebGLPipeline = __webpack_require__(/*! ../WebGLPipeline */ \"./node_modules/phaser/src/renderer/webgl/WebGLPipeline.js\");\r\n\r\n/**\r\n * @classdesc\r\n * BitmapMaskPipeline handles all bitmap masking rendering in WebGL. It works by using \r\n * sampling two texture on the fragment shader and using the fragment's alpha to clip the region.\r\n * The config properties are:\r\n * - game: Current game instance.\r\n * - renderer: Current WebGL renderer.\r\n * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES.\r\n * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants).\r\n * - vertShader: Source for vertex shader as a string.\r\n * - fragShader: Source for fragment shader as a string.\r\n * - vertexCapacity: The amount of vertices that shall be allocated\r\n * - vertexSize: The size of a single vertex in bytes.\r\n *\r\n * @class BitmapMaskPipeline\r\n * @extends Phaser.Renderer.WebGL.WebGLPipeline\r\n * @memberof Phaser.Renderer.WebGL.Pipelines\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - Used for overriding shader an pipeline properties if extending this pipeline.\r\n */\r\nvar BitmapMaskPipeline = new Class({\r\n\r\n Extends: WebGLPipeline,\r\n \r\n initialize:\r\n\r\n function BitmapMaskPipeline (config)\r\n {\r\n WebGLPipeline.call(this, {\r\n game: config.game,\r\n renderer: config.renderer,\r\n gl: config.renderer.gl,\r\n topology: (config.topology ? config.topology : config.renderer.gl.TRIANGLES),\r\n vertShader: (config.vertShader ? config.vertShader : ShaderSourceVS),\r\n fragShader: (config.fragShader ? config.fragShader : ShaderSourceFS),\r\n vertexCapacity: (config.vertexCapacity ? config.vertexCapacity : 3),\r\n\r\n vertexSize: (config.vertexSize ? config.vertexSize :\r\n Float32Array.BYTES_PER_ELEMENT * 2),\r\n\r\n vertices: new Float32Array([\r\n -1, +1, -1, -7, +7, +1\r\n ]).buffer,\r\n\r\n attributes: [\r\n {\r\n name: 'inPosition',\r\n size: 2,\r\n type: config.renderer.gl.FLOAT,\r\n normalized: false,\r\n offset: 0\r\n }\r\n ]\r\n });\r\n\r\n /**\r\n * Float32 view of the array buffer containing the pipeline's vertices.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#vertexViewF32\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.vertexViewF32 = new Float32Array(this.vertexData);\r\n\r\n /**\r\n * Size of the batch.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#maxQuads\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.maxQuads = 1;\r\n\r\n /**\r\n * Dirty flag to check if resolution properties need to be updated on the \r\n * masking shader.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#resolutionDirty\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.resolutionDirty = true;\r\n },\r\n\r\n /**\r\n * Called every time the pipeline needs to be used.\r\n * It binds all necessary resources.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#onBind\r\n * @since 3.0.0\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n onBind: function ()\r\n {\r\n WebGLPipeline.prototype.onBind.call(this);\r\n\r\n var renderer = this.renderer;\r\n var program = this.program;\r\n \r\n if (this.resolutionDirty)\r\n {\r\n renderer.setFloat2(program, 'uResolution', this.width, this.height);\r\n renderer.setInt1(program, 'uMainSampler', 0);\r\n renderer.setInt1(program, 'uMaskSampler', 1);\r\n this.resolutionDirty = false;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * [description]\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#resize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - [description]\r\n * @param {number} height - [description]\r\n * @param {number} resolution - [description]\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n resize: function (width, height, resolution)\r\n {\r\n WebGLPipeline.prototype.resize.call(this, width, height, resolution);\r\n this.resolutionDirty = true;\r\n return this;\r\n },\r\n\r\n /**\r\n * Binds necessary resources and renders the mask to a separated framebuffer.\r\n * The framebuffer for the masked object is also bound for further use.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#beginMask\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} mask - GameObject used as mask.\r\n * @param {Phaser.GameObjects.GameObject} maskedObject - GameObject masked by the mask GameObject.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - [description]\r\n */\r\n beginMask: function (mask, maskedObject, camera)\r\n {\r\n var renderer = this.renderer;\r\n var gl = this.gl;\r\n\r\n // The renderable Game Object that is being used for the bitmap mask\r\n var bitmapMask = mask.bitmapMask;\r\n\r\n if (bitmapMask && gl)\r\n {\r\n renderer.flush();\r\n\r\n mask.prevFramebuffer = renderer.currentFramebuffer;\r\n\r\n renderer.setFramebuffer(mask.mainFramebuffer);\r\n\r\n gl.disable(gl.STENCIL_TEST);\r\n\r\n gl.clearColor(0, 0, 0, 0);\r\n\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n\r\n if (renderer.currentCameraMask.mask !== mask)\r\n {\r\n renderer.currentMask.mask = mask;\r\n renderer.currentMask.camera = camera;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * The masked game objects framebuffer is unbound and its texture \r\n * is bound together with the mask texture and the mask shader and \r\n * a draw call with a single quad is processed. Here is where the\r\n * masking effect is applied. \r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#endMask\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} mask - GameObject used as a mask.\r\n */\r\n endMask: function (mask, camera)\r\n {\r\n var gl = this.gl;\r\n var renderer = this.renderer;\r\n\r\n // The renderable Game Object that is being used for the bitmap mask\r\n var bitmapMask = mask.bitmapMask;\r\n\r\n if (bitmapMask && gl)\r\n {\r\n renderer.flush();\r\n\r\n // First we draw the mask to the mask fb\r\n renderer.setFramebuffer(mask.maskFramebuffer);\r\n\r\n gl.clearColor(0, 0, 0, 0);\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n\r\n renderer.setBlendMode(0, true);\r\n\r\n bitmapMask.renderWebGL(renderer, bitmapMask, 0, camera);\r\n\r\n renderer.flush();\r\n\r\n renderer.setFramebuffer(mask.prevFramebuffer);\r\n\r\n // Is there a stencil further up the stack?\r\n var prev = renderer.getCurrentStencilMask();\r\n\r\n if (prev)\r\n {\r\n gl.enable(gl.STENCIL_TEST);\r\n\r\n prev.mask.applyStencil(renderer, prev.camera, true);\r\n }\r\n else\r\n {\r\n renderer.currentMask.mask = null;\r\n }\r\n\r\n // Bind bitmap mask pipeline and draw\r\n renderer.setPipeline(this);\r\n\r\n gl.activeTexture(gl.TEXTURE1);\r\n gl.bindTexture(gl.TEXTURE_2D, mask.maskTexture);\r\n\r\n gl.activeTexture(gl.TEXTURE0);\r\n gl.bindTexture(gl.TEXTURE_2D, mask.mainTexture);\r\n\r\n gl.uniform1i(gl.getUniformLocation(this.program, 'uInvertMaskAlpha'), mask.invertAlpha);\r\n\r\n // Finally, draw a triangle filling the whole screen\r\n gl.drawArrays(this.topology, 0, 3);\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = BitmapMaskPipeline;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/webgl/pipelines/BitmapMaskPipeline.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/webgl/pipelines/ForwardDiffuseLightPipeline.js": /*!*****************************************************************************************!*\ !*** ./node_modules/phaser/src/renderer/webgl/pipelines/ForwardDiffuseLightPipeline.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar ShaderSourceFS = __webpack_require__(/*! ../shaders/ForwardDiffuse-frag.js */ \"./node_modules/phaser/src/renderer/webgl/shaders/ForwardDiffuse-frag.js\");\r\nvar TextureTintPipeline = __webpack_require__(/*! ./TextureTintPipeline */ \"./node_modules/phaser/src/renderer/webgl/pipelines/TextureTintPipeline.js\");\r\n\r\nvar LIGHT_COUNT = 10;\r\n\r\n/**\r\n * @classdesc\r\n * ForwardDiffuseLightPipeline implements a forward rendering approach for 2D lights.\r\n * This pipeline extends TextureTintPipeline so it implements all it's rendering functions\r\n * and batching system.\r\n *\r\n * @class ForwardDiffuseLightPipeline\r\n * @extends Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline\r\n * @memberof Phaser.Renderer.WebGL.Pipelines\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - The configuration of the pipeline, same as the {@link Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline}. The fragment shader will be replaced with the lighting shader.\r\n */\r\nvar ForwardDiffuseLightPipeline = new Class({\r\n\r\n Extends: TextureTintPipeline,\r\n\r\n initialize:\r\n\r\n function ForwardDiffuseLightPipeline (config)\r\n {\r\n LIGHT_COUNT = config.maxLights;\r\n\r\n config.fragShader = ShaderSourceFS.replace('%LIGHT_COUNT%', LIGHT_COUNT.toString());\r\n\r\n TextureTintPipeline.call(this, config);\r\n\r\n /**\r\n * Default normal map texture to use.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#defaultNormalMap\r\n * @type {Phaser.Texture.Frame}\r\n * @private\r\n * @since 3.11.0\r\n */\r\n this.defaultNormalMap;\r\n\r\n /**\r\n * Inverse rotation matrix for normal map rotations.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#inverseRotationMatrix\r\n * @type {Float32Array}\r\n * @private\r\n * @since 3.16.0\r\n */\r\n this.inverseRotationMatrix = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1\r\n ]);\r\n },\r\n\r\n /**\r\n * Called when the Game has fully booted and the Renderer has finished setting up.\r\n * \r\n * By this stage all Game level systems are now in place and you can perform any final\r\n * tasks that the pipeline may need that relied on game systems such as the Texture Manager.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#boot\r\n * @override\r\n * @since 3.11.0\r\n */\r\n boot: function ()\r\n {\r\n this.defaultNormalMap = this.game.textures.getFrame('__DEFAULT');\r\n },\r\n\r\n /**\r\n * This function binds its base class resources and this lights 2D resources.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#onBind\r\n * @override\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n onBind: function (gameObject)\r\n {\r\n TextureTintPipeline.prototype.onBind.call(this);\r\n\r\n var renderer = this.renderer;\r\n var program = this.program;\r\n\r\n this.mvpUpdate();\r\n\r\n renderer.setInt1(program, 'uNormSampler', 1);\r\n renderer.setFloat2(program, 'uResolution', this.width, this.height);\r\n\r\n if (gameObject)\r\n {\r\n this.setNormalMap(gameObject);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * This function sets all the needed resources for each camera pass.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#onRender\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene being rendered.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered with.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n onRender: function (scene, camera)\r\n {\r\n this.active = false;\r\n\r\n var lightManager = scene.sys.lights;\r\n\r\n if (!lightManager || lightManager.lights.length <= 0 || !lightManager.active)\r\n {\r\n // Passthru\r\n return this;\r\n }\r\n\r\n var lights = lightManager.cull(camera);\r\n var lightCount = Math.min(lights.length, LIGHT_COUNT);\r\n\r\n if (lightCount === 0)\r\n {\r\n return this;\r\n }\r\n\r\n this.active = true;\r\n\r\n var renderer = this.renderer;\r\n var program = this.program;\r\n var cameraMatrix = camera.matrix;\r\n var point = {x: 0, y: 0};\r\n var height = renderer.height;\r\n var index;\r\n\r\n for (index = 0; index < LIGHT_COUNT; ++index)\r\n {\r\n // Reset lights\r\n renderer.setFloat1(program, 'uLights[' + index + '].radius', 0);\r\n }\r\n\r\n renderer.setFloat4(program, 'uCamera', camera.x, camera.y, camera.rotation, camera.zoom);\r\n renderer.setFloat3(program, 'uAmbientLightColor', lightManager.ambientColor.r, lightManager.ambientColor.g, lightManager.ambientColor.b);\r\n\r\n for (index = 0; index < lightCount; ++index)\r\n {\r\n var light = lights[index];\r\n var lightName = 'uLights[' + index + '].';\r\n\r\n cameraMatrix.transformPoint(light.x, light.y, point);\r\n\r\n renderer.setFloat2(program, lightName + 'position', point.x - (camera.scrollX * light.scrollFactorX * camera.zoom), height - (point.y - (camera.scrollY * light.scrollFactorY) * camera.zoom));\r\n renderer.setFloat3(program, lightName + 'color', light.r, light.g, light.b);\r\n renderer.setFloat1(program, lightName + 'intensity', light.intensity);\r\n renderer.setFloat1(program, lightName + 'radius', light.radius);\r\n }\r\n\r\n this.currentNormalMapRotation = null;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generic function for batching a textured quad\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#batchTexture\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - Source GameObject\r\n * @param {WebGLTexture} texture - Raw WebGLTexture associated with the quad\r\n * @param {integer} textureWidth - Real texture width\r\n * @param {integer} textureHeight - Real texture height\r\n * @param {number} srcX - X coordinate of the quad\r\n * @param {number} srcY - Y coordinate of the quad\r\n * @param {number} srcWidth - Width of the quad\r\n * @param {number} srcHeight - Height of the quad\r\n * @param {number} scaleX - X component of scale\r\n * @param {number} scaleY - Y component of scale\r\n * @param {number} rotation - Rotation of the quad\r\n * @param {boolean} flipX - Indicates if the quad is horizontally flipped\r\n * @param {boolean} flipY - Indicates if the quad is vertically flipped\r\n * @param {number} scrollFactorX - By which factor is the quad affected by the camera horizontal scroll\r\n * @param {number} scrollFactorY - By which factor is the quad effected by the camera vertical scroll\r\n * @param {number} displayOriginX - Horizontal origin in pixels\r\n * @param {number} displayOriginY - Vertical origin in pixels\r\n * @param {number} frameX - X coordinate of the texture frame\r\n * @param {number} frameY - Y coordinate of the texture frame\r\n * @param {number} frameWidth - Width of the texture frame\r\n * @param {number} frameHeight - Height of the texture frame\r\n * @param {integer} tintTL - Tint for top left\r\n * @param {integer} tintTR - Tint for top right\r\n * @param {integer} tintBL - Tint for bottom left\r\n * @param {integer} tintBR - Tint for bottom right\r\n * @param {number} tintEffect - The tint effect (0 for additive, 1 for replacement)\r\n * @param {number} uOffset - Horizontal offset on texture coordinate\r\n * @param {number} vOffset - Vertical offset on texture coordinate\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - Current used camera\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - Parent container\r\n */\r\n batchTexture: function (\r\n gameObject,\r\n texture,\r\n textureWidth, textureHeight,\r\n srcX, srcY,\r\n srcWidth, srcHeight,\r\n scaleX, scaleY,\r\n rotation,\r\n flipX, flipY,\r\n scrollFactorX, scrollFactorY,\r\n displayOriginX, displayOriginY,\r\n frameX, frameY, frameWidth, frameHeight,\r\n tintTL, tintTR, tintBL, tintBR, tintEffect,\r\n uOffset, vOffset,\r\n camera,\r\n parentTransformMatrix)\r\n {\r\n if (!this.active)\r\n {\r\n return;\r\n }\r\n\r\n this.renderer.setPipeline(this);\r\n\r\n var normalTexture;\r\n\r\n if (gameObject.displayTexture)\r\n {\r\n normalTexture = gameObject.displayTexture.dataSource[gameObject.displayFrame.sourceIndex];\r\n }\r\n else if (gameObject.texture)\r\n {\r\n normalTexture = gameObject.texture.dataSource[gameObject.frame.sourceIndex];\r\n }\r\n else if (gameObject.tileset)\r\n {\r\n if (Array.isArray(gameObject.tileset))\r\n {\r\n normalTexture = gameObject.tileset[0].image.dataSource[0];\r\n }\r\n else\r\n {\r\n normalTexture = gameObject.tileset.image.dataSource[0];\r\n }\r\n }\r\n\r\n if (!normalTexture)\r\n {\r\n console.warn('Normal map missing or invalid');\r\n return;\r\n }\r\n\r\n this.setTexture2D(normalTexture.glTexture, 1);\r\n this.setNormalMapRotation(rotation);\r\n\r\n var camMatrix = this._tempMatrix1;\r\n var spriteMatrix = this._tempMatrix2;\r\n var calcMatrix = this._tempMatrix3;\r\n\r\n var u0 = (frameX / textureWidth) + uOffset;\r\n var v0 = (frameY / textureHeight) + vOffset;\r\n var u1 = (frameX + frameWidth) / textureWidth + uOffset;\r\n var v1 = (frameY + frameHeight) / textureHeight + vOffset;\r\n\r\n var width = srcWidth;\r\n var height = srcHeight;\r\n\r\n // var x = -displayOriginX + frameX;\r\n // var y = -displayOriginY + frameY;\r\n\r\n var x = -displayOriginX;\r\n var y = -displayOriginY;\r\n\r\n if (gameObject.isCropped)\r\n {\r\n var crop = gameObject._crop;\r\n\r\n width = crop.width;\r\n height = crop.height;\r\n\r\n srcWidth = crop.width;\r\n srcHeight = crop.height;\r\n\r\n frameX = crop.x;\r\n frameY = crop.y;\r\n\r\n var ox = frameX;\r\n var oy = frameY;\r\n\r\n if (flipX)\r\n {\r\n ox = (frameWidth - crop.x - crop.width);\r\n }\r\n \r\n if (flipY && !texture.isRenderTexture)\r\n {\r\n oy = (frameHeight - crop.y - crop.height);\r\n }\r\n\r\n u0 = (ox / textureWidth) + uOffset;\r\n v0 = (oy / textureHeight) + vOffset;\r\n u1 = (ox + crop.width) / textureWidth + uOffset;\r\n v1 = (oy + crop.height) / textureHeight + vOffset;\r\n\r\n x = -displayOriginX + frameX;\r\n y = -displayOriginY + frameY;\r\n }\r\n\r\n // Invert the flipY if this is a RenderTexture\r\n flipY = flipY ^ (texture.isRenderTexture ? 1 : 0);\r\n\r\n if (flipX)\r\n {\r\n width *= -1;\r\n x += srcWidth;\r\n }\r\n\r\n if (flipY)\r\n {\r\n height *= -1;\r\n y += srcHeight;\r\n }\r\n\r\n // Do we need this? (doubt it)\r\n // if (camera.roundPixels)\r\n // {\r\n // x |= 0;\r\n // y |= 0;\r\n // }\r\n\r\n var xw = x + width;\r\n var yh = y + height;\r\n\r\n spriteMatrix.applyITRS(srcX, srcY, rotation, scaleX, scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentTransformMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * scrollFactorX, -camera.scrollY * scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n spriteMatrix.e = srcX;\r\n spriteMatrix.f = srcY;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n spriteMatrix.e -= camera.scrollX * scrollFactorX;\r\n spriteMatrix.f -= camera.scrollY * scrollFactorY;\r\n \r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n\r\n var tx0 = calcMatrix.getX(x, y);\r\n var ty0 = calcMatrix.getY(x, y);\r\n\r\n var tx1 = calcMatrix.getX(x, yh);\r\n var ty1 = calcMatrix.getY(x, yh);\r\n\r\n var tx2 = calcMatrix.getX(xw, yh);\r\n var ty2 = calcMatrix.getY(xw, yh);\r\n\r\n var tx3 = calcMatrix.getX(xw, y);\r\n var ty3 = calcMatrix.getY(xw, y);\r\n\r\n if (camera.roundPixels)\r\n {\r\n tx0 = Math.round(tx0);\r\n ty0 = Math.round(ty0);\r\n\r\n tx1 = Math.round(tx1);\r\n ty1 = Math.round(ty1);\r\n\r\n tx2 = Math.round(tx2);\r\n ty2 = Math.round(ty2);\r\n\r\n tx3 = Math.round(tx3);\r\n ty3 = Math.round(ty3);\r\n }\r\n\r\n this.setTexture2D(texture, 0);\r\n\r\n this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, 0);\r\n },\r\n\r\n /**\r\n * Sets the Game Objects normal map as the active texture.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#setNormalMap\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to update.\r\n */\r\n setNormalMap: function (gameObject)\r\n {\r\n if (!this.active || !gameObject)\r\n {\r\n return;\r\n }\r\n\r\n var normalTexture;\r\n\r\n if (gameObject.texture)\r\n {\r\n normalTexture = gameObject.texture.dataSource[gameObject.frame.sourceIndex];\r\n }\r\n\r\n if (!normalTexture)\r\n {\r\n normalTexture = this.defaultNormalMap;\r\n }\r\n\r\n this.setTexture2D(normalTexture.glTexture, 1);\r\n\r\n this.renderer.setPipeline(gameObject.defaultPipeline);\r\n },\r\n\r\n /**\r\n * Rotates the normal map vectors inversely by the given angle.\r\n * Only works in 2D space.\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#setNormalMapRotation\r\n * @since 3.16.0\r\n * \r\n * @param {number} rotation - The angle of rotation in radians.\r\n */\r\n setNormalMapRotation: function (rotation)\r\n {\r\n if (rotation !== this.currentNormalMapRotation || this.batches.length === 0)\r\n {\r\n if (this.batches.length > 0)\r\n {\r\n this.flush();\r\n }\r\n\r\n var inverseRotationMatrix = this.inverseRotationMatrix;\r\n\r\n if (rotation)\r\n {\r\n var rot = -rotation;\r\n var c = Math.cos(rot);\r\n var s = Math.sin(rot);\r\n\r\n inverseRotationMatrix[1] = s;\r\n inverseRotationMatrix[3] = -s;\r\n inverseRotationMatrix[0] = inverseRotationMatrix[4] = c;\r\n }\r\n else\r\n {\r\n inverseRotationMatrix[0] = inverseRotationMatrix[4] = 1;\r\n inverseRotationMatrix[1] = inverseRotationMatrix[3] = 0;\r\n }\r\n\r\n this.renderer.setMatrix3(this.program, 'uInverseRotationMatrix', false, inverseRotationMatrix);\r\n\r\n this.currentNormalMapRotation = rotation;\r\n }\r\n },\r\n\r\n /**\r\n * Takes a Sprite Game Object, or any object that extends it, which has a normal texture and adds it to the batch.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#batchSprite\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Sprite} sprite - The texture-based Game Object to add to the batch.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the rendering transform.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - The transform matrix of the parent container, if set.\r\n */\r\n batchSprite: function (sprite, camera, parentTransformMatrix)\r\n {\r\n if (!this.active)\r\n {\r\n return;\r\n }\r\n\r\n var normalTexture = sprite.texture.dataSource[sprite.frame.sourceIndex];\r\n\r\n if (normalTexture)\r\n {\r\n this.renderer.setPipeline(this);\r\n\r\n this.setTexture2D(normalTexture.glTexture, 1);\r\n this.setNormalMapRotation(sprite.rotation);\r\n\r\n TextureTintPipeline.prototype.batchSprite.call(this, sprite, camera, parentTransformMatrix);\r\n }\r\n }\r\n\r\n});\r\n\r\nForwardDiffuseLightPipeline.LIGHT_COUNT = LIGHT_COUNT;\r\n\r\nmodule.exports = ForwardDiffuseLightPipeline;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/webgl/pipelines/ForwardDiffuseLightPipeline.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/webgl/pipelines/TextureTintPipeline.js": /*!*********************************************************************************!*\ !*** ./node_modules/phaser/src/renderer/webgl/pipelines/TextureTintPipeline.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Earcut = __webpack_require__(/*! ../../../geom/polygon/Earcut */ \"./node_modules/phaser/src/geom/polygon/Earcut.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar ModelViewProjection = __webpack_require__(/*! ./components/ModelViewProjection */ \"./node_modules/phaser/src/renderer/webgl/pipelines/components/ModelViewProjection.js\");\r\nvar ShaderSourceFS = __webpack_require__(/*! ../shaders/TextureTint-frag.js */ \"./node_modules/phaser/src/renderer/webgl/shaders/TextureTint-frag.js\");\r\nvar ShaderSourceVS = __webpack_require__(/*! ../shaders/TextureTint-vert.js */ \"./node_modules/phaser/src/renderer/webgl/shaders/TextureTint-vert.js\");\r\nvar TransformMatrix = __webpack_require__(/*! ../../../gameobjects/components/TransformMatrix */ \"./node_modules/phaser/src/gameobjects/components/TransformMatrix.js\");\r\nvar Utils = __webpack_require__(/*! ../Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\nvar WebGLPipeline = __webpack_require__(/*! ../WebGLPipeline */ \"./node_modules/phaser/src/renderer/webgl/WebGLPipeline.js\");\r\n\r\n/**\r\n * @classdesc\r\n * TextureTintPipeline implements the rendering infrastructure\r\n * for displaying textured objects\r\n * The config properties are:\r\n * - game: Current game instance.\r\n * - renderer: Current WebGL renderer.\r\n * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES.\r\n * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants).\r\n * - vertShader: Source for vertex shader as a string.\r\n * - fragShader: Source for fragment shader as a string.\r\n * - vertexCapacity: The amount of vertices that shall be allocated\r\n * - vertexSize: The size of a single vertex in bytes.\r\n *\r\n * @class TextureTintPipeline\r\n * @extends Phaser.Renderer.WebGL.WebGLPipeline\r\n * @memberof Phaser.Renderer.WebGL.Pipelines\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - The configuration options for this Texture Tint Pipeline, as described above.\r\n */\r\nvar TextureTintPipeline = new Class({\r\n\r\n Extends: WebGLPipeline,\r\n\r\n Mixins: [\r\n ModelViewProjection\r\n ],\r\n\r\n initialize:\r\n\r\n function TextureTintPipeline (config)\r\n {\r\n var rendererConfig = config.renderer.config;\r\n\r\n // Vertex Size = attribute size added together (2 + 2 + 1 + 4)\r\n\r\n WebGLPipeline.call(this, {\r\n game: config.game,\r\n renderer: config.renderer,\r\n gl: config.renderer.gl,\r\n topology: GetFastValue(config, 'topology', config.renderer.gl.TRIANGLES),\r\n vertShader: GetFastValue(config, 'vertShader', ShaderSourceVS),\r\n fragShader: GetFastValue(config, 'fragShader', ShaderSourceFS),\r\n vertexCapacity: GetFastValue(config, 'vertexCapacity', 6 * rendererConfig.batchSize),\r\n vertexSize: GetFastValue(config, 'vertexSize', Float32Array.BYTES_PER_ELEMENT * 5 + Uint8Array.BYTES_PER_ELEMENT * 4),\r\n attributes: [\r\n {\r\n name: 'inPosition',\r\n size: 2,\r\n type: config.renderer.gl.FLOAT,\r\n normalized: false,\r\n offset: 0\r\n },\r\n {\r\n name: 'inTexCoord',\r\n size: 2,\r\n type: config.renderer.gl.FLOAT,\r\n normalized: false,\r\n offset: Float32Array.BYTES_PER_ELEMENT * 2\r\n },\r\n {\r\n name: 'inTintEffect',\r\n size: 1,\r\n type: config.renderer.gl.FLOAT,\r\n normalized: false,\r\n offset: Float32Array.BYTES_PER_ELEMENT * 4\r\n },\r\n {\r\n name: 'inTint',\r\n size: 4,\r\n type: config.renderer.gl.UNSIGNED_BYTE,\r\n normalized: true,\r\n offset: Float32Array.BYTES_PER_ELEMENT * 5\r\n }\r\n ]\r\n });\r\n\r\n /**\r\n * Float32 view of the array buffer containing the pipeline's vertices.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#vertexViewF32\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.vertexViewF32 = new Float32Array(this.vertexData);\r\n\r\n /**\r\n * Uint32 view of the array buffer containing the pipeline's vertices.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#vertexViewU32\r\n * @type {Uint32Array}\r\n * @since 3.0.0\r\n */\r\n this.vertexViewU32 = new Uint32Array(this.vertexData);\r\n\r\n /**\r\n * Size of the batch.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#maxQuads\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.maxQuads = rendererConfig.batchSize;\r\n\r\n /**\r\n * Collection of batch information\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batches\r\n * @type {array}\r\n * @since 3.1.0\r\n */\r\n this.batches = [];\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#_tempMatrix1\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.11.0\r\n */\r\n this._tempMatrix1 = new TransformMatrix();\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#_tempMatrix2\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.11.0\r\n */\r\n this._tempMatrix2 = new TransformMatrix();\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#_tempMatrix3\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.11.0\r\n */\r\n this._tempMatrix3 = new TransformMatrix();\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#_tempMatrix4\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.11.0\r\n */\r\n this._tempMatrix4 = new TransformMatrix();\r\n\r\n /**\r\n * Used internally to draw stroked triangles.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#tempTriangle\r\n * @type {array}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this.tempTriangle = [\r\n { x: 0, y: 0, width: 0 },\r\n { x: 0, y: 0, width: 0 },\r\n { x: 0, y: 0, width: 0 },\r\n { x: 0, y: 0, width: 0 }\r\n ];\r\n\r\n /**\r\n * The tint effect to be applied by the shader in the next geometry draw:\r\n * \r\n * 0 = texture multiplied by color\r\n * 1 = solid color + texture alpha\r\n * 2 = solid color, no texture\r\n * 3 = solid texture, no color\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#tintEffect\r\n * @type {number}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this.tintEffect = 2;\r\n\r\n /**\r\n * Cached stroke tint.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#strokeTint\r\n * @type {object}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this.strokeTint = { TL: 0, TR: 0, BL: 0, BR: 0 };\r\n\r\n /**\r\n * Cached fill tint.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#fillTint\r\n * @type {object}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this.fillTint = { TL: 0, TR: 0, BL: 0, BR: 0 };\r\n\r\n /**\r\n * Internal texture frame reference.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#currentFrame\r\n * @type {Phaser.Textures.Frame}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this.currentFrame = { u0: 0, v0: 0, u1: 1, v1: 1 };\r\n\r\n /**\r\n * Internal path quad cache.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#firstQuad\r\n * @type {array}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this.firstQuad = [ 0, 0, 0, 0, 0 ];\r\n\r\n /**\r\n * Internal path quad cache.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#prevQuad\r\n * @type {array}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this.prevQuad = [ 0, 0, 0, 0, 0 ];\r\n\r\n /**\r\n * Used internally for triangulating a polygon.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#polygonCache\r\n * @type {array}\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this.polygonCache = [];\r\n\r\n this.mvpInit();\r\n },\r\n\r\n /**\r\n * Called every time the pipeline needs to be used.\r\n * It binds all necessary resources.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#onBind\r\n * @since 3.0.0\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n onBind: function ()\r\n {\r\n WebGLPipeline.prototype.onBind.call(this);\r\n\r\n this.mvpUpdate();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resizes this pipeline and updates the projection.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#resize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The new width.\r\n * @param {number} height - The new height.\r\n * @param {number} resolution - The resolution.\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n resize: function (width, height, resolution)\r\n {\r\n WebGLPipeline.prototype.resize.call(this, width, height, resolution);\r\n\r\n this.projOrtho(0, this.width, this.height, 0, -1000.0, 1000.0);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Assigns a texture to the current batch. If a different texture is already set it creates a new batch object.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#setTexture2D\r\n * @since 3.1.0\r\n *\r\n * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch. If not given uses blankTexture.\r\n * @param {integer} [unit=0] - Texture unit to which the texture needs to be bound.\r\n *\r\n * @return {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} This pipeline instance.\r\n */\r\n setTexture2D: function (texture, unit)\r\n {\r\n if (texture === undefined) { texture = this.renderer.blankTexture.glTexture; }\r\n if (unit === undefined) { unit = 0; }\r\n\r\n if (this.requireTextureBatch(texture, unit))\r\n {\r\n this.pushBatch(texture, unit);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Checks if the current batch has the same texture and texture unit, or if we need to create a new batch.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#requireTextureBatch\r\n * @since 3.16.0\r\n *\r\n * @param {WebGLTexture} texture - WebGLTexture that will be assigned to the current batch. If not given uses blankTexture.\r\n * @param {integer} unit - Texture unit to which the texture needs to be bound.\r\n *\r\n * @return {boolean} `true` if the pipeline needs to create a new batch, otherwise `false`.\r\n */\r\n requireTextureBatch: function (texture, unit)\r\n {\r\n var batches = this.batches;\r\n var batchLength = batches.length;\r\n\r\n if (batchLength > 0)\r\n {\r\n // If Texture Unit specified, we get the texture from the textures array, otherwise we use the texture property\r\n var currentTexture = (unit > 0) ? batches[batchLength - 1].textures[unit - 1] : batches[batchLength - 1].texture;\r\n\r\n return !(currentTexture === texture);\r\n }\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Creates a new batch object and pushes it to a batch array.\r\n * The batch object contains information relevant to the current \r\n * vertex batch like the offset in the vertex buffer, vertex count and \r\n * the textures used by that batch.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#pushBatch\r\n * @since 3.1.0\r\n * \r\n * @param {WebGLTexture} texture - Optional WebGLTexture that will be assigned to the created batch.\r\n * @param {integer} unit - Texture unit to which the texture needs to be bound.\r\n */\r\n pushBatch: function (texture, unit)\r\n {\r\n if (unit === 0)\r\n {\r\n this.batches.push({\r\n first: this.vertexCount,\r\n texture: texture,\r\n textures: []\r\n });\r\n }\r\n else\r\n {\r\n var textures = [];\r\n\r\n textures[unit - 1] = texture;\r\n\r\n this.batches.push({\r\n first: this.vertexCount,\r\n texture: null,\r\n textures: textures\r\n });\r\n }\r\n },\r\n\r\n /**\r\n * Uploads the vertex data and emits a draw call for the current batch of vertices.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#flush\r\n * @since 3.0.0\r\n *\r\n * @return {this} This WebGLPipeline instance.\r\n */\r\n flush: function ()\r\n {\r\n if (this.flushLocked)\r\n {\r\n return this;\r\n }\r\n\r\n this.flushLocked = true;\r\n\r\n var gl = this.gl;\r\n var vertexCount = this.vertexCount;\r\n var topology = this.topology;\r\n var vertexSize = this.vertexSize;\r\n var renderer = this.renderer;\r\n\r\n var batches = this.batches;\r\n var batchCount = batches.length;\r\n var batchVertexCount = 0;\r\n var batch = null;\r\n var batchNext;\r\n var textureIndex;\r\n var nTexture;\r\n\r\n if (batchCount === 0 || vertexCount === 0)\r\n {\r\n this.flushLocked = false;\r\n\r\n return this;\r\n }\r\n\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize));\r\n\r\n // Process the TEXTURE BATCHES\r\n\r\n for (var index = 0; index < batchCount - 1; index++)\r\n {\r\n batch = batches[index];\r\n batchNext = batches[index + 1];\r\n\r\n // Multi-texture check (for non-zero texture units)\r\n if (batch.textures.length > 0)\r\n {\r\n for (textureIndex = 0; textureIndex < batch.textures.length; ++textureIndex)\r\n {\r\n nTexture = batch.textures[textureIndex];\r\n\r\n if (nTexture)\r\n {\r\n renderer.setTexture2D(nTexture, 1 + textureIndex, false);\r\n }\r\n }\r\n\r\n gl.activeTexture(gl.TEXTURE0);\r\n }\r\n\r\n batchVertexCount = batchNext.first - batch.first;\r\n\r\n // Bail out if texture property is null (i.e. if a texture unit > 0)\r\n if (batch.texture === null || batchVertexCount <= 0)\r\n {\r\n continue;\r\n }\r\n\r\n renderer.setTexture2D(batch.texture, 0, false);\r\n\r\n gl.drawArrays(topology, batch.first, batchVertexCount);\r\n }\r\n\r\n // Left over data\r\n batch = batches[batchCount - 1];\r\n\r\n // Multi-texture check (for non-zero texture units)\r\n\r\n if (batch.textures.length > 0)\r\n {\r\n for (textureIndex = 0; textureIndex < batch.textures.length; ++textureIndex)\r\n {\r\n nTexture = batch.textures[textureIndex];\r\n\r\n if (nTexture)\r\n {\r\n renderer.setTexture2D(nTexture, 1 + textureIndex, false);\r\n }\r\n }\r\n\r\n gl.activeTexture(gl.TEXTURE0);\r\n }\r\n\r\n batchVertexCount = vertexCount - batch.first;\r\n\r\n if (batch.texture && batchVertexCount > 0)\r\n {\r\n renderer.setTexture2D(batch.texture, 0, false);\r\n\r\n gl.drawArrays(topology, batch.first, batchVertexCount);\r\n }\r\n\r\n this.vertexCount = 0;\r\n\r\n batches.length = 0;\r\n\r\n this.flushLocked = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes a Sprite Game Object, or any object that extends it, and adds it to the batch.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchSprite\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.GameObjects.Image|Phaser.GameObjects.Sprite)} sprite - The texture based Game Object to add to the batch.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the rendering transform.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - The transform matrix of the parent container, if set.\r\n */\r\n batchSprite: function (sprite, camera, parentTransformMatrix)\r\n {\r\n // Will cause a flush if there are batchSize entries already\r\n this.renderer.setPipeline(this);\r\n\r\n var camMatrix = this._tempMatrix1;\r\n var spriteMatrix = this._tempMatrix2;\r\n var calcMatrix = this._tempMatrix3;\r\n\r\n var frame = sprite.frame;\r\n var texture = frame.glTexture;\r\n\r\n var u0 = frame.u0;\r\n var v0 = frame.v0;\r\n var u1 = frame.u1;\r\n var v1 = frame.v1;\r\n var frameX = frame.x;\r\n var frameY = frame.y;\r\n var frameWidth = frame.cutWidth;\r\n var frameHeight = frame.cutHeight;\r\n var customPivot = frame.customPivot;\r\n\r\n var displayOriginX = sprite.displayOriginX;\r\n var displayOriginY = sprite.displayOriginY;\r\n\r\n var x = -displayOriginX + frameX;\r\n var y = -displayOriginY + frameY;\r\n\r\n if (sprite.isCropped)\r\n {\r\n var crop = sprite._crop;\r\n\r\n if (crop.flipX !== sprite.flipX || crop.flipY !== sprite.flipY)\r\n {\r\n frame.updateCropUVs(crop, sprite.flipX, sprite.flipY);\r\n }\r\n\r\n u0 = crop.u0;\r\n v0 = crop.v0;\r\n u1 = crop.u1;\r\n v1 = crop.v1;\r\n\r\n frameWidth = crop.width;\r\n frameHeight = crop.height;\r\n\r\n frameX = crop.x;\r\n frameY = crop.y;\r\n\r\n x = -displayOriginX + frameX;\r\n y = -displayOriginY + frameY;\r\n }\r\n\r\n var flipX = 1;\r\n var flipY = 1;\r\n\r\n if (sprite.flipX)\r\n {\r\n if (!customPivot)\r\n {\r\n x += (-frame.realWidth + (displayOriginX * 2));\r\n }\r\n\r\n flipX = -1;\r\n }\r\n\r\n // Auto-invert the flipY if this is coming from a GLTexture\r\n if (sprite.flipY || (frame.source.isGLTexture && !texture.flipY))\r\n {\r\n if (!customPivot)\r\n {\r\n y += (-frame.realHeight + (displayOriginY * 2));\r\n }\r\n\r\n flipY = -1;\r\n }\r\n\r\n spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX * flipX, sprite.scaleY * flipY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentTransformMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * sprite.scrollFactorX, -camera.scrollY * sprite.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n spriteMatrix.e = sprite.x;\r\n spriteMatrix.f = sprite.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n spriteMatrix.e -= camera.scrollX * sprite.scrollFactorX;\r\n spriteMatrix.f -= camera.scrollY * sprite.scrollFactorY;\r\n \r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n\r\n var xw = x + frameWidth;\r\n var yh = y + frameHeight;\r\n\r\n var tx0 = calcMatrix.getX(x, y);\r\n var ty0 = calcMatrix.getY(x, y);\r\n\r\n var tx1 = calcMatrix.getX(x, yh);\r\n var ty1 = calcMatrix.getY(x, yh);\r\n\r\n var tx2 = calcMatrix.getX(xw, yh);\r\n var ty2 = calcMatrix.getY(xw, yh);\r\n\r\n var tx3 = calcMatrix.getX(xw, y);\r\n var ty3 = calcMatrix.getY(xw, y);\r\n\r\n var tintTL = Utils.getTintAppendFloatAlpha(sprite._tintTL, camera.alpha * sprite._alphaTL);\r\n var tintTR = Utils.getTintAppendFloatAlpha(sprite._tintTR, camera.alpha * sprite._alphaTR);\r\n var tintBL = Utils.getTintAppendFloatAlpha(sprite._tintBL, camera.alpha * sprite._alphaBL);\r\n var tintBR = Utils.getTintAppendFloatAlpha(sprite._tintBR, camera.alpha * sprite._alphaBR);\r\n\r\n if (camera.roundPixels)\r\n {\r\n tx0 = Math.round(tx0);\r\n ty0 = Math.round(ty0);\r\n\r\n tx1 = Math.round(tx1);\r\n ty1 = Math.round(ty1);\r\n\r\n tx2 = Math.round(tx2);\r\n ty2 = Math.round(ty2);\r\n\r\n tx3 = Math.round(tx3);\r\n ty3 = Math.round(ty3);\r\n }\r\n\r\n this.setTexture2D(texture, 0);\r\n\r\n var tintEffect = (sprite._isTinted && sprite.tintFill);\r\n\r\n this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, 0);\r\n },\r\n\r\n /**\r\n * Adds the vertices data into the batch and flushes if full.\r\n * \r\n * Assumes 6 vertices in the following arrangement:\r\n * \r\n * ```\r\n * 0----3\r\n * |\\ B|\r\n * | \\ |\r\n * | \\ |\r\n * | A \\|\r\n * | \\\r\n * 1----2\r\n * ```\r\n * \r\n * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchQuad\r\n * @since 3.12.0\r\n *\r\n * @param {number} x0 - The top-left x position.\r\n * @param {number} y0 - The top-left y position.\r\n * @param {number} x1 - The bottom-left x position.\r\n * @param {number} y1 - The bottom-left y position.\r\n * @param {number} x2 - The bottom-right x position.\r\n * @param {number} y2 - The bottom-right y position.\r\n * @param {number} x3 - The top-right x position.\r\n * @param {number} y3 - The top-right y position.\r\n * @param {number} u0 - UV u0 value.\r\n * @param {number} v0 - UV v0 value.\r\n * @param {number} u1 - UV u1 value.\r\n * @param {number} v1 - UV v1 value.\r\n * @param {number} tintTL - The top-left tint color value.\r\n * @param {number} tintTR - The top-right tint color value.\r\n * @param {number} tintBL - The bottom-left tint color value.\r\n * @param {number} tintBR - The bottom-right tint color value.\r\n * @param {(number|boolean)} tintEffect - The tint effect for the shader to use.\r\n * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs.\r\n * @param {integer} [unit=0] - Texture unit to which the texture needs to be bound.\r\n * \r\n * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`.\r\n */\r\n batchQuad: function (x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit)\r\n {\r\n var hasFlushed = false;\r\n\r\n if (this.vertexCount + 6 > this.vertexCapacity)\r\n {\r\n this.flush();\r\n\r\n hasFlushed = true;\r\n\r\n this.setTexture2D(texture, unit);\r\n }\r\n\r\n var vertexViewF32 = this.vertexViewF32;\r\n var vertexViewU32 = this.vertexViewU32;\r\n\r\n var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1;\r\n \r\n vertexViewF32[++vertexOffset] = x0;\r\n vertexViewF32[++vertexOffset] = y0;\r\n vertexViewF32[++vertexOffset] = u0;\r\n vertexViewF32[++vertexOffset] = v0;\r\n vertexViewF32[++vertexOffset] = tintEffect;\r\n vertexViewU32[++vertexOffset] = tintTL;\r\n\r\n vertexViewF32[++vertexOffset] = x1;\r\n vertexViewF32[++vertexOffset] = y1;\r\n vertexViewF32[++vertexOffset] = u0;\r\n vertexViewF32[++vertexOffset] = v1;\r\n vertexViewF32[++vertexOffset] = tintEffect;\r\n vertexViewU32[++vertexOffset] = tintBL;\r\n\r\n vertexViewF32[++vertexOffset] = x2;\r\n vertexViewF32[++vertexOffset] = y2;\r\n vertexViewF32[++vertexOffset] = u1;\r\n vertexViewF32[++vertexOffset] = v1;\r\n vertexViewF32[++vertexOffset] = tintEffect;\r\n vertexViewU32[++vertexOffset] = tintBR;\r\n\r\n vertexViewF32[++vertexOffset] = x0;\r\n vertexViewF32[++vertexOffset] = y0;\r\n vertexViewF32[++vertexOffset] = u0;\r\n vertexViewF32[++vertexOffset] = v0;\r\n vertexViewF32[++vertexOffset] = tintEffect;\r\n vertexViewU32[++vertexOffset] = tintTL;\r\n\r\n vertexViewF32[++vertexOffset] = x2;\r\n vertexViewF32[++vertexOffset] = y2;\r\n vertexViewF32[++vertexOffset] = u1;\r\n vertexViewF32[++vertexOffset] = v1;\r\n vertexViewF32[++vertexOffset] = tintEffect;\r\n vertexViewU32[++vertexOffset] = tintBR;\r\n\r\n vertexViewF32[++vertexOffset] = x3;\r\n vertexViewF32[++vertexOffset] = y3;\r\n vertexViewF32[++vertexOffset] = u1;\r\n vertexViewF32[++vertexOffset] = v0;\r\n vertexViewF32[++vertexOffset] = tintEffect;\r\n vertexViewU32[++vertexOffset] = tintTR;\r\n\r\n this.vertexCount += 6;\r\n\r\n return hasFlushed;\r\n },\r\n\r\n /**\r\n * Adds the vertices data into the batch and flushes if full.\r\n * \r\n * Assumes 3 vertices in the following arrangement:\r\n * \r\n * ```\r\n * 0\r\n * |\\\r\n * | \\\r\n * | \\\r\n * | \\\r\n * | \\\r\n * 1-----2\r\n * ```\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchTri\r\n * @since 3.12.0\r\n *\r\n * @param {number} x1 - The bottom-left x position.\r\n * @param {number} y1 - The bottom-left y position.\r\n * @param {number} x2 - The bottom-right x position.\r\n * @param {number} y2 - The bottom-right y position.\r\n * @param {number} x3 - The top-right x position.\r\n * @param {number} y3 - The top-right y position.\r\n * @param {number} u0 - UV u0 value.\r\n * @param {number} v0 - UV v0 value.\r\n * @param {number} u1 - UV u1 value.\r\n * @param {number} v1 - UV v1 value.\r\n * @param {number} tintTL - The top-left tint color value.\r\n * @param {number} tintTR - The top-right tint color value.\r\n * @param {number} tintBL - The bottom-left tint color value.\r\n * @param {(number|boolean)} tintEffect - The tint effect for the shader to use.\r\n * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs.\r\n * @param {integer} [unit=0] - Texture unit to which the texture needs to be bound.\r\n * \r\n * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`.\r\n */\r\n batchTri: function (x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect, texture, unit)\r\n {\r\n var hasFlushed = false;\r\n\r\n if (this.vertexCount + 3 > this.vertexCapacity)\r\n {\r\n this.flush();\r\n\r\n this.setTexture2D(texture, unit);\r\n\r\n hasFlushed = true;\r\n }\r\n\r\n var vertexViewF32 = this.vertexViewF32;\r\n var vertexViewU32 = this.vertexViewU32;\r\n\r\n var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1;\r\n\r\n vertexViewF32[++vertexOffset] = x1;\r\n vertexViewF32[++vertexOffset] = y1;\r\n vertexViewF32[++vertexOffset] = u0;\r\n vertexViewF32[++vertexOffset] = v0;\r\n vertexViewF32[++vertexOffset] = tintEffect;\r\n vertexViewU32[++vertexOffset] = tintTL;\r\n\r\n vertexViewF32[++vertexOffset] = x2;\r\n vertexViewF32[++vertexOffset] = y2;\r\n vertexViewF32[++vertexOffset] = u0;\r\n vertexViewF32[++vertexOffset] = v1;\r\n vertexViewF32[++vertexOffset] = tintEffect;\r\n vertexViewU32[++vertexOffset] = tintTR;\r\n\r\n vertexViewF32[++vertexOffset] = x3;\r\n vertexViewF32[++vertexOffset] = y3;\r\n vertexViewF32[++vertexOffset] = u1;\r\n vertexViewF32[++vertexOffset] = v1;\r\n vertexViewF32[++vertexOffset] = tintEffect;\r\n vertexViewU32[++vertexOffset] = tintBL;\r\n\r\n this.vertexCount += 3;\r\n\r\n return hasFlushed;\r\n },\r\n\r\n /**\r\n * Generic function for batching a textured quad using argument values instead of a Game Object.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchTexture\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - Source GameObject.\r\n * @param {WebGLTexture} texture - Raw WebGLTexture associated with the quad.\r\n * @param {integer} textureWidth - Real texture width.\r\n * @param {integer} textureHeight - Real texture height.\r\n * @param {number} srcX - X coordinate of the quad.\r\n * @param {number} srcY - Y coordinate of the quad.\r\n * @param {number} srcWidth - Width of the quad.\r\n * @param {number} srcHeight - Height of the quad.\r\n * @param {number} scaleX - X component of scale.\r\n * @param {number} scaleY - Y component of scale.\r\n * @param {number} rotation - Rotation of the quad.\r\n * @param {boolean} flipX - Indicates if the quad is horizontally flipped.\r\n * @param {boolean} flipY - Indicates if the quad is vertically flipped.\r\n * @param {number} scrollFactorX - By which factor is the quad affected by the camera horizontal scroll.\r\n * @param {number} scrollFactorY - By which factor is the quad effected by the camera vertical scroll.\r\n * @param {number} displayOriginX - Horizontal origin in pixels.\r\n * @param {number} displayOriginY - Vertical origin in pixels.\r\n * @param {number} frameX - X coordinate of the texture frame.\r\n * @param {number} frameY - Y coordinate of the texture frame.\r\n * @param {number} frameWidth - Width of the texture frame.\r\n * @param {number} frameHeight - Height of the texture frame.\r\n * @param {integer} tintTL - Tint for top left.\r\n * @param {integer} tintTR - Tint for top right.\r\n * @param {integer} tintBL - Tint for bottom left.\r\n * @param {integer} tintBR - Tint for bottom right.\r\n * @param {number} tintEffect - The tint effect.\r\n * @param {number} uOffset - Horizontal offset on texture coordinate.\r\n * @param {number} vOffset - Vertical offset on texture coordinate.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - Current used camera.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - Parent container.\r\n * @param {boolean} [skipFlip=false] - Skip the renderTexture check.\r\n */\r\n batchTexture: function (\r\n gameObject,\r\n texture,\r\n textureWidth, textureHeight,\r\n srcX, srcY,\r\n srcWidth, srcHeight,\r\n scaleX, scaleY,\r\n rotation,\r\n flipX, flipY,\r\n scrollFactorX, scrollFactorY,\r\n displayOriginX, displayOriginY,\r\n frameX, frameY, frameWidth, frameHeight,\r\n tintTL, tintTR, tintBL, tintBR, tintEffect,\r\n uOffset, vOffset,\r\n camera,\r\n parentTransformMatrix,\r\n skipFlip)\r\n {\r\n this.renderer.setPipeline(this, gameObject);\r\n\r\n var camMatrix = this._tempMatrix1;\r\n var spriteMatrix = this._tempMatrix2;\r\n var calcMatrix = this._tempMatrix3;\r\n\r\n var u0 = (frameX / textureWidth) + uOffset;\r\n var v0 = (frameY / textureHeight) + vOffset;\r\n var u1 = (frameX + frameWidth) / textureWidth + uOffset;\r\n var v1 = (frameY + frameHeight) / textureHeight + vOffset;\r\n\r\n var width = srcWidth;\r\n var height = srcHeight;\r\n\r\n var x = -displayOriginX;\r\n var y = -displayOriginY;\r\n\r\n if (gameObject.isCropped)\r\n {\r\n var crop = gameObject._crop;\r\n\r\n width = crop.width;\r\n height = crop.height;\r\n\r\n srcWidth = crop.width;\r\n srcHeight = crop.height;\r\n\r\n frameX = crop.x;\r\n frameY = crop.y;\r\n\r\n var ox = frameX;\r\n var oy = frameY;\r\n\r\n if (flipX)\r\n {\r\n ox = (frameWidth - crop.x - crop.width);\r\n }\r\n \r\n if (flipY && !texture.isRenderTexture)\r\n {\r\n oy = (frameHeight - crop.y - crop.height);\r\n }\r\n\r\n u0 = (ox / textureWidth) + uOffset;\r\n v0 = (oy / textureHeight) + vOffset;\r\n u1 = (ox + crop.width) / textureWidth + uOffset;\r\n v1 = (oy + crop.height) / textureHeight + vOffset;\r\n\r\n x = -displayOriginX + frameX;\r\n y = -displayOriginY + frameY;\r\n }\r\n\r\n // Invert the flipY if this is a RenderTexture\r\n flipY = flipY ^ (!skipFlip && texture.isRenderTexture ? 1 : 0);\r\n\r\n if (flipX)\r\n {\r\n width *= -1;\r\n x += srcWidth;\r\n }\r\n\r\n if (flipY)\r\n {\r\n height *= -1;\r\n y += srcHeight;\r\n }\r\n\r\n var xw = x + width;\r\n var yh = y + height;\r\n\r\n spriteMatrix.applyITRS(srcX, srcY, rotation, scaleX, scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentTransformMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * scrollFactorX, -camera.scrollY * scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n spriteMatrix.e = srcX;\r\n spriteMatrix.f = srcY;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n spriteMatrix.e -= camera.scrollX * scrollFactorX;\r\n spriteMatrix.f -= camera.scrollY * scrollFactorY;\r\n \r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n\r\n var tx0 = calcMatrix.getX(x, y);\r\n var ty0 = calcMatrix.getY(x, y);\r\n\r\n var tx1 = calcMatrix.getX(x, yh);\r\n var ty1 = calcMatrix.getY(x, yh);\r\n\r\n var tx2 = calcMatrix.getX(xw, yh);\r\n var ty2 = calcMatrix.getY(xw, yh);\r\n\r\n var tx3 = calcMatrix.getX(xw, y);\r\n var ty3 = calcMatrix.getY(xw, y);\r\n\r\n if (camera.roundPixels)\r\n {\r\n tx0 = Math.round(tx0);\r\n ty0 = Math.round(ty0);\r\n\r\n tx1 = Math.round(tx1);\r\n ty1 = Math.round(ty1);\r\n\r\n tx2 = Math.round(tx2);\r\n ty2 = Math.round(ty2);\r\n\r\n tx3 = Math.round(tx3);\r\n ty3 = Math.round(ty3);\r\n }\r\n\r\n this.setTexture2D(texture, 0);\r\n\r\n this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, 0);\r\n },\r\n\r\n /**\r\n * Adds a Texture Frame into the batch for rendering.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchTextureFrame\r\n * @since 3.12.0\r\n *\r\n * @param {Phaser.Textures.Frame} frame - The Texture Frame to be rendered.\r\n * @param {number} x - The horizontal position to render the texture at.\r\n * @param {number} y - The vertical position to render the texture at.\r\n * @param {number} tint - The tint color.\r\n * @param {number} alpha - The alpha value.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} transformMatrix - The Transform Matrix to use for the texture.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - A parent Transform Matrix.\r\n */\r\n batchTextureFrame: function (\r\n frame,\r\n x, y,\r\n tint, alpha,\r\n transformMatrix,\r\n parentTransformMatrix\r\n )\r\n {\r\n this.renderer.setPipeline(this);\r\n\r\n var spriteMatrix = this._tempMatrix1.copyFrom(transformMatrix);\r\n var calcMatrix = this._tempMatrix2;\r\n\r\n var xw = x + frame.width;\r\n var yh = y + frame.height;\r\n\r\n if (parentTransformMatrix)\r\n {\r\n spriteMatrix.multiply(parentTransformMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n calcMatrix = spriteMatrix;\r\n }\r\n\r\n var tx0 = calcMatrix.getX(x, y);\r\n var ty0 = calcMatrix.getY(x, y);\r\n\r\n var tx1 = calcMatrix.getX(x, yh);\r\n var ty1 = calcMatrix.getY(x, yh);\r\n\r\n var tx2 = calcMatrix.getX(xw, yh);\r\n var ty2 = calcMatrix.getY(xw, yh);\r\n\r\n var tx3 = calcMatrix.getX(xw, y);\r\n var ty3 = calcMatrix.getY(xw, y);\r\n\r\n this.setTexture2D(frame.glTexture, 0);\r\n\r\n tint = Utils.getTintAppendFloatAlpha(tint, alpha);\r\n\r\n this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, 0, frame.glTexture, 0);\r\n },\r\n\r\n /**\r\n * Pushes a filled rectangle into the vertex batch.\r\n * Rectangle has no transform values and isn't transformed into the local space.\r\n * Used for directly batching untransformed rectangles, such as Camera background colors.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#drawFillRect\r\n * @since 3.12.0\r\n *\r\n * @param {number} x - Horizontal top left coordinate of the rectangle.\r\n * @param {number} y - Vertical top left coordinate of the rectangle.\r\n * @param {number} width - Width of the rectangle.\r\n * @param {number} height - Height of the rectangle.\r\n * @param {number} color - Color of the rectangle to draw.\r\n * @param {number} alpha - Alpha value of the rectangle to draw.\r\n */\r\n drawFillRect: function (x, y, width, height, color, alpha)\r\n {\r\n var xw = x + width;\r\n var yh = y + height;\r\n\r\n this.setTexture2D();\r\n\r\n var tint = Utils.getTintAppendFloatAlphaAndSwap(color, alpha);\r\n\r\n this.batchQuad(x, y, x, yh, xw, yh, xw, y, 0, 0, 1, 1, tint, tint, tint, tint, 2);\r\n },\r\n\r\n /**\r\n * Pushes a filled rectangle into the vertex batch.\r\n * Rectangle factors in the given transform matrices before adding to the batch.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchFillRect\r\n * @since 3.12.0\r\n *\r\n * @param {number} x - Horizontal top left coordinate of the rectangle.\r\n * @param {number} y - Vertical top left coordinate of the rectangle.\r\n * @param {number} width - Width of the rectangle.\r\n * @param {number} height - Height of the rectangle.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform.\r\n */\r\n batchFillRect: function (x, y, width, height, currentMatrix, parentMatrix)\r\n {\r\n this.renderer.setPipeline(this);\r\n\r\n var calcMatrix = this._tempMatrix3;\r\n\r\n // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix\r\n if (parentMatrix)\r\n {\r\n parentMatrix.multiply(currentMatrix, calcMatrix);\r\n }\r\n \r\n var xw = x + width;\r\n var yh = y + height;\r\n\r\n var x0 = calcMatrix.getX(x, y);\r\n var y0 = calcMatrix.getY(x, y);\r\n\r\n var x1 = calcMatrix.getX(x, yh);\r\n var y1 = calcMatrix.getY(x, yh);\r\n\r\n var x2 = calcMatrix.getX(xw, yh);\r\n var y2 = calcMatrix.getY(xw, yh);\r\n\r\n var x3 = calcMatrix.getX(xw, y);\r\n var y3 = calcMatrix.getY(xw, y);\r\n\r\n var frame = this.currentFrame;\r\n\r\n var u0 = frame.u0;\r\n var v0 = frame.v0;\r\n var u1 = frame.u1;\r\n var v1 = frame.v1;\r\n\r\n this.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, this.fillTint.TL, this.fillTint.TR, this.fillTint.BL, this.fillTint.BR, this.tintEffect);\r\n },\r\n\r\n /**\r\n * Pushes a filled triangle into the vertex batch.\r\n * Triangle factors in the given transform matrices before adding to the batch.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchFillTriangle\r\n * @since 3.12.0\r\n *\r\n * @param {number} x0 - Point 0 x coordinate.\r\n * @param {number} y0 - Point 0 y coordinate.\r\n * @param {number} x1 - Point 1 x coordinate.\r\n * @param {number} y1 - Point 1 y coordinate.\r\n * @param {number} x2 - Point 2 x coordinate.\r\n * @param {number} y2 - Point 2 y coordinate.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform.\r\n */\r\n batchFillTriangle: function (x0, y0, x1, y1, x2, y2, currentMatrix, parentMatrix)\r\n {\r\n this.renderer.setPipeline(this);\r\n\r\n var calcMatrix = this._tempMatrix3;\r\n\r\n // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix\r\n if (parentMatrix)\r\n {\r\n parentMatrix.multiply(currentMatrix, calcMatrix);\r\n }\r\n \r\n var tx0 = calcMatrix.getX(x0, y0);\r\n var ty0 = calcMatrix.getY(x0, y0);\r\n\r\n var tx1 = calcMatrix.getX(x1, y1);\r\n var ty1 = calcMatrix.getY(x1, y1);\r\n\r\n var tx2 = calcMatrix.getX(x2, y2);\r\n var ty2 = calcMatrix.getY(x2, y2);\r\n\r\n var frame = this.currentFrame;\r\n\r\n var u0 = frame.u0;\r\n var v0 = frame.v0;\r\n var u1 = frame.u1;\r\n var v1 = frame.v1;\r\n\r\n this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, u0, v0, u1, v1, this.fillTint.TL, this.fillTint.TR, this.fillTint.BL, this.tintEffect);\r\n },\r\n\r\n /**\r\n * Pushes a stroked triangle into the vertex batch.\r\n * Triangle factors in the given transform matrices before adding to the batch.\r\n * The triangle is created from 3 lines and drawn using the `batchStrokePath` method.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchStrokeTriangle\r\n * @since 3.12.0\r\n *\r\n * @param {number} x0 - Point 0 x coordinate.\r\n * @param {number} y0 - Point 0 y coordinate.\r\n * @param {number} x1 - Point 1 x coordinate.\r\n * @param {number} y1 - Point 1 y coordinate.\r\n * @param {number} x2 - Point 2 x coordinate.\r\n * @param {number} y2 - Point 2 y coordinate.\r\n * @param {number} lineWidth - The width of the line in pixels.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform.\r\n */\r\n batchStrokeTriangle: function (x0, y0, x1, y1, x2, y2, lineWidth, currentMatrix, parentMatrix)\r\n {\r\n var tempTriangle = this.tempTriangle;\r\n\r\n tempTriangle[0].x = x0;\r\n tempTriangle[0].y = y0;\r\n tempTriangle[0].width = lineWidth;\r\n\r\n tempTriangle[1].x = x1;\r\n tempTriangle[1].y = y1;\r\n tempTriangle[1].width = lineWidth;\r\n\r\n tempTriangle[2].x = x2;\r\n tempTriangle[2].y = y2;\r\n tempTriangle[2].width = lineWidth;\r\n\r\n tempTriangle[3].x = x0;\r\n tempTriangle[3].y = y0;\r\n tempTriangle[3].width = lineWidth;\r\n\r\n this.batchStrokePath(tempTriangle, lineWidth, false, currentMatrix, parentMatrix);\r\n },\r\n\r\n /**\r\n * Adds the given path to the vertex batch for rendering.\r\n * \r\n * It works by taking the array of path data and then passing it through Earcut, which\r\n * creates a list of polygons. Each polygon is then added to the batch.\r\n * \r\n * The path is always automatically closed because it's filled.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchFillPath\r\n * @since 3.12.0\r\n *\r\n * @param {array} path - Collection of points that represent the path.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform.\r\n */\r\n batchFillPath: function (path, currentMatrix, parentMatrix)\r\n {\r\n this.renderer.setPipeline(this);\r\n\r\n var calcMatrix = this._tempMatrix3;\r\n\r\n // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix\r\n if (parentMatrix)\r\n {\r\n parentMatrix.multiply(currentMatrix, calcMatrix);\r\n }\r\n\r\n var length = path.length;\r\n var polygonCache = this.polygonCache;\r\n var polygonIndexArray;\r\n var point;\r\n\r\n var tintTL = this.fillTint.TL;\r\n var tintTR = this.fillTint.TR;\r\n var tintBL = this.fillTint.BL;\r\n var tintEffect = this.tintEffect;\r\n\r\n for (var pathIndex = 0; pathIndex < length; ++pathIndex)\r\n {\r\n point = path[pathIndex];\r\n polygonCache.push(point.x, point.y);\r\n }\r\n\r\n polygonIndexArray = Earcut(polygonCache);\r\n length = polygonIndexArray.length;\r\n\r\n var frame = this.currentFrame;\r\n\r\n for (var index = 0; index < length; index += 3)\r\n {\r\n var p0 = polygonIndexArray[index + 0] * 2;\r\n var p1 = polygonIndexArray[index + 1] * 2;\r\n var p2 = polygonIndexArray[index + 2] * 2;\r\n\r\n var x0 = polygonCache[p0 + 0];\r\n var y0 = polygonCache[p0 + 1];\r\n var x1 = polygonCache[p1 + 0];\r\n var y1 = polygonCache[p1 + 1];\r\n var x2 = polygonCache[p2 + 0];\r\n var y2 = polygonCache[p2 + 1];\r\n\r\n var tx0 = calcMatrix.getX(x0, y0);\r\n var ty0 = calcMatrix.getY(x0, y0);\r\n \r\n var tx1 = calcMatrix.getX(x1, y1);\r\n var ty1 = calcMatrix.getY(x1, y1);\r\n \r\n var tx2 = calcMatrix.getX(x2, y2);\r\n var ty2 = calcMatrix.getY(x2, y2);\r\n\r\n var u0 = frame.u0;\r\n var v0 = frame.v0;\r\n var u1 = frame.u1;\r\n var v1 = frame.v1;\r\n \r\n this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect);\r\n }\r\n\r\n polygonCache.length = 0;\r\n },\r\n\r\n /**\r\n * Adds the given path to the vertex batch for rendering.\r\n * \r\n * It works by taking the array of path data and calling `batchLine` for each section\r\n * of the path.\r\n * \r\n * The path is optionally closed at the end.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchStrokePath\r\n * @since 3.12.0\r\n *\r\n * @param {array} path - Collection of points that represent the path.\r\n * @param {number} lineWidth - The width of the line segments in pixels.\r\n * @param {boolean} pathOpen - Indicates if the path should be closed or left open.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform.\r\n */\r\n batchStrokePath: function (path, lineWidth, pathOpen, currentMatrix, parentMatrix)\r\n {\r\n this.renderer.setPipeline(this);\r\n\r\n // Reset the closePath booleans\r\n this.prevQuad[4] = 0;\r\n this.firstQuad[4] = 0;\r\n\r\n var pathLength = path.length - 1;\r\n\r\n for (var pathIndex = 0; pathIndex < pathLength; pathIndex++)\r\n {\r\n var point0 = path[pathIndex];\r\n var point1 = path[pathIndex + 1];\r\n\r\n this.batchLine(\r\n point0.x,\r\n point0.y,\r\n point1.x,\r\n point1.y,\r\n point0.width / 2,\r\n point1.width / 2,\r\n lineWidth,\r\n pathIndex,\r\n !pathOpen && (pathIndex === pathLength - 1),\r\n currentMatrix,\r\n parentMatrix\r\n );\r\n }\r\n },\r\n\r\n /**\r\n * Creates a quad and adds it to the vertex batch based on the given line values.\r\n *\r\n * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchLine\r\n * @since 3.12.0\r\n *\r\n * @param {number} ax - X coordinate to the start of the line\r\n * @param {number} ay - Y coordinate to the start of the line\r\n * @param {number} bx - X coordinate to the end of the line\r\n * @param {number} by - Y coordinate to the end of the line\r\n * @param {number} aLineWidth - Width of the start of the line\r\n * @param {number} bLineWidth - Width of the end of the line\r\n * @param {Float32Array} currentMatrix - Parent matrix, generally used by containers\r\n */\r\n batchLine: function (ax, ay, bx, by, aLineWidth, bLineWidth, lineWidth, index, closePath, currentMatrix, parentMatrix)\r\n {\r\n this.renderer.setPipeline(this);\r\n\r\n var calcMatrix = this._tempMatrix3;\r\n\r\n // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix\r\n if (parentMatrix)\r\n {\r\n parentMatrix.multiply(currentMatrix, calcMatrix);\r\n }\r\n\r\n var dx = bx - ax;\r\n var dy = by - ay;\r\n\r\n var len = Math.sqrt(dx * dx + dy * dy);\r\n var al0 = aLineWidth * (by - ay) / len;\r\n var al1 = aLineWidth * (ax - bx) / len;\r\n var bl0 = bLineWidth * (by - ay) / len;\r\n var bl1 = bLineWidth * (ax - bx) / len;\r\n\r\n var lx0 = bx - bl0;\r\n var ly0 = by - bl1;\r\n var lx1 = ax - al0;\r\n var ly1 = ay - al1;\r\n var lx2 = bx + bl0;\r\n var ly2 = by + bl1;\r\n var lx3 = ax + al0;\r\n var ly3 = ay + al1;\r\n\r\n // tx0 = bottom right\r\n var brX = calcMatrix.getX(lx0, ly0);\r\n var brY = calcMatrix.getY(lx0, ly0);\r\n\r\n // tx1 = bottom left\r\n var blX = calcMatrix.getX(lx1, ly1);\r\n var blY = calcMatrix.getY(lx1, ly1);\r\n\r\n // tx2 = top right\r\n var trX = calcMatrix.getX(lx2, ly2);\r\n var trY = calcMatrix.getY(lx2, ly2);\r\n\r\n // tx3 = top left\r\n var tlX = calcMatrix.getX(lx3, ly3);\r\n var tlY = calcMatrix.getY(lx3, ly3);\r\n\r\n var tint = this.strokeTint;\r\n var tintEffect = this.tintEffect;\r\n\r\n var tintTL = tint.TL;\r\n var tintTR = tint.TR;\r\n var tintBL = tint.BL;\r\n var tintBR = tint.BR;\r\n\r\n var frame = this.currentFrame;\r\n\r\n var u0 = frame.u0;\r\n var v0 = frame.v0;\r\n var u1 = frame.u1;\r\n var v1 = frame.v1;\r\n\r\n // TL, BL, BR, TR\r\n this.batchQuad(tlX, tlY, blX, blY, brX, brY, trX, trY, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect);\r\n\r\n if (lineWidth <= 2)\r\n {\r\n // No point doing a linejoin if the line isn't thick enough\r\n return;\r\n }\r\n\r\n var prev = this.prevQuad;\r\n var first = this.firstQuad;\r\n\r\n if (index > 0 && prev[4])\r\n {\r\n this.batchQuad(tlX, tlY, blX, blY, prev[0], prev[1], prev[2], prev[3], u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect);\r\n }\r\n else\r\n {\r\n first[0] = tlX;\r\n first[1] = tlY;\r\n first[2] = blX;\r\n first[3] = blY;\r\n first[4] = 1;\r\n }\r\n\r\n if (closePath && first[4])\r\n {\r\n // Add a join for the final path segment\r\n this.batchQuad(brX, brY, trX, trY, first[0], first[1], first[2], first[3], u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect);\r\n }\r\n else\r\n {\r\n // Store it\r\n\r\n prev[0] = brX;\r\n prev[1] = brY;\r\n prev[2] = trX;\r\n prev[3] = trY;\r\n prev[4] = 1;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = TextureTintPipeline;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/webgl/pipelines/TextureTintPipeline.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/webgl/pipelines/components/ModelViewProjection.js": /*!********************************************************************************************!*\ !*** ./node_modules/phaser/src/renderer/webgl/pipelines/components/ModelViewProjection.js ***! \********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Implements a model view projection matrices.\r\n * Pipelines can implement this for doing 2D and 3D rendering.\r\n *\r\n * @namespace Phaser.Renderer.WebGL.Pipelines.ModelViewProjection\r\n * @since 3.0.0\r\n */\r\nvar ModelViewProjection = {\r\n\r\n /**\r\n * Dirty flag for checking if model matrix needs to be updated on GPU.\r\n * \r\n * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelMatrixDirty\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n modelMatrixDirty: false,\r\n\r\n /**\r\n * Dirty flag for checking if view matrix needs to be updated on GPU.\r\n * \r\n * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewMatrixDirty\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n viewMatrixDirty: false,\r\n\r\n /**\r\n * Dirty flag for checking if projection matrix needs to be updated on GPU.\r\n * \r\n * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projectionMatrixDirty\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n projectionMatrixDirty: false,\r\n\r\n /**\r\n * Model matrix\r\n * \r\n * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelMatrix\r\n * @type {?Float32Array}\r\n * @since 3.0.0\r\n */\r\n modelMatrix: null,\r\n\r\n /**\r\n * View matrix\r\n * \r\n * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewMatrix\r\n * @type {?Float32Array}\r\n * @since 3.0.0\r\n */\r\n viewMatrix: null,\r\n\r\n /**\r\n * Projection matrix\r\n * \r\n * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projectionMatrix\r\n * @type {?Float32Array}\r\n * @since 3.0.0\r\n */\r\n projectionMatrix: null,\r\n\r\n /**\r\n * Initializes MVP matrices with an identity matrix\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#mvpInit\r\n * @since 3.0.0\r\n */\r\n mvpInit: function ()\r\n {\r\n this.modelMatrixDirty = true;\r\n this.viewMatrixDirty = true;\r\n this.projectionMatrixDirty = true;\r\n \r\n this.modelMatrix = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1\r\n ]);\r\n \r\n this.viewMatrix = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1\r\n ]);\r\n \r\n this.projectionMatrix = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1\r\n ]);\r\n \r\n return this;\r\n },\r\n\r\n /**\r\n * If dirty flags are set then the matrices are uploaded to the GPU.\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#mvpUpdate\r\n * @since 3.0.0\r\n */\r\n mvpUpdate: function ()\r\n {\r\n var program = this.program;\r\n\r\n if (this.modelMatrixDirty)\r\n {\r\n this.renderer.setMatrix4(program, 'uModelMatrix', false, this.modelMatrix);\r\n this.modelMatrixDirty = false;\r\n }\r\n \r\n if (this.viewMatrixDirty)\r\n {\r\n this.renderer.setMatrix4(program, 'uViewMatrix', false, this.viewMatrix);\r\n this.viewMatrixDirty = false;\r\n }\r\n\r\n if (this.projectionMatrixDirty)\r\n {\r\n this.renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix);\r\n this.projectionMatrixDirty = false;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Loads an identity matrix to the model matrix\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelIdentity\r\n * @since 3.0.0\r\n */\r\n modelIdentity: function ()\r\n {\r\n var modelMatrix = this.modelMatrix;\r\n \r\n modelMatrix[0] = 1;\r\n modelMatrix[1] = 0;\r\n modelMatrix[2] = 0;\r\n modelMatrix[3] = 0;\r\n modelMatrix[4] = 0;\r\n modelMatrix[5] = 1;\r\n modelMatrix[6] = 0;\r\n modelMatrix[7] = 0;\r\n modelMatrix[8] = 0;\r\n modelMatrix[9] = 0;\r\n modelMatrix[10] = 1;\r\n modelMatrix[11] = 0;\r\n modelMatrix[12] = 0;\r\n modelMatrix[13] = 0;\r\n modelMatrix[14] = 0;\r\n modelMatrix[15] = 1;\r\n\r\n this.modelMatrixDirty = true;\r\n \r\n return this;\r\n },\r\n\r\n /**\r\n * Scale model matrix\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelScale\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n modelScale: function (x, y, z)\r\n {\r\n var modelMatrix = this.modelMatrix;\r\n\r\n modelMatrix[0] = modelMatrix[0] * x;\r\n modelMatrix[1] = modelMatrix[1] * x;\r\n modelMatrix[2] = modelMatrix[2] * x;\r\n modelMatrix[3] = modelMatrix[3] * x;\r\n modelMatrix[4] = modelMatrix[4] * y;\r\n modelMatrix[5] = modelMatrix[5] * y;\r\n modelMatrix[6] = modelMatrix[6] * y;\r\n modelMatrix[7] = modelMatrix[7] * y;\r\n modelMatrix[8] = modelMatrix[8] * z;\r\n modelMatrix[9] = modelMatrix[9] * z;\r\n modelMatrix[10] = modelMatrix[10] * z;\r\n modelMatrix[11] = modelMatrix[11] * z;\r\n \r\n this.modelMatrixDirty = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate model matrix\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelTranslate\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n modelTranslate: function (x, y, z)\r\n {\r\n var modelMatrix = this.modelMatrix;\r\n\r\n modelMatrix[12] = modelMatrix[0] * x + modelMatrix[4] * y + modelMatrix[8] * z + modelMatrix[12];\r\n modelMatrix[13] = modelMatrix[1] * x + modelMatrix[5] * y + modelMatrix[9] * z + modelMatrix[13];\r\n modelMatrix[14] = modelMatrix[2] * x + modelMatrix[6] * y + modelMatrix[10] * z + modelMatrix[14];\r\n modelMatrix[15] = modelMatrix[3] * x + modelMatrix[7] * y + modelMatrix[11] * z + modelMatrix[15];\r\n\r\n this.modelMatrixDirty = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotates the model matrix in the X axis.\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelRotateX\r\n * @since 3.0.0\r\n *\r\n * @param {number} radians - The amount to rotate by.\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n modelRotateX: function (radians)\r\n {\r\n var modelMatrix = this.modelMatrix;\r\n var s = Math.sin(radians);\r\n var c = Math.cos(radians);\r\n var a10 = modelMatrix[4];\r\n var a11 = modelMatrix[5];\r\n var a12 = modelMatrix[6];\r\n var a13 = modelMatrix[7];\r\n var a20 = modelMatrix[8];\r\n var a21 = modelMatrix[9];\r\n var a22 = modelMatrix[10];\r\n var a23 = modelMatrix[11];\r\n\r\n modelMatrix[4] = a10 * c + a20 * s;\r\n modelMatrix[5] = a11 * c + a21 * s;\r\n modelMatrix[6] = a12 * c + a22 * s;\r\n modelMatrix[7] = a13 * c + a23 * s;\r\n modelMatrix[8] = a20 * c - a10 * s;\r\n modelMatrix[9] = a21 * c - a11 * s;\r\n modelMatrix[10] = a22 * c - a12 * s;\r\n modelMatrix[11] = a23 * c - a13 * s;\r\n\r\n this.modelMatrixDirty = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotates the model matrix in the Y axis.\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelRotateY\r\n * @since 3.0.0\r\n *\r\n * @param {number} radians - The amount to rotate by.\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n modelRotateY: function (radians)\r\n {\r\n var modelMatrix = this.modelMatrix;\r\n var s = Math.sin(radians);\r\n var c = Math.cos(radians);\r\n var a00 = modelMatrix[0];\r\n var a01 = modelMatrix[1];\r\n var a02 = modelMatrix[2];\r\n var a03 = modelMatrix[3];\r\n var a20 = modelMatrix[8];\r\n var a21 = modelMatrix[9];\r\n var a22 = modelMatrix[10];\r\n var a23 = modelMatrix[11];\r\n\r\n modelMatrix[0] = a00 * c - a20 * s;\r\n modelMatrix[1] = a01 * c - a21 * s;\r\n modelMatrix[2] = a02 * c - a22 * s;\r\n modelMatrix[3] = a03 * c - a23 * s;\r\n modelMatrix[8] = a00 * s + a20 * c;\r\n modelMatrix[9] = a01 * s + a21 * c;\r\n modelMatrix[10] = a02 * s + a22 * c;\r\n modelMatrix[11] = a03 * s + a23 * c;\r\n\r\n this.modelMatrixDirty = true;\r\n \r\n return this;\r\n },\r\n \r\n /**\r\n * Rotates the model matrix in the Z axis.\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelRotateZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} radians - The amount to rotate by.\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n modelRotateZ: function (radians)\r\n {\r\n var modelMatrix = this.modelMatrix;\r\n var s = Math.sin(radians);\r\n var c = Math.cos(radians);\r\n var a00 = modelMatrix[0];\r\n var a01 = modelMatrix[1];\r\n var a02 = modelMatrix[2];\r\n var a03 = modelMatrix[3];\r\n var a10 = modelMatrix[4];\r\n var a11 = modelMatrix[5];\r\n var a12 = modelMatrix[6];\r\n var a13 = modelMatrix[7];\r\n\r\n modelMatrix[0] = a00 * c + a10 * s;\r\n modelMatrix[1] = a01 * c + a11 * s;\r\n modelMatrix[2] = a02 * c + a12 * s;\r\n modelMatrix[3] = a03 * c + a13 * s;\r\n modelMatrix[4] = a10 * c - a00 * s;\r\n modelMatrix[5] = a11 * c - a01 * s;\r\n modelMatrix[6] = a12 * c - a02 * s;\r\n modelMatrix[7] = a13 * c - a03 * s;\r\n\r\n this.modelMatrixDirty = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Loads identity matrix into the view matrix\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewIdentity\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n viewIdentity: function ()\r\n {\r\n var viewMatrix = this.viewMatrix;\r\n \r\n viewMatrix[0] = 1;\r\n viewMatrix[1] = 0;\r\n viewMatrix[2] = 0;\r\n viewMatrix[3] = 0;\r\n viewMatrix[4] = 0;\r\n viewMatrix[5] = 1;\r\n viewMatrix[6] = 0;\r\n viewMatrix[7] = 0;\r\n viewMatrix[8] = 0;\r\n viewMatrix[9] = 0;\r\n viewMatrix[10] = 1;\r\n viewMatrix[11] = 0;\r\n viewMatrix[12] = 0;\r\n viewMatrix[13] = 0;\r\n viewMatrix[14] = 0;\r\n viewMatrix[15] = 1;\r\n\r\n this.viewMatrixDirty = true;\r\n \r\n return this;\r\n },\r\n \r\n /**\r\n * Scales view matrix\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewScale\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n viewScale: function (x, y, z)\r\n {\r\n var viewMatrix = this.viewMatrix;\r\n\r\n viewMatrix[0] = viewMatrix[0] * x;\r\n viewMatrix[1] = viewMatrix[1] * x;\r\n viewMatrix[2] = viewMatrix[2] * x;\r\n viewMatrix[3] = viewMatrix[3] * x;\r\n viewMatrix[4] = viewMatrix[4] * y;\r\n viewMatrix[5] = viewMatrix[5] * y;\r\n viewMatrix[6] = viewMatrix[6] * y;\r\n viewMatrix[7] = viewMatrix[7] * y;\r\n viewMatrix[8] = viewMatrix[8] * z;\r\n viewMatrix[9] = viewMatrix[9] * z;\r\n viewMatrix[10] = viewMatrix[10] * z;\r\n viewMatrix[11] = viewMatrix[11] * z;\r\n \r\n this.viewMatrixDirty = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translates view matrix\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewTranslate\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n viewTranslate: function (x, y, z)\r\n {\r\n var viewMatrix = this.viewMatrix;\r\n\r\n viewMatrix[12] = viewMatrix[0] * x + viewMatrix[4] * y + viewMatrix[8] * z + viewMatrix[12];\r\n viewMatrix[13] = viewMatrix[1] * x + viewMatrix[5] * y + viewMatrix[9] * z + viewMatrix[13];\r\n viewMatrix[14] = viewMatrix[2] * x + viewMatrix[6] * y + viewMatrix[10] * z + viewMatrix[14];\r\n viewMatrix[15] = viewMatrix[3] * x + viewMatrix[7] * y + viewMatrix[11] * z + viewMatrix[15];\r\n\r\n this.viewMatrixDirty = true;\r\n\r\n return this;\r\n },\r\n \r\n /**\r\n * Rotates view matrix in the X axis.\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewRotateX\r\n * @since 3.0.0\r\n *\r\n * @param {number} radians - The amount to rotate by.\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n viewRotateX: function (radians)\r\n {\r\n var viewMatrix = this.viewMatrix;\r\n var s = Math.sin(radians);\r\n var c = Math.cos(radians);\r\n var a10 = viewMatrix[4];\r\n var a11 = viewMatrix[5];\r\n var a12 = viewMatrix[6];\r\n var a13 = viewMatrix[7];\r\n var a20 = viewMatrix[8];\r\n var a21 = viewMatrix[9];\r\n var a22 = viewMatrix[10];\r\n var a23 = viewMatrix[11];\r\n\r\n viewMatrix[4] = a10 * c + a20 * s;\r\n viewMatrix[5] = a11 * c + a21 * s;\r\n viewMatrix[6] = a12 * c + a22 * s;\r\n viewMatrix[7] = a13 * c + a23 * s;\r\n viewMatrix[8] = a20 * c - a10 * s;\r\n viewMatrix[9] = a21 * c - a11 * s;\r\n viewMatrix[10] = a22 * c - a12 * s;\r\n viewMatrix[11] = a23 * c - a13 * s;\r\n\r\n this.viewMatrixDirty = true;\r\n\r\n return this;\r\n },\r\n \r\n /**\r\n * Rotates view matrix in the Y axis.\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewRotateY\r\n * @since 3.0.0\r\n *\r\n * @param {number} radians - The amount to rotate by.\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n viewRotateY: function (radians)\r\n {\r\n var viewMatrix = this.viewMatrix;\r\n var s = Math.sin(radians);\r\n var c = Math.cos(radians);\r\n var a00 = viewMatrix[0];\r\n var a01 = viewMatrix[1];\r\n var a02 = viewMatrix[2];\r\n var a03 = viewMatrix[3];\r\n var a20 = viewMatrix[8];\r\n var a21 = viewMatrix[9];\r\n var a22 = viewMatrix[10];\r\n var a23 = viewMatrix[11];\r\n\r\n viewMatrix[0] = a00 * c - a20 * s;\r\n viewMatrix[1] = a01 * c - a21 * s;\r\n viewMatrix[2] = a02 * c - a22 * s;\r\n viewMatrix[3] = a03 * c - a23 * s;\r\n viewMatrix[8] = a00 * s + a20 * c;\r\n viewMatrix[9] = a01 * s + a21 * c;\r\n viewMatrix[10] = a02 * s + a22 * c;\r\n viewMatrix[11] = a03 * s + a23 * c;\r\n\r\n this.viewMatrixDirty = true;\r\n \r\n return this;\r\n },\r\n \r\n /**\r\n * Rotates view matrix in the Z axis.\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewRotateZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} radians - The amount to rotate by.\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n viewRotateZ: function (radians)\r\n {\r\n var viewMatrix = this.viewMatrix;\r\n var s = Math.sin(radians);\r\n var c = Math.cos(radians);\r\n var a00 = viewMatrix[0];\r\n var a01 = viewMatrix[1];\r\n var a02 = viewMatrix[2];\r\n var a03 = viewMatrix[3];\r\n var a10 = viewMatrix[4];\r\n var a11 = viewMatrix[5];\r\n var a12 = viewMatrix[6];\r\n var a13 = viewMatrix[7];\r\n\r\n viewMatrix[0] = a00 * c + a10 * s;\r\n viewMatrix[1] = a01 * c + a11 * s;\r\n viewMatrix[2] = a02 * c + a12 * s;\r\n viewMatrix[3] = a03 * c + a13 * s;\r\n viewMatrix[4] = a10 * c - a00 * s;\r\n viewMatrix[5] = a11 * c - a01 * s;\r\n viewMatrix[6] = a12 * c - a02 * s;\r\n viewMatrix[7] = a13 * c - a03 * s;\r\n\r\n this.viewMatrixDirty = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Loads a 2D view matrix (3x2 matrix) into a 4x4 view matrix \r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewLoad2D\r\n * @since 3.0.0\r\n *\r\n * @param {Float32Array} matrix2D - The Matrix2D.\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n viewLoad2D: function (matrix2D)\r\n {\r\n var vm = this.viewMatrix;\r\n\r\n vm[0] = matrix2D[0];\r\n vm[1] = matrix2D[1];\r\n vm[2] = 0.0;\r\n vm[3] = 0.0;\r\n vm[4] = matrix2D[2];\r\n vm[5] = matrix2D[3];\r\n vm[6] = 0.0;\r\n vm[7] = 0.0;\r\n vm[8] = matrix2D[4];\r\n vm[9] = matrix2D[5];\r\n vm[10] = 1.0;\r\n vm[11] = 0.0;\r\n vm[12] = 0.0;\r\n vm[13] = 0.0;\r\n vm[14] = 0.0;\r\n vm[15] = 1.0;\r\n\r\n this.viewMatrixDirty = true;\r\n\r\n return this;\r\n },\r\n\r\n\r\n /**\r\n * Copies a 4x4 matrix into the view matrix\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewLoad\r\n * @since 3.0.0\r\n *\r\n * @param {Float32Array} matrix - The Matrix2D.\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n viewLoad: function (matrix)\r\n {\r\n var vm = this.viewMatrix;\r\n\r\n vm[0] = matrix[0];\r\n vm[1] = matrix[1];\r\n vm[2] = matrix[2];\r\n vm[3] = matrix[3];\r\n vm[4] = matrix[4];\r\n vm[5] = matrix[5];\r\n vm[6] = matrix[6];\r\n vm[7] = matrix[7];\r\n vm[8] = matrix[8];\r\n vm[9] = matrix[9];\r\n vm[10] = matrix[10];\r\n vm[11] = matrix[11];\r\n vm[12] = matrix[12];\r\n vm[13] = matrix[13];\r\n vm[14] = matrix[14];\r\n vm[15] = matrix[15];\r\n\r\n this.viewMatrixDirty = true;\r\n\r\n return this;\r\n },\r\n \r\n /**\r\n * Loads identity matrix into the projection matrix.\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projIdentity\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n projIdentity: function ()\r\n {\r\n var projectionMatrix = this.projectionMatrix;\r\n \r\n projectionMatrix[0] = 1;\r\n projectionMatrix[1] = 0;\r\n projectionMatrix[2] = 0;\r\n projectionMatrix[3] = 0;\r\n projectionMatrix[4] = 0;\r\n projectionMatrix[5] = 1;\r\n projectionMatrix[6] = 0;\r\n projectionMatrix[7] = 0;\r\n projectionMatrix[8] = 0;\r\n projectionMatrix[9] = 0;\r\n projectionMatrix[10] = 1;\r\n projectionMatrix[11] = 0;\r\n projectionMatrix[12] = 0;\r\n projectionMatrix[13] = 0;\r\n projectionMatrix[14] = 0;\r\n projectionMatrix[15] = 1;\r\n\r\n this.projectionMatrixDirty = true;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets up an orthographic projection matrix\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projOrtho\r\n * @since 3.0.0\r\n *\r\n * @param {number} left - The left value.\r\n * @param {number} right - The right value.\r\n * @param {number} bottom - The bottom value.\r\n * @param {number} top - The top value.\r\n * @param {number} near - The near value.\r\n * @param {number} far - The far value.\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n projOrtho: function (left, right, bottom, top, near, far)\r\n {\r\n var projectionMatrix = this.projectionMatrix;\r\n var leftRight = 1.0 / (left - right);\r\n var bottomTop = 1.0 / (bottom - top);\r\n var nearFar = 1.0 / (near - far);\r\n\r\n projectionMatrix[0] = -2.0 * leftRight;\r\n projectionMatrix[1] = 0.0;\r\n projectionMatrix[2] = 0.0;\r\n projectionMatrix[3] = 0.0;\r\n projectionMatrix[4] = 0.0;\r\n projectionMatrix[5] = -2.0 * bottomTop;\r\n projectionMatrix[6] = 0.0;\r\n projectionMatrix[7] = 0.0;\r\n projectionMatrix[8] = 0.0;\r\n projectionMatrix[9] = 0.0;\r\n projectionMatrix[10] = 2.0 * nearFar;\r\n projectionMatrix[11] = 0.0;\r\n projectionMatrix[12] = (left + right) * leftRight;\r\n projectionMatrix[13] = (top + bottom) * bottomTop;\r\n projectionMatrix[14] = (far + near) * nearFar;\r\n projectionMatrix[15] = 1.0;\r\n\r\n this.projectionMatrixDirty = true;\r\n\r\n return this;\r\n },\r\n \r\n /**\r\n * Sets up a perspective projection matrix\r\n * \r\n * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projPersp\r\n * @since 3.0.0\r\n *\r\n * @param {number} fovY - The fov value.\r\n * @param {number} aspectRatio - The aspectRatio value.\r\n * @param {number} near - The near value.\r\n * @param {number} far - The far value.\r\n *\r\n * @return {this} This Model View Projection.\r\n */\r\n projPersp: function (fovY, aspectRatio, near, far)\r\n {\r\n var projectionMatrix = this.projectionMatrix;\r\n var fov = 1.0 / Math.tan(fovY / 2.0);\r\n var nearFar = 1.0 / (near - far);\r\n \r\n projectionMatrix[0] = fov / aspectRatio;\r\n projectionMatrix[1] = 0.0;\r\n projectionMatrix[2] = 0.0;\r\n projectionMatrix[3] = 0.0;\r\n projectionMatrix[4] = 0.0;\r\n projectionMatrix[5] = fov;\r\n projectionMatrix[6] = 0.0;\r\n projectionMatrix[7] = 0.0;\r\n projectionMatrix[8] = 0.0;\r\n projectionMatrix[9] = 0.0;\r\n projectionMatrix[10] = (far + near) * nearFar;\r\n projectionMatrix[11] = -1.0;\r\n projectionMatrix[12] = 0.0;\r\n projectionMatrix[13] = 0.0;\r\n projectionMatrix[14] = (2.0 * far * near) * nearFar;\r\n projectionMatrix[15] = 0.0;\r\n \r\n this.projectionMatrixDirty = true;\r\n\r\n return this;\r\n }\r\n};\r\n\r\nmodule.exports = ModelViewProjection;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/webgl/pipelines/components/ModelViewProjection.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/webgl/pipelines/index.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/renderer/webgl/pipelines/index.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Renderer.WebGL.Pipelines\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BitmapMaskPipeline: __webpack_require__(/*! ./BitmapMaskPipeline */ \"./node_modules/phaser/src/renderer/webgl/pipelines/BitmapMaskPipeline.js\"),\r\n ForwardDiffuseLightPipeline: __webpack_require__(/*! ./ForwardDiffuseLightPipeline */ \"./node_modules/phaser/src/renderer/webgl/pipelines/ForwardDiffuseLightPipeline.js\"),\r\n TextureTintPipeline: __webpack_require__(/*! ./TextureTintPipeline */ \"./node_modules/phaser/src/renderer/webgl/pipelines/TextureTintPipeline.js\"),\r\n ModelViewProjection: __webpack_require__(/*! ./components/ModelViewProjection */ \"./node_modules/phaser/src/renderer/webgl/pipelines/components/ModelViewProjection.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/webgl/pipelines/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/webgl/shaders/BitmapMask-frag.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/renderer/webgl/shaders/BitmapMask-frag.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = [\n '#define SHADER_NAME PHASER_BITMAP_MASK_FS',\n '',\n 'precision mediump float;',\n '',\n 'uniform vec2 uResolution;',\n 'uniform sampler2D uMainSampler;',\n 'uniform sampler2D uMaskSampler;',\n 'uniform bool uInvertMaskAlpha;',\n '',\n 'void main()',\n '{',\n ' vec2 uv = gl_FragCoord.xy / uResolution;',\n ' vec4 mainColor = texture2D(uMainSampler, uv);',\n ' vec4 maskColor = texture2D(uMaskSampler, uv);',\n ' float alpha = mainColor.a;',\n '',\n ' if (!uInvertMaskAlpha)',\n ' {',\n ' alpha *= (maskColor.a);',\n ' }',\n ' else',\n ' {',\n ' alpha *= (1.0 - maskColor.a);',\n ' }',\n '',\n ' gl_FragColor = vec4(mainColor.rgb * alpha, alpha);',\n '}',\n ''\n].join('\\n');\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/webgl/shaders/BitmapMask-frag.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/webgl/shaders/BitmapMask-vert.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/renderer/webgl/shaders/BitmapMask-vert.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = [\n '#define SHADER_NAME PHASER_BITMAP_MASK_VS',\n '',\n 'precision mediump float;',\n '',\n 'attribute vec2 inPosition;',\n '',\n 'void main()',\n '{',\n ' gl_Position = vec4(inPosition, 0.0, 1.0);',\n '}',\n ''\n].join('\\n');\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/webgl/shaders/BitmapMask-vert.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/webgl/shaders/ForwardDiffuse-frag.js": /*!*******************************************************************************!*\ !*** ./node_modules/phaser/src/renderer/webgl/shaders/ForwardDiffuse-frag.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = [\r\n '#define SHADER_NAME PHASER_FORWARD_DIFFUSE_FS',\r\n '',\r\n 'precision mediump float;',\r\n '',\r\n 'struct Light',\r\n '{',\r\n ' vec2 position;',\r\n ' vec3 color;',\r\n ' float intensity;',\r\n ' float radius;',\r\n '};',\r\n '',\r\n 'const int kMaxLights = %LIGHT_COUNT%;',\r\n '',\r\n 'uniform vec4 uCamera; /* x, y, rotation, zoom */',\r\n 'uniform vec2 uResolution;',\r\n 'uniform sampler2D uMainSampler;',\r\n 'uniform sampler2D uNormSampler;',\r\n 'uniform vec3 uAmbientLightColor;',\r\n 'uniform Light uLights[kMaxLights];',\r\n 'uniform mat3 uInverseRotationMatrix;',\r\n '',\r\n 'varying vec2 outTexCoord;',\r\n 'varying vec4 outTint;',\r\n '',\r\n 'void main()',\r\n '{',\r\n ' vec3 finalColor = vec3(0.0, 0.0, 0.0);',\r\n ' vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.rgb * outTint.a, outTint.a);',\r\n ' vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;',\r\n ' vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));',\r\n ' vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;',\r\n '',\r\n ' for (int index = 0; index < kMaxLights; ++index)',\r\n ' {',\r\n ' Light light = uLights[index];',\r\n ' vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);',\r\n ' vec3 lightNormal = normalize(lightDir);',\r\n ' float distToSurf = length(lightDir) * uCamera.w;',\r\n ' float diffuseFactor = max(dot(normal, lightNormal), 0.0);',\r\n ' float radius = (light.radius / res.x * uCamera.w) * uCamera.w;',\r\n ' float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);',\r\n ' vec3 diffuse = light.color * diffuseFactor;',\r\n ' finalColor += (attenuation * diffuse) * light.intensity;',\r\n ' }',\r\n '',\r\n ' vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);',\r\n ' gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);',\r\n '',\r\n '}',\r\n ''\r\n].join('\\n');\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/webgl/shaders/ForwardDiffuse-frag.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/webgl/shaders/TextureTint-frag.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/renderer/webgl/shaders/TextureTint-frag.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = [\n '#define SHADER_NAME PHASER_TEXTURE_TINT_FS',\n '',\n 'precision mediump float;',\n '',\n 'uniform sampler2D uMainSampler;',\n '',\n 'varying vec2 outTexCoord;',\n 'varying float outTintEffect;',\n 'varying vec4 outTint;',\n '',\n 'void main()',\n '{',\n ' vec4 texture = texture2D(uMainSampler, outTexCoord);',\n ' vec4 texel = vec4(outTint.rgb * outTint.a, outTint.a);',\n ' vec4 color = texture;',\n '',\n ' if (outTintEffect == 0.0)',\n ' {',\n ' // Multiply texture tint',\n ' color = texture * texel;',\n ' }',\n ' else if (outTintEffect == 1.0)',\n ' {',\n ' // Solid color + texture alpha',\n ' color.rgb = mix(texture.rgb, outTint.rgb * outTint.a, texture.a);',\n ' color.a = texture.a * texel.a;',\n ' }',\n ' else if (outTintEffect == 2.0)',\n ' {',\n ' // Solid color, no texture',\n ' color = texel;',\n ' }',\n '',\n ' gl_FragColor = color;',\n '}',\n ''\n].join('\\n');\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/webgl/shaders/TextureTint-frag.js?"); /***/ }), /***/ "./node_modules/phaser/src/renderer/webgl/shaders/TextureTint-vert.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/renderer/webgl/shaders/TextureTint-vert.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = [\n '#define SHADER_NAME PHASER_TEXTURE_TINT_VS',\n '',\n 'precision mediump float;',\n '',\n 'uniform mat4 uProjectionMatrix;',\n 'uniform mat4 uViewMatrix;',\n 'uniform mat4 uModelMatrix;',\n '',\n 'attribute vec2 inPosition;',\n 'attribute vec2 inTexCoord;',\n 'attribute float inTintEffect;',\n 'attribute vec4 inTint;',\n '',\n 'varying vec2 outTexCoord;',\n 'varying float outTintEffect;',\n 'varying vec4 outTint;',\n '',\n 'void main ()',\n '{',\n ' gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);',\n '',\n ' outTexCoord = inTexCoord;',\n ' outTint = inTint;',\n ' outTintEffect = inTintEffect;',\n '}',\n '',\n ''\n].join('\\n');\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/renderer/webgl/shaders/TextureTint-vert.js?"); /***/ }), /***/ "./node_modules/phaser/src/scale/ScaleManager.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/scale/ScaleManager.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/scale/const/index.js\");\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/scale/events/index.js\");\r\nvar GameEvents = __webpack_require__(/*! ../core/events */ \"./node_modules/phaser/src/core/events/index.js\");\r\nvar GetInnerHeight = __webpack_require__(/*! ../dom/GetInnerHeight */ \"./node_modules/phaser/src/dom/GetInnerHeight.js\");\r\nvar GetTarget = __webpack_require__(/*! ../dom/GetTarget */ \"./node_modules/phaser/src/dom/GetTarget.js\");\r\nvar GetScreenOrientation = __webpack_require__(/*! ../dom/GetScreenOrientation */ \"./node_modules/phaser/src/dom/GetScreenOrientation.js\");\r\nvar NOOP = __webpack_require__(/*! ../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar Rectangle = __webpack_require__(/*! ../geom/rectangle/Rectangle */ \"./node_modules/phaser/src/geom/rectangle/Rectangle.js\");\r\nvar Size = __webpack_require__(/*! ../structs/Size */ \"./node_modules/phaser/src/structs/Size.js\");\r\nvar SnapFloor = __webpack_require__(/*! ../math/snap/SnapFloor */ \"./node_modules/phaser/src/math/snap/SnapFloor.js\");\r\nvar Vector2 = __webpack_require__(/*! ../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Scale Manager handles the scaling, resizing and alignment of the game canvas.\r\n * \r\n * The way scaling is handled is by setting the game canvas to a fixed size, which is defined in the\r\n * game configuration. You also define the parent container in the game config. If no parent is given,\r\n * it will default to using the document body. The Scale Manager will then look at the available space\r\n * within the _parent_ and scale the canvas accordingly. Scaling is handled by setting the canvas CSS\r\n * width and height properties, leaving the width and height of the canvas element itself untouched.\r\n * Scaling is therefore achieved by keeping the core canvas the same size and 'stretching'\r\n * it via its CSS properties. This gives the same result and speed as using the `transform-scale` CSS\r\n * property, without the need for browser prefix handling.\r\n * \r\n * The calculations for the scale are heavily influenced by the bounding parent size, which is the computed\r\n * dimensions of the canvas's parent. The CSS rules of the parent element play an important role in the\r\n * operation of the Scale Manager. For example, if the parent has no defined width or height, then actions\r\n * like auto-centering will fail to achieve the required result. The Scale Manager works in tandem with the\r\n * CSS you set-up on the page hosting your game, rather than taking control of it.\r\n * \r\n * #### Parent and Display canvas containment guidelines:\r\n *\r\n * - Style the Parent element (of the game canvas) to control the Parent size and thus the games size and layout.\r\n *\r\n * - The Parent element's CSS styles should _effectively_ apply maximum (and minimum) bounding behavior.\r\n *\r\n * - The Parent element should _not_ apply a padding as this is not accounted for.\r\n * If a padding is required apply it to the Parent's parent or apply a margin to the Parent.\r\n * If you need to add a border, margin or any other CSS around your game container, then use a parent element and\r\n * apply the CSS to this instead, otherwise you'll be constantly resizing the shape of the game container.\r\n *\r\n * - The Display canvas layout CSS styles (i.e. margins, size) should not be altered / specified as\r\n * they may be updated by the Scale Manager.\r\n *\r\n * #### Scale Modes\r\n * \r\n * The way the scaling is handled is determined by the `scaleMode` property. The default is `NONE`,\r\n * which prevents Phaser from scaling or touching the canvas, or its parent, at all. In this mode, you are\r\n * responsible for all scaling. The other scaling modes afford you automatic scaling.\r\n * \r\n * If you wish to scale your game so that it always fits into the available space within the parent, you\r\n * should use the scale mode `FIT`. Look at the documentation for other scale modes to see what options are\r\n * available. Here is a basic config showing how to set this scale mode:\r\n * \r\n * ```javascript\r\n * scale: {\r\n * parent: 'yourgamediv',\r\n * mode: Phaser.Scale.FIT,\r\n * width: 800,\r\n * height: 600\r\n * }\r\n * ```\r\n * \r\n * Place the `scale` config object within your game config.\r\n * \r\n * If you wish for the canvas to be resized directly, so that the canvas itself fills the available space\r\n * (i.e. it isn't scaled, it's resized) then use the `RESIZE` scale mode. This will give you a 1:1 mapping\r\n * of canvas pixels to game size. In this mode CSS isn't used to scale the canvas, it's literally adjusted\r\n * to fill all available space within the parent. You should be extremely careful about the size of the\r\n * canvas you're creating when doing this, as the larger the area, the more work the GPU has to do and it's\r\n * very easy to hit fill-rate limits quickly.\r\n * \r\n * For complex, custom-scaling requirements, you should probably consider using the `RESIZE` scale mode,\r\n * with your own limitations in place re: canvas dimensions and managing the scaling with the game scenes\r\n * yourself. For the vast majority of games, however, the `FIT` mode is likely to be the most used.\r\n * \r\n * Please appreciate that the Scale Manager cannot perform miracles. All it does is scale your game canvas\r\n * as best it can, based on what it can infer from its surrounding area. There are all kinds of environments\r\n * where it's up to you to guide and help the canvas position itself, especially when built into rendering\r\n * frameworks like React and Vue. If your page requires meta tags to prevent user scaling gestures, or such\r\n * like, then it's up to you to ensure they are present in the html.\r\n * \r\n * #### Centering\r\n * \r\n * You can also have the game canvas automatically centered. Again, this relies heavily on the parent being\r\n * properly configured and styled, as the centering offsets are based entirely on the available space\r\n * within the parent element. Centering is disabled by default, or can be applied horizontally, vertically,\r\n * or both. Here's an example:\r\n * \r\n * ```javascript\r\n * scale: {\r\n * parent: 'yourgamediv',\r\n * autoCenter: Phaser.Scale.CENTER_BOTH,\r\n * width: 800,\r\n * height: 600\r\n * }\r\n * ```\r\n * \r\n * #### Fullscreen API\r\n * \r\n * If the browser supports it, you can send your game into fullscreen mode. In this mode, the game will fill\r\n * the entire display, removing all browser UI and anything else present on the screen. It will remain in this\r\n * mode until your game either disables it, or until the user tabs out or presses ESCape if on desktop. It's a\r\n * great way to achieve a desktop-game like experience from the browser, but it does require a modern browser\r\n * to handle it. Some mobile browsers also support this.\r\n *\r\n * @class ScaleManager\r\n * @memberof Phaser.Scale\r\n * @extends Phaser.Events.EventEmitter\r\n * @constructor\r\n * @since 3.16.0\r\n *\r\n * @param {Phaser.Game} game - A reference to the Phaser.Game instance.\r\n */\r\nvar ScaleManager = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function ScaleManager (game)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * A reference to the Phaser.Game instance.\r\n *\r\n * @name Phaser.Scale.ScaleManager#game\r\n * @type {Phaser.Game}\r\n * @readonly\r\n * @since 3.15.0\r\n */\r\n this.game = game;\r\n\r\n /**\r\n * A reference to the HTML Canvas Element that Phaser uses to render the game.\r\n *\r\n * @name Phaser.Scale.ScaleManager#canvas\r\n * @type {HTMLCanvasElement}\r\n * @since 3.16.0\r\n */\r\n this.canvas;\r\n\r\n /**\r\n * The DOM bounds of the canvas element.\r\n *\r\n * @name Phaser.Scale.ScaleManager#canvasBounds\r\n * @type {Phaser.Geom.Rectangle}\r\n * @since 3.16.0\r\n */\r\n this.canvasBounds = new Rectangle();\r\n\r\n /**\r\n * The parent object of the Canvas. Often a div, or the browser window, or nothing in non-browser environments.\r\n * \r\n * This is set in the Game Config as the `parent` property. If undefined (or just not present), it will default\r\n * to use the document body. If specifically set to `null` Phaser will ignore all parent operations.\r\n *\r\n * @name Phaser.Scale.ScaleManager#parent\r\n * @type {?any}\r\n * @since 3.16.0\r\n */\r\n this.parent = null;\r\n\r\n /**\r\n * Is the parent element the browser window?\r\n *\r\n * @name Phaser.Scale.ScaleManager#parentIsWindow\r\n * @type {boolean}\r\n * @since 3.16.0\r\n */\r\n this.parentIsWindow = false;\r\n\r\n /**\r\n * The Parent Size component.\r\n *\r\n * @name Phaser.Scale.ScaleManager#parentSize\r\n * @type {Phaser.Structs.Size}\r\n * @since 3.16.0\r\n */\r\n this.parentSize = new Size();\r\n\r\n /**\r\n * The Game Size component.\r\n * \r\n * The un-modified game size, as requested in the game config (the raw width / height),\r\n * as used for world bounds, cameras, etc\r\n *\r\n * @name Phaser.Scale.ScaleManager#gameSize\r\n * @type {Phaser.Structs.Size}\r\n * @since 3.16.0\r\n */\r\n this.gameSize = new Size();\r\n\r\n /**\r\n * The Base Size component.\r\n * \r\n * The modified game size, which is the gameSize * resolution, used to set the canvas width and height\r\n * (but not the CSS style)\r\n *\r\n * @name Phaser.Scale.ScaleManager#baseSize\r\n * @type {Phaser.Structs.Size}\r\n * @since 3.16.0\r\n */\r\n this.baseSize = new Size();\r\n\r\n /**\r\n * The Display Size component.\r\n * \r\n * The size used for the canvas style, factoring in the scale mode, parent and other values.\r\n *\r\n * @name Phaser.Scale.ScaleManager#displaySize\r\n * @type {Phaser.Structs.Size}\r\n * @since 3.16.0\r\n */\r\n this.displaySize = new Size();\r\n\r\n /**\r\n * The game scale mode.\r\n *\r\n * @name Phaser.Scale.ScaleManager#scaleMode\r\n * @type {Phaser.Scale.ScaleModeType}\r\n * @since 3.16.0\r\n */\r\n this.scaleMode = CONST.SCALE_MODE.NONE;\r\n\r\n /**\r\n * The canvas resolution.\r\n * \r\n * This is hard-coded to a value of 1 in the 3.16 release of Phaser and will be enabled at a later date.\r\n *\r\n * @name Phaser.Scale.ScaleManager#resolution\r\n * @type {number}\r\n * @since 3.16.0\r\n */\r\n this.resolution = 1;\r\n\r\n /**\r\n * The game zoom factor.\r\n * \r\n * This value allows you to multiply your games base size by the given zoom factor.\r\n * This is then used when calculating the display size, even in `NONE` situations.\r\n * If you don't want Phaser to touch the canvas style at all, this value should be 1.\r\n * \r\n * Can also be set to `MAX_ZOOM` in which case the zoom value will be derived based\r\n * on the game size and available space within the parent.\r\n *\r\n * @name Phaser.Scale.ScaleManager#zoom\r\n * @type {number}\r\n * @since 3.16.0\r\n */\r\n this.zoom = 1;\r\n\r\n /**\r\n * Internal flag set when the game zoom factor is modified.\r\n *\r\n * @name Phaser.Scale.ScaleManager#_resetZoom\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this._resetZoom = false;\r\n\r\n /**\r\n * The scale factor between the baseSize and the canvasBounds.\r\n *\r\n * @name Phaser.Scale.ScaleManager#displayScale\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\n this.displayScale = new Vector2(1, 1);\r\n\r\n /**\r\n * If set, the canvas sizes will be automatically passed through Math.floor.\r\n * This results in rounded pixel display values, which is important for performance on legacy\r\n * and low powered devices, but at the cost of not achieving a 'perfect' fit in some browser windows.\r\n *\r\n * @name Phaser.Scale.ScaleManager#autoRound\r\n * @type {boolean}\r\n * @since 3.16.0\r\n */\r\n this.autoRound = false;\r\n\r\n /**\r\n * Automatically center the canvas within the parent? The different centering modes are:\r\n * \r\n * 1. No centering.\r\n * 2. Center both horizontally and vertically.\r\n * 3. Center horizontally.\r\n * 4. Center vertically.\r\n * \r\n * Please be aware that in order to center the game canvas, you must have specified a parent\r\n * that has a size set, or the canvas parent is the document.body.\r\n *\r\n * @name Phaser.Scale.ScaleManager#autoCenter\r\n * @type {Phaser.Scale.CenterType}\r\n * @since 3.16.0\r\n */\r\n this.autoCenter = CONST.CENTER.NO_CENTER;\r\n\r\n /**\r\n * The current device orientation.\r\n * \r\n * Orientation events are dispatched via the Device Orientation API, typically only on mobile browsers.\r\n *\r\n * @name Phaser.Scale.ScaleManager#orientation\r\n * @type {Phaser.Scale.OrientationType}\r\n * @since 3.16.0\r\n */\r\n this.orientation = CONST.ORIENTATION.LANDSCAPE;\r\n\r\n /**\r\n * A reference to the Device.Fullscreen object.\r\n *\r\n * @name Phaser.Scale.ScaleManager#fullscreen\r\n * @type {Phaser.Device.Fullscreen}\r\n * @since 3.16.0\r\n */\r\n this.fullscreen;\r\n\r\n /**\r\n * The DOM Element which is sent into fullscreen mode.\r\n *\r\n * @name Phaser.Scale.ScaleManager#fullscreenTarget\r\n * @type {?any}\r\n * @since 3.16.0\r\n */\r\n this.fullscreenTarget = null;\r\n\r\n /**\r\n * Did Phaser create the fullscreen target div, or was it provided in the game config?\r\n *\r\n * @name Phaser.Scale.ScaleManager#_createdFullscreenTarget\r\n * @type {boolean}\r\n * @private\r\n * @since 3.16.0\r\n */\r\n this._createdFullscreenTarget = false;\r\n\r\n /**\r\n * The dirty state of the Scale Manager.\r\n * Set if there is a change between the parent size and the current size.\r\n *\r\n * @name Phaser.Scale.ScaleManager#dirty\r\n * @type {boolean}\r\n * @since 3.16.0\r\n */\r\n this.dirty = false;\r\n\r\n /**\r\n * How many milliseconds should elapse before checking if the browser size has changed?\r\n * \r\n * Most modern browsers dispatch a 'resize' event, which the Scale Manager will listen for.\r\n * However, older browsers fail to do this, or do it consistently, so we fall back to a\r\n * more traditional 'size check' based on a time interval. You can control how often it is\r\n * checked here.\r\n *\r\n * @name Phaser.Scale.ScaleManager#resizeInterval\r\n * @type {integer}\r\n * @since 3.16.0\r\n */\r\n this.resizeInterval = 500;\r\n\r\n /**\r\n * Internal size interval tracker.\r\n *\r\n * @name Phaser.Scale.ScaleManager#_lastCheck\r\n * @type {integer}\r\n * @private\r\n * @since 3.16.0\r\n */\r\n this._lastCheck = 0;\r\n\r\n /**\r\n * Internal flag to check orientation state.\r\n *\r\n * @name Phaser.Scale.ScaleManager#_checkOrientation\r\n * @type {boolean}\r\n * @private\r\n * @since 3.16.0\r\n */\r\n this._checkOrientation = false;\r\n\r\n /**\r\n * Internal object containing our defined event listeners.\r\n *\r\n * @name Phaser.Scale.ScaleManager#listeners\r\n * @type {object}\r\n * @private\r\n * @since 3.16.0\r\n */\r\n this.listeners = {\r\n\r\n orientationChange: NOOP,\r\n windowResize: NOOP,\r\n fullScreenChange: NOOP,\r\n fullScreenError: NOOP\r\n\r\n };\r\n },\r\n\r\n /**\r\n * Called _before_ the canvas object is created and added to the DOM.\r\n *\r\n * @method Phaser.Scale.ScaleManager#preBoot\r\n * @protected\r\n * @listens Phaser.Core.Events#BOOT\r\n * @since 3.16.0\r\n */\r\n preBoot: function ()\r\n {\r\n // Parse the config to get the scaling values we need\r\n this.parseConfig(this.game.config);\r\n\r\n this.game.events.once('boot', this.boot, this);\r\n },\r\n\r\n /**\r\n * The Boot handler is called by Phaser.Game when it first starts up.\r\n * The renderer is available by now and the canvas has been added to the DOM.\r\n *\r\n * @method Phaser.Scale.ScaleManager#boot\r\n * @protected\r\n * @fires Phaser.Scale.Events#RESIZE\r\n * @since 3.16.0\r\n */\r\n boot: function ()\r\n {\r\n var game = this.game;\r\n\r\n this.canvas = game.canvas;\r\n\r\n this.fullscreen = game.device.fullscreen;\r\n\r\n if (this.scaleMode !== CONST.SCALE_MODE.RESIZE)\r\n {\r\n this.displaySize.setAspectMode(this.scaleMode);\r\n }\r\n\r\n if (this.scaleMode === CONST.SCALE_MODE.NONE)\r\n {\r\n this.resize(this.width, this.height);\r\n }\r\n else\r\n {\r\n this.getParentBounds();\r\n\r\n // Only set the parent bounds if the parent has an actual size\r\n if (this.parentSize.width > 0 && this.parentSize.height > 0)\r\n {\r\n this.displaySize.setParent(this.parentSize);\r\n }\r\n\r\n this.refresh();\r\n }\r\n\r\n game.events.on(GameEvents.PRE_STEP, this.step, this);\r\n game.events.once(GameEvents.DESTROY, this.destroy, this);\r\n\r\n this.startListeners();\r\n },\r\n\r\n /**\r\n * Parses the game configuration to set-up the scale defaults.\r\n *\r\n * @method Phaser.Scale.ScaleManager#parseConfig\r\n * @protected\r\n * @since 3.16.0\r\n * \r\n * @param {Phaser.Types.Core.GameConfig} config - The Game configuration object.\r\n */\r\n parseConfig: function (config)\r\n {\r\n // Get the parent element, if any\r\n this.getParent(config);\r\n \r\n // Get the size of the parent element\r\n // This can often set a height of zero (especially for un-styled divs)\r\n this.getParentBounds();\r\n\r\n var width = config.width;\r\n var height = config.height;\r\n var scaleMode = config.scaleMode;\r\n var resolution = config.resolution;\r\n var zoom = config.zoom;\r\n var autoRound = config.autoRound;\r\n\r\n // If width = '100%', or similar value\r\n if (typeof width === 'string')\r\n {\r\n // If we have a parent with a height, we'll work it out from that\r\n var parentWidth = this.parentSize.width;\r\n\r\n if (parentWidth === 0)\r\n {\r\n parentWidth = window.innerWidth;\r\n }\r\n\r\n var parentScaleX = parseInt(width, 10) / 100;\r\n\r\n width = Math.floor(parentWidth * parentScaleX);\r\n }\r\n\r\n // If height = '100%', or similar value\r\n if (typeof height === 'string')\r\n {\r\n // If we have a parent with a height, we'll work it out from that\r\n var parentHeight = this.parentSize.height;\r\n\r\n if (parentHeight === 0)\r\n {\r\n parentHeight = window.innerHeight;\r\n }\r\n\r\n var parentScaleY = parseInt(height, 10) / 100;\r\n\r\n height = Math.floor(parentHeight * parentScaleY);\r\n }\r\n\r\n // This is fixed at 1 on purpose.\r\n // Changing it will break all user input.\r\n // Wait for another release to solve this issue.\r\n this.resolution = 1;\r\n\r\n this.scaleMode = scaleMode;\r\n\r\n this.autoRound = autoRound;\r\n\r\n this.autoCenter = config.autoCenter;\r\n\r\n this.resizeInterval = config.resizeInterval;\r\n\r\n if (autoRound)\r\n {\r\n width = Math.floor(width);\r\n height = Math.floor(height);\r\n }\r\n\r\n // The un-modified game size, as requested in the game config (the raw width / height) as used for world bounds, etc\r\n this.gameSize.setSize(width, height);\r\n\r\n if (zoom === CONST.ZOOM.MAX_ZOOM)\r\n {\r\n zoom = this.getMaxZoom();\r\n }\r\n\r\n this.zoom = zoom;\r\n\r\n if (zoom !== 1)\r\n {\r\n this._resetZoom = true;\r\n }\r\n\r\n // The modified game size, which is the w/h * resolution\r\n this.baseSize.setSize(width * resolution, height * resolution);\r\n\r\n if (autoRound)\r\n {\r\n this.baseSize.width = Math.floor(this.baseSize.width);\r\n this.baseSize.height = Math.floor(this.baseSize.height);\r\n }\r\n\r\n if (config.minWidth > 0)\r\n {\r\n this.displaySize.setMin(config.minWidth * zoom, config.minHeight * zoom);\r\n }\r\n\r\n if (config.maxWidth > 0)\r\n {\r\n this.displaySize.setMax(config.maxWidth * zoom, config.maxHeight * zoom);\r\n }\r\n\r\n // The size used for the canvas style, factoring in the scale mode and parent and zoom value\r\n // We just use the w/h here as this is what sets the aspect ratio (which doesn't then change)\r\n this.displaySize.setSize(width, height);\r\n\r\n this.orientation = GetScreenOrientation(width, height);\r\n },\r\n\r\n /**\r\n * Determines the parent element of the game canvas, if any, based on the game configuration.\r\n *\r\n * @method Phaser.Scale.ScaleManager#getParent\r\n * @since 3.16.0\r\n * \r\n * @param {Phaser.Types.Core.GameConfig} config - The Game configuration object.\r\n */\r\n getParent: function (config)\r\n {\r\n var parent = config.parent;\r\n\r\n if (parent === null)\r\n {\r\n // User is responsible for managing the parent\r\n return;\r\n }\r\n\r\n this.parent = GetTarget(parent);\r\n this.parentIsWindow = (this.parent === document.body);\r\n\r\n if (config.expandParent && config.scaleMode !== CONST.SCALE_MODE.NONE)\r\n {\r\n var DOMRect = this.parent.getBoundingClientRect();\r\n\r\n if (this.parentIsWindow || DOMRect.height === 0)\r\n {\r\n document.documentElement.style.height = '100%';\r\n document.body.style.height = '100%';\r\n\r\n DOMRect = this.parent.getBoundingClientRect();\r\n\r\n // The parent STILL has no height, clearly no CSS\r\n // has been set on it even though we fixed the body :(\r\n if (!this.parentIsWindow && DOMRect.height === 0)\r\n {\r\n this.parent.style.overflow = 'hidden';\r\n this.parent.style.width = '100%';\r\n this.parent.style.height = '100%';\r\n }\r\n }\r\n }\r\n\r\n // And now get the fullscreenTarget\r\n if (config.fullscreenTarget && !this.fullscreenTarget)\r\n {\r\n this.fullscreenTarget = GetTarget(config.fullscreenTarget);\r\n }\r\n },\r\n\r\n /**\r\n * Calculates the size of the parent bounds and updates the `parentSize` component, if the canvas has a dom parent.\r\n *\r\n * @method Phaser.Scale.ScaleManager#getParentBounds\r\n * @since 3.16.0\r\n * \r\n * @return {boolean} `true` if the parent bounds have changed size, otherwise `false`.\r\n */\r\n getParentBounds: function ()\r\n {\r\n if (!this.parent)\r\n {\r\n return false;\r\n }\r\n\r\n var parentSize = this.parentSize;\r\n\r\n // Ref. http://msdn.microsoft.com/en-us/library/hh781509(v=vs.85).aspx for getBoundingClientRect\r\n\r\n var DOMRect = this.parent.getBoundingClientRect();\r\n\r\n if (this.parentIsWindow && this.game.device.os.iOS)\r\n {\r\n DOMRect.height = GetInnerHeight(true);\r\n }\r\n\r\n var resolution = this.resolution;\r\n var newWidth = DOMRect.width * resolution;\r\n var newHeight = DOMRect.height * resolution;\r\n\r\n if (parentSize.width !== newWidth || parentSize.height !== newHeight)\r\n {\r\n parentSize.setSize(newWidth, newHeight);\r\n\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n },\r\n\r\n /**\r\n * Attempts to lock the orientation of the web browser using the Screen Orientation API.\r\n * \r\n * This API is only available on modern mobile browsers.\r\n * See https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation for details.\r\n *\r\n * @method Phaser.Scale.ScaleManager#lockOrientation\r\n * @since 3.16.0\r\n * \r\n * @param {string} orientation - The orientation you'd like to lock the browser in. Should be an API string such as 'landscape', 'landscape-primary', 'portrait', etc.\r\n * \r\n * @return {boolean} `true` if the orientation was successfully locked, otherwise `false`.\r\n */\r\n lockOrientation: function (orientation)\r\n {\r\n var lock = screen.lockOrientation || screen.mozLockOrientation || screen.msLockOrientation;\r\n\r\n if (lock)\r\n {\r\n return lock(orientation);\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * This method will set the size of the Parent Size component, which is used in scaling\r\n * and centering calculations. You only need to call this method if you have explicitly\r\n * disabled the use of a parent in your game config, but still wish to take advantage of\r\n * other Scale Manager features.\r\n *\r\n * @method Phaser.Scale.ScaleManager#setParentSize\r\n * @fires Phaser.Scale.Events#RESIZE\r\n * @since 3.16.0\r\n * \r\n * @param {number} width - The new width of the parent.\r\n * @param {number} height - The new height of the parent.\r\n * \r\n * @return {this} The Scale Manager instance.\r\n */\r\n setParentSize: function (width, height)\r\n {\r\n this.parentSize.setSize(width, height);\r\n\r\n return this.refresh();\r\n },\r\n\r\n /**\r\n * This method will set a new size for your game.\r\n * \r\n * It should only be used if you're looking to change the base size of your game and are using\r\n * one of the Scale Manager scaling modes, i.e. `FIT`. If you're using `NONE` and wish to\r\n * change the game and canvas size directly, then please use the `resize` method instead.\r\n *\r\n * @method Phaser.Scale.ScaleManager#setGameSize\r\n * @fires Phaser.Scale.Events#RESIZE\r\n * @since 3.16.0\r\n * \r\n * @param {number} width - The new width of the game.\r\n * @param {number} height - The new height of the game.\r\n * \r\n * @return {this} The Scale Manager instance.\r\n */\r\n setGameSize: function (width, height)\r\n {\r\n var autoRound = this.autoRound;\r\n var resolution = this.resolution;\r\n\r\n if (autoRound)\r\n {\r\n width = Math.floor(width);\r\n height = Math.floor(height);\r\n }\r\n\r\n var previousWidth = this.width;\r\n var previousHeight = this.height;\r\n\r\n // The un-modified game size, as requested in the game config (the raw width / height) as used for world bounds, etc\r\n this.gameSize.resize(width, height);\r\n\r\n // The modified game size, which is the w/h * resolution\r\n this.baseSize.resize(width * resolution, height * resolution);\r\n\r\n if (autoRound)\r\n {\r\n this.baseSize.width = Math.floor(this.baseSize.width);\r\n this.baseSize.height = Math.floor(this.baseSize.height);\r\n }\r\n\r\n // The size used for the canvas style, factoring in the scale mode and parent and zoom value\r\n // We just use the w/h here as this is what sets the aspect ratio (which doesn't then change)\r\n this.displaySize.setSize(width, height);\r\n\r\n this.canvas.width = this.baseSize.width;\r\n this.canvas.height = this.baseSize.height;\r\n\r\n return this.refresh(previousWidth, previousHeight);\r\n },\r\n\r\n /**\r\n * Call this to modify the size of the Phaser canvas element directly.\r\n * You should only use this if you are using the `NONE` scale mode,\r\n * it will update all internal components completely.\r\n * \r\n * If all you want to do is change the size of the parent, see the `setParentSize` method.\r\n * \r\n * If all you want is to change the base size of the game, but still have the Scale Manager\r\n * manage all the scaling (i.e. you're **not** using `NONE`), then see the `setGameSize` method.\r\n * \r\n * This method will set the `gameSize`, `baseSize` and `displaySize` components to the given\r\n * dimensions. It will then resize the canvas width and height to the values given, by\r\n * directly setting the properties. Finally, if you have set the Scale Manager zoom value\r\n * to anything other than 1 (the default), it will set the canvas CSS width and height to\r\n * be the given size multiplied by the zoom factor (the canvas pixel size remains untouched).\r\n * \r\n * If you have enabled `autoCenter`, it is then passed to the `updateCenter` method and\r\n * the margins are set, allowing the canvas to be centered based on its parent element\r\n * alone. Finally, the `displayScale` is adjusted and the RESIZE event dispatched.\r\n *\r\n * @method Phaser.Scale.ScaleManager#resize\r\n * @fires Phaser.Scale.Events#RESIZE\r\n * @since 3.16.0\r\n * \r\n * @param {number} width - The new width of the game.\r\n * @param {number} height - The new height of the game.\r\n * \r\n * @return {this} The Scale Manager instance.\r\n */\r\n resize: function (width, height)\r\n {\r\n var zoom = this.zoom;\r\n var resolution = this.resolution;\r\n var autoRound = this.autoRound;\r\n\r\n if (autoRound)\r\n {\r\n width = Math.floor(width);\r\n height = Math.floor(height);\r\n }\r\n\r\n var previousWidth = this.width;\r\n var previousHeight = this.height;\r\n\r\n // The un-modified game size, as requested in the game config (the raw width / height) as used for world bounds, etc\r\n this.gameSize.resize(width, height);\r\n\r\n // The modified game size, which is the w/h * resolution\r\n this.baseSize.resize(width * resolution, height * resolution);\r\n\r\n if (autoRound)\r\n {\r\n this.baseSize.width = Math.floor(this.baseSize.width);\r\n this.baseSize.height = Math.floor(this.baseSize.height);\r\n }\r\n\r\n // The size used for the canvas style, factoring in the scale mode and parent and zoom value\r\n // We just use the w/h here as this is what sets the aspect ratio (which doesn't then change)\r\n this.displaySize.setSize((width * zoom) * resolution, (height * zoom) * resolution);\r\n\r\n this.canvas.width = this.baseSize.width;\r\n this.canvas.height = this.baseSize.height;\r\n\r\n var style = this.canvas.style;\r\n\r\n var styleWidth = width * zoom;\r\n var styleHeight = height * zoom;\r\n\r\n if (autoRound)\r\n {\r\n styleWidth = Math.floor(styleWidth);\r\n styleHeight = Math.floor(styleHeight);\r\n }\r\n\r\n if (styleWidth !== width || styleHeight !== height)\r\n {\r\n style.width = styleWidth + 'px';\r\n style.height = styleHeight + 'px';\r\n }\r\n\r\n return this.refresh(previousWidth, previousHeight);\r\n },\r\n\r\n /**\r\n * Sets the zoom value of the Scale Manager.\r\n *\r\n * @method Phaser.Scale.ScaleManager#setZoom\r\n * @fires Phaser.Scale.Events#RESIZE\r\n * @since 3.16.0\r\n * \r\n * @param {integer} value - The new zoom value of the game.\r\n * \r\n * @return {this} The Scale Manager instance.\r\n */\r\n setZoom: function (value)\r\n {\r\n this.zoom = value;\r\n this._resetZoom = true;\r\n\r\n return this.refresh();\r\n },\r\n\r\n /**\r\n * Sets the zoom to be the maximum possible based on the _current_ parent size.\r\n *\r\n * @method Phaser.Scale.ScaleManager#setMaxZoom\r\n * @fires Phaser.Scale.Events#RESIZE\r\n * @since 3.16.0\r\n * \r\n * @return {this} The Scale Manager instance.\r\n */\r\n setMaxZoom: function ()\r\n {\r\n this.zoom = this.getMaxZoom();\r\n this._resetZoom = true;\r\n\r\n return this.refresh();\r\n },\r\n\r\n /**\r\n * Refreshes the internal scale values, bounds sizes and orientation checks.\r\n * \r\n * Once finished, dispatches the resize event.\r\n * \r\n * This is called automatically by the Scale Manager when the browser window size changes,\r\n * as long as it is using a Scale Mode other than 'NONE'.\r\n *\r\n * @method Phaser.Scale.ScaleManager#refresh\r\n * @fires Phaser.Scale.Events#RESIZE\r\n * @since 3.16.0\r\n * \r\n * @param {number} [previousWidth] - The previous width of the game. Only set if the gameSize has changed.\r\n * @param {number} [previousHeight] - The previous height of the game. Only set if the gameSize has changed.\r\n * \r\n * @return {this} The Scale Manager instance.\r\n */\r\n refresh: function (previousWidth, previousHeight)\r\n {\r\n if (previousWidth === undefined) { previousWidth = this.width; }\r\n if (previousHeight === undefined) { previousHeight = this.height; }\r\n\r\n this.updateScale();\r\n this.updateBounds();\r\n this.updateOrientation();\r\n\r\n this.displayScale.set(this.baseSize.width / this.canvasBounds.width, this.baseSize.height / this.canvasBounds.height);\r\n\r\n var domContainer = this.game.domContainer;\r\n\r\n if (domContainer)\r\n {\r\n this.baseSize.setCSS(domContainer);\r\n\r\n var canvasStyle = this.canvas.style;\r\n var domStyle = domContainer.style;\r\n\r\n domStyle.transform = 'scale(' + this.displaySize.width / this.baseSize.width + ',' + this.displaySize.height / this.baseSize.height + ')';\r\n\r\n domStyle.marginLeft = canvasStyle.marginLeft;\r\n domStyle.marginTop = canvasStyle.marginTop;\r\n }\r\n\r\n this.emit(Events.RESIZE, this.gameSize, this.baseSize, this.displaySize, this.resolution, previousWidth, previousHeight);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal method that checks the current screen orientation, only if the internal check flag is set.\r\n * \r\n * If the orientation has changed it updates the orientation property and then dispatches the orientation change event.\r\n *\r\n * @method Phaser.Scale.ScaleManager#updateOrientation\r\n * @fires Phaser.Scale.Events#ORIENTATION_CHANGE\r\n * @since 3.16.0\r\n */\r\n updateOrientation: function ()\r\n {\r\n if (this._checkOrientation)\r\n {\r\n this._checkOrientation = false;\r\n\r\n var newOrientation = GetScreenOrientation(this.width, this.height);\r\n\r\n if (newOrientation !== this.orientation)\r\n {\r\n this.orientation = newOrientation;\r\n \r\n this.emit(Events.ORIENTATION_CHANGE, newOrientation);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Internal method that manages updating the size components based on the scale mode.\r\n *\r\n * @method Phaser.Scale.ScaleManager#updateScale\r\n * @since 3.16.0\r\n */\r\n updateScale: function ()\r\n {\r\n var style = this.canvas.style;\r\n\r\n var width = this.gameSize.width;\r\n var height = this.gameSize.height;\r\n\r\n var styleWidth;\r\n var styleHeight;\r\n\r\n var zoom = this.zoom;\r\n var autoRound = this.autoRound;\r\n var resolution = 1;\r\n\r\n if (this.scaleMode === CONST.SCALE_MODE.NONE)\r\n {\r\n // No scale\r\n this.displaySize.setSize((width * zoom) * resolution, (height * zoom) * resolution);\r\n\r\n styleWidth = this.displaySize.width / resolution;\r\n styleHeight = this.displaySize.height / resolution;\r\n\r\n if (autoRound)\r\n {\r\n styleWidth = Math.floor(styleWidth);\r\n styleHeight = Math.floor(styleHeight);\r\n }\r\n\r\n if (this._resetZoom)\r\n {\r\n style.width = styleWidth + 'px';\r\n style.height = styleHeight + 'px';\r\n\r\n this._resetZoom = false;\r\n }\r\n }\r\n else if (this.scaleMode === CONST.SCALE_MODE.RESIZE)\r\n {\r\n // Resize to match parent\r\n\r\n // This will constrain using min/max\r\n this.displaySize.setSize(this.parentSize.width, this.parentSize.height);\r\n\r\n this.gameSize.setSize(this.displaySize.width, this.displaySize.height);\r\n\r\n this.baseSize.setSize(this.displaySize.width * resolution, this.displaySize.height * resolution);\r\n\r\n styleWidth = this.displaySize.width / resolution;\r\n styleHeight = this.displaySize.height / resolution;\r\n\r\n if (autoRound)\r\n {\r\n styleWidth = Math.floor(styleWidth);\r\n styleHeight = Math.floor(styleHeight);\r\n }\r\n\r\n this.canvas.width = styleWidth;\r\n this.canvas.height = styleHeight;\r\n }\r\n else\r\n {\r\n // All other scale modes\r\n this.displaySize.setSize(this.parentSize.width, this.parentSize.height);\r\n\r\n styleWidth = this.displaySize.width / resolution;\r\n styleHeight = this.displaySize.height / resolution;\r\n\r\n if (autoRound)\r\n {\r\n styleWidth = Math.floor(styleWidth);\r\n styleHeight = Math.floor(styleHeight);\r\n }\r\n\r\n style.width = styleWidth + 'px';\r\n style.height = styleHeight + 'px';\r\n }\r\n\r\n // Update the parentSize in case the canvas / style change modified it\r\n this.getParentBounds();\r\n\r\n // Finally, update the centering\r\n this.updateCenter();\r\n },\r\n\r\n /**\r\n * Calculates and returns the largest possible zoom factor, based on the current\r\n * parent and game sizes. If the parent has no dimensions (i.e. an unstyled div),\r\n * or is smaller than the un-zoomed game, then this will return a value of 1 (no zoom)\r\n *\r\n * @method Phaser.Scale.ScaleManager#getMaxZoom\r\n * @since 3.16.0\r\n * \r\n * @return {integer} The maximum possible zoom factor. At a minimum this value is always at least 1.\r\n */\r\n getMaxZoom: function ()\r\n {\r\n var zoomH = SnapFloor(this.parentSize.width, this.gameSize.width, 0, true);\r\n var zoomV = SnapFloor(this.parentSize.height, this.gameSize.height, 0, true);\r\n \r\n return Math.max(Math.min(zoomH, zoomV), 1);\r\n },\r\n\r\n /**\r\n * Calculates and updates the canvas CSS style in order to center it within the\r\n * bounds of its parent. If you have explicitly set parent to be `null` in your\r\n * game config then this method will likely give incorrect results unless you have called the\r\n * `setParentSize` method first.\r\n * \r\n * It works by modifying the canvas CSS `marginLeft` and `marginTop` properties.\r\n * \r\n * If they have already been set by your own style sheet, or code, this will overwrite them.\r\n * \r\n * To prevent the Scale Manager from centering the canvas, either do not set the\r\n * `autoCenter` property in your game config, or make sure it is set to `NO_CENTER`.\r\n *\r\n * @method Phaser.Scale.ScaleManager#updateCenter\r\n * @since 3.16.0\r\n */\r\n updateCenter: function ()\r\n {\r\n var autoCenter = this.autoCenter;\r\n\r\n if (autoCenter === CONST.CENTER.NO_CENTER)\r\n {\r\n return;\r\n }\r\n\r\n var canvas = this.canvas;\r\n\r\n var style = canvas.style;\r\n\r\n var bounds = canvas.getBoundingClientRect();\r\n\r\n // var width = parseInt(canvas.style.width, 10) || canvas.width;\r\n // var height = parseInt(canvas.style.height, 10) || canvas.height;\r\n\r\n var width = bounds.width;\r\n var height = bounds.height;\r\n\r\n var offsetX = Math.floor((this.parentSize.width - width) / 2);\r\n var offsetY = Math.floor((this.parentSize.height - height) / 2);\r\n\r\n if (autoCenter === CONST.CENTER.CENTER_HORIZONTALLY)\r\n {\r\n offsetY = 0;\r\n }\r\n else if (autoCenter === CONST.CENTER.CENTER_VERTICALLY)\r\n {\r\n offsetX = 0;\r\n }\r\n\r\n style.marginLeft = offsetX + 'px';\r\n style.marginTop = offsetY + 'px';\r\n },\r\n\r\n /**\r\n * Updates the `canvasBounds` rectangle to match the bounding client rectangle of the\r\n * canvas element being used to track input events.\r\n *\r\n * @method Phaser.Scale.ScaleManager#updateBounds\r\n * @since 3.16.0\r\n */\r\n updateBounds: function ()\r\n {\r\n var bounds = this.canvasBounds;\r\n var clientRect = this.canvas.getBoundingClientRect();\r\n\r\n bounds.x = clientRect.left + (window.pageXOffset || 0) - (document.documentElement.clientLeft || 0);\r\n bounds.y = clientRect.top + (window.pageYOffset || 0) - (document.documentElement.clientTop || 0);\r\n bounds.width = clientRect.width;\r\n bounds.height = clientRect.height;\r\n },\r\n\r\n /**\r\n * Transforms the pageX value into the scaled coordinate space of the Scale Manager.\r\n *\r\n * @method Phaser.Scale.ScaleManager#transformX\r\n * @since 3.16.0\r\n *\r\n * @param {number} pageX - The DOM pageX value.\r\n *\r\n * @return {number} The translated value.\r\n */\r\n transformX: function (pageX)\r\n {\r\n return (pageX - this.canvasBounds.left) * this.displayScale.x;\r\n },\r\n\r\n /**\r\n * Transforms the pageY value into the scaled coordinate space of the Scale Manager.\r\n *\r\n * @method Phaser.Scale.ScaleManager#transformY\r\n * @since 3.16.0\r\n *\r\n * @param {number} pageY - The DOM pageY value.\r\n *\r\n * @return {number} The translated value.\r\n */\r\n transformY: function (pageY)\r\n {\r\n return (pageY - this.canvasBounds.top) * this.displayScale.y;\r\n },\r\n\r\n /**\r\n * Sends a request to the browser to ask it to go in to full screen mode, using the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API Fullscreen API}.\r\n * \r\n * If the browser does not support this, a `FULLSCREEN_UNSUPPORTED` event will be emitted.\r\n * \r\n * This method _must_ be called from a user-input gesture, such as `pointerup`. You cannot launch\r\n * games fullscreen without this, as most browsers block it. Games within an iframe will also be blocked\r\n * from fullscreen unless the iframe has the `allowfullscreen` attribute.\r\n * \r\n * On touch devices, such as Android and iOS Safari, you should always use `pointerup` and NOT `pointerdown`,\r\n * otherwise the request will fail unless the document in which your game is embedded has already received\r\n * some form of touch input, which you cannot guarantee. Activating fullscreen via `pointerup` circumvents\r\n * this issue.\r\n * \r\n * Performing an action that navigates to another page, or opens another tab, will automatically cancel\r\n * fullscreen mode, as will the user pressing the ESC key. To cancel fullscreen mode directly from your game,\r\n * i.e. by clicking an icon, call the `stopFullscreen` method.\r\n * \r\n * A browser can only send one DOM element into fullscreen. You can control which element this is by\r\n * setting the `fullscreenTarget` property in your game config, or changing the property in the Scale Manager.\r\n * Note that the game canvas _must_ be a child of the target. If you do not give a target, Phaser will\r\n * automatically create a blank `
` element and move the canvas into it, before going fullscreen.\r\n * When it leaves fullscreen, the div will be removed.\r\n *\r\n * @method Phaser.Scale.ScaleManager#startFullscreen\r\n * @fires Phaser.Scale.Events#ENTER_FULLSCREEN\r\n * @fires Phaser.Scale.Events#FULLSCREEN_FAILED\r\n * @fires Phaser.Scale.Events#FULLSCREEN_UNSUPPORTED\r\n * @fires Phaser.Scale.Events#RESIZE\r\n * @since 3.16.0\r\n * \r\n * @param {object} [fullscreenOptions] - The FullscreenOptions dictionary is used to provide configuration options when entering full screen.\r\n */\r\n startFullscreen: function (fullscreenOptions)\r\n {\r\n if (fullscreenOptions === undefined) { fullscreenOptions = { navigationUI: 'hide' }; }\r\n\r\n var fullscreen = this.fullscreen;\r\n\r\n if (!fullscreen.available)\r\n {\r\n this.emit(Events.FULLSCREEN_UNSUPPORTED);\r\n\r\n return;\r\n }\r\n\r\n if (!fullscreen.active)\r\n {\r\n var fsTarget = this.getFullscreenTarget();\r\n\r\n var fsPromise;\r\n \r\n if (fullscreen.keyboard)\r\n {\r\n fsPromise = fsTarget[fullscreen.request](Element.ALLOW_KEYBOARD_INPUT);\r\n }\r\n else\r\n {\r\n fsPromise = fsTarget[fullscreen.request](fullscreenOptions);\r\n }\r\n\r\n if (fsPromise)\r\n {\r\n fsPromise.then(this.fullscreenSuccessHandler.bind(this)).catch(this.fullscreenErrorHandler.bind(this));\r\n }\r\n else if (fullscreen.active)\r\n {\r\n this.fullscreenSuccessHandler();\r\n }\r\n else\r\n {\r\n this.fullscreenErrorHandler();\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * The browser has successfully entered fullscreen mode.\r\n *\r\n * @method Phaser.Scale.ScaleManager#fullscreenSuccessHandler\r\n * @private\r\n * @fires Phaser.Scale.Events#ENTER_FULLSCREEN\r\n * @fires Phaser.Scale.Events#RESIZE\r\n * @since 3.17.0\r\n */\r\n fullscreenSuccessHandler: function ()\r\n {\r\n this.getParentBounds();\r\n\r\n this.refresh();\r\n\r\n this.emit(Events.ENTER_FULLSCREEN);\r\n },\r\n\r\n /**\r\n * The browser failed to enter fullscreen mode.\r\n *\r\n * @method Phaser.Scale.ScaleManager#fullscreenErrorHandler\r\n * @private\r\n * @fires Phaser.Scale.Events#FULLSCREEN_FAILED\r\n * @fires Phaser.Scale.Events#RESIZE\r\n * @since 3.17.0\r\n * \r\n * @param {any} error - The DOM error event.\r\n */\r\n fullscreenErrorHandler: function (error)\r\n {\r\n this.removeFullscreenTarget();\r\n\r\n this.emit(Events.FULLSCREEN_FAILED, error);\r\n },\r\n\r\n /**\r\n * An internal method that gets the target element that is used when entering fullscreen mode.\r\n *\r\n * @method Phaser.Scale.ScaleManager#getFullscreenTarget\r\n * @since 3.16.0\r\n * \r\n * @return {object} The fullscreen target element.\r\n */\r\n getFullscreenTarget: function ()\r\n {\r\n if (!this.fullscreenTarget)\r\n {\r\n var fsTarget = document.createElement('div');\r\n\r\n fsTarget.style.margin = '0';\r\n fsTarget.style.padding = '0';\r\n fsTarget.style.width = '100%';\r\n fsTarget.style.height = '100%';\r\n\r\n this.fullscreenTarget = fsTarget;\r\n\r\n this._createdFullscreenTarget = true;\r\n }\r\n\r\n if (this._createdFullscreenTarget)\r\n {\r\n var canvasParent = this.canvas.parentNode;\r\n\r\n canvasParent.insertBefore(this.fullscreenTarget, this.canvas);\r\n\r\n this.fullscreenTarget.appendChild(this.canvas);\r\n }\r\n\r\n return this.fullscreenTarget;\r\n },\r\n\r\n /**\r\n * Removes the fullscreen target that was added to the DOM.\r\n *\r\n * @method Phaser.Scale.ScaleManager#removeFullscreenTarget\r\n * @since 3.17.0\r\n */\r\n removeFullscreenTarget: function ()\r\n {\r\n if (this._createdFullscreenTarget)\r\n {\r\n var fsTarget = this.fullscreenTarget;\r\n\r\n if (fsTarget && fsTarget.parentNode)\r\n {\r\n var parent = fsTarget.parentNode;\r\n\r\n parent.insertBefore(this.canvas, fsTarget);\r\n\r\n parent.removeChild(fsTarget);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Calling this method will cancel fullscreen mode, if the browser has entered it.\r\n *\r\n * @method Phaser.Scale.ScaleManager#stopFullscreen\r\n * @fires Phaser.Scale.Events#LEAVE_FULLSCREEN\r\n * @fires Phaser.Scale.Events#FULLSCREEN_UNSUPPORTED\r\n * @since 3.16.0\r\n */\r\n stopFullscreen: function ()\r\n {\r\n var fullscreen = this.fullscreen;\r\n\r\n if (!fullscreen.available)\r\n {\r\n this.emit(Events.FULLSCREEN_UNSUPPORTED);\r\n\r\n return false;\r\n }\r\n\r\n if (fullscreen.active)\r\n {\r\n document[fullscreen.cancel]();\r\n }\r\n\r\n this.removeFullscreenTarget();\r\n\r\n // Get the parent size again as it will have changed\r\n this.getParentBounds();\r\n\r\n this.emit(Events.LEAVE_FULLSCREEN);\r\n\r\n this.refresh();\r\n },\r\n\r\n /**\r\n * Toggles the fullscreen mode. If already in fullscreen, calling this will cancel it.\r\n * If not in fullscreen, this will request the browser to enter fullscreen mode.\r\n * \r\n * If the browser does not support this, a `FULLSCREEN_UNSUPPORTED` event will be emitted.\r\n * \r\n * This method _must_ be called from a user-input gesture, such as `pointerdown`. You cannot launch\r\n * games fullscreen without this, as most browsers block it. Games within an iframe will also be blocked\r\n * from fullscreen unless the iframe has the `allowfullscreen` attribute.\r\n *\r\n * @method Phaser.Scale.ScaleManager#toggleFullscreen\r\n * @fires Phaser.Scale.Events#ENTER_FULLSCREEN\r\n * @fires Phaser.Scale.Events#LEAVE_FULLSCREEN\r\n * @fires Phaser.Scale.Events#FULLSCREEN_UNSUPPORTED\r\n * @fires Phaser.Scale.Events#RESIZE\r\n * @since 3.16.0\r\n * \r\n * @param {object} [fullscreenOptions] - The FullscreenOptions dictionary is used to provide configuration options when entering full screen.\r\n */\r\n toggleFullscreen: function (fullscreenOptions)\r\n {\r\n if (this.fullscreen.active)\r\n {\r\n this.stopFullscreen();\r\n }\r\n else\r\n {\r\n this.startFullscreen(fullscreenOptions);\r\n }\r\n },\r\n\r\n /**\r\n * An internal method that starts the different DOM event listeners running.\r\n *\r\n * @method Phaser.Scale.ScaleManager#startListeners\r\n * @since 3.16.0\r\n */\r\n startListeners: function ()\r\n {\r\n var _this = this;\r\n var listeners = this.listeners;\r\n\r\n listeners.orientationChange = function ()\r\n {\r\n _this._checkOrientation = true;\r\n _this.dirty = true;\r\n };\r\n\r\n listeners.windowResize = function ()\r\n {\r\n _this.dirty = true;\r\n };\r\n\r\n // Only dispatched on mobile devices\r\n window.addEventListener('orientationchange', listeners.orientationChange, false);\r\n\r\n window.addEventListener('resize', listeners.windowResize, false);\r\n\r\n if (this.fullscreen.available)\r\n {\r\n listeners.fullScreenChange = function (event)\r\n {\r\n return _this.onFullScreenChange(event);\r\n };\r\n\r\n listeners.fullScreenError = function (event)\r\n {\r\n return _this.onFullScreenError(event);\r\n };\r\n\r\n var vendors = [ 'webkit', 'moz', '' ];\r\n\r\n vendors.forEach(function (prefix)\r\n {\r\n document.addEventListener(prefix + 'fullscreenchange', listeners.fullScreenChange, false);\r\n document.addEventListener(prefix + 'fullscreenerror', listeners.fullScreenError, false);\r\n });\r\n\r\n // MS Specific\r\n document.addEventListener('MSFullscreenChange', listeners.fullScreenChange, false);\r\n document.addEventListener('MSFullscreenError', listeners.fullScreenError, false);\r\n }\r\n },\r\n\r\n /**\r\n * Triggered when a fullscreenchange event is dispatched by the DOM.\r\n *\r\n * @method Phaser.Scale.ScaleManager#onFullScreenChange\r\n * @since 3.16.0\r\n */\r\n onFullScreenChange: function ()\r\n {\r\n // They pressed ESC while in fullscreen mode\r\n if (!(document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement || document.mozFullScreenElement))\r\n {\r\n this.stopFullscreen();\r\n }\r\n },\r\n\r\n /**\r\n * Triggered when a fullscreenerror event is dispatched by the DOM.\r\n *\r\n * @method Phaser.Scale.ScaleManager#onFullScreenError\r\n * @since 3.16.0\r\n */\r\n onFullScreenError: function ()\r\n {\r\n this.removeFullscreenTarget();\r\n },\r\n\r\n /**\r\n * Internal method, called automatically by the game step.\r\n * Monitors the elapsed time and resize interval to see if a parent bounds check needs to take place.\r\n *\r\n * @method Phaser.Scale.ScaleManager#step\r\n * @since 3.16.0\r\n *\r\n * @param {number} time - The time value from the most recent Game step. Typically a high-resolution timer value, or Date.now().\r\n * @param {number} delta - The delta value since the last frame. This is smoothed to avoid delta spikes by the TimeStep class.\r\n */\r\n step: function (time, delta)\r\n {\r\n if (!this.parent)\r\n {\r\n return;\r\n }\r\n\r\n this._lastCheck += delta;\r\n\r\n if (this.dirty || this._lastCheck > this.resizeInterval)\r\n {\r\n // Returns true if the parent bounds have changed size\r\n if (this.getParentBounds())\r\n {\r\n this.refresh();\r\n }\r\n\r\n this.dirty = false;\r\n this._lastCheck = 0;\r\n }\r\n },\r\n\r\n /**\r\n * Stops all DOM event listeners.\r\n *\r\n * @method Phaser.Scale.ScaleManager#stopListeners\r\n * @since 3.16.0\r\n */\r\n stopListeners: function ()\r\n {\r\n var listeners = this.listeners;\r\n\r\n window.removeEventListener('orientationchange', listeners.orientationChange, false);\r\n window.removeEventListener('resize', listeners.windowResize, false);\r\n\r\n var vendors = [ 'webkit', 'moz', '' ];\r\n\r\n vendors.forEach(function (prefix)\r\n {\r\n document.removeEventListener(prefix + 'fullscreenchange', listeners.fullScreenChange, false);\r\n document.removeEventListener(prefix + 'fullscreenerror', listeners.fullScreenError, false);\r\n });\r\n\r\n // MS Specific\r\n document.removeEventListener('MSFullscreenChange', listeners.fullScreenChange, false);\r\n document.removeEventListener('MSFullscreenError', listeners.fullScreenError, false);\r\n },\r\n\r\n /**\r\n * Destroys this Scale Manager, releasing all references to external resources.\r\n * Once destroyed, the Scale Manager cannot be used again.\r\n *\r\n * @method Phaser.Scale.ScaleManager#destroy\r\n * @since 3.16.0\r\n */\r\n destroy: function ()\r\n {\r\n this.removeAllListeners();\r\n\r\n this.stopListeners();\r\n\r\n this.game = null;\r\n this.canvas = null;\r\n this.canvasBounds = null;\r\n this.parent = null;\r\n this.fullscreenTarget = null;\r\n\r\n this.parentSize.destroy();\r\n this.gameSize.destroy();\r\n this.baseSize.destroy();\r\n this.displaySize.destroy();\r\n },\r\n\r\n /**\r\n * Is the browser currently in fullscreen mode or not?\r\n *\r\n * @name Phaser.Scale.ScaleManager#isFullscreen\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n isFullscreen: {\r\n\r\n get: function ()\r\n {\r\n return this.fullscreen.active;\r\n }\r\n \r\n },\r\n\r\n /**\r\n * The game width.\r\n * \r\n * This is typically the size given in the game configuration.\r\n *\r\n * @name Phaser.Scale.ScaleManager#width\r\n * @type {number}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n width: {\r\n\r\n get: function ()\r\n {\r\n return this.gameSize.width;\r\n }\r\n \r\n },\r\n\r\n /**\r\n * The game height.\r\n * \r\n * This is typically the size given in the game configuration.\r\n *\r\n * @name Phaser.Scale.ScaleManager#height\r\n * @type {number}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n height: {\r\n\r\n get: function ()\r\n {\r\n return this.gameSize.height;\r\n }\r\n \r\n },\r\n\r\n /**\r\n * Is the device in a portrait orientation as reported by the Orientation API?\r\n * This value is usually only available on mobile devices.\r\n *\r\n * @name Phaser.Scale.ScaleManager#isPortrait\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n isPortrait: {\r\n\r\n get: function ()\r\n {\r\n return (this.orientation === CONST.ORIENTATION.PORTRAIT);\r\n }\r\n \r\n },\r\n\r\n /**\r\n * Is the device in a landscape orientation as reported by the Orientation API?\r\n * This value is usually only available on mobile devices.\r\n *\r\n * @name Phaser.Scale.ScaleManager#isLandscape\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n isLandscape: {\r\n\r\n get: function ()\r\n {\r\n return (this.orientation === CONST.ORIENTATION.LANDSCAPE);\r\n }\r\n \r\n },\r\n\r\n /**\r\n * Are the game dimensions portrait? (i.e. taller than they are wide)\r\n * \r\n * This is different to the device itself being in a portrait orientation.\r\n *\r\n * @name Phaser.Scale.ScaleManager#isGamePortrait\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n isGamePortrait: {\r\n\r\n get: function ()\r\n {\r\n return (this.height > this.width);\r\n }\r\n \r\n },\r\n\r\n /**\r\n * Are the game dimensions landscape? (i.e. wider than they are tall)\r\n * \r\n * This is different to the device itself being in a landscape orientation.\r\n *\r\n * @name Phaser.Scale.ScaleManager#isGameLandscape\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n isGameLandscape: {\r\n\r\n get: function ()\r\n {\r\n return (this.width > this.height);\r\n }\r\n \r\n }\r\n\r\n});\r\n\r\nmodule.exports = ScaleManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scale/ScaleManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/scale/const/CENTER_CONST.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/scale/const/CENTER_CONST.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Phaser Scale Manager constants for centering the game canvas.\r\n * \r\n * @namespace Phaser.Scale.Center\r\n * @memberof Phaser.Scale\r\n * @since 3.16.0\r\n */\r\n\r\n/**\r\n * Phaser Scale Manager constants for centering the game canvas.\r\n * \r\n * To find out what each mode does please see [Phaser.Scale.Center]{@link Phaser.Scale.Center}.\r\n * \r\n * @typedef {Phaser.Scale.Center} Phaser.Scale.CenterType\r\n * @memberof Phaser.Scale\r\n * @since 3.16.0\r\n */\r\n\r\nmodule.exports = {\r\n\r\n /**\r\n * The game canvas is not centered within the parent by Phaser.\r\n * You can still center it yourself via CSS.\r\n * \r\n * @name Phaser.Scale.Center.NO_CENTER\r\n * @type {integer}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n NO_CENTER: 0,\r\n\r\n /**\r\n * The game canvas is centered both horizontally and vertically within the parent.\r\n * To do this, the parent has to have a bounds that can be calculated and not be empty.\r\n * \r\n * Centering is achieved by setting the margin left and top properties of the\r\n * game canvas, and does not factor in any other CSS styles you may have applied.\r\n * \r\n * @name Phaser.Scale.Center.CENTER_BOTH\r\n * @type {integer}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n CENTER_BOTH: 1,\r\n\r\n /**\r\n * The game canvas is centered horizontally within the parent.\r\n * To do this, the parent has to have a bounds that can be calculated and not be empty.\r\n * \r\n * Centering is achieved by setting the margin left and top properties of the\r\n * game canvas, and does not factor in any other CSS styles you may have applied.\r\n * \r\n * @name Phaser.Scale.Center.CENTER_HORIZONTALLY\r\n * @type {integer}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n CENTER_HORIZONTALLY: 2,\r\n\r\n /**\r\n * The game canvas is centered both vertically within the parent.\r\n * To do this, the parent has to have a bounds that can be calculated and not be empty.\r\n * \r\n * Centering is achieved by setting the margin left and top properties of the\r\n * game canvas, and does not factor in any other CSS styles you may have applied.\r\n * \r\n * @name Phaser.Scale.Center.CENTER_VERTICALLY\r\n * @type {integer}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n CENTER_VERTICALLY: 3\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scale/const/CENTER_CONST.js?"); /***/ }), /***/ "./node_modules/phaser/src/scale/const/ORIENTATION_CONST.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/scale/const/ORIENTATION_CONST.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Phaser Scale Manager constants for orientation.\r\n * \r\n * @namespace Phaser.Scale.Orientation\r\n * @memberof Phaser.Scale\r\n * @since 3.16.0\r\n */\r\n\r\n/**\r\n * Phaser Scale Manager constants for orientation.\r\n * \r\n * To find out what each mode does please see [Phaser.Scale.Orientation]{@link Phaser.Scale.Orientation}.\r\n * \r\n * @typedef {Phaser.Scale.Orientation} Phaser.Scale.OrientationType\r\n * @memberof Phaser.Scale\r\n * @since 3.16.0\r\n */\r\n\r\nmodule.exports = {\r\n\r\n /**\r\n * A landscape orientation.\r\n * \r\n * @name Phaser.Scale.Orientation.LANDSCAPE\r\n * @type {string}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n LANDSCAPE: 'landscape-primary',\r\n\r\n /**\r\n * A portrait orientation.\r\n * \r\n * @name Phaser.Scale.Orientation.PORTRAIT\r\n * @type {string}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n PORTRAIT: 'portrait-primary'\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scale/const/ORIENTATION_CONST.js?"); /***/ }), /***/ "./node_modules/phaser/src/scale/const/SCALE_MODE_CONST.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/scale/const/SCALE_MODE_CONST.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Phaser Scale Manager constants for the different scale modes available.\r\n * \r\n * @namespace Phaser.Scale.ScaleModes\r\n * @memberof Phaser.Scale\r\n * @since 3.16.0\r\n */\r\n\r\n/**\r\n * Phaser Scale Manager constants for the different scale modes available.\r\n * \r\n * To find out what each mode does please see [Phaser.Scale.ScaleModes]{@link Phaser.Scale.ScaleModes}.\r\n * \r\n * @typedef {Phaser.Scale.ScaleModes} Phaser.Scale.ScaleModeType\r\n * @memberof Phaser.Scale\r\n * @since 3.16.0\r\n */\r\n\r\nmodule.exports = {\r\n\r\n /**\r\n * No scaling happens at all. The canvas is set to the size given in the game config and Phaser doesn't change it\r\n * again from that point on. If you change the canvas size, either via CSS, or directly via code, then you need\r\n * to call the Scale Managers `resize` method to give the new dimensions, or input events will stop working.\r\n * \r\n * @name Phaser.Scale.ScaleModes.NONE\r\n * @type {integer}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n NONE: 0,\r\n\r\n /**\r\n * The height is automatically adjusted based on the width.\r\n * \r\n * @name Phaser.Scale.ScaleModes.WIDTH_CONTROLS_HEIGHT\r\n * @type {integer}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n WIDTH_CONTROLS_HEIGHT: 1,\r\n\r\n /**\r\n * The width is automatically adjusted based on the height.\r\n * \r\n * @name Phaser.Scale.ScaleModes.HEIGHT_CONTROLS_WIDTH\r\n * @type {integer}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n HEIGHT_CONTROLS_WIDTH: 2,\r\n\r\n /**\r\n * The width and height are automatically adjusted to fit inside the given target area,\r\n * while keeping the aspect ratio. Depending on the aspect ratio there may be some space\r\n * inside the area which is not covered.\r\n * \r\n * @name Phaser.Scale.ScaleModes.FIT\r\n * @type {integer}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n FIT: 3,\r\n\r\n /**\r\n * The width and height are automatically adjusted to make the size cover the entire target\r\n * area while keeping the aspect ratio. This may extend further out than the target size.\r\n * \r\n * @name Phaser.Scale.ScaleModes.ENVELOP\r\n * @type {integer}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n ENVELOP: 4,\r\n\r\n /**\r\n * The Canvas is resized to fit all available _parent_ space, regardless of aspect ratio.\r\n * \r\n * @name Phaser.Scale.ScaleModes.RESIZE\r\n * @type {integer}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n RESIZE: 5\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scale/const/SCALE_MODE_CONST.js?"); /***/ }), /***/ "./node_modules/phaser/src/scale/const/ZOOM_CONST.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/scale/const/ZOOM_CONST.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Phaser Scale Manager constants for zoom modes.\r\n * \r\n * @namespace Phaser.Scale.Zoom\r\n * @memberof Phaser.Scale\r\n * @since 3.16.0\r\n */\r\n\r\n/**\r\n * Phaser Scale Manager constants for zoom modes.\r\n * \r\n * To find out what each mode does please see [Phaser.Scale.Zoom]{@link Phaser.Scale.Zoom}.\r\n * \r\n * @typedef {Phaser.Scale.Zoom} Phaser.Scale.ZoomType\r\n * @memberof Phaser.Scale\r\n * @since 3.16.0\r\n */\r\n\r\nmodule.exports = {\r\n\r\n /**\r\n * The game canvas will not be zoomed by Phaser.\r\n * \r\n * @name Phaser.Scale.Zoom.NO_ZOOM\r\n * @type {integer}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n NO_ZOOM: 1,\r\n\r\n /**\r\n * The game canvas will be 2x zoomed by Phaser.\r\n * \r\n * @name Phaser.Scale.Zoom.ZOOM_2X\r\n * @type {integer}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n ZOOM_2X: 2,\r\n\r\n /**\r\n * The game canvas will be 4x zoomed by Phaser.\r\n * \r\n * @name Phaser.Scale.Zoom.ZOOM_4X\r\n * @type {integer}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n ZOOM_4X: 4,\r\n\r\n /**\r\n * Calculate the zoom value based on the maximum multiplied game size that will\r\n * fit into the parent, or browser window if no parent is set.\r\n * \r\n * @name Phaser.Scale.Zoom.MAX_ZOOM\r\n * @type {integer}\r\n * @const\r\n * @since 3.16.0\r\n */\r\n MAX_ZOOM: -1\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scale/const/ZOOM_CONST.js?"); /***/ }), /***/ "./node_modules/phaser/src/scale/const/index.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/scale/const/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = {\r\n\r\n CENTER: __webpack_require__(/*! ./CENTER_CONST */ \"./node_modules/phaser/src/scale/const/CENTER_CONST.js\"),\r\n ORIENTATION: __webpack_require__(/*! ./ORIENTATION_CONST */ \"./node_modules/phaser/src/scale/const/ORIENTATION_CONST.js\"),\r\n SCALE_MODE: __webpack_require__(/*! ./SCALE_MODE_CONST */ \"./node_modules/phaser/src/scale/const/SCALE_MODE_CONST.js\"),\r\n ZOOM: __webpack_require__(/*! ./ZOOM_CONST */ \"./node_modules/phaser/src/scale/const/ZOOM_CONST.js\")\r\n\r\n};\r\n\r\nmodule.exports = CONST;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scale/const/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/scale/events/ENTER_FULLSCREEN_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/scale/events/ENTER_FULLSCREEN_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scale Manager has successfully entered fullscreen mode.\r\n *\r\n * @event Phaser.Scale.Events#ENTER_FULLSCREEN\r\n * @since 3.16.1\r\n */\r\nmodule.exports = 'enterfullscreen';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scale/events/ENTER_FULLSCREEN_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scale/events/FULLSCREEN_FAILED_EVENT.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/scale/events/FULLSCREEN_FAILED_EVENT.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scale Manager tried to enter fullscreen mode but failed.\r\n *\r\n * @event Phaser.Scale.Events#FULLSCREEN_FAILED\r\n * @since 3.17.0\r\n */\r\nmodule.exports = 'fullscreenfailed';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scale/events/FULLSCREEN_FAILED_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scale/events/FULLSCREEN_UNSUPPORTED_EVENT.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/scale/events/FULLSCREEN_UNSUPPORTED_EVENT.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scale Manager tried to enter fullscreen mode, but it is unsupported by the browser.\r\n *\r\n * @event Phaser.Scale.Events#FULLSCREEN_UNSUPPORTED\r\n * @since 3.16.1\r\n */\r\nmodule.exports = 'fullscreenunsupported';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scale/events/FULLSCREEN_UNSUPPORTED_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scale/events/LEAVE_FULLSCREEN_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/scale/events/LEAVE_FULLSCREEN_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scale Manager was in fullscreen mode, but has since left, either directly via game code,\r\n * or via a user gestured, such as pressing the ESC key.\r\n *\r\n * @event Phaser.Scale.Events#LEAVE_FULLSCREEN\r\n * @since 3.16.1\r\n */\r\nmodule.exports = 'leavefullscreen';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scale/events/LEAVE_FULLSCREEN_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scale/events/ORIENTATION_CHANGE_EVENT.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/scale/events/ORIENTATION_CHANGE_EVENT.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scale Manager Orientation Change Event.\r\n *\r\n * @event Phaser.Scale.Events#ORIENTATION_CHANGE\r\n * @since 3.16.1\r\n * \r\n * @param {string} orientation - \r\n */\r\nmodule.exports = 'orientationchange';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scale/events/ORIENTATION_CHANGE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scale/events/RESIZE_EVENT.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/scale/events/RESIZE_EVENT.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scale Manager Resize Event.\r\n * \r\n * This event is dispatched whenever the Scale Manager detects a resize event from the browser.\r\n * It sends three parameters to the callback, each of them being Size components. You can read\r\n * the `width`, `height`, `aspectRatio` and other properties of these components to help with\r\n * scaling your own game content.\r\n *\r\n * @event Phaser.Scale.Events#RESIZE\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas.\r\n * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size multiplied by resolution.\r\n * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode.\r\n * @param {number} resolution - The current resolution. Defaults to 1 at the moment.\r\n * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width.\r\n * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height.\r\n */\r\nmodule.exports = 'resize';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scale/events/RESIZE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scale/events/index.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/scale/events/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Scale.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n ENTER_FULLSCREEN: __webpack_require__(/*! ./ENTER_FULLSCREEN_EVENT */ \"./node_modules/phaser/src/scale/events/ENTER_FULLSCREEN_EVENT.js\"),\r\n FULLSCREEN_FAILED: __webpack_require__(/*! ./FULLSCREEN_FAILED_EVENT */ \"./node_modules/phaser/src/scale/events/FULLSCREEN_FAILED_EVENT.js\"),\r\n FULLSCREEN_UNSUPPORTED: __webpack_require__(/*! ./FULLSCREEN_UNSUPPORTED_EVENT */ \"./node_modules/phaser/src/scale/events/FULLSCREEN_UNSUPPORTED_EVENT.js\"),\r\n LEAVE_FULLSCREEN: __webpack_require__(/*! ./LEAVE_FULLSCREEN_EVENT */ \"./node_modules/phaser/src/scale/events/LEAVE_FULLSCREEN_EVENT.js\"),\r\n ORIENTATION_CHANGE: __webpack_require__(/*! ./ORIENTATION_CHANGE_EVENT */ \"./node_modules/phaser/src/scale/events/ORIENTATION_CHANGE_EVENT.js\"),\r\n RESIZE: __webpack_require__(/*! ./RESIZE_EVENT */ \"./node_modules/phaser/src/scale/events/RESIZE_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scale/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/scale/index.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/scale/index.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Extend = __webpack_require__(/*! ../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/scale/const/index.js\");\r\n\r\n/**\r\n * @namespace Phaser.Scale\r\n * \r\n * @borrows Phaser.Scale.Center.NO_CENTER as NO_CENTER\r\n * @borrows Phaser.Scale.Center.CENTER_BOTH as CENTER_BOTH\r\n * @borrows Phaser.Scale.Center.CENTER_HORIZONTALLY as CENTER_HORIZONTALLY\r\n * @borrows Phaser.Scale.Center.CENTER_VERTICALLY as CENTER_VERTICALLY\r\n * \r\n * @borrows Phaser.Scale.Orientation.LANDSCAPE as LANDSCAPE\r\n * @borrows Phaser.Scale.Orientation.PORTRAIT as PORTRAIT\r\n * \r\n * @borrows Phaser.Scale.ScaleModes.NONE as NONE\r\n * @borrows Phaser.Scale.ScaleModes.WIDTH_CONTROLS_HEIGHT as WIDTH_CONTROLS_HEIGHT\r\n * @borrows Phaser.Scale.ScaleModes.HEIGHT_CONTROLS_WIDTH as HEIGHT_CONTROLS_WIDTH\r\n * @borrows Phaser.Scale.ScaleModes.FIT as FIT\r\n * @borrows Phaser.Scale.ScaleModes.ENVELOP as ENVELOP\r\n * @borrows Phaser.Scale.ScaleModes.RESIZE as RESIZE\r\n * \r\n * @borrows Phaser.Scale.Zoom.NO_ZOOM as NO_ZOOM\r\n * @borrows Phaser.Scale.Zoom.ZOOM_2X as ZOOM_2X\r\n * @borrows Phaser.Scale.Zoom.ZOOM_4X as ZOOM_4X\r\n * @borrows Phaser.Scale.Zoom.MAX_ZOOM as MAX_ZOOM\r\n */\r\n\r\nvar Scale = {\r\n\r\n Center: __webpack_require__(/*! ./const/CENTER_CONST */ \"./node_modules/phaser/src/scale/const/CENTER_CONST.js\"),\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/scale/events/index.js\"),\r\n Orientation: __webpack_require__(/*! ./const/ORIENTATION_CONST */ \"./node_modules/phaser/src/scale/const/ORIENTATION_CONST.js\"),\r\n ScaleManager: __webpack_require__(/*! ./ScaleManager */ \"./node_modules/phaser/src/scale/ScaleManager.js\"),\r\n ScaleModes: __webpack_require__(/*! ./const/SCALE_MODE_CONST */ \"./node_modules/phaser/src/scale/const/SCALE_MODE_CONST.js\"),\r\n Zoom: __webpack_require__(/*! ./const/ZOOM_CONST */ \"./node_modules/phaser/src/scale/const/ZOOM_CONST.js\")\r\n\r\n};\r\n\r\nScale = Extend(false, Scale, CONST.CENTER);\r\nScale = Extend(false, Scale, CONST.ORIENTATION);\r\nScale = Extend(false, Scale, CONST.SCALE_MODE);\r\nScale = Extend(false, Scale, CONST.ZOOM);\r\n\r\nmodule.exports = Scale;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scale/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/GetPhysicsPlugins.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/scene/GetPhysicsPlugins.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetFastValue = __webpack_require__(/*! ../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar UppercaseFirst = __webpack_require__(/*! ../utils/string/UppercaseFirst */ \"./node_modules/phaser/src/utils/string/UppercaseFirst.js\");\r\n\r\n/**\r\n * Builds an array of which physics plugins should be activated for the given Scene.\r\n *\r\n * @function Phaser.Scenes.GetPhysicsPlugins\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scenes.Systems} sys - The scene system to get the physics systems of.\r\n *\r\n * @return {array} An array of Physics systems to start for this Scene.\r\n */\r\nvar GetPhysicsPlugins = function (sys)\r\n{\r\n var defaultSystem = sys.game.config.defaultPhysicsSystem;\r\n var sceneSystems = GetFastValue(sys.settings, 'physics', false);\r\n\r\n if (!defaultSystem && !sceneSystems)\r\n {\r\n // No default physics system or systems in this scene\r\n return;\r\n }\r\n\r\n // Let's build the systems array\r\n var output = [];\r\n\r\n if (defaultSystem)\r\n {\r\n output.push(UppercaseFirst(defaultSystem + 'Physics'));\r\n }\r\n\r\n if (sceneSystems)\r\n {\r\n for (var key in sceneSystems)\r\n {\r\n key = UppercaseFirst(key.concat('Physics'));\r\n\r\n if (output.indexOf(key) === -1)\r\n {\r\n output.push(key);\r\n }\r\n }\r\n }\r\n\r\n // An array of Physics systems to start for this Scene\r\n return output;\r\n};\r\n\r\nmodule.exports = GetPhysicsPlugins;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/GetPhysicsPlugins.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/GetScenePlugins.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/scene/GetScenePlugins.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetFastValue = __webpack_require__(/*! ../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\n\r\n/**\r\n * Builds an array of which plugins (not including physics plugins) should be activated for the given Scene.\r\n *\r\n * @function Phaser.Scenes.GetScenePlugins\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scenes.Systems} sys - The Scene Systems object to check for plugins.\r\n *\r\n * @return {array} An array of all plugins which should be activated, either the default ones or the ones configured in the Scene Systems object.\r\n */\r\nvar GetScenePlugins = function (sys)\r\n{\r\n var defaultPlugins = sys.plugins.getDefaultScenePlugins();\r\n\r\n var scenePlugins = GetFastValue(sys.settings, 'plugins', false);\r\n\r\n // Scene Plugins always override Default Plugins\r\n if (Array.isArray(scenePlugins))\r\n {\r\n return scenePlugins;\r\n }\r\n else if (defaultPlugins)\r\n {\r\n return defaultPlugins;\r\n }\r\n else\r\n {\r\n // No default plugins or plugins in this scene\r\n return [];\r\n }\r\n};\r\n\r\nmodule.exports = GetScenePlugins;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/GetScenePlugins.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/InjectionMap.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/scene/InjectionMap.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// These properties get injected into the Scene and map to local systems\r\n// The map value is the property that is injected into the Scene, the key is the Scene.Systems reference.\r\n// These defaults can be modified via the Scene config object\r\n// var config = {\r\n// map: {\r\n// add: 'makeStuff',\r\n// load: 'loader'\r\n// }\r\n// };\r\n\r\nvar InjectionMap = {\r\n\r\n game: 'game',\r\n\r\n anims: 'anims',\r\n cache: 'cache',\r\n plugins: 'plugins',\r\n registry: 'registry',\r\n scale: 'scale',\r\n sound: 'sound',\r\n textures: 'textures',\r\n\r\n events: 'events',\r\n cameras: 'cameras',\r\n add: 'add',\r\n make: 'make',\r\n scenePlugin: 'scene',\r\n displayList: 'children',\r\n lights: 'lights',\r\n\r\n data: 'data',\r\n input: 'input',\r\n load: 'load',\r\n time: 'time',\r\n tweens: 'tweens',\r\n\r\n arcadePhysics: 'physics',\r\n impactPhysics: 'impact',\r\n matterPhysics: 'matter'\r\n\r\n};\r\n\r\nif (typeof PLUGIN_CAMERA3D)\r\n{\r\n InjectionMap.cameras3d = 'cameras3d';\r\n}\r\n\r\nif (typeof PLUGIN_FBINSTANT)\r\n{\r\n InjectionMap.facebook = 'facebook';\r\n}\r\n\r\nmodule.exports = InjectionMap;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/InjectionMap.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/Scene.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/scene/Scene.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Systems = __webpack_require__(/*! ./Systems */ \"./node_modules/phaser/src/scene/Systems.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A base Phaser.Scene class which can be extended for your own use.\r\n *\r\n * You can also define the optional methods {@link Phaser.Types.Scenes.SceneInitCallback init()}, {@link Phaser.Types.Scenes.ScenePreloadCallback preload()}, and {@link Phaser.Types.Scenes.SceneCreateCallback create()}.\r\n *\r\n * @class Scene\r\n * @memberof Phaser\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Scenes.SettingsConfig)} config - Scene specific configuration settings.\r\n */\r\nvar Scene = new Class({\r\n\r\n initialize:\r\n\r\n function Scene (config)\r\n {\r\n /**\r\n * The Scene Systems. You must never overwrite this property, or all hell will break lose.\r\n *\r\n * @name Phaser.Scene#sys\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.sys = new Systems(this, config);\r\n\r\n /**\r\n * A reference to the Phaser.Game instance.\r\n * This property will only be available if defined in the Scene Injection Map.\r\n *\r\n * @name Phaser.Scene#game\r\n * @type {Phaser.Game}\r\n * @since 3.0.0\r\n */\r\n this.game;\r\n\r\n /**\r\n * A reference to the global Animation Manager.\r\n * This property will only be available if defined in the Scene Injection Map.\r\n *\r\n * @name Phaser.Scene#anims\r\n * @type {Phaser.Animations.AnimationManager}\r\n * @since 3.0.0\r\n */\r\n this.anims;\r\n\r\n /**\r\n * A reference to the global Cache.\r\n * This property will only be available if defined in the Scene Injection Map.\r\n *\r\n * @name Phaser.Scene#cache\r\n * @type {Phaser.Cache.CacheManager}\r\n * @since 3.0.0\r\n */\r\n this.cache;\r\n\r\n /**\r\n * A reference to the game level Data Manager.\r\n * This property will only be available if defined in the Scene Injection Map.\r\n *\r\n * @name Phaser.Scene#registry\r\n * @type {Phaser.Data.DataManager}\r\n * @since 3.0.0\r\n */\r\n this.registry;\r\n\r\n /**\r\n * A reference to the Sound Manager.\r\n * This property will only be available if defined in the Scene Injection Map and the plugin is installed.\r\n *\r\n * @name Phaser.Scene#sound\r\n * @type {Phaser.Sound.BaseSoundManager}\r\n * @since 3.0.0\r\n */\r\n this.sound;\r\n\r\n /**\r\n * A reference to the Texture Manager.\r\n * This property will only be available if defined in the Scene Injection Map.\r\n *\r\n * @name Phaser.Scene#textures\r\n * @type {Phaser.Textures.TextureManager}\r\n * @since 3.0.0\r\n */\r\n this.textures;\r\n\r\n /**\r\n * A scene level Event Emitter.\r\n * This property will only be available if defined in the Scene Injection Map.\r\n *\r\n * @name Phaser.Scene#events\r\n * @type {Phaser.Events.EventEmitter}\r\n * @since 3.0.0\r\n */\r\n this.events;\r\n\r\n /**\r\n * A scene level Camera System.\r\n * This property will only be available if defined in the Scene Injection Map.\r\n *\r\n * @name Phaser.Scene#cameras\r\n * @type {Phaser.Cameras.Scene2D.CameraManager}\r\n * @since 3.0.0\r\n */\r\n this.cameras;\r\n\r\n /**\r\n * A scene level Game Object Factory.\r\n * This property will only be available if defined in the Scene Injection Map.\r\n *\r\n * @name Phaser.Scene#add\r\n * @type {Phaser.GameObjects.GameObjectFactory}\r\n * @since 3.0.0\r\n */\r\n this.add;\r\n\r\n /**\r\n * A scene level Game Object Creator.\r\n * This property will only be available if defined in the Scene Injection Map.\r\n *\r\n * @name Phaser.Scene#make\r\n * @type {Phaser.GameObjects.GameObjectCreator}\r\n * @since 3.0.0\r\n */\r\n this.make;\r\n\r\n /**\r\n * A reference to the Scene Manager Plugin.\r\n * This property will only be available if defined in the Scene Injection Map.\r\n *\r\n * @name Phaser.Scene#scene\r\n * @type {Phaser.Scenes.ScenePlugin}\r\n * @since 3.0.0\r\n */\r\n this.scene;\r\n\r\n /**\r\n * A scene level Game Object Display List.\r\n * This property will only be available if defined in the Scene Injection Map.\r\n *\r\n * @name Phaser.Scene#children\r\n * @type {Phaser.GameObjects.DisplayList}\r\n * @since 3.0.0\r\n */\r\n this.children;\r\n\r\n /**\r\n * A scene level Lights Manager Plugin.\r\n * This property will only be available if defined in the Scene Injection Map and the plugin is installed.\r\n *\r\n * @name Phaser.Scene#lights\r\n * @type {Phaser.GameObjects.LightsManager}\r\n * @since 3.0.0\r\n */\r\n this.lights;\r\n\r\n /**\r\n * A scene level Data Manager Plugin.\r\n * This property will only be available if defined in the Scene Injection Map and the plugin is installed.\r\n *\r\n * @name Phaser.Scene#data\r\n * @type {Phaser.Data.DataManager}\r\n * @since 3.0.0\r\n */\r\n this.data;\r\n\r\n /**\r\n * A scene level Input Manager Plugin.\r\n * This property will only be available if defined in the Scene Injection Map and the plugin is installed.\r\n *\r\n * @name Phaser.Scene#input\r\n * @type {Phaser.Input.InputPlugin}\r\n * @since 3.0.0\r\n */\r\n this.input;\r\n\r\n /**\r\n * A scene level Loader Plugin.\r\n * This property will only be available if defined in the Scene Injection Map and the plugin is installed.\r\n *\r\n * @name Phaser.Scene#load\r\n * @type {Phaser.Loader.LoaderPlugin}\r\n * @since 3.0.0\r\n */\r\n this.load;\r\n\r\n /**\r\n * A scene level Time and Clock Plugin.\r\n * This property will only be available if defined in the Scene Injection Map and the plugin is installed.\r\n *\r\n * @name Phaser.Scene#time\r\n * @type {Phaser.Time.Clock}\r\n * @since 3.0.0\r\n */\r\n this.time;\r\n\r\n /**\r\n * A scene level Tween Manager Plugin.\r\n * This property will only be available if defined in the Scene Injection Map and the plugin is installed.\r\n *\r\n * @name Phaser.Scene#tweens\r\n * @type {Phaser.Tweens.TweenManager}\r\n * @since 3.0.0\r\n */\r\n this.tweens;\r\n\r\n /**\r\n * A scene level Arcade Physics Plugin.\r\n * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured.\r\n *\r\n * @name Phaser.Scene#physics\r\n * @type {Phaser.Physics.Arcade.ArcadePhysics}\r\n * @since 3.0.0\r\n */\r\n this.physics;\r\n\r\n /**\r\n * A scene level Impact Physics Plugin.\r\n * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured.\r\n *\r\n * @name Phaser.Scene#impact\r\n * @type {Phaser.Physics.Impact.ImpactPhysics}\r\n * @since 3.0.0\r\n */\r\n this.impact;\r\n\r\n /**\r\n * A scene level Matter Physics Plugin.\r\n * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured.\r\n *\r\n * @name Phaser.Scene#matter\r\n * @type {Phaser.Physics.Matter.MatterPhysics}\r\n * @since 3.0.0\r\n */\r\n this.matter;\r\n\r\n if (typeof PLUGIN_FBINSTANT)\r\n {\r\n /**\r\n * A scene level Facebook Instant Games Plugin.\r\n * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured.\r\n *\r\n * @name Phaser.Scene#facebook\r\n * @type {Phaser.FacebookInstantGamesPlugin}\r\n * @since 3.12.0\r\n */\r\n this.facebook;\r\n }\r\n\r\n /**\r\n * A reference to the global Scale Manager.\r\n * This property will only be available if defined in the Scene Injection Map.\r\n *\r\n * @name Phaser.Scene#scale\r\n * @type {Phaser.Scale.ScaleManager}\r\n * @since 3.16.2\r\n */\r\n this.scale;\r\n\r\n /**\r\n * A reference to the Plugin Manager.\r\n *\r\n * The Plugin Manager is a global system that allows plugins to register themselves with it, and can then install\r\n * those plugins into Scenes as required.\r\n *\r\n * @name Phaser.Scene#plugins\r\n * @type {Phaser.Plugins.PluginManager}\r\n * @since 3.0.0\r\n */\r\n this.plugins;\r\n },\r\n\r\n /**\r\n * Should be overridden by your own Scenes.\r\n * This method is called once per game step while the scene is running.\r\n *\r\n * @method Phaser.Scene#update\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\n update: function ()\r\n {\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Scene;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/Scene.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/SceneManager.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/scene/SceneManager.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/scene/const.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\nvar GameEvents = __webpack_require__(/*! ../core/events */ \"./node_modules/phaser/src/core/events/index.js\");\r\nvar GetValue = __webpack_require__(/*! ../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar LoaderEvents = __webpack_require__(/*! ../loader/events */ \"./node_modules/phaser/src/loader/events/index.js\");\r\nvar NOOP = __webpack_require__(/*! ../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar Scene = __webpack_require__(/*! ./Scene */ \"./node_modules/phaser/src/scene/Scene.js\");\r\nvar Systems = __webpack_require__(/*! ./Systems */ \"./node_modules/phaser/src/scene/Systems.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Scene Manager.\r\n *\r\n * The Scene Manager is a Game level system, responsible for creating, processing and updating all of the\r\n * Scenes in a Game instance.\r\n *\r\n *\r\n * @class SceneManager\r\n * @memberof Phaser.Scenes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - The Phaser.Game instance this Scene Manager belongs to.\r\n * @param {object} sceneConfig - Scene specific configuration settings.\r\n */\r\nvar SceneManager = new Class({\r\n\r\n initialize:\r\n\r\n function SceneManager (game, sceneConfig)\r\n {\r\n /**\r\n * The Game that this SceneManager belongs to.\r\n *\r\n * @name Phaser.Scenes.SceneManager#game\r\n * @type {Phaser.Game}\r\n * @since 3.0.0\r\n */\r\n this.game = game;\r\n\r\n /**\r\n * An object that maps the keys to the scene so we can quickly get a scene from a key without iteration.\r\n *\r\n * @name Phaser.Scenes.SceneManager#keys\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.keys = {};\r\n\r\n /**\r\n * The array in which all of the scenes are kept.\r\n *\r\n * @name Phaser.Scenes.SceneManager#scenes\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.scenes = [];\r\n\r\n /**\r\n * Scenes pending to be added are stored in here until the manager has time to add it.\r\n *\r\n * @name Phaser.Scenes.SceneManager#_pending\r\n * @type {array}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._pending = [];\r\n\r\n /**\r\n * An array of scenes waiting to be started once the game has booted.\r\n *\r\n * @name Phaser.Scenes.SceneManager#_start\r\n * @type {array}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._start = [];\r\n\r\n /**\r\n * An operations queue, because we don't manipulate the scenes array during processing.\r\n *\r\n * @name Phaser.Scenes.SceneManager#_queue\r\n * @type {array}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._queue = [];\r\n\r\n /**\r\n * Boot time data to merge.\r\n *\r\n * @name Phaser.Scenes.SceneManager#_data\r\n * @type {object}\r\n * @private\r\n * @since 3.4.0\r\n */\r\n this._data = {};\r\n\r\n /**\r\n * Is the Scene Manager actively processing the Scenes list?\r\n *\r\n * @name Phaser.Scenes.SceneManager#isProcessing\r\n * @type {boolean}\r\n * @default false\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.isProcessing = false;\r\n\r\n /**\r\n * Has the Scene Manager properly started?\r\n *\r\n * @name Phaser.Scenes.SceneManager#isBooted\r\n * @type {boolean}\r\n * @default false\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n this.isBooted = false;\r\n\r\n /**\r\n * Do any of the Cameras in any of the Scenes require a custom viewport?\r\n * If not we can skip scissor tests.\r\n *\r\n * @name Phaser.Scenes.SceneManager#customViewports\r\n * @type {number}\r\n * @default 0\r\n * @since 3.12.0\r\n */\r\n this.customViewports = 0;\r\n\r\n if (sceneConfig)\r\n {\r\n if (!Array.isArray(sceneConfig))\r\n {\r\n sceneConfig = [ sceneConfig ];\r\n }\r\n\r\n for (var i = 0; i < sceneConfig.length; i++)\r\n {\r\n // The i === 0 part just autostarts the first Scene given (unless it says otherwise in its config)\r\n this._pending.push({\r\n key: 'default',\r\n scene: sceneConfig[i],\r\n autoStart: (i === 0),\r\n data: {}\r\n });\r\n }\r\n }\r\n\r\n game.events.once(GameEvents.READY, this.bootQueue, this);\r\n },\r\n\r\n /**\r\n * Internal first-time Scene boot handler.\r\n *\r\n * @method Phaser.Scenes.SceneManager#bootQueue\r\n * @private\r\n * @since 3.2.0\r\n */\r\n bootQueue: function ()\r\n {\r\n if (this.isBooted)\r\n {\r\n return;\r\n }\r\n\r\n var i;\r\n var entry;\r\n var key;\r\n var sceneConfig;\r\n\r\n for (i = 0; i < this._pending.length; i++)\r\n {\r\n entry = this._pending[i];\r\n\r\n key = entry.key;\r\n sceneConfig = entry.scene;\r\n\r\n var newScene;\r\n\r\n if (sceneConfig instanceof Scene)\r\n {\r\n newScene = this.createSceneFromInstance(key, sceneConfig);\r\n }\r\n else if (typeof sceneConfig === 'object')\r\n {\r\n newScene = this.createSceneFromObject(key, sceneConfig);\r\n }\r\n else if (typeof sceneConfig === 'function')\r\n {\r\n newScene = this.createSceneFromFunction(key, sceneConfig);\r\n }\r\n\r\n // Replace key in case the scene changed it\r\n key = newScene.sys.settings.key;\r\n\r\n this.keys[key] = newScene;\r\n\r\n this.scenes.push(newScene);\r\n\r\n // Any data to inject?\r\n if (this._data[key])\r\n {\r\n newScene.sys.settings.data = this._data[key].data;\r\n\r\n if (this._data[key].autoStart)\r\n {\r\n entry.autoStart = true;\r\n }\r\n }\r\n\r\n if (entry.autoStart || newScene.sys.settings.active)\r\n {\r\n this._start.push(key);\r\n }\r\n }\r\n\r\n // Clear the pending lists\r\n this._pending.length = 0;\r\n\r\n this._data = {};\r\n\r\n this.isBooted = true;\r\n\r\n // _start might have been populated by the above\r\n for (i = 0; i < this._start.length; i++)\r\n {\r\n entry = this._start[i];\r\n\r\n this.start(entry);\r\n }\r\n\r\n this._start.length = 0;\r\n },\r\n\r\n /**\r\n * Process the Scene operations queue.\r\n *\r\n * @method Phaser.Scenes.SceneManager#processQueue\r\n * @since 3.0.0\r\n */\r\n processQueue: function ()\r\n {\r\n var pendingLength = this._pending.length;\r\n var queueLength = this._queue.length;\r\n\r\n if (pendingLength === 0 && queueLength === 0)\r\n {\r\n return;\r\n }\r\n\r\n var i;\r\n var entry;\r\n\r\n if (pendingLength)\r\n {\r\n for (i = 0; i < pendingLength; i++)\r\n {\r\n entry = this._pending[i];\r\n\r\n this.add(entry.key, entry.scene, entry.autoStart, entry.data);\r\n }\r\n\r\n // _start might have been populated by this.add\r\n for (i = 0; i < this._start.length; i++)\r\n {\r\n entry = this._start[i];\r\n\r\n this.start(entry);\r\n }\r\n\r\n // Clear the pending lists\r\n this._start.length = 0;\r\n this._pending.length = 0;\r\n\r\n return;\r\n }\r\n\r\n for (i = 0; i < this._queue.length; i++)\r\n {\r\n entry = this._queue[i];\r\n\r\n this[entry.op](entry.keyA, entry.keyB);\r\n }\r\n\r\n this._queue.length = 0;\r\n },\r\n\r\n /**\r\n * Adds a new Scene into the SceneManager.\r\n * You must give each Scene a unique key by which you'll identify it.\r\n *\r\n * The `sceneConfig` can be:\r\n *\r\n * * A `Phaser.Scene` object, or an object that extends it.\r\n * * A plain JavaScript object\r\n * * A JavaScript ES6 Class that extends `Phaser.Scene`\r\n * * A JavaScript ES5 prototype based Class\r\n * * A JavaScript function\r\n *\r\n * If a function is given then a new Scene will be created by calling it.\r\n *\r\n * @method Phaser.Scenes.SceneManager#add\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - A unique key used to reference the Scene, i.e. `MainMenu` or `Level1`.\r\n * @param {(Phaser.Scene|Phaser.Types.Scenes.SettingsConfig|Phaser.Types.Scenes.CreateSceneFromObjectConfig|function)} sceneConfig - The config for the Scene\r\n * @param {boolean} [autoStart=false] - If `true` the Scene will be started immediately after being added.\r\n * @param {object} [data] - Optional data object. This will be set as Scene.settings.data and passed to `Scene.init`.\r\n *\r\n * @return {?Phaser.Scene} The added Scene, if it was added immediately, otherwise `null`.\r\n */\r\n add: function (key, sceneConfig, autoStart, data)\r\n {\r\n if (autoStart === undefined) { autoStart = false; }\r\n if (data === undefined) { data = {}; }\r\n\r\n // If processing or not booted then put scene into a holding pattern\r\n if (this.isProcessing || !this.isBooted)\r\n {\r\n this._pending.push({\r\n key: key,\r\n scene: sceneConfig,\r\n autoStart: autoStart,\r\n data: data\r\n });\r\n\r\n if (!this.isBooted)\r\n {\r\n this._data[key] = { data: data };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n key = this.getKey(key, sceneConfig);\r\n\r\n var newScene;\r\n\r\n if (sceneConfig instanceof Scene)\r\n {\r\n newScene = this.createSceneFromInstance(key, sceneConfig);\r\n }\r\n else if (typeof sceneConfig === 'object')\r\n {\r\n sceneConfig.key = key;\r\n\r\n newScene = this.createSceneFromObject(key, sceneConfig);\r\n }\r\n else if (typeof sceneConfig === 'function')\r\n {\r\n newScene = this.createSceneFromFunction(key, sceneConfig);\r\n }\r\n\r\n // Any data to inject?\r\n newScene.sys.settings.data = data;\r\n\r\n // Replace key in case the scene changed it\r\n key = newScene.sys.settings.key;\r\n\r\n this.keys[key] = newScene;\r\n\r\n this.scenes.push(newScene);\r\n\r\n if (autoStart || newScene.sys.settings.active)\r\n {\r\n if (this._pending.length)\r\n {\r\n this._start.push(key);\r\n }\r\n else\r\n {\r\n this.start(key);\r\n }\r\n }\r\n\r\n return newScene;\r\n },\r\n\r\n /**\r\n * Removes a Scene from the SceneManager.\r\n *\r\n * The Scene is removed from the local scenes array, it's key is cleared from the keys\r\n * cache and Scene.Systems.destroy is then called on it.\r\n *\r\n * If the SceneManager is processing the Scenes when this method is called it will\r\n * queue the operation for the next update sequence.\r\n *\r\n * @method Phaser.Scenes.SceneManager#remove\r\n * @since 3.2.0\r\n *\r\n * @param {string} key - A unique key used to reference the Scene, i.e. `MainMenu` or `Level1`.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n remove: function (key)\r\n {\r\n if (this.isProcessing)\r\n {\r\n this._queue.push({ op: 'remove', keyA: key, keyB: null });\r\n }\r\n else\r\n {\r\n var sceneToRemove = this.getScene(key);\r\n\r\n if (!sceneToRemove || sceneToRemove.sys.isTransitioning())\r\n {\r\n return this;\r\n }\r\n\r\n var index = this.scenes.indexOf(sceneToRemove);\r\n var sceneKey = sceneToRemove.sys.settings.key;\r\n\r\n if (index > -1)\r\n {\r\n delete this.keys[sceneKey];\r\n this.scenes.splice(index, 1);\r\n\r\n if (this._start.indexOf(sceneKey) > -1)\r\n {\r\n index = this._start.indexOf(sceneKey);\r\n this._start.splice(index, 1);\r\n }\r\n\r\n sceneToRemove.sys.destroy();\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Boot the given Scene.\r\n *\r\n * @method Phaser.Scenes.SceneManager#bootScene\r\n * @private\r\n * @fires Phaser.Scenes.Events#TRANSITION_INIT\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to boot.\r\n */\r\n bootScene: function (scene)\r\n {\r\n var sys = scene.sys;\r\n var settings = sys.settings;\r\n\r\n if (scene.init)\r\n {\r\n scene.init.call(scene, settings.data);\r\n\r\n settings.status = CONST.INIT;\r\n\r\n if (settings.isTransition)\r\n {\r\n sys.events.emit(Events.TRANSITION_INIT, settings.transitionFrom, settings.transitionDuration);\r\n }\r\n }\r\n\r\n var loader;\r\n\r\n if (sys.load)\r\n {\r\n loader = sys.load;\r\n\r\n loader.reset();\r\n }\r\n\r\n if (loader && scene.preload)\r\n {\r\n scene.preload.call(scene);\r\n\r\n // Is the loader empty?\r\n if (loader.list.size === 0)\r\n {\r\n this.create(scene);\r\n }\r\n else\r\n {\r\n settings.status = CONST.LOADING;\r\n\r\n // Start the loader going as we have something in the queue\r\n loader.once(LoaderEvents.COMPLETE, this.loadComplete, this);\r\n\r\n loader.start();\r\n }\r\n }\r\n else\r\n {\r\n // No preload? Then there was nothing to load either\r\n this.create(scene);\r\n }\r\n },\r\n\r\n /**\r\n * Handles load completion for a Scene's Loader.\r\n *\r\n * Starts the Scene that the Loader belongs to.\r\n *\r\n * @method Phaser.Scenes.SceneManager#loadComplete\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - The loader that has completed loading.\r\n */\r\n loadComplete: function (loader)\r\n {\r\n var scene = loader.scene;\r\n\r\n // TODO - Remove. This should *not* be handled here\r\n // Try to unlock HTML5 sounds every time any loader completes\r\n if (this.game.sound && this.game.sound.onBlurPausedSounds)\r\n {\r\n this.game.sound.unlock();\r\n }\r\n\r\n this.create(scene);\r\n },\r\n\r\n /**\r\n * Handle payload completion for a Scene.\r\n *\r\n * @method Phaser.Scenes.SceneManager#payloadComplete\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - The loader that has completed loading its Scene's payload.\r\n */\r\n payloadComplete: function (loader)\r\n {\r\n this.bootScene(loader.scene);\r\n },\r\n\r\n /**\r\n * Updates the Scenes.\r\n *\r\n * @method Phaser.Scenes.SceneManager#update\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - Time elapsed.\r\n * @param {number} delta - Delta time from the last update.\r\n */\r\n update: function (time, delta)\r\n {\r\n this.processQueue();\r\n\r\n this.isProcessing = true;\r\n\r\n // Loop through the active scenes in reverse order\r\n for (var i = this.scenes.length - 1; i >= 0; i--)\r\n {\r\n var sys = this.scenes[i].sys;\r\n\r\n if (sys.settings.status > CONST.START && sys.settings.status <= CONST.RUNNING)\r\n {\r\n sys.step(time, delta);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Renders the Scenes.\r\n *\r\n * @method Phaser.Scenes.SceneManager#render\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer to use.\r\n */\r\n render: function (renderer)\r\n {\r\n // Loop through the scenes in forward order\r\n for (var i = 0; i < this.scenes.length; i++)\r\n {\r\n var sys = this.scenes[i].sys;\r\n\r\n if (sys.settings.visible && sys.settings.status >= CONST.LOADING && sys.settings.status < CONST.SLEEPING)\r\n {\r\n sys.render(renderer);\r\n }\r\n }\r\n\r\n this.isProcessing = false;\r\n },\r\n\r\n /**\r\n * Calls the given Scene's {@link Phaser.Scene#create} method and updates its status.\r\n *\r\n * @method Phaser.Scenes.SceneManager#create\r\n * @private\r\n * @fires Phaser.Scenes.Events#CREATE\r\n * @fires Phaser.Scenes.Events#TRANSITION_INIT\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to create.\r\n */\r\n create: function (scene)\r\n {\r\n var sys = scene.sys;\r\n var settings = sys.settings;\r\n\r\n if (scene.create)\r\n {\r\n settings.status = CONST.CREATING;\r\n\r\n scene.create.call(scene, settings.data);\r\n\r\n if (settings.status === CONST.DESTROYED)\r\n {\r\n return;\r\n }\r\n }\r\n\r\n if (settings.isTransition)\r\n {\r\n sys.events.emit(Events.TRANSITION_START, settings.transitionFrom, settings.transitionDuration);\r\n }\r\n\r\n // If the Scene has an update function we'll set it now, otherwise it'll remain as NOOP\r\n if (scene.update)\r\n {\r\n sys.sceneUpdate = scene.update;\r\n }\r\n\r\n settings.status = CONST.RUNNING;\r\n\r\n sys.events.emit(Events.CREATE, scene);\r\n },\r\n\r\n /**\r\n * Creates and initializes a Scene from a function.\r\n *\r\n * @method Phaser.Scenes.SceneManager#createSceneFromFunction\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the Scene.\r\n * @param {function} scene - The function to create the Scene from.\r\n *\r\n * @return {Phaser.Scene} The created Scene.\r\n */\r\n createSceneFromFunction: function (key, scene)\r\n {\r\n var newScene = new scene();\r\n\r\n if (newScene instanceof Scene)\r\n {\r\n var configKey = newScene.sys.settings.key;\r\n\r\n if (configKey !== '')\r\n {\r\n key = configKey;\r\n }\r\n\r\n if (this.keys.hasOwnProperty(key))\r\n {\r\n throw new Error('Cannot add a Scene with duplicate key: ' + key);\r\n }\r\n\r\n return this.createSceneFromInstance(key, newScene);\r\n }\r\n else\r\n {\r\n newScene.sys = new Systems(newScene);\r\n\r\n newScene.sys.settings.key = key;\r\n\r\n newScene.sys.init(this.game);\r\n\r\n return newScene;\r\n }\r\n },\r\n\r\n /**\r\n * Creates and initializes a Scene instance.\r\n *\r\n * @method Phaser.Scenes.SceneManager#createSceneFromInstance\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the Scene.\r\n * @param {Phaser.Scene} newScene - The Scene instance.\r\n *\r\n * @return {Phaser.Scene} The created Scene.\r\n */\r\n createSceneFromInstance: function (key, newScene)\r\n {\r\n var configKey = newScene.sys.settings.key;\r\n\r\n if (configKey !== '')\r\n {\r\n key = configKey;\r\n }\r\n else\r\n {\r\n newScene.sys.settings.key = key;\r\n }\r\n\r\n newScene.sys.init(this.game);\r\n\r\n return newScene;\r\n },\r\n\r\n /**\r\n * Creates and initializes a Scene from an Object definition.\r\n *\r\n * @method Phaser.Scenes.SceneManager#createSceneFromObject\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the Scene.\r\n * @param {(string|Phaser.Types.Scenes.SettingsConfig|Phaser.Types.Scenes.CreateSceneFromObjectConfig)} sceneConfig - The Scene config.\r\n *\r\n * @return {Phaser.Scene} The created Scene.\r\n */\r\n createSceneFromObject: function (key, sceneConfig)\r\n {\r\n var newScene = new Scene(sceneConfig);\r\n\r\n var configKey = newScene.sys.settings.key;\r\n\r\n if (configKey !== '')\r\n {\r\n key = configKey;\r\n }\r\n else\r\n {\r\n newScene.sys.settings.key = key;\r\n }\r\n\r\n newScene.sys.init(this.game);\r\n\r\n // Extract callbacks\r\n\r\n var defaults = [ 'init', 'preload', 'create', 'update', 'render' ];\r\n\r\n for (var i = 0; i < defaults.length; i++)\r\n {\r\n var sceneCallback = GetValue(sceneConfig, defaults[i], null);\r\n\r\n if (sceneCallback)\r\n {\r\n newScene[defaults[i]] = sceneCallback;\r\n }\r\n }\r\n\r\n // Now let's move across any other functions or properties that may exist in the extend object:\r\n\r\n /*\r\n scene: {\r\n preload: preload,\r\n create: create,\r\n extend: {\r\n hello: 1,\r\n test: 'atari',\r\n addImage: addImage\r\n }\r\n }\r\n */\r\n\r\n if (sceneConfig.hasOwnProperty('extend'))\r\n {\r\n for (var propertyKey in sceneConfig.extend)\r\n {\r\n if (!sceneConfig.extend.hasOwnProperty(propertyKey))\r\n {\r\n continue;\r\n }\r\n\r\n var value = sceneConfig.extend[propertyKey];\r\n\r\n if (propertyKey === 'data' && newScene.hasOwnProperty('data') && typeof value === 'object')\r\n {\r\n // Populate the DataManager\r\n newScene.data.merge(value);\r\n }\r\n else if (propertyKey !== 'sys')\r\n {\r\n newScene[propertyKey] = value;\r\n }\r\n }\r\n }\r\n\r\n return newScene;\r\n },\r\n\r\n /**\r\n * Retrieves the key of a Scene from a Scene config.\r\n *\r\n * @method Phaser.Scenes.SceneManager#getKey\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key to check in the Scene config.\r\n * @param {(Phaser.Scene|Phaser.Types.Scenes.SettingsConfig|function)} sceneConfig - The Scene config.\r\n *\r\n * @return {string} The Scene key.\r\n */\r\n getKey: function (key, sceneConfig)\r\n {\r\n if (!key) { key = 'default'; }\r\n\r\n if (typeof sceneConfig === 'function')\r\n {\r\n return key;\r\n }\r\n else if (sceneConfig instanceof Scene)\r\n {\r\n key = sceneConfig.sys.settings.key;\r\n }\r\n else if (typeof sceneConfig === 'object' && sceneConfig.hasOwnProperty('key'))\r\n {\r\n key = sceneConfig.key;\r\n }\r\n\r\n // By this point it's either 'default' or extracted from the Scene\r\n\r\n if (this.keys.hasOwnProperty(key))\r\n {\r\n throw new Error('Cannot add a Scene with duplicate key: ' + key);\r\n }\r\n else\r\n {\r\n return key;\r\n }\r\n },\r\n\r\n /**\r\n * Returns an array of all the current Scenes being managed by this Scene Manager.\r\n *\r\n * You can filter the output by the active state of the Scene and choose to have\r\n * the array returned in normal or reversed order.\r\n *\r\n * @method Phaser.Scenes.SceneManager#getScenes\r\n * @since 3.16.0\r\n *\r\n * @param {boolean} [isActive=true] - Only include Scene's that are currently active?\r\n * @param {boolean} [inReverse=false] - Return the array of Scenes in reverse?\r\n *\r\n * @return {Phaser.Scene[]} An array containing all of the Scenes in the Scene Manager.\r\n */\r\n getScenes: function (isActive, inReverse)\r\n {\r\n if (isActive === undefined) { isActive = true; }\r\n if (inReverse === undefined) { inReverse = false; }\r\n\r\n var out = [];\r\n var scenes = this.scenes;\r\n\r\n for (var i = 0; i < scenes.length; i++)\r\n {\r\n var scene = scenes[i];\r\n\r\n if (scene && (!isActive || (isActive && scene.sys.isActive())))\r\n {\r\n out.push(scene);\r\n }\r\n }\r\n\r\n return (inReverse) ? out.reverse() : out;\r\n },\r\n\r\n /**\r\n * Retrieves a Scene.\r\n *\r\n * @method Phaser.Scenes.SceneManager#getScene\r\n * @since 3.0.0\r\n *\r\n * @param {string|Phaser.Scene} key - The Scene to retrieve.\r\n *\r\n * @return {?Phaser.Scene} The Scene.\r\n */\r\n getScene: function (key)\r\n {\r\n if (typeof key === 'string')\r\n {\r\n if (this.keys[key])\r\n {\r\n return this.keys[key];\r\n }\r\n }\r\n else\r\n {\r\n for (var i = 0; i < this.scenes.length; i++)\r\n {\r\n if (key === this.scenes[i])\r\n {\r\n return key;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Determines whether a Scene is running.\r\n *\r\n * @method Phaser.Scenes.SceneManager#isActive\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The Scene to check.\r\n *\r\n * @return {boolean} Whether the Scene is running.\r\n */\r\n isActive: function (key)\r\n {\r\n var scene = this.getScene(key);\r\n\r\n if (scene)\r\n {\r\n return scene.sys.isActive();\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Determines whether a Scene is paused.\r\n *\r\n * @method Phaser.Scenes.SceneManager#isPaused\r\n * @since 3.17.0\r\n *\r\n * @param {string} key - The Scene to check.\r\n *\r\n * @return {boolean} Whether the Scene is paused.\r\n */\r\n isPaused: function (key)\r\n {\r\n var scene = this.getScene(key);\r\n\r\n if (scene)\r\n {\r\n return scene.sys.isPaused();\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Determines whether a Scene is visible.\r\n *\r\n * @method Phaser.Scenes.SceneManager#isVisible\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The Scene to check.\r\n *\r\n * @return {boolean} Whether the Scene is visible.\r\n */\r\n isVisible: function (key)\r\n {\r\n var scene = this.getScene(key);\r\n\r\n if (scene)\r\n {\r\n return scene.sys.isVisible();\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Determines whether a Scene is sleeping.\r\n *\r\n * @method Phaser.Scenes.SceneManager#isSleeping\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The Scene to check.\r\n *\r\n * @return {boolean} Whether the Scene is sleeping.\r\n */\r\n isSleeping: function (key)\r\n {\r\n var scene = this.getScene(key);\r\n\r\n if (scene)\r\n {\r\n return scene.sys.isSleeping();\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Pauses the given Scene.\r\n *\r\n * @method Phaser.Scenes.SceneManager#pause\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The Scene to pause.\r\n * @param {object} [data] - An optional data object that will be passed to the Scene and emitted by its pause event.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n pause: function (key, data)\r\n {\r\n var scene = this.getScene(key);\r\n\r\n if (scene)\r\n {\r\n scene.sys.pause(data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resumes the given Scene.\r\n *\r\n * @method Phaser.Scenes.SceneManager#resume\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The Scene to resume.\r\n * @param {object} [data] - An optional data object that will be passed to the Scene and emitted by its resume event.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n resume: function (key, data)\r\n {\r\n var scene = this.getScene(key);\r\n\r\n if (scene)\r\n {\r\n scene.sys.resume(data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Puts the given Scene to sleep.\r\n *\r\n * @method Phaser.Scenes.SceneManager#sleep\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The Scene to put to sleep.\r\n * @param {object} [data] - An optional data object that will be passed to the Scene and emitted by its sleep event.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n sleep: function (key, data)\r\n {\r\n var scene = this.getScene(key);\r\n\r\n if (scene && !scene.sys.isTransitioning())\r\n {\r\n scene.sys.sleep(data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Awakens the given Scene.\r\n *\r\n * @method Phaser.Scenes.SceneManager#wake\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The Scene to wake up.\r\n * @param {object} [data] - An optional data object that will be passed to the Scene and emitted by its wake event.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n wake: function (key, data)\r\n {\r\n var scene = this.getScene(key);\r\n\r\n if (scene)\r\n {\r\n scene.sys.wake(data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Runs the given Scene.\r\n *\r\n * If the given Scene is paused, it will resume it. If sleeping, it will wake it.\r\n * If not running at all, it will be started.\r\n *\r\n * Use this if you wish to open a modal Scene by calling `pause` on the current\r\n * Scene, then `run` on the modal Scene.\r\n *\r\n * @method Phaser.Scenes.SceneManager#run\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The Scene to run.\r\n * @param {object} [data] - A data object that will be passed to the Scene on start, wake, or resume.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This Scene Manager.\r\n */\r\n run: function (key, data)\r\n {\r\n var scene = this.getScene(key);\r\n\r\n if (!scene)\r\n {\r\n for (var i = 0; i < this._pending.length; i++)\r\n {\r\n if (this._pending[i].key === key)\r\n {\r\n this.queueOp('start', key, data);\r\n break;\r\n }\r\n }\r\n return this;\r\n }\r\n\r\n if (scene.sys.isSleeping())\r\n {\r\n // Sleeping?\r\n scene.sys.wake(data);\r\n }\r\n else if (scene.sys.isPaused())\r\n {\r\n // Paused?\r\n scene.sys.resume(data);\r\n }\r\n else\r\n {\r\n // Not actually running?\r\n this.start(key, data);\r\n }\r\n },\r\n\r\n /**\r\n * Starts the given Scene.\r\n *\r\n * @method Phaser.Scenes.SceneManager#start\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The Scene to start.\r\n * @param {object} [data] - Optional data object to pass to Scene.Settings and Scene.init.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n start: function (key, data)\r\n {\r\n // If the Scene Manager is not running, then put the Scene into a holding pattern\r\n if (!this.isBooted)\r\n {\r\n this._data[key] = {\r\n autoStart: true,\r\n data: data\r\n };\r\n\r\n return this;\r\n }\r\n\r\n var scene = this.getScene(key);\r\n\r\n if (scene)\r\n {\r\n // If the Scene is already running (perhaps they called start from a launched sub-Scene?)\r\n // then we close it down before starting it again.\r\n if (scene.sys.isActive() || scene.sys.isPaused())\r\n {\r\n scene.sys.shutdown();\r\n\r\n scene.sys.start(data);\r\n }\r\n else\r\n {\r\n scene.sys.start(data);\r\n\r\n var loader;\r\n\r\n if (scene.sys.load)\r\n {\r\n loader = scene.sys.load;\r\n }\r\n\r\n // Files payload?\r\n if (loader && scene.sys.settings.hasOwnProperty('pack'))\r\n {\r\n loader.reset();\r\n\r\n if (loader.addPack({ payload: scene.sys.settings.pack }))\r\n {\r\n scene.sys.settings.status = CONST.LOADING;\r\n\r\n loader.once(LoaderEvents.COMPLETE, this.payloadComplete, this);\r\n\r\n loader.start();\r\n\r\n return this;\r\n }\r\n }\r\n }\r\n\r\n this.bootScene(scene);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stops the given Scene.\r\n *\r\n * @method Phaser.Scenes.SceneManager#stop\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The Scene to stop.\r\n * @param {object} [data] - Optional data object to pass to Scene.shutdown.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n stop: function (key, data)\r\n {\r\n var scene = this.getScene(key);\r\n\r\n if (scene && !scene.sys.isTransitioning())\r\n {\r\n scene.sys.shutdown(data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sleeps one one Scene and starts the other.\r\n *\r\n * @method Phaser.Scenes.SceneManager#switch\r\n * @since 3.0.0\r\n *\r\n * @param {string} from - The Scene to sleep.\r\n * @param {string} to - The Scene to start.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n switch: function (from, to)\r\n {\r\n var sceneA = this.getScene(from);\r\n var sceneB = this.getScene(to);\r\n\r\n if (sceneA && sceneB && sceneA !== sceneB)\r\n {\r\n this.sleep(from);\r\n\r\n if (this.isSleeping(to))\r\n {\r\n this.wake(to);\r\n }\r\n else\r\n {\r\n this.start(to);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieves a Scene by numeric index.\r\n *\r\n * @method Phaser.Scenes.SceneManager#getAt\r\n * @since 3.0.0\r\n *\r\n * @param {integer} index - The index of the Scene to retrieve.\r\n *\r\n * @return {(Phaser.Scene|undefined)} The Scene.\r\n */\r\n getAt: function (index)\r\n {\r\n return this.scenes[index];\r\n },\r\n\r\n /**\r\n * Retrieves the numeric index of a Scene.\r\n *\r\n * @method Phaser.Scenes.SceneManager#getIndex\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Scene)} key - The key of the Scene.\r\n *\r\n * @return {integer} The index of the Scene.\r\n */\r\n getIndex: function (key)\r\n {\r\n var scene = this.getScene(key);\r\n\r\n return this.scenes.indexOf(scene);\r\n },\r\n\r\n /**\r\n * Brings a Scene to the top of the Scenes list.\r\n *\r\n * This means it will render above all other Scenes.\r\n *\r\n * @method Phaser.Scenes.SceneManager#bringToTop\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Scene)} key - The Scene to move.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n bringToTop: function (key)\r\n {\r\n if (this.isProcessing)\r\n {\r\n this._queue.push({ op: 'bringToTop', keyA: key, keyB: null });\r\n }\r\n else\r\n {\r\n var index = this.getIndex(key);\r\n\r\n if (index !== -1 && index < this.scenes.length)\r\n {\r\n var scene = this.getScene(key);\r\n\r\n this.scenes.splice(index, 1);\r\n this.scenes.push(scene);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sends a Scene to the back of the Scenes list.\r\n *\r\n * This means it will render below all other Scenes.\r\n *\r\n * @method Phaser.Scenes.SceneManager#sendToBack\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Scene)} key - The Scene to move.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n sendToBack: function (key)\r\n {\r\n if (this.isProcessing)\r\n {\r\n this._queue.push({ op: 'sendToBack', keyA: key, keyB: null });\r\n }\r\n else\r\n {\r\n var index = this.getIndex(key);\r\n\r\n if (index !== -1 && index > 0)\r\n {\r\n var scene = this.getScene(key);\r\n\r\n this.scenes.splice(index, 1);\r\n this.scenes.unshift(scene);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves a Scene down one position in the Scenes list.\r\n *\r\n * @method Phaser.Scenes.SceneManager#moveDown\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Scene)} key - The Scene to move.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n moveDown: function (key)\r\n {\r\n if (this.isProcessing)\r\n {\r\n this._queue.push({ op: 'moveDown', keyA: key, keyB: null });\r\n }\r\n else\r\n {\r\n var indexA = this.getIndex(key);\r\n\r\n if (indexA > 0)\r\n {\r\n var indexB = indexA - 1;\r\n var sceneA = this.getScene(key);\r\n var sceneB = this.getAt(indexB);\r\n\r\n this.scenes[indexA] = sceneB;\r\n this.scenes[indexB] = sceneA;\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves a Scene up one position in the Scenes list.\r\n *\r\n * @method Phaser.Scenes.SceneManager#moveUp\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Scene)} key - The Scene to move.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n moveUp: function (key)\r\n {\r\n if (this.isProcessing)\r\n {\r\n this._queue.push({ op: 'moveUp', keyA: key, keyB: null });\r\n }\r\n else\r\n {\r\n var indexA = this.getIndex(key);\r\n\r\n if (indexA < this.scenes.length - 1)\r\n {\r\n var indexB = indexA + 1;\r\n var sceneA = this.getScene(key);\r\n var sceneB = this.getAt(indexB);\r\n\r\n this.scenes[indexA] = sceneB;\r\n this.scenes[indexB] = sceneA;\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves a Scene so it is immediately above another Scene in the Scenes list.\r\n *\r\n * This means it will render over the top of the other Scene.\r\n *\r\n * @method Phaser.Scenes.SceneManager#moveAbove\r\n * @since 3.2.0\r\n *\r\n * @param {(string|Phaser.Scene)} keyA - The Scene that Scene B will be moved above.\r\n * @param {(string|Phaser.Scene)} keyB - The Scene to be moved.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n moveAbove: function (keyA, keyB)\r\n {\r\n if (keyA === keyB)\r\n {\r\n return this;\r\n }\r\n\r\n if (this.isProcessing)\r\n {\r\n this._queue.push({ op: 'moveAbove', keyA: keyA, keyB: keyB });\r\n }\r\n else\r\n {\r\n var indexA = this.getIndex(keyA);\r\n var indexB = this.getIndex(keyB);\r\n\r\n if (indexA !== -1 && indexB !== -1)\r\n {\r\n var tempScene = this.getAt(indexB);\r\n\r\n // Remove\r\n this.scenes.splice(indexB, 1);\r\n\r\n // Add in new location\r\n this.scenes.splice(indexA + 1, 0, tempScene);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves a Scene so it is immediately below another Scene in the Scenes list.\r\n *\r\n * This means it will render behind the other Scene.\r\n *\r\n * @method Phaser.Scenes.SceneManager#moveBelow\r\n * @since 3.2.0\r\n *\r\n * @param {(string|Phaser.Scene)} keyA - The Scene that Scene B will be moved above.\r\n * @param {(string|Phaser.Scene)} keyB - The Scene to be moved.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n moveBelow: function (keyA, keyB)\r\n {\r\n if (keyA === keyB)\r\n {\r\n return this;\r\n }\r\n\r\n if (this.isProcessing)\r\n {\r\n this._queue.push({ op: 'moveBelow', keyA: keyA, keyB: keyB });\r\n }\r\n else\r\n {\r\n var indexA = this.getIndex(keyA);\r\n var indexB = this.getIndex(keyB);\r\n\r\n if (indexA !== -1 && indexB !== -1)\r\n {\r\n var tempScene = this.getAt(indexB);\r\n\r\n // Remove\r\n this.scenes.splice(indexB, 1);\r\n\r\n if (indexA === 0)\r\n {\r\n this.scenes.unshift(tempScene);\r\n }\r\n else\r\n {\r\n // Add in new location\r\n this.scenes.splice(indexA, 0, tempScene);\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Queue a Scene operation for the next update.\r\n *\r\n * @method Phaser.Scenes.SceneManager#queueOp\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {string} op - The operation to perform.\r\n * @param {(string|Phaser.Scene)} keyA - Scene A.\r\n * @param {(any|string|Phaser.Scene)} [keyB] - Scene B, or a data object.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n queueOp: function (op, keyA, keyB)\r\n {\r\n this._queue.push({ op: op, keyA: keyA, keyB: keyB });\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Swaps the positions of two Scenes in the Scenes list.\r\n *\r\n * @method Phaser.Scenes.SceneManager#swapPosition\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Scene)} keyA - The first Scene to swap.\r\n * @param {(string|Phaser.Scene)} keyB - The second Scene to swap.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n swapPosition: function (keyA, keyB)\r\n {\r\n if (keyA === keyB)\r\n {\r\n return this;\r\n }\r\n\r\n if (this.isProcessing)\r\n {\r\n this._queue.push({ op: 'swapPosition', keyA: keyA, keyB: keyB });\r\n }\r\n else\r\n {\r\n var indexA = this.getIndex(keyA);\r\n var indexB = this.getIndex(keyB);\r\n\r\n if (indexA !== indexB && indexA !== -1 && indexB !== -1)\r\n {\r\n var tempScene = this.getAt(indexA);\r\n\r\n this.scenes[indexA] = this.scenes[indexB];\r\n this.scenes[indexB] = tempScene;\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Dumps debug information about each Scene to the developer console.\r\n *\r\n * @method Phaser.Scenes.SceneManager#dump\r\n * @since 3.2.0\r\n */\r\n dump: function ()\r\n {\r\n var out = [];\r\n var map = [ 'pending', 'init', 'start', 'loading', 'creating', 'running', 'paused', 'sleeping', 'shutdown', 'destroyed' ];\r\n\r\n for (var i = 0; i < this.scenes.length; i++)\r\n {\r\n var sys = this.scenes[i].sys;\r\n\r\n var key = (sys.settings.visible && (sys.settings.status === CONST.RUNNING || sys.settings.status === CONST.PAUSED)) ? '[*] ' : '[-] ';\r\n key += sys.settings.key + ' (' + map[sys.settings.status] + ')';\r\n\r\n out.push(key);\r\n }\r\n\r\n console.log(out.join('\\n'));\r\n },\r\n\r\n /**\r\n * Destroy the SceneManager and all of its Scene's systems.\r\n *\r\n * @method Phaser.Scenes.SceneManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n for (var i = 0; i < this.scenes.length; i++)\r\n {\r\n var sys = this.scenes[i].sys;\r\n\r\n sys.destroy();\r\n }\r\n\r\n this.update = NOOP;\r\n\r\n this.scenes = [];\r\n\r\n this._pending = [];\r\n this._start = [];\r\n this._queue = [];\r\n\r\n this.game = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SceneManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/SceneManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/ScenePlugin.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/scene/ScenePlugin.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = __webpack_require__(/*! ../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar PluginCache = __webpack_require__(/*! ../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A proxy class to the Global Scene Manager.\r\n *\r\n * @class ScenePlugin\r\n * @memberof Phaser.Scenes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene that this ScenePlugin belongs to.\r\n */\r\nvar ScenePlugin = new Class({\r\n\r\n initialize:\r\n\r\n function ScenePlugin (scene)\r\n {\r\n /**\r\n * The Scene that this ScenePlugin belongs to.\r\n *\r\n * @name Phaser.Scenes.ScenePlugin#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * The Scene Systems instance of the Scene that this ScenePlugin belongs to.\r\n *\r\n * @name Phaser.Scenes.ScenePlugin#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n /**\r\n * The settings of the Scene this ScenePlugin belongs to.\r\n *\r\n * @name Phaser.Scenes.ScenePlugin#settings\r\n * @type {Phaser.Types.Scenes.SettingsObject}\r\n * @since 3.0.0\r\n */\r\n this.settings = scene.sys.settings;\r\n\r\n /**\r\n * The key of the Scene this ScenePlugin belongs to.\r\n *\r\n * @name Phaser.Scenes.ScenePlugin#key\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.key = scene.sys.settings.key;\r\n\r\n /**\r\n * The Game's SceneManager.\r\n *\r\n * @name Phaser.Scenes.ScenePlugin#manager\r\n * @type {Phaser.Scenes.SceneManager}\r\n * @since 3.0.0\r\n */\r\n this.manager = scene.sys.game.scene;\r\n\r\n /**\r\n * If this Scene is currently transitioning to another, this holds\r\n * the current percentage of the transition progress, between 0 and 1.\r\n *\r\n * @name Phaser.Scenes.ScenePlugin#transitionProgress\r\n * @type {number}\r\n * @since 3.5.0\r\n */\r\n this.transitionProgress = 0;\r\n\r\n /**\r\n * Transition elapsed timer.\r\n *\r\n * @name Phaser.Scenes.ScenePlugin#_elapsed\r\n * @type {integer}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this._elapsed = 0;\r\n\r\n /**\r\n * Transition elapsed timer.\r\n *\r\n * @name Phaser.Scenes.ScenePlugin#_target\r\n * @type {?Phaser.Scenes.Scene}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this._target = null;\r\n\r\n /**\r\n * Transition duration.\r\n *\r\n * @name Phaser.Scenes.ScenePlugin#_duration\r\n * @type {integer}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this._duration = 0;\r\n\r\n /**\r\n * Transition callback.\r\n *\r\n * @name Phaser.Scenes.ScenePlugin#_onUpdate\r\n * @type {function}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this._onUpdate;\r\n\r\n /**\r\n * Transition callback scope.\r\n *\r\n * @name Phaser.Scenes.ScenePlugin#_onUpdateScope\r\n * @type {object}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this._onUpdateScope;\r\n\r\n /**\r\n * Will this Scene sleep (true) after the transition, or stop (false)\r\n *\r\n * @name Phaser.Scenes.ScenePlugin#_willSleep\r\n * @type {boolean}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this._willSleep = false;\r\n\r\n /**\r\n * Will this Scene be removed from the Scene Manager after the transition completes?\r\n *\r\n * @name Phaser.Scenes.ScenePlugin#_willRemove\r\n * @type {boolean}\r\n * @private\r\n * @since 3.5.0\r\n */\r\n this._willRemove = false;\r\n\r\n scene.sys.events.once(Events.BOOT, this.boot, this);\r\n scene.sys.events.on(Events.START, this.pluginStart, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#boot\r\n * @private\r\n * @since 3.0.0\r\n */\r\n boot: function ()\r\n {\r\n this.systems.events.once(Events.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#pluginStart\r\n * @private\r\n * @since 3.5.0\r\n */\r\n pluginStart: function ()\r\n {\r\n this._target = null;\r\n\r\n this.systems.events.once(Events.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * Shutdown this Scene and run the given one.\r\n *\r\n * This will happen at the next Scene Manager update, not immediately.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#start\r\n * @since 3.0.0\r\n *\r\n * @param {string} [key] - The Scene to start.\r\n * @param {object} [data] - The Scene data.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n start: function (key, data)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n this.manager.queueOp('stop', this.key);\r\n this.manager.queueOp('start', key, data);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Restarts this Scene.\r\n *\r\n * This will happen at the next Scene Manager update, not immediately.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#restart\r\n * @since 3.4.0\r\n *\r\n * @param {object} [data] - The Scene data.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n restart: function (data)\r\n {\r\n var key = this.key;\r\n\r\n this.manager.queueOp('stop', key);\r\n this.manager.queueOp('start', key, data);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * This will start a transition from the current Scene to the target Scene given.\r\n *\r\n * The transition will last for the duration specified in milliseconds.\r\n *\r\n * You can have the target Scene moved above or below this one in the display list.\r\n *\r\n * You can specify an update callback. This callback will be invoked _every frame_ for the duration\r\n * of the transition.\r\n *\r\n * This Scene can either be sent to sleep at the end of the transition, or stopped. The default is to stop.\r\n *\r\n * There are also 5 transition related events: This scene will emit the event `transitionout` when\r\n * the transition begins, which is typically the frame after calling this method.\r\n *\r\n * The target Scene will emit the event `transitioninit` when that Scene's `init` method is called.\r\n * It will then emit the event `transitionstart` when its `create` method is called.\r\n * If the Scene was sleeping and has been woken up, it will emit the event `transitionwake` instead of these two,\r\n * as the Scenes `init` and `create` methods are not invoked when a Scene wakes up.\r\n *\r\n * When the duration of the transition has elapsed it will emit the event `transitioncomplete`.\r\n * These events are cleared of all listeners when the Scene shuts down, but not if it is sent to sleep.\r\n *\r\n * It's important to understand that the duration of the transition begins the moment you call this method.\r\n * If the Scene you are transitioning to includes delayed processes, such as waiting for files to load, the\r\n * time still counts down even while that is happening. If the game itself pauses, or something else causes\r\n * this Scenes update loop to stop, then the transition will also pause for that duration. There are\r\n * checks in place to prevent you accidentally stopping a transitioning Scene but if you've got code to\r\n * override this understand that until the target Scene completes it might never be unlocked for input events.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#transition\r\n * @fires Phaser.Scenes.Events#TRANSITION_OUT\r\n * @since 3.5.0\r\n *\r\n * @param {Phaser.Types.Scenes.SceneTransitionConfig} config - The transition configuration object.\r\n *\r\n * @return {boolean} `true` is the transition was started, otherwise `false`.\r\n */\r\n transition: function (config)\r\n {\r\n if (config === undefined) { config = {}; }\r\n\r\n var key = GetFastValue(config, 'target', false);\r\n\r\n var target = this.manager.getScene(key);\r\n\r\n if (!key || !this.checkValidTransition(target))\r\n {\r\n return false;\r\n }\r\n\r\n var duration = GetFastValue(config, 'duration', 1000);\r\n\r\n this._elapsed = 0;\r\n this._target = target;\r\n this._duration = duration;\r\n this._willSleep = GetFastValue(config, 'sleep', false);\r\n this._willRemove = GetFastValue(config, 'remove', false);\r\n\r\n var callback = GetFastValue(config, 'onUpdate', null);\r\n\r\n if (callback)\r\n {\r\n this._onUpdate = callback;\r\n this._onUpdateScope = GetFastValue(config, 'onUpdateScope', this.scene);\r\n }\r\n\r\n var allowInput = GetFastValue(config, 'allowInput', false);\r\n\r\n this.settings.transitionAllowInput = allowInput;\r\n\r\n var targetSettings = target.sys.settings;\r\n\r\n targetSettings.isTransition = true;\r\n targetSettings.transitionFrom = this.scene;\r\n targetSettings.transitionDuration = duration;\r\n targetSettings.transitionAllowInput = allowInput;\r\n\r\n if (GetFastValue(config, 'moveAbove', false))\r\n {\r\n this.manager.moveAbove(this.key, key);\r\n }\r\n else if (GetFastValue(config, 'moveBelow', false))\r\n {\r\n this.manager.moveBelow(this.key, key);\r\n }\r\n\r\n if (target.sys.isSleeping())\r\n {\r\n target.sys.wake();\r\n }\r\n else\r\n {\r\n this.manager.start(key, GetFastValue(config, 'data'));\r\n }\r\n\r\n this.systems.events.emit(Events.TRANSITION_OUT, target, duration);\r\n\r\n this.systems.events.on(Events.UPDATE, this.step, this);\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Checks to see if this Scene can transition to the target Scene or not.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#checkValidTransition\r\n * @private\r\n * @since 3.5.0\r\n *\r\n * @param {Phaser.Scene} target - The Scene to test against.\r\n *\r\n * @return {boolean} `true` if this Scene can transition, otherwise `false`.\r\n */\r\n checkValidTransition: function (target)\r\n {\r\n // Not a valid target if it doesn't exist, isn't active or is already transitioning in or out\r\n if (!target || target.sys.isActive() || target.sys.isTransitioning() || target === this.scene || this.systems.isTransitioning())\r\n {\r\n return false;\r\n }\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * A single game step. This is only called if the parent Scene is transitioning\r\n * out to another Scene.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#step\r\n * @private\r\n * @since 3.5.0\r\n *\r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\n step: function (time, delta)\r\n {\r\n this._elapsed += delta;\r\n\r\n this.transitionProgress = Clamp(this._elapsed / this._duration, 0, 1);\r\n\r\n if (this._onUpdate)\r\n {\r\n this._onUpdate.call(this._onUpdateScope, this.transitionProgress);\r\n }\r\n\r\n if (this._elapsed >= this._duration)\r\n {\r\n this.transitionComplete();\r\n }\r\n },\r\n\r\n /**\r\n * Called by `step` when the transition out of this scene to another is over.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#transitionComplete\r\n * @private\r\n * @fires Phaser.Scenes.Events#TRANSITION_COMPLETE\r\n * @since 3.5.0\r\n */\r\n transitionComplete: function ()\r\n {\r\n var targetSys = this._target.sys;\r\n var targetSettings = this._target.sys.settings;\r\n\r\n // Stop the step\r\n this.systems.events.off(Events.UPDATE, this.step, this);\r\n\r\n // Notify target scene\r\n targetSys.events.emit(Events.TRANSITION_COMPLETE, this.scene);\r\n\r\n // Clear target scene settings\r\n targetSettings.isTransition = false;\r\n targetSettings.transitionFrom = null;\r\n\r\n // Clear local settings\r\n this._duration = 0;\r\n this._target = null;\r\n this._onUpdate = null;\r\n this._onUpdateScope = null;\r\n\r\n // Now everything is clear we can handle what happens to this Scene\r\n if (this._willRemove)\r\n {\r\n this.manager.remove(this.key);\r\n }\r\n else if (this._willSleep)\r\n {\r\n this.systems.sleep();\r\n }\r\n else\r\n {\r\n this.manager.stop(this.key);\r\n }\r\n },\r\n\r\n /**\r\n * Add the Scene into the Scene Manager and start it if 'autoStart' is true or the Scene config 'active' property is set.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#add\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The Scene key.\r\n * @param {(Phaser.Scene|Phaser.Types.Scenes.SettingsConfig|Phaser.Types.Scenes.CreateSceneFromObjectConfig|function)} sceneConfig - The config for the Scene.\r\n * @param {boolean} autoStart - Whether to start the Scene after it's added.\r\n * @param {object} [data] - Optional data object. This will be set as Scene.settings.data and passed to `Scene.init`.\r\n *\r\n * @return {Phaser.Scene} An instance of the Scene that was added to the Scene Manager.\r\n */\r\n add: function (key, sceneConfig, autoStart, data)\r\n {\r\n return this.manager.add(key, sceneConfig, autoStart, data);\r\n },\r\n\r\n /**\r\n * Launch the given Scene and run it in parallel with this one.\r\n *\r\n * This will happen at the next Scene Manager update, not immediately.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#launch\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The Scene to launch.\r\n * @param {object} [data] - The Scene data.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n launch: function (key, data)\r\n {\r\n if (key && key !== this.key)\r\n {\r\n this.manager.queueOp('start', key, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Runs the given Scene, but does not change the state of this Scene.\r\n *\r\n * This will happen at the next Scene Manager update, not immediately.\r\n *\r\n * If the given Scene is paused, it will resume it. If sleeping, it will wake it.\r\n * If not running at all, it will be started.\r\n *\r\n * Use this if you wish to open a modal Scene by calling `pause` on the current\r\n * Scene, then `run` on the modal Scene.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#run\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The Scene to run.\r\n * @param {object} [data] - A data object that will be passed to the Scene and emitted in its ready, wake, or resume events.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n run: function (key, data)\r\n {\r\n if (key && key !== this.key)\r\n {\r\n this.manager.queueOp('run', key, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Pause the Scene - this stops the update step from happening but it still renders.\r\n *\r\n * This will happen at the next Scene Manager update, not immediately.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#pause\r\n * @since 3.0.0\r\n *\r\n * @param {string} [key] - The Scene to pause.\r\n * @param {object} [data] - An optional data object that will be passed to the Scene and emitted in its pause event.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n pause: function (key, data)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n this.manager.queueOp('pause', key, data);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resume the Scene - starts the update loop again.\r\n *\r\n * This will happen at the next Scene Manager update, not immediately.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#resume\r\n * @since 3.0.0\r\n *\r\n * @param {string} [key] - The Scene to resume.\r\n * @param {object} [data] - An optional data object that will be passed to the Scene and emitted in its resume event.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n resume: function (key, data)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n this.manager.queueOp('resume', key, data);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Makes the Scene sleep (no update, no render) but doesn't shutdown.\r\n *\r\n * This will happen at the next Scene Manager update, not immediately.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#sleep\r\n * @since 3.0.0\r\n *\r\n * @param {string} [key] - The Scene to put to sleep.\r\n * @param {object} [data] - An optional data object that will be passed to the Scene and emitted in its sleep event.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n sleep: function (key, data)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n this.manager.queueOp('sleep', key, data);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Makes the Scene wake-up (starts update and render)\r\n *\r\n * This will happen at the next Scene Manager update, not immediately.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#wake\r\n * @since 3.0.0\r\n *\r\n * @param {string} [key] - The Scene to wake up.\r\n * @param {object} [data] - An optional data object that will be passed to the Scene and emitted in its wake event.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n wake: function (key, data)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n this.manager.queueOp('wake', key, data);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Makes this Scene sleep then starts the Scene given.\r\n *\r\n * This will happen at the next Scene Manager update, not immediately.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#switch\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The Scene to start.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n switch: function (key)\r\n {\r\n if (key !== this.key)\r\n {\r\n this.manager.queueOp('switch', this.key, key);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Shutdown the Scene, clearing display list, timers, etc.\r\n *\r\n * This happens at the next Scene Manager update, not immediately.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#stop\r\n * @since 3.0.0\r\n *\r\n * @param {string} [key] - The Scene to stop.\r\n * @param {any} [data] - Optional data object to pass to Scene.Systems.shutdown.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n stop: function (key, data)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n this.manager.queueOp('stop', key, data);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the active state of the given Scene.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#setActive\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - If `true` the Scene will be resumed. If `false` it will be paused.\r\n * @param {string} [key] - The Scene to set the active state of.\r\n * @param {object} [data] - An optional data object that will be passed to the Scene and emitted with its events.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n setActive: function (value, key, data)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n var scene = this.manager.getScene(key);\r\n\r\n if (scene)\r\n {\r\n scene.sys.setActive(value, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the visible state of the given Scene.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#setVisible\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The visible value.\r\n * @param {string} [key] - The Scene to set the visible state for.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n setVisible: function (value, key)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n var scene = this.manager.getScene(key);\r\n\r\n if (scene)\r\n {\r\n scene.sys.setVisible(value);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Checks if the given Scene is sleeping or not?\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#isSleeping\r\n * @since 3.0.0\r\n *\r\n * @param {string} [key] - The Scene to check.\r\n *\r\n * @return {boolean} Whether the Scene is sleeping.\r\n */\r\n isSleeping: function (key)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n return this.manager.isSleeping(key);\r\n },\r\n\r\n /**\r\n * Checks if the given Scene is running or not?\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#isActive\r\n * @since 3.0.0\r\n *\r\n * @param {string} [key] - The Scene to check.\r\n *\r\n * @return {boolean} Whether the Scene is running.\r\n */\r\n isActive: function (key)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n return this.manager.isActive(key);\r\n },\r\n\r\n /**\r\n * Checks if the given Scene is paused or not?\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#isPaused\r\n * @since 3.17.0\r\n *\r\n * @param {string} [key] - The Scene to check.\r\n *\r\n * @return {boolean} Whether the Scene is paused.\r\n */\r\n isPaused: function (key)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n return this.manager.isPaused(key);\r\n },\r\n\r\n /**\r\n * Checks if the given Scene is visible or not?\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#isVisible\r\n * @since 3.0.0\r\n *\r\n * @param {string} [key] - The Scene to check.\r\n *\r\n * @return {boolean} Whether the Scene is visible.\r\n */\r\n isVisible: function (key)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n return this.manager.isVisible(key);\r\n },\r\n\r\n /**\r\n * Swaps the position of two scenes in the Scenes list.\r\n *\r\n * This controls the order in which they are rendered and updated.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#swapPosition\r\n * @since 3.2.0\r\n *\r\n * @param {string} keyA - The first Scene to swap.\r\n * @param {string} [keyB] - The second Scene to swap. If none is given it defaults to this Scene.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n swapPosition: function (keyA, keyB)\r\n {\r\n if (keyB === undefined) { keyB = this.key; }\r\n\r\n if (keyA !== keyB)\r\n {\r\n this.manager.swapPosition(keyA, keyB);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Swaps the position of two scenes in the Scenes list, so that Scene B is directly above Scene A.\r\n *\r\n * This controls the order in which they are rendered and updated.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#moveAbove\r\n * @since 3.2.0\r\n *\r\n * @param {string} keyA - The Scene that Scene B will be moved to be above.\r\n * @param {string} [keyB] - The Scene to be moved. If none is given it defaults to this Scene.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n moveAbove: function (keyA, keyB)\r\n {\r\n if (keyB === undefined) { keyB = this.key; }\r\n\r\n if (keyA !== keyB)\r\n {\r\n this.manager.moveAbove(keyA, keyB);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Swaps the position of two scenes in the Scenes list, so that Scene B is directly below Scene A.\r\n *\r\n * This controls the order in which they are rendered and updated.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#moveBelow\r\n * @since 3.2.0\r\n *\r\n * @param {string} keyA - The Scene that Scene B will be moved to be below.\r\n * @param {string} [keyB] - The Scene to be moved. If none is given it defaults to this Scene.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n moveBelow: function (keyA, keyB)\r\n {\r\n if (keyB === undefined) { keyB = this.key; }\r\n\r\n if (keyA !== keyB)\r\n {\r\n this.manager.moveBelow(keyA, keyB);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes a Scene from the SceneManager.\r\n *\r\n * The Scene is removed from the local scenes array, it's key is cleared from the keys\r\n * cache and Scene.Systems.destroy is then called on it.\r\n *\r\n * If the SceneManager is processing the Scenes when this method is called it will\r\n * queue the operation for the next update sequence.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#remove\r\n * @since 3.2.0\r\n *\r\n * @param {(string|Phaser.Scene)} [key] - The Scene to be removed.\r\n *\r\n * @return {Phaser.Scenes.SceneManager} This SceneManager.\r\n */\r\n remove: function (key)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n this.manager.remove(key);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves a Scene up one position in the Scenes list.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#moveUp\r\n * @since 3.0.0\r\n *\r\n * @param {string} [key] - The Scene to move.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n moveUp: function (key)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n this.manager.moveUp(key);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves a Scene down one position in the Scenes list.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#moveDown\r\n * @since 3.0.0\r\n *\r\n * @param {string} [key] - The Scene to move.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n moveDown: function (key)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n this.manager.moveDown(key);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Brings a Scene to the top of the Scenes list.\r\n *\r\n * This means it will render above all other Scenes.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#bringToTop\r\n * @since 3.0.0\r\n *\r\n * @param {string} [key] - The Scene to move.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n bringToTop: function (key)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n this.manager.bringToTop(key);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sends a Scene to the back of the Scenes list.\r\n *\r\n * This means it will render below all other Scenes.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#sendToBack\r\n * @since 3.0.0\r\n *\r\n * @param {string} [key] - The Scene to move.\r\n *\r\n * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object.\r\n */\r\n sendToBack: function (key)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n this.manager.sendToBack(key);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieve a Scene.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#get\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The Scene to retrieve.\r\n *\r\n * @return {Phaser.Scene} The Scene.\r\n */\r\n get: function (key)\r\n {\r\n return this.manager.getScene(key);\r\n },\r\n\r\n /**\r\n * Retrieves the numeric index of a Scene in the Scenes list.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#getIndex\r\n * @since 3.7.0\r\n *\r\n * @param {(string|Phaser.Scene)} [key] - The Scene to get the index of.\r\n *\r\n * @return {integer} The index of the Scene.\r\n */\r\n getIndex: function (key)\r\n {\r\n if (key === undefined) { key = this.key; }\r\n\r\n return this.manager.getIndex(key);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#shutdown\r\n * @private\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.off(Events.SHUTDOWN, this.shutdown, this);\r\n eventEmitter.off(Events.POST_UPDATE, this.step, this);\r\n eventEmitter.off(Events.TRANSITION_OUT);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Phaser.Scenes.ScenePlugin#destroy\r\n * @private\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.scene.sys.events.off(Events.START, this.start, this);\r\n\r\n this.scene = null;\r\n this.systems = null;\r\n this.settings = null;\r\n this.manager = null;\r\n }\r\n\r\n});\r\n\r\nPluginCache.register('ScenePlugin', ScenePlugin, 'scenePlugin');\r\n\r\nmodule.exports = ScenePlugin;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/ScenePlugin.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/Settings.js": /*!***************************************************!*\ !*** ./node_modules/phaser/src/scene/Settings.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/scene/const.js\");\r\nvar GetValue = __webpack_require__(/*! ../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar Merge = __webpack_require__(/*! ../utils/object/Merge */ \"./node_modules/phaser/src/utils/object/Merge.js\");\r\nvar InjectionMap = __webpack_require__(/*! ./InjectionMap */ \"./node_modules/phaser/src/scene/InjectionMap.js\");\r\n\r\n/**\r\n * @namespace Phaser.Scenes.Settings\r\n */\r\n\r\nvar Settings = {\r\n\r\n /**\r\n * Takes a Scene configuration object and returns a fully formed System Settings object.\r\n *\r\n * @function Phaser.Scenes.Settings.create\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Scenes.SettingsConfig)} config - The Scene configuration object used to create this Scene Settings.\r\n *\r\n * @return {Phaser.Types.Scenes.SettingsObject} The Scene Settings object created as a result of the config and default settings.\r\n */\r\n create: function (config)\r\n {\r\n if (typeof config === 'string')\r\n {\r\n config = { key: config };\r\n }\r\n else if (config === undefined)\r\n {\r\n // Pass the 'hasOwnProperty' checks\r\n config = {};\r\n }\r\n\r\n return {\r\n\r\n status: CONST.PENDING,\r\n\r\n key: GetValue(config, 'key', ''),\r\n active: GetValue(config, 'active', false),\r\n visible: GetValue(config, 'visible', true),\r\n\r\n isBooted: false,\r\n\r\n isTransition: false,\r\n transitionFrom: null,\r\n transitionDuration: 0,\r\n transitionAllowInput: true,\r\n\r\n // Loader payload array\r\n\r\n data: {},\r\n\r\n pack: GetValue(config, 'pack', false),\r\n\r\n // Cameras\r\n\r\n cameras: GetValue(config, 'cameras', null),\r\n\r\n // Scene Property Injection Map\r\n\r\n map: GetValue(config, 'map', Merge(InjectionMap, GetValue(config, 'mapAdd', {}))),\r\n\r\n // Physics\r\n\r\n physics: GetValue(config, 'physics', {}),\r\n\r\n // Loader\r\n\r\n loader: GetValue(config, 'loader', {}),\r\n\r\n // Plugins\r\n\r\n plugins: GetValue(config, 'plugins', false),\r\n\r\n // Input\r\n\r\n input: GetValue(config, 'input', {})\r\n\r\n };\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Settings;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/Settings.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/Systems.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/scene/Systems.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/scene/const.js\");\r\nvar DefaultPlugins = __webpack_require__(/*! ../plugins/DefaultPlugins */ \"./node_modules/phaser/src/plugins/DefaultPlugins.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\nvar GetPhysicsPlugins = __webpack_require__(/*! ./GetPhysicsPlugins */ \"./node_modules/phaser/src/scene/GetPhysicsPlugins.js\");\r\nvar GetScenePlugins = __webpack_require__(/*! ./GetScenePlugins */ \"./node_modules/phaser/src/scene/GetScenePlugins.js\");\r\nvar NOOP = __webpack_require__(/*! ../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar Settings = __webpack_require__(/*! ./Settings */ \"./node_modules/phaser/src/scene/Settings.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Scene Systems class.\r\n *\r\n * This class is available from within a Scene under the property `sys`.\r\n * It is responsible for managing all of the plugins a Scene has running, including the display list, and\r\n * handling the update step and renderer. It also contains references to global systems belonging to Game.\r\n *\r\n * @class Systems\r\n * @memberof Phaser.Scenes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene that owns this Systems instance.\r\n * @param {(string|Phaser.Types.Scenes.SettingsConfig)} config - Scene specific configuration settings.\r\n */\r\nvar Systems = new Class({\r\n\r\n initialize:\r\n\r\n function Systems (scene, config)\r\n {\r\n /**\r\n * A reference to the Scene that these Systems belong to.\r\n *\r\n * @name Phaser.Scenes.Systems#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A reference to the Phaser Game instance.\r\n *\r\n * @name Phaser.Scenes.Systems#game\r\n * @type {Phaser.Game}\r\n * @since 3.0.0\r\n */\r\n this.game;\r\n\r\n /**\r\n * A reference to either the Canvas or WebGL Renderer that this Game is using.\r\n *\r\n * @name Phaser.Scenes.Systems#renderer\r\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\r\n * @since 3.17.0\r\n */\r\n this.renderer;\r\n\r\n if (typeof PLUGIN_FBINSTANT)\r\n {\r\n /**\r\n * The Facebook Instant Games Plugin.\r\n *\r\n * @name Phaser.Scenes.Systems#facebook\r\n * @type {Phaser.FacebookInstantGamesPlugin}\r\n * @since 3.12.0\r\n */\r\n this.facebook;\r\n }\r\n\r\n /**\r\n * The Scene Configuration object, as passed in when creating the Scene.\r\n *\r\n * @name Phaser.Scenes.Systems#config\r\n * @type {(string|Phaser.Types.Scenes.SettingsConfig)}\r\n * @since 3.0.0\r\n */\r\n this.config = config;\r\n\r\n /**\r\n * The Scene Settings. This is the parsed output based on the Scene configuration.\r\n *\r\n * @name Phaser.Scenes.Systems#settings\r\n * @type {Phaser.Types.Scenes.SettingsObject}\r\n * @since 3.0.0\r\n */\r\n this.settings = Settings.create(config);\r\n\r\n /**\r\n * A handy reference to the Scene canvas / context.\r\n *\r\n * @name Phaser.Scenes.Systems#canvas\r\n * @type {HTMLCanvasElement}\r\n * @since 3.0.0\r\n */\r\n this.canvas;\r\n\r\n /**\r\n * A reference to the Canvas Rendering Context being used by the renderer.\r\n *\r\n * @name Phaser.Scenes.Systems#context\r\n * @type {CanvasRenderingContext2D}\r\n * @since 3.0.0\r\n */\r\n this.context;\r\n\r\n // Global Systems - these are single-instance global managers that belong to Game\r\n\r\n /**\r\n * A reference to the global Animations Manager.\r\n * \r\n * In the default set-up you can access this from within a Scene via the `this.anims` property.\r\n *\r\n * @name Phaser.Scenes.Systems#anims\r\n * @type {Phaser.Animations.AnimationManager}\r\n * @since 3.0.0\r\n */\r\n this.anims;\r\n\r\n /**\r\n * A reference to the global Cache. The Cache stores all files bought in to Phaser via\r\n * the Loader, with the exception of images. Images are stored in the Texture Manager.\r\n * \r\n * In the default set-up you can access this from within a Scene via the `this.cache` property.\r\n *\r\n * @name Phaser.Scenes.Systems#cache\r\n * @type {Phaser.Cache.CacheManager}\r\n * @since 3.0.0\r\n */\r\n this.cache;\r\n\r\n /**\r\n * A reference to the global Plugins Manager.\r\n * \r\n * In the default set-up you can access this from within a Scene via the `this.plugins` property.\r\n *\r\n * @name Phaser.Scenes.Systems#plugins\r\n * @type {Phaser.Plugins.PluginManager}\r\n * @since 3.0.0\r\n */\r\n this.plugins;\r\n\r\n /**\r\n * A reference to the global registry. This is a game-wide instance of the Data Manager, allowing\r\n * you to exchange data between Scenes via a universal and shared point.\r\n * \r\n * In the default set-up you can access this from within a Scene via the `this.registry` property.\r\n *\r\n * @name Phaser.Scenes.Systems#registry\r\n * @type {Phaser.Data.DataManager}\r\n * @since 3.0.0\r\n */\r\n this.registry;\r\n\r\n /**\r\n * A reference to the global Scale Manager.\r\n * \r\n * In the default set-up you can access this from within a Scene via the `this.scale` property.\r\n *\r\n * @name Phaser.Scenes.Systems#scale\r\n * @type {Phaser.Scale.ScaleManager}\r\n * @since 3.15.0\r\n */\r\n this.scale;\r\n\r\n /**\r\n * A reference to the global Sound Manager.\r\n * \r\n * In the default set-up you can access this from within a Scene via the `this.sound` property.\r\n *\r\n * @name Phaser.Scenes.Systems#sound\r\n * @type {(Phaser.Sound.NoAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager|Phaser.Sound.WebAudioSoundManager)}\r\n * @since 3.0.0\r\n */\r\n this.sound;\r\n\r\n /**\r\n * A reference to the global Texture Manager.\r\n * \r\n * In the default set-up you can access this from within a Scene via the `this.textures` property.\r\n *\r\n * @name Phaser.Scenes.Systems#textures\r\n * @type {Phaser.Textures.TextureManager}\r\n * @since 3.0.0\r\n */\r\n this.textures;\r\n\r\n // Core Plugins - these are non-optional Scene plugins, needed by lots of the other systems\r\n\r\n /**\r\n * A reference to the Scene's Game Object Factory.\r\n * \r\n * Use this to quickly and easily create new Game Object's.\r\n * \r\n * In the default set-up you can access this from within a Scene via the `this.add` property.\r\n *\r\n * @name Phaser.Scenes.Systems#add\r\n * @type {Phaser.GameObjects.GameObjectFactory}\r\n * @since 3.0.0\r\n */\r\n this.add;\r\n\r\n /**\r\n * A reference to the Scene's Camera Manager.\r\n * \r\n * Use this to manipulate and create Cameras for this specific Scene.\r\n * \r\n * In the default set-up you can access this from within a Scene via the `this.cameras` property.\r\n *\r\n * @name Phaser.Scenes.Systems#cameras\r\n * @type {Phaser.Cameras.Scene2D.CameraManager}\r\n * @since 3.0.0\r\n */\r\n this.cameras;\r\n\r\n /**\r\n * A reference to the Scene's Display List.\r\n * \r\n * Use this to organize the children contained in the display list.\r\n * \r\n * In the default set-up you can access this from within a Scene via the `this.children` property.\r\n *\r\n * @name Phaser.Scenes.Systems#displayList\r\n * @type {Phaser.GameObjects.DisplayList}\r\n * @since 3.0.0\r\n */\r\n this.displayList;\r\n\r\n /**\r\n * A reference to the Scene's Event Manager.\r\n * \r\n * Use this to listen for Scene specific events, such as `pause` and `shutdown`.\r\n * \r\n * In the default set-up you can access this from within a Scene via the `this.events` property.\r\n *\r\n * @name Phaser.Scenes.Systems#events\r\n * @type {Phaser.Events.EventEmitter}\r\n * @since 3.0.0\r\n */\r\n this.events;\r\n\r\n /**\r\n * A reference to the Scene's Game Object Creator.\r\n * \r\n * Use this to quickly and easily create new Game Object's. The difference between this and the\r\n * Game Object Factory, is that the Creator just creates and returns Game Object instances, it\r\n * doesn't then add them to the Display List or Update List.\r\n * \r\n * In the default set-up you can access this from within a Scene via the `this.make` property.\r\n *\r\n * @name Phaser.Scenes.Systems#make\r\n * @type {Phaser.GameObjects.GameObjectCreator}\r\n * @since 3.0.0\r\n */\r\n this.make;\r\n\r\n /**\r\n * A reference to the Scene Manager Plugin.\r\n * \r\n * Use this to manipulate both this and other Scene's in your game, for example to launch a parallel Scene,\r\n * or pause or resume a Scene, or switch from this Scene to another.\r\n * \r\n * In the default set-up you can access this from within a Scene via the `this.scene` property.\r\n *\r\n * @name Phaser.Scenes.Systems#scenePlugin\r\n * @type {Phaser.Scenes.ScenePlugin}\r\n * @since 3.0.0\r\n */\r\n this.scenePlugin;\r\n\r\n /**\r\n * A reference to the Scene's Update List.\r\n * \r\n * Use this to organize the children contained in the update list.\r\n * \r\n * The Update List is responsible for managing children that need their `preUpdate` methods called,\r\n * in order to process so internal components, such as Sprites with Animations.\r\n * \r\n * In the default set-up there is no reference to this from within the Scene itself.\r\n *\r\n * @name Phaser.Scenes.Systems#updateList\r\n * @type {Phaser.GameObjects.UpdateList}\r\n * @since 3.0.0\r\n */\r\n this.updateList;\r\n\r\n /**\r\n * The Scene Update function.\r\n *\r\n * This starts out as NOOP during init, preload and create, and at the end of create\r\n * it swaps to be whatever the Scene.update function is.\r\n *\r\n * @name Phaser.Scenes.Systems#sceneUpdate\r\n * @type {function}\r\n * @private\r\n * @since 3.10.0\r\n */\r\n this.sceneUpdate = NOOP;\r\n },\r\n\r\n /**\r\n * This method is called only once by the Scene Manager when the Scene is instantiated.\r\n * It is responsible for setting up all of the Scene plugins and references.\r\n * It should never be called directly.\r\n *\r\n * @method Phaser.Scenes.Systems#init\r\n * @protected\r\n * @fires Phaser.Scenes.Events#BOOT\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - A reference to the Phaser Game instance.\r\n */\r\n init: function (game)\r\n {\r\n this.settings.status = CONST.INIT;\r\n\r\n // This will get replaced by the SceneManager with the actual update function, if it exists, once create is over.\r\n this.sceneUpdate = NOOP;\r\n\r\n this.game = game;\r\n this.renderer = game.renderer;\r\n\r\n this.canvas = game.canvas;\r\n this.context = game.context;\r\n\r\n var pluginManager = game.plugins;\r\n\r\n this.plugins = pluginManager;\r\n\r\n pluginManager.addToScene(this, DefaultPlugins.Global, [ DefaultPlugins.CoreScene, GetScenePlugins(this), GetPhysicsPlugins(this) ]);\r\n\r\n this.events.emit(Events.BOOT, this);\r\n\r\n this.settings.isBooted = true;\r\n },\r\n\r\n /**\r\n * Called by a plugin, it tells the System to install the plugin locally.\r\n *\r\n * @method Phaser.Scenes.Systems#install\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {array} plugin - An array of plugins to install into this Scene.\r\n */\r\n install: function (plugin)\r\n {\r\n if (!Array.isArray(plugin))\r\n {\r\n plugin = [ plugin ];\r\n }\r\n\r\n this.plugins.installLocal(this, plugin);\r\n },\r\n\r\n /**\r\n * A single game step. Called automatically by the Scene Manager as a result of a Request Animation\r\n * Frame or Set Timeout call to the main Game instance.\r\n *\r\n * @method Phaser.Scenes.Systems#step\r\n * @fires Phaser.Scenes.Events#PRE_UPDATE\r\n * @fires Phaser.Scenes.Events#_UPDATE\r\n * @fires Phaser.Scenes.Events#POST_UPDATE\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - The time value from the most recent Game step. Typically a high-resolution timer value, or Date.now().\r\n * @param {number} delta - The delta value since the last frame. This is smoothed to avoid delta spikes by the TimeStep class.\r\n */\r\n step: function (time, delta)\r\n {\r\n this.events.emit(Events.PRE_UPDATE, time, delta);\r\n\r\n this.events.emit(Events.UPDATE, time, delta);\r\n\r\n this.sceneUpdate.call(this.scene, time, delta);\r\n\r\n this.events.emit(Events.POST_UPDATE, time, delta);\r\n },\r\n\r\n /**\r\n * Called automatically by the Scene Manager.\r\n * Instructs the Scene to render itself via its Camera Manager to the renderer given.\r\n *\r\n * @method Phaser.Scenes.Systems#render\r\n * @fires Phaser.Scenes.Events#RENDER\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that invoked the render call.\r\n */\r\n render: function (renderer)\r\n {\r\n var displayList = this.displayList;\r\n\r\n displayList.depthSort();\r\n\r\n this.cameras.render(renderer, displayList);\r\n\r\n this.events.emit(Events.RENDER, renderer);\r\n },\r\n\r\n /**\r\n * Force a sort of the display list on the next render.\r\n *\r\n * @method Phaser.Scenes.Systems#queueDepthSort\r\n * @since 3.0.0\r\n */\r\n queueDepthSort: function ()\r\n {\r\n this.displayList.queueDepthSort();\r\n },\r\n\r\n /**\r\n * Immediately sorts the display list if the flag is set.\r\n *\r\n * @method Phaser.Scenes.Systems#depthSort\r\n * @since 3.0.0\r\n */\r\n depthSort: function ()\r\n {\r\n this.displayList.depthSort();\r\n },\r\n\r\n /**\r\n * Pause this Scene.\r\n * A paused Scene still renders, it just doesn't run ANY of its update handlers or systems.\r\n *\r\n * @method Phaser.Scenes.Systems#pause\r\n * @fires Phaser.Scenes.Events#PAUSE\r\n * @since 3.0.0\r\n * \r\n * @param {object} [data] - A data object that will be passed in the 'pause' event.\r\n *\r\n * @return {Phaser.Scenes.Systems} This Systems object.\r\n */\r\n pause: function (data)\r\n {\r\n if (this.settings.active)\r\n {\r\n this.settings.status = CONST.PAUSED;\r\n\r\n this.settings.active = false;\r\n\r\n this.events.emit(Events.PAUSE, this, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resume this Scene from a paused state.\r\n *\r\n * @method Phaser.Scenes.Systems#resume\r\n * @fires Phaser.Scenes.Events#RESUME\r\n * @since 3.0.0\r\n *\r\n * @param {object} [data] - A data object that will be passed in the 'resume' event.\r\n *\r\n * @return {Phaser.Scenes.Systems} This Systems object.\r\n */\r\n resume: function (data)\r\n {\r\n if (!this.settings.active)\r\n {\r\n this.settings.status = CONST.RUNNING;\r\n\r\n this.settings.active = true;\r\n\r\n this.events.emit(Events.RESUME, this, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Send this Scene to sleep.\r\n *\r\n * A sleeping Scene doesn't run its update step or render anything, but it also isn't shut down\r\n * or has any of its systems or children removed, meaning it can be re-activated at any point and\r\n * will carry on from where it left off. It also keeps everything in memory and events and callbacks\r\n * from other Scenes may still invoke changes within it, so be careful what is left active.\r\n *\r\n * @method Phaser.Scenes.Systems#sleep\r\n * @fires Phaser.Scenes.Events#SLEEP\r\n * @since 3.0.0\r\n * \r\n * @param {object} [data] - A data object that will be passed in the 'sleep' event.\r\n *\r\n * @return {Phaser.Scenes.Systems} This Systems object.\r\n */\r\n sleep: function (data)\r\n {\r\n this.settings.status = CONST.SLEEPING;\r\n\r\n this.settings.active = false;\r\n this.settings.visible = false;\r\n\r\n this.events.emit(Events.SLEEP, this, data);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Wake-up this Scene if it was previously asleep.\r\n *\r\n * @method Phaser.Scenes.Systems#wake\r\n * @fires Phaser.Scenes.Events#WAKE\r\n * @since 3.0.0\r\n *\r\n * @param {object} [data] - A data object that will be passed in the 'wake' event.\r\n *\r\n * @return {Phaser.Scenes.Systems} This Systems object.\r\n */\r\n wake: function (data)\r\n {\r\n var settings = this.settings;\r\n\r\n settings.status = CONST.RUNNING;\r\n\r\n settings.active = true;\r\n settings.visible = true;\r\n\r\n this.events.emit(Events.WAKE, this, data);\r\n\r\n if (settings.isTransition)\r\n {\r\n this.events.emit(Events.TRANSITION_WAKE, settings.transitionFrom, settings.transitionDuration);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns any data that was sent to this Scene by another Scene.\r\n * \r\n * The data is also passed to `Scene.init` and in various Scene events, but\r\n * you can access it at any point via this method.\r\n *\r\n * @method Phaser.Scenes.Systems#getData\r\n * @since 3.22.0\r\n *\r\n * @return {any} \r\n */\r\n getData: function ()\r\n {\r\n return this.settings.data;\r\n },\r\n\r\n /**\r\n * Is this Scene sleeping?\r\n *\r\n * @method Phaser.Scenes.Systems#isSleeping\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if this Scene is asleep, otherwise `false`.\r\n */\r\n isSleeping: function ()\r\n {\r\n return (this.settings.status === CONST.SLEEPING);\r\n },\r\n\r\n /**\r\n * Is this Scene running?\r\n *\r\n * @method Phaser.Scenes.Systems#isActive\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if this Scene is running, otherwise `false`.\r\n */\r\n isActive: function ()\r\n {\r\n return (this.settings.status === CONST.RUNNING);\r\n },\r\n\r\n /**\r\n * Is this Scene paused?\r\n *\r\n * @method Phaser.Scenes.Systems#isPaused\r\n * @since 3.13.0\r\n *\r\n * @return {boolean} `true` if this Scene is paused, otherwise `false`.\r\n */\r\n isPaused: function ()\r\n {\r\n return (this.settings.status === CONST.PAUSED);\r\n },\r\n\r\n /**\r\n * Is this Scene currently transitioning out to, or in from another Scene?\r\n *\r\n * @method Phaser.Scenes.Systems#isTransitioning\r\n * @since 3.5.0\r\n *\r\n * @return {boolean} `true` if this Scene is currently transitioning, otherwise `false`.\r\n */\r\n isTransitioning: function ()\r\n {\r\n return (this.settings.isTransition || this.scenePlugin._target !== null);\r\n },\r\n\r\n /**\r\n * Is this Scene currently transitioning out from itself to another Scene?\r\n *\r\n * @method Phaser.Scenes.Systems#isTransitionOut\r\n * @since 3.5.0\r\n *\r\n * @return {boolean} `true` if this Scene is in transition to another Scene, otherwise `false`.\r\n */\r\n isTransitionOut: function ()\r\n {\r\n return (this.scenePlugin._target !== null && this.scenePlugin._duration > 0);\r\n },\r\n\r\n /**\r\n * Is this Scene currently transitioning in from another Scene?\r\n *\r\n * @method Phaser.Scenes.Systems#isTransitionIn\r\n * @since 3.5.0\r\n *\r\n * @return {boolean} `true` if this Scene is transitioning in from another Scene, otherwise `false`.\r\n */\r\n isTransitionIn: function ()\r\n {\r\n return (this.settings.isTransition);\r\n },\r\n\r\n /**\r\n * Is this Scene visible and rendering?\r\n *\r\n * @method Phaser.Scenes.Systems#isVisible\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if this Scene is visible, otherwise `false`.\r\n */\r\n isVisible: function ()\r\n {\r\n return this.settings.visible;\r\n },\r\n\r\n /**\r\n * Sets the visible state of this Scene.\r\n * An invisible Scene will not render, but will still process updates.\r\n *\r\n * @method Phaser.Scenes.Systems#setVisible\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - `true` to render this Scene, otherwise `false`.\r\n *\r\n * @return {Phaser.Scenes.Systems} This Systems object.\r\n */\r\n setVisible: function (value)\r\n {\r\n this.settings.visible = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the active state of this Scene.\r\n * \r\n * An active Scene will run its core update loop.\r\n *\r\n * @method Phaser.Scenes.Systems#setActive\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - If `true` the Scene will be resumed, if previously paused. If `false` it will be paused.\r\n * @param {object} [data] - A data object that will be passed in the 'resume' or 'pause' events.\r\n *\r\n * @return {Phaser.Scenes.Systems} This Systems object.\r\n */\r\n setActive: function (value, data)\r\n {\r\n if (value)\r\n {\r\n return this.resume(data);\r\n }\r\n else\r\n {\r\n return this.pause(data);\r\n }\r\n },\r\n\r\n /**\r\n * Start this Scene running and rendering.\r\n * Called automatically by the SceneManager.\r\n *\r\n * @method Phaser.Scenes.Systems#start\r\n * @fires Phaser.Scenes.Events#START\r\n * @fires Phaser.Scenes.Events#READY\r\n * @since 3.0.0\r\n *\r\n * @param {object} data - Optional data object that may have been passed to this Scene from another.\r\n */\r\n start: function (data)\r\n {\r\n if (data)\r\n {\r\n this.settings.data = data;\r\n }\r\n\r\n this.settings.status = CONST.START;\r\n\r\n this.settings.active = true;\r\n this.settings.visible = true;\r\n\r\n // For plugins to listen out for\r\n this.events.emit(Events.START, this);\r\n\r\n // For user-land code to listen out for\r\n this.events.emit(Events.READY, this, data);\r\n },\r\n\r\n /**\r\n * Shutdown this Scene and send a shutdown event to all of its systems.\r\n * A Scene that has been shutdown will not run its update loop or render, but it does\r\n * not destroy any of its plugins or references. It is put into hibernation for later use.\r\n * If you don't ever plan to use this Scene again, then it should be destroyed instead\r\n * to free-up resources.\r\n *\r\n * @method Phaser.Scenes.Systems#shutdown\r\n * @fires Phaser.Scenes.Events#SHUTDOWN\r\n * @since 3.0.0\r\n * \r\n * @param {object} [data] - A data object that will be passed in the 'shutdown' event.\r\n */\r\n shutdown: function (data)\r\n {\r\n this.events.off(Events.TRANSITION_INIT);\r\n this.events.off(Events.TRANSITION_START);\r\n this.events.off(Events.TRANSITION_COMPLETE);\r\n this.events.off(Events.TRANSITION_OUT);\r\n\r\n this.settings.status = CONST.SHUTDOWN;\r\n\r\n this.settings.active = false;\r\n this.settings.visible = false;\r\n\r\n this.events.emit(Events.SHUTDOWN, this, data);\r\n },\r\n\r\n /**\r\n * Destroy this Scene and send a destroy event all of its systems.\r\n * A destroyed Scene cannot be restarted.\r\n * You should not call this directly, instead use `SceneManager.remove`.\r\n *\r\n * @method Phaser.Scenes.Systems#destroy\r\n * @private\r\n * @fires Phaser.Scenes.Events#DESTROY\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.settings.status = CONST.DESTROYED;\r\n\r\n this.settings.active = false;\r\n this.settings.visible = false;\r\n\r\n this.events.emit(Events.DESTROY, this);\r\n\r\n this.events.removeAllListeners();\r\n\r\n var props = [ 'scene', 'game', 'anims', 'cache', 'plugins', 'registry', 'sound', 'textures', 'add', 'camera', 'displayList', 'events', 'make', 'scenePlugin', 'updateList' ];\r\n\r\n for (var i = 0; i < props.length; i++)\r\n {\r\n this[props[i]] = null;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Systems;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/Systems.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/const.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/scene/const.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Scene consts.\r\n * \r\n * @ignore\r\n */\r\n\r\nvar CONST = {\r\n\r\n /**\r\n * Scene state.\r\n * \r\n * @name Phaser.Scenes.PENDING\r\n * @readonly\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PENDING: 0,\r\n\r\n /**\r\n * Scene state.\r\n * \r\n * @name Phaser.Scenes.INIT\r\n * @readonly\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n INIT: 1,\r\n\r\n /**\r\n * Scene state.\r\n * \r\n * @name Phaser.Scenes.START\r\n * @readonly\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n START: 2,\r\n\r\n /**\r\n * Scene state.\r\n * \r\n * @name Phaser.Scenes.LOADING\r\n * @readonly\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADING: 3,\r\n\r\n /**\r\n * Scene state.\r\n * \r\n * @name Phaser.Scenes.CREATING\r\n * @readonly\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n CREATING: 4,\r\n\r\n /**\r\n * Scene state.\r\n * \r\n * @name Phaser.Scenes.RUNNING\r\n * @readonly\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n RUNNING: 5,\r\n\r\n /**\r\n * Scene state.\r\n * \r\n * @name Phaser.Scenes.PAUSED\r\n * @readonly\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PAUSED: 6,\r\n\r\n /**\r\n * Scene state.\r\n * \r\n * @name Phaser.Scenes.SLEEPING\r\n * @readonly\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n SLEEPING: 7,\r\n\r\n /**\r\n * Scene state.\r\n * \r\n * @name Phaser.Scenes.SHUTDOWN\r\n * @readonly\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n SHUTDOWN: 8,\r\n\r\n /**\r\n * Scene state.\r\n * \r\n * @name Phaser.Scenes.DESTROYED\r\n * @readonly\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n DESTROYED: 9\r\n\r\n};\r\n\r\nmodule.exports = CONST;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/const.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/BOOT_EVENT.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/BOOT_EVENT.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Boot Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('boot', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#BOOT\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'boot';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/BOOT_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/CREATE_EVENT.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/CREATE_EVENT.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Create Event.\r\n * \r\n * This event is dispatched by a Scene after it has been created by the Scene Manager.\r\n * \r\n * If a Scene has a `create` method then this event is emitted _after_ that has run.\r\n * \r\n * If there is a transition, this event will be fired after the `TRANSITION_START` event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('create', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#CREATE\r\n * @since 3.17.0\r\n * \r\n * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event.\r\n */\r\nmodule.exports = 'create';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/CREATE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/DESTROY_EVENT.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/DESTROY_EVENT.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Destroy Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems destroy process.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('destroy', listener)`.\r\n * \r\n * You should destroy any resources that may be in use by your Scene in this event handler.\r\n * \r\n * @event Phaser.Scenes.Events#DESTROY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'destroy';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/DESTROY_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/PAUSE_EVENT.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/PAUSE_EVENT.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Pause Event.\r\n * \r\n * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an\r\n * action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('pause', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#PAUSE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was paused.\r\n */\r\nmodule.exports = 'pause';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/PAUSE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/POST_UPDATE_EVENT.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/POST_UPDATE_EVENT.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Post Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('postupdate', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#POST_UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'postupdate';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/POST_UPDATE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/PRE_UPDATE_EVENT.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/PRE_UPDATE_EVENT.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Pre Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('preupdate', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#PRE_UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'preupdate';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/PRE_UPDATE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/READY_EVENT.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/READY_EVENT.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Ready Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems start process.\r\n * By this point in the process the Scene is now fully active and rendering.\r\n * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('ready', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#READY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was started.\r\n */\r\nmodule.exports = 'ready';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/READY_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/RENDER_EVENT.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/RENDER_EVENT.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Render Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('render', listener)`.\r\n * \r\n * A Scene will only render if it is visible and active.\r\n * By the time this event is dispatched, the Scene will have already been rendered.\r\n * \r\n * @event Phaser.Scenes.Events#RENDER\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene.\r\n */\r\nmodule.exports = 'render';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/RENDER_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/RESUME_EVENT.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/RESUME_EVENT.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Resume Event.\r\n * \r\n * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('resume', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#RESUME\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was resumed.\r\n */\r\nmodule.exports = 'resume';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/RESUME_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/SHUTDOWN_EVENT.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/SHUTDOWN_EVENT.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Shutdown Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems shutdown process.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('shutdown', listener)`.\r\n * \r\n * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding\r\n * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not\r\n * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources.\r\n * \r\n * @event Phaser.Scenes.Events#SHUTDOWN\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was shutdown.\r\n */\r\nmodule.exports = 'shutdown';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/SHUTDOWN_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/SLEEP_EVENT.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/SLEEP_EVENT.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Sleep Event.\r\n * \r\n * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('sleep', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#SLEEP\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was sent to sleep.\r\n */\r\nmodule.exports = 'sleep';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/SLEEP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/START_EVENT.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/START_EVENT.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Start Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('start', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'start';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Complete Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition.\r\n * \r\n * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration\r\n * of the transition.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitioncomplete', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_COMPLETE\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} scene -The Scene on which the transitioned completed.\r\n */\r\nmodule.exports = 'transitioncomplete';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/TRANSITION_INIT_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/TRANSITION_INIT_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Init Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition.\r\n * \r\n * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method,\r\n * this event is not dispatched.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitioninit', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_INIT\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitioninit';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/TRANSITION_INIT_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/TRANSITION_OUT_EVENT.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/TRANSITION_OUT_EVENT.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Out Event.\r\n * \r\n * This event is dispatched by a Scene when it initiates a transition to another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionout', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_OUT\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} target - A reference to the Scene that is being transitioned to.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionout';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/TRANSITION_OUT_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/TRANSITION_START_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/TRANSITION_START_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Start Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep.\r\n * \r\n * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method,\r\n * this event is dispatched anyway.\r\n * \r\n * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is\r\n * dispatched instead of this event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionstart', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_START\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionstart';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/TRANSITION_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Wake Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before\r\n * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionwake', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_WAKE\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionwake';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/UPDATE_EVENT.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/UPDATE_EVENT.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('update', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'update';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/UPDATE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/WAKE_EVENT.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/scene/events/WAKE_EVENT.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Wake Event.\r\n * \r\n * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('wake', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#WAKE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was woken up.\r\n */\r\nmodule.exports = 'wake';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/WAKE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/events/index.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/scene/events/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Scenes.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BOOT: __webpack_require__(/*! ./BOOT_EVENT */ \"./node_modules/phaser/src/scene/events/BOOT_EVENT.js\"),\r\n CREATE: __webpack_require__(/*! ./CREATE_EVENT */ \"./node_modules/phaser/src/scene/events/CREATE_EVENT.js\"),\r\n DESTROY: __webpack_require__(/*! ./DESTROY_EVENT */ \"./node_modules/phaser/src/scene/events/DESTROY_EVENT.js\"),\r\n PAUSE: __webpack_require__(/*! ./PAUSE_EVENT */ \"./node_modules/phaser/src/scene/events/PAUSE_EVENT.js\"),\r\n POST_UPDATE: __webpack_require__(/*! ./POST_UPDATE_EVENT */ \"./node_modules/phaser/src/scene/events/POST_UPDATE_EVENT.js\"),\r\n PRE_UPDATE: __webpack_require__(/*! ./PRE_UPDATE_EVENT */ \"./node_modules/phaser/src/scene/events/PRE_UPDATE_EVENT.js\"),\r\n READY: __webpack_require__(/*! ./READY_EVENT */ \"./node_modules/phaser/src/scene/events/READY_EVENT.js\"),\r\n RENDER: __webpack_require__(/*! ./RENDER_EVENT */ \"./node_modules/phaser/src/scene/events/RENDER_EVENT.js\"),\r\n RESUME: __webpack_require__(/*! ./RESUME_EVENT */ \"./node_modules/phaser/src/scene/events/RESUME_EVENT.js\"),\r\n SHUTDOWN: __webpack_require__(/*! ./SHUTDOWN_EVENT */ \"./node_modules/phaser/src/scene/events/SHUTDOWN_EVENT.js\"),\r\n SLEEP: __webpack_require__(/*! ./SLEEP_EVENT */ \"./node_modules/phaser/src/scene/events/SLEEP_EVENT.js\"),\r\n START: __webpack_require__(/*! ./START_EVENT */ \"./node_modules/phaser/src/scene/events/START_EVENT.js\"),\r\n TRANSITION_COMPLETE: __webpack_require__(/*! ./TRANSITION_COMPLETE_EVENT */ \"./node_modules/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js\"),\r\n TRANSITION_INIT: __webpack_require__(/*! ./TRANSITION_INIT_EVENT */ \"./node_modules/phaser/src/scene/events/TRANSITION_INIT_EVENT.js\"),\r\n TRANSITION_OUT: __webpack_require__(/*! ./TRANSITION_OUT_EVENT */ \"./node_modules/phaser/src/scene/events/TRANSITION_OUT_EVENT.js\"),\r\n TRANSITION_START: __webpack_require__(/*! ./TRANSITION_START_EVENT */ \"./node_modules/phaser/src/scene/events/TRANSITION_START_EVENT.js\"),\r\n TRANSITION_WAKE: __webpack_require__(/*! ./TRANSITION_WAKE_EVENT */ \"./node_modules/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js\"),\r\n UPDATE: __webpack_require__(/*! ./UPDATE_EVENT */ \"./node_modules/phaser/src/scene/events/UPDATE_EVENT.js\"),\r\n WAKE: __webpack_require__(/*! ./WAKE_EVENT */ \"./node_modules/phaser/src/scene/events/WAKE_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/scene/index.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/scene/index.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/scene/const.js\");\r\nvar Extend = __webpack_require__(/*! ../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\n\r\n/**\r\n * @namespace Phaser.Scenes\r\n */\r\n\r\nvar Scene = {\r\n\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/scene/events/index.js\"),\r\n SceneManager: __webpack_require__(/*! ./SceneManager */ \"./node_modules/phaser/src/scene/SceneManager.js\"),\r\n ScenePlugin: __webpack_require__(/*! ./ScenePlugin */ \"./node_modules/phaser/src/scene/ScenePlugin.js\"),\r\n Settings: __webpack_require__(/*! ./Settings */ \"./node_modules/phaser/src/scene/Settings.js\"),\r\n Systems: __webpack_require__(/*! ./Systems */ \"./node_modules/phaser/src/scene/Systems.js\")\r\n\r\n};\r\n\r\n// Merge in the consts\r\nScene = Extend(false, Scene, CONST);\r\n\r\nmodule.exports = Scene;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/scene/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/BaseSound.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/sound/BaseSound.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Pavle Goloskokovic (http://prunegames.com)\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/sound/events/index.js\");\r\nvar Extend = __webpack_require__(/*! ../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\nvar NOOP = __webpack_require__(/*! ../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\n/**\r\n * @classdesc\r\n * Class containing all the shared state and behavior of a sound object, independent of the implementation.\r\n *\r\n * @class BaseSound\r\n * @extends Phaser.Events.EventEmitter\r\n * @memberof Phaser.Sound\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Sound.BaseSoundManager} manager - Reference to the current sound manager instance.\r\n * @param {string} key - Asset key for the sound.\r\n * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings.\r\n */\r\nvar BaseSound = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function BaseSound (manager, key, config)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * Local reference to the sound manager.\r\n *\r\n * @name Phaser.Sound.BaseSound#manager\r\n * @type {Phaser.Sound.BaseSoundManager}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.manager = manager;\r\n\r\n /**\r\n * Asset key for the sound.\r\n *\r\n * @name Phaser.Sound.BaseSound#key\r\n * @type {string}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.key = key;\r\n\r\n /**\r\n * Flag indicating if sound is currently playing.\r\n *\r\n * @name Phaser.Sound.BaseSound#isPlaying\r\n * @type {boolean}\r\n * @default false\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.isPlaying = false;\r\n\r\n /**\r\n * Flag indicating if sound is currently paused.\r\n *\r\n * @name Phaser.Sound.BaseSound#isPaused\r\n * @type {boolean}\r\n * @default false\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.isPaused = false;\r\n\r\n /**\r\n * A property that holds the value of sound's actual playback rate,\r\n * after its rate and detune values has been combined with global\r\n * rate and detune values.\r\n *\r\n * @name Phaser.Sound.BaseSound#totalRate\r\n * @type {number}\r\n * @default 1\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.totalRate = 1;\r\n\r\n /**\r\n * A value representing the duration, in seconds.\r\n * It could be total sound duration or a marker duration.\r\n *\r\n * @name Phaser.Sound.BaseSound#duration\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.duration = this.duration || 0;\r\n\r\n /**\r\n * The total duration of the sound in seconds.\r\n *\r\n * @name Phaser.Sound.BaseSound#totalDuration\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.totalDuration = this.totalDuration || 0;\r\n\r\n /**\r\n * A config object used to store default sound settings' values.\r\n * Default values will be set by properties' setters.\r\n *\r\n * @name Phaser.Sound.BaseSound#config\r\n * @type {Phaser.Types.Sound.SoundConfig}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.config = {\r\n\r\n mute: false,\r\n volume: 1,\r\n rate: 1,\r\n detune: 0,\r\n seek: 0,\r\n loop: false,\r\n delay: 0\r\n\r\n };\r\n\r\n /**\r\n * Reference to the currently used config.\r\n * It could be default config or marker config.\r\n *\r\n * @name Phaser.Sound.BaseSound#currentConfig\r\n * @type {Phaser.Types.Sound.SoundConfig}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.currentConfig = this.config;\r\n\r\n this.config = Extend(this.config, config);\r\n\r\n /**\r\n * Object containing markers definitions.\r\n *\r\n * @name Phaser.Sound.BaseSound#markers\r\n * @type {Object.}\r\n * @default {}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.markers = {};\r\n\r\n /**\r\n * Currently playing marker.\r\n * 'null' if whole sound is playing.\r\n *\r\n * @name Phaser.Sound.BaseSound#currentMarker\r\n * @type {Phaser.Types.Sound.SoundMarker}\r\n * @default null\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.currentMarker = null;\r\n\r\n /**\r\n * Flag indicating if destroy method was called on this sound.\r\n *\r\n * @name Phaser.Sound.BaseSound#pendingRemove\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.pendingRemove = false;\r\n },\r\n\r\n /**\r\n * Adds a marker into the current sound. A marker is represented by name, start time, duration, and optionally config object.\r\n * This allows you to bundle multiple sounds together into a single audio file and use markers to jump between them for playback.\r\n *\r\n * @method Phaser.Sound.BaseSound#addMarker\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Sound.SoundMarker} marker - Marker object.\r\n *\r\n * @return {boolean} Whether the marker was added successfully.\r\n */\r\n addMarker: function (marker)\r\n {\r\n if (!marker || !marker.name || typeof marker.name !== 'string')\r\n {\r\n return false;\r\n }\r\n\r\n if (this.markers[marker.name])\r\n {\r\n // eslint-disable-next-line no-console\r\n console.error('addMarker ' + marker.name + ' already exists in Sound');\r\n\r\n return false;\r\n }\r\n\r\n marker = Extend(true, {\r\n name: '',\r\n start: 0,\r\n duration: this.totalDuration - (marker.start || 0),\r\n config: {\r\n mute: false,\r\n volume: 1,\r\n rate: 1,\r\n detune: 0,\r\n seek: 0,\r\n loop: false,\r\n delay: 0\r\n }\r\n }, marker);\r\n\r\n this.markers[marker.name] = marker;\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Updates previously added marker.\r\n *\r\n * @method Phaser.Sound.BaseSound#updateMarker\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Sound.SoundMarker} marker - Marker object with updated values.\r\n *\r\n * @return {boolean} Whether the marker was updated successfully.\r\n */\r\n updateMarker: function (marker)\r\n {\r\n if (!marker || !marker.name || typeof marker.name !== 'string')\r\n {\r\n return false;\r\n }\r\n\r\n if (!this.markers[marker.name])\r\n {\r\n // eslint-disable-next-line no-console\r\n console.warn('Audio Marker: ' + marker.name + ' missing in Sound: ' + this.key);\r\n\r\n return false;\r\n }\r\n\r\n this.markers[marker.name] = Extend(true, this.markers[marker.name], marker);\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Removes a marker from the sound.\r\n *\r\n * @method Phaser.Sound.BaseSound#removeMarker\r\n * @since 3.0.0\r\n *\r\n * @param {string} markerName - The name of the marker to remove.\r\n *\r\n * @return {?Phaser.Types.Sound.SoundMarker} Removed marker object or 'null' if there was no marker with provided name.\r\n */\r\n removeMarker: function (markerName)\r\n {\r\n var marker = this.markers[markerName];\r\n\r\n if (!marker)\r\n {\r\n return null;\r\n }\r\n\r\n this.markers[markerName] = null;\r\n\r\n return marker;\r\n },\r\n\r\n /**\r\n * Play this sound, or a marked section of it.\r\n * It always plays the sound from the start. If you want to start playback from a specific time\r\n * you can set 'seek' setting of the config object, provided to this call, to that value.\r\n *\r\n * @method Phaser.Sound.BaseSound#play\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Sound.SoundConfig)} [markerName=''] - If you want to play a marker then provide the marker name here. Alternatively, this parameter can be a SoundConfig object.\r\n * @param {Phaser.Types.Sound.SoundConfig} [config] - Optional sound config object to be applied to this marker or entire sound if no marker name is provided. It gets memorized for future plays of current section of the sound.\r\n *\r\n * @return {boolean} Whether the sound started playing successfully.\r\n */\r\n play: function (markerName, config)\r\n {\r\n if (markerName === undefined) { markerName = ''; }\r\n\r\n if (typeof markerName === 'object')\r\n {\r\n config = markerName;\r\n markerName = '';\r\n }\r\n\r\n if (typeof markerName !== 'string')\r\n {\r\n return false;\r\n }\r\n\r\n if (!markerName)\r\n {\r\n this.currentMarker = null;\r\n this.currentConfig = this.config;\r\n this.duration = this.totalDuration;\r\n }\r\n else\r\n {\r\n if (!this.markers[markerName])\r\n {\r\n // eslint-disable-next-line no-console\r\n console.warn('Marker: ' + markerName + ' missing in Sound: ' + this.key);\r\n\r\n return false;\r\n }\r\n\r\n this.currentMarker = this.markers[markerName];\r\n this.currentConfig = this.currentMarker.config;\r\n this.duration = this.currentMarker.duration;\r\n }\r\n\r\n this.resetConfig();\r\n\r\n this.currentConfig = Extend(this.currentConfig, config);\r\n\r\n this.isPlaying = true;\r\n this.isPaused = false;\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Pauses the sound.\r\n *\r\n * @method Phaser.Sound.BaseSound#pause\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} Whether the sound was paused successfully.\r\n */\r\n pause: function ()\r\n {\r\n if (this.isPaused || !this.isPlaying)\r\n {\r\n return false;\r\n }\r\n\r\n this.isPlaying = false;\r\n this.isPaused = true;\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Resumes the sound.\r\n *\r\n * @method Phaser.Sound.BaseSound#resume\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} Whether the sound was resumed successfully.\r\n */\r\n resume: function ()\r\n {\r\n if (!this.isPaused || this.isPlaying)\r\n {\r\n return false;\r\n }\r\n\r\n this.isPlaying = true;\r\n this.isPaused = false;\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Stop playing this sound.\r\n *\r\n * @method Phaser.Sound.BaseSound#stop\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} Whether the sound was stopped successfully.\r\n */\r\n stop: function ()\r\n {\r\n if (!this.isPaused && !this.isPlaying)\r\n {\r\n return false;\r\n }\r\n\r\n this.isPlaying = false;\r\n this.isPaused = false;\r\n\r\n this.resetConfig();\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Method used internally for applying config values to some of the sound properties.\r\n *\r\n * @method Phaser.Sound.BaseSound#applyConfig\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n applyConfig: function ()\r\n {\r\n this.mute = this.currentConfig.mute;\r\n this.volume = this.currentConfig.volume;\r\n this.rate = this.currentConfig.rate;\r\n this.detune = this.currentConfig.detune;\r\n this.loop = this.currentConfig.loop;\r\n },\r\n\r\n /**\r\n * Method used internally for resetting values of some of the config properties.\r\n *\r\n * @method Phaser.Sound.BaseSound#resetConfig\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n resetConfig: function ()\r\n {\r\n this.currentConfig.seek = 0;\r\n this.currentConfig.delay = 0;\r\n },\r\n\r\n /**\r\n * Update method called automatically by sound manager on every game step.\r\n *\r\n * @method Phaser.Sound.BaseSound#update\r\n * @override\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time elapsed since the last frame.\r\n */\r\n update: NOOP,\r\n\r\n /**\r\n * Method used internally to calculate total playback rate of the sound.\r\n *\r\n * @method Phaser.Sound.BaseSound#calculateRate\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n calculateRate: function ()\r\n {\r\n var cent = 1.0005777895065548; // Math.pow(2, 1/1200);\r\n var totalDetune = this.currentConfig.detune + this.manager.detune;\r\n var detuneRate = Math.pow(cent, totalDetune);\r\n\r\n this.totalRate = this.currentConfig.rate * this.manager.rate * detuneRate;\r\n },\r\n\r\n /**\r\n * Destroys this sound and all associated events and marks it for removal from the sound manager.\r\n *\r\n * @method Phaser.Sound.BaseSound#destroy\r\n * @fires Phaser.Sound.Events#DESTROY\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n if (this.pendingRemove)\r\n {\r\n return;\r\n }\r\n\r\n this.emit(Events.DESTROY, this);\r\n this.pendingRemove = true;\r\n this.manager = null;\r\n this.key = '';\r\n this.removeAllListeners();\r\n this.isPlaying = false;\r\n this.isPaused = false;\r\n this.config = null;\r\n this.currentConfig = null;\r\n this.markers = null;\r\n this.currentMarker = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = BaseSound;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/BaseSound.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/BaseSoundManager.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/sound/BaseSoundManager.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Pavle Goloskokovic (http://prunegames.com)\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Clone = __webpack_require__(/*! ../utils/object/Clone */ \"./node_modules/phaser/src/utils/object/Clone.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/sound/events/index.js\");\r\nvar GameEvents = __webpack_require__(/*! ../core/events */ \"./node_modules/phaser/src/core/events/index.js\");\r\nvar NOOP = __webpack_require__(/*! ../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The sound manager is responsible for playing back audio via Web Audio API or HTML Audio tag as fallback.\r\n * The audio file type and the encoding of those files are extremely important.\r\n *\r\n * Not all browsers can play all audio formats.\r\n *\r\n * There is a good guide to what's supported [here](https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/Cross-browser_audio_basics#Audio_Codec_Support).\r\n *\r\n * @class BaseSoundManager\r\n * @extends Phaser.Events.EventEmitter\r\n * @memberof Phaser.Sound\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - Reference to the current game instance.\r\n */\r\nvar BaseSoundManager = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function BaseSoundManager (game)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * Local reference to game.\r\n *\r\n * @name Phaser.Sound.BaseSoundManager#game\r\n * @type {Phaser.Game}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.game = game;\r\n\r\n /**\r\n * Local reference to the JSON Cache, as used by Audio Sprites.\r\n *\r\n * @name Phaser.Sound.BaseSoundManager#jsonCache\r\n * @type {Phaser.Cache.BaseCache}\r\n * @readonly\r\n * @since 3.7.0\r\n */\r\n this.jsonCache = game.cache.json;\r\n\r\n /**\r\n * An array containing all added sounds.\r\n *\r\n * @name Phaser.Sound.BaseSoundManager#sounds\r\n * @type {Phaser.Sound.BaseSound[]}\r\n * @default []\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.sounds = [];\r\n\r\n /**\r\n * Global mute setting.\r\n *\r\n * @name Phaser.Sound.BaseSoundManager#mute\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.mute = false;\r\n\r\n /**\r\n * Global volume setting.\r\n *\r\n * @name Phaser.Sound.BaseSoundManager#volume\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.volume = 1;\r\n\r\n /**\r\n * Flag indicating if sounds should be paused when game looses focus,\r\n * for instance when user switches to another tab/program/app.\r\n *\r\n * @name Phaser.Sound.BaseSoundManager#pauseOnBlur\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.pauseOnBlur = true;\r\n\r\n /**\r\n * Property that actually holds the value of global playback rate.\r\n *\r\n * @name Phaser.Sound.BaseSoundManager#_rate\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this._rate = 1;\r\n\r\n /**\r\n * Property that actually holds the value of global detune.\r\n *\r\n * @name Phaser.Sound.BaseSoundManager#_detune\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._detune = 0;\r\n\r\n /**\r\n * Mobile devices require sounds to be triggered from an explicit user action,\r\n * such as a tap, before any sound can be loaded/played on a web page.\r\n * Set to true if the audio system is currently locked awaiting user interaction.\r\n *\r\n * @name Phaser.Sound.BaseSoundManager#locked\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.locked = this.locked || false;\r\n\r\n /**\r\n * Flag used internally for handling when the audio system\r\n * has been unlocked, if there ever was a need for it.\r\n *\r\n * @name Phaser.Sound.BaseSoundManager#unlocked\r\n * @type {boolean}\r\n * @default false\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.unlocked = false;\r\n\r\n game.events.on(GameEvents.BLUR, function ()\r\n {\r\n if (this.pauseOnBlur)\r\n {\r\n this.onBlur();\r\n }\r\n }, this);\r\n\r\n game.events.on(GameEvents.FOCUS, function ()\r\n {\r\n if (this.pauseOnBlur)\r\n {\r\n this.onFocus();\r\n }\r\n }, this);\r\n\r\n game.events.on(GameEvents.PRE_STEP, this.update, this);\r\n game.events.once(GameEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * Adds a new sound into the sound manager.\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#add\r\n * @override\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - Asset key for the sound.\r\n * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings.\r\n *\r\n * @return {Phaser.Sound.BaseSound} The new sound instance.\r\n */\r\n add: NOOP,\r\n\r\n /**\r\n * Adds a new audio sprite sound into the sound manager.\r\n * Audio Sprites are a combination of audio files and a JSON configuration.\r\n * The JSON follows the format of that created by https://github.com/tonistiigi/audiosprite\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#addAudioSprite\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - Asset key for the sound.\r\n * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings.\r\n *\r\n * @return {(Phaser.Sound.HTML5AudioSound|Phaser.Sound.WebAudioSound)} The new audio sprite sound instance.\r\n */\r\n addAudioSprite: function (key, config)\r\n {\r\n if (config === undefined) { config = {}; }\r\n\r\n var sound = this.add(key, config);\r\n\r\n sound.spritemap = this.jsonCache.get(key).spritemap;\r\n\r\n for (var markerName in sound.spritemap)\r\n {\r\n if (!sound.spritemap.hasOwnProperty(markerName))\r\n {\r\n continue;\r\n }\r\n\r\n var markerConfig = Clone(config);\r\n\r\n var marker = sound.spritemap[markerName];\r\n\r\n markerConfig.loop = (marker.hasOwnProperty('loop')) ? marker.loop : false;\r\n\r\n sound.addMarker({\r\n name: markerName,\r\n start: marker.start,\r\n duration: marker.end - marker.start,\r\n config: markerConfig\r\n });\r\n }\r\n\r\n return sound;\r\n },\r\n\r\n /**\r\n * Adds a new sound to the sound manager and plays it.\r\n * The sound will be automatically removed (destroyed) once playback ends.\r\n * This lets you play a new sound on the fly without the need to keep a reference to it.\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#play\r\n * @listens Phaser.Sound.Events#COMPLETE\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - Asset key for the sound.\r\n * @param {(Phaser.Types.Sound.SoundConfig|Phaser.Types.Sound.SoundMarker)} [extra] - An optional additional object containing settings to be applied to the sound. It could be either config or marker object.\r\n *\r\n * @return {boolean} Whether the sound started playing successfully.\r\n */\r\n play: function (key, extra)\r\n {\r\n var sound = this.add(key);\r\n\r\n sound.once(Events.COMPLETE, sound.destroy, sound);\r\n\r\n if (extra)\r\n {\r\n if (extra.name)\r\n {\r\n sound.addMarker(extra);\r\n\r\n return sound.play(extra.name);\r\n }\r\n else\r\n {\r\n return sound.play(extra);\r\n }\r\n }\r\n else\r\n {\r\n return sound.play();\r\n }\r\n },\r\n\r\n /**\r\n * Enables playing audio sprite sound on the fly without the need to keep a reference to it.\r\n * Sound will auto destroy once its playback ends.\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#playAudioSprite\r\n * @listens Phaser.Sound.Events#COMPLETE\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - Asset key for the sound.\r\n * @param {string} spriteName - The name of the sound sprite to play.\r\n * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings.\r\n *\r\n * @return {boolean} Whether the audio sprite sound started playing successfully.\r\n */\r\n playAudioSprite: function (key, spriteName, config)\r\n {\r\n var sound = this.addAudioSprite(key);\r\n\r\n sound.once(Events.COMPLETE, sound.destroy, sound);\r\n\r\n return sound.play(spriteName, config);\r\n },\r\n\r\n /**\r\n * Removes a sound from the sound manager.\r\n * The removed sound is destroyed before removal.\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#remove\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Sound.BaseSound} sound - The sound object to remove.\r\n *\r\n * @return {boolean} True if the sound was removed successfully, otherwise false.\r\n */\r\n remove: function (sound)\r\n {\r\n var index = this.sounds.indexOf(sound);\r\n\r\n if (index !== -1)\r\n {\r\n sound.destroy();\r\n\r\n this.sounds.splice(index, 1);\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Removes all sounds from the sound manager that have an asset key matching the given value.\r\n * The removed sounds are destroyed before removal.\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#removeByKey\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key to match when removing sound objects.\r\n *\r\n * @return {number} The number of matching sound objects that were removed.\r\n */\r\n removeByKey: function (key)\r\n {\r\n var removed = 0;\r\n\r\n for (var i = this.sounds.length - 1; i >= 0; i--)\r\n {\r\n var sound = this.sounds[i];\r\n\r\n if (sound.key === key)\r\n {\r\n sound.destroy();\r\n\r\n this.sounds.splice(i, 1);\r\n\r\n removed++;\r\n }\r\n }\r\n\r\n return removed;\r\n },\r\n\r\n /**\r\n * Pauses all the sounds in the game.\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#pauseAll\r\n * @fires Phaser.Sound.Events#PAUSE_ALL\r\n * @since 3.0.0\r\n */\r\n pauseAll: function ()\r\n {\r\n this.forEachActiveSound(function (sound)\r\n {\r\n sound.pause();\r\n });\r\n\r\n this.emit(Events.PAUSE_ALL, this);\r\n },\r\n\r\n /**\r\n * Resumes all the sounds in the game.\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#resumeAll\r\n * @fires Phaser.Sound.Events#RESUME_ALL\r\n * @since 3.0.0\r\n */\r\n resumeAll: function ()\r\n {\r\n this.forEachActiveSound(function (sound)\r\n {\r\n sound.resume();\r\n });\r\n\r\n this.emit(Events.RESUME_ALL, this);\r\n },\r\n\r\n /**\r\n * Stops all the sounds in the game.\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#stopAll\r\n * @fires Phaser.Sound.Events#STOP_ALL\r\n * @since 3.0.0\r\n */\r\n stopAll: function ()\r\n {\r\n this.forEachActiveSound(function (sound)\r\n {\r\n sound.stop();\r\n });\r\n\r\n this.emit(Events.STOP_ALL, this);\r\n },\r\n\r\n /**\r\n * Method used internally for unlocking audio playback on devices that\r\n * require user interaction before any sound can be played on a web page.\r\n *\r\n * Read more about how this issue is handled here in [this article](https://medium.com/@pgoloskokovic/unlocking-web-audio-the-smarter-way-8858218c0e09).\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#unlock\r\n * @override\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n unlock: NOOP,\r\n\r\n /**\r\n * Method used internally for pausing sound manager if\r\n * Phaser.Sound.BaseSoundManager#pauseOnBlur is set to true.\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#onBlur\r\n * @override\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n onBlur: NOOP,\r\n\r\n /**\r\n * Method used internally for resuming sound manager if\r\n * Phaser.Sound.BaseSoundManager#pauseOnBlur is set to true.\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#onFocus\r\n * @override\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n onFocus: NOOP,\r\n\r\n /**\r\n * Update method called on every game step.\r\n * Removes destroyed sounds and updates every active sound in the game.\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#update\r\n * @protected\r\n * @fires Phaser.Sound.Events#UNLOCKED\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time elapsed since the last frame.\r\n */\r\n update: function (time, delta)\r\n {\r\n if (this.unlocked)\r\n {\r\n this.unlocked = false;\r\n this.locked = false;\r\n\r\n this.emit(Events.UNLOCKED, this);\r\n }\r\n\r\n for (var i = this.sounds.length - 1; i >= 0; i--)\r\n {\r\n if (this.sounds[i].pendingRemove)\r\n {\r\n this.sounds.splice(i, 1);\r\n }\r\n }\r\n\r\n this.sounds.forEach(function (sound)\r\n {\r\n sound.update(time, delta);\r\n });\r\n },\r\n\r\n /**\r\n * Destroys all the sounds in the game and all associated events.\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.removeAllListeners();\r\n\r\n this.forEachActiveSound(function (sound)\r\n {\r\n sound.destroy();\r\n });\r\n\r\n this.sounds.length = 0;\r\n this.sounds = null;\r\n\r\n this.game = null;\r\n },\r\n\r\n /**\r\n * Method used internally for iterating only over active sounds and skipping sounds that are marked for removal.\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#forEachActiveSound\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Sound.EachActiveSoundCallback} callback - Callback function. (manager: Phaser.Sound.BaseSoundManager, sound: Phaser.Sound.BaseSound, index: number, sounds: Phaser.Manager.BaseSound[]) => void\r\n * @param {*} [scope] - Callback context.\r\n */\r\n forEachActiveSound: function (callback, scope)\r\n {\r\n var _this = this;\r\n\r\n this.sounds.forEach(function (sound, index)\r\n {\r\n if (sound && !sound.pendingRemove)\r\n {\r\n callback.call(scope || _this, sound, index, _this.sounds);\r\n }\r\n });\r\n },\r\n\r\n /**\r\n * Sets the global playback rate at which all the sounds will be played.\r\n *\r\n * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed\r\n * and 2.0 doubles the audios playback speed.\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#setRate\r\n * @fires Phaser.Sound.Events#GLOBAL_RATE\r\n * @since 3.3.0\r\n *\r\n * @param {number} value - Global playback rate at which all the sounds will be played.\r\n *\r\n * @return {Phaser.Sound.BaseSoundManager} This Sound Manager.\r\n */\r\n setRate: function (value)\r\n {\r\n this.rate = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Global playback rate at which all the sounds will be played.\r\n * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed\r\n * and 2.0 doubles the audio's playback speed.\r\n *\r\n * @name Phaser.Sound.BaseSoundManager#rate\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n rate: {\r\n\r\n get: function ()\r\n {\r\n return this._rate;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._rate = value;\r\n\r\n this.forEachActiveSound(function (sound)\r\n {\r\n sound.calculateRate();\r\n });\r\n\r\n this.emit(Events.GLOBAL_RATE, this, value);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the global detuning of all sounds in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29).\r\n * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent).\r\n *\r\n * @method Phaser.Sound.BaseSoundManager#setDetune\r\n * @fires Phaser.Sound.Events#GLOBAL_DETUNE\r\n * @since 3.3.0\r\n *\r\n * @param {number} value - The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent).\r\n *\r\n * @return {Phaser.Sound.BaseSoundManager} This Sound Manager.\r\n */\r\n setDetune: function (value)\r\n {\r\n this.detune = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Global detuning of all sounds in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29).\r\n * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent).\r\n *\r\n * @name Phaser.Sound.BaseSoundManager#detune\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n detune: {\r\n\r\n get: function ()\r\n {\r\n return this._detune;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._detune = value;\r\n\r\n this.forEachActiveSound(function (sound)\r\n {\r\n sound.calculateRate();\r\n });\r\n\r\n this.emit(Events.GLOBAL_DETUNE, this, value);\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = BaseSoundManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/BaseSoundManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/SoundManagerCreator.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/sound/SoundManagerCreator.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Pavle Goloskokovic (http://prunegames.com)\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar HTML5AudioSoundManager = __webpack_require__(/*! ./html5/HTML5AudioSoundManager */ \"./node_modules/phaser/src/sound/html5/HTML5AudioSoundManager.js\");\r\nvar NoAudioSoundManager = __webpack_require__(/*! ./noaudio/NoAudioSoundManager */ \"./node_modules/phaser/src/sound/noaudio/NoAudioSoundManager.js\");\r\nvar WebAudioSoundManager = __webpack_require__(/*! ./webaudio/WebAudioSoundManager */ \"./node_modules/phaser/src/sound/webaudio/WebAudioSoundManager.js\");\r\n\r\n/**\r\n * Creates a Web Audio, HTML5 Audio or No Audio Sound Manager based on config and device settings.\r\n *\r\n * Be aware of https://developers.google.com/web/updates/2017/09/autoplay-policy-changes\r\n *\r\n * @function Phaser.Sound.SoundManagerCreator\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - Reference to the current game instance.\r\n * \r\n * @return {(Phaser.Sound.HTML5AudioSoundManager|Phaser.Sound.WebAudioSoundManager|Phaser.Sound.NoAudioSoundManager)} The Sound Manager instance that was created.\r\n */\r\nvar SoundManagerCreator = {\r\n\r\n create: function (game)\r\n {\r\n var audioConfig = game.config.audio;\r\n var deviceAudio = game.device.audio;\r\n\r\n if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData))\r\n {\r\n return new NoAudioSoundManager(game);\r\n }\r\n\r\n if (deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio))\r\n {\r\n return new WebAudioSoundManager(game);\r\n }\r\n\r\n return new HTML5AudioSoundManager(game);\r\n }\r\n\r\n};\r\n\r\nmodule.exports = SoundManagerCreator;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/SoundManagerCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/COMPLETE_EVENT.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/COMPLETE_EVENT.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Complete Event.\r\n * \r\n * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they complete playback.\r\n * \r\n * Listen to it from a Sound instance using `Sound.on('complete', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var music = this.sound.add('key');\r\n * music.on('complete', listener);\r\n * music.play();\r\n * ```\r\n *\r\n * @event Phaser.Sound.Events#COMPLETE\r\n * @since 3.16.1\r\n * \r\n * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event.\r\n */\r\nmodule.exports = 'complete';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/DECODED_ALL_EVENT.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/DECODED_ALL_EVENT.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Audio Data Decoded All Event.\r\n * \r\n * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method,\r\n * once all files passed to the method have been decoded (or errored).\r\n * \r\n * Use `Phaser.Sound.Events#DECODED` to listen for single sounds being decoded, and `DECODED_ALL` to\r\n * listen for them all completing.\r\n * \r\n * Listen to it from the Sound Manager in a Scene using `this.sound.on('decodedall', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * this.sound.once('decodedall', handler);\r\n * this.sound.decodeAudio([ audioFiles ]);\r\n * ```\r\n *\r\n * @event Phaser.Sound.Events#DECODED_ALL\r\n * @since 3.18.0\r\n */\r\nmodule.exports = 'decodedall';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/DECODED_ALL_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/DECODED_EVENT.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/DECODED_EVENT.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Audio Data Decoded Event.\r\n * \r\n * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method.\r\n * \r\n * Listen to it from the Sound Manager in a Scene using `this.sound.on('decoded', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * this.sound.on('decoded', handler);\r\n * this.sound.decodeAudio(key, audioData);\r\n * ```\r\n *\r\n * @event Phaser.Sound.Events#DECODED\r\n * @since 3.18.0\r\n * \r\n * @param {string} key - The key of the audio file that was decoded and added to the audio cache.\r\n */\r\nmodule.exports = 'decoded';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/DECODED_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/DESTROY_EVENT.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/DESTROY_EVENT.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Destroy Event.\r\n * \r\n * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are destroyed, either\r\n * directly or via a Sound Manager.\r\n * \r\n * Listen to it from a Sound instance using `Sound.on('destroy', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var music = this.sound.add('key');\r\n * music.on('destroy', listener);\r\n * music.destroy();\r\n * ```\r\n *\r\n * @event Phaser.Sound.Events#DESTROY\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event.\r\n */\r\nmodule.exports = 'destroy';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/DESTROY_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/DETUNE_EVENT.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/DETUNE_EVENT.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Detune Event.\r\n * \r\n * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their detune value changes.\r\n * \r\n * Listen to it from a Sound instance using `Sound.on('detune', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var music = this.sound.add('key');\r\n * music.on('detune', listener);\r\n * music.play();\r\n * music.setDetune(200);\r\n * ```\r\n *\r\n * @event Phaser.Sound.Events#DETUNE\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event.\r\n * @param {number} detune - The new detune value of the Sound.\r\n */\r\nmodule.exports = 'detune';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/DETUNE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/GLOBAL_DETUNE_EVENT.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/GLOBAL_DETUNE_EVENT.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Manager Global Detune Event.\r\n * \r\n * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager,\r\n * or the HTML5 Audio Manager. It is dispatched when the `detune` property of the Sound Manager is changed, which globally\r\n * adjusts the detuning of all active sounds.\r\n * \r\n * Listen to it from a Scene using: `this.sound.on('rate', listener)`.\r\n *\r\n * @event Phaser.Sound.Events#GLOBAL_DETUNE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event.\r\n * @param {number} detune - The updated detune value.\r\n */\r\nmodule.exports = 'detune';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/GLOBAL_DETUNE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/GLOBAL_MUTE_EVENT.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/GLOBAL_MUTE_EVENT.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Manager Global Mute Event.\r\n * \r\n * This event is dispatched by the Sound Manager when its `mute` property is changed, either directly\r\n * or via the `setMute` method. This changes the mute state of all active sounds.\r\n * \r\n * Listen to it from a Scene using: `this.sound.on('mute', listener)`.\r\n *\r\n * @event Phaser.Sound.Events#GLOBAL_MUTE\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Sound.WebAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager)} soundManager - A reference to the Sound Manager that emitted the event.\r\n * @param {boolean} mute - The mute value. `true` if the Sound Manager is now muted, otherwise `false`.\r\n */\r\nmodule.exports = 'mute';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/GLOBAL_MUTE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/GLOBAL_RATE_EVENT.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/GLOBAL_RATE_EVENT.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Manager Global Rate Event.\r\n * \r\n * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager,\r\n * or the HTML5 Audio Manager. It is dispatched when the `rate` property of the Sound Manager is changed, which globally\r\n * adjusts the playback rate of all active sounds.\r\n * \r\n * Listen to it from a Scene using: `this.sound.on('rate', listener)`.\r\n *\r\n * @event Phaser.Sound.Events#GLOBAL_RATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event.\r\n * @param {number} rate - The updated rate value.\r\n */\r\nmodule.exports = 'rate';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/GLOBAL_RATE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/GLOBAL_VOLUME_EVENT.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/GLOBAL_VOLUME_EVENT.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Manager Global Volume Event.\r\n * \r\n * This event is dispatched by the Sound Manager when its `volume` property is changed, either directly\r\n * or via the `setVolume` method. This changes the volume of all active sounds.\r\n * \r\n * Listen to it from a Scene using: `this.sound.on('volume', listener)`.\r\n *\r\n * @event Phaser.Sound.Events#GLOBAL_VOLUME\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Sound.WebAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager)} soundManager - A reference to the sound manager that emitted the event.\r\n * @param {number} volume - The new global volume of the Sound Manager.\r\n */\r\nmodule.exports = 'volume';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/GLOBAL_VOLUME_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/LOOPED_EVENT.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/LOOPED_EVENT.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Looped Event.\r\n * \r\n * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they loop during playback.\r\n * \r\n * Listen to it from a Sound instance using `Sound.on('looped', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var music = this.sound.add('key');\r\n * music.on('looped', listener);\r\n * music.setLoop(true);\r\n * music.play();\r\n * ```\r\n * \r\n * This is not to be confused with the [LOOP]{@linkcode Phaser.Sound.Events#event:LOOP} event, which only emits when the loop state of a Sound is changed.\r\n *\r\n * @event Phaser.Sound.Events#LOOPED\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event.\r\n */\r\nmodule.exports = 'looped';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/LOOPED_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/LOOP_EVENT.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/LOOP_EVENT.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Loop Event.\r\n * \r\n * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their loop state is changed.\r\n * \r\n * Listen to it from a Sound instance using `Sound.on('loop', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var music = this.sound.add('key');\r\n * music.on('loop', listener);\r\n * music.setLoop(true);\r\n * ```\r\n * \r\n * This is not to be confused with the [LOOPED]{@linkcode Phaser.Sound.Events#event:LOOPED} event, which emits each time a Sound loops during playback.\r\n *\r\n * @event Phaser.Sound.Events#LOOP\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event.\r\n * @param {boolean} loop - The new loop value. `true` if the Sound will loop, otherwise `false`.\r\n */\r\nmodule.exports = 'loop';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/LOOP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/MUTE_EVENT.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/MUTE_EVENT.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Mute Event.\r\n * \r\n * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their mute state changes.\r\n * \r\n * Listen to it from a Sound instance using `Sound.on('mute', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var music = this.sound.add('key');\r\n * music.on('mute', listener);\r\n * music.play();\r\n * music.setMute(true);\r\n * ```\r\n *\r\n * @event Phaser.Sound.Events#MUTE\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event.\r\n * @param {boolean} mute - The mute value. `true` if the Sound is now muted, otherwise `false`.\r\n */\r\nmodule.exports = 'mute';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/MUTE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/PAUSE_ALL_EVENT.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/PAUSE_ALL_EVENT.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Pause All Sounds Event.\r\n * \r\n * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager,\r\n * or the HTML5 Audio Manager. It is dispatched when the `pauseAll` method is invoked and after all current Sounds\r\n * have been paused.\r\n * \r\n * Listen to it from a Scene using: `this.sound.on('pauseall', listener)`.\r\n *\r\n * @event Phaser.Sound.Events#PAUSE_ALL\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event.\r\n */\r\nmodule.exports = 'pauseall';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/PAUSE_ALL_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/PAUSE_EVENT.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/PAUSE_EVENT.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Pause Event.\r\n * \r\n * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are paused.\r\n * \r\n * Listen to it from a Sound instance using `Sound.on('pause', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var music = this.sound.add('key');\r\n * music.on('pause', listener);\r\n * music.play();\r\n * music.pause();\r\n * ```\r\n *\r\n * @event Phaser.Sound.Events#PAUSE\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event.\r\n */\r\nmodule.exports = 'pause';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/PAUSE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/PLAY_EVENT.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/PLAY_EVENT.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Play Event.\r\n * \r\n * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are played.\r\n * \r\n * Listen to it from a Sound instance using `Sound.on('play', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var music = this.sound.add('key');\r\n * music.on('play', listener);\r\n * music.play();\r\n * ```\r\n *\r\n * @event Phaser.Sound.Events#PLAY\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event.\r\n */\r\nmodule.exports = 'play';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/PLAY_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/RATE_EVENT.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/RATE_EVENT.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Rate Change Event.\r\n * \r\n * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their rate changes.\r\n * \r\n * Listen to it from a Sound instance using `Sound.on('rate', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var music = this.sound.add('key');\r\n * music.on('rate', listener);\r\n * music.play();\r\n * music.setRate(0.5);\r\n * ```\r\n *\r\n * @event Phaser.Sound.Events#RATE\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event.\r\n * @param {number} rate - The new rate of the Sound.\r\n */\r\nmodule.exports = 'rate';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/RATE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/RESUME_ALL_EVENT.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/RESUME_ALL_EVENT.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Resume All Sounds Event.\r\n * \r\n * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager,\r\n * or the HTML5 Audio Manager. It is dispatched when the `resumeAll` method is invoked and after all current Sounds\r\n * have been resumed.\r\n * \r\n * Listen to it from a Scene using: `this.sound.on('resumeall', listener)`.\r\n *\r\n * @event Phaser.Sound.Events#RESUME_ALL\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event.\r\n */\r\nmodule.exports = 'resumeall';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/RESUME_ALL_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/RESUME_EVENT.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/RESUME_EVENT.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Resume Event.\r\n * \r\n * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are resumed from a paused state.\r\n * \r\n * Listen to it from a Sound instance using `Sound.on('resume', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var music = this.sound.add('key');\r\n * music.on('resume', listener);\r\n * music.play();\r\n * music.pause();\r\n * music.resume();\r\n * ```\r\n *\r\n * @event Phaser.Sound.Events#RESUME\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event.\r\n */\r\nmodule.exports = 'resume';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/RESUME_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/SEEK_EVENT.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/SEEK_EVENT.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Seek Event.\r\n * \r\n * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are seeked to a new position.\r\n * \r\n * Listen to it from a Sound instance using `Sound.on('seek', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var music = this.sound.add('key');\r\n * music.on('seek', listener);\r\n * music.play();\r\n * music.setSeek(5000);\r\n * ```\r\n *\r\n * @event Phaser.Sound.Events#SEEK\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event.\r\n * @param {number} detune - The new detune value of the Sound.\r\n */\r\nmodule.exports = 'seek';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/SEEK_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/STOP_ALL_EVENT.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/STOP_ALL_EVENT.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Stop All Sounds Event.\r\n * \r\n * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager,\r\n * or the HTML5 Audio Manager. It is dispatched when the `stopAll` method is invoked and after all current Sounds\r\n * have been stopped.\r\n * \r\n * Listen to it from a Scene using: `this.sound.on('stopall', listener)`.\r\n *\r\n * @event Phaser.Sound.Events#STOP_ALL\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event.\r\n */\r\nmodule.exports = 'stopall';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/STOP_ALL_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/STOP_EVENT.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/STOP_EVENT.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Stop Event.\r\n * \r\n * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are stopped.\r\n * \r\n * Listen to it from a Sound instance using `Sound.on('stop', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var music = this.sound.add('key');\r\n * music.on('stop', listener);\r\n * music.play();\r\n * music.stop();\r\n * ```\r\n *\r\n * @event Phaser.Sound.Events#STOP\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event.\r\n */\r\nmodule.exports = 'stop';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/STOP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/UNLOCKED_EVENT.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/UNLOCKED_EVENT.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Manager Unlocked Event.\r\n * \r\n * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager,\r\n * or the HTML5 Audio Manager. It is dispatched during the update loop when the Sound Manager becomes unlocked. For\r\n * Web Audio this is on the first user gesture on the page.\r\n * \r\n * Listen to it from a Scene using: `this.sound.on('unlocked', listener)`.\r\n *\r\n * @event Phaser.Sound.Events#UNLOCKED\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event.\r\n */\r\nmodule.exports = 'unlocked';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/UNLOCKED_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/VOLUME_EVENT.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/sound/events/VOLUME_EVENT.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Sound Volume Event.\r\n * \r\n * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their volume changes.\r\n * \r\n * Listen to it from a Sound instance using `Sound.on('volume', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var music = this.sound.add('key');\r\n * music.on('volume', listener);\r\n * music.play();\r\n * music.setVolume(0.5);\r\n * ```\r\n *\r\n * @event Phaser.Sound.Events#VOLUME\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event.\r\n * @param {number} volume - The new volume of the Sound.\r\n */\r\nmodule.exports = 'volume';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/VOLUME_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/events/index.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/sound/events/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Sound.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n COMPLETE: __webpack_require__(/*! ./COMPLETE_EVENT */ \"./node_modules/phaser/src/sound/events/COMPLETE_EVENT.js\"),\r\n DECODED: __webpack_require__(/*! ./DECODED_EVENT */ \"./node_modules/phaser/src/sound/events/DECODED_EVENT.js\"),\r\n DECODED_ALL: __webpack_require__(/*! ./DECODED_ALL_EVENT */ \"./node_modules/phaser/src/sound/events/DECODED_ALL_EVENT.js\"),\r\n DESTROY: __webpack_require__(/*! ./DESTROY_EVENT */ \"./node_modules/phaser/src/sound/events/DESTROY_EVENT.js\"),\r\n DETUNE: __webpack_require__(/*! ./DETUNE_EVENT */ \"./node_modules/phaser/src/sound/events/DETUNE_EVENT.js\"),\r\n GLOBAL_DETUNE: __webpack_require__(/*! ./GLOBAL_DETUNE_EVENT */ \"./node_modules/phaser/src/sound/events/GLOBAL_DETUNE_EVENT.js\"),\r\n GLOBAL_MUTE: __webpack_require__(/*! ./GLOBAL_MUTE_EVENT */ \"./node_modules/phaser/src/sound/events/GLOBAL_MUTE_EVENT.js\"),\r\n GLOBAL_RATE: __webpack_require__(/*! ./GLOBAL_RATE_EVENT */ \"./node_modules/phaser/src/sound/events/GLOBAL_RATE_EVENT.js\"),\r\n GLOBAL_VOLUME: __webpack_require__(/*! ./GLOBAL_VOLUME_EVENT */ \"./node_modules/phaser/src/sound/events/GLOBAL_VOLUME_EVENT.js\"),\r\n LOOP: __webpack_require__(/*! ./LOOP_EVENT */ \"./node_modules/phaser/src/sound/events/LOOP_EVENT.js\"),\r\n LOOPED: __webpack_require__(/*! ./LOOPED_EVENT */ \"./node_modules/phaser/src/sound/events/LOOPED_EVENT.js\"),\r\n MUTE: __webpack_require__(/*! ./MUTE_EVENT */ \"./node_modules/phaser/src/sound/events/MUTE_EVENT.js\"),\r\n PAUSE_ALL: __webpack_require__(/*! ./PAUSE_ALL_EVENT */ \"./node_modules/phaser/src/sound/events/PAUSE_ALL_EVENT.js\"),\r\n PAUSE: __webpack_require__(/*! ./PAUSE_EVENT */ \"./node_modules/phaser/src/sound/events/PAUSE_EVENT.js\"),\r\n PLAY: __webpack_require__(/*! ./PLAY_EVENT */ \"./node_modules/phaser/src/sound/events/PLAY_EVENT.js\"),\r\n RATE: __webpack_require__(/*! ./RATE_EVENT */ \"./node_modules/phaser/src/sound/events/RATE_EVENT.js\"),\r\n RESUME_ALL: __webpack_require__(/*! ./RESUME_ALL_EVENT */ \"./node_modules/phaser/src/sound/events/RESUME_ALL_EVENT.js\"),\r\n RESUME: __webpack_require__(/*! ./RESUME_EVENT */ \"./node_modules/phaser/src/sound/events/RESUME_EVENT.js\"),\r\n SEEK: __webpack_require__(/*! ./SEEK_EVENT */ \"./node_modules/phaser/src/sound/events/SEEK_EVENT.js\"),\r\n STOP_ALL: __webpack_require__(/*! ./STOP_ALL_EVENT */ \"./node_modules/phaser/src/sound/events/STOP_ALL_EVENT.js\"),\r\n STOP: __webpack_require__(/*! ./STOP_EVENT */ \"./node_modules/phaser/src/sound/events/STOP_EVENT.js\"),\r\n UNLOCKED: __webpack_require__(/*! ./UNLOCKED_EVENT */ \"./node_modules/phaser/src/sound/events/UNLOCKED_EVENT.js\"),\r\n VOLUME: __webpack_require__(/*! ./VOLUME_EVENT */ \"./node_modules/phaser/src/sound/events/VOLUME_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/html5/HTML5AudioSound.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/sound/html5/HTML5AudioSound.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Pavle Goloskokovic (http://prunegames.com)\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BaseSound = __webpack_require__(/*! ../BaseSound */ \"./node_modules/phaser/src/sound/BaseSound.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/sound/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * HTML5 Audio implementation of the sound.\r\n *\r\n * @class HTML5AudioSound\r\n * @extends Phaser.Sound.BaseSound\r\n * @memberof Phaser.Sound\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Sound.HTML5AudioSoundManager} manager - Reference to the current sound manager instance.\r\n * @param {string} key - Asset key for the sound.\r\n * @param {Phaser.Types.Sound.SoundConfig} [config={}] - An optional config object containing default sound settings.\r\n */\r\nvar HTML5AudioSound = new Class({\r\n\r\n Extends: BaseSound,\r\n\r\n initialize:\r\n\r\n function HTML5AudioSound (manager, key, config)\r\n {\r\n if (config === undefined) { config = {}; }\r\n\r\n /**\r\n * An array containing all HTML5 Audio tags that could be used for individual\r\n * sound's playback. Number of instances depends on the config value passed\r\n * to the Loader#audio method call, default is 1.\r\n *\r\n * @name Phaser.Sound.HTML5AudioSound#tags\r\n * @type {HTMLAudioElement[]}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.tags = manager.game.cache.audio.get(key);\r\n\r\n if (!this.tags)\r\n {\r\n throw new Error('There is no audio asset with key \"' + key + '\" in the audio cache');\r\n }\r\n\r\n /**\r\n * Reference to an HTML5 Audio tag used for playing sound.\r\n *\r\n * @name Phaser.Sound.HTML5AudioSound#audio\r\n * @type {HTMLAudioElement}\r\n * @private\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.audio = null;\r\n\r\n /**\r\n * Timestamp as generated by the Request Animation Frame or SetTimeout\r\n * representing the time at which the delayed sound playback should start.\r\n * Set to 0 if sound playback is not delayed.\r\n *\r\n * @name Phaser.Sound.HTML5AudioSound#startTime\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.startTime = 0;\r\n\r\n /**\r\n * Audio tag's playback position recorded on previous\r\n * update method call. Set to 0 if sound is not playing.\r\n *\r\n * @name Phaser.Sound.HTML5AudioSound#previousTime\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.previousTime = 0;\r\n\r\n this.duration = this.tags[0].duration;\r\n\r\n this.totalDuration = this.tags[0].duration;\r\n\r\n BaseSound.call(this, manager, key, config);\r\n },\r\n\r\n /**\r\n * Play this sound, or a marked section of it.\r\n * It always plays the sound from the start. If you want to start playback from a specific time\r\n * you can set 'seek' setting of the config object, provided to this call, to that value.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#play\r\n * @fires Phaser.Sound.Events#PLAY\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Sound.SoundConfig)} [markerName=''] - If you want to play a marker then provide the marker name here. Alternatively, this parameter can be a SoundConfig object.\r\n * @param {Phaser.Types.Sound.SoundConfig} [config] - Optional sound config object to be applied to this marker or entire sound if no marker name is provided. It gets memorized for future plays of current section of the sound.\r\n *\r\n * @return {boolean} Whether the sound started playing successfully.\r\n */\r\n play: function (markerName, config)\r\n {\r\n if (this.manager.isLocked(this, 'play', [ markerName, config ]))\r\n {\r\n return false;\r\n }\r\n\r\n if (!BaseSound.prototype.play.call(this, markerName, config))\r\n {\r\n return false;\r\n }\r\n\r\n // \\/\\/\\/ isPlaying = true, isPaused = false \\/\\/\\/\r\n if (!this.pickAndPlayAudioTag())\r\n {\r\n return false;\r\n }\r\n\r\n this.emit(Events.PLAY, this);\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Pauses the sound.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#pause\r\n * @fires Phaser.Sound.Events#PAUSE\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} Whether the sound was paused successfully.\r\n */\r\n pause: function ()\r\n {\r\n if (this.manager.isLocked(this, 'pause'))\r\n {\r\n return false;\r\n }\r\n\r\n if (this.startTime > 0)\r\n {\r\n return false;\r\n }\r\n\r\n if (!BaseSound.prototype.pause.call(this))\r\n {\r\n return false;\r\n }\r\n\r\n // \\/\\/\\/ isPlaying = false, isPaused = true \\/\\/\\/\r\n this.currentConfig.seek = this.audio.currentTime - (this.currentMarker ? this.currentMarker.start : 0);\r\n\r\n this.stopAndReleaseAudioTag();\r\n\r\n this.emit(Events.PAUSE, this);\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Resumes the sound.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#resume\r\n * @fires Phaser.Sound.Events#RESUME\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} Whether the sound was resumed successfully.\r\n */\r\n resume: function ()\r\n {\r\n if (this.manager.isLocked(this, 'resume'))\r\n {\r\n return false;\r\n }\r\n\r\n if (this.startTime > 0)\r\n {\r\n return false;\r\n }\r\n\r\n if (!BaseSound.prototype.resume.call(this))\r\n {\r\n return false;\r\n }\r\n\r\n // \\/\\/\\/ isPlaying = true, isPaused = false \\/\\/\\/\r\n if (!this.pickAndPlayAudioTag())\r\n {\r\n return false;\r\n }\r\n\r\n this.emit(Events.RESUME, this);\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Stop playing this sound.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#stop\r\n * @fires Phaser.Sound.Events#STOP\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} Whether the sound was stopped successfully.\r\n */\r\n stop: function ()\r\n {\r\n if (this.manager.isLocked(this, 'stop'))\r\n {\r\n return false;\r\n }\r\n\r\n if (!BaseSound.prototype.stop.call(this))\r\n {\r\n return false;\r\n }\r\n\r\n // \\/\\/\\/ isPlaying = false, isPaused = false \\/\\/\\/\r\n this.stopAndReleaseAudioTag();\r\n\r\n this.emit(Events.STOP, this);\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Used internally to do what the name says.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#pickAndPlayAudioTag\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} Whether the sound was assigned an audio tag successfully.\r\n */\r\n pickAndPlayAudioTag: function ()\r\n {\r\n if (!this.pickAudioTag())\r\n {\r\n this.reset();\r\n return false;\r\n }\r\n\r\n var seek = this.currentConfig.seek;\r\n var delay = this.currentConfig.delay;\r\n var offset = (this.currentMarker ? this.currentMarker.start : 0) + seek;\r\n\r\n this.previousTime = offset;\r\n this.audio.currentTime = offset;\r\n this.applyConfig();\r\n\r\n if (delay === 0)\r\n {\r\n this.startTime = 0;\r\n\r\n if (this.audio.paused)\r\n {\r\n this.playCatchPromise();\r\n }\r\n }\r\n else\r\n {\r\n this.startTime = window.performance.now() + delay * 1000;\r\n\r\n if (!this.audio.paused)\r\n {\r\n this.audio.pause();\r\n }\r\n }\r\n\r\n this.resetConfig();\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * This method performs the audio tag pooling logic. It first looks for\r\n * unused audio tag to assign to this sound object. If there are no unused\r\n * audio tags, based on HTML5AudioSoundManager#override property value, it\r\n * looks for sound with most advanced playback and hijacks its audio tag or\r\n * does nothing.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#pickAudioTag\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} Whether the sound was assigned an audio tag successfully.\r\n */\r\n pickAudioTag: function ()\r\n {\r\n if (this.audio)\r\n {\r\n return true;\r\n }\r\n\r\n for (var i = 0; i < this.tags.length; i++)\r\n {\r\n var audio = this.tags[i];\r\n\r\n if (audio.dataset.used === 'false')\r\n {\r\n audio.dataset.used = 'true';\r\n this.audio = audio;\r\n return true;\r\n }\r\n }\r\n\r\n if (!this.manager.override)\r\n {\r\n return false;\r\n }\r\n\r\n var otherSounds = [];\r\n\r\n this.manager.forEachActiveSound(function (sound)\r\n {\r\n if (sound.key === this.key && sound.audio)\r\n {\r\n otherSounds.push(sound);\r\n }\r\n }, this);\r\n\r\n otherSounds.sort(function (a1, a2)\r\n {\r\n if (a1.loop === a2.loop)\r\n {\r\n // sort by progress\r\n return (a2.seek / a2.duration) - (a1.seek / a1.duration);\r\n }\r\n return a1.loop ? 1 : -1;\r\n });\r\n\r\n var selectedSound = otherSounds[0];\r\n\r\n this.audio = selectedSound.audio;\r\n\r\n selectedSound.reset();\r\n selectedSound.audio = null;\r\n selectedSound.startTime = 0;\r\n selectedSound.previousTime = 0;\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Method used for playing audio tag and catching possible exceptions\r\n * thrown from rejected Promise returned from play method call.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#playCatchPromise\r\n * @private\r\n * @since 3.0.0\r\n */\r\n playCatchPromise: function ()\r\n {\r\n var playPromise = this.audio.play();\r\n\r\n if (playPromise)\r\n {\r\n // eslint-disable-next-line no-unused-vars\r\n playPromise.catch(function (reason)\r\n {\r\n console.warn(reason);\r\n });\r\n }\r\n },\r\n\r\n /**\r\n * Used internally to do what the name says.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#stopAndReleaseAudioTag\r\n * @private\r\n * @since 3.0.0\r\n */\r\n stopAndReleaseAudioTag: function ()\r\n {\r\n this.audio.pause();\r\n this.audio.dataset.used = 'false';\r\n this.audio = null;\r\n this.startTime = 0;\r\n this.previousTime = 0;\r\n },\r\n\r\n /**\r\n * Method used internally to reset sound state, usually when stopping sound\r\n * or when hijacking audio tag from another sound.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#reset\r\n * @private\r\n * @since 3.0.0\r\n */\r\n reset: function ()\r\n {\r\n BaseSound.prototype.stop.call(this);\r\n },\r\n\r\n /**\r\n * Method used internally by sound manager for pausing sound if\r\n * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSoundManager#onBlur\r\n * @private\r\n * @since 3.0.0\r\n */\r\n onBlur: function ()\r\n {\r\n this.isPlaying = false;\r\n this.isPaused = true;\r\n\r\n this.currentConfig.seek = this.audio.currentTime - (this.currentMarker ? this.currentMarker.start : 0);\r\n\r\n this.currentConfig.delay = Math.max(0, (this.startTime - window.performance.now()) / 1000);\r\n\r\n this.stopAndReleaseAudioTag();\r\n },\r\n\r\n /**\r\n * Method used internally by sound manager for resuming sound if\r\n * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#onFocus\r\n * @private\r\n * @since 3.0.0\r\n */\r\n onFocus: function ()\r\n {\r\n this.isPlaying = true;\r\n this.isPaused = false;\r\n this.pickAndPlayAudioTag();\r\n },\r\n\r\n /**\r\n * Update method called automatically by sound manager on every game step.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#update\r\n * @fires Phaser.Sound.Events#COMPLETE\r\n * @fires Phaser.Sound.Events#LOOPED\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time elapsed since the last frame.\r\n */\r\n // eslint-disable-next-line no-unused-vars\r\n update: function (time, delta)\r\n {\r\n if (!this.isPlaying)\r\n {\r\n return;\r\n }\r\n\r\n // handling delayed playback\r\n if (this.startTime > 0)\r\n {\r\n if (this.startTime < time - this.manager.audioPlayDelay)\r\n {\r\n this.audio.currentTime += Math.max(0, time - this.startTime) / 1000;\r\n this.startTime = 0;\r\n this.previousTime = this.audio.currentTime;\r\n this.playCatchPromise();\r\n }\r\n\r\n return;\r\n }\r\n\r\n // handle looping and ending\r\n var startTime = this.currentMarker ? this.currentMarker.start : 0;\r\n var endTime = startTime + this.duration;\r\n var currentTime = this.audio.currentTime;\r\n\r\n if (this.currentConfig.loop)\r\n {\r\n if (currentTime >= endTime - this.manager.loopEndOffset)\r\n {\r\n this.audio.currentTime = startTime + Math.max(0, currentTime - endTime);\r\n currentTime = this.audio.currentTime;\r\n }\r\n else if (currentTime < startTime)\r\n {\r\n this.audio.currentTime += startTime;\r\n currentTime = this.audio.currentTime;\r\n }\r\n\r\n if (currentTime < this.previousTime)\r\n {\r\n this.emit(Events.LOOPED, this);\r\n }\r\n }\r\n else if (currentTime >= endTime)\r\n {\r\n this.reset();\r\n\r\n this.stopAndReleaseAudioTag();\r\n\r\n this.emit(Events.COMPLETE, this);\r\n\r\n return;\r\n }\r\n\r\n this.previousTime = currentTime;\r\n },\r\n\r\n /**\r\n * Calls Phaser.Sound.BaseSound#destroy method\r\n * and cleans up all HTML5 Audio related stuff.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n BaseSound.prototype.destroy.call(this);\r\n\r\n this.tags = null;\r\n\r\n if (this.audio)\r\n {\r\n this.stopAndReleaseAudioTag();\r\n }\r\n },\r\n\r\n /**\r\n * Method used internally to determine mute setting of the sound.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#updateMute\r\n * @private\r\n * @since 3.0.0\r\n */\r\n updateMute: function ()\r\n {\r\n if (this.audio)\r\n {\r\n this.audio.muted = this.currentConfig.mute || this.manager.mute;\r\n }\r\n },\r\n\r\n /**\r\n * Method used internally to calculate total volume of the sound.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#updateVolume\r\n * @private\r\n * @since 3.0.0\r\n */\r\n updateVolume: function ()\r\n {\r\n if (this.audio)\r\n {\r\n this.audio.volume = this.currentConfig.volume * this.manager.volume;\r\n }\r\n },\r\n\r\n /**\r\n * Method used internally to calculate total playback rate of the sound.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#calculateRate\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n calculateRate: function ()\r\n {\r\n BaseSound.prototype.calculateRate.call(this);\r\n\r\n if (this.audio)\r\n {\r\n this.audio.playbackRate = this.totalRate;\r\n }\r\n },\r\n\r\n /**\r\n * Boolean indicating whether the sound is muted or not.\r\n * Gets or sets the muted state of this sound.\r\n * \r\n * @name Phaser.Sound.HTML5AudioSound#mute\r\n * @type {boolean}\r\n * @default false\r\n * @fires Phaser.Sound.Events#MUTE\r\n * @since 3.0.0\r\n */\r\n mute: {\r\n\r\n get: function ()\r\n {\r\n return this.currentConfig.mute;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.currentConfig.mute = value;\r\n\r\n if (this.manager.isLocked(this, 'mute', value))\r\n {\r\n return;\r\n }\r\n\r\n this.updateMute();\r\n\r\n this.emit(Events.MUTE, this, value);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the muted state of this Sound.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#setMute\r\n * @fires Phaser.Sound.Events#MUTE\r\n * @since 3.4.0\r\n *\r\n * @param {boolean} value - `true` to mute this sound, `false` to unmute it.\r\n *\r\n * @return {Phaser.Sound.HTML5AudioSound} This Sound instance.\r\n */\r\n setMute: function (value)\r\n {\r\n this.mute = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets or sets the volume of this sound, a value between 0 (silence) and 1 (full volume).\r\n * \r\n * @name Phaser.Sound.HTML5AudioSound#volume\r\n * @type {number}\r\n * @default 1\r\n * @fires Phaser.Sound.Events#VOLUME\r\n * @since 3.0.0\r\n */\r\n volume: {\r\n\r\n get: function ()\r\n {\r\n return this.currentConfig.volume;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.currentConfig.volume = value;\r\n\r\n if (this.manager.isLocked(this, 'volume', value))\r\n {\r\n return;\r\n }\r\n\r\n this.updateVolume();\r\n\r\n this.emit(Events.VOLUME, this, value);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the volume of this Sound.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#setVolume\r\n * @fires Phaser.Sound.Events#VOLUME\r\n * @since 3.4.0\r\n *\r\n * @param {number} value - The volume of the sound.\r\n *\r\n * @return {Phaser.Sound.HTML5AudioSound} This Sound instance.\r\n */\r\n setVolume: function (value)\r\n {\r\n this.volume = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rate at which this Sound will be played.\r\n * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed\r\n * and 2.0 doubles the audios playback speed.\r\n *\r\n * @name Phaser.Sound.HTML5AudioSound#rate\r\n * @type {number}\r\n * @default 1\r\n * @fires Phaser.Sound.Events#RATE\r\n * @since 3.0.0\r\n */\r\n rate: {\r\n\r\n get: function ()\r\n {\r\n return this.currentConfig.rate;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.currentConfig.rate = value;\r\n\r\n if (this.manager.isLocked(this, Events.RATE, value))\r\n {\r\n return;\r\n }\r\n else\r\n {\r\n this.calculateRate();\r\n\r\n this.emit(Events.RATE, this, value);\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the playback rate of this Sound.\r\n * \r\n * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed\r\n * and 2.0 doubles the audios playback speed.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#setRate\r\n * @fires Phaser.Sound.Events#RATE\r\n * @since 3.3.0\r\n *\r\n * @param {number} value - The playback rate at of this Sound.\r\n *\r\n * @return {Phaser.Sound.HTML5AudioSound} This Sound.\r\n */\r\n setRate: function (value)\r\n {\r\n this.rate = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29).\r\n * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent).\r\n *\r\n * @name Phaser.Sound.HTML5AudioSound#detune\r\n * @type {number}\r\n * @default 0\r\n * @fires Phaser.Sound.Events#DETUNE\r\n * @since 3.0.0\r\n */\r\n detune: {\r\n\r\n get: function ()\r\n {\r\n return this.currentConfig.detune;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.currentConfig.detune = value;\r\n\r\n if (this.manager.isLocked(this, Events.DETUNE, value))\r\n {\r\n return;\r\n }\r\n else\r\n {\r\n this.calculateRate();\r\n\r\n this.emit(Events.DETUNE, this, value);\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29).\r\n * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent).\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#setDetune\r\n * @fires Phaser.Sound.Events#DETUNE\r\n * @since 3.3.0\r\n *\r\n * @param {number} value - The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent).\r\n *\r\n * @return {Phaser.Sound.HTML5AudioSound} This Sound.\r\n */\r\n setDetune: function (value)\r\n {\r\n this.detune = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Property representing the position of playback for this sound, in seconds.\r\n * Setting it to a specific value moves current playback to that position.\r\n * The value given is clamped to the range 0 to current marker duration.\r\n * Setting seek of a stopped sound has no effect.\r\n * \r\n * @name Phaser.Sound.HTML5AudioSound#seek\r\n * @type {number}\r\n * @fires Phaser.Sound.Events#SEEK\r\n * @since 3.0.0\r\n */\r\n seek: {\r\n\r\n get: function ()\r\n {\r\n if (this.isPlaying)\r\n {\r\n return this.audio.currentTime - (this.currentMarker ? this.currentMarker.start : 0);\r\n }\r\n else if (this.isPaused)\r\n {\r\n return this.currentConfig.seek;\r\n }\r\n else\r\n {\r\n return 0;\r\n }\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (this.manager.isLocked(this, 'seek', value))\r\n {\r\n return;\r\n }\r\n\r\n if (this.startTime > 0)\r\n {\r\n return;\r\n }\r\n\r\n if (this.isPlaying || this.isPaused)\r\n {\r\n value = Math.min(Math.max(0, value), this.duration);\r\n\r\n if (this.isPlaying)\r\n {\r\n this.previousTime = value;\r\n this.audio.currentTime = value;\r\n }\r\n else if (this.isPaused)\r\n {\r\n this.currentConfig.seek = value;\r\n }\r\n\r\n this.emit(Events.SEEK, this, value);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Seeks to a specific point in this sound.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#setSeek\r\n * @fires Phaser.Sound.Events#SEEK\r\n * @since 3.4.0\r\n *\r\n * @param {number} value - The point in the sound to seek to.\r\n *\r\n * @return {Phaser.Sound.HTML5AudioSound} This Sound instance.\r\n */\r\n setSeek: function (value)\r\n {\r\n this.seek = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Flag indicating whether or not the sound or current sound marker will loop.\r\n * \r\n * @name Phaser.Sound.HTML5AudioSound#loop\r\n * @type {boolean}\r\n * @default false\r\n * @fires Phaser.Sound.Events#LOOP\r\n * @since 3.0.0\r\n */\r\n loop: {\r\n\r\n get: function ()\r\n {\r\n return this.currentConfig.loop;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.currentConfig.loop = value;\r\n\r\n if (this.manager.isLocked(this, 'loop', value))\r\n {\r\n return;\r\n }\r\n\r\n if (this.audio)\r\n {\r\n this.audio.loop = value;\r\n }\r\n\r\n this.emit(Events.LOOP, this, value);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the loop state of this Sound.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSound#setLoop\r\n * @fires Phaser.Sound.Events#LOOP\r\n * @since 3.4.0\r\n *\r\n * @param {boolean} value - `true` to loop this sound, `false` to not loop it.\r\n *\r\n * @return {Phaser.Sound.HTML5AudioSound} This Sound instance.\r\n */\r\n setLoop: function (value)\r\n {\r\n this.loop = value;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = HTML5AudioSound;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/html5/HTML5AudioSound.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/html5/HTML5AudioSoundManager.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/sound/html5/HTML5AudioSoundManager.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Pavle Goloskokovic (http://prunegames.com)\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BaseSoundManager = __webpack_require__(/*! ../BaseSoundManager */ \"./node_modules/phaser/src/sound/BaseSoundManager.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/sound/events/index.js\");\r\nvar HTML5AudioSound = __webpack_require__(/*! ./HTML5AudioSound */ \"./node_modules/phaser/src/sound/html5/HTML5AudioSound.js\");\r\n\r\n/**\r\n * HTML5 Audio implementation of the Sound Manager.\r\n * \r\n * Note: To play multiple instances of the same HTML5 Audio sound, you need to provide an `instances` value when\r\n * loading the sound with the Loader:\r\n * \r\n * ```javascript\r\n * this.load.audio('explosion', 'explosion.mp3', {\r\n * instances: 2\r\n * });\r\n * ```\r\n *\r\n * @class HTML5AudioSoundManager\r\n * @extends Phaser.Sound.BaseSoundManager\r\n * @memberof Phaser.Sound\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - Reference to the current game instance.\r\n */\r\nvar HTML5AudioSoundManager = new Class({\r\n\r\n Extends: BaseSoundManager,\r\n\r\n initialize:\r\n\r\n function HTML5AudioSoundManager (game)\r\n {\r\n /**\r\n * Flag indicating whether if there are no idle instances of HTML5 Audio tag,\r\n * for any particular sound, if one of the used tags should be hijacked and used\r\n * for succeeding playback or if succeeding Phaser.Sound.HTML5AudioSound#play\r\n * call should be ignored.\r\n *\r\n * @name Phaser.Sound.HTML5AudioSoundManager#override\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.override = true;\r\n\r\n /**\r\n * Value representing time difference, in seconds, between calling\r\n * play method on an audio tag and when it actually starts playing.\r\n * It is used to achieve more accurate delayed sound playback.\r\n *\r\n * You might need to tweak this value to get the desired results\r\n * since audio play delay varies depending on the browser/platform.\r\n *\r\n * @name Phaser.Sound.HTML5AudioSoundManager#audioPlayDelay\r\n * @type {number}\r\n * @default 0.1\r\n * @since 3.0.0\r\n */\r\n this.audioPlayDelay = 0.1;\r\n\r\n /**\r\n * A value by which we should offset the loop end marker of the\r\n * looping sound to compensate for lag, caused by changing audio\r\n * tag playback position, in order to achieve gapless looping.\r\n *\r\n * You might need to tweak this value to get the desired results\r\n * since loop lag varies depending on the browser/platform.\r\n *\r\n * @name Phaser.Sound.HTML5AudioSoundManager#loopEndOffset\r\n * @type {number}\r\n * @default 0.05\r\n * @since 3.0.0\r\n */\r\n this.loopEndOffset = 0.05;\r\n\r\n /**\r\n * An array for keeping track of all the sounds\r\n * that were paused when game lost focus.\r\n *\r\n * @name Phaser.Sound.HTML5AudioSoundManager#onBlurPausedSounds\r\n * @type {Phaser.Sound.HTML5AudioSound[]}\r\n * @private\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.onBlurPausedSounds = [];\r\n\r\n this.locked = 'ontouchstart' in window;\r\n\r\n /**\r\n * A queue of all actions performed on sound objects while audio was locked.\r\n * Once the audio gets unlocked, after an explicit user interaction,\r\n * all actions will be performed in chronological order.\r\n * Array of object types: { sound: Phaser.Sound.HTML5AudioSound, name: string, value?: * }\r\n *\r\n * @name Phaser.Sound.HTML5AudioSoundManager#lockedActionsQueue\r\n * @type {array}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.lockedActionsQueue = this.locked ? [] : null;\r\n\r\n /**\r\n * Property that actually holds the value of global mute\r\n * for HTML5 Audio sound manager implementation.\r\n *\r\n * @name Phaser.Sound.HTML5AudioSoundManager#_mute\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this._mute = false;\r\n\r\n /**\r\n * Property that actually holds the value of global volume\r\n * for HTML5 Audio sound manager implementation.\r\n *\r\n * @name Phaser.Sound.HTML5AudioSoundManager#_volume\r\n * @type {boolean}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this._volume = 1;\r\n\r\n BaseSoundManager.call(this, game);\r\n },\r\n\r\n /**\r\n * Adds a new sound into the sound manager.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSoundManager#add\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - Asset key for the sound.\r\n * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings.\r\n *\r\n * @return {Phaser.Sound.HTML5AudioSound} The new sound instance.\r\n */\r\n add: function (key, config)\r\n {\r\n var sound = new HTML5AudioSound(this, key, config);\r\n\r\n this.sounds.push(sound);\r\n\r\n return sound;\r\n },\r\n\r\n /**\r\n * Unlocks HTML5 Audio loading and playback on mobile\r\n * devices on the initial explicit user interaction.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSoundManager#unlock\r\n * @since 3.0.0\r\n */\r\n unlock: function ()\r\n {\r\n this.locked = false;\r\n\r\n var _this = this;\r\n\r\n this.game.cache.audio.entries.each(function (key, tags)\r\n {\r\n for (var i = 0; i < tags.length; i++)\r\n {\r\n if (tags[i].dataset.locked === 'true')\r\n {\r\n _this.locked = true;\r\n\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n });\r\n\r\n if (!this.locked)\r\n {\r\n return;\r\n }\r\n\r\n var moved = false;\r\n\r\n var detectMove = function ()\r\n {\r\n moved = true;\r\n };\r\n\r\n var unlock = function ()\r\n {\r\n if (moved)\r\n {\r\n moved = false;\r\n return;\r\n }\r\n\r\n document.body.removeEventListener('touchmove', detectMove);\r\n document.body.removeEventListener('touchend', unlock);\r\n\r\n var lockedTags = [];\r\n\r\n _this.game.cache.audio.entries.each(function (key, tags)\r\n {\r\n for (var i = 0; i < tags.length; i++)\r\n {\r\n var tag = tags[i];\r\n\r\n if (tag.dataset.locked === 'true')\r\n {\r\n lockedTags.push(tag);\r\n }\r\n }\r\n\r\n return true;\r\n });\r\n\r\n if (lockedTags.length === 0)\r\n {\r\n return;\r\n }\r\n\r\n var lastTag = lockedTags[lockedTags.length - 1];\r\n\r\n lastTag.oncanplaythrough = function ()\r\n {\r\n lastTag.oncanplaythrough = null;\r\n\r\n lockedTags.forEach(function (tag)\r\n {\r\n tag.dataset.locked = 'false';\r\n });\r\n\r\n _this.unlocked = true;\r\n };\r\n\r\n lockedTags.forEach(function (tag)\r\n {\r\n tag.load();\r\n });\r\n };\r\n\r\n this.once(Events.UNLOCKED, function ()\r\n {\r\n this.forEachActiveSound(function (sound)\r\n {\r\n if (sound.currentMarker === null && sound.duration === 0)\r\n {\r\n sound.duration = sound.tags[0].duration;\r\n }\r\n\r\n sound.totalDuration = sound.tags[0].duration;\r\n });\r\n\r\n while (this.lockedActionsQueue.length)\r\n {\r\n var lockedAction = this.lockedActionsQueue.shift();\r\n\r\n if (lockedAction.sound[lockedAction.prop].apply)\r\n {\r\n lockedAction.sound[lockedAction.prop].apply(lockedAction.sound, lockedAction.value || []);\r\n }\r\n else\r\n {\r\n lockedAction.sound[lockedAction.prop] = lockedAction.value;\r\n }\r\n }\r\n\r\n }, this);\r\n\r\n document.body.addEventListener('touchmove', detectMove, false);\r\n document.body.addEventListener('touchend', unlock, false);\r\n },\r\n\r\n /**\r\n * Method used internally for pausing sound manager if\r\n * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSoundManager#onBlur\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n onBlur: function ()\r\n {\r\n this.forEachActiveSound(function (sound)\r\n {\r\n if (sound.isPlaying)\r\n {\r\n this.onBlurPausedSounds.push(sound);\r\n sound.onBlur();\r\n }\r\n });\r\n },\r\n\r\n /**\r\n * Method used internally for resuming sound manager if\r\n * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSoundManager#onFocus\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n onFocus: function ()\r\n {\r\n this.onBlurPausedSounds.forEach(function (sound)\r\n {\r\n sound.onFocus();\r\n });\r\n\r\n this.onBlurPausedSounds.length = 0;\r\n },\r\n\r\n /**\r\n * Calls Phaser.Sound.BaseSoundManager#destroy method\r\n * and cleans up all HTML5 Audio related stuff.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSoundManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n BaseSoundManager.prototype.destroy.call(this);\r\n\r\n this.onBlurPausedSounds.length = 0;\r\n this.onBlurPausedSounds = null;\r\n },\r\n\r\n /**\r\n * Method used internally by Phaser.Sound.HTML5AudioSound class methods and property setters\r\n * to check if sound manager is locked and then either perform action immediately or queue it\r\n * to be performed once the sound manager gets unlocked.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSoundManager#isLocked\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Sound.HTML5AudioSound} sound - Sound object on which to perform queued action.\r\n * @param {string} prop - Name of the method to be called or property to be assigned a value to.\r\n * @param {*} [value] - An optional parameter that either holds an array of arguments to be passed to the method call or value to be set to the property.\r\n *\r\n * @return {boolean} Whether the sound manager is locked.\r\n */\r\n isLocked: function (sound, prop, value)\r\n {\r\n if (sound.tags[0].dataset.locked === 'true')\r\n {\r\n this.lockedActionsQueue.push({\r\n sound: sound,\r\n prop: prop,\r\n value: value\r\n });\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Sets the muted state of all this Sound Manager.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSoundManager#setMute\r\n * @fires Phaser.Sound.Events#GLOBAL_MUTE\r\n * @since 3.3.0\r\n *\r\n * @param {boolean} value - `true` to mute all sounds, `false` to unmute them.\r\n *\r\n * @return {Phaser.Sound.HTML5AudioSoundManager} This Sound Manager.\r\n */\r\n setMute: function (value)\r\n {\r\n this.mute = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * @name Phaser.Sound.HTML5AudioSoundManager#mute\r\n * @type {boolean}\r\n * @fires Phaser.Sound.Events#GLOBAL_MUTE\r\n * @since 3.0.0\r\n */\r\n mute: {\r\n\r\n get: function ()\r\n {\r\n return this._mute;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._mute = value;\r\n\r\n this.forEachActiveSound(function (sound)\r\n {\r\n sound.updateMute();\r\n });\r\n\r\n this.emit(Events.GLOBAL_MUTE, this, value);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the volume of this Sound Manager.\r\n *\r\n * @method Phaser.Sound.HTML5AudioSoundManager#setVolume\r\n * @fires Phaser.Sound.Events#GLOBAL_VOLUME\r\n * @since 3.3.0\r\n *\r\n * @param {number} value - The global volume of this Sound Manager.\r\n *\r\n * @return {Phaser.Sound.HTML5AudioSoundManager} This Sound Manager.\r\n */\r\n setVolume: function (value)\r\n {\r\n this.volume = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * @name Phaser.Sound.HTML5AudioSoundManager#volume\r\n * @type {number}\r\n * @fires Phaser.Sound.Events#GLOBAL_VOLUME\r\n * @since 3.0.0\r\n */\r\n volume: {\r\n\r\n get: function ()\r\n {\r\n return this._volume;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._volume = value;\r\n\r\n this.forEachActiveSound(function (sound)\r\n {\r\n sound.updateVolume();\r\n });\r\n\r\n this.emit(Events.GLOBAL_VOLUME, this, value);\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = HTML5AudioSoundManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/html5/HTML5AudioSoundManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/index.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/sound/index.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Pavle Goloskokovic (http://prunegames.com)\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Sound\r\n */\r\n\r\nmodule.exports = {\r\n\r\n SoundManagerCreator: __webpack_require__(/*! ./SoundManagerCreator */ \"./node_modules/phaser/src/sound/SoundManagerCreator.js\"),\r\n\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/sound/events/index.js\"),\r\n\r\n BaseSound: __webpack_require__(/*! ./BaseSound */ \"./node_modules/phaser/src/sound/BaseSound.js\"),\r\n BaseSoundManager: __webpack_require__(/*! ./BaseSoundManager */ \"./node_modules/phaser/src/sound/BaseSoundManager.js\"),\r\n\r\n WebAudioSound: __webpack_require__(/*! ./webaudio/WebAudioSound */ \"./node_modules/phaser/src/sound/webaudio/WebAudioSound.js\"),\r\n WebAudioSoundManager: __webpack_require__(/*! ./webaudio/WebAudioSoundManager */ \"./node_modules/phaser/src/sound/webaudio/WebAudioSoundManager.js\"),\r\n\r\n HTML5AudioSound: __webpack_require__(/*! ./html5/HTML5AudioSound */ \"./node_modules/phaser/src/sound/html5/HTML5AudioSound.js\"),\r\n HTML5AudioSoundManager: __webpack_require__(/*! ./html5/HTML5AudioSoundManager */ \"./node_modules/phaser/src/sound/html5/HTML5AudioSoundManager.js\"),\r\n\r\n NoAudioSound: __webpack_require__(/*! ./noaudio/NoAudioSound */ \"./node_modules/phaser/src/sound/noaudio/NoAudioSound.js\"),\r\n NoAudioSoundManager: __webpack_require__(/*! ./noaudio/NoAudioSoundManager */ \"./node_modules/phaser/src/sound/noaudio/NoAudioSoundManager.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/noaudio/NoAudioSound.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/sound/noaudio/NoAudioSound.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Pavle Goloskokovic (http://prunegames.com)\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BaseSound = __webpack_require__(/*! ../BaseSound */ \"./node_modules/phaser/src/sound/BaseSound.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Extend = __webpack_require__(/*! ../../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\n\r\n/**\r\n * @classdesc\r\n * No audio implementation of the sound. It is used if audio has been\r\n * disabled in the game config or the device doesn't support any audio.\r\n *\r\n * It represents a graceful degradation of sound logic that provides\r\n * minimal functionality and prevents Phaser projects that use audio from\r\n * breaking on devices that don't support any audio playback technologies.\r\n *\r\n * @class NoAudioSound\r\n * @extends Phaser.Sound.BaseSound\r\n * @memberof Phaser.Sound\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Sound.NoAudioSoundManager} manager - Reference to the current sound manager instance.\r\n * @param {string} key - Asset key for the sound.\r\n * @param {Phaser.Types.Sound.SoundConfig} [config={}] - An optional config object containing default sound settings.\r\n */\r\nvar NoAudioSound = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function NoAudioSound (manager, key, config)\r\n {\r\n if (config === void 0) { config = {}; }\r\n\r\n EventEmitter.call(this);\r\n\r\n this.manager = manager;\r\n this.key = key;\r\n this.isPlaying = false;\r\n this.isPaused = false;\r\n this.totalRate = 1;\r\n this.duration = 0;\r\n this.totalDuration = 0;\r\n\r\n this.config = Extend({\r\n mute: false,\r\n volume: 1,\r\n rate: 1,\r\n detune: 0,\r\n seek: 0,\r\n loop: false,\r\n delay: 0\r\n }, config);\r\n\r\n this.currentConfig = this.config;\r\n this.mute = false;\r\n this.volume = 1;\r\n this.rate = 1;\r\n this.detune = 0;\r\n this.seek = 0;\r\n this.loop = false;\r\n this.markers = {};\r\n this.currentMarker = null;\r\n this.pendingRemove = false;\r\n },\r\n\r\n // eslint-disable-next-line no-unused-vars\r\n addMarker: function (marker)\r\n {\r\n return false;\r\n },\r\n\r\n // eslint-disable-next-line no-unused-vars\r\n updateMarker: function (marker)\r\n {\r\n return false;\r\n },\r\n\r\n // eslint-disable-next-line no-unused-vars\r\n removeMarker: function (markerName)\r\n {\r\n return null;\r\n },\r\n\r\n // eslint-disable-next-line no-unused-vars\r\n play: function (markerName, config)\r\n {\r\n return false;\r\n },\r\n\r\n pause: function ()\r\n {\r\n return false;\r\n },\r\n\r\n resume: function ()\r\n {\r\n return false;\r\n },\r\n\r\n stop: function ()\r\n {\r\n return false;\r\n },\r\n\r\n destroy: function ()\r\n {\r\n this.manager.remove(this);\r\n\r\n BaseSound.prototype.destroy.call(this);\r\n }\r\n});\r\n\r\nmodule.exports = NoAudioSound;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/noaudio/NoAudioSound.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/noaudio/NoAudioSoundManager.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/sound/noaudio/NoAudioSoundManager.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Pavle Goloskokovic (http://prunegames.com)\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BaseSoundManager = __webpack_require__(/*! ../BaseSoundManager */ \"./node_modules/phaser/src/sound/BaseSoundManager.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar NoAudioSound = __webpack_require__(/*! ./NoAudioSound */ \"./node_modules/phaser/src/sound/noaudio/NoAudioSound.js\");\r\nvar NOOP = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\n/**\r\n * @classdesc\r\n * No audio implementation of the sound manager. It is used if audio has been\r\n * disabled in the game config or the device doesn't support any audio.\r\n *\r\n * It represents a graceful degradation of sound manager logic that provides\r\n * minimal functionality and prevents Phaser projects that use audio from\r\n * breaking on devices that don't support any audio playback technologies.\r\n *\r\n * @class NoAudioSoundManager\r\n * @extends Phaser.Sound.BaseSoundManager\r\n * @memberof Phaser.Sound\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - Reference to the current game instance.\r\n */\r\nvar NoAudioSoundManager = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function NoAudioSoundManager (game)\r\n {\r\n EventEmitter.call(this);\r\n\r\n this.game = game;\r\n this.sounds = [];\r\n this.mute = false;\r\n this.volume = 1;\r\n this.rate = 1;\r\n this.detune = 0;\r\n this.pauseOnBlur = true;\r\n this.locked = false;\r\n },\r\n\r\n add: function (key, config)\r\n {\r\n var sound = new NoAudioSound(this, key, config);\r\n\r\n this.sounds.push(sound);\r\n\r\n return sound;\r\n },\r\n\r\n addAudioSprite: function (key, config)\r\n {\r\n var sound = this.add(key, config);\r\n\r\n sound.spritemap = {};\r\n\r\n return sound;\r\n },\r\n\r\n // eslint-disable-next-line no-unused-vars\r\n play: function (key, extra)\r\n {\r\n return false;\r\n },\r\n\r\n // eslint-disable-next-line no-unused-vars\r\n playAudioSprite: function (key, spriteName, config)\r\n {\r\n return false;\r\n },\r\n\r\n remove: function (sound)\r\n {\r\n return BaseSoundManager.prototype.remove.call(this, sound);\r\n },\r\n\r\n removeByKey: function (key)\r\n {\r\n return BaseSoundManager.prototype.removeByKey.call(this, key);\r\n },\r\n\r\n pauseAll: NOOP,\r\n resumeAll: NOOP,\r\n stopAll: NOOP,\r\n update: NOOP,\r\n setRate: NOOP,\r\n setDetune: NOOP,\r\n setMute: NOOP,\r\n setVolume: NOOP,\r\n\r\n forEachActiveSound: function (callbackfn, scope)\r\n {\r\n BaseSoundManager.prototype.forEachActiveSound.call(this, callbackfn, scope);\r\n },\r\n\r\n destroy: function ()\r\n {\r\n BaseSoundManager.prototype.destroy.call(this);\r\n }\r\n\r\n});\r\n\r\nmodule.exports = NoAudioSoundManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/noaudio/NoAudioSoundManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/webaudio/WebAudioSound.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/sound/webaudio/WebAudioSound.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Pavle Goloskokovic (http://prunegames.com)\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BaseSound = __webpack_require__(/*! ../BaseSound */ \"./node_modules/phaser/src/sound/BaseSound.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/sound/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * Web Audio API implementation of the sound.\r\n *\r\n * @class WebAudioSound\r\n * @extends Phaser.Sound.BaseSound\r\n * @memberof Phaser.Sound\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Sound.WebAudioSoundManager} manager - Reference to the current sound manager instance.\r\n * @param {string} key - Asset key for the sound.\r\n * @param {Phaser.Types.Sound.SoundConfig} [config={}] - An optional config object containing default sound settings.\r\n */\r\nvar WebAudioSound = new Class({\r\n\r\n Extends: BaseSound,\r\n\r\n initialize:\r\n\r\n function WebAudioSound (manager, key, config)\r\n {\r\n if (config === undefined) { config = {}; }\r\n\r\n /**\r\n * Audio buffer containing decoded data of the audio asset to be played.\r\n *\r\n * @name Phaser.Sound.WebAudioSound#audioBuffer\r\n * @type {AudioBuffer}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.audioBuffer = manager.game.cache.audio.get(key);\r\n\r\n if (!this.audioBuffer)\r\n {\r\n throw new Error('There is no audio asset with key \"' + key + '\" in the audio cache');\r\n }\r\n\r\n /**\r\n * A reference to an audio source node used for playing back audio from\r\n * audio data stored in Phaser.Sound.WebAudioSound#audioBuffer.\r\n *\r\n * @name Phaser.Sound.WebAudioSound#source\r\n * @type {AudioBufferSourceNode}\r\n * @private\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.source = null;\r\n\r\n /**\r\n * A reference to a second audio source used for gapless looped playback.\r\n *\r\n * @name Phaser.Sound.WebAudioSound#loopSource\r\n * @type {AudioBufferSourceNode}\r\n * @private\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.loopSource = null;\r\n\r\n /**\r\n * Gain node responsible for controlling this sound's muting.\r\n *\r\n * @name Phaser.Sound.WebAudioSound#muteNode\r\n * @type {GainNode}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.muteNode = manager.context.createGain();\r\n\r\n /**\r\n * Gain node responsible for controlling this sound's volume.\r\n *\r\n * @name Phaser.Sound.WebAudioSound#volumeNode\r\n * @type {GainNode}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.volumeNode = manager.context.createGain();\r\n\r\n /**\r\n * The time at which the sound should have started playback from the beginning.\r\n * Based on BaseAudioContext.currentTime value.\r\n *\r\n * @name Phaser.Sound.WebAudioSound#playTime\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.playTime = 0;\r\n\r\n /**\r\n * The time at which the sound source should have actually started playback.\r\n * Based on BaseAudioContext.currentTime value.\r\n *\r\n * @name Phaser.Sound.WebAudioSound#startTime\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.startTime = 0;\r\n\r\n /**\r\n * The time at which the sound loop source should actually start playback.\r\n * Based on BaseAudioContext.currentTime value.\r\n *\r\n * @name Phaser.Sound.WebAudioSound#loopTime\r\n * @type {number}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.loopTime = 0;\r\n\r\n /**\r\n * An array where we keep track of all rate updates during playback.\r\n * Array of object types: { time: number, rate: number }\r\n *\r\n * @name Phaser.Sound.WebAudioSound#rateUpdates\r\n * @type {array}\r\n * @private\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.rateUpdates = [];\r\n\r\n /**\r\n * Used for keeping track when sound source playback has ended\r\n * so its state can be updated accordingly.\r\n *\r\n * @name Phaser.Sound.WebAudioSound#hasEnded\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.hasEnded = false;\r\n\r\n /**\r\n * Used for keeping track when sound source has looped\r\n * so its state can be updated accordingly.\r\n *\r\n * @name Phaser.Sound.WebAudioSound#hasLooped\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.hasLooped = false;\r\n\r\n this.muteNode.connect(this.volumeNode);\r\n\r\n this.volumeNode.connect(manager.destination);\r\n\r\n this.duration = this.audioBuffer.duration;\r\n\r\n this.totalDuration = this.audioBuffer.duration;\r\n\r\n BaseSound.call(this, manager, key, config);\r\n },\r\n\r\n /**\r\n * Play this sound, or a marked section of it.\r\n * \r\n * It always plays the sound from the start. If you want to start playback from a specific time\r\n * you can set 'seek' setting of the config object, provided to this call, to that value.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#play\r\n * @fires Phaser.Sound.Events#PLAY\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Sound.SoundConfig)} [markerName=''] - If you want to play a marker then provide the marker name here. Alternatively, this parameter can be a SoundConfig object.\r\n * @param {Phaser.Types.Sound.SoundConfig} [config] - Optional sound config object to be applied to this marker or entire sound if no marker name is provided. It gets memorized for future plays of current section of the sound.\r\n *\r\n * @return {boolean} Whether the sound started playing successfully.\r\n */\r\n play: function (markerName, config)\r\n {\r\n if (!BaseSound.prototype.play.call(this, markerName, config))\r\n {\r\n return false;\r\n }\r\n\r\n // \\/\\/\\/ isPlaying = true, isPaused = false \\/\\/\\/\r\n this.stopAndRemoveBufferSource();\r\n this.createAndStartBufferSource();\r\n\r\n this.emit(Events.PLAY, this);\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Pauses the sound.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#pause\r\n * @fires Phaser.Sound.Events#PAUSE\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} Whether the sound was paused successfully.\r\n */\r\n pause: function ()\r\n {\r\n if (this.manager.context.currentTime < this.startTime)\r\n {\r\n return false;\r\n }\r\n\r\n if (!BaseSound.prototype.pause.call(this))\r\n {\r\n return false;\r\n }\r\n\r\n // \\/\\/\\/ isPlaying = false, isPaused = true \\/\\/\\/\r\n this.currentConfig.seek = this.getCurrentTime(); // Equivalent to setting paused time\r\n this.stopAndRemoveBufferSource();\r\n\r\n this.emit(Events.PAUSE, this);\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Resumes the sound.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#resume\r\n * @fires Phaser.Sound.Events#RESUME\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} Whether the sound was resumed successfully.\r\n */\r\n resume: function ()\r\n {\r\n if (this.manager.context.currentTime < this.startTime)\r\n {\r\n return false;\r\n }\r\n\r\n if (!BaseSound.prototype.resume.call(this))\r\n {\r\n return false;\r\n }\r\n\r\n // \\/\\/\\/ isPlaying = true, isPaused = false \\/\\/\\/\r\n this.createAndStartBufferSource();\r\n\r\n this.emit(Events.RESUME, this);\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Stop playing this sound.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#stop\r\n * @fires Phaser.Sound.Events#STOP\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} Whether the sound was stopped successfully.\r\n */\r\n stop: function ()\r\n {\r\n if (!BaseSound.prototype.stop.call(this))\r\n {\r\n return false;\r\n }\r\n\r\n // \\/\\/\\/ isPlaying = false, isPaused = false \\/\\/\\/\r\n this.stopAndRemoveBufferSource();\r\n\r\n this.emit(Events.STOP, this);\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Used internally.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#createAndStartBufferSource\r\n * @private\r\n * @since 3.0.0\r\n */\r\n createAndStartBufferSource: function ()\r\n {\r\n var seek = this.currentConfig.seek;\r\n var delay = this.currentConfig.delay;\r\n var when = this.manager.context.currentTime + delay;\r\n var offset = (this.currentMarker ? this.currentMarker.start : 0) + seek;\r\n var duration = this.duration - seek;\r\n\r\n this.playTime = when - seek;\r\n this.startTime = when;\r\n this.source = this.createBufferSource();\r\n\r\n this.applyConfig();\r\n\r\n this.source.start(Math.max(0, when), Math.max(0, offset), Math.max(0, duration));\r\n\r\n this.resetConfig();\r\n },\r\n\r\n /**\r\n * Used internally.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#createAndStartLoopBufferSource\r\n * @private\r\n * @since 3.0.0\r\n */\r\n createAndStartLoopBufferSource: function ()\r\n {\r\n var when = this.getLoopTime();\r\n var offset = this.currentMarker ? this.currentMarker.start : 0;\r\n var duration = this.duration;\r\n\r\n this.loopTime = when;\r\n this.loopSource = this.createBufferSource();\r\n this.loopSource.playbackRate.setValueAtTime(this.totalRate, 0);\r\n this.loopSource.start(Math.max(0, when), Math.max(0, offset), Math.max(0, duration));\r\n },\r\n\r\n /**\r\n * Used internally.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#createBufferSource\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @return {AudioBufferSourceNode}\r\n */\r\n createBufferSource: function ()\r\n {\r\n var _this = this;\r\n var source = this.manager.context.createBufferSource();\r\n\r\n source.buffer = this.audioBuffer;\r\n\r\n source.connect(this.muteNode);\r\n\r\n source.onended = function (ev)\r\n {\r\n if (ev.target === _this.source)\r\n {\r\n // sound ended\r\n if (_this.currentConfig.loop)\r\n {\r\n _this.hasLooped = true;\r\n }\r\n else\r\n {\r\n _this.hasEnded = true;\r\n }\r\n }\r\n\r\n // else was stopped\r\n };\r\n\r\n return source;\r\n },\r\n\r\n /**\r\n * Used internally.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#stopAndRemoveBufferSource\r\n * @private\r\n * @since 3.0.0\r\n */\r\n stopAndRemoveBufferSource: function ()\r\n {\r\n if (this.source)\r\n {\r\n this.source.stop();\r\n this.source.disconnect();\r\n this.source = null;\r\n }\r\n\r\n this.playTime = 0;\r\n this.startTime = 0;\r\n\r\n this.stopAndRemoveLoopBufferSource();\r\n },\r\n\r\n /**\r\n * Used internally.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#stopAndRemoveLoopBufferSource\r\n * @private\r\n * @since 3.0.0\r\n */\r\n stopAndRemoveLoopBufferSource: function ()\r\n {\r\n if (this.loopSource)\r\n {\r\n this.loopSource.stop();\r\n this.loopSource.disconnect();\r\n this.loopSource = null;\r\n }\r\n\r\n this.loopTime = 0;\r\n },\r\n\r\n /**\r\n * Method used internally for applying config values to some of the sound properties.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#applyConfig\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n applyConfig: function ()\r\n {\r\n this.rateUpdates.length = 0;\r\n\r\n this.rateUpdates.push({\r\n time: 0,\r\n rate: 1\r\n });\r\n\r\n BaseSound.prototype.applyConfig.call(this);\r\n },\r\n\r\n /**\r\n * Update method called automatically by sound manager on every game step.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#update\r\n * @fires Phaser.Sound.Events#COMPLETE\r\n * @fires Phaser.Sound.Events#LOOPED\r\n * @protected\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.\r\n * @param {number} delta - The delta time elapsed since the last frame.\r\n */\r\n // eslint-disable-next-line no-unused-vars\r\n update: function (time, delta)\r\n {\r\n if (this.hasEnded)\r\n {\r\n this.hasEnded = false;\r\n\r\n BaseSound.prototype.stop.call(this);\r\n\r\n this.stopAndRemoveBufferSource();\r\n\r\n this.emit(Events.COMPLETE, this);\r\n }\r\n else if (this.hasLooped)\r\n {\r\n this.hasLooped = false;\r\n this.source = this.loopSource;\r\n this.loopSource = null;\r\n this.playTime = this.startTime = this.loopTime;\r\n this.rateUpdates.length = 0;\r\n\r\n this.rateUpdates.push({\r\n time: 0,\r\n rate: this.totalRate\r\n });\r\n\r\n this.createAndStartLoopBufferSource();\r\n\r\n this.emit(Events.LOOPED, this);\r\n }\r\n },\r\n\r\n /**\r\n * Calls Phaser.Sound.BaseSound#destroy method\r\n * and cleans up all Web Audio API related stuff.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n BaseSound.prototype.destroy.call(this);\r\n\r\n this.audioBuffer = null;\r\n this.stopAndRemoveBufferSource();\r\n this.muteNode.disconnect();\r\n this.muteNode = null;\r\n this.volumeNode.disconnect();\r\n this.volumeNode = null;\r\n this.rateUpdates.length = 0;\r\n this.rateUpdates = null;\r\n },\r\n\r\n /**\r\n * Method used internally to calculate total playback rate of the sound.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#calculateRate\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n calculateRate: function ()\r\n {\r\n BaseSound.prototype.calculateRate.call(this);\r\n\r\n var now = this.manager.context.currentTime;\r\n\r\n if (this.source && typeof this.totalRate === 'number')\r\n {\r\n this.source.playbackRate.setValueAtTime(this.totalRate, now);\r\n }\r\n\r\n if (this.isPlaying)\r\n {\r\n this.rateUpdates.push({\r\n time: Math.max(this.startTime, now) - this.playTime,\r\n rate: this.totalRate\r\n });\r\n\r\n if (this.loopSource)\r\n {\r\n this.stopAndRemoveLoopBufferSource();\r\n this.createAndStartLoopBufferSource();\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Method used internally for calculating current playback time of a playing sound.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#getCurrentTime\r\n * @private\r\n * @since 3.0.0\r\n */\r\n getCurrentTime: function ()\r\n {\r\n var currentTime = 0;\r\n\r\n for (var i = 0; i < this.rateUpdates.length; i++)\r\n {\r\n var nextTime = 0;\r\n\r\n if (i < this.rateUpdates.length - 1)\r\n {\r\n nextTime = this.rateUpdates[i + 1].time;\r\n }\r\n else\r\n {\r\n nextTime = this.manager.context.currentTime - this.playTime;\r\n }\r\n\r\n currentTime += (nextTime - this.rateUpdates[i].time) * this.rateUpdates[i].rate;\r\n }\r\n\r\n return currentTime;\r\n },\r\n\r\n /**\r\n * Method used internally for calculating the time\r\n * at witch the loop source should start playing.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#getLoopTime\r\n * @private\r\n * @since 3.0.0\r\n */\r\n getLoopTime: function ()\r\n {\r\n var lastRateUpdateCurrentTime = 0;\r\n\r\n for (var i = 0; i < this.rateUpdates.length - 1; i++)\r\n {\r\n lastRateUpdateCurrentTime += (this.rateUpdates[i + 1].time - this.rateUpdates[i].time) * this.rateUpdates[i].rate;\r\n }\r\n\r\n var lastRateUpdate = this.rateUpdates[this.rateUpdates.length - 1];\r\n\r\n return this.playTime + lastRateUpdate.time + (this.duration - lastRateUpdateCurrentTime) / lastRateUpdate.rate;\r\n },\r\n\r\n /**\r\n * Rate at which this Sound will be played.\r\n * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed\r\n * and 2.0 doubles the audios playback speed.\r\n *\r\n * @name Phaser.Sound.WebAudioSound#rate\r\n * @type {number}\r\n * @default 1\r\n * @fires Phaser.Sound.Events#RATE\r\n * @since 3.0.0\r\n */\r\n rate: {\r\n\r\n get: function ()\r\n {\r\n return this.currentConfig.rate;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.currentConfig.rate = value;\r\n\r\n this.calculateRate();\r\n\r\n this.emit(Events.RATE, this, value);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the playback rate of this Sound.\r\n * \r\n * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed\r\n * and 2.0 doubles the audios playback speed.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#setRate\r\n * @fires Phaser.Sound.Events#RATE\r\n * @since 3.3.0\r\n *\r\n * @param {number} value - The playback rate at of this Sound.\r\n *\r\n * @return {Phaser.Sound.WebAudioSound} This Sound.\r\n */\r\n setRate: function (value)\r\n {\r\n this.rate = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29).\r\n * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent).\r\n *\r\n * @name Phaser.Sound.WebAudioSound#detune\r\n * @type {number}\r\n * @default 0\r\n * @fires Phaser.Sound.Events#DETUNE\r\n * @since 3.0.0\r\n */\r\n detune: {\r\n\r\n get: function ()\r\n {\r\n return this.currentConfig.detune;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.currentConfig.detune = value;\r\n\r\n this.calculateRate();\r\n\r\n this.emit(Events.DETUNE, this, value);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29).\r\n * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent).\r\n *\r\n * @method Phaser.Sound.WebAudioSound#setDetune\r\n * @fires Phaser.Sound.Events#DETUNE\r\n * @since 3.3.0\r\n *\r\n * @param {number} value - The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent).\r\n *\r\n * @return {Phaser.Sound.WebAudioSound} This Sound.\r\n */\r\n setDetune: function (value)\r\n {\r\n this.detune = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Boolean indicating whether the sound is muted or not.\r\n * Gets or sets the muted state of this sound.\r\n * \r\n * @name Phaser.Sound.WebAudioSound#mute\r\n * @type {boolean}\r\n * @default false\r\n * @fires Phaser.Sound.Events#MUTE\r\n * @since 3.0.0\r\n */\r\n mute: {\r\n\r\n get: function ()\r\n {\r\n return (this.muteNode.gain.value === 0);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.currentConfig.mute = value;\r\n this.muteNode.gain.setValueAtTime(value ? 0 : 1, 0);\r\n\r\n this.emit(Events.MUTE, this, value);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the muted state of this Sound.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#setMute\r\n * @fires Phaser.Sound.Events#MUTE\r\n * @since 3.4.0\r\n *\r\n * @param {boolean} value - `true` to mute this sound, `false` to unmute it.\r\n *\r\n * @return {Phaser.Sound.WebAudioSound} This Sound instance.\r\n */\r\n setMute: function (value)\r\n {\r\n this.mute = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets or sets the volume of this sound, a value between 0 (silence) and 1 (full volume).\r\n * \r\n * @name Phaser.Sound.WebAudioSound#volume\r\n * @type {number}\r\n * @default 1\r\n * @fires Phaser.Sound.Events#VOLUME\r\n * @since 3.0.0\r\n */\r\n volume: {\r\n\r\n get: function ()\r\n {\r\n return this.volumeNode.gain.value;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.currentConfig.volume = value;\r\n this.volumeNode.gain.setValueAtTime(value, 0);\r\n\r\n this.emit(Events.VOLUME, this, value);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the volume of this Sound.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#setVolume\r\n * @fires Phaser.Sound.Events#VOLUME\r\n * @since 3.4.0\r\n *\r\n * @param {number} value - The volume of the sound.\r\n *\r\n * @return {Phaser.Sound.WebAudioSound} This Sound instance.\r\n */\r\n setVolume: function (value)\r\n {\r\n this.volume = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Property representing the position of playback for this sound, in seconds.\r\n * Setting it to a specific value moves current playback to that position.\r\n * The value given is clamped to the range 0 to current marker duration.\r\n * Setting seek of a stopped sound has no effect.\r\n * \r\n * @name Phaser.Sound.WebAudioSound#seek\r\n * @type {number}\r\n * @fires Phaser.Sound.Events#SEEK\r\n * @since 3.0.0\r\n */\r\n seek: {\r\n\r\n get: function ()\r\n {\r\n if (this.isPlaying)\r\n {\r\n if (this.manager.context.currentTime < this.startTime)\r\n {\r\n return this.startTime - this.playTime;\r\n }\r\n\r\n return this.getCurrentTime();\r\n }\r\n else if (this.isPaused)\r\n {\r\n return this.currentConfig.seek;\r\n }\r\n else\r\n {\r\n return 0;\r\n }\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (this.manager.context.currentTime < this.startTime)\r\n {\r\n return;\r\n }\r\n\r\n if (this.isPlaying || this.isPaused)\r\n {\r\n value = Math.min(Math.max(0, value), this.duration);\r\n\r\n this.currentConfig.seek = value;\r\n\r\n if (this.isPlaying)\r\n {\r\n this.stopAndRemoveBufferSource();\r\n this.createAndStartBufferSource();\r\n }\r\n\r\n this.emit(Events.SEEK, this, value);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Seeks to a specific point in this sound.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#setSeek\r\n * @fires Phaser.Sound.Events#SEEK\r\n * @since 3.4.0\r\n *\r\n * @param {number} value - The point in the sound to seek to.\r\n *\r\n * @return {Phaser.Sound.WebAudioSound} This Sound instance.\r\n */\r\n setSeek: function (value)\r\n {\r\n this.seek = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Flag indicating whether or not the sound or current sound marker will loop.\r\n * \r\n * @name Phaser.Sound.WebAudioSound#loop\r\n * @type {boolean}\r\n * @default false\r\n * @fires Phaser.Sound.Events#LOOP\r\n * @since 3.0.0\r\n */\r\n loop: {\r\n\r\n get: function ()\r\n {\r\n return this.currentConfig.loop;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.currentConfig.loop = value;\r\n\r\n if (this.isPlaying)\r\n {\r\n this.stopAndRemoveLoopBufferSource();\r\n\r\n if (value)\r\n {\r\n this.createAndStartLoopBufferSource();\r\n }\r\n }\r\n\r\n this.emit(Events.LOOP, this, value);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the loop state of this Sound.\r\n *\r\n * @method Phaser.Sound.WebAudioSound#setLoop\r\n * @fires Phaser.Sound.Events#LOOP\r\n * @since 3.4.0\r\n *\r\n * @param {boolean} value - `true` to loop this sound, `false` to not loop it.\r\n *\r\n * @return {Phaser.Sound.WebAudioSound} This Sound instance.\r\n */\r\n setLoop: function (value)\r\n {\r\n this.loop = value;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = WebAudioSound;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/webaudio/WebAudioSound.js?"); /***/ }), /***/ "./node_modules/phaser/src/sound/webaudio/WebAudioSoundManager.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/sound/webaudio/WebAudioSoundManager.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @author Pavle Goloskokovic (http://prunegames.com)\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Base64ToArrayBuffer = __webpack_require__(/*! ../../utils/base64/Base64ToArrayBuffer */ \"./node_modules/phaser/src/utils/base64/Base64ToArrayBuffer.js\");\r\nvar BaseSoundManager = __webpack_require__(/*! ../BaseSoundManager */ \"./node_modules/phaser/src/sound/BaseSoundManager.js\");\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/sound/events/index.js\");\r\nvar WebAudioSound = __webpack_require__(/*! ./WebAudioSound */ \"./node_modules/phaser/src/sound/webaudio/WebAudioSound.js\");\r\n\r\n/**\r\n * @classdesc\r\n * Web Audio API implementation of the sound manager.\r\n *\r\n * @class WebAudioSoundManager\r\n * @extends Phaser.Sound.BaseSoundManager\r\n * @memberof Phaser.Sound\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - Reference to the current game instance.\r\n */\r\nvar WebAudioSoundManager = new Class({\r\n\r\n Extends: BaseSoundManager,\r\n\r\n initialize:\r\n\r\n function WebAudioSoundManager (game)\r\n {\r\n /**\r\n * The AudioContext being used for playback.\r\n *\r\n * @name Phaser.Sound.WebAudioSoundManager#context\r\n * @type {AudioContext}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.context = this.createAudioContext(game);\r\n\r\n /**\r\n * Gain node responsible for controlling global muting.\r\n *\r\n * @name Phaser.Sound.WebAudioSoundManager#masterMuteNode\r\n * @type {GainNode}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.masterMuteNode = this.context.createGain();\r\n\r\n /**\r\n * Gain node responsible for controlling global volume.\r\n *\r\n * @name Phaser.Sound.WebAudioSoundManager#masterVolumeNode\r\n * @type {GainNode}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.masterVolumeNode = this.context.createGain();\r\n\r\n this.masterMuteNode.connect(this.masterVolumeNode);\r\n\r\n this.masterVolumeNode.connect(this.context.destination);\r\n\r\n /**\r\n * Destination node for connecting individual sounds to.\r\n *\r\n * @name Phaser.Sound.WebAudioSoundManager#destination\r\n * @type {AudioNode}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.destination = this.masterMuteNode;\r\n\r\n this.locked = this.context.state === 'suspended' && ('ontouchstart' in window || 'onclick' in window);\r\n\r\n BaseSoundManager.call(this, game);\r\n\r\n if (this.locked)\r\n {\r\n this.unlock();\r\n }\r\n },\r\n\r\n /**\r\n * Method responsible for instantiating and returning AudioContext instance.\r\n * If an instance of an AudioContext class was provided through the game config,\r\n * that instance will be returned instead. This can come in handy if you are reloading\r\n * a Phaser game on a page that never properly refreshes (such as in an SPA project)\r\n * and you want to reuse already instantiated AudioContext.\r\n *\r\n * @method Phaser.Sound.WebAudioSoundManager#createAudioContext\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - Reference to the current game instance.\r\n *\r\n * @return {AudioContext} The AudioContext instance to be used for playback.\r\n */\r\n createAudioContext: function (game)\r\n {\r\n var audioConfig = game.config.audio;\r\n\r\n if (audioConfig && audioConfig.context)\r\n {\r\n audioConfig.context.resume();\r\n\r\n return audioConfig.context;\r\n }\r\n\r\n return new AudioContext();\r\n },\r\n\r\n /**\r\n * This method takes a new AudioContext reference and then sets\r\n * this Sound Manager to use that context for all playback.\r\n * \r\n * As part of this call it also disconnects the master mute and volume\r\n * nodes and then re-creates them on the new given context.\r\n *\r\n * @method Phaser.Sound.WebAudioSoundManager#setAudioContext\r\n * @since 3.21.0\r\n *\r\n * @param {AudioContext} context - Reference to an already created AudioContext instance.\r\n *\r\n * @return {this} The WebAudioSoundManager instance.\r\n */\r\n setAudioContext: function (context)\r\n {\r\n if (this.context)\r\n {\r\n this.context.close();\r\n }\r\n\r\n if (this.masterMuteNode)\r\n {\r\n this.masterMuteNode.disconnect();\r\n }\r\n\r\n if (this.masterVolumeNode)\r\n {\r\n this.masterVolumeNode.disconnect();\r\n }\r\n\r\n this.context = context;\r\n\r\n this.masterMuteNode = context.createGain();\r\n this.masterVolumeNode = context.createGain();\r\n\r\n this.masterMuteNode.connect(this.masterVolumeNode);\r\n this.masterVolumeNode.connect(context.destination);\r\n\r\n this.destination = this.masterMuteNode;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds a new sound into the sound manager.\r\n *\r\n * @method Phaser.Sound.WebAudioSoundManager#add\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - Asset key for the sound.\r\n * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings.\r\n *\r\n * @return {Phaser.Sound.WebAudioSound} The new sound instance.\r\n */\r\n add: function (key, config)\r\n {\r\n var sound = new WebAudioSound(this, key, config);\r\n\r\n this.sounds.push(sound);\r\n\r\n return sound;\r\n },\r\n\r\n /**\r\n * Decode audio data into a format ready for playback via Web Audio.\r\n * \r\n * The audio data can be a base64 encoded string, an audio media-type data uri, or an ArrayBuffer instance.\r\n * \r\n * The `audioKey` is the key that will be used to save the decoded audio to the audio cache.\r\n * \r\n * Instead of passing a single entry you can instead pass an array of `Phaser.Types.Sound.DecodeAudioConfig`\r\n * objects as the first and only argument.\r\n * \r\n * Decoding is an async process, so be sure to listen for the events to know when decoding has completed.\r\n * \r\n * Once the audio has decoded it can be added to the Sound Manager or played via its key.\r\n *\r\n * @method Phaser.Sound.WebAudioSoundManager#decodeAudio\r\n * @fires Phaser.Sound.Events#DECODED\r\n * @fires Phaser.Sound.Events#DECODED_ALL\r\n * @since 3.18.0\r\n *\r\n * @param {(Phaser.Types.Sound.DecodeAudioConfig[]|string)} [audioKey] - The string-based key to be used to reference the decoded audio in the audio cache, or an array of audio config objects.\r\n * @param {(ArrayBuffer|string)} [audioData] - The audio data, either a base64 encoded string, an audio media-type data uri, or an ArrayBuffer instance.\r\n */\r\n decodeAudio: function (audioKey, audioData)\r\n {\r\n var audioFiles;\r\n\r\n if (!Array.isArray(audioKey))\r\n {\r\n audioFiles = [ { key: audioKey, data: audioData } ];\r\n }\r\n else\r\n {\r\n audioFiles = audioKey;\r\n }\r\n\r\n var cache = this.game.cache.audio;\r\n var remaining = audioFiles.length;\r\n\r\n for (var i = 0; i < audioFiles.length; i++)\r\n {\r\n var entry = audioFiles[i];\r\n\r\n var key = entry.key;\r\n var data = entry.data;\r\n\r\n if (typeof data === 'string')\r\n {\r\n data = Base64ToArrayBuffer(data);\r\n }\r\n\r\n var success = function (key, audioBuffer)\r\n {\r\n cache.add(key, audioBuffer);\r\n \r\n this.emit(Events.DECODED, key);\r\n\r\n remaining--;\r\n\r\n if (remaining === 0)\r\n {\r\n this.emit(Events.DECODED_ALL);\r\n }\r\n }.bind(this, key);\r\n \r\n var failure = function (key, error)\r\n {\r\n // eslint-disable-next-line no-console\r\n console.error('Error decoding audio: ' + key + ' - ', error ? error.message : '');\r\n\r\n remaining--;\r\n\r\n if (remaining === 0)\r\n {\r\n this.emit(Events.DECODED_ALL);\r\n }\r\n }.bind(this, key);\r\n\r\n this.context.decodeAudioData(data, success, failure);\r\n }\r\n },\r\n\r\n /**\r\n * Unlocks Web Audio API on the initial input event.\r\n *\r\n * Read more about how this issue is handled here in [this article](https://medium.com/@pgoloskokovic/unlocking-web-audio-the-smarter-way-8858218c0e09).\r\n *\r\n * @method Phaser.Sound.WebAudioSoundManager#unlock\r\n * @since 3.0.0\r\n */\r\n unlock: function ()\r\n {\r\n var _this = this;\r\n\r\n var body = document.body;\r\n\r\n var unlockHandler = function unlockHandler ()\r\n {\r\n if (_this.context)\r\n {\r\n _this.context.resume().then(function ()\r\n {\r\n body.removeEventListener('touchstart', unlockHandler);\r\n body.removeEventListener('touchend', unlockHandler);\r\n body.removeEventListener('click', unlockHandler);\r\n body.removeEventListener('keydown', unlockHandler);\r\n \r\n _this.unlocked = true;\r\n }, function ()\r\n {\r\n body.removeEventListener('touchstart', unlockHandler);\r\n body.removeEventListener('touchend', unlockHandler);\r\n body.removeEventListener('click', unlockHandler);\r\n body.removeEventListener('keydown', unlockHandler);\r\n });\r\n }\r\n };\r\n\r\n if (body)\r\n {\r\n body.addEventListener('touchstart', unlockHandler, false);\r\n body.addEventListener('touchend', unlockHandler, false);\r\n body.addEventListener('click', unlockHandler, false);\r\n body.addEventListener('keydown', unlockHandler, false);\r\n }\r\n },\r\n\r\n /**\r\n * Method used internally for pausing sound manager if\r\n * Phaser.Sound.WebAudioSoundManager#pauseOnBlur is set to true.\r\n *\r\n * @method Phaser.Sound.WebAudioSoundManager#onBlur\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n onBlur: function ()\r\n {\r\n if (!this.locked)\r\n {\r\n this.context.suspend();\r\n }\r\n },\r\n\r\n /**\r\n * Method used internally for resuming sound manager if\r\n * Phaser.Sound.WebAudioSoundManager#pauseOnBlur is set to true.\r\n *\r\n * @method Phaser.Sound.WebAudioSoundManager#onFocus\r\n * @protected\r\n * @since 3.0.0\r\n */\r\n onFocus: function ()\r\n {\r\n if (!this.locked)\r\n {\r\n this.context.resume();\r\n }\r\n },\r\n\r\n /**\r\n * Calls Phaser.Sound.BaseSoundManager#destroy method\r\n * and cleans up all Web Audio API related stuff.\r\n *\r\n * @method Phaser.Sound.WebAudioSoundManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.destination = null;\r\n this.masterVolumeNode.disconnect();\r\n this.masterVolumeNode = null;\r\n this.masterMuteNode.disconnect();\r\n this.masterMuteNode = null;\r\n\r\n if (this.game.config.audio && this.game.config.audio.context)\r\n {\r\n this.context.suspend();\r\n }\r\n else\r\n {\r\n var _this = this;\r\n\r\n this.context.close().then(function ()\r\n {\r\n _this.context = null;\r\n });\r\n }\r\n\r\n BaseSoundManager.prototype.destroy.call(this);\r\n },\r\n\r\n /**\r\n * Sets the muted state of all this Sound Manager.\r\n *\r\n * @method Phaser.Sound.WebAudioSoundManager#setMute\r\n * @fires Phaser.Sound.Events#GLOBAL_MUTE\r\n * @since 3.3.0\r\n *\r\n * @param {boolean} value - `true` to mute all sounds, `false` to unmute them.\r\n *\r\n * @return {Phaser.Sound.WebAudioSoundManager} This Sound Manager.\r\n */\r\n setMute: function (value)\r\n {\r\n this.mute = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * @name Phaser.Sound.WebAudioSoundManager#mute\r\n * @type {boolean}\r\n * @fires Phaser.Sound.Events#GLOBAL_MUTE\r\n * @since 3.0.0\r\n */\r\n mute: {\r\n\r\n get: function ()\r\n {\r\n return (this.masterMuteNode.gain.value === 0);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.masterMuteNode.gain.setValueAtTime(value ? 0 : 1, 0);\r\n\r\n this.emit(Events.GLOBAL_MUTE, this, value);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the volume of this Sound Manager.\r\n *\r\n * @method Phaser.Sound.WebAudioSoundManager#setVolume\r\n * @fires Phaser.Sound.Events#GLOBAL_VOLUME\r\n * @since 3.3.0\r\n *\r\n * @param {number} value - The global volume of this Sound Manager.\r\n *\r\n * @return {Phaser.Sound.WebAudioSoundManager} This Sound Manager.\r\n */\r\n setVolume: function (value)\r\n {\r\n this.volume = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * @name Phaser.Sound.WebAudioSoundManager#volume\r\n * @type {number}\r\n * @fires Phaser.Sound.Events#GLOBAL_VOLUME\r\n * @since 3.0.0\r\n */\r\n volume: {\r\n\r\n get: function ()\r\n {\r\n return this.masterVolumeNode.gain.value;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.masterVolumeNode.gain.setValueAtTime(value, 0);\r\n\r\n this.emit(Events.GLOBAL_VOLUME, this, value);\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = WebAudioSoundManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/sound/webaudio/WebAudioSoundManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/structs/List.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/structs/List.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ArrayUtils = __webpack_require__(/*! ../utils/array */ \"./node_modules/phaser/src/utils/array/index.js\");\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar NOOP = __webpack_require__(/*! ../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar StableSort = __webpack_require__(/*! ../utils/array/StableSort */ \"./node_modules/phaser/src/utils/array/StableSort.js\");\r\n\r\n/**\r\n * @callback EachListCallback\r\n *\r\n * @param {I} item - The item which is currently being processed.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * List is a generic implementation of an ordered list which contains utility methods for retrieving, manipulating, and iterating items.\r\n *\r\n * @class List\r\n * @memberof Phaser.Structs\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n *\r\n * @param {*} parent - The parent of this list.\r\n */\r\nvar List = new Class({\r\n\r\n initialize:\r\n\r\n function List (parent)\r\n {\r\n /**\r\n * The parent of this list.\r\n *\r\n * @name Phaser.Structs.List#parent\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.parent = parent;\r\n\r\n /**\r\n * The objects that belong to this collection.\r\n *\r\n * @genericUse {T[]} - [$type]\r\n *\r\n * @name Phaser.Structs.List#list\r\n * @type {Array.<*>}\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.list = [];\r\n\r\n /**\r\n * The index of the current element.\r\n * \r\n * This is used internally when iterating through the list with the {@link #first}, {@link #last}, {@link #get}, and {@link #previous} properties.\r\n *\r\n * @name Phaser.Structs.List#position\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.position = 0;\r\n\r\n /**\r\n * A callback that is invoked every time a child is added to this list.\r\n *\r\n * @name Phaser.Structs.List#addCallback\r\n * @type {function}\r\n * @since 3.4.0\r\n */\r\n this.addCallback = NOOP;\r\n\r\n /**\r\n * A callback that is invoked every time a child is removed from this list.\r\n *\r\n * @name Phaser.Structs.List#removeCallback\r\n * @type {function}\r\n * @since 3.4.0\r\n */\r\n this.removeCallback = NOOP;\r\n\r\n /**\r\n * The property key to sort by.\r\n *\r\n * @name Phaser.Structs.List#_sortKey\r\n * @type {string}\r\n * @since 3.4.0\r\n */\r\n this._sortKey = '';\r\n },\r\n\r\n /**\r\n * Adds the given item to the end of the list. Each item must be unique.\r\n *\r\n * @method Phaser.Structs.List#add\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [child,$return]\r\n *\r\n * @param {*|Array.<*>} child - The item, or array of items, to add to the list.\r\n * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully.\r\n *\r\n * @return {*} The list's underlying array.\r\n */\r\n add: function (child, skipCallback)\r\n {\r\n if (skipCallback)\r\n {\r\n return ArrayUtils.Add(this.list, child);\r\n }\r\n else\r\n {\r\n return ArrayUtils.Add(this.list, child, 0, this.addCallback, this);\r\n }\r\n },\r\n\r\n /**\r\n * Adds an item to list, starting at a specified index. Each item must be unique within the list.\r\n *\r\n * @method Phaser.Structs.List#addAt\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [child,$return]\r\n *\r\n * @param {*} child - The item, or array of items, to add to the list.\r\n * @param {integer} [index=0] - The index in the list at which the element(s) will be inserted.\r\n * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully.\r\n *\r\n * @return {*} The List's underlying array.\r\n */\r\n addAt: function (child, index, skipCallback)\r\n {\r\n if (skipCallback)\r\n {\r\n return ArrayUtils.AddAt(this.list, child, index);\r\n }\r\n else\r\n {\r\n return ArrayUtils.AddAt(this.list, child, index, 0, this.addCallback, this);\r\n }\r\n },\r\n\r\n /**\r\n * Retrieves the item at a given position inside the List.\r\n *\r\n * @method Phaser.Structs.List#getAt\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [$return]\r\n *\r\n * @param {integer} index - The index of the item.\r\n *\r\n * @return {*} The retrieved item, or `undefined` if it's outside the List's bounds.\r\n */\r\n getAt: function (index)\r\n {\r\n return this.list[index];\r\n },\r\n\r\n /**\r\n * Locates an item within the List and returns its index.\r\n *\r\n * @method Phaser.Structs.List#getIndex\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [child]\r\n *\r\n * @param {*} child - The item to locate.\r\n *\r\n * @return {integer} The index of the item within the List, or -1 if it's not in the List.\r\n */\r\n getIndex: function (child)\r\n {\r\n // Return -1 if given child isn't a child of this display list\r\n return this.list.indexOf(child);\r\n },\r\n\r\n /**\r\n * Sort the contents of this List so the items are in order based on the given property.\r\n * For example, `sort('alpha')` would sort the List contents based on the value of their `alpha` property.\r\n *\r\n * @method Phaser.Structs.List#sort\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T[]} - [children,$return]\r\n *\r\n * @param {string} property - The property to lexically sort by.\r\n * @param {function} [handler] - Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean.\r\n *\r\n * @return {Phaser.Structs.List} This List object.\r\n */\r\n sort: function (property, handler)\r\n {\r\n if (!property)\r\n {\r\n return this;\r\n }\r\n\r\n if (handler === undefined)\r\n {\r\n handler = function (childA, childB)\r\n {\r\n return childA[property] - childB[property];\r\n };\r\n }\r\n\r\n StableSort.inplace(this.list, handler);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Searches for the first instance of a child with its `name`\r\n * property matching the given argument. Should more than one child have\r\n * the same name only the first is returned.\r\n *\r\n * @method Phaser.Structs.List#getByName\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T | null} - [$return]\r\n *\r\n * @param {string} name - The name to search for.\r\n *\r\n * @return {?*} The first child with a matching name, or null if none were found.\r\n */\r\n getByName: function (name)\r\n {\r\n return ArrayUtils.GetFirst(this.list, 'name', name);\r\n },\r\n\r\n /**\r\n * Returns a random child from the group.\r\n *\r\n * @method Phaser.Structs.List#getRandom\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T | null} - [$return]\r\n *\r\n * @param {integer} [startIndex=0] - Offset from the front of the group (lowest child).\r\n * @param {integer} [length=(to top)] - Restriction on the number of values you want to randomly select from.\r\n *\r\n * @return {?*} A random child of this Group.\r\n */\r\n getRandom: function (startIndex, length)\r\n {\r\n return ArrayUtils.GetRandom(this.list, startIndex, length);\r\n },\r\n\r\n /**\r\n * Returns the first element in a given part of the List which matches a specific criterion.\r\n *\r\n * @method Phaser.Structs.List#getFirst\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T | null} - [$return]\r\n *\r\n * @param {string} property - The name of the property to test or a falsey value to have no criterion.\r\n * @param {*} value - The value to test the `property` against, or `undefined` to allow any value and only check for existence.\r\n * @param {number} [startIndex=0] - The position in the List to start the search at.\r\n * @param {number} [endIndex] - The position in the List to optionally stop the search at. It won't be checked.\r\n *\r\n * @return {?*} The first item which matches the given criterion, or `null` if no such item exists.\r\n */\r\n getFirst: function (property, value, startIndex, endIndex)\r\n {\r\n return ArrayUtils.GetFirst(this.list, property, value, startIndex, endIndex);\r\n },\r\n\r\n /**\r\n * Returns all children in this List.\r\n *\r\n * You can optionally specify a matching criteria using the `property` and `value` arguments.\r\n *\r\n * For example: `getAll('parent')` would return only children that have a property called `parent`.\r\n *\r\n * You can also specify a value to compare the property to:\r\n * \r\n * `getAll('visible', true)` would return only children that have their visible property set to `true`.\r\n *\r\n * Optionally you can specify a start and end index. For example if this List had 100 children,\r\n * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only\r\n * the first 50 children in the List.\r\n *\r\n * @method Phaser.Structs.List#getAll\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [value]\r\n * @genericUse {T[]} - [$return]\r\n *\r\n * @param {string} [property] - An optional property to test against the value argument.\r\n * @param {*} [value] - If property is set then Child.property must strictly equal this value to be included in the results.\r\n * @param {integer} [startIndex] - The first child index to start the search from.\r\n * @param {integer} [endIndex] - The last child index to search up until.\r\n *\r\n * @return {Array.<*>} All items of the List which match the given criterion, if any.\r\n */\r\n getAll: function (property, value, startIndex, endIndex)\r\n {\r\n return ArrayUtils.GetAll(this.list, property, value, startIndex, endIndex);\r\n },\r\n\r\n /**\r\n * Returns the total number of items in the List which have a property matching the given value.\r\n *\r\n * @method Phaser.Structs.List#count\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [value]\r\n *\r\n * @param {string} property - The property to test on each item.\r\n * @param {*} value - The value to test the property against.\r\n *\r\n * @return {integer} The total number of matching elements.\r\n */\r\n count: function (property, value)\r\n {\r\n return ArrayUtils.CountAllMatching(this.list, property, value);\r\n },\r\n\r\n /**\r\n * Swaps the positions of two items in the list.\r\n *\r\n * @method Phaser.Structs.List#swap\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [child1,child2]\r\n *\r\n * @param {*} child1 - The first item to swap.\r\n * @param {*} child2 - The second item to swap.\r\n */\r\n swap: function (child1, child2)\r\n {\r\n ArrayUtils.Swap(this.list, child1, child2);\r\n },\r\n\r\n /**\r\n * Moves an item in the List to a new position.\r\n *\r\n * @method Phaser.Structs.List#moveTo\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [child,$return]\r\n *\r\n * @param {*} child - The item to move.\r\n * @param {integer} index - Moves an item in the List to a new position.\r\n *\r\n * @return {*} The item that was moved.\r\n */\r\n moveTo: function (child, index)\r\n {\r\n return ArrayUtils.MoveTo(this.list, child, index);\r\n },\r\n\r\n /**\r\n * Removes one or many items from the List.\r\n *\r\n * @method Phaser.Structs.List#remove\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [child,$return]\r\n *\r\n * @param {*} child - The item, or array of items, to remove.\r\n * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback.\r\n *\r\n * @return {*} The item, or array of items, which were successfully removed from the List.\r\n */\r\n remove: function (child, skipCallback)\r\n {\r\n if (skipCallback)\r\n {\r\n return ArrayUtils.Remove(this.list, child);\r\n }\r\n else\r\n {\r\n return ArrayUtils.Remove(this.list, child, this.removeCallback, this);\r\n }\r\n },\r\n\r\n /**\r\n * Removes the item at the given position in the List.\r\n *\r\n * @method Phaser.Structs.List#removeAt\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [$return]\r\n *\r\n * @param {integer} index - The position to remove the item from.\r\n * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback.\r\n *\r\n * @return {*} The item that was removed.\r\n */\r\n removeAt: function (index, skipCallback)\r\n {\r\n if (skipCallback)\r\n {\r\n return ArrayUtils.RemoveAt(this.list, index);\r\n }\r\n else\r\n {\r\n return ArrayUtils.RemoveAt(this.list, index, this.removeCallback, this);\r\n }\r\n },\r\n\r\n /**\r\n * Removes the items within the given range in the List.\r\n *\r\n * @method Phaser.Structs.List#removeBetween\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T[]} - [$return]\r\n *\r\n * @param {integer} [startIndex=0] - The index to start removing from.\r\n * @param {integer} [endIndex] - The position to stop removing at. The item at this position won't be removed.\r\n * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback.\r\n *\r\n * @return {Array.<*>} An array of the items which were removed.\r\n */\r\n removeBetween: function (startIndex, endIndex, skipCallback)\r\n {\r\n if (skipCallback)\r\n {\r\n return ArrayUtils.RemoveBetween(this.list, startIndex, endIndex);\r\n }\r\n else\r\n {\r\n return ArrayUtils.RemoveBetween(this.list, startIndex, endIndex, this.removeCallback, this);\r\n }\r\n },\r\n\r\n /**\r\n * Removes all the items.\r\n *\r\n * @method Phaser.Structs.List#removeAll\r\n * @since 3.0.0\r\n *\r\n * @genericUse {Phaser.Structs.List.} - [$return]\r\n * \r\n * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback.\r\n *\r\n * @return {Phaser.Structs.List} This List object.\r\n */\r\n removeAll: function (skipCallback)\r\n {\r\n var i = this.list.length;\r\n\r\n while (i--)\r\n {\r\n this.remove(this.list[i], skipCallback);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Brings the given child to the top of this List.\r\n *\r\n * @method Phaser.Structs.List#bringToTop\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [child,$return]\r\n *\r\n * @param {*} child - The item to bring to the top of the List.\r\n *\r\n * @return {*} The item which was moved.\r\n */\r\n bringToTop: function (child)\r\n {\r\n return ArrayUtils.BringToTop(this.list, child);\r\n },\r\n\r\n /**\r\n * Sends the given child to the bottom of this List.\r\n *\r\n * @method Phaser.Structs.List#sendToBack\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [child,$return]\r\n *\r\n * @param {*} child - The item to send to the back of the list.\r\n *\r\n * @return {*} The item which was moved.\r\n */\r\n sendToBack: function (child)\r\n {\r\n return ArrayUtils.SendToBack(this.list, child);\r\n },\r\n\r\n /**\r\n * Moves the given child up one place in this group unless it's already at the top.\r\n *\r\n * @method Phaser.Structs.List#moveUp\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [child,$return]\r\n *\r\n * @param {*} child - The item to move up.\r\n *\r\n * @return {*} The item which was moved.\r\n */\r\n moveUp: function (child)\r\n {\r\n ArrayUtils.MoveUp(this.list, child);\r\n\r\n return child;\r\n },\r\n\r\n /**\r\n * Moves the given child down one place in this group unless it's already at the bottom.\r\n *\r\n * @method Phaser.Structs.List#moveDown\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [child,$return]\r\n *\r\n * @param {*} child - The item to move down.\r\n *\r\n * @return {*} The item which was moved.\r\n */\r\n moveDown: function (child)\r\n {\r\n ArrayUtils.MoveDown(this.list, child);\r\n\r\n return child;\r\n },\r\n\r\n /**\r\n * Reverses the order of all children in this List.\r\n *\r\n * @method Phaser.Structs.List#reverse\r\n * @since 3.0.0\r\n *\r\n * @genericUse {Phaser.Structs.List.} - [$return]\r\n *\r\n * @return {Phaser.Structs.List} This List object.\r\n */\r\n reverse: function ()\r\n {\r\n this.list.reverse();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Shuffles the items in the list.\r\n *\r\n * @method Phaser.Structs.List#shuffle\r\n * @since 3.0.0\r\n *\r\n * @genericUse {Phaser.Structs.List.} - [$return]\r\n *\r\n * @return {Phaser.Structs.List} This List object.\r\n */\r\n shuffle: function ()\r\n {\r\n ArrayUtils.Shuffle(this.list);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Replaces a child of this List with the given newChild. The newChild cannot be a member of this List.\r\n *\r\n * @method Phaser.Structs.List#replace\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [oldChild,newChild,$return]\r\n *\r\n * @param {*} oldChild - The child in this List that will be replaced.\r\n * @param {*} newChild - The child to be inserted into this List.\r\n *\r\n * @return {*} Returns the oldChild that was replaced within this group.\r\n */\r\n replace: function (oldChild, newChild)\r\n {\r\n return ArrayUtils.Replace(this.list, oldChild, newChild);\r\n },\r\n\r\n /**\r\n * Checks if an item exists within the List.\r\n *\r\n * @method Phaser.Structs.List#exists\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [child]\r\n *\r\n * @param {*} child - The item to check for the existence of.\r\n *\r\n * @return {boolean} `true` if the item is found in the list, otherwise `false`.\r\n */\r\n exists: function (child)\r\n {\r\n return (this.list.indexOf(child) > -1);\r\n },\r\n\r\n /**\r\n * Sets the property `key` to the given value on all members of this List.\r\n *\r\n * @method Phaser.Structs.List#setAll\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [value]\r\n *\r\n * @param {string} property - The name of the property to set.\r\n * @param {*} value - The value to set the property to.\r\n * @param {integer} [startIndex] - The first child index to start the search from.\r\n * @param {integer} [endIndex] - The last child index to search up until.\r\n */\r\n setAll: function (property, value, startIndex, endIndex)\r\n {\r\n ArrayUtils.SetAll(this.list, property, value, startIndex, endIndex);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Passes all children to the given callback.\r\n *\r\n * @method Phaser.Structs.List#each\r\n * @since 3.0.0\r\n *\r\n * @genericUse {EachListCallback.} - [callback]\r\n *\r\n * @param {EachListCallback} callback - The function to call.\r\n * @param {*} [context] - Value to use as `this` when executing callback.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\r\n */\r\n each: function (callback, context)\r\n {\r\n var args = [ null ];\r\n\r\n for (var i = 2; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (i = 0; i < this.list.length; i++)\r\n {\r\n args[0] = this.list[i];\r\n\r\n callback.apply(context, args);\r\n }\r\n },\r\n\r\n /**\r\n * Clears the List and recreates its internal array.\r\n *\r\n * @method Phaser.Structs.List#shutdown\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n this.removeAll();\r\n\r\n this.list = [];\r\n },\r\n\r\n /**\r\n * Destroys this List.\r\n *\r\n * @method Phaser.Structs.List#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.removeAll();\r\n\r\n this.parent = null;\r\n this.addCallback = null;\r\n this.removeCallback = null;\r\n },\r\n\r\n /**\r\n * The number of items inside the List.\r\n *\r\n * @name Phaser.Structs.List#length\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n length: {\r\n\r\n get: function ()\r\n {\r\n return this.list.length;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The first item in the List or `null` for an empty List.\r\n *\r\n * @name Phaser.Structs.List#first\r\n * @genericUse {T} - [$type]\r\n * @type {*}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n first: {\r\n\r\n get: function ()\r\n {\r\n this.position = 0;\r\n\r\n if (this.list.length > 0)\r\n {\r\n return this.list[0];\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The last item in the List, or `null` for an empty List.\r\n *\r\n * @name Phaser.Structs.List#last\r\n * @genericUse {T} - [$type]\r\n * @type {*}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n last: {\r\n\r\n get: function ()\r\n {\r\n if (this.list.length > 0)\r\n {\r\n this.position = this.list.length - 1;\r\n\r\n return this.list[this.position];\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The next item in the List, or `null` if the entire List has been traversed.\r\n * \r\n * This property can be read successively after reading {@link #first} or manually setting the {@link #position} to iterate the List.\r\n *\r\n * @name Phaser.Structs.List#next\r\n * @genericUse {T} - [$type]\r\n * @type {*}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n next: {\r\n\r\n get: function ()\r\n {\r\n if (this.position < this.list.length)\r\n {\r\n this.position++;\r\n\r\n return this.list[this.position];\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The previous item in the List, or `null` if the entire List has been traversed.\r\n * \r\n * This property can be read successively after reading {@link #last} or manually setting the {@link #position} to iterate the List backwards.\r\n *\r\n * @name Phaser.Structs.List#previous\r\n * @genericUse {T} - [$type]\r\n * @type {*}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n previous: {\r\n\r\n get: function ()\r\n {\r\n if (this.position > 0)\r\n {\r\n this.position--;\r\n\r\n return this.list[this.position];\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = List;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/structs/List.js?"); /***/ }), /***/ "./node_modules/phaser/src/structs/Map.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/structs/Map.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @callback EachMapCallback\r\n *\r\n * @param {string} key - The key of the Map entry.\r\n * @param {E} entry - The value of the Map entry.\r\n *\r\n * @return {?boolean} The callback result.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * The keys of a Map can be arbitrary values.\r\n * \r\n * ```javascript\r\n * var map = new Map([\r\n * [ 1, 'one' ],\r\n * [ 2, 'two' ],\r\n * [ 3, 'three' ]\r\n * ]);\r\n * ```\r\n *\r\n * @class Map\r\n * @memberof Phaser.Structs\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @generic K\r\n * @generic V\r\n * @genericUse {V[]} - [elements]\r\n *\r\n * @param {Array.<*>} elements - An optional array of key-value pairs to populate this Map with.\r\n */\r\nvar Map = new Class({\r\n\r\n initialize:\r\n\r\n function Map (elements)\r\n {\r\n /**\r\n * The entries in this Map.\r\n *\r\n * @genericUse {Object.} - [$type]\r\n *\r\n * @name Phaser.Structs.Map#entries\r\n * @type {Object.}\r\n * @default {}\r\n * @since 3.0.0\r\n */\r\n this.entries = {};\r\n\r\n /**\r\n * The number of key / value pairs in this Map.\r\n *\r\n * @name Phaser.Structs.Map#size\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.size = 0;\r\n\r\n if (Array.isArray(elements))\r\n {\r\n for (var i = 0; i < elements.length; i++)\r\n {\r\n this.set(elements[i][0], elements[i][1]);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Adds an element with a specified `key` and `value` to this Map.\r\n * If the `key` already exists, the value will be replaced.\r\n *\r\n * @method Phaser.Structs.Map#set\r\n * @since 3.0.0\r\n *\r\n * @genericUse {K} - [key]\r\n * @genericUse {V} - [value]\r\n * @genericUse {Phaser.Structs.Map.} - [$return]\r\n *\r\n * @param {string} key - The key of the element to be added to this Map.\r\n * @param {*} value - The value of the element to be added to this Map.\r\n *\r\n * @return {Phaser.Structs.Map} This Map object.\r\n */\r\n set: function (key, value)\r\n {\r\n if (!this.has(key))\r\n {\r\n this.size++;\r\n }\r\n\r\n this.entries[key] = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns the value associated to the `key`, or `undefined` if there is none.\r\n *\r\n * @method Phaser.Structs.Map#get\r\n * @since 3.0.0\r\n *\r\n * @genericUse {K} - [key]\r\n * @genericUse {V} - [$return]\r\n *\r\n * @param {string} key - The key of the element to return from the `Map` object.\r\n *\r\n * @return {*} The element associated with the specified key or `undefined` if the key can't be found in this Map object.\r\n */\r\n get: function (key)\r\n {\r\n if (this.has(key))\r\n {\r\n return this.entries[key];\r\n }\r\n },\r\n\r\n /**\r\n * Returns an `Array` of all the values stored in this Map.\r\n *\r\n * @method Phaser.Structs.Map#getArray\r\n * @since 3.0.0\r\n *\r\n * @genericUse {V[]} - [$return]\r\n *\r\n * @return {Array.<*>} An array of the values stored in this Map.\r\n */\r\n getArray: function ()\r\n {\r\n var output = [];\r\n var entries = this.entries;\r\n\r\n for (var key in entries)\r\n {\r\n output.push(entries[key]);\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns a boolean indicating whether an element with the specified key exists or not.\r\n *\r\n * @method Phaser.Structs.Map#has\r\n * @since 3.0.0\r\n *\r\n * @genericUse {K} - [key]\r\n *\r\n * @param {string} key - The key of the element to test for presence of in this Map.\r\n *\r\n * @return {boolean} Returns `true` if an element with the specified key exists in this Map, otherwise `false`.\r\n */\r\n has: function (key)\r\n {\r\n return (this.entries.hasOwnProperty(key));\r\n },\r\n\r\n /**\r\n * Delete the specified element from this Map.\r\n *\r\n * @method Phaser.Structs.Map#delete\r\n * @since 3.0.0\r\n *\r\n * @genericUse {K} - [key]\r\n * @genericUse {Phaser.Structs.Map.} - [$return]\r\n *\r\n * @param {string} key - The key of the element to delete from this Map.\r\n *\r\n * @return {Phaser.Structs.Map} This Map object.\r\n */\r\n delete: function (key)\r\n {\r\n if (this.has(key))\r\n {\r\n delete this.entries[key];\r\n this.size--;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Delete all entries from this Map.\r\n *\r\n * @method Phaser.Structs.Map#clear\r\n * @since 3.0.0\r\n *\r\n * @genericUse {Phaser.Structs.Map.} - [$return]\r\n *\r\n * @return {Phaser.Structs.Map} This Map object.\r\n */\r\n clear: function ()\r\n {\r\n Object.keys(this.entries).forEach(function (prop)\r\n {\r\n delete this.entries[prop];\r\n\r\n }, this);\r\n\r\n this.size = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns all entries keys in this Map.\r\n *\r\n * @method Phaser.Structs.Map#keys\r\n * @since 3.0.0\r\n *\r\n * @genericUse {K[]} - [$return]\r\n *\r\n * @return {string[]} Array containing entries' keys.\r\n */\r\n keys: function ()\r\n {\r\n return Object.keys(this.entries);\r\n },\r\n\r\n /**\r\n * Returns an `Array` of all entries.\r\n *\r\n * @method Phaser.Structs.Map#values\r\n * @since 3.0.0\r\n *\r\n * @genericUse {V[]} - [$return]\r\n *\r\n * @return {Array.<*>} An `Array` of entries.\r\n */\r\n values: function ()\r\n {\r\n var output = [];\r\n var entries = this.entries;\r\n\r\n for (var key in entries)\r\n {\r\n output.push(entries[key]);\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Dumps the contents of this Map to the console via `console.group`.\r\n *\r\n * @method Phaser.Structs.Map#dump\r\n * @since 3.0.0\r\n */\r\n dump: function ()\r\n {\r\n var entries = this.entries;\r\n\r\n // eslint-disable-next-line no-console\r\n console.group('Map');\r\n\r\n for (var key in entries)\r\n {\r\n console.log(key, entries[key]);\r\n }\r\n\r\n // eslint-disable-next-line no-console\r\n console.groupEnd();\r\n },\r\n\r\n /**\r\n * Passes all entries in this Map to the given callback.\r\n *\r\n * @method Phaser.Structs.Map#each\r\n * @since 3.0.0\r\n *\r\n * @genericUse {EachMapCallback.} - [callback]\r\n * @genericUse {Phaser.Structs.Map.} - [$return]\r\n *\r\n * @param {EachMapCallback} callback - The callback which will receive the keys and entries held in this Map.\r\n *\r\n * @return {Phaser.Structs.Map} This Map object.\r\n */\r\n each: function (callback)\r\n {\r\n var entries = this.entries;\r\n\r\n for (var key in entries)\r\n {\r\n if (callback(key, entries[key]) === false)\r\n {\r\n break;\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns `true` if the value exists within this Map. Otherwise, returns `false`.\r\n *\r\n * @method Phaser.Structs.Map#contains\r\n * @since 3.0.0\r\n *\r\n * @genericUse {V} - [value]\r\n *\r\n * @param {*} value - The value to search for.\r\n *\r\n * @return {boolean} `true` if the value is found, otherwise `false`.\r\n */\r\n contains: function (value)\r\n {\r\n var entries = this.entries;\r\n\r\n for (var key in entries)\r\n {\r\n if (entries[key] === value)\r\n {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Merges all new keys from the given Map into this one.\r\n * If it encounters a key that already exists it will be skipped unless override is set to `true`.\r\n *\r\n * @method Phaser.Structs.Map#merge\r\n * @since 3.0.0\r\n *\r\n * @genericUse {Phaser.Structs.Map.} - [map,$return]\r\n *\r\n * @param {Phaser.Structs.Map} map - The Map to merge in to this Map.\r\n * @param {boolean} [override=false] - Set to `true` to replace values in this Map with those from the source map, or `false` to skip them.\r\n *\r\n * @return {Phaser.Structs.Map} This Map object.\r\n */\r\n merge: function (map, override)\r\n {\r\n if (override === undefined) { override = false; }\r\n\r\n var local = this.entries;\r\n var source = map.entries;\r\n\r\n for (var key in source)\r\n {\r\n if (local.hasOwnProperty(key) && override)\r\n {\r\n local[key] = source[key];\r\n }\r\n else\r\n {\r\n this.set(key, source[key]);\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Map;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/structs/Map.js?"); /***/ }), /***/ "./node_modules/phaser/src/structs/ProcessQueue.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/structs/ProcessQueue.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/structs/events/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Process Queue maintains three internal lists.\r\n * \r\n * The `pending` list is a selection of items which are due to be made 'active' in the next update.\r\n * The `active` list is a selection of items which are considered active and should be updated.\r\n * The `destroy` list is a selection of items that were active and are awaiting being destroyed in the next update.\r\n *\r\n * When new items are added to a Process Queue they are put in the pending list, rather than being added\r\n * immediately the active list. Equally, items that are removed are put into the destroy list, rather than\r\n * being destroyed immediately. This allows the Process Queue to carefully process each item at a specific, fixed\r\n * time, rather than at the time of the request from the API.\r\n *\r\n * @class ProcessQueue\r\n * @extends Phaser.Events.EventEmitter\r\n * @memberof Phaser.Structs\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n */\r\nvar ProcessQueue = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function ProcessQueue ()\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * The `pending` list is a selection of items which are due to be made 'active' in the next update.\r\n *\r\n * @genericUse {T[]} - [$type]\r\n *\r\n * @name Phaser.Structs.ProcessQueue#_pending\r\n * @type {Array.<*>}\r\n * @private\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this._pending = [];\r\n\r\n /**\r\n * The `active` list is a selection of items which are considered active and should be updated.\r\n *\r\n * @genericUse {T[]} - [$type]\r\n *\r\n * @name Phaser.Structs.ProcessQueue#_active\r\n * @type {Array.<*>}\r\n * @private\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this._active = [];\r\n\r\n /**\r\n * The `destroy` list is a selection of items that were active and are awaiting being destroyed in the next update.\r\n *\r\n * @genericUse {T[]} - [$type]\r\n *\r\n * @name Phaser.Structs.ProcessQueue#_destroy\r\n * @type {Array.<*>}\r\n * @private\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this._destroy = [];\r\n\r\n /**\r\n * The total number of items awaiting processing.\r\n *\r\n * @name Phaser.Structs.ProcessQueue#_toProcess\r\n * @type {integer}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._toProcess = 0;\r\n },\r\n\r\n /**\r\n * Adds a new item to the Process Queue.\r\n * \r\n * The item is added to the pending list and made active in the next update.\r\n *\r\n * @method Phaser.Structs.ProcessQueue#add\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [item]\r\n * @genericUse {Phaser.Structs.ProcessQueue.} - [$return]\r\n *\r\n * @param {*} item - The item to add to the queue.\r\n *\r\n * @return {*} The item that was added.\r\n */\r\n add: function (item)\r\n {\r\n this._pending.push(item);\r\n\r\n this._toProcess++;\r\n\r\n return item;\r\n },\r\n\r\n /**\r\n * Removes an item from the Process Queue.\r\n * \r\n * The item is added to the pending destroy and fully removed in the next update.\r\n *\r\n * @method Phaser.Structs.ProcessQueue#remove\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [item]\r\n * @genericUse {Phaser.Structs.ProcessQueue.} - [$return]\r\n *\r\n * @param {*} item - The item to be removed from the queue.\r\n *\r\n * @return {*} The item that was removed.\r\n */\r\n remove: function (item)\r\n {\r\n this._destroy.push(item);\r\n\r\n this._toProcess++;\r\n\r\n return item;\r\n },\r\n\r\n /**\r\n * Removes all active items from this Process Queue.\r\n * \r\n * All the items are marked as 'pending destroy' and fully removed in the next update.\r\n *\r\n * @method Phaser.Structs.ProcessQueue#removeAll\r\n * @since 3.20.0\r\n *\r\n * @return {this} This Process Queue object.\r\n */\r\n removeAll: function ()\r\n {\r\n var list = this._active;\r\n var destroy = this._destroy;\r\n var i = list.length;\r\n\r\n while (i--)\r\n {\r\n destroy.push(list[i]);\r\n\r\n this._toProcess++;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Update this queue. First it will process any items awaiting destruction, and remove them.\r\n * \r\n * Then it will check to see if there are any items pending insertion, and move them to an\r\n * active state. Finally, it will return a list of active items for further processing.\r\n *\r\n * @method Phaser.Structs.ProcessQueue#update\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T[]} - [$return]\r\n *\r\n * @return {Array.<*>} A list of active items.\r\n */\r\n update: function ()\r\n {\r\n if (this._toProcess === 0)\r\n {\r\n // Quick bail\r\n return this._active;\r\n }\r\n\r\n var list = this._destroy;\r\n var active = this._active;\r\n var i;\r\n var item;\r\n\r\n // Clear the 'destroy' list\r\n for (i = 0; i < list.length; i++)\r\n {\r\n item = list[i];\r\n\r\n // Remove from the 'active' array\r\n var idx = active.indexOf(item);\r\n\r\n if (idx !== -1)\r\n {\r\n active.splice(idx, 1);\r\n\r\n this.emit(Events.REMOVE, item);\r\n }\r\n }\r\n\r\n list.length = 0;\r\n\r\n // Process the pending addition list\r\n // This stops callbacks and out of sync events from populating the active array mid-way during an update\r\n\r\n list = this._pending;\r\n\r\n for (i = 0; i < list.length; i++)\r\n {\r\n item = list[i];\r\n\r\n this._active.push(item);\r\n\r\n this.emit(Events.ADD, item);\r\n }\r\n\r\n list.length = 0;\r\n\r\n this._toProcess = 0;\r\n\r\n // The owner of this queue can now safely do whatever it needs to with the active list\r\n return this._active;\r\n },\r\n\r\n /**\r\n * Returns the current list of active items.\r\n * \r\n * This method returns a reference to the active list array, not a copy of it.\r\n * Therefore, be careful to not modify this array outside of the ProcessQueue.\r\n *\r\n * @method Phaser.Structs.ProcessQueue#getActive\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T[]} - [$return]\r\n *\r\n * @return {Array.<*>} A list of active items.\r\n */\r\n getActive: function ()\r\n {\r\n return this._active;\r\n },\r\n\r\n /**\r\n * The number of entries in the active list.\r\n *\r\n * @name Phaser.Structs.ProcessQueue#length\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.20.0\r\n */\r\n length: {\r\n\r\n get: function ()\r\n {\r\n return this._active.length;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Immediately destroys this process queue, clearing all of its internal arrays and resetting the process totals.\r\n *\r\n * @method Phaser.Structs.ProcessQueue#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this._toProcess = 0;\r\n\r\n this._pending = [];\r\n this._active = [];\r\n this._destroy = [];\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ProcessQueue;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/structs/ProcessQueue.js?"); /***/ }), /***/ "./node_modules/phaser/src/structs/RTree.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/structs/RTree.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Vladimir Agafonkin\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar quickselect = __webpack_require__(/*! ../utils/array/QuickSelect */ \"./node_modules/phaser/src/utils/array/QuickSelect.js\");\r\n\r\n/**\r\n * @classdesc\r\n * RBush is a high-performance JavaScript library for 2D spatial indexing of points and rectangles.\r\n * It's based on an optimized R-tree data structure with bulk insertion support.\r\n *\r\n * Spatial index is a special data structure for points and rectangles that allows you to perform queries like\r\n * \"all items within this bounding box\" very efficiently (e.g. hundreds of times faster than looping over all items).\r\n *\r\n * This version of RBush uses a fixed min/max accessor structure of `[ '.left', '.top', '.right', '.bottom' ]`.\r\n * This is to avoid the eval like function creation that the original library used, which caused CSP policy violations.\r\n * \r\n * rbush is forked from https://github.com/mourner/rbush by Vladimir Agafonkin\r\n *\r\n * @class RTree\r\n * @memberof Phaser.Structs\r\n * @constructor\r\n * @since 3.0.0\r\n */\r\n\r\nfunction rbush (maxEntries)\r\n{\r\n var format = [ '.left', '.top', '.right', '.bottom' ];\r\n\r\n if (!(this instanceof rbush)) return new rbush(maxEntries, format);\r\n\r\n // max entries in a node is 9 by default; min node fill is 40% for best performance\r\n this._maxEntries = Math.max(4, maxEntries || 9);\r\n this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));\r\n\r\n this.clear();\r\n}\r\n\r\nrbush.prototype = {\r\n\r\n all: function ()\r\n {\r\n return this._all(this.data, []);\r\n },\r\n\r\n search: function (bbox)\r\n {\r\n var node = this.data,\r\n result = [],\r\n toBBox = this.toBBox;\r\n\r\n if (!intersects(bbox, node)) return result;\r\n\r\n var nodesToSearch = [],\r\n i, len, child, childBBox;\r\n\r\n while (node) {\r\n for (i = 0, len = node.children.length; i < len; i++) {\r\n\r\n child = node.children[i];\r\n childBBox = node.leaf ? toBBox(child) : child;\r\n\r\n if (intersects(bbox, childBBox)) {\r\n if (node.leaf) result.push(child);\r\n else if (contains(bbox, childBBox)) this._all(child, result);\r\n else nodesToSearch.push(child);\r\n }\r\n }\r\n node = nodesToSearch.pop();\r\n }\r\n\r\n return result;\r\n },\r\n\r\n collides: function (bbox)\r\n {\r\n var node = this.data,\r\n toBBox = this.toBBox;\r\n\r\n if (!intersects(bbox, node)) return false;\r\n\r\n var nodesToSearch = [],\r\n i, len, child, childBBox;\r\n\r\n while (node) {\r\n for (i = 0, len = node.children.length; i < len; i++) {\r\n\r\n child = node.children[i];\r\n childBBox = node.leaf ? toBBox(child) : child;\r\n\r\n if (intersects(bbox, childBBox)) {\r\n if (node.leaf || contains(bbox, childBBox)) return true;\r\n nodesToSearch.push(child);\r\n }\r\n }\r\n node = nodesToSearch.pop();\r\n }\r\n\r\n return false;\r\n },\r\n\r\n load: function (data)\r\n {\r\n if (!(data && data.length)) return this;\r\n\r\n if (data.length < this._minEntries) {\r\n for (var i = 0, len = data.length; i < len; i++) {\r\n this.insert(data[i]);\r\n }\r\n return this;\r\n }\r\n\r\n // recursively build the tree with the given data from scratch using OMT algorithm\r\n var node = this._build(data.slice(), 0, data.length - 1, 0);\r\n\r\n if (!this.data.children.length) {\r\n // save as is if tree is empty\r\n this.data = node;\r\n\r\n } else if (this.data.height === node.height) {\r\n // split root if trees have the same height\r\n this._splitRoot(this.data, node);\r\n\r\n } else {\r\n if (this.data.height < node.height) {\r\n // swap trees if inserted one is bigger\r\n var tmpNode = this.data;\r\n this.data = node;\r\n node = tmpNode;\r\n }\r\n\r\n // insert the small tree into the large tree at appropriate level\r\n this._insert(node, this.data.height - node.height - 1, true);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n insert: function (item)\r\n {\r\n if (item) this._insert(item, this.data.height - 1);\r\n return this;\r\n },\r\n\r\n clear: function ()\r\n {\r\n this.data = createNode([]);\r\n return this;\r\n },\r\n\r\n remove: function (item, equalsFn)\r\n {\r\n if (!item) return this;\r\n\r\n var node = this.data,\r\n bbox = this.toBBox(item),\r\n path = [],\r\n indexes = [],\r\n i, parent, index, goingUp;\r\n\r\n // depth-first iterative tree traversal\r\n while (node || path.length) {\r\n\r\n if (!node) { // go up\r\n node = path.pop();\r\n parent = path[path.length - 1];\r\n i = indexes.pop();\r\n goingUp = true;\r\n }\r\n\r\n if (node.leaf) { // check current node\r\n index = findItem(item, node.children, equalsFn);\r\n\r\n if (index !== -1) {\r\n // item found, remove the item and condense tree upwards\r\n node.children.splice(index, 1);\r\n path.push(node);\r\n this._condense(path);\r\n return this;\r\n }\r\n }\r\n\r\n if (!goingUp && !node.leaf && contains(node, bbox)) { // go down\r\n path.push(node);\r\n indexes.push(i);\r\n i = 0;\r\n parent = node;\r\n node = node.children[0];\r\n\r\n } else if (parent) { // go right\r\n i++;\r\n node = parent.children[i];\r\n goingUp = false;\r\n\r\n } else node = null; // nothing found\r\n }\r\n\r\n return this;\r\n },\r\n\r\n toBBox: function (item) { return item; },\r\n\r\n compareMinX: compareNodeMinX,\r\n compareMinY: compareNodeMinY,\r\n\r\n toJSON: function () { return this.data; },\r\n\r\n fromJSON: function (data)\r\n {\r\n this.data = data;\r\n return this;\r\n },\r\n\r\n _all: function (node, result)\r\n {\r\n var nodesToSearch = [];\r\n while (node) {\r\n if (node.leaf) result.push.apply(result, node.children);\r\n else nodesToSearch.push.apply(nodesToSearch, node.children);\r\n\r\n node = nodesToSearch.pop();\r\n }\r\n return result;\r\n },\r\n\r\n _build: function (items, left, right, height)\r\n {\r\n var N = right - left + 1,\r\n M = this._maxEntries,\r\n node;\r\n\r\n if (N <= M) {\r\n // reached leaf level; return leaf\r\n node = createNode(items.slice(left, right + 1));\r\n calcBBox(node, this.toBBox);\r\n return node;\r\n }\r\n\r\n if (!height) {\r\n // target height of the bulk-loaded tree\r\n height = Math.ceil(Math.log(N) / Math.log(M));\r\n\r\n // target number of root entries to maximize storage utilization\r\n M = Math.ceil(N / Math.pow(M, height - 1));\r\n }\r\n\r\n node = createNode([]);\r\n node.leaf = false;\r\n node.height = height;\r\n\r\n // split the items into M mostly square tiles\r\n\r\n var N2 = Math.ceil(N / M),\r\n N1 = N2 * Math.ceil(Math.sqrt(M)),\r\n i, j, right2, right3;\r\n\r\n multiSelect(items, left, right, N1, this.compareMinX);\r\n\r\n for (i = left; i <= right; i += N1) {\r\n\r\n right2 = Math.min(i + N1 - 1, right);\r\n\r\n multiSelect(items, i, right2, N2, this.compareMinY);\r\n\r\n for (j = i; j <= right2; j += N2) {\r\n\r\n right3 = Math.min(j + N2 - 1, right2);\r\n\r\n // pack each entry recursively\r\n node.children.push(this._build(items, j, right3, height - 1));\r\n }\r\n }\r\n\r\n calcBBox(node, this.toBBox);\r\n\r\n return node;\r\n },\r\n\r\n _chooseSubtree: function (bbox, node, level, path)\r\n {\r\n var i, len, child, targetNode, area, enlargement, minArea, minEnlargement;\r\n\r\n while (true) {\r\n path.push(node);\r\n\r\n if (node.leaf || path.length - 1 === level) break;\r\n\r\n minArea = minEnlargement = Infinity;\r\n\r\n for (i = 0, len = node.children.length; i < len; i++) {\r\n child = node.children[i];\r\n area = bboxArea(child);\r\n enlargement = enlargedArea(bbox, child) - area;\r\n\r\n // choose entry with the least area enlargement\r\n if (enlargement < minEnlargement) {\r\n minEnlargement = enlargement;\r\n minArea = area < minArea ? area : minArea;\r\n targetNode = child;\r\n\r\n } else if (enlargement === minEnlargement) {\r\n // otherwise choose one with the smallest area\r\n if (area < minArea) {\r\n minArea = area;\r\n targetNode = child;\r\n }\r\n }\r\n }\r\n\r\n node = targetNode || node.children[0];\r\n }\r\n\r\n return node;\r\n },\r\n\r\n _insert: function (item, level, isNode)\r\n {\r\n var toBBox = this.toBBox,\r\n bbox = isNode ? item : toBBox(item),\r\n insertPath = [];\r\n\r\n // find the best node for accommodating the item, saving all nodes along the path too\r\n var node = this._chooseSubtree(bbox, this.data, level, insertPath);\r\n\r\n // put the item into the node\r\n node.children.push(item);\r\n extend(node, bbox);\r\n\r\n // split on node overflow; propagate upwards if necessary\r\n while (level >= 0) {\r\n if (insertPath[level].children.length > this._maxEntries) {\r\n this._split(insertPath, level);\r\n level--;\r\n } else break;\r\n }\r\n\r\n // adjust bboxes along the insertion path\r\n this._adjustParentBBoxes(bbox, insertPath, level);\r\n },\r\n\r\n // split overflowed node into two\r\n _split: function (insertPath, level)\r\n {\r\n var node = insertPath[level],\r\n M = node.children.length,\r\n m = this._minEntries;\r\n\r\n this._chooseSplitAxis(node, m, M);\r\n\r\n var splitIndex = this._chooseSplitIndex(node, m, M);\r\n\r\n var newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));\r\n newNode.height = node.height;\r\n newNode.leaf = node.leaf;\r\n\r\n calcBBox(node, this.toBBox);\r\n calcBBox(newNode, this.toBBox);\r\n\r\n if (level) insertPath[level - 1].children.push(newNode);\r\n else this._splitRoot(node, newNode);\r\n },\r\n\r\n _splitRoot: function (node, newNode)\r\n {\r\n // split root node\r\n this.data = createNode([node, newNode]);\r\n this.data.height = node.height + 1;\r\n this.data.leaf = false;\r\n calcBBox(this.data, this.toBBox);\r\n },\r\n\r\n _chooseSplitIndex: function (node, m, M)\r\n {\r\n var i, bbox1, bbox2, overlap, area, minOverlap, minArea, index;\r\n\r\n minOverlap = minArea = Infinity;\r\n\r\n for (i = m; i <= M - m; i++) {\r\n bbox1 = distBBox(node, 0, i, this.toBBox);\r\n bbox2 = distBBox(node, i, M, this.toBBox);\r\n\r\n overlap = intersectionArea(bbox1, bbox2);\r\n area = bboxArea(bbox1) + bboxArea(bbox2);\r\n\r\n // choose distribution with minimum overlap\r\n if (overlap < minOverlap) {\r\n minOverlap = overlap;\r\n index = i;\r\n\r\n minArea = area < minArea ? area : minArea;\r\n\r\n } else if (overlap === minOverlap) {\r\n // otherwise choose distribution with minimum area\r\n if (area < minArea) {\r\n minArea = area;\r\n index = i;\r\n }\r\n }\r\n }\r\n\r\n return index;\r\n },\r\n\r\n // sorts node children by the best axis for split\r\n _chooseSplitAxis: function (node, m, M)\r\n {\r\n var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX,\r\n compareMinY = node.leaf ? this.compareMinY : compareNodeMinY,\r\n xMargin = this._allDistMargin(node, m, M, compareMinX),\r\n yMargin = this._allDistMargin(node, m, M, compareMinY);\r\n\r\n // if total distributions margin value is minimal for x, sort by minX,\r\n // otherwise it's already sorted by minY\r\n if (xMargin < yMargin) node.children.sort(compareMinX);\r\n },\r\n\r\n // total margin of all possible split distributions where each node is at least m full\r\n _allDistMargin: function (node, m, M, compare)\r\n {\r\n node.children.sort(compare);\r\n\r\n var toBBox = this.toBBox,\r\n leftBBox = distBBox(node, 0, m, toBBox),\r\n rightBBox = distBBox(node, M - m, M, toBBox),\r\n margin = bboxMargin(leftBBox) + bboxMargin(rightBBox),\r\n i, child;\r\n\r\n for (i = m; i < M - m; i++) {\r\n child = node.children[i];\r\n extend(leftBBox, node.leaf ? toBBox(child) : child);\r\n margin += bboxMargin(leftBBox);\r\n }\r\n\r\n for (i = M - m - 1; i >= m; i--) {\r\n child = node.children[i];\r\n extend(rightBBox, node.leaf ? toBBox(child) : child);\r\n margin += bboxMargin(rightBBox);\r\n }\r\n\r\n return margin;\r\n },\r\n\r\n _adjustParentBBoxes: function (bbox, path, level)\r\n {\r\n // adjust bboxes along the given tree path\r\n for (var i = level; i >= 0; i--) {\r\n extend(path[i], bbox);\r\n }\r\n },\r\n\r\n _condense: function (path)\r\n {\r\n // go through the path, removing empty nodes and updating bboxes\r\n for (var i = path.length - 1, siblings; i >= 0; i--) {\r\n if (path[i].children.length === 0) {\r\n if (i > 0) {\r\n siblings = path[i - 1].children;\r\n siblings.splice(siblings.indexOf(path[i]), 1);\r\n\r\n } else this.clear();\r\n\r\n } else calcBBox(path[i], this.toBBox);\r\n }\r\n },\r\n\r\n compareMinX: function (a, b)\r\n {\r\n return a.left - b.left;\r\n },\r\n\r\n compareMinY: function (a, b)\r\n {\r\n return a.top - b.top;\r\n },\r\n\r\n toBBox: function (a)\r\n {\r\n return {\r\n minX: a.left,\r\n minY: a.top,\r\n maxX: a.right,\r\n maxY: a.bottom\r\n };\r\n }\r\n};\r\n\r\nfunction findItem (item, items, equalsFn)\r\n{\r\n if (!equalsFn) return items.indexOf(item);\r\n\r\n for (var i = 0; i < items.length; i++) {\r\n if (equalsFn(item, items[i])) return i;\r\n }\r\n return -1;\r\n}\r\n\r\n// calculate node's bbox from bboxes of its children\r\nfunction calcBBox (node, toBBox)\r\n{\r\n distBBox(node, 0, node.children.length, toBBox, node);\r\n}\r\n\r\n// min bounding rectangle of node children from k to p-1\r\nfunction distBBox (node, k, p, toBBox, destNode)\r\n{\r\n if (!destNode) destNode = createNode(null);\r\n destNode.minX = Infinity;\r\n destNode.minY = Infinity;\r\n destNode.maxX = -Infinity;\r\n destNode.maxY = -Infinity;\r\n\r\n for (var i = k, child; i < p; i++) {\r\n child = node.children[i];\r\n extend(destNode, node.leaf ? toBBox(child) : child);\r\n }\r\n\r\n return destNode;\r\n}\r\n\r\nfunction extend (a, b)\r\n{\r\n a.minX = Math.min(a.minX, b.minX);\r\n a.minY = Math.min(a.minY, b.minY);\r\n a.maxX = Math.max(a.maxX, b.maxX);\r\n a.maxY = Math.max(a.maxY, b.maxY);\r\n return a;\r\n}\r\n\r\nfunction compareNodeMinX (a, b) { return a.minX - b.minX; }\r\nfunction compareNodeMinY (a, b) { return a.minY - b.minY; }\r\n\r\nfunction bboxArea (a) { return (a.maxX - a.minX) * (a.maxY - a.minY); }\r\nfunction bboxMargin (a) { return (a.maxX - a.minX) + (a.maxY - a.minY); }\r\n\r\nfunction enlargedArea (a, b)\r\n{\r\n return (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) *\r\n (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY));\r\n}\r\n\r\nfunction intersectionArea (a, b)\r\n{\r\n var minX = Math.max(a.minX, b.minX),\r\n minY = Math.max(a.minY, b.minY),\r\n maxX = Math.min(a.maxX, b.maxX),\r\n maxY = Math.min(a.maxY, b.maxY);\r\n\r\n return Math.max(0, maxX - minX) *\r\n Math.max(0, maxY - minY);\r\n}\r\n\r\nfunction contains (a, b)\r\n{\r\n return a.minX <= b.minX &&\r\n a.minY <= b.minY &&\r\n b.maxX <= a.maxX &&\r\n b.maxY <= a.maxY;\r\n}\r\n\r\nfunction intersects (a, b)\r\n{\r\n return b.minX <= a.maxX &&\r\n b.minY <= a.maxY &&\r\n b.maxX >= a.minX &&\r\n b.maxY >= a.minY;\r\n}\r\n\r\nfunction createNode (children)\r\n{\r\n return {\r\n children: children,\r\n height: 1,\r\n leaf: true,\r\n minX: Infinity,\r\n minY: Infinity,\r\n maxX: -Infinity,\r\n maxY: -Infinity\r\n };\r\n}\r\n\r\n// sort an array so that items come in groups of n unsorted items, with groups sorted between each other;\r\n// combines selection algorithm with binary divide & conquer approach\r\n\r\nfunction multiSelect (arr, left, right, n, compare)\r\n{\r\n var stack = [left, right],\r\n mid;\r\n\r\n while (stack.length)\r\n {\r\n right = stack.pop();\r\n left = stack.pop();\r\n\r\n if (right - left <= n) continue;\r\n\r\n mid = left + Math.ceil((right - left) / n / 2) * n;\r\n quickselect(arr, mid, left, right, compare);\r\n\r\n stack.push(left, mid, mid, right);\r\n }\r\n}\r\n\r\nmodule.exports = rbush;\n\n//# sourceURL=webpack:///./node_modules/phaser/src/structs/RTree.js?"); /***/ }), /***/ "./node_modules/phaser/src/structs/Set.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/structs/Set.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @callback EachSetCallback\r\n *\r\n * @param {E} entry - The Set entry.\r\n * @param {number} index - The index of the entry within the Set.\r\n *\r\n * @return {?boolean} The callback result.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * A Set is a collection of unique elements.\r\n *\r\n * @class Set\r\n * @memberof Phaser.Structs\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[]} - [elements]\r\n *\r\n * @param {Array.<*>} [elements] - An optional array of elements to insert into this Set.\r\n */\r\nvar Set = new Class({\r\n\r\n initialize:\r\n\r\n function Set (elements)\r\n {\r\n /**\r\n * The entries of this Set. Stored internally as an array.\r\n *\r\n * @genericUse {T[]} - [$type]\r\n *\r\n * @name Phaser.Structs.Set#entries\r\n * @type {Array.<*>}\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.entries = [];\r\n\r\n if (Array.isArray(elements))\r\n {\r\n for (var i = 0; i < elements.length; i++)\r\n {\r\n this.set(elements[i]);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Inserts the provided value into this Set. If the value is already contained in this Set this method will have no effect.\r\n *\r\n * @method Phaser.Structs.Set#set\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [value]\r\n * @genericUse {Phaser.Structs.Set.} - [$return]\r\n *\r\n * @param {*} value - The value to insert into this Set.\r\n *\r\n * @return {Phaser.Structs.Set} This Set object.\r\n */\r\n set: function (value)\r\n {\r\n if (this.entries.indexOf(value) === -1)\r\n {\r\n this.entries.push(value);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Get an element of this Set which has a property of the specified name, if that property is equal to the specified value.\r\n * If no elements of this Set satisfy the condition then this method will return `null`.\r\n *\r\n * @method Phaser.Structs.Set#get\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [value,$return]\r\n *\r\n * @param {string} property - The property name to check on the elements of this Set.\r\n * @param {*} value - The value to check for.\r\n *\r\n * @return {*} The first element of this Set that meets the required condition, or `null` if this Set contains no elements that meet the condition.\r\n */\r\n get: function (property, value)\r\n {\r\n for (var i = 0; i < this.entries.length; i++)\r\n {\r\n var entry = this.entries[i];\r\n\r\n if (entry[property] === value)\r\n {\r\n return entry;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Returns an array containing all the values in this Set.\r\n *\r\n * @method Phaser.Structs.Set#getArray\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T[]} - [$return]\r\n *\r\n * @return {Array.<*>} An array containing all the values in this Set.\r\n */\r\n getArray: function ()\r\n {\r\n return this.entries.slice(0);\r\n },\r\n\r\n /**\r\n * Removes the given value from this Set if this Set contains that value.\r\n *\r\n * @method Phaser.Structs.Set#delete\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [value]\r\n * @genericUse {Phaser.Structs.Set.} - [$return]\r\n *\r\n * @param {*} value - The value to remove from the Set.\r\n *\r\n * @return {Phaser.Structs.Set} This Set object.\r\n */\r\n delete: function (value)\r\n {\r\n var index = this.entries.indexOf(value);\r\n\r\n if (index > -1)\r\n {\r\n this.entries.splice(index, 1);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Dumps the contents of this Set to the console via `console.group`.\r\n *\r\n * @method Phaser.Structs.Set#dump\r\n * @since 3.0.0\r\n */\r\n dump: function ()\r\n {\r\n // eslint-disable-next-line no-console\r\n console.group('Set');\r\n\r\n for (var i = 0; i < this.entries.length; i++)\r\n {\r\n var entry = this.entries[i];\r\n console.log(entry);\r\n }\r\n\r\n // eslint-disable-next-line no-console\r\n console.groupEnd();\r\n },\r\n\r\n /**\r\n * Passes each value in this Set to the given callback.\r\n * Use this function when you know this Set will be modified during the iteration, otherwise use `iterate`.\r\n *\r\n * @method Phaser.Structs.Set#each\r\n * @since 3.0.0\r\n *\r\n * @genericUse {EachSetCallback.} - [callback]\r\n * @genericUse {Phaser.Structs.Set.} - [$return]\r\n *\r\n * @param {EachSetCallback} callback - The callback to be invoked and passed each value this Set contains.\r\n * @param {*} [callbackScope] - The scope of the callback.\r\n *\r\n * @return {Phaser.Structs.Set} This Set object.\r\n */\r\n each: function (callback, callbackScope)\r\n {\r\n var i;\r\n var temp = this.entries.slice();\r\n var len = temp.length;\r\n\r\n if (callbackScope)\r\n {\r\n for (i = 0; i < len; i++)\r\n {\r\n if (callback.call(callbackScope, temp[i], i) === false)\r\n {\r\n break;\r\n }\r\n }\r\n }\r\n else\r\n {\r\n for (i = 0; i < len; i++)\r\n {\r\n if (callback(temp[i], i) === false)\r\n {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Passes each value in this Set to the given callback.\r\n * For when you absolutely know this Set won't be modified during the iteration.\r\n *\r\n * @method Phaser.Structs.Set#iterate\r\n * @since 3.0.0\r\n *\r\n * @genericUse {EachSetCallback.} - [callback]\r\n * @genericUse {Phaser.Structs.Set.} - [$return]\r\n *\r\n * @param {EachSetCallback} callback - The callback to be invoked and passed each value this Set contains.\r\n * @param {*} [callbackScope] - The scope of the callback.\r\n *\r\n * @return {Phaser.Structs.Set} This Set object.\r\n */\r\n iterate: function (callback, callbackScope)\r\n {\r\n var i;\r\n var len = this.entries.length;\r\n\r\n if (callbackScope)\r\n {\r\n for (i = 0; i < len; i++)\r\n {\r\n if (callback.call(callbackScope, this.entries[i], i) === false)\r\n {\r\n break;\r\n }\r\n }\r\n }\r\n else\r\n {\r\n for (i = 0; i < len; i++)\r\n {\r\n if (callback(this.entries[i], i) === false)\r\n {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Goes through each entry in this Set and invokes the given function on them, passing in the arguments.\r\n *\r\n * @method Phaser.Structs.Set#iterateLocal\r\n * @since 3.0.0\r\n *\r\n * @genericUse {Phaser.Structs.Set.} - [$return]\r\n *\r\n * @param {string} callbackKey - The key of the function to be invoked on each Set entry.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\r\n *\r\n * @return {Phaser.Structs.Set} This Set object.\r\n */\r\n iterateLocal: function (callbackKey)\r\n {\r\n var i;\r\n var args = [];\r\n\r\n for (i = 1; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n var len = this.entries.length;\r\n\r\n for (i = 0; i < len; i++)\r\n {\r\n var entry = this.entries[i];\r\n\r\n entry[callbackKey].apply(entry, args);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Clears this Set so that it no longer contains any values.\r\n *\r\n * @method Phaser.Structs.Set#clear\r\n * @since 3.0.0\r\n *\r\n * @genericUse {Phaser.Structs.Set.} - [$return]\r\n *\r\n * @return {Phaser.Structs.Set} This Set object.\r\n */\r\n clear: function ()\r\n {\r\n this.entries.length = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns `true` if this Set contains the given value, otherwise returns `false`.\r\n *\r\n * @method Phaser.Structs.Set#contains\r\n * @since 3.0.0\r\n *\r\n * @genericUse {T} - [value]\r\n *\r\n * @param {*} value - The value to check for in this Set.\r\n *\r\n * @return {boolean} `true` if the given value was found in this Set, otherwise `false`.\r\n */\r\n contains: function (value)\r\n {\r\n return (this.entries.indexOf(value) > -1);\r\n },\r\n\r\n /**\r\n * Returns a new Set containing all values that are either in this Set or in the Set provided as an argument.\r\n *\r\n * @method Phaser.Structs.Set#union\r\n * @since 3.0.0\r\n *\r\n * @genericUse {Phaser.Structs.Set.} - [set,$return]\r\n *\r\n * @param {Phaser.Structs.Set} set - The Set to perform the union with.\r\n *\r\n * @return {Phaser.Structs.Set} A new Set containing all the values in this Set and the Set provided as an argument.\r\n */\r\n union: function (set)\r\n {\r\n var newSet = new Set();\r\n\r\n set.entries.forEach(function (value)\r\n {\r\n newSet.set(value);\r\n });\r\n\r\n this.entries.forEach(function (value)\r\n {\r\n newSet.set(value);\r\n });\r\n\r\n return newSet;\r\n },\r\n\r\n /**\r\n * Returns a new Set that contains only the values which are in this Set and that are also in the given Set.\r\n *\r\n * @method Phaser.Structs.Set#intersect\r\n * @since 3.0.0\r\n *\r\n * @genericUse {Phaser.Structs.Set.} - [set,$return]\r\n *\r\n * @param {Phaser.Structs.Set} set - The Set to intersect this set with.\r\n *\r\n * @return {Phaser.Structs.Set} The result of the intersection, as a new Set.\r\n */\r\n intersect: function (set)\r\n {\r\n var newSet = new Set();\r\n\r\n this.entries.forEach(function (value)\r\n {\r\n if (set.contains(value))\r\n {\r\n newSet.set(value);\r\n }\r\n });\r\n\r\n return newSet;\r\n },\r\n\r\n /**\r\n * Returns a new Set containing all the values in this Set which are *not* also in the given Set.\r\n *\r\n * @method Phaser.Structs.Set#difference\r\n * @since 3.0.0\r\n *\r\n * @genericUse {Phaser.Structs.Set.} - [set,$return]\r\n *\r\n * @param {Phaser.Structs.Set} set - The Set to perform the difference with.\r\n *\r\n * @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.\r\n */\r\n difference: function (set)\r\n {\r\n var newSet = new Set();\r\n\r\n this.entries.forEach(function (value)\r\n {\r\n if (!set.contains(value))\r\n {\r\n newSet.set(value);\r\n }\r\n });\r\n\r\n return newSet;\r\n },\r\n\r\n /**\r\n * The size of this Set. This is the number of entries within it.\r\n * Changing the size will truncate the Set if the given value is smaller than the current size.\r\n * Increasing the size larger than the current size has no effect.\r\n *\r\n * @name Phaser.Structs.Set#size\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n size: {\r\n\r\n get: function ()\r\n {\r\n return this.entries.length;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (value < this.entries.length)\r\n {\r\n return this.entries.length = value;\r\n }\r\n else\r\n {\r\n return this.entries.length;\r\n }\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Set;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/structs/Set.js?"); /***/ }), /***/ "./node_modules/phaser/src/structs/Size.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/structs/Size.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = __webpack_require__(/*! ../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar SnapFloor = __webpack_require__(/*! ../math/snap/SnapFloor */ \"./node_modules/phaser/src/math/snap/SnapFloor.js\");\r\nvar Vector2 = __webpack_require__(/*! ../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Size component allows you to set `width` and `height` properties and define the relationship between them.\r\n * \r\n * The component can automatically maintain the aspect ratios between the two values, and clamp them\r\n * to a defined min-max range. You can also control the dominant axis. When dimensions are given to the Size component\r\n * that would cause it to exceed its min-max range, the dimensions are adjusted based on the dominant axis.\r\n *\r\n * @class Size\r\n * @memberof Phaser.Structs\r\n * @constructor\r\n * @since 3.16.0\r\n *\r\n * @param {number} [width=0] - The width of the Size component.\r\n * @param {number} [height=width] - The height of the Size component. If not given, it will use the `width`.\r\n * @param {integer} [aspectMode=0] - The aspect mode of the Size component. Defaults to 0, no mode.\r\n * @param {any} [parent=null] - The parent of this Size component. Can be any object with public `width` and `height` properties. Dimensions are clamped to keep them within the parent bounds where possible.\r\n */\r\nvar Size = new Class({\r\n\r\n initialize:\r\n\r\n function Size (width, height, aspectMode, parent)\r\n {\r\n if (width === undefined) { width = 0; }\r\n if (height === undefined) { height = width; }\r\n if (aspectMode === undefined) { aspectMode = 0; }\r\n if (parent === undefined) { parent = null; }\r\n\r\n /**\r\n * Internal width value.\r\n *\r\n * @name Phaser.Structs.Size#_width\r\n * @type {number}\r\n * @private\r\n * @since 3.16.0\r\n */\r\n this._width = width;\r\n\r\n /**\r\n * Internal height value.\r\n *\r\n * @name Phaser.Structs.Size#_height\r\n * @type {number}\r\n * @private\r\n * @since 3.16.0\r\n */\r\n this._height = height;\r\n\r\n /**\r\n * Internal parent reference.\r\n *\r\n * @name Phaser.Structs.Size#_parent\r\n * @type {any}\r\n * @private\r\n * @since 3.16.0\r\n */\r\n this._parent = parent;\r\n\r\n /**\r\n * The aspect mode this Size component will use when calculating its dimensions.\r\n * This property is read-only. To change it use the `setAspectMode` method.\r\n *\r\n * @name Phaser.Structs.Size#aspectMode\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n this.aspectMode = aspectMode;\r\n\r\n /**\r\n * The proportional relationship between the width and height.\r\n * \r\n * This property is read-only and is updated automatically when either the `width` or `height` properties are changed,\r\n * depending on the aspect mode.\r\n *\r\n * @name Phaser.Structs.Size#aspectRatio\r\n * @type {number}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n this.aspectRatio = (height === 0) ? 1 : width / height;\r\n\r\n /**\r\n * The minimum allowed width.\r\n * Cannot be less than zero.\r\n * This value is read-only. To change it see the `setMin` method.\r\n *\r\n * @name Phaser.Structs.Size#minWidth\r\n * @type {number}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n this.minWidth = 0;\r\n\r\n /**\r\n * The minimum allowed height.\r\n * Cannot be less than zero.\r\n * This value is read-only. To change it see the `setMin` method.\r\n *\r\n * @name Phaser.Structs.Size#minHeight\r\n * @type {number}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n this.minHeight = 0;\r\n\r\n /**\r\n * The maximum allowed width.\r\n * This value is read-only. To change it see the `setMax` method.\r\n *\r\n * @name Phaser.Structs.Size#maxWidth\r\n * @type {number}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n this.maxWidth = Number.MAX_VALUE;\r\n\r\n /**\r\n * The maximum allowed height.\r\n * This value is read-only. To change it see the `setMax` method.\r\n *\r\n * @name Phaser.Structs.Size#maxHeight\r\n * @type {number}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n this.maxHeight = Number.MAX_VALUE;\r\n\r\n /**\r\n * A Vector2 containing the horizontal and vertical snap values, which the width and height are snapped to during resizing.\r\n * \r\n * By default this is disabled.\r\n * \r\n * This property is read-only. To change it see the `setSnap` method.\r\n *\r\n * @name Phaser.Structs.Size#snapTo\r\n * @type {Phaser.Math.Vector2}\r\n * @readonly\r\n * @since 3.16.0\r\n */\r\n this.snapTo = new Vector2();\r\n },\r\n\r\n /**\r\n * Sets the aspect mode of this Size component.\r\n * \r\n * The aspect mode controls what happens when you modify the `width` or `height` properties, or call `setSize`.\r\n * \r\n * It can be a number from 0 to 4, or a Size constant:\r\n * \r\n * 0. NONE = Do not make the size fit the aspect ratio. Change the ratio when the size changes.\r\n * 1. WIDTH_CONTROLS_HEIGHT = The height is automatically adjusted based on the width.\r\n * 2. HEIGHT_CONTROLS_WIDTH = The width is automatically adjusted based on the height.\r\n * 3. FIT = The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered.\r\n * 4. ENVELOP = The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size.\r\n * \r\n * Calling this method automatically recalculates the `width` and the `height`, if required.\r\n * \r\n * @method Phaser.Structs.Size#setAspectMode\r\n * @since 3.16.0\r\n *\r\n * @param {integer} [value=0] - The aspect mode value.\r\n *\r\n * @return {this} This Size component instance.\r\n */\r\n setAspectMode: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.aspectMode = value;\r\n\r\n return this.setSize(this._width, this._height);\r\n },\r\n\r\n /**\r\n * By setting a Snap To value when this Size component is modified its dimensions will automatically\r\n * by snapped to the nearest grid slice, using floor. For example, if you have snap value of 16,\r\n * and the width changes to 68, then it will snap down to 64 (the closest multiple of 16 when floored)\r\n * \r\n * Note that snapping takes place before adjustments by the parent, or the min / max settings. If these\r\n * values are not multiples of the given snap values, then this can result in un-snapped dimensions.\r\n * \r\n * Call this method with no arguments to reset the snap values.\r\n * \r\n * Calling this method automatically recalculates the `width` and the `height`, if required.\r\n * \r\n * @method Phaser.Structs.Size#setSnap\r\n * @since 3.16.0\r\n *\r\n * @param {number} [snapWidth=0] - The amount to snap the width to. If you don't want to snap the width, pass a value of zero.\r\n * @param {number} [snapHeight=snapWidth] - The amount to snap the height to. If not provided it will use the `snapWidth` value. If you don't want to snap the height, pass a value of zero.\r\n *\r\n * @return {this} This Size component instance.\r\n */\r\n setSnap: function (snapWidth, snapHeight)\r\n {\r\n if (snapWidth === undefined) { snapWidth = 0; }\r\n if (snapHeight === undefined) { snapHeight = snapWidth; }\r\n\r\n this.snapTo.set(snapWidth, snapHeight);\r\n\r\n return this.setSize(this._width, this._height);\r\n },\r\n\r\n /**\r\n * Sets, or clears, the parent of this Size component.\r\n * \r\n * To clear the parent call this method with no arguments.\r\n * \r\n * The parent influences the maximum extents to which this Size component can expand,\r\n * based on the aspect mode:\r\n * \r\n * NONE - The parent clamps both the width and height.\r\n * WIDTH_CONTROLS_HEIGHT - The parent clamps just the width.\r\n * HEIGHT_CONTROLS_WIDTH - The parent clamps just the height.\r\n * FIT - The parent clamps whichever axis is required to ensure the size fits within it.\r\n * ENVELOP - The parent is used to ensure the size fully envelops the parent.\r\n * \r\n * Calling this method automatically calls `setSize`.\r\n *\r\n * @method Phaser.Structs.Size#setParent\r\n * @since 3.16.0\r\n *\r\n * @param {any} [parent] - Sets the parent of this Size component. Don't provide a value to clear an existing parent.\r\n *\r\n * @return {this} This Size component instance.\r\n */\r\n setParent: function (parent)\r\n {\r\n this._parent = parent;\r\n\r\n return this.setSize(this._width, this._height);\r\n },\r\n\r\n /**\r\n * Set the minimum width and height values this Size component will allow.\r\n * \r\n * The minimum values can never be below zero, or greater than the maximum values.\r\n * \r\n * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range.\r\n * \r\n * Note that based on the aspect mode, and if this Size component has a parent set or not, the minimums set here\r\n * _can_ be exceed in some situations.\r\n *\r\n * @method Phaser.Structs.Size#setMin\r\n * @since 3.16.0\r\n *\r\n * @param {number} [width=0] - The minimum allowed width of the Size component.\r\n * @param {number} [height=width] - The minimum allowed height of the Size component. If not given, it will use the `width`.\r\n *\r\n * @return {this} This Size component instance.\r\n */\r\n setMin: function (width, height)\r\n {\r\n if (width === undefined) { width = 0; }\r\n if (height === undefined) { height = width; }\r\n\r\n this.minWidth = Clamp(width, 0, this.maxWidth);\r\n this.minHeight = Clamp(height, 0, this.maxHeight);\r\n\r\n return this.setSize(this._width, this._height);\r\n },\r\n\r\n /**\r\n * Set the maximum width and height values this Size component will allow.\r\n * \r\n * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range.\r\n * \r\n * Note that based on the aspect mode, and if this Size component has a parent set or not, the maximums set here\r\n * _can_ be exceed in some situations.\r\n *\r\n * @method Phaser.Structs.Size#setMax\r\n * @since 3.16.0\r\n *\r\n * @param {number} [width=Number.MAX_VALUE] - The maximum allowed width of the Size component.\r\n * @param {number} [height=width] - The maximum allowed height of the Size component. If not given, it will use the `width`.\r\n *\r\n * @return {this} This Size component instance.\r\n */\r\n setMax: function (width, height)\r\n {\r\n if (width === undefined) { width = Number.MAX_VALUE; }\r\n if (height === undefined) { height = width; }\r\n\r\n this.maxWidth = Clamp(width, this.minWidth, Number.MAX_VALUE);\r\n this.maxHeight = Clamp(height, this.minHeight, Number.MAX_VALUE);\r\n\r\n return this.setSize(this._width, this._height);\r\n },\r\n\r\n /**\r\n * Sets the width and height of this Size component based on the aspect mode.\r\n * \r\n * If the aspect mode is 'none' then calling this method will change the aspect ratio, otherwise the current\r\n * aspect ratio is honored across all other modes.\r\n * \r\n * If snapTo values have been set then the given width and height are snapped first, prior to any further\r\n * adjustment via min/max values, or a parent.\r\n * \r\n * If minimum and/or maximum dimensions have been specified, the values given to this method will be clamped into\r\n * that range prior to adjustment, but may still exceed them depending on the aspect mode.\r\n * \r\n * If this Size component has a parent set, and the aspect mode is `fit` or `envelop`, then the given sizes will\r\n * be clamped to the range specified by the parent.\r\n *\r\n * @method Phaser.Structs.Size#setSize\r\n * @since 3.16.0\r\n *\r\n * @param {number} [width=0] - The new width of the Size component.\r\n * @param {number} [height=width] - The new height of the Size component. If not given, it will use the `width`.\r\n *\r\n * @return {this} This Size component instance.\r\n */\r\n setSize: function (width, height)\r\n {\r\n if (width === undefined) { width = 0; }\r\n if (height === undefined) { height = width; }\r\n \r\n switch (this.aspectMode)\r\n {\r\n case Size.NONE:\r\n this._width = this.getNewWidth(SnapFloor(width, this.snapTo.x));\r\n this._height = this.getNewHeight(SnapFloor(height, this.snapTo.y));\r\n this.aspectRatio = (this._height === 0) ? 1 : this._width / this._height;\r\n break;\r\n\r\n case Size.WIDTH_CONTROLS_HEIGHT:\r\n this._width = this.getNewWidth(SnapFloor(width, this.snapTo.x));\r\n this._height = this.getNewHeight(this._width * (1 / this.aspectRatio), false);\r\n break;\r\n\r\n case Size.HEIGHT_CONTROLS_WIDTH:\r\n this._height = this.getNewHeight(SnapFloor(height, this.snapTo.y));\r\n this._width = this.getNewWidth(this._height * this.aspectRatio, false);\r\n break;\r\n\r\n case Size.FIT:\r\n this.constrain(width, height, true);\r\n break;\r\n\r\n case Size.ENVELOP:\r\n this.constrain(width, height, false);\r\n break;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a new aspect ratio, overriding what was there previously.\r\n * \r\n * It then calls `setSize` immediately using the current dimensions.\r\n *\r\n * @method Phaser.Structs.Size#setAspectRatio\r\n * @since 3.16.0\r\n *\r\n * @param {number} ratio - The new aspect ratio.\r\n *\r\n * @return {this} This Size component instance.\r\n */\r\n setAspectRatio: function (ratio)\r\n {\r\n this.aspectRatio = ratio;\r\n\r\n return this.setSize(this._width, this._height);\r\n },\r\n\r\n /**\r\n * Sets a new width and height for this Size component and updates the aspect ratio based on them.\r\n * \r\n * It _doesn't_ change the `aspectMode` and still factors in size limits such as the min max and parent bounds.\r\n *\r\n * @method Phaser.Structs.Size#resize\r\n * @since 3.16.0\r\n *\r\n * @param {number} width - The new width of the Size component.\r\n * @param {number} [height=width] - The new height of the Size component. If not given, it will use the `width`.\r\n *\r\n * @return {this} This Size component instance.\r\n */\r\n resize: function (width, height)\r\n {\r\n this._width = this.getNewWidth(SnapFloor(width, this.snapTo.x));\r\n this._height = this.getNewHeight(SnapFloor(height, this.snapTo.y));\r\n this.aspectRatio = (this._height === 0) ? 1 : this._width / this._height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes a new width and passes it through the min/max clamp and then checks it doesn't exceed the parent width.\r\n *\r\n * @method Phaser.Structs.Size#getNewWidth\r\n * @since 3.16.0\r\n *\r\n * @param {number} value - The value to clamp and check.\r\n * @param {boolean} [checkParent=true] - Check the given value against the parent, if set.\r\n *\r\n * @return {number} The modified width value.\r\n */\r\n getNewWidth: function (value, checkParent)\r\n {\r\n if (checkParent === undefined) { checkParent = true; }\r\n \r\n value = Clamp(value, this.minWidth, this.maxWidth);\r\n\r\n if (checkParent && this._parent && value > this._parent.width)\r\n {\r\n value = Math.max(this.minWidth, this._parent.width);\r\n }\r\n\r\n return value;\r\n },\r\n\r\n /**\r\n * Takes a new height and passes it through the min/max clamp and then checks it doesn't exceed the parent height.\r\n *\r\n * @method Phaser.Structs.Size#getNewHeight\r\n * @since 3.16.0\r\n *\r\n * @param {number} value - The value to clamp and check.\r\n * @param {boolean} [checkParent=true] - Check the given value against the parent, if set.\r\n *\r\n * @return {number} The modified height value.\r\n */\r\n getNewHeight: function (value, checkParent)\r\n {\r\n if (checkParent === undefined) { checkParent = true; }\r\n\r\n value = Clamp(value, this.minHeight, this.maxHeight);\r\n\r\n if (checkParent && this._parent && value > this._parent.height)\r\n {\r\n value = Math.max(this.minHeight, this._parent.height);\r\n }\r\n\r\n return value;\r\n },\r\n\r\n /**\r\n * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio.\r\n * \r\n * If `fit` is true there may be some space inside the target area which is not covered if its aspect ratio differs.\r\n * If `fit` is false the size may extend further out than the target area if the aspect ratios differ.\r\n * \r\n * If this Size component has a parent set, then the width and height passed to this method will be clamped so\r\n * it cannot exceed that of the parent.\r\n *\r\n * @method Phaser.Structs.Size#constrain\r\n * @since 3.16.0\r\n *\r\n * @param {number} [width=0] - The new width of the Size component.\r\n * @param {number} [height] - The new height of the Size component. If not given, it will use the width value.\r\n * @param {boolean} [fit=true] - Perform a `fit` (true) constraint, or an `envelop` (false) constraint.\r\n *\r\n * @return {this} This Size component instance.\r\n */\r\n constrain: function (width, height, fit)\r\n {\r\n if (width === undefined) { width = 0; }\r\n if (height === undefined) { height = width; }\r\n if (fit === undefined) { fit = true; }\r\n\r\n width = this.getNewWidth(width);\r\n height = this.getNewHeight(height);\r\n\r\n var snap = this.snapTo;\r\n var newRatio = (height === 0) ? 1 : width / height;\r\n\r\n if ((fit && this.aspectRatio > newRatio) || (!fit && this.aspectRatio < newRatio))\r\n {\r\n // We need to change the height to fit the width\r\n\r\n width = SnapFloor(width, snap.x);\r\n\r\n height = width / this.aspectRatio;\r\n\r\n if (snap.y > 0)\r\n {\r\n height = SnapFloor(height, snap.y);\r\n\r\n // Reduce the width accordingly\r\n width = height * this.aspectRatio;\r\n }\r\n }\r\n else if ((fit && this.aspectRatio < newRatio) || (!fit && this.aspectRatio > newRatio))\r\n {\r\n // We need to change the width to fit the height\r\n\r\n height = SnapFloor(height, snap.y);\r\n\r\n width = height * this.aspectRatio;\r\n\r\n if (snap.x > 0)\r\n {\r\n width = SnapFloor(width, snap.x);\r\n\r\n // Reduce the height accordingly\r\n height = width * (1 / this.aspectRatio);\r\n }\r\n }\r\n\r\n this._width = width;\r\n this._height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio.\r\n * \r\n * There may be some space inside the target area which is not covered if its aspect ratio differs.\r\n * \r\n * If this Size component has a parent set, then the width and height passed to this method will be clamped so\r\n * it cannot exceed that of the parent.\r\n *\r\n * @method Phaser.Structs.Size#fitTo\r\n * @since 3.16.0\r\n *\r\n * @param {number} [width=0] - The new width of the Size component.\r\n * @param {number} [height] - The new height of the Size component. If not given, it will use the width value.\r\n *\r\n * @return {this} This Size component instance.\r\n */\r\n fitTo: function (width, height)\r\n {\r\n return this.constrain(width, height, true);\r\n },\r\n\r\n /**\r\n * The current `width` and `height` are adjusted so that they fully envelope the given dimensions, while keeping the aspect ratio.\r\n * \r\n * The size may extend further out than the target area if the aspect ratios differ.\r\n * \r\n * If this Size component has a parent set, then the values are clamped so that it never exceeds the parent\r\n * on the longest axis.\r\n *\r\n * @method Phaser.Structs.Size#envelop\r\n * @since 3.16.0\r\n *\r\n * @param {number} [width=0] - The new width of the Size component.\r\n * @param {number} [height] - The new height of the Size component. If not given, it will use the width value.\r\n *\r\n * @return {this} This Size component instance.\r\n */\r\n envelop: function (width, height)\r\n {\r\n return this.constrain(width, height, false);\r\n },\r\n\r\n /**\r\n * Sets the width of this Size component.\r\n * \r\n * Depending on the aspect mode, changing the width may also update the height and aspect ratio.\r\n *\r\n * @method Phaser.Structs.Size#setWidth\r\n * @since 3.16.0\r\n *\r\n * @param {number} width - The new width of the Size component.\r\n *\r\n * @return {this} This Size component instance.\r\n */\r\n setWidth: function (value)\r\n {\r\n return this.setSize(value, this._height);\r\n },\r\n\r\n /**\r\n * Sets the height of this Size component.\r\n * \r\n * Depending on the aspect mode, changing the height may also update the width and aspect ratio.\r\n *\r\n * @method Phaser.Structs.Size#setHeight\r\n * @since 3.16.0\r\n *\r\n * @param {number} height - The new height of the Size component.\r\n *\r\n * @return {this} This Size component instance.\r\n */\r\n setHeight: function (value)\r\n {\r\n return this.setSize(this._width, value);\r\n },\r\n\r\n /**\r\n * Returns a string representation of this Size component.\r\n *\r\n * @method Phaser.Structs.Size#toString\r\n * @since 3.16.0\r\n *\r\n * @return {string} A string representation of this Size component.\r\n */\r\n toString: function ()\r\n {\r\n return '[{ Size (width=' + this._width + ' height=' + this._height + ' aspectRatio=' + this.aspectRatio + ' aspectMode=' + this.aspectMode + ') }]';\r\n },\r\n\r\n /**\r\n * Sets the values of this Size component to the `element.style.width` and `height`\r\n * properties of the given DOM Element. The properties are set as `px` values.\r\n *\r\n * @method Phaser.Structs.Size#setCSS\r\n * @since 3.17.0\r\n *\r\n * @param {HTMLElement} element - The DOM Element to set the CSS style on.\r\n */\r\n setCSS: function (element)\r\n {\r\n if (element && element.style)\r\n {\r\n element.style.width = this._width + 'px';\r\n element.style.height = this._height + 'px';\r\n }\r\n },\r\n\r\n /**\r\n * Copies the aspect mode, aspect ratio, width and height from this Size component\r\n * to the given Size component. Note that the parent, if set, is not copied across.\r\n *\r\n * @method Phaser.Structs.Size#copy\r\n * @since 3.16.0\r\n * \r\n * @param {Phaser.Structs.Size} destination - The Size component to copy the values to.\r\n *\r\n * @return {Phaser.Structs.Size} The updated destination Size component.\r\n */\r\n copy: function (destination)\r\n {\r\n destination.setAspectMode(this.aspectMode);\r\n\r\n destination.aspectRatio = this.aspectRatio;\r\n\r\n return destination.setSize(this.width, this.height);\r\n },\r\n\r\n /**\r\n * Destroys this Size component.\r\n * \r\n * This clears the local properties and any parent object, if set.\r\n * \r\n * A destroyed Size component cannot be re-used.\r\n *\r\n * @method Phaser.Structs.Size#destroy\r\n * @since 3.16.0\r\n */\r\n destroy: function ()\r\n {\r\n this._parent = null;\r\n this.snapTo = null;\r\n },\r\n\r\n /**\r\n * The width of this Size component.\r\n * \r\n * This value is clamped to the range specified by `minWidth` and `maxWidth`, if enabled.\r\n * \r\n * A width can never be less than zero.\r\n * \r\n * Changing this value will automatically update the `height` if the aspect ratio lock is enabled.\r\n * You can also use the `setWidth` and `getWidth` methods.\r\n *\r\n * @name Phaser.Structs.Size#width\r\n * @type {number}\r\n * @since 3.16.0\r\n */\r\n width: {\r\n\r\n get: function ()\r\n {\r\n return this._width;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.setSize(value, this._height);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The height of this Size component.\r\n * \r\n * This value is clamped to the range specified by `minHeight` and `maxHeight`, if enabled.\r\n * \r\n * A height can never be less than zero.\r\n * \r\n * Changing this value will automatically update the `width` if the aspect ratio lock is enabled.\r\n * You can also use the `setHeight` and `getHeight` methods.\r\n *\r\n * @name Phaser.Structs.Size#height\r\n * @type {number}\r\n * @since 3.16.0\r\n */\r\n height: {\r\n\r\n get: function ()\r\n {\r\n return this._height;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.setSize(this._width, value);\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Do not make the size fit the aspect ratio. Change the ratio when the size changes.\r\n * \r\n * @name Phaser.Structs.Size.NONE\r\n * @constant\r\n * @type {integer}\r\n * @since 3.16.0\r\n */\r\nSize.NONE = 0;\r\n\r\n/**\r\n * The height is automatically adjusted based on the width.\r\n * \r\n * @name Phaser.Structs.Size.WIDTH_CONTROLS_HEIGHT\r\n * @constant\r\n * @type {integer}\r\n * @since 3.16.0\r\n */\r\nSize.WIDTH_CONTROLS_HEIGHT = 1;\r\n\r\n/**\r\n * The width is automatically adjusted based on the height.\r\n * \r\n * @name Phaser.Structs.Size.HEIGHT_CONTROLS_WIDTH\r\n * @constant\r\n * @type {integer}\r\n * @since 3.16.0\r\n */\r\nSize.HEIGHT_CONTROLS_WIDTH = 2;\r\n\r\n/**\r\n * The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered.\r\n * \r\n * @name Phaser.Structs.Size.FIT\r\n * @constant\r\n * @type {integer}\r\n * @since 3.16.0\r\n */\r\nSize.FIT = 3;\r\n\r\n/**\r\n * The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size.\r\n * \r\n * @name Phaser.Structs.Size.ENVELOP\r\n * @constant\r\n * @type {integer}\r\n * @since 3.16.0\r\n */\r\nSize.ENVELOP = 4;\r\n\r\nmodule.exports = Size;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/structs/Size.js?"); /***/ }), /***/ "./node_modules/phaser/src/structs/events/PROCESS_QUEUE_ADD_EVENT.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/structs/events/PROCESS_QUEUE_ADD_EVENT.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Process Queue Add Event.\r\n * \r\n * This event is dispatched by a Process Queue when a new item is successfully moved to its active list.\r\n * \r\n * You will most commonly see this used by a Scene's Update List when a new Game Object has been added.\r\n * \r\n * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('add', listener)`.\r\n *\r\n * @event Phaser.Structs.Events#PROCESS_QUEUE_ADD\r\n * @since 3.20.0\r\n * \r\n * @param {*} item - The item that was added to the Process Queue.\r\n */\r\nmodule.exports = 'add';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/structs/events/PROCESS_QUEUE_ADD_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/structs/events/PROCESS_QUEUE_REMOVE_EVENT.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/structs/events/PROCESS_QUEUE_REMOVE_EVENT.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Process Queue Remove Event.\r\n * \r\n * This event is dispatched by a Process Queue when a new item is successfully removed from its active list.\r\n * \r\n * You will most commonly see this used by a Scene's Update List when a Game Object has been removed.\r\n * \r\n * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('remove', listener)`.\r\n *\r\n * @event Phaser.Structs.Events#PROCESS_QUEUE_REMOVE\r\n * @since 3.20.0\r\n * \r\n * @param {*} item - The item that was removed from the Process Queue.\r\n */\r\nmodule.exports = 'remove';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/structs/events/PROCESS_QUEUE_REMOVE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/structs/events/index.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/structs/events/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Structs.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n PROCESS_QUEUE_ADD: __webpack_require__(/*! ./PROCESS_QUEUE_ADD_EVENT */ \"./node_modules/phaser/src/structs/events/PROCESS_QUEUE_ADD_EVENT.js\"),\r\n PROCESS_QUEUE_REMOVE: __webpack_require__(/*! ./PROCESS_QUEUE_REMOVE_EVENT */ \"./node_modules/phaser/src/structs/events/PROCESS_QUEUE_REMOVE_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/structs/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/structs/index.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/structs/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Structs\r\n */\r\n\r\nmodule.exports = {\r\n\r\n List: __webpack_require__(/*! ./List */ \"./node_modules/phaser/src/structs/List.js\"),\r\n Map: __webpack_require__(/*! ./Map */ \"./node_modules/phaser/src/structs/Map.js\"),\r\n ProcessQueue: __webpack_require__(/*! ./ProcessQueue */ \"./node_modules/phaser/src/structs/ProcessQueue.js\"),\r\n RTree: __webpack_require__(/*! ./RTree */ \"./node_modules/phaser/src/structs/RTree.js\"),\r\n Set: __webpack_require__(/*! ./Set */ \"./node_modules/phaser/src/structs/Set.js\"),\r\n Size: __webpack_require__(/*! ./Size */ \"./node_modules/phaser/src/structs/Size.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/structs/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/CanvasTexture.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/textures/CanvasTexture.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Clamp = __webpack_require__(/*! ../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\nvar Color = __webpack_require__(/*! ../display/color/Color */ \"./node_modules/phaser/src/display/color/Color.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/const.js\");\r\nvar IsSizePowerOfTwo = __webpack_require__(/*! ../math/pow2/IsSizePowerOfTwo */ \"./node_modules/phaser/src/math/pow2/IsSizePowerOfTwo.js\");\r\nvar Texture = __webpack_require__(/*! ./Texture */ \"./node_modules/phaser/src/textures/Texture.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Canvas Texture is a special kind of Texture that is backed by an HTML Canvas Element as its source.\r\n *\r\n * You can use the properties of this texture to draw to the canvas element directly, using all of the standard\r\n * canvas operations available in the browser. Any Game Object can be given this texture and will render with it.\r\n *\r\n * Note: When running under WebGL the Canvas Texture needs to re-generate its base WebGLTexture and reupload it to\r\n * the GPU every time you modify it, otherwise the changes you make to this texture will not be visible. To do this\r\n * you should call `CanvasTexture.refresh()` once you are finished with your changes to the canvas. Try and keep\r\n * this to a minimum, especially on large canvas sizes, or you may inadvertently thrash the GPU by constantly uploading\r\n * texture data to it. This restriction does not apply if using the Canvas Renderer.\r\n * \r\n * It starts with only one frame that covers the whole of the canvas. You can add further frames, that specify\r\n * sections of the canvas using the `add` method.\r\n * \r\n * Should you need to resize the canvas use the `setSize` method so that it accurately updates all of the underlying\r\n * texture data as well. Forgetting to do this (i.e. by changing the canvas size directly from your code) could cause\r\n * graphical errors.\r\n *\r\n * @class CanvasTexture\r\n * @extends Phaser.Textures.Texture\r\n * @memberof Phaser.Textures\r\n * @constructor\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Textures.TextureManager} manager - A reference to the Texture Manager this Texture belongs to.\r\n * @param {string} key - The unique string-based key of this Texture.\r\n * @param {HTMLCanvasElement} source - The canvas element that is used as the base of this texture.\r\n * @param {integer} width - The width of the canvas.\r\n * @param {integer} height - The height of the canvas.\r\n */\r\nvar CanvasTexture = new Class({\r\n\r\n Extends: Texture,\r\n\r\n initialize:\r\n\r\n function CanvasTexture (manager, key, source, width, height)\r\n {\r\n Texture.call(this, manager, key, source, width, height);\r\n\r\n this.add('__BASE', 0, 0, 0, width, height);\r\n\r\n /**\r\n * A reference to the Texture Source of this Canvas.\r\n *\r\n * @name Phaser.Textures.CanvasTexture#_source\r\n * @type {Phaser.Textures.TextureSource}\r\n * @private\r\n * @since 3.7.0\r\n */\r\n this._source = this.frames['__BASE'].source;\r\n\r\n /**\r\n * The source Canvas Element.\r\n *\r\n * @name Phaser.Textures.CanvasTexture#canvas\r\n * @readonly\r\n * @type {HTMLCanvasElement}\r\n * @since 3.7.0\r\n */\r\n this.canvas = this._source.image;\r\n\r\n /**\r\n * The 2D Canvas Rendering Context.\r\n *\r\n * @name Phaser.Textures.CanvasTexture#context\r\n * @readonly\r\n * @type {CanvasRenderingContext2D}\r\n * @since 3.7.0\r\n */\r\n this.context = this.canvas.getContext('2d');\r\n\r\n /**\r\n * The width of the Canvas.\r\n * This property is read-only, if you wish to change it use the `setSize` method.\r\n *\r\n * @name Phaser.Textures.CanvasTexture#width\r\n * @readonly\r\n * @type {integer}\r\n * @since 3.7.0\r\n */\r\n this.width = width;\r\n\r\n /**\r\n * The height of the Canvas.\r\n * This property is read-only, if you wish to change it use the `setSize` method.\r\n *\r\n * @name Phaser.Textures.CanvasTexture#height\r\n * @readonly\r\n * @type {integer}\r\n * @since 3.7.0\r\n */\r\n this.height = height;\r\n\r\n /**\r\n * The context image data.\r\n * Use the `update` method to populate this when the canvas changes.\r\n *\r\n * @name Phaser.Textures.CanvasTexture#imageData\r\n * @type {ImageData}\r\n * @since 3.13.0\r\n */\r\n this.imageData = this.context.getImageData(0, 0, width, height);\r\n\r\n /**\r\n * A Uint8ClampedArray view into the `buffer`.\r\n * Use the `update` method to populate this when the canvas changes.\r\n * Note that this is unavailable in some browsers, such as Epic Browser, due to their security restrictions.\r\n *\r\n * @name Phaser.Textures.CanvasTexture#data\r\n * @type {Uint8ClampedArray}\r\n * @since 3.13.0\r\n */\r\n this.data = null;\r\n\r\n if (this.imageData)\r\n {\r\n this.data = this.imageData.data;\r\n }\r\n\r\n /**\r\n * An Uint32Array view into the `buffer`.\r\n *\r\n * @name Phaser.Textures.CanvasTexture#pixels\r\n * @type {Uint32Array}\r\n * @since 3.13.0\r\n */\r\n this.pixels = null;\r\n\r\n /**\r\n * An ArrayBuffer the same size as the context ImageData.\r\n *\r\n * @name Phaser.Textures.CanvasTexture#buffer\r\n * @type {ArrayBuffer}\r\n * @since 3.13.0\r\n */\r\n this.buffer;\r\n\r\n if (this.data)\r\n {\r\n if (this.imageData.data.buffer)\r\n {\r\n this.buffer = this.imageData.data.buffer;\r\n this.pixels = new Uint32Array(this.buffer);\r\n }\r\n else if (window.ArrayBuffer)\r\n {\r\n this.buffer = new ArrayBuffer(this.imageData.data.length);\r\n this.pixels = new Uint32Array(this.buffer);\r\n }\r\n else\r\n {\r\n this.pixels = this.imageData.data;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * This re-creates the `imageData` from the current context.\r\n * It then re-builds the ArrayBuffer, the `data` Uint8ClampedArray reference and the `pixels` Int32Array.\r\n *\r\n * Warning: This is a very expensive operation, so use it sparingly.\r\n *\r\n * @method Phaser.Textures.CanvasTexture#update\r\n * @since 3.13.0\r\n *\r\n * @return {Phaser.Textures.CanvasTexture} This CanvasTexture.\r\n */\r\n update: function ()\r\n {\r\n this.imageData = this.context.getImageData(0, 0, this.width, this.height);\r\n\r\n this.data = this.imageData.data;\r\n\r\n if (this.imageData.data.buffer)\r\n {\r\n this.buffer = this.imageData.data.buffer;\r\n this.pixels = new Uint32Array(this.buffer);\r\n }\r\n else if (window.ArrayBuffer)\r\n {\r\n this.buffer = new ArrayBuffer(this.imageData.data.length);\r\n this.pixels = new Uint32Array(this.buffer);\r\n }\r\n else\r\n {\r\n this.pixels = this.imageData.data;\r\n }\r\n\r\n if (this.manager.game.config.renderType === CONST.WEBGL)\r\n {\r\n this.refresh();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Draws the given Image or Canvas element to this CanvasTexture, then updates the internal\r\n * ImageData buffer and arrays.\r\n *\r\n * @method Phaser.Textures.CanvasTexture#draw\r\n * @since 3.13.0\r\n * \r\n * @param {integer} x - The x coordinate to draw the source at.\r\n * @param {integer} y - The y coordinate to draw the source at.\r\n * @param {(HTMLImageElement|HTMLCanvasElement)} source - The element to draw to this canvas.\r\n * \r\n * @return {Phaser.Textures.CanvasTexture} This CanvasTexture.\r\n */\r\n draw: function (x, y, source)\r\n {\r\n this.context.drawImage(source, x, y);\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * Draws the given texture frame to this CanvasTexture, then updates the internal\r\n * ImageData buffer and arrays.\r\n *\r\n * @method Phaser.Textures.CanvasTexture#drawFrame\r\n * @since 3.16.0\r\n * \r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture.\r\n * @param {integer} [x=0] - The x coordinate to draw the source at.\r\n * @param {integer} [y=0] - The y coordinate to draw the source at.\r\n * \r\n * @return {Phaser.Textures.CanvasTexture} This CanvasTexture.\r\n */\r\n drawFrame: function (key, frame, x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n var textureFrame = this.manager.getFrame(key, frame);\r\n\r\n if (textureFrame)\r\n {\r\n var cd = textureFrame.canvasData;\r\n\r\n var width = textureFrame.cutWidth;\r\n var height = textureFrame.cutHeight;\r\n var res = textureFrame.source.resolution;\r\n\r\n this.context.drawImage(\r\n textureFrame.source.image,\r\n cd.x, cd.y,\r\n width,\r\n height,\r\n x, y,\r\n width / res,\r\n height / res\r\n );\r\n\r\n return this.update();\r\n }\r\n else\r\n {\r\n return this;\r\n }\r\n },\r\n\r\n /**\r\n * Sets a pixel in the CanvasTexture to the given color and alpha values.\r\n *\r\n * This is an expensive operation to run in large quantities, so use sparingly.\r\n *\r\n * @method Phaser.Textures.CanvasTexture#setPixel\r\n * @since 3.16.0\r\n * \r\n * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer.\r\n * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer.\r\n * @param {integer} red - The red color value. A number between 0 and 255.\r\n * @param {integer} green - The green color value. A number between 0 and 255.\r\n * @param {integer} blue - The blue color value. A number between 0 and 255.\r\n * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255.\r\n * \r\n * @return {this} This CanvasTexture.\r\n */\r\n setPixel: function (x, y, red, green, blue, alpha)\r\n {\r\n if (alpha === undefined) { alpha = 255; }\r\n\r\n x = Math.abs(Math.floor(x));\r\n y = Math.abs(Math.floor(y));\r\n\r\n var index = this.getIndex(x, y);\r\n\r\n if (index > -1)\r\n {\r\n var imageData = this.context.getImageData(x, y, 1, 1);\r\n\r\n imageData.data[0] = red;\r\n imageData.data[1] = green;\r\n imageData.data[2] = blue;\r\n imageData.data[3] = alpha;\r\n\r\n this.context.putImageData(imageData, x, y);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Puts the ImageData into the context of this CanvasTexture at the given coordinates.\r\n *\r\n * @method Phaser.Textures.CanvasTexture#putData\r\n * @since 3.16.0\r\n * \r\n * @param {ImageData} imageData - The ImageData to put at the given location.\r\n * @param {integer} x - The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer.\r\n * @param {integer} y - The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer.\r\n * @param {integer} [dirtyX=0] - Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted.\r\n * @param {integer} [dirtyY=0] - Vertical position (x coordinate) of the top-left corner from which the image data will be extracted.\r\n * @param {integer} [dirtyWidth] - Width of the rectangle to be painted. Defaults to the width of the image data.\r\n * @param {integer} [dirtyHeight] - Height of the rectangle to be painted. Defaults to the height of the image data.\r\n * \r\n * @return {this} This CanvasTexture.\r\n */\r\n putData: function (imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight)\r\n {\r\n if (dirtyX === undefined) { dirtyX = 0; }\r\n if (dirtyY === undefined) { dirtyY = 0; }\r\n if (dirtyWidth === undefined) { dirtyWidth = imageData.width; }\r\n if (dirtyHeight === undefined) { dirtyHeight = imageData.height; }\r\n\r\n this.context.putImageData(imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets an ImageData region from this CanvasTexture from the position and size specified.\r\n * You can write this back using `CanvasTexture.putData`, or manipulate it.\r\n *\r\n * @method Phaser.Textures.CanvasTexture#getData\r\n * @since 3.16.0\r\n * \r\n * @param {integer} x - The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer.\r\n * @param {integer} y - The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer.\r\n * @param {integer} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left.\r\n * @param {integer} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up.\r\n * \r\n * @return {ImageData} The ImageData extracted from this CanvasTexture.\r\n */\r\n getData: function (x, y, width, height)\r\n {\r\n x = Clamp(Math.floor(x), 0, this.width - 1);\r\n y = Clamp(Math.floor(y), 0, this.height - 1);\r\n width = Clamp(width, 1, this.width - x);\r\n height = Clamp(height, 1, this.height - y);\r\n\r\n var imageData = this.context.getImageData(x, y, width, height);\r\n\r\n return imageData;\r\n },\r\n\r\n /**\r\n * Get the color of a specific pixel from this texture and store it in a Color object.\r\n * \r\n * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer,\r\n * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist.\r\n *\r\n * @method Phaser.Textures.CanvasTexture#getPixel\r\n * @since 3.13.0\r\n * \r\n * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer.\r\n * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer.\r\n * @param {Phaser.Display.Color} [out] - A Color object to store the pixel values in. If not provided a new Color object will be created.\r\n * \r\n * @return {Phaser.Display.Color} An object with the red, green, blue and alpha values set in the r, g, b and a properties.\r\n */\r\n getPixel: function (x, y, out)\r\n {\r\n if (!out)\r\n {\r\n out = new Color();\r\n }\r\n\r\n var index = this.getIndex(x, y);\r\n\r\n if (index > -1)\r\n {\r\n var data = this.data;\r\n\r\n var r = data[index + 0];\r\n var g = data[index + 1];\r\n var b = data[index + 2];\r\n var a = data[index + 3];\r\n\r\n out.setTo(r, g, b, a);\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Returns an array containing all of the pixels in the given region.\r\n *\r\n * If the requested region extends outside the bounds of this CanvasTexture,\r\n * the region is truncated to fit.\r\n * \r\n * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer,\r\n * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist.\r\n *\r\n * @method Phaser.Textures.CanvasTexture#getPixels\r\n * @since 3.16.0\r\n * \r\n * @param {integer} [x=0] - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer.\r\n * @param {integer} [y=0] - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer.\r\n * @param {integer} [width] - The width of the region to get. Must be an integer. Defaults to the canvas width if not given.\r\n * @param {integer} [height] - The height of the region to get. Must be an integer. If not given will be set to the `width`.\r\n * \r\n * @return {Phaser.Types.Textures.PixelConfig[]} An array of Pixel objects.\r\n */\r\n getPixels: function (x, y, width, height)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = this.width; }\r\n if (height === undefined) { height = width; }\r\n\r\n x = Math.abs(Math.round(x));\r\n y = Math.abs(Math.round(y));\r\n\r\n var left = Clamp(x, 0, this.width);\r\n var right = Clamp(x + width, 0, this.width);\r\n var top = Clamp(y, 0, this.height);\r\n var bottom = Clamp(y + height, 0, this.height);\r\n\r\n var pixel = new Color();\r\n\r\n var out = [];\r\n\r\n for (var py = top; py < bottom; py++)\r\n {\r\n var row = [];\r\n\r\n for (var px = left; px < right; px++)\r\n {\r\n pixel = this.getPixel(px, py, pixel);\r\n\r\n row.push({ x: px, y: py, color: pixel.color, alpha: pixel.alphaGL });\r\n }\r\n\r\n out.push(row);\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Returns the Image Data index for the given pixel in this CanvasTexture.\r\n *\r\n * The index can be used to read directly from the `this.data` array.\r\n *\r\n * The index points to the red value in the array. The subsequent 3 indexes\r\n * point to green, blue and alpha respectively.\r\n *\r\n * @method Phaser.Textures.CanvasTexture#getIndex\r\n * @since 3.16.0\r\n * \r\n * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer.\r\n * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer.\r\n * \r\n * @return {integer} \r\n */\r\n getIndex: function (x, y)\r\n {\r\n x = Math.abs(Math.round(x));\r\n y = Math.abs(Math.round(y));\r\n\r\n if (x < this.width && y < this.height)\r\n {\r\n return (x + y * this.width) * 4;\r\n }\r\n else\r\n {\r\n return -1;\r\n }\r\n },\r\n\r\n /**\r\n * This should be called manually if you are running under WebGL.\r\n * It will refresh the WebGLTexture from the Canvas source. Only call this if you know that the\r\n * canvas has changed, as there is a significant GPU texture allocation cost involved in doing so.\r\n *\r\n * @method Phaser.Textures.CanvasTexture#refresh\r\n * @since 3.7.0\r\n *\r\n * @return {Phaser.Textures.CanvasTexture} This CanvasTexture.\r\n */\r\n refresh: function ()\r\n {\r\n this._source.update();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the Canvas Element.\r\n *\r\n * @method Phaser.Textures.CanvasTexture#getCanvas\r\n * @since 3.7.0\r\n *\r\n * @return {HTMLCanvasElement} The Canvas DOM element this texture is using.\r\n */\r\n getCanvas: function ()\r\n {\r\n return this.canvas;\r\n },\r\n\r\n /**\r\n * Gets the 2D Canvas Rendering Context.\r\n *\r\n * @method Phaser.Textures.CanvasTexture#getContext\r\n * @since 3.7.0\r\n *\r\n * @return {CanvasRenderingContext2D} The Canvas Rendering Context this texture is using.\r\n */\r\n getContext: function ()\r\n {\r\n return this.context;\r\n },\r\n\r\n /**\r\n * Clears the given region of this Canvas Texture, resetting it back to transparent.\r\n * If no region is given, the whole Canvas Texture is cleared.\r\n *\r\n * @method Phaser.Textures.CanvasTexture#clear\r\n * @since 3.7.0\r\n * \r\n * @param {integer} [x=0] - The x coordinate of the top-left of the region to clear.\r\n * @param {integer} [y=0] - The y coordinate of the top-left of the region to clear.\r\n * @param {integer} [width] - The width of the region.\r\n * @param {integer} [height] - The height of the region.\r\n *\r\n * @return {Phaser.Textures.CanvasTexture} The Canvas Texture.\r\n */\r\n clear: function (x, y, width, height)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = this.width; }\r\n if (height === undefined) { height = this.height; }\r\n\r\n this.context.clearRect(x, y, width, height);\r\n\r\n return this.update();\r\n },\r\n\r\n /**\r\n * Changes the size of this Canvas Texture.\r\n *\r\n * @method Phaser.Textures.CanvasTexture#setSize\r\n * @since 3.7.0\r\n *\r\n * @param {integer} width - The new width of the Canvas.\r\n * @param {integer} [height] - The new height of the Canvas. If not given it will use the width as the height.\r\n *\r\n * @return {Phaser.Textures.CanvasTexture} The Canvas Texture.\r\n */\r\n setSize: function (width, height)\r\n {\r\n if (height === undefined) { height = width; }\r\n\r\n if (width !== this.width || height !== this.height)\r\n {\r\n // Update the Canvas\r\n this.canvas.width = width;\r\n this.canvas.height = height;\r\n\r\n // Update the Texture Source\r\n this._source.width = width;\r\n this._source.height = height;\r\n this._source.isPowerOf2 = IsSizePowerOfTwo(width, height);\r\n\r\n // Update the Frame\r\n this.frames['__BASE'].setSize(width, height, 0, 0);\r\n\r\n this.refresh();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Destroys this Texture and releases references to its sources and frames.\r\n *\r\n * @method Phaser.Textures.CanvasTexture#destroy\r\n * @since 3.16.0\r\n */\r\n destroy: function ()\r\n {\r\n Texture.prototype.destroy.call(this);\r\n\r\n this._source = null;\r\n this.canvas = null;\r\n this.context = null;\r\n this.imageData = null;\r\n this.data = null;\r\n this.pixels = null;\r\n this.buffer = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = CanvasTexture;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/CanvasTexture.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/Frame.js": /*!***************************************************!*\ !*** ./node_modules/phaser/src/textures/Frame.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Clamp = __webpack_require__(/*! ../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\nvar Extend = __webpack_require__(/*! ../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Frame is a section of a Texture.\r\n *\r\n * @class Frame\r\n * @memberof Phaser.Textures\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.Texture} texture - The Texture this Frame is a part of.\r\n * @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture.\r\n * @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of.\r\n * @param {number} x - The x coordinate of the top-left of this Frame.\r\n * @param {number} y - The y coordinate of the top-left of this Frame.\r\n * @param {number} width - The width of this Frame.\r\n * @param {number} height - The height of this Frame.\r\n */\r\nvar Frame = new Class({\r\n\r\n initialize:\r\n\r\n function Frame (texture, name, sourceIndex, x, y, width, height)\r\n {\r\n /**\r\n * The Texture this Frame is a part of.\r\n *\r\n * @name Phaser.Textures.Frame#texture\r\n * @type {Phaser.Textures.Texture}\r\n * @since 3.0.0\r\n */\r\n this.texture = texture;\r\n\r\n /**\r\n * The name of this Frame.\r\n * The name is unique within the Texture.\r\n *\r\n * @name Phaser.Textures.Frame#name\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * The TextureSource this Frame is part of.\r\n *\r\n * @name Phaser.Textures.Frame#source\r\n * @type {Phaser.Textures.TextureSource}\r\n * @since 3.0.0\r\n */\r\n this.source = texture.source[sourceIndex];\r\n\r\n /**\r\n * The index of the TextureSource in the Texture sources array.\r\n *\r\n * @name Phaser.Textures.Frame#sourceIndex\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.sourceIndex = sourceIndex;\r\n\r\n /**\r\n * A reference to the Texture Source WebGL Texture that this Frame is using.\r\n *\r\n * @name Phaser.Textures.Frame#glTexture\r\n * @type {?WebGLTexture}\r\n * @default null\r\n * @since 3.11.0\r\n */\r\n this.glTexture = this.source.glTexture;\r\n\r\n /**\r\n * X position within the source image to cut from.\r\n *\r\n * @name Phaser.Textures.Frame#cutX\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.cutX;\r\n\r\n /**\r\n * Y position within the source image to cut from.\r\n *\r\n * @name Phaser.Textures.Frame#cutY\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.cutY;\r\n\r\n /**\r\n * The width of the area in the source image to cut.\r\n *\r\n * @name Phaser.Textures.Frame#cutWidth\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.cutWidth;\r\n\r\n /**\r\n * The height of the area in the source image to cut.\r\n *\r\n * @name Phaser.Textures.Frame#cutHeight\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.cutHeight;\r\n\r\n /**\r\n * The X rendering offset of this Frame, taking trim into account.\r\n *\r\n * @name Phaser.Textures.Frame#x\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The Y rendering offset of this Frame, taking trim into account.\r\n *\r\n * @name Phaser.Textures.Frame#y\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n /**\r\n * The rendering width of this Frame, taking trim into account.\r\n *\r\n * @name Phaser.Textures.Frame#width\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.width;\r\n\r\n /**\r\n * The rendering height of this Frame, taking trim into account.\r\n *\r\n * @name Phaser.Textures.Frame#height\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.height;\r\n\r\n /**\r\n * Half the width, floored.\r\n * Precalculated for the renderer.\r\n *\r\n * @name Phaser.Textures.Frame#halfWidth\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.halfWidth;\r\n\r\n /**\r\n * Half the height, floored.\r\n * Precalculated for the renderer.\r\n *\r\n * @name Phaser.Textures.Frame#halfHeight\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.halfHeight;\r\n\r\n /**\r\n * The x center of this frame, floored.\r\n *\r\n * @name Phaser.Textures.Frame#centerX\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.centerX;\r\n\r\n /**\r\n * The y center of this frame, floored.\r\n *\r\n * @name Phaser.Textures.Frame#centerY\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.centerY;\r\n\r\n /**\r\n * The horizontal pivot point of this Frame.\r\n *\r\n * @name Phaser.Textures.Frame#pivotX\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.pivotX = 0;\r\n\r\n /**\r\n * The vertical pivot point of this Frame.\r\n *\r\n * @name Phaser.Textures.Frame#pivotY\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.pivotY = 0;\r\n\r\n /**\r\n * Does this Frame have a custom pivot point?\r\n *\r\n * @name Phaser.Textures.Frame#customPivot\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.customPivot = false;\r\n\r\n /**\r\n * **CURRENTLY UNSUPPORTED**\r\n *\r\n * Is this frame is rotated or not in the Texture?\r\n * Rotation allows you to use rotated frames in texture atlas packing.\r\n * It has nothing to do with Sprite rotation.\r\n *\r\n * @name Phaser.Textures.Frame#rotated\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.rotated = false;\r\n\r\n /**\r\n * Over-rides the Renderer setting.\r\n * -1 = use Renderer Setting\r\n * 0 = No rounding\r\n * 1 = Round\r\n *\r\n * @name Phaser.Textures.Frame#autoRound\r\n * @type {integer}\r\n * @default -1\r\n * @since 3.0.0\r\n */\r\n this.autoRound = -1;\r\n\r\n /**\r\n * Any Frame specific custom data can be stored here.\r\n *\r\n * @name Phaser.Textures.Frame#customData\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.customData = {};\r\n\r\n /**\r\n * WebGL UV u0 value.\r\n *\r\n * @name Phaser.Textures.Frame#u0\r\n * @type {number}\r\n * @default 0\r\n * @since 3.11.0\r\n */\r\n this.u0 = 0;\r\n\r\n /**\r\n * WebGL UV v0 value.\r\n *\r\n * @name Phaser.Textures.Frame#v0\r\n * @type {number}\r\n * @default 0\r\n * @since 3.11.0\r\n */\r\n this.v0 = 0;\r\n\r\n /**\r\n * WebGL UV u1 value.\r\n *\r\n * @name Phaser.Textures.Frame#u1\r\n * @type {number}\r\n * @default 0\r\n * @since 3.11.0\r\n */\r\n this.u1 = 0;\r\n\r\n /**\r\n * WebGL UV v1 value.\r\n *\r\n * @name Phaser.Textures.Frame#v1\r\n * @type {number}\r\n * @default 0\r\n * @since 3.11.0\r\n */\r\n this.v1 = 0;\r\n\r\n /**\r\n * The un-modified source frame, trim and UV data.\r\n *\r\n * @name Phaser.Textures.Frame#data\r\n * @type {object}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.data = {\r\n cut: {\r\n x: 0,\r\n y: 0,\r\n w: 0,\r\n h: 0,\r\n r: 0,\r\n b: 0\r\n },\r\n trim: false,\r\n sourceSize: {\r\n w: 0,\r\n h: 0\r\n },\r\n spriteSourceSize: {\r\n x: 0,\r\n y: 0,\r\n w: 0,\r\n h: 0,\r\n r: 0,\r\n b: 0\r\n },\r\n radius: 0,\r\n drawImage: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n }\r\n };\r\n\r\n this.setSize(width, height, x, y);\r\n },\r\n\r\n /**\r\n * Sets the width, height, x and y of this Frame.\r\n * \r\n * This is called automatically by the constructor\r\n * and should rarely be changed on-the-fly.\r\n *\r\n * @method Phaser.Textures.Frame#setSize\r\n * @since 3.7.0\r\n *\r\n * @param {integer} width - The width of the frame before being trimmed.\r\n * @param {integer} height - The height of the frame before being trimmed.\r\n * @param {integer} [x=0] - The x coordinate of the top-left of this Frame.\r\n * @param {integer} [y=0] - The y coordinate of the top-left of this Frame.\r\n *\r\n * @return {Phaser.Textures.Frame} This Frame object.\r\n */\r\n setSize: function (width, height, x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n\r\n this.cutX = x;\r\n this.cutY = y;\r\n this.cutWidth = width;\r\n this.cutHeight = height;\r\n\r\n this.width = width;\r\n this.height = height;\r\n\r\n this.halfWidth = Math.floor(width * 0.5);\r\n this.halfHeight = Math.floor(height * 0.5);\r\n\r\n this.centerX = Math.floor(width / 2);\r\n this.centerY = Math.floor(height / 2);\r\n\r\n var data = this.data;\r\n var cut = data.cut;\r\n\r\n cut.x = x;\r\n cut.y = y;\r\n cut.w = width;\r\n cut.h = height;\r\n cut.r = x + width;\r\n cut.b = y + height;\r\n\r\n data.sourceSize.w = width;\r\n data.sourceSize.h = height;\r\n\r\n data.spriteSourceSize.w = width;\r\n data.spriteSourceSize.h = height;\r\n\r\n data.radius = 0.5 * Math.sqrt(width * width + height * height);\r\n\r\n var drawImage = data.drawImage;\r\n\r\n drawImage.x = x;\r\n drawImage.y = y;\r\n drawImage.width = width;\r\n drawImage.height = height;\r\n\r\n return this.updateUVs();\r\n },\r\n\r\n /**\r\n * If the frame was trimmed when added to the Texture Atlas, this records the trim and source data.\r\n *\r\n * @method Phaser.Textures.Frame#setTrim\r\n * @since 3.0.0\r\n *\r\n * @param {number} actualWidth - The width of the frame before being trimmed.\r\n * @param {number} actualHeight - The height of the frame before being trimmed.\r\n * @param {number} destX - The destination X position of the trimmed frame for display.\r\n * @param {number} destY - The destination Y position of the trimmed frame for display.\r\n * @param {number} destWidth - The destination width of the trimmed frame for display.\r\n * @param {number} destHeight - The destination height of the trimmed frame for display.\r\n *\r\n * @return {Phaser.Textures.Frame} This Frame object.\r\n */\r\n setTrim: function (actualWidth, actualHeight, destX, destY, destWidth, destHeight)\r\n {\r\n var data = this.data;\r\n var ss = data.spriteSourceSize;\r\n\r\n // Store actual values\r\n\r\n data.trim = true;\r\n\r\n data.sourceSize.w = actualWidth;\r\n data.sourceSize.h = actualHeight;\r\n\r\n ss.x = destX;\r\n ss.y = destY;\r\n ss.w = destWidth;\r\n ss.h = destHeight;\r\n ss.r = destX + destWidth;\r\n ss.b = destY + destHeight;\r\n\r\n // Adjust properties\r\n this.x = destX;\r\n this.y = destY;\r\n\r\n this.width = destWidth;\r\n this.height = destHeight;\r\n\r\n this.halfWidth = destWidth * 0.5;\r\n this.halfHeight = destHeight * 0.5;\r\n\r\n this.centerX = Math.floor(destWidth / 2);\r\n this.centerY = Math.floor(destHeight / 2);\r\n\r\n return this.updateUVs();\r\n },\r\n\r\n /**\r\n * Takes a crop data object and, based on the rectangular region given, calculates the\r\n * required UV coordinates in order to crop this Frame for WebGL and Canvas rendering.\r\n * \r\n * This is called directly by the Game Object Texture Components `setCrop` method.\r\n * Please use that method to crop a Game Object.\r\n *\r\n * @method Phaser.Textures.Frame#setCropUVs\r\n * @since 3.11.0\r\n * \r\n * @param {object} crop - The crop data object. This is the `GameObject._crop` property.\r\n * @param {number} x - The x coordinate to start the crop from. Cannot be negative or exceed the Frame width.\r\n * @param {number} y - The y coordinate to start the crop from. Cannot be negative or exceed the Frame height.\r\n * @param {number} width - The width of the crop rectangle. Cannot exceed the Frame width.\r\n * @param {number} height - The height of the crop rectangle. Cannot exceed the Frame height.\r\n * @param {boolean} flipX - Does the parent Game Object have flipX set?\r\n * @param {boolean} flipY - Does the parent Game Object have flipY set?\r\n *\r\n * @return {object} The updated crop data object.\r\n */\r\n setCropUVs: function (crop, x, y, width, height, flipX, flipY)\r\n {\r\n // Clamp the input values\r\n\r\n var cx = this.cutX;\r\n var cy = this.cutY;\r\n var cw = this.cutWidth;\r\n var ch = this.cutHeight;\r\n var rw = this.realWidth;\r\n var rh = this.realHeight;\r\n\r\n x = Clamp(x, 0, rw);\r\n y = Clamp(y, 0, rh);\r\n\r\n width = Clamp(width, 0, rw - x);\r\n height = Clamp(height, 0, rh - y);\r\n\r\n var ox = cx + x;\r\n var oy = cy + y;\r\n var ow = width;\r\n var oh = height;\r\n\r\n var data = this.data;\r\n\r\n if (data.trim)\r\n {\r\n var ss = data.spriteSourceSize;\r\n\r\n // Need to check for intersection between the cut area and the crop area\r\n // If there is none, we set UV to be empty, otherwise set it to be the intersection area\r\n\r\n width = Clamp(width, 0, cw - x);\r\n height = Clamp(height, 0, ch - y);\r\n \r\n var cropRight = x + width;\r\n var cropBottom = y + height;\r\n\r\n var intersects = !(ss.r < x || ss.b < y || ss.x > cropRight || ss.y > cropBottom);\r\n\r\n if (intersects)\r\n {\r\n var ix = Math.max(ss.x, x);\r\n var iy = Math.max(ss.y, y);\r\n var iw = Math.min(ss.r, cropRight) - ix;\r\n var ih = Math.min(ss.b, cropBottom) - iy;\r\n\r\n ow = iw;\r\n oh = ih;\r\n \r\n if (flipX)\r\n {\r\n ox = cx + (cw - (ix - ss.x) - iw);\r\n }\r\n else\r\n {\r\n ox = cx + (ix - ss.x);\r\n }\r\n \r\n if (flipY)\r\n {\r\n oy = cy + (ch - (iy - ss.y) - ih);\r\n }\r\n else\r\n {\r\n oy = cy + (iy - ss.y);\r\n }\r\n\r\n x = ix;\r\n y = iy;\r\n\r\n width = iw;\r\n height = ih;\r\n }\r\n else\r\n {\r\n ox = 0;\r\n oy = 0;\r\n ow = 0;\r\n oh = 0;\r\n }\r\n }\r\n else\r\n {\r\n if (flipX)\r\n {\r\n ox = cx + (cw - x - width);\r\n }\r\n \r\n if (flipY)\r\n {\r\n oy = cy + (ch - y - height);\r\n }\r\n }\r\n\r\n var tw = this.source.width;\r\n var th = this.source.height;\r\n\r\n // Map the given coordinates into UV space, clamping to the 0-1 range.\r\n\r\n crop.u0 = Math.max(0, ox / tw);\r\n crop.v0 = Math.max(0, oy / th);\r\n crop.u1 = Math.min(1, (ox + ow) / tw);\r\n crop.v1 = Math.min(1, (oy + oh) / th);\r\n\r\n crop.x = x;\r\n crop.y = y;\r\n\r\n crop.cx = ox;\r\n crop.cy = oy;\r\n crop.cw = ow;\r\n crop.ch = oh;\r\n\r\n crop.width = width;\r\n crop.height = height;\r\n\r\n crop.flipX = flipX;\r\n crop.flipY = flipY;\r\n\r\n return crop;\r\n },\r\n\r\n /**\r\n * Takes a crop data object and recalculates the UVs based on the dimensions inside the crop object.\r\n * Called automatically by `setFrame`.\r\n *\r\n * @method Phaser.Textures.Frame#updateCropUVs\r\n * @since 3.11.0\r\n * \r\n * @param {object} crop - The crop data object. This is the `GameObject._crop` property.\r\n * @param {boolean} flipX - Does the parent Game Object have flipX set?\r\n * @param {boolean} flipY - Does the parent Game Object have flipY set?\r\n *\r\n * @return {object} The updated crop data object.\r\n */\r\n updateCropUVs: function (crop, flipX, flipY)\r\n {\r\n return this.setCropUVs(crop, crop.x, crop.y, crop.width, crop.height, flipX, flipY);\r\n },\r\n\r\n /**\r\n * Updates the internal WebGL UV cache and the drawImage cache.\r\n *\r\n * @method Phaser.Textures.Frame#updateUVs\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Textures.Frame} This Frame object.\r\n */\r\n updateUVs: function ()\r\n {\r\n var cx = this.cutX;\r\n var cy = this.cutY;\r\n var cw = this.cutWidth;\r\n var ch = this.cutHeight;\r\n\r\n // Canvas data\r\n\r\n var cd = this.data.drawImage;\r\n\r\n cd.width = cw;\r\n cd.height = ch;\r\n\r\n // WebGL data\r\n\r\n var tw = this.source.width;\r\n var th = this.source.height;\r\n\r\n this.u0 = cx / tw;\r\n this.v0 = cy / th;\r\n\r\n this.u1 = (cx + cw) / tw;\r\n this.v1 = (cy + ch) / th;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Updates the internal WebGL UV cache.\r\n *\r\n * @method Phaser.Textures.Frame#updateUVsInverted\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Textures.Frame} This Frame object.\r\n */\r\n updateUVsInverted: function ()\r\n {\r\n var tw = this.source.width;\r\n var th = this.source.height;\r\n\r\n this.u0 = (this.cutX + this.cutHeight) / tw;\r\n this.v0 = this.cutY / th;\r\n\r\n this.u1 = this.cutX / tw;\r\n this.v1 = (this.cutY + this.cutWidth) / th;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Clones this Frame into a new Frame object.\r\n *\r\n * @method Phaser.Textures.Frame#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Textures.Frame} A clone of this Frame.\r\n */\r\n clone: function ()\r\n {\r\n var clone = new Frame(this.texture, this.name, this.sourceIndex);\r\n\r\n clone.cutX = this.cutX;\r\n clone.cutY = this.cutY;\r\n clone.cutWidth = this.cutWidth;\r\n clone.cutHeight = this.cutHeight;\r\n\r\n clone.x = this.x;\r\n clone.y = this.y;\r\n\r\n clone.width = this.width;\r\n clone.height = this.height;\r\n\r\n clone.halfWidth = this.halfWidth;\r\n clone.halfHeight = this.halfHeight;\r\n\r\n clone.centerX = this.centerX;\r\n clone.centerY = this.centerY;\r\n\r\n clone.rotated = this.rotated;\r\n\r\n clone.data = Extend(true, clone.data, this.data);\r\n\r\n clone.updateUVs();\r\n\r\n return clone;\r\n },\r\n\r\n /**\r\n * Destroys this Frame by nulling its reference to the parent Texture and and data objects.\r\n *\r\n * @method Phaser.Textures.Frame#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.source = null;\r\n this.texture = null;\r\n this.glTexture = null;\r\n this.customData = null;\r\n this.data = null;\r\n },\r\n\r\n /**\r\n * The width of the Frame in its un-trimmed, un-padded state, as prepared in the art package,\r\n * before being packed.\r\n *\r\n * @name Phaser.Textures.Frame#realWidth\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n realWidth: {\r\n\r\n get: function ()\r\n {\r\n return this.data.sourceSize.w;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The height of the Frame in its un-trimmed, un-padded state, as prepared in the art package,\r\n * before being packed.\r\n *\r\n * @name Phaser.Textures.Frame#realHeight\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n realHeight: {\r\n\r\n get: function ()\r\n {\r\n return this.data.sourceSize.h;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The radius of the Frame (derived from sqrt(w * w + h * h) / 2)\r\n *\r\n * @name Phaser.Textures.Frame#radius\r\n * @type {number}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n radius: {\r\n\r\n get: function ()\r\n {\r\n return this.data.radius;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Is the Frame trimmed or not?\r\n *\r\n * @name Phaser.Textures.Frame#trimmed\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n trimmed: {\r\n\r\n get: function ()\r\n {\r\n return this.data.trim;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Canvas drawImage data object.\r\n *\r\n * @name Phaser.Textures.Frame#canvasData\r\n * @type {object}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n canvasData: {\r\n\r\n get: function ()\r\n {\r\n return this.data.drawImage;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Frame;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/Frame.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/Texture.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/textures/Texture.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Frame = __webpack_require__(/*! ./Frame */ \"./node_modules/phaser/src/textures/Frame.js\");\r\nvar TextureSource = __webpack_require__(/*! ./TextureSource */ \"./node_modules/phaser/src/textures/TextureSource.js\");\r\n\r\nvar TEXTURE_MISSING_ERROR = 'Texture.frame missing: ';\r\n\r\n/**\r\n * @classdesc\r\n * A Texture consists of a source, usually an Image from the Cache, and a collection of Frames.\r\n * The Frames represent the different areas of the Texture. For example a texture atlas\r\n * may have many Frames, one for each element within the atlas. Where-as a single image would have\r\n * just one frame, that encompasses the whole image.\r\n * \r\n * Every Texture, no matter where it comes from, always has at least 1 frame called the `__BASE` frame.\r\n * This frame represents the entirety of the source image.\r\n *\r\n * Textures are managed by the global TextureManager. This is a singleton class that is\r\n * responsible for creating and delivering Textures and their corresponding Frames to Game Objects.\r\n *\r\n * Sprites and other Game Objects get the texture data they need from the TextureManager.\r\n *\r\n * @class Texture\r\n * @memberof Phaser.Textures\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.TextureManager} manager - A reference to the Texture Manager this Texture belongs to.\r\n * @param {string} key - The unique string-based key of this Texture.\r\n * @param {(HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[])} source - An array of sources that are used to create the texture. Usually Images, but can also be a Canvas.\r\n * @param {number} [width] - The width of the Texture. This is optional and automatically derived from the source images.\r\n * @param {number} [height] - The height of the Texture. This is optional and automatically derived from the source images.\r\n */\r\nvar Texture = new Class({\r\n\r\n initialize:\r\n\r\n function Texture (manager, key, source, width, height)\r\n {\r\n if (!Array.isArray(source))\r\n {\r\n source = [ source ];\r\n }\r\n\r\n /**\r\n * A reference to the Texture Manager this Texture belongs to.\r\n *\r\n * @name Phaser.Textures.Texture#manager\r\n * @type {Phaser.Textures.TextureManager}\r\n * @since 3.0.0\r\n */\r\n this.manager = manager;\r\n\r\n /**\r\n * The unique string-based key of this Texture.\r\n *\r\n * @name Phaser.Textures.Texture#key\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.key = key;\r\n\r\n /**\r\n * An array of TextureSource instances.\r\n * These are unique to this Texture and contain the actual Image (or Canvas) data.\r\n *\r\n * @name Phaser.Textures.Texture#source\r\n * @type {Phaser.Textures.TextureSource[]}\r\n * @since 3.0.0\r\n */\r\n this.source = [];\r\n\r\n /**\r\n * An array of TextureSource data instances.\r\n * Used to store additional data images, such as normal maps or specular maps.\r\n *\r\n * @name Phaser.Textures.Texture#dataSource\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.dataSource = [];\r\n\r\n /**\r\n * A key-value object pair associating the unique Frame keys with the Frames objects.\r\n *\r\n * @name Phaser.Textures.Texture#frames\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.frames = {};\r\n\r\n /**\r\n * Any additional data that was set in the source JSON (if any),\r\n * or any extra data you'd like to store relating to this texture\r\n *\r\n * @name Phaser.Textures.Texture#customData\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.customData = {};\r\n\r\n /**\r\n * The name of the first frame of the Texture.\r\n *\r\n * @name Phaser.Textures.Texture#firstFrame\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.firstFrame = '__BASE';\r\n\r\n /**\r\n * The total number of Frames in this Texture, including the `__BASE` frame.\r\n * \r\n * A Texture will always contain at least 1 frame because every Texture contains a `__BASE` frame by default,\r\n * in addition to any extra frames that have been added to it, such as when parsing a Sprite Sheet or Texture Atlas.\r\n *\r\n * @name Phaser.Textures.Texture#frameTotal\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.frameTotal = 0;\r\n\r\n // Load the Sources\r\n for (var i = 0; i < source.length; i++)\r\n {\r\n this.source.push(new TextureSource(this, source[i], width, height));\r\n }\r\n },\r\n\r\n /**\r\n * Adds a new Frame to this Texture.\r\n *\r\n * A Frame is a rectangular region of a TextureSource with a unique index or string-based key.\r\n * \r\n * The name given must be unique within this Texture. If it already exists, this method will return `null`.\r\n *\r\n * @method Phaser.Textures.Texture#add\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture.\r\n * @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of.\r\n * @param {number} x - The x coordinate of the top-left of this Frame.\r\n * @param {number} y - The y coordinate of the top-left of this Frame.\r\n * @param {number} width - The width of this Frame.\r\n * @param {number} height - The height of this Frame.\r\n *\r\n * @return {?Phaser.Textures.Frame} The Frame that was added to this Texture, or `null` if the given name already exists.\r\n */\r\n add: function (name, sourceIndex, x, y, width, height)\r\n {\r\n if (this.has(name))\r\n {\r\n return null;\r\n }\r\n\r\n var frame = new Frame(this, name, sourceIndex, x, y, width, height);\r\n\r\n this.frames[name] = frame;\r\n\r\n // Set the first frame of the Texture (other than __BASE)\r\n // This is used to ensure we don't spam the display with entire\r\n // atlases of sprite sheets, but instead just the first frame of them\r\n // should the dev incorrectly specify the frame index\r\n if (this.firstFrame === '__BASE')\r\n {\r\n this.firstFrame = name;\r\n }\r\n\r\n this.frameTotal++;\r\n\r\n return frame;\r\n },\r\n\r\n /**\r\n * Removes the given Frame from this Texture. The Frame is destroyed immediately.\r\n * \r\n * Any Game Objects using this Frame should stop using it _before_ you remove it,\r\n * as it does not happen automatically.\r\n *\r\n * @method Phaser.Textures.Texture#remove\r\n * @since 3.19.0\r\n *\r\n * @param {string} name - The key of the Frame to remove.\r\n *\r\n * @return {boolean} True if a Frame with the matching key was removed from this Texture.\r\n */\r\n remove: function (name)\r\n {\r\n if (this.has(name))\r\n {\r\n var frame = this.get(name);\r\n\r\n frame.destroy();\r\n\r\n delete this.frames[name];\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Checks to see if a Frame matching the given key exists within this Texture.\r\n *\r\n * @method Phaser.Textures.Texture#has\r\n * @since 3.0.0\r\n *\r\n * @param {string} name - The key of the Frame to check for.\r\n *\r\n * @return {boolean} True if a Frame with the matching key exists in this Texture.\r\n */\r\n has: function (name)\r\n {\r\n return (this.frames[name]);\r\n },\r\n\r\n /**\r\n * Gets a Frame from this Texture based on either the key or the index of the Frame.\r\n *\r\n * In a Texture Atlas Frames are typically referenced by a key.\r\n * In a Sprite Sheet Frames are referenced by an index.\r\n * Passing no value for the name returns the base texture.\r\n *\r\n * @method Phaser.Textures.Texture#get\r\n * @since 3.0.0\r\n *\r\n * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture.\r\n *\r\n * @return {Phaser.Textures.Frame} The Texture Frame.\r\n */\r\n get: function (name)\r\n {\r\n // null, undefined, empty string, zero\r\n if (!name)\r\n {\r\n name = this.firstFrame;\r\n }\r\n\r\n var frame = this.frames[name];\r\n\r\n if (!frame)\r\n {\r\n console.warn(TEXTURE_MISSING_ERROR + name);\r\n\r\n frame = this.frames[this.firstFrame];\r\n }\r\n\r\n return frame;\r\n },\r\n\r\n /**\r\n * Takes the given TextureSource and returns the index of it within this Texture.\r\n * If it's not in this Texture, it returns -1.\r\n * Unless this Texture has multiple TextureSources, such as with a multi-atlas, this\r\n * method will always return zero or -1.\r\n *\r\n * @method Phaser.Textures.Texture#getTextureSourceIndex\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.TextureSource} source - The TextureSource to check.\r\n *\r\n * @return {integer} The index of the TextureSource within this Texture, or -1 if not in this Texture.\r\n */\r\n getTextureSourceIndex: function (source)\r\n {\r\n for (var i = 0; i < this.source.length; i++)\r\n {\r\n if (this.source[i] === source)\r\n {\r\n return i;\r\n }\r\n }\r\n\r\n return -1;\r\n },\r\n\r\n /**\r\n * Returns an array of all the Frames in the given TextureSource.\r\n *\r\n * @method Phaser.Textures.Texture#getFramesFromTextureSource\r\n * @since 3.0.0\r\n *\r\n * @param {integer} sourceIndex - The index of the TextureSource to get the Frames from.\r\n * @param {boolean} [includeBase=false] - Include the `__BASE` Frame in the output array?\r\n *\r\n * @return {Phaser.Textures.Frame[]} An array of Texture Frames.\r\n */\r\n getFramesFromTextureSource: function (sourceIndex, includeBase)\r\n {\r\n if (includeBase === undefined) { includeBase = false; }\r\n\r\n var out = [];\r\n\r\n for (var frameName in this.frames)\r\n {\r\n if (frameName === '__BASE' && !includeBase)\r\n {\r\n continue;\r\n }\r\n\r\n var frame = this.frames[frameName];\r\n\r\n if (frame.sourceIndex === sourceIndex)\r\n {\r\n out.push(frame);\r\n }\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Returns an array with all of the names of the Frames in this Texture.\r\n *\r\n * Useful if you want to randomly assign a Frame to a Game Object, as you can\r\n * pick a random element from the returned array.\r\n *\r\n * @method Phaser.Textures.Texture#getFrameNames\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [includeBase=false] - Include the `__BASE` Frame in the output array?\r\n *\r\n * @return {string[]} An array of all Frame names in this Texture.\r\n */\r\n getFrameNames: function (includeBase)\r\n {\r\n if (includeBase === undefined) { includeBase = false; }\r\n\r\n var out = Object.keys(this.frames);\r\n\r\n if (!includeBase)\r\n {\r\n var idx = out.indexOf('__BASE');\r\n\r\n if (idx !== -1)\r\n {\r\n out.splice(idx, 1);\r\n }\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Given a Frame name, return the source image it uses to render with.\r\n *\r\n * This will return the actual DOM Image or Canvas element.\r\n *\r\n * @method Phaser.Textures.Texture#getSourceImage\r\n * @since 3.0.0\r\n *\r\n * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture.\r\n *\r\n * @return {(HTMLImageElement|HTMLCanvasElement|Phaser.GameObjects.RenderTexture)} The DOM Image, Canvas Element or Render Texture.\r\n */\r\n getSourceImage: function (name)\r\n {\r\n if (name === undefined || name === null || this.frameTotal === 1)\r\n {\r\n name = '__BASE';\r\n }\r\n\r\n var frame = this.frames[name];\r\n\r\n if (frame)\r\n {\r\n return frame.source.image;\r\n }\r\n else\r\n {\r\n console.warn(TEXTURE_MISSING_ERROR + name);\r\n\r\n return this.frames['__BASE'].source.image;\r\n }\r\n },\r\n\r\n /**\r\n * Given a Frame name, return the data source image it uses to render with.\r\n * You can use this to get the normal map for an image for example.\r\n *\r\n * This will return the actual DOM Image.\r\n *\r\n * @method Phaser.Textures.Texture#getDataSourceImage\r\n * @since 3.7.0\r\n *\r\n * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture.\r\n *\r\n * @return {(HTMLImageElement|HTMLCanvasElement)} The DOM Image or Canvas Element.\r\n */\r\n getDataSourceImage: function (name)\r\n {\r\n if (name === undefined || name === null || this.frameTotal === 1)\r\n {\r\n name = '__BASE';\r\n }\r\n\r\n var frame = this.frames[name];\r\n var idx;\r\n\r\n if (!frame)\r\n {\r\n console.warn(TEXTURE_MISSING_ERROR + name);\r\n\r\n idx = this.frames['__BASE'].sourceIndex;\r\n }\r\n else\r\n {\r\n idx = frame.sourceIndex;\r\n }\r\n\r\n return this.dataSource[idx].image;\r\n },\r\n\r\n /**\r\n * Adds a data source image to this Texture.\r\n *\r\n * An example of a data source image would be a normal map, where all of the Frames for this Texture\r\n * equally apply to the normal map.\r\n *\r\n * @method Phaser.Textures.Texture#setDataSource\r\n * @since 3.0.0\r\n *\r\n * @param {(HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[])} data - The source image.\r\n */\r\n setDataSource: function (data)\r\n {\r\n if (!Array.isArray(data))\r\n {\r\n data = [ data ];\r\n }\r\n \r\n for (var i = 0; i < data.length; i++)\r\n {\r\n var source = this.source[i];\r\n\r\n this.dataSource.push(new TextureSource(this, data[i], source.width, source.height));\r\n }\r\n },\r\n\r\n /**\r\n * Sets the Filter Mode for this Texture.\r\n *\r\n * The mode can be either Linear, the default, or Nearest.\r\n *\r\n * For pixel-art you should use Nearest.\r\n *\r\n * The mode applies to the entire Texture, not just a specific Frame of it.\r\n *\r\n * @method Phaser.Textures.Texture#setFilter\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.FilterMode} filterMode - The Filter Mode.\r\n */\r\n setFilter: function (filterMode)\r\n {\r\n var i;\r\n\r\n for (i = 0; i < this.source.length; i++)\r\n {\r\n this.source[i].setFilter(filterMode);\r\n }\r\n\r\n for (i = 0; i < this.dataSource.length; i++)\r\n {\r\n this.dataSource[i].setFilter(filterMode);\r\n }\r\n },\r\n\r\n /**\r\n * Destroys this Texture and releases references to its sources and frames.\r\n *\r\n * @method Phaser.Textures.Texture#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n var i;\r\n\r\n for (i = 0; i < this.source.length; i++)\r\n {\r\n this.source[i].destroy();\r\n }\r\n\r\n for (i = 0; i < this.dataSource.length; i++)\r\n {\r\n this.dataSource[i].destroy();\r\n }\r\n\r\n for (var frameName in this.frames)\r\n {\r\n var frame = this.frames[frameName];\r\n\r\n frame.destroy();\r\n }\r\n\r\n this.source = [];\r\n this.dataSource = [];\r\n this.frames = {};\r\n\r\n this.manager.removeKey(this.key);\r\n\r\n this.manager = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Texture;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/Texture.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/TextureManager.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/textures/TextureManager.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CanvasPool = __webpack_require__(/*! ../display/canvas/CanvasPool */ \"./node_modules/phaser/src/display/canvas/CanvasPool.js\");\r\nvar CanvasTexture = __webpack_require__(/*! ./CanvasTexture */ \"./node_modules/phaser/src/textures/CanvasTexture.js\");\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Color = __webpack_require__(/*! ../display/color/Color */ \"./node_modules/phaser/src/display/color/Color.js\");\r\nvar CONST = __webpack_require__(/*! ../const */ \"./node_modules/phaser/src/const.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/textures/events/index.js\");\r\nvar GameEvents = __webpack_require__(/*! ../core/events */ \"./node_modules/phaser/src/core/events/index.js\");\r\nvar GenerateTexture = __webpack_require__(/*! ../create/GenerateTexture */ \"./node_modules/phaser/src/create/GenerateTexture.js\");\r\nvar GetValue = __webpack_require__(/*! ../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar Parser = __webpack_require__(/*! ./parsers */ \"./node_modules/phaser/src/textures/parsers/index.js\");\r\nvar Texture = __webpack_require__(/*! ./Texture */ \"./node_modules/phaser/src/textures/Texture.js\");\r\n\r\n/**\r\n * @callback EachTextureCallback\r\n *\r\n * @param {Phaser.Textures.Texture} texture - Each texture in Texture Manager.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * Textures are managed by the global TextureManager. This is a singleton class that is\r\n * responsible for creating and delivering Textures and their corresponding Frames to Game Objects.\r\n *\r\n * Sprites and other Game Objects get the texture data they need from the TextureManager.\r\n *\r\n * Access it via `scene.textures`.\r\n *\r\n * @class TextureManager\r\n * @extends Phaser.Events.EventEmitter\r\n * @memberof Phaser.Textures\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - The Phaser.Game instance this Texture Manager belongs to.\r\n */\r\nvar TextureManager = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function TextureManager (game)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * The Game that this TextureManager belongs to.\r\n *\r\n * @name Phaser.Textures.TextureManager#game\r\n * @type {Phaser.Game}\r\n * @since 3.0.0\r\n */\r\n this.game = game;\r\n\r\n /**\r\n * The name of this manager.\r\n *\r\n * @name Phaser.Textures.TextureManager#name\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.name = 'TextureManager';\r\n\r\n /**\r\n * An object that has all of textures that Texture Manager creates.\r\n * Textures are assigned to keys so we can access to any texture that this object has directly by key value without iteration.\r\n *\r\n * @name Phaser.Textures.TextureManager#list\r\n * @type {object}\r\n * @default {}\r\n * @since 3.0.0\r\n */\r\n this.list = {};\r\n\r\n /**\r\n * The temporary canvas element to save an pixel data of an arbitrary texture in getPixel() and getPixelAlpha() method.\r\n *\r\n * @name Phaser.Textures.TextureManager#_tempCanvas\r\n * @type {HTMLCanvasElement}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._tempCanvas = CanvasPool.create2D(this, 1, 1);\r\n\r\n /**\r\n * The context of the temporary canvas element made to save an pixel data in getPixel() and getPixelAlpha() method.\r\n *\r\n * @name Phaser.Textures.TextureManager#_tempContext\r\n * @type {CanvasRenderingContext2D}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._tempContext = this._tempCanvas.getContext('2d');\r\n\r\n /**\r\n * An counting value used for emitting 'ready' event after all of managers in game is loaded.\r\n *\r\n * @name Phaser.Textures.TextureManager#_pending\r\n * @type {integer}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._pending = 0;\r\n\r\n game.events.once(GameEvents.BOOT, this.boot, this);\r\n },\r\n\r\n /**\r\n * The Boot Handler called by Phaser.Game when it first starts up.\r\n *\r\n * @method Phaser.Textures.TextureManager#boot\r\n * @private\r\n * @since 3.0.0\r\n */\r\n boot: function ()\r\n {\r\n this._pending = 2;\r\n\r\n this.on(Events.LOAD, this.updatePending, this);\r\n this.on(Events.ERROR, this.updatePending, this);\r\n\r\n this.addBase64('__DEFAULT', this.game.config.defaultImage);\r\n this.addBase64('__MISSING', this.game.config.missingImage);\r\n\r\n this.game.events.once(GameEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * After 'onload' or 'onerror' invoked twice, emit 'ready' event.\r\n *\r\n * @method Phaser.Textures.TextureManager#updatePending\r\n * @private\r\n * @since 3.0.0\r\n */\r\n updatePending: function ()\r\n {\r\n this._pending--;\r\n\r\n if (this._pending === 0)\r\n {\r\n this.off(Events.LOAD);\r\n this.off(Events.ERROR);\r\n\r\n this.emit(Events.READY);\r\n }\r\n },\r\n\r\n /**\r\n * Checks the given texture key and throws a console.warn if the key is already in use, then returns false.\r\n * If you wish to avoid the console.warn then use `TextureManager.exists` instead.\r\n *\r\n * @method Phaser.Textures.TextureManager#checkKey\r\n * @since 3.7.0\r\n *\r\n * @param {string} key - The texture key to check.\r\n *\r\n * @return {boolean} `true` if it's safe to use the texture key, otherwise `false`.\r\n */\r\n checkKey: function (key)\r\n {\r\n if (this.exists(key))\r\n {\r\n // eslint-disable-next-line no-console\r\n console.error('Texture key already in use: ' + key);\r\n\r\n return false;\r\n }\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Removes a Texture from the Texture Manager and destroys it. This will immediately\r\n * clear all references to it from the Texture Manager, and if it has one, destroy its\r\n * WebGLTexture. This will emit a `removetexture` event.\r\n *\r\n * Note: If you have any Game Objects still using this texture they will start throwing\r\n * errors the next time they try to render. Make sure that removing the texture is the final\r\n * step when clearing down to avoid this.\r\n *\r\n * @method Phaser.Textures.TextureManager#remove\r\n * @fires Phaser.Textures.Events#REMOVE\r\n * @since 3.7.0\r\n *\r\n * @param {(string|Phaser.Textures.Texture)} key - The key of the Texture to remove, or a reference to it.\r\n *\r\n * @return {Phaser.Textures.TextureManager} The Texture Manager.\r\n */\r\n remove: function (key)\r\n {\r\n if (typeof key === 'string')\r\n {\r\n if (this.exists(key))\r\n {\r\n key = this.get(key);\r\n }\r\n else\r\n {\r\n console.warn('No texture found matching key: ' + key);\r\n return this;\r\n }\r\n }\r\n\r\n // By this point key should be a Texture, if not, the following fails anyway\r\n if (this.list.hasOwnProperty(key.key))\r\n {\r\n key.destroy();\r\n\r\n this.emit(Events.REMOVE, key.key);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes a key from the Texture Manager but does not destroy the Texture that was using the key.\r\n *\r\n * @method Phaser.Textures.TextureManager#removeKey\r\n * @since 3.17.0\r\n *\r\n * @param {string} key - The key to remove from the texture list.\r\n *\r\n * @return {Phaser.Textures.TextureManager} The Texture Manager.\r\n */\r\n removeKey: function (key)\r\n {\r\n if (this.list.hasOwnProperty(key))\r\n {\r\n delete this.list[key];\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds a new Texture to the Texture Manager created from the given Base64 encoded data.\r\n *\r\n * @method Phaser.Textures.TextureManager#addBase64\r\n * @fires Phaser.Textures.Events#ADD\r\n * @fires Phaser.Textures.Events#ERROR\r\n * @fires Phaser.Textures.Events#LOAD\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {*} data - The Base64 encoded data.\r\n * \r\n * @return {this} This Texture Manager instance.\r\n */\r\n addBase64: function (key, data)\r\n {\r\n if (this.checkKey(key))\r\n {\r\n var _this = this;\r\n\r\n var image = new Image();\r\n\r\n image.onerror = function ()\r\n {\r\n _this.emit(Events.ERROR, key);\r\n };\r\n\r\n image.onload = function ()\r\n {\r\n var texture = _this.create(key, image);\r\n\r\n Parser.Image(texture, 0);\r\n\r\n _this.emit(Events.ADD, key, texture);\r\n\r\n _this.emit(Events.LOAD, key, texture);\r\n };\r\n\r\n image.src = data;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets an existing texture frame and converts it into a base64 encoded image and returns the base64 data.\r\n * \r\n * You can also provide the image type and encoder options.\r\n * \r\n * This will only work with bitmap based texture frames, such as those created from Texture Atlases.\r\n * It will not work with GL Texture objects, such as Shaders, or Render Textures. For those please\r\n * see the WebGL Snapshot function instead.\r\n *\r\n * @method Phaser.Textures.TextureManager#getBase64\r\n * @since 3.12.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture.\r\n * @param {string} [type='image/png'] - [description]\r\n * @param {number} [encoderOptions=0.92] - [description]\r\n * \r\n * @return {string} The base64 encoded data, or an empty string if the texture frame could not be found.\r\n */\r\n getBase64: function (key, frame, type, encoderOptions)\r\n {\r\n if (type === undefined) { type = 'image/png'; }\r\n if (encoderOptions === undefined) { encoderOptions = 0.92; }\r\n\r\n var data = '';\r\n\r\n var textureFrame = this.getFrame(key, frame);\r\n\r\n if (textureFrame && (textureFrame.source.isRenderTexture || textureFrame.source.isGLTexture))\r\n {\r\n console.warn('Cannot getBase64 from WebGL Texture');\r\n }\r\n else if (textureFrame)\r\n {\r\n var cd = textureFrame.canvasData;\r\n\r\n var canvas = CanvasPool.create2D(this, cd.width, cd.height);\r\n var ctx = canvas.getContext('2d');\r\n\r\n ctx.drawImage(\r\n textureFrame.source.image,\r\n cd.x,\r\n cd.y,\r\n cd.width,\r\n cd.height,\r\n 0,\r\n 0,\r\n cd.width,\r\n cd.height\r\n );\r\n\r\n data = canvas.toDataURL(type, encoderOptions);\r\n\r\n CanvasPool.remove(canvas);\r\n }\r\n\r\n return data;\r\n },\r\n\r\n /**\r\n * Adds a new Texture to the Texture Manager created from the given Image element.\r\n *\r\n * @method Phaser.Textures.TextureManager#addImage\r\n * @fires Phaser.Textures.Events#ADD\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {HTMLImageElement} source - The source Image element.\r\n * @param {HTMLImageElement|HTMLCanvasElement} [dataSource] - An optional data Image element.\r\n *\r\n * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use.\r\n */\r\n addImage: function (key, source, dataSource)\r\n {\r\n var texture = null;\r\n\r\n if (this.checkKey(key))\r\n {\r\n texture = this.create(key, source);\r\n\r\n Parser.Image(texture, 0);\r\n\r\n if (dataSource)\r\n {\r\n texture.setDataSource(dataSource);\r\n }\r\n\r\n this.emit(Events.ADD, key, texture);\r\n }\r\n \r\n return texture;\r\n },\r\n\r\n /**\r\n * Takes a WebGL Texture and creates a Phaser Texture from it, which is added to the Texture Manager using the given key.\r\n * \r\n * This allows you to then use the Texture as a normal texture for texture based Game Objects like Sprites.\r\n * \r\n * This is a WebGL only feature.\r\n *\r\n * @method Phaser.Textures.TextureManager#addGLTexture\r\n * @fires Phaser.Textures.Events#ADD\r\n * @since 3.19.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {WebGLTexture} glTexture - The source Render Texture.\r\n * @param {number} width - The new width of the Texture.\r\n * @param {number} height - The new height of the Texture.\r\n *\r\n * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use.\r\n */\r\n addGLTexture: function (key, glTexture, width, height)\r\n {\r\n var texture = null;\r\n\r\n if (this.checkKey(key))\r\n {\r\n texture = this.create(key, glTexture, width, height);\r\n\r\n texture.add('__BASE', 0, 0, 0, width, height);\r\n\r\n this.emit(Events.ADD, key, texture);\r\n }\r\n \r\n return texture;\r\n },\r\n\r\n /**\r\n * Adds a Render Texture to the Texture Manager using the given key.\r\n * This allows you to then use the Render Texture as a normal texture for texture based Game Objects like Sprites.\r\n *\r\n * @method Phaser.Textures.TextureManager#addRenderTexture\r\n * @fires Phaser.Textures.Events#ADD\r\n * @since 3.12.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {Phaser.GameObjects.RenderTexture} renderTexture - The source Render Texture.\r\n *\r\n * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use.\r\n */\r\n addRenderTexture: function (key, renderTexture)\r\n {\r\n var texture = null;\r\n\r\n if (this.checkKey(key))\r\n {\r\n texture = this.create(key, renderTexture);\r\n\r\n texture.add('__BASE', 0, 0, 0, renderTexture.width, renderTexture.height);\r\n\r\n this.emit(Events.ADD, key, texture);\r\n }\r\n \r\n return texture;\r\n },\r\n\r\n /**\r\n * Creates a new Texture using the given config values.\r\n * Generated textures consist of a Canvas element to which the texture data is drawn.\r\n * See the Phaser.Create function for the more direct way to create textures.\r\n *\r\n * @method Phaser.Textures.TextureManager#generate\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {object} config - The configuration object needed to generate the texture.\r\n *\r\n * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use.\r\n */\r\n generate: function (key, config)\r\n {\r\n if (this.checkKey(key))\r\n {\r\n var canvas = CanvasPool.create(this, 1, 1);\r\n\r\n config.canvas = canvas;\r\n\r\n GenerateTexture(config);\r\n\r\n return this.addCanvas(key, canvas);\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n },\r\n\r\n /**\r\n * Creates a new Texture using a blank Canvas element of the size given.\r\n *\r\n * Canvas elements are automatically pooled and calling this method will\r\n * extract a free canvas from the CanvasPool, or create one if none are available.\r\n *\r\n * @method Phaser.Textures.TextureManager#createCanvas\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {integer} [width=256] - The width of the Canvas element.\r\n * @param {integer} [height=256] - The height of the Canvas element.\r\n *\r\n * @return {?Phaser.Textures.CanvasTexture} The Canvas Texture that was created, or `null` if the key is already in use.\r\n */\r\n createCanvas: function (key, width, height)\r\n {\r\n if (width === undefined) { width = 256; }\r\n if (height === undefined) { height = 256; }\r\n\r\n if (this.checkKey(key))\r\n {\r\n var canvas = CanvasPool.create(this, width, height, CONST.CANVAS, true);\r\n\r\n return this.addCanvas(key, canvas);\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Creates a new Canvas Texture object from an existing Canvas element\r\n * and adds it to this Texture Manager, unless `skipCache` is true.\r\n *\r\n * @method Phaser.Textures.TextureManager#addCanvas\r\n * @fires Phaser.Textures.Events#ADD\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {HTMLCanvasElement} source - The Canvas element to form the base of the new Texture.\r\n * @param {boolean} [skipCache=false] - Skip adding this Texture into the Cache?\r\n *\r\n * @return {?Phaser.Textures.CanvasTexture} The Canvas Texture that was created, or `null` if the key is already in use.\r\n */\r\n addCanvas: function (key, source, skipCache)\r\n {\r\n if (skipCache === undefined) { skipCache = false; }\r\n\r\n var texture = null;\r\n\r\n if (skipCache)\r\n {\r\n texture = new CanvasTexture(this, key, source, source.width, source.height);\r\n }\r\n else if (this.checkKey(key))\r\n {\r\n texture = new CanvasTexture(this, key, source, source.width, source.height);\r\n\r\n this.list[key] = texture;\r\n\r\n this.emit(Events.ADD, key, texture);\r\n }\r\n\r\n return texture;\r\n },\r\n\r\n /**\r\n * Adds a new Texture Atlas to this Texture Manager.\r\n * It can accept either JSON Array or JSON Hash formats, as exported by Texture Packer and similar software.\r\n *\r\n * @method Phaser.Textures.TextureManager#addAtlas\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {HTMLImageElement} source - The source Image element.\r\n * @param {object} data - The Texture Atlas data.\r\n * @param {HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[]} [dataSource] - An optional data Image element.\r\n *\r\n * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use.\r\n */\r\n addAtlas: function (key, source, data, dataSource)\r\n {\r\n // New Texture Packer format?\r\n if (Array.isArray(data.textures) || Array.isArray(data.frames))\r\n {\r\n return this.addAtlasJSONArray(key, source, data, dataSource);\r\n }\r\n else\r\n {\r\n return this.addAtlasJSONHash(key, source, data, dataSource);\r\n }\r\n },\r\n\r\n /**\r\n * Adds a Texture Atlas to this Texture Manager.\r\n * The frame data of the atlas must be stored in an Array within the JSON.\r\n * This is known as a JSON Array in software such as Texture Packer.\r\n *\r\n * @method Phaser.Textures.TextureManager#addAtlasJSONArray\r\n * @fires Phaser.Textures.Events#ADD\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {(HTMLImageElement|HTMLImageElement[])} source - The source Image element/s.\r\n * @param {(object|object[])} data - The Texture Atlas data/s.\r\n * @param {HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[]} [dataSource] - An optional data Image element.\r\n *\r\n * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use.\r\n */\r\n addAtlasJSONArray: function (key, source, data, dataSource)\r\n {\r\n var texture = null;\r\n\r\n if (this.checkKey(key))\r\n {\r\n texture = this.create(key, source);\r\n\r\n // Multi-Atlas?\r\n if (Array.isArray(data))\r\n {\r\n var singleAtlasFile = (data.length === 1); // multi-pack with one atlas file for all images\r\n\r\n // !! Assumes the textures are in the same order in the source array as in the json data !!\r\n for (var i = 0; i < texture.source.length; i++)\r\n {\r\n var atlasData = singleAtlasFile ? data[0] : data[i];\r\n\r\n Parser.JSONArray(texture, i, atlasData);\r\n }\r\n }\r\n else\r\n {\r\n Parser.JSONArray(texture, 0, data);\r\n }\r\n\r\n if (dataSource)\r\n {\r\n texture.setDataSource(dataSource);\r\n }\r\n\r\n this.emit(Events.ADD, key, texture);\r\n }\r\n\r\n return texture;\r\n },\r\n\r\n /**\r\n * Adds a Texture Atlas to this Texture Manager.\r\n * The frame data of the atlas must be stored in an Object within the JSON.\r\n * This is known as a JSON Hash in software such as Texture Packer.\r\n *\r\n * @method Phaser.Textures.TextureManager#addAtlasJSONHash\r\n * @fires Phaser.Textures.Events#ADD\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {HTMLImageElement} source - The source Image element.\r\n * @param {object} data - The Texture Atlas data.\r\n * @param {HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[]} [dataSource] - An optional data Image element.\r\n *\r\n * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use.\r\n */\r\n addAtlasJSONHash: function (key, source, data, dataSource)\r\n {\r\n var texture = null;\r\n\r\n if (this.checkKey(key))\r\n {\r\n texture = this.create(key, source);\r\n\r\n if (Array.isArray(data))\r\n {\r\n for (var i = 0; i < data.length; i++)\r\n {\r\n Parser.JSONHash(texture, i, data[i]);\r\n }\r\n }\r\n else\r\n {\r\n Parser.JSONHash(texture, 0, data);\r\n }\r\n\r\n if (dataSource)\r\n {\r\n texture.setDataSource(dataSource);\r\n }\r\n\r\n this.emit(Events.ADD, key, texture);\r\n }\r\n\r\n return texture;\r\n },\r\n\r\n /**\r\n * Adds a Texture Atlas to this Texture Manager, where the atlas data is given\r\n * in the XML format.\r\n *\r\n * @method Phaser.Textures.TextureManager#addAtlasXML\r\n * @fires Phaser.Textures.Events#ADD\r\n * @since 3.7.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {HTMLImageElement} source - The source Image element.\r\n * @param {object} data - The Texture Atlas XML data.\r\n * @param {HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[]} [dataSource] - An optional data Image element.\r\n *\r\n * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use.\r\n */\r\n addAtlasXML: function (key, source, data, dataSource)\r\n {\r\n var texture = null;\r\n\r\n if (this.checkKey(key))\r\n {\r\n texture = this.create(key, source);\r\n \r\n Parser.AtlasXML(texture, 0, data);\r\n\r\n if (dataSource)\r\n {\r\n texture.setDataSource(dataSource);\r\n }\r\n\r\n this.emit(Events.ADD, key, texture);\r\n }\r\n\r\n return texture;\r\n },\r\n\r\n /**\r\n * Adds a Unity Texture Atlas to this Texture Manager.\r\n * The data must be in the form of a Unity YAML file.\r\n *\r\n * @method Phaser.Textures.TextureManager#addUnityAtlas\r\n * @fires Phaser.Textures.Events#ADD\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {HTMLImageElement} source - The source Image element.\r\n * @param {object} data - The Texture Atlas data.\r\n * @param {HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[]} [dataSource] - An optional data Image element.\r\n *\r\n * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use.\r\n */\r\n addUnityAtlas: function (key, source, data, dataSource)\r\n {\r\n var texture = null;\r\n\r\n if (this.checkKey(key))\r\n {\r\n texture = this.create(key, source);\r\n\r\n Parser.UnityYAML(texture, 0, data);\r\n\r\n if (dataSource)\r\n {\r\n texture.setDataSource(dataSource);\r\n }\r\n\r\n this.emit(Events.ADD, key, texture);\r\n }\r\n\r\n return texture;\r\n },\r\n\r\n /**\r\n * Adds a Sprite Sheet to this Texture Manager.\r\n *\r\n * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact\r\n * same size and cannot be trimmed or rotated.\r\n *\r\n * @method Phaser.Textures.TextureManager#addSpriteSheet\r\n * @fires Phaser.Textures.Events#ADD\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {HTMLImageElement} source - The source Image element.\r\n * @param {Phaser.Types.Textures.SpriteSheetConfig} config - The configuration object for this Sprite Sheet.\r\n *\r\n * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use.\r\n */\r\n addSpriteSheet: function (key, source, config)\r\n {\r\n var texture = null;\r\n\r\n if (this.checkKey(key))\r\n {\r\n texture = this.create(key, source);\r\n\r\n var width = texture.source[0].width;\r\n var height = texture.source[0].height;\r\n\r\n Parser.SpriteSheet(texture, 0, 0, 0, width, height, config);\r\n\r\n this.emit(Events.ADD, key, texture);\r\n }\r\n\r\n return texture;\r\n },\r\n\r\n /**\r\n * Adds a Sprite Sheet to this Texture Manager, where the Sprite Sheet exists as a Frame within a Texture Atlas.\r\n *\r\n * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact\r\n * same size and cannot be trimmed or rotated.\r\n *\r\n * @method Phaser.Textures.TextureManager#addSpriteSheetFromAtlas\r\n * @fires Phaser.Textures.Events#ADD\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {Phaser.Types.Textures.SpriteSheetFromAtlasConfig} config - The configuration object for this Sprite Sheet.\r\n *\r\n * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use.\r\n */\r\n addSpriteSheetFromAtlas: function (key, config)\r\n {\r\n if (!this.checkKey(key))\r\n {\r\n return null;\r\n }\r\n\r\n var atlasKey = GetValue(config, 'atlas', null);\r\n var atlasFrame = GetValue(config, 'frame', null);\r\n\r\n if (!atlasKey || !atlasFrame)\r\n {\r\n return;\r\n }\r\n\r\n var atlas = this.get(atlasKey);\r\n var sheet = atlas.get(atlasFrame);\r\n\r\n if (sheet)\r\n {\r\n var texture = this.create(key, sheet.source.image);\r\n\r\n if (sheet.trimmed)\r\n {\r\n // If trimmed we need to help the parser adjust\r\n Parser.SpriteSheetFromAtlas(texture, sheet, config);\r\n }\r\n else\r\n {\r\n Parser.SpriteSheet(texture, 0, sheet.cutX, sheet.cutY, sheet.cutWidth, sheet.cutHeight, config);\r\n }\r\n\r\n this.emit(Events.ADD, key, texture);\r\n\r\n return texture;\r\n }\r\n },\r\n\r\n /**\r\n * Creates a new Texture using the given source and dimensions.\r\n *\r\n * @method Phaser.Textures.TextureManager#create\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {HTMLImageElement} source - The source Image element.\r\n * @param {integer} width - The width of the Texture.\r\n * @param {integer} height - The height of the Texture.\r\n *\r\n * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use.\r\n */\r\n create: function (key, source, width, height)\r\n {\r\n var texture = null;\r\n\r\n if (this.checkKey(key))\r\n {\r\n texture = new Texture(this, key, source, width, height);\r\n\r\n this.list[key] = texture;\r\n }\r\n\r\n return texture;\r\n },\r\n\r\n /**\r\n * Checks the given key to see if a Texture using it exists within this Texture Manager.\r\n *\r\n * @method Phaser.Textures.TextureManager#exists\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n *\r\n * @return {boolean} Returns `true` if a Texture matching the given key exists in this Texture Manager.\r\n */\r\n exists: function (key)\r\n {\r\n return (this.list.hasOwnProperty(key));\r\n },\r\n\r\n /**\r\n * Returns a Texture from the Texture Manager that matches the given key.\r\n * \r\n * If the key is `undefined` it will return the `__DEFAULT` Texture.\r\n * \r\n * If the key is an instance of a Texture, it will return the key directly.\r\n * \r\n * Finally. if the key is given, but not found and not a Texture instance, it will return the `__MISSING` Texture.\r\n *\r\n * @method Phaser.Textures.TextureManager#get\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Textures.Texture)} key - The unique string-based key of the Texture, or a Texture instance.\r\n *\r\n * @return {Phaser.Textures.Texture} The Texture that was created.\r\n */\r\n get: function (key)\r\n {\r\n if (key === undefined) { key = '__DEFAULT'; }\r\n\r\n if (this.list[key])\r\n {\r\n return this.list[key];\r\n }\r\n else if (key instanceof Texture)\r\n {\r\n return key;\r\n }\r\n else\r\n {\r\n return this.list['__MISSING'];\r\n }\r\n },\r\n\r\n /**\r\n * Takes a Texture key and Frame name and returns a clone of that Frame if found.\r\n *\r\n * @method Phaser.Textures.TextureManager#cloneFrame\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {(string|integer)} frame - The string or index of the Frame to be cloned.\r\n *\r\n * @return {Phaser.Textures.Frame} A Clone of the given Frame.\r\n */\r\n cloneFrame: function (key, frame)\r\n {\r\n if (this.list[key])\r\n {\r\n return this.list[key].get(frame).clone();\r\n }\r\n },\r\n\r\n /**\r\n * Takes a Texture key and Frame name and returns a reference to that Frame, if found.\r\n *\r\n * @method Phaser.Textures.TextureManager#getFrame\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture.\r\n *\r\n * @return {Phaser.Textures.Frame} A Texture Frame object.\r\n */\r\n getFrame: function (key, frame)\r\n {\r\n if (this.list[key])\r\n {\r\n return this.list[key].get(frame);\r\n }\r\n },\r\n\r\n /**\r\n * Returns an array with all of the keys of all Textures in this Texture Manager.\r\n * The output array will exclude the `__DEFAULT` and `__MISSING` keys.\r\n *\r\n * @method Phaser.Textures.TextureManager#getTextureKeys\r\n * @since 3.0.0\r\n *\r\n * @return {string[]} An array containing all of the Texture keys stored in this Texture Manager.\r\n */\r\n getTextureKeys: function ()\r\n {\r\n var output = [];\r\n\r\n for (var key in this.list)\r\n {\r\n if (key !== '__DEFAULT' && key !== '__MISSING')\r\n {\r\n output.push(key);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Given a Texture and an `x` and `y` coordinate this method will return a new\r\n * Color object that has been populated with the color and alpha values of the pixel\r\n * at that location in the Texture.\r\n *\r\n * @method Phaser.Textures.TextureManager#getPixel\r\n * @since 3.0.0\r\n *\r\n * @param {integer} x - The x coordinate of the pixel within the Texture.\r\n * @param {integer} y - The y coordinate of the pixel within the Texture.\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {(string|integer)} [frame] - The string or index of the Frame.\r\n *\r\n * @return {?Phaser.Display.Color} A Color object populated with the color values of the requested pixel,\r\n * or `null` if the coordinates were out of bounds.\r\n */\r\n getPixel: function (x, y, key, frame)\r\n {\r\n var textureFrame = this.getFrame(key, frame);\r\n\r\n if (textureFrame)\r\n {\r\n // Adjust for trim (if not trimmed x and y are just zero)\r\n x -= textureFrame.x;\r\n y -= textureFrame.y;\r\n\r\n var data = textureFrame.data.cut;\r\n\r\n x += data.x;\r\n y += data.y;\r\n\r\n if (x >= data.x && x < data.r && y >= data.y && y < data.b)\r\n {\r\n var ctx = this._tempContext;\r\n\r\n ctx.clearRect(0, 0, 1, 1);\r\n ctx.drawImage(textureFrame.source.image, x, y, 1, 1, 0, 0, 1, 1);\r\n\r\n var rgb = ctx.getImageData(0, 0, 1, 1);\r\n\r\n return new Color(rgb.data[0], rgb.data[1], rgb.data[2], rgb.data[3]);\r\n }\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Given a Texture and an `x` and `y` coordinate this method will return a value between 0 and 255\r\n * corresponding to the alpha value of the pixel at that location in the Texture. If the coordinate\r\n * is out of bounds it will return null.\r\n *\r\n * @method Phaser.Textures.TextureManager#getPixelAlpha\r\n * @since 3.10.0\r\n *\r\n * @param {integer} x - The x coordinate of the pixel within the Texture.\r\n * @param {integer} y - The y coordinate of the pixel within the Texture.\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {(string|integer)} [frame] - The string or index of the Frame.\r\n *\r\n * @return {integer} A value between 0 and 255, or `null` if the coordinates were out of bounds.\r\n */\r\n getPixelAlpha: function (x, y, key, frame)\r\n {\r\n var textureFrame = this.getFrame(key, frame);\r\n\r\n if (textureFrame)\r\n {\r\n // Adjust for trim (if not trimmed x and y are just zero)\r\n x -= textureFrame.x;\r\n y -= textureFrame.y;\r\n\r\n var data = textureFrame.data.cut;\r\n\r\n x += data.x;\r\n y += data.y;\r\n\r\n if (x >= data.x && x < data.r && y >= data.y && y < data.b)\r\n {\r\n var ctx = this._tempContext;\r\n\r\n ctx.clearRect(0, 0, 1, 1);\r\n ctx.drawImage(textureFrame.source.image, x, y, 1, 1, 0, 0, 1, 1);\r\n \r\n var rgb = ctx.getImageData(0, 0, 1, 1);\r\n \r\n return rgb.data[3];\r\n }\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Sets the given Game Objects `texture` and `frame` properties so that it uses\r\n * the Texture and Frame specified in the `key` and `frame` arguments to this method.\r\n *\r\n * @method Phaser.Textures.TextureManager#setTexture\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the texture would be set on.\r\n * @param {string} key - The unique string-based key of the Texture.\r\n * @param {(string|integer)} [frame] - The string or index of the Frame.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The Game Object the texture was set on.\r\n */\r\n setTexture: function (gameObject, key, frame)\r\n {\r\n if (this.list[key])\r\n {\r\n gameObject.texture = this.list[key];\r\n gameObject.frame = gameObject.texture.get(frame);\r\n }\r\n\r\n return gameObject;\r\n },\r\n\r\n /**\r\n * Changes the key being used by a Texture to the new key provided.\r\n * \r\n * The old key is removed, allowing it to be re-used.\r\n * \r\n * Game Objects are linked to Textures by a reference to the Texture object, so\r\n * all existing references will be retained.\r\n *\r\n * @method Phaser.Textures.TextureManager#renameTexture\r\n * @since 3.12.0\r\n *\r\n * @param {string} currentKey - The current string-based key of the Texture you wish to rename.\r\n * @param {string} newKey - The new unique string-based key to use for the Texture.\r\n *\r\n * @return {boolean} `true` if the Texture key was successfully renamed, otherwise `false`.\r\n */\r\n renameTexture: function (currentKey, newKey)\r\n {\r\n var texture = this.get(currentKey);\r\n\r\n if (texture && currentKey !== newKey)\r\n {\r\n texture.key = newKey;\r\n\r\n this.list[newKey] = texture;\r\n\r\n delete this.list[currentKey];\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Passes all Textures to the given callback.\r\n *\r\n * @method Phaser.Textures.TextureManager#each\r\n * @since 3.0.0\r\n *\r\n * @param {EachTextureCallback} callback - The callback function to be sent the Textures.\r\n * @param {object} scope - The value to use as `this` when executing the callback.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\r\n */\r\n each: function (callback, scope)\r\n {\r\n var args = [ null ];\r\n\r\n for (var i = 1; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (var texture in this.list)\r\n {\r\n args[0] = this.list[texture];\r\n\r\n callback.apply(scope, args);\r\n }\r\n },\r\n\r\n /**\r\n * Destroys the Texture Manager and all Textures stored within it.\r\n *\r\n * @method Phaser.Textures.TextureManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n for (var texture in this.list)\r\n {\r\n this.list[texture].destroy();\r\n }\r\n\r\n this.list = {};\r\n\r\n this.game = null;\r\n\r\n CanvasPool.remove(this._tempCanvas);\r\n }\r\n\r\n});\r\n\r\nmodule.exports = TextureManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/TextureManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/TextureSource.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/textures/TextureSource.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CanvasPool = __webpack_require__(/*! ../display/canvas/CanvasPool */ \"./node_modules/phaser/src/display/canvas/CanvasPool.js\");\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar IsSizePowerOfTwo = __webpack_require__(/*! ../math/pow2/IsSizePowerOfTwo */ \"./node_modules/phaser/src/math/pow2/IsSizePowerOfTwo.js\");\r\nvar ScaleModes = __webpack_require__(/*! ../renderer/ScaleModes */ \"./node_modules/phaser/src/renderer/ScaleModes.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Texture Source is the encapsulation of the actual source data for a Texture.\r\n * \r\n * This is typically an Image Element, loaded from the file system or network, a Canvas Element or a Video Element.\r\n *\r\n * A Texture can contain multiple Texture Sources, which only happens when a multi-atlas is loaded.\r\n *\r\n * @class TextureSource\r\n * @memberof Phaser.Textures\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.Texture} texture - The Texture this TextureSource belongs to.\r\n * @param {(HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|Phaser.GameObjects.RenderTexture|WebGLTexture)} source - The source image data.\r\n * @param {integer} [width] - Optional width of the source image. If not given it's derived from the source itself.\r\n * @param {integer} [height] - Optional height of the source image. If not given it's derived from the source itself.\r\n * @param {boolean} [flipY=false] - Sets the `UNPACK_FLIP_Y_WEBGL` flag the WebGL Texture uses during upload.\r\n */\r\nvar TextureSource = new Class({\r\n\r\n initialize:\r\n\r\n function TextureSource (texture, source, width, height, flipY)\r\n {\r\n if (flipY === undefined) { flipY = false; }\r\n\r\n var game = texture.manager.game;\r\n\r\n /**\r\n * The Texture this TextureSource belongs to.\r\n *\r\n * @name Phaser.Textures.TextureSource#renderer\r\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\r\n * @since 3.7.0\r\n */\r\n this.renderer = game.renderer;\r\n\r\n /**\r\n * The Texture this TextureSource belongs to.\r\n *\r\n * @name Phaser.Textures.TextureSource#texture\r\n * @type {Phaser.Textures.Texture}\r\n * @since 3.0.0\r\n */\r\n this.texture = texture;\r\n\r\n /**\r\n * The source of the image data.\r\n * \r\n * This is either an Image Element, a Canvas Element, a Video Element, a RenderTexture or a WebGLTexture.\r\n *\r\n * @name Phaser.Textures.TextureSource#source\r\n * @type {(HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|Phaser.GameObjects.RenderTexture|WebGLTexture)}\r\n * @since 3.12.0\r\n */\r\n this.source = source;\r\n\r\n /**\r\n * The image data.\r\n * \r\n * This is either an Image element, Canvas element or a Video Element.\r\n *\r\n * @name Phaser.Textures.TextureSource#image\r\n * @type {(HTMLImageElement|HTMLCanvasElement|HTMLVideoElement)}\r\n * @since 3.0.0\r\n */\r\n this.image = source;\r\n\r\n /**\r\n * Currently un-used.\r\n *\r\n * @name Phaser.Textures.TextureSource#compressionAlgorithm\r\n * @type {integer}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.compressionAlgorithm = null;\r\n\r\n /**\r\n * The resolution of the source image.\r\n *\r\n * @name Phaser.Textures.TextureSource#resolution\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.resolution = 1;\r\n\r\n /**\r\n * The width of the source image. If not specified in the constructor it will check\r\n * the `naturalWidth` and then `width` properties of the source image.\r\n *\r\n * @name Phaser.Textures.TextureSource#width\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.width = width || source.naturalWidth || source.videoWidth || source.width || 0;\r\n\r\n /**\r\n * The height of the source image. If not specified in the constructor it will check\r\n * the `naturalHeight` and then `height` properties of the source image.\r\n *\r\n * @name Phaser.Textures.TextureSource#height\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.height = height || source.naturalHeight || source.videoHeight || source.height || 0;\r\n\r\n /**\r\n * The Scale Mode the image will use when rendering.\r\n * Either Linear or Nearest.\r\n *\r\n * @name Phaser.Textures.TextureSource#scaleMode\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.scaleMode = ScaleModes.DEFAULT;\r\n\r\n /**\r\n * Is the source image a Canvas Element?\r\n *\r\n * @name Phaser.Textures.TextureSource#isCanvas\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.isCanvas = (source instanceof HTMLCanvasElement);\r\n\r\n /**\r\n * Is the source image a Video Element?\r\n *\r\n * @name Phaser.Textures.TextureSource#isVideo\r\n * @type {boolean}\r\n * @since 3.20.0\r\n */\r\n this.isVideo = (window.hasOwnProperty('HTMLVideoElement') && source instanceof HTMLVideoElement);\r\n\r\n /**\r\n * Is the source image a Render Texture?\r\n *\r\n * @name Phaser.Textures.TextureSource#isRenderTexture\r\n * @type {boolean}\r\n * @since 3.12.0\r\n */\r\n this.isRenderTexture = (source.type === 'RenderTexture');\r\n\r\n /**\r\n * Is the source image a WebGLTexture?\r\n *\r\n * @name Phaser.Textures.TextureSource#isGLTexture\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.isGLTexture = (window.hasOwnProperty('WebGLTexture') && source instanceof WebGLTexture);\r\n\r\n /**\r\n * Are the source image dimensions a power of two?\r\n *\r\n * @name Phaser.Textures.TextureSource#isPowerOf2\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.isPowerOf2 = IsSizePowerOfTwo(this.width, this.height);\r\n\r\n /**\r\n * The WebGL Texture of the source image. If this TextureSource is driven from a WebGLTexture\r\n * already, then this is a reference to that WebGLTexture.\r\n *\r\n * @name Phaser.Textures.TextureSource#glTexture\r\n * @type {?WebGLTexture}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.glTexture = null;\r\n\r\n /**\r\n * Sets the `UNPACK_FLIP_Y_WEBGL` flag the WebGL Texture uses during upload.\r\n *\r\n * @name Phaser.Textures.TextureSource#flipY\r\n * @type {boolean}\r\n * @since 3.20.0\r\n */\r\n this.flipY = flipY;\r\n\r\n this.init(game);\r\n },\r\n\r\n /**\r\n * Creates a WebGL Texture, if required, and sets the Texture filter mode.\r\n *\r\n * @method Phaser.Textures.TextureSource#init\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Game} game - A reference to the Phaser Game instance.\r\n */\r\n init: function (game)\r\n {\r\n if (this.renderer)\r\n {\r\n if (this.renderer.gl)\r\n {\r\n if (this.isCanvas)\r\n {\r\n this.glTexture = this.renderer.createCanvasTexture(this.image, false, this.flipY);\r\n }\r\n else if (this.isVideo)\r\n {\r\n this.glTexture = this.renderer.createVideoTexture(this.image, false, this.flipY);\r\n }\r\n else if (this.isRenderTexture)\r\n {\r\n this.image = this.source.canvas;\r\n \r\n this.glTexture = this.renderer.createTextureFromSource(null, this.width, this.height, this.scaleMode);\r\n }\r\n else if (this.isGLTexture)\r\n {\r\n this.glTexture = this.source;\r\n }\r\n else\r\n {\r\n this.glTexture = this.renderer.createTextureFromSource(this.image, this.width, this.height, this.scaleMode);\r\n }\r\n }\r\n else if (this.isRenderTexture)\r\n {\r\n this.image = this.source.canvas;\r\n }\r\n }\r\n\r\n if (!game.config.antialias)\r\n {\r\n this.setFilter(1);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the Filter Mode for this Texture.\r\n *\r\n * The mode can be either Linear, the default, or Nearest.\r\n *\r\n * For pixel-art you should use Nearest.\r\n *\r\n * @method Phaser.Textures.TextureSource#setFilter\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.FilterMode} filterMode - The Filter Mode.\r\n */\r\n setFilter: function (filterMode)\r\n {\r\n if (this.renderer.gl)\r\n {\r\n this.renderer.setTextureFilter(this.glTexture, filterMode);\r\n }\r\n\r\n this.scaleMode = filterMode;\r\n },\r\n\r\n /**\r\n * Sets the `UNPACK_FLIP_Y_WEBGL` flag for the WebGL Texture during texture upload.\r\n *\r\n * @method Phaser.Textures.TextureSource#setFlipY\r\n * @since 3.20.0\r\n *\r\n * @param {boolean} [value=true] - Should the WebGL Texture be flipped on the Y axis on texture upload or not?\r\n */\r\n setFlipY: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.flipY = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * If this TextureSource is backed by a Canvas and is running under WebGL,\r\n * it updates the WebGLTexture using the canvas data.\r\n *\r\n * @method Phaser.Textures.TextureSource#update\r\n * @since 3.7.0\r\n */\r\n update: function ()\r\n {\r\n var gl = this.renderer.gl;\r\n\r\n if (gl && this.isCanvas)\r\n {\r\n this.glTexture = this.renderer.updateCanvasTexture(this.image, this.glTexture, this.flipY);\r\n }\r\n else if (gl && this.isVideo)\r\n {\r\n this.glTexture = this.renderer.updateVideoTexture(this.image, this.glTexture, this.flipY);\r\n }\r\n },\r\n\r\n /**\r\n * Destroys this Texture Source and nulls the references.\r\n *\r\n * @method Phaser.Textures.TextureSource#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n if (this.glTexture)\r\n {\r\n this.renderer.deleteTexture(this.glTexture);\r\n }\r\n\r\n if (this.isCanvas)\r\n {\r\n CanvasPool.remove(this.image);\r\n }\r\n\r\n this.renderer = null;\r\n this.texture = null;\r\n this.source = null;\r\n this.image = null;\r\n this.glTexture = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = TextureSource;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/TextureSource.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/const.js": /*!***************************************************!*\ !*** ./node_modules/phaser/src/textures/const.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Filter Types.\r\n *\r\n * @namespace Phaser.Textures.FilterMode\r\n * @memberof Phaser.Textures\r\n * @since 3.0.0\r\n */\r\nvar CONST = {\r\n\r\n /**\r\n * Linear filter type.\r\n * \r\n * @name Phaser.Textures.FilterMode.LINEAR\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LINEAR: 0,\r\n\r\n /**\r\n * Nearest neighbor filter type.\r\n * \r\n * @name Phaser.Textures.FilterMode.NEAREST\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n NEAREST: 1\r\n \r\n};\r\n\r\nmodule.exports = CONST;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/const.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/events/ADD_EVENT.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/textures/events/ADD_EVENT.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Texture Add Event.\r\n * \r\n * This event is dispatched by the Texture Manager when a texture is added to it.\r\n * \r\n * Listen to this event from within a Scene using: `this.textures.on('addtexture', listener)`.\r\n *\r\n * @event Phaser.Textures.Events#ADD\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the Texture that was added to the Texture Manager.\r\n * @param {Phaser.Textures.Texture} texture - A reference to the Texture that was added to the Texture Manager.\r\n */\r\nmodule.exports = 'addtexture';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/events/ADD_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/events/ERROR_EVENT.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/textures/events/ERROR_EVENT.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Texture Load Error Event.\r\n * \r\n * This event is dispatched by the Texture Manager when a texture it requested to load failed.\r\n * This only happens when base64 encoded textures fail. All other texture types are loaded via the Loader Plugin.\r\n * \r\n * Listen to this event from within a Scene using: `this.textures.on('onerror', listener)`.\r\n *\r\n * @event Phaser.Textures.Events#ERROR\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the Texture that failed to load into the Texture Manager.\r\n */\r\nmodule.exports = 'onerror';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/events/ERROR_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/events/LOAD_EVENT.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/textures/events/LOAD_EVENT.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Texture Load Event.\r\n * \r\n * This event is dispatched by the Texture Manager when a texture has finished loading on it.\r\n * This only happens for base64 encoded textures. All other texture types are loaded via the Loader Plugin.\r\n * \r\n * Listen to this event from within a Scene using: `this.textures.on('onload', listener)`.\r\n * \r\n * This event is dispatched after the [ADD]{@linkcode Phaser.Textures.Events#event:ADD} event.\r\n *\r\n * @event Phaser.Textures.Events#LOAD\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the Texture that was loaded by the Texture Manager.\r\n * @param {Phaser.Textures.Texture} texture - A reference to the Texture that was loaded by the Texture Manager.\r\n */\r\nmodule.exports = 'onload';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/events/LOAD_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/events/READY_EVENT.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/textures/events/READY_EVENT.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * This internal event signifies that the Texture Manager is now ready and the Game can continue booting.\r\n * \r\n * When a Phaser Game instance is booting for the first time, the Texture Manager has to wait on a couple of non-blocking\r\n * async events before it's fully ready to carry on. When those complete the Texture Manager emits this event via the Game\r\n * instance, which tells the Game to carry on booting.\r\n *\r\n * @event Phaser.Textures.Events#READY\r\n * @since 3.16.1\r\n */\r\nmodule.exports = 'ready';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/events/READY_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/events/REMOVE_EVENT.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/textures/events/REMOVE_EVENT.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Texture Remove Event.\r\n * \r\n * This event is dispatched by the Texture Manager when a texture is removed from it.\r\n * \r\n * Listen to this event from within a Scene using: `this.textures.on('removetexture', listener)`.\r\n * \r\n * If you have any Game Objects still using the removed texture, they will start throwing\r\n * errors the next time they try to render. Be sure to clear all use of the texture in this event handler.\r\n *\r\n * @event Phaser.Textures.Events#REMOVE\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the Texture that was removed from the Texture Manager.\r\n */\r\nmodule.exports = 'removetexture';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/events/REMOVE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/events/index.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/textures/events/index.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Textures.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n ADD: __webpack_require__(/*! ./ADD_EVENT */ \"./node_modules/phaser/src/textures/events/ADD_EVENT.js\"),\r\n ERROR: __webpack_require__(/*! ./ERROR_EVENT */ \"./node_modules/phaser/src/textures/events/ERROR_EVENT.js\"),\r\n LOAD: __webpack_require__(/*! ./LOAD_EVENT */ \"./node_modules/phaser/src/textures/events/LOAD_EVENT.js\"),\r\n READY: __webpack_require__(/*! ./READY_EVENT */ \"./node_modules/phaser/src/textures/events/READY_EVENT.js\"),\r\n REMOVE: __webpack_require__(/*! ./REMOVE_EVENT */ \"./node_modules/phaser/src/textures/events/REMOVE_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/index.js": /*!***************************************************!*\ !*** ./node_modules/phaser/src/textures/index.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Extend = __webpack_require__(/*! ../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\nvar FilterMode = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/textures/const.js\");\r\n\r\n/**\r\n * @namespace Phaser.Textures\r\n */\r\n\r\n/**\r\n * Linear filter type.\r\n * \r\n * @name Phaser.Textures.LINEAR\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n\r\n/**\r\n * Nearest Neighbor filter type.\r\n * \r\n * @name Phaser.Textures.NEAREST\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n\r\nvar Textures = {\r\n\r\n CanvasTexture: __webpack_require__(/*! ./CanvasTexture */ \"./node_modules/phaser/src/textures/CanvasTexture.js\"),\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/textures/events/index.js\"),\r\n FilterMode: FilterMode,\r\n Frame: __webpack_require__(/*! ./Frame */ \"./node_modules/phaser/src/textures/Frame.js\"),\r\n Parsers: __webpack_require__(/*! ./parsers */ \"./node_modules/phaser/src/textures/parsers/index.js\"),\r\n Texture: __webpack_require__(/*! ./Texture */ \"./node_modules/phaser/src/textures/Texture.js\"),\r\n TextureManager: __webpack_require__(/*! ./TextureManager */ \"./node_modules/phaser/src/textures/TextureManager.js\"),\r\n TextureSource: __webpack_require__(/*! ./TextureSource */ \"./node_modules/phaser/src/textures/TextureSource.js\")\r\n\r\n};\r\n\r\nTextures = Extend(false, Textures, FilterMode);\r\n\r\nmodule.exports = Textures;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/parsers/AtlasXML.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/textures/parsers/AtlasXML.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Parses an XML Texture Atlas object and adds all the Frames into a Texture.\r\n *\r\n * @function Phaser.Textures.Parsers.AtlasXML\r\n * @memberof Phaser.Textures.Parsers\r\n * @private\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to.\r\n * @param {integer} sourceIndex - The index of the TextureSource.\r\n * @param {*} xml - The XML data.\r\n *\r\n * @return {Phaser.Textures.Texture} The Texture modified by this parser.\r\n */\r\nvar AtlasXML = function (texture, sourceIndex, xml)\r\n{\r\n // Malformed?\r\n if (!xml.getElementsByTagName('TextureAtlas'))\r\n {\r\n console.warn('Invalid Texture Atlas XML given');\r\n return;\r\n }\r\n\r\n // Add in a __BASE entry (for the entire atlas)\r\n var source = texture.source[sourceIndex];\r\n\r\n texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height);\r\n\r\n // By this stage frames is a fully parsed array\r\n var frames = xml.getElementsByTagName('SubTexture');\r\n\r\n var newFrame;\r\n\r\n for (var i = 0; i < frames.length; i++)\r\n {\r\n var frame = frames[i].attributes;\r\n\r\n var name = frame.name.value;\r\n var x = parseInt(frame.x.value, 10);\r\n var y = parseInt(frame.y.value, 10);\r\n var width = parseInt(frame.width.value, 10);\r\n var height = parseInt(frame.height.value, 10);\r\n\r\n // The frame values are the exact coordinates to cut the frame out of the atlas from\r\n newFrame = texture.add(name, sourceIndex, x, y, width, height);\r\n\r\n // These are the original (non-trimmed) sprite values\r\n if (frame.frameX)\r\n {\r\n var frameX = Math.abs(parseInt(frame.frameX.value, 10));\r\n var frameY = Math.abs(parseInt(frame.frameY.value, 10));\r\n var frameWidth = parseInt(frame.frameWidth.value, 10);\r\n var frameHeight = parseInt(frame.frameHeight.value, 10);\r\n\r\n newFrame.setTrim(\r\n width,\r\n height,\r\n frameX,\r\n frameY,\r\n frameWidth,\r\n frameHeight\r\n );\r\n }\r\n }\r\n\r\n return texture;\r\n};\r\n\r\nmodule.exports = AtlasXML;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/parsers/AtlasXML.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/parsers/Canvas.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/textures/parsers/Canvas.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Adds a Canvas Element to a Texture.\r\n *\r\n * @function Phaser.Textures.Parsers.Canvas\r\n * @memberof Phaser.Textures.Parsers\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to.\r\n * @param {integer} sourceIndex - The index of the TextureSource.\r\n *\r\n * @return {Phaser.Textures.Texture} The Texture modified by this parser.\r\n */\r\nvar Canvas = function (texture, sourceIndex)\r\n{\r\n var source = texture.source[sourceIndex];\r\n\r\n texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height);\r\n\r\n return texture;\r\n};\r\n\r\nmodule.exports = Canvas;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/parsers/Canvas.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/parsers/Image.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/textures/parsers/Image.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Adds an Image Element to a Texture.\r\n *\r\n * @function Phaser.Textures.Parsers.Image\r\n * @memberof Phaser.Textures.Parsers\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to.\r\n * @param {integer} sourceIndex - The index of the TextureSource.\r\n *\r\n * @return {Phaser.Textures.Texture} The Texture modified by this parser.\r\n */\r\nvar Image = function (texture, sourceIndex)\r\n{\r\n var source = texture.source[sourceIndex];\r\n\r\n texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height);\r\n\r\n return texture;\r\n};\r\n\r\nmodule.exports = Image;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/parsers/Image.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/parsers/JSONArray.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/textures/parsers/JSONArray.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clone = __webpack_require__(/*! ../../utils/object/Clone */ \"./node_modules/phaser/src/utils/object/Clone.js\");\r\n\r\n/**\r\n * Parses a Texture Atlas JSON Array and adds the Frames to the Texture.\r\n * JSON format expected to match that defined by Texture Packer, with the frames property containing an array of Frames.\r\n *\r\n * @function Phaser.Textures.Parsers.JSONArray\r\n * @memberof Phaser.Textures.Parsers\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to.\r\n * @param {integer} sourceIndex - The index of the TextureSource.\r\n * @param {object} json - The JSON data.\r\n *\r\n * @return {Phaser.Textures.Texture} The Texture modified by this parser.\r\n */\r\nvar JSONArray = function (texture, sourceIndex, json)\r\n{\r\n // Malformed?\r\n if (!json['frames'] && !json['textures'])\r\n {\r\n console.warn('Invalid Texture Atlas JSON Array');\r\n return;\r\n }\r\n\r\n // Add in a __BASE entry (for the entire atlas)\r\n var source = texture.source[sourceIndex];\r\n\r\n texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height);\r\n\r\n // By this stage frames is a fully parsed array\r\n var frames = (Array.isArray(json.textures)) ? json.textures[sourceIndex].frames : json.frames;\r\n\r\n var newFrame;\r\n\r\n for (var i = 0; i < frames.length; i++)\r\n {\r\n var src = frames[i];\r\n\r\n // The frame values are the exact coordinates to cut the frame out of the atlas from\r\n newFrame = texture.add(src.filename, sourceIndex, src.frame.x, src.frame.y, src.frame.w, src.frame.h);\r\n\r\n // These are the original (non-trimmed) sprite values\r\n if (src.trimmed)\r\n {\r\n newFrame.setTrim(\r\n src.sourceSize.w,\r\n src.sourceSize.h,\r\n src.spriteSourceSize.x,\r\n src.spriteSourceSize.y,\r\n src.spriteSourceSize.w,\r\n src.spriteSourceSize.h\r\n );\r\n }\r\n\r\n if (src.rotated)\r\n {\r\n newFrame.rotated = true;\r\n newFrame.updateUVsInverted();\r\n }\r\n\r\n if (src.anchor)\r\n {\r\n newFrame.customPivot = true;\r\n newFrame.pivotX = src.anchor.x;\r\n newFrame.pivotY = src.anchor.y;\r\n }\r\n\r\n // Copy over any extra data\r\n newFrame.customData = Clone(src);\r\n }\r\n\r\n // Copy over any additional data that was in the JSON to Texture.customData\r\n for (var dataKey in json)\r\n {\r\n if (dataKey === 'frames')\r\n {\r\n continue;\r\n }\r\n\r\n if (Array.isArray(json[dataKey]))\r\n {\r\n texture.customData[dataKey] = json[dataKey].slice(0);\r\n }\r\n else\r\n {\r\n texture.customData[dataKey] = json[dataKey];\r\n }\r\n }\r\n\r\n return texture;\r\n};\r\n\r\nmodule.exports = JSONArray;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/parsers/JSONArray.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/parsers/JSONHash.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/textures/parsers/JSONHash.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clone = __webpack_require__(/*! ../../utils/object/Clone */ \"./node_modules/phaser/src/utils/object/Clone.js\");\r\n\r\n/**\r\n * Parses a Texture Atlas JSON Hash and adds the Frames to the Texture.\r\n * JSON format expected to match that defined by Texture Packer, with the frames property containing an object of Frames.\r\n *\r\n * @function Phaser.Textures.Parsers.JSONHash\r\n * @memberof Phaser.Textures.Parsers\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to.\r\n * @param {integer} sourceIndex - The index of the TextureSource.\r\n * @param {object} json - The JSON data.\r\n *\r\n * @return {Phaser.Textures.Texture} The Texture modified by this parser.\r\n */\r\nvar JSONHash = function (texture, sourceIndex, json)\r\n{\r\n // Malformed?\r\n if (!json['frames'])\r\n {\r\n console.warn('Invalid Texture Atlas JSON Hash given, missing \\'frames\\' Object');\r\n return;\r\n }\r\n\r\n // Add in a __BASE entry (for the entire atlas)\r\n var source = texture.source[sourceIndex];\r\n\r\n texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height);\r\n\r\n // By this stage frames is a fully parsed Object\r\n var frames = json['frames'];\r\n var newFrame;\r\n\r\n for (var key in frames)\r\n {\r\n var src = frames[key];\r\n\r\n // The frame values are the exact coordinates to cut the frame out of the atlas from\r\n newFrame = texture.add(key, sourceIndex, src.frame.x, src.frame.y, src.frame.w, src.frame.h);\r\n\r\n // These are the original (non-trimmed) sprite values\r\n if (src.trimmed)\r\n {\r\n newFrame.setTrim(\r\n src.sourceSize.w,\r\n src.sourceSize.h,\r\n src.spriteSourceSize.x,\r\n src.spriteSourceSize.y,\r\n src.spriteSourceSize.w,\r\n src.spriteSourceSize.h\r\n );\r\n }\r\n\r\n if (src.rotated)\r\n {\r\n newFrame.rotated = true;\r\n newFrame.updateUVsInverted();\r\n }\r\n\r\n // Copy over any extra data\r\n newFrame.customData = Clone(src);\r\n }\r\n\r\n // Copy over any additional data that was in the JSON to Texture.customData\r\n for (var dataKey in json)\r\n {\r\n if (dataKey === 'frames')\r\n {\r\n continue;\r\n }\r\n\r\n if (Array.isArray(json[dataKey]))\r\n {\r\n texture.customData[dataKey] = json[dataKey].slice(0);\r\n }\r\n else\r\n {\r\n texture.customData[dataKey] = json[dataKey];\r\n }\r\n }\r\n\r\n return texture;\r\n};\r\n\r\nmodule.exports = JSONHash;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/parsers/JSONHash.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/parsers/SpriteSheet.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/textures/parsers/SpriteSheet.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\n\r\n/**\r\n * Parses a Sprite Sheet and adds the Frames to the Texture.\r\n * \r\n * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact\r\n * same size and cannot be trimmed or rotated.\r\n *\r\n * @function Phaser.Textures.Parsers.SpriteSheet\r\n * @memberof Phaser.Textures.Parsers\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to.\r\n * @param {integer} sourceIndex - The index of the TextureSource.\r\n * @param {integer} x - [description]\r\n * @param {integer} y - [description]\r\n * @param {integer} width - [description]\r\n * @param {integer} height - [description]\r\n * @param {object} config - An object describing how to parse the Sprite Sheet.\r\n * @param {number} config.frameWidth - Width in pixels of a single frame in the sprite sheet.\r\n * @param {number} [config.frameHeight] - Height in pixels of a single frame in the sprite sheet. Defaults to frameWidth if not provided.\r\n * @param {number} [config.startFrame=0] - [description]\r\n * @param {number} [config.endFrame=-1] - [description]\r\n * @param {number} [config.margin=0] - If the frames have been drawn with a margin, specify the amount here.\r\n * @param {number} [config.spacing=0] - If the frames have been drawn with spacing between them, specify the amount here.\r\n *\r\n * @return {Phaser.Textures.Texture} The Texture modified by this parser.\r\n */\r\nvar SpriteSheet = function (texture, sourceIndex, x, y, width, height, config)\r\n{\r\n var frameWidth = GetFastValue(config, 'frameWidth', null);\r\n var frameHeight = GetFastValue(config, 'frameHeight', frameWidth);\r\n\r\n // If missing we can't proceed\r\n if (frameWidth === null)\r\n {\r\n throw new Error('TextureManager.SpriteSheet: Invalid frameWidth given.');\r\n }\r\n\r\n // Add in a __BASE entry (for the entire atlas)\r\n var source = texture.source[sourceIndex];\r\n\r\n texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height);\r\n\r\n var startFrame = GetFastValue(config, 'startFrame', 0);\r\n var endFrame = GetFastValue(config, 'endFrame', -1);\r\n var margin = GetFastValue(config, 'margin', 0);\r\n var spacing = GetFastValue(config, 'spacing', 0);\r\n\r\n var row = Math.floor((width - margin + spacing) / (frameWidth + spacing));\r\n var column = Math.floor((height - margin + spacing) / (frameHeight + spacing));\r\n var total = row * column;\r\n\r\n if (total === 0)\r\n {\r\n console.warn('SpriteSheet frame dimensions will result in zero frames.');\r\n }\r\n\r\n if (startFrame > total || startFrame < -total)\r\n {\r\n startFrame = 0;\r\n }\r\n\r\n if (startFrame < 0)\r\n {\r\n // Allow negative skipframes.\r\n startFrame = total + startFrame;\r\n }\r\n\r\n if (endFrame !== -1)\r\n {\r\n total = startFrame + (endFrame + 1);\r\n }\r\n\r\n var fx = margin;\r\n var fy = margin;\r\n var ax = 0;\r\n var ay = 0;\r\n\r\n for (var i = 0; i < total; i++)\r\n {\r\n ax = 0;\r\n ay = 0;\r\n\r\n var w = fx + frameWidth;\r\n var h = fy + frameHeight;\r\n\r\n if (w > width)\r\n {\r\n ax = w - width;\r\n }\r\n\r\n if (h > height)\r\n {\r\n ay = h - height;\r\n }\r\n\r\n texture.add(i, sourceIndex, x + fx, y + fy, frameWidth - ax, frameHeight - ay);\r\n\r\n fx += frameWidth + spacing;\r\n\r\n if (fx + frameWidth > width)\r\n {\r\n fx = margin;\r\n fy += frameHeight + spacing;\r\n }\r\n }\r\n\r\n return texture;\r\n};\r\n\r\nmodule.exports = SpriteSheet;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/parsers/SpriteSheet.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/parsers/SpriteSheetFromAtlas.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/textures/parsers/SpriteSheetFromAtlas.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\n\r\n/**\r\n * Parses a Sprite Sheet and adds the Frames to the Texture, where the Sprite Sheet is stored as a frame within an Atlas.\r\n *\r\n * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact\r\n * same size and cannot be trimmed or rotated.\r\n *\r\n * @function Phaser.Textures.Parsers.SpriteSheetFromAtlas\r\n * @memberof Phaser.Textures.Parsers\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to.\r\n * @param {Phaser.Textures.Frame} frame - The Frame that contains the Sprite Sheet.\r\n * @param {object} config - An object describing how to parse the Sprite Sheet.\r\n * @param {number} config.frameWidth - Width in pixels of a single frame in the sprite sheet.\r\n * @param {number} [config.frameHeight] - Height in pixels of a single frame in the sprite sheet. Defaults to frameWidth if not provided.\r\n * @param {number} [config.startFrame=0] - Index of the start frame in the sprite sheet\r\n * @param {number} [config.endFrame=-1] - Index of the end frame in the sprite sheet. -1 mean all the rest of the frames\r\n * @param {number} [config.margin=0] - If the frames have been drawn with a margin, specify the amount here.\r\n * @param {number} [config.spacing=0] - If the frames have been drawn with spacing between them, specify the amount here.\r\n *\r\n * @return {Phaser.Textures.Texture} The Texture modified by this parser.\r\n */\r\nvar SpriteSheetFromAtlas = function (texture, frame, config)\r\n{\r\n var frameWidth = GetFastValue(config, 'frameWidth', null);\r\n var frameHeight = GetFastValue(config, 'frameHeight', frameWidth);\r\n\r\n // If missing we can't proceed\r\n if (!frameWidth)\r\n {\r\n throw new Error('TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.');\r\n }\r\n\r\n // Add in a __BASE entry (for the entire atlas frame)\r\n var source = texture.source[0];\r\n texture.add('__BASE', 0, 0, 0, source.width, source.height);\r\n\r\n var startFrame = GetFastValue(config, 'startFrame', 0);\r\n var endFrame = GetFastValue(config, 'endFrame', -1);\r\n var margin = GetFastValue(config, 'margin', 0);\r\n var spacing = GetFastValue(config, 'spacing', 0);\r\n\r\n var x = frame.cutX;\r\n var y = frame.cutY;\r\n\r\n var cutWidth = frame.cutWidth;\r\n var cutHeight = frame.cutHeight;\r\n var sheetWidth = frame.realWidth;\r\n var sheetHeight = frame.realHeight;\r\n\r\n var row = Math.floor((sheetWidth - margin + spacing) / (frameWidth + spacing));\r\n var column = Math.floor((sheetHeight - margin + spacing) / (frameHeight + spacing));\r\n var total = row * column;\r\n\r\n // trim offsets\r\n\r\n var leftPad = frame.x;\r\n var leftWidth = frameWidth - leftPad;\r\n\r\n var rightWidth = frameWidth - ((sheetWidth - cutWidth) - leftPad);\r\n\r\n var topPad = frame.y;\r\n var topHeight = frameHeight - topPad;\r\n\r\n var bottomHeight = frameHeight - ((sheetHeight - cutHeight) - topPad);\r\n\r\n if (startFrame > total || startFrame < -total)\r\n {\r\n startFrame = 0;\r\n }\r\n\r\n if (startFrame < 0)\r\n {\r\n // Allow negative skipframes.\r\n startFrame = total + startFrame;\r\n }\r\n\r\n if (endFrame !== -1)\r\n {\r\n total = startFrame + (endFrame + 1);\r\n }\r\n\r\n var sheetFrame;\r\n var frameX = margin;\r\n var frameY = margin;\r\n var frameIndex = 0;\r\n var sourceIndex = frame.sourceIndex;\r\n\r\n for (var sheetY = 0; sheetY < column; sheetY++)\r\n {\r\n var topRow = (sheetY === 0);\r\n var bottomRow = (sheetY === column - 1);\r\n\r\n for (var sheetX = 0; sheetX < row; sheetX++)\r\n {\r\n var leftRow = (sheetX === 0);\r\n var rightRow = (sheetX === row - 1);\r\n\r\n sheetFrame = texture.add(frameIndex, sourceIndex, x + frameX, y + frameY, frameWidth, frameHeight);\r\n\r\n if (leftRow || topRow || rightRow || bottomRow)\r\n {\r\n var destX = (leftRow) ? leftPad : 0;\r\n var destY = (topRow) ? topPad : 0;\r\n\r\n var trimWidth = 0;\r\n var trimHeight = 0;\r\n\r\n if (leftRow)\r\n {\r\n trimWidth += (frameWidth - leftWidth);\r\n }\r\n\r\n if (rightRow)\r\n {\r\n trimWidth += (frameWidth - rightWidth);\r\n }\r\n\r\n if (topRow)\r\n {\r\n trimHeight += (frameHeight - topHeight);\r\n }\r\n\r\n if (bottomRow)\r\n {\r\n trimHeight += (frameHeight - bottomHeight);\r\n }\r\n\r\n var destWidth = frameWidth - trimWidth;\r\n var destHeight = frameHeight - trimHeight;\r\n\r\n sheetFrame.cutWidth = destWidth;\r\n sheetFrame.cutHeight = destHeight;\r\n\r\n sheetFrame.setTrim(frameWidth, frameHeight, destX, destY, destWidth, destHeight);\r\n }\r\n\r\n frameX += spacing;\r\n\r\n if (leftRow)\r\n {\r\n frameX += leftWidth;\r\n }\r\n else if (rightRow)\r\n {\r\n frameX += rightWidth;\r\n }\r\n else\r\n {\r\n frameX += frameWidth;\r\n }\r\n\r\n frameIndex++;\r\n }\r\n\r\n frameX = margin;\r\n frameY += spacing;\r\n\r\n if (topRow)\r\n {\r\n frameY += topHeight;\r\n }\r\n else if (bottomRow)\r\n {\r\n frameY += bottomHeight;\r\n }\r\n else\r\n {\r\n frameY += frameHeight;\r\n }\r\n }\r\n\r\n return texture;\r\n};\r\n\r\nmodule.exports = SpriteSheetFromAtlas;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/parsers/SpriteSheetFromAtlas.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/parsers/UnityYAML.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/textures/parsers/UnityYAML.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar imageHeight = 0;\r\n\r\n/**\r\n * @function addFrame\r\n * @private\r\n * @since 3.0.0\r\n */\r\nvar addFrame = function (texture, sourceIndex, name, frame)\r\n{\r\n // The frame values are the exact coordinates to cut the frame out of the atlas from\r\n\r\n var y = imageHeight - frame.y - frame.height;\r\n\r\n texture.add(name, sourceIndex, frame.x, y, frame.width, frame.height);\r\n\r\n // These are the original (non-trimmed) sprite values\r\n /*\r\n if (src.trimmed)\r\n {\r\n newFrame.setTrim(\r\n src.sourceSize.w,\r\n src.sourceSize.h,\r\n src.spriteSourceSize.x,\r\n src.spriteSourceSize.y,\r\n src.spriteSourceSize.w,\r\n src.spriteSourceSize.h\r\n );\r\n }\r\n */\r\n};\r\n\r\n/**\r\n * Parses a Unity YAML File and creates Frames in the Texture.\r\n * For more details about Sprite Meta Data see https://docs.unity3d.com/ScriptReference/SpriteMetaData.html\r\n *\r\n * @function Phaser.Textures.Parsers.UnityYAML\r\n * @memberof Phaser.Textures.Parsers\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to.\r\n * @param {integer} sourceIndex - The index of the TextureSource.\r\n * @param {object} yaml - The YAML data.\r\n *\r\n * @return {Phaser.Textures.Texture} The Texture modified by this parser.\r\n */\r\nvar UnityYAML = function (texture, sourceIndex, yaml)\r\n{\r\n // Add in a __BASE entry (for the entire atlas)\r\n var source = texture.source[sourceIndex];\r\n\r\n texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height);\r\n\r\n imageHeight = source.height;\r\n\r\n var data = yaml.split('\\n');\r\n\r\n var lineRegExp = /^[ ]*(- )*(\\w+)+[: ]+(.*)/;\r\n\r\n var prevSprite = '';\r\n var currentSprite = '';\r\n var rect = { x: 0, y: 0, width: 0, height: 0 };\r\n\r\n // var pivot = { x: 0, y: 0 };\r\n // var border = { x: 0, y: 0, z: 0, w: 0 };\r\n\r\n for (var i = 0; i < data.length; i++)\r\n {\r\n var results = data[i].match(lineRegExp);\r\n\r\n if (!results)\r\n {\r\n continue;\r\n }\r\n\r\n var isList = (results[1] === '- ');\r\n var key = results[2];\r\n var value = results[3];\r\n\r\n if (isList)\r\n {\r\n if (currentSprite !== prevSprite)\r\n {\r\n addFrame(texture, sourceIndex, currentSprite, rect);\r\n\r\n prevSprite = currentSprite;\r\n }\r\n\r\n rect = { x: 0, y: 0, width: 0, height: 0 };\r\n }\r\n\r\n if (key === 'name')\r\n {\r\n // Start new list\r\n currentSprite = value;\r\n continue;\r\n }\r\n\r\n switch (key)\r\n {\r\n case 'x':\r\n case 'y':\r\n case 'width':\r\n case 'height':\r\n rect[key] = parseInt(value, 10);\r\n break;\r\n\r\n // case 'pivot':\r\n // pivot = eval('var obj = ' + value);\r\n // break;\r\n\r\n // case 'border':\r\n // border = eval('var obj = ' + value);\r\n // break;\r\n }\r\n }\r\n\r\n if (currentSprite !== prevSprite)\r\n {\r\n addFrame(texture, sourceIndex, currentSprite, rect);\r\n }\r\n\r\n return texture;\r\n};\r\n\r\nmodule.exports = UnityYAML;\r\n\r\n/*\r\nExample data:\r\n\r\nTextureImporter:\r\n spritePivot: {x: .5, y: .5}\r\n spriteBorder: {x: 0, y: 0, z: 0, w: 0}\r\n spritePixelsToUnits: 100\r\n spriteSheet:\r\n sprites:\r\n - name: asteroids_0\r\n rect:\r\n serializedVersion: 2\r\n x: 5\r\n y: 328\r\n width: 65\r\n height: 82\r\n alignment: 0\r\n pivot: {x: 0, y: 0}\r\n border: {x: 0, y: 0, z: 0, w: 0}\r\n - name: asteroids_1\r\n rect:\r\n serializedVersion: 2\r\n x: 80\r\n y: 322\r\n width: 53\r\n height: 88\r\n alignment: 0\r\n pivot: {x: 0, y: 0}\r\n border: {x: 0, y: 0, z: 0, w: 0}\r\n spritePackingTag: Asteroids\r\n*/\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/parsers/UnityYAML.js?"); /***/ }), /***/ "./node_modules/phaser/src/textures/parsers/index.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/textures/parsers/index.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Textures.Parsers\r\n */\r\n\r\nmodule.exports = {\r\n\r\n AtlasXML: __webpack_require__(/*! ./AtlasXML */ \"./node_modules/phaser/src/textures/parsers/AtlasXML.js\"),\r\n Canvas: __webpack_require__(/*! ./Canvas */ \"./node_modules/phaser/src/textures/parsers/Canvas.js\"),\r\n Image: __webpack_require__(/*! ./Image */ \"./node_modules/phaser/src/textures/parsers/Image.js\"),\r\n JSONArray: __webpack_require__(/*! ./JSONArray */ \"./node_modules/phaser/src/textures/parsers/JSONArray.js\"),\r\n JSONHash: __webpack_require__(/*! ./JSONHash */ \"./node_modules/phaser/src/textures/parsers/JSONHash.js\"),\r\n SpriteSheet: __webpack_require__(/*! ./SpriteSheet */ \"./node_modules/phaser/src/textures/parsers/SpriteSheet.js\"),\r\n SpriteSheetFromAtlas: __webpack_require__(/*! ./SpriteSheetFromAtlas */ \"./node_modules/phaser/src/textures/parsers/SpriteSheetFromAtlas.js\"),\r\n UnityYAML: __webpack_require__(/*! ./UnityYAML */ \"./node_modules/phaser/src/textures/parsers/UnityYAML.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/textures/parsers/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/Formats.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/Formats.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Tilemaps.Formats\r\n */\r\n\r\nmodule.exports = {\r\n\r\n /**\r\n * CSV Map Type\r\n * \r\n * @name Phaser.Tilemaps.Formats.CSV\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n CSV: 0,\r\n\r\n /**\r\n * Tiled JSON Map Type\r\n * \r\n * @name Phaser.Tilemaps.Formats.TILED_JSON\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n TILED_JSON: 1,\r\n\r\n /**\r\n * 2D Array Map Type\r\n * \r\n * @name Phaser.Tilemaps.Formats.ARRAY_2D\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n ARRAY_2D: 2,\r\n\r\n /**\r\n * Weltmeister (Impact.js) Map Type\r\n * \r\n * @name Phaser.Tilemaps.Formats.WELTMEISTER\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n WELTMEISTER: 3\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/Formats.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/ImageCollection.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/ImageCollection.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * An Image Collection is a special Tile Set containing multiple images, with no slicing into each image.\r\n *\r\n * Image Collections are normally created automatically when Tiled data is loaded.\r\n *\r\n * @class ImageCollection\r\n * @memberof Phaser.Tilemaps\r\n * @constructor\r\n * @since 3.0.0\r\n * \r\n * @param {string} name - The name of the image collection in the map data.\r\n * @param {integer} firstgid - The first image index this image collection contains.\r\n * @param {integer} [width=32] - Width of widest image (in pixels).\r\n * @param {integer} [height=32] - Height of tallest image (in pixels).\r\n * @param {integer} [margin=0] - The margin around all images in the collection (in pixels).\r\n * @param {integer} [spacing=0] - The spacing between each image in the collection (in pixels).\r\n * @param {object} [properties={}] - Custom Image Collection properties.\r\n */\r\nvar ImageCollection = new Class({\r\n\r\n initialize:\r\n\r\n function ImageCollection (name, firstgid, width, height, margin, spacing, properties)\r\n {\r\n if (width === undefined || width <= 0) { width = 32; }\r\n if (height === undefined || height <= 0) { height = 32; }\r\n if (margin === undefined) { margin = 0; }\r\n if (spacing === undefined) { spacing = 0; }\r\n\r\n /**\r\n * The name of the Image Collection.\r\n * \r\n * @name Phaser.Tilemaps.ImageCollection#name\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * The Tiled firstgid value.\r\n * This is the starting index of the first image index this Image Collection contains.\r\n * \r\n * @name Phaser.Tilemaps.ImageCollection#firstgid\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.firstgid = firstgid | 0;\r\n\r\n /**\r\n * The width of the widest image (in pixels).\r\n * \r\n * @name Phaser.Tilemaps.ImageCollection#imageWidth\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.imageWidth = width | 0;\r\n\r\n /**\r\n * The height of the tallest image (in pixels).\r\n * \r\n * @name Phaser.Tilemaps.ImageCollection#imageHeight\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.imageHeight = height | 0;\r\n\r\n /**\r\n * The margin around the images in the collection (in pixels).\r\n * Use `setSpacing` to change.\r\n * \r\n * @name Phaser.Tilemaps.ImageCollection#imageMarge\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.imageMargin = margin | 0;\r\n\r\n /**\r\n * The spacing between each image in the collection (in pixels).\r\n * Use `setSpacing` to change.\r\n * \r\n * @name Phaser.Tilemaps.ImageCollection#imageSpacing\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.imageSpacing = spacing | 0;\r\n\r\n /**\r\n * Image Collection-specific properties that are typically defined in the Tiled editor.\r\n * \r\n * @name Phaser.Tilemaps.ImageCollection#properties\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.properties = properties || {};\r\n\r\n /**\r\n * The cached images that are a part of this collection.\r\n * \r\n * @name Phaser.Tilemaps.ImageCollection#images\r\n * @type {array}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.images = [];\r\n\r\n /**\r\n * The total number of images in the image collection.\r\n * \r\n * @name Phaser.Tilemaps.ImageCollection#total\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.total = 0;\r\n },\r\n\r\n /**\r\n * Returns true if and only if this image collection contains the given image index.\r\n *\r\n * @method Phaser.Tilemaps.ImageCollection#containsImageIndex\r\n * @since 3.0.0\r\n * \r\n * @param {integer} imageIndex - The image index to search for.\r\n * \r\n * @return {boolean} True if this Image Collection contains the given index.\r\n */\r\n containsImageIndex: function (imageIndex)\r\n {\r\n return (imageIndex >= this.firstgid && imageIndex < (this.firstgid + this.total));\r\n },\r\n\r\n /**\r\n * Add an image to this Image Collection.\r\n *\r\n * @method Phaser.Tilemaps.ImageCollection#addImage\r\n * @since 3.0.0\r\n * \r\n * @param {integer} gid - The gid of the image in the Image Collection.\r\n * @param {string} image - The the key of the image in the Image Collection and in the cache.\r\n *\r\n * @return {Phaser.Tilemaps.ImageCollection} This ImageCollection object.\r\n */\r\n addImage: function (gid, image)\r\n {\r\n this.images.push({ gid: gid, image: image });\r\n this.total++;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ImageCollection;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/ImageCollection.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/ParseToTilemap.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/ParseToTilemap.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Formats = __webpack_require__(/*! ./Formats */ \"./node_modules/phaser/src/tilemaps/Formats.js\");\r\nvar MapData = __webpack_require__(/*! ./mapdata/MapData */ \"./node_modules/phaser/src/tilemaps/mapdata/MapData.js\");\r\nvar Parse = __webpack_require__(/*! ./parsers/Parse */ \"./node_modules/phaser/src/tilemaps/parsers/Parse.js\");\r\nvar Tilemap = __webpack_require__(/*! ./Tilemap */ \"./node_modules/phaser/src/tilemaps/Tilemap.js\");\r\n\r\n/**\r\n * Create a Tilemap from the given key or data. If neither is given, make a blank Tilemap. When\r\n * loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing from\r\n * a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map data. For\r\n * an empty map, you should specify tileWidth, tileHeight, width & height.\r\n *\r\n * @function Phaser.Tilemaps.ParseToTilemap\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scene} scene - The Scene to which this Tilemap belongs.\r\n * @param {string} [key] - The key in the Phaser cache that corresponds to the loaded tilemap data.\r\n * @param {integer} [tileWidth=32] - The width of a tile in pixels.\r\n * @param {integer} [tileHeight=32] - The height of a tile in pixels.\r\n * @param {integer} [width=10] - The width of the map in tiles.\r\n * @param {integer} [height=10] - The height of the map in tiles.\r\n * @param {integer[][]} [data] - Instead of loading from the cache, you can also load directly from\r\n * a 2D array of tile indexes.\r\n * @param {boolean} [insertNull=false] - Controls how empty tiles, tiles with an index of -1, in the\r\n * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty\r\n * location will get a Tile object with an index of -1. If you've a large sparsely populated map and\r\n * the tile data doesn't need to change then setting this value to `true` will help with memory\r\n * consumption. However if your map is small or you need to update the tiles dynamically, then leave\r\n * the default value set.\r\n * \r\n * @return {Phaser.Tilemaps.Tilemap}\r\n */\r\nvar ParseToTilemap = function (scene, key, tileWidth, tileHeight, width, height, data, insertNull)\r\n{\r\n if (tileWidth === undefined) { tileWidth = 32; }\r\n if (tileHeight === undefined) { tileHeight = 32; }\r\n if (width === undefined) { width = 10; }\r\n if (height === undefined) { height = 10; }\r\n if (insertNull === undefined) { insertNull = false; }\r\n\r\n var mapData = null;\r\n\r\n if (Array.isArray(data))\r\n {\r\n var name = key !== undefined ? key : 'map';\r\n mapData = Parse(name, Formats.ARRAY_2D, data, tileWidth, tileHeight, insertNull);\r\n }\r\n else if (key !== undefined)\r\n {\r\n var tilemapData = scene.cache.tilemap.get(key);\r\n\r\n if (!tilemapData)\r\n {\r\n console.warn('No map data found for key ' + key);\r\n }\r\n else\r\n {\r\n mapData = Parse(key, tilemapData.format, tilemapData.data, tileWidth, tileHeight, insertNull);\r\n }\r\n }\r\n\r\n if (mapData === null)\r\n {\r\n mapData = new MapData({\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight,\r\n width: width,\r\n height: height\r\n });\r\n }\r\n\r\n return new Tilemap(scene, mapData);\r\n};\r\n\r\nmodule.exports = ParseToTilemap;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/ParseToTilemap.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/Tile.js": /*!**************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/Tile.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../gameobjects/components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar Rectangle = __webpack_require__(/*! ../geom/rectangle */ \"./node_modules/phaser/src/geom/rectangle/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Tile is a representation of a single tile within the Tilemap. This is a lightweight data\r\n * representation, so its position information is stored without factoring in scroll, layer\r\n * scale or layer position.\r\n *\r\n * @class Tile\r\n * @memberof Phaser.Tilemaps\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Tilemaps.LayerData} layer - The LayerData object in the Tilemap that this tile belongs to.\r\n * @param {integer} index - The unique index of this tile within the map.\r\n * @param {integer} x - The x coordinate of this tile in tile coordinates.\r\n * @param {integer} y - The y coordinate of this tile in tile coordinates.\r\n * @param {integer} width - Width of the tile in pixels.\r\n * @param {integer} height - Height of the tile in pixels.\r\n * @param {integer} baseWidth - The base width a tile in the map (in pixels). Tiled maps support\r\n * multiple tileset sizes within one map, but they are still placed at intervals of the base\r\n * tile width.\r\n * @param {integer} baseHeight - The base height of the tile in pixels (in pixels). Tiled maps\r\n * support multiple tileset sizes within one map, but they are still placed at intervals of the\r\n * base tile height.\r\n */\r\nvar Tile = new Class({\r\n\r\n Mixins: [\r\n Components.Alpha,\r\n Components.Flip,\r\n Components.Visible\r\n ],\r\n\r\n initialize:\r\n\r\n function Tile (layer, index, x, y, width, height, baseWidth, baseHeight)\r\n {\r\n /**\r\n * The LayerData in the Tilemap data that this tile belongs to.\r\n *\r\n * @name Phaser.Tilemaps.Tile#layer\r\n * @type {Phaser.Tilemaps.LayerData}\r\n * @since 3.0.0\r\n */\r\n this.layer = layer;\r\n\r\n /**\r\n * The index of this tile within the map data corresponding to the tileset, or -1 if this\r\n * represents a blank tile.\r\n *\r\n * @name Phaser.Tilemaps.Tile#index\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.index = index;\r\n\r\n /**\r\n * The x map coordinate of this tile in tile units.\r\n *\r\n * @name Phaser.Tilemaps.Tile#x\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.x = x;\r\n\r\n /**\r\n * The y map coordinate of this tile in tile units.\r\n *\r\n * @name Phaser.Tilemaps.Tile#y\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.y = y;\r\n\r\n /**\r\n * The width of the tile in pixels.\r\n *\r\n * @name Phaser.Tilemaps.Tile#width\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.width = width;\r\n\r\n /**\r\n * The height of the tile in pixels.\r\n *\r\n * @name Phaser.Tilemaps.Tile#height\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.height = height;\r\n\r\n /**\r\n * The map's base width of a tile in pixels. Tiled maps support multiple tileset sizes\r\n * within one map, but they are still placed at intervals of the base tile size.\r\n *\r\n * @name Phaser.Tilemaps.Tile#baseWidth\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.baseWidth = (baseWidth !== undefined) ? baseWidth : width;\r\n\r\n /**\r\n * The map's base height of a tile in pixels. Tiled maps support multiple tileset sizes\r\n * within one map, but they are still placed at intervals of the base tile size.\r\n *\r\n * @name Phaser.Tilemaps.Tile#baseHeight\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.baseHeight = (baseHeight !== undefined) ? baseHeight : height;\r\n\r\n /**\r\n * The x coordinate of the top left of this tile in pixels. This is relative to the top left\r\n * of the layer this tile is being rendered within. This property does NOT factor in camera\r\n * scroll, layer scale or layer position.\r\n *\r\n * @name Phaser.Tilemaps.Tile#pixelX\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.pixelX = 0;\r\n\r\n /**\r\n * The y coordinate of the top left of this tile in pixels. This is relative to the top left\r\n * of the layer this tile is being rendered within. This property does NOT factor in camera\r\n * scroll, layer scale or layer position.\r\n *\r\n * @name Phaser.Tilemaps.Tile#pixelY\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.pixelY = 0;\r\n\r\n this.updatePixelXY();\r\n\r\n /**\r\n * Tile specific properties. These usually come from Tiled.\r\n *\r\n * @name Phaser.Tilemaps.Tile#properties\r\n * @type {any}\r\n * @since 3.0.0\r\n */\r\n this.properties = {};\r\n\r\n /**\r\n * The rotation angle of this tile.\r\n *\r\n * @name Phaser.Tilemaps.Tile#rotation\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.rotation = 0;\r\n\r\n /**\r\n * Whether the tile should collide with any object on the left side.\r\n *\r\n * @name Phaser.Tilemaps.Tile#collideLeft\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.collideLeft = false;\r\n\r\n /**\r\n * Whether the tile should collide with any object on the right side.\r\n *\r\n * @name Phaser.Tilemaps.Tile#collideRight\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.collideRight = false;\r\n\r\n /**\r\n * Whether the tile should collide with any object on the top side.\r\n *\r\n * @name Phaser.Tilemaps.Tile#collideUp\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.collideUp = false;\r\n\r\n /**\r\n * Whether the tile should collide with any object on the bottom side.\r\n *\r\n * @name Phaser.Tilemaps.Tile#collideDown\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.collideDown = false;\r\n\r\n /**\r\n * Whether the tile's left edge is interesting for collisions.\r\n *\r\n * @name Phaser.Tilemaps.Tile#faceLeft\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.faceLeft = false;\r\n\r\n /**\r\n * Whether the tile's right edge is interesting for collisions.\r\n *\r\n * @name Phaser.Tilemaps.Tile#faceRight\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.faceRight = false;\r\n\r\n /**\r\n * Whether the tile's top edge is interesting for collisions.\r\n *\r\n * @name Phaser.Tilemaps.Tile#faceTop\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.faceTop = false;\r\n\r\n /**\r\n * Whether the tile's bottom edge is interesting for collisions.\r\n *\r\n * @name Phaser.Tilemaps.Tile#faceBottom\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.faceBottom = false;\r\n\r\n /**\r\n * Tile collision callback.\r\n *\r\n * @name Phaser.Tilemaps.Tile#collisionCallback\r\n * @type {function}\r\n * @since 3.0.0\r\n */\r\n this.collisionCallback = null;\r\n\r\n /**\r\n * The context in which the collision callback will be called.\r\n *\r\n * @name Phaser.Tilemaps.Tile#collisionCallbackContext\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.collisionCallbackContext = this;\r\n\r\n /**\r\n * The tint to apply to this tile. Note: tint is currently a single color value instead of\r\n * the 4 corner tint component on other GameObjects.\r\n *\r\n * @name Phaser.Tilemaps.Tile#tint\r\n * @type {number}\r\n * @default\r\n * @since 3.0.0\r\n */\r\n this.tint = 0xffffff;\r\n\r\n /**\r\n * An empty object where physics-engine specific information (e.g. bodies) may be stored.\r\n *\r\n * @name Phaser.Tilemaps.Tile#physics\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.physics = {};\r\n },\r\n\r\n /**\r\n * Check if the given x and y world coordinates are within this Tile. This does not factor in\r\n * camera scroll, layer scale or layer position.\r\n *\r\n * @method Phaser.Tilemaps.Tile#containsPoint\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate to test.\r\n * @param {number} y - The y coordinate to test.\r\n *\r\n * @return {boolean} True if the coordinates are within this Tile, otherwise false.\r\n */\r\n containsPoint: function (x, y)\r\n {\r\n return !(x < this.pixelX || y < this.pixelY || x > this.right || y > this.bottom);\r\n },\r\n\r\n /**\r\n * Copies the tile data & properties from the given tile to this tile. This copies everything\r\n * except for position and interesting faces.\r\n *\r\n * @method Phaser.Tilemaps.Tile#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tilemaps.Tile} tile - The tile to copy from.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} This Tile object.\r\n */\r\n copy: function (tile)\r\n {\r\n this.index = tile.index;\r\n this.alpha = tile.alpha;\r\n this.properties = tile.properties;\r\n this.visible = tile.visible;\r\n this.setFlip(tile.flipX, tile.flipY);\r\n this.tint = tile.tint;\r\n this.rotation = tile.rotation;\r\n this.collideUp = tile.collideUp;\r\n this.collideDown = tile.collideDown;\r\n this.collideLeft = tile.collideLeft;\r\n this.collideRight = tile.collideRight;\r\n this.collisionCallback = tile.collisionCallback;\r\n this.collisionCallbackContext = tile.collisionCallbackContext;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The collision group for this Tile, defined within the Tileset. This returns a reference to\r\n * the collision group stored within the Tileset, so any modification of the returned object\r\n * will impact all tiles that have the same index as this tile.\r\n *\r\n * @method Phaser.Tilemaps.Tile#getCollisionGroup\r\n * @since 3.0.0\r\n *\r\n * @return {?object} tileset\r\n */\r\n getCollisionGroup: function ()\r\n {\r\n return this.tileset ? this.tileset.getTileCollisionGroup(this.index) : null;\r\n },\r\n\r\n /**\r\n * The tile data for this Tile, defined within the Tileset. This typically contains Tiled\r\n * collision data, tile animations and terrain information. This returns a reference to the tile\r\n * data stored within the Tileset, so any modification of the returned object will impact all\r\n * tiles that have the same index as this tile.\r\n *\r\n * @method Phaser.Tilemaps.Tile#getTileData\r\n * @since 3.0.0\r\n *\r\n * @return {?object} tileset\r\n */\r\n getTileData: function ()\r\n {\r\n return this.tileset ? this.tileset.getTileData(this.index) : null;\r\n },\r\n\r\n /**\r\n * Gets the world X position of the left side of the tile, factoring in the layers position,\r\n * scale and scroll.\r\n *\r\n * @method Phaser.Tilemaps.Tile#getLeft\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check.\r\n *\r\n * @return {number}\r\n */\r\n getLeft: function (camera)\r\n {\r\n var tilemapLayer = this.tilemapLayer;\r\n\r\n return (tilemapLayer) ? tilemapLayer.tileToWorldX(this.x, camera) : this.x * this.baseWidth;\r\n },\r\n\r\n /**\r\n * Gets the world X position of the right side of the tile, factoring in the layer's position,\r\n * scale and scroll.\r\n *\r\n * @method Phaser.Tilemaps.Tile#getRight\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check.\r\n *\r\n * @return {number}\r\n */\r\n getRight: function (camera)\r\n {\r\n var tilemapLayer = this.tilemapLayer;\r\n\r\n return (tilemapLayer) ? this.getLeft(camera) + this.width * tilemapLayer.scaleX : this.getLeft(camera) + this.width;\r\n },\r\n\r\n /**\r\n * Gets the world Y position of the top side of the tile, factoring in the layer's position,\r\n * scale and scroll.\r\n *\r\n * @method Phaser.Tilemaps.Tile#getTop\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check.\r\n *\r\n * @return {number}\r\n */\r\n getTop: function (camera)\r\n {\r\n var tilemapLayer = this.tilemapLayer;\r\n\r\n // Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile in grid\r\n // units is the bottom left, so the y coordinate needs to be adjusted by the difference\r\n // between the base size and this tile's size.\r\n return tilemapLayer\r\n ? tilemapLayer.tileToWorldY(this.y, camera) - (this.height - this.baseHeight) * tilemapLayer.scaleY\r\n : this.y * this.baseHeight - (this.height - this.baseHeight);\r\n },\r\n\r\n /**\r\n * Gets the world Y position of the bottom side of the tile, factoring in the layer's position,\r\n * scale and scroll.\r\n\r\n * @method Phaser.Tilemaps.Tile#getBottom\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check.\r\n *\r\n * @return {number}\r\n */\r\n getBottom: function (camera)\r\n {\r\n var tilemapLayer = this.tilemapLayer;\r\n return tilemapLayer\r\n ? this.getTop(camera) + this.height * tilemapLayer.scaleY\r\n : this.getTop(camera) + this.height;\r\n },\r\n\r\n\r\n /**\r\n * Gets the world rectangle bounding box for the tile, factoring in the layers position,\r\n * scale and scroll.\r\n *\r\n * @method Phaser.Tilemaps.Tile#getBounds\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check.\r\n * @param {object} [output] - [description]\r\n *\r\n * @return {(Phaser.Geom.Rectangle|object)}\r\n */\r\n getBounds: function (camera, output)\r\n {\r\n if (output === undefined) { output = new Rectangle(); }\r\n\r\n output.x = this.getLeft();\r\n output.y = this.getTop();\r\n output.width = this.getRight() - output.x;\r\n output.height = this.getBottom() - output.y;\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Gets the world X position of the center of the tile, factoring in the layer's position,\r\n * scale and scroll.\r\n *\r\n * @method Phaser.Tilemaps.Tile#getCenterX\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check.\r\n *\r\n * @return {number}\r\n */\r\n getCenterX: function (camera)\r\n {\r\n return (this.getLeft(camera) + this.getRight(camera)) / 2;\r\n },\r\n\r\n /**\r\n * Gets the world Y position of the center of the tile, factoring in the layer's position,\r\n * scale and scroll.\r\n *\r\n * @method Phaser.Tilemaps.Tile#getCenterY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check.\r\n *\r\n * @return {number}\r\n */\r\n getCenterY: function (camera)\r\n {\r\n return (this.getTop(camera) + this.getBottom(camera)) / 2;\r\n },\r\n\r\n /**\r\n * Clean up memory.\r\n *\r\n * @method Phaser.Tilemaps.Tile#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.collisionCallback = undefined;\r\n this.collisionCallbackContext = undefined;\r\n this.properties = undefined;\r\n },\r\n\r\n /**\r\n * Check for intersection with this tile. This does not factor in camera scroll, layer scale or\r\n * layer position.\r\n *\r\n * @method Phaser.Tilemaps.Tile#intersects\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x axis in pixels.\r\n * @param {number} y - The y axis in pixels.\r\n * @param {number} right - The right point.\r\n * @param {number} bottom - The bottom point.\r\n *\r\n * @return {boolean}\r\n */\r\n intersects: function (x, y, right, bottom)\r\n {\r\n return !(\r\n right <= this.pixelX || bottom <= this.pixelY ||\r\n x >= this.right || y >= this.bottom\r\n );\r\n },\r\n\r\n /**\r\n * Checks if the tile is interesting.\r\n *\r\n * @method Phaser.Tilemaps.Tile#isInteresting\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} collides - If true, will consider the tile interesting if it collides on any side.\r\n * @param {boolean} faces - If true, will consider the tile interesting if it has an interesting face.\r\n *\r\n * @return {boolean} True if the Tile is interesting, otherwise false.\r\n */\r\n isInteresting: function (collides, faces)\r\n {\r\n if (collides && faces) { return (this.canCollide || this.hasInterestingFace); }\r\n else if (collides) { return this.collides; }\r\n else if (faces) { return this.hasInterestingFace; }\r\n return false;\r\n },\r\n\r\n /**\r\n * Reset collision status flags.\r\n *\r\n * @method Phaser.Tilemaps.Tile#resetCollision\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate interesting faces for this tile and its neighbors.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} This Tile object.\r\n */\r\n resetCollision: function (recalculateFaces)\r\n {\r\n if (recalculateFaces === undefined) { recalculateFaces = true; }\r\n\r\n this.collideLeft = false;\r\n this.collideRight = false;\r\n this.collideUp = false;\r\n this.collideDown = false;\r\n\r\n this.faceTop = false;\r\n this.faceBottom = false;\r\n this.faceLeft = false;\r\n this.faceRight = false;\r\n\r\n if (recalculateFaces)\r\n {\r\n var tilemapLayer = this.tilemapLayer;\r\n\r\n if (tilemapLayer)\r\n {\r\n this.tilemapLayer.calculateFacesAt(this.x, this.y);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset faces.\r\n *\r\n * @method Phaser.Tilemaps.Tile#resetFaces\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Tilemaps.Tile} This Tile object.\r\n */\r\n resetFaces: function ()\r\n {\r\n this.faceTop = false;\r\n this.faceBottom = false;\r\n this.faceLeft = false;\r\n this.faceRight = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the collision flags for each side of this tile and updates the interesting faces list.\r\n *\r\n * @method Phaser.Tilemaps.Tile#setCollision\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} left - Indicating collide with any object on the left.\r\n * @param {boolean} [right] - Indicating collide with any object on the right.\r\n * @param {boolean} [up] - Indicating collide with any object on the top.\r\n * @param {boolean} [down] - Indicating collide with any object on the bottom.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate interesting faces\r\n * for this tile and its neighbors.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} This Tile object.\r\n */\r\n setCollision: function (left, right, up, down, recalculateFaces)\r\n {\r\n if (right === undefined) { right = left; }\r\n if (up === undefined) { up = left; }\r\n if (down === undefined) { down = left; }\r\n if (recalculateFaces === undefined) { recalculateFaces = true; }\r\n\r\n this.collideLeft = left;\r\n this.collideRight = right;\r\n this.collideUp = up;\r\n this.collideDown = down;\r\n\r\n this.faceLeft = left;\r\n this.faceRight = right;\r\n this.faceTop = up;\r\n this.faceBottom = down;\r\n\r\n if (recalculateFaces)\r\n {\r\n var tilemapLayer = this.tilemapLayer;\r\n\r\n if (tilemapLayer)\r\n {\r\n this.tilemapLayer.calculateFacesAt(this.x, this.y);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set a callback to be called when this tile is hit by an object. The callback must true for\r\n * collision processing to take place.\r\n *\r\n * @method Phaser.Tilemaps.Tile#setCollisionCallback\r\n * @since 3.0.0\r\n *\r\n * @param {function} callback - Callback function.\r\n * @param {object} context - Callback will be called within this context.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} This Tile object.\r\n */\r\n setCollisionCallback: function (callback, context)\r\n {\r\n if (callback === null)\r\n {\r\n this.collisionCallback = undefined;\r\n this.collisionCallbackContext = undefined;\r\n }\r\n else\r\n {\r\n this.collisionCallback = callback;\r\n this.collisionCallbackContext = context;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the size of the tile and updates its pixelX and pixelY.\r\n *\r\n * @method Phaser.Tilemaps.Tile#setSize\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileWidth - The width of the tile in pixels.\r\n * @param {integer} tileHeight - The height of the tile in pixels.\r\n * @param {integer} baseWidth - The base width a tile in the map (in pixels).\r\n * @param {integer} baseHeight - The base height of the tile in pixels (in pixels).\r\n *\r\n * @return {Phaser.Tilemaps.Tile} This Tile object.\r\n */\r\n setSize: function (tileWidth, tileHeight, baseWidth, baseHeight)\r\n {\r\n if (tileWidth !== undefined) { this.width = tileWidth; }\r\n if (tileHeight !== undefined) { this.height = tileHeight; }\r\n if (baseWidth !== undefined) { this.baseWidth = baseWidth; }\r\n if (baseHeight !== undefined) { this.baseHeight = baseHeight; }\r\n\r\n this.updatePixelXY();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Used internally. Updates the tile's world XY position based on the current tile size.\r\n *\r\n * @method Phaser.Tilemaps.Tile#updatePixelXY\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Tilemaps.Tile} This Tile object.\r\n */\r\n updatePixelXY: function ()\r\n {\r\n // Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile is the\r\n // bottom left, while the Phaser renderer assumes the origin is the top left. The y\r\n // coordinate needs to be adjusted by the difference.\r\n this.pixelX = this.x * this.baseWidth;\r\n this.pixelY = this.y * this.baseHeight;\r\n\r\n // this.pixelY = this.y * this.baseHeight - (this.height - this.baseHeight);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * True if this tile can collide on any of its faces or has a collision callback set.\r\n *\r\n * @name Phaser.Tilemaps.Tile#canCollide\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n canCollide: {\r\n get: function ()\r\n {\r\n return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || this.collisionCallback);\r\n }\r\n },\r\n\r\n /**\r\n * True if this tile can collide on any of its faces.\r\n *\r\n * @name Phaser.Tilemaps.Tile#collides\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n collides: {\r\n get: function ()\r\n {\r\n return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown);\r\n }\r\n },\r\n\r\n /**\r\n * True if this tile has any interesting faces.\r\n *\r\n * @name Phaser.Tilemaps.Tile#hasInterestingFace\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n hasInterestingFace: {\r\n get: function ()\r\n {\r\n return (this.faceTop || this.faceBottom || this.faceLeft || this.faceRight);\r\n }\r\n },\r\n\r\n /**\r\n * The tileset that contains this Tile. This is null if accessed from a LayerData instance\r\n * before the tile is placed in a StaticTilemapLayer or DynamicTilemapLayer, or if the tile has\r\n * an index that doesn't correspond to any of the map's tilesets.\r\n *\r\n * @name Phaser.Tilemaps.Tile#tileset\r\n * @type {?Phaser.Tilemaps.Tileset}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n tileset: {\r\n\r\n get: function ()\r\n {\r\n var tilemapLayer = this.layer.tilemapLayer;\r\n\r\n if (tilemapLayer)\r\n {\r\n var tileset = tilemapLayer.gidMap[this.index];\r\n\r\n if (tileset)\r\n {\r\n return tileset;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The tilemap layer that contains this Tile. This will only return null if accessed from a\r\n * LayerData instance before the tile is placed within a StaticTilemapLayer or\r\n * DynamicTilemapLayer.\r\n *\r\n * @name Phaser.Tilemaps.Tile#tilemapLayer\r\n * @type {?Phaser.Tilemaps.StaticTilemapLayer|Phaser.Tilemaps.DynamicTilemapLayer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n tilemapLayer: {\r\n get: function ()\r\n {\r\n return this.layer.tilemapLayer;\r\n }\r\n },\r\n\r\n /**\r\n * The tilemap that contains this Tile. This will only return null if accessed from a LayerData\r\n * instance before the tile is placed within a StaticTilemapLayer or DynamicTilemapLayer.\r\n *\r\n * @name Phaser.Tilemaps.Tile#tilemap\r\n * @type {?Phaser.Tilemaps.Tilemap}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n tilemap: {\r\n get: function ()\r\n {\r\n var tilemapLayer = this.tilemapLayer;\r\n return tilemapLayer ? tilemapLayer.tilemap : null;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Tile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/Tile.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/Tilemap.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/Tilemap.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar DegToRad = __webpack_require__(/*! ../math/DegToRad */ \"./node_modules/phaser/src/math/DegToRad.js\");\r\nvar DynamicTilemapLayer = __webpack_require__(/*! ./dynamiclayer/DynamicTilemapLayer */ \"./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayer.js\");\r\nvar Extend = __webpack_require__(/*! ../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\nvar Formats = __webpack_require__(/*! ./Formats */ \"./node_modules/phaser/src/tilemaps/Formats.js\");\r\nvar LayerData = __webpack_require__(/*! ./mapdata/LayerData */ \"./node_modules/phaser/src/tilemaps/mapdata/LayerData.js\");\r\nvar Rotate = __webpack_require__(/*! ../math/Rotate */ \"./node_modules/phaser/src/math/Rotate.js\");\r\nvar SpliceOne = __webpack_require__(/*! ../utils/array/SpliceOne */ \"./node_modules/phaser/src/utils/array/SpliceOne.js\");\r\nvar StaticTilemapLayer = __webpack_require__(/*! ./staticlayer/StaticTilemapLayer */ \"./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayer.js\");\r\nvar Tile = __webpack_require__(/*! ./Tile */ \"./node_modules/phaser/src/tilemaps/Tile.js\");\r\nvar TilemapComponents = __webpack_require__(/*! ./components */ \"./node_modules/phaser/src/tilemaps/components/index.js\");\r\nvar Tileset = __webpack_require__(/*! ./Tileset */ \"./node_modules/phaser/src/tilemaps/Tileset.js\");\r\n\r\n/**\r\n * @callback TilemapFilterCallback\r\n *\r\n * @param {Phaser.GameObjects.GameObject} value - An object found in the filtered area.\r\n * @param {number} index - The index of the object within the array.\r\n * @param {Phaser.GameObjects.GameObject[]} array - An array of all the objects found.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The object.\r\n */\r\n\r\n/**\r\n * @callback TilemapFindCallback\r\n *\r\n * @param {Phaser.GameObjects.GameObject} value - An object found.\r\n * @param {number} index - The index of the object within the array.\r\n * @param {Phaser.GameObjects.GameObject[]} array - An array of all the objects found.\r\n *\r\n * @return {boolean} `true` if the callback should be invoked, otherwise `false`.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * A Tilemap is a container for Tilemap data. This isn't a display object, rather, it holds data\r\n * about the map and allows you to add tilesets and tilemap layers to it. A map can have one or\r\n * more tilemap layers (StaticTilemapLayer or DynamicTilemapLayer), which are the display\r\n * objects that actually render tiles.\r\n *\r\n * The Tilemap data be parsed from a Tiled JSON file, a CSV file or a 2D array. Tiled is a free\r\n * software package specifically for creating tile maps, and is available from:\r\n * http://www.mapeditor.org\r\n *\r\n * A Tilemap has handy methods for getting & manipulating the tiles within a layer. You can only\r\n * use the methods that change tiles (e.g. removeTileAt) on a DynamicTilemapLayer.\r\n *\r\n * Note that all Tilemaps use a base tile size to calculate dimensions from, but that a\r\n * StaticTilemapLayer or DynamicTilemapLayer may have its own unique tile size that overrides\r\n * it.\r\n *\r\n * As of Phaser 3.21.0, if your tilemap includes layer groups (a feature of Tiled 1.2.0+) these\r\n * will be traversed and the following properties will affect children:\r\n * - opacity (blended with parent) and visibility (parent overrides child)\r\n * - Vertical and horizontal offset\r\n * The grouping hierarchy is not preserved and all layers will be flattened into a single array.\r\n * Group layers are parsed during Tilemap construction but are discarded after parsing so dynamic\r\n * layers will NOT continue to be affected by a parent.\r\n *\r\n * To avoid duplicate layer names, a layer that is a child of a group layer will have its parent\r\n * group name prepended with a '/'. For example, consider a group called 'ParentGroup' with a\r\n * child called 'Layer 1'. In the Tilemap object, 'Layer 1' will have the name\r\n * 'ParentGroup/Layer 1'.\r\n *\r\n * @class Tilemap\r\n * @memberof Phaser.Tilemaps\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Tilemap belongs.\r\n * @param {Phaser.Tilemaps.MapData} mapData - A MapData instance containing Tilemap data.\r\n */\r\nvar Tilemap = new Class({\r\n\r\n initialize:\r\n\r\n function Tilemap (scene, mapData)\r\n {\r\n /**\r\n * @name Phaser.Tilemaps.Tilemap#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * The base width of a tile in pixels. Note that individual layers may have a different tile\r\n * width.\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#tileWidth\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.tileWidth = mapData.tileWidth;\r\n\r\n /**\r\n * The base height of a tile in pixels. Note that individual layers may have a different\r\n * tile height.\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#tileHeight\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.tileHeight = mapData.tileHeight;\r\n\r\n /**\r\n * The width of the map (in tiles).\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.width = mapData.width;\r\n\r\n /**\r\n * The height of the map (in tiles).\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.height = mapData.height;\r\n\r\n /**\r\n * The orientation of the map data (as specified in Tiled), usually 'orthogonal'.\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#orientation\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.orientation = mapData.orientation;\r\n\r\n /**\r\n * The render (draw) order of the map data (as specified in Tiled), usually 'right-down'.\r\n *\r\n * The draw orders are:\r\n *\r\n * right-down\r\n * left-down\r\n * right-up\r\n * left-up\r\n *\r\n * This can be changed via the `setRenderOrder` method.\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#renderOrder\r\n * @type {string}\r\n * @since 3.12.0\r\n */\r\n this.renderOrder = mapData.renderOrder;\r\n\r\n /**\r\n * The format of the map data.\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#format\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.format = mapData.format;\r\n\r\n /**\r\n * The version of the map data (as specified in Tiled, usually 1).\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#version\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.version = mapData.version;\r\n\r\n /**\r\n * Map specific properties as specified in Tiled.\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#properties\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.properties = mapData.properties;\r\n\r\n /**\r\n * The width of the map in pixels based on width * tileWidth.\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#widthInPixels\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.widthInPixels = mapData.widthInPixels;\r\n\r\n /**\r\n * The height of the map in pixels based on height * tileHeight.\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#heightInPixels\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.heightInPixels = mapData.heightInPixels;\r\n\r\n /**\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#imageCollections\r\n * @type {Phaser.Tilemaps.ImageCollection[]}\r\n * @since 3.0.0\r\n */\r\n this.imageCollections = mapData.imageCollections;\r\n\r\n /**\r\n * An array of Tiled Image Layers.\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#images\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.images = mapData.images;\r\n\r\n /**\r\n * An array of Tilemap layer data.\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#layers\r\n * @type {Phaser.Tilemaps.LayerData[]}\r\n * @since 3.0.0\r\n */\r\n this.layers = mapData.layers;\r\n\r\n /**\r\n * An array of Tilesets used in the map.\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#tilesets\r\n * @type {Phaser.Tilemaps.Tileset[]}\r\n * @since 3.0.0\r\n */\r\n this.tilesets = mapData.tilesets;\r\n\r\n /**\r\n * An array of ObjectLayer instances parsed from Tiled object layers.\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#objects\r\n * @type {Phaser.Tilemaps.ObjectLayer[]}\r\n * @since 3.0.0\r\n */\r\n this.objects = mapData.objects;\r\n\r\n /**\r\n * The index of the currently selected LayerData object.\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#currentLayerIndex\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.currentLayerIndex = 0;\r\n },\r\n\r\n /**\r\n * Sets the rendering (draw) order of the tiles in this map.\r\n *\r\n * The default is 'right-down', meaning it will order the tiles starting from the top-left,\r\n * drawing to the right and then moving down to the next row.\r\n *\r\n * The draw orders are:\r\n *\r\n * 0 = right-down\r\n * 1 = left-down\r\n * 2 = right-up\r\n * 3 = left-up\r\n *\r\n * Setting the render order does not change the tiles or how they are stored in the layer,\r\n * it purely impacts the order in which they are rendered.\r\n *\r\n * You can provide either an integer (0 to 3), or the string version of the order.\r\n *\r\n * Calling this method _after_ creating Static or Dynamic Tilemap Layers will **not** automatically\r\n * update them to use the new render order. If you call this method after creating layers, use their\r\n * own `setRenderOrder` methods to change them as needed.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#setRenderOrder\r\n * @since 3.12.0\r\n *\r\n * @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'.\r\n *\r\n * @return {this} This Tilemap object.\r\n */\r\n setRenderOrder: function (renderOrder)\r\n {\r\n var orders = [ 'right-down', 'left-down', 'right-up', 'left-up' ];\r\n\r\n if (typeof renderOrder === 'number')\r\n {\r\n renderOrder = orders[renderOrder];\r\n }\r\n\r\n if (orders.indexOf(renderOrder) > -1)\r\n {\r\n this.renderOrder = renderOrder;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds an image to the map to be used as a tileset. A single map may use multiple tilesets.\r\n * Note that the tileset name can be found in the JSON file exported from Tiled, or in the Tiled\r\n * editor.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#addTilesetImage\r\n * @since 3.0.0\r\n *\r\n * @param {string} tilesetName - The name of the tileset as specified in the map data.\r\n * @param {string} [key] - The key of the Phaser.Cache image used for this tileset. If\r\n * `undefined` or `null` it will look for an image with a key matching the tilesetName parameter.\r\n * @param {integer} [tileWidth] - The width of the tile (in pixels) in the Tileset Image. If not\r\n * given it will default to the map's tileWidth value, or the tileWidth specified in the Tiled\r\n * JSON file.\r\n * @param {integer} [tileHeight] - The height of the tiles (in pixels) in the Tileset Image. If\r\n * not given it will default to the map's tileHeight value, or the tileHeight specified in the\r\n * Tiled JSON file.\r\n * @param {integer} [tileMargin] - The margin around the tiles in the sheet (in pixels). If not\r\n * specified, it will default to 0 or the value specified in the Tiled JSON file.\r\n * @param {integer} [tileSpacing] - The spacing between each the tile in the sheet (in pixels).\r\n * If not specified, it will default to 0 or the value specified in the Tiled JSON file.\r\n * @param {integer} [gid=0] - If adding multiple tilesets to a blank map, specify the starting\r\n * GID this set will use here.\r\n *\r\n * @return {?Phaser.Tilemaps.Tileset} Returns the Tileset object that was created or updated, or null if it\r\n * failed.\r\n */\r\n addTilesetImage: function (tilesetName, key, tileWidth, tileHeight, tileMargin, tileSpacing, gid)\r\n {\r\n if (tilesetName === undefined) { return null; }\r\n if (key === undefined || key === null) { key = tilesetName; }\r\n\r\n if (!this.scene.sys.textures.exists(key))\r\n {\r\n console.warn('Invalid Tileset Image: ' + key);\r\n return null;\r\n }\r\n\r\n var texture = this.scene.sys.textures.get(key);\r\n\r\n var index = this.getTilesetIndex(tilesetName);\r\n\r\n if (index === null && this.format === Formats.TILED_JSON)\r\n {\r\n console.warn('No data found for Tileset: ' + tilesetName);\r\n return null;\r\n }\r\n\r\n var tileset = this.tilesets[index];\r\n\r\n if (tileset)\r\n {\r\n tileset.setTileSize(tileWidth, tileHeight);\r\n tileset.setSpacing(tileMargin, tileSpacing);\r\n tileset.setImage(texture);\r\n\r\n return tileset;\r\n }\r\n\r\n if (tileWidth === undefined) { tileWidth = this.tileWidth; }\r\n if (tileHeight === undefined) { tileHeight = this.tileHeight; }\r\n if (tileMargin === undefined) { tileMargin = 0; }\r\n if (tileSpacing === undefined) { tileSpacing = 0; }\r\n if (gid === undefined) { gid = 0; }\r\n\r\n tileset = new Tileset(tilesetName, gid, tileWidth, tileHeight, tileMargin, tileSpacing);\r\n\r\n tileset.setImage(texture);\r\n\r\n this.tilesets.push(tileset);\r\n\r\n return tileset;\r\n },\r\n\r\n /**\r\n * Turns the DynamicTilemapLayer associated with the given layer into a StaticTilemapLayer. If\r\n * no layer specified, the map's current layer is used. This is useful if you want to manipulate\r\n * a map at the start of a scene, but then make it non-manipulable and optimize it for speed.\r\n * Note: the DynamicTilemapLayer passed in is destroyed, so make sure to store the value\r\n * returned from this method if you want to manipulate the new StaticTilemapLayer.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#convertLayerToStatic\r\n * @since 3.0.0\r\n *\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer)} [layer] - The name of the layer from Tiled, the\r\n * index of the layer in the map, or a DynamicTilemapLayer.\r\n *\r\n * @return {?Phaser.Tilemaps.StaticTilemapLayer} Returns the new layer that was created, or null if it\r\n * failed.\r\n */\r\n convertLayerToStatic: function (layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n var dynamicLayer = layer.tilemapLayer;\r\n\r\n if (!dynamicLayer || !(dynamicLayer instanceof DynamicTilemapLayer))\r\n {\r\n return null;\r\n }\r\n\r\n var staticLayer = new StaticTilemapLayer(\r\n dynamicLayer.scene,\r\n dynamicLayer.tilemap,\r\n dynamicLayer.layerIndex,\r\n dynamicLayer.tileset,\r\n dynamicLayer.x,\r\n dynamicLayer.y\r\n );\r\n\r\n this.scene.sys.displayList.add(staticLayer);\r\n\r\n dynamicLayer.destroy();\r\n\r\n return staticLayer;\r\n },\r\n\r\n /**\r\n * Copies the tiles in the source rectangular area to a new destination (all specified in tile\r\n * coordinates) within the layer. This copies all tile properties & recalculates collision\r\n * information in the destination region.\r\n *\r\n * If no layer specified, the map's current layer is used. This cannot be applied to StaticTilemapLayers.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#copy\r\n * @since 3.0.0\r\n *\r\n * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels.\r\n * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels.\r\n * @param {integer} width - The width of the area to copy, in tiles, not pixels.\r\n * @param {integer} height - The height of the area to copy, in tiles, not pixels.\r\n * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels.\r\n * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.\r\n */\r\n copy: function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (this._isStaticCall(layer, 'copy')) { return this; }\r\n\r\n if (layer !== null)\r\n {\r\n TilemapComponents.Copy(\r\n srcTileX, srcTileY,\r\n width, height,\r\n destTileX, destTileY,\r\n recalculateFaces, layer\r\n );\r\n\r\n return this;\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n },\r\n\r\n /**\r\n * Creates a new and empty DynamicTilemapLayer. The currently selected layer in the map is set to this new layer.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#createBlankDynamicLayer\r\n * @since 3.0.0\r\n *\r\n * @param {string} name - The name of this layer. Must be unique within the map.\r\n * @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.\r\n * @param {number} [x=0] - The world x position where the top left of this layer will be placed.\r\n * @param {number} [y=0] - The world y position where the top left of this layer will be placed.\r\n * @param {integer} [width] - The width of the layer in tiles. If not specified, it will default to the map's width.\r\n * @param {integer} [height] - The height of the layer in tiles. If not specified, it will default to the map's height.\r\n * @param {integer} [tileWidth] - The width of the tiles the layer uses for calculations. If not specified, it will default to the map's tileWidth.\r\n * @param {integer} [tileHeight] - The height of the tiles the layer uses for calculations. If not specified, it will default to the map's tileHeight.\r\n *\r\n * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer that was created, or `null` if it failed.\r\n */\r\n createBlankDynamicLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = this.width; }\r\n if (height === undefined) { height = this.height; }\r\n if (tileWidth === undefined) { tileWidth = this.tileWidth; }\r\n if (tileHeight === undefined) { tileHeight = this.tileHeight; }\r\n\r\n var index = this.getLayerIndex(name);\r\n\r\n if (index !== null)\r\n {\r\n console.warn('Invalid Tilemap Layer ID: ' + name);\r\n return null;\r\n }\r\n\r\n var layerData = new LayerData({\r\n name: name,\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight,\r\n width: width,\r\n height: height\r\n });\r\n\r\n var row;\r\n\r\n for (var tileY = 0; tileY < height; tileY++)\r\n {\r\n row = [];\r\n\r\n for (var tileX = 0; tileX < width; tileX++)\r\n {\r\n row.push(new Tile(layerData, -1, tileX, tileY, tileWidth, tileHeight, this.tileWidth, this.tileHeight));\r\n }\r\n\r\n layerData.data.push(row);\r\n }\r\n\r\n this.layers.push(layerData);\r\n\r\n this.currentLayerIndex = this.layers.length - 1;\r\n\r\n var dynamicLayer = new DynamicTilemapLayer(this.scene, this, this.currentLayerIndex, tileset, x, y);\r\n\r\n dynamicLayer.setRenderOrder(this.renderOrder);\r\n\r\n this.scene.sys.displayList.add(dynamicLayer);\r\n\r\n return dynamicLayer;\r\n },\r\n\r\n /**\r\n * Creates a new DynamicTilemapLayer that renders the LayerData associated with the given\r\n * `layerID`. The currently selected layer in the map is set to this new layer.\r\n *\r\n * The `layerID` is important. If you've created your map in Tiled then you can get this by\r\n * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and\r\n * look at the layers[].name value. Either way it must match.\r\n *\r\n * Unlike a static layer, a dynamic layer can be modified. See DynamicTilemapLayer for more\r\n * information.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#createDynamicLayer\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled.\r\n * @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.\r\n * @param {number} [x=0] - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0.\r\n * @param {number} [y=0] - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0.\r\n *\r\n * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer was created, or null if it failed.\r\n */\r\n createDynamicLayer: function (layerID, tileset, x, y)\r\n {\r\n var index = this.getLayerIndex(layerID);\r\n\r\n if (index === null)\r\n {\r\n console.warn('Invalid Tilemap Layer ID: ' + layerID);\r\n\r\n if (typeof layerID === 'string')\r\n {\r\n console.warn('Valid tilelayer names:\\n\\t' + this.getTileLayerNames().join(',\\n\\t'));\r\n }\r\n\r\n return null;\r\n }\r\n\r\n var layerData = this.layers[index];\r\n\r\n // Check for an associated static or dynamic tilemap layer\r\n if (layerData.tilemapLayer)\r\n {\r\n console.warn('Tilemap Layer ID already exists:' + layerID);\r\n return null;\r\n }\r\n\r\n this.currentLayerIndex = index;\r\n\r\n // Default the x/y position to match Tiled layer offset, if it exists.\r\n\r\n if (x === undefined)\r\n {\r\n x = layerData.x;\r\n }\r\n\r\n if (y === undefined)\r\n {\r\n y = layerData.y;\r\n }\r\n\r\n var layer = new DynamicTilemapLayer(this.scene, this, index, tileset, x, y);\r\n\r\n layer.setRenderOrder(this.renderOrder);\r\n\r\n this.scene.sys.displayList.add(layer);\r\n\r\n return layer;\r\n },\r\n\r\n /**\r\n * Creates a Sprite for every object matching the given gid in the map data. All properties from\r\n * the map data objectgroup are copied into the `spriteConfig`, so you can use this as an easy\r\n * way to configure Sprite properties from within the map editor. For example giving an object a\r\n * property of alpha: 0.5 in the map editor will duplicate that when the Sprite is created.\r\n *\r\n * Custom object properties not sharing names with the Sprite's own properties are copied to the\r\n * Sprite's {@link Phaser.GameObjects.Sprite#data data store}.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#createFromObjects\r\n * @since 3.0.0\r\n *\r\n * @param {string} name - The name of the object layer (from Tiled) to create Sprites from.\r\n * @param {(integer|string)} id - Either the id (object), gid (tile object) or name (object or\r\n * tile object) from Tiled. Ids are unique in Tiled, but a gid is shared by all tile objects\r\n * with the same graphic. The same name can be used on multiple objects.\r\n * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e.\r\n * scene.make.sprite).\r\n * @param {Phaser.Scene} [scene=the scene the map is within] - The Scene to create the Sprites within.\r\n *\r\n * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created.\r\n */\r\n createFromObjects: function (name, id, spriteConfig, scene)\r\n {\r\n if (spriteConfig === undefined) { spriteConfig = {}; }\r\n if (scene === undefined) { scene = this.scene; }\r\n\r\n var objectLayer = this.getObjectLayer(name);\r\n\r\n if (!objectLayer)\r\n {\r\n console.warn('Cannot create from object. Invalid objectgroup name given: ' + name);\r\n\r\n if (typeof layerID === 'string')\r\n {\r\n console.warn('Valid objectgroup names:\\n\\t' + this.getObjectLayerNames().join(',\\n\\t'));\r\n }\r\n\r\n return null;\r\n }\r\n\r\n var objects = objectLayer.objects;\r\n var sprites = [];\r\n\r\n for (var i = 0; i < objects.length; i++)\r\n {\r\n var found = false;\r\n var obj = objects[i];\r\n\r\n if (obj.gid !== undefined && typeof id === 'number' && obj.gid === id ||\r\n obj.id !== undefined && typeof id === 'number' && obj.id === id ||\r\n obj.name !== undefined && typeof id === 'string' && obj.name === id)\r\n {\r\n found = true;\r\n }\r\n\r\n if (found)\r\n {\r\n var config = Extend({}, spriteConfig, obj.properties);\r\n\r\n config.x = obj.x;\r\n config.y = obj.y;\r\n\r\n var sprite = scene.make.sprite(config);\r\n\r\n sprite.name = obj.name;\r\n\r\n if (obj.width) { sprite.displayWidth = obj.width; }\r\n if (obj.height) { sprite.displayHeight = obj.height; }\r\n\r\n // Origin is (0, 1) in Tiled, so find the offset that matches the Sprite's origin.\r\n var offset = {\r\n x: sprite.originX * sprite.displayWidth,\r\n y: (sprite.originY - 1) * sprite.displayHeight\r\n };\r\n\r\n // If the object is rotated, then the origin offset also needs to be rotated.\r\n if (obj.rotation)\r\n {\r\n var angle = DegToRad(obj.rotation);\r\n Rotate(offset, angle);\r\n sprite.rotation = angle;\r\n }\r\n\r\n sprite.x += offset.x;\r\n sprite.y += offset.y;\r\n\r\n if (obj.flippedHorizontal !== undefined || obj.flippedVertical !== undefined)\r\n {\r\n sprite.setFlip(obj.flippedHorizontal, obj.flippedVertical);\r\n }\r\n\r\n if (!obj.visible) { sprite.visible = false; }\r\n\r\n for (var key in obj.properties)\r\n {\r\n if (sprite.hasOwnProperty(key))\r\n {\r\n continue;\r\n }\r\n\r\n sprite.setData(key, obj.properties[key]);\r\n }\r\n\r\n sprites.push(sprite);\r\n }\r\n }\r\n\r\n return sprites;\r\n },\r\n\r\n /**\r\n * Creates a Sprite for every object matching the given tile indexes in the layer. You can\r\n * optionally specify if each tile will be replaced with a new tile after the Sprite has been\r\n * created. This is useful if you want to lay down special tiles in a level that are converted to\r\n * Sprites, but want to replace the tile itself with a floor tile or similar once converted.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#createFromTiles\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from.\r\n * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted\r\n * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a\r\n * one-to-one mapping with the indexes array.\r\n * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite).\r\n * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.GameObjects.Sprite[]} Returns an array of Tiles, or null if the layer given was invalid.\r\n */\r\n createFromTiles: function (indexes, replacements, spriteConfig, scene, camera, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.CreateFromTiles(indexes, replacements, spriteConfig, scene, camera, layer);\r\n },\r\n\r\n /**\r\n * Creates a new StaticTilemapLayer that renders the LayerData associated with the given\r\n * `layerID`. The currently selected layer in the map is set to this new layer.\r\n *\r\n * The `layerID` is important. If you've created your map in Tiled then you can get this by\r\n * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and\r\n * look at the layers[].name value. Either way it must match.\r\n *\r\n * It's important to remember that a static layer cannot be modified. See StaticTilemapLayer for\r\n * more information.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#createStaticLayer\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled.\r\n * @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.\r\n * @param {number} [x=0] - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0.\r\n * @param {number} [y=0] - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0.\r\n *\r\n * @return {?Phaser.Tilemaps.StaticTilemapLayer} Returns the new layer was created, or null if it failed.\r\n */\r\n createStaticLayer: function (layerID, tileset, x, y)\r\n {\r\n var index = this.getLayerIndex(layerID);\r\n\r\n if (index === null)\r\n {\r\n console.warn('Invalid Tilemap Layer ID: ' + layerID);\r\n if (typeof layerID === 'string')\r\n {\r\n console.warn('Valid tilelayer names:\\n\\t' + this.getTileLayerNames().join(',\\n\\t'));\r\n }\r\n return null;\r\n }\r\n\r\n var layerData = this.layers[index];\r\n\r\n // Check for an associated static or dynamic tilemap layer\r\n if (layerData.tilemapLayer)\r\n {\r\n console.warn('Tilemap Layer ID already exists:' + layerID);\r\n return null;\r\n }\r\n\r\n this.currentLayerIndex = index;\r\n\r\n // Default the x/y position to match Tiled layer offset, if it exists.\r\n if (x === undefined && this.layers[index].x) { x = this.layers[index].x; }\r\n if (y === undefined && this.layers[index].y) { y = this.layers[index].y; }\r\n\r\n var layer = new StaticTilemapLayer(this.scene, this, index, tileset, x, y);\r\n\r\n layer.setRenderOrder(this.renderOrder);\r\n\r\n this.scene.sys.displayList.add(layer);\r\n\r\n return layer;\r\n },\r\n\r\n /**\r\n * Removes all layer data from this Tilemap and nulls the scene reference. This will destroy any\r\n * StaticTilemapLayers or DynamicTilemapLayers that have been linked to LayerData.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.removeAllLayers();\r\n this.tilesets.length = 0;\r\n this.objects.length = 0;\r\n this.scene = undefined;\r\n },\r\n\r\n /**\r\n * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the\r\n * specified index. Tiles will be set to collide if the given index is a colliding index.\r\n * Collision information in the region will be recalculated.\r\n *\r\n * If no layer specified, the map's current layer is used.\r\n * This cannot be applied to StaticTilemapLayers.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#fill\r\n * @since 3.0.0\r\n *\r\n * @param {integer} index - The tile index to fill the area with.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.\r\n */\r\n fill: function (index, tileX, tileY, width, height, recalculateFaces, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n if (this._isStaticCall(layer, 'fill')) { return this; }\r\n\r\n TilemapComponents.Fill(index, tileX, tileY, width, height, recalculateFaces, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * For each object in the given object layer, run the given filter callback function. Any\r\n * objects that pass the filter test (i.e. where the callback returns true) will returned as a\r\n * new array. Similar to Array.prototype.Filter in vanilla JS.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#filterObjects\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Tilemaps.ObjectLayer|string)} objectLayer - The name of an object layer (from Tiled) or an ObjectLayer instance.\r\n * @param {TilemapFilterCallback} callback - The callback. Each object in the given area will be passed to this callback as the first and only parameter.\r\n * @param {object} [context] - The context under which the callback should be run.\r\n *\r\n * @return {?Phaser.GameObjects.GameObject[]} An array of object that match the search, or null if the objectLayer given was invalid.\r\n */\r\n filterObjects: function (objectLayer, callback, context)\r\n {\r\n if (typeof objectLayer === 'string')\r\n {\r\n var name = objectLayer;\r\n\r\n objectLayer = this.getObjectLayer(objectLayer);\r\n\r\n if (!objectLayer)\r\n {\r\n console.warn('No object layer found with the name: ' + name);\r\n return null;\r\n }\r\n }\r\n\r\n return objectLayer.objects.filter(callback, context);\r\n },\r\n\r\n /**\r\n * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given\r\n * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns\r\n * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS.\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#filterTiles\r\n * @since 3.0.0\r\n *\r\n * @param {function} callback - The callback. Each tile in the given area will be passed to this\r\n * callback as the first and only parameter. The callback should return true for tiles that pass the\r\n * filter.\r\n * @param {object} [context] - The context under which the callback should be run.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid.\r\n */\r\n filterTiles: function (callback, context, tileX, tileY, width, height, filteringOptions, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.FilterTiles(callback, context, tileX, tileY, width, height, filteringOptions, layer);\r\n },\r\n\r\n /**\r\n * Searches the entire map layer for the first tile matching the given index, then returns that Tile\r\n * object. If no match is found, it returns null. The search starts from the top-left tile and\r\n * continues horizontally until it hits the end of the row, then it drops down to the next column.\r\n * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to\r\n * the top-left.\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#findByIndex\r\n * @since 3.0.0\r\n *\r\n * @param {integer} index - The tile index value to search for.\r\n * @param {integer} [skip=0] - The number of times to skip a matching tile before returning.\r\n * @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.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid.\r\n */\r\n findByIndex: function (findIndex, skip, reverse, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.FindByIndex(findIndex, skip, reverse, layer);\r\n },\r\n\r\n /**\r\n * Find the first object in the given object layer that satisfies the provided testing function.\r\n * I.e. finds the first object for which `callback` returns true. Similar to\r\n * Array.prototype.find in vanilla JS.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#findObject\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Tilemaps.ObjectLayer|string)} objectLayer - The name of an object layer (from Tiled) or an ObjectLayer instance.\r\n * @param {TilemapFindCallback} callback - The callback. Each object in the given area will be passed to this callback as the first and only parameter.\r\n * @param {object} [context] - The context under which the callback should be run.\r\n *\r\n * @return {?Phaser.GameObjects.GameObject} An object that matches the search, or null if no object found.\r\n */\r\n findObject: function (objectLayer, callback, context)\r\n {\r\n if (typeof objectLayer === 'string')\r\n {\r\n var name = objectLayer;\r\n\r\n objectLayer = this.getObjectLayer(objectLayer);\r\n\r\n if (!objectLayer)\r\n {\r\n console.warn('No object layer found with the name: ' + name);\r\n return null;\r\n }\r\n }\r\n\r\n return objectLayer.objects.find(callback, context) || null;\r\n },\r\n\r\n /**\r\n * Find the first tile in the given rectangular area (in tile coordinates) of the layer that\r\n * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns\r\n * true. Similar to Array.prototype.find in vanilla JS.\r\n * If no layer specified, the maps current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#findTile\r\n * @since 3.0.0\r\n *\r\n * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter.\r\n * @param {object} [context] - The context under which the callback should be run.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid.\r\n */\r\n findTile: function (callback, context, tileX, tileY, width, height, filteringOptions, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.FindTile(callback, context, tileX, tileY, width, height, filteringOptions, layer);\r\n },\r\n\r\n /**\r\n * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given\r\n * callback. Similar to Array.prototype.forEach in vanilla JS.\r\n *\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#forEachTile\r\n * @since 3.0.0\r\n *\r\n * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter.\r\n * @param {object} [context] - The context under which the callback should be run.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.\r\n */\r\n forEachTile: function (callback, context, tileX, tileY, width, height, filteringOptions, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.ForEachTile(callback, context, tileX, tileY, width, height, filteringOptions, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the image layer index based on its name.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getImageIndex\r\n * @since 3.0.0\r\n *\r\n * @param {string} name - The name of the image to get.\r\n *\r\n * @return {integer} The index of the image in this tilemap, or null if not found.\r\n */\r\n getImageIndex: function (name)\r\n {\r\n return this.getIndex(this.images, name);\r\n },\r\n\r\n /**\r\n * Return a list of all valid imagelayer names loaded in this Tilemap.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getImageLayerNames\r\n * @since 3.21.0\r\n *\r\n * @return {string[]} Array of valid imagelayer names / IDs loaded into this Tilemap.\r\n */\r\n getImageLayerNames: function ()\r\n {\r\n if (!this.images || !Array.isArray(this.images))\r\n {\r\n return [];\r\n }\r\n\r\n return this.images.map(function (image)\r\n {\r\n return image.name;\r\n });\r\n },\r\n\r\n /**\r\n * Internally used. Returns the index of the object in one of the Tilemaps arrays whose name\r\n * property matches the given `name`.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getIndex\r\n * @since 3.0.0\r\n *\r\n * @param {array} location - The Tilemap array to search.\r\n * @param {string} name - The name of the array element to get.\r\n *\r\n * @return {number} The index of the element in the array, or null if not found.\r\n */\r\n getIndex: function (location, name)\r\n {\r\n for (var i = 0; i < location.length; i++)\r\n {\r\n if (location[i].name === name)\r\n {\r\n return i;\r\n }\r\n }\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Gets the LayerData from this.layers that is associated with `layer`, or null if an invalid\r\n * `layer` is given.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getLayer\r\n * @since 3.0.0\r\n *\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the\r\n * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a\r\n * StaticTilemapLayer. If not given will default to the maps current layer index.\r\n *\r\n * @return {Phaser.Tilemaps.LayerData} The corresponding LayerData within this.layers.\r\n */\r\n getLayer: function (layer)\r\n {\r\n var index = this.getLayerIndex(layer);\r\n\r\n return (index !== null) ? this.layers[index] : null;\r\n },\r\n\r\n /**\r\n * Gets the ObjectLayer from this.objects that has the given `name`, or null if no ObjectLayer\r\n * is found with that name.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getObjectLayer\r\n * @since 3.0.0\r\n *\r\n * @param {string} [name] - The name of the object layer from Tiled.\r\n *\r\n * @return {?Phaser.Tilemaps.ObjectLayer} The corresponding ObjectLayer within this.objects or null.\r\n */\r\n getObjectLayer: function (name)\r\n {\r\n var index = this.getIndex(this.objects, name);\r\n\r\n return (index !== null) ? this.objects[index] : null;\r\n },\r\n\r\n /**\r\n * Return a list of all valid objectgroup names loaded in this Tilemap.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getObjectLayerNames\r\n * @since 3.21.0\r\n *\r\n * @return {string[]} Array of valid objectgroup names / IDs loaded into this Tilemap.\r\n */\r\n getObjectLayerNames: function ()\r\n {\r\n if (!this.objects || !Array.isArray(this.objects))\r\n {\r\n return [];\r\n }\r\n\r\n return this.objects.map(function (object)\r\n {\r\n return object.name;\r\n });\r\n },\r\n\r\n /**\r\n * Gets the LayerData index of the given `layer` within this.layers, or null if an invalid\r\n * `layer` is given.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getLayerIndex\r\n * @since 3.0.0\r\n *\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the\r\n * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a\r\n * StaticTilemapLayer. If not given will default to the map's current layer index.\r\n *\r\n * @return {integer} The LayerData index within this.layers.\r\n */\r\n getLayerIndex: function (layer)\r\n {\r\n if (layer === undefined)\r\n {\r\n return this.currentLayerIndex;\r\n }\r\n else if (typeof layer === 'string')\r\n {\r\n return this.getLayerIndexByName(layer);\r\n }\r\n else if (typeof layer === 'number' && layer < this.layers.length)\r\n {\r\n return layer;\r\n }\r\n else if (layer instanceof StaticTilemapLayer || layer instanceof DynamicTilemapLayer)\r\n {\r\n return layer.layerIndex;\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n },\r\n\r\n /**\r\n * Gets the index of the LayerData within this.layers that has the given `name`, or null if an\r\n * invalid `name` is given.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getLayerIndexByName\r\n * @since 3.0.0\r\n *\r\n * @param {string} name - The name of the layer to get.\r\n *\r\n * @return {integer} The LayerData index within this.layers.\r\n */\r\n getLayerIndexByName: function (name)\r\n {\r\n return this.getIndex(this.layers, name);\r\n },\r\n\r\n /**\r\n * Gets a tile at the given tile coordinates from the given layer.\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getTileAt\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels).\r\n * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels).\r\n * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid.\r\n */\r\n getTileAt: function (tileX, tileY, nonNull, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.GetTileAt(tileX, tileY, nonNull, layer);\r\n },\r\n\r\n /**\r\n * Gets a tile at the given world coordinates from the given layer.\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getTileAtWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - X position to get the tile from (given in pixels)\r\n * @param {number} worldY - Y position to get the tile from (given in pixels)\r\n * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid.\r\n */\r\n getTileAtWorldXY: function (worldX, worldY, nonNull, camera, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.GetTileAtWorldXY(worldX, worldY, nonNull, camera, layer);\r\n },\r\n\r\n /**\r\n * Return a list of all valid tilelayer names loaded in this Tilemap.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getTileLayerNames\r\n * @since 3.21.0\r\n *\r\n * @return {string[]} Array of valid tilelayer names / IDs loaded into this Tilemap.\r\n */\r\n getTileLayerNames: function ()\r\n {\r\n if (!this.layers || !Array.isArray(this.layers))\r\n {\r\n return [];\r\n }\r\n\r\n return this.layers.map(function (layer)\r\n {\r\n return layer.name;\r\n });\r\n },\r\n\r\n /**\r\n * Gets the tiles in the given rectangular area (in tile coordinates) of the layer.\r\n * If no layer specified, the maps current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getTilesWithin\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid.\r\n */\r\n getTilesWithin: function (tileX, tileY, width, height, filteringOptions, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer);\r\n },\r\n\r\n /**\r\n * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle,\r\n * Line, Rectangle or Triangle. The shape should be in world coordinates.\r\n * If no layer specified, the maps current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getTilesWithinShape\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid.\r\n */\r\n getTilesWithinShape: function (shape, filteringOptions, camera, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.GetTilesWithinShape(shape, filteringOptions, camera, layer);\r\n },\r\n\r\n /**\r\n * Gets the tiles in the given rectangular area (in world coordinates) of the layer.\r\n * If no layer specified, the maps current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getTilesWithinWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The world x coordinate for the top-left of the area.\r\n * @param {number} worldY - The world y coordinate for the top-left of the area.\r\n * @param {number} width - The width of the area.\r\n * @param {number} height - The height of the area.\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid.\r\n */\r\n getTilesWithinWorldXY: function (worldX, worldY, width, height, filteringOptions, camera, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.GetTilesWithinWorldXY(worldX, worldY, width, height, filteringOptions, camera, layer);\r\n },\r\n\r\n /**\r\n * Gets the Tileset that has the given `name`, or null if an invalid `name` is given.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getTileset\r\n * @since 3.14.0\r\n *\r\n * @param {string} name - The name of the Tileset to get.\r\n *\r\n * @return {?Phaser.Tilemaps.Tileset} The Tileset, or `null` if no matching named tileset was found.\r\n */\r\n getTileset: function (name)\r\n {\r\n var index = this.getIndex(this.tilesets, name);\r\n\r\n return (index !== null) ? this.tilesets[index] : null;\r\n },\r\n\r\n /**\r\n * Gets the index of the Tileset within this.tilesets that has the given `name`, or null if an\r\n * invalid `name` is given.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#getTilesetIndex\r\n * @since 3.0.0\r\n *\r\n * @param {string} name - The name of the Tileset to get.\r\n *\r\n * @return {integer} The Tileset index within this.tilesets.\r\n */\r\n getTilesetIndex: function (name)\r\n {\r\n return this.getIndex(this.tilesets, name);\r\n },\r\n\r\n /**\r\n * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns\r\n * false if there is no tile or if the tile at that location has an index of -1.\r\n *\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#hasTileAt\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?boolean} Returns a boolean, or null if the layer given was invalid.\r\n */\r\n hasTileAt: function (tileX, tileY, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.HasTileAt(tileX, tileY, layer);\r\n },\r\n\r\n /**\r\n * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns\r\n * false if there is no tile or if the tile at that location has an index of -1.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#hasTileAtWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The x coordinate, in pixels.\r\n * @param {number} worldY - The y coordinate, in pixels.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?boolean} Returns a boolean, or null if the layer given was invalid.\r\n */\r\n hasTileAtWorldXY: function (worldX, worldY, camera, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.HasTileAtWorldXY(worldX, worldY, camera, layer);\r\n },\r\n\r\n /**\r\n * The LayerData object that is currently selected in the map. You can set this property using\r\n * any type supported by setLayer.\r\n *\r\n * @name Phaser.Tilemaps.Tilemap#layer\r\n * @type {Phaser.Tilemaps.LayerData}\r\n * @since 3.0.0\r\n */\r\n layer: {\r\n get: function ()\r\n {\r\n return this.layers[this.currentLayerIndex];\r\n },\r\n\r\n set: function (layer)\r\n {\r\n this.setLayer(layer);\r\n }\r\n },\r\n\r\n /**\r\n * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index\r\n * or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified\r\n * location. If you pass in an index, only the index at the specified location will be changed.\r\n * Collision information will be recalculated at the specified location.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n *\r\n * This cannot be applied to StaticTilemapLayers.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#putTileAt\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object.\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid or the coordinates were out of bounds.\r\n */\r\n putTileAt: function (tile, tileX, tileY, recalculateFaces, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (this._isStaticCall(layer, 'putTileAt')) { return null; }\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.PutTileAt(tile, tileX, tileY, recalculateFaces, layer);\r\n },\r\n\r\n /**\r\n * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either\r\n * an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the\r\n * specified location. If you pass in an index, only the index at the specified location will be\r\n * changed. Collision information will be recalculated at the specified location.\r\n *\r\n * If no layer specified, the maps current layer is used. This\r\n * cannot be applied to StaticTilemapLayers.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#putTileAtWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object.\r\n * @param {number} worldX - The x coordinate, in pixels.\r\n * @param {number} worldY - The y coordinate, in pixels.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid.\r\n */\r\n putTileAtWorldXY: function (tile, worldX, worldY, recalculateFaces, camera, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (this._isStaticCall(layer, 'putTileAtWorldXY')) { return null; }\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.PutTileAtWorldXY(tile, worldX, worldY, recalculateFaces, camera, layer);\r\n },\r\n\r\n /**\r\n * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified\r\n * layer. The array can be composed of either tile indexes or Tile objects. If you pass in a Tile,\r\n * all attributes will be copied over to the specified location. If you pass in an index, only the\r\n * index at the specified location will be changed. Collision information will be recalculated\r\n * within the region tiles were changed.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n * This cannot be applied to StaticTilemapLayers.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#putTilesAt\r\n * @since 3.0.0\r\n *\r\n * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place.\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.\r\n */\r\n putTilesAt: function (tilesArray, tileX, tileY, recalculateFaces, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (this._isStaticCall(layer, 'putTilesAt')) { return this; }\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.PutTilesAt(tilesArray, tileX, tileY, recalculateFaces, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the\r\n * specified layer. Each tile will receive a new index. If an array of indexes is passed in, then\r\n * those will be used for randomly assigning new tile indexes. If an array is not provided, the\r\n * indexes found within the region (excluding -1) will be used for randomly assigning new tile\r\n * indexes. This method only modifies tile indexes and does not change collision information.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n * This cannot be applied to StaticTilemapLayers.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#randomize\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.\r\n */\r\n randomize: function (tileX, tileY, width, height, indexes, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (this._isStaticCall(layer, 'randomize')) { return this; }\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.Randomize(tileX, tileY, width, height, indexes, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting\r\n * faces are used internally for optimizing collisions against tiles. This method is mostly used\r\n * internally to optimize recalculating faces when only one tile has been changed.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#calculateFacesAt\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.\r\n */\r\n calculateFacesAt: function (tileX, tileY, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.CalculateFacesAt(tileX, tileY, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the\r\n * layer. Interesting faces are used internally for optimizing collisions against tiles. This method\r\n * is mostly used internally.\r\n *\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#calculateFacesWithin\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.\r\n */\r\n calculateFacesWithin: function (tileX, tileY, width, height, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.CalculateFacesWithin(tileX, tileY, width, height, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes the given TilemapLayer from this Tilemap without destroying it.\r\n *\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#removeLayer\r\n * @since 3.17.0\r\n *\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to be removed.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.\r\n */\r\n removeLayer: function (layer)\r\n {\r\n var index = this.getLayerIndex(layer);\r\n\r\n if (index !== null)\r\n {\r\n SpliceOne(this.layers, index);\r\n for (var i = index; i < this.layers.length; i++)\r\n {\r\n if (this.layers[i].tilemapLayer)\r\n {\r\n this.layers[i].tilemapLayer.layerIndex--;\r\n }\r\n }\r\n\r\n if (this.currentLayerIndex === index)\r\n {\r\n this.currentLayerIndex = 0;\r\n }\r\n\r\n return this;\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n },\r\n\r\n /**\r\n * Destroys the given TilemapLayer and removes it from this Tilemap.\r\n *\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#destroyLayer\r\n * @since 3.17.0\r\n *\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to be destroyed.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.\r\n */\r\n destroyLayer: function (layer)\r\n {\r\n var index = this.getLayerIndex(layer);\r\n\r\n if (index !== null)\r\n {\r\n layer = this.layers[index];\r\n\r\n layer.destroy();\r\n\r\n SpliceOne(this.layers, index);\r\n\r\n if (this.currentLayerIndex === index)\r\n {\r\n this.currentLayerIndex = 0;\r\n }\r\n\r\n return this;\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n },\r\n\r\n /**\r\n * Removes all layers from this Tilemap and destroys any associated StaticTilemapLayers or\r\n * DynamicTilemapLayers.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#removeAllLayers\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Tilemaps.Tilemap} This Tilemap object.\r\n */\r\n removeAllLayers: function ()\r\n {\r\n var layers = this.layers;\r\n\r\n // Destroy any StaticTilemapLayers or DynamicTilemapLayers that are stored in LayerData\r\n for (var i = 0; i < layers.length; i++)\r\n {\r\n if (layers[i].tilemapLayer)\r\n {\r\n layers[i].tilemapLayer.destroy(false);\r\n }\r\n }\r\n\r\n layers.length = 0;\r\n\r\n this.currentLayerIndex = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes the given Tile, or an array of Tiles, from the layer to which they belong,\r\n * and optionally recalculates the collision information.\r\n *\r\n * This cannot be applied to Tiles that belong to Static Tilemap Layers.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#removeTile\r\n * @since 3.17.0\r\n *\r\n * @param {(Phaser.Tilemaps.Tile|Phaser.Tilemaps.Tile[])} tiles - The Tile to remove, or an array of Tiles.\r\n * @param {integer} [replaceIndex=-1] - After removing the Tile, insert a brand new Tile into its location with the given index. Leave as -1 to just remove the tile.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n *\r\n * @return {Phaser.Tilemaps.Tile[]} Returns an array of Tiles that were removed.\r\n */\r\n removeTile: function (tiles, replaceIndex, recalculateFaces)\r\n {\r\n if (replaceIndex === undefined) { replaceIndex = -1; }\r\n if (recalculateFaces === undefined) { recalculateFaces = true; }\r\n\r\n var removed = [];\r\n\r\n if (!Array.isArray(tiles))\r\n {\r\n tiles = [ tiles ];\r\n }\r\n\r\n for (var i = 0; i < tiles.length; i++)\r\n {\r\n var tile = tiles[i];\r\n\r\n removed.push(this.removeTileAt(tile.x, tile.y, true, recalculateFaces, tile.tilemapLayer));\r\n\r\n if (replaceIndex > -1)\r\n {\r\n this.putTileAt(replaceIndex, tile.x, tile.y, recalculateFaces, tile.tilemapLayer);\r\n }\r\n }\r\n\r\n return removed;\r\n },\r\n\r\n /**\r\n * Removes the tile at the given tile coordinates in the specified layer and updates the layer's\r\n * collision information.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n * This cannot be applied to StaticTilemapLayers.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#removeTileAt\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @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.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile} Returns the Tile that was removed, or null if the layer given was invalid.\r\n */\r\n removeTileAt: function (tileX, tileY, replaceWithNull, recalculateFaces, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (this._isStaticCall(layer, 'removeTileAt')) { return null; }\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.RemoveTileAt(tileX, tileY, replaceWithNull, recalculateFaces, layer);\r\n },\r\n\r\n /**\r\n * Removes the tile at the given world coordinates in the specified layer and updates the layer's\r\n * collision information.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n * This cannot be applied to StaticTilemapLayers.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#removeTileAtWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The x coordinate, in pixels.\r\n * @param {number} worldY - The y coordinate, in pixels.\r\n * @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.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid.\r\n */\r\n removeTileAtWorldXY: function (worldX, worldY, replaceWithNull, recalculateFaces, camera, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (this._isStaticCall(layer, 'removeTileAtWorldXY')) { return null; }\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.RemoveTileAtWorldXY(worldX, worldY, replaceWithNull, recalculateFaces, camera, layer);\r\n },\r\n\r\n /**\r\n * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to\r\n * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles\r\n * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation\r\n * wherever you want on the screen.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#renderDebug\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon.\r\n * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.\r\n */\r\n renderDebug: function (graphics, styleConfig, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.RenderDebug(graphics, styleConfig, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Draws a debug representation of all layers within this Tilemap to the given Graphics object.\r\n *\r\n * This is helpful when you want to get a quick idea of which of your tiles are colliding and which\r\n * have interesting faces. The tiles are drawn starting at (0, 0) in the Graphics, allowing you to\r\n * place the debug representation wherever you want on the screen.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#renderDebugFull\r\n * @since 3.17.0\r\n *\r\n * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon.\r\n * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.\r\n */\r\n renderDebugFull: function (graphics, styleConfig)\r\n {\r\n var layers = this.layers;\r\n\r\n // Destroy any StaticTilemapLayers or DynamicTilemapLayers that are stored in LayerData\r\n for (var i = 0; i < layers.length; i++)\r\n {\r\n TilemapComponents.RenderDebug(graphics, styleConfig, layers[i]);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching\r\n * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does\r\n * not change collision information.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n * This cannot be applied to StaticTilemapLayers.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#replaceByIndex\r\n * @since 3.0.0\r\n *\r\n * @param {integer} findIndex - The index of the tile to search for.\r\n * @param {integer} newIndex - The index of the tile to replace it with.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.\r\n */\r\n replaceByIndex: function (findIndex, newIndex, tileX, tileY, width, height, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (this._isStaticCall(layer, 'replaceByIndex')) { return this; }\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.ReplaceByIndex(findIndex, newIndex, tileX, tileY, width, height, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets collision on the given tile or tiles within a layer by index. You can pass in either a\r\n * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if\r\n * collision will be enabled (true) or disabled (false).\r\n *\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#setCollision\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.\r\n */\r\n setCollision: function (indexes, collides, recalculateFaces, layer, updateLayer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.SetCollision(indexes, collides, recalculateFaces, layer, updateLayer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets collision on a range of tiles in a layer whose index is between the specified `start` and\r\n * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set\r\n * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be\r\n * enabled (true) or disabled (false).\r\n *\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#setCollisionBetween\r\n * @since 3.0.0\r\n *\r\n * @param {integer} start - The first index of the tile to be set for collision.\r\n * @param {integer} stop - The last index of the tile to be set for collision.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.\r\n */\r\n setCollisionBetween: function (start, stop, collides, recalculateFaces, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.SetCollisionBetween(start, stop, collides, recalculateFaces, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property\r\n * that matches the given properties object, its collision flag will be set. The `collides`\r\n * parameter controls if collision will be enabled (true) or disabled (false). Passing in\r\n * `{ collides: true }` would update the collision flag on any tiles with a \"collides\" property that\r\n * has a value of true. Any tile that doesn't have \"collides\" set to true will be ignored. You can\r\n * also use an array of values, e.g. `{ types: [\"stone\", \"lava\", \"sand\" ] }`. If a tile has a\r\n * \"types\" property that matches any of those values, its collision flag will be updated.\r\n *\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#setCollisionByProperty\r\n * @since 3.0.0\r\n *\r\n * @param {object} properties - An object with tile properties and corresponding values that should be checked.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.\r\n */\r\n setCollisionByProperty: function (properties, collides, recalculateFaces, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.SetCollisionByProperty(properties, collides, recalculateFaces, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets collision on all tiles in the given layer, except for tiles that have an index specified in\r\n * the given array. The `collides` parameter controls if collision will be enabled (true) or\r\n * disabled (false).\r\n *\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#setCollisionByExclusion\r\n * @since 3.0.0\r\n *\r\n * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.\r\n */\r\n setCollisionByExclusion: function (indexes, collides, recalculateFaces, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.SetCollisionByExclusion(indexes, collides, recalculateFaces, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets collision on the tiles within a layer by checking each tile's collision group data\r\n * (typically defined in Tiled within the tileset collision editor). If any objects are found within\r\n * a tile's collision group, the tile's colliding information will be set. The `collides` parameter\r\n * controls if collision will be enabled (true) or disabled (false).\r\n *\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#setCollisionFromCollisionGroup\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.\r\n */\r\n setCollisionFromCollisionGroup: function (collides, recalculateFaces, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.SetCollisionFromCollisionGroup(collides, recalculateFaces, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a global collision callback for the given tile index within the layer. This will affect all\r\n * tiles on this layer that have the same index. If a callback is already set for the tile index it\r\n * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile\r\n * at a specific location on the map then see setTileLocationCallback.\r\n *\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#setTileIndexCallback\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for.\r\n * @param {function} callback - The callback that will be invoked when the tile is collided with.\r\n * @param {object} callbackContext - The context under which the callback is called.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.\r\n */\r\n setTileIndexCallback: function (indexes, callback, callbackContext, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.SetTileIndexCallback(indexes, callback, callbackContext, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer.\r\n * If a callback is already set for the tile index it will be replaced. Set the callback to null to\r\n * remove it.\r\n *\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#setTileLocationCallback\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} width - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} height - How many tiles tall from the `tileY` index the area will be.\r\n * @param {function} callback - The callback that will be invoked when the tile is collided with.\r\n * @param {object} [callbackContext] - The context under which the callback is called.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.\r\n */\r\n setTileLocationCallback: function (tileX, tileY, width, height, callback, callbackContext, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.SetTileLocationCallback(tileX, tileY, width, height, callback, callbackContext, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the current layer to the LayerData associated with `layer`.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#setLayer\r\n * @since 3.0.0\r\n *\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the\r\n * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a\r\n * StaticTilemapLayer. If not given will default to the map's current layer index.\r\n *\r\n * @return {Phaser.Tilemaps.Tilemap} This Tilemap object.\r\n */\r\n setLayer: function (layer)\r\n {\r\n var index = this.getLayerIndex(layer);\r\n\r\n if (index !== null)\r\n {\r\n this.currentLayerIndex = index;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the base tile size for the map. Note: this does not necessarily match the tileWidth and\r\n * tileHeight for all layers. This also updates the base size on all tiles across all layers.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#setBaseTileSize\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileWidth - The width of the tiles the map uses for calculations.\r\n * @param {integer} tileHeight - The height of the tiles the map uses for calculations.\r\n *\r\n * @return {Phaser.Tilemaps.Tilemap} This Tilemap object.\r\n */\r\n setBaseTileSize: function (tileWidth, tileHeight)\r\n {\r\n this.tileWidth = tileWidth;\r\n this.tileHeight = tileHeight;\r\n this.widthInPixels = this.width * tileWidth;\r\n this.heightInPixels = this.height * tileHeight;\r\n\r\n // Update the base tile size on all layers & tiles\r\n for (var i = 0; i < this.layers.length; i++)\r\n {\r\n this.layers[i].baseTileWidth = tileWidth;\r\n this.layers[i].baseTileHeight = tileHeight;\r\n\r\n var mapData = this.layers[i].data;\r\n var mapWidth = this.layers[i].width;\r\n var mapHeight = this.layers[i].height;\r\n\r\n for (var row = 0; row < mapHeight; row++)\r\n {\r\n for (var col = 0; col < mapWidth; col++)\r\n {\r\n var tile = mapData[row][col];\r\n\r\n if (tile !== null)\r\n {\r\n tile.setSize(undefined, undefined, tileWidth, tileHeight);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the tile size for a specific `layer`. Note: this does not necessarily match the map's\r\n * tileWidth and tileHeight for all layers. This will set the tile size for the layer and any\r\n * tiles the layer has.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#setLayerTileSize\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileWidth - The width of the tiles (in pixels) in the layer.\r\n * @param {integer} tileHeight - The height of the tiles (in pixels) in the layer.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the\r\n * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a\r\n * StaticTilemapLayer. If not given will default to the map's current layer index.\r\n *\r\n * @return {Phaser.Tilemaps.Tilemap} This Tilemap object.\r\n */\r\n setLayerTileSize: function (tileWidth, tileHeight, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return this; }\r\n\r\n layer.tileWidth = tileWidth;\r\n layer.tileHeight = tileHeight;\r\n\r\n var mapData = layer.data;\r\n var mapWidth = layer.width;\r\n var mapHeight = layer.height;\r\n\r\n for (var row = 0; row < mapHeight; row++)\r\n {\r\n for (var col = 0; col < mapWidth; col++)\r\n {\r\n var tile = mapData[row][col];\r\n\r\n if (tile !== null)\r\n {\r\n tile.setSize(tileWidth, tileHeight);\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given\r\n * layer. It will only randomize the tiles in that area, so if they're all the same nothing will\r\n * appear to have changed! This method only modifies tile indexes and does not change collision\r\n * information.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n * This cannot be applied to StaticTilemapLayers.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#shuffle\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.\r\n */\r\n shuffle: function (tileX, tileY, width, height, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (this._isStaticCall(layer, 'shuffle')) { return this; }\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.Shuffle(tileX, tileY, width, height, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching\r\n * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision\r\n * information.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n * This cannot be applied to StaticTilemapLayers.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#swapByIndex\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileA - First tile index.\r\n * @param {integer} tileB - Second tile index.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.\r\n */\r\n swapByIndex: function (indexA, indexB, tileX, tileY, width, height, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (this._isStaticCall(layer, 'swapByIndex')) { return this; }\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.SwapByIndex(indexA, indexB, tileX, tileY, width, height, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the\r\n * layers position, scale and scroll.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#tileToWorldX\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?number} Returns a number, or null if the layer given was invalid.\r\n */\r\n tileToWorldX: function (tileX, camera, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.TileToWorldX(tileX, camera, layer);\r\n },\r\n\r\n /**\r\n * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the\r\n * layers position, scale and scroll.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#tileToWorldY\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer\r\n * to use. If not given the current layer is used.\r\n *\r\n * @return {?number} Returns a number, or null if the layer given was invalid.\r\n */\r\n tileToWorldY: function (tileX, camera, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.TileToWorldY(tileX, camera, layer);\r\n },\r\n\r\n /**\r\n * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the\r\n * layers position, scale and scroll. This will return a new Vector2 object or update the given\r\n * `point` object.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#tileToWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid.\r\n */\r\n tileToWorldXY: function (tileX, tileY, point, camera, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.TileToWorldXY(tileX, tileY, point, camera, layer);\r\n },\r\n\r\n /**\r\n * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the\r\n * specified layer. Each tile will receive a new index. New indexes are drawn from the given\r\n * weightedIndexes array. An example weighted array:\r\n *\r\n * [\r\n * { index: 6, weight: 4 }, // Probability of index 6 is 4 / 8\r\n * { index: 7, weight: 2 }, // Probability of index 7 would be 2 / 8\r\n * { index: 8, weight: 1.5 }, // Probability of index 8 would be 1.5 / 8\r\n * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8\r\n * ]\r\n *\r\n * The probability of any index being choose is (the index's weight) / (sum of all weights). This\r\n * method only modifies tile indexes and does not change collision information.\r\n *\r\n * If no layer specified, the map's current layer is used. This\r\n * cannot be applied to StaticTilemapLayers.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#weightedRandomize\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during\r\n * randomization. They should be in the form: { index: 0, weight: 4 } or\r\n * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.\r\n */\r\n weightedRandomize: function (tileX, tileY, width, height, weightedIndexes, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (this._isStaticCall(layer, 'weightedRandomize')) { return this; }\r\n\r\n if (layer === null) { return null; }\r\n\r\n TilemapComponents.WeightedRandomize(tileX, tileY, width, height, weightedIndexes, layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the\r\n * layers position, scale and scroll.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#worldToTileX\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles.\r\n * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer\r\n * to use. If not given the current layer is used.\r\n *\r\n * @return {?number} Returns a number, or null if the layer given was invalid.\r\n */\r\n worldToTileX: function (worldX, snapToFloor, camera, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.WorldToTileX(worldX, snapToFloor, camera, layer);\r\n },\r\n\r\n /**\r\n * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the\r\n * layers position, scale and scroll.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#worldToTileY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles.\r\n * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?number} Returns a number, or null if the layer given was invalid.\r\n */\r\n worldToTileY: function (worldY, snapToFloor, camera, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.WorldToTileY(worldY, snapToFloor, camera, layer);\r\n },\r\n\r\n /**\r\n * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the\r\n * layers position, scale and scroll. This will return a new Vector2 object or update the given\r\n * `point` object.\r\n *\r\n * If no layer specified, the maps current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#worldToTileXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles.\r\n * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles.\r\n * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer.\r\n * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.\r\n *\r\n * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid.\r\n */\r\n worldToTileXY: function (worldX, worldY, snapToFloor, point, camera, layer)\r\n {\r\n layer = this.getLayer(layer);\r\n\r\n if (layer === null) { return null; }\r\n\r\n return TilemapComponents.WorldToTileXY(worldX, worldY, snapToFloor, point, camera, layer);\r\n },\r\n\r\n /**\r\n * Used internally to check if a layer is static and prints out a warning.\r\n *\r\n * @method Phaser.Tilemaps.Tilemap#_isStaticCall\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @return {boolean}\r\n */\r\n _isStaticCall: function (layer, functionName)\r\n {\r\n if (layer.tilemapLayer instanceof StaticTilemapLayer)\r\n {\r\n console.warn(functionName + ': You cannot change the tiles in a static tilemap layer');\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Tilemap;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/Tilemap.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/TilemapCreator.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/TilemapCreator.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectCreator = __webpack_require__(/*! ../gameobjects/GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar ParseToTilemap = __webpack_require__(/*! ./ParseToTilemap */ \"./node_modules/phaser/src/tilemaps/ParseToTilemap.js\");\r\n\r\n/**\r\n * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided.\r\n * When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing\r\n * from a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map\r\n * data. For an empty map, you should specify tileWidth, tileHeight, width & height.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#tilemap\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Types.Tilemaps.TilemapConfig} [config] - The config options for the Tilemap.\r\n * \r\n * @return {Phaser.Tilemaps.Tilemap}\r\n */\r\nGameObjectCreator.register('tilemap', function (config)\r\n{\r\n // Defaults are applied in ParseToTilemap\r\n var c = (config !== undefined) ? config : {};\r\n\r\n return ParseToTilemap(\r\n this.scene,\r\n c.key,\r\n c.tileWidth,\r\n c.tileHeight,\r\n c.width,\r\n c.height,\r\n c.data,\r\n c.insertNull\r\n );\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/TilemapCreator.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/TilemapFactory.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/TilemapFactory.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GameObjectFactory = __webpack_require__(/*! ../gameobjects/GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar ParseToTilemap = __webpack_require__(/*! ./ParseToTilemap */ \"./node_modules/phaser/src/tilemaps/ParseToTilemap.js\");\r\n\r\n/**\r\n * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided.\r\n * When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing\r\n * from a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map\r\n * data. For an empty map, you should specify tileWidth, tileHeight, width & height.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#tilemap\r\n * @since 3.0.0\r\n *\r\n * @param {string} [key] - The key in the Phaser cache that corresponds to the loaded tilemap data.\r\n * @param {integer} [tileWidth=32] - The width of a tile in pixels. Pass in `null` to leave as the\r\n * default.\r\n * @param {integer} [tileHeight=32] - The height of a tile in pixels. Pass in `null` to leave as the\r\n * default.\r\n * @param {integer} [width=10] - The width of the map in tiles. Pass in `null` to leave as the\r\n * default.\r\n * @param {integer} [height=10] - The height of the map in tiles. Pass in `null` to leave as the\r\n * default.\r\n * @param {integer[][]} [data] - Instead of loading from the cache, you can also load directly from\r\n * a 2D array of tile indexes. Pass in `null` for no data.\r\n * @param {boolean} [insertNull=false] - Controls how empty tiles, tiles with an index of -1, in the\r\n * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty\r\n * location will get a Tile object with an index of -1. If you've a large sparsely populated map and\r\n * the tile data doesn't need to change then setting this value to `true` will help with memory\r\n * consumption. However if your map is small or you need to update the tiles dynamically, then leave\r\n * the default value set.\r\n * \r\n * @return {Phaser.Tilemaps.Tilemap}\r\n */\r\nGameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, width, height, data, insertNull)\r\n{\r\n // Allow users to specify null to indicate that they want the default value, since null is\r\n // shorter & more legible than undefined. Convert null to undefined to allow ParseToTilemap\r\n // defaults to take effect.\r\n\r\n if (key === null) { key = undefined; }\r\n if (tileWidth === null) { tileWidth = undefined; }\r\n if (tileHeight === null) { tileHeight = undefined; }\r\n if (width === null) { width = undefined; }\r\n if (height === null) { height = undefined; }\r\n\r\n return ParseToTilemap(this.scene, key, tileWidth, tileHeight, width, height, data, insertNull);\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/TilemapFactory.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/Tileset.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/Tileset.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Tileset is a combination of an image containing the tiles and a container for data about\r\n * each tile.\r\n *\r\n * @class Tileset\r\n * @memberof Phaser.Tilemaps\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {string} name - The name of the tileset in the map data.\r\n * @param {integer} firstgid - The first tile index this tileset contains.\r\n * @param {integer} [tileWidth=32] - Width of each tile (in pixels).\r\n * @param {integer} [tileHeight=32] - Height of each tile (in pixels).\r\n * @param {integer} [tileMargin=0] - The margin around all tiles in the sheet (in pixels).\r\n * @param {integer} [tileSpacing=0] - The spacing between each tile in the sheet (in pixels).\r\n * @param {object} [tileProperties={}] - Custom properties defined per tile in the Tileset.\r\n * These typically are custom properties created in Tiled when editing a tileset.\r\n * @param {object} [tileData={}] - Data stored per tile. These typically are created in Tiled\r\n * when editing a tileset, e.g. from Tiled's tile collision editor or terrain editor.\r\n */\r\nvar Tileset = new Class({\r\n\r\n initialize:\r\n\r\n function Tileset (name, firstgid, tileWidth, tileHeight, tileMargin, tileSpacing, tileProperties, tileData)\r\n {\r\n if (tileWidth === undefined || tileWidth <= 0) { tileWidth = 32; }\r\n if (tileHeight === undefined || tileHeight <= 0) { tileHeight = 32; }\r\n if (tileMargin === undefined) { tileMargin = 0; }\r\n if (tileSpacing === undefined) { tileSpacing = 0; }\r\n if (tileProperties === undefined) { tileProperties = {}; }\r\n if (tileData === undefined) { tileData = {}; }\r\n\r\n /**\r\n * The name of the Tileset.\r\n *\r\n * @name Phaser.Tilemaps.Tileset#name\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * The starting index of the first tile index this Tileset contains.\r\n *\r\n * @name Phaser.Tilemaps.Tileset#firstgid\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.firstgid = firstgid;\r\n\r\n /**\r\n * The width of each tile (in pixels). Use setTileSize to change.\r\n *\r\n * @name Phaser.Tilemaps.Tileset#tileWidth\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.tileWidth = tileWidth;\r\n\r\n /**\r\n * The height of each tile (in pixels). Use setTileSize to change.\r\n *\r\n * @name Phaser.Tilemaps.Tileset#tileHeight\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.tileHeight = tileHeight;\r\n\r\n /**\r\n * The margin around the tiles in the sheet (in pixels). Use `setSpacing` to change.\r\n *\r\n * @name Phaser.Tilemaps.Tileset#tileMargin\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.tileMargin = tileMargin;\r\n\r\n /**\r\n * The spacing between each the tile in the sheet (in pixels). Use `setSpacing` to change.\r\n *\r\n * @name Phaser.Tilemaps.Tileset#tileSpacing\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.tileSpacing = tileSpacing;\r\n\r\n /**\r\n * Tileset-specific properties per tile that are typically defined in the Tiled editor in the\r\n * Tileset editor.\r\n *\r\n * @name Phaser.Tilemaps.Tileset#tileProperties\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.tileProperties = tileProperties;\r\n\r\n /**\r\n * Tileset-specific data per tile that are typically defined in the Tiled editor, e.g. within\r\n * the Tileset collision editor. This is where collision objects and terrain are stored.\r\n *\r\n * @name Phaser.Tilemaps.Tileset#tileData\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.tileData = tileData;\r\n\r\n /**\r\n * The cached image that contains the individual tiles. Use setImage to set.\r\n *\r\n * @name Phaser.Tilemaps.Tileset#image\r\n * @type {?Phaser.Textures.Texture}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.image = null;\r\n\r\n /**\r\n * The gl texture used by the WebGL renderer.\r\n *\r\n * @name Phaser.Tilemaps.Tileset#glTexture\r\n * @type {?WebGLTexture}\r\n * @readonly\r\n * @since 3.11.0\r\n */\r\n this.glTexture = null;\r\n\r\n /**\r\n * The number of tile rows in the the tileset.\r\n *\r\n * @name Phaser.Tilemaps.Tileset#rows\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.rows = 0;\r\n\r\n /**\r\n * The number of tile columns in the tileset.\r\n *\r\n * @name Phaser.Tilemaps.Tileset#columns\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.columns = 0;\r\n\r\n /**\r\n * The total number of tiles in the tileset.\r\n *\r\n * @name Phaser.Tilemaps.Tileset#total\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.total = 0;\r\n\r\n /**\r\n * The look-up table to specific tile image texture coordinates (UV in pixels). Each element\r\n * contains the coordinates for a tile in an object of the form {x, y}.\r\n *\r\n * @name Phaser.Tilemaps.Tileset#texCoordinates\r\n * @type {object[]}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.texCoordinates = [];\r\n },\r\n\r\n /**\r\n * Get a tiles properties that are stored in the Tileset. Returns null if tile index is not\r\n * contained in this Tileset. This is typically defined in Tiled under the Tileset editor.\r\n *\r\n * @method Phaser.Tilemaps.Tileset#getTileProperties\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map.\r\n *\r\n * @return {?(object|undefined)}\r\n */\r\n getTileProperties: function (tileIndex)\r\n {\r\n if (!this.containsTileIndex(tileIndex)) { return null; }\r\n\r\n return this.tileProperties[tileIndex - this.firstgid];\r\n },\r\n\r\n /**\r\n * Get a tile's data that is stored in the Tileset. Returns null if tile index is not contained\r\n * in this Tileset. This is typically defined in Tiled and will contain both Tileset collision\r\n * info and terrain mapping.\r\n *\r\n * @method Phaser.Tilemaps.Tileset#getTileData\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map.\r\n *\r\n * @return {?object|undefined}\r\n */\r\n getTileData: function (tileIndex)\r\n {\r\n if (!this.containsTileIndex(tileIndex)) { return null; }\r\n\r\n return this.tileData[tileIndex - this.firstgid];\r\n },\r\n\r\n /**\r\n * Get a tile's collision group that is stored in the Tileset. Returns null if tile index is not\r\n * contained in this Tileset. This is typically defined within Tiled's tileset collision editor.\r\n *\r\n * @method Phaser.Tilemaps.Tileset#getTileCollisionGroup\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map.\r\n *\r\n * @return {?object}\r\n */\r\n getTileCollisionGroup: function (tileIndex)\r\n {\r\n var data = this.getTileData(tileIndex);\r\n\r\n return (data && data.objectgroup) ? data.objectgroup : null;\r\n },\r\n\r\n /**\r\n * Returns true if and only if this Tileset contains the given tile index.\r\n *\r\n * @method Phaser.Tilemaps.Tileset#containsTileIndex\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map.\r\n *\r\n * @return {boolean}\r\n */\r\n containsTileIndex: function (tileIndex)\r\n {\r\n return (\r\n tileIndex >= this.firstgid &&\r\n tileIndex < (this.firstgid + this.total)\r\n );\r\n },\r\n\r\n /**\r\n * Returns the texture coordinates (UV in pixels) in the Tileset image for the given tile index.\r\n * Returns null if tile index is not contained in this Tileset.\r\n *\r\n * @method Phaser.Tilemaps.Tileset#getTileTextureCoordinates\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map.\r\n *\r\n * @return {?object} Object in the form { x, y } representing the top-left UV coordinate\r\n * within the Tileset image.\r\n */\r\n getTileTextureCoordinates: function (tileIndex)\r\n {\r\n if (!this.containsTileIndex(tileIndex)) { return null; }\r\n\r\n return this.texCoordinates[tileIndex - this.firstgid];\r\n },\r\n\r\n /**\r\n * Sets the image associated with this Tileset and updates the tile data (rows, columns, etc.).\r\n *\r\n * @method Phaser.Tilemaps.Tileset#setImage\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.Texture} texture - The image that contains the tiles.\r\n *\r\n * @return {Phaser.Tilemaps.Tileset} This Tileset object.\r\n */\r\n setImage: function (texture)\r\n {\r\n this.image = texture;\r\n\r\n this.glTexture = texture.get().source.glTexture;\r\n\r\n this.updateTileData(this.image.source[0].width, this.image.source[0].height);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the tile width & height and updates the tile data (rows, columns, etc.).\r\n *\r\n * @method Phaser.Tilemaps.Tileset#setTileSize\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileWidth] - The width of a tile in pixels.\r\n * @param {integer} [tileHeight] - The height of a tile in pixels.\r\n *\r\n * @return {Phaser.Tilemaps.Tileset} This Tileset object.\r\n */\r\n setTileSize: function (tileWidth, tileHeight)\r\n {\r\n if (tileWidth !== undefined) { this.tileWidth = tileWidth; }\r\n if (tileHeight !== undefined) { this.tileHeight = tileHeight; }\r\n\r\n if (this.image)\r\n {\r\n this.updateTileData(this.image.source[0].width, this.image.source[0].height);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the tile margin & spacing and updates the tile data (rows, columns, etc.).\r\n *\r\n * @method Phaser.Tilemaps.Tileset#setSpacing\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [margin] - The margin around the tiles in the sheet (in pixels).\r\n * @param {integer} [spacing] - The spacing between the tiles in the sheet (in pixels).\r\n *\r\n * @return {Phaser.Tilemaps.Tileset} This Tileset object.\r\n */\r\n setSpacing: function (margin, spacing)\r\n {\r\n if (margin !== undefined) { this.tileMargin = margin; }\r\n if (spacing !== undefined) { this.tileSpacing = spacing; }\r\n\r\n if (this.image)\r\n {\r\n this.updateTileData(this.image.source[0].width, this.image.source[0].height);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Updates tile texture coordinates and tileset data.\r\n *\r\n * @method Phaser.Tilemaps.Tileset#updateTileData\r\n * @since 3.0.0\r\n *\r\n * @param {integer} imageWidth - The (expected) width of the image to slice.\r\n * @param {integer} imageHeight - The (expected) height of the image to slice.\r\n *\r\n * @return {Phaser.Tilemaps.Tileset} This Tileset object.\r\n */\r\n updateTileData: function (imageWidth, imageHeight)\r\n {\r\n var rowCount = (imageHeight - this.tileMargin * 2 + this.tileSpacing) / (this.tileHeight + this.tileSpacing);\r\n var colCount = (imageWidth - this.tileMargin * 2 + this.tileSpacing) / (this.tileWidth + this.tileSpacing);\r\n\r\n if (rowCount % 1 !== 0 || colCount % 1 !== 0)\r\n {\r\n console.warn('Image tile area not tile size multiple in: ' + this.name);\r\n }\r\n\r\n // In Tiled a tileset image that is not an even multiple of the tile dimensions is truncated\r\n // - hence the floor when calculating the rows/columns.\r\n rowCount = Math.floor(rowCount);\r\n colCount = Math.floor(colCount);\r\n\r\n this.rows = rowCount;\r\n this.columns = colCount;\r\n\r\n // In Tiled, \"empty\" spaces in a tileset count as tiles and hence count towards the gid\r\n this.total = rowCount * colCount;\r\n\r\n this.texCoordinates.length = 0;\r\n\r\n var tx = this.tileMargin;\r\n var ty = this.tileMargin;\r\n\r\n for (var y = 0; y < this.rows; y++)\r\n {\r\n for (var x = 0; x < this.columns; x++)\r\n {\r\n this.texCoordinates.push({ x: tx, y: ty });\r\n tx += this.tileWidth + this.tileSpacing;\r\n }\r\n\r\n tx = this.tileMargin;\r\n ty += this.tileHeight + this.tileSpacing;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Tileset;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/Tileset.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/CalculateFacesAt.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/CalculateFacesAt.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTileAt = __webpack_require__(/*! ./GetTileAt */ \"./node_modules/phaser/src/tilemaps/components/GetTileAt.js\");\r\n\r\n/**\r\n * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting\r\n * faces are used internally for optimizing collisions against tiles. This method is mostly used\r\n * internally to optimize recalculating faces when only one tile has been changed.\r\n *\r\n * @function Phaser.Tilemaps.Components.CalculateFacesAt\r\n * @private\r\n * @since 3.0.0\r\n * \r\n * @param {integer} tileX - The x coordinate.\r\n * @param {integer} tileY - The y coordinate.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar CalculateFacesAt = function (tileX, tileY, layer)\r\n{\r\n var tile = GetTileAt(tileX, tileY, true, layer);\r\n var above = GetTileAt(tileX, tileY - 1, true, layer);\r\n var below = GetTileAt(tileX, tileY + 1, true, layer);\r\n var left = GetTileAt(tileX - 1, tileY, true, layer);\r\n var right = GetTileAt(tileX + 1, tileY, true, layer);\r\n var tileCollides = tile && tile.collides;\r\n\r\n // Assume the changed tile has all interesting edges\r\n if (tileCollides)\r\n {\r\n tile.faceTop = true;\r\n tile.faceBottom = true;\r\n tile.faceLeft = true;\r\n tile.faceRight = true;\r\n }\r\n\r\n // Reset edges that are shared between tile and its neighbors\r\n if (above && above.collides)\r\n {\r\n if (tileCollides) { tile.faceTop = false; }\r\n above.faceBottom = !tileCollides;\r\n }\r\n\r\n if (below && below.collides)\r\n {\r\n if (tileCollides) { tile.faceBottom = false; }\r\n below.faceTop = !tileCollides;\r\n }\r\n\r\n if (left && left.collides)\r\n {\r\n if (tileCollides) { tile.faceLeft = false; }\r\n left.faceRight = !tileCollides;\r\n }\r\n\r\n if (right && right.collides)\r\n {\r\n if (tileCollides) { tile.faceRight = false; }\r\n right.faceLeft = !tileCollides;\r\n }\r\n\r\n if (tile && !tile.collides) { tile.resetFaces(); }\r\n\r\n return tile;\r\n};\r\n\r\nmodule.exports = CalculateFacesAt;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/CalculateFacesAt.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/CalculateFacesWithin.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/CalculateFacesWithin.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTileAt = __webpack_require__(/*! ./GetTileAt */ \"./node_modules/phaser/src/tilemaps/components/GetTileAt.js\");\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\n\r\n/**\r\n * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the\r\n * layer. Interesting faces are used internally for optimizing collisions against tiles. This method\r\n * is mostly used internally.\r\n *\r\n * @function Phaser.Tilemaps.Components.CalculateFacesWithin\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} width - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} height - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar CalculateFacesWithin = function (tileX, tileY, width, height, layer)\r\n{\r\n var above = null;\r\n var below = null;\r\n var left = null;\r\n var right = null;\r\n\r\n var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer);\r\n\r\n for (var i = 0; i < tiles.length; i++)\r\n {\r\n var tile = tiles[i];\r\n\r\n if (tile)\r\n {\r\n if (tile.collides)\r\n {\r\n above = GetTileAt(tile.x, tile.y - 1, true, layer);\r\n below = GetTileAt(tile.x, tile.y + 1, true, layer);\r\n left = GetTileAt(tile.x - 1, tile.y, true, layer);\r\n right = GetTileAt(tile.x + 1, tile.y, true, layer);\r\n\r\n tile.faceTop = (above && above.collides) ? false : true;\r\n tile.faceBottom = (below && below.collides) ? false : true;\r\n tile.faceLeft = (left && left.collides) ? false : true;\r\n tile.faceRight = (right && right.collides) ? false : true;\r\n }\r\n else\r\n {\r\n tile.resetFaces();\r\n }\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = CalculateFacesWithin;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/CalculateFacesWithin.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/Copy.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/Copy.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\nvar CalculateFacesWithin = __webpack_require__(/*! ./CalculateFacesWithin */ \"./node_modules/phaser/src/tilemaps/components/CalculateFacesWithin.js\");\r\n\r\n/**\r\n * Copies the tiles in the source rectangular area to a new destination (all specified in tile\r\n * coordinates) within the layer. This copies all tile properties & recalculates collision\r\n * information in the destination region.\r\n *\r\n * @function Phaser.Tilemaps.Components.Copy\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels.\r\n * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels.\r\n * @param {integer} width - The width of the area to copy, in tiles, not pixels.\r\n * @param {integer} height - The height of the area to copy, in tiles, not pixels.\r\n * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels.\r\n * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar Copy = function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces, layer)\r\n{\r\n if (srcTileX < 0) { srcTileX = 0; }\r\n if (srcTileY < 0) { srcTileY = 0; }\r\n if (recalculateFaces === undefined) { recalculateFaces = true; }\r\n\r\n var srcTiles = GetTilesWithin(srcTileX, srcTileY, width, height, null, layer);\r\n\r\n var offsetX = destTileX - srcTileX;\r\n var offsetY = destTileY - srcTileY;\r\n\r\n for (var i = 0; i < srcTiles.length; i++)\r\n {\r\n var tileX = srcTiles[i].x + offsetX;\r\n var tileY = srcTiles[i].y + offsetY;\r\n if (tileX >= 0 && tileX < layer.width && tileY >= 0 && tileY < layer.height)\r\n {\r\n if (layer.data[tileY][tileX])\r\n {\r\n layer.data[tileY][tileX].copy(srcTiles[i]);\r\n }\r\n }\r\n }\r\n\r\n if (recalculateFaces)\r\n {\r\n // Recalculate the faces within the destination area and neighboring tiles\r\n CalculateFacesWithin(destTileX - 1, destTileY - 1, width + 2, height + 2, layer);\r\n }\r\n};\r\n\r\nmodule.exports = Copy;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/Copy.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/CreateFromTiles.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/CreateFromTiles.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar TileToWorldX = __webpack_require__(/*! ./TileToWorldX */ \"./node_modules/phaser/src/tilemaps/components/TileToWorldX.js\");\r\nvar TileToWorldY = __webpack_require__(/*! ./TileToWorldY */ \"./node_modules/phaser/src/tilemaps/components/TileToWorldY.js\");\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\nvar ReplaceByIndex = __webpack_require__(/*! ./ReplaceByIndex */ \"./node_modules/phaser/src/tilemaps/components/ReplaceByIndex.js\");\r\n\r\n/**\r\n * Creates a Sprite for every object matching the given tile indexes in the layer. You can\r\n * optionally specify if each tile will be replaced with a new tile after the Sprite has been\r\n * created. This is useful if you want to lay down special tiles in a level that are converted to\r\n * Sprites, but want to replace the tile itself with a floor tile or similar once converted.\r\n *\r\n * @function Phaser.Tilemaps.Components.CreateFromTiles\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from.\r\n * @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.\r\n * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite).\r\n * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n *\r\n * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created.\r\n */\r\nvar CreateFromTiles = function (indexes, replacements, spriteConfig, scene, camera, layer)\r\n{\r\n if (spriteConfig === undefined) { spriteConfig = {}; }\r\n\r\n if (!Array.isArray(indexes)) { indexes = [ indexes ]; }\r\n\r\n var tilemapLayer = layer.tilemapLayer;\r\n if (scene === undefined) { scene = tilemapLayer.scene; }\r\n if (camera === undefined) { camera = scene.cameras.main; }\r\n\r\n var tiles = GetTilesWithin(0, 0, layer.width, layer.height, null, layer);\r\n var sprites = [];\r\n var i;\r\n\r\n for (i = 0; i < tiles.length; i++)\r\n {\r\n var tile = tiles[i];\r\n\r\n if (indexes.indexOf(tile.index) !== -1)\r\n {\r\n spriteConfig.x = TileToWorldX(tile.x, camera, layer);\r\n spriteConfig.y = TileToWorldY(tile.y, camera, layer);\r\n\r\n var sprite = scene.make.sprite(spriteConfig);\r\n sprites.push(sprite);\r\n }\r\n }\r\n\r\n if (typeof replacements === 'number')\r\n {\r\n // Assume 1 replacement for all types of tile given\r\n for (i = 0; i < indexes.length; i++)\r\n {\r\n ReplaceByIndex(indexes[i], replacements, 0, 0, layer.width, layer.height, layer);\r\n }\r\n }\r\n else if (Array.isArray(replacements))\r\n {\r\n // Assume 1 to 1 mapping with indexes array\r\n for (i = 0; i < indexes.length; i++)\r\n {\r\n ReplaceByIndex(indexes[i], replacements[i], 0, 0, layer.width, layer.height, layer);\r\n }\r\n }\r\n\r\n return sprites;\r\n};\r\n\r\nmodule.exports = CreateFromTiles;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/CreateFromTiles.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/CullTiles.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/CullTiles.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SnapFloor = __webpack_require__(/*! ../../math/snap/SnapFloor */ \"./node_modules/phaser/src/math/snap/SnapFloor.js\");\r\nvar SnapCeil = __webpack_require__(/*! ../../math/snap/SnapCeil */ \"./node_modules/phaser/src/math/snap/SnapCeil.js\");\r\n\r\n/**\r\n * Returns the tiles in the given layer that are within the camera's viewport. This is used internally.\r\n *\r\n * @function Phaser.Tilemaps.Components.CullTiles\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against.\r\n * @param {array} [outputArray] - An optional array to store the Tile objects within.\r\n *\r\n * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.\r\n */\r\nvar CullTiles = function (layer, camera, outputArray, renderOrder)\r\n{\r\n if (outputArray === undefined) { outputArray = []; }\r\n if (renderOrder === undefined) { renderOrder = 0; }\r\n\r\n outputArray.length = 0;\r\n\r\n var tilemap = layer.tilemapLayer.tilemap;\r\n var tilemapLayer = layer.tilemapLayer;\r\n\r\n var mapData = layer.data;\r\n var mapWidth = layer.width;\r\n var mapHeight = layer.height;\r\n\r\n // We need to use the tile sizes defined for the map as a whole, not the layer,\r\n // in order to calculate the bounds correctly. As different sized tiles may be\r\n // placed on the grid and we cannot trust layer.baseTileWidth to give us the true size.\r\n var tileW = Math.floor(tilemap.tileWidth * tilemapLayer.scaleX);\r\n var tileH = Math.floor(tilemap.tileHeight * tilemapLayer.scaleY);\r\n\r\n var drawLeft = 0;\r\n var drawRight = mapWidth;\r\n var drawTop = 0;\r\n var drawBottom = mapHeight;\r\n\r\n if (!tilemapLayer.skipCull && tilemapLayer.scrollFactorX === 1 && tilemapLayer.scrollFactorY === 1)\r\n {\r\n // Camera world view bounds, snapped for scaled tile size\r\n // Cull Padding values are given in tiles, not pixels\r\n\r\n var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX;\r\n var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX;\r\n var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH, 0, true) - tilemapLayer.cullPaddingY;\r\n var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH, 0, true) + tilemapLayer.cullPaddingY;\r\n\r\n drawLeft = Math.max(0, boundsLeft);\r\n drawRight = Math.min(mapWidth, boundsRight);\r\n drawTop = Math.max(0, boundsTop);\r\n drawBottom = Math.min(mapHeight, boundsBottom);\r\n }\r\n\r\n var x;\r\n var y;\r\n var tile;\r\n\r\n if (renderOrder === 0)\r\n {\r\n // right-down\r\n\r\n for (y = drawTop; y < drawBottom; y++)\r\n {\r\n for (x = drawLeft; mapData[y] && x < drawRight; x++)\r\n {\r\n tile = mapData[y][x];\r\n\r\n if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0)\r\n {\r\n continue;\r\n }\r\n\r\n outputArray.push(tile);\r\n }\r\n }\r\n }\r\n else if (renderOrder === 1)\r\n {\r\n // left-down\r\n\r\n for (y = drawTop; y < drawBottom; y++)\r\n {\r\n for (x = drawRight; mapData[y] && x >= drawLeft; x--)\r\n {\r\n tile = mapData[y][x];\r\n\r\n if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0)\r\n {\r\n continue;\r\n }\r\n\r\n outputArray.push(tile);\r\n }\r\n }\r\n }\r\n else if (renderOrder === 2)\r\n {\r\n // right-up\r\n\r\n for (y = drawBottom; y >= drawTop; y--)\r\n {\r\n for (x = drawLeft; mapData[y] && x < drawRight; x++)\r\n {\r\n tile = mapData[y][x];\r\n\r\n if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0)\r\n {\r\n continue;\r\n }\r\n\r\n outputArray.push(tile);\r\n }\r\n }\r\n }\r\n else if (renderOrder === 3)\r\n {\r\n // left-up\r\n\r\n for (y = drawBottom; y >= drawTop; y--)\r\n {\r\n for (x = drawRight; mapData[y] && x >= drawLeft; x--)\r\n {\r\n tile = mapData[y][x];\r\n\r\n if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0)\r\n {\r\n continue;\r\n }\r\n\r\n outputArray.push(tile);\r\n }\r\n }\r\n }\r\n\r\n tilemapLayer.tilesDrawn = outputArray.length;\r\n tilemapLayer.tilesTotal = mapWidth * mapHeight;\r\n\r\n return outputArray;\r\n};\r\n\r\nmodule.exports = CullTiles;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/CullTiles.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/Fill.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/Fill.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\nvar CalculateFacesWithin = __webpack_require__(/*! ./CalculateFacesWithin */ \"./node_modules/phaser/src/tilemaps/components/CalculateFacesWithin.js\");\r\nvar SetTileCollision = __webpack_require__(/*! ./SetTileCollision */ \"./node_modules/phaser/src/tilemaps/components/SetTileCollision.js\");\r\n\r\n/**\r\n * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the\r\n * specified index. Tiles will be set to collide if the given index is a colliding index.\r\n * Collision information in the region will be recalculated.\r\n *\r\n * @function Phaser.Tilemaps.Components.Fill\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} index - The tile index to fill the area with.\r\n * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} width - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} height - How many tiles tall from the `tileY` index the area will be.\r\n * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The tile layer to use. If not given the current layer is used.\r\n */\r\nvar Fill = function (index, tileX, tileY, width, height, recalculateFaces, layer)\r\n{\r\n var doesIndexCollide = (layer.collideIndexes.indexOf(index) !== -1);\r\n\r\n var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer);\r\n\r\n for (var i = 0; i < tiles.length; i++)\r\n {\r\n tiles[i].index = index;\r\n\r\n SetTileCollision(tiles[i], doesIndexCollide);\r\n }\r\n\r\n if (recalculateFaces)\r\n {\r\n // Recalculate the faces within the area and neighboring tiles\r\n CalculateFacesWithin(tileX - 1, tileY - 1, width + 2, height + 2, layer);\r\n }\r\n};\r\n\r\nmodule.exports = Fill;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/Fill.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/FilterTiles.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/FilterTiles.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\n\r\n/**\r\n * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given\r\n * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns\r\n * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS.\r\n *\r\n * @function Phaser.Tilemaps.Components.FilterTiles\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {function} callback - The callback. Each tile in the given area will be passed to this\r\n * callback as the first and only parameter. The callback should return true for tiles that pass the\r\n * filter.\r\n * @param {object} [context] - The context under which the callback should be run.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.\r\n * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.\r\n * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * \r\n * @return {Phaser.Tilemaps.Tile[]} The filtered array of Tiles.\r\n */\r\nvar FilterTiles = function (callback, context, tileX, tileY, width, height, filteringOptions, layer)\r\n{\r\n var tiles = GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer);\r\n\r\n return tiles.filter(callback, context);\r\n};\r\n\r\nmodule.exports = FilterTiles;\r\n\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/FilterTiles.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/FindByIndex.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/FindByIndex.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Searches the entire map layer for the first tile matching the given index, then returns that Tile\r\n * object. If no match is found, it returns null. The search starts from the top-left tile and\r\n * continues horizontally until it hits the end of the row, then it drops down to the next column.\r\n * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to\r\n * the top-left.\r\n *\r\n * @function Phaser.Tilemaps.Components.FindByIndex\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} index - The tile index value to search for.\r\n * @param {integer} [skip=0] - The number of times to skip a matching tile before returning.\r\n * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the\r\n * bottom-right. Otherwise it scans from the top-left.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile} The first (or n skipped) tile with the matching index.\r\n */\r\nvar FindByIndex = function (findIndex, skip, reverse, layer)\r\n{\r\n if (skip === undefined) { skip = 0; }\r\n if (reverse === undefined) { reverse = false; }\r\n\r\n var count = 0;\r\n var tx;\r\n var ty;\r\n var tile;\r\n\r\n if (reverse)\r\n {\r\n for (ty = layer.height - 1; ty >= 0; ty--)\r\n {\r\n for (tx = layer.width - 1; tx >= 0; tx--)\r\n {\r\n tile = layer.data[ty][tx];\r\n if (tile && tile.index === findIndex)\r\n {\r\n if (count === skip)\r\n {\r\n return tile;\r\n }\r\n else\r\n {\r\n count += 1;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n else\r\n {\r\n for (ty = 0; ty < layer.height; ty++)\r\n {\r\n for (tx = 0; tx < layer.width; tx++)\r\n {\r\n tile = layer.data[ty][tx];\r\n if (tile && tile.index === findIndex)\r\n {\r\n if (count === skip)\r\n {\r\n return tile;\r\n }\r\n else\r\n {\r\n count += 1;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nmodule.exports = FindByIndex;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/FindByIndex.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/FindTile.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/FindTile.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\n\r\n/**\r\n * @callback FindTileCallback\r\n *\r\n * @param {Phaser.Tilemaps.Tile} value - The Tile.\r\n * @param {integer} index - The index of the tile.\r\n * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects.\r\n *\r\n * @return {boolean} Return `true` if the callback should run, otherwise `false`.\r\n */\r\n\r\n/**\r\n * Find the first tile in the given rectangular area (in tile coordinates) of the layer that\r\n * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns\r\n * true. Similar to Array.prototype.find in vanilla JS.\r\n *\r\n * @function Phaser.Tilemaps.Components.FindTile\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter.\r\n * @param {object} [context] - The context under which the callback should be run.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.\r\n * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.\r\n * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile} A Tile that matches the search, or null if no Tile found\r\n */\r\nvar FindTile = function (callback, context, tileX, tileY, width, height, filteringOptions, layer)\r\n{\r\n var tiles = GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer);\r\n return tiles.find(callback, context) || null;\r\n};\r\n\r\nmodule.exports = FindTile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/FindTile.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/ForEachTile.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/ForEachTile.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\n\r\n/**\r\n * @callback EachTileCallback\r\n *\r\n * @param {Phaser.Tilemaps.Tile} value - The Tile.\r\n * @param {integer} index - The index of the tile.\r\n * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects.\r\n */\r\n\r\n/**\r\n * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given\r\n * callback. Similar to Array.prototype.forEach in vanilla JS.\r\n *\r\n * @function Phaser.Tilemaps.Components.ForEachTile\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter.\r\n * @param {object} [context] - The context under which the callback should be run.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.\r\n * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.\r\n * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar ForEachTile = function (callback, context, tileX, tileY, width, height, filteringOptions, layer)\r\n{\r\n var tiles = GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer);\r\n\r\n tiles.forEach(callback, context);\r\n};\r\n\r\nmodule.exports = ForEachTile;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/ForEachTile.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/GetTileAt.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/GetTileAt.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar IsInLayerBounds = __webpack_require__(/*! ./IsInLayerBounds */ \"./node_modules/phaser/src/tilemaps/components/IsInLayerBounds.js\");\r\n\r\n/**\r\n * Gets a tile at the given tile coordinates from the given layer.\r\n *\r\n * @function Phaser.Tilemaps.Components.GetTileAt\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels).\r\n * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels).\r\n * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * \r\n * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates\r\n * were invalid.\r\n */\r\nvar GetTileAt = function (tileX, tileY, nonNull, layer)\r\n{\r\n if (nonNull === undefined) { nonNull = false; }\r\n\r\n if (IsInLayerBounds(tileX, tileY, layer))\r\n {\r\n var tile = layer.data[tileY][tileX] || null;\r\n if (tile === null)\r\n {\r\n return null;\r\n }\r\n else if (tile.index === -1)\r\n {\r\n return nonNull ? tile : null;\r\n }\r\n else\r\n {\r\n return tile;\r\n }\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n};\r\n\r\nmodule.exports = GetTileAt;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/GetTileAt.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/GetTileAtWorldXY.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/GetTileAtWorldXY.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTileAt = __webpack_require__(/*! ./GetTileAt */ \"./node_modules/phaser/src/tilemaps/components/GetTileAt.js\");\r\nvar WorldToTileX = __webpack_require__(/*! ./WorldToTileX */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileX.js\");\r\nvar WorldToTileY = __webpack_require__(/*! ./WorldToTileY */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileY.js\");\r\n\r\n/**\r\n * Gets a tile at the given world coordinates from the given layer.\r\n *\r\n * @function Phaser.Tilemaps.Components.GetTileAtWorldXY\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - X position to get the tile from (given in pixels)\r\n * @param {number} worldY - Y position to get the tile from (given in pixels)\r\n * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * \r\n * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates\r\n * were invalid.\r\n */\r\nvar GetTileAtWorldXY = function (worldX, worldY, nonNull, camera, layer)\r\n{\r\n var tileX = WorldToTileX(worldX, true, camera, layer);\r\n var tileY = WorldToTileY(worldY, true, camera, layer);\r\n\r\n return GetTileAt(tileX, tileY, nonNull, layer);\r\n};\r\n\r\nmodule.exports = GetTileAtWorldXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/GetTileAtWorldXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\n\r\n/**\r\n * Gets the tiles in the given rectangular area (in tile coordinates) of the layer.\r\n *\r\n * @function Phaser.Tilemaps.Components.GetTilesWithin\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} width - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} height - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Types.Tilemaps.GetTilesWithinFilteringOptions} GetTilesWithinFilteringOptions - Optional filters to apply when getting the tiles.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * \r\n * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects.\r\n */\r\nvar GetTilesWithin = function (tileX, tileY, width, height, filteringOptions, layer)\r\n{\r\n if (tileX === undefined) { tileX = 0; }\r\n if (tileY === undefined) { tileY = 0; }\r\n if (width === undefined) { width = layer.width; }\r\n if (height === undefined) { height = layer.height; }\r\n\r\n var isNotEmpty = GetFastValue(filteringOptions, 'isNotEmpty', false);\r\n var isColliding = GetFastValue(filteringOptions, 'isColliding', false);\r\n var hasInterestingFace = GetFastValue(filteringOptions, 'hasInterestingFace', false);\r\n\r\n // Clip x, y to top left of map, while shrinking width/height to match.\r\n if (tileX < 0)\r\n {\r\n width += tileX;\r\n tileX = 0;\r\n }\r\n if (tileY < 0)\r\n {\r\n height += tileY;\r\n tileY = 0;\r\n }\r\n\r\n // Clip width and height to bottom right of map.\r\n if (tileX + width > layer.width)\r\n {\r\n width = Math.max(layer.width - tileX, 0);\r\n }\r\n if (tileY + height > layer.height)\r\n {\r\n height = Math.max(layer.height - tileY, 0);\r\n }\r\n\r\n var results = [];\r\n\r\n for (var ty = tileY; ty < tileY + height; ty++)\r\n {\r\n for (var tx = tileX; tx < tileX + width; tx++)\r\n {\r\n var tile = layer.data[ty][tx];\r\n if (tile !== null)\r\n {\r\n if (isNotEmpty && tile.index === -1) { continue; }\r\n if (isColliding && !tile.collides) { continue; }\r\n if (hasInterestingFace && !tile.hasInterestingFace) { continue; }\r\n results.push(tile);\r\n }\r\n }\r\n }\r\n\r\n return results;\r\n};\r\n\r\nmodule.exports = GetTilesWithin;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/GetTilesWithinShape.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/GetTilesWithinShape.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Geom = __webpack_require__(/*! ../../geom/ */ \"./node_modules/phaser/src/geom/index.js\");\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\nvar Intersects = __webpack_require__(/*! ../../geom/intersects/ */ \"./node_modules/phaser/src/geom/intersects/index.js\");\r\nvar NOOP = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar TileToWorldX = __webpack_require__(/*! ./TileToWorldX */ \"./node_modules/phaser/src/tilemaps/components/TileToWorldX.js\");\r\nvar TileToWorldY = __webpack_require__(/*! ./TileToWorldY */ \"./node_modules/phaser/src/tilemaps/components/TileToWorldY.js\");\r\nvar WorldToTileX = __webpack_require__(/*! ./WorldToTileX */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileX.js\");\r\nvar WorldToTileY = __webpack_require__(/*! ./WorldToTileY */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileY.js\");\r\n\r\nvar TriangleToRectangle = function (triangle, rect)\r\n{\r\n return Intersects.RectangleToTriangle(rect, triangle);\r\n};\r\n\r\n// Note: Could possibly be optimized by copying the shape and shifting it into tilemapLayer\r\n// coordinates instead of shifting the tiles.\r\n\r\n/**\r\n * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle,\r\n * Line, Rectangle or Triangle. The shape should be in world coordinates.\r\n *\r\n * @function Phaser.Tilemaps.Components.GetTilesWithinShape\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates\r\n * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.\r\n * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.\r\n * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n *\r\n * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects.\r\n */\r\nvar GetTilesWithinShape = function (shape, filteringOptions, camera, layer)\r\n{\r\n if (shape === undefined) { return []; }\r\n\r\n // intersectTest is a function with parameters: shape, rect\r\n var intersectTest = NOOP;\r\n if (shape instanceof Geom.Circle) { intersectTest = Intersects.CircleToRectangle; }\r\n else if (shape instanceof Geom.Rectangle) { intersectTest = Intersects.RectangleToRectangle; }\r\n else if (shape instanceof Geom.Triangle) { intersectTest = TriangleToRectangle; }\r\n else if (shape instanceof Geom.Line) { intersectTest = Intersects.LineToRectangle; }\r\n\r\n // Top left corner of the shapes's bounding box, rounded down to include partial tiles\r\n var xStart = WorldToTileX(shape.left, true, camera, layer);\r\n var yStart = WorldToTileY(shape.top, true, camera, layer);\r\n\r\n // Bottom right corner of the shapes's bounding box, rounded up to include partial tiles\r\n var xEnd = Math.ceil(WorldToTileX(shape.right, false, camera, layer));\r\n var yEnd = Math.ceil(WorldToTileY(shape.bottom, false, camera, layer));\r\n\r\n // Tiles within bounding rectangle of shape. Bounds are forced to be at least 1 x 1 tile in size\r\n // to grab tiles for shapes that don't have a height or width (e.g. a horizontal line).\r\n var width = Math.max(xEnd - xStart, 1);\r\n var height = Math.max(yEnd - yStart, 1);\r\n var tiles = GetTilesWithin(xStart, yStart, width, height, filteringOptions, layer);\r\n\r\n var tileWidth = layer.tileWidth;\r\n var tileHeight = layer.tileHeight;\r\n if (layer.tilemapLayer)\r\n {\r\n tileWidth *= layer.tilemapLayer.scaleX;\r\n tileHeight *= layer.tilemapLayer.scaleY;\r\n }\r\n\r\n var results = [];\r\n var tileRect = new Geom.Rectangle(0, 0, tileWidth, tileHeight);\r\n for (var i = 0; i < tiles.length; i++)\r\n {\r\n var tile = tiles[i];\r\n tileRect.x = TileToWorldX(tile.x, camera, layer);\r\n tileRect.y = TileToWorldY(tile.y, camera, layer);\r\n if (intersectTest(shape, tileRect))\r\n {\r\n results.push(tile);\r\n }\r\n }\r\n\r\n return results;\r\n};\r\n\r\nmodule.exports = GetTilesWithinShape;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/GetTilesWithinShape.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/GetTilesWithinWorldXY.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/GetTilesWithinWorldXY.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\nvar WorldToTileX = __webpack_require__(/*! ./WorldToTileX */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileX.js\");\r\nvar WorldToTileY = __webpack_require__(/*! ./WorldToTileY */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileY.js\");\r\n\r\n/**\r\n * Gets the tiles in the given rectangular area (in world coordinates) of the layer.\r\n *\r\n * @function Phaser.Tilemaps.Components.GetTilesWithinWorldXY\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The world x coordinate for the top-left of the area.\r\n * @param {number} worldY - The world y coordinate for the top-left of the area.\r\n * @param {number} width - The width of the area.\r\n * @param {number} height - The height of the area.\r\n * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.\r\n * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.\r\n * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * \r\n * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects.\r\n */\r\nvar GetTilesWithinWorldXY = function (worldX, worldY, width, height, filteringOptions, camera, layer)\r\n{\r\n // Top left corner of the rect, rounded down to include partial tiles\r\n var xStart = WorldToTileX(worldX, true, camera, layer);\r\n var yStart = WorldToTileY(worldY, true, camera, layer);\r\n\r\n // Bottom right corner of the rect, rounded up to include partial tiles\r\n var xEnd = Math.ceil(WorldToTileX(worldX + width, false, camera, layer));\r\n var yEnd = Math.ceil(WorldToTileY(worldY + height, false, camera, layer));\r\n\r\n return GetTilesWithin(xStart, yStart, xEnd - xStart, yEnd - yStart, filteringOptions, layer);\r\n};\r\n\r\nmodule.exports = GetTilesWithinWorldXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/GetTilesWithinWorldXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/HasTileAt.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/HasTileAt.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar IsInLayerBounds = __webpack_require__(/*! ./IsInLayerBounds */ \"./node_modules/phaser/src/tilemaps/components/IsInLayerBounds.js\");\r\n\r\n/**\r\n * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns\r\n * false if there is no tile or if the tile at that location has an index of -1.\r\n *\r\n * @function Phaser.Tilemaps.Components.HasTileAt\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels).\r\n * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels).\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * \r\n * @return {?boolean} Returns a boolean, or null if the layer given was invalid.\r\n */\r\nvar HasTileAt = function (tileX, tileY, layer)\r\n{\r\n if (IsInLayerBounds(tileX, tileY, layer))\r\n {\r\n var tile = layer.data[tileY][tileX];\r\n return (tile !== null && tile.index > -1);\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = HasTileAt;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/HasTileAt.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/HasTileAtWorldXY.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/HasTileAtWorldXY.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar HasTileAt = __webpack_require__(/*! ./HasTileAt */ \"./node_modules/phaser/src/tilemaps/components/HasTileAt.js\");\r\nvar WorldToTileX = __webpack_require__(/*! ./WorldToTileX */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileX.js\");\r\nvar WorldToTileY = __webpack_require__(/*! ./WorldToTileY */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileY.js\");\r\n\r\n/**\r\n * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns\r\n * false if there is no tile or if the tile at that location has an index of -1.\r\n *\r\n * @function Phaser.Tilemaps.Components.HasTileAtWorldXY\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The X coordinate of the world position.\r\n * @param {number} worldY - The Y coordinate of the world position.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * \r\n * @return {?boolean} Returns a boolean, or null if the layer given was invalid.\r\n */\r\nvar HasTileAtWorldXY = function (worldX, worldY, camera, layer)\r\n{\r\n var tileX = WorldToTileX(worldX, true, camera, layer);\r\n var tileY = WorldToTileY(worldY, true, camera, layer);\r\n\r\n return HasTileAt(tileX, tileY, layer);\r\n};\r\n\r\nmodule.exports = HasTileAtWorldXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/HasTileAtWorldXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/IsInLayerBounds.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/IsInLayerBounds.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if the given tile coordinates are within the bounds of the layer.\r\n *\r\n * @function Phaser.Tilemaps.Components.IsInLayerBounds\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * \r\n * @return {boolean} `true` if the tile coordinates are within the bounds of the layer, otherwise `false`.\r\n */\r\nvar IsInLayerBounds = function (tileX, tileY, layer)\r\n{\r\n return (tileX >= 0 && tileX < layer.width && tileY >= 0 && tileY < layer.height);\r\n};\r\n\r\nmodule.exports = IsInLayerBounds;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/IsInLayerBounds.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/PutTileAt.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/PutTileAt.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Tile = __webpack_require__(/*! ../Tile */ \"./node_modules/phaser/src/tilemaps/Tile.js\");\r\nvar IsInLayerBounds = __webpack_require__(/*! ./IsInLayerBounds */ \"./node_modules/phaser/src/tilemaps/components/IsInLayerBounds.js\");\r\nvar CalculateFacesAt = __webpack_require__(/*! ./CalculateFacesAt */ \"./node_modules/phaser/src/tilemaps/components/CalculateFacesAt.js\");\r\nvar SetTileCollision = __webpack_require__(/*! ./SetTileCollision */ \"./node_modules/phaser/src/tilemaps/components/SetTileCollision.js\");\r\n\r\n/**\r\n * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index\r\n * or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified\r\n * location. If you pass in an index, only the index at the specified location will be changed.\r\n * Collision information will be recalculated at the specified location.\r\n *\r\n * @function Phaser.Tilemaps.Components.PutTileAt\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object.\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map.\r\n */\r\nvar PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer)\r\n{\r\n if (!IsInLayerBounds(tileX, tileY, layer)) { return null; }\r\n if (recalculateFaces === undefined) { recalculateFaces = true; }\r\n\r\n var oldTile = layer.data[tileY][tileX];\r\n var oldTileCollides = oldTile && oldTile.collides;\r\n\r\n if (tile instanceof Tile)\r\n {\r\n if (layer.data[tileY][tileX] === null)\r\n {\r\n layer.data[tileY][tileX] = new Tile(layer, tile.index, tileX, tileY, tile.width, tile.height);\r\n }\r\n layer.data[tileY][tileX].copy(tile);\r\n }\r\n else\r\n {\r\n var index = tile;\r\n if (layer.data[tileY][tileX] === null)\r\n {\r\n layer.data[tileY][tileX] = new Tile(layer, index, tileX, tileY, layer.tileWidth, layer.tileHeight);\r\n }\r\n else\r\n {\r\n layer.data[tileY][tileX].index = index;\r\n }\r\n }\r\n\r\n // Updating colliding flag on the new tile\r\n var newTile = layer.data[tileY][tileX];\r\n var collides = layer.collideIndexes.indexOf(newTile.index) !== -1;\r\n SetTileCollision(newTile, collides);\r\n\r\n // Recalculate faces only if the colliding flag at (tileX, tileY) has changed\r\n if (recalculateFaces && (oldTileCollides !== newTile.collides))\r\n {\r\n CalculateFacesAt(tileX, tileY, layer);\r\n }\r\n\r\n return newTile;\r\n};\r\n\r\nmodule.exports = PutTileAt;\r\n\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/PutTileAt.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/PutTileAtWorldXY.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/PutTileAtWorldXY.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PutTileAt = __webpack_require__(/*! ./PutTileAt */ \"./node_modules/phaser/src/tilemaps/components/PutTileAt.js\");\r\nvar WorldToTileX = __webpack_require__(/*! ./WorldToTileX */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileX.js\");\r\nvar WorldToTileY = __webpack_require__(/*! ./WorldToTileY */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileY.js\");\r\n\r\n/**\r\n * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either\r\n * an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the\r\n * specified location. If you pass in an index, only the index at the specified location will be\r\n * changed. Collision information will be recalculated at the specified location.\r\n *\r\n * @function Phaser.Tilemaps.Components.PutTileAtWorldXY\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object.\r\n * @param {number} worldX - The x coordinate, in pixels.\r\n * @param {number} worldY - The y coordinate, in pixels.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map.\r\n */\r\nvar PutTileAtWorldXY = function (tile, worldX, worldY, recalculateFaces, camera, layer)\r\n{\r\n var tileX = WorldToTileX(worldX, true, camera, layer);\r\n var tileY = WorldToTileY(worldY, true, camera, layer);\r\n return PutTileAt(tile, tileX, tileY, recalculateFaces, layer);\r\n};\r\n\r\nmodule.exports = PutTileAtWorldXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/PutTileAtWorldXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/PutTilesAt.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/PutTilesAt.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CalculateFacesWithin = __webpack_require__(/*! ./CalculateFacesWithin */ \"./node_modules/phaser/src/tilemaps/components/CalculateFacesWithin.js\");\r\nvar PutTileAt = __webpack_require__(/*! ./PutTileAt */ \"./node_modules/phaser/src/tilemaps/components/PutTileAt.js\");\r\n\r\n/**\r\n * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified\r\n * layer. The array can be composed of either tile indexes or Tile objects. If you pass in a Tile,\r\n * all attributes will be copied over to the specified location. If you pass in an index, only the\r\n * index at the specified location will be changed. Collision information will be recalculated\r\n * within the region tiles were changed.\r\n *\r\n * @function Phaser.Tilemaps.Components.PutTilesAt\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place.\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar PutTilesAt = function (tilesArray, tileX, tileY, recalculateFaces, layer)\r\n{\r\n if (!Array.isArray(tilesArray)) { return null; }\r\n if (recalculateFaces === undefined) { recalculateFaces = true; }\r\n\r\n // Force the input array to be a 2D array\r\n if (!Array.isArray(tilesArray[0]))\r\n {\r\n tilesArray = [ tilesArray ];\r\n }\r\n\r\n var height = tilesArray.length;\r\n var width = tilesArray[0].length;\r\n\r\n for (var ty = 0; ty < height; ty++)\r\n {\r\n for (var tx = 0; tx < width; tx++)\r\n {\r\n var tile = tilesArray[ty][tx];\r\n PutTileAt(tile, tileX + tx, tileY + ty, false, layer);\r\n }\r\n }\r\n\r\n if (recalculateFaces)\r\n {\r\n // Recalculate the faces within the destination area and neighboring tiles\r\n CalculateFacesWithin(tileX - 1, tileY - 1, width + 2, height + 2, layer);\r\n }\r\n};\r\n\r\nmodule.exports = PutTilesAt;\r\n\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/PutTilesAt.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/Randomize.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/Randomize.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\nvar GetRandom = __webpack_require__(/*! ../../utils/array/GetRandom */ \"./node_modules/phaser/src/utils/array/GetRandom.js\");\r\n\r\n/**\r\n * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the\r\n * specified layer. Each tile will receive a new index. If an array of indexes is passed in, then\r\n * those will be used for randomly assigning new tile indexes. If an array is not provided, the\r\n * indexes found within the region (excluding -1) will be used for randomly assigning new tile\r\n * indexes. This method only modifies tile indexes and does not change collision information.\r\n *\r\n * @function Phaser.Tilemaps.Components.Randomize\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar Randomize = function (tileX, tileY, width, height, indexes, layer)\r\n{\r\n var i;\r\n var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer);\r\n\r\n // If no indices are given, then find all the unique indexes within the specified region\r\n if (indexes === undefined)\r\n {\r\n indexes = [];\r\n for (i = 0; i < tiles.length; i++)\r\n {\r\n if (indexes.indexOf(tiles[i].index) === -1)\r\n {\r\n indexes.push(tiles[i].index);\r\n }\r\n }\r\n }\r\n\r\n for (i = 0; i < tiles.length; i++)\r\n {\r\n tiles[i].index = GetRandom(indexes);\r\n }\r\n};\r\n\r\nmodule.exports = Randomize;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/Randomize.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/RemoveTileAt.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/RemoveTileAt.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Tile = __webpack_require__(/*! ../Tile */ \"./node_modules/phaser/src/tilemaps/Tile.js\");\r\nvar IsInLayerBounds = __webpack_require__(/*! ./IsInLayerBounds */ \"./node_modules/phaser/src/tilemaps/components/IsInLayerBounds.js\");\r\nvar CalculateFacesAt = __webpack_require__(/*! ./CalculateFacesAt */ \"./node_modules/phaser/src/tilemaps/components/CalculateFacesAt.js\");\r\n\r\n/**\r\n * Removes the tile at the given tile coordinates in the specified layer and updates the layer's\r\n * collision information.\r\n *\r\n * @function Phaser.Tilemaps.Components.RemoveTileAt\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The x coordinate.\r\n * @param {integer} tileY - The y coordinate.\r\n * @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.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} The Tile object that was removed.\r\n */\r\nvar RemoveTileAt = function (tileX, tileY, replaceWithNull, recalculateFaces, layer)\r\n{\r\n if (replaceWithNull === undefined) { replaceWithNull = false; }\r\n if (recalculateFaces === undefined) { recalculateFaces = true; }\r\n\r\n if (!IsInLayerBounds(tileX, tileY, layer))\r\n {\r\n return null;\r\n }\r\n\r\n var tile = layer.data[tileY][tileX];\r\n\r\n if (!tile)\r\n {\r\n return null;\r\n }\r\n else\r\n {\r\n layer.data[tileY][tileX] = (replaceWithNull) ? null : new Tile(layer, -1, tileX, tileY, tile.width, tile.height);\r\n }\r\n\r\n // Recalculate faces only if the removed tile was a colliding tile\r\n if (recalculateFaces && tile && tile.collides)\r\n {\r\n CalculateFacesAt(tileX, tileY, layer);\r\n }\r\n\r\n return tile;\r\n};\r\n\r\nmodule.exports = RemoveTileAt;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/RemoveTileAt.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/RemoveTileAtWorldXY.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/RemoveTileAtWorldXY.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RemoveTileAt = __webpack_require__(/*! ./RemoveTileAt */ \"./node_modules/phaser/src/tilemaps/components/RemoveTileAt.js\");\r\nvar WorldToTileX = __webpack_require__(/*! ./WorldToTileX */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileX.js\");\r\nvar WorldToTileY = __webpack_require__(/*! ./WorldToTileY */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileY.js\");\r\n\r\n/**\r\n * Removes the tile at the given world coordinates in the specified layer and updates the layer's\r\n * collision information.\r\n *\r\n * @function Phaser.Tilemaps.Components.RemoveTileAtWorldXY\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The x coordinate, in pixels.\r\n * @param {number} worldY - The y coordinate, in pixels.\r\n * @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.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} The Tile object that was removed.\r\n */\r\nvar RemoveTileAtWorldXY = function (worldX, worldY, replaceWithNull, recalculateFaces, camera, layer)\r\n{\r\n var tileX = WorldToTileX(worldX, true, camera, layer);\r\n var tileY = WorldToTileY(worldY, true, camera, layer);\r\n return RemoveTileAt(tileX, tileY, replaceWithNull, recalculateFaces, layer);\r\n};\r\n\r\nmodule.exports = RemoveTileAtWorldXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/RemoveTileAtWorldXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/RenderDebug.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/RenderDebug.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\nvar Color = __webpack_require__(/*! ../../display/color */ \"./node_modules/phaser/src/display/color/index.js\");\r\n\r\nvar defaultTileColor = new Color(105, 210, 231, 150);\r\nvar defaultCollidingTileColor = new Color(243, 134, 48, 200);\r\nvar defaultFaceColor = new Color(40, 39, 37, 150);\r\n\r\n/**\r\n * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to\r\n * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles\r\n * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation\r\n * wherever you want on the screen.\r\n *\r\n * @function Phaser.Tilemaps.Components.RenderDebug\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon.\r\n * @param {object} styleConfig - An object specifying the colors to use for the debug drawing.\r\n * @param {?Phaser.Display.Color} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at\r\n * non-colliding tile locations. If set to null, non-colliding tiles will not be drawn.\r\n * @param {?Phaser.Display.Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled\r\n * rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn.\r\n * @param {?Phaser.Display.Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting\r\n * tile faces. If set to null, interesting tile faces will not be drawn.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar RenderDebug = function (graphics, styleConfig, layer)\r\n{\r\n if (styleConfig === undefined) { styleConfig = {}; }\r\n\r\n // Default colors without needlessly creating Color objects\r\n var tileColor = (styleConfig.tileColor !== undefined) ? styleConfig.tileColor : defaultTileColor;\r\n var collidingTileColor = (styleConfig.collidingTileColor !== undefined) ? styleConfig.collidingTileColor : defaultCollidingTileColor;\r\n var faceColor = (styleConfig.faceColor !== undefined) ? styleConfig.faceColor : defaultFaceColor;\r\n\r\n var tiles = GetTilesWithin(0, 0, layer.width, layer.height, null, layer);\r\n\r\n graphics.translateCanvas(layer.tilemapLayer.x, layer.tilemapLayer.y);\r\n graphics.scaleCanvas(layer.tilemapLayer.scaleX, layer.tilemapLayer.scaleY);\r\n\r\n for (var i = 0; i < tiles.length; i++)\r\n {\r\n var tile = tiles[i];\r\n\r\n var tw = tile.width;\r\n var th = tile.height;\r\n var x = tile.pixelX;\r\n var y = tile.pixelY;\r\n\r\n var color = tile.collides ? collidingTileColor : tileColor;\r\n\r\n if (color !== null)\r\n {\r\n graphics.fillStyle(color.color, color.alpha / 255);\r\n graphics.fillRect(x, y, tw, th);\r\n }\r\n\r\n // Inset the face line to prevent neighboring tile's lines from overlapping\r\n x += 1;\r\n y += 1;\r\n tw -= 2;\r\n th -= 2;\r\n\r\n if (faceColor !== null)\r\n {\r\n graphics.lineStyle(1, faceColor.color, faceColor.alpha / 255);\r\n\r\n if (tile.faceTop) { graphics.lineBetween(x, y, x + tw, y); }\r\n if (tile.faceRight) { graphics.lineBetween(x + tw, y, x + tw, y + th); }\r\n if (tile.faceBottom) { graphics.lineBetween(x, y + th, x + tw, y + th); }\r\n if (tile.faceLeft) { graphics.lineBetween(x, y, x, y + th); }\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = RenderDebug;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/RenderDebug.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/ReplaceByIndex.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/ReplaceByIndex.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\n\r\n/**\r\n * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching\r\n * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does\r\n * not change collision information.\r\n *\r\n * @function Phaser.Tilemaps.Components.ReplaceByIndex\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} findIndex - The index of the tile to search for.\r\n * @param {integer} newIndex - The index of the tile to replace it with.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar ReplaceByIndex = function (findIndex, newIndex, tileX, tileY, width, height, layer)\r\n{\r\n var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer);\r\n\r\n for (var i = 0; i < tiles.length; i++)\r\n {\r\n if (tiles[i] && tiles[i].index === findIndex)\r\n {\r\n tiles[i].index = newIndex;\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = ReplaceByIndex;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/ReplaceByIndex.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/SetCollision.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/SetCollision.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SetTileCollision = __webpack_require__(/*! ./SetTileCollision */ \"./node_modules/phaser/src/tilemaps/components/SetTileCollision.js\");\r\nvar CalculateFacesWithin = __webpack_require__(/*! ./CalculateFacesWithin */ \"./node_modules/phaser/src/tilemaps/components/CalculateFacesWithin.js\");\r\nvar SetLayerCollisionIndex = __webpack_require__(/*! ./SetLayerCollisionIndex */ \"./node_modules/phaser/src/tilemaps/components/SetLayerCollisionIndex.js\");\r\n\r\n/**\r\n * Sets collision on the given tile or tiles within a layer by index. You can pass in either a\r\n * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if\r\n * collision will be enabled (true) or disabled (false).\r\n *\r\n * @function Phaser.Tilemaps.Components.SetCollision\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * @param {boolean} updateLayer - If true, updates the current tiles on the layer. Set to\r\n * false if no tiles have been placed for significant performance boost.\r\n */\r\nvar SetCollision = function (indexes, collides, recalculateFaces, layer, updateLayer)\r\n{\r\n if (collides === undefined) { collides = true; }\r\n if (recalculateFaces === undefined) { recalculateFaces = true; }\r\n if (!Array.isArray(indexes)) { indexes = [ indexes ]; }\r\n if (updateLayer === undefined) { updateLayer = true; }\r\n\r\n // Update the array of colliding indexes\r\n for (var i = 0; i < indexes.length; i++)\r\n {\r\n SetLayerCollisionIndex(indexes[i], collides, layer);\r\n }\r\n \r\n // Update the tiles\r\n if (updateLayer)\r\n {\r\n for (var ty = 0; ty < layer.height; ty++)\r\n {\r\n for (var tx = 0; tx < layer.width; tx++)\r\n {\r\n var tile = layer.data[ty][tx];\r\n\r\n if (tile && indexes.indexOf(tile.index) !== -1)\r\n {\r\n SetTileCollision(tile, collides);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (recalculateFaces)\r\n {\r\n CalculateFacesWithin(0, 0, layer.width, layer.height, layer);\r\n }\r\n};\r\n\r\nmodule.exports = SetCollision;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/SetCollision.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/SetCollisionBetween.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/SetCollisionBetween.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SetTileCollision = __webpack_require__(/*! ./SetTileCollision */ \"./node_modules/phaser/src/tilemaps/components/SetTileCollision.js\");\r\nvar CalculateFacesWithin = __webpack_require__(/*! ./CalculateFacesWithin */ \"./node_modules/phaser/src/tilemaps/components/CalculateFacesWithin.js\");\r\nvar SetLayerCollisionIndex = __webpack_require__(/*! ./SetLayerCollisionIndex */ \"./node_modules/phaser/src/tilemaps/components/SetLayerCollisionIndex.js\");\r\n\r\n/**\r\n * Sets collision on a range of tiles in a layer whose index is between the specified `start` and\r\n * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set\r\n * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be\r\n * enabled (true) or disabled (false).\r\n *\r\n * @function Phaser.Tilemaps.Components.SetCollisionBetween\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} start - The first index of the tile to be set for collision.\r\n * @param {integer} stop - The last index of the tile to be set for collision.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to\r\n * false if no tiles have been placed for significant performance boost.\r\n */\r\nvar SetCollisionBetween = function (start, stop, collides, recalculateFaces, layer, updateLayer)\r\n{\r\n if (collides === undefined) { collides = true; }\r\n if (recalculateFaces === undefined) { recalculateFaces = true; }\r\n if (updateLayer === undefined) { updateLayer = true; }\r\n\r\n if (start > stop) { return; }\r\n\r\n // Update the array of colliding indexes\r\n for (var index = start; index <= stop; index++)\r\n {\r\n SetLayerCollisionIndex(index, collides, layer);\r\n }\r\n\r\n // Update the tiles\r\n if (updateLayer)\r\n {\r\n for (var ty = 0; ty < layer.height; ty++)\r\n {\r\n for (var tx = 0; tx < layer.width; tx++)\r\n {\r\n var tile = layer.data[ty][tx];\r\n \r\n if (tile)\r\n {\r\n if (tile.index >= start && tile.index <= stop)\r\n {\r\n SetTileCollision(tile, collides);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (recalculateFaces)\r\n {\r\n CalculateFacesWithin(0, 0, layer.width, layer.height, layer);\r\n }\r\n};\r\n\r\nmodule.exports = SetCollisionBetween;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/SetCollisionBetween.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/SetCollisionByExclusion.js": /*!********************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/SetCollisionByExclusion.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SetTileCollision = __webpack_require__(/*! ./SetTileCollision */ \"./node_modules/phaser/src/tilemaps/components/SetTileCollision.js\");\r\nvar CalculateFacesWithin = __webpack_require__(/*! ./CalculateFacesWithin */ \"./node_modules/phaser/src/tilemaps/components/CalculateFacesWithin.js\");\r\nvar SetLayerCollisionIndex = __webpack_require__(/*! ./SetLayerCollisionIndex */ \"./node_modules/phaser/src/tilemaps/components/SetLayerCollisionIndex.js\");\r\n\r\n/**\r\n * Sets collision on all tiles in the given layer, except for tiles that have an index specified in\r\n * the given array. The `collides` parameter controls if collision will be enabled (true) or\r\n * disabled (false).\r\n *\r\n * @function Phaser.Tilemaps.Components.SetCollisionByExclusion\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar SetCollisionByExclusion = function (indexes, collides, recalculateFaces, layer)\r\n{\r\n if (collides === undefined) { collides = true; }\r\n if (recalculateFaces === undefined) { recalculateFaces = true; }\r\n if (!Array.isArray(indexes)) { indexes = [ indexes ]; }\r\n\r\n // Note: this only updates layer.collideIndexes for tile indexes found currently in the layer\r\n for (var ty = 0; ty < layer.height; ty++)\r\n {\r\n for (var tx = 0; tx < layer.width; tx++)\r\n {\r\n var tile = layer.data[ty][tx];\r\n if (tile && indexes.indexOf(tile.index) === -1)\r\n {\r\n SetTileCollision(tile, collides);\r\n SetLayerCollisionIndex(tile.index, collides, layer);\r\n }\r\n }\r\n }\r\n\r\n if (recalculateFaces)\r\n {\r\n CalculateFacesWithin(0, 0, layer.width, layer.height, layer);\r\n }\r\n};\r\n\r\nmodule.exports = SetCollisionByExclusion;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/SetCollisionByExclusion.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/SetCollisionByProperty.js": /*!*******************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/SetCollisionByProperty.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SetTileCollision = __webpack_require__(/*! ./SetTileCollision */ \"./node_modules/phaser/src/tilemaps/components/SetTileCollision.js\");\r\nvar CalculateFacesWithin = __webpack_require__(/*! ./CalculateFacesWithin */ \"./node_modules/phaser/src/tilemaps/components/CalculateFacesWithin.js\");\r\nvar HasValue = __webpack_require__(/*! ../../utils/object/HasValue */ \"./node_modules/phaser/src/utils/object/HasValue.js\");\r\n\r\n/**\r\n * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property\r\n * that matches the given properties object, its collision flag will be set. The `collides`\r\n * parameter controls if collision will be enabled (true) or disabled (false). Passing in\r\n * `{ collides: true }` would update the collision flag on any tiles with a \"collides\" property that\r\n * has a value of true. Any tile that doesn't have \"collides\" set to true will be ignored. You can\r\n * also use an array of values, e.g. `{ types: [\"stone\", \"lava\", \"sand\" ] }`. If a tile has a\r\n * \"types\" property that matches any of those values, its collision flag will be updated.\r\n *\r\n * @function Phaser.Tilemaps.Components.SetCollisionByProperty\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {object} properties - An object with tile properties and corresponding values that should be checked.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar SetCollisionByProperty = function (properties, collides, recalculateFaces, layer)\r\n{\r\n if (collides === undefined) { collides = true; }\r\n if (recalculateFaces === undefined) { recalculateFaces = true; }\r\n\r\n for (var ty = 0; ty < layer.height; ty++)\r\n {\r\n for (var tx = 0; tx < layer.width; tx++)\r\n {\r\n var tile = layer.data[ty][tx];\r\n\r\n if (!tile) { continue; }\r\n\r\n for (var property in properties)\r\n {\r\n if (!HasValue(tile.properties, property)) { continue; }\r\n\r\n var values = properties[property];\r\n if (!Array.isArray(values))\r\n {\r\n values = [ values ];\r\n }\r\n\r\n for (var i = 0; i < values.length; i++)\r\n {\r\n if (tile.properties[property] === values[i])\r\n {\r\n SetTileCollision(tile, collides);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (recalculateFaces)\r\n {\r\n CalculateFacesWithin(0, 0, layer.width, layer.height, layer);\r\n }\r\n};\r\n\r\nmodule.exports = SetCollisionByProperty;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/SetCollisionByProperty.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/SetCollisionFromCollisionGroup.js": /*!***************************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/SetCollisionFromCollisionGroup.js ***! \***************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SetTileCollision = __webpack_require__(/*! ./SetTileCollision */ \"./node_modules/phaser/src/tilemaps/components/SetTileCollision.js\");\r\nvar CalculateFacesWithin = __webpack_require__(/*! ./CalculateFacesWithin */ \"./node_modules/phaser/src/tilemaps/components/CalculateFacesWithin.js\");\r\n\r\n/**\r\n * Sets collision on the tiles within a layer by checking each tile's collision group data\r\n * (typically defined in Tiled within the tileset collision editor). If any objects are found within\r\n * a tile's collision group, the tile's colliding information will be set. The `collides` parameter\r\n * controls if collision will be enabled (true) or disabled (false).\r\n *\r\n * @function Phaser.Tilemaps.Components.SetCollisionFromCollisionGroup\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar SetCollisionFromCollisionGroup = function (collides, recalculateFaces, layer)\r\n{\r\n if (collides === undefined) { collides = true; }\r\n if (recalculateFaces === undefined) { recalculateFaces = true; }\r\n\r\n for (var ty = 0; ty < layer.height; ty++)\r\n {\r\n for (var tx = 0; tx < layer.width; tx++)\r\n {\r\n var tile = layer.data[ty][tx];\r\n\r\n if (!tile) { continue; }\r\n\r\n var collisionGroup = tile.getCollisionGroup();\r\n\r\n // It's possible in Tiled to have a collision group without any shapes, e.g. create a\r\n // shape and then delete the shape.\r\n if (collisionGroup && collisionGroup.objects && collisionGroup.objects.length > 0)\r\n {\r\n SetTileCollision(tile, collides);\r\n }\r\n }\r\n }\r\n\r\n if (recalculateFaces)\r\n {\r\n CalculateFacesWithin(0, 0, layer.width, layer.height, layer);\r\n }\r\n};\r\n\r\nmodule.exports = SetCollisionFromCollisionGroup;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/SetCollisionFromCollisionGroup.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/SetLayerCollisionIndex.js": /*!*******************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/SetLayerCollisionIndex.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Internally used method to keep track of the tile indexes that collide within a layer. This\r\n * updates LayerData.collideIndexes to either contain or not contain the given `tileIndex`.\r\n *\r\n * @function Phaser.Tilemaps.Components.SetLayerCollisionIndex\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileIndex - The tile index to set the collision boolean for.\r\n * @param {boolean} [collides=true] - Should the tile index collide or not?\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar SetLayerCollisionIndex = function (tileIndex, collides, layer)\r\n{\r\n var loc = layer.collideIndexes.indexOf(tileIndex);\r\n\r\n if (collides && loc === -1)\r\n {\r\n layer.collideIndexes.push(tileIndex);\r\n }\r\n else if (!collides && loc !== -1)\r\n {\r\n layer.collideIndexes.splice(loc, 1);\r\n }\r\n};\r\n\r\nmodule.exports = SetLayerCollisionIndex;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/SetLayerCollisionIndex.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/SetTileCollision.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/SetTileCollision.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Internally used method to set the colliding state of a tile. This does not recalculate\r\n * interesting faces.\r\n *\r\n * @function Phaser.Tilemaps.Components.SetTileCollision\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tilemaps.Tile} tile - The Tile to set the collision on.\r\n * @param {boolean} [collides=true] - Should the tile index collide or not?\r\n */\r\nvar SetTileCollision = function (tile, collides)\r\n{\r\n if (collides)\r\n {\r\n tile.setCollision(true, true, true, true, false);\r\n }\r\n else\r\n {\r\n tile.resetCollision(false);\r\n }\r\n};\r\n\r\nmodule.exports = SetTileCollision;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/SetTileCollision.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/SetTileIndexCallback.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/SetTileIndexCallback.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sets a global collision callback for the given tile index within the layer. This will affect all\r\n * tiles on this layer that have the same index. If a callback is already set for the tile index it\r\n * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile\r\n * at a specific location on the map then see setTileLocationCallback.\r\n *\r\n * @function Phaser.Tilemaps.Components.SetTileIndexCallback\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for.\r\n * @param {function} callback - The callback that will be invoked when the tile is collided with.\r\n * @param {object} callbackContext - The context under which the callback is called.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar SetTileIndexCallback = function (indexes, callback, callbackContext, layer)\r\n{\r\n if (typeof indexes === 'number')\r\n {\r\n layer.callbacks[indexes] = (callback !== null)\r\n ? { callback: callback, callbackContext: callbackContext }\r\n : undefined;\r\n }\r\n else\r\n {\r\n for (var i = 0, len = indexes.length; i < len; i++)\r\n {\r\n layer.callbacks[indexes[i]] = (callback !== null)\r\n ? { callback: callback, callbackContext: callbackContext }\r\n : undefined;\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = SetTileIndexCallback;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/SetTileIndexCallback.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/SetTileLocationCallback.js": /*!********************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/SetTileLocationCallback.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\n\r\n/**\r\n * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer.\r\n * If a callback is already set for the tile index it will be replaced. Set the callback to null to\r\n * remove it.\r\n *\r\n * @function Phaser.Tilemaps.Components.SetTileLocationCallback\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {function} callback - The callback that will be invoked when the tile is collided with.\r\n * @param {object} callbackContext - The context under which the callback is called.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar SetTileLocationCallback = function (tileX, tileY, width, height, callback, callbackContext, layer)\r\n{\r\n var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer);\r\n\r\n for (var i = 0; i < tiles.length; i++)\r\n {\r\n tiles[i].setCollisionCallback(callback, callbackContext);\r\n }\r\n\r\n};\r\n\r\nmodule.exports = SetTileLocationCallback;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/SetTileLocationCallback.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/Shuffle.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/Shuffle.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\nvar ShuffleArray = __webpack_require__(/*! ../../utils/array/Shuffle */ \"./node_modules/phaser/src/utils/array/Shuffle.js\");\r\n\r\n/**\r\n * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given\r\n * layer. It will only randomize the tiles in that area, so if they're all the same nothing will\r\n * appear to have changed! This method only modifies tile indexes and does not change collision\r\n * information.\r\n *\r\n * @function Phaser.Tilemaps.Components.Shuffle\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar Shuffle = function (tileX, tileY, width, height, layer)\r\n{\r\n var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer);\r\n\r\n var indexes = tiles.map(function (tile) { return tile.index; });\r\n ShuffleArray(indexes);\r\n\r\n for (var i = 0; i < tiles.length; i++)\r\n {\r\n tiles[i].index = indexes[i];\r\n }\r\n};\r\n\r\nmodule.exports = Shuffle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/Shuffle.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/SwapByIndex.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/SwapByIndex.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\n\r\n/**\r\n * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching\r\n * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision\r\n * information.\r\n *\r\n * @function Phaser.Tilemaps.Components.SwapByIndex\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileA - First tile index.\r\n * @param {integer} tileB - Second tile index.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar SwapByIndex = function (indexA, indexB, tileX, tileY, width, height, layer)\r\n{\r\n var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer);\r\n for (var i = 0; i < tiles.length; i++)\r\n {\r\n if (tiles[i])\r\n {\r\n if (tiles[i].index === indexA)\r\n {\r\n tiles[i].index = indexB;\r\n }\r\n else if (tiles[i].index === indexB)\r\n {\r\n tiles[i].index = indexA;\r\n }\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = SwapByIndex;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/SwapByIndex.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/TileToWorldX.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/TileToWorldX.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the\r\n * layer's position, scale and scroll.\r\n *\r\n * @function Phaser.Tilemaps.Components.TileToWorldX\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * \r\n * @return {number}\r\n */\r\nvar TileToWorldX = function (tileX, camera, layer)\r\n{\r\n var tileWidth = layer.baseTileWidth;\r\n var tilemapLayer = layer.tilemapLayer;\r\n var layerWorldX = 0;\r\n\r\n if (tilemapLayer)\r\n {\r\n if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; }\r\n\r\n layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX);\r\n\r\n tileWidth *= tilemapLayer.scaleX;\r\n }\r\n\r\n return layerWorldX + tileX * tileWidth;\r\n};\r\n\r\nmodule.exports = TileToWorldX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/TileToWorldX.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/TileToWorldXY.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/TileToWorldXY.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar TileToWorldX = __webpack_require__(/*! ./TileToWorldX */ \"./node_modules/phaser/src/tilemaps/components/TileToWorldX.js\");\r\nvar TileToWorldY = __webpack_require__(/*! ./TileToWorldY */ \"./node_modules/phaser/src/tilemaps/components/TileToWorldY.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the\r\n * layer's position, scale and scroll. This will return a new Vector2 object or update the given\r\n * `point` object.\r\n *\r\n * @function Phaser.Tilemaps.Components.TileToWorldXY\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * \r\n * @return {Phaser.Math.Vector2} The XY location in world coordinates.\r\n */\r\nvar TileToWorldXY = function (tileX, tileY, point, camera, layer)\r\n{\r\n if (point === undefined) { point = new Vector2(0, 0); }\r\n\r\n point.x = TileToWorldX(tileX, camera, layer);\r\n point.y = TileToWorldY(tileY, camera, layer);\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = TileToWorldXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/TileToWorldXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/TileToWorldY.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/TileToWorldY.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the\r\n * layer's position, scale and scroll.\r\n *\r\n * @function Phaser.Tilemaps.Components.TileToWorldY\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileY - The x coordinate, in tiles, not pixels.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * \r\n * @return {number}\r\n */\r\nvar TileToWorldY = function (tileY, camera, layer)\r\n{\r\n var tileHeight = layer.baseTileHeight;\r\n var tilemapLayer = layer.tilemapLayer;\r\n var layerWorldY = 0;\r\n\r\n if (tilemapLayer)\r\n {\r\n if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; }\r\n\r\n layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY));\r\n\r\n tileHeight *= tilemapLayer.scaleY;\r\n }\r\n\r\n return layerWorldY + tileY * tileHeight;\r\n};\r\n\r\nmodule.exports = TileToWorldY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/TileToWorldY.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/WeightedRandomize.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/WeightedRandomize.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetTilesWithin = __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\");\r\n\r\n/**\r\n * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the\r\n * specified layer. Each tile will receive a new index. New indexes are drawn from the given\r\n * weightedIndexes array. An example weighted array:\r\n *\r\n * [\r\n * { index: 6, weight: 4 }, // Probability of index 6 is 4 / 8\r\n * { index: 7, weight: 2 }, // Probability of index 7 would be 2 / 8\r\n * { index: 8, weight: 1.5 }, // Probability of index 8 would be 1.5 / 8\r\n * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8\r\n * ]\r\n *\r\n * The probability of any index being choose is (the index's weight) / (sum of all weights). This\r\n * method only modifies tile indexes and does not change collision information.\r\n *\r\n * @function Phaser.Tilemaps.Components.WeightedRandomize\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during\r\n * randomization. They should be in the form: { index: 0, weight: 4 } or\r\n * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n */\r\nvar WeightedRandomize = function (tileX, tileY, width, height, weightedIndexes, layer)\r\n{\r\n if (weightedIndexes === undefined) { return; }\r\n\r\n var i;\r\n var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer);\r\n\r\n var weightTotal = 0;\r\n for (i = 0; i < weightedIndexes.length; i++)\r\n {\r\n weightTotal += weightedIndexes[i].weight;\r\n }\r\n\r\n if (weightTotal <= 0) { return; }\r\n\r\n for (i = 0; i < tiles.length; i++)\r\n {\r\n var rand = Math.random() * weightTotal;\r\n var sum = 0;\r\n var randomIndex = -1;\r\n for (var j = 0; j < weightedIndexes.length; j++)\r\n {\r\n sum += weightedIndexes[j].weight;\r\n if (rand <= sum)\r\n {\r\n var chosen = weightedIndexes[j].index;\r\n randomIndex = Array.isArray(chosen)\r\n ? chosen[Math.floor(Math.random() * chosen.length)]\r\n : chosen;\r\n break;\r\n }\r\n }\r\n\r\n tiles[i].index = randomIndex;\r\n }\r\n};\r\n\r\nmodule.exports = WeightedRandomize;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/WeightedRandomize.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/WorldToTileX.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/WorldToTileX.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the\r\n * layer's position, scale and scroll.\r\n *\r\n * @function Phaser.Tilemaps.Components.WorldToTileX\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles.\r\n * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * \r\n * @return {number} The X location in tile units.\r\n */\r\nvar WorldToTileX = function (worldX, snapToFloor, camera, layer)\r\n{\r\n if (snapToFloor === undefined) { snapToFloor = true; }\r\n\r\n var tileWidth = layer.baseTileWidth;\r\n var tilemapLayer = layer.tilemapLayer;\r\n\r\n if (tilemapLayer)\r\n {\r\n if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; }\r\n\r\n // Find the world position relative to the static or dynamic layer's top left origin,\r\n // factoring in the camera's horizontal scroll\r\n worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX));\r\n\r\n tileWidth *= tilemapLayer.scaleX;\r\n }\r\n\r\n return snapToFloor\r\n ? Math.floor(worldX / tileWidth)\r\n : worldX / tileWidth;\r\n};\r\n\r\nmodule.exports = WorldToTileX;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/WorldToTileX.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/WorldToTileXY.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/WorldToTileXY.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar WorldToTileX = __webpack_require__(/*! ./WorldToTileX */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileX.js\");\r\nvar WorldToTileY = __webpack_require__(/*! ./WorldToTileY */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileY.js\");\r\nvar Vector2 = __webpack_require__(/*! ../../math/Vector2 */ \"./node_modules/phaser/src/math/Vector2.js\");\r\n\r\n/**\r\n * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the\r\n * layer's position, scale and scroll. This will return a new Vector2 object or update the given\r\n * `point` object.\r\n *\r\n * @function Phaser.Tilemaps.Components.WorldToTileXY\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles.\r\n * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles.\r\n * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer.\r\n * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * \r\n * @return {Phaser.Math.Vector2} The XY location in tile units.\r\n */\r\nvar WorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer)\r\n{\r\n if (point === undefined) { point = new Vector2(0, 0); }\r\n\r\n point.x = WorldToTileX(worldX, snapToFloor, camera, layer);\r\n point.y = WorldToTileY(worldY, snapToFloor, camera, layer);\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = WorldToTileXY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/WorldToTileXY.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/WorldToTileY.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/WorldToTileY.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the\r\n * layer's position, scale and scroll.\r\n *\r\n * @function Phaser.Tilemaps.Components.WorldToTileY\r\n * @private\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles.\r\n * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.\r\n * \r\n * @return {number} The Y location in tile units.\r\n */\r\nvar WorldToTileY = function (worldY, snapToFloor, camera, layer)\r\n{\r\n if (snapToFloor === undefined) { snapToFloor = true; }\r\n\r\n var tileHeight = layer.baseTileHeight;\r\n var tilemapLayer = layer.tilemapLayer;\r\n\r\n if (tilemapLayer)\r\n {\r\n if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; }\r\n\r\n // Find the world position relative to the static or dynamic layer's top left origin,\r\n // factoring in the camera's vertical scroll\r\n worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY));\r\n\r\n tileHeight *= tilemapLayer.scaleY;\r\n }\r\n\r\n return snapToFloor\r\n ? Math.floor(worldY / tileHeight)\r\n : worldY / tileHeight;\r\n};\r\n\r\nmodule.exports = WorldToTileY;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/WorldToTileY.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/components/index.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/components/index.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Tilemaps.Components\r\n */\r\n\r\nmodule.exports = {\r\n\r\n CalculateFacesAt: __webpack_require__(/*! ./CalculateFacesAt */ \"./node_modules/phaser/src/tilemaps/components/CalculateFacesAt.js\"),\r\n CalculateFacesWithin: __webpack_require__(/*! ./CalculateFacesWithin */ \"./node_modules/phaser/src/tilemaps/components/CalculateFacesWithin.js\"),\r\n Copy: __webpack_require__(/*! ./Copy */ \"./node_modules/phaser/src/tilemaps/components/Copy.js\"),\r\n CreateFromTiles: __webpack_require__(/*! ./CreateFromTiles */ \"./node_modules/phaser/src/tilemaps/components/CreateFromTiles.js\"),\r\n CullTiles: __webpack_require__(/*! ./CullTiles */ \"./node_modules/phaser/src/tilemaps/components/CullTiles.js\"),\r\n Fill: __webpack_require__(/*! ./Fill */ \"./node_modules/phaser/src/tilemaps/components/Fill.js\"),\r\n FilterTiles: __webpack_require__(/*! ./FilterTiles */ \"./node_modules/phaser/src/tilemaps/components/FilterTiles.js\"),\r\n FindByIndex: __webpack_require__(/*! ./FindByIndex */ \"./node_modules/phaser/src/tilemaps/components/FindByIndex.js\"),\r\n FindTile: __webpack_require__(/*! ./FindTile */ \"./node_modules/phaser/src/tilemaps/components/FindTile.js\"),\r\n ForEachTile: __webpack_require__(/*! ./ForEachTile */ \"./node_modules/phaser/src/tilemaps/components/ForEachTile.js\"),\r\n GetTileAt: __webpack_require__(/*! ./GetTileAt */ \"./node_modules/phaser/src/tilemaps/components/GetTileAt.js\"),\r\n GetTileAtWorldXY: __webpack_require__(/*! ./GetTileAtWorldXY */ \"./node_modules/phaser/src/tilemaps/components/GetTileAtWorldXY.js\"),\r\n GetTilesWithin: __webpack_require__(/*! ./GetTilesWithin */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithin.js\"),\r\n GetTilesWithinShape: __webpack_require__(/*! ./GetTilesWithinShape */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithinShape.js\"),\r\n GetTilesWithinWorldXY: __webpack_require__(/*! ./GetTilesWithinWorldXY */ \"./node_modules/phaser/src/tilemaps/components/GetTilesWithinWorldXY.js\"),\r\n HasTileAt: __webpack_require__(/*! ./HasTileAt */ \"./node_modules/phaser/src/tilemaps/components/HasTileAt.js\"),\r\n HasTileAtWorldXY: __webpack_require__(/*! ./HasTileAtWorldXY */ \"./node_modules/phaser/src/tilemaps/components/HasTileAtWorldXY.js\"),\r\n IsInLayerBounds: __webpack_require__(/*! ./IsInLayerBounds */ \"./node_modules/phaser/src/tilemaps/components/IsInLayerBounds.js\"),\r\n PutTileAt: __webpack_require__(/*! ./PutTileAt */ \"./node_modules/phaser/src/tilemaps/components/PutTileAt.js\"),\r\n PutTileAtWorldXY: __webpack_require__(/*! ./PutTileAtWorldXY */ \"./node_modules/phaser/src/tilemaps/components/PutTileAtWorldXY.js\"),\r\n PutTilesAt: __webpack_require__(/*! ./PutTilesAt */ \"./node_modules/phaser/src/tilemaps/components/PutTilesAt.js\"),\r\n Randomize: __webpack_require__(/*! ./Randomize */ \"./node_modules/phaser/src/tilemaps/components/Randomize.js\"),\r\n RemoveTileAt: __webpack_require__(/*! ./RemoveTileAt */ \"./node_modules/phaser/src/tilemaps/components/RemoveTileAt.js\"),\r\n RemoveTileAtWorldXY: __webpack_require__(/*! ./RemoveTileAtWorldXY */ \"./node_modules/phaser/src/tilemaps/components/RemoveTileAtWorldXY.js\"),\r\n RenderDebug: __webpack_require__(/*! ./RenderDebug */ \"./node_modules/phaser/src/tilemaps/components/RenderDebug.js\"),\r\n ReplaceByIndex: __webpack_require__(/*! ./ReplaceByIndex */ \"./node_modules/phaser/src/tilemaps/components/ReplaceByIndex.js\"),\r\n SetCollision: __webpack_require__(/*! ./SetCollision */ \"./node_modules/phaser/src/tilemaps/components/SetCollision.js\"),\r\n SetCollisionBetween: __webpack_require__(/*! ./SetCollisionBetween */ \"./node_modules/phaser/src/tilemaps/components/SetCollisionBetween.js\"),\r\n SetCollisionByExclusion: __webpack_require__(/*! ./SetCollisionByExclusion */ \"./node_modules/phaser/src/tilemaps/components/SetCollisionByExclusion.js\"),\r\n SetCollisionByProperty: __webpack_require__(/*! ./SetCollisionByProperty */ \"./node_modules/phaser/src/tilemaps/components/SetCollisionByProperty.js\"),\r\n SetCollisionFromCollisionGroup: __webpack_require__(/*! ./SetCollisionFromCollisionGroup */ \"./node_modules/phaser/src/tilemaps/components/SetCollisionFromCollisionGroup.js\"),\r\n SetTileIndexCallback: __webpack_require__(/*! ./SetTileIndexCallback */ \"./node_modules/phaser/src/tilemaps/components/SetTileIndexCallback.js\"),\r\n SetTileLocationCallback: __webpack_require__(/*! ./SetTileLocationCallback */ \"./node_modules/phaser/src/tilemaps/components/SetTileLocationCallback.js\"),\r\n Shuffle: __webpack_require__(/*! ./Shuffle */ \"./node_modules/phaser/src/tilemaps/components/Shuffle.js\"),\r\n SwapByIndex: __webpack_require__(/*! ./SwapByIndex */ \"./node_modules/phaser/src/tilemaps/components/SwapByIndex.js\"),\r\n TileToWorldX: __webpack_require__(/*! ./TileToWorldX */ \"./node_modules/phaser/src/tilemaps/components/TileToWorldX.js\"),\r\n TileToWorldXY: __webpack_require__(/*! ./TileToWorldXY */ \"./node_modules/phaser/src/tilemaps/components/TileToWorldXY.js\"),\r\n TileToWorldY: __webpack_require__(/*! ./TileToWorldY */ \"./node_modules/phaser/src/tilemaps/components/TileToWorldY.js\"),\r\n WeightedRandomize: __webpack_require__(/*! ./WeightedRandomize */ \"./node_modules/phaser/src/tilemaps/components/WeightedRandomize.js\"),\r\n WorldToTileX: __webpack_require__(/*! ./WorldToTileX */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileX.js\"),\r\n WorldToTileXY: __webpack_require__(/*! ./WorldToTileXY */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileXY.js\"),\r\n WorldToTileY: __webpack_require__(/*! ./WorldToTileY */ \"./node_modules/phaser/src/tilemaps/components/WorldToTileY.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/components/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayer.js": /*!******************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayer.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../../gameobjects/components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar DynamicTilemapLayerRender = __webpack_require__(/*! ./DynamicTilemapLayerRender */ \"./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayerRender.js\");\r\nvar GameObject = __webpack_require__(/*! ../../gameobjects/GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar TilemapComponents = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/tilemaps/components/index.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Dynamic Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination\r\n * with one, or more, Tilesets.\r\n *\r\n * A Dynamic Tilemap Layer trades some speed for being able to apply powerful effects. Unlike a\r\n * Static Tilemap Layer, you can apply per-tile effects like tint or alpha, and you can change the\r\n * tiles in a DynamicTilemapLayer.\r\n * \r\n * Use this over a Static Tilemap Layer when you need those features.\r\n *\r\n * @class DynamicTilemapLayer\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.Tilemaps\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.ComputedSize\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs.\r\n * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of.\r\n * @param {integer} layerIndex - The index of the LayerData associated with this layer.\r\n * @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.\r\n * @param {number} [x=0] - The world x position where the top left of this layer will be placed.\r\n * @param {number} [y=0] - The world y position where the top left of this layer will be placed.\r\n */\r\nvar DynamicTilemapLayer = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.Alpha,\r\n Components.BlendMode,\r\n Components.ComputedSize,\r\n Components.Depth,\r\n Components.Flip,\r\n Components.GetBounds,\r\n Components.Origin,\r\n Components.Pipeline,\r\n Components.Transform,\r\n Components.Visible,\r\n Components.ScrollFactor,\r\n DynamicTilemapLayerRender\r\n ],\r\n\r\n initialize:\r\n\r\n function DynamicTilemapLayer (scene, tilemap, layerIndex, tileset, x, y)\r\n {\r\n GameObject.call(this, scene, 'DynamicTilemapLayer');\r\n\r\n /**\r\n * Used internally by physics system to perform fast type checks.\r\n *\r\n * @name Phaser.Tilemaps.DynamicTilemapLayer#isTilemap\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.isTilemap = true;\r\n\r\n /**\r\n * The Tilemap that this layer is a part of.\r\n *\r\n * @name Phaser.Tilemaps.DynamicTilemapLayer#tilemap\r\n * @type {Phaser.Tilemaps.Tilemap}\r\n * @since 3.0.0\r\n */\r\n this.tilemap = tilemap;\r\n\r\n /**\r\n * The index of the LayerData associated with this layer.\r\n *\r\n * @name Phaser.Tilemaps.DynamicTilemapLayer#layerIndex\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.layerIndex = layerIndex;\r\n\r\n /**\r\n * The LayerData associated with this layer. LayerData can only be associated with one\r\n * tilemap layer.\r\n *\r\n * @name Phaser.Tilemaps.DynamicTilemapLayer#layer\r\n * @type {Phaser.Tilemaps.LayerData}\r\n * @since 3.0.0\r\n */\r\n this.layer = tilemap.layers[layerIndex];\r\n\r\n // Link the LayerData with this static tilemap layer\r\n this.layer.tilemapLayer = this;\r\n\r\n /**\r\n * The Tileset/s associated with this layer.\r\n * \r\n * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference.\r\n *\r\n * @name Phaser.Tilemaps.DynamicTilemapLayer#tileset\r\n * @type {Phaser.Tilemaps.Tileset[]}\r\n * @since 3.0.0\r\n */\r\n this.tileset = [];\r\n\r\n /**\r\n * Used internally with the canvas render. This holds the tiles that are visible within the\r\n * camera.\r\n *\r\n * @name Phaser.Tilemaps.DynamicTilemapLayer#culledTiles\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.culledTiles = [];\r\n\r\n /**\r\n * You can control if the Cameras should cull tiles before rendering them or not.\r\n * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer.\r\n *\r\n * However, there are some instances when you may wish to disable this, and toggling this flag allows\r\n * you to do so. Also see `setSkipCull` for a chainable method that does the same thing.\r\n *\r\n * @name Phaser.Tilemaps.DynamicTilemapLayer#skipCull\r\n * @type {boolean}\r\n * @since 3.11.0\r\n */\r\n this.skipCull = false;\r\n\r\n /**\r\n * The total number of tiles drawn by the renderer in the last frame.\r\n *\r\n * @name Phaser.Tilemaps.DynamicTilemapLayer#tilesDrawn\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.11.0\r\n */\r\n this.tilesDrawn = 0;\r\n\r\n /**\r\n * The total number of tiles in this layer. Updated every frame.\r\n *\r\n * @name Phaser.Tilemaps.DynamicTilemapLayer#tilesTotal\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.11.0\r\n */\r\n this.tilesTotal = this.layer.width * this.layer.height;\r\n\r\n /**\r\n * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size.\r\n *\r\n * See the method `setCullPadding` for more details.\r\n *\r\n * @name Phaser.Tilemaps.DynamicTilemapLayer#cullPaddingX\r\n * @type {integer}\r\n * @default 1\r\n * @since 3.11.0\r\n */\r\n this.cullPaddingX = 1;\r\n\r\n /**\r\n * The amount of extra tiles to add into the cull rectangle when calculating its vertical size.\r\n *\r\n * See the method `setCullPadding` for more details.\r\n *\r\n * @name Phaser.Tilemaps.DynamicTilemapLayer#cullPaddingY\r\n * @type {integer}\r\n * @default 1\r\n * @since 3.11.0\r\n */\r\n this.cullPaddingY = 1;\r\n\r\n /**\r\n * The callback that is invoked when the tiles are culled.\r\n *\r\n * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like.\r\n *\r\n * It will be sent 3 arguments:\r\n *\r\n * 1. The Phaser.Tilemaps.LayerData object for this Layer\r\n * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull.\r\n * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered.\r\n *\r\n * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system.\r\n *\r\n * @name Phaser.Tilemaps.DynamicTilemapLayer#cullCallback\r\n * @type {function}\r\n * @since 3.11.0\r\n */\r\n this.cullCallback = TilemapComponents.CullTiles;\r\n\r\n /**\r\n * The rendering (draw) order of the tiles in this layer.\r\n * \r\n * The default is 0 which is 'right-down', meaning it will draw the tiles starting from the top-left,\r\n * drawing to the right and then moving down to the next row.\r\n * \r\n * The draw orders are:\r\n * \r\n * 0 = right-down\r\n * 1 = left-down\r\n * 2 = right-up\r\n * 3 = left-up\r\n * \r\n * This can be changed via the `setRenderOrder` method.\r\n *\r\n * @name Phaser.Tilemaps.DynamicTilemapLayer#_renderOrder\r\n * @type {integer}\r\n * @default 0\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._renderOrder = 0;\r\n\r\n /**\r\n * An array holding the mapping between the tile indexes and the tileset they belong to.\r\n *\r\n * @name Phaser.Tilemaps.DynamicTilemapLayer#gidMap\r\n * @type {Phaser.Tilemaps.Tileset[]}\r\n * @since 3.14.0\r\n */\r\n this.gidMap = [];\r\n\r\n this.setTilesets(tileset);\r\n this.setAlpha(this.layer.alpha);\r\n this.setPosition(x, y);\r\n this.setOrigin();\r\n this.setSize(tilemap.tileWidth * this.layer.width, tilemap.tileHeight * this.layer.height);\r\n\r\n this.initPipeline('TextureTintPipeline');\r\n },\r\n\r\n /**\r\n * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#setTilesets\r\n * @private\r\n * @since 3.14.0\r\n * \r\n * @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.\r\n */\r\n setTilesets: function (tilesets)\r\n {\r\n var gidMap = [];\r\n var setList = [];\r\n var map = this.tilemap;\r\n\r\n if (!Array.isArray(tilesets))\r\n {\r\n tilesets = [ tilesets ];\r\n }\r\n\r\n for (var i = 0; i < tilesets.length; i++)\r\n {\r\n var tileset = tilesets[i];\r\n\r\n if (typeof tileset === 'string')\r\n {\r\n tileset = map.getTileset(tileset);\r\n }\r\n\r\n if (tileset)\r\n {\r\n setList.push(tileset);\r\n\r\n var s = tileset.firstgid;\r\n\r\n for (var t = 0; t < tileset.total; t++)\r\n {\r\n gidMap[s + t] = tileset;\r\n }\r\n }\r\n }\r\n\r\n this.gidMap = gidMap;\r\n this.tileset = setList;\r\n },\r\n\r\n /**\r\n * Sets the rendering (draw) order of the tiles in this layer.\r\n * \r\n * The default is 'right-down', meaning it will order the tiles starting from the top-left,\r\n * drawing to the right and then moving down to the next row.\r\n * \r\n * The draw orders are:\r\n * \r\n * 0 = right-down\r\n * 1 = left-down\r\n * 2 = right-up\r\n * 3 = left-up\r\n * \r\n * Setting the render order does not change the tiles or how they are stored in the layer,\r\n * it purely impacts the order in which they are rendered.\r\n * \r\n * You can provide either an integer (0 to 3), or the string version of the order.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#setRenderOrder\r\n * @since 3.12.0\r\n *\r\n * @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'.\r\n *\r\n * @return {this} This Tilemap Layer object.\r\n */\r\n setRenderOrder: function (renderOrder)\r\n {\r\n var orders = [ 'right-down', 'left-down', 'right-up', 'left-up' ];\r\n\r\n if (typeof renderOrder === 'string')\r\n {\r\n renderOrder = orders.indexOf(renderOrder);\r\n }\r\n\r\n if (renderOrder >= 0 && renderOrder < 4)\r\n {\r\n this._renderOrder = renderOrder;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting\r\n * faces are used internally for optimizing collisions against tiles. This method is mostly used\r\n * internally to optimize recalculating faces when only one tile has been changed.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#calculateFacesAt\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The x coordinate.\r\n * @param {integer} tileY - The y coordinate.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n calculateFacesAt: function (tileX, tileY)\r\n {\r\n TilemapComponents.CalculateFacesAt(tileX, tileY, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the\r\n * layer. Interesting faces are used internally for optimizing collisions against tiles. This method\r\n * is mostly used internally.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#calculateFacesWithin\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n calculateFacesWithin: function (tileX, tileY, width, height)\r\n {\r\n TilemapComponents.CalculateFacesWithin(tileX, tileY, width, height, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a Sprite for every object matching the given tile indexes in the layer. You can\r\n * optionally specify if each tile will be replaced with a new tile after the Sprite has been\r\n * created. This is useful if you want to lay down special tiles in a level that are converted to\r\n * Sprites, but want to replace the tile itself with a floor tile or similar once converted.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#createFromTiles\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from.\r\n * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted\r\n * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a\r\n * one-to-one mapping with the indexes array.\r\n * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e.\r\n * scene.make.sprite).\r\n * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY\r\n *\r\n * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created.\r\n */\r\n createFromTiles: function (indexes, replacements, spriteConfig, scene, camera)\r\n {\r\n return TilemapComponents.CreateFromTiles(indexes, replacements, spriteConfig, scene, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Returns the tiles in the given layer that are within the cameras viewport.\r\n * This is used internally.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#cull\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against.\r\n *\r\n * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.\r\n */\r\n cull: function (camera)\r\n {\r\n return this.cullCallback(this.layer, camera, this.culledTiles, this._renderOrder);\r\n },\r\n\r\n /**\r\n * Copies the tiles in the source rectangular area to a new destination (all specified in tile\r\n * coordinates) within the layer. This copies all tile properties & recalculates collision\r\n * information in the destination region.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#copy\r\n * @since 3.0.0\r\n *\r\n * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels.\r\n * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels.\r\n * @param {integer} width - The width of the area to copy, in tiles, not pixels.\r\n * @param {integer} height - The height of the area to copy, in tiles, not pixels.\r\n * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels.\r\n * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n copy: function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces)\r\n {\r\n TilemapComponents.Copy(srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Destroys this DynamicTilemapLayer and removes its link to the associated LayerData.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#destroy\r\n * @since 3.0.0\r\n * \r\n * @param {boolean} [removeFromTilemap=true] - Remove this layer from the parent Tilemap?\r\n */\r\n destroy: function (removeFromTilemap)\r\n {\r\n if (removeFromTilemap === undefined) { removeFromTilemap = true; }\r\n\r\n if (!this.tilemap)\r\n {\r\n // Abort, we've already been destroyed\r\n return;\r\n }\r\n\r\n // Uninstall this layer only if it is still installed on the LayerData object\r\n if (this.layer.tilemapLayer === this)\r\n {\r\n this.layer.tilemapLayer = undefined;\r\n }\r\n\r\n if (removeFromTilemap)\r\n {\r\n this.tilemap.removeLayer(this);\r\n }\r\n\r\n this.tilemap = undefined;\r\n this.layer = undefined;\r\n this.culledTiles.length = 0;\r\n this.cullCallback = null;\r\n\r\n this.gidMap = [];\r\n this.tileset = [];\r\n\r\n GameObject.prototype.destroy.call(this);\r\n },\r\n\r\n /**\r\n * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the\r\n * specified index. Tiles will be set to collide if the given index is a colliding index.\r\n * Collision information in the region will be recalculated.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#fill\r\n * @since 3.0.0\r\n *\r\n * @param {integer} index - The tile index to fill the area with.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n fill: function (index, tileX, tileY, width, height, recalculateFaces)\r\n {\r\n TilemapComponents.Fill(index, tileX, tileY, width, height, recalculateFaces, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given\r\n * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns\r\n * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#filterTiles\r\n * @since 3.0.0\r\n *\r\n * @param {function} callback - The callback. Each tile in the given area will be passed to this\r\n * callback as the first and only parameter. The callback should return true for tiles that pass the\r\n * filter.\r\n * @param {object} [context] - The context under which the callback should be run.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n *\r\n * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.\r\n */\r\n filterTiles: function (callback, context, tileX, tileY, width, height, filteringOptions)\r\n {\r\n return TilemapComponents.FilterTiles(callback, context, tileX, tileY, width, height, filteringOptions, this.layer);\r\n },\r\n\r\n /**\r\n * Searches the entire map layer for the first tile matching the given index, then returns that Tile\r\n * object. If no match is found, it returns null. The search starts from the top-left tile and\r\n * continues horizontally until it hits the end of the row, then it drops down to the next column.\r\n * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to\r\n * the top-left.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#findByIndex\r\n * @since 3.0.0\r\n *\r\n * @param {integer} index - The tile index value to search for.\r\n * @param {integer} [skip=0] - The number of times to skip a matching tile before returning.\r\n * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the\r\n * bottom-right. Otherwise it scans from the top-left.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} A Tile object.\r\n */\r\n findByIndex: function (findIndex, skip, reverse)\r\n {\r\n return TilemapComponents.FindByIndex(findIndex, skip, reverse, this.layer);\r\n },\r\n\r\n /**\r\n * Find the first tile in the given rectangular area (in tile coordinates) of the layer that\r\n * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns\r\n * true. Similar to Array.prototype.find in vanilla JS.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#findTile\r\n * @since 3.0.0\r\n *\r\n * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter.\r\n * @param {object} [context] - The context under which the callback should be run.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile}\r\n */\r\n findTile: function (callback, context, tileX, tileY, width, height, filteringOptions)\r\n {\r\n return TilemapComponents.FindTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer);\r\n },\r\n\r\n /**\r\n * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given\r\n * callback. Similar to Array.prototype.forEach in vanilla JS.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#forEachTile\r\n * @since 3.0.0\r\n *\r\n * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter.\r\n * @param {object} [context] - The context under which the callback should be run.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n forEachTile: function (callback, context, tileX, tileY, width, height, filteringOptions)\r\n {\r\n TilemapComponents.ForEachTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets a tile at the given tile coordinates from the given layer.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#getTileAt\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels).\r\n * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels).\r\n * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid.\r\n */\r\n getTileAt: function (tileX, tileY, nonNull)\r\n {\r\n return TilemapComponents.GetTileAt(tileX, tileY, nonNull, this.layer);\r\n },\r\n\r\n /**\r\n * Gets a tile at the given world coordinates from the given layer.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#getTileAtWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - X position to get the tile from (given in pixels)\r\n * @param {number} worldY - Y position to get the tile from (given in pixels)\r\n * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates\r\n * were invalid.\r\n */\r\n getTileAtWorldXY: function (worldX, worldY, nonNull, camera)\r\n {\r\n return TilemapComponents.GetTileAtWorldXY(worldX, worldY, nonNull, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Gets the tiles in the given rectangular area (in tile coordinates) of the layer.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithin\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n *\r\n * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.\r\n */\r\n getTilesWithin: function (tileX, tileY, width, height, filteringOptions)\r\n {\r\n return TilemapComponents.GetTilesWithin(tileX, tileY, width, height, filteringOptions, this.layer);\r\n },\r\n\r\n /**\r\n * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle,\r\n * Line, Rectangle or Triangle. The shape should be in world coordinates.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinShape\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.\r\n *\r\n * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.\r\n */\r\n getTilesWithinShape: function (shape, filteringOptions, camera)\r\n {\r\n return TilemapComponents.GetTilesWithinShape(shape, filteringOptions, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Gets the tiles in the given rectangular area (in world coordinates) of the layer.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The world x coordinate for the top-left of the area.\r\n * @param {number} worldY - The world y coordinate for the top-left of the area.\r\n * @param {number} width - The width of the area.\r\n * @param {number} height - The height of the area.\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.\r\n *\r\n * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.\r\n */\r\n getTilesWithinWorldXY: function (worldX, worldY, width, height, filteringOptions, camera)\r\n {\r\n return TilemapComponents.GetTilesWithinWorldXY(worldX, worldY, width, height, filteringOptions, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns\r\n * false if there is no tile or if the tile at that location has an index of -1.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAt\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n *\r\n * @return {boolean} `true` if a tile was found at the given location, otherwise `false`.\r\n */\r\n hasTileAt: function (tileX, tileY)\r\n {\r\n return TilemapComponents.HasTileAt(tileX, tileY, this.layer);\r\n },\r\n\r\n /**\r\n * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns\r\n * false if there is no tile or if the tile at that location has an index of -1.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAtWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The x coordinate, in pixels.\r\n * @param {number} worldY - The y coordinate, in pixels.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.\r\n *\r\n * @return {boolean} `true` if a tile was found at the given location, otherwise `false`.\r\n */\r\n hasTileAtWorldXY: function (worldX, worldY, camera)\r\n {\r\n return TilemapComponents.HasTileAtWorldXY(worldX, worldY, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index\r\n * or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified\r\n * location. If you pass in an index, only the index at the specified location will be changed.\r\n * Collision information will be recalculated at the specified location.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#putTileAt\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object.\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} A Tile object.\r\n */\r\n putTileAt: function (tile, tileX, tileY, recalculateFaces)\r\n {\r\n return TilemapComponents.PutTileAt(tile, tileX, tileY, recalculateFaces, this.layer);\r\n },\r\n\r\n /**\r\n * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either\r\n * an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the\r\n * specified location. If you pass in an index, only the index at the specified location will be\r\n * changed. Collision information will be recalculated at the specified location.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#putTileAtWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object.\r\n * @param {number} worldX - The x coordinate, in pixels.\r\n * @param {number} worldY - The y coordinate, in pixels.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} A Tile object.\r\n */\r\n putTileAtWorldXY: function (tile, worldX, worldY, recalculateFaces, camera)\r\n {\r\n return TilemapComponents.PutTileAtWorldXY(tile, worldX, worldY, recalculateFaces, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified\r\n * layer. The array can be composed of either tile indexes or Tile objects. If you pass in a Tile,\r\n * all attributes will be copied over to the specified location. If you pass in an index, only the\r\n * index at the specified location will be changed. Collision information will be recalculated\r\n * within the region tiles were changed.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#putTilesAt\r\n * @since 3.0.0\r\n *\r\n * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place.\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n putTilesAt: function (tilesArray, tileX, tileY, recalculateFaces)\r\n {\r\n TilemapComponents.PutTilesAt(tilesArray, tileX, tileY, recalculateFaces, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the\r\n * specified layer. Each tile will receive a new index. If an array of indexes is passed in, then\r\n * those will be used for randomly assigning new tile indexes. If an array is not provided, the\r\n * indexes found within the region (excluding -1) will be used for randomly assigning new tile\r\n * indexes. This method only modifies tile indexes and does not change collision information.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#randomize\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n randomize: function (tileX, tileY, width, height, indexes)\r\n {\r\n TilemapComponents.Randomize(tileX, tileY, width, height, indexes, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes the tile at the given tile coordinates in the specified layer and updates the layer's\r\n * collision information.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAt\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @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.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} A Tile object.\r\n */\r\n removeTileAt: function (tileX, tileY, replaceWithNull, recalculateFaces)\r\n {\r\n return TilemapComponents.RemoveTileAt(tileX, tileY, replaceWithNull, recalculateFaces, this.layer);\r\n },\r\n\r\n /**\r\n * Removes the tile at the given world coordinates in the specified layer and updates the layer's\r\n * collision information.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAtWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The x coordinate, in pixels.\r\n * @param {number} worldY - The y coordinate, in pixels.\r\n * @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.\r\n * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} A Tile object.\r\n */\r\n removeTileAtWorldXY: function (worldX, worldY, replaceWithNull, recalculateFaces, camera)\r\n {\r\n return TilemapComponents.RemoveTileAtWorldXY(worldX, worldY, replaceWithNull, recalculateFaces, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to\r\n * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles\r\n * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation\r\n * wherever you want on the screen.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#renderDebug\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon.\r\n * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n renderDebug: function (graphics, styleConfig)\r\n {\r\n TilemapComponents.RenderDebug(graphics, styleConfig, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching\r\n * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does\r\n * not change collision information.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#replaceByIndex\r\n * @since 3.0.0\r\n *\r\n * @param {integer} findIndex - The index of the tile to search for.\r\n * @param {integer} newIndex - The index of the tile to replace it with.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n replaceByIndex: function (findIndex, newIndex, tileX, tileY, width, height)\r\n {\r\n TilemapComponents.ReplaceByIndex(findIndex, newIndex, tileX, tileY, width, height, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * You can control if the Cameras should cull tiles before rendering them or not.\r\n * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer.\r\n *\r\n * However, there are some instances when you may wish to disable this.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#setSkipCull\r\n * @since 3.11.0\r\n *\r\n * @param {boolean} [value=true] - Set to `true` to stop culling tiles. Set to `false` to enable culling again.\r\n *\r\n * @return {this} This Tilemap Layer object.\r\n */\r\n setSkipCull: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skipCull = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * When a Camera culls the tiles in this layer it does so using its view into the world, building up a\r\n * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size\r\n * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so\r\n * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px\r\n * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale)\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#setCullPadding\r\n * @since 3.11.0\r\n *\r\n * @param {integer} [paddingX=1] - The amount of extra horizontal tiles to add to the cull check padding.\r\n * @param {integer} [paddingY=1] - The amount of extra vertical tiles to add to the cull check padding.\r\n *\r\n * @return {this} This Tilemap Layer object.\r\n */\r\n setCullPadding: function (paddingX, paddingY)\r\n {\r\n if (paddingX === undefined) { paddingX = 1; }\r\n if (paddingY === undefined) { paddingY = 1; }\r\n\r\n this.cullPaddingX = paddingX;\r\n this.cullPaddingY = paddingY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets collision on the given tile or tiles within a layer by index. You can pass in either a\r\n * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if\r\n * collision will be enabled (true) or disabled (false).\r\n *\r\n * If no layer specified, the map's current layer is used.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollision\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.\r\n * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to\r\n * false if no tiles have been placed for significant performance boost.\r\n *\r\n * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.\r\n */\r\n setCollision: function (indexes, collides, recalculateFaces, updateLayer)\r\n {\r\n TilemapComponents.SetCollision(indexes, collides, recalculateFaces, this.layer, updateLayer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets collision on a range of tiles in a layer whose index is between the specified `start` and\r\n * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set\r\n * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be\r\n * enabled (true) or disabled (false).\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionBetween\r\n * @since 3.0.0\r\n *\r\n * @param {integer} start - The first index of the tile to be set for collision.\r\n * @param {integer} stop - The last index of the tile to be set for collision.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n setCollisionBetween: function (start, stop, collides, recalculateFaces)\r\n {\r\n TilemapComponents.SetCollisionBetween(start, stop, collides, recalculateFaces, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property\r\n * that matches the given properties object, its collision flag will be set. The `collides`\r\n * parameter controls if collision will be enabled (true) or disabled (false). Passing in\r\n * `{ collides: true }` would update the collision flag on any tiles with a \"collides\" property that\r\n * has a value of true. Any tile that doesn't have \"collides\" set to true will be ignored. You can\r\n * also use an array of values, e.g. `{ types: [\"stone\", \"lava\", \"sand\" ] }`. If a tile has a\r\n * \"types\" property that matches any of those values, its collision flag will be updated.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionByProperty\r\n * @since 3.0.0\r\n *\r\n * @param {object} properties - An object with tile properties and corresponding values that should be checked.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n setCollisionByProperty: function (properties, collides, recalculateFaces)\r\n {\r\n TilemapComponents.SetCollisionByProperty(properties, collides, recalculateFaces, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets collision on all tiles in the given layer, except for tiles that have an index specified in\r\n * the given array. The `collides` parameter controls if collision will be enabled (true) or\r\n * disabled (false).\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionByExclusion\r\n * @since 3.0.0\r\n *\r\n * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n setCollisionByExclusion: function (indexes, collides, recalculateFaces)\r\n {\r\n TilemapComponents.SetCollisionByExclusion(indexes, collides, recalculateFaces, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets collision on the tiles within a layer by checking each tiles collision group data\r\n * (typically defined in Tiled within the tileset collision editor). If any objects are found within\r\n * a tiles collision group, the tile's colliding information will be set. The `collides` parameter\r\n * controls if collision will be enabled (true) or disabled (false).\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionFromCollisionGroup\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n setCollisionFromCollisionGroup: function (collides, recalculateFaces)\r\n {\r\n TilemapComponents.SetCollisionFromCollisionGroup(collides, recalculateFaces, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a global collision callback for the given tile index within the layer. This will affect all\r\n * tiles on this layer that have the same index. If a callback is already set for the tile index it\r\n * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile\r\n * at a specific location on the map then see setTileLocationCallback.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#setTileIndexCallback\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|integer[])} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for.\r\n * @param {function} callback - The callback that will be invoked when the tile is collided with.\r\n * @param {object} callbackContext - The context under which the callback is called.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n setTileIndexCallback: function (indexes, callback, callbackContext)\r\n {\r\n TilemapComponents.SetTileIndexCallback(indexes, callback, callbackContext, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer.\r\n * If a callback is already set for the tile index it will be replaced. Set the callback to null to\r\n * remove it.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#setTileLocationCallback\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {function} [callback] - The callback that will be invoked when the tile is collided with.\r\n * @param {object} [callbackContext] - The context under which the callback is called.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n setTileLocationCallback: function (tileX, tileY, width, height, callback, callbackContext)\r\n {\r\n TilemapComponents.SetTileLocationCallback(tileX, tileY, width, height, callback, callbackContext, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given\r\n * layer. It will only randomize the tiles in that area, so if they're all the same nothing will\r\n * appear to have changed! This method only modifies tile indexes and does not change collision\r\n * information.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#shuffle\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n shuffle: function (tileX, tileY, width, height)\r\n {\r\n TilemapComponents.Shuffle(tileX, tileY, width, height, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching\r\n * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision\r\n * information.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#swapByIndex\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileA - First tile index.\r\n * @param {integer} tileB - Second tile index.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n swapByIndex: function (indexA, indexB, tileX, tileY, width, height)\r\n {\r\n TilemapComponents.SwapByIndex(indexA, indexB, tileX, tileY, width, height, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the\r\n * layers position, scale and scroll.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldX\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n *\r\n * @return {number}\r\n */\r\n tileToWorldX: function (tileX, camera)\r\n {\r\n return TilemapComponents.TileToWorldX(tileX, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the\r\n * layers position, scale and scroll.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldY\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n *\r\n * @return {number}\r\n */\r\n tileToWorldY: function (tileY, camera)\r\n {\r\n return TilemapComponents.TileToWorldY(tileY, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the\r\n * layers position, scale and scroll. This will return a new Vector2 object or update the given\r\n * `point` object.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The x coordinate, in tiles, not pixels.\r\n * @param {integer} tileY - The y coordinate, in tiles, not pixels.\r\n * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n *\r\n * @return {Phaser.Math.Vector2}\r\n */\r\n tileToWorldXY: function (tileX, tileY, point, camera)\r\n {\r\n return TilemapComponents.TileToWorldXY(tileX, tileY, point, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the\r\n * specified layer. Each tile will receive a new index. New indexes are drawn from the given\r\n * weightedIndexes array. An example weighted array:\r\n *\r\n * [\r\n * { index: 6, weight: 4 }, // Probability of index 6 is 4 / 8\r\n * { index: 7, weight: 2 }, // Probability of index 7 would be 2 / 8\r\n * { index: 8, weight: 1.5 }, // Probability of index 8 would be 1.5 / 8\r\n * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8\r\n * ]\r\n *\r\n * The probability of any index being choose is (the index's weight) / (sum of all weights). This\r\n * method only modifies tile indexes and does not change collision information.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#weightedRandomize\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during\r\n * randomization. They should be in the form: { index: 0, weight: 4 } or\r\n * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes.\r\n *\r\n * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.\r\n */\r\n weightedRandomize: function (tileX, tileY, width, height, weightedIndexes)\r\n {\r\n TilemapComponents.WeightedRandomize(tileX, tileY, width, height, weightedIndexes, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the\r\n * layers position, scale and scroll.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileX\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles.\r\n * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n *\r\n * @return {number}\r\n */\r\n worldToTileX: function (worldX, snapToFloor, camera)\r\n {\r\n return TilemapComponents.WorldToTileX(worldX, snapToFloor, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the\r\n * layers position, scale and scroll.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles.\r\n * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n *\r\n * @return {number}\r\n */\r\n worldToTileY: function (worldY, snapToFloor, camera)\r\n {\r\n return TilemapComponents.WorldToTileY(worldY, snapToFloor, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the\r\n * layers position, scale and scroll. This will return a new Vector2 object or update the given\r\n * `point` object.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles.\r\n * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles.\r\n * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer.\r\n * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n *\r\n * @return {Phaser.Math.Vector2}\r\n */\r\n worldToTileXY: function (worldX, worldY, snapToFloor, point, camera)\r\n {\r\n return TilemapComponents.WorldToTileXY(worldX, worldY, snapToFloor, point, camera, this.layer);\r\n }\r\n\r\n});\r\n\r\nmodule.exports = DynamicTilemapLayer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayer.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayerCanvasRenderer.js": /*!********************************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayerCanvasRenderer.js ***! \********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#renderCanvas\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.Tilemaps.DynamicTilemapLayer} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar DynamicTilemapLayerCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n src.cull(camera);\r\n\r\n var renderTiles = src.culledTiles;\r\n var tileCount = renderTiles.length;\r\n\r\n if (tileCount === 0)\r\n {\r\n return;\r\n }\r\n\r\n var camMatrix = renderer._tempMatrix1;\r\n var layerMatrix = renderer._tempMatrix2;\r\n var calcMatrix = renderer._tempMatrix3;\r\n\r\n layerMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n var ctx = renderer.currentContext;\r\n var gidMap = src.gidMap;\r\n\r\n ctx.save();\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n layerMatrix.e = src.x;\r\n layerMatrix.f = src.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(layerMatrix, calcMatrix);\r\n\r\n calcMatrix.copyToContext(ctx);\r\n }\r\n else\r\n {\r\n layerMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n layerMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n layerMatrix.copyToContext(ctx);\r\n }\r\n\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (!renderer.antialias || src.scaleX > 1 || src.scaleY > 1)\r\n {\r\n ctx.imageSmoothingEnabled = false;\r\n }\r\n\r\n for (var i = 0; i < tileCount; i++)\r\n {\r\n var tile = renderTiles[i];\r\n\r\n var tileset = gidMap[tile.index];\r\n\r\n if (!tileset)\r\n {\r\n continue;\r\n }\r\n\r\n var image = tileset.image.getSourceImage();\r\n var tileTexCoords = tileset.getTileTextureCoordinates(tile.index);\r\n\r\n if (tileTexCoords)\r\n {\r\n var halfWidth = tile.width / 2;\r\n var halfHeight = tile.height / 2;\r\n \r\n ctx.save();\r\n\r\n ctx.translate(tile.pixelX + halfWidth, tile.pixelY + halfHeight);\r\n \r\n if (tile.rotation !== 0)\r\n {\r\n ctx.rotate(tile.rotation);\r\n }\r\n \r\n if (tile.flipX || tile.flipY)\r\n {\r\n ctx.scale((tile.flipX) ? -1 : 1, (tile.flipY) ? -1 : 1);\r\n }\r\n \r\n ctx.globalAlpha = alpha * tile.alpha;\r\n \r\n ctx.drawImage(\r\n image,\r\n tileTexCoords.x, tileTexCoords.y,\r\n tile.width, tile.height,\r\n -halfWidth, -halfHeight,\r\n tile.width, tile.height\r\n );\r\n \r\n ctx.restore();\r\n }\r\n }\r\n\r\n ctx.restore();\r\n};\r\n\r\nmodule.exports = DynamicTilemapLayerCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayerCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayerRender.js": /*!************************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayerRender.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./DynamicTilemapLayerWebGLRenderer */ \"./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayerWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./DynamicTilemapLayerCanvasRenderer */ \"./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayerCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayerRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayerWebGLRenderer.js": /*!*******************************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayerWebGLRenderer.js ***! \*******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Utils = __webpack_require__(/*! ../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.Tilemaps.DynamicTilemapLayer#renderWebGL\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.Tilemaps.DynamicTilemapLayer} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n */\r\nvar DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPercentage, camera)\r\n{\r\n src.cull(camera);\r\n\r\n var renderTiles = src.culledTiles;\r\n var tileCount = renderTiles.length;\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (tileCount === 0 || alpha <= 0)\r\n {\r\n return;\r\n }\r\n\r\n var gidMap = src.gidMap;\r\n var pipeline = src.pipeline;\r\n\r\n var getTint = Utils.getTintAppendFloatAlphaAndSwap;\r\n\r\n var scrollFactorX = src.scrollFactorX;\r\n var scrollFactorY = src.scrollFactorY;\r\n\r\n var x = src.x;\r\n var y = src.y;\r\n\r\n var sx = src.scaleX;\r\n var sy = src.scaleY;\r\n\r\n var tilesets = src.tileset;\r\n\r\n // Loop through each tileset in this layer, drawing just the tiles that are in that set each time\r\n // Doing it this way around allows us to batch tiles using the same tileset\r\n for (var c = 0; c < tilesets.length; c++)\r\n {\r\n var currentSet = tilesets[c];\r\n var texture = currentSet.glTexture;\r\n\r\n for (var i = 0; i < tileCount; i++)\r\n {\r\n var tile = renderTiles[i];\r\n\r\n var tileset = gidMap[tile.index];\r\n\r\n if (tileset !== currentSet)\r\n {\r\n // Skip tiles that aren't in this set\r\n continue;\r\n }\r\n \r\n var tileTexCoords = tileset.getTileTextureCoordinates(tile.index);\r\n\r\n if (tileTexCoords === null)\r\n {\r\n continue;\r\n }\r\n\r\n var frameWidth = tile.width;\r\n var frameHeight = tile.height;\r\n\r\n var frameX = tileTexCoords.x;\r\n var frameY = tileTexCoords.y;\r\n\r\n var tw = tile.width * 0.5;\r\n var th = tile.height * 0.5;\r\n\r\n var tint = getTint(tile.tint, alpha * tile.alpha);\r\n\r\n pipeline.batchTexture(\r\n src,\r\n texture,\r\n texture.width, texture.height,\r\n x + ((tw + tile.pixelX) * sx), y + ((th + tile.pixelY) * sy),\r\n tile.width, tile.height,\r\n sx, sy,\r\n tile.rotation,\r\n tile.flipX, tile.flipY,\r\n scrollFactorX, scrollFactorY,\r\n tw, th,\r\n frameX, frameY, frameWidth, frameHeight,\r\n tint, tint, tint, tint, false,\r\n 0, 0,\r\n camera,\r\n null,\r\n true\r\n );\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = DynamicTilemapLayerWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayerWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/index.js": /*!***************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/index.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Tilemaps\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Components: __webpack_require__(/*! ./components */ \"./node_modules/phaser/src/tilemaps/components/index.js\"),\r\n Parsers: __webpack_require__(/*! ./parsers */ \"./node_modules/phaser/src/tilemaps/parsers/index.js\"),\r\n\r\n Formats: __webpack_require__(/*! ./Formats */ \"./node_modules/phaser/src/tilemaps/Formats.js\"),\r\n ImageCollection: __webpack_require__(/*! ./ImageCollection */ \"./node_modules/phaser/src/tilemaps/ImageCollection.js\"),\r\n ParseToTilemap: __webpack_require__(/*! ./ParseToTilemap */ \"./node_modules/phaser/src/tilemaps/ParseToTilemap.js\"),\r\n Tile: __webpack_require__(/*! ./Tile */ \"./node_modules/phaser/src/tilemaps/Tile.js\"),\r\n Tilemap: __webpack_require__(/*! ./Tilemap */ \"./node_modules/phaser/src/tilemaps/Tilemap.js\"),\r\n TilemapCreator: __webpack_require__(/*! ./TilemapCreator */ \"./node_modules/phaser/src/tilemaps/TilemapCreator.js\"),\r\n TilemapFactory: __webpack_require__(/*! ./TilemapFactory */ \"./node_modules/phaser/src/tilemaps/TilemapFactory.js\"),\r\n Tileset: __webpack_require__(/*! ./Tileset */ \"./node_modules/phaser/src/tilemaps/Tileset.js\"),\r\n\r\n LayerData: __webpack_require__(/*! ./mapdata/LayerData */ \"./node_modules/phaser/src/tilemaps/mapdata/LayerData.js\"),\r\n MapData: __webpack_require__(/*! ./mapdata/MapData */ \"./node_modules/phaser/src/tilemaps/mapdata/MapData.js\"),\r\n ObjectLayer: __webpack_require__(/*! ./mapdata/ObjectLayer */ \"./node_modules/phaser/src/tilemaps/mapdata/ObjectLayer.js\"),\r\n\r\n DynamicTilemapLayer: __webpack_require__(/*! ./dynamiclayer/DynamicTilemapLayer */ \"./node_modules/phaser/src/tilemaps/dynamiclayer/DynamicTilemapLayer.js\"),\r\n StaticTilemapLayer: __webpack_require__(/*! ./staticlayer/StaticTilemapLayer */ \"./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayer.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/mapdata/LayerData.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/mapdata/LayerData.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A class for representing data about about a layer in a map. Maps are parsed from CSV, Tiled,\r\n * etc. into this format. Tilemap, StaticTilemapLayer and DynamicTilemapLayer have a reference\r\n * to this data and use it to look up and perform operations on tiles.\r\n *\r\n * @class LayerData\r\n * @memberof Phaser.Tilemaps\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {object} [config] - [description]\r\n */\r\nvar LayerData = new Class({\r\n\r\n initialize:\r\n\r\n function LayerData (config)\r\n {\r\n if (config === undefined) { config = {}; }\r\n\r\n /**\r\n * The name of the layer, if specified in Tiled.\r\n *\r\n * @name Phaser.Tilemaps.LayerData#name\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.name = GetFastValue(config, 'name', 'layer');\r\n\r\n /**\r\n * The x offset of where to draw from the top left\r\n *\r\n * @name Phaser.Tilemaps.LayerData#x\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.x = GetFastValue(config, 'x', 0);\r\n\r\n /**\r\n * The y offset of where to draw from the top left\r\n *\r\n * @name Phaser.Tilemaps.LayerData#y\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.y = GetFastValue(config, 'y', 0);\r\n\r\n /**\r\n * The width in tile of the layer.\r\n *\r\n * @name Phaser.Tilemaps.LayerData#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.width = GetFastValue(config, 'width', 0);\r\n\r\n /**\r\n * The height in tiles of the layer.\r\n *\r\n * @name Phaser.Tilemaps.LayerData#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.height = GetFastValue(config, 'height', 0);\r\n\r\n /**\r\n * The pixel width of the tiles.\r\n *\r\n * @name Phaser.Tilemaps.LayerData#tileWidth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.tileWidth = GetFastValue(config, 'tileWidth', 0);\r\n\r\n /**\r\n * The pixel height of the tiles.\r\n *\r\n * @name Phaser.Tilemaps.LayerData#tileHeight\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.tileHeight = GetFastValue(config, 'tileHeight', 0);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Tilemaps.LayerData#baseTileWidth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.baseTileWidth = GetFastValue(config, 'baseTileWidth', this.tileWidth);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Tilemaps.LayerData#baseTileHeight\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.baseTileHeight = GetFastValue(config, 'baseTileHeight', this.tileHeight);\r\n\r\n /**\r\n * The width in pixels of the entire layer.\r\n *\r\n * @name Phaser.Tilemaps.LayerData#widthInPixels\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.widthInPixels = GetFastValue(config, 'widthInPixels', this.width * this.baseTileWidth);\r\n\r\n /**\r\n * The height in pixels of the entire layer.\r\n *\r\n * @name Phaser.Tilemaps.LayerData#heightInPixels\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.heightInPixels = GetFastValue(config, 'heightInPixels', this.height * this.baseTileHeight);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Tilemaps.LayerData#alpha\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.alpha = GetFastValue(config, 'alpha', 1);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Tilemaps.LayerData#visible\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.visible = GetFastValue(config, 'visible', true);\r\n\r\n /**\r\n * Layer specific properties (can be specified in Tiled)\r\n *\r\n * @name Phaser.Tilemaps.LayerData#properties\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.properties = GetFastValue(config, 'properties', {});\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Tilemaps.LayerData#indexes\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.indexes = GetFastValue(config, 'indexes', []);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Tilemaps.LayerData#collideIndexes\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.collideIndexes = GetFastValue(config, 'collideIndexes', []);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Tilemaps.LayerData#callbacks\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.callbacks = GetFastValue(config, 'callbacks', []);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Tilemaps.LayerData#bodies\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.bodies = GetFastValue(config, 'bodies', []);\r\n\r\n /**\r\n * An array of the tile indexes\r\n *\r\n * @name Phaser.Tilemaps.LayerData#data\r\n * @type {Phaser.Tilemaps.Tile[][]}\r\n * @since 3.0.0\r\n */\r\n this.data = GetFastValue(config, 'data', []);\r\n\r\n /**\r\n * [description]\r\n *\r\n * @name Phaser.Tilemaps.LayerData#tilemapLayer\r\n * @type {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)}\r\n * @since 3.0.0\r\n */\r\n this.tilemapLayer = GetFastValue(config, 'tilemapLayer', null);\r\n }\r\n\r\n});\r\n\r\nmodule.exports = LayerData;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/mapdata/LayerData.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/mapdata/MapData.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/mapdata/MapData.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A class for representing data about a map. Maps are parsed from CSV, Tiled, etc. into this\r\n * format. A Tilemap object get a copy of this data and then unpacks the needed properties into\r\n * itself.\r\n *\r\n * @class MapData\r\n * @memberof Phaser.Tilemaps\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Tilemaps.MapDataConfig} [config] - The Map configuration object.\r\n */\r\nvar MapData = new Class({\r\n\r\n initialize:\r\n\r\n function MapData (config)\r\n {\r\n if (config === undefined) { config = {}; }\r\n\r\n /**\r\n * The key in the Phaser cache that corresponds to the loaded tilemap data.\r\n * \r\n * @name Phaser.Tilemaps.MapData#name\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.name = GetFastValue(config, 'name', 'map');\r\n\r\n /**\r\n * The width of the entire tilemap.\r\n * \r\n * @name Phaser.Tilemaps.MapData#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.width = GetFastValue(config, 'width', 0);\r\n\r\n /**\r\n * The height of the entire tilemap.\r\n * \r\n * @name Phaser.Tilemaps.MapData#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.height = GetFastValue(config, 'height', 0);\r\n\r\n /**\r\n * If the map is infinite or not.\r\n *\r\n * @name Phaser.Tilemaps.MapData#infinite\r\n * @type {boolean}\r\n * @since 3.17.0\r\n */\r\n this.infinite = GetFastValue(config, 'infinite', false);\r\n\r\n /**\r\n * The width of the tiles.\r\n * \r\n * @name Phaser.Tilemaps.MapData#tileWidth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.tileWidth = GetFastValue(config, 'tileWidth', 0);\r\n\r\n /**\r\n * The height of the tiles.\r\n * \r\n * @name Phaser.Tilemaps.MapData#tileHeight\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.tileHeight = GetFastValue(config, 'tileHeight', 0);\r\n\r\n /**\r\n * The width in pixels of the entire tilemap.\r\n * \r\n * @name Phaser.Tilemaps.MapData#widthInPixels\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.widthInPixels = GetFastValue(config, 'widthInPixels', this.width * this.tileWidth);\r\n\r\n /**\r\n * The height in pixels of the entire tilemap.\r\n * \r\n * @name Phaser.Tilemaps.MapData#heightInPixels\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.heightInPixels = GetFastValue(config, 'heightInPixels', this.height * this.tileHeight);\r\n\r\n /**\r\n * [description]\r\n * \r\n * @name Phaser.Tilemaps.MapData#format\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.format = GetFastValue(config, 'format', null);\r\n\r\n /**\r\n * The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'.\r\n * \r\n * @name Phaser.Tilemaps.MapData#orientation\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.orientation = GetFastValue(config, 'orientation', 'orthogonal');\r\n\r\n /**\r\n * Determines the draw order of tilemap. Default is right-down\r\n * \r\n * 0, or 'right-down'\r\n * 1, or 'left-down'\r\n * 2, or 'right-up'\r\n * 3, or 'left-up'\r\n * \r\n * @name Phaser.Tilemaps.MapData#renderOrder\r\n * @type {string}\r\n * @since 3.12.0\r\n */\r\n this.renderOrder = GetFastValue(config, 'renderOrder', 'right-down');\r\n\r\n /**\r\n * The version of the map data (as specified in Tiled).\r\n * \r\n * @name Phaser.Tilemaps.MapData#version\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.version = GetFastValue(config, 'version', '1');\r\n\r\n /**\r\n * Map specific properties (can be specified in Tiled)\r\n * \r\n * @name Phaser.Tilemaps.MapData#properties\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.properties = GetFastValue(config, 'properties', {});\r\n\r\n /**\r\n * An array with all the layers configured to the MapData.\r\n * \r\n * @name Phaser.Tilemaps.MapData#layers\r\n * @type {(Phaser.Tilemaps.LayerData[]|Phaser.Tilemaps.ObjectLayer)}\r\n * @since 3.0.0\r\n */\r\n this.layers = GetFastValue(config, 'layers', []);\r\n\r\n /**\r\n * An array of Tiled Image Layers.\r\n * \r\n * @name Phaser.Tilemaps.MapData#images\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.images = GetFastValue(config, 'images', []);\r\n\r\n /**\r\n * An object of Tiled Object Layers.\r\n * \r\n * @name Phaser.Tilemaps.MapData#objects\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.objects = GetFastValue(config, 'objects', {});\r\n\r\n /**\r\n * An object of collision data. Must be created as physics object or will return undefined.\r\n * \r\n * @name Phaser.Tilemaps.MapData#collision\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.collision = GetFastValue(config, 'collision', {});\r\n\r\n /**\r\n * An array of Tilesets.\r\n * \r\n * @name Phaser.Tilemaps.MapData#tilesets\r\n * @type {Phaser.Tilemaps.Tileset[]}\r\n * @since 3.0.0\r\n */\r\n this.tilesets = GetFastValue(config, 'tilesets', []);\r\n\r\n /**\r\n * The collection of images the map uses(specified in Tiled)\r\n * \r\n * @name Phaser.Tilemaps.MapData#imageCollections\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.imageCollections = GetFastValue(config, 'imageCollections', []);\r\n\r\n /**\r\n * [description]\r\n * \r\n * @name Phaser.Tilemaps.MapData#tiles\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.tiles = GetFastValue(config, 'tiles', []);\r\n }\r\n\r\n});\r\n\r\nmodule.exports = MapData;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/mapdata/MapData.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/mapdata/ObjectLayer.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/mapdata/ObjectLayer.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A class for representing a Tiled object layer in a map. This mirrors the structure of a Tiled\r\n * object layer, except:\r\n * - \"x\" & \"y\" properties are ignored since these cannot be changed in Tiled.\r\n * - \"offsetx\" & \"offsety\" are applied to the individual object coordinates directly, so they\r\n * are ignored as well.\r\n * - \"draworder\" is ignored.\r\n *\r\n * @class ObjectLayer\r\n * @memberof Phaser.Tilemaps\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Tilemaps.ObjectLayerConfig} [config] - The data for the layer from the Tiled JSON object.\r\n */\r\nvar ObjectLayer = new Class({\r\n\r\n initialize:\r\n\r\n function ObjectLayer (config)\r\n {\r\n if (config === undefined) { config = {}; }\r\n\r\n /**\r\n * The name of the Object Layer.\r\n *\r\n * @name Phaser.Tilemaps.ObjectLayer#name\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.name = GetFastValue(config, 'name', 'object layer');\r\n\r\n /**\r\n * The opacity of the layer, between 0 and 1.\r\n *\r\n * @name Phaser.Tilemaps.ObjectLayer#opacity\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.opacity = GetFastValue(config, 'opacity', 1);\r\n\r\n /**\r\n * The custom properties defined on the Object Layer, keyed by their name.\r\n *\r\n * @name Phaser.Tilemaps.ObjectLayer#properties\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.properties = GetFastValue(config, 'properties', {});\r\n\r\n /**\r\n * The type of each custom property defined on the Object Layer, keyed by its name.\r\n *\r\n * @name Phaser.Tilemaps.ObjectLayer#propertyTypes\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.propertyTypes = GetFastValue(config, 'propertytypes', {});\r\n\r\n /**\r\n * The type of the layer, which should be `objectgroup`.\r\n *\r\n * @name Phaser.Tilemaps.ObjectLayer#type\r\n * @type {string}\r\n * @since 3.0.0\r\n */\r\n this.type = GetFastValue(config, 'type', 'objectgroup');\r\n\r\n /**\r\n * Whether the layer is shown (`true`) or hidden (`false`).\r\n *\r\n * @name Phaser.Tilemaps.ObjectLayer#visible\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.visible = GetFastValue(config, 'visible', true);\r\n\r\n /**\r\n * An array of all objects on this Object Layer.\r\n *\r\n * Each Tiled object corresponds to a JavaScript object in this array. It has an `id` (unique),\r\n * `name` (as assigned in Tiled), `type` (as assigned in Tiled), `rotation` (in clockwise degrees),\r\n * `properties` (if any), `visible` state (`true` if visible, `false` otherwise),\r\n * `x` and `y` coordinates (in pixels, relative to the tilemap), and a `width` and `height` (in pixels).\r\n *\r\n * An object tile has a `gid` property (GID of the represented tile), a `flippedHorizontal` property,\r\n * a `flippedVertical` property, and `flippedAntiDiagonal` property.\r\n * The {@link http://docs.mapeditor.org/en/latest/reference/tmx-map-format/|Tiled documentation} contains\r\n * information on flipping and rotation.\r\n *\r\n * Polylines have a `polyline` property, which is an array of objects corresponding to points,\r\n * where each point has an `x` property and a `y` property. Polygons have an identically structured\r\n * array in their `polygon` property. Text objects have a `text` property with the text's properties.\r\n *\r\n * Rectangles and ellipses have a `rectangle` or `ellipse` property set to `true`.\r\n *\r\n * @name Phaser.Tilemaps.ObjectLayer#objects\r\n * @type {Phaser.Types.Tilemaps.TiledObject[]}\r\n * @since 3.0.0\r\n */\r\n this.objects = GetFastValue(config, 'objects', []);\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ObjectLayer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/mapdata/ObjectLayer.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/Parse.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/Parse.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Formats = __webpack_require__(/*! ../Formats */ \"./node_modules/phaser/src/tilemaps/Formats.js\");\r\nvar Parse2DArray = __webpack_require__(/*! ./Parse2DArray */ \"./node_modules/phaser/src/tilemaps/parsers/Parse2DArray.js\");\r\nvar ParseCSV = __webpack_require__(/*! ./ParseCSV */ \"./node_modules/phaser/src/tilemaps/parsers/ParseCSV.js\");\r\nvar ParseJSONTiled = __webpack_require__(/*! ./tiled/ParseJSONTiled */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseJSONTiled.js\");\r\nvar ParseWeltmeister = __webpack_require__(/*! ./impact/ParseWeltmeister */ \"./node_modules/phaser/src/tilemaps/parsers/impact/ParseWeltmeister.js\");\r\n\r\n/**\r\n * Parses raw data of a given Tilemap format into a new MapData object. If no recognized data format\r\n * is found, returns `null`. When loading from CSV or a 2D array, you should specify the tileWidth &\r\n * tileHeight. When parsing from a map from Tiled, the tileWidth & tileHeight will be pulled from\r\n * the map data.\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Parse\r\n * @since 3.0.0\r\n *\r\n * @param {string} name - The name of the tilemap, used to set the name on the MapData.\r\n * @param {integer} mapFormat - See ../Formats.js.\r\n * @param {(integer[][]|string|object)} data - 2D array, CSV string or Tiled JSON object.\r\n * @param {integer} tileWidth - The width of a tile in pixels. Required for 2D array and CSV, but\r\n * ignored for Tiled JSON.\r\n * @param {integer} tileHeight - The height of a tile in pixels. Required for 2D array and CSV, but\r\n * ignored for Tiled JSON.\r\n * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map\r\n * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty\r\n * location will get a Tile object with an index of -1. If you've a large sparsely populated map and\r\n * the tile data doesn't need to change then setting this value to `true` will help with memory\r\n * consumption. However if your map is small or you need to update the tiles dynamically, then leave\r\n * the default value set.\r\n *\r\n * @return {Phaser.Tilemaps.MapData} The created `MapData` object.\r\n */\r\nvar Parse = function (name, mapFormat, data, tileWidth, tileHeight, insertNull)\r\n{\r\n var newMap;\r\n\r\n switch (mapFormat)\r\n {\r\n case (Formats.ARRAY_2D):\r\n newMap = Parse2DArray(name, data, tileWidth, tileHeight, insertNull);\r\n break;\r\n case (Formats.CSV):\r\n newMap = ParseCSV(name, data, tileWidth, tileHeight, insertNull);\r\n break;\r\n case (Formats.TILED_JSON):\r\n newMap = ParseJSONTiled(name, data, insertNull);\r\n break;\r\n case (Formats.WELTMEISTER):\r\n newMap = ParseWeltmeister(name, data, insertNull);\r\n break;\r\n default:\r\n console.warn('Unrecognized tilemap data format: ' + mapFormat);\r\n newMap = null;\r\n }\r\n\r\n return newMap;\r\n};\r\n\r\nmodule.exports = Parse;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/Parse.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/Parse2DArray.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/Parse2DArray.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Formats = __webpack_require__(/*! ../Formats */ \"./node_modules/phaser/src/tilemaps/Formats.js\");\r\nvar LayerData = __webpack_require__(/*! ../mapdata/LayerData */ \"./node_modules/phaser/src/tilemaps/mapdata/LayerData.js\");\r\nvar MapData = __webpack_require__(/*! ../mapdata/MapData */ \"./node_modules/phaser/src/tilemaps/mapdata/MapData.js\");\r\nvar Tile = __webpack_require__(/*! ../Tile */ \"./node_modules/phaser/src/tilemaps/Tile.js\");\r\n\r\n/**\r\n * Parses a 2D array of tile indexes into a new MapData object with a single layer.\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Parse2DArray\r\n * @since 3.0.0\r\n *\r\n * @param {string} name - The name of the tilemap, used to set the name on the MapData.\r\n * @param {integer[][]} data - 2D array, CSV string or Tiled JSON object.\r\n * @param {integer} tileWidth - The width of a tile in pixels.\r\n * @param {integer} tileHeight - The height of a tile in pixels.\r\n * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map\r\n * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty\r\n * location will get a Tile object with an index of -1. If you've a large sparsely populated map and\r\n * the tile data doesn't need to change then setting this value to `true` will help with memory\r\n * consumption. However if your map is small or you need to update the tiles dynamically, then leave\r\n * the default value set.\r\n *\r\n * @return {Phaser.Tilemaps.MapData} [description]\r\n */\r\nvar Parse2DArray = function (name, data, tileWidth, tileHeight, insertNull)\r\n{\r\n var layerData = new LayerData({\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight\r\n });\r\n\r\n var mapData = new MapData({\r\n name: name,\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight,\r\n format: Formats.ARRAY_2D,\r\n layers: [ layerData ]\r\n });\r\n\r\n var tiles = [];\r\n var height = data.length;\r\n var width = 0;\r\n\r\n for (var y = 0; y < data.length; y++)\r\n {\r\n tiles[y] = [];\r\n var row = data[y];\r\n\r\n for (var x = 0; x < row.length; x++)\r\n {\r\n var tileIndex = parseInt(row[x], 10);\r\n\r\n if (isNaN(tileIndex) || tileIndex === -1)\r\n {\r\n tiles[y][x] = insertNull\r\n ? null\r\n : new Tile(layerData, -1, x, y, tileWidth, tileHeight);\r\n }\r\n else\r\n {\r\n tiles[y][x] = new Tile(layerData, tileIndex, x, y, tileWidth, tileHeight);\r\n }\r\n }\r\n\r\n if (width === 0)\r\n {\r\n width = row.length;\r\n }\r\n }\r\n\r\n mapData.width = layerData.width = width;\r\n mapData.height = layerData.height = height;\r\n mapData.widthInPixels = layerData.widthInPixels = width * tileWidth;\r\n mapData.heightInPixels = layerData.heightInPixels = height * tileHeight;\r\n layerData.data = tiles;\r\n\r\n return mapData;\r\n};\r\n\r\nmodule.exports = Parse2DArray;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/Parse2DArray.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/ParseCSV.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/ParseCSV.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Formats = __webpack_require__(/*! ../Formats */ \"./node_modules/phaser/src/tilemaps/Formats.js\");\r\nvar Parse2DArray = __webpack_require__(/*! ./Parse2DArray */ \"./node_modules/phaser/src/tilemaps/parsers/Parse2DArray.js\");\r\n\r\n/**\r\n * Parses a CSV string of tile indexes into a new MapData object with a single layer.\r\n *\r\n * @function Phaser.Tilemaps.Parsers.ParseCSV\r\n * @since 3.0.0\r\n *\r\n * @param {string} name - The name of the tilemap, used to set the name on the MapData.\r\n * @param {string} data - CSV string of tile indexes.\r\n * @param {integer} tileWidth - The width of a tile in pixels.\r\n * @param {integer} tileHeight - The height of a tile in pixels.\r\n * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map\r\n * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty\r\n * location will get a Tile object with an index of -1. If you've a large sparsely populated map and\r\n * the tile data doesn't need to change then setting this value to `true` will help with memory\r\n * consumption. However if your map is small or you need to update the tiles dynamically, then leave\r\n * the default value set.\r\n *\r\n * @return {Phaser.Tilemaps.MapData} The resulting MapData object.\r\n */\r\nvar ParseCSV = function (name, data, tileWidth, tileHeight, insertNull)\r\n{\r\n var array2D = data\r\n .trim()\r\n .split('\\n')\r\n .map(function (row) { return row.split(','); });\r\n\r\n var map = Parse2DArray(name, array2D, tileWidth, tileHeight, insertNull);\r\n map.format = Formats.CSV;\r\n\r\n return map;\r\n};\r\n\r\nmodule.exports = ParseCSV;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/ParseCSV.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/impact/ParseTileLayers.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/impact/ParseTileLayers.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar LayerData = __webpack_require__(/*! ../../mapdata/LayerData */ \"./node_modules/phaser/src/tilemaps/mapdata/LayerData.js\");\r\nvar Tile = __webpack_require__(/*! ../../Tile */ \"./node_modules/phaser/src/tilemaps/Tile.js\");\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Impact.ParseTileLayers\r\n * @since 3.0.0\r\n *\r\n * @param {object} json - [description]\r\n * @param {boolean} insertNull - [description]\r\n *\r\n * @return {array} [description]\r\n */\r\nvar ParseTileLayers = function (json, insertNull)\r\n{\r\n var tileLayers = [];\r\n\r\n for (var i = 0; i < json.layer.length; i++)\r\n {\r\n var layer = json.layer[i];\r\n\r\n var layerData = new LayerData({\r\n name: layer.name,\r\n width: layer.width,\r\n height: layer.height,\r\n tileWidth: layer.tilesize,\r\n tileHeight: layer.tilesize,\r\n visible: layer.visible === 1\r\n });\r\n\r\n var row = [];\r\n var tileGrid = [];\r\n\r\n // Loop through the data field in the JSON. This is a 2D array containing the tile indexes,\r\n // one after the other. The indexes are relative to the tileset that contains the tile.\r\n for (var y = 0; y < layer.data.length; y++)\r\n {\r\n for (var x = 0; x < layer.data[y].length; x++)\r\n {\r\n // In Weltmeister, 0 = no tile, but the Tilemap API expects -1 = no tile.\r\n var index = layer.data[y][x] - 1;\r\n\r\n var tile;\r\n\r\n if (index > -1)\r\n {\r\n tile = new Tile(layerData, index, x, y, layer.tilesize, layer.tilesize);\r\n }\r\n else\r\n {\r\n tile = insertNull\r\n ? null\r\n : new Tile(layerData, -1, x, y, layer.tilesize, layer.tilesize);\r\n }\r\n\r\n row.push(tile);\r\n }\r\n\r\n tileGrid.push(row);\r\n row = [];\r\n }\r\n\r\n layerData.data = tileGrid;\r\n\r\n tileLayers.push(layerData);\r\n }\r\n\r\n return tileLayers;\r\n};\r\n\r\nmodule.exports = ParseTileLayers;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/impact/ParseTileLayers.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/impact/ParseTilesets.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/impact/ParseTilesets.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Tileset = __webpack_require__(/*! ../../Tileset */ \"./node_modules/phaser/src/tilemaps/Tileset.js\");\r\n\r\n/**\r\n * [description]\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Impact.ParseTilesets\r\n * @since 3.0.0\r\n *\r\n * @param {object} json - [description]\r\n *\r\n * @return {array} [description]\r\n */\r\nvar ParseTilesets = function (json)\r\n{\r\n var tilesets = [];\r\n var tilesetsNames = [];\r\n\r\n for (var i = 0; i < json.layer.length; i++)\r\n {\r\n var layer = json.layer[i];\r\n\r\n // A relative filepath to the source image (within Weltmeister) is used for the name\r\n var tilesetName = layer.tilesetName;\r\n\r\n // Only add unique tilesets that have a valid name. Collision layers will have a blank name.\r\n if (tilesetName !== '' && tilesetsNames.indexOf(tilesetName) === -1)\r\n {\r\n tilesetsNames.push(tilesetName);\r\n\r\n // Tiles are stored with an ID relative to the tileset, rather than a globally unique ID\r\n // across all tilesets. Also, tilesets in Weltmeister have no margin or padding.\r\n tilesets.push(new Tileset(tilesetName, 0, layer.tilesize, layer.tilesize, 0, 0));\r\n }\r\n }\r\n\r\n return tilesets;\r\n};\r\n\r\nmodule.exports = ParseTilesets;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/impact/ParseTilesets.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/impact/ParseWeltmeister.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/impact/ParseWeltmeister.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Formats = __webpack_require__(/*! ../../Formats */ \"./node_modules/phaser/src/tilemaps/Formats.js\");\r\nvar MapData = __webpack_require__(/*! ../../mapdata/MapData */ \"./node_modules/phaser/src/tilemaps/mapdata/MapData.js\");\r\nvar ParseTileLayers = __webpack_require__(/*! ./ParseTileLayers */ \"./node_modules/phaser/src/tilemaps/parsers/impact/ParseTileLayers.js\");\r\nvar ParseTilesets = __webpack_require__(/*! ./ParseTilesets */ \"./node_modules/phaser/src/tilemaps/parsers/impact/ParseTilesets.js\");\r\n\r\n/**\r\n * Parses a Weltmeister JSON object into a new MapData object.\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Impact.ParseWeltmeister\r\n * @since 3.0.0\r\n *\r\n * @param {string} name - The name of the tilemap, used to set the name on the MapData.\r\n * @param {object} json - The Weltmeister JSON object.\r\n * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map\r\n * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty\r\n * location will get a Tile object with an index of -1. If you've a large sparsely populated map and\r\n * the tile data doesn't need to change then setting this value to `true` will help with memory\r\n * consumption. However if your map is small or you need to update the tiles dynamically, then leave\r\n * the default value set.\r\n *\r\n * @return {?object} [description]\r\n */\r\nvar ParseWeltmeister = function (name, json, insertNull)\r\n{\r\n if (json.layer.length === 0)\r\n {\r\n console.warn('No layers found in the Weltmeister map: ' + name);\r\n return null;\r\n }\r\n\r\n var width = 0;\r\n var height = 0;\r\n\r\n for (var i = 0; i < json.layer.length; i++)\r\n {\r\n if (json.layer[i].width > width) { width = json.layer[i].width; }\r\n if (json.layer[i].height > height) { height = json.layer[i].height; }\r\n }\r\n\r\n var mapData = new MapData({\r\n width: width,\r\n height: height,\r\n name: name,\r\n tileWidth: json.layer[0].tilesize,\r\n tileHeight: json.layer[0].tilesize,\r\n format: Formats.WELTMEISTER\r\n });\r\n\r\n mapData.layers = ParseTileLayers(json, insertNull);\r\n mapData.tilesets = ParseTilesets(json);\r\n\r\n return mapData;\r\n};\r\n\r\nmodule.exports = ParseWeltmeister;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/impact/ParseWeltmeister.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/impact/index.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/impact/index.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Tilemaps.Parsers.Impact\r\n */\r\n\r\nmodule.exports = {\r\n\r\n ParseTileLayers: __webpack_require__(/*! ./ParseTileLayers */ \"./node_modules/phaser/src/tilemaps/parsers/impact/ParseTileLayers.js\"),\r\n ParseTilesets: __webpack_require__(/*! ./ParseTilesets */ \"./node_modules/phaser/src/tilemaps/parsers/impact/ParseTilesets.js\"),\r\n ParseWeltmeister: __webpack_require__(/*! ./ParseWeltmeister */ \"./node_modules/phaser/src/tilemaps/parsers/impact/ParseWeltmeister.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/impact/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/index.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/index.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Tilemaps.Parsers\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Parse: __webpack_require__(/*! ./Parse */ \"./node_modules/phaser/src/tilemaps/parsers/Parse.js\"),\r\n Parse2DArray: __webpack_require__(/*! ./Parse2DArray */ \"./node_modules/phaser/src/tilemaps/parsers/Parse2DArray.js\"),\r\n ParseCSV: __webpack_require__(/*! ./ParseCSV */ \"./node_modules/phaser/src/tilemaps/parsers/ParseCSV.js\"),\r\n\r\n Impact: __webpack_require__(/*! ./impact/ */ \"./node_modules/phaser/src/tilemaps/parsers/impact/index.js\"),\r\n Tiled: __webpack_require__(/*! ./tiled/ */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/index.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/tiled/AssignTileProperties.js": /*!********************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/tiled/AssignTileProperties.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Extend = __webpack_require__(/*! ../../../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\n\r\n/**\r\n * Copy properties from tileset to tiles.\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Tiled.AssignTileProperties\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tilemaps.MapData} mapData - [description]\r\n */\r\nvar AssignTileProperties = function (mapData)\r\n{\r\n var layerData;\r\n var tile;\r\n var sid;\r\n var set;\r\n var row;\r\n\r\n // go through each of the map data layers\r\n for (var i = 0; i < mapData.layers.length; i++)\r\n {\r\n layerData = mapData.layers[i];\r\n\r\n set = null;\r\n\r\n // rows of tiles\r\n for (var j = 0; j < layerData.data.length; j++)\r\n {\r\n row = layerData.data[j];\r\n\r\n // individual tiles\r\n for (var k = 0; k < row.length; k++)\r\n {\r\n tile = row[k];\r\n\r\n if (tile === null || tile.index < 0)\r\n {\r\n continue;\r\n }\r\n\r\n // find the relevant tileset\r\n sid = mapData.tiles[tile.index][2];\r\n set = mapData.tilesets[sid];\r\n\r\n // Ensure that a tile's size matches its tileset\r\n tile.width = set.tileWidth;\r\n tile.height = set.tileHeight;\r\n\r\n // if that tile type has any properties, add them to the tile object\r\n if (set.tileProperties && set.tileProperties[tile.index - set.firstgid])\r\n {\r\n tile.properties = Extend(\r\n tile.properties, set.tileProperties[tile.index - set.firstgid]\r\n );\r\n }\r\n }\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = AssignTileProperties;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/tiled/AssignTileProperties.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/tiled/Base64Decode.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/tiled/Base64Decode.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Decode base-64 encoded data, for example as exported by Tiled.\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Tiled.Base64Decode\r\n * @since 3.0.0\r\n *\r\n * @param {object} data - Base-64 encoded data to decode.\r\n *\r\n * @return {array} Array containing the decoded bytes.\r\n */\r\nvar Base64Decode = function (data)\r\n{\r\n var binaryString = window.atob(data);\r\n var len = binaryString.length;\r\n var bytes = new Array(len / 4);\r\n\r\n // Interpret binaryString as an array of bytes representing little-endian encoded uint32 values.\r\n for (var i = 0; i < len; i += 4)\r\n {\r\n bytes[i / 4] = (\r\n binaryString.charCodeAt(i) |\r\n binaryString.charCodeAt(i + 1) << 8 |\r\n binaryString.charCodeAt(i + 2) << 16 |\r\n binaryString.charCodeAt(i + 3) << 24\r\n ) >>> 0;\r\n }\r\n\r\n return bytes;\r\n};\r\n\r\nmodule.exports = Base64Decode;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/tiled/Base64Decode.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/tiled/BuildTilesetIndex.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/tiled/BuildTilesetIndex.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Master list of tiles -> x, y, index in tileset.\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Tiled.BuildTilesetIndex\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tilemaps.MapData} mapData - [description]\r\n *\r\n * @return {array} [description]\r\n */\r\nvar BuildTilesetIndex = function (mapData)\r\n{\r\n var tiles = [];\r\n\r\n for (var i = 0; i < mapData.tilesets.length; i++)\r\n {\r\n var set = mapData.tilesets[i];\r\n\r\n var x = set.tileMargin;\r\n var y = set.tileMargin;\r\n\r\n var count = 0;\r\n var countX = 0;\r\n var countY = 0;\r\n\r\n for (var t = set.firstgid; t < set.firstgid + set.total; t++)\r\n {\r\n // Can add extra properties here as needed\r\n tiles[t] = [ x, y, i ];\r\n\r\n x += set.tileWidth + set.tileSpacing;\r\n\r\n count++;\r\n\r\n if (count === set.total)\r\n {\r\n break;\r\n }\r\n\r\n countX++;\r\n\r\n if (countX === set.columns)\r\n {\r\n x = set.tileMargin;\r\n y += set.tileHeight + set.tileSpacing;\r\n\r\n countX = 0;\r\n countY++;\r\n\r\n if (countY === set.rows)\r\n {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return tiles;\r\n};\r\n\r\nmodule.exports = BuildTilesetIndex;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/tiled/BuildTilesetIndex.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/tiled/CreateGroupLayer.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/tiled/CreateGroupLayer.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Seth Berrier \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetFastValue = __webpack_require__(/*! ../../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\n\r\n/**\r\n * Parse a Tiled group layer and create a state object for inheriting.\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Tiled.CreateGroupLayer\r\n * @since 3.21.0\r\n *\r\n * @param {object} json - The Tiled JSON object.\r\n * @param {object} [currentl] - The current group layer from the Tiled JSON file.\r\n * @param {object} [parentstate] - The state of the parent group (if any).\r\n *\r\n * @return {object} A group state object with proper values for updating children layers.\r\n */\r\nvar CreateGroupLayer = function (json, groupl, parentstate)\r\n{\r\n if (!groupl)\r\n {\r\n // Return a default group state object\r\n return {\r\n i: 0, // Current layer array iterator\r\n layers: json.layers, // Current array of layers\r\n\r\n // Values inherited from parent group\r\n name: '',\r\n opacity: 1,\r\n visible: true,\r\n x: 0,\r\n y: 0\r\n };\r\n }\r\n\r\n // Compute group layer x, y\r\n var layerX = groupl.x + GetFastValue(groupl, 'startx', 0) * json.tilewidth + GetFastValue(groupl, 'offsetx', 0);\r\n var layerY = groupl.y + GetFastValue(groupl, 'starty', 0) * json.tileheight + GetFastValue(groupl, 'offsety', 0);\r\n\r\n // Compute next state inherited from group\r\n return {\r\n i: 0,\r\n layers: groupl.layers,\r\n name: parentstate.name + groupl.name + '/',\r\n opacity: parentstate.opacity * groupl.opacity,\r\n visible: parentstate.visible && groupl.visible,\r\n x: parentstate.x + layerX,\r\n y: parentstate.y + layerY\r\n };\r\n};\r\n\r\nmodule.exports = CreateGroupLayer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/tiled/CreateGroupLayer.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/tiled/ParseGID.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/tiled/ParseGID.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FLIPPED_HORIZONTAL = 0x80000000;\r\nvar FLIPPED_VERTICAL = 0x40000000;\r\nvar FLIPPED_ANTI_DIAGONAL = 0x20000000; // Top-right is swapped with bottom-left corners\r\n\r\n/**\r\n * See Tiled documentation on tile flipping:\r\n * http://docs.mapeditor.org/en/latest/reference/tmx-map-format/\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Tiled.ParseGID\r\n * @since 3.0.0\r\n *\r\n * @param {number} gid - [description]\r\n *\r\n * @return {object} [description]\r\n */\r\nvar ParseGID = function (gid)\r\n{\r\n var flippedHorizontal = Boolean(gid & FLIPPED_HORIZONTAL);\r\n var flippedVertical = Boolean(gid & FLIPPED_VERTICAL);\r\n var flippedAntiDiagonal = Boolean(gid & FLIPPED_ANTI_DIAGONAL);\r\n gid = gid & ~(FLIPPED_HORIZONTAL | FLIPPED_VERTICAL | FLIPPED_ANTI_DIAGONAL);\r\n\r\n // Parse the flip flags into something Phaser can use\r\n var rotation = 0;\r\n var flipped = false;\r\n\r\n if (flippedHorizontal && flippedVertical && flippedAntiDiagonal)\r\n {\r\n rotation = Math.PI / 2;\r\n flipped = true;\r\n }\r\n else if (flippedHorizontal && flippedVertical && !flippedAntiDiagonal)\r\n {\r\n rotation = Math.PI;\r\n flipped = false;\r\n }\r\n else if (flippedHorizontal && !flippedVertical && flippedAntiDiagonal)\r\n {\r\n rotation = Math.PI / 2;\r\n flipped = false;\r\n }\r\n else if (flippedHorizontal && !flippedVertical && !flippedAntiDiagonal)\r\n {\r\n rotation = 0;\r\n flipped = true;\r\n }\r\n else if (!flippedHorizontal && flippedVertical && flippedAntiDiagonal)\r\n {\r\n rotation = 3 * Math.PI / 2;\r\n flipped = false;\r\n }\r\n else if (!flippedHorizontal && flippedVertical && !flippedAntiDiagonal)\r\n {\r\n rotation = Math.PI;\r\n flipped = true;\r\n }\r\n else if (!flippedHorizontal && !flippedVertical && flippedAntiDiagonal)\r\n {\r\n rotation = 3 * Math.PI / 2;\r\n flipped = true;\r\n }\r\n else if (!flippedHorizontal && !flippedVertical && !flippedAntiDiagonal)\r\n {\r\n rotation = 0;\r\n flipped = false;\r\n }\r\n\r\n return {\r\n gid: gid,\r\n flippedHorizontal: flippedHorizontal,\r\n flippedVertical: flippedVertical,\r\n flippedAntiDiagonal: flippedAntiDiagonal,\r\n rotation: rotation,\r\n flipped: flipped\r\n };\r\n};\r\n\r\nmodule.exports = ParseGID;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/tiled/ParseGID.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/tiled/ParseImageLayers.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/tiled/ParseImageLayers.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetFastValue = __webpack_require__(/*! ../../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar CreateGroupLayer = __webpack_require__(/*! ./CreateGroupLayer */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/CreateGroupLayer.js\");\r\n\r\n/**\r\n * Parses a Tiled JSON object into an array of objects with details about the image layers.\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Tiled.ParseImageLayers\r\n * @since 3.0.0\r\n *\r\n * @param {object} json - The Tiled JSON object.\r\n *\r\n * @return {array} Array of objects that include critical info about the map's image layers\r\n */\r\nvar ParseImageLayers = function (json)\r\n{\r\n var images = [];\r\n\r\n // State inherited from a parent group\r\n var groupStack = [];\r\n var curGroupState = CreateGroupLayer(json);\r\n\r\n while (curGroupState.i < curGroupState.layers.length || groupStack.length > 0)\r\n {\r\n if (curGroupState.i >= curGroupState.layers.length)\r\n {\r\n // Ensure recursion stack is not empty first\r\n if (groupStack.length < 1)\r\n {\r\n console.warn(\r\n 'TilemapParser.parseTiledJSON - Invalid layer group hierarchy'\r\n );\r\n break;\r\n }\r\n\r\n // Return to previous recursive state\r\n curGroupState = groupStack.pop();\r\n continue;\r\n }\r\n\r\n // Get current layer and advance iterator\r\n var curi = curGroupState.layers[curGroupState.i];\r\n curGroupState.i++;\r\n\r\n if (curi.type !== 'imagelayer')\r\n {\r\n if (curi.type === 'group')\r\n {\r\n // Compute next state inherited from group\r\n var nextGroupState = CreateGroupLayer(json, curi, curGroupState);\r\n\r\n // Preserve current state before recursing\r\n groupStack.push(curGroupState);\r\n curGroupState = nextGroupState;\r\n }\r\n\r\n // Skip this layer OR 'recurse' (iterative style) into the group\r\n continue;\r\n }\r\n\r\n var layerOffsetX = GetFastValue(curi, 'offsetx', 0) + GetFastValue(curi, 'startx', 0);\r\n var layerOffsetY = GetFastValue(curi, 'offsety', 0) + GetFastValue(curi, 'starty', 0);\r\n images.push({\r\n name: (curGroupState.name + curi.name),\r\n image: curi.image,\r\n x: (curGroupState.x + layerOffsetX + curi.x),\r\n y: (curGroupState.y + layerOffsetY + curi.y),\r\n alpha: (curGroupState.opacity * curi.opacity),\r\n visible: (curGroupState.visible && curi.visible),\r\n properties: GetFastValue(curi, 'properties', {})\r\n });\r\n }\r\n\r\n return images;\r\n};\r\n\r\nmodule.exports = ParseImageLayers;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/tiled/ParseImageLayers.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/tiled/ParseJSONTiled.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/tiled/ParseJSONTiled.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Formats = __webpack_require__(/*! ../../Formats */ \"./node_modules/phaser/src/tilemaps/Formats.js\");\r\nvar MapData = __webpack_require__(/*! ../../mapdata/MapData */ \"./node_modules/phaser/src/tilemaps/mapdata/MapData.js\");\r\nvar ParseTileLayers = __webpack_require__(/*! ./ParseTileLayers */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseTileLayers.js\");\r\nvar ParseImageLayers = __webpack_require__(/*! ./ParseImageLayers */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseImageLayers.js\");\r\nvar ParseTilesets = __webpack_require__(/*! ./ParseTilesets */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseTilesets.js\");\r\nvar ParseObjectLayers = __webpack_require__(/*! ./ParseObjectLayers */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseObjectLayers.js\");\r\nvar BuildTilesetIndex = __webpack_require__(/*! ./BuildTilesetIndex */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/BuildTilesetIndex.js\");\r\nvar AssignTileProperties = __webpack_require__(/*! ./AssignTileProperties */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/AssignTileProperties.js\");\r\n\r\n/**\r\n * Parses a Tiled JSON object into a new MapData object.\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Tiled.ParseJSONTiled\r\n * @since 3.0.0\r\n *\r\n * @param {string} name - The name of the tilemap, used to set the name on the MapData.\r\n * @param {object} json - The Tiled JSON object.\r\n * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map\r\n * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty\r\n * location will get a Tile object with an index of -1. If you've a large sparsely populated map and\r\n * the tile data doesn't need to change then setting this value to `true` will help with memory\r\n * consumption. However if your map is small or you need to update the tiles dynamically, then leave\r\n * the default value set.\r\n *\r\n * @return {?Phaser.Tilemaps.MapData} The created MapData object, or `null` if the data can't be parsed.\r\n */\r\nvar ParseJSONTiled = function (name, json, insertNull)\r\n{\r\n if (json.orientation !== 'orthogonal')\r\n {\r\n console.warn('Only orthogonal map types are supported in this version of Phaser');\r\n return null;\r\n }\r\n\r\n // Map data will consist of: layers, objects, images, tilesets, sizes\r\n var mapData = new MapData({\r\n width: json.width,\r\n height: json.height,\r\n name: name,\r\n tileWidth: json.tilewidth,\r\n tileHeight: json.tileheight,\r\n orientation: json.orientation,\r\n format: Formats.TILED_JSON,\r\n version: json.version,\r\n properties: json.properties,\r\n renderOrder: json.renderorder,\r\n infinite: json.infinite\r\n });\r\n\r\n mapData.layers = ParseTileLayers(json, insertNull);\r\n mapData.images = ParseImageLayers(json);\r\n\r\n var sets = ParseTilesets(json);\r\n mapData.tilesets = sets.tilesets;\r\n mapData.imageCollections = sets.imageCollections;\r\n\r\n mapData.objects = ParseObjectLayers(json);\r\n\r\n mapData.tiles = BuildTilesetIndex(mapData);\r\n\r\n AssignTileProperties(mapData);\r\n\r\n return mapData;\r\n};\r\n\r\nmodule.exports = ParseJSONTiled;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/tiled/ParseJSONTiled.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/tiled/ParseObject.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/tiled/ParseObject.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Pick = __webpack_require__(/*! ../../../utils/object/Pick */ \"./node_modules/phaser/src/utils/object/Pick.js\");\r\nvar ParseGID = __webpack_require__(/*! ./ParseGID */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseGID.js\");\r\n\r\nvar copyPoints = function (p) { return { x: p.x, y: p.y }; };\r\n\r\nvar commonObjectProps = [ 'id', 'name', 'type', 'rotation', 'properties', 'visible', 'x', 'y', 'width', 'height' ];\r\n\r\n/**\r\n * Convert a Tiled object to an internal parsed object normalising and copying properties over, while applying optional x and y offsets. The parsed object will always have the properties `id`, `name`, `type`, `rotation`, `properties`, `visible`, `x`, `y`, `width` and `height`. Other properties will be added according to the object type (such as text, polyline, gid etc.)\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Tiled.ParseObject\r\n * @since 3.0.0\r\n *\r\n * @param {object} tiledObject - Tiled object to convert to an internal parsed object normalising and copying properties over.\r\n * @param {number} [offsetX=0] - Optional additional offset to apply to the object's x property. Defaults to 0.\r\n * @param {number} [offsetY=0] - Optional additional offset to apply to the object's y property. Defaults to 0.\r\n *\r\n * @return {object} The parsed object containing properties read from the Tiled object according to it's type with x and y values updated according to the given offsets.\r\n */\r\nvar ParseObject = function (tiledObject, offsetX, offsetY)\r\n{\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n var parsedObject = Pick(tiledObject, commonObjectProps);\r\n\r\n parsedObject.x += offsetX;\r\n parsedObject.y += offsetY;\r\n\r\n if (tiledObject.gid)\r\n {\r\n // Object tiles\r\n var gidInfo = ParseGID(tiledObject.gid);\r\n parsedObject.gid = gidInfo.gid;\r\n parsedObject.flippedHorizontal = gidInfo.flippedHorizontal;\r\n parsedObject.flippedVertical = gidInfo.flippedVertical;\r\n parsedObject.flippedAntiDiagonal = gidInfo.flippedAntiDiagonal;\r\n }\r\n else if (tiledObject.polyline)\r\n {\r\n parsedObject.polyline = tiledObject.polyline.map(copyPoints);\r\n }\r\n else if (tiledObject.polygon)\r\n {\r\n parsedObject.polygon = tiledObject.polygon.map(copyPoints);\r\n }\r\n else if (tiledObject.ellipse)\r\n {\r\n parsedObject.ellipse = tiledObject.ellipse;\r\n parsedObject.width = tiledObject.width;\r\n parsedObject.height = tiledObject.height;\r\n }\r\n else if (tiledObject.text)\r\n {\r\n parsedObject.width = tiledObject.width;\r\n parsedObject.height = tiledObject.height;\r\n parsedObject.text = tiledObject.text;\r\n }\r\n else\r\n {\r\n // Otherwise, assume it is a rectangle\r\n parsedObject.rectangle = true;\r\n parsedObject.width = tiledObject.width;\r\n parsedObject.height = tiledObject.height;\r\n }\r\n\r\n return parsedObject;\r\n};\r\n\r\nmodule.exports = ParseObject;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/tiled/ParseObject.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/tiled/ParseObjectLayers.js": /*!*****************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/tiled/ParseObjectLayers.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetFastValue = __webpack_require__(/*! ../../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar ParseObject = __webpack_require__(/*! ./ParseObject */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseObject.js\");\r\nvar ObjectLayer = __webpack_require__(/*! ../../mapdata/ObjectLayer */ \"./node_modules/phaser/src/tilemaps/mapdata/ObjectLayer.js\");\r\nvar CreateGroupLayer = __webpack_require__(/*! ./CreateGroupLayer */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/CreateGroupLayer.js\");\r\n\r\n/**\r\n * Parses a Tiled JSON object into an array of ObjectLayer objects.\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Tiled.ParseObjectLayers\r\n * @since 3.0.0\r\n *\r\n * @param {object} json - The Tiled JSON object.\r\n *\r\n * @return {array} An array of all object layers in the tilemap as `ObjectLayer`s.\r\n */\r\nvar ParseObjectLayers = function (json)\r\n{\r\n var objectLayers = [];\r\n\r\n // State inherited from a parent group\r\n var groupStack = [];\r\n var curGroupState = CreateGroupLayer(json);\r\n\r\n while (curGroupState.i < curGroupState.layers.length || groupStack.length > 0)\r\n {\r\n if (curGroupState.i >= curGroupState.layers.length)\r\n {\r\n // Ensure recursion stack is not empty first\r\n if (groupStack.length < 1)\r\n {\r\n console.warn(\r\n 'TilemapParser.parseTiledJSON - Invalid layer group hierarchy'\r\n );\r\n break;\r\n }\r\n\r\n // Return to previous recursive state\r\n curGroupState = groupStack.pop();\r\n continue;\r\n }\r\n\r\n // Get current layer and advance iterator\r\n var curo = curGroupState.layers[curGroupState.i];\r\n curGroupState.i++;\r\n\r\n // Modify inherited properties\r\n curo.opacity *= curGroupState.opacity;\r\n curo.visible = curGroupState.visible && curo.visible;\r\n\r\n if (curo.type !== 'objectgroup')\r\n {\r\n if (curo.type === 'group')\r\n {\r\n // Compute next state inherited from group\r\n var nextGroupState = CreateGroupLayer(json, curo, curGroupState);\r\n\r\n // Preserve current state before recursing\r\n groupStack.push(curGroupState);\r\n curGroupState = nextGroupState;\r\n }\r\n\r\n // Skip this layer OR 'recurse' (iterative style) into the group\r\n continue;\r\n }\r\n\r\n curo.name = curGroupState.name + curo.name;\r\n var offsetX = curGroupState.x + GetFastValue(curo, 'startx', 0) + GetFastValue(curo, 'offsetx', 0);\r\n var offsetY = curGroupState.y + GetFastValue(curo, 'starty', 0) + GetFastValue(curo, 'offsety', 0);\r\n\r\n var objects = [];\r\n for (var j = 0; j < curo.objects.length; j++)\r\n {\r\n var parsedObject = ParseObject(curo.objects[j], offsetX, offsetY);\r\n\r\n objects.push(parsedObject);\r\n }\r\n\r\n var objectLayer = new ObjectLayer(curo);\r\n objectLayer.objects = objects;\r\n\r\n objectLayers.push(objectLayer);\r\n }\r\n\r\n return objectLayers;\r\n};\r\n\r\nmodule.exports = ParseObjectLayers;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/tiled/ParseObjectLayers.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/tiled/ParseTileLayers.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/tiled/ParseTileLayers.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Base64Decode = __webpack_require__(/*! ./Base64Decode */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/Base64Decode.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../../../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\nvar LayerData = __webpack_require__(/*! ../../mapdata/LayerData */ \"./node_modules/phaser/src/tilemaps/mapdata/LayerData.js\");\r\nvar ParseGID = __webpack_require__(/*! ./ParseGID */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseGID.js\");\r\nvar Tile = __webpack_require__(/*! ../../Tile */ \"./node_modules/phaser/src/tilemaps/Tile.js\");\r\nvar CreateGroupLayer = __webpack_require__(/*! ./CreateGroupLayer */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/CreateGroupLayer.js\");\r\n\r\n/**\r\n * Parses all tilemap layers in a Tiled JSON object into new LayerData objects.\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Tiled.ParseTileLayers\r\n * @since 3.0.0\r\n *\r\n * @param {object} json - The Tiled JSON object.\r\n * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map\r\n * data are handled (see {@link Phaser.Tilemaps.Parsers.Tiled.ParseJSONTiled}).\r\n *\r\n * @return {Phaser.Tilemaps.LayerData[]} - An array of LayerData objects, one for each entry in\r\n * json.layers with the type 'tilelayer'.\r\n */\r\nvar ParseTileLayers = function (json, insertNull)\r\n{\r\n var infiniteMap = GetFastValue(json, 'infinite', false);\r\n var tileLayers = [];\r\n\r\n // State inherited from a parent group\r\n var groupStack = [];\r\n var curGroupState = CreateGroupLayer(json);\r\n\r\n while (curGroupState.i < curGroupState.layers.length || groupStack.length > 0)\r\n {\r\n if (curGroupState.i >= curGroupState.layers.length)\r\n {\r\n // Ensure recursion stack is not empty first\r\n if (groupStack.length < 1)\r\n {\r\n console.warn(\r\n 'TilemapParser.parseTiledJSON - Invalid layer group hierarchy'\r\n );\r\n break;\r\n }\r\n\r\n // Return to previous recursive state\r\n curGroupState = groupStack.pop();\r\n continue;\r\n }\r\n\r\n var curl = curGroupState.layers[curGroupState.i];\r\n curGroupState.i++;\r\n\r\n if (curl.type !== 'tilelayer')\r\n {\r\n if (curl.type === 'group')\r\n {\r\n // Compute next state inherited from group\r\n var nextGroupState = CreateGroupLayer(json, curl, curGroupState);\r\n\r\n // Preserve current state before recursing\r\n groupStack.push(curGroupState);\r\n curGroupState = nextGroupState;\r\n }\r\n\r\n // Skip this layer OR 'recurse' (iterative style) into the group\r\n continue;\r\n }\r\n\r\n // Base64 decode data if necessary. NOTE: uncompressed base64 only.\r\n if (curl.compression)\r\n {\r\n console.warn(\r\n 'TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer \\''\r\n + curl.name + '\\''\r\n );\r\n continue;\r\n }\r\n else if (curl.encoding && curl.encoding === 'base64')\r\n {\r\n // Chunks for an infinite map\r\n if (curl.chunks)\r\n {\r\n for (var i = 0; i < curl.chunks.length; i++)\r\n {\r\n curl.chunks[i].data = Base64Decode(curl.chunks[i].data);\r\n }\r\n }\r\n\r\n // Non-infinite map data\r\n if (curl.data)\r\n {\r\n curl.data = Base64Decode(curl.data);\r\n }\r\n\r\n delete curl.encoding; // Allow the same map to be parsed multiple times\r\n }\r\n\r\n // This is an array containing the tile indexes, one after the other. -1 = no tile,\r\n // everything else = the tile index (starting at 1 for Tiled, 0 for CSV) If the map\r\n // contains multiple tilesets then the indexes are relative to that which the set starts\r\n // from. Need to set which tileset in the cache = which tileset in the JSON, if you do this\r\n // manually it means you can use the same map data but a new tileset.\r\n\r\n var layerData;\r\n var gidInfo;\r\n var tile;\r\n var blankTile;\r\n\r\n var output = [];\r\n var x = 0;\r\n\r\n if (infiniteMap)\r\n {\r\n var layerOffsetX = (GetFastValue(curl, 'startx', 0) + curl.x);\r\n var layerOffsetY = (GetFastValue(curl, 'starty', 0) + curl.y);\r\n layerData = new LayerData({\r\n name: (curGroupState.name + curl.name),\r\n x: (curGroupState.x + GetFastValue(curl, 'offsetx', 0) + layerOffsetX * json.tilewidth),\r\n y: (curGroupState.y + GetFastValue(curl, 'offsety', 0) + layerOffsetY * json.tileheight),\r\n width: curl.width,\r\n height: curl.height,\r\n tileWidth: json.tilewidth,\r\n tileHeight: json.tileheight,\r\n alpha: (curGroupState.opacity * curl.opacity),\r\n visible: (curGroupState.visible && curl.visible),\r\n properties: GetFastValue(curl, 'properties', {})\r\n });\r\n\r\n for (var c = 0; c < curl.height; c++)\r\n {\r\n output.push([ null ]);\r\n\r\n for (var j = 0; j < curl.width; j++)\r\n {\r\n output[c][j] = null;\r\n }\r\n }\r\n\r\n for (c = 0, len = curl.chunks.length; c < len; c++)\r\n {\r\n var chunk = curl.chunks[c];\r\n\r\n var offsetX = (chunk.x - layerOffsetX);\r\n var offsetY = (chunk.y - layerOffsetY);\r\n\r\n var y = 0;\r\n\r\n for (var t = 0, len2 = chunk.data.length; t < len2; t++)\r\n {\r\n var newOffsetX = x + offsetX;\r\n var newOffsetY = y + offsetY;\r\n\r\n gidInfo = ParseGID(chunk.data[t]);\r\n\r\n // index, x, y, width, height\r\n if (gidInfo.gid > 0)\r\n {\r\n tile = new Tile(layerData, gidInfo.gid, newOffsetX, newOffsetY, json.tilewidth,\r\n json.tileheight);\r\n\r\n // Turning Tiled's FlippedHorizontal, FlippedVertical and FlippedAntiDiagonal\r\n // propeties into flipX, flipY and rotation\r\n tile.rotation = gidInfo.rotation;\r\n tile.flipX = gidInfo.flipped;\r\n\r\n output[newOffsetY][newOffsetX] = tile;\r\n }\r\n else\r\n {\r\n blankTile = insertNull\r\n ? null\r\n : new Tile(layerData, -1, newOffsetX, newOffsetY, json.tilewidth, json.tileheight);\r\n\r\n output[newOffsetY][newOffsetX] = blankTile;\r\n }\r\n\r\n x++;\r\n\r\n if (x === chunk.width)\r\n {\r\n y++;\r\n x = 0;\r\n }\r\n }\r\n }\r\n }\r\n else\r\n {\r\n layerData = new LayerData({\r\n name: (curGroupState.name + curl.name),\r\n x: (curGroupState.x + GetFastValue(curl, 'offsetx', 0) + curl.x),\r\n y: (curGroupState.y + GetFastValue(curl, 'offsety', 0) + curl.y),\r\n width: curl.width,\r\n height: curl.height,\r\n tileWidth: json.tilewidth,\r\n tileHeight: json.tileheight,\r\n alpha: (curGroupState.opacity * curl.opacity),\r\n visible: (curGroupState.visible && curl.visible),\r\n properties: GetFastValue(curl, 'properties', {})\r\n });\r\n\r\n var row = [];\r\n\r\n // Loop through the data field in the JSON.\r\n for (var k = 0, len = curl.data.length; k < len; k++)\r\n {\r\n gidInfo = ParseGID(curl.data[k]);\r\n\r\n // index, x, y, width, height\r\n if (gidInfo.gid > 0)\r\n {\r\n tile = new Tile(layerData, gidInfo.gid, x, output.length, json.tilewidth,\r\n json.tileheight);\r\n\r\n // Turning Tiled's FlippedHorizontal, FlippedVertical and FlippedAntiDiagonal\r\n // propeties into flipX, flipY and rotation\r\n tile.rotation = gidInfo.rotation;\r\n tile.flipX = gidInfo.flipped;\r\n\r\n row.push(tile);\r\n }\r\n else\r\n {\r\n blankTile = insertNull\r\n ? null\r\n : new Tile(layerData, -1, x, output.length, json.tilewidth, json.tileheight);\r\n row.push(blankTile);\r\n }\r\n\r\n x++;\r\n\r\n if (x === curl.width)\r\n {\r\n output.push(row);\r\n x = 0;\r\n row = [];\r\n }\r\n }\r\n }\r\n\r\n layerData.data = output;\r\n tileLayers.push(layerData);\r\n }\r\n\r\n return tileLayers;\r\n};\r\n\r\nmodule.exports = ParseTileLayers;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/tiled/ParseTileLayers.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/tiled/ParseTilesets.js": /*!*************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/tiled/ParseTilesets.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Tileset = __webpack_require__(/*! ../../Tileset */ \"./node_modules/phaser/src/tilemaps/Tileset.js\");\r\nvar ImageCollection = __webpack_require__(/*! ../../ImageCollection */ \"./node_modules/phaser/src/tilemaps/ImageCollection.js\");\r\nvar ParseObject = __webpack_require__(/*! ./ParseObject */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseObject.js\");\r\n\r\n/**\r\n * Tilesets and Image Collections\r\n *\r\n * @function Phaser.Tilemaps.Parsers.Tiled.ParseTilesets\r\n * @since 3.0.0\r\n *\r\n * @param {object} json - [description]\r\n *\r\n * @return {object} [description]\r\n */\r\nvar ParseTilesets = function (json)\r\n{\r\n var tilesets = [];\r\n var imageCollections = [];\r\n var lastSet = null;\r\n var stringID;\r\n\r\n for (var i = 0; i < json.tilesets.length; i++)\r\n {\r\n // name, firstgid, width, height, margin, spacing, properties\r\n var set = json.tilesets[i];\r\n\r\n if (set.source)\r\n {\r\n console.warn('Phaser can\\'t load external tilesets. Use the Embed Tileset button and then export the map again.');\r\n }\r\n else if (set.image)\r\n {\r\n var newSet = new Tileset(set.name, set.firstgid, set.tilewidth, set.tileheight, set.margin, set.spacing);\r\n\r\n if (json.version > 1)\r\n {\r\n // Tiled 1.2+\r\n\r\n if (Array.isArray(set.tiles))\r\n {\r\n var tiles = {};\r\n var props = {};\r\n\r\n for (var t = 0; t < set.tiles.length; t++)\r\n {\r\n var tile = set.tiles[t];\r\n\r\n // Convert tileproperties\r\n if (tile.properties)\r\n {\r\n var newPropData = {};\r\n\r\n tile.properties.forEach(function (propData)\r\n {\r\n newPropData[propData['name']] = propData['value'];\r\n });\r\n\r\n props[tile.id] = newPropData;\r\n }\r\n\r\n // Convert objectgroup\r\n if (tile.objectgroup)\r\n {\r\n tiles[tile.id] = { objectgroup: tile.objectgroup };\r\n\r\n if (tile.objectgroup.objects)\r\n {\r\n var parsedObjects2 = tile.objectgroup.objects.map(\r\n function (obj) { return ParseObject(obj); }\r\n );\r\n\r\n tiles[tile.id].objectgroup.objects = parsedObjects2;\r\n }\r\n }\r\n\r\n // Copy animation data\r\n if (tile.animation)\r\n {\r\n if (tiles.hasOwnProperty(tile.id))\r\n {\r\n tiles[tile.id].animation = tile.animation;\r\n }\r\n else\r\n {\r\n tiles[tile.id] = { animation: tile.animation };\r\n }\r\n }\r\n }\r\n\r\n newSet.tileData = tiles;\r\n newSet.tileProperties = props;\r\n }\r\n }\r\n else\r\n {\r\n // Tiled 1\r\n\r\n // Properties stored per-tile in object with string indexes starting at \"0\"\r\n if (set.tileproperties)\r\n {\r\n newSet.tileProperties = set.tileproperties;\r\n }\r\n\r\n // Object & terrain shapes stored per-tile in object with string indexes starting at \"0\"\r\n if (set.tiles)\r\n {\r\n newSet.tileData = set.tiles;\r\n\r\n // Parse the objects into Phaser format to match handling of other Tiled objects\r\n for (stringID in newSet.tileData)\r\n {\r\n var objectGroup = newSet.tileData[stringID].objectgroup;\r\n if (objectGroup && objectGroup.objects)\r\n {\r\n var parsedObjects1 = objectGroup.objects.map(\r\n function (obj) { return ParseObject(obj); }\r\n );\r\n newSet.tileData[stringID].objectgroup.objects = parsedObjects1;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // For a normal sliced tileset the row/count/size information is computed when updated.\r\n // This is done (again) after the image is set.\r\n newSet.updateTileData(set.imagewidth, set.imageheight);\r\n\r\n tilesets.push(newSet);\r\n }\r\n else\r\n {\r\n var newCollection = new ImageCollection(set.name, set.firstgid, set.tilewidth,\r\n set.tileheight, set.margin, set.spacing, set.properties);\r\n\r\n for (stringID in set.tiles)\r\n {\r\n var image = set.tiles[stringID].image;\r\n var gid = set.firstgid + parseInt(stringID, 10);\r\n newCollection.addImage(gid, image);\r\n }\r\n\r\n imageCollections.push(newCollection);\r\n }\r\n\r\n // We've got a new Tileset, so set the lastgid into the previous one\r\n if (lastSet)\r\n {\r\n lastSet.lastgid = set.firstgid - 1;\r\n }\r\n\r\n lastSet = set;\r\n }\r\n\r\n return { tilesets: tilesets, imageCollections: imageCollections };\r\n};\r\n\r\nmodule.exports = ParseTilesets;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/tiled/ParseTilesets.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/parsers/tiled/index.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/parsers/tiled/index.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Tilemaps.Parsers.Tiled\r\n */\r\n\r\nmodule.exports = {\r\n\r\n AssignTileProperties: __webpack_require__(/*! ./AssignTileProperties */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/AssignTileProperties.js\"),\r\n Base64Decode: __webpack_require__(/*! ./Base64Decode */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/Base64Decode.js\"),\r\n BuildTilesetIndex: __webpack_require__(/*! ./BuildTilesetIndex */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/BuildTilesetIndex.js\"),\r\n ParseGID: __webpack_require__(/*! ./ParseGID */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseGID.js\"),\r\n ParseImageLayers: __webpack_require__(/*! ./ParseImageLayers */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseImageLayers.js\"),\r\n ParseJSONTiled: __webpack_require__(/*! ./ParseJSONTiled */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseJSONTiled.js\"),\r\n ParseObject: __webpack_require__(/*! ./ParseObject */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseObject.js\"),\r\n ParseObjectLayers: __webpack_require__(/*! ./ParseObjectLayers */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseObjectLayers.js\"),\r\n ParseTileLayers: __webpack_require__(/*! ./ParseTileLayers */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseTileLayers.js\"),\r\n ParseTilesets: __webpack_require__(/*! ./ParseTilesets */ \"./node_modules/phaser/src/tilemaps/parsers/tiled/ParseTilesets.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/parsers/tiled/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayer.js": /*!****************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayer.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar Components = __webpack_require__(/*! ../../gameobjects/components */ \"./node_modules/phaser/src/gameobjects/components/index.js\");\r\nvar GameEvents = __webpack_require__(/*! ../../core/events */ \"./node_modules/phaser/src/core/events/index.js\");\r\nvar GameObject = __webpack_require__(/*! ../../gameobjects/GameObject */ \"./node_modules/phaser/src/gameobjects/GameObject.js\");\r\nvar StaticTilemapLayerRender = __webpack_require__(/*! ./StaticTilemapLayerRender */ \"./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayerRender.js\");\r\nvar TilemapComponents = __webpack_require__(/*! ../components */ \"./node_modules/phaser/src/tilemaps/components/index.js\");\r\nvar TransformMatrix = __webpack_require__(/*! ../../gameobjects/components/TransformMatrix */ \"./node_modules/phaser/src/gameobjects/components/TransformMatrix.js\");\r\nvar Utils = __webpack_require__(/*! ../../renderer/webgl/Utils */ \"./node_modules/phaser/src/renderer/webgl/Utils.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Static Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination\r\n * with one, or more, Tilesets.\r\n *\r\n * A Static Tilemap Layer is optimized for rendering speed over flexibility. You cannot apply per-tile\r\n * effects like tint or alpha, or change the tiles or tilesets the layer uses.\r\n * \r\n * Use a Static Tilemap Layer instead of a Dynamic Tilemap Layer when you don't need tile manipulation features.\r\n *\r\n * @class StaticTilemapLayer\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.Tilemaps\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @extends Phaser.GameObjects.Components.Alpha\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.ComputedSize\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Flip\r\n * @extends Phaser.GameObjects.Components.GetBounds\r\n * @extends Phaser.GameObjects.Components.Origin\r\n * @extends Phaser.GameObjects.Components.Pipeline\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n * @extends Phaser.GameObjects.Components.ScrollFactor\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs.\r\n * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of.\r\n * @param {integer} layerIndex - The index of the LayerData associated with this layer.\r\n * @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.\r\n * @param {number} [x=0] - The world x position where the top left of this layer will be placed.\r\n * @param {number} [y=0] - The world y position where the top left of this layer will be placed.\r\n */\r\nvar StaticTilemapLayer = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.Alpha,\r\n Components.BlendMode,\r\n Components.ComputedSize,\r\n Components.Depth,\r\n Components.Flip,\r\n Components.GetBounds,\r\n Components.Origin,\r\n Components.Pipeline,\r\n Components.Transform,\r\n Components.Visible,\r\n Components.ScrollFactor,\r\n StaticTilemapLayerRender\r\n ],\r\n\r\n initialize:\r\n\r\n function StaticTilemapLayer (scene, tilemap, layerIndex, tileset, x, y)\r\n {\r\n GameObject.call(this, scene, 'StaticTilemapLayer');\r\n\r\n /**\r\n * Used internally by physics system to perform fast type checks.\r\n *\r\n * @name Phaser.Tilemaps.StaticTilemapLayer#isTilemap\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.isTilemap = true;\r\n\r\n /**\r\n * The Tilemap that this layer is a part of.\r\n *\r\n * @name Phaser.Tilemaps.StaticTilemapLayer#tilemap\r\n * @type {Phaser.Tilemaps.Tilemap}\r\n * @since 3.0.0\r\n */\r\n this.tilemap = tilemap;\r\n\r\n /**\r\n * The index of the LayerData associated with this layer.\r\n *\r\n * @name Phaser.Tilemaps.StaticTilemapLayer#layerIndex\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.layerIndex = layerIndex;\r\n\r\n /**\r\n * The LayerData associated with this layer. LayerData can only be associated with one\r\n * tilemap layer.\r\n *\r\n * @name Phaser.Tilemaps.StaticTilemapLayer#layer\r\n * @type {Phaser.Tilemaps.LayerData}\r\n * @since 3.0.0\r\n */\r\n this.layer = tilemap.layers[layerIndex];\r\n\r\n // Link the LayerData with this static tilemap layer\r\n this.layer.tilemapLayer = this;\r\n\r\n /**\r\n * The Tileset/s associated with this layer.\r\n * \r\n * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference.\r\n *\r\n * @name Phaser.Tilemaps.StaticTilemapLayer#tileset\r\n * @type {Phaser.Tilemaps.Tileset[]}\r\n * @since 3.0.0\r\n */\r\n this.tileset = [];\r\n\r\n /**\r\n * Used internally by the Canvas renderer.\r\n * This holds the tiles that are visible within the camera in the last frame.\r\n *\r\n * @name Phaser.Tilemaps.StaticTilemapLayer#culledTiles\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.culledTiles = [];\r\n\r\n /**\r\n * Canvas only.\r\n * \r\n * You can control if the Cameras should cull tiles before rendering them or not.\r\n * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer.\r\n *\r\n * However, there are some instances when you may wish to disable this, and toggling this flag allows\r\n * you to do so. Also see `setSkipCull` for a chainable method that does the same thing.\r\n *\r\n * @name Phaser.Tilemaps.StaticTilemapLayer#skipCull\r\n * @type {boolean}\r\n * @since 3.12.0\r\n */\r\n this.skipCull = false;\r\n\r\n /**\r\n * Canvas only.\r\n * \r\n * The total number of tiles drawn by the renderer in the last frame.\r\n * \r\n * This only works when rending with Canvas.\r\n *\r\n * @name Phaser.Tilemaps.StaticTilemapLayer#tilesDrawn\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.12.0\r\n */\r\n this.tilesDrawn = 0;\r\n\r\n /**\r\n * Canvas only.\r\n * \r\n * The total number of tiles in this layer. Updated every frame.\r\n *\r\n * @name Phaser.Tilemaps.StaticTilemapLayer#tilesTotal\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.12.0\r\n */\r\n this.tilesTotal = this.layer.width * this.layer.height;\r\n\r\n /**\r\n * Canvas only.\r\n * \r\n * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size.\r\n *\r\n * See the method `setCullPadding` for more details.\r\n *\r\n * @name Phaser.Tilemaps.StaticTilemapLayer#cullPaddingX\r\n * @type {integer}\r\n * @default 1\r\n * @since 3.12.0\r\n */\r\n this.cullPaddingX = 1;\r\n\r\n /**\r\n * Canvas only.\r\n * \r\n * The amount of extra tiles to add into the cull rectangle when calculating its vertical size.\r\n *\r\n * See the method `setCullPadding` for more details.\r\n *\r\n * @name Phaser.Tilemaps.StaticTilemapLayer#cullPaddingY\r\n * @type {integer}\r\n * @default 1\r\n * @since 3.12.0\r\n */\r\n this.cullPaddingY = 1;\r\n\r\n /**\r\n * Canvas only.\r\n * \r\n * The callback that is invoked when the tiles are culled.\r\n *\r\n * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like.\r\n *\r\n * It will be sent 3 arguments:\r\n *\r\n * 1. The Phaser.Tilemaps.LayerData object for this Layer\r\n * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull.\r\n * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered.\r\n *\r\n * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system.\r\n *\r\n * @name Phaser.Tilemaps.StaticTilemapLayer#cullCallback\r\n * @type {function}\r\n * @since 3.12.0\r\n */\r\n this.cullCallback = TilemapComponents.CullTiles;\r\n\r\n /**\r\n * A reference to the renderer.\r\n * \r\n * @name Phaser.Tilemaps.StaticTilemapLayer#renderer\r\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.renderer = scene.sys.game.renderer;\r\n\r\n /**\r\n * An array of vertex buffer objects, used by the WebGL renderer.\r\n * \r\n * 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.\r\n * \r\n * @name Phaser.Tilemaps.StaticTilemapLayer#vertexBuffer\r\n * @type {WebGLBuffer[]}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.vertexBuffer = [];\r\n\r\n /**\r\n * An array of ArrayBuffer objects, used by the WebGL renderer.\r\n * \r\n * 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.\r\n * \r\n * @name Phaser.Tilemaps.StaticTilemapLayer#bufferData\r\n * @type {ArrayBuffer[]}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.bufferData = [];\r\n\r\n /**\r\n * An array of Float32 Array objects, used by the WebGL renderer.\r\n * \r\n * 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.\r\n * \r\n * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewF32\r\n * @type {Float32Array[]}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.vertexViewF32 = [];\r\n\r\n /**\r\n * An array of Uint32 Array objects, used by the WebGL renderer.\r\n * \r\n * 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.\r\n * \r\n * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewU32\r\n * @type {Uint32Array[]}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.vertexViewU32 = [];\r\n\r\n /**\r\n * An array of booleans, used by the WebGL renderer.\r\n * \r\n * 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.\r\n * \r\n * @name Phaser.Tilemaps.StaticTilemapLayer#dirty\r\n * @type {boolean[]}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.dirty = [];\r\n\r\n /**\r\n * An array of integers, used by the WebGL renderer.\r\n * \r\n * 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.\r\n * \r\n * @name Phaser.Tilemaps.StaticTilemapLayer#vertexCount\r\n * @type {integer[]}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.vertexCount = [];\r\n\r\n /**\r\n * The rendering (draw) order of the tiles in this layer.\r\n * \r\n * The default is 0 which is 'right-down', meaning it will draw the tiles starting from the top-left,\r\n * drawing to the right and then moving down to the next row.\r\n * \r\n * The draw orders are:\r\n * \r\n * 0 = right-down\r\n * 1 = left-down\r\n * 2 = right-up\r\n * 3 = left-up\r\n * \r\n * This can be changed via the `setRenderOrder` method.\r\n *\r\n * @name Phaser.Tilemaps.StaticTilemapLayer#_renderOrder\r\n * @type {integer}\r\n * @default 0\r\n * @private\r\n * @since 3.12.0\r\n */\r\n this._renderOrder = 0;\r\n\r\n /**\r\n * A temporary Transform Matrix, re-used internally during batching.\r\n *\r\n * @name Phaser.Tilemaps.StaticTilemapLayer#_tempMatrix\r\n * @private\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.14.0\r\n */\r\n this._tempMatrix = new TransformMatrix();\r\n\r\n /**\r\n * An array holding the mapping between the tile indexes and the tileset they belong to.\r\n *\r\n * @name Phaser.Tilemaps.StaticTilemapLayer#gidMap\r\n * @type {Phaser.Tilemaps.Tileset[]}\r\n * @since 3.14.0\r\n */\r\n this.gidMap = [];\r\n\r\n this.setTilesets(tileset);\r\n this.setAlpha(this.layer.alpha);\r\n this.setPosition(x, y);\r\n this.setOrigin();\r\n this.setSize(tilemap.tileWidth * this.layer.width, tilemap.tileHeight * this.layer.height);\r\n\r\n this.updateVBOData();\r\n\r\n this.initPipeline('TextureTintPipeline');\r\n\r\n scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function ()\r\n {\r\n this.updateVBOData();\r\n }, this);\r\n },\r\n\r\n /**\r\n * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#setTilesets\r\n * @private\r\n * @since 3.14.0\r\n * \r\n * @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.\r\n */\r\n setTilesets: function (tilesets)\r\n {\r\n var gidMap = [];\r\n var setList = [];\r\n var map = this.tilemap;\r\n\r\n if (!Array.isArray(tilesets))\r\n {\r\n tilesets = [ tilesets ];\r\n }\r\n\r\n for (var i = 0; i < tilesets.length; i++)\r\n {\r\n var tileset = tilesets[i];\r\n\r\n if (typeof tileset === 'string')\r\n {\r\n tileset = map.getTileset(tileset);\r\n }\r\n\r\n if (tileset)\r\n {\r\n setList.push(tileset);\r\n\r\n var s = tileset.firstgid;\r\n\r\n for (var t = 0; t < tileset.total; t++)\r\n {\r\n gidMap[s + t] = tileset;\r\n }\r\n }\r\n }\r\n\r\n this.gidMap = gidMap;\r\n this.tileset = setList;\r\n },\r\n\r\n /**\r\n * Prepares the VBO data arrays for population by the `upload` method.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#updateVBOData\r\n * @private\r\n * @since 3.14.0\r\n *\r\n * @return {this} This Tilemap Layer object.\r\n */\r\n updateVBOData: function ()\r\n {\r\n for (var i = 0; i < this.tileset.length; i++)\r\n {\r\n this.dirty[i] = true;\r\n this.vertexCount[i] = 0;\r\n this.vertexBuffer[i] = null;\r\n this.bufferData[i] = null;\r\n this.vertexViewF32[i] = null;\r\n this.vertexViewU32[i] = null;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Upload the tile data to a VBO.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#upload\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to render to.\r\n * @param {integer} tilesetIndex - The tileset index.\r\n *\r\n * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.\r\n */\r\n upload: function (camera, tilesetIndex)\r\n {\r\n var renderer = this.renderer;\r\n var gl = renderer.gl;\r\n\r\n var pipeline = renderer.pipelines.TextureTintPipeline;\r\n\r\n if (this.dirty[tilesetIndex])\r\n {\r\n var tileset = this.tileset[tilesetIndex];\r\n var mapWidth = this.layer.width;\r\n var mapHeight = this.layer.height;\r\n var width = tileset.image.source[0].width;\r\n var height = tileset.image.source[0].height;\r\n var mapData = this.layer.data;\r\n var tile;\r\n var row;\r\n var col;\r\n var renderOrder = this._renderOrder;\r\n var minTileIndex = tileset.firstgid;\r\n var maxTileIndex = tileset.firstgid + tileset.total;\r\n \r\n var vertexBuffer = this.vertexBuffer[tilesetIndex];\r\n var bufferData = this.bufferData[tilesetIndex];\r\n var vOffset = -1;\r\n var bufferSize = (mapWidth * mapHeight) * pipeline.vertexSize * 6;\r\n\r\n this.vertexCount[tilesetIndex] = 0;\r\n \r\n if (bufferData === null)\r\n {\r\n bufferData = new ArrayBuffer(bufferSize);\r\n\r\n this.bufferData[tilesetIndex] = bufferData;\r\n\r\n this.vertexViewF32[tilesetIndex] = new Float32Array(bufferData);\r\n this.vertexViewU32[tilesetIndex] = new Uint32Array(bufferData);\r\n }\r\n \r\n if (renderOrder === 0)\r\n {\r\n // right-down\r\n \r\n for (row = 0; row < mapHeight; row++)\r\n {\r\n for (col = 0; col < mapWidth; col++)\r\n {\r\n tile = mapData[row][col];\r\n \r\n if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible)\r\n {\r\n continue;\r\n }\r\n \r\n vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex);\r\n }\r\n }\r\n }\r\n else if (renderOrder === 1)\r\n {\r\n // left-down\r\n \r\n for (row = 0; row < mapHeight; row++)\r\n {\r\n for (col = mapWidth - 1; col >= 0; col--)\r\n {\r\n tile = mapData[row][col];\r\n \r\n if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible)\r\n {\r\n continue;\r\n }\r\n \r\n vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex);\r\n }\r\n }\r\n }\r\n else if (renderOrder === 2)\r\n {\r\n // right-up\r\n \r\n for (row = mapHeight - 1; row >= 0; row--)\r\n {\r\n for (col = 0; col < mapWidth; col++)\r\n {\r\n tile = mapData[row][col];\r\n \r\n if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible)\r\n {\r\n continue;\r\n }\r\n \r\n vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex);\r\n }\r\n }\r\n }\r\n else if (renderOrder === 3)\r\n {\r\n // left-up\r\n \r\n for (row = mapHeight - 1; row >= 0; row--)\r\n {\r\n for (col = mapWidth - 1; col >= 0; col--)\r\n {\r\n tile = mapData[row][col];\r\n \r\n if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible)\r\n {\r\n continue;\r\n }\r\n \r\n vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex);\r\n }\r\n }\r\n }\r\n \r\n this.dirty[tilesetIndex] = false;\r\n \r\n if (vertexBuffer === null)\r\n {\r\n vertexBuffer = renderer.createVertexBuffer(bufferData, gl.STATIC_DRAW);\r\n \r\n this.vertexBuffer[tilesetIndex] = vertexBuffer;\r\n }\r\n else\r\n {\r\n renderer.setVertexBuffer(vertexBuffer);\r\n \r\n gl.bufferSubData(gl.ARRAY_BUFFER, 0, bufferData);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a single tile into the batch.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#batchTile\r\n * @private\r\n * @since 3.12.0\r\n *\r\n * @param {integer} vOffset - The vertex offset.\r\n * @param {any} tile - The tile being rendered.\r\n * @param {any} tileset - The tileset being used for rendering.\r\n * @param {integer} width - The width of the tileset image in pixels.\r\n * @param {integer} height - The height of the tileset image in pixels.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the layer is being rendered with.\r\n * @param {integer} tilesetIndex - The tileset index.\r\n *\r\n * @return {integer} The new vOffset value.\r\n */\r\n batchTile: function (vOffset, tile, tileset, width, height, camera, tilesetIndex)\r\n {\r\n var texCoords = tileset.getTileTextureCoordinates(tile.index);\r\n\r\n if (!texCoords)\r\n {\r\n return vOffset;\r\n }\r\n\r\n var tileWidth = tileset.tileWidth;\r\n var tileHeight = tileset.tileHeight;\r\n\r\n var halfTileWidth = tileWidth / 2;\r\n var halfTileHeight = tileHeight / 2;\r\n\r\n var u0 = texCoords.x / width;\r\n var v0 = texCoords.y / height;\r\n var u1 = (texCoords.x + tileWidth) / width;\r\n var v1 = (texCoords.y + tileHeight) / height;\r\n\r\n var matrix = this._tempMatrix;\r\n\r\n var x = -halfTileWidth;\r\n var y = -halfTileHeight;\r\n\r\n if (tile.flipX)\r\n {\r\n tileWidth *= -1;\r\n x += tileset.tileWidth;\r\n }\r\n\r\n if (tile.flipY)\r\n {\r\n tileHeight *= -1;\r\n y += tileset.tileHeight;\r\n }\r\n\r\n var xw = x + tileWidth;\r\n var yh = y + tileHeight;\r\n\r\n matrix.applyITRS(halfTileWidth + tile.pixelX, halfTileHeight + tile.pixelY, tile.rotation, 1, 1);\r\n\r\n var tint = Utils.getTintAppendFloatAlpha(0xffffff, camera.alpha * this.alpha * tile.alpha);\r\n\r\n var tx0 = matrix.getX(x, y);\r\n var ty0 = matrix.getY(x, y);\r\n\r\n var tx1 = matrix.getX(x, yh);\r\n var ty1 = matrix.getY(x, yh);\r\n\r\n var tx2 = matrix.getX(xw, yh);\r\n var ty2 = matrix.getY(xw, yh);\r\n\r\n var tx3 = matrix.getX(xw, y);\r\n var ty3 = matrix.getY(xw, y);\r\n\r\n if (camera.roundPixels)\r\n {\r\n tx0 = Math.round(tx0);\r\n ty0 = Math.round(ty0);\r\n\r\n tx1 = Math.round(tx1);\r\n ty1 = Math.round(ty1);\r\n\r\n tx2 = Math.round(tx2);\r\n ty2 = Math.round(ty2);\r\n\r\n tx3 = Math.round(tx3);\r\n ty3 = Math.round(ty3);\r\n }\r\n\r\n var vertexViewF32 = this.vertexViewF32[tilesetIndex];\r\n var vertexViewU32 = this.vertexViewU32[tilesetIndex];\r\n\r\n vertexViewF32[++vOffset] = tx0;\r\n vertexViewF32[++vOffset] = ty0;\r\n vertexViewF32[++vOffset] = u0;\r\n vertexViewF32[++vOffset] = v0;\r\n vertexViewF32[++vOffset] = 0;\r\n vertexViewU32[++vOffset] = tint;\r\n\r\n vertexViewF32[++vOffset] = tx1;\r\n vertexViewF32[++vOffset] = ty1;\r\n vertexViewF32[++vOffset] = u0;\r\n vertexViewF32[++vOffset] = v1;\r\n vertexViewF32[++vOffset] = 0;\r\n vertexViewU32[++vOffset] = tint;\r\n\r\n vertexViewF32[++vOffset] = tx2;\r\n vertexViewF32[++vOffset] = ty2;\r\n vertexViewF32[++vOffset] = u1;\r\n vertexViewF32[++vOffset] = v1;\r\n vertexViewF32[++vOffset] = 0;\r\n vertexViewU32[++vOffset] = tint;\r\n\r\n vertexViewF32[++vOffset] = tx0;\r\n vertexViewF32[++vOffset] = ty0;\r\n vertexViewF32[++vOffset] = u0;\r\n vertexViewF32[++vOffset] = v0;\r\n vertexViewF32[++vOffset] = 0;\r\n vertexViewU32[++vOffset] = tint;\r\n\r\n vertexViewF32[++vOffset] = tx2;\r\n vertexViewF32[++vOffset] = ty2;\r\n vertexViewF32[++vOffset] = u1;\r\n vertexViewF32[++vOffset] = v1;\r\n vertexViewF32[++vOffset] = 0;\r\n vertexViewU32[++vOffset] = tint;\r\n\r\n vertexViewF32[++vOffset] = tx3;\r\n vertexViewF32[++vOffset] = ty3;\r\n vertexViewF32[++vOffset] = u1;\r\n vertexViewF32[++vOffset] = v0;\r\n vertexViewF32[++vOffset] = 0;\r\n vertexViewU32[++vOffset] = tint;\r\n\r\n this.vertexCount[tilesetIndex] += 6;\r\n\r\n return vOffset;\r\n },\r\n\r\n /**\r\n * Sets the rendering (draw) order of the tiles in this layer.\r\n * \r\n * The default is 'right-down', meaning it will order the tiles starting from the top-left,\r\n * drawing to the right and then moving down to the next row.\r\n * \r\n * The draw orders are:\r\n * \r\n * 0 = right-down\r\n * 1 = left-down\r\n * 2 = right-up\r\n * 3 = left-up\r\n * \r\n * Setting the render order does not change the tiles or how they are stored in the layer,\r\n * it purely impacts the order in which they are rendered.\r\n * \r\n * You can provide either an integer (0 to 3), or the string version of the order.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#setRenderOrder\r\n * @since 3.12.0\r\n *\r\n * @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'.\r\n *\r\n * @return {this} This Tilemap Layer object.\r\n */\r\n setRenderOrder: function (renderOrder)\r\n {\r\n var orders = [ 'right-down', 'left-down', 'right-up', 'left-up' ];\r\n\r\n if (typeof renderOrder === 'string')\r\n {\r\n renderOrder = orders.indexOf(renderOrder);\r\n }\r\n\r\n if (renderOrder >= 0 && renderOrder < 4)\r\n {\r\n this._renderOrder = renderOrder;\r\n\r\n for (var i = 0; i < this.tileset.length; i++)\r\n {\r\n this.dirty[i] = true;\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting\r\n * faces are used internally for optimizing collisions against tiles. This method is mostly used\r\n * internally to optimize recalculating faces when only one tile has been changed.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#calculateFacesAt\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The x coordinate.\r\n * @param {integer} tileY - The y coordinate.\r\n *\r\n * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.\r\n */\r\n calculateFacesAt: function (tileX, tileY)\r\n {\r\n TilemapComponents.CalculateFacesAt(tileX, tileY, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the\r\n * layer. Interesting faces are used internally for optimizing collisions against tiles. This method\r\n * is mostly used internally.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#calculateFacesWithin\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n *\r\n * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.\r\n */\r\n calculateFacesWithin: function (tileX, tileY, width, height)\r\n {\r\n TilemapComponents.CalculateFacesWithin(tileX, tileY, width, height, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a Sprite for every object matching the given tile indexes in the layer. You can\r\n * optionally specify if each tile will be replaced with a new tile after the Sprite has been\r\n * created. This is useful if you want to lay down special tiles in a level that are converted to\r\n * Sprites, but want to replace the tile itself with a floor tile or similar once converted.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#createFromTiles\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from.\r\n * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted\r\n * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a\r\n * one-to-one mapping with the indexes array.\r\n * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e.\r\n * scene.make.sprite).\r\n * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY\r\n *\r\n * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created.\r\n */\r\n createFromTiles: function (indexes, replacements, spriteConfig, scene, camera)\r\n {\r\n return TilemapComponents.CreateFromTiles(indexes, replacements, spriteConfig, scene, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Returns the tiles in the given layer that are within the cameras viewport.\r\n * This is used internally.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#cull\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against.\r\n *\r\n * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.\r\n */\r\n cull: function (camera)\r\n {\r\n return this.cullCallback(this.layer, camera, this.culledTiles);\r\n },\r\n\r\n /**\r\n * Canvas only.\r\n * \r\n * You can control if the Cameras should cull tiles before rendering them or not.\r\n * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer.\r\n *\r\n * However, there are some instances when you may wish to disable this.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#setSkipCull\r\n * @since 3.12.0\r\n *\r\n * @param {boolean} [value=true] - Set to `true` to stop culling tiles. Set to `false` to enable culling again.\r\n *\r\n * @return {this} This Tilemap Layer object.\r\n */\r\n setSkipCull: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skipCull = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Canvas only.\r\n * \r\n * When a Camera culls the tiles in this layer it does so using its view into the world, building up a\r\n * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size\r\n * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so\r\n * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px\r\n * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale)\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#setCullPadding\r\n * @since 3.12.0\r\n *\r\n * @param {integer} [paddingX=1] - The amount of extra horizontal tiles to add to the cull check padding.\r\n * @param {integer} [paddingY=1] - The amount of extra vertical tiles to add to the cull check padding.\r\n *\r\n * @return {this} This Tilemap Layer object.\r\n */\r\n setCullPadding: function (paddingX, paddingY)\r\n {\r\n if (paddingX === undefined) { paddingX = 1; }\r\n if (paddingY === undefined) { paddingY = 1; }\r\n\r\n this.cullPaddingX = paddingX;\r\n this.cullPaddingY = paddingY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Searches the entire map layer for the first tile matching the given index, then returns that Tile\r\n * object. If no match is found, it returns null. The search starts from the top-left tile and\r\n * continues horizontally until it hits the end of the row, then it drops down to the next column.\r\n * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to\r\n * the top-left.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#findByIndex\r\n * @since 3.0.0\r\n *\r\n * @param {integer} index - The tile index value to search for.\r\n * @param {integer} [skip=0] - The number of times to skip a matching tile before returning.\r\n * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the\r\n * bottom-right. Otherwise it scans from the top-left.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} A Tile object.\r\n */\r\n findByIndex: function (findIndex, skip, reverse)\r\n {\r\n return TilemapComponents.FindByIndex(findIndex, skip, reverse, this.layer);\r\n },\r\n\r\n /**\r\n * Find the first tile in the given rectangular area (in tile coordinates) of the layer that\r\n * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns\r\n * true. Similar to Array.prototype.find in vanilla JS.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#findTile\r\n * @since 3.0.0\r\n *\r\n * @param {function} callback - The callback. Each tile in the given area will be passed to this\r\n * callback as the first and only parameter.\r\n * @param {object} [context] - The context under which the callback should be run.\r\n * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n *\r\n * @return {?Phaser.Tilemaps.Tile}\r\n */\r\n findTile: function (callback, context, tileX, tileY, width, height, filteringOptions)\r\n {\r\n return TilemapComponents.FindTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer);\r\n },\r\n\r\n /**\r\n * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given\r\n * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns\r\n * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#filterTiles\r\n * @since 3.0.0\r\n *\r\n * @param {function} callback - The callback. Each tile in the given area will be passed to this\r\n * callback as the first and only parameter. The callback should return true for tiles that pass the\r\n * filter.\r\n * @param {object} [context] - The context under which the callback should be run.\r\n * @param {integer} [tileX=0] - The leftmost tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n *\r\n * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.\r\n */\r\n filterTiles: function (callback, context, tileX, tileY, width, height, filteringOptions)\r\n {\r\n return TilemapComponents.FilterTiles(callback, context, tileX, tileY, width, height, filteringOptions, this.layer);\r\n },\r\n\r\n /**\r\n * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given\r\n * callback. Similar to Array.prototype.forEach in vanilla JS.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#forEachTile\r\n * @since 3.0.0\r\n *\r\n * @param {function} callback - The callback. Each tile in the given area will be passed to this\r\n * callback as the first and only parameter.\r\n * @param {object} [context] - The context under which the callback should be run.\r\n * @param {integer} [tileX=0] - The leftmost tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n *\r\n * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.\r\n */\r\n forEachTile: function (callback, context, tileX, tileY, width, height, filteringOptions)\r\n {\r\n TilemapComponents.ForEachTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets a tile at the given tile coordinates from the given layer.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#getTileAt\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels).\r\n * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels).\r\n * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile\r\n * object with an index of -1.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid.\r\n */\r\n getTileAt: function (tileX, tileY, nonNull)\r\n {\r\n return TilemapComponents.GetTileAt(tileX, tileY, nonNull, this.layer);\r\n },\r\n\r\n /**\r\n * Gets a tile at the given world coordinates from the given layer.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#getTileAtWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - X position to get the tile from (given in pixels)\r\n * @param {number} worldY - Y position to get the tile from (given in pixels)\r\n * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile\r\n * object with an index of -1.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n *\r\n * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates\r\n * were invalid.\r\n */\r\n getTileAtWorldXY: function (worldX, worldY, nonNull, camera)\r\n {\r\n return TilemapComponents.GetTileAtWorldXY(worldX, worldY, nonNull, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Gets the tiles in the given rectangular area (in tile coordinates) of the layer.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithin\r\n * @since 3.0.0\r\n *\r\n * @param {integer} [tileX=0] - The leftmost tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n *\r\n * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.\r\n */\r\n getTilesWithin: function (tileX, tileY, width, height, filteringOptions)\r\n {\r\n return TilemapComponents.GetTilesWithin(tileX, tileY, width, height, filteringOptions, this.layer);\r\n },\r\n\r\n /**\r\n * Gets the tiles in the given rectangular area (in world coordinates) of the layer.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithinWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The leftmost tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {number} worldY - The topmost tile index (in tile coordinates) to use as the origin of the area to filter.\r\n * @param {number} width - How many tiles wide from the `tileX` index the area will be.\r\n * @param {number} height - How many tiles high from the `tileY` index the area will be.\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.\r\n *\r\n * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.\r\n */\r\n getTilesWithinWorldXY: function (worldX, worldY, width, height, filteringOptions, camera)\r\n {\r\n return TilemapComponents.GetTilesWithinWorldXY(worldX, worldY, width, height, filteringOptions, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle,\r\n * Line, Rectangle or Triangle. The shape should be in world coordinates.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithinShape\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates\r\n * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n *\r\n * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.\r\n */\r\n getTilesWithinShape: function (shape, filteringOptions, camera)\r\n {\r\n return TilemapComponents.GetTilesWithinShape(shape, filteringOptions, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns\r\n * false if there is no tile or if the tile at that location has an index of -1.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#hasTileAt\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - X position to get the tile from in tile coordinates.\r\n * @param {integer} tileY - Y position to get the tile from in tile coordinates.\r\n *\r\n * @return {boolean}\r\n */\r\n hasTileAt: function (tileX, tileY)\r\n {\r\n return TilemapComponents.HasTileAt(tileX, tileY, this.layer);\r\n },\r\n\r\n /**\r\n * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns\r\n * false if there is no tile or if the tile at that location has an index of -1.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#hasTileAtWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The X coordinate of the world position.\r\n * @param {number} worldY - The Y coordinate of the world position.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n *\r\n * @return {boolean}\r\n */\r\n hasTileAtWorldXY: function (worldX, worldY, camera)\r\n {\r\n return TilemapComponents.HasTileAtWorldXY(worldX, worldY, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to\r\n * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles\r\n * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation\r\n * wherever you want on the screen.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#renderDebug\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon.\r\n * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing.\r\n *\r\n * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.\r\n */\r\n renderDebug: function (graphics, styleConfig)\r\n {\r\n TilemapComponents.RenderDebug(graphics, styleConfig, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets collision on the given tile or tiles within a layer by index. You can pass in either a\r\n * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if\r\n * collision will be enabled (true) or disabled (false).\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#setCollision\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear\r\n * collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the\r\n * update.\r\n * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to\r\n * false if no tiles have been placed for significant performance boost.\r\n *\r\n * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.\r\n */\r\n setCollision: function (indexes, collides, recalculateFaces, updateLayer)\r\n {\r\n TilemapComponents.SetCollision(indexes, collides, recalculateFaces, this.layer, updateLayer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets collision on a range of tiles in a layer whose index is between the specified `start` and\r\n * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set\r\n * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be\r\n * enabled (true) or disabled (false).\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionBetween\r\n * @since 3.0.0\r\n *\r\n * @param {integer} start - The first index of the tile to be set for collision.\r\n * @param {integer} stop - The last index of the tile to be set for collision.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear\r\n * collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the\r\n * update.\r\n *\r\n * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.\r\n */\r\n setCollisionBetween: function (start, stop, collides, recalculateFaces)\r\n {\r\n TilemapComponents.SetCollisionBetween(start, stop, collides, recalculateFaces, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property\r\n * that matches the given properties object, its collision flag will be set. The `collides`\r\n * parameter controls if collision will be enabled (true) or disabled (false). Passing in\r\n * `{ collides: true }` would update the collision flag on any tiles with a \"collides\" property that\r\n * has a value of true. Any tile that doesn't have \"collides\" set to true will be ignored. You can\r\n * also use an array of values, e.g. `{ types: [\"stone\", \"lava\", \"sand\" ] }`. If a tile has a\r\n * \"types\" property that matches any of those values, its collision flag will be updated.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionByProperty\r\n * @since 3.0.0\r\n *\r\n * @param {object} properties - An object with tile properties and corresponding values that should\r\n * be checked.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear\r\n * collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the\r\n * update.\r\n *\r\n * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.\r\n */\r\n setCollisionByProperty: function (properties, collides, recalculateFaces)\r\n {\r\n TilemapComponents.SetCollisionByProperty(properties, collides, recalculateFaces, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets collision on all tiles in the given layer, except for tiles that have an index specified in\r\n * the given array. The `collides` parameter controls if collision will be enabled (true) or\r\n * disabled (false).\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionByExclusion\r\n * @since 3.0.0\r\n *\r\n * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision.\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear\r\n * collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the\r\n * update.\r\n *\r\n * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.\r\n */\r\n setCollisionByExclusion: function (indexes, collides, recalculateFaces)\r\n {\r\n TilemapComponents.SetCollisionByExclusion(indexes, collides, recalculateFaces, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a global collision callback for the given tile index within the layer. This will affect all\r\n * tiles on this layer that have the same index. If a callback is already set for the tile index it\r\n * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile\r\n * at a specific location on the map then see setTileLocationCallback.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#setTileIndexCallback\r\n * @since 3.0.0\r\n *\r\n * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a\r\n * collision callback set for.\r\n * @param {function} callback - The callback that will be invoked when the tile is collided with.\r\n * @param {object} callbackContext - The context under which the callback is called.\r\n *\r\n * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.\r\n */\r\n setTileIndexCallback: function (indexes, callback, callbackContext)\r\n {\r\n TilemapComponents.SetTileIndexCallback(indexes, callback, callbackContext, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets collision on the tiles within a layer by checking each tiles collision group data\r\n * (typically defined in Tiled within the tileset collision editor). If any objects are found within\r\n * a tiles collision group, the tile's colliding information will be set. The `collides` parameter\r\n * controls if collision will be enabled (true) or disabled (false).\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionFromCollisionGroup\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear\r\n * collision.\r\n * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the\r\n * update.\r\n *\r\n * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.\r\n */\r\n setCollisionFromCollisionGroup: function (collides, recalculateFaces)\r\n {\r\n TilemapComponents.SetCollisionFromCollisionGroup(collides, recalculateFaces, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer.\r\n * If a callback is already set for the tile index it will be replaced. Set the callback to null to\r\n * remove it.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#setTileLocationCallback\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The leftmost tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} tileY - The topmost tile index (in tile coordinates) to use as the origin of the area.\r\n * @param {integer} width - How many tiles wide from the `tileX` index the area will be.\r\n * @param {integer} height - How many tiles tall from the `tileY` index the area will be.\r\n * @param {function} callback - The callback that will be invoked when the tile is collided with.\r\n * @param {object} [callbackContext] - The context under which the callback is called.\r\n *\r\n * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.\r\n */\r\n setTileLocationCallback: function (tileX, tileY, width, height, callback, callbackContext)\r\n {\r\n TilemapComponents.SetTileLocationCallback(tileX, tileY, width, height, callback, callbackContext, this.layer);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the\r\n * layers position, scale and scroll.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldX\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The X coordinate, in tile coordinates.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the world values from the tile index.\r\n *\r\n * @return {number}\r\n */\r\n tileToWorldX: function (tileX, camera)\r\n {\r\n return TilemapComponents.TileToWorldX(tileX, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the\r\n * layers position, scale and scroll.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldY\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileY - The Y coordinate, in tile coordinates.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the world values from the tile index.\r\n *\r\n * @return {number}\r\n */\r\n tileToWorldY: function (tileY, camera)\r\n {\r\n return TilemapComponents.TileToWorldY(tileY, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the\r\n * layers position, scale and scroll. This will return a new Vector2 object or update the given\r\n * `point` object.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldXY\r\n * @since 3.0.0\r\n *\r\n * @param {integer} tileX - The X coordinate, in tile coordinates.\r\n * @param {integer} tileY - The Y coordinate, in tile coordinates.\r\n * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given, a new Vector2 is created.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the world values from the tile index.\r\n *\r\n * @return {Phaser.Math.Vector2}\r\n */\r\n tileToWorldXY: function (tileX, tileY, point, camera)\r\n {\r\n return TilemapComponents.TileToWorldXY(tileX, tileY, point, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the\r\n * layers position, scale and scroll.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileX\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The X coordinate, in world pixels.\r\n * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the\r\n * nearest integer.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.]\r\n *\r\n * @return {number}\r\n */\r\n worldToTileX: function (worldX, snapToFloor, camera)\r\n {\r\n return TilemapComponents.WorldToTileX(worldX, snapToFloor, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the\r\n * layers position, scale and scroll.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldY - The Y coordinate, in world pixels.\r\n * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the\r\n * nearest integer.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n *\r\n * @return {number}\r\n */\r\n worldToTileY: function (worldY, snapToFloor, camera)\r\n {\r\n return TilemapComponents.WorldToTileY(worldY, snapToFloor, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the\r\n * layers position, scale and scroll. This will return a new Vector2 object or update the given\r\n * `point` object.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} worldX - The X coordinate, in world pixels.\r\n * @param {number} worldY - The Y coordinate, in world pixels.\r\n * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the\r\n * nearest integer.\r\n * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given, a new Vector2 is created.\r\n * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.\r\n *\r\n * @return {Phaser.Math.Vector2}\r\n */\r\n worldToTileXY: function (worldX, worldY, snapToFloor, point, camera)\r\n {\r\n return TilemapComponents.WorldToTileXY(worldX, worldY, snapToFloor, point, camera, this.layer);\r\n },\r\n\r\n /**\r\n * Destroys this StaticTilemapLayer and removes its link to the associated LayerData.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#destroy\r\n * @since 3.0.0\r\n * \r\n * @param {boolean} [removeFromTilemap=true] - Remove this layer from the parent Tilemap?\r\n */\r\n destroy: function (removeFromTilemap)\r\n {\r\n if (removeFromTilemap === undefined) { removeFromTilemap = true; }\r\n\r\n if (!this.tilemap)\r\n {\r\n // Abort, we've already been destroyed\r\n return;\r\n }\r\n\r\n // Uninstall this layer only if it is still installed on the LayerData object\r\n if (this.layer.tilemapLayer === this)\r\n {\r\n this.layer.tilemapLayer = undefined;\r\n }\r\n\r\n if (removeFromTilemap)\r\n {\r\n this.tilemap.removeLayer(this);\r\n }\r\n\r\n this.tilemap = undefined;\r\n this.layer = undefined;\r\n this.culledTiles.length = 0;\r\n this.cullCallback = null;\r\n\r\n for (var i = 0; i < this.tileset.length; i++)\r\n {\r\n this.dirty[i] = true;\r\n this.vertexCount[i] = 0;\r\n this.vertexBuffer[i] = null;\r\n this.bufferData[i] = null;\r\n this.vertexViewF32[i] = null;\r\n this.vertexViewU32[i] = null;\r\n }\r\n\r\n this.gidMap = [];\r\n this.tileset = [];\r\n\r\n GameObject.prototype.destroy.call(this);\r\n }\r\n\r\n});\r\n\r\nmodule.exports = StaticTilemapLayer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayer.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayerCanvasRenderer.js": /*!******************************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayerCanvasRenderer.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#renderCanvas\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.Tilemaps.StaticTilemapLayer} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar StaticTilemapLayerCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n src.cull(camera);\r\n\r\n var renderTiles = src.culledTiles;\r\n var tileCount = renderTiles.length;\r\n\r\n if (tileCount === 0)\r\n {\r\n return;\r\n }\r\n\r\n var camMatrix = renderer._tempMatrix1;\r\n var layerMatrix = renderer._tempMatrix2;\r\n var calcMatrix = renderer._tempMatrix3;\r\n\r\n layerMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n var ctx = renderer.currentContext;\r\n var gidMap = src.gidMap;\r\n\r\n ctx.save();\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n layerMatrix.e = src.x;\r\n layerMatrix.f = src.y;\r\n\r\n camMatrix.multiply(layerMatrix, calcMatrix);\r\n\r\n calcMatrix.copyToContext(ctx);\r\n }\r\n else\r\n {\r\n // Undo the camera scroll\r\n layerMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n layerMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n layerMatrix.copyToContext(ctx);\r\n }\r\n\r\n var alpha = camera.alpha * src.alpha;\r\n\r\n if (!renderer.antialias || src.scaleX > 1 || src.scaleY > 1)\r\n {\r\n ctx.imageSmoothingEnabled = false;\r\n }\r\n\r\n for (var i = 0; i < tileCount; i++)\r\n {\r\n var tile = renderTiles[i];\r\n\r\n var tileset = gidMap[tile.index];\r\n\r\n if (!tileset)\r\n {\r\n continue;\r\n }\r\n\r\n var image = tileset.image.getSourceImage();\r\n var tileTexCoords = tileset.getTileTextureCoordinates(tile.index);\r\n\r\n if (tileTexCoords)\r\n {\r\n var tileWidth = tileset.tileWidth;\r\n var tileHeight = tileset.tileHeight;\r\n var halfWidth = tileWidth / 2;\r\n var halfHeight = tileHeight / 2;\r\n \r\n ctx.save();\r\n\r\n ctx.translate(tile.pixelX + halfWidth, tile.pixelY + halfHeight);\r\n\r\n if (tile.rotation !== 0)\r\n {\r\n ctx.rotate(tile.rotation);\r\n }\r\n \r\n if (tile.flipX || tile.flipY)\r\n {\r\n ctx.scale((tile.flipX) ? -1 : 1, (tile.flipY) ? -1 : 1);\r\n }\r\n\r\n ctx.globalAlpha = alpha * tile.alpha;\r\n \r\n ctx.drawImage(\r\n image,\r\n tileTexCoords.x, tileTexCoords.y,\r\n tileWidth, tileHeight,\r\n -halfWidth, -halfHeight,\r\n tileWidth, tileHeight\r\n );\r\n \r\n ctx.restore();\r\n }\r\n }\r\n\r\n ctx.restore();\r\n};\r\n\r\nmodule.exports = StaticTilemapLayerCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayerCanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayerRender.js": /*!**********************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayerRender.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\nvar renderCanvas = __webpack_require__(/*! ../../utils/NOOP */ \"./node_modules/phaser/src/utils/NOOP.js\");\r\n\r\nif (true)\r\n{\r\n renderWebGL = __webpack_require__(/*! ./StaticTilemapLayerWebGLRenderer */ \"./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayerWebGLRenderer.js\");\r\n}\r\n\r\nif (true)\r\n{\r\n renderCanvas = __webpack_require__(/*! ./StaticTilemapLayerCanvasRenderer */ \"./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayerCanvasRenderer.js\");\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayerRender.js?"); /***/ }), /***/ "./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayerWebGLRenderer.js": /*!*****************************************************************************************!*\ !*** ./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayerWebGLRenderer.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * \r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n * \r\n * A Static Tilemap Layer renders immediately and does not use any batching.\r\n *\r\n * @method Phaser.Tilemaps.StaticTilemapLayer#renderWebGL\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.Tilemaps.StaticTilemapLayer} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n */\r\nvar StaticTilemapLayerWebGLRenderer = function (renderer, src, interpolationPercentage, camera)\r\n{\r\n var tilesets = src.tileset;\r\n\r\n var pipeline = src.pipeline;\r\n var pipelineVertexBuffer = pipeline.vertexBuffer;\r\n\r\n renderer.setPipeline(pipeline);\r\n\r\n pipeline.modelIdentity();\r\n pipeline.modelTranslate(src.x - (camera.scrollX * src.scrollFactorX), src.y - (camera.scrollY * src.scrollFactorY), 0);\r\n pipeline.modelScale(src.scaleX, src.scaleY, 1);\r\n pipeline.viewLoad2D(camera.matrix.matrix);\r\n\r\n for (var i = 0; i < tilesets.length; i++)\r\n {\r\n src.upload(camera, i);\r\n\r\n if (src.vertexCount[i] > 0)\r\n {\r\n if (renderer.currentPipeline && renderer.currentPipeline.vertexCount > 0)\r\n {\r\n renderer.flush();\r\n }\r\n \r\n pipeline.vertexBuffer = src.vertexBuffer[i];\r\n \r\n renderer.setPipeline(pipeline);\r\n \r\n renderer.setTexture2D(tilesets[i].glTexture, 0);\r\n \r\n renderer.gl.drawArrays(pipeline.topology, 0, src.vertexCount[i]);\r\n }\r\n }\r\n\r\n // Restore the pipeline\r\n pipeline.vertexBuffer = pipelineVertexBuffer;\r\n\r\n pipeline.viewIdentity();\r\n pipeline.modelIdentity();\r\n};\r\n\r\nmodule.exports = StaticTilemapLayerWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tilemaps/staticlayer/StaticTilemapLayerWebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser/src/time/Clock.js": /*!***********************************************!*\ !*** ./node_modules/phaser/src/time/Clock.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar PluginCache = __webpack_require__(/*! ../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar SceneEvents = __webpack_require__(/*! ../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\nvar TimerEvent = __webpack_require__(/*! ./TimerEvent */ \"./node_modules/phaser/src/time/TimerEvent.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Clock is a Scene plugin which creates and updates Timer Events for its Scene.\r\n *\r\n * @class Clock\r\n * @memberof Phaser.Time\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene which owns this Clock.\r\n */\r\nvar Clock = new Class({\r\n\r\n initialize:\r\n\r\n function Clock (scene)\r\n {\r\n /**\r\n * The Scene which owns this Clock.\r\n *\r\n * @name Phaser.Time.Clock#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * The Scene Systems object of the Scene which owns this Clock.\r\n *\r\n * @name Phaser.Time.Clock#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n /**\r\n * The current time of the Clock, in milliseconds.\r\n *\r\n * If accessed externally, this is equivalent to the `time` parameter normally passed to a Scene's `update` method.\r\n *\r\n * @name Phaser.Time.Clock#now\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.now = 0;\r\n\r\n // Scale the delta time coming into the Clock by this factor\r\n // which then influences anything using this Clock for calculations, like TimerEvents\r\n\r\n /**\r\n * The scale of the Clock's time delta.\r\n * \r\n * The time delta is the time elapsed between two consecutive frames and influences the speed of time for this Clock and anything which uses it, such as its Timer Events. Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. A value of 0 freezes time and is effectively equivalent to pausing the Clock.\r\n *\r\n * @name Phaser.Time.Clock#timeScale\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.timeScale = 1;\r\n\r\n /**\r\n * Whether the Clock is paused (`true`) or active (`false`).\r\n *\r\n * When paused, the Clock will not update any of its Timer Events, thus freezing time.\r\n *\r\n * @name Phaser.Time.Clock#paused\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.paused = false;\r\n\r\n /**\r\n * An array of all Timer Events whose delays haven't expired - these are actively updating Timer Events.\r\n *\r\n * @name Phaser.Time.Clock#_active\r\n * @type {Phaser.Time.TimerEvent[]}\r\n * @private\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this._active = [];\r\n\r\n /**\r\n * An array of all Timer Events which will be added to the Clock at the start of the frame.\r\n *\r\n * @name Phaser.Time.Clock#_pendingInsertion\r\n * @type {Phaser.Time.TimerEvent[]}\r\n * @private\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this._pendingInsertion = [];\r\n\r\n /**\r\n * An array of all Timer Events which will be removed from the Clock at the start of the frame.\r\n *\r\n * @name Phaser.Time.Clock#_pendingRemoval\r\n * @type {Phaser.Time.TimerEvent[]}\r\n * @private\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this._pendingRemoval = [];\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n scene.sys.events.on(SceneEvents.START, this.start, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Time.Clock#boot\r\n * @private\r\n * @since 3.5.1\r\n */\r\n boot: function ()\r\n {\r\n // Sync with the TimeStep\r\n this.now = this.systems.game.loop.time;\r\n \r\n this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Time.Clock#start\r\n * @private\r\n * @since 3.5.0\r\n */\r\n start: function ()\r\n {\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.on(SceneEvents.PRE_UPDATE, this.preUpdate, this);\r\n eventEmitter.on(SceneEvents.UPDATE, this.update, this);\r\n eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * Creates a Timer Event and adds it to the Clock at the start of the frame.\r\n *\r\n * @method Phaser.Time.Clock#addEvent\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Time.TimerEventConfig} config - The configuration for the Timer Event.\r\n *\r\n * @return {Phaser.Time.TimerEvent} The Timer Event which was created.\r\n */\r\n addEvent: function (config)\r\n {\r\n var event = new TimerEvent(config);\r\n\r\n this._pendingInsertion.push(event);\r\n\r\n return event;\r\n },\r\n\r\n /**\r\n * Creates a Timer Event and adds it to the Clock at the start of the frame.\r\n *\r\n * This is a shortcut for {@link #addEvent} which can be shorter and is compatible with the syntax of the GreenSock Animation Platform (GSAP).\r\n *\r\n * @method Phaser.Time.Clock#delayedCall\r\n * @since 3.0.0\r\n *\r\n * @param {number} delay - The delay of the function call, in milliseconds.\r\n * @param {function} callback - The function to call after the delay expires.\r\n * @param {Array.<*>} [args] - The arguments to call the function with.\r\n * @param {*} [callbackScope] - The scope (`this` object) to call the function with.\r\n *\r\n * @return {Phaser.Time.TimerEvent} The Timer Event which was created.\r\n */\r\n delayedCall: function (delay, callback, args, callbackScope)\r\n {\r\n return this.addEvent({ delay: delay, callback: callback, args: args, callbackScope: callbackScope });\r\n },\r\n\r\n /**\r\n * Clears and recreates the array of pending Timer Events.\r\n *\r\n * @method Phaser.Time.Clock#clearPendingEvents\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Time.Clock} This Clock object.\r\n */\r\n clearPendingEvents: function ()\r\n {\r\n this._pendingInsertion = [];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Schedules all active Timer Events for removal at the start of the frame.\r\n *\r\n * @method Phaser.Time.Clock#removeAllEvents\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Time.Clock} This Clock object.\r\n */\r\n removeAllEvents: function ()\r\n {\r\n this._pendingRemoval = this._pendingRemoval.concat(this._active);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Updates the arrays of active and pending Timer Events. Called at the start of the frame.\r\n *\r\n * @method Phaser.Time.Clock#preUpdate\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\n preUpdate: function ()\r\n {\r\n var toRemove = this._pendingRemoval.length;\r\n var toInsert = this._pendingInsertion.length;\r\n\r\n if (toRemove === 0 && toInsert === 0)\r\n {\r\n // Quick bail\r\n return;\r\n }\r\n\r\n var i;\r\n var event;\r\n\r\n // Delete old events\r\n for (i = 0; i < toRemove; i++)\r\n {\r\n event = this._pendingRemoval[i];\r\n\r\n var index = this._active.indexOf(event);\r\n\r\n if (index > -1)\r\n {\r\n this._active.splice(index, 1);\r\n }\r\n\r\n // Pool them?\r\n event.destroy();\r\n }\r\n\r\n for (i = 0; i < toInsert; i++)\r\n {\r\n event = this._pendingInsertion[i];\r\n\r\n this._active.push(event);\r\n }\r\n\r\n // Clear the lists\r\n this._pendingRemoval.length = 0;\r\n this._pendingInsertion.length = 0;\r\n },\r\n\r\n /**\r\n * Updates the Clock's internal time and all of its Timer Events.\r\n *\r\n * @method Phaser.Time.Clock#update\r\n * @since 3.0.0\r\n *\r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\n update: function (time, delta)\r\n {\r\n this.now = time;\r\n\r\n if (this.paused)\r\n {\r\n return;\r\n }\r\n\r\n delta *= this.timeScale;\r\n\r\n for (var i = 0; i < this._active.length; i++)\r\n {\r\n var event = this._active[i];\r\n\r\n if (event.paused)\r\n {\r\n continue;\r\n }\r\n\r\n // Use delta time to increase elapsed.\r\n // Avoids needing to adjust for pause / resume.\r\n // Automatically smoothed by TimeStep class.\r\n // In testing accurate to +- 1ms!\r\n event.elapsed += delta * event.timeScale;\r\n\r\n if (event.elapsed >= event.delay)\r\n {\r\n var remainder = event.elapsed - event.delay;\r\n\r\n // Limit it, in case it's checked in the callback\r\n event.elapsed = event.delay;\r\n\r\n // Process the event\r\n if (!event.hasDispatched && event.callback)\r\n {\r\n event.hasDispatched = true;\r\n event.callback.apply(event.callbackScope, event.args);\r\n }\r\n\r\n if (event.repeatCount > 0)\r\n {\r\n event.repeatCount--;\r\n\r\n event.elapsed = remainder;\r\n event.hasDispatched = false;\r\n }\r\n else\r\n {\r\n this._pendingRemoval.push(event);\r\n }\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Phaser.Time.Clock#shutdown\r\n * @private\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n var i;\r\n\r\n for (i = 0; i < this._pendingInsertion.length; i++)\r\n {\r\n this._pendingInsertion[i].destroy();\r\n }\r\n\r\n for (i = 0; i < this._active.length; i++)\r\n {\r\n this._active[i].destroy();\r\n }\r\n\r\n for (i = 0; i < this._pendingRemoval.length; i++)\r\n {\r\n this._pendingRemoval[i].destroy();\r\n }\r\n\r\n this._active.length = 0;\r\n this._pendingRemoval.length = 0;\r\n this._pendingInsertion.length = 0;\r\n\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.off(SceneEvents.PRE_UPDATE, this.preUpdate, this);\r\n eventEmitter.off(SceneEvents.UPDATE, this.update, this);\r\n eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Phaser.Time.Clock#destroy\r\n * @private\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.scene.sys.events.off(SceneEvents.START, this.start, this);\r\n\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nPluginCache.register('Clock', Clock, 'time');\r\n\r\nmodule.exports = Clock;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/time/Clock.js?"); /***/ }), /***/ "./node_modules/phaser/src/time/TimerEvent.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/time/TimerEvent.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar GetFastValue = __webpack_require__(/*! ../utils/object/GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Timer Event represents a delayed function call. It's managed by a Scene's {@link Clock} and will call its function after a set amount of time has passed. The Timer Event can optionally repeat - i.e. call its function multiple times before finishing, or loop indefinitely.\r\n *\r\n * Because it's managed by a Clock, a Timer Event is based on game time, will be affected by its Clock's time scale, and will pause if its Clock pauses.\r\n *\r\n * @class TimerEvent\r\n * @memberof Phaser.Time\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Time.TimerEventConfig} config - The configuration for the Timer Event, including its delay and callback.\r\n */\r\nvar TimerEvent = new Class({\r\n\r\n initialize:\r\n\r\n function TimerEvent (config)\r\n {\r\n /**\r\n * The delay in ms at which this TimerEvent fires.\r\n *\r\n * @name Phaser.Time.TimerEvent#delay\r\n * @type {number}\r\n * @default 0\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.delay = 0;\r\n\r\n /**\r\n * The total number of times this TimerEvent will repeat before finishing.\r\n *\r\n * @name Phaser.Time.TimerEvent#repeat\r\n * @type {number}\r\n * @default 0\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.repeat = 0;\r\n\r\n /**\r\n * If repeating this contains the current repeat count.\r\n *\r\n * @name Phaser.Time.TimerEvent#repeatCount\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.repeatCount = 0;\r\n\r\n /**\r\n * True if this TimerEvent loops, otherwise false.\r\n *\r\n * @name Phaser.Time.TimerEvent#loop\r\n * @type {boolean}\r\n * @default false\r\n * @readonly\r\n * @since 3.0.0\r\n */\r\n this.loop = false;\r\n\r\n /**\r\n * The callback that will be called when the TimerEvent occurs.\r\n *\r\n * @name Phaser.Time.TimerEvent#callback\r\n * @type {function}\r\n * @since 3.0.0\r\n */\r\n this.callback;\r\n\r\n /**\r\n * The scope in which the callback will be called.\r\n *\r\n * @name Phaser.Time.TimerEvent#callbackScope\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.callbackScope;\r\n\r\n /**\r\n * Additional arguments to be passed to the callback.\r\n *\r\n * @name Phaser.Time.TimerEvent#args\r\n * @type {array}\r\n * @since 3.0.0\r\n */\r\n this.args;\r\n\r\n /**\r\n * Scale the time causing this TimerEvent to update.\r\n *\r\n * @name Phaser.Time.TimerEvent#timeScale\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.timeScale = 1;\r\n\r\n /**\r\n * Start this many MS into the elapsed (useful if you want a long duration with repeat, but for the first loop to fire quickly)\r\n *\r\n * @name Phaser.Time.TimerEvent#startAt\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.startAt = 0;\r\n\r\n /**\r\n * The time in milliseconds which has elapsed since the Timer Event's creation.\r\n *\r\n * This value is local for the Timer Event and is relative to its Clock. As such, it's influenced by the Clock's time scale and paused state, the Timer Event's initial {@link #startAt} property, and the Timer Event's {@link #timeScale} and {@link #paused} state.\r\n *\r\n * @name Phaser.Time.TimerEvent#elapsed\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.elapsed = 0;\r\n\r\n /**\r\n * Whether or not this timer is paused.\r\n *\r\n * @name Phaser.Time.TimerEvent#paused\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.paused = false;\r\n\r\n /**\r\n * Whether the Timer Event's function has been called.\r\n *\r\n * When the Timer Event fires, this property will be set to `true` before the callback function is invoked and will be reset immediately afterward if the Timer Event should repeat. The value of this property does not directly influence whether the Timer Event will be removed from its Clock, but can prevent it from firing.\r\n *\r\n * @name Phaser.Time.TimerEvent#hasDispatched\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.hasDispatched = false;\r\n\r\n this.reset(config);\r\n },\r\n\r\n /**\r\n * Completely reinitializes the Timer Event, regardless of its current state, according to a configuration object.\r\n *\r\n * @method Phaser.Time.TimerEvent#reset\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Time.TimerEventConfig} config - The new state for the Timer Event.\r\n *\r\n * @return {Phaser.Time.TimerEvent} This TimerEvent object.\r\n */\r\n reset: function (config)\r\n {\r\n this.delay = GetFastValue(config, 'delay', 0);\r\n\r\n // Can also be set to -1 for an infinite loop (same as setting loop: true)\r\n this.repeat = GetFastValue(config, 'repeat', 0);\r\n\r\n this.loop = GetFastValue(config, 'loop', false);\r\n\r\n this.callback = GetFastValue(config, 'callback', undefined);\r\n\r\n this.callbackScope = GetFastValue(config, 'callbackScope', this.callback);\r\n\r\n this.args = GetFastValue(config, 'args', []);\r\n\r\n this.timeScale = GetFastValue(config, 'timeScale', 1);\r\n\r\n this.startAt = GetFastValue(config, 'startAt', 0);\r\n\r\n this.paused = GetFastValue(config, 'paused', false);\r\n\r\n this.elapsed = this.startAt;\r\n this.hasDispatched = false;\r\n this.repeatCount = (this.repeat === -1 || this.loop) ? 999999999999 : this.repeat;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the progress of the current iteration, not factoring in repeats.\r\n *\r\n * @method Phaser.Time.TimerEvent#getProgress\r\n * @since 3.0.0\r\n *\r\n * @return {number} A number between 0 and 1 representing the current progress.\r\n */\r\n getProgress: function ()\r\n {\r\n return (this.elapsed / this.delay);\r\n },\r\n\r\n /**\r\n * Gets the progress of the timer overall, factoring in repeats.\r\n *\r\n * @method Phaser.Time.TimerEvent#getOverallProgress\r\n * @since 3.0.0\r\n *\r\n * @return {number} The overall progress of the Timer Event, between 0 and 1.\r\n */\r\n getOverallProgress: function ()\r\n {\r\n if (this.repeat > 0)\r\n {\r\n var totalDuration = this.delay + (this.delay * this.repeat);\r\n var totalElapsed = this.elapsed + (this.delay * (this.repeat - this.repeatCount));\r\n\r\n return (totalElapsed / totalDuration);\r\n }\r\n else\r\n {\r\n return this.getProgress();\r\n }\r\n },\r\n\r\n /**\r\n * Returns the number of times this Timer Event will repeat before finishing.\r\n *\r\n * This should not be confused with the number of times the Timer Event will fire before finishing. A return value of 0 doesn't indicate that the Timer Event has finished running - it indicates that it will not repeat after the next time it fires.\r\n *\r\n * @method Phaser.Time.TimerEvent#getRepeatCount\r\n * @since 3.0.0\r\n *\r\n * @return {number} How many times the Timer Event will repeat.\r\n */\r\n getRepeatCount: function ()\r\n {\r\n return this.repeatCount;\r\n },\r\n\r\n /**\r\n * Returns the local elapsed time for the current iteration of the Timer Event.\r\n *\r\n * @method Phaser.Time.TimerEvent#getElapsed\r\n * @since 3.0.0\r\n *\r\n * @return {number} The local elapsed time in milliseconds.\r\n */\r\n getElapsed: function ()\r\n {\r\n return this.elapsed;\r\n },\r\n\r\n /**\r\n * Returns the local elapsed time for the current iteration of the Timer Event in seconds.\r\n *\r\n * @method Phaser.Time.TimerEvent#getElapsedSeconds\r\n * @since 3.0.0\r\n *\r\n * @return {number} The local elapsed time in seconds.\r\n */\r\n getElapsedSeconds: function ()\r\n {\r\n return this.elapsed * 0.001;\r\n },\r\n\r\n /**\r\n * Forces the Timer Event to immediately expire, thus scheduling its removal in the next frame.\r\n *\r\n * @method Phaser.Time.TimerEvent#remove\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [dispatchCallback=false] - If `true`, the function of the Timer Event will be called before its removal.\r\n */\r\n remove: function (dispatchCallback)\r\n {\r\n if (dispatchCallback === undefined) { dispatchCallback = false; }\r\n\r\n this.elapsed = this.delay;\r\n\r\n this.hasDispatched = !dispatchCallback;\r\n\r\n this.repeatCount = 0;\r\n },\r\n\r\n /**\r\n * Destroys all object references in the Timer Event, i.e. its callback, scope, and arguments.\r\n *\r\n * Normally, this method is only called by the Clock when it shuts down. As such, it doesn't stop the Timer Event. If called manually, the Timer Event will still be updated by the Clock, but it won't do anything when it fires.\r\n *\r\n * @method Phaser.Time.TimerEvent#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.callback = undefined;\r\n this.callbackScope = undefined;\r\n this.args = [];\r\n }\r\n\r\n});\r\n\r\nmodule.exports = TimerEvent;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/time/TimerEvent.js?"); /***/ }), /***/ "./node_modules/phaser/src/time/index.js": /*!***********************************************!*\ !*** ./node_modules/phaser/src/time/index.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Time\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Clock: __webpack_require__(/*! ./Clock */ \"./node_modules/phaser/src/time/Clock.js\"),\r\n TimerEvent: __webpack_require__(/*! ./TimerEvent */ \"./node_modules/phaser/src/time/TimerEvent.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/time/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/Timeline.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/tweens/Timeline.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/tweens/events/index.js\");\r\nvar TweenBuilder = __webpack_require__(/*! ./builders/TweenBuilder */ \"./node_modules/phaser/src/tweens/builders/TweenBuilder.js\");\r\nvar TWEEN_CONST = __webpack_require__(/*! ./tween/const */ \"./node_modules/phaser/src/tweens/tween/const.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Timeline combines multiple Tweens into one. Its overall behavior is otherwise similar to a single Tween.\r\n *\r\n * The Timeline updates all of its Tweens simultaneously. Its methods allow you to easily build a sequence\r\n * of Tweens (each one starting after the previous one) or run multiple Tweens at once during given parts of the Timeline.\r\n *\r\n * @class Timeline\r\n * @memberof Phaser.Tweens\r\n * @extends Phaser.Events.EventEmitter\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tweens.TweenManager} manager - The Tween Manager which owns this Timeline.\r\n */\r\nvar Timeline = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function Timeline (manager)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * The Tween Manager which owns this Timeline.\r\n *\r\n * @name Phaser.Tweens.Timeline#manager\r\n * @type {Phaser.Tweens.TweenManager}\r\n * @since 3.0.0\r\n */\r\n this.manager = manager;\r\n\r\n /**\r\n * A constant value which allows this Timeline to be easily identified as one.\r\n *\r\n * @name Phaser.Tweens.Timeline#isTimeline\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.isTimeline = true;\r\n\r\n /**\r\n * An array of Tween objects, each containing a unique property and target being tweened.\r\n *\r\n * @name Phaser.Tweens.Timeline#data\r\n * @type {array}\r\n * @default []\r\n * @since 3.0.0\r\n */\r\n this.data = [];\r\n\r\n /**\r\n * The cached size of the data array.\r\n *\r\n * @name Phaser.Tweens.Timeline#totalData\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.totalData = 0;\r\n\r\n /**\r\n * If true then duration, delay, etc values are all frame totals, rather than ms.\r\n *\r\n * @name Phaser.Tweens.Timeline#useFrames\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.useFrames = false;\r\n\r\n /**\r\n * Scales the time applied to this Timeline. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on.\r\n * Value isn't used when calculating total duration of the Timeline, it's a run-time delta adjustment only.\r\n *\r\n * @name Phaser.Tweens.Timeline#timeScale\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.timeScale = 1;\r\n\r\n /**\r\n * Loop this Timeline? Can be -1 for an infinite loop, or an integer.\r\n * When enabled it will play through ALL Tweens again (use Tween.repeat to loop a single tween)\r\n *\r\n * @name Phaser.Tweens.Timeline#loop\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.loop = 0;\r\n\r\n /**\r\n * Time in ms/frames before this Timeline loops.\r\n *\r\n * @name Phaser.Tweens.Timeline#loopDelay\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.loopDelay = 0;\r\n\r\n /**\r\n * How many loops are left to run?\r\n *\r\n * @name Phaser.Tweens.Timeline#loopCounter\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.loopCounter = 0;\r\n\r\n /**\r\n * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = true (as it never completes)\r\n *\r\n * @name Phaser.Tweens.Timeline#completeDelay\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.completeDelay = 0;\r\n\r\n /**\r\n * Countdown timer value, as used by `loopDelay` and `completeDelay`.\r\n *\r\n * @name Phaser.Tweens.Timeline#countdown\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.countdown = 0;\r\n\r\n /**\r\n * The current state of the Timeline.\r\n *\r\n * @name Phaser.Tweens.Timeline#state\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.state = TWEEN_CONST.PENDING_ADD;\r\n\r\n /**\r\n * The state of the Timeline when it was paused (used by Resume)\r\n *\r\n * @name Phaser.Tweens.Timeline#_pausedState\r\n * @type {integer}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._pausedState = TWEEN_CONST.PENDING_ADD;\r\n\r\n /**\r\n * Does the Timeline start off paused? (if so it needs to be started with Timeline.play)\r\n *\r\n * @name Phaser.Tweens.Timeline#paused\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.paused = false;\r\n\r\n /**\r\n * Elapsed time in ms/frames of this run through of the Timeline.\r\n *\r\n * @name Phaser.Tweens.Timeline#elapsed\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.elapsed = 0;\r\n\r\n /**\r\n * Total elapsed time in ms/frames of the entire Timeline, including looping.\r\n *\r\n * @name Phaser.Tweens.Timeline#totalElapsed\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.totalElapsed = 0;\r\n\r\n /**\r\n * Time in ms/frames for the whole Timeline to play through once, excluding loop amounts and loop delays.\r\n *\r\n * @name Phaser.Tweens.Timeline#duration\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.duration = 0;\r\n\r\n /**\r\n * Value between 0 and 1. The amount of progress through the Timeline, _excluding loops_.\r\n *\r\n * @name Phaser.Tweens.Timeline#progress\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.progress = 0;\r\n\r\n /**\r\n * Time in ms/frames for all Tweens in this Timeline to complete (including looping)\r\n *\r\n * @name Phaser.Tweens.Timeline#totalDuration\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.totalDuration = 0;\r\n\r\n /**\r\n * Value between 0 and 1. The amount through the entire Timeline, including looping.\r\n *\r\n * @name Phaser.Tweens.Timeline#totalProgress\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.totalProgress = 0;\r\n\r\n /**\r\n * An object containing the different Tween callback functions.\r\n * \r\n * You can either set these in the Tween config, or by calling the `Tween.setCallback` method.\r\n * \r\n * `onComplete` When the Timeline finishes playback fully or `Timeline.stop` is called. Never invoked if timeline is set to repeat infinitely.\r\n * `onLoop` When a Timeline loops.\r\n * `onStart` When the Timeline starts playing.\r\n * `onUpdate` When a Timeline updates a child Tween.\r\n * `onYoyo` When a Timeline starts a yoyo.\r\n *\r\n * @name Phaser.Tweens.Timeline#callbacks\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.callbacks = {\r\n onComplete: null,\r\n onLoop: null,\r\n onStart: null,\r\n onUpdate: null,\r\n onYoyo: null\r\n };\r\n\r\n /**\r\n * The context in which all callbacks are invoked.\r\n *\r\n * @name Phaser.Tweens.Timeline#callbackScope\r\n * @type {any}\r\n * @since 3.0.0\r\n */\r\n this.callbackScope;\r\n },\r\n\r\n /**\r\n * Internal method that will emit a Timeline based Event and invoke the given callback.\r\n *\r\n * @method Phaser.Tweens.Timeline#dispatchTimelineEvent\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched.\r\n * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation.\r\n */\r\n dispatchTimelineEvent: function (event, callback)\r\n {\r\n this.emit(event, this);\r\n\r\n if (callback)\r\n {\r\n callback.func.apply(callback.scope, callback.params);\r\n }\r\n },\r\n\r\n /**\r\n * Sets the value of the time scale applied to this Timeline. A value of 1 runs in real-time.\r\n * A value of 0.5 runs 50% slower, and so on.\r\n * \r\n * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only.\r\n *\r\n * @method Phaser.Tweens.Timeline#setTimeScale\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The time scale value to set.\r\n *\r\n * @return {this} This Timeline object.\r\n */\r\n setTimeScale: function (value)\r\n {\r\n this.timeScale = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the value of the time scale applied to this Timeline. A value of 1 runs in real-time.\r\n * A value of 0.5 runs 50% slower, and so on.\r\n *\r\n * @method Phaser.Tweens.Timeline#getTimeScale\r\n * @since 3.0.0\r\n *\r\n * @return {number} The value of the time scale applied to this Timeline.\r\n */\r\n getTimeScale: function ()\r\n {\r\n return this.timeScale;\r\n },\r\n\r\n /**\r\n * Check whether or not the Timeline is playing.\r\n *\r\n * @method Phaser.Tweens.Timeline#isPlaying\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if this Timeline is active, otherwise `false`.\r\n */\r\n isPlaying: function ()\r\n {\r\n return (this.state === TWEEN_CONST.ACTIVE);\r\n },\r\n\r\n /**\r\n * Creates a new Tween, based on the given Tween Config, and adds it to this Timeline.\r\n *\r\n * @method Phaser.Tweens.Timeline#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Types.Tweens.TweenBuilderConfig|object)} config - The configuration object for the Tween.\r\n *\r\n * @return {this} This Timeline object.\r\n */\r\n add: function (config)\r\n {\r\n return this.queue(TweenBuilder(this, config));\r\n },\r\n\r\n /**\r\n * Adds an existing Tween to this Timeline.\r\n *\r\n * @method Phaser.Tweens.Timeline#queue\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tweens.Tween} tween - The Tween to be added to this Timeline.\r\n *\r\n * @return {this} This Timeline object.\r\n */\r\n queue: function (tween)\r\n {\r\n if (!this.isPlaying())\r\n {\r\n tween.parent = this;\r\n tween.parentIsTimeline = true;\r\n\r\n this.data.push(tween);\r\n\r\n this.totalData = this.data.length;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Checks whether a Tween has an offset value.\r\n *\r\n * @method Phaser.Tweens.Timeline#hasOffset\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tweens.Tween} tween - The Tween to check.\r\n *\r\n * @return {boolean} `true` if the tween has a non-null offset.\r\n */\r\n hasOffset: function (tween)\r\n {\r\n return (tween.offset !== null);\r\n },\r\n\r\n /**\r\n * Checks whether the offset value is a number or a directive that is relative to previous tweens.\r\n *\r\n * @method Phaser.Tweens.Timeline#isOffsetAbsolute\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The offset value to be evaluated.\r\n *\r\n * @return {boolean} `true` if the result is a number, `false` if it is a directive like \" -= 1000\".\r\n */\r\n isOffsetAbsolute: function (value)\r\n {\r\n return (typeof(value) === 'number');\r\n },\r\n\r\n /**\r\n * Checks if the offset is a relative value rather than an absolute one.\r\n * If the value is just a number, this returns false.\r\n *\r\n * @method Phaser.Tweens.Timeline#isOffsetRelative\r\n * @since 3.0.0\r\n *\r\n * @param {string} value - The offset value to be evaluated.\r\n *\r\n * @return {boolean} `true` if the value is relative, i.e \" -= 1000\". If `false`, the offset is absolute.\r\n */\r\n isOffsetRelative: function (value)\r\n {\r\n var t = typeof(value);\r\n\r\n if (t === 'string')\r\n {\r\n var op = value[0];\r\n\r\n if (op === '-' || op === '+')\r\n {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Parses the relative offset value, returning a positive or negative number.\r\n *\r\n * @method Phaser.Tweens.Timeline#getRelativeOffset\r\n * @since 3.0.0\r\n *\r\n * @param {string} value - The relative offset, in the format of '-=500', for example. The first character determines whether it will be a positive or negative number. Spacing matters here.\r\n * @param {number} base - The value to use as the offset.\r\n *\r\n * @return {number} The parsed offset value.\r\n */\r\n getRelativeOffset: function (value, base)\r\n {\r\n var op = value[0];\r\n var num = parseFloat(value.substr(2));\r\n var result = base;\r\n\r\n switch (op)\r\n {\r\n case '+':\r\n result += num;\r\n break;\r\n\r\n case '-':\r\n result -= num;\r\n break;\r\n }\r\n\r\n // Cannot ever be < 0\r\n return Math.max(0, result);\r\n },\r\n\r\n /**\r\n * Calculates the total duration of the timeline.\r\n * \r\n * Computes all tween durations and returns the full duration of the timeline.\r\n * \r\n * The resulting number is stored in the timeline, not as a return value.\r\n *\r\n * @method Phaser.Tweens.Timeline#calcDuration\r\n * @since 3.0.0\r\n */\r\n calcDuration: function ()\r\n {\r\n var prevEnd = 0;\r\n var totalDuration = 0;\r\n var offsetDuration = 0;\r\n\r\n for (var i = 0; i < this.totalData; i++)\r\n {\r\n var tween = this.data[i];\r\n\r\n tween.init();\r\n\r\n if (this.hasOffset(tween))\r\n {\r\n if (this.isOffsetAbsolute(tween.offset))\r\n {\r\n // An actual number, so it defines the start point from the beginning of the timeline\r\n tween.calculatedOffset = tween.offset;\r\n\r\n if (tween.offset === 0)\r\n {\r\n offsetDuration = 0;\r\n }\r\n }\r\n else if (this.isOffsetRelative(tween.offset))\r\n {\r\n // A relative offset (i.e. '-=1000', so starts at 'offset' ms relative to the PREVIOUS Tweens ending time)\r\n tween.calculatedOffset = this.getRelativeOffset(tween.offset, prevEnd);\r\n }\r\n }\r\n else\r\n {\r\n // Sequential\r\n tween.calculatedOffset = offsetDuration;\r\n }\r\n\r\n prevEnd = tween.totalDuration + tween.calculatedOffset;\r\n\r\n totalDuration += tween.totalDuration;\r\n offsetDuration += tween.totalDuration;\r\n }\r\n\r\n // Excludes loop values\r\n this.duration = totalDuration;\r\n\r\n this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop;\r\n\r\n if (this.loopCounter > 0)\r\n {\r\n this.totalDuration = this.duration + this.completeDelay + ((this.duration + this.loopDelay) * this.loopCounter);\r\n }\r\n else\r\n {\r\n this.totalDuration = this.duration + this.completeDelay;\r\n }\r\n },\r\n\r\n /**\r\n * Initializes the timeline, which means all Tweens get their init() called, and the total duration will be computed.\r\n * Returns a boolean indicating whether the timeline is auto-started or not.\r\n *\r\n * @method Phaser.Tweens.Timeline#init\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the Timeline is started. `false` if it is paused.\r\n */\r\n init: function ()\r\n {\r\n this.calcDuration();\r\n\r\n this.progress = 0;\r\n this.totalProgress = 0;\r\n\r\n if (this.paused)\r\n {\r\n this.state = TWEEN_CONST.PAUSED;\r\n\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n },\r\n\r\n /**\r\n * Resets all of the timeline's tweens back to their initial states.\r\n * The boolean parameter indicates whether tweens that are looping should reset as well, or not.\r\n *\r\n * @method Phaser.Tweens.Timeline#resetTweens\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} resetFromLoop - If `true`, resets all looping tweens to their initial values.\r\n */\r\n resetTweens: function (resetFromLoop)\r\n {\r\n for (var i = 0; i < this.totalData; i++)\r\n {\r\n var tween = this.data[i];\r\n\r\n tween.play(resetFromLoop);\r\n }\r\n },\r\n\r\n /**\r\n * Sets a callback for the Timeline.\r\n *\r\n * @method Phaser.Tweens.Timeline#setCallback\r\n * @since 3.0.0\r\n *\r\n * @param {string} type - The internal type of callback to set.\r\n * @param {function} callback - Timeline allows multiple tweens to be linked together to create a streaming sequence.\r\n * @param {array} [params] - The parameters to pass to the callback.\r\n * @param {object} [scope] - The context scope of the callback.\r\n *\r\n * @return {this} This Timeline object.\r\n */\r\n setCallback: function (type, callback, params, scope)\r\n {\r\n if (Timeline.TYPES.indexOf(type) !== -1)\r\n {\r\n this.callbacks[type] = { func: callback, scope: scope, params: params };\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Passed a Tween to the Tween Manager and requests it be made active.\r\n *\r\n * @method Phaser.Tweens.Timeline#makeActive\r\n * @since 3.3.0\r\n *\r\n * @param {Phaser.Tweens.Tween} tween - The tween object to make active.\r\n *\r\n * @return {Phaser.Tweens.TweenManager} The Timeline's Tween Manager reference.\r\n */\r\n makeActive: function (tween)\r\n {\r\n return this.manager.makeActive(tween);\r\n },\r\n\r\n /**\r\n * Starts playing the Timeline.\r\n *\r\n * @method Phaser.Tweens.Timeline#play\r\n * @fires Phaser.Tweens.Events#TIMELINE_START\r\n * @since 3.0.0\r\n */\r\n play: function ()\r\n {\r\n if (this.state === TWEEN_CONST.ACTIVE)\r\n {\r\n return;\r\n }\r\n\r\n if (this.paused)\r\n {\r\n this.paused = false;\r\n\r\n this.manager.makeActive(this);\r\n\r\n return;\r\n }\r\n else\r\n {\r\n this.resetTweens(false);\r\n\r\n this.state = TWEEN_CONST.ACTIVE;\r\n }\r\n\r\n this.dispatchTimelineEvent(Events.TIMELINE_START, this.callbacks.onStart);\r\n },\r\n\r\n /**\r\n * Updates the Timeline's `state` and fires callbacks and events.\r\n *\r\n * @method Phaser.Tweens.Timeline#nextState\r\n * @fires Phaser.Tweens.Events#TIMELINE_COMPLETE\r\n * @fires Phaser.Tweens.Events#TIMELINE_LOOP\r\n * @since 3.0.0\r\n *\r\n * @see Phaser.Tweens.Timeline#update\r\n */\r\n nextState: function ()\r\n {\r\n if (this.loopCounter > 0)\r\n {\r\n // Reset the elapsed time\r\n this.elapsed = 0;\r\n this.progress = 0;\r\n\r\n this.loopCounter--;\r\n\r\n this.resetTweens(true);\r\n\r\n if (this.loopDelay > 0)\r\n {\r\n this.countdown = this.loopDelay;\r\n\r\n this.state = TWEEN_CONST.LOOP_DELAY;\r\n }\r\n else\r\n {\r\n this.state = TWEEN_CONST.ACTIVE;\r\n\r\n this.dispatchTimelineEvent(Events.TIMELINE_LOOP, this.callbacks.onLoop);\r\n }\r\n }\r\n else if (this.completeDelay > 0)\r\n {\r\n this.state = TWEEN_CONST.COMPLETE_DELAY;\r\n\r\n this.countdown = this.completeDelay;\r\n }\r\n else\r\n {\r\n this.state = TWEEN_CONST.PENDING_REMOVE;\r\n\r\n this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE, this.callbacks.onComplete);\r\n }\r\n },\r\n\r\n /**\r\n * Returns 'true' if this Timeline has finished and should be removed from the Tween Manager.\r\n * Otherwise, returns false.\r\n *\r\n * @method Phaser.Tweens.Timeline#update\r\n * @fires Phaser.Tweens.Events#TIMELINE_COMPLETE\r\n * @fires Phaser.Tweens.Events#TIMELINE_UPDATE\r\n * @since 3.0.0\r\n *\r\n * @param {number} timestamp - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n *\r\n * @return {boolean} Returns `true` if this Timeline has finished and should be removed from the Tween Manager.\r\n */\r\n update: function (timestamp, delta)\r\n {\r\n if (this.state === TWEEN_CONST.PAUSED)\r\n {\r\n return;\r\n }\r\n\r\n if (this.useFrames)\r\n {\r\n delta = 1 * this.manager.timeScale;\r\n }\r\n\r\n delta *= this.timeScale;\r\n\r\n this.elapsed += delta;\r\n this.progress = Math.min(this.elapsed / this.duration, 1);\r\n\r\n this.totalElapsed += delta;\r\n this.totalProgress = Math.min(this.totalElapsed / this.totalDuration, 1);\r\n\r\n switch (this.state)\r\n {\r\n case TWEEN_CONST.ACTIVE:\r\n\r\n var stillRunning = this.totalData;\r\n\r\n for (var i = 0; i < this.totalData; i++)\r\n {\r\n var tween = this.data[i];\r\n\r\n if (tween.update(timestamp, delta))\r\n {\r\n stillRunning--;\r\n }\r\n }\r\n\r\n this.dispatchTimelineEvent(Events.TIMELINE_UPDATE, this.callbacks.onUpdate);\r\n\r\n // Anything still running? If not, we're done\r\n if (stillRunning === 0)\r\n {\r\n this.nextState();\r\n }\r\n\r\n break;\r\n\r\n case TWEEN_CONST.LOOP_DELAY:\r\n\r\n this.countdown -= delta;\r\n\r\n if (this.countdown <= 0)\r\n {\r\n this.state = TWEEN_CONST.ACTIVE;\r\n\r\n this.dispatchTimelineEvent(Events.TIMELINE_LOOP, this.callbacks.onLoop);\r\n }\r\n\r\n break;\r\n\r\n case TWEEN_CONST.COMPLETE_DELAY:\r\n\r\n this.countdown -= delta;\r\n\r\n if (this.countdown <= 0)\r\n {\r\n this.state = TWEEN_CONST.PENDING_REMOVE;\r\n\r\n this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE, this.callbacks.onComplete);\r\n }\r\n\r\n break;\r\n }\r\n\r\n return (this.state === TWEEN_CONST.PENDING_REMOVE);\r\n },\r\n\r\n /**\r\n * Stops the Timeline immediately, whatever stage of progress it is at and flags it for removal by the TweenManager.\r\n *\r\n * @method Phaser.Tweens.Timeline#stop\r\n * @since 3.0.0\r\n */\r\n stop: function ()\r\n {\r\n this.state = TWEEN_CONST.PENDING_REMOVE;\r\n },\r\n\r\n /**\r\n * Pauses the Timeline, retaining its internal state.\r\n * \r\n * Calling this on a Timeline that is already paused has no effect and fires no event.\r\n *\r\n * @method Phaser.Tweens.Timeline#pause\r\n * @fires Phaser.Tweens.Events#TIMELINE_PAUSE\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Timeline object.\r\n */\r\n pause: function ()\r\n {\r\n if (this.state === TWEEN_CONST.PAUSED)\r\n {\r\n return;\r\n }\r\n\r\n this.paused = true;\r\n\r\n this._pausedState = this.state;\r\n\r\n this.state = TWEEN_CONST.PAUSED;\r\n\r\n this.emit(Events.TIMELINE_PAUSE, this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resumes a paused Timeline from where it was when it was paused.\r\n * \r\n * Calling this on a Timeline that isn't paused has no effect and fires no event.\r\n *\r\n * @method Phaser.Tweens.Timeline#resume\r\n * @fires Phaser.Tweens.Events#TIMELINE_RESUME\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Timeline object.\r\n */\r\n resume: function ()\r\n {\r\n if (this.state === TWEEN_CONST.PAUSED)\r\n {\r\n this.paused = false;\r\n\r\n this.state = this._pausedState;\r\n\r\n this.emit(Events.TIMELINE_RESUME, this);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Checks if any of the Tweens in this Timeline as operating on the target object.\r\n * \r\n * Returns `false` if no Tweens operate on the target object.\r\n *\r\n * @method Phaser.Tweens.Timeline#hasTarget\r\n * @since 3.0.0\r\n *\r\n * @param {object} target - The target to check all Tweens against.\r\n *\r\n * @return {boolean} `true` if there is at least a single Tween that operates on the target object, otherwise `false`.\r\n */\r\n hasTarget: function (target)\r\n {\r\n for (var i = 0; i < this.data.length; i++)\r\n {\r\n if (this.data[i].hasTarget(target))\r\n {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Stops all the Tweens in the Timeline immediately, whatever stage of progress they are at and flags\r\n * them for removal by the TweenManager.\r\n *\r\n * @method Phaser.Tweens.Timeline#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n for (var i = 0; i < this.data.length; i++)\r\n {\r\n this.data[i].stop();\r\n }\r\n }\r\n\r\n});\r\n\r\nTimeline.TYPES = [ 'onStart', 'onUpdate', 'onLoop', 'onComplete', 'onYoyo' ];\r\n\r\nmodule.exports = Timeline;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/Timeline.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/TweenManager.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/tweens/TweenManager.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ArrayRemove = __webpack_require__(/*! ../utils/array/Remove */ \"./node_modules/phaser/src/utils/array/Remove.js\");\r\nvar Class = __webpack_require__(/*! ../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar NumberTweenBuilder = __webpack_require__(/*! ./builders/NumberTweenBuilder */ \"./node_modules/phaser/src/tweens/builders/NumberTweenBuilder.js\");\r\nvar PluginCache = __webpack_require__(/*! ../plugins/PluginCache */ \"./node_modules/phaser/src/plugins/PluginCache.js\");\r\nvar SceneEvents = __webpack_require__(/*! ../scene/events */ \"./node_modules/phaser/src/scene/events/index.js\");\r\nvar StaggerBuilder = __webpack_require__(/*! ./builders/StaggerBuilder */ \"./node_modules/phaser/src/tweens/builders/StaggerBuilder.js\");\r\nvar TimelineBuilder = __webpack_require__(/*! ./builders/TimelineBuilder */ \"./node_modules/phaser/src/tweens/builders/TimelineBuilder.js\");\r\nvar TWEEN_CONST = __webpack_require__(/*! ./tween/const */ \"./node_modules/phaser/src/tweens/tween/const.js\");\r\nvar TweenBuilder = __webpack_require__(/*! ./builders/TweenBuilder */ \"./node_modules/phaser/src/tweens/builders/TweenBuilder.js\");\r\n\r\n/**\r\n * @classdesc\r\n * The Tween Manager is a default Scene Plugin which controls and updates Tweens and Timelines.\r\n *\r\n * @class TweenManager\r\n * @memberof Phaser.Tweens\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene which owns this Tween Manager.\r\n */\r\nvar TweenManager = new Class({\r\n\r\n initialize:\r\n\r\n function TweenManager (scene)\r\n {\r\n /**\r\n * The Scene which owns this Tween Manager.\r\n *\r\n * @name Phaser.Tweens.TweenManager#scene\r\n * @type {Phaser.Scene}\r\n * @since 3.0.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * The Systems object of the Scene which owns this Tween Manager.\r\n *\r\n * @name Phaser.Tweens.TweenManager#systems\r\n * @type {Phaser.Scenes.Systems}\r\n * @since 3.0.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n /**\r\n * The time scale of the Tween Manager.\r\n *\r\n * This value scales the time delta between two frames, thus influencing the speed of time for all Tweens owned by this Tween Manager.\r\n *\r\n * @name Phaser.Tweens.TweenManager#timeScale\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.timeScale = 1;\r\n\r\n /**\r\n * An array of Tweens and Timelines which will be added to the Tween Manager at the start of the frame.\r\n *\r\n * @name Phaser.Tweens.TweenManager#_add\r\n * @type {array}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._add = [];\r\n\r\n /**\r\n * An array of Tweens and Timelines pending to be later added to the Tween Manager.\r\n *\r\n * @name Phaser.Tweens.TweenManager#_pending\r\n * @type {array}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._pending = [];\r\n\r\n /**\r\n * An array of Tweens and Timelines which are still incomplete and are actively processed by the Tween Manager.\r\n *\r\n * @name Phaser.Tweens.TweenManager#_active\r\n * @type {array}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._active = [];\r\n\r\n /**\r\n * An array of Tweens and Timelines which will be removed from the Tween Manager at the start of the frame.\r\n *\r\n * @name Phaser.Tweens.TweenManager#_destroy\r\n * @type {array}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._destroy = [];\r\n\r\n /**\r\n * The number of Tweens and Timelines which need to be processed by the Tween Manager at the start of the frame.\r\n *\r\n * @name Phaser.Tweens.TweenManager#_toProcess\r\n * @type {integer}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this._toProcess = 0;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n scene.sys.events.on(SceneEvents.START, this.start, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically, only once, when the Scene is first created.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Tweens.TweenManager#boot\r\n * @private\r\n * @since 3.5.1\r\n */\r\n boot: function ()\r\n {\r\n this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);\r\n },\r\n\r\n /**\r\n * This method is called automatically by the Scene when it is starting up.\r\n * It is responsible for creating local systems, properties and listening for Scene events.\r\n * Do not invoke it directly.\r\n *\r\n * @method Phaser.Tweens.TweenManager#start\r\n * @private\r\n * @since 3.5.0\r\n */\r\n start: function ()\r\n {\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.on(SceneEvents.PRE_UPDATE, this.preUpdate, this);\r\n eventEmitter.on(SceneEvents.UPDATE, this.update, this);\r\n eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n\r\n this.timeScale = 1;\r\n },\r\n\r\n /**\r\n * Create a Tween Timeline and return it, but do NOT add it to the active or pending Tween lists.\r\n *\r\n * @method Phaser.Tweens.TweenManager#createTimeline\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Tweens.TimelineBuilderConfig} [config] - The configuration object for the Timeline and its Tweens.\r\n *\r\n * @return {Phaser.Tweens.Timeline} The created Timeline object.\r\n */\r\n createTimeline: function (config)\r\n {\r\n return TimelineBuilder(this, config);\r\n },\r\n\r\n /**\r\n * Create a Tween Timeline and add it to the active Tween list/\r\n *\r\n * @method Phaser.Tweens.TweenManager#timeline\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Tweens.TimelineBuilderConfig} [config] - The configuration object for the Timeline and its Tweens.\r\n *\r\n * @return {Phaser.Tweens.Timeline} The created Timeline object.\r\n */\r\n timeline: function (config)\r\n {\r\n var timeline = TimelineBuilder(this, config);\r\n\r\n if (!timeline.paused)\r\n {\r\n this._add.push(timeline);\r\n\r\n this._toProcess++;\r\n }\r\n\r\n return timeline;\r\n },\r\n\r\n /**\r\n * Create a Tween and return it, but do NOT add it to the active or pending Tween lists.\r\n *\r\n * @method Phaser.Tweens.TweenManager#create\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The configuration object for the Tween.\r\n *\r\n * @return {Phaser.Tweens.Tween} The created Tween object.\r\n */\r\n create: function (config)\r\n {\r\n return TweenBuilder(this, config);\r\n },\r\n\r\n /**\r\n * Create a Tween and add it to the active Tween list.\r\n *\r\n * @method Phaser.Tweens.TweenManager#add\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The configuration object for the Tween.\r\n *\r\n * @return {Phaser.Tweens.Tween} The created Tween.\r\n */\r\n add: function (config)\r\n {\r\n var tween = TweenBuilder(this, config);\r\n\r\n this._add.push(tween);\r\n\r\n this._toProcess++;\r\n\r\n return tween;\r\n },\r\n\r\n /**\r\n * Add an existing tween into the active Tween list.\r\n *\r\n * @method Phaser.Tweens.TweenManager#existing\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tweens.Tween} tween - The Tween to add.\r\n *\r\n * @return {Phaser.Tweens.TweenManager} This Tween Manager object.\r\n */\r\n existing: function (tween)\r\n {\r\n this._add.push(tween);\r\n\r\n this._toProcess++;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Create a Number Tween and add it to the active Tween list.\r\n *\r\n * @method Phaser.Tweens.TweenManager#addCounter\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Tweens.NumberTweenBuilderConfig} config - The configuration object for the Number Tween.\r\n *\r\n * @return {Phaser.Tweens.Tween} The created Number Tween.\r\n */\r\n addCounter: function (config)\r\n {\r\n var tween = NumberTweenBuilder(this, config);\r\n\r\n this._add.push(tween);\r\n\r\n this._toProcess++;\r\n\r\n return tween;\r\n },\r\n\r\n /**\r\n * Creates a Stagger function to be used by a Tween property.\r\n * \r\n * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween.\r\n * \r\n * This is only worth using if the tween has multiple targets.\r\n * \r\n * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2\r\n * over the duration specified:\r\n * \r\n * ```javascript\r\n * this.tweens.add({\r\n * targets: [ ... ],\r\n * scale: 0.2,\r\n * ease: 'linear',\r\n * duration: 1000,\r\n * delay: this.tweens.stagger(100)\r\n * });\r\n * ```\r\n * \r\n * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering\r\n * from the center out, using a cubic ease.\r\n * \r\n * ```javascript\r\n * this.tweens.add({\r\n * targets: [ ... ],\r\n * scale: 0.2,\r\n * ease: 'linear',\r\n * duration: 1000,\r\n * delay: this.tweens.stagger(500, { grid: [ 10, 6 ], from: 'center', ease: 'cubic.out' })\r\n * });\r\n * ```\r\n *\r\n * @method Phaser.Tweens.TweenManager#stagger\r\n * @since 3.19.0\r\n *\r\n * @param {(number|number[])} value - The amount to stagger by, or an array containing two elements representing the min and max values to stagger between.\r\n * @param {Phaser.Types.Tweens.StaggerConfig} config - The configuration object for the Stagger function.\r\n *\r\n * @return {function} The stagger function.\r\n */\r\n stagger: function (value, options)\r\n {\r\n return StaggerBuilder(value, options);\r\n },\r\n\r\n /**\r\n * Updates the Tween Manager's internal lists at the start of the frame.\r\n *\r\n * This method will return immediately if no changes have been indicated.\r\n *\r\n * @method Phaser.Tweens.TweenManager#preUpdate\r\n * @since 3.0.0\r\n */\r\n preUpdate: function ()\r\n {\r\n if (this._toProcess === 0)\r\n {\r\n // Quick bail\r\n return;\r\n }\r\n\r\n var list = this._destroy;\r\n var active = this._active;\r\n var pending = this._pending;\r\n var i;\r\n var tween;\r\n\r\n // Clear the 'destroy' list\r\n for (i = 0; i < list.length; i++)\r\n {\r\n tween = list[i];\r\n\r\n // Remove from the 'active' array\r\n var idx = active.indexOf(tween);\r\n\r\n if (idx === -1)\r\n {\r\n // Not in the active array, is it in pending instead?\r\n idx = pending.indexOf(tween);\r\n\r\n if (idx > -1)\r\n {\r\n tween.state = TWEEN_CONST.REMOVED;\r\n pending.splice(idx, 1);\r\n }\r\n }\r\n else\r\n {\r\n tween.state = TWEEN_CONST.REMOVED;\r\n active.splice(idx, 1);\r\n }\r\n }\r\n\r\n list.length = 0;\r\n\r\n // Process the addition list\r\n // This stops callbacks and out of sync events from populating the active array mid-way during the update\r\n\r\n list = this._add;\r\n\r\n for (i = 0; i < list.length; i++)\r\n {\r\n tween = list[i];\r\n\r\n if (tween.state === TWEEN_CONST.PENDING_ADD)\r\n {\r\n // Return true if the Tween should be started right away, otherwise false\r\n if (tween.init())\r\n {\r\n tween.play();\r\n\r\n this._active.push(tween);\r\n }\r\n else\r\n {\r\n this._pending.push(tween);\r\n }\r\n }\r\n }\r\n\r\n list.length = 0;\r\n\r\n this._toProcess = 0;\r\n },\r\n\r\n /**\r\n * Updates all Tweens and Timelines of the Tween Manager.\r\n *\r\n * @method Phaser.Tweens.TweenManager#update\r\n * @since 3.0.0\r\n *\r\n * @param {number} timestamp - The current time in milliseconds.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\n update: function (timestamp, delta)\r\n {\r\n // Process active tweens\r\n var list = this._active;\r\n var tween;\r\n\r\n // Scale the delta\r\n delta *= this.timeScale;\r\n\r\n for (var i = 0; i < list.length; i++)\r\n {\r\n tween = list[i];\r\n\r\n // If Tween.update returns 'true' then it means it has completed,\r\n // so move it to the destroy list\r\n if (tween.update(timestamp, delta))\r\n {\r\n this._destroy.push(tween);\r\n this._toProcess++;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Removes the given tween from the Tween Manager, regardless of its state (pending or active).\r\n *\r\n * @method Phaser.Tweens.TweenManager#remove\r\n * @since 3.17.0\r\n *\r\n * @param {Phaser.Tweens.Tween} tween - The Tween to be removed.\r\n *\r\n * @return {Phaser.Tweens.TweenManager} This Tween Manager object.\r\n */\r\n remove: function (tween)\r\n {\r\n ArrayRemove(this._add, tween);\r\n ArrayRemove(this._pending, tween);\r\n ArrayRemove(this._active, tween);\r\n ArrayRemove(this._destroy, tween);\r\n\r\n tween.state = TWEEN_CONST.REMOVED;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Checks if a Tween or Timeline is active and adds it to the Tween Manager at the start of the frame if it isn't.\r\n *\r\n * @method Phaser.Tweens.TweenManager#makeActive\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tweens.Tween} tween - The Tween to check.\r\n *\r\n * @return {Phaser.Tweens.TweenManager} This Tween Manager object.\r\n */\r\n makeActive: function (tween)\r\n {\r\n if (this._add.indexOf(tween) !== -1 || this._active.indexOf(tween) !== -1)\r\n {\r\n return this;\r\n }\r\n\r\n var idx = this._pending.indexOf(tween);\r\n\r\n if (idx !== -1)\r\n {\r\n this._pending.splice(idx, 1);\r\n }\r\n\r\n this._add.push(tween);\r\n\r\n tween.state = TWEEN_CONST.PENDING_ADD;\r\n\r\n this._toProcess++;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Passes all Tweens to the given callback.\r\n *\r\n * @method Phaser.Tweens.TweenManager#each\r\n * @since 3.0.0\r\n *\r\n * @param {function} callback - The function to call.\r\n * @param {object} [scope] - The scope (`this` object) to call the function with.\r\n * @param {...*} [args] - The arguments to pass into the function. Its first argument will always be the Tween currently being iterated.\r\n */\r\n each: function (callback, scope)\r\n {\r\n var args = [ null ];\r\n\r\n for (var i = 1; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (var texture in this.list)\r\n {\r\n args[0] = this.list[texture];\r\n\r\n callback.apply(scope, args);\r\n }\r\n },\r\n\r\n /**\r\n * Returns an array of all active Tweens and Timelines in the Tween Manager.\r\n *\r\n * @method Phaser.Tweens.TweenManager#getAllTweens\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Tweens.Tween[]} A new array containing references to all active Tweens and Timelines.\r\n */\r\n getAllTweens: function ()\r\n {\r\n var list = this._active;\r\n var output = [];\r\n\r\n for (var i = 0; i < list.length; i++)\r\n {\r\n output.push(list[i]);\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns the scale of the time delta for all Tweens and Timelines owned by this Tween Manager.\r\n *\r\n * @method Phaser.Tweens.TweenManager#getGlobalTimeScale\r\n * @since 3.0.0\r\n *\r\n * @return {number} The scale of the time delta, usually 1.\r\n */\r\n getGlobalTimeScale: function ()\r\n {\r\n return this.timeScale;\r\n },\r\n\r\n /**\r\n * Returns an array of all Tweens or Timelines in the Tween Manager which affect the given target or array of targets.\r\n *\r\n * @method Phaser.Tweens.TweenManager#getTweensOf\r\n * @since 3.0.0\r\n *\r\n * @param {(object|array)} target - The target to look for. Provide an array to look for multiple targets.\r\n *\r\n * @return {Phaser.Tweens.Tween[]} A new array containing all Tweens and Timelines which affect the given target(s).\r\n */\r\n getTweensOf: function (target)\r\n {\r\n var list = this._active;\r\n var tween;\r\n var output = [];\r\n var i;\r\n\r\n if (Array.isArray(target))\r\n {\r\n for (i = 0; i < list.length; i++)\r\n {\r\n tween = list[i];\r\n\r\n for (var t = 0; t < target.length; t++)\r\n {\r\n if (tween.hasTarget(target[t]))\r\n {\r\n output.push(tween);\r\n }\r\n }\r\n }\r\n }\r\n else\r\n {\r\n for (i = 0; i < list.length; i++)\r\n {\r\n tween = list[i];\r\n\r\n if (tween.hasTarget(target))\r\n {\r\n output.push(tween);\r\n }\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Checks if the given object is being affected by a playing Tween.\r\n *\r\n * @method Phaser.Tweens.TweenManager#isTweening\r\n * @since 3.0.0\r\n *\r\n * @param {object} target - target Phaser.Tweens.Tween object\r\n *\r\n * @return {boolean} returns if target tween object is active or not\r\n */\r\n isTweening: function (target)\r\n {\r\n var list = this._active;\r\n var tween;\r\n\r\n for (var i = 0; i < list.length; i++)\r\n {\r\n tween = list[i];\r\n\r\n if (tween.hasTarget(target) && tween.isPlaying())\r\n {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Stops all Tweens in this Tween Manager. They will be removed at the start of the frame.\r\n *\r\n * @method Phaser.Tweens.TweenManager#killAll\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Tweens.TweenManager} This Tween Manager.\r\n */\r\n killAll: function ()\r\n {\r\n var tweens = this.getAllTweens();\r\n\r\n for (var i = 0; i < tweens.length; i++)\r\n {\r\n tweens[i].stop();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stops all Tweens which affect the given target or array of targets. The Tweens will be removed from the Tween Manager at the start of the frame.\r\n *\r\n * @see {@link #getTweensOf}\r\n *\r\n * @method Phaser.Tweens.TweenManager#killTweensOf\r\n * @since 3.0.0\r\n *\r\n * @param {(object|array)} target - The target to look for. Provide an array to look for multiple targets.\r\n *\r\n * @return {Phaser.Tweens.TweenManager} This Tween Manager.\r\n */\r\n killTweensOf: function (target)\r\n {\r\n var tweens = this.getTweensOf(target);\r\n\r\n for (var i = 0; i < tweens.length; i++)\r\n {\r\n tweens[i].stop();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Pauses all Tweens in this Tween Manager.\r\n *\r\n * @method Phaser.Tweens.TweenManager#pauseAll\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Tweens.TweenManager} This Tween Manager.\r\n */\r\n pauseAll: function ()\r\n {\r\n var list = this._active;\r\n\r\n for (var i = 0; i < list.length; i++)\r\n {\r\n list[i].pause();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resumes all Tweens in this Tween Manager.\r\n *\r\n * @method Phaser.Tweens.TweenManager#resumeAll\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Tweens.TweenManager} This Tween Manager.\r\n */\r\n resumeAll: function ()\r\n {\r\n var list = this._active;\r\n\r\n for (var i = 0; i < list.length; i++)\r\n {\r\n list[i].resume();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets a new scale of the time delta for this Tween Manager.\r\n *\r\n * The time delta is the time elapsed between two consecutive frames and influences the speed of time for this Tween Manager and all Tweens it owns. Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. A value of 0 freezes time and is effectively equivalent to pausing all Tweens.\r\n *\r\n * @method Phaser.Tweens.TweenManager#setGlobalTimeScale\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The new scale of the time delta, where 1 is the normal speed.\r\n *\r\n * @return {Phaser.Tweens.TweenManager} This Tween Manager.\r\n */\r\n setGlobalTimeScale: function (value)\r\n {\r\n this.timeScale = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method Phaser.Tweens.TweenManager#shutdown\r\n * @since 3.0.0\r\n */\r\n shutdown: function ()\r\n {\r\n this.killAll();\r\n\r\n this._add = [];\r\n this._pending = [];\r\n this._active = [];\r\n this._destroy = [];\r\n\r\n this._toProcess = 0;\r\n\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.off(SceneEvents.PRE_UPDATE, this.preUpdate, this);\r\n eventEmitter.off(SceneEvents.UPDATE, this.update, this);\r\n eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this);\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method Phaser.Tweens.TweenManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.scene.sys.events.off(SceneEvents.START, this.start, this);\r\n\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nPluginCache.register('TweenManager', TweenManager, 'tweens');\r\n\r\nmodule.exports = TweenManager;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/TweenManager.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/builders/GetBoolean.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/tweens/builders/GetBoolean.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Retrieves the value of the given key from an object.\r\n *\r\n * @function Phaser.Tweens.Builders.GetBoolean\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to retrieve the value from.\r\n * @param {string} key - The key to look for in the `source` object.\r\n * @param {*} defaultValue - The default value to return if the `key` doesn't exist or if no `source` object is provided.\r\n *\r\n * @return {*} The retrieved value.\r\n */\r\nvar GetBoolean = function (source, key, defaultValue)\r\n{\r\n if (!source)\r\n {\r\n return defaultValue;\r\n }\r\n else if (source.hasOwnProperty(key))\r\n {\r\n return source[key];\r\n }\r\n else\r\n {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nmodule.exports = GetBoolean;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/builders/GetBoolean.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/builders/GetEaseFunction.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/tweens/builders/GetEaseFunction.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar EaseMap = __webpack_require__(/*! ../../math/easing/EaseMap */ \"./node_modules/phaser/src/math/easing/EaseMap.js\");\r\nvar UppercaseFirst = __webpack_require__(/*! ../../utils/string/UppercaseFirst */ \"./node_modules/phaser/src/utils/string/UppercaseFirst.js\");\r\n\r\n/**\r\n * This internal function is used to return the correct ease function for a Tween.\r\n * \r\n * It can take a variety of input, including an EaseMap based string, or a custom function.\r\n *\r\n * @function Phaser.Tweens.Builders.GetEaseFunction\r\n * @since 3.0.0\r\n *\r\n * @param {(string|function)} ease - The ease to find. This can be either a string from the EaseMap, or a custom function.\r\n * @param {number[]} [easeParams] - An optional array of ease parameters to go with the ease.\r\n *\r\n * @return {function} The ease function.\r\n */\r\nvar GetEaseFunction = function (ease, easeParams)\r\n{\r\n // Default ease function\r\n var easeFunction = EaseMap.Power0;\r\n\r\n // Prepare ease function\r\n if (typeof ease === 'string')\r\n {\r\n // String based look-up\r\n\r\n // 1) They specified it correctly\r\n if (EaseMap.hasOwnProperty(ease))\r\n {\r\n easeFunction = EaseMap[ease];\r\n }\r\n else\r\n {\r\n // Do some string manipulation to try and find it\r\n var direction = '';\r\n\r\n if (ease.indexOf('.'))\r\n {\r\n // quad.in = Quad.easeIn\r\n // quad.out = Quad.easeOut\r\n // quad.inout =Quad.easeInOut\r\n\r\n direction = ease.substr(ease.indexOf('.') + 1);\r\n\r\n if (direction.toLowerCase() === 'in')\r\n {\r\n direction = 'easeIn';\r\n }\r\n else if (direction.toLowerCase() === 'out')\r\n {\r\n direction = 'easeOut';\r\n }\r\n else if (direction.toLowerCase() === 'inout')\r\n {\r\n direction = 'easeInOut';\r\n }\r\n }\r\n\r\n ease = UppercaseFirst(ease.substr(0, ease.indexOf('.') + 1) + direction);\r\n\r\n if (EaseMap.hasOwnProperty(ease))\r\n {\r\n easeFunction = EaseMap[ease];\r\n }\r\n }\r\n }\r\n else if (typeof ease === 'function')\r\n {\r\n // Custom function\r\n easeFunction = ease;\r\n }\r\n else if (Array.isArray(ease) && ease.length === 4)\r\n {\r\n // Bezier function (TODO)\r\n }\r\n\r\n // No custom ease parameters?\r\n if (!easeParams)\r\n {\r\n // Return ease function\r\n return easeFunction;\r\n }\r\n\r\n var cloneParams = easeParams.slice(0);\r\n\r\n cloneParams.unshift(0);\r\n\r\n // Return ease function with custom ease parameters\r\n return function (v)\r\n {\r\n cloneParams[0] = v;\r\n\r\n return easeFunction.apply(this, cloneParams);\r\n };\r\n};\r\n\r\nmodule.exports = GetEaseFunction;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/builders/GetEaseFunction.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/builders/GetNewValue.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/tweens/builders/GetNewValue.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Internal function used by the Tween Builder to create a function that will return\r\n * the given value from the source.\r\n *\r\n * @function Phaser.Tweens.Builders.GetNewValue\r\n * @since 3.0.0\r\n *\r\n * @param {any} source - The source object to get the value from.\r\n * @param {string} key - The property to get from the source.\r\n * @param {any} defaultValue - A default value to return should the source not have the property set.\r\n *\r\n * @return {function} A function which when called will return the property value from the source.\r\n */\r\nvar GetNewValue = function (source, key, defaultValue)\r\n{\r\n var valueCallback;\r\n\r\n if (source.hasOwnProperty(key))\r\n {\r\n var t = typeof(source[key]);\r\n\r\n if (t === 'function')\r\n {\r\n valueCallback = function (target, targetKey, value, targetIndex, totalTargets, tween)\r\n {\r\n return source[key](target, targetKey, value, targetIndex, totalTargets, tween);\r\n };\r\n }\r\n else\r\n {\r\n valueCallback = function ()\r\n {\r\n return source[key];\r\n };\r\n }\r\n }\r\n else if (typeof defaultValue === 'function')\r\n {\r\n valueCallback = defaultValue;\r\n }\r\n else\r\n {\r\n valueCallback = function ()\r\n {\r\n return defaultValue;\r\n };\r\n }\r\n\r\n return valueCallback;\r\n};\r\n\r\nmodule.exports = GetNewValue;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/builders/GetNewValue.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/builders/GetProps.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/tweens/builders/GetProps.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RESERVED = __webpack_require__(/*! ../tween/ReservedProps */ \"./node_modules/phaser/src/tweens/tween/ReservedProps.js\");\r\n\r\n/**\r\n * Internal function used by the Tween Builder to return an array of properties\r\n * that the Tween will be operating on. It takes a tween configuration object\r\n * and then checks that none of the `props` entries start with an underscore, or that\r\n * none of the direct properties are on the Reserved list.\r\n *\r\n * @function Phaser.Tweens.Builders.GetProps\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Tweens.TweenBuilderConfig} config - The configuration object of the Tween to get the properties from.\r\n *\r\n * @return {string[]} An array of all the properties the tween will operate on.\r\n */\r\nvar GetProps = function (config)\r\n{\r\n var key;\r\n var keys = [];\r\n\r\n // First see if we have a props object\r\n\r\n if (config.hasOwnProperty('props'))\r\n {\r\n for (key in config.props)\r\n {\r\n // Skip any property that starts with an underscore\r\n if (key.substr(0, 1) !== '_')\r\n {\r\n keys.push({ key: key, value: config.props[key] });\r\n }\r\n }\r\n }\r\n else\r\n {\r\n for (key in config)\r\n {\r\n // Skip any property that is in the ReservedProps list or that starts with an underscore\r\n if (RESERVED.indexOf(key) === -1 && key.substr(0, 1) !== '_')\r\n {\r\n keys.push({ key: key, value: config[key] });\r\n }\r\n }\r\n }\r\n\r\n return keys;\r\n};\r\n\r\nmodule.exports = GetProps;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/builders/GetProps.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/builders/GetTargets.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/tweens/builders/GetTargets.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\n\r\n/**\r\n * Extracts an array of targets from a Tween configuration object.\r\n *\r\n * The targets will be looked for in a `targets` property. If it's a function, its return value will be used as the result.\r\n *\r\n * @function Phaser.Tweens.Builders.GetTargets\r\n * @since 3.0.0\r\n *\r\n * @param {object} config - The configuration object to use.\r\n *\r\n * @return {array} An array of targets (may contain only one element), or `null` if no targets were specified.\r\n */\r\nvar GetTargets = function (config)\r\n{\r\n var targets = GetValue(config, 'targets', null);\r\n\r\n if (targets === null)\r\n {\r\n return targets;\r\n }\r\n\r\n if (typeof targets === 'function')\r\n {\r\n targets = targets.call();\r\n }\r\n\r\n if (!Array.isArray(targets))\r\n {\r\n targets = [ targets ];\r\n }\r\n\r\n return targets;\r\n};\r\n\r\nmodule.exports = GetTargets;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/builders/GetTargets.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/builders/GetTweens.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/tweens/builders/GetTweens.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\n\r\n/**\r\n * Internal function used by the Timeline Builder.\r\n * \r\n * It returns an array of all tweens in the given timeline config.\r\n *\r\n * @function Phaser.Tweens.Builders.GetTweens\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline.\r\n *\r\n * @return {Phaser.Tweens.Tween[]} An array of Tween instances that the Timeline will manage.\r\n */\r\nvar GetTweens = function (config)\r\n{\r\n var tweens = GetValue(config, 'tweens', null);\r\n\r\n if (tweens === null)\r\n {\r\n return [];\r\n }\r\n else if (typeof tweens === 'function')\r\n {\r\n tweens = tweens.call();\r\n }\r\n\r\n if (!Array.isArray(tweens))\r\n {\r\n tweens = [ tweens ];\r\n }\r\n\r\n return tweens;\r\n};\r\n\r\nmodule.exports = GetTweens;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/builders/GetTweens.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/builders/GetValueOp.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/tweens/builders/GetValueOp.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction hasGetActive (def)\r\n{\r\n return (!!def.getActive && typeof def.getActive === 'function');\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction hasGetStart (def)\r\n{\r\n return (!!def.getStart && typeof def.getStart === 'function');\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction hasGetEnd (def)\r\n{\r\n return (!!def.getEnd && typeof def.getEnd === 'function');\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction hasGetters (def)\r\n{\r\n return hasGetStart(def) || hasGetEnd(def) || hasGetActive(def);\r\n}\r\n\r\n/**\r\n * Returns `getActive`, `getStart` and `getEnd` functions for a TweenData based on a target property and end value.\r\n * \r\n * `getActive` if not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property.\r\n * `getEnd` is invoked once any start delays have expired and returns what the value should tween to.\r\n * `getStart` is invoked when the tween reaches the end and needs to either repeat or yoyo, it returns the value to go back to.\r\n *\r\n * If the end value is a number, it will be treated as an absolute value and the property will be tweened to it.\r\n * A string can be provided to specify a relative end value which consists of an operation\r\n * (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current\r\n * value, or `/=` to divide the current value) followed by its operand.\r\n * \r\n * A function can be provided to allow greater control over the end value; it will receive the target\r\n * object being tweened, the name of the property being tweened, and the current value of the property\r\n * as its arguments.\r\n * \r\n * If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd`\r\n * callbacks, which will receive the same arguments, can be provided instead. If an object with a `value`\r\n * property is provided, the property will be used as the effective value under the same rules described here.\r\n *\r\n * @function Phaser.Tweens.Builders.GetValueOp\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The name of the property to modify.\r\n * @param {*} propertyValue - The ending value of the property, as described above.\r\n *\r\n * @return {function} An array of functions, `getActive`, `getStart` and `getEnd`, which return the starting and the ending value of the property based on the provided value.\r\n */\r\nvar GetValueOp = function (key, propertyValue)\r\n{\r\n var callbacks;\r\n\r\n // The returned value sets what the property will be at the END of the Tween (usually called at the start of the Tween)\r\n var getEnd = function (target, key, value) { return value; };\r\n\r\n // The returned value sets what the property will be at the START of the Tween (usually called at the end of the Tween)\r\n var getStart = function (target, key, value) { return value; };\r\n\r\n // What to set the property to the moment the TweenData is invoked\r\n var getActive = null;\r\n\r\n var t = typeof(propertyValue);\r\n\r\n if (t === 'number')\r\n {\r\n // props: {\r\n // x: 400,\r\n // y: 300\r\n // }\r\n\r\n getEnd = function ()\r\n {\r\n return propertyValue;\r\n };\r\n }\r\n else if (t === 'string')\r\n {\r\n // props: {\r\n // x: '+=400',\r\n // y: '-=300',\r\n // z: '*=2',\r\n // w: '/=2'\r\n // }\r\n\r\n var op = propertyValue[0];\r\n var num = parseFloat(propertyValue.substr(2));\r\n\r\n switch (op)\r\n {\r\n case '+':\r\n getEnd = function (target, key, value)\r\n {\r\n return value + num;\r\n };\r\n break;\r\n\r\n case '-':\r\n getEnd = function (target, key, value)\r\n {\r\n return value - num;\r\n };\r\n break;\r\n\r\n case '*':\r\n getEnd = function (target, key, value)\r\n {\r\n return value * num;\r\n };\r\n break;\r\n\r\n case '/':\r\n getEnd = function (target, key, value)\r\n {\r\n return value / num;\r\n };\r\n break;\r\n\r\n default:\r\n getEnd = function ()\r\n {\r\n return parseFloat(propertyValue);\r\n };\r\n }\r\n }\r\n else if (t === 'function')\r\n {\r\n // The same as setting just the getEnd function and no getStart\r\n\r\n // props: {\r\n // x: function (target, key, value, targetIndex, totalTargets, tween) { return value + 50); },\r\n // }\r\n\r\n getEnd = propertyValue;\r\n }\r\n else if (t === 'object')\r\n {\r\n if (hasGetters(propertyValue))\r\n {\r\n /*\r\n x: {\r\n // Called the moment Tween is active. The returned value sets the property on the target immediately.\r\n getActive: function (target, key, value, targetIndex, totalTargets, tween)\r\n {\r\n return value;\r\n },\r\n\r\n // Called at the start of the Tween. The returned value sets what the property will be at the END of the Tween.\r\n getEnd: function (target, key, value, targetIndex, totalTargets, tween)\r\n {\r\n return value;\r\n },\r\n\r\n // Called at the end of the Tween. The returned value sets what the property will be at the START of the Tween.\r\n getStart: function (target, key, value, targetIndex, totalTargets, tween)\r\n {\r\n return value;\r\n }\r\n }\r\n */\r\n\r\n if (hasGetActive(propertyValue))\r\n {\r\n getActive = propertyValue.getActive;\r\n }\r\n\r\n if (hasGetEnd(propertyValue))\r\n {\r\n getEnd = propertyValue.getEnd;\r\n }\r\n\r\n if (hasGetStart(propertyValue))\r\n {\r\n getStart = propertyValue.getStart;\r\n }\r\n }\r\n else if (propertyValue.hasOwnProperty('value'))\r\n {\r\n // 'value' may still be a string, function or a number\r\n // props: {\r\n // x: { value: 400, ... },\r\n // y: { value: 300, ... }\r\n // }\r\n\r\n callbacks = GetValueOp(key, propertyValue.value);\r\n }\r\n else\r\n {\r\n // 'from' and 'to' may still be a string, function or a number\r\n // props: {\r\n // x: { from: 400, to: 600 },\r\n // y: { from: 300, to: 500 }\r\n // }\r\n\r\n // Same as above, but the 'start' value is set immediately on the target\r\n // props: {\r\n // x: { start: 400, to: 600 },\r\n // y: { start: 300, to: 500 }\r\n // }\r\n\r\n // 'start' value is set immediately, then it goes 'from' to 'to' during the tween\r\n // props: {\r\n // x: { start: 200, from: 400, to: 600 },\r\n // y: { start: 300, from: 300, to: 500 }\r\n // }\r\n\r\n var hasTo = propertyValue.hasOwnProperty('to');\r\n var hasFrom = propertyValue.hasOwnProperty('from');\r\n var hasStart = propertyValue.hasOwnProperty('start');\r\n\r\n if (hasTo && (hasFrom || hasStart))\r\n {\r\n callbacks = GetValueOp(key, propertyValue.to);\r\n\r\n if (hasStart)\r\n {\r\n var startCallbacks = GetValueOp(key, propertyValue.start);\r\n \r\n callbacks.getActive = startCallbacks.getEnd;\r\n }\r\n \r\n if (hasFrom)\r\n {\r\n var fromCallbacks = GetValueOp(key, propertyValue.from);\r\n \r\n callbacks.getStart = fromCallbacks.getEnd;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // If callback not set by the else if block above then set it here and return it\r\n if (!callbacks)\r\n {\r\n callbacks = {\r\n getActive: getActive,\r\n getEnd: getEnd,\r\n getStart: getStart\r\n };\r\n }\r\n\r\n return callbacks;\r\n};\r\n\r\nmodule.exports = GetValueOp;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/builders/GetValueOp.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/builders/NumberTweenBuilder.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/tweens/builders/NumberTweenBuilder.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Defaults = __webpack_require__(/*! ../tween/Defaults */ \"./node_modules/phaser/src/tweens/tween/Defaults.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar GetBoolean = __webpack_require__(/*! ./GetBoolean */ \"./node_modules/phaser/src/tweens/builders/GetBoolean.js\");\r\nvar GetEaseFunction = __webpack_require__(/*! ./GetEaseFunction */ \"./node_modules/phaser/src/tweens/builders/GetEaseFunction.js\");\r\nvar GetNewValue = __webpack_require__(/*! ./GetNewValue */ \"./node_modules/phaser/src/tweens/builders/GetNewValue.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar GetValueOp = __webpack_require__(/*! ./GetValueOp */ \"./node_modules/phaser/src/tweens/builders/GetValueOp.js\");\r\nvar Tween = __webpack_require__(/*! ../tween/Tween */ \"./node_modules/phaser/src/tweens/tween/Tween.js\");\r\nvar TweenData = __webpack_require__(/*! ../tween/TweenData */ \"./node_modules/phaser/src/tweens/tween/TweenData.js\");\r\n\r\n/**\r\n * Creates a new Number Tween.\r\n *\r\n * @function Phaser.Tweens.Builders.NumberTweenBuilder\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - The owner of the new Tween.\r\n * @param {Phaser.Types.Tweens.NumberTweenBuilderConfig} config - Configuration for the new Tween.\r\n * @param {Phaser.Types.Tweens.TweenConfigDefaults} defaults - Tween configuration defaults.\r\n *\r\n * @return {Phaser.Tweens.Tween} The new tween.\r\n */\r\nvar NumberTweenBuilder = function (parent, config, defaults)\r\n{\r\n if (defaults === undefined)\r\n {\r\n defaults = Defaults;\r\n }\r\n\r\n // var tween = this.tweens.addCounter({\r\n // from: 100,\r\n // to: 200,\r\n // ... (normal tween properties)\r\n // })\r\n //\r\n // Then use it in your game via:\r\n //\r\n // tween.getValue()\r\n\r\n var from = GetValue(config, 'from', 0);\r\n var to = GetValue(config, 'to', 1);\r\n\r\n var targets = [ { value: from } ];\r\n\r\n var delay = GetNewValue(config, 'delay', defaults.delay);\r\n var duration = GetNewValue(config, 'duration', defaults.duration);\r\n var easeParams = GetValue(config, 'easeParams', defaults.easeParams);\r\n var ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), easeParams);\r\n var hold = GetNewValue(config, 'hold', defaults.hold);\r\n var repeat = GetNewValue(config, 'repeat', defaults.repeat);\r\n var repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay);\r\n var yoyo = GetBoolean(config, 'yoyo', defaults.yoyo);\r\n\r\n var data = [];\r\n\r\n var ops = GetValueOp('value', to);\r\n\r\n var tweenData = TweenData(\r\n targets[0],\r\n 0,\r\n 'value',\r\n ops.getEnd,\r\n ops.getStart,\r\n ops.getActive,\r\n ease,\r\n delay,\r\n duration,\r\n yoyo,\r\n hold,\r\n repeat,\r\n repeatDelay,\r\n false,\r\n false\r\n );\r\n\r\n tweenData.start = from;\r\n tweenData.current = from;\r\n tweenData.to = to;\r\n\r\n data.push(tweenData);\r\n\r\n var tween = new Tween(parent, data, targets);\r\n\r\n tween.offset = GetAdvancedValue(config, 'offset', null);\r\n tween.completeDelay = GetAdvancedValue(config, 'completeDelay', 0);\r\n tween.loop = Math.round(GetAdvancedValue(config, 'loop', 0));\r\n tween.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0));\r\n tween.paused = GetBoolean(config, 'paused', false);\r\n tween.useFrames = GetBoolean(config, 'useFrames', false);\r\n\r\n // Set the Callbacks\r\n var scope = GetValue(config, 'callbackScope', tween);\r\n\r\n // Callback parameters: 0 = a reference to the Tween itself, 1 = the target/s of the Tween, ... your own params\r\n var tweenArray = [ tween, null ];\r\n\r\n var callbacks = Tween.TYPES;\r\n\r\n for (var i = 0; i < callbacks.length; i++)\r\n {\r\n var type = callbacks[i];\r\n\r\n var callback = GetValue(config, type, false);\r\n\r\n if (callback)\r\n {\r\n var callbackScope = GetValue(config, type + 'Scope', scope);\r\n var callbackParams = GetValue(config, type + 'Params', []);\r\n\r\n // The null is reset to be the Tween target\r\n tween.setCallback(type, callback, tweenArray.concat(callbackParams), callbackScope);\r\n }\r\n }\r\n\r\n return tween;\r\n};\r\n\r\nmodule.exports = NumberTweenBuilder;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/builders/NumberTweenBuilder.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/builders/StaggerBuilder.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/tweens/builders/StaggerBuilder.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetEaseFunction = __webpack_require__(/*! ./GetEaseFunction */ \"./node_modules/phaser/src/tweens/builders/GetEaseFunction.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\n\r\n/**\r\n * Creates a Stagger function to be used by a Tween property.\r\n * \r\n * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween.\r\n * \r\n * This is only worth using if the tween has multiple targets.\r\n * \r\n * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2\r\n * over the duration specified:\r\n * \r\n * ```javascript\r\n * this.tweens.add({\r\n * targets: [ ... ],\r\n * scale: 0.2,\r\n * ease: 'linear',\r\n * duration: 1000,\r\n * delay: this.tweens.stagger(100)\r\n * });\r\n * ```\r\n * \r\n * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering\r\n * from the center out, using a cubic ease.\r\n * \r\n * ```javascript\r\n * this.tweens.add({\r\n * targets: [ ... ],\r\n * scale: 0.2,\r\n * ease: 'linear',\r\n * duration: 1000,\r\n * delay: this.tweens.stagger(500, { grid: [ 10, 6 ], from: 'center', ease: 'cubic.out' })\r\n * });\r\n * ```\r\n *\r\n * @function Phaser.Tweens.Builders.StaggerBuilder\r\n * @since 3.19.0\r\n *\r\n * @param {(number|number[])} value - The amount to stagger by, or an array containing two elements representing the min and max values to stagger between.\r\n * @param {Phaser.Types.Tweens.StaggerConfig} [config] - A Stagger Configuration object.\r\n *\r\n * @return {function} The stagger function.\r\n */\r\nvar StaggerBuilder = function (value, options)\r\n{\r\n if (options === undefined) { options = {}; }\r\n\r\n var result;\r\n\r\n var start = GetValue(options, 'start', 0);\r\n var ease = GetValue(options, 'ease', null);\r\n var grid = GetValue(options, 'grid', null);\r\n\r\n var from = GetValue(options, 'from', 0);\r\n\r\n var fromFirst = (from === 'first');\r\n var fromCenter = (from === 'center');\r\n var fromLast = (from === 'last');\r\n var fromValue = (typeof(from) === 'number');\r\n\r\n var isRange = (Array.isArray(value));\r\n var value1 = (isRange) ? parseFloat(value[0]) : parseFloat(value);\r\n var value2 = (isRange) ? parseFloat(value[1]) : 0;\r\n var maxValue = Math.max(value1, value2);\r\n\r\n if (isRange)\r\n {\r\n start += value1;\r\n }\r\n\r\n if (grid)\r\n {\r\n // Pre-calc the grid to save doing it for ever tweendata update\r\n var gridWidth = grid[0];\r\n var gridHeight = grid[1];\r\n\r\n var fromX = 0;\r\n var fromY = 0;\r\n\r\n var distanceX = 0;\r\n var distanceY = 0;\r\n\r\n var gridValues = [];\r\n\r\n if (fromLast)\r\n {\r\n fromX = gridWidth - 1;\r\n fromY = gridHeight - 1;\r\n }\r\n else if (fromValue)\r\n {\r\n fromX = from % gridWidth;\r\n fromY = Math.floor(from / gridWidth);\r\n }\r\n else if (fromCenter)\r\n {\r\n fromX = (gridWidth - 1) / 2;\r\n fromY = (gridHeight - 1) / 2;\r\n }\r\n\r\n var gridMax = MATH_CONST.MIN_SAFE_INTEGER;\r\n\r\n for (var toY = 0; toY < gridHeight; toY++)\r\n {\r\n gridValues[toY] = [];\r\n\r\n for (var toX = 0; toX < gridWidth; toX++)\r\n {\r\n distanceX = fromX - toX;\r\n distanceY = fromY - toY;\r\n\r\n var dist = Math.sqrt(distanceX * distanceX + distanceY * distanceY);\r\n\r\n if (dist > gridMax)\r\n {\r\n gridMax = dist;\r\n }\r\n\r\n gridValues[toY][toX] = dist;\r\n }\r\n }\r\n }\r\n\r\n var easeFunction = (ease) ? GetEaseFunction(ease) : null;\r\n\r\n if (grid)\r\n {\r\n result = function (target, key, value, index)\r\n {\r\n var gridSpace = 0;\r\n var toX = index % gridWidth;\r\n var toY = Math.floor(index / gridWidth);\r\n \r\n if (toX >= 0 && toX < gridWidth && toY >= 0 && toY < gridHeight)\r\n {\r\n gridSpace = gridValues[toY][toX];\r\n }\r\n\r\n var output;\r\n \r\n if (isRange)\r\n {\r\n var diff = (value2 - value1);\r\n \r\n if (easeFunction)\r\n {\r\n output = ((gridSpace / gridMax) * diff) * easeFunction(gridSpace / gridMax);\r\n }\r\n else\r\n {\r\n output = (gridSpace / gridMax) * diff;\r\n }\r\n }\r\n else if (easeFunction)\r\n {\r\n output = (gridSpace * value1) * easeFunction(gridSpace / gridMax);\r\n }\r\n else\r\n {\r\n output = gridSpace * value1;\r\n }\r\n\r\n return output + start;\r\n };\r\n }\r\n else\r\n {\r\n result = function (target, key, value, index, total)\r\n {\r\n // zero offset\r\n total--;\r\n \r\n var fromIndex;\r\n \r\n if (fromFirst)\r\n {\r\n fromIndex = index;\r\n }\r\n else if (fromCenter)\r\n {\r\n fromIndex = Math.abs((total / 2) - index);\r\n }\r\n else if (fromLast)\r\n {\r\n fromIndex = total - index;\r\n }\r\n else if (fromValue)\r\n {\r\n fromIndex = Math.abs(from - index);\r\n }\r\n \r\n var output;\r\n \r\n if (isRange)\r\n {\r\n var spacing;\r\n\r\n if (fromCenter)\r\n {\r\n spacing = ((value2 - value1) / total) * (fromIndex * 2);\r\n }\r\n else\r\n {\r\n spacing = ((value2 - value1) / total) * fromIndex;\r\n }\r\n \r\n if (easeFunction)\r\n {\r\n output = spacing * easeFunction(fromIndex / total);\r\n }\r\n else\r\n {\r\n output = spacing;\r\n }\r\n }\r\n else if (easeFunction)\r\n {\r\n output = (total * maxValue) * easeFunction(fromIndex / total);\r\n }\r\n else\r\n {\r\n output = fromIndex * value1;\r\n }\r\n \r\n return output + start;\r\n };\r\n }\r\n\r\n return result;\r\n};\r\n\r\nmodule.exports = StaggerBuilder;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/builders/StaggerBuilder.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/builders/TimelineBuilder.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/tweens/builders/TimelineBuilder.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clone = __webpack_require__(/*! ../../utils/object/Clone */ \"./node_modules/phaser/src/utils/object/Clone.js\");\r\nvar Defaults = __webpack_require__(/*! ../tween/Defaults */ \"./node_modules/phaser/src/tweens/tween/Defaults.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar GetBoolean = __webpack_require__(/*! ./GetBoolean */ \"./node_modules/phaser/src/tweens/builders/GetBoolean.js\");\r\nvar GetEaseFunction = __webpack_require__(/*! ./GetEaseFunction */ \"./node_modules/phaser/src/tweens/builders/GetEaseFunction.js\");\r\nvar GetNewValue = __webpack_require__(/*! ./GetNewValue */ \"./node_modules/phaser/src/tweens/builders/GetNewValue.js\");\r\nvar GetTargets = __webpack_require__(/*! ./GetTargets */ \"./node_modules/phaser/src/tweens/builders/GetTargets.js\");\r\nvar GetTweens = __webpack_require__(/*! ./GetTweens */ \"./node_modules/phaser/src/tweens/builders/GetTweens.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar Timeline = __webpack_require__(/*! ../Timeline */ \"./node_modules/phaser/src/tweens/Timeline.js\");\r\nvar TweenBuilder = __webpack_require__(/*! ./TweenBuilder */ \"./node_modules/phaser/src/tweens/builders/TweenBuilder.js\");\r\n\r\n/**\r\n * Builds a Timeline of Tweens based on a configuration object.\r\n *\r\n * @function Phaser.Tweens.Builders.TimelineBuilder\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tweens.TweenManager} manager - The Tween Manager to which the Timeline will belong.\r\n * @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline.\r\n *\r\n * @return {Phaser.Tweens.Timeline} The created Timeline.\r\n */\r\nvar TimelineBuilder = function (manager, config)\r\n{\r\n var timeline = new Timeline(manager);\r\n\r\n var tweens = GetTweens(config);\r\n\r\n if (tweens.length === 0)\r\n {\r\n timeline.paused = true;\r\n\r\n return timeline;\r\n }\r\n\r\n var defaults = Clone(Defaults);\r\n\r\n defaults.targets = GetTargets(config);\r\n\r\n // totalDuration: If specified each tween in the Timeline is given an equal portion of the totalDuration\r\n\r\n var totalDuration = GetAdvancedValue(config, 'totalDuration', 0);\r\n\r\n if (totalDuration > 0)\r\n {\r\n defaults.duration = Math.floor(totalDuration / tweens.length);\r\n }\r\n else\r\n {\r\n defaults.duration = GetNewValue(config, 'duration', defaults.duration);\r\n }\r\n\r\n defaults.delay = GetNewValue(config, 'delay', defaults.delay);\r\n defaults.easeParams = GetValue(config, 'easeParams', defaults.easeParams);\r\n defaults.ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), defaults.easeParams);\r\n defaults.hold = GetNewValue(config, 'hold', defaults.hold);\r\n defaults.repeat = GetNewValue(config, 'repeat', defaults.repeat);\r\n defaults.repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay);\r\n defaults.yoyo = GetBoolean(config, 'yoyo', defaults.yoyo);\r\n defaults.flipX = GetBoolean(config, 'flipX', defaults.flipX);\r\n defaults.flipY = GetBoolean(config, 'flipY', defaults.flipY);\r\n\r\n // Create the Tweens\r\n for (var i = 0; i < tweens.length; i++)\r\n {\r\n timeline.queue(TweenBuilder(timeline, tweens[i], defaults));\r\n }\r\n\r\n timeline.completeDelay = GetAdvancedValue(config, 'completeDelay', 0);\r\n timeline.loop = Math.round(GetAdvancedValue(config, 'loop', 0));\r\n timeline.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0));\r\n timeline.paused = GetBoolean(config, 'paused', false);\r\n timeline.useFrames = GetBoolean(config, 'useFrames', false);\r\n\r\n // Callbacks\r\n\r\n var scope = GetValue(config, 'callbackScope', timeline);\r\n\r\n var timelineArray = [ timeline ];\r\n\r\n var onStart = GetValue(config, 'onStart', false);\r\n\r\n // The Start of the Timeline\r\n if (onStart)\r\n {\r\n var onStartScope = GetValue(config, 'onStartScope', scope);\r\n var onStartParams = GetValue(config, 'onStartParams', []);\r\n\r\n timeline.setCallback('onStart', onStart, timelineArray.concat(onStartParams), onStartScope);\r\n }\r\n\r\n var onUpdate = GetValue(config, 'onUpdate', false);\r\n\r\n // Every time the Timeline updates (regardless which Tweens are running)\r\n if (onUpdate)\r\n {\r\n var onUpdateScope = GetValue(config, 'onUpdateScope', scope);\r\n var onUpdateParams = GetValue(config, 'onUpdateParams', []);\r\n\r\n timeline.setCallback('onUpdate', onUpdate, timelineArray.concat(onUpdateParams), onUpdateScope);\r\n }\r\n\r\n var onLoop = GetValue(config, 'onLoop', false);\r\n\r\n // Called when the whole Timeline loops\r\n if (onLoop)\r\n {\r\n var onLoopScope = GetValue(config, 'onLoopScope', scope);\r\n var onLoopParams = GetValue(config, 'onLoopParams', []);\r\n\r\n timeline.setCallback('onLoop', onLoop, timelineArray.concat(onLoopParams), onLoopScope);\r\n }\r\n\r\n var onYoyo = GetValue(config, 'onYoyo', false);\r\n\r\n // Called when a Timeline yoyos\r\n if (onYoyo)\r\n {\r\n var onYoyoScope = GetValue(config, 'onYoyoScope', scope);\r\n var onYoyoParams = GetValue(config, 'onYoyoParams', []);\r\n\r\n timeline.setCallback('onYoyo', onYoyo, timelineArray.concat(null, onYoyoParams), onYoyoScope);\r\n }\r\n\r\n var onComplete = GetValue(config, 'onComplete', false);\r\n\r\n // Called when the Timeline completes, after the completeDelay, etc.\r\n if (onComplete)\r\n {\r\n var onCompleteScope = GetValue(config, 'onCompleteScope', scope);\r\n var onCompleteParams = GetValue(config, 'onCompleteParams', []);\r\n\r\n timeline.setCallback('onComplete', onComplete, timelineArray.concat(onCompleteParams), onCompleteScope);\r\n }\r\n\r\n return timeline;\r\n};\r\n\r\nmodule.exports = TimelineBuilder;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/builders/TimelineBuilder.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/builders/TweenBuilder.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/tweens/builders/TweenBuilder.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Defaults = __webpack_require__(/*! ../tween/Defaults */ \"./node_modules/phaser/src/tweens/tween/Defaults.js\");\r\nvar GetAdvancedValue = __webpack_require__(/*! ../../utils/object/GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\");\r\nvar GetBoolean = __webpack_require__(/*! ./GetBoolean */ \"./node_modules/phaser/src/tweens/builders/GetBoolean.js\");\r\nvar GetEaseFunction = __webpack_require__(/*! ./GetEaseFunction */ \"./node_modules/phaser/src/tweens/builders/GetEaseFunction.js\");\r\nvar GetNewValue = __webpack_require__(/*! ./GetNewValue */ \"./node_modules/phaser/src/tweens/builders/GetNewValue.js\");\r\nvar GetProps = __webpack_require__(/*! ./GetProps */ \"./node_modules/phaser/src/tweens/builders/GetProps.js\");\r\nvar GetTargets = __webpack_require__(/*! ./GetTargets */ \"./node_modules/phaser/src/tweens/builders/GetTargets.js\");\r\nvar GetValue = __webpack_require__(/*! ../../utils/object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar GetValueOp = __webpack_require__(/*! ./GetValueOp */ \"./node_modules/phaser/src/tweens/builders/GetValueOp.js\");\r\nvar Tween = __webpack_require__(/*! ../tween/Tween */ \"./node_modules/phaser/src/tweens/tween/Tween.js\");\r\nvar TweenData = __webpack_require__(/*! ../tween/TweenData */ \"./node_modules/phaser/src/tweens/tween/TweenData.js\");\r\n\r\n/**\r\n * Creates a new Tween.\r\n *\r\n * @function Phaser.Tweens.Builders.TweenBuilder\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - The owner of the new Tween.\r\n * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - Configuration for the new Tween.\r\n * @param {Phaser.Types.Tweens.TweenConfigDefaults} defaults - Tween configuration defaults.\r\n *\r\n * @return {Phaser.Tweens.Tween} The new tween.\r\n */\r\nvar TweenBuilder = function (parent, config, defaults)\r\n{\r\n if (defaults === undefined)\r\n {\r\n defaults = Defaults;\r\n }\r\n\r\n // Create arrays of the Targets and the Properties\r\n var targets = (defaults.targets) ? defaults.targets : GetTargets(config);\r\n\r\n // var props = (defaults.props) ? defaults.props : GetProps(config);\r\n var props = GetProps(config);\r\n\r\n // Default Tween values\r\n var delay = GetNewValue(config, 'delay', defaults.delay);\r\n var duration = GetNewValue(config, 'duration', defaults.duration);\r\n var easeParams = GetValue(config, 'easeParams', defaults.easeParams);\r\n var ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), easeParams);\r\n var hold = GetNewValue(config, 'hold', defaults.hold);\r\n var repeat = GetNewValue(config, 'repeat', defaults.repeat);\r\n var repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay);\r\n var yoyo = GetBoolean(config, 'yoyo', defaults.yoyo);\r\n var flipX = GetBoolean(config, 'flipX', defaults.flipX);\r\n var flipY = GetBoolean(config, 'flipY', defaults.flipY);\r\n\r\n var data = [];\r\n\r\n // Loop through every property defined in the Tween, i.e.: props { x, y, alpha }\r\n for (var p = 0; p < props.length; p++)\r\n {\r\n var key = props[p].key;\r\n var value = props[p].value;\r\n\r\n // Create 1 TweenData per target, per property\r\n for (var t = 0; t < targets.length; t++)\r\n {\r\n var ops = GetValueOp(key, value);\r\n\r\n var tweenData = TweenData(\r\n targets[t],\r\n t,\r\n key,\r\n ops.getEnd,\r\n ops.getStart,\r\n ops.getActive,\r\n GetEaseFunction(GetValue(value, 'ease', ease), easeParams),\r\n GetNewValue(value, 'delay', delay),\r\n GetNewValue(value, 'duration', duration),\r\n GetBoolean(value, 'yoyo', yoyo),\r\n GetNewValue(value, 'hold', hold),\r\n GetNewValue(value, 'repeat', repeat),\r\n GetNewValue(value, 'repeatDelay', repeatDelay),\r\n GetBoolean(value, 'flipX', flipX),\r\n GetBoolean(value, 'flipY', flipY)\r\n );\r\n\r\n data.push(tweenData);\r\n }\r\n }\r\n\r\n var tween = new Tween(parent, data, targets);\r\n\r\n tween.offset = GetAdvancedValue(config, 'offset', null);\r\n tween.completeDelay = GetAdvancedValue(config, 'completeDelay', 0);\r\n tween.loop = Math.round(GetAdvancedValue(config, 'loop', 0));\r\n tween.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0));\r\n tween.paused = GetBoolean(config, 'paused', false);\r\n tween.useFrames = GetBoolean(config, 'useFrames', false);\r\n\r\n // Set the Callbacks\r\n var scope = GetValue(config, 'callbackScope', tween);\r\n\r\n // Callback parameters: 0 = a reference to the Tween itself, 1 = the target/s of the Tween, ... your own params\r\n var tweenArray = [ tween, null ];\r\n\r\n var callbacks = Tween.TYPES;\r\n\r\n for (var i = 0; i < callbacks.length; i++)\r\n {\r\n var type = callbacks[i];\r\n\r\n var callback = GetValue(config, type, false);\r\n\r\n if (callback)\r\n {\r\n var callbackScope = GetValue(config, type + 'Scope', scope);\r\n var callbackParams = GetValue(config, type + 'Params', []);\r\n\r\n // The null is reset to be the Tween target\r\n tween.setCallback(type, callback, tweenArray.concat(callbackParams), callbackScope);\r\n }\r\n }\r\n\r\n return tween;\r\n};\r\n\r\nmodule.exports = TweenBuilder;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/builders/TweenBuilder.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/builders/index.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/tweens/builders/index.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Tweens.Builders\r\n */\r\n\r\nmodule.exports = {\r\n\r\n GetBoolean: __webpack_require__(/*! ./GetBoolean */ \"./node_modules/phaser/src/tweens/builders/GetBoolean.js\"),\r\n GetEaseFunction: __webpack_require__(/*! ./GetEaseFunction */ \"./node_modules/phaser/src/tweens/builders/GetEaseFunction.js\"),\r\n GetNewValue: __webpack_require__(/*! ./GetNewValue */ \"./node_modules/phaser/src/tweens/builders/GetNewValue.js\"),\r\n GetProps: __webpack_require__(/*! ./GetProps */ \"./node_modules/phaser/src/tweens/builders/GetProps.js\"),\r\n GetTargets: __webpack_require__(/*! ./GetTargets */ \"./node_modules/phaser/src/tweens/builders/GetTargets.js\"),\r\n GetTweens: __webpack_require__(/*! ./GetTweens */ \"./node_modules/phaser/src/tweens/builders/GetTweens.js\"),\r\n GetValueOp: __webpack_require__(/*! ./GetValueOp */ \"./node_modules/phaser/src/tweens/builders/GetValueOp.js\"),\r\n NumberTweenBuilder: __webpack_require__(/*! ./NumberTweenBuilder */ \"./node_modules/phaser/src/tweens/builders/NumberTweenBuilder.js\"),\r\n StaggerBuilder: __webpack_require__(/*! ./StaggerBuilder */ \"./node_modules/phaser/src/tweens/builders/StaggerBuilder.js\"),\r\n TimelineBuilder: __webpack_require__(/*! ./TimelineBuilder */ \"./node_modules/phaser/src/tweens/builders/TimelineBuilder.js\"),\r\n TweenBuilder: __webpack_require__(/*! ./TweenBuilder */ \"./node_modules/phaser/src/tweens/builders/TweenBuilder.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/builders/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/events/TIMELINE_COMPLETE_EVENT.js": /*!**************************************************************************!*\ !*** ./node_modules/phaser/src/tweens/events/TIMELINE_COMPLETE_EVENT.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Timeline Complete Event.\r\n * \r\n * This event is dispatched by a Tween Timeline when it completes playback.\r\n * \r\n * Listen to it from a Timeline instance using `Timeline.on('complete', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var timeline = this.tweens.timeline({\r\n * targets: image,\r\n * ease: 'Power1',\r\n * duration: 3000,\r\n * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]\r\n * });\r\n * timeline.on('complete', listener);\r\n * timeline.play();\r\n * ```\r\n *\r\n * @event Phaser.Tweens.Events#TIMELINE_COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event.\r\n */\r\nmodule.exports = 'complete';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/events/TIMELINE_COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/events/TIMELINE_LOOP_EVENT.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/tweens/events/TIMELINE_LOOP_EVENT.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Timeline Loop Event.\r\n * \r\n * This event is dispatched by a Tween Timeline every time it loops.\r\n * \r\n * Listen to it from a Timeline instance using `Timeline.on('loop', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var timeline = this.tweens.timeline({\r\n * targets: image,\r\n * ease: 'Power1',\r\n * duration: 3000,\r\n * loop: 4,\r\n * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]\r\n * });\r\n * timeline.on('loop', listener);\r\n * timeline.play();\r\n * ```\r\n *\r\n * @event Phaser.Tweens.Events#TIMELINE_LOOP\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event.\r\n */\r\nmodule.exports = 'loop';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/events/TIMELINE_LOOP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/events/TIMELINE_PAUSE_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/tweens/events/TIMELINE_PAUSE_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Timeline Pause Event.\r\n * \r\n * This event is dispatched by a Tween Timeline when it is paused.\r\n * \r\n * Listen to it from a Timeline instance using `Timeline.on('pause', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var timeline = this.tweens.timeline({\r\n * targets: image,\r\n * ease: 'Power1',\r\n * duration: 3000,\r\n * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]\r\n * });\r\n * timeline.on('pause', listener);\r\n * // At some point later ...\r\n * timeline.pause();\r\n * ```\r\n *\r\n * @event Phaser.Tweens.Events#TIMELINE_PAUSE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event.\r\n */\r\nmodule.exports = 'pause';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/events/TIMELINE_PAUSE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/events/TIMELINE_RESUME_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/tweens/events/TIMELINE_RESUME_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Timeline Resume Event.\r\n * \r\n * This event is dispatched by a Tween Timeline when it is resumed from a paused state.\r\n * \r\n * Listen to it from a Timeline instance using `Timeline.on('resume', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var timeline = this.tweens.timeline({\r\n * targets: image,\r\n * ease: 'Power1',\r\n * duration: 3000,\r\n * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]\r\n * });\r\n * timeline.on('resume', listener);\r\n * // At some point later ...\r\n * timeline.resume();\r\n * ```\r\n *\r\n * @event Phaser.Tweens.Events#TIMELINE_RESUME\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event.\r\n */\r\nmodule.exports = 'resume';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/events/TIMELINE_RESUME_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/events/TIMELINE_START_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/tweens/events/TIMELINE_START_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Timeline Start Event.\r\n * \r\n * This event is dispatched by a Tween Timeline when it starts.\r\n * \r\n * Listen to it from a Timeline instance using `Timeline.on('start', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var timeline = this.tweens.timeline({\r\n * targets: image,\r\n * ease: 'Power1',\r\n * duration: 3000,\r\n * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]\r\n * });\r\n * timeline.on('start', listener);\r\n * timeline.play();\r\n * ```\r\n *\r\n * @event Phaser.Tweens.Events#TIMELINE_START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event.\r\n */\r\nmodule.exports = 'start';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/events/TIMELINE_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/events/TIMELINE_UPDATE_EVENT.js": /*!************************************************************************!*\ !*** ./node_modules/phaser/src/tweens/events/TIMELINE_UPDATE_EVENT.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Timeline Update Event.\r\n * \r\n * This event is dispatched by a Tween Timeline every time it updates, which can happen a lot of times per second,\r\n * so be careful about listening to this event unless you absolutely require it.\r\n * \r\n * Listen to it from a Timeline instance using `Timeline.on('update', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var timeline = this.tweens.timeline({\r\n * targets: image,\r\n * ease: 'Power1',\r\n * duration: 3000,\r\n * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]\r\n * });\r\n * timeline.on('update', listener);\r\n * timeline.play();\r\n * ```\r\n *\r\n * @event Phaser.Tweens.Events#TIMELINE_UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event.\r\n */\r\nmodule.exports = 'update';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/events/TIMELINE_UPDATE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/events/TWEEN_ACTIVE_EVENT.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/tweens/events/TWEEN_ACTIVE_EVENT.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Tween Active Event.\r\n * \r\n * This event is dispatched by a Tween when it becomes active within the Tween Manager.\r\n * \r\n * An 'active' Tween is one that is now progressing, although it may not yet be updating\r\n * any target properties, due to settings such as `delay`. If you need an event for when\r\n * the Tween starts actually updating its first property, see `TWEEN_START`.\r\n * \r\n * Listen to it from a Tween instance using `Tween.on('active', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var tween = this.tweens.add({\r\n * targets: image,\r\n * x: 500,\r\n * ease: 'Power1',\r\n * duration: 3000\r\n * });\r\n * tween.on('active', listener);\r\n * ```\r\n *\r\n * @event Phaser.Tweens.Events#TWEEN_ACTIVE\r\n * @since 3.19.0\r\n * \r\n * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event.\r\n * @param {any[]} targets - An array of references to the target/s the Tween is operating on.\r\n */\r\nmodule.exports = 'active';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/events/TWEEN_ACTIVE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/events/TWEEN_COMPLETE_EVENT.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/tweens/events/TWEEN_COMPLETE_EVENT.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Tween Complete Event.\r\n * \r\n * This event is dispatched by a Tween when it completes playback entirely, factoring in repeats and loops.\r\n * \r\n * If the Tween has been set to loop or repeat infinitely, this event will not be dispatched\r\n * unless the `Tween.stop` method is called.\r\n * \r\n * If a Tween has a `completeDelay` set, this event will fire after that delay expires.\r\n * \r\n * Listen to it from a Tween instance using `Tween.on('complete', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var tween = this.tweens.add({\r\n * targets: image,\r\n * x: 500,\r\n * ease: 'Power1',\r\n * duration: 3000\r\n * });\r\n * tween.on('complete', listener);\r\n * ```\r\n *\r\n * @event Phaser.Tweens.Events#TWEEN_COMPLETE\r\n * @since 3.19.0\r\n * \r\n * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event.\r\n * @param {any[]} targets - An array of references to the target/s the Tween is operating on.\r\n */\r\nmodule.exports = 'complete';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/events/TWEEN_COMPLETE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/events/TWEEN_LOOP_EVENT.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/tweens/events/TWEEN_LOOP_EVENT.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Tween Loop Event.\r\n * \r\n * This event is dispatched by a Tween when it loops.\r\n * \r\n * This event will only be dispatched if the Tween has a loop count set.\r\n * \r\n * If a Tween has a `loopDelay` set, this event will fire after that delay expires.\r\n * \r\n * The difference between `loop` and `repeat` is that `repeat` is a property setting,\r\n * where-as `loop` applies to the entire Tween.\r\n * \r\n * Listen to it from a Tween instance using `Tween.on('loop', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var tween = this.tweens.add({\r\n * targets: image,\r\n * x: 500,\r\n * ease: 'Power1',\r\n * duration: 3000,\r\n * loop: 6\r\n * });\r\n * tween.on('loop', listener);\r\n * ```\r\n *\r\n * @event Phaser.Tweens.Events#TWEEN_LOOP\r\n * @since 3.19.0\r\n * \r\n * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event.\r\n * @param {any[]} targets - An array of references to the target/s the Tween is operating on.\r\n */\r\nmodule.exports = 'loop';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/events/TWEEN_LOOP_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/events/TWEEN_REPEAT_EVENT.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/tweens/events/TWEEN_REPEAT_EVENT.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Tween Repeat Event.\r\n * \r\n * This event is dispatched by a Tween when one of the properties it is tweening repeats.\r\n * \r\n * This event will only be dispatched if the Tween has a property with a repeat count set.\r\n * \r\n * If a Tween has a `repeatDelay` set, this event will fire after that delay expires.\r\n * \r\n * The difference between `loop` and `repeat` is that `repeat` is a property setting,\r\n * where-as `loop` applies to the entire Tween.\r\n * \r\n * Listen to it from a Tween instance using `Tween.on('repeat', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var tween = this.tweens.add({\r\n * targets: image,\r\n * x: 500,\r\n * ease: 'Power1',\r\n * duration: 3000,\r\n * repeat: 4\r\n * });\r\n * tween.on('repeat', listener);\r\n * ```\r\n *\r\n * @event Phaser.Tweens.Events#TWEEN_REPEAT\r\n * @since 3.19.0\r\n * \r\n * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event.\r\n * @param {string} key - The key of the property that just repeated.\r\n * @param {any} target - The target that the property just repeated on.\r\n */\r\nmodule.exports = 'repeat';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/events/TWEEN_REPEAT_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/events/TWEEN_START_EVENT.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/tweens/events/TWEEN_START_EVENT.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Tween Start Event.\r\n * \r\n * This event is dispatched by a Tween when it starts tweening its first property.\r\n * \r\n * A Tween will only emit this event once, as it can only start once.\r\n * \r\n * If a Tween has a `delay` set, this event will fire after that delay expires.\r\n * \r\n * Listen to it from a Tween instance using `Tween.on('start', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var tween = this.tweens.add({\r\n * targets: image,\r\n * x: 500,\r\n * ease: 'Power1',\r\n * duration: 3000\r\n * });\r\n * tween.on('start', listener);\r\n * ```\r\n *\r\n * @event Phaser.Tweens.Events#TWEEN_START\r\n * @since 3.19.0\r\n * \r\n * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event.\r\n * @param {any[]} targets - An array of references to the target/s the Tween is operating on.\r\n */\r\nmodule.exports = 'start';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/events/TWEEN_START_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/events/TWEEN_UPDATE_EVENT.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/tweens/events/TWEEN_UPDATE_EVENT.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Tween Update Event.\r\n * \r\n * This event is dispatched by a Tween every time it updates _any_ of the properties it is tweening.\r\n * \r\n * A Tween that is changing 3 properties of a target will emit this event 3 times per change, once per property.\r\n * \r\n * **Note:** This is a very high frequency event and may be dispatched multiple times, every single frame.\r\n * \r\n * Listen to it from a Tween instance using `Tween.on('update', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var tween = this.tweens.add({\r\n * targets: image,\r\n * x: 500,\r\n * ease: 'Power1',\r\n * duration: 3000,\r\n * });\r\n * tween.on('update', listener);\r\n * ```\r\n *\r\n * @event Phaser.Tweens.Events#TWEEN_UPDATE\r\n * @since 3.19.0\r\n * \r\n * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event.\r\n * @param {string} key - The property that was updated, i.e. `x` or `scale`.\r\n * @param {any} target - The target object that was updated. Usually a Game Object, but can be of any type.\r\n * @param {number} current - The current value of the property that was tweened.\r\n * @param {number} previous - The previous value of the property that was tweened, prior to this update.\r\n */\r\nmodule.exports = 'update';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/events/TWEEN_UPDATE_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/events/TWEEN_YOYO_EVENT.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/tweens/events/TWEEN_YOYO_EVENT.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Tween Yoyo Event.\r\n * \r\n * This event is dispatched by a Tween whenever a property it is tweening yoyos.\r\n * \r\n * This event will only be dispatched if the Tween has a property with `yoyo` set.\r\n * \r\n * If the Tween has a `hold` value, this event is dispatched when the hold expires.\r\n * \r\n * This event is dispatched for every property, and for every target, that yoyos.\r\n * For example, if a Tween was updating 2 properties and had 10 targets, this event\r\n * would be dispatched 20 times (twice per target). So be careful how you use it!\r\n * \r\n * Listen to it from a Tween instance using `Tween.on('yoyo', listener)`, i.e.:\r\n * \r\n * ```javascript\r\n * var tween = this.tweens.add({\r\n * targets: image,\r\n * x: 500,\r\n * ease: 'Power1',\r\n * duration: 3000,\r\n * yoyo: true\r\n * });\r\n * tween.on('yoyo', listener);\r\n * ```\r\n *\r\n * @event Phaser.Tweens.Events#TWEEN_YOYO\r\n * @since 3.19.0\r\n * \r\n * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event.\r\n * @param {string} key - The property that yoyo'd, i.e. `x` or `scale`.\r\n * @param {any} target - The target object that was yoyo'd. Usually a Game Object, but can be of any type.\r\n */\r\nmodule.exports = 'yoyo';\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/events/TWEEN_YOYO_EVENT.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/events/index.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/tweens/events/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Tweens.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n TIMELINE_COMPLETE: __webpack_require__(/*! ./TIMELINE_COMPLETE_EVENT */ \"./node_modules/phaser/src/tweens/events/TIMELINE_COMPLETE_EVENT.js\"),\r\n TIMELINE_LOOP: __webpack_require__(/*! ./TIMELINE_LOOP_EVENT */ \"./node_modules/phaser/src/tweens/events/TIMELINE_LOOP_EVENT.js\"),\r\n TIMELINE_PAUSE: __webpack_require__(/*! ./TIMELINE_PAUSE_EVENT */ \"./node_modules/phaser/src/tweens/events/TIMELINE_PAUSE_EVENT.js\"),\r\n TIMELINE_RESUME: __webpack_require__(/*! ./TIMELINE_RESUME_EVENT */ \"./node_modules/phaser/src/tweens/events/TIMELINE_RESUME_EVENT.js\"),\r\n TIMELINE_START: __webpack_require__(/*! ./TIMELINE_START_EVENT */ \"./node_modules/phaser/src/tweens/events/TIMELINE_START_EVENT.js\"),\r\n TIMELINE_UPDATE: __webpack_require__(/*! ./TIMELINE_UPDATE_EVENT */ \"./node_modules/phaser/src/tweens/events/TIMELINE_UPDATE_EVENT.js\"),\r\n TWEEN_ACTIVE: __webpack_require__(/*! ./TWEEN_ACTIVE_EVENT */ \"./node_modules/phaser/src/tweens/events/TWEEN_ACTIVE_EVENT.js\"),\r\n TWEEN_COMPLETE: __webpack_require__(/*! ./TWEEN_COMPLETE_EVENT */ \"./node_modules/phaser/src/tweens/events/TWEEN_COMPLETE_EVENT.js\"),\r\n TWEEN_LOOP: __webpack_require__(/*! ./TWEEN_LOOP_EVENT */ \"./node_modules/phaser/src/tweens/events/TWEEN_LOOP_EVENT.js\"),\r\n TWEEN_REPEAT: __webpack_require__(/*! ./TWEEN_REPEAT_EVENT */ \"./node_modules/phaser/src/tweens/events/TWEEN_REPEAT_EVENT.js\"),\r\n TWEEN_START: __webpack_require__(/*! ./TWEEN_START_EVENT */ \"./node_modules/phaser/src/tweens/events/TWEEN_START_EVENT.js\"),\r\n TWEEN_UPDATE: __webpack_require__(/*! ./TWEEN_UPDATE_EVENT */ \"./node_modules/phaser/src/tweens/events/TWEEN_UPDATE_EVENT.js\"),\r\n TWEEN_YOYO: __webpack_require__(/*! ./TWEEN_YOYO_EVENT */ \"./node_modules/phaser/src/tweens/events/TWEEN_YOYO_EVENT.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/events/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/index.js": /*!*************************************************!*\ !*** ./node_modules/phaser/src/tweens/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = __webpack_require__(/*! ./tween/const */ \"./node_modules/phaser/src/tweens/tween/const.js\");\r\nvar Extend = __webpack_require__(/*! ../utils/object/Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\");\r\n\r\n/**\r\n * @namespace Phaser.Tweens\r\n */\r\n\r\nvar Tweens = {\r\n\r\n Builders: __webpack_require__(/*! ./builders */ \"./node_modules/phaser/src/tweens/builders/index.js\"),\r\n Events: __webpack_require__(/*! ./events */ \"./node_modules/phaser/src/tweens/events/index.js\"),\r\n\r\n TweenManager: __webpack_require__(/*! ./TweenManager */ \"./node_modules/phaser/src/tweens/TweenManager.js\"),\r\n Tween: __webpack_require__(/*! ./tween/Tween */ \"./node_modules/phaser/src/tweens/tween/Tween.js\"),\r\n TweenData: __webpack_require__(/*! ./tween/TweenData */ \"./node_modules/phaser/src/tweens/tween/TweenData.js\"),\r\n Timeline: __webpack_require__(/*! ./Timeline */ \"./node_modules/phaser/src/tweens/Timeline.js\")\r\n\r\n};\r\n\r\n// Merge in the consts\r\nTweens = Extend(false, Tweens, CONST);\r\n\r\nmodule.exports = Tweens;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/tween/Defaults.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/tweens/tween/Defaults.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @typedef {object} Phaser.Types.Tweens.TweenConfigDefaults\r\n * @since 3.0.0\r\n * \r\n * @property {(object|object[])} targets - The object, or an array of objects, to run the tween on.\r\n * @property {number} [delay=0] - The number of milliseconds to delay before the tween will start.\r\n * @property {number} [duration=1000] - The duration of the tween in milliseconds.\r\n * @property {string} [ease='Power0'] - The easing equation to use for the tween.\r\n * @property {array} [easeParams] - Optional easing parameters.\r\n * @property {number} [hold=0] - The number of milliseconds to hold the tween for before yoyo'ing.\r\n * @property {number} [repeat=0] - The number of times to repeat the tween.\r\n * @property {number} [repeatDelay=0] - The number of milliseconds to pause before a tween will repeat.\r\n * @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.\r\n * @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.\r\n * @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.\r\n */\r\n\r\nvar TWEEN_DEFAULTS = {\r\n targets: null,\r\n delay: 0,\r\n duration: 1000,\r\n ease: 'Power0',\r\n easeParams: null,\r\n hold: 0,\r\n repeat: 0,\r\n repeatDelay: 0,\r\n yoyo: false,\r\n flipX: false,\r\n flipY: false\r\n};\r\n\r\nmodule.exports = TWEEN_DEFAULTS;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/tween/Defaults.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/tween/ReservedProps.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/tweens/tween/ReservedProps.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// RESERVED properties that a Tween config object uses\r\n\r\n// completeDelay: The time the tween will wait before the onComplete event is dispatched once it has completed\r\n// delay: The time the tween will wait before it first starts\r\n// duration: The duration of the tween\r\n// ease: The ease function used by the tween\r\n// easeParams: The parameters to go with the ease function (if any)\r\n// flipX: flip X the GameObject on tween end\r\n// flipY: flip Y the GameObject on tween end// hold: The time the tween will pause before running a yoyo\r\n// hold: The time the tween will pause before running a yoyo\r\n// loop: The time the tween will pause before starting either a yoyo or returning to the start for a repeat\r\n// loopDelay: \r\n// offset: Used when the Tween is part of a Timeline\r\n// paused: Does the tween start in a paused state, or playing?\r\n// props: The properties being tweened by the tween\r\n// repeat: The number of times the tween will repeat itself (a value of 1 means the tween will play twice, as it repeated once)\r\n// repeatDelay: The time the tween will pause for before starting a repeat. The tween holds in the start state.\r\n// targets: The targets the tween is updating.\r\n// useFrames: Use frames or milliseconds?\r\n// yoyo: boolean - Does the tween reverse itself (yoyo) when it reaches the end?\r\n\r\nmodule.exports = [\r\n 'callbackScope',\r\n 'completeDelay',\r\n 'delay',\r\n 'duration',\r\n 'ease',\r\n 'easeParams',\r\n 'flipX',\r\n 'flipY',\r\n 'hold',\r\n 'loop',\r\n 'loopDelay',\r\n 'offset',\r\n 'onActive',\r\n 'onActiveParams',\r\n 'onActiveScope',\r\n 'onComplete',\r\n 'onCompleteParams',\r\n 'onCompleteScope',\r\n 'onLoop',\r\n 'onLoopParams',\r\n 'onLoopScope',\r\n 'onRepeat',\r\n 'onRepeatParams',\r\n 'onRepeatScope',\r\n 'onStart',\r\n 'onStartParams',\r\n 'onStartScope',\r\n 'onUpdate',\r\n 'onUpdateParams',\r\n 'onUpdateScope',\r\n 'onYoyo',\r\n 'onYoyoParams',\r\n 'onYoyoScope',\r\n 'paused',\r\n 'props',\r\n 'repeat',\r\n 'repeatDelay',\r\n 'targets',\r\n 'useFrames',\r\n 'yoyo'\r\n];\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/tween/ReservedProps.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/tween/Tween.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/tweens/tween/Tween.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = __webpack_require__(/*! ../../utils/Class */ \"./node_modules/phaser/src/utils/Class.js\");\r\nvar EventEmitter = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\r\nvar Events = __webpack_require__(/*! ../events */ \"./node_modules/phaser/src/tweens/events/index.js\");\r\nvar GameObjectCreator = __webpack_require__(/*! ../../gameobjects/GameObjectCreator */ \"./node_modules/phaser/src/gameobjects/GameObjectCreator.js\");\r\nvar GameObjectFactory = __webpack_require__(/*! ../../gameobjects/GameObjectFactory */ \"./node_modules/phaser/src/gameobjects/GameObjectFactory.js\");\r\nvar TWEEN_CONST = __webpack_require__(/*! ./const */ \"./node_modules/phaser/src/tweens/tween/const.js\");\r\nvar MATH_CONST = __webpack_require__(/*! ../../math/const */ \"./node_modules/phaser/src/math/const.js\");\r\n\r\n/**\r\n * @classdesc\r\n * A Tween is able to manipulate the properties of one or more objects to any given value, based\r\n * on a duration and type of ease. They are rarely instantiated directly and instead should be\r\n * created via the TweenManager.\r\n *\r\n * @class Tween\r\n * @memberof Phaser.Tweens\r\n * @extends Phaser.Events.EventEmitter\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - A reference to the parent of this Tween. Either the Tween Manager or a Tween Timeline instance.\r\n * @param {Phaser.Types.Tweens.TweenDataConfig[]} data - An array of TweenData objects, each containing a unique property to be tweened.\r\n * @param {array} targets - An array of targets to be tweened.\r\n */\r\nvar Tween = new Class({\r\n\r\n Extends: EventEmitter,\r\n\r\n initialize:\r\n\r\n function Tween (parent, data, targets)\r\n {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * A reference to the parent of this Tween.\r\n * Either the Tween Manager or a Tween Timeline instance.\r\n *\r\n * @name Phaser.Tweens.Tween#parent\r\n * @type {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)}\r\n * @since 3.0.0\r\n */\r\n this.parent = parent;\r\n\r\n /**\r\n * Is the parent of this Tween a Timeline?\r\n *\r\n * @name Phaser.Tweens.Tween#parentIsTimeline\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n this.parentIsTimeline = parent.hasOwnProperty('isTimeline');\r\n\r\n /**\r\n * An array of TweenData objects, each containing a unique property and target being tweened.\r\n *\r\n * @name Phaser.Tweens.Tween#data\r\n * @type {Phaser.Types.Tweens.TweenDataConfig[]}\r\n * @since 3.0.0\r\n */\r\n this.data = data;\r\n\r\n /**\r\n * The cached length of the data array.\r\n *\r\n * @name Phaser.Tweens.Tween#totalData\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.totalData = data.length;\r\n\r\n /**\r\n * An array of references to the target/s this Tween is operating on.\r\n *\r\n * @name Phaser.Tweens.Tween#targets\r\n * @type {object[]}\r\n * @since 3.0.0\r\n */\r\n this.targets = targets;\r\n\r\n /**\r\n * Cached target total (not necessarily the same as the data total)\r\n *\r\n * @name Phaser.Tweens.Tween#totalTargets\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.totalTargets = targets.length;\r\n\r\n /**\r\n * If `true` then duration, delay, etc values are all frame totals.\r\n *\r\n * @name Phaser.Tweens.Tween#useFrames\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.useFrames = false;\r\n\r\n /**\r\n * Scales the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on.\r\n * Value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only.\r\n *\r\n * @name Phaser.Tweens.Tween#timeScale\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.timeScale = 1;\r\n\r\n /**\r\n * Loop this tween? Can be -1 for an infinite loop, or an integer.\r\n * When enabled it will play through ALL TweenDatas again. Use TweenData.repeat to loop a single element.\r\n *\r\n * @name Phaser.Tweens.Tween#loop\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.loop = 0;\r\n\r\n /**\r\n * Time in ms/frames before the tween loops.\r\n *\r\n * @name Phaser.Tweens.Tween#loopDelay\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.loopDelay = 0;\r\n\r\n /**\r\n * How many loops are left to run?\r\n *\r\n * @name Phaser.Tweens.Tween#loopCounter\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.loopCounter = 0;\r\n\r\n /**\r\n * Time in ms/frames before the 'onStart' event fires.\r\n * This is the shortest `delay` value across all of the TweenDatas of this Tween.\r\n *\r\n * @name Phaser.Tweens.Tween#startDelay\r\n * @type {number}\r\n * @default 0\r\n * @since 3.19.0\r\n */\r\n this.startDelay = 0;\r\n\r\n /**\r\n * Has this Tween started playback yet?\r\n * This boolean is toggled when the Tween leaves the 'delayed' state and starts running.\r\n *\r\n * @name Phaser.Tweens.Tween#hasStarted\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.hasStarted = false;\r\n\r\n /**\r\n * Is this Tween currently seeking?\r\n * This boolean is toggled in the `Tween.seek` method.\r\n * When a tween is seeking it will not dispatch any events or callbacks.\r\n *\r\n * @name Phaser.Tweens.Tween#isSeeking\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.isSeeking = false;\r\n\r\n /**\r\n * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = -1 (as it never completes)\r\n *\r\n * @name Phaser.Tweens.Tween#completeDelay\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.completeDelay = 0;\r\n\r\n /**\r\n * Countdown timer (used by timeline offset, loopDelay and completeDelay)\r\n *\r\n * @name Phaser.Tweens.Tween#countdown\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.countdown = 0;\r\n\r\n /**\r\n * Set only if this Tween is part of a Timeline.\r\n *\r\n * @name Phaser.Tweens.Tween#offset\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.offset = 0;\r\n\r\n /**\r\n * Set only if this Tween is part of a Timeline. The calculated offset amount.\r\n *\r\n * @name Phaser.Tweens.Tween#calculatedOffset\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.calculatedOffset = 0;\r\n\r\n /**\r\n * The current state of the tween\r\n *\r\n * @name Phaser.Tweens.Tween#state\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n this.state = TWEEN_CONST.PENDING_ADD;\r\n\r\n /**\r\n * The state of the tween when it was paused (used by Resume)\r\n *\r\n * @name Phaser.Tweens.Tween#_pausedState\r\n * @type {integer}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this._pausedState = TWEEN_CONST.INIT;\r\n\r\n /**\r\n * Does the Tween start off paused? (if so it needs to be started with Tween.play)\r\n *\r\n * @name Phaser.Tweens.Tween#paused\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this.paused = false;\r\n\r\n /**\r\n * Elapsed time in ms/frames of this run through the Tween.\r\n *\r\n * @name Phaser.Tweens.Tween#elapsed\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.elapsed = 0;\r\n\r\n /**\r\n * Total elapsed time in ms/frames of the entire Tween, including looping.\r\n *\r\n * @name Phaser.Tweens.Tween#totalElapsed\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.totalElapsed = 0;\r\n\r\n /**\r\n * Time in ms/frames for the whole Tween to play through once, excluding loop amounts and loop delays.\r\n *\r\n * @name Phaser.Tweens.Tween#duration\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.duration = 0;\r\n\r\n /**\r\n * Value between 0 and 1. The amount through the Tween, excluding loops.\r\n *\r\n * @name Phaser.Tweens.Tween#progress\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.progress = 0;\r\n\r\n /**\r\n * Time in ms/frames for the Tween to complete (including looping)\r\n *\r\n * @name Phaser.Tweens.Tween#totalDuration\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.totalDuration = 0;\r\n\r\n /**\r\n * Value between 0 and 1. The amount through the entire Tween, including looping.\r\n *\r\n * @name Phaser.Tweens.Tween#totalProgress\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.totalProgress = 0;\r\n\r\n /**\r\n * An object containing the different Tween callback functions.\r\n * \r\n * You can either set these in the Tween config, or by calling the `Tween.setCallback` method.\r\n * \r\n * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused.\r\n * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay.\r\n * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set.\r\n * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set.\r\n * `onComplete` When the Tween finishes playback fully or `Tween.stop` is called. Never invoked if tween is set to repeat infinitely.\r\n * `onUpdate` When a TweenData updates a property on a source target during playback.\r\n * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set.\r\n *\r\n * @name Phaser.Tweens.Tween#callbacks\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.callbacks = {\r\n onActive: null,\r\n onComplete: null,\r\n onLoop: null,\r\n onRepeat: null,\r\n onStart: null,\r\n onUpdate: null,\r\n onYoyo: null\r\n };\r\n\r\n /**\r\n * The context in which all callbacks are invoked.\r\n *\r\n * @name Phaser.Tweens.Tween#callbackScope\r\n * @type {any}\r\n * @since 3.0.0\r\n */\r\n this.callbackScope;\r\n },\r\n\r\n /**\t\r\n * Returns the current value of the specified Tween Data.\r\n *\r\n * @method Phaser.Tweens.Tween#getValue\r\n * @since 3.0.0\r\n * \r\n * @param {integer} [index=0] - The Tween Data to return the value from.\r\n *\r\n * @return {number} The value of the requested Tween Data.\r\n */\t\r\n getValue: function (index)\r\n {\r\n if (index === undefined) { index = 0; }\r\n\r\n return this.data[index].current;\r\n },\r\n\r\n /**\r\n * Set the scale the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on.\r\n *\r\n * @method Phaser.Tweens.Tween#setTimeScale\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The scale factor for timescale.\r\n *\r\n * @return {this} - This Tween instance.\r\n */\r\n setTimeScale: function (value)\r\n {\r\n this.timeScale = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns the scale of the time applied to this Tween.\r\n *\r\n * @method Phaser.Tweens.Tween#getTimeScale\r\n * @since 3.0.0\r\n *\r\n * @return {number} The timescale of this tween (between 0 and 1)\r\n */\r\n getTimeScale: function ()\r\n {\r\n return this.timeScale;\r\n },\r\n\r\n /**\r\n * Checks if the Tween is currently active.\r\n *\r\n * @method Phaser.Tweens.Tween#isPlaying\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the Tween is active, otherwise `false`.\r\n */\r\n isPlaying: function ()\r\n {\r\n return (this.state === TWEEN_CONST.ACTIVE);\r\n },\r\n\r\n /**\r\n * Checks if the Tween is currently paused.\r\n *\r\n * @method Phaser.Tweens.Tween#isPaused\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the Tween is paused, otherwise `false`.\r\n */\r\n isPaused: function ()\r\n {\r\n return (this.state === TWEEN_CONST.PAUSED);\r\n },\r\n\r\n /**\r\n * See if this Tween is currently acting upon the given target.\r\n *\r\n * @method Phaser.Tweens.Tween#hasTarget\r\n * @since 3.0.0\r\n *\r\n * @param {object} target - The target to check against this Tween.\r\n *\r\n * @return {boolean} `true` if the given target is a target of this Tween, otherwise `false`.\r\n */\r\n hasTarget: function (target)\r\n {\r\n return (this.targets.indexOf(target) !== -1);\r\n },\r\n\r\n /**\r\n * Updates the 'end' value of the given property across all matching targets.\r\n * \r\n * Calling this does not adjust the duration of the tween, or the current progress.\r\n * \r\n * You can optionally tell it to set the 'start' value to be the current value (before the change).\r\n *\r\n * @method Phaser.Tweens.Tween#updateTo\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The property to set the new value for.\r\n * @param {*} value - The new value of the property.\r\n * @param {boolean} [startToCurrent=false] - Should this change set the start value to be the current value?\r\n *\r\n * @return {this} - This Tween instance.\r\n */\r\n updateTo: function (key, value, startToCurrent)\r\n {\r\n if (startToCurrent === undefined) { startToCurrent = false; }\r\n\r\n for (var i = 0; i < this.totalData; i++)\r\n {\r\n var tweenData = this.data[i];\r\n\r\n if (tweenData.key === key)\r\n {\r\n tweenData.end = value;\r\n\r\n if (startToCurrent)\r\n {\r\n tweenData.start = tweenData.current;\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Restarts the tween from the beginning.\r\n *\r\n * @method Phaser.Tweens.Tween#restart\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Tween instance.\r\n */\r\n restart: function ()\r\n {\r\n // Reset these so they're ready for the next update\r\n this.elapsed = 0;\r\n this.progress = 0;\r\n this.totalElapsed = 0;\r\n this.totalProgress = 0;\r\n\r\n if (this.state === TWEEN_CONST.ACTIVE)\r\n {\r\n return this.seek(0);\r\n }\r\n else if (this.state === TWEEN_CONST.REMOVED)\r\n {\r\n this.seek(0);\r\n this.parent.makeActive(this);\r\n\r\n return this;\r\n }\r\n else if (this.state === TWEEN_CONST.PENDING_ADD)\r\n {\r\n return this;\r\n }\r\n else\r\n {\r\n return this.play();\r\n }\r\n },\r\n\r\n /**\r\n * Internal method that calculates the overall duration of the Tween.\r\n *\r\n * @method Phaser.Tweens.Tween#calcDuration\r\n * @since 3.0.0\r\n */\r\n calcDuration: function ()\r\n {\r\n var maxDuration = 0;\r\n var minDelay = MATH_CONST.MAX_SAFE_INTEGER;\r\n\r\n var data = this.data;\r\n\r\n for (var i = 0; i < this.totalData; i++)\r\n {\r\n var tweenData = data[i];\r\n\r\n // Set t1 (duration + hold + yoyo)\r\n tweenData.t1 = tweenData.duration + tweenData.hold;\r\n\r\n if (tweenData.yoyo)\r\n {\r\n tweenData.t1 += tweenData.duration;\r\n }\r\n\r\n // Set t2 (repeatDelay + duration + hold + yoyo)\r\n tweenData.t2 = tweenData.t1 + tweenData.repeatDelay;\r\n\r\n // Total Duration\r\n tweenData.totalDuration = tweenData.delay + tweenData.t1;\r\n\r\n if (tweenData.repeat === -1)\r\n {\r\n tweenData.totalDuration += (tweenData.t2 * 999999999999);\r\n }\r\n else if (tweenData.repeat > 0)\r\n {\r\n tweenData.totalDuration += (tweenData.t2 * tweenData.repeat);\r\n }\r\n\r\n if (tweenData.totalDuration > maxDuration)\r\n {\r\n // Get the longest TweenData from the Tween, used to calculate the Tween TD\r\n maxDuration = tweenData.totalDuration;\r\n }\r\n\r\n if (tweenData.delay < minDelay)\r\n {\r\n minDelay = tweenData.delay;\r\n }\r\n }\r\n\r\n // Excludes loop values\r\n\r\n // If duration has been set to 0 then we give it a super-low value so that it always\r\n // renders at least 1 frame, but no more, without causing divided by zero errors elsewhere.\r\n this.duration = Math.max(maxDuration, 0.001);\r\n\r\n this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop;\r\n\r\n if (this.loopCounter > 0)\r\n {\r\n this.totalDuration = this.duration + this.completeDelay + ((this.duration + this.loopDelay) * this.loopCounter);\r\n }\r\n else\r\n {\r\n this.totalDuration = this.duration + this.completeDelay;\r\n }\r\n\r\n // How long before this Tween starts playback?\r\n this.startDelay = minDelay;\r\n },\r\n\r\n /**\r\n * Called by TweenManager.preUpdate as part of its loop to check pending and active tweens.\r\n * Should not be called directly.\r\n *\r\n * @method Phaser.Tweens.Tween#init\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} Returns `true` if this Tween should be moved from the pending list to the active list by the Tween Manager.\r\n */\r\n init: function ()\r\n {\r\n // You can't have a paused Tween if it's part of a Timeline\r\n if (this.paused && !this.parentIsTimeline)\r\n {\r\n this.state = TWEEN_CONST.PENDING_ADD;\r\n this._pausedState = TWEEN_CONST.INIT;\r\n\r\n return false;\r\n }\r\n\r\n var data = this.data;\r\n var totalTargets = this.totalTargets;\r\n\r\n for (var i = 0; i < this.totalData; i++)\r\n {\r\n var tweenData = data[i];\r\n var target = tweenData.target;\r\n var gen = tweenData.gen;\r\n var key = tweenData.key;\r\n var targetIndex = tweenData.index;\r\n\r\n // Old function signature: i, totalTargets, target\r\n // New function signature: target, key, value, index, total, tween\r\n\r\n tweenData.delay = gen.delay(target, key, 0, targetIndex, totalTargets, this);\r\n tweenData.duration = Math.max(gen.duration(target, key, 0, targetIndex, totalTargets, this), 0.001);\r\n tweenData.hold = gen.hold(target, key, 0, targetIndex, totalTargets, this);\r\n tweenData.repeat = gen.repeat(target, key, 0, targetIndex, totalTargets, this);\r\n tweenData.repeatDelay = gen.repeatDelay(target, key, 0, targetIndex, totalTargets, this);\r\n }\r\n\r\n this.calcDuration();\r\n\r\n this.progress = 0;\r\n this.totalProgress = 0;\r\n this.elapsed = 0;\r\n this.totalElapsed = 0;\r\n\r\n this.state = TWEEN_CONST.INIT;\r\n\r\n return true;\r\n },\r\n\r\n /**\r\n * Internal method that makes this Tween active within the TweenManager\r\n * and emits the onActive event and callback.\r\n *\r\n * @method Phaser.Tweens.Tween#makeActive\r\n * @fires Phaser.Tweens.Events#TWEEN_ACTIVE\r\n * @since 3.19.0\r\n */\r\n makeActive: function ()\r\n {\r\n this.parent.makeActive(this);\r\n\r\n this.dispatchTweenEvent(Events.TWEEN_ACTIVE, this.callbacks.onActive);\r\n },\r\n\r\n /**\r\n * Internal method that advances to the next state of the Tween during playback.\r\n *\r\n * @method Phaser.Tweens.Tween#nextState\r\n * @fires Phaser.Tweens.Events#TWEEN_COMPLETE\r\n * @fires Phaser.Tweens.Events#TWEEN_LOOP\r\n * @since 3.0.0\r\n */\r\n nextState: function ()\r\n {\r\n if (this.loopCounter > 0)\r\n {\r\n this.elapsed = 0;\r\n this.progress = 0;\r\n this.loopCounter--;\r\n\r\n this.resetTweenData(true);\r\n\r\n if (this.loopDelay > 0)\r\n {\r\n this.countdown = this.loopDelay;\r\n this.state = TWEEN_CONST.LOOP_DELAY;\r\n }\r\n else\r\n {\r\n this.state = TWEEN_CONST.ACTIVE;\r\n\r\n this.dispatchTweenEvent(Events.TWEEN_LOOP, this.callbacks.onLoop);\r\n }\r\n }\r\n else if (this.completeDelay > 0)\r\n {\r\n this.state = TWEEN_CONST.COMPLETE_DELAY;\r\n\r\n this.countdown = this.completeDelay;\r\n }\r\n else\r\n {\r\n this.state = TWEEN_CONST.PENDING_REMOVE;\r\n\r\n this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete);\r\n }\r\n },\r\n\r\n /**\r\n * Pauses the Tween immediately. Use `resume` to continue playback.\r\n *\r\n * @method Phaser.Tweens.Tween#pause\r\n * @since 3.0.0\r\n *\r\n * @return {this} - This Tween instance.\r\n */\r\n pause: function ()\r\n {\r\n if (this.state === TWEEN_CONST.PAUSED)\r\n {\r\n return this;\r\n }\r\n\r\n this.paused = true;\r\n\r\n this._pausedState = this.state;\r\n\r\n this.state = TWEEN_CONST.PAUSED;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Starts a Tween playing.\r\n * \r\n * You only need to call this method if you have configured the tween to be paused on creation.\r\n * \r\n * If the Tween is already playing, calling this method again will have no effect. If you wish to\r\n * restart the Tween, use `Tween.restart` instead.\r\n * \r\n * Calling this method after the Tween has completed will start the Tween playing again from the start.\r\n * This is the same as calling `Tween.seek(0)` and then `Tween.play()`.\r\n *\r\n * @method Phaser.Tweens.Tween#play\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} [resetFromTimeline=false] - Is this Tween being played as part of a Timeline?\r\n *\r\n * @return {this} This Tween instance.\r\n */\r\n play: function (resetFromTimeline)\r\n {\r\n if (resetFromTimeline === undefined) { resetFromTimeline = false; }\r\n\r\n var state = this.state;\r\n\r\n if (state === TWEEN_CONST.INIT && !this.parentIsTimeline)\r\n {\r\n this.resetTweenData(false);\r\n\r\n this.state = TWEEN_CONST.ACTIVE;\r\n\r\n return this;\r\n }\r\n else if (state === TWEEN_CONST.ACTIVE || (state === TWEEN_CONST.PENDING_ADD && this._pausedState === TWEEN_CONST.PENDING_ADD))\r\n {\r\n return this;\r\n }\r\n else if (!this.parentIsTimeline && (state === TWEEN_CONST.PENDING_REMOVE || state === TWEEN_CONST.REMOVED))\r\n {\r\n this.seek(0);\r\n this.parent.makeActive(this);\r\n\r\n return this;\r\n }\r\n\r\n if (this.parentIsTimeline)\r\n {\r\n this.resetTweenData(resetFromTimeline);\r\n\r\n if (this.calculatedOffset === 0)\r\n {\r\n this.state = TWEEN_CONST.ACTIVE;\r\n }\r\n else\r\n {\r\n this.countdown = this.calculatedOffset;\r\n\r\n this.state = TWEEN_CONST.OFFSET_DELAY;\r\n }\r\n }\r\n else if (this.paused)\r\n {\r\n this.paused = false;\r\n\r\n this.makeActive();\r\n }\r\n else\r\n {\r\n this.resetTweenData(resetFromTimeline);\r\n\r\n this.state = TWEEN_CONST.ACTIVE;\r\n\r\n this.makeActive();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal method that resets all of the Tween Data, including the progress and elapsed values.\r\n *\r\n * @method Phaser.Tweens.Tween#resetTweenData\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} resetFromLoop - Has this method been called as part of a loop?\r\n */\r\n resetTweenData: function (resetFromLoop)\r\n {\r\n var data = this.data;\r\n var total = this.totalData;\r\n var totalTargets = this.totalTargets;\r\n\r\n for (var i = 0; i < total; i++)\r\n {\r\n var tweenData = data[i];\r\n\r\n var target = tweenData.target;\r\n var key = tweenData.key;\r\n var targetIndex = tweenData.index;\r\n\r\n tweenData.progress = 0;\r\n tweenData.elapsed = 0;\r\n\r\n tweenData.repeatCounter = (tweenData.repeat === -1) ? 999999999999 : tweenData.repeat;\r\n\r\n if (resetFromLoop)\r\n {\r\n tweenData.start = tweenData.getStartValue(target, key, tweenData.start, targetIndex, totalTargets, this);\r\n\r\n tweenData.end = tweenData.getEndValue(target, key, tweenData.end, targetIndex, totalTargets, this);\r\n\r\n tweenData.current = tweenData.start;\r\n\r\n tweenData.state = TWEEN_CONST.PLAYING_FORWARD;\r\n }\r\n else\r\n {\r\n tweenData.state = TWEEN_CONST.PENDING_RENDER;\r\n }\r\n\r\n if (tweenData.delay > 0)\r\n {\r\n tweenData.elapsed = tweenData.delay;\r\n\r\n tweenData.state = TWEEN_CONST.DELAY;\r\n }\r\n\r\n if (tweenData.getActiveValue)\r\n {\r\n target[key] = tweenData.getActiveValue(tweenData.target, tweenData.key, tweenData.start);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Resumes the playback of a previously paused Tween.\r\n *\r\n * @method Phaser.Tweens.Tween#resume\r\n * @since 3.0.0\r\n *\r\n * @return {this} - This Tween instance.\r\n */\r\n resume: function ()\r\n {\r\n if (this.state === TWEEN_CONST.PAUSED)\r\n {\r\n this.paused = false;\r\n\r\n this.state = this._pausedState;\r\n }\r\n else\r\n {\r\n this.play();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Seeks to a specific point in the Tween.\r\n * \r\n * **Note:** You cannot seek a Tween that repeats or loops forever, or that has an unusually long total duration.\r\n * \r\n * The given position is a value between 0 and 1 which represents how far through the Tween to seek to.\r\n * A value of 0.5 would seek to half-way through the Tween, where-as a value of zero would seek to the start.\r\n * \r\n * Note that the seek takes the entire duration of the Tween into account, including delays, loops and repeats.\r\n * For example, a Tween that lasts for 2 seconds, but that loops 3 times, would have a total duration of 6 seconds,\r\n * so seeking to 0.5 would seek to 3 seconds into the Tween, as that's half-way through its _entire_ duration.\r\n * \r\n * Seeking works by resetting the Tween to its initial values and then iterating through the Tween at `delta`\r\n * jumps per step. The longer the Tween, the longer this can take.\r\n *\r\n * @method Phaser.Tweens.Tween#seek\r\n * @since 3.0.0\r\n *\r\n * @param {number} toPosition - A value between 0 and 1 which represents the progress point to seek to.\r\n * @param {number} [delta=16.6] - The size of each step when seeking through the Tween. A higher value completes faster but at a cost of less precision.\r\n *\r\n * @return {this} This Tween instance.\r\n */\r\n seek: function (toPosition, delta)\r\n {\r\n if (delta === undefined) { delta = 16.6; }\r\n\r\n if (this.totalDuration >= 3600000)\r\n {\r\n console.warn('Tween.seek duration too long');\r\n\r\n return this;\r\n }\r\n\r\n if (this.state === TWEEN_CONST.REMOVED)\r\n {\r\n this.makeActive();\r\n }\r\n\r\n this.elapsed = 0;\r\n this.progress = 0;\r\n this.totalElapsed = 0;\r\n this.totalProgress = 0;\r\n\r\n var data = this.data;\r\n var totalTargets = this.totalTargets;\r\n\r\n for (var i = 0; i < this.totalData; i++)\r\n {\r\n var tweenData = data[i];\r\n var target = tweenData.target;\r\n var gen = tweenData.gen;\r\n var key = tweenData.key;\r\n var targetIndex = tweenData.index;\r\n\r\n tweenData.progress = 0;\r\n tweenData.elapsed = 0;\r\n\r\n tweenData.repeatCounter = (tweenData.repeat === -1) ? 999999999999 : tweenData.repeat;\r\n\r\n // Old function signature: i, totalTargets, target\r\n // New function signature: target, key, value, index, total, tween\r\n\r\n tweenData.delay = gen.delay(target, key, 0, targetIndex, totalTargets, this);\r\n tweenData.duration = Math.max(gen.duration(target, key, 0, targetIndex, totalTargets, this), 0.001);\r\n tweenData.hold = gen.hold(target, key, 0, targetIndex, totalTargets, this);\r\n tweenData.repeat = gen.repeat(target, key, 0, targetIndex, totalTargets, this);\r\n tweenData.repeatDelay = gen.repeatDelay(target, key, 0, targetIndex, totalTargets, this);\r\n\r\n tweenData.current = tweenData.start;\r\n tweenData.state = TWEEN_CONST.PLAYING_FORWARD;\r\n\r\n this.updateTweenData(this, tweenData, 0, targetIndex, totalTargets);\r\n\r\n if (tweenData.delay > 0)\r\n {\r\n tweenData.elapsed = tweenData.delay;\r\n tweenData.state = TWEEN_CONST.DELAY;\r\n }\r\n }\r\n\r\n this.calcDuration();\r\n\r\n var wasPaused = false;\r\n\r\n if (this.state === TWEEN_CONST.PAUSED)\r\n {\r\n wasPaused = true;\r\n\r\n this.state = TWEEN_CONST.ACTIVE;\r\n }\r\n\r\n this.isSeeking = true;\r\n\r\n do\r\n {\r\n this.update(0, delta);\r\n\r\n } while (this.totalProgress < toPosition);\r\n\r\n this.isSeeking = false;\r\n\r\n if (wasPaused)\r\n {\r\n this.state = TWEEN_CONST.PAUSED;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets an event based callback to be invoked during playback.\r\n * \r\n * Calling this method will replace a previously set callback for the given type, if any exists.\r\n * \r\n * The types available are:\r\n * \r\n * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused.\r\n * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay.\r\n * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set.\r\n * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set.\r\n * `onComplete` When the Tween finishes playback fully or `Tween.stop` is called. Never invoked if tween is set to repeat infinitely.\r\n * `onUpdate` When a TweenData updates a property on a source target during playback.\r\n * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set.\r\n *\r\n * @method Phaser.Tweens.Tween#setCallback\r\n * @since 3.0.0\r\n *\r\n * @param {string} type - Type of the callback to set.\r\n * @param {function} callback - The function to invoke when this callback happens.\r\n * @param {array} [params] - An array of parameters for specified callbacks types.\r\n * @param {any} [scope] - The context the callback will be invoked in.\r\n *\r\n * @return {this} This Tween instance.\r\n */\r\n setCallback: function (type, callback, params, scope)\r\n {\r\n this.callbacks[type] = { func: callback, scope: scope, params: params };\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Flags the Tween as being complete, whatever stage of progress it is at.\r\n *\r\n * If an onComplete callback has been defined it will automatically invoke it, unless a `delay`\r\n * argument is provided, in which case the Tween will delay for that period of time before calling the callback.\r\n *\r\n * If you don't need a delay, or have an onComplete callback, then call `Tween.stop` instead.\r\n *\r\n * @method Phaser.Tweens.Tween#complete\r\n * @fires Phaser.Tweens.Events#TWEEN_COMPLETE\r\n * @since 3.2.0\r\n *\r\n * @param {number} [delay=0] - The time to wait before invoking the complete callback. If zero it will fire immediately.\r\n *\r\n * @return {this} This Tween instance.\r\n */\r\n complete: function (delay)\r\n {\r\n if (delay === undefined) { delay = 0; }\r\n\r\n if (delay)\r\n {\r\n this.state = TWEEN_CONST.COMPLETE_DELAY;\r\n\r\n this.countdown = delay;\r\n }\r\n else\r\n {\r\n this.state = TWEEN_CONST.PENDING_REMOVE;\r\n\r\n this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Immediately removes this Tween from the TweenManager and all of its internal arrays,\r\n * no matter what stage it as it. Then sets the tween state to `REMOVED`.\r\n * \r\n * You should dispose of your reference to this tween after calling this method, to\r\n * free it from memory.\r\n *\r\n * @method Phaser.Tweens.Tween#remove\r\n * @since 3.17.0\r\n *\r\n * @return {this} This Tween instance.\r\n */\r\n remove: function ()\r\n {\r\n this.parent.remove(this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stops the Tween immediately, whatever stage of progress it is at and flags it for removal by the TweenManager.\r\n *\r\n * @method Phaser.Tweens.Tween#stop\r\n * @since 3.0.0\r\n *\r\n * @param {number} [resetTo] - If you want to seek the tween, provide a value between 0 and 1.\r\n *\r\n * @return {this} This Tween instance.\r\n */\r\n stop: function (resetTo)\r\n {\r\n if (this.state === TWEEN_CONST.ACTIVE)\r\n {\r\n if (resetTo !== undefined)\r\n {\r\n this.seek(resetTo);\r\n }\r\n }\r\n\r\n if (this.state !== TWEEN_CONST.REMOVED)\r\n {\r\n if (this.state === TWEEN_CONST.PAUSED || this.state === TWEEN_CONST.PENDING_ADD)\r\n {\r\n if (this.parentIsTimeline)\r\n {\r\n this.parent.manager._destroy.push(this);\r\n this.parent.manager._toProcess++;\r\n }\r\n else\r\n {\r\n this.parent._destroy.push(this);\r\n this.parent._toProcess++;\r\n }\r\n }\r\n\r\n this.removeAllListeners();\r\n\r\n this.state = TWEEN_CONST.PENDING_REMOVE;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal method that advances the Tween based on the time values.\r\n *\r\n * @method Phaser.Tweens.Tween#update\r\n * @fires Phaser.Tweens.Events#TWEEN_COMPLETE\r\n * @fires Phaser.Tweens.Events#TWEEN_LOOP\r\n * @fires Phaser.Tweens.Events#TWEEN_START\r\n * @since 3.0.0\r\n *\r\n * @param {number} timestamp - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n *\r\n * @return {boolean} Returns `true` if this Tween has finished and should be removed from the Tween Manager, otherwise returns `false`.\r\n */\r\n update: function (timestamp, delta)\r\n {\r\n if (this.state === TWEEN_CONST.PAUSED)\r\n {\r\n return false;\r\n }\r\n\r\n if (this.useFrames)\r\n {\r\n delta = 1 * this.parent.timeScale;\r\n }\r\n\r\n delta *= this.timeScale;\r\n\r\n this.elapsed += delta;\r\n this.progress = Math.min(this.elapsed / this.duration, 1);\r\n\r\n this.totalElapsed += delta;\r\n this.totalProgress = Math.min(this.totalElapsed / this.totalDuration, 1);\r\n\r\n switch (this.state)\r\n {\r\n case TWEEN_CONST.ACTIVE:\r\n\r\n if (!this.hasStarted && !this.isSeeking)\r\n {\r\n this.startDelay -= delta;\r\n \r\n if (this.startDelay <= 0)\r\n {\r\n this.hasStarted = true;\r\n\r\n this.dispatchTweenEvent(Events.TWEEN_START, this.callbacks.onStart);\r\n }\r\n }\r\n\r\n var stillRunning = false;\r\n\r\n for (var i = 0; i < this.totalData; i++)\r\n {\r\n var tweenData = this.data[i];\r\n\r\n if (this.updateTweenData(this, tweenData, delta))\r\n {\r\n stillRunning = true;\r\n }\r\n }\r\n\r\n // Anything still running? If not, we're done\r\n if (!stillRunning)\r\n {\r\n this.nextState();\r\n }\r\n\r\n break;\r\n\r\n case TWEEN_CONST.LOOP_DELAY:\r\n\r\n this.countdown -= delta;\r\n\r\n if (this.countdown <= 0)\r\n {\r\n this.state = TWEEN_CONST.ACTIVE;\r\n\r\n this.dispatchTweenEvent(Events.TWEEN_LOOP, this.callbacks.onLoop);\r\n }\r\n\r\n break;\r\n\r\n case TWEEN_CONST.OFFSET_DELAY:\r\n\r\n this.countdown -= delta;\r\n\r\n if (this.countdown <= 0)\r\n {\r\n this.state = TWEEN_CONST.ACTIVE;\r\n }\r\n\r\n break;\r\n\r\n case TWEEN_CONST.COMPLETE_DELAY:\r\n\r\n this.countdown -= delta;\r\n\r\n if (this.countdown <= 0)\r\n {\r\n this.state = TWEEN_CONST.PENDING_REMOVE;\r\n\r\n this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete);\r\n }\r\n\r\n break;\r\n }\r\n\r\n return (this.state === TWEEN_CONST.PENDING_REMOVE);\r\n },\r\n\r\n /**\r\n * Internal method that will emit a TweenData based Event and invoke the given callback.\r\n *\r\n * @method Phaser.Tweens.Tween#dispatchTweenDataEvent\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched.\r\n * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation.\r\n * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData object that caused this event.\r\n */\r\n dispatchTweenDataEvent: function (event, callback, tweenData)\r\n {\r\n if (!this.isSeeking)\r\n {\r\n this.emit(event, this, tweenData.key, tweenData.target, tweenData.current, tweenData.previous);\r\n\r\n if (callback)\r\n {\r\n callback.params[1] = tweenData.target;\r\n\r\n callback.func.apply(callback.scope, callback.params);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Internal method that will emit a Tween based Event and invoke the given callback.\r\n *\r\n * @method Phaser.Tweens.Tween#dispatchTweenEvent\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched.\r\n * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation.\r\n */\r\n dispatchTweenEvent: function (event, callback)\r\n {\r\n if (!this.isSeeking)\r\n {\r\n this.emit(event, this, this.targets);\r\n\r\n if (callback)\r\n {\r\n callback.params[1] = this.targets;\r\n \r\n callback.func.apply(callback.scope, callback.params);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Internal method used as part of the playback process that sets a tween to play in reverse.\r\n *\r\n * @method Phaser.Tweens.Tween#setStateFromEnd\r\n * @fires Phaser.Tweens.Events#TWEEN_REPEAT\r\n * @fires Phaser.Tweens.Events#TWEEN_YOYO\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tweens.Tween} tween - The Tween to update.\r\n * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update.\r\n * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values.\r\n *\r\n * @return {integer} The state of this Tween.\r\n */\r\n setStateFromEnd: function (tween, tweenData, diff)\r\n {\r\n if (tweenData.yoyo)\r\n {\r\n // We've hit the end of a Playing Forward TweenData and we have a yoyo\r\n\r\n // Account for any extra time we got from the previous frame\r\n tweenData.elapsed = diff;\r\n tweenData.progress = diff / tweenData.duration;\r\n\r\n if (tweenData.flipX)\r\n {\r\n tweenData.target.toggleFlipX();\r\n }\r\n\r\n if (tweenData.flipY)\r\n {\r\n tweenData.target.toggleFlipY();\r\n }\r\n\r\n this.dispatchTweenDataEvent(Events.TWEEN_YOYO, tween.callbacks.onYoyo, tweenData);\r\n\r\n tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween);\r\n\r\n return TWEEN_CONST.PLAYING_BACKWARD;\r\n }\r\n else if (tweenData.repeatCounter > 0)\r\n {\r\n // We've hit the end of a Playing Forward TweenData and we have a Repeat.\r\n // So we're going to go right back to the start to repeat it again.\r\n\r\n tweenData.repeatCounter--;\r\n\r\n // Account for any extra time we got from the previous frame\r\n tweenData.elapsed = diff;\r\n tweenData.progress = diff / tweenData.duration;\r\n\r\n if (tweenData.flipX)\r\n {\r\n tweenData.target.toggleFlipX();\r\n }\r\n\r\n if (tweenData.flipY)\r\n {\r\n tweenData.target.toggleFlipY();\r\n }\r\n\r\n tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween);\r\n\r\n tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween);\r\n\r\n // Delay?\r\n if (tweenData.repeatDelay > 0)\r\n {\r\n tweenData.elapsed = tweenData.repeatDelay - diff;\r\n\r\n tweenData.current = tweenData.start;\r\n\r\n tweenData.target[tweenData.key] = tweenData.current;\r\n\r\n return TWEEN_CONST.REPEAT_DELAY;\r\n }\r\n else\r\n {\r\n this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData);\r\n\r\n return TWEEN_CONST.PLAYING_FORWARD;\r\n }\r\n }\r\n\r\n return TWEEN_CONST.COMPLETE;\r\n },\r\n\r\n /**\r\n * Internal method used as part of the playback process that sets a tween to play from the start.\r\n *\r\n * @method Phaser.Tweens.Tween#setStateFromStart\r\n * @fires Phaser.Tweens.Events#TWEEN_REPEAT\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tweens.Tween} tween - The Tween to update.\r\n * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update.\r\n * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values.\r\n *\r\n * @return {integer} The state of this Tween.\r\n */\r\n setStateFromStart: function (tween, tweenData, diff)\r\n {\r\n if (tweenData.repeatCounter > 0)\r\n {\r\n tweenData.repeatCounter--;\r\n\r\n // Account for any extra time we got from the previous frame\r\n tweenData.elapsed = diff;\r\n tweenData.progress = diff / tweenData.duration;\r\n\r\n if (tweenData.flipX)\r\n {\r\n tweenData.target.toggleFlipX();\r\n }\r\n\r\n if (tweenData.flipY)\r\n {\r\n tweenData.target.toggleFlipY();\r\n }\r\n\r\n tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween);\r\n\r\n // Delay?\r\n if (tweenData.repeatDelay > 0)\r\n {\r\n tweenData.elapsed = tweenData.repeatDelay - diff;\r\n\r\n tweenData.current = tweenData.start;\r\n\r\n tweenData.target[tweenData.key] = tweenData.current;\r\n\r\n return TWEEN_CONST.REPEAT_DELAY;\r\n }\r\n else\r\n {\r\n this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData);\r\n\r\n return TWEEN_CONST.PLAYING_FORWARD;\r\n }\r\n }\r\n\r\n return TWEEN_CONST.COMPLETE;\r\n },\r\n\r\n /**\r\n * Internal method that advances the TweenData based on the time value given.\r\n *\r\n * @method Phaser.Tweens.Tween#updateTweenData\r\n * @fires Phaser.Tweens.Events#TWEEN_UPDATE\r\n * @fires Phaser.Tweens.Events#TWEEN_REPEAT\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Tweens.Tween} tween - The Tween to update.\r\n * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update.\r\n * @param {number} delta - Either a value in ms, or 1 if Tween.useFrames is true.\r\n *\r\n * @return {boolean} True if the tween is not complete (e.g., playing), or false if the tween is complete.\r\n */\r\n updateTweenData: function (tween, tweenData, delta)\r\n {\r\n var target = tweenData.target;\r\n\r\n switch (tweenData.state)\r\n {\r\n case TWEEN_CONST.PLAYING_FORWARD:\r\n case TWEEN_CONST.PLAYING_BACKWARD:\r\n\r\n if (!target)\r\n {\r\n tweenData.state = TWEEN_CONST.COMPLETE;\r\n break;\r\n }\r\n\r\n var elapsed = tweenData.elapsed;\r\n var duration = tweenData.duration;\r\n var diff = 0;\r\n\r\n elapsed += delta;\r\n\r\n if (elapsed > duration)\r\n {\r\n diff = elapsed - duration;\r\n elapsed = duration;\r\n }\r\n\r\n var forward = (tweenData.state === TWEEN_CONST.PLAYING_FORWARD);\r\n var progress = elapsed / duration;\r\n\r\n tweenData.elapsed = elapsed;\r\n tweenData.progress = progress;\r\n tweenData.previous = tweenData.current;\r\n\r\n if (progress === 1)\r\n {\r\n if (forward)\r\n {\r\n tweenData.current = tweenData.end;\r\n target[tweenData.key] = tweenData.end;\r\n\r\n if (tweenData.hold > 0)\r\n {\r\n tweenData.elapsed = tweenData.hold - diff;\r\n\r\n tweenData.state = TWEEN_CONST.HOLD_DELAY;\r\n }\r\n else\r\n {\r\n tweenData.state = this.setStateFromEnd(tween, tweenData, diff);\r\n }\r\n }\r\n else\r\n {\r\n tweenData.current = tweenData.start;\r\n target[tweenData.key] = tweenData.start;\r\n\r\n tweenData.state = this.setStateFromStart(tween, tweenData, diff);\r\n }\r\n }\r\n else\r\n {\r\n var v = (forward) ? tweenData.ease(progress) : tweenData.ease(1 - progress);\r\n\r\n tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v);\r\n\r\n target[tweenData.key] = tweenData.current;\r\n }\r\n\r\n this.dispatchTweenDataEvent(Events.TWEEN_UPDATE, tween.callbacks.onUpdate, tweenData);\r\n\r\n break;\r\n\r\n case TWEEN_CONST.DELAY:\r\n\r\n tweenData.elapsed -= delta;\r\n\r\n if (tweenData.elapsed <= 0)\r\n {\r\n tweenData.elapsed = Math.abs(tweenData.elapsed);\r\n\r\n tweenData.state = TWEEN_CONST.PENDING_RENDER;\r\n }\r\n\r\n break;\r\n\r\n case TWEEN_CONST.REPEAT_DELAY:\r\n\r\n tweenData.elapsed -= delta;\r\n\r\n if (tweenData.elapsed <= 0)\r\n {\r\n tweenData.elapsed = Math.abs(tweenData.elapsed);\r\n\r\n tweenData.state = TWEEN_CONST.PLAYING_FORWARD;\r\n\r\n this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData);\r\n }\r\n\r\n break;\r\n\r\n case TWEEN_CONST.HOLD_DELAY:\r\n\r\n tweenData.elapsed -= delta;\r\n\r\n if (tweenData.elapsed <= 0)\r\n {\r\n tweenData.state = this.setStateFromEnd(tween, tweenData, Math.abs(tweenData.elapsed));\r\n }\r\n\r\n break;\r\n\r\n case TWEEN_CONST.PENDING_RENDER:\r\n\r\n if (target)\r\n {\r\n tweenData.start = tweenData.getStartValue(target, tweenData.key, target[tweenData.key], tweenData.index, tween.totalTargets, tween);\r\n\r\n tweenData.end = tweenData.getEndValue(target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween);\r\n\r\n tweenData.current = tweenData.start;\r\n\r\n target[tweenData.key] = tweenData.start;\r\n\r\n tweenData.state = TWEEN_CONST.PLAYING_FORWARD;\r\n }\r\n else\r\n {\r\n tweenData.state = TWEEN_CONST.COMPLETE;\r\n }\r\n\r\n break;\r\n }\r\n\r\n // Return TRUE if this TweenData still playing, otherwise return FALSE\r\n return (tweenData.state !== TWEEN_CONST.COMPLETE);\r\n }\r\n\r\n});\r\n\r\n// onActive = 'active' event = When the Tween is moved from the pending to the active list in the manager, even if playback delayed\r\n// onStart = 'start' event = When the Tween starts playing from a delayed state (will happen same time as onActive if no delay)\r\n// onYoyo = 'yoyo' event = When the Tween starts a yoyo\r\n// onRepeat = 'repeat' event = When a TweenData repeats playback (if any)\r\n// onComplete = 'complete' event = When the Tween finishes all playback (can sometimes never happen if repeat -1), also when 'stop' called\r\n// onUpdate = 'update' event = When the Tween updates a TweenData during playback (expensive!)\r\n// onLoop = 'loop' event = Used to loop ALL TweenDatas in a Tween\r\n\r\nTween.TYPES = [\r\n 'onActive',\r\n 'onComplete',\r\n 'onLoop',\r\n 'onRepeat',\r\n 'onStart',\r\n 'onUpdate',\r\n 'onYoyo'\r\n];\r\n\r\n/**\r\n * Creates a new Tween object.\r\n *\r\n * Note: This method will only be available if Tweens have been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectFactory#tween\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The Tween configuration.\r\n *\r\n * @return {Phaser.Tweens.Tween} The Tween that was created.\r\n */\r\nGameObjectFactory.register('tween', function (config)\r\n{\r\n return this.scene.sys.tweens.add(config);\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectFactory context.\r\n//\r\n// There are several properties available to use:\r\n//\r\n// this.scene - a reference to the Scene that owns the GameObjectFactory\r\n// this.displayList - a reference to the Display List the Scene owns\r\n// this.updateList - a reference to the Update List the Scene owns\r\n\r\n/**\r\n * Creates a new Tween object and returns it.\r\n *\r\n * Note: This method will only be available if Tweens have been built into Phaser.\r\n *\r\n * @method Phaser.GameObjects.GameObjectCreator#tween\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The Tween configuration.\r\n *\r\n * @return {Phaser.Tweens.Tween} The Tween that was created.\r\n */\r\nGameObjectCreator.register('tween', function (config)\r\n{\r\n return this.scene.sys.tweens.create(config);\r\n});\r\n\r\n// When registering a factory function 'this' refers to the GameObjectCreator context.\r\n\r\nmodule.exports = Tween;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/tween/Tween.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/tween/TweenData.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/tweens/tween/TweenData.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target.\r\n * A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween.\r\n *\r\n * This is an internal function used by the TweenBuilder and should not be accessed directly, instead,\r\n * Tweens should be created using the GameObjectFactory or GameObjectCreator.\r\n *\r\n * @function Phaser.Tweens.TweenData\r\n * @since 3.0.0\r\n *\r\n * @param {any} target - The target to tween.\r\n * @param {integer} index - The target index within the Tween targets array.\r\n * @param {string} key - The property of the target to tween.\r\n * @param {function} getEnd - What the property will be at the END of the Tween.\r\n * @param {function} getStart - What the property will be at the START of the Tween.\r\n * @param {?function} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property.\r\n * @param {function} ease - The ease function this tween uses.\r\n * @param {number} delay - Time in ms/frames before tween will start.\r\n * @param {number} duration - Duration of the tween in ms/frames.\r\n * @param {boolean} yoyo - Determines whether the tween should return back to its start value after hold has expired.\r\n * @param {number} hold - Time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true.\r\n * @param {number} repeat - Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice.\r\n * @param {number} repeatDelay - Time in ms/frames before the repeat will start.\r\n * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens?\r\n * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens?\r\n *\r\n * @return {Phaser.Types.Tweens.TweenDataConfig} The config object describing this TweenData.\r\n */\r\nvar TweenData = function (target, index, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY)\r\n{\r\n return {\r\n\r\n // The target to tween\r\n target: target,\r\n\r\n // The index of the target within the tween targets array\r\n index: index,\r\n\r\n // The property of the target to tween\r\n key: key,\r\n\r\n // What to set the property to the moment the TweenData is invoked.\r\n getActiveValue: getActive,\r\n\r\n // The returned value sets what the property will be at the END of the Tween.\r\n getEndValue: getEnd,\r\n\r\n // The returned value sets what the property will be at the START of the Tween.\r\n getStartValue: getStart,\r\n\r\n // The ease function this tween uses.\r\n ease: ease,\r\n\r\n // Duration of the tween in ms/frames, excludes time for yoyo or repeats.\r\n duration: 0,\r\n\r\n // The total calculated duration of this TweenData (based on duration, repeat, delay and yoyo)\r\n totalDuration: 0,\r\n\r\n // Time in ms/frames before tween will start.\r\n delay: 0,\r\n\r\n // Cause the tween to return back to its start value after hold has expired.\r\n yoyo: yoyo,\r\n\r\n // Time in ms/frames the tween will pause before running the yoyo or starting a repeat.\r\n hold: 0,\r\n\r\n // Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice.\r\n repeat: 0,\r\n\r\n // Time in ms/frames before the repeat will start.\r\n repeatDelay: 0,\r\n\r\n // Automatically call toggleFlipX when the TweenData yoyos or repeats\r\n flipX: flipX,\r\n\r\n // Automatically call toggleFlipY when the TweenData yoyos or repeats\r\n flipY: flipY,\r\n\r\n // Between 0 and 1 showing completion of this TweenData.\r\n progress: 0,\r\n\r\n // Delta counter.\r\n elapsed: 0,\r\n\r\n // How many repeats are left to run?\r\n repeatCounter: 0,\r\n\r\n // Ease Value Data:\r\n\r\n start: 0,\r\n previous: 0,\r\n current: 0,\r\n end: 0,\r\n\r\n // Time Durations\r\n t1: 0,\r\n t2: 0,\r\n\r\n // LoadValue generation functions\r\n gen: {\r\n delay: delay,\r\n duration: duration,\r\n hold: hold,\r\n repeat: repeat,\r\n repeatDelay: repeatDelay\r\n },\r\n\r\n // TWEEN_CONST.CREATED\r\n state: 0\r\n };\r\n};\r\n\r\nmodule.exports = TweenData;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/tween/TweenData.js?"); /***/ }), /***/ "./node_modules/phaser/src/tweens/tween/const.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/tweens/tween/const.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar TWEEN_CONST = {\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.CREATED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n CREATED: 0,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.INIT\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n INIT: 1,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.DELAY\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n DELAY: 2,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.OFFSET_DELAY\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n OFFSET_DELAY: 3,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.PENDING_RENDER\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PENDING_RENDER: 4,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.PLAYING_FORWARD\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PLAYING_FORWARD: 5,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.PLAYING_BACKWARD\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PLAYING_BACKWARD: 6,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.HOLD_DELAY\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n HOLD_DELAY: 7,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.REPEAT_DELAY\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n REPEAT_DELAY: 8,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.COMPLETE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n COMPLETE: 9,\r\n\r\n // Tween specific (starts from 20 to cleanly allow extra TweenData consts in the future)\r\n\r\n /**\r\n * Tween state.\r\n * \r\n * @name Phaser.Tweens.PENDING_ADD\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PENDING_ADD: 20,\r\n\r\n /**\r\n * Tween state.\r\n * \r\n * @name Phaser.Tweens.PAUSED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PAUSED: 21,\r\n\r\n /**\r\n * Tween state.\r\n * \r\n * @name Phaser.Tweens.LOOP_DELAY\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOOP_DELAY: 22,\r\n\r\n /**\r\n * Tween state.\r\n * \r\n * @name Phaser.Tweens.ACTIVE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n ACTIVE: 23,\r\n\r\n /**\r\n * Tween state.\r\n * \r\n * @name Phaser.Tweens.COMPLETE_DELAY\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n COMPLETE_DELAY: 24,\r\n\r\n /**\r\n * Tween state.\r\n * \r\n * @name Phaser.Tweens.PENDING_REMOVE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PENDING_REMOVE: 25,\r\n\r\n /**\r\n * Tween state.\r\n * \r\n * @name Phaser.Tweens.REMOVED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n REMOVED: 26\r\n\r\n};\r\n\r\nmodule.exports = TWEEN_CONST;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/tweens/tween/const.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/Class.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/utils/Class.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Taken from klasse by mattdesl https://github.com/mattdesl/klasse\r\n\r\nfunction hasGetterOrSetter (def)\r\n{\r\n return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function');\r\n}\r\n\r\nfunction getProperty (definition, k, isClassDescriptor)\r\n{\r\n // This may be a lightweight object, OR it might be a property that was defined previously.\r\n\r\n // For simple class descriptors we can just assume its NOT previously defined.\r\n var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k);\r\n\r\n if (!isClassDescriptor && def.value && typeof def.value === 'object')\r\n {\r\n def = def.value;\r\n }\r\n\r\n // This might be a regular property, or it may be a getter/setter the user defined in a class.\r\n if (def && hasGetterOrSetter(def))\r\n {\r\n if (typeof def.enumerable === 'undefined')\r\n {\r\n def.enumerable = true;\r\n }\r\n\r\n if (typeof def.configurable === 'undefined')\r\n {\r\n def.configurable = true;\r\n }\r\n\r\n return def;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n}\r\n\r\nfunction hasNonConfigurable (obj, k)\r\n{\r\n var prop = Object.getOwnPropertyDescriptor(obj, k);\r\n\r\n if (!prop)\r\n {\r\n return false;\r\n }\r\n\r\n if (prop.value && typeof prop.value === 'object')\r\n {\r\n prop = prop.value;\r\n }\r\n\r\n if (prop.configurable === false)\r\n {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Extends the given `myClass` object's prototype with the properties of `definition`.\r\n *\r\n * @function extend\r\n * @param {Object} ctor The constructor object to mix into.\r\n * @param {Object} definition A dictionary of functions for the class.\r\n * @param {boolean} isClassDescriptor Is the definition a class descriptor?\r\n * @param {Object} [extend] The parent constructor object.\r\n */\r\nfunction extend (ctor, definition, isClassDescriptor, extend)\r\n{\r\n for (var k in definition)\r\n {\r\n if (!definition.hasOwnProperty(k))\r\n {\r\n continue;\r\n }\r\n\r\n var def = getProperty(definition, k, isClassDescriptor);\r\n\r\n if (def !== false)\r\n {\r\n // If Extends is used, we will check its prototype to see if the final variable exists.\r\n\r\n var parent = extend || ctor;\r\n\r\n if (hasNonConfigurable(parent.prototype, k))\r\n {\r\n // Just skip the final property\r\n if (Class.ignoreFinals)\r\n {\r\n continue;\r\n }\r\n\r\n // We cannot re-define a property that is configurable=false.\r\n // So we will consider them final and throw an error. This is by\r\n // default so it is clear to the developer what is happening.\r\n // You can set ignoreFinals to true if you need to extend a class\r\n // which has configurable=false; it will simply not re-define final properties.\r\n throw new Error('cannot override final property \\'' + k + '\\', set Class.ignoreFinals = true to skip');\r\n }\r\n\r\n Object.defineProperty(ctor.prototype, k, def);\r\n }\r\n else\r\n {\r\n ctor.prototype[k] = definition[k];\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Applies the given `mixins` to the prototype of `myClass`.\r\n *\r\n * @function mixin\r\n * @param {Object} myClass The constructor object to mix into.\r\n * @param {Object|Array} mixins The mixins to apply to the constructor.\r\n */\r\nfunction mixin (myClass, mixins)\r\n{\r\n if (!mixins)\r\n {\r\n return;\r\n }\r\n\r\n if (!Array.isArray(mixins))\r\n {\r\n mixins = [ mixins ];\r\n }\r\n\r\n for (var i = 0; i < mixins.length; i++)\r\n {\r\n extend(myClass, mixins[i].prototype || mixins[i]);\r\n }\r\n}\r\n\r\n/**\r\n * Creates a new class with the given descriptor.\r\n * The constructor, defined by the name `initialize`,\r\n * is an optional function. If unspecified, an anonymous\r\n * function will be used which calls the parent class (if\r\n * one exists).\r\n *\r\n * You can also use `Extends` and `Mixins` to provide subclassing\r\n * and inheritance.\r\n *\r\n * @class Phaser.Class\r\n * @constructor\r\n * @param {Object} definition a dictionary of functions for the class\r\n * @example\r\n *\r\n * var MyClass = new Phaser.Class({\r\n *\r\n * initialize: function() {\r\n * this.foo = 2.0;\r\n * },\r\n *\r\n * bar: function() {\r\n * return this.foo + 5;\r\n * }\r\n * });\r\n */\r\nfunction Class (definition)\r\n{\r\n if (!definition)\r\n {\r\n definition = {};\r\n }\r\n\r\n // The variable name here dictates what we see in Chrome debugger\r\n var initialize;\r\n var Extends;\r\n\r\n if (definition.initialize)\r\n {\r\n if (typeof definition.initialize !== 'function')\r\n {\r\n throw new Error('initialize must be a function');\r\n }\r\n\r\n initialize = definition.initialize;\r\n\r\n // Usually we should avoid 'delete' in V8 at all costs.\r\n // However, its unlikely to make any performance difference\r\n // here since we only call this on class creation (i.e. not object creation).\r\n delete definition.initialize;\r\n }\r\n else if (definition.Extends)\r\n {\r\n var base = definition.Extends;\r\n\r\n initialize = function ()\r\n {\r\n base.apply(this, arguments);\r\n };\r\n }\r\n else\r\n {\r\n initialize = function () {};\r\n }\r\n\r\n if (definition.Extends)\r\n {\r\n initialize.prototype = Object.create(definition.Extends.prototype);\r\n initialize.prototype.constructor = initialize;\r\n\r\n // For getOwnPropertyDescriptor to work, we need to act directly on the Extends (or Mixin)\r\n\r\n Extends = definition.Extends;\r\n\r\n delete definition.Extends;\r\n }\r\n else\r\n {\r\n initialize.prototype.constructor = initialize;\r\n }\r\n\r\n // Grab the mixins, if they are specified...\r\n var mixins = null;\r\n\r\n if (definition.Mixins)\r\n {\r\n mixins = definition.Mixins;\r\n delete definition.Mixins;\r\n }\r\n\r\n // First, mixin if we can.\r\n mixin(initialize, mixins);\r\n\r\n // Now we grab the actual definition which defines the overrides.\r\n extend(initialize, definition, true, Extends);\r\n\r\n return initialize;\r\n}\r\n\r\nClass.extend = extend;\r\nClass.mixin = mixin;\r\nClass.ignoreFinals = false;\r\n\r\nmodule.exports = Class;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/Class.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/NOOP.js": /*!***********************************************!*\ !*** ./node_modules/phaser/src/utils/NOOP.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * A NOOP (No Operation) callback function.\r\n *\r\n * Used internally by Phaser when it's more expensive to determine if a callback exists\r\n * than it is to just invoke an empty function.\r\n *\r\n * @function Phaser.Utils.NOOP\r\n * @since 3.0.0\r\n */\r\nvar NOOP = function ()\r\n{\r\n // NOOP\r\n};\r\n\r\nmodule.exports = NOOP;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/NOOP.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/Add.js": /*!****************************************************!*\ !*** ./node_modules/phaser/src/utils/array/Add.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Adds the given item, or array of items, to the array.\r\n *\r\n * Each item must be unique within the array.\r\n *\r\n * The array is modified in-place and returned.\r\n *\r\n * You can optionally specify a limit to the maximum size of the array. If the quantity of items being\r\n * added will take the array length over this limit, it will stop adding once the limit is reached.\r\n *\r\n * You can optionally specify a callback to be invoked for each item successfully added to the array.\r\n *\r\n * @function Phaser.Utils.Array.Add\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to be added to.\r\n * @param {any|any[]} item - The item, or array of items, to add to the array. Each item must be unique within the array.\r\n * @param {integer} [limit] - Optional limit which caps the size of the array.\r\n * @param {function} [callback] - A callback to be invoked for each item successfully added to the array.\r\n * @param {object} [context] - The context in which the callback is invoked.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar Add = function (array, item, limit, callback, context)\r\n{\r\n if (context === undefined) { context = array; }\r\n\r\n if (limit > 0)\r\n {\r\n var remaining = limit - array.length;\r\n\r\n // There's nothing more we can do here, the array is full\r\n if (remaining <= 0)\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n // Fast path to avoid array mutation and iteration\r\n if (!Array.isArray(item))\r\n {\r\n if (array.indexOf(item) === -1)\r\n {\r\n array.push(item);\r\n\r\n if (callback)\r\n {\r\n callback.call(context, item);\r\n }\r\n\r\n return item;\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n // If we got this far, we have an array of items to insert\r\n\r\n // Ensure all the items are unique\r\n var itemLength = item.length - 1;\r\n\r\n while (itemLength >= 0)\r\n {\r\n if (array.indexOf(item[itemLength]) !== -1)\r\n {\r\n // Already exists in array, so remove it\r\n item.splice(itemLength, 1);\r\n }\r\n\r\n itemLength--;\r\n }\r\n\r\n // Anything left?\r\n itemLength = item.length;\r\n\r\n if (itemLength === 0)\r\n {\r\n return null;\r\n }\r\n\r\n if (limit > 0 && itemLength > remaining)\r\n {\r\n item.splice(remaining);\r\n\r\n itemLength = remaining;\r\n }\r\n\r\n for (var i = 0; i < itemLength; i++)\r\n {\r\n var entry = item[i];\r\n\r\n array.push(entry);\r\n\r\n if (callback)\r\n {\r\n callback.call(context, entry);\r\n }\r\n }\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = Add;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/Add.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/AddAt.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/utils/array/AddAt.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Adds the given item, or array of items, to the array starting at the index specified.\r\n * \r\n * Each item must be unique within the array.\r\n * \r\n * Existing elements in the array are shifted up.\r\n * \r\n * The array is modified in-place and returned.\r\n * \r\n * You can optionally specify a limit to the maximum size of the array. If the quantity of items being\r\n * added will take the array length over this limit, it will stop adding once the limit is reached.\r\n * \r\n * You can optionally specify a callback to be invoked for each item successfully added to the array.\r\n *\r\n * @function Phaser.Utils.Array.AddAt\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to be added to.\r\n * @param {any|any[]} item - The item, or array of items, to add to the array.\r\n * @param {integer} [index=0] - The index in the array where the item will be inserted.\r\n * @param {integer} [limit] - Optional limit which caps the size of the array.\r\n * @param {function} [callback] - A callback to be invoked for each item successfully added to the array.\r\n * @param {object} [context] - The context in which the callback is invoked.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar AddAt = function (array, item, index, limit, callback, context)\r\n{\r\n if (index === undefined) { index = 0; }\r\n if (context === undefined) { context = array; }\r\n\r\n if (limit > 0)\r\n {\r\n var remaining = limit - array.length;\r\n\r\n // There's nothing more we can do here, the array is full\r\n if (remaining <= 0)\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n // Fast path to avoid array mutation and iteration\r\n if (!Array.isArray(item))\r\n {\r\n if (array.indexOf(item) === -1)\r\n {\r\n array.splice(index, 0, item);\r\n\r\n if (callback)\r\n {\r\n callback.call(context, item);\r\n }\r\n\r\n return item;\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n // If we got this far, we have an array of items to insert\r\n\r\n // Ensure all the items are unique\r\n var itemLength = item.length - 1;\r\n\r\n while (itemLength >= 0)\r\n {\r\n if (array.indexOf(item[itemLength]) !== -1)\r\n {\r\n // Already exists in array, so remove it\r\n item.pop();\r\n }\r\n\r\n itemLength--;\r\n }\r\n\r\n // Anything left?\r\n itemLength = item.length;\r\n\r\n if (itemLength === 0)\r\n {\r\n return null;\r\n }\r\n\r\n // Truncate to the limit\r\n if (limit > 0 && itemLength > remaining)\r\n {\r\n item.splice(remaining);\r\n\r\n itemLength = remaining;\r\n }\r\n\r\n for (var i = itemLength - 1; i >= 0; i--)\r\n {\r\n var entry = item[i];\r\n\r\n array.splice(index, 0, entry);\r\n\r\n if (callback)\r\n {\r\n callback.call(context, entry);\r\n }\r\n }\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = AddAt;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/AddAt.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/BringToTop.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/utils/array/BringToTop.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Moves the given element to the top of the array.\r\n * The array is modified in-place.\r\n *\r\n * @function Phaser.Utils.Array.BringToTop\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array.\r\n * @param {*} item - The element to move.\r\n *\r\n * @return {*} The element that was moved.\r\n */\r\nvar BringToTop = function (array, item)\r\n{\r\n var currentIndex = array.indexOf(item);\r\n\r\n if (currentIndex !== -1 && currentIndex < array.length)\r\n {\r\n array.splice(currentIndex, 1);\r\n array.push(item);\r\n }\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = BringToTop;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/BringToTop.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/CountAllMatching.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/CountAllMatching.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SafeRange = __webpack_require__(/*! ./SafeRange */ \"./node_modules/phaser/src/utils/array/SafeRange.js\");\r\n\r\n/**\r\n * Returns the total number of elements in the array which have a property matching the given value.\r\n *\r\n * @function Phaser.Utils.Array.CountAllMatching\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to search.\r\n * @param {string} property - The property to test on each array element.\r\n * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check.\r\n * @param {integer} [startIndex] - An optional start index to search from.\r\n * @param {integer} [endIndex] - An optional end index to search to.\r\n *\r\n * @return {integer} The total number of elements with properties matching the given value.\r\n */\r\nvar CountAllMatching = function (array, property, value, startIndex, endIndex)\r\n{\r\n if (startIndex === undefined) { startIndex = 0; }\r\n if (endIndex === undefined) { endIndex = array.length; }\r\n\r\n var total = 0;\r\n\r\n if (SafeRange(array, startIndex, endIndex))\r\n {\r\n for (var i = startIndex; i < endIndex; i++)\r\n {\r\n var child = array[i];\r\n\r\n if (child[property] === value)\r\n {\r\n total++;\r\n }\r\n }\r\n }\r\n\r\n return total;\r\n};\r\n\r\nmodule.exports = CountAllMatching;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/CountAllMatching.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/Each.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/utils/array/Each.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Passes each element in the array to the given callback.\r\n *\r\n * @function Phaser.Utils.Array.Each\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to search.\r\n * @param {function} callback - A callback to be invoked for each item in the array.\r\n * @param {object} context - The context in which the callback is invoked.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the current array item.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar Each = function (array, callback, context)\r\n{\r\n var i;\r\n var args = [ null ];\r\n\r\n for (i = 3; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (i = 0; i < array.length; i++)\r\n {\r\n args[0] = array[i];\r\n\r\n callback.apply(context, args);\r\n }\r\n\r\n return array;\r\n};\r\n\r\nmodule.exports = Each;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/Each.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/EachInRange.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/EachInRange.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SafeRange = __webpack_require__(/*! ./SafeRange */ \"./node_modules/phaser/src/utils/array/SafeRange.js\");\r\n\r\n/**\r\n * Passes each element in the array, between the start and end indexes, to the given callback.\r\n *\r\n * @function Phaser.Utils.Array.EachInRange\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to search.\r\n * @param {function} callback - A callback to be invoked for each item in the array.\r\n * @param {object} context - The context in which the callback is invoked.\r\n * @param {integer} startIndex - The start index to search from.\r\n * @param {integer} endIndex - The end index to search to.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar EachInRange = function (array, callback, context, startIndex, endIndex)\r\n{\r\n if (startIndex === undefined) { startIndex = 0; }\r\n if (endIndex === undefined) { endIndex = array.length; }\r\n\r\n if (SafeRange(array, startIndex, endIndex))\r\n {\r\n var i;\r\n var args = [ null ];\r\n\r\n for (i = 5; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (i = startIndex; i < endIndex; i++)\r\n {\r\n args[0] = array[i];\r\n\r\n callback.apply(context, args);\r\n }\r\n }\r\n\r\n return array;\r\n};\r\n\r\nmodule.exports = EachInRange;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/EachInRange.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/FindClosestInSorted.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/FindClosestInSorted.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Searches a pre-sorted array for the closet value to the given number.\r\n *\r\n * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name,\r\n * and will check for the closest value of those to the given number.\r\n *\r\n * @function Phaser.Utils.Array.FindClosestInSorted\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to search for in the array.\r\n * @param {array} array - The array to search, which must be sorted.\r\n * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value.\r\n *\r\n * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value.\r\n */\r\nvar FindClosestInSorted = function (value, array, key)\r\n{\r\n if (!array.length)\r\n {\r\n return NaN;\r\n }\r\n else if (array.length === 1)\r\n {\r\n return array[0];\r\n }\r\n\r\n var i = 1;\r\n var low;\r\n var high;\r\n\r\n if (key)\r\n {\r\n if (value < array[0][key])\r\n {\r\n return array[0];\r\n }\r\n\r\n while (array[i][key] < value)\r\n {\r\n i++;\r\n }\r\n }\r\n else\r\n {\r\n while (array[i] < value)\r\n {\r\n i++;\r\n }\r\n }\r\n\r\n if (i > array.length)\r\n {\r\n i = array.length;\r\n }\r\n\r\n if (key)\r\n {\r\n low = array[i - 1][key];\r\n high = array[i][key];\r\n\r\n return ((high - value) <= (value - low)) ? array[i] : array[i - 1];\r\n }\r\n else\r\n {\r\n low = array[i - 1];\r\n high = array[i];\r\n\r\n return ((high - value) <= (value - low)) ? high : low;\r\n }\r\n};\r\n\r\nmodule.exports = FindClosestInSorted;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/FindClosestInSorted.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/GetAll.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/utils/array/GetAll.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SafeRange = __webpack_require__(/*! ./SafeRange */ \"./node_modules/phaser/src/utils/array/SafeRange.js\");\r\n\r\n/**\r\n * Returns all elements in the array.\r\n *\r\n * You can optionally specify a matching criteria using the `property` and `value` arguments.\r\n *\r\n * For example: `getAll('visible', true)` would return only elements that have their visible property set.\r\n *\r\n * Optionally you can specify a start and end index. For example if the array had 100 elements,\r\n * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only\r\n * the first 50 elements.\r\n *\r\n * @function Phaser.Utils.Array.GetAll\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to search.\r\n * @param {string} [property] - The property to test on each array element.\r\n * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check.\r\n * @param {integer} [startIndex] - An optional start index to search from.\r\n * @param {integer} [endIndex] - An optional end index to search to.\r\n *\r\n * @return {array} All matching elements from the array.\r\n */\r\nvar GetAll = function (array, property, value, startIndex, endIndex)\r\n{\r\n if (startIndex === undefined) { startIndex = 0; }\r\n if (endIndex === undefined) { endIndex = array.length; }\r\n\r\n var output = [];\r\n\r\n if (SafeRange(array, startIndex, endIndex))\r\n {\r\n for (var i = startIndex; i < endIndex; i++)\r\n {\r\n var child = array[i];\r\n\r\n if (!property ||\r\n (property && value === undefined && child.hasOwnProperty(property)) ||\r\n (property && value !== undefined && child[property] === value))\r\n {\r\n output.push(child);\r\n }\r\n }\r\n }\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = GetAll;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/GetAll.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/GetFirst.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/utils/array/GetFirst.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SafeRange = __webpack_require__(/*! ./SafeRange */ \"./node_modules/phaser/src/utils/array/SafeRange.js\");\r\n\r\n/**\r\n * Returns the first element in the array.\r\n *\r\n * You can optionally specify a matching criteria using the `property` and `value` arguments.\r\n *\r\n * For example: `getAll('visible', true)` would return the first element that had its `visible` property set.\r\n *\r\n * Optionally you can specify a start and end index. For example if the array had 100 elements,\r\n * and you set `startIndex` to 0 and `endIndex` to 50, it would search only the first 50 elements.\r\n *\r\n * @function Phaser.Utils.Array.GetFirst\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to search.\r\n * @param {string} [property] - The property to test on each array element.\r\n * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check.\r\n * @param {integer} [startIndex=0] - An optional start index to search from.\r\n * @param {integer} [endIndex=array.length] - An optional end index to search up to (but not included)\r\n *\r\n * @return {object} The first matching element from the array, or `null` if no element could be found in the range given.\r\n */\r\nvar GetFirst = function (array, property, value, startIndex, endIndex)\r\n{\r\n if (startIndex === undefined) { startIndex = 0; }\r\n if (endIndex === undefined) { endIndex = array.length; }\r\n\r\n if (SafeRange(array, startIndex, endIndex))\r\n {\r\n for (var i = startIndex; i < endIndex; i++)\r\n {\r\n var child = array[i];\r\n\r\n if (!property ||\r\n (property && value === undefined && child.hasOwnProperty(property)) ||\r\n (property && value !== undefined && child[property] === value))\r\n {\r\n return child;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nmodule.exports = GetFirst;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/GetFirst.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/GetRandom.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/utils/array/GetRandom.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns a Random element from the array.\r\n *\r\n * @function Phaser.Utils.Array.GetRandom\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to select the random entry from.\r\n * @param {integer} [startIndex=0] - An optional start index.\r\n * @param {integer} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from.\r\n *\r\n * @return {*} A random element from the array, or `null` if no element could be found in the range given.\r\n */\r\nvar GetRandom = function (array, startIndex, length)\r\n{\r\n if (startIndex === undefined) { startIndex = 0; }\r\n if (length === undefined) { length = array.length; }\r\n\r\n var randomIndex = startIndex + Math.floor(Math.random() * length);\r\n\r\n return (array[randomIndex] === undefined) ? null : array[randomIndex];\r\n};\r\n\r\nmodule.exports = GetRandom;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/GetRandom.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/MoveDown.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/utils/array/MoveDown.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Moves the given array element down one place in the array.\r\n * The array is modified in-place.\r\n *\r\n * @function Phaser.Utils.Array.MoveDown\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The input array.\r\n * @param {*} item - The element to move down the array.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar MoveDown = function (array, item)\r\n{\r\n var currentIndex = array.indexOf(item);\r\n\r\n if (currentIndex > 0)\r\n {\r\n var item2 = array[currentIndex - 1];\r\n\r\n var index2 = array.indexOf(item2);\r\n\r\n array[currentIndex] = item2;\r\n array[index2] = item;\r\n }\r\n\r\n return array;\r\n};\r\n\r\nmodule.exports = MoveDown;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/MoveDown.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/MoveTo.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/utils/array/MoveTo.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Moves an element in an array to a new position within the same array.\r\n * The array is modified in-place.\r\n *\r\n * @function Phaser.Utils.Array.MoveTo\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array.\r\n * @param {*} item - The element to move.\r\n * @param {integer} index - The new index that the element will be moved to.\r\n *\r\n * @return {*} The element that was moved.\r\n */\r\nvar MoveTo = function (array, item, index)\r\n{\r\n var currentIndex = array.indexOf(item);\r\n\r\n if (currentIndex === -1 || index < 0 || index >= array.length)\r\n {\r\n throw new Error('Supplied index out of bounds');\r\n }\r\n\r\n if (currentIndex !== index)\r\n {\r\n // Remove\r\n array.splice(currentIndex, 1);\r\n\r\n // Add in new location\r\n array.splice(index, 0, item);\r\n }\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = MoveTo;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/MoveTo.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/MoveUp.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/utils/array/MoveUp.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Moves the given array element up one place in the array.\r\n * The array is modified in-place.\r\n *\r\n * @function Phaser.Utils.Array.MoveUp\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The input array.\r\n * @param {*} item - The element to move up the array.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar MoveUp = function (array, item)\r\n{\r\n var currentIndex = array.indexOf(item);\r\n\r\n if (currentIndex !== -1 && currentIndex < array.length - 1)\r\n {\r\n // The element one above `item` in the array\r\n var item2 = array[currentIndex + 1];\r\n var index2 = array.indexOf(item2);\r\n\r\n array[currentIndex] = item2;\r\n array[index2] = item;\r\n }\r\n\r\n return array;\r\n};\r\n\r\nmodule.exports = MoveUp;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/MoveUp.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/NumberArray.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/NumberArray.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Create an array representing the range of numbers (usually integers), between, and inclusive of,\r\n * the given `start` and `end` arguments. For example:\r\n *\r\n * `var array = numberArray(2, 4); // array = [2, 3, 4]`\r\n * `var array = numberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]`\r\n *\r\n * This is equivalent to `numberArrayStep(start, end, 1)`.\r\n *\r\n * You can optionally provide a prefix and / or suffix string. If given the array will contain\r\n * strings, not integers. For example:\r\n *\r\n * `var array = numberArray(1, 4, 'Level '); // array = [\"Level 1\", \"Level 2\", \"Level 3\", \"Level 4\"]`\r\n * `var array = numberArray(5, 7, 'HD-', '.png'); // array = [\"HD-5.png\", \"HD-6.png\", \"HD-7.png\"]`\r\n *\r\n * @function Phaser.Utils.Array.NumberArray\r\n * @since 3.0.0\r\n *\r\n * @param {number} start - The minimum value the array starts with.\r\n * @param {number} end - The maximum value the array contains.\r\n * @param {string} [prefix] - Optional prefix to place before the number. If provided the array will contain strings, not integers.\r\n * @param {string} [suffix] - Optional suffix to place after the number. If provided the array will contain strings, not integers.\r\n *\r\n * @return {(number[]|string[])} The array of number values, or strings if a prefix or suffix was provided.\r\n */\r\nvar NumberArray = function (start, end, prefix, suffix)\r\n{\r\n var result = [];\r\n\r\n for (var i = start; i <= end; i++)\r\n {\r\n if (prefix || suffix)\r\n {\r\n var key = (prefix) ? prefix + i.toString() : i.toString();\r\n\r\n if (suffix)\r\n {\r\n key = key.concat(suffix);\r\n }\r\n\r\n result.push(key);\r\n }\r\n else\r\n {\r\n result.push(i);\r\n }\r\n }\r\n\r\n return result;\r\n};\r\n\r\nmodule.exports = NumberArray;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/NumberArray.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/NumberArrayStep.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/NumberArrayStep.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RoundAwayFromZero = __webpack_require__(/*! ../../math/RoundAwayFromZero */ \"./node_modules/phaser/src/math/RoundAwayFromZero.js\");\r\n\r\n/**\r\n * Create an array of numbers (positive and/or negative) progressing from `start`\r\n * up to but not including `end` by advancing by `step`.\r\n *\r\n * If `start` is less than `end` a zero-length range is created unless a negative `step` is specified.\r\n *\r\n * Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0;\r\n * for forward compatibility make sure to pass in actual numbers.\r\n * \r\n * @example\r\n * NumberArrayStep(4);\r\n * // => [0, 1, 2, 3]\r\n *\r\n * NumberArrayStep(1, 5);\r\n * // => [1, 2, 3, 4]\r\n *\r\n * NumberArrayStep(0, 20, 5);\r\n * // => [0, 5, 10, 15]\r\n *\r\n * NumberArrayStep(0, -4, -1);\r\n * // => [0, -1, -2, -3]\r\n *\r\n * NumberArrayStep(1, 4, 0);\r\n * // => [1, 1, 1]\r\n *\r\n * NumberArrayStep(0);\r\n * // => []\r\n *\r\n * @function Phaser.Utils.Array.NumberArrayStep\r\n * @since 3.0.0\r\n *\r\n * @param {number} [start=0] - The start of the range.\r\n * @param {number} [end=null] - The end of the range.\r\n * @param {number} [step=1] - The value to increment or decrement by.\r\n *\r\n * @return {number[]} The array of number values.\r\n */\r\nvar NumberArrayStep = function (start, end, step)\r\n{\r\n if (start === undefined) { start = 0; }\r\n if (end === undefined) { end = null; }\r\n if (step === undefined) { step = 1; }\r\n\r\n if (end === null)\r\n {\r\n end = start;\r\n start = 0;\r\n }\r\n\r\n var result = [];\r\n\r\n var total = Math.max(RoundAwayFromZero((end - start) / (step || 1)), 0);\r\n\r\n for (var i = 0; i < total; i++)\r\n {\r\n result.push(start);\r\n start += step;\r\n }\r\n\r\n return result;\r\n};\r\n\r\nmodule.exports = NumberArrayStep;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/NumberArrayStep.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/QuickSelect.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/QuickSelect.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction swap (arr, i, j)\r\n{\r\n var tmp = arr[i];\r\n arr[i] = arr[j];\r\n arr[j] = tmp;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction defaultCompare (a, b)\r\n{\r\n return a < b ? -1 : a > b ? 1 : 0;\r\n}\r\n\r\n/**\r\n * A [Floyd-Rivest](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm) quick selection algorithm.\r\n *\r\n * Rearranges the array items so that all items in the [left, k] range are smaller than all items in [k, right];\r\n * The k-th element will have the (k - left + 1)th smallest value in [left, right].\r\n *\r\n * The array is modified in-place.\r\n *\r\n * Based on code by [Vladimir Agafonkin](https://www.npmjs.com/~mourner)\r\n *\r\n * @function Phaser.Utils.Array.QuickSelect\r\n * @since 3.0.0\r\n *\r\n * @param {array} arr - The array to sort.\r\n * @param {integer} k - The k-th element index.\r\n * @param {integer} [left=0] - The index of the left part of the range.\r\n * @param {integer} [right] - The index of the right part of the range.\r\n * @param {function} [compare] - An optional comparison function. Is passed two elements and should return 0, 1 or -1.\r\n */\r\nvar QuickSelect = function (arr, k, left, right, compare)\r\n{\r\n if (left === undefined) { left = 0; }\r\n if (right === undefined) { right = arr.length - 1; }\r\n if (compare === undefined) { compare = defaultCompare; }\r\n\r\n while (right > left)\r\n {\r\n if (right - left > 600)\r\n {\r\n var n = right - left + 1;\r\n var m = k - left + 1;\r\n var z = Math.log(n);\r\n var s = 0.5 * Math.exp(2 * z / 3);\r\n var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\r\n var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\r\n var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\r\n\r\n QuickSelect(arr, k, newLeft, newRight, compare);\r\n }\r\n\r\n var t = arr[k];\r\n var i = left;\r\n var j = right;\r\n\r\n swap(arr, left, k);\r\n\r\n if (compare(arr[right], t) > 0)\r\n {\r\n swap(arr, left, right);\r\n }\r\n\r\n while (i < j)\r\n {\r\n swap(arr, i, j);\r\n\r\n i++;\r\n j--;\r\n\r\n while (compare(arr[i], t) < 0)\r\n {\r\n i++;\r\n }\r\n\r\n while (compare(arr[j], t) > 0)\r\n {\r\n j--;\r\n }\r\n }\r\n\r\n if (compare(arr[left], t) === 0)\r\n {\r\n swap(arr, left, j);\r\n }\r\n else\r\n {\r\n j++;\r\n swap(arr, j, right);\r\n }\r\n\r\n if (j <= k)\r\n {\r\n left = j + 1;\r\n }\r\n\r\n if (k <= j)\r\n {\r\n right = j - 1;\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = QuickSelect;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/QuickSelect.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/Range.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/utils/array/Range.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetValue = __webpack_require__(/*! ../object/GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar Shuffle = __webpack_require__(/*! ./Shuffle */ \"./node_modules/phaser/src/utils/array/Shuffle.js\");\r\n\r\nvar BuildChunk = function (a, b, qty)\r\n{\r\n var out = [];\r\n\r\n for (var aIndex = 0; aIndex < a.length; aIndex++)\r\n {\r\n for (var bIndex = 0; bIndex < b.length; bIndex++)\r\n {\r\n for (var i = 0; i < qty; i++)\r\n {\r\n out.push({ a: a[aIndex], b: b[bIndex] });\r\n }\r\n }\r\n }\r\n\r\n return out;\r\n};\r\n\r\n/**\r\n * Creates an array populated with a range of values, based on the given arguments and configuration object.\r\n *\r\n * Range ([a,b,c], [1,2,3]) =\r\n * a1, a2, a3, b1, b2, b3, c1, c2, c3\r\n * \r\n * Range ([a,b], [1,2,3], qty = 3) =\r\n * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3\r\n * \r\n * Range ([a,b,c], [1,2,3], repeat x1) =\r\n * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3\r\n * \r\n * Range ([a,b], [1,2], repeat -1 = endless, max = 14) =\r\n * Maybe if max is set then repeat goes to -1 automatically?\r\n * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements)\r\n * \r\n * Range ([a], [1,2,3,4,5], random = true) =\r\n * a4, a1, a5, a2, a3\r\n * \r\n * Range ([a, b], [1,2,3], random = true) =\r\n * b3, a2, a1, b1, a3, b2\r\n * \r\n * Range ([a, b, c], [1,2,3], randomB = true) =\r\n * a3, a1, a2, b2, b3, b1, c1, c3, c2\r\n * \r\n * Range ([a], [1,2,3,4,5], yoyo = true) =\r\n * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1\r\n * \r\n * Range ([a, b], [1,2,3], yoyo = true) =\r\n * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1\r\n *\r\n * @function Phaser.Utils.Array.Range\r\n * @since 3.0.0\r\n *\r\n * @param {array} a - The first array of range elements.\r\n * @param {array} b - The second array of range elements.\r\n * @param {object} [options] - A range configuration object. Can contain: repeat, random, randomB, yoyo, max, qty.\r\n *\r\n * @return {array} An array of arranged elements.\r\n */\r\nvar Range = function (a, b, options)\r\n{\r\n var max = GetValue(options, 'max', 0);\r\n var qty = GetValue(options, 'qty', 1);\r\n var random = GetValue(options, 'random', false);\r\n var randomB = GetValue(options, 'randomB', false);\r\n var repeat = GetValue(options, 'repeat', 0);\r\n var yoyo = GetValue(options, 'yoyo', false);\r\n\r\n var out = [];\r\n\r\n if (randomB)\r\n {\r\n Shuffle(b);\r\n }\r\n\r\n // Endless repeat, so limit by max\r\n if (repeat === -1)\r\n {\r\n if (max === 0)\r\n {\r\n repeat = 0;\r\n }\r\n else\r\n {\r\n // Work out how many repeats we need\r\n var total = (a.length * b.length) * qty;\r\n\r\n if (yoyo)\r\n {\r\n total *= 2;\r\n }\r\n\r\n repeat = Math.ceil(max / total);\r\n }\r\n }\r\n\r\n for (var i = 0; i <= repeat; i++)\r\n {\r\n var chunk = BuildChunk(a, b, qty);\r\n\r\n if (random)\r\n {\r\n Shuffle(chunk);\r\n }\r\n\r\n out = out.concat(chunk);\r\n\r\n if (yoyo)\r\n {\r\n chunk.reverse();\r\n\r\n out = out.concat(chunk);\r\n }\r\n }\r\n\r\n if (max)\r\n {\r\n out.splice(max);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = Range;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/Range.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/Remove.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/utils/array/Remove.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SpliceOne = __webpack_require__(/*! ./SpliceOne */ \"./node_modules/phaser/src/utils/array/SpliceOne.js\");\r\n\r\n/**\r\n * Removes the given item, or array of items, from the array.\r\n * \r\n * The array is modified in-place.\r\n * \r\n * You can optionally specify a callback to be invoked for each item successfully removed from the array.\r\n *\r\n * @function Phaser.Utils.Array.Remove\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to be modified.\r\n * @param {*|Array.<*>} item - The item, or array of items, to be removed from the array.\r\n * @param {function} [callback] - A callback to be invoked for each item successfully removed from the array.\r\n * @param {object} [context] - The context in which the callback is invoked.\r\n *\r\n * @return {*|Array.<*>} The item, or array of items, that were successfully removed from the array.\r\n */\r\nvar Remove = function (array, item, callback, context)\r\n{\r\n if (context === undefined) { context = array; }\r\n\r\n var index;\r\n\r\n // Fast path to avoid array mutation and iteration\r\n if (!Array.isArray(item))\r\n {\r\n index = array.indexOf(item);\r\n\r\n if (index !== -1)\r\n {\r\n SpliceOne(array, index);\r\n\r\n if (callback)\r\n {\r\n callback.call(context, item);\r\n }\r\n\r\n return item;\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n // If we got this far, we have an array of items to remove\r\n\r\n var itemLength = item.length - 1;\r\n\r\n while (itemLength >= 0)\r\n {\r\n var entry = item[itemLength];\r\n\r\n index = array.indexOf(entry);\r\n\r\n if (index !== -1)\r\n {\r\n SpliceOne(array, index);\r\n\r\n if (callback)\r\n {\r\n callback.call(context, entry);\r\n }\r\n }\r\n else\r\n {\r\n // Item wasn't found in the array, so remove it from our return results\r\n item.pop();\r\n }\r\n\r\n itemLength--;\r\n }\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = Remove;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/Remove.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/RemoveAt.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/utils/array/RemoveAt.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SpliceOne = __webpack_require__(/*! ./SpliceOne */ \"./node_modules/phaser/src/utils/array/SpliceOne.js\");\r\n\r\n/**\r\n * Removes the item from the given position in the array.\r\n * \r\n * The array is modified in-place.\r\n * \r\n * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array.\r\n *\r\n * @function Phaser.Utils.Array.RemoveAt\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to be modified.\r\n * @param {integer} index - The array index to remove the item from. The index must be in bounds or it will throw an error.\r\n * @param {function} [callback] - A callback to be invoked for the item removed from the array.\r\n * @param {object} [context] - The context in which the callback is invoked.\r\n *\r\n * @return {*} The item that was removed.\r\n */\r\nvar RemoveAt = function (array, index, callback, context)\r\n{\r\n if (context === undefined) { context = array; }\r\n\r\n if (index < 0 || index > array.length - 1)\r\n {\r\n throw new Error('Index out of bounds');\r\n }\r\n\r\n var item = SpliceOne(array, index);\r\n\r\n if (callback)\r\n {\r\n callback.call(context, item);\r\n }\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = RemoveAt;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/RemoveAt.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/RemoveBetween.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/RemoveBetween.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SafeRange = __webpack_require__(/*! ./SafeRange */ \"./node_modules/phaser/src/utils/array/SafeRange.js\");\r\n\r\n/**\r\n * Removes the item within the given range in the array.\r\n * \r\n * The array is modified in-place.\r\n * \r\n * You can optionally specify a callback to be invoked for the item/s successfully removed from the array.\r\n *\r\n * @function Phaser.Utils.Array.RemoveBetween\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to be modified.\r\n * @param {integer} startIndex - The start index to remove from.\r\n * @param {integer} endIndex - The end index to remove to.\r\n * @param {function} [callback] - A callback to be invoked for the item removed from the array.\r\n * @param {object} [context] - The context in which the callback is invoked.\r\n *\r\n * @return {Array.<*>} An array of items that were removed.\r\n */\r\nvar RemoveBetween = function (array, startIndex, endIndex, callback, context)\r\n{\r\n if (startIndex === undefined) { startIndex = 0; }\r\n if (endIndex === undefined) { endIndex = array.length; }\r\n if (context === undefined) { context = array; }\r\n\r\n if (SafeRange(array, startIndex, endIndex))\r\n {\r\n var size = endIndex - startIndex;\r\n\r\n var removed = array.splice(startIndex, size);\r\n\r\n if (callback)\r\n {\r\n for (var i = 0; i < removed.length; i++)\r\n {\r\n var entry = removed[i];\r\n\r\n callback.call(context, entry);\r\n }\r\n }\r\n\r\n return removed;\r\n }\r\n else\r\n {\r\n return [];\r\n }\r\n};\r\n\r\nmodule.exports = RemoveBetween;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/RemoveBetween.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/RemoveRandomElement.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/RemoveRandomElement.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SpliceOne = __webpack_require__(/*! ./SpliceOne */ \"./node_modules/phaser/src/utils/array/SpliceOne.js\");\r\n\r\n/**\r\n * Removes a random object from the given array and returns it.\r\n * Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index.\r\n *\r\n * @function Phaser.Utils.Array.RemoveRandomElement\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to removed a random element from.\r\n * @param {integer} [start=0] - The array index to start the search from.\r\n * @param {integer} [length=array.length] - Optional restriction on the number of elements to randomly select from.\r\n *\r\n * @return {object} The random element that was removed, or `null` if there were no array elements that fell within the given range.\r\n */\r\nvar RemoveRandomElement = function (array, start, length)\r\n{\r\n if (start === undefined) { start = 0; }\r\n if (length === undefined) { length = array.length; }\r\n\r\n var randomIndex = start + Math.floor(Math.random() * length);\r\n\r\n return SpliceOne(array, randomIndex);\r\n};\r\n\r\nmodule.exports = RemoveRandomElement;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/RemoveRandomElement.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/Replace.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/utils/array/Replace.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Replaces an element of the array with the new element.\r\n * The new element cannot already be a member of the array.\r\n * The array is modified in-place.\r\n *\r\n * @function Phaser.Utils.Array.Replace\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to search within.\r\n * @param {*} oldChild - The element in the array that will be replaced.\r\n * @param {*} newChild - The element to be inserted into the array at the position of `oldChild`.\r\n *\r\n * @return {boolean} Returns true if the oldChild was successfully replaced, otherwise returns false.\r\n */\r\nvar Replace = function (array, oldChild, newChild)\r\n{\r\n var index1 = array.indexOf(oldChild);\r\n var index2 = array.indexOf(newChild);\r\n\r\n if (index1 !== -1 && index2 === -1)\r\n {\r\n array[index1] = newChild;\r\n\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n};\r\n\r\nmodule.exports = Replace;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/Replace.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/RotateLeft.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/utils/array/RotateLeft.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Moves the element at the start of the array to the end, shifting all items in the process.\r\n * The \"rotation\" happens to the left.\r\n *\r\n * @function Phaser.Utils.Array.RotateLeft\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to shift to the left. This array is modified in place.\r\n * @param {integer} [total=1] - The number of times to shift the array.\r\n *\r\n * @return {*} The most recently shifted element.\r\n */\r\nvar RotateLeft = function (array, total)\r\n{\r\n if (total === undefined) { total = 1; }\r\n\r\n var element = null;\r\n\r\n for (var i = 0; i < total; i++)\r\n {\r\n element = array.shift();\r\n array.push(element);\r\n }\r\n\r\n return element;\r\n};\r\n\r\nmodule.exports = RotateLeft;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/RotateLeft.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/RotateRight.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/RotateRight.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Moves the element at the end of the array to the start, shifting all items in the process.\r\n * The \"rotation\" happens to the right.\r\n *\r\n * @function Phaser.Utils.Array.RotateRight\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to shift to the right. This array is modified in place.\r\n * @param {integer} [total=1] - The number of times to shift the array.\r\n *\r\n * @return {*} The most recently shifted element.\r\n */\r\nvar RotateRight = function (array, total)\r\n{\r\n if (total === undefined) { total = 1; }\r\n\r\n var element = null;\r\n\r\n for (var i = 0; i < total; i++)\r\n {\r\n element = array.pop();\r\n array.unshift(element);\r\n }\r\n\r\n return element;\r\n};\r\n\r\nmodule.exports = RotateRight;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/RotateRight.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/SafeRange.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/utils/array/SafeRange.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Tests if the start and end indexes are a safe range for the given array.\r\n * \r\n * @function Phaser.Utils.Array.SafeRange\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to check.\r\n * @param {integer} startIndex - The start index.\r\n * @param {integer} endIndex - The end index.\r\n * @param {boolean} [throwError=true] - Throw an error if the range is out of bounds.\r\n *\r\n * @return {boolean} True if the range is safe, otherwise false.\r\n */\r\nvar SafeRange = function (array, startIndex, endIndex, throwError)\r\n{\r\n var len = array.length;\r\n\r\n if (startIndex < 0 ||\r\n startIndex > len ||\r\n startIndex >= endIndex ||\r\n endIndex > len ||\r\n startIndex + endIndex > len)\r\n {\r\n if (throwError)\r\n {\r\n throw new Error('Range Error: Values outside acceptable range');\r\n }\r\n\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n};\r\n\r\nmodule.exports = SafeRange;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/SafeRange.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/SendToBack.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/utils/array/SendToBack.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Moves the given element to the bottom of the array.\r\n * The array is modified in-place.\r\n *\r\n * @function Phaser.Utils.Array.SendToBack\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array.\r\n * @param {*} item - The element to move.\r\n *\r\n * @return {*} The element that was moved.\r\n */\r\nvar SendToBack = function (array, item)\r\n{\r\n var currentIndex = array.indexOf(item);\r\n\r\n if (currentIndex !== -1 && currentIndex > 0)\r\n {\r\n array.splice(currentIndex, 1);\r\n array.unshift(item);\r\n }\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = SendToBack;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/SendToBack.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/SetAll.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/utils/array/SetAll.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SafeRange = __webpack_require__(/*! ./SafeRange */ \"./node_modules/phaser/src/utils/array/SafeRange.js\");\r\n\r\n/**\r\n * Scans the array for elements with the given property. If found, the property is set to the `value`.\r\n *\r\n * For example: `SetAll('visible', true)` would set all elements that have a `visible` property to `false`.\r\n *\r\n * Optionally you can specify a start and end index. For example if the array had 100 elements,\r\n * and you set `startIndex` to 0 and `endIndex` to 50, it would update only the first 50 elements.\r\n *\r\n * @function Phaser.Utils.Array.SetAll\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to search.\r\n * @param {string} property - The property to test for on each array element.\r\n * @param {*} value - The value to set the property to.\r\n * @param {integer} [startIndex] - An optional start index to search from.\r\n * @param {integer} [endIndex] - An optional end index to search to.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar SetAll = function (array, property, value, startIndex, endIndex)\r\n{\r\n if (startIndex === undefined) { startIndex = 0; }\r\n if (endIndex === undefined) { endIndex = array.length; }\r\n\r\n if (SafeRange(array, startIndex, endIndex))\r\n {\r\n for (var i = startIndex; i < endIndex; i++)\r\n {\r\n var entry = array[i];\r\n\r\n if (entry.hasOwnProperty(property))\r\n {\r\n entry[property] = value;\r\n }\r\n }\r\n }\r\n\r\n return array;\r\n};\r\n\r\nmodule.exports = SetAll;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/SetAll.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/Shuffle.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/utils/array/Shuffle.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Shuffles the contents of the given array using the Fisher-Yates implementation.\r\n *\r\n * The original array is modified directly and returned.\r\n *\r\n * @function Phaser.Utils.Array.Shuffle\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[]} - [array,$return]\r\n *\r\n * @param {T[]} array - The array to shuffle. This array is modified in place.\r\n *\r\n * @return {T[]} The shuffled array.\r\n */\r\nvar Shuffle = function (array)\r\n{\r\n for (var i = array.length - 1; i > 0; i--)\r\n {\r\n var j = Math.floor(Math.random() * (i + 1));\r\n var temp = array[i];\r\n array[i] = array[j];\r\n array[j] = temp;\r\n }\r\n\r\n return array;\r\n};\r\n\r\nmodule.exports = Shuffle;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/Shuffle.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/SpliceOne.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/utils/array/SpliceOne.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Removes a single item from an array and returns it without creating gc, like the native splice does.\r\n * Based on code by Mike Reinstein.\r\n *\r\n * @function Phaser.Utils.Array.SpliceOne\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to splice from.\r\n * @param {integer} index - The index of the item which should be spliced.\r\n *\r\n * @return {*} The item which was spliced (removed).\r\n */\r\nvar SpliceOne = function (array, index)\r\n{\r\n if (index >= array.length)\r\n {\r\n return;\r\n }\r\n\r\n var len = array.length - 1;\r\n\r\n var item = array[index];\r\n\r\n for (var i = index; i < len; i++)\r\n {\r\n array[i] = array[i + 1];\r\n }\r\n\r\n array.length = len;\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = SpliceOne;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/SpliceOne.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/StableSort.js": /*!***********************************************************!*\ !*** ./node_modules/phaser/src/utils/array/StableSort.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n//! stable.js 0.1.6, https://github.com/Two-Screen/stable\r\n//! © 2017 Angry Bytes and contributors. MIT licensed.\r\n\r\n/**\r\n * @namespace Phaser.Utils.Array.StableSortFunctions\r\n */\r\n\r\n(function() {\r\n\r\n /**\r\n * A stable array sort, because `Array#sort()` is not guaranteed stable.\r\n * This is an implementation of merge sort, without recursion.\r\n *\r\n * @function Phaser.Utils.Array.StableSort\r\n * @since 3.0.0\r\n *\r\n * @param {array} arr - The input array to be sorted.\r\n * @param {function} comp - The comparison handler.\r\n *\r\n * @return {array} The sorted result.\r\n */\r\nvar stable = function(arr, comp) {\r\n return exec(arr.slice(), comp);\r\n};\r\n\r\n /**\r\n * Sort the input array and simply copy it back if the result isn't in the original array, which happens on an odd number of passes.\r\n *\r\n * @function Phaser.Utils.Array.StableSortFunctions.inplace\r\n * @memberof Phaser.Utils.Array.StableSortFunctions\r\n * @since 3.0.0\r\n *\r\n * @param {array} arr - The input array.\r\n * @param {function} comp - The comparison handler.\r\n *\r\n * @return {array} The sorted array.\r\n */\r\nstable.inplace = function(arr, comp) {\r\n var result = exec(arr, comp);\r\n\r\n // This simply copies back if the result isn't in the original array,\r\n // which happens on an odd number of passes.\r\n if (result !== arr) {\r\n pass(result, null, arr.length, arr);\r\n }\r\n\r\n return arr;\r\n};\r\n\r\n// Execute the sort using the input array and a second buffer as work space.\r\n// Returns one of those two, containing the final result.\r\nfunction exec(arr, comp) {\r\n if (typeof(comp) !== 'function') {\r\n comp = function(a, b) {\r\n return String(a).localeCompare(b);\r\n };\r\n }\r\n\r\n // Short-circuit when there's nothing to sort.\r\n var len = arr.length;\r\n if (len <= 1) {\r\n return arr;\r\n }\r\n\r\n // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc.\r\n // Chunks are the size of the left or right hand in merge sort.\r\n // Stop when the left-hand covers all of the array.\r\n var buffer = new Array(len);\r\n for (var chk = 1; chk < len; chk *= 2) {\r\n pass(arr, comp, chk, buffer);\r\n\r\n var tmp = arr;\r\n arr = buffer;\r\n buffer = tmp;\r\n }\r\n\r\n return arr;\r\n}\r\n\r\n// Run a single pass with the given chunk size.\r\nvar pass = function(arr, comp, chk, result) {\r\n var len = arr.length;\r\n var i = 0;\r\n // Step size / double chunk size.\r\n var dbl = chk * 2;\r\n // Bounds of the left and right chunks.\r\n var l, r, e;\r\n // Iterators over the left and right chunk.\r\n var li, ri;\r\n\r\n // Iterate over pairs of chunks.\r\n for (l = 0; l < len; l += dbl) {\r\n r = l + chk;\r\n e = r + chk;\r\n if (r > len) r = len;\r\n if (e > len) e = len;\r\n\r\n // Iterate both chunks in parallel.\r\n li = l;\r\n ri = r;\r\n while (true) {\r\n // Compare the chunks.\r\n if (li < r && ri < e) {\r\n // This works for a regular `sort()` compatible comparator,\r\n // but also for a simple comparator like: `a > b`\r\n if (comp(arr[li], arr[ri]) <= 0) {\r\n result[i++] = arr[li++];\r\n }\r\n else {\r\n result[i++] = arr[ri++];\r\n }\r\n }\r\n // Nothing to compare, just flush what's left.\r\n else if (li < r) {\r\n result[i++] = arr[li++];\r\n }\r\n else if (ri < e) {\r\n result[i++] = arr[ri++];\r\n }\r\n // Both iterators are at the chunk ends.\r\n else {\r\n break;\r\n }\r\n }\r\n }\r\n};\r\n\r\n// Export using CommonJS or to the window.\r\nif (true) {\r\n module.exports = stable;\r\n}\r\nelse {}\r\n\r\n})();\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/StableSort.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/Swap.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/utils/array/Swap.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Swaps the position of two elements in the given array.\r\n * The elements must exist in the same array.\r\n * The array is modified in-place.\r\n *\r\n * @function Phaser.Utils.Array.Swap\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The input array.\r\n * @param {*} item1 - The first element to swap.\r\n * @param {*} item2 - The second element to swap.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar Swap = function (array, item1, item2)\r\n{\r\n if (item1 === item2)\r\n {\r\n return;\r\n }\r\n\r\n var index1 = array.indexOf(item1);\r\n var index2 = array.indexOf(item2);\r\n\r\n if (index1 < 0 || index2 < 0)\r\n {\r\n throw new Error('Supplied items must be elements of the same array');\r\n }\r\n\r\n array[index1] = item2;\r\n array[index2] = item1;\r\n\r\n return array;\r\n};\r\n\r\nmodule.exports = Swap;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/Swap.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/index.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/utils/array/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Utils.Array\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Matrix: __webpack_require__(/*! ./matrix */ \"./node_modules/phaser/src/utils/array/matrix/index.js\"),\r\n\r\n Add: __webpack_require__(/*! ./Add */ \"./node_modules/phaser/src/utils/array/Add.js\"),\r\n AddAt: __webpack_require__(/*! ./AddAt */ \"./node_modules/phaser/src/utils/array/AddAt.js\"),\r\n BringToTop: __webpack_require__(/*! ./BringToTop */ \"./node_modules/phaser/src/utils/array/BringToTop.js\"),\r\n CountAllMatching: __webpack_require__(/*! ./CountAllMatching */ \"./node_modules/phaser/src/utils/array/CountAllMatching.js\"),\r\n Each: __webpack_require__(/*! ./Each */ \"./node_modules/phaser/src/utils/array/Each.js\"),\r\n EachInRange: __webpack_require__(/*! ./EachInRange */ \"./node_modules/phaser/src/utils/array/EachInRange.js\"),\r\n FindClosestInSorted: __webpack_require__(/*! ./FindClosestInSorted */ \"./node_modules/phaser/src/utils/array/FindClosestInSorted.js\"),\r\n GetAll: __webpack_require__(/*! ./GetAll */ \"./node_modules/phaser/src/utils/array/GetAll.js\"),\r\n GetFirst: __webpack_require__(/*! ./GetFirst */ \"./node_modules/phaser/src/utils/array/GetFirst.js\"),\r\n GetRandom: __webpack_require__(/*! ./GetRandom */ \"./node_modules/phaser/src/utils/array/GetRandom.js\"),\r\n MoveDown: __webpack_require__(/*! ./MoveDown */ \"./node_modules/phaser/src/utils/array/MoveDown.js\"),\r\n MoveTo: __webpack_require__(/*! ./MoveTo */ \"./node_modules/phaser/src/utils/array/MoveTo.js\"),\r\n MoveUp: __webpack_require__(/*! ./MoveUp */ \"./node_modules/phaser/src/utils/array/MoveUp.js\"),\r\n NumberArray: __webpack_require__(/*! ./NumberArray */ \"./node_modules/phaser/src/utils/array/NumberArray.js\"),\r\n NumberArrayStep: __webpack_require__(/*! ./NumberArrayStep */ \"./node_modules/phaser/src/utils/array/NumberArrayStep.js\"),\r\n QuickSelect: __webpack_require__(/*! ./QuickSelect */ \"./node_modules/phaser/src/utils/array/QuickSelect.js\"),\r\n Range: __webpack_require__(/*! ./Range */ \"./node_modules/phaser/src/utils/array/Range.js\"),\r\n Remove: __webpack_require__(/*! ./Remove */ \"./node_modules/phaser/src/utils/array/Remove.js\"),\r\n RemoveAt: __webpack_require__(/*! ./RemoveAt */ \"./node_modules/phaser/src/utils/array/RemoveAt.js\"),\r\n RemoveBetween: __webpack_require__(/*! ./RemoveBetween */ \"./node_modules/phaser/src/utils/array/RemoveBetween.js\"),\r\n RemoveRandomElement: __webpack_require__(/*! ./RemoveRandomElement */ \"./node_modules/phaser/src/utils/array/RemoveRandomElement.js\"),\r\n Replace: __webpack_require__(/*! ./Replace */ \"./node_modules/phaser/src/utils/array/Replace.js\"),\r\n RotateLeft: __webpack_require__(/*! ./RotateLeft */ \"./node_modules/phaser/src/utils/array/RotateLeft.js\"),\r\n RotateRight: __webpack_require__(/*! ./RotateRight */ \"./node_modules/phaser/src/utils/array/RotateRight.js\"),\r\n SafeRange: __webpack_require__(/*! ./SafeRange */ \"./node_modules/phaser/src/utils/array/SafeRange.js\"),\r\n SendToBack: __webpack_require__(/*! ./SendToBack */ \"./node_modules/phaser/src/utils/array/SendToBack.js\"),\r\n SetAll: __webpack_require__(/*! ./SetAll */ \"./node_modules/phaser/src/utils/array/SetAll.js\"),\r\n Shuffle: __webpack_require__(/*! ./Shuffle */ \"./node_modules/phaser/src/utils/array/Shuffle.js\"),\r\n SpliceOne: __webpack_require__(/*! ./SpliceOne */ \"./node_modules/phaser/src/utils/array/SpliceOne.js\"),\r\n StableSort: __webpack_require__(/*! ./StableSort */ \"./node_modules/phaser/src/utils/array/StableSort.js\"),\r\n Swap: __webpack_require__(/*! ./Swap */ \"./node_modules/phaser/src/utils/array/Swap.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/matrix/CheckMatrix.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/matrix/CheckMatrix.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if an array can be used as a matrix.\r\n *\r\n * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) have the same length. There must be at least two rows:\r\n *\r\n * ```\r\n * [\r\n * [ 1, 1, 1, 1, 1, 1 ],\r\n * [ 2, 0, 0, 0, 0, 4 ],\r\n * [ 2, 0, 1, 2, 0, 4 ],\r\n * [ 2, 0, 3, 4, 0, 4 ],\r\n * [ 2, 0, 0, 0, 0, 4 ],\r\n * [ 3, 3, 3, 3, 3, 3 ]\r\n * ]\r\n * ```\r\n *\r\n * @function Phaser.Utils.Array.Matrix.CheckMatrix\r\n * @since 3.0.0\r\n * \r\n * @generic T\r\n * @genericUse {T[][]} - [matrix]\r\n *\r\n * @param {T[][]} [matrix] - The array to check.\r\n *\r\n * @return {boolean} `true` if the given `matrix` array is a valid matrix.\r\n */\r\nvar CheckMatrix = function (matrix)\r\n{\r\n if (!Array.isArray(matrix) || matrix.length < 2 || !Array.isArray(matrix[0]))\r\n {\r\n return false;\r\n }\r\n\r\n // How long is the first row?\r\n var size = matrix[0].length;\r\n\r\n // Validate the rest of the rows are the same length\r\n for (var i = 1; i < matrix.length; i++)\r\n {\r\n if (matrix[i].length !== size)\r\n {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nmodule.exports = CheckMatrix;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/matrix/CheckMatrix.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/matrix/MatrixToString.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/matrix/MatrixToString.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Pad = __webpack_require__(/*! ../../string/Pad */ \"./node_modules/phaser/src/utils/string/Pad.js\");\r\nvar CheckMatrix = __webpack_require__(/*! ./CheckMatrix */ \"./node_modules/phaser/src/utils/array/matrix/CheckMatrix.js\");\r\n\r\n/**\r\n * Generates a string (which you can pass to console.log) from the given Array Matrix.\r\n *\r\n * @function Phaser.Utils.Array.Matrix.MatrixToString\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[][]} - [matrix]\r\n *\r\n * @param {T[][]} [matrix] - A 2-dimensional array.\r\n *\r\n * @return {string} A string representing the matrix.\r\n */\r\nvar MatrixToString = function (matrix)\r\n{\r\n var str = '';\r\n\r\n if (!CheckMatrix(matrix))\r\n {\r\n return str;\r\n }\r\n\r\n for (var r = 0; r < matrix.length; r++)\r\n {\r\n for (var c = 0; c < matrix[r].length; c++)\r\n {\r\n var cell = matrix[r][c].toString();\r\n\r\n if (cell !== 'undefined')\r\n {\r\n str += Pad(cell, 2);\r\n }\r\n else\r\n {\r\n str += '?';\r\n }\r\n\r\n if (c < matrix[r].length - 1)\r\n {\r\n str += ' |';\r\n }\r\n }\r\n\r\n if (r < matrix.length - 1)\r\n {\r\n str += '\\n';\r\n\r\n for (var i = 0; i < matrix[r].length; i++)\r\n {\r\n str += '---';\r\n\r\n if (i < matrix[r].length - 1)\r\n {\r\n str += '+';\r\n }\r\n }\r\n\r\n str += '\\n';\r\n }\r\n\r\n }\r\n\r\n return str;\r\n};\r\n\r\nmodule.exports = MatrixToString;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/matrix/MatrixToString.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/matrix/ReverseColumns.js": /*!**********************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/matrix/ReverseColumns.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Reverses the columns in the given Array Matrix.\r\n *\r\n * @function Phaser.Utils.Array.Matrix.ReverseColumns\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[][]} - [matrix,$return]\r\n *\r\n * @param {T[][]} [matrix] - The array matrix to reverse the columns for.\r\n *\r\n * @return {T[][]} The column reversed matrix.\r\n */\r\nvar ReverseColumns = function (matrix)\r\n{\r\n return matrix.reverse();\r\n};\r\n\r\nmodule.exports = ReverseColumns;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/matrix/ReverseColumns.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/matrix/ReverseRows.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/matrix/ReverseRows.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Reverses the rows in the given Array Matrix.\r\n *\r\n * @function Phaser.Utils.Array.Matrix.ReverseRows\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[][]} - [matrix,$return]\r\n *\r\n * @param {T[][]} [matrix] - The array matrix to reverse the rows for.\r\n *\r\n * @return {T[][]} The column reversed matrix.\r\n */\r\nvar ReverseRows = function (matrix)\r\n{\r\n for (var i = 0; i < matrix.length; i++)\r\n {\r\n matrix[i].reverse();\r\n }\r\n\r\n return matrix;\r\n};\r\n\r\nmodule.exports = ReverseRows;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/matrix/ReverseRows.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/matrix/Rotate180.js": /*!*****************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/matrix/Rotate180.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RotateMatrix = __webpack_require__(/*! ./RotateMatrix */ \"./node_modules/phaser/src/utils/array/matrix/RotateMatrix.js\");\r\n\r\n/**\r\n * Rotates the array matrix 180 degrees.\r\n *\r\n * @function Phaser.Utils.Array.Matrix.Rotate180\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[][]} - [matrix,$return]\r\n *\r\n * @param {T[][]} [matrix] - The array to rotate.\r\n *\r\n * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix.\r\n */\r\nvar Rotate180 = function (matrix)\r\n{\r\n return RotateMatrix(matrix, 180);\r\n};\r\n\r\nmodule.exports = Rotate180;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/matrix/Rotate180.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/matrix/RotateLeft.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/matrix/RotateLeft.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RotateMatrix = __webpack_require__(/*! ./RotateMatrix */ \"./node_modules/phaser/src/utils/array/matrix/RotateMatrix.js\");\r\n\r\n/**\r\n * Rotates the array matrix to the left (or 90 degrees)\r\n *\r\n * @function Phaser.Utils.Array.Matrix.RotateLeft\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[][]} - [matrix,$return]\r\n *\r\n * @param {T[][]} [matrix] - The array to rotate.\r\n *\r\n * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix.\r\n */\r\nvar RotateLeft = function (matrix)\r\n{\r\n return RotateMatrix(matrix, 90);\r\n};\r\n\r\nmodule.exports = RotateLeft;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/matrix/RotateLeft.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/matrix/RotateMatrix.js": /*!********************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/matrix/RotateMatrix.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CheckMatrix = __webpack_require__(/*! ./CheckMatrix */ \"./node_modules/phaser/src/utils/array/matrix/CheckMatrix.js\");\r\nvar TransposeMatrix = __webpack_require__(/*! ./TransposeMatrix */ \"./node_modules/phaser/src/utils/array/matrix/TransposeMatrix.js\");\r\n\r\n/**\r\n * Rotates the array matrix based on the given rotation value.\r\n *\r\n * The value can be given in degrees: 90, -90, 270, -270 or 180,\r\n * or a string command: `rotateLeft`, `rotateRight` or `rotate180`.\r\n *\r\n * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}.\r\n *\r\n * @function Phaser.Utils.Array.Matrix.RotateMatrix\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[][]} - [matrix,$return]\r\n *\r\n * @param {T[][]} [matrix] - The array to rotate.\r\n * @param {(number|string)} [direction=90] - The amount to rotate the matrix by.\r\n *\r\n * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix.\r\n */\r\nvar RotateMatrix = function (matrix, direction)\r\n{\r\n if (direction === undefined) { direction = 90; }\r\n\r\n if (!CheckMatrix(matrix))\r\n {\r\n return null;\r\n }\r\n\r\n if (typeof direction !== 'string')\r\n {\r\n direction = ((direction % 360) + 360) % 360;\r\n }\r\n\r\n if (direction === 90 || direction === -270 || direction === 'rotateLeft')\r\n {\r\n matrix = TransposeMatrix(matrix);\r\n matrix.reverse();\r\n }\r\n else if (direction === -90 || direction === 270 || direction === 'rotateRight')\r\n {\r\n matrix.reverse();\r\n matrix = TransposeMatrix(matrix);\r\n }\r\n else if (Math.abs(direction) === 180 || direction === 'rotate180')\r\n {\r\n for (var i = 0; i < matrix.length; i++)\r\n {\r\n matrix[i].reverse();\r\n }\r\n\r\n matrix.reverse();\r\n }\r\n\r\n return matrix;\r\n};\r\n\r\nmodule.exports = RotateMatrix;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/matrix/RotateMatrix.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/matrix/RotateRight.js": /*!*******************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/matrix/RotateRight.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RotateMatrix = __webpack_require__(/*! ./RotateMatrix */ \"./node_modules/phaser/src/utils/array/matrix/RotateMatrix.js\");\r\n\r\n/**\r\n * Rotates the array matrix to the left (or -90 degrees)\r\n *\r\n * @function Phaser.Utils.Array.Matrix.RotateRight\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[][]} - [matrix,$return]\r\n *\r\n * @param {T[][]} [matrix] - The array to rotate.\r\n *\r\n * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix.\r\n */\r\nvar RotateRight = function (matrix)\r\n{\r\n return RotateMatrix(matrix, -90);\r\n};\r\n\r\nmodule.exports = RotateRight;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/matrix/RotateRight.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/matrix/TransposeMatrix.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/matrix/TransposeMatrix.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Transposes the elements of the given matrix (array of arrays).\r\n *\r\n * The transpose of a matrix is a new matrix whose rows are the columns of the original.\r\n *\r\n * @function Phaser.Utils.Array.Matrix.TransposeMatrix\r\n * @since 3.0.0\r\n * \r\n * @generic T\r\n * @genericUse {T[][]} - [array,$return]\r\n * \r\n * @param {T[][]} [array] - The array matrix to transpose.\r\n *\r\n * @return {T[][]} A new array matrix which is a transposed version of the given array.\r\n */\r\nvar TransposeMatrix = function (array)\r\n{\r\n var sourceRowCount = array.length;\r\n var sourceColCount = array[0].length;\r\n\r\n var result = new Array(sourceColCount);\r\n\r\n for (var i = 0; i < sourceColCount; i++)\r\n {\r\n result[i] = new Array(sourceRowCount);\r\n\r\n for (var j = sourceRowCount - 1; j > -1; j--)\r\n {\r\n result[i][j] = array[j][i];\r\n }\r\n }\r\n\r\n return result;\r\n};\r\n\r\nmodule.exports = TransposeMatrix;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/matrix/TransposeMatrix.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/array/matrix/index.js": /*!*************************************************************!*\ !*** ./node_modules/phaser/src/utils/array/matrix/index.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Utils.Array.Matrix\r\n */\r\n\r\nmodule.exports = {\r\n\r\n CheckMatrix: __webpack_require__(/*! ./CheckMatrix */ \"./node_modules/phaser/src/utils/array/matrix/CheckMatrix.js\"),\r\n MatrixToString: __webpack_require__(/*! ./MatrixToString */ \"./node_modules/phaser/src/utils/array/matrix/MatrixToString.js\"),\r\n ReverseColumns: __webpack_require__(/*! ./ReverseColumns */ \"./node_modules/phaser/src/utils/array/matrix/ReverseColumns.js\"),\r\n ReverseRows: __webpack_require__(/*! ./ReverseRows */ \"./node_modules/phaser/src/utils/array/matrix/ReverseRows.js\"),\r\n Rotate180: __webpack_require__(/*! ./Rotate180 */ \"./node_modules/phaser/src/utils/array/matrix/Rotate180.js\"),\r\n RotateLeft: __webpack_require__(/*! ./RotateLeft */ \"./node_modules/phaser/src/utils/array/matrix/RotateLeft.js\"),\r\n RotateMatrix: __webpack_require__(/*! ./RotateMatrix */ \"./node_modules/phaser/src/utils/array/matrix/RotateMatrix.js\"),\r\n RotateRight: __webpack_require__(/*! ./RotateRight */ \"./node_modules/phaser/src/utils/array/matrix/RotateRight.js\"),\r\n TransposeMatrix: __webpack_require__(/*! ./TransposeMatrix */ \"./node_modules/phaser/src/utils/array/matrix/TransposeMatrix.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/array/matrix/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/base64/ArrayBufferToBase64.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/utils/base64/ArrayBufferToBase64.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer)\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\r\n\r\n/**\r\n * Converts an ArrayBuffer into a base64 string.\r\n * \r\n * The resulting string can optionally be a data uri if the `mediaType` argument is provided.\r\n * \r\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs for more details.\r\n *\r\n * @function Phaser.Utils.Base64.ArrayBufferToBase64\r\n * @since 3.18.0\r\n * \r\n * @param {ArrayBuffer} arrayBuffer - The Array Buffer to encode.\r\n * @param {string} [mediaType] - An optional media type, i.e. `audio/ogg` or `image/jpeg`. If included the resulting string will be a data URI.\r\n * \r\n * @return {string} The base64 encoded Array Buffer.\r\n */\r\nvar ArrayBufferToBase64 = function (arrayBuffer, mediaType)\r\n{\r\n var bytes = new Uint8Array(arrayBuffer);\r\n var len = bytes.length;\r\n\r\n var base64 = (mediaType) ? 'data:' + mediaType + ';base64,' : '';\r\n\r\n for (var i = 0; i < len; i += 3)\r\n {\r\n base64 += chars[bytes[i] >> 2];\r\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\r\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\r\n base64 += chars[bytes[i + 2] & 63];\r\n }\r\n\r\n if ((len % 3) === 2)\r\n {\r\n base64 = base64.substring(0, base64.length - 1) + '=';\r\n }\r\n else if (len % 3 === 1)\r\n {\r\n base64 = base64.substring(0, base64.length - 2) + '==';\r\n }\r\n \r\n return base64;\r\n};\r\n\r\nmodule.exports = ArrayBufferToBase64;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/base64/ArrayBufferToBase64.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/base64/Base64ToArrayBuffer.js": /*!*********************************************************************!*\ !*** ./node_modules/phaser/src/utils/base64/Base64ToArrayBuffer.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer)\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\r\n\r\n// Use a lookup table to find the index.\r\nvar lookup = new Uint8Array(256);\r\n\r\nfor (var i = 0; i < chars.length; i++)\r\n{\r\n lookup[chars.charCodeAt(i)] = i;\r\n}\r\n\r\n/**\r\n * Converts a base64 string, either with or without a data uri, into an Array Buffer.\r\n *\r\n * @function Phaser.Utils.Base64.Base64ToArrayBuffer\r\n * @since 3.18.0\r\n * \r\n * @param {string} base64 - The base64 string to be decoded. Can optionally contain a data URI header, which will be stripped out prior to decoding.\r\n * \r\n * @return {ArrayBuffer} An ArrayBuffer decoded from the base64 data.\r\n */\r\nvar Base64ToArrayBuffer = function (base64)\r\n{\r\n // Is it a data uri? if so, strip the header away\r\n base64 = base64.substr(base64.indexOf(',') + 1);\r\n\r\n var len = base64.length;\r\n var bufferLength = len * 0.75;\r\n var p = 0;\r\n var encoded1;\r\n var encoded2;\r\n var encoded3;\r\n var encoded4;\r\n\r\n if (base64[len - 1] === '=')\r\n {\r\n bufferLength--;\r\n\r\n if (base64[len - 2] === '=')\r\n {\r\n bufferLength--;\r\n }\r\n }\r\n\r\n var arrayBuffer = new ArrayBuffer(bufferLength);\r\n var bytes = new Uint8Array(arrayBuffer);\r\n\r\n for (var i = 0; i < len; i += 4)\r\n {\r\n encoded1 = lookup[base64.charCodeAt(i)];\r\n encoded2 = lookup[base64.charCodeAt(i + 1)];\r\n encoded3 = lookup[base64.charCodeAt(i + 2)];\r\n encoded4 = lookup[base64.charCodeAt(i + 3)];\r\n\r\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\r\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\r\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\r\n }\r\n\r\n return arrayBuffer;\r\n};\r\n\r\nmodule.exports = Base64ToArrayBuffer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/base64/Base64ToArrayBuffer.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/base64/index.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/utils/base64/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Utils.Base64\r\n */\r\n\r\nmodule.exports = {\r\n\r\n ArrayBufferToBase64: __webpack_require__(/*! ./ArrayBufferToBase64 */ \"./node_modules/phaser/src/utils/base64/ArrayBufferToBase64.js\"),\r\n Base64ToArrayBuffer: __webpack_require__(/*! ./Base64ToArrayBuffer */ \"./node_modules/phaser/src/utils/base64/Base64ToArrayBuffer.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/base64/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/index.js": /*!************************************************!*\ !*** ./node_modules/phaser/src/utils/index.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Utils\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Array: __webpack_require__(/*! ./array/ */ \"./node_modules/phaser/src/utils/array/index.js\"),\r\n Base64: __webpack_require__(/*! ./base64/ */ \"./node_modules/phaser/src/utils/base64/index.js\"),\r\n Objects: __webpack_require__(/*! ./object/ */ \"./node_modules/phaser/src/utils/object/index.js\"),\r\n String: __webpack_require__(/*! ./string/ */ \"./node_modules/phaser/src/utils/string/index.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/object/Clone.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/utils/object/Clone.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Shallow Object Clone. Will not clone nested objects.\r\n *\r\n * @function Phaser.Utils.Objects.Clone\r\n * @since 3.0.0\r\n *\r\n * @param {object} obj - the object from which to clone\r\n *\r\n * @return {object} a new object with the same properties as the input obj\r\n */\r\nvar Clone = function (obj)\r\n{\r\n var clone = {};\r\n\r\n for (var key in obj)\r\n {\r\n if (Array.isArray(obj[key]))\r\n {\r\n clone[key] = obj[key].slice(0);\r\n }\r\n else\r\n {\r\n clone[key] = obj[key];\r\n }\r\n }\r\n\r\n return clone;\r\n};\r\n\r\nmodule.exports = Clone;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/object/Clone.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/object/Extend.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/utils/object/Extend.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar IsPlainObject = __webpack_require__(/*! ./IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\");\r\n\r\n// @param {boolean} deep - Perform a deep copy?\r\n// @param {object} target - The target object to copy to.\r\n// @return {object} The extended object.\r\n\r\n/**\r\n * This is a slightly modified version of http://api.jquery.com/jQuery.extend/\r\n *\r\n * @function Phaser.Utils.Objects.Extend\r\n * @since 3.0.0\r\n *\r\n * @return {object} The extended object.\r\n */\r\nvar Extend = function ()\r\n{\r\n var options, name, src, copy, copyIsArray, clone,\r\n target = arguments[0] || {},\r\n i = 1,\r\n length = arguments.length,\r\n deep = false;\r\n\r\n // Handle a deep copy situation\r\n if (typeof target === 'boolean')\r\n {\r\n deep = target;\r\n target = arguments[1] || {};\r\n\r\n // skip the boolean and the target\r\n i = 2;\r\n }\r\n\r\n // extend Phaser if only one argument is passed\r\n if (length === i)\r\n {\r\n target = this;\r\n --i;\r\n }\r\n\r\n for (; i < length; i++)\r\n {\r\n // Only deal with non-null/undefined values\r\n if ((options = arguments[i]) != null)\r\n {\r\n // Extend the base object\r\n for (name in options)\r\n {\r\n src = target[name];\r\n copy = options[name];\r\n\r\n // Prevent never-ending loop\r\n if (target === copy)\r\n {\r\n continue;\r\n }\r\n\r\n // Recurse if we're merging plain objects or arrays\r\n if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy))))\r\n {\r\n if (copyIsArray)\r\n {\r\n copyIsArray = false;\r\n clone = src && Array.isArray(src) ? src : [];\r\n }\r\n else\r\n {\r\n clone = src && IsPlainObject(src) ? src : {};\r\n }\r\n\r\n // Never move original objects, clone them\r\n target[name] = Extend(deep, clone, copy);\r\n\r\n // Don't bring in undefined values\r\n }\r\n else if (copy !== undefined)\r\n {\r\n target[name] = copy;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Return the modified object\r\n return target;\r\n};\r\n\r\nmodule.exports = Extend;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/object/Extend.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/object/GetAdvancedValue.js": /*!******************************************************************!*\ !*** ./node_modules/phaser/src/utils/object/GetAdvancedValue.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH = __webpack_require__(/*! ../../math */ \"./node_modules/phaser/src/math/index.js\");\r\nvar GetValue = __webpack_require__(/*! ./GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\n\r\n/**\r\n * Retrieves a value from an object. Allows for more advanced selection options, including:\r\n *\r\n * Allowed types:\r\n * \r\n * Implicit\r\n * {\r\n * x: 4\r\n * }\r\n *\r\n * From function\r\n * {\r\n * x: function ()\r\n * }\r\n *\r\n * Randomly pick one element from the array\r\n * {\r\n * x: [a, b, c, d, e, f]\r\n * }\r\n *\r\n * Random integer between min and max:\r\n * {\r\n * x: { randInt: [min, max] }\r\n * }\r\n *\r\n * Random float between min and max:\r\n * {\r\n * x: { randFloat: [min, max] }\r\n * }\r\n * \r\n *\r\n * @function Phaser.Utils.Objects.GetAdvancedValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to retrieve the value from.\r\n * @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.\r\n * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object.\r\n *\r\n * @return {*} The value of the requested key.\r\n */\r\nvar GetAdvancedValue = function (source, key, defaultValue)\r\n{\r\n var value = GetValue(source, key, null);\r\n\r\n if (value === null)\r\n {\r\n return defaultValue;\r\n }\r\n else if (Array.isArray(value))\r\n {\r\n return MATH.RND.pick(value);\r\n }\r\n else if (typeof value === 'object')\r\n {\r\n if (value.hasOwnProperty('randInt'))\r\n {\r\n return MATH.RND.integerInRange(value.randInt[0], value.randInt[1]);\r\n }\r\n else if (value.hasOwnProperty('randFloat'))\r\n {\r\n return MATH.RND.realInRange(value.randFloat[0], value.randFloat[1]);\r\n }\r\n }\r\n else if (typeof value === 'function')\r\n {\r\n return value(key);\r\n }\r\n\r\n return value;\r\n};\r\n\r\nmodule.exports = GetAdvancedValue;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/object/GetAdvancedValue.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/object/GetFastValue.js": /*!**************************************************************!*\ !*** ./node_modules/phaser/src/utils/object/GetFastValue.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue}\r\n *\r\n * @function Phaser.Utils.Objects.GetFastValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to search\r\n * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods)\r\n * @param {*} [defaultValue] - The default value to use if the key does not exist.\r\n *\r\n * @return {*} The value if found; otherwise, defaultValue (null if none provided)\r\n */\r\nvar GetFastValue = function (source, key, defaultValue)\r\n{\r\n var t = typeof(source);\r\n\r\n if (!source || t === 'number' || t === 'string')\r\n {\r\n return defaultValue;\r\n }\r\n else if (source.hasOwnProperty(key) && source[key] !== undefined)\r\n {\r\n return source[key];\r\n }\r\n else\r\n {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nmodule.exports = GetFastValue;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/object/GetFastValue.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/object/GetMinMaxValue.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/utils/object/GetMinMaxValue.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetValue = __webpack_require__(/*! ./GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\");\r\nvar Clamp = __webpack_require__(/*! ../../math/Clamp */ \"./node_modules/phaser/src/math/Clamp.js\");\r\n\r\n/**\r\n * Retrieves and clamps a numerical value from an object.\r\n *\r\n * @function Phaser.Utils.Objects.GetMinMaxValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to retrieve the value from.\r\n * @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 (`.`).\r\n * @param {number} min - The minimum value which can be returned.\r\n * @param {number} max - The maximum value which can be returned.\r\n * @param {number} defaultValue - The value to return if the property doesn't exist. It's also constrained to the given bounds.\r\n *\r\n * @return {number} The clamped value from the `source` object.\r\n */\r\nvar GetMinMaxValue = function (source, key, min, max, defaultValue)\r\n{\r\n if (defaultValue === undefined) { defaultValue = min; }\r\n\r\n var value = GetValue(source, key, defaultValue);\r\n\r\n return Clamp(value, min, max);\r\n};\r\n\r\nmodule.exports = GetMinMaxValue;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/object/GetMinMaxValue.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/object/GetValue.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/utils/object/GetValue.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Source object\r\n// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner'\r\n// The default value to use if the key doesn't exist\r\n\r\n/**\r\n * Retrieves a value from an object.\r\n *\r\n * @function Phaser.Utils.Objects.GetValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to retrieve the value from.\r\n * @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.\r\n * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object.\r\n *\r\n * @return {*} The value of the requested key.\r\n */\r\nvar GetValue = function (source, key, defaultValue)\r\n{\r\n if (!source || typeof source === 'number')\r\n {\r\n return defaultValue;\r\n }\r\n else if (source.hasOwnProperty(key))\r\n {\r\n return source[key];\r\n }\r\n else if (key.indexOf('.') !== -1)\r\n {\r\n var keys = key.split('.');\r\n var parent = source;\r\n var value = defaultValue;\r\n\r\n // Use for loop here so we can break early\r\n for (var i = 0; i < keys.length; i++)\r\n {\r\n if (parent.hasOwnProperty(keys[i]))\r\n {\r\n // Yes it has a key property, let's carry on down\r\n value = parent[keys[i]];\r\n\r\n parent = parent[keys[i]];\r\n }\r\n else\r\n {\r\n // Can't go any further, so reset to default\r\n value = defaultValue;\r\n break;\r\n }\r\n }\r\n\r\n return value;\r\n }\r\n else\r\n {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nmodule.exports = GetValue;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/object/GetValue.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/object/HasAll.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/utils/object/HasAll.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Verifies that an object contains all requested keys\r\n *\r\n * @function Phaser.Utils.Objects.HasAll\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - an object on which to check for key existence\r\n * @param {string[]} keys - an array of keys to ensure the source object contains\r\n *\r\n * @return {boolean} true if the source object contains all keys, false otherwise.\r\n */\r\nvar HasAll = function (source, keys)\r\n{\r\n for (var i = 0; i < keys.length; i++)\r\n {\r\n if (!source.hasOwnProperty(keys[i]))\r\n {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nmodule.exports = HasAll;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/object/HasAll.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/object/HasAny.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/utils/object/HasAny.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Verifies that an object contains at least one of the requested keys\r\n *\r\n * @function Phaser.Utils.Objects.HasAny\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - an object on which to check for key existence\r\n * @param {string[]} keys - an array of keys to search the object for\r\n *\r\n * @return {boolean} true if the source object contains at least one of the keys, false otherwise\r\n */\r\nvar HasAny = function (source, keys)\r\n{\r\n for (var i = 0; i < keys.length; i++)\r\n {\r\n if (source.hasOwnProperty(keys[i]))\r\n {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n};\r\n\r\nmodule.exports = HasAny;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/object/HasAny.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/object/HasValue.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/utils/object/HasValue.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Determine whether the source object has a property with the specified key.\r\n *\r\n * @function Phaser.Utils.Objects.HasValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The source object to be checked.\r\n * @param {string} key - The property to check for within the object\r\n *\r\n * @return {boolean} `true` if the provided `key` exists on the `source` object, otherwise `false`.\r\n */\r\nvar HasValue = function (source, key)\r\n{\r\n return (source.hasOwnProperty(key));\r\n};\r\n\r\nmodule.exports = HasValue;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/object/HasValue.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/object/IsPlainObject.js": /*!***************************************************************!*\ !*** ./node_modules/phaser/src/utils/object/IsPlainObject.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * This is a slightly modified version of jQuery.isPlainObject.\r\n * A plain object is an object whose internal class property is [object Object].\r\n *\r\n * @function Phaser.Utils.Objects.IsPlainObject\r\n * @since 3.0.0\r\n *\r\n * @param {object} obj - The object to inspect.\r\n *\r\n * @return {boolean} `true` if the object is plain, otherwise `false`.\r\n */\r\nvar IsPlainObject = function (obj)\r\n{\r\n // Not plain objects:\r\n // - Any object or value whose internal [[Class]] property is not \"[object Object]\"\r\n // - DOM nodes\r\n // - window\r\n if (typeof(obj) !== 'object' || obj.nodeType || obj === obj.window)\r\n {\r\n return false;\r\n }\r\n\r\n // Support: Firefox <20\r\n // The try/catch suppresses exceptions thrown when attempting to access\r\n // the \"constructor\" property of certain host objects, ie. |window.location|\r\n // https://bugzilla.mozilla.org/show_bug.cgi?id=814622\r\n try\r\n {\r\n if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf'))\r\n {\r\n return false;\r\n }\r\n }\r\n catch (e)\r\n {\r\n return false;\r\n }\r\n\r\n // If the function hasn't returned already, we're confident that\r\n // |obj| is a plain object, created by {} or constructed with new Object\r\n return true;\r\n};\r\n\r\nmodule.exports = IsPlainObject;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/object/IsPlainObject.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/object/Merge.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/utils/object/Merge.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clone = __webpack_require__(/*! ./Clone */ \"./node_modules/phaser/src/utils/object/Clone.js\");\r\n\r\n/**\r\n * Creates a new Object using all values from obj1 and obj2.\r\n * If a value exists in both obj1 and obj2, the value in obj1 is used.\r\n * \r\n * This is only a shallow copy. Deeply nested objects are not cloned, so be sure to only use this\r\n * function on shallow objects.\r\n *\r\n * @function Phaser.Utils.Objects.Merge\r\n * @since 3.0.0\r\n *\r\n * @param {object} obj1 - The first object.\r\n * @param {object} obj2 - The second object.\r\n *\r\n * @return {object} A new object containing the union of obj1's and obj2's properties.\r\n */\r\nvar Merge = function (obj1, obj2)\r\n{\r\n var clone = Clone(obj1);\r\n\r\n for (var key in obj2)\r\n {\r\n if (!clone.hasOwnProperty(key))\r\n {\r\n clone[key] = obj2[key];\r\n }\r\n }\r\n\r\n return clone;\r\n};\r\n\r\nmodule.exports = Merge;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/object/Merge.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/object/MergeRight.js": /*!************************************************************!*\ !*** ./node_modules/phaser/src/utils/object/MergeRight.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clone = __webpack_require__(/*! ./Clone */ \"./node_modules/phaser/src/utils/object/Clone.js\");\r\n\r\n/**\r\n * Creates a new Object using all values from obj1.\r\n * \r\n * Then scans obj2. If a property is found in obj2 that *also* exists in obj1, the value from obj2 is used, otherwise the property is skipped.\r\n *\r\n * @function Phaser.Utils.Objects.MergeRight\r\n * @since 3.0.0\r\n *\r\n * @param {object} obj1 - The first object to merge.\r\n * @param {object} obj2 - The second object to merge. Keys from this object which also exist in `obj1` will be copied to `obj1`.\r\n *\r\n * @return {object} The merged object. `obj1` and `obj2` are not modified.\r\n */\r\nvar MergeRight = function (obj1, obj2)\r\n{\r\n var clone = Clone(obj1);\r\n\r\n for (var key in obj2)\r\n {\r\n if (clone.hasOwnProperty(key))\r\n {\r\n clone[key] = obj2[key];\r\n }\r\n }\r\n\r\n return clone;\r\n};\r\n\r\nmodule.exports = MergeRight;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/object/MergeRight.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/object/Pick.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/utils/object/Pick.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar HasValue = __webpack_require__(/*! ./HasValue */ \"./node_modules/phaser/src/utils/object/HasValue.js\");\r\n\r\n/**\r\n * Returns a new object that only contains the `keys` that were found on the object provided.\r\n * If no `keys` are found, an empty object is returned.\r\n *\r\n * @function Phaser.Utils.Objects.Pick\r\n * @since 3.18.0\r\n *\r\n * @param {object} object - The object to pick the provided keys from.\r\n * @param {array} keys - An array of properties to retrieve from the provided object.\r\n *\r\n * @return {object} A new object that only contains the `keys` that were found on the provided object. If no `keys` were found, an empty object will be returned.\r\n */\r\nvar Pick = function (object, keys)\r\n{\r\n var obj = {};\r\n\r\n for (var i = 0; i < keys.length; i++)\r\n {\r\n var key = keys[i];\r\n\r\n if (HasValue(object, key))\r\n {\r\n obj[key] = object[key];\r\n }\r\n }\r\n\r\n return obj;\r\n};\r\n\r\nmodule.exports = Pick;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/object/Pick.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/object/SetValue.js": /*!**********************************************************!*\ !*** ./node_modules/phaser/src/utils/object/SetValue.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sets a value in an object, allowing for dot notation to control the depth of the property.\r\n * \r\n * For example:\r\n * \r\n * ```javascript\r\n * var data = {\r\n * world: {\r\n * position: {\r\n * x: 200,\r\n * y: 100\r\n * }\r\n * }\r\n * };\r\n * \r\n * SetValue(data, 'world.position.y', 300);\r\n * \r\n * console.log(data.world.position.y); // 300\r\n * ```\r\n *\r\n * @function Phaser.Utils.Objects.SetValue\r\n * @since 3.17.0\r\n *\r\n * @param {object} source - The object to set the value in.\r\n * @param {string} key - The name of the property in the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`)\r\n * @param {any} value - The value to set into the property, if found in the source object.\r\n *\r\n * @return {boolean} `true` if the property key was valid and the value was set, otherwise `false`.\r\n */\r\nvar SetValue = function (source, key, value)\r\n{\r\n if (!source || typeof source === 'number')\r\n {\r\n return false;\r\n }\r\n else if (source.hasOwnProperty(key))\r\n {\r\n source[key] = value;\r\n\r\n return true;\r\n }\r\n else if (key.indexOf('.') !== -1)\r\n {\r\n var keys = key.split('.');\r\n var parent = source;\r\n var prev = source;\r\n\r\n // Use for loop here so we can break early\r\n for (var i = 0; i < keys.length; i++)\r\n {\r\n if (parent.hasOwnProperty(keys[i]))\r\n {\r\n // Yes it has a key property, let's carry on down\r\n prev = parent;\r\n parent = parent[keys[i]];\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n\r\n prev[keys[keys.length - 1]] = value;\r\n\r\n return true;\r\n }\r\n \r\n return false;\r\n};\r\n\r\nmodule.exports = SetValue;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/object/SetValue.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/object/index.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/utils/object/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Utils.Objects\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Clone: __webpack_require__(/*! ./Clone */ \"./node_modules/phaser/src/utils/object/Clone.js\"),\r\n Extend: __webpack_require__(/*! ./Extend */ \"./node_modules/phaser/src/utils/object/Extend.js\"),\r\n GetAdvancedValue: __webpack_require__(/*! ./GetAdvancedValue */ \"./node_modules/phaser/src/utils/object/GetAdvancedValue.js\"),\r\n GetFastValue: __webpack_require__(/*! ./GetFastValue */ \"./node_modules/phaser/src/utils/object/GetFastValue.js\"),\r\n GetMinMaxValue: __webpack_require__(/*! ./GetMinMaxValue */ \"./node_modules/phaser/src/utils/object/GetMinMaxValue.js\"),\r\n GetValue: __webpack_require__(/*! ./GetValue */ \"./node_modules/phaser/src/utils/object/GetValue.js\"),\r\n HasAll: __webpack_require__(/*! ./HasAll */ \"./node_modules/phaser/src/utils/object/HasAll.js\"),\r\n HasAny: __webpack_require__(/*! ./HasAny */ \"./node_modules/phaser/src/utils/object/HasAny.js\"),\r\n HasValue: __webpack_require__(/*! ./HasValue */ \"./node_modules/phaser/src/utils/object/HasValue.js\"),\r\n IsPlainObject: __webpack_require__(/*! ./IsPlainObject */ \"./node_modules/phaser/src/utils/object/IsPlainObject.js\"),\r\n Merge: __webpack_require__(/*! ./Merge */ \"./node_modules/phaser/src/utils/object/Merge.js\"),\r\n MergeRight: __webpack_require__(/*! ./MergeRight */ \"./node_modules/phaser/src/utils/object/MergeRight.js\"),\r\n Pick: __webpack_require__(/*! ./Pick */ \"./node_modules/phaser/src/utils/object/Pick.js\"),\r\n SetValue: __webpack_require__(/*! ./SetValue */ \"./node_modules/phaser/src/utils/object/SetValue.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/object/index.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/string/Format.js": /*!********************************************************!*\ !*** ./node_modules/phaser/src/utils/string/Format.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes a string and replaces instances of markers with values in the given array.\r\n * The markers take the form of `%1`, `%2`, etc. I.e.:\r\n *\r\n * `Format(\"The %1 is worth %2 gold\", [ 'Sword', 500 ])`\r\n *\r\n * @function Phaser.Utils.String.Format\r\n * @since 3.0.0\r\n *\r\n * @param {string} string - The string containing the replacement markers.\r\n * @param {array} values - An array containing values that will replace the markers. If no value exists an empty string is inserted instead.\r\n *\r\n * @return {string} The string containing replaced values.\r\n */\r\nvar Format = function (string, values)\r\n{\r\n return string.replace(/%([0-9]+)/g, function (s, n)\r\n {\r\n return values[Number(n) - 1];\r\n });\r\n};\r\n\r\nmodule.exports = Format;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/string/Format.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/string/Pad.js": /*!*****************************************************!*\ !*** ./node_modules/phaser/src/utils/string/Pad.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes the given string and pads it out, to the length required, using the character\r\n * specified. For example if you need a string to be 6 characters long, you can call:\r\n *\r\n * `pad('bob', 6, '-', 2)`\r\n *\r\n * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right.\r\n *\r\n * You can also use it to pad numbers (they are always returned as strings):\r\n * \r\n * `pad(512, 6, '0', 1)`\r\n *\r\n * Would return: `000512` with the string padded to the left.\r\n *\r\n * If you don't specify a direction it'll pad to both sides:\r\n * \r\n * `pad('c64', 7, '*')`\r\n *\r\n * Would return: `**c64**`\r\n *\r\n * @function Phaser.Utils.String.Pad\r\n * @since 3.0.0\r\n *\r\n * @param {string} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers.\r\n * @param {integer} [len=0] - The number of characters to be added.\r\n * @param {string} [pad=\" \"] - The string to pad it out with (defaults to a space).\r\n * @param {integer} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both).\r\n * \r\n * @return {string} The padded string.\r\n */\r\nvar Pad = function (str, len, pad, dir)\r\n{\r\n if (len === undefined) { len = 0; }\r\n if (pad === undefined) { pad = ' '; }\r\n if (dir === undefined) { dir = 3; }\r\n\r\n str = str.toString();\r\n\r\n var padlen = 0;\r\n\r\n if (len + 1 >= str.length)\r\n {\r\n switch (dir)\r\n {\r\n case 1:\r\n str = new Array(len + 1 - str.length).join(pad) + str;\r\n break;\r\n\r\n case 3:\r\n var right = Math.ceil((padlen = len - str.length) / 2);\r\n var left = padlen - right;\r\n str = new Array(left + 1).join(pad) + str + new Array(right + 1).join(pad);\r\n break;\r\n\r\n default:\r\n str = str + new Array(len + 1 - str.length).join(pad);\r\n break;\r\n }\r\n }\r\n\r\n return str;\r\n};\r\n\r\nmodule.exports = Pad;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/string/Pad.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/string/Reverse.js": /*!*********************************************************!*\ !*** ./node_modules/phaser/src/utils/string/Reverse.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes the given string and reverses it, returning the reversed string.\r\n * For example if given the string `Atari 520ST` it would return `TS025 iratA`.\r\n *\r\n * @function Phaser.Utils.String.Reverse\r\n * @since 3.0.0\r\n *\r\n * @param {string} string - The string to be reversed.\r\n *\r\n * @return {string} The reversed string.\r\n */\r\nvar Reverse = function (string)\r\n{\r\n return string.split('').reverse().join('');\r\n};\r\n\r\nmodule.exports = Reverse;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/string/Reverse.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/string/UUID.js": /*!******************************************************!*\ !*** ./node_modules/phaser/src/utils/string/UUID.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Creates and returns an RFC4122 version 4 compliant UUID.\r\n * \r\n * The string is in the form: `xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx` where each `x` is replaced with a random\r\n * hexadecimal digit from 0 to f, and `y` is replaced with a random hexadecimal digit from 8 to b.\r\n *\r\n * @function Phaser.Utils.String.UUID\r\n * @since 3.12.0\r\n *\r\n * @return {string} The UUID string.\r\n */\r\nvar UUID = function ()\r\n{\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c)\r\n {\r\n var r = Math.random() * 16 | 0;\r\n var v = (c === 'x') ? r : (r & 0x3 | 0x8);\r\n\r\n return v.toString(16);\r\n });\r\n};\r\n\r\nmodule.exports = UUID;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/string/UUID.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/string/UppercaseFirst.js": /*!****************************************************************!*\ !*** ./node_modules/phaser/src/utils/string/UppercaseFirst.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Capitalizes the first letter of a string if there is one.\r\n * @example\r\n * UppercaseFirst('abc');\r\n * // returns 'Abc'\r\n * @example\r\n * UppercaseFirst('the happy family');\r\n * // returns 'The happy family'\r\n * @example\r\n * UppercaseFirst('');\r\n * // returns ''\r\n *\r\n * @function Phaser.Utils.String.UppercaseFirst\r\n * @since 3.0.0\r\n *\r\n * @param {string} str - The string to capitalize.\r\n *\r\n * @return {string} A new string, same as the first, but with the first letter capitalized.\r\n */\r\nvar UppercaseFirst = function (str)\r\n{\r\n return str && str[0].toUpperCase() + str.slice(1);\r\n};\r\n\r\nmodule.exports = UppercaseFirst;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/string/UppercaseFirst.js?"); /***/ }), /***/ "./node_modules/phaser/src/utils/string/index.js": /*!*******************************************************!*\ !*** ./node_modules/phaser/src/utils/string/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Utils.String\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Format: __webpack_require__(/*! ./Format */ \"./node_modules/phaser/src/utils/string/Format.js\"),\r\n Pad: __webpack_require__(/*! ./Pad */ \"./node_modules/phaser/src/utils/string/Pad.js\"),\r\n Reverse: __webpack_require__(/*! ./Reverse */ \"./node_modules/phaser/src/utils/string/Reverse.js\"),\r\n UppercaseFirst: __webpack_require__(/*! ./UppercaseFirst */ \"./node_modules/phaser/src/utils/string/UppercaseFirst.js\"),\r\n UUID: __webpack_require__(/*! ./UUID */ \"./node_modules/phaser/src/utils/string/UUID.js\")\r\n\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser/src/utils/string/index.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/bbcodetext-plugin.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/bbcodetext-plugin.js ***! \***********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _gameobjects_text_bbocdetext_Factory_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./gameobjects/text/bbocdetext/Factory.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/Factory.js\");\n/* harmony import */ var _gameobjects_text_bbocdetext_Creator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./gameobjects/text/bbocdetext/Creator.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/Creator.js\");\n/* harmony import */ var _gameobjects_text_bbocdetext_BBCodeText_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gameobjects/text/bbocdetext/BBCodeText.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/BBCodeText.js\");\n/* harmony import */ var _utils_object_SetValue_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/object/SetValue.js */ \"./node_modules/phaser3-rex-plugins/plugins/utils/object/SetValue.js\");\n\r\n\r\n\r\n\r\n\r\nclass BBCodeTextPlugin extends Phaser.Plugins.BasePlugin {\r\n\r\n constructor(pluginManager) {\r\n super(pluginManager);\r\n\r\n // Register our new Game Object type\r\n pluginManager.registerGameObject('rexBBCodeText', _gameobjects_text_bbocdetext_Factory_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"], _gameobjects_text_bbocdetext_Creator_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\r\n }\r\n\r\n start() {\r\n var eventEmitter = this.game.events;\r\n eventEmitter.once('destroy', this.destroy, this);\r\n }\r\n}\r\n\r\nObject(_utils_object_SetValue_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(window, 'RexPlugins.GameObjects.BBCodeText', _gameobjects_text_bbocdetext_BBCodeText_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (BBCodeTextPlugin);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/bbcodetext-plugin.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/bbcodetext.js": /*!****************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/bbcodetext.js ***! \****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _gameobjects_text_bbocdetext_Factory_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./gameobjects/text/bbocdetext/Factory.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/Factory.js\");\n/* harmony import */ var _gameobjects_text_bbocdetext_Creator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./gameobjects/text/bbocdetext/Creator.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/Creator.js\");\n/* harmony import */ var _gameobjects_text_bbocdetext_BBCodeText_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gameobjects/text/bbocdetext/BBCodeText.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/BBCodeText.js\");\n\r\n\r\n\r\n\r\nPhaser.GameObjects.GameObjectFactory.register('rexBBCodeText', _gameobjects_text_bbocdetext_Factory_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\r\nPhaser.GameObjects.GameObjectCreator.register('rexBBCodeText', _gameobjects_text_bbocdetext_Creator_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (_gameobjects_text_bbocdetext_BBCodeText_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/bbcodetext.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/BBCodeText.js": /*!********************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/BBCodeText.js ***! \********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _textbase_Text_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../textbase/Text.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/Text.js\");\n/* harmony import */ var _Parser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Parser.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/Parser.js\");\n\r\n\r\n\r\nclass BBCodeText extends _textbase_Text_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\r\n constructor(scene, x, y, text, style) {\r\n super(scene, x, y, text, style, 'rexBBCodeText', _Parser_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\r\n }\r\n}\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (BBCodeText);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/BBCodeText.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/Creator.js": /*!*****************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/Creator.js ***! \*****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _BBCodeText_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BBCodeText.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/BBCodeText.js\");\n\r\n\r\nconst GetAdvancedValue = Phaser.Utils.Objects.GetAdvancedValue;\r\nconst BuildGameObject = Phaser.GameObjects.BuildGameObject;\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (config, addToScene) {\r\n // style Object = {\r\n // font: [ 'font', '16px Courier' ],\r\n // backgroundColor: [ 'backgroundColor', null ],\r\n // fill: [ 'fill', '#fff' ],\r\n // stroke: [ 'stroke', '#fff' ],\r\n // strokeThickness: [ 'strokeThickness', 0 ],\r\n // shadowOffsetX: [ 'shadow.offsetX', 0 ],\r\n // shadowOffsetY: [ 'shadow.offsetY', 0 ],\r\n // shadowColor: [ 'shadow.color', '#000' ],\r\n // shadowBlur: [ 'shadow.blur', 0 ],\r\n // shadowStroke: [ 'shadow.stroke', false ],\r\n // shadowFill: [ 'shadow.fill', false ],\r\n // align: [ 'align', 'left' ],\r\n // maxLines: [ 'maxLines', 0 ],\r\n // fixedWidth: [ 'fixedWidth', false ],\r\n // fixedHeight: [ 'fixedHeight', false ]\r\n // }\r\n\r\n var content = GetAdvancedValue(config, 'text', '');\r\n var style = GetAdvancedValue(config, 'style', null);\r\n\r\n // Padding\r\n // { padding: 2 }\r\n // { padding: { x: , y: }}\r\n // { padding: { left: , top: }}\r\n // { padding: { left: , right: , top: , bottom: }} \r\n\r\n var padding = GetAdvancedValue(config, 'padding', null);\r\n\r\n if (padding !== null) {\r\n style.padding = padding;\r\n }\r\n\r\n if (addToScene !== undefined) {\r\n config.add = addToScene;\r\n }\r\n\r\n var gameObject = new _BBCodeText_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this.scene, 0, 0, content, style);\r\n BuildGameObject(this.scene, gameObject, config);\r\n\r\n // Text specific config options:\r\n\r\n gameObject.autoRound = GetAdvancedValue(config, 'autoRound', true);\r\n gameObject.resolution = GetAdvancedValue(config, 'resolution', 1);\r\n\r\n return gameObject;\r\n});;\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/Creator.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/Factory.js": /*!*****************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/Factory.js ***! \*****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _BBCodeText_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BBCodeText.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/BBCodeText.js\");\n\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (x, y, text, style) {\r\n var gameObject = new _BBCodeText_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this.scene, x, y, text, style);\r\n this.scene.add.existing(gameObject);\r\n return gameObject;\r\n});;\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/Factory.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/Parser.js": /*!****************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/Parser.js ***! \****************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _textbase_textstyle_TextStyle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../textbase/textstyle/TextStyle.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/textstyle/TextStyle.js\");\n\r\n\r\nvar GETPROP_RESULT = {\r\n plainText: null,\r\n prevProp: null\r\n};\r\n\r\nvar STYLE_RESULT = new _textbase_textstyle_TextStyle_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\r\nvar EMPTYPROP = {};\r\n\r\nvar parser = {\r\n splitText: function (text, mode) {\r\n var result = [];\r\n var arr, m, charIdx = 0,\r\n totalLen = text.length,\r\n matchStart = totalLen;\r\n\r\n while (true) {\r\n arr = RE_SPLITTEXT.exec(text);\r\n if (!arr) {\r\n break;\r\n }\r\n\r\n m = arr[0];\r\n matchStart = RE_SPLITTEXT.lastIndex - m.length;\r\n\r\n if (charIdx < matchStart) {\r\n result.push(text.substring(charIdx, matchStart));\r\n }\r\n\r\n if (mode === undefined) {\r\n result.push(m);\r\n }\r\n\r\n charIdx = RE_SPLITTEXT.lastIndex;\r\n }\r\n\r\n if (charIdx < totalLen) {\r\n result.push(text.substring(charIdx, totalLen));\r\n }\r\n return result; // [text,...]\r\n },\r\n\r\n tagTextToProp: function (text, prevProp) {\r\n var plainText, innerMatch;\r\n\r\n if (prevProp == null) {\r\n prevProp = {};\r\n }\r\n\r\n // close image tag\r\n if (prevProp.img) {\r\n updateProp(prevProp, PROP_REMOVE, 'img');\r\n }\r\n // Check if current fragment is a class tag\r\n if (RE_BLOD_OPEN.test(text)) {\r\n updateProp(prevProp, PROP_ADD, 'b', true);\r\n plainText = '';\r\n } else if (RE_BLOD_CLOSE.test(text)) {\r\n updateProp(prevProp, PROP_REMOVE, 'b');\r\n plainText = '';\r\n } else if (RE_ITALICS_OPEN.test(text)) {\r\n updateProp(prevProp, PROP_ADD, 'i', true);\r\n plainText = '';\r\n } else if (RE_ITALICS_CLOSE.test(text)) {\r\n updateProp(prevProp, PROP_REMOVE, 'i');\r\n plainText = '';\r\n } else if (RE_SIZE_OPEN.test(text)) {\r\n innerMatch = text.match(RE_SIZE_OPEN);\r\n updateProp(prevProp, PROP_ADD, 'size', innerMatch[1] + 'px');\r\n plainText = '';\r\n } else if (RE_SIZE_CLOSE.test(text)) {\r\n updateProp(prevProp, PROP_REMOVE, 'size');\r\n plainText = '';\r\n } else if (RE_COLOR_OPEN.test(text)) {\r\n innerMatch = text.match(RE_COLOR_OPEN);\r\n updateProp(prevProp, PROP_ADD, 'color', innerMatch[1]);\r\n plainText = '';\r\n } else if (RE_COLOR_CLOSE.test(text)) {\r\n updateProp(prevProp, PROP_REMOVE, 'color');\r\n plainText = '';\r\n } else if (RE_UNDERLINE_OPEN.test(text)) {\r\n innerMatch = text.match(RE_UNDERLINE_OPEN);\r\n updateProp(prevProp, PROP_ADD, 'u', true);\r\n plainText = '';\r\n } else if (RE_UNDERLINE_OPENC.test(text)) {\r\n innerMatch = text.match(RE_UNDERLINE_OPENC);\r\n updateProp(prevProp, PROP_ADD, 'u', innerMatch[1]);\r\n plainText = '';\r\n } else if (RE_UNDERLINE_CLOSE.test(text)) {\r\n updateProp(prevProp, PROP_REMOVE, 'u');\r\n plainText = '';\r\n } else if (RE_SHADOW_OPEN.test(text)) {\r\n updateProp(prevProp, PROP_ADD, 'shadow', true);\r\n plainText = '';\r\n } else if (RE_SHADOW_CLOSE.test(text)) {\r\n updateProp(prevProp, PROP_REMOVE, 'shadow');\r\n plainText = '';\r\n } else if (RE_STROKE_OPEN.test(text)) {\r\n updateProp(prevProp, PROP_ADD, 'stroke', true);\r\n plainText = '';\r\n } else if (RE_STROKE_OPENC.test(text)) {\r\n innerMatch = text.match(RE_STROKE_OPENC);\r\n updateProp(prevProp, PROP_ADD, 'stroke', innerMatch[1]);\r\n plainText = '';\r\n } else if (RE_STROKE_CLOSE.test(text)) {\r\n updateProp(prevProp, PROP_REMOVE, 'stroke');\r\n plainText = '';\r\n } else if (RE_IMAGE_OPEN.test(text)) {\r\n innerMatch = text.match(RE_IMAGE_OPEN);\r\n updateProp(prevProp, PROP_ADD, 'img', innerMatch[1]);\r\n plainText = '';\r\n } else if (RE_IMAGE_CLOSE.test(text)) {\r\n updateProp(prevProp, PROP_REMOVE, 'img');\r\n plainText = '';\r\n } else if (RE_AREA_OPEN.test(text)) {\r\n innerMatch = text.match(RE_AREA_OPEN);\r\n updateProp(prevProp, PROP_ADD, 'area', innerMatch[1]);\r\n plainText = '';\r\n } else if (RE_AREA_CLOSE.test(text)) {\r\n updateProp(prevProp, PROP_REMOVE, 'area');\r\n plainText = ''; \r\n } else {\r\n plainText = text\r\n }\r\n\r\n var result = GETPROP_RESULT;\r\n result.plainText = plainText;\r\n result.prop = prevProp;\r\n return result;\r\n },\r\n\r\n propToContextStyle: function (defaultStyle, prop) {\r\n var result = STYLE_RESULT;\r\n if (!prop.hasOwnProperty('img')) {\r\n result.image = null;\r\n\r\n if (prop.hasOwnProperty('family')) {\r\n result.fontFamily = prop.family;\r\n } else {\r\n result.fontFamily = defaultStyle.fontFamily;\r\n }\r\n\r\n if (prop.hasOwnProperty('size')) {\r\n var size = prop.size;\r\n if (typeof (size) === 'number') {\r\n size = size.toString() + 'px';\r\n }\r\n result.fontSize = size;\r\n } else {\r\n result.fontSize = defaultStyle.fontSize;\r\n }\r\n result.fontStyle = getFontStyle(prop.b, prop.i);\r\n\r\n if (prop.hasOwnProperty('color')) {\r\n result.color = prop.color;\r\n } else {\r\n result.color = defaultStyle.color;\r\n }\r\n\r\n if (prop.hasOwnProperty('stroke')) {\r\n if (prop.stroke === true) {\r\n result.stroke = defaultStyle.stroke;\r\n result.strokeThickness = defaultStyle.strokeThickness;\r\n } else {\r\n result.stroke = prop.stroke;\r\n result.strokeThickness = defaultStyle.strokeThickness;\r\n }\r\n } else {\r\n result.stroke = defaultStyle.stroke;\r\n result.strokeThickness = 0;\r\n }\r\n } else {\r\n result.image = prop.img;\r\n }\r\n\r\n if (prop.hasOwnProperty('shadow')) {\r\n if (prop.shadow === true) {\r\n result.shadowColor = defaultStyle.shadowColor;\r\n result.shadowOffsetX = defaultStyle.shadowOffsetX;\r\n result.shadowOffsetY = defaultStyle.shadowOffsetY;\r\n result.shadowBlur = defaultStyle.shadowBlur;\r\n result.shadowStroke = true;\r\n result.shadowFill = true;\r\n } else {\r\n result.shadowColor = prop.shadow;\r\n result.shadowOffsetX = defaultStyle.shadowOffsetX;\r\n result.shadowOffsetY = defaultStyle.shadowOffsetY;\r\n result.shadowBlur = defaultStyle.shadowBlur;\r\n result.shadowStroke = true;\r\n result.shadowFill = true;\r\n }\r\n } else {\r\n result.shadowColor = '#000';\r\n result.shadowOffsetX = 0;\r\n result.shadowOffsetY = 0;\r\n result.shadowBlur = 0;\r\n result.shadowStroke = false;\r\n result.shadowFill = false;\r\n }\r\n\r\n if (prop.hasOwnProperty('u')) {\r\n if (prop.u === true) {\r\n result.underlineColor = defaultStyle.underlineColor;\r\n result.underlineThickness = defaultStyle.underlineThickness;\r\n result.underlineOffset = defaultStyle.underlineOffset;\r\n } else {\r\n result.underlineColor = prop.u;\r\n result.underlineThickness = defaultStyle.underlineThickness;\r\n result.underlineOffset = defaultStyle.underlineOffset;\r\n }\r\n } else {\r\n result.underlineColor = '#000';\r\n result.underlineThickness = 0;\r\n result.underlineOffset = 0;\r\n }\r\n\r\n return result;\r\n },\r\n\r\n propToTagText: function (text, prop, prevProp) {\r\n if (prevProp == null) {\r\n prevProp = EMPTYPROP;\r\n }\r\n\r\n for (var k in prevProp) {\r\n if (prop.hasOwnProperty(k)) {\r\n continue;\r\n }\r\n\r\n text = '[/' + k + ']' + text;\r\n }\r\n\r\n var header = '';\r\n for (var k in prop) {\r\n if (prevProp[k] === prop[k]) {\r\n continue;\r\n }\r\n\r\n if (k === 'size') {\r\n header += ('[size=' + prop[k].replace('px', '') + ']');\r\n } else if ((k === 'color') || (k === 'stroke') || (k === 'img')) {\r\n header += ('[' + k + '=' + prop[k] + ']');\r\n } else if (k === 'u') {\r\n if (prop[k] === true) {\r\n header += '[u]';\r\n } else {\r\n header += ('[u=' + prop[k] + ']');\r\n }\r\n } else {\r\n header += ('[' + k + ']');\r\n }\r\n }\r\n text = header + text;\r\n\r\n return text;\r\n }\r\n};\r\n\r\nvar updateProp = function (prop, op, key, value) {\r\n if (op === PROP_ADD) {\r\n // PROP_ADD \r\n prop[key] = value;\r\n } else {\r\n // PROP_REMOVE \r\n if (prop.hasOwnProperty(key)) {\r\n delete prop[key];\r\n }\r\n }\r\n\r\n return prop;\r\n};\r\n\r\nvar getFontStyle = function (isBold, isItalic) {\r\n if (isBold && isItalic) {\r\n return 'bold italic';\r\n } else if (isBold) {\r\n return 'bold';\r\n } else if (isItalic) {\r\n return 'italic';\r\n } else {\r\n return '';\r\n }\r\n};\r\n\r\nvar RE_SPLITTEXT = /\\[b\\]|\\[\\/b\\]|\\[i\\]|\\[\\/i\\]|\\[size=(\\d+)\\]|\\[\\/size\\]|\\[color=([a-z]+|#[0-9abcdef]+)\\]|\\[\\/color\\]|\\[u\\]|\\[u=([a-z]+|#[0-9abcdef]+)\\]|\\[\\/u\\]|\\[shadow\\]|\\[\\/shadow\\]|\\[stroke\\]|\\[stroke=([a-z]+|#[0-9abcdef]+)\\]|\\[\\/stroke\\]|\\[img=([^\\]]+)\\]|\\[\\/img\\]|\\[area=([^\\]]+)\\]|\\[\\/area\\]/ig;\r\n\r\nvar RE_BLOD_OPEN = /\\[b\\]/i;\r\nvar RE_BLOD_CLOSE = /\\[\\/b\\]/i;\r\nvar RE_ITALICS_OPEN = /\\[i\\]/i;\r\nvar RE_ITALICS_CLOSE = /\\[\\/i\\]/i;\r\nvar RE_SIZE_OPEN = /\\[size=(\\d+)\\]/i;\r\nvar RE_SIZE_CLOSE = /\\[\\/size\\]/i;\r\nvar RE_COLOR_OPEN = /\\[color=([a-z]+|#[0-9abcdef]+)\\]/i;\r\nvar RE_COLOR_CLOSE = /\\[\\/color\\]/i;\r\nvar RE_UNDERLINE_OPEN = /\\[u\\]/i;\r\nvar RE_UNDERLINE_OPENC = /\\[u=([a-z]+|#[0-9abcdef]+)\\]/i;\r\nvar RE_UNDERLINE_CLOSE = /\\[\\/u\\]/i;\r\nvar RE_SHADOW_OPEN = /\\[shadow\\]/i;\r\nvar RE_SHADOW_CLOSE = /\\[\\/shadow\\]/i;\r\nvar RE_STROKE_OPEN = /\\[stroke\\]/i;\r\nvar RE_STROKE_OPENC = /\\[stroke=([a-z]+|#[0-9abcdef]+)\\]/i;\r\nvar RE_STROKE_CLOSE = /\\[\\/stroke\\]/i;\r\nvar RE_IMAGE_OPEN = /\\[img=([^\\]]+)\\]/i;\r\nvar RE_IMAGE_CLOSE = /\\[\\/img\\]/i;\r\nvar RE_AREA_OPEN = /\\[area=([^\\]]+)\\]/i;\r\nvar RE_AREA_CLOSE = /\\[\\/area\\]/i;\r\nconst PROP_REMOVE = false;\r\nconst PROP_ADD = true;\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (parser);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/bbocdetext/Parser.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/Text.js": /*!************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/Text.js ***! \************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _render_Render_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./render/Render.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/render/Render.js\");\n/* harmony import */ var _textstyle_TextStyle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./textstyle/TextStyle.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/textstyle/TextStyle.js\");\n/* harmony import */ var _canvastext_CanvasText_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./canvastext/CanvasText.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/CanvasText.js\");\n/* harmony import */ var _pool_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../pool.js */ \"./node_modules/phaser3-rex-plugins/plugins/pool.js\");\n/* harmony import */ var _const_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./const.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/const.js\");\n/* harmony import */ var _imagemanager_GetGlobImageManager_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./imagemanager/GetGlobImageManager.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/imagemanager/GetGlobImageManager.js\");\n\r\n // extended\r\n\r\n\r\n\r\n\r\n\r\nconst AddToDOM = Phaser.DOM.AddToDOM;\r\nconst CanvasPool = Phaser.Display.Canvas.CanvasPool;\r\nconst GameObject = Phaser.GameObjects.GameObject;\r\nconst GetValue = Phaser.Utils.Objects.GetValue;\r\nconst RemoveFromDOM = Phaser.DOM.RemoveFromDOM;\r\nconst SPLITREGEXP = _const_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].SPLITREGEXP;\r\n\r\nvar PensPools = {};\r\n\r\nclass Text extends GameObject {\r\n constructor(scene, x, y, text, style, type, parser) {\r\n if (x === undefined) {\r\n x = 0;\r\n }\r\n if (y === undefined) {\r\n y = 0;\r\n }\r\n\r\n super(scene, type);\r\n\r\n this.renderer = scene.sys.game.renderer;\r\n\r\n this.setPosition(x, y);\r\n this.setOrigin(0, 0);\r\n this.initPipeline();\r\n\r\n this.canvas = CanvasPool.create(this);\r\n\r\n this.context = this.canvas.getContext('2d');\r\n\r\n if (style) {\r\n // Override align\r\n if (style.hasOwnProperty('align')) {\r\n var halign = style.align;\r\n delete style.align;\r\n style.halign = halign;\r\n }\r\n }\r\n this.style = new _textstyle_TextStyle_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this, style);\r\n\r\n this.autoRound = true;\r\n\r\n this._text = undefined;\r\n\r\n this.padding = {\r\n left: 0,\r\n right: 0,\r\n top: 0,\r\n bottom: 0\r\n };\r\n\r\n this.width = 1;\r\n\r\n this.height = 1;\r\n\r\n this.dirty = false;\r\n\r\n // If resolution wasn't set, then we get it from the game config\r\n if (this.style.resolution === 0) {\r\n this.style.resolution = scene.sys.game.config.resolution;\r\n }\r\n\r\n this._crop = this.resetCropObject();\r\n\r\n // Create a Texture for this Text object\r\n this.texture = scene.sys.textures.addCanvas(null, this.canvas, true);\r\n\r\n // Get the frame\r\n this.frame = this.texture.get();\r\n\r\n // Set the resolution\r\n this.frame.source.resolution = this.style.resolution;\r\n\r\n if (this.renderer && this.renderer.gl) {\r\n // Clear the default 1x1 glTexture, as we override it later\r\n\r\n this.renderer.deleteTexture(this.frame.source.glTexture);\r\n\r\n this.frame.source.glTexture = null;\r\n }\r\n\r\n if (!PensPools.hasOwnProperty(type)) {\r\n PensPools[type] = new _pool_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]();\r\n }\r\n this.canvasText = new _canvastext_CanvasText_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\r\n parent: this,\r\n context: this.context,\r\n parser: parser,\r\n style: this.style,\r\n pensPool: PensPools[type]\r\n });\r\n\r\n //this.initRTL();\r\n\r\n if (style && style.padding) {\r\n this.setPadding(style.padding);\r\n }\r\n\r\n this.setText(text);\r\n\r\n scene.sys.game.events.on('contextrestored', function () {\r\n this.dirty = true;\r\n }, this);\r\n }\r\n\r\n set text(value) {\r\n this.setText(value);\r\n }\r\n get text() {\r\n return this._text;\r\n }\r\n\r\n initRTL() {\r\n if (!this.style.rtl) {\r\n return;\r\n }\r\n\r\n // Here is where the crazy starts.\r\n //\r\n // Due to browser implementation issues, you cannot fillText BiDi text to a canvas\r\n // that is not part of the DOM. It just completely ignores the direction property.\r\n\r\n this.canvas.dir = 'rtl';\r\n\r\n // Experimental atm, but one day ...\r\n this.context.direction = 'rtl';\r\n\r\n // Add it to the DOM, but hidden within the parent canvas.\r\n this.canvas.style.display = 'none';\r\n\r\n AddToDOM(this.canvas, this.scene.sys.canvas);\r\n\r\n // And finally we set the x origin\r\n this.originX = 1;\r\n }\r\n\r\n setText(value) {\r\n if (!value && value !== 0) {\r\n value = '';\r\n }\r\n\r\n if (Array.isArray(value)) {\r\n value = value.join('\\n');\r\n }\r\n\r\n if (value !== this._text) {\r\n this._text = value.toString();\r\n\r\n this.updateText();\r\n }\r\n\r\n return this;\r\n }\r\n\r\n setStyle(style) {\r\n return this.style.setStyle(style);\r\n }\r\n\r\n setFont(font) {\r\n return this.style.setFont(font);\r\n }\r\n\r\n setFontFamily(family) {\r\n return this.style.setFontFamily(family);\r\n }\r\n\r\n setFontSize(size) {\r\n return this.style.setFontSize(size);\r\n }\r\n\r\n setFontStyle(style) {\r\n return this.style.setFontStyle(style);\r\n }\r\n\r\n setFixedSize(width, height) {\r\n return this.style.setFixedSize(width, height);\r\n }\r\n\r\n setBackgroundColor(color) {\r\n return this.style.setBackgroundColor(color);\r\n }\r\n\r\n setFill(color) {\r\n return this.style.setFill(color);\r\n }\r\n\r\n setColor(color) {\r\n return this.style.setColor(color);\r\n }\r\n\r\n setStroke(color, thickness) {\r\n return this.style.setStroke(color, thickness);\r\n }\r\n\r\n setShadow(x, y, color, blur, shadowStroke, shadowFill) {\r\n return this.style.setShadow(x, y, color, blur, shadowStroke, shadowFill);\r\n }\r\n\r\n setShadowOffset(x, y) {\r\n return this.style.setShadowOffset(x, y);\r\n }\r\n\r\n setShadowColor(color) {\r\n return this.style.setShadowColor(color);\r\n }\r\n\r\n setShadowBlur(blur) {\r\n return this.style.setShadowBlur(blur);\r\n }\r\n\r\n setShadowStroke(enabled) {\r\n return this.style.setShadowStroke(enabled);\r\n }\r\n\r\n setShadowFill(enabled) {\r\n return this.style.setShadowFill(enabled);\r\n }\r\n\r\n setWrapMode(mode) {\r\n return this.style.setWrapMode(mode);\r\n }\r\n\r\n setWrapWidth(width) {\r\n return this.style.setWrapWidth(width);\r\n }\r\n\r\n setAlign(align) {\r\n return this.style.setHAlign(align);\r\n }\r\n\r\n setLineSpacing(value) {\r\n return this.style.setLineSpacing(value);\r\n }\r\n\r\n setPadding(left, top, right, bottom) {\r\n if (typeof left === 'object') {\r\n var config = left;\r\n\r\n // If they specify x and/or y this applies to all\r\n var x = GetValue(config, 'x', null);\r\n\r\n if (x !== null) {\r\n left = x;\r\n right = x;\r\n } else {\r\n left = GetValue(config, 'left', 0);\r\n right = GetValue(config, 'right', left);\r\n }\r\n\r\n var y = GetValue(config, 'y', null);\r\n\r\n if (y !== null) {\r\n top = y;\r\n bottom = y;\r\n } else {\r\n top = GetValue(config, 'top', 0);\r\n bottom = GetValue(config, 'bottom', top);\r\n }\r\n } else {\r\n if (left === undefined) {\r\n left = 0;\r\n }\r\n if (top === undefined) {\r\n top = left;\r\n }\r\n if (right === undefined) {\r\n right = left;\r\n }\r\n if (bottom === undefined) {\r\n bottom = top;\r\n }\r\n }\r\n\r\n this.padding.left = left;\r\n this.padding.top = top;\r\n this.padding.right = right;\r\n this.padding.bottom = bottom;\r\n\r\n return this.updateText(false);\r\n }\r\n\r\n setResolution(value) {\r\n return this.style.setResolution(value);\r\n }\r\n\r\n setMaxLines(max) {\r\n return this.style.setMaxLines(max);\r\n }\r\n\r\n updateText(runWrap) {\r\n if (runWrap === undefined) {\r\n runWrap = true;\r\n }\r\n var canvasText = this.canvasText;\r\n\r\n // wrap text to pens\r\n var style = this.style;\r\n if (runWrap) {\r\n canvasText.updatePenManager(\r\n this._text,\r\n style.wrapMode,\r\n style.wrapWidth,\r\n style.lineHeight\r\n );\r\n }\r\n\r\n // resize\r\n var padding = this.padding;\r\n var textWidth, textHeight;\r\n if (style.fixedWidth === 0) {\r\n this.width = canvasText.linesWidth + padding.left + padding.right;\r\n textWidth = canvasText.linesWidth;\r\n }\r\n else {\r\n this.width = style.fixedWidth;\r\n textWidth = this.width - padding.left - padding.right;\r\n if (textWidth < canvasText.linesWidth) {\r\n textWidth = canvasText.linesWidth;\r\n }\r\n }\r\n if (style.fixedHeight === 0) {\r\n this.height = canvasText.linesHeight + padding.top + padding.bottom;\r\n textHeight = canvasText.linesHeight;\r\n }\r\n else {\r\n this.height = style.fixedHeight;\r\n textHeight = this.height - padding.top - padding.bottom;\r\n if (textHeight < canvasText.linesHeight) {\r\n textHeight = canvasText.linesHeight;\r\n }\r\n }\r\n\r\n var w = this.width;\r\n var h = this.height;\r\n\r\n this.updateDisplayOrigin();\r\n\r\n var resolution = style.resolution;\r\n w *= resolution;\r\n h *= resolution;\r\n\r\n w = Math.max(Math.ceil(w), 1);\r\n h = Math.max(Math.ceil(h), 1);\r\n\r\n var canvas = this.canvas;\r\n var context = this.context;\r\n if (canvas.width !== w || canvas.height !== h) {\r\n canvas.width = w;\r\n canvas.height = h;\r\n this.frame.setSize(w, h);\r\n } else {\r\n context.clearRect(0, 0, w, h);\r\n }\r\n\r\n context.save();\r\n context.scale(resolution, resolution);\r\n\r\n // draw\r\n canvasText.draw(\r\n padding.left,\r\n padding.top,\r\n textWidth,\r\n textHeight\r\n );\r\n\r\n context.restore();\r\n\r\n if (this.renderer.gl) {\r\n this.frame.source.glTexture = this.renderer.canvasToTexture(canvas, this.frame.source.glTexture, true);\r\n this.frame.glTexture = this.frame.source.glTexture;\r\n }\r\n\r\n this.dirty = true;\r\n\r\n var input = this.input;\r\n\r\n if (input && !input.customHitArea) {\r\n input.hitArea.width = this.width;\r\n input.hitArea.height = this.height;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n getTextMetrics() {\r\n return this.style.getTextMetrics();\r\n }\r\n\r\n toJSON() {\r\n var out = Components.ToJSON(this);\r\n\r\n // Extra Text data is added here\r\n\r\n var data = {\r\n autoRound: this.autoRound,\r\n text: this._text,\r\n style: this.style.toJSON(),\r\n resolution: this.resolution,\r\n padding: {\r\n left: this.padding.left,\r\n right: this.padding.right,\r\n top: this.padding.top,\r\n bottom: this.padding.bottom\r\n }\r\n };\r\n\r\n out.data = data;\r\n\r\n return out;\r\n }\r\n\r\n preDestroy() {\r\n if (this.style.rtl) {\r\n RemoveFromDOM(this.canvas);\r\n }\r\n\r\n CanvasPool.remove(this.canvas);\r\n this.canvasText.destroy();\r\n }\r\n\r\n setInteractive(shape, callback, dropZone) {\r\n GameObject.prototype.setInteractive.call(this, shape, callback, dropZone);\r\n this.canvasText.setInteractive();\r\n return this;\r\n }\r\n\r\n getWrappedText(text, start, end) {\r\n text = this.canvasText.getText(text, start, end, true);\r\n return text.split(SPLITREGEXP);\r\n }\r\n\r\n getPlainText(text, start, end) {\r\n return this.canvasText.getPlainText(text, start, end);\r\n }\r\n\r\n getText(text, start, end) {\r\n return this.canvasText.getText(text, start, end, false);\r\n }\r\n\r\n getSubString(text, start, end) {\r\n return this.getText(text, start, end);\r\n }\r\n\r\n copyPenManager(penManager) {\r\n return this.canvasText.copyPenManager(penManager);\r\n }\r\n\r\n getPenManager(text, penManager) {\r\n return this.canvasText.getPenManager(text, penManager);\r\n }\r\n\r\n setSize(width, height) {\r\n return this.setFixedSize(width, height);\r\n }\r\n\r\n resize(width, height) {\r\n return this.setFixedSize(width, height);\r\n }\r\n\r\n set lineSpacing(value) {\r\n this.setLineSpacing(value);\r\n }\r\n get lineSpacing() {\r\n return this.style.lineSpacing;\r\n }\r\n\r\n get imageManager() {\r\n return Object(_imagemanager_GetGlobImageManager_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.scene.textures);\r\n }\r\n\r\n addImage(key, config) {\r\n this.imageManager.add(key, config);\r\n return this;\r\n }\r\n\r\n drawAreaBounds(graphics, color) {\r\n this.canvasText.hitAreaManager.drawBounds(graphics, color, this);\r\n return this;\r\n }\r\n}\r\n\r\nconst Components = Phaser.GameObjects.Components;\r\nPhaser.Class.mixin(Text,\r\n [\r\n Components.Alpha,\r\n Components.BlendMode,\r\n Components.ComputedSize,\r\n Components.Crop,\r\n Components.Depth,\r\n Components.Flip,\r\n Components.GetBounds,\r\n Components.Mask,\r\n Components.Origin,\r\n Components.Pipeline,\r\n Components.ScrollFactor,\r\n Components.Tint,\r\n Components.Transform,\r\n Components.Visible,\r\n _render_Render_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]\r\n ]\r\n);\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (Text);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/Text.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/CanvasText.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/CanvasText.js ***! \*****************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _DrawMethods_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DrawMethods.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/DrawMethods.js\");\n/* harmony import */ var _penmanger_PenManager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../penmanger/PenManager.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/penmanger/PenManager.js\");\n/* harmony import */ var _hitareamanager_HitAreaManager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../hitareamanager/HitAreaManager.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/hitareamanager/HitAreaManager.js\");\n/* harmony import */ var _SetInteractive_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SetInteractive.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/SetInteractive.js\");\n/* harmony import */ var _const_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../const.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/const.js\");\n/* harmony import */ var _WrapText_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./WrapText.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/WrapText.js\");\n/* harmony import */ var _utils_object_Clone_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../utils/object/Clone.js */ \"./node_modules/phaser3-rex-plugins/plugins/utils/object/Clone.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nconst GetValue = Phaser.Utils.Objects.GetValue;\r\nconst NO_WRAP = _const_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].NO_WRAP;\r\nconst NO_NEWLINE = _const_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].NO_NEWLINE;\r\n\r\nclass CanvasText {\r\n constructor(config) {\r\n this.parent = config.parent;\r\n this.context = GetValue(config, 'context', null);\r\n this.canvas = this.context.canvas;\r\n this.parser = GetValue(config, 'parser', null);\r\n this.defatultStyle = GetValue(config, 'style', null);\r\n this.autoRound = true;\r\n\r\n this.pensPool = GetValue(config, 'pensPool', null);\r\n this.penManager = this.newPenManager();\r\n this._tmpPenManager = null;\r\n\r\n this.hitAreaManager = new _hitareamanager_HitAreaManager_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\r\n\r\n var context = this.context;\r\n this.getTextWidth = function (text) {\r\n return context.measureText(text).width;\r\n }\r\n }\r\n\r\n destroy() {\r\n this.context = undefined;\r\n this.canvas = undefined;\r\n this.parser = undefined;\r\n this.defatultStyle = undefined;\r\n\r\n if (this.penManager) {\r\n this.penManager.destroy();\r\n this.penManager = undefined;\r\n }\r\n if (this._tmpPenManager) {\r\n this._tmpPenManager.destroy();\r\n this._tmpPenManager = undefined;\r\n }\r\n if (this.hitAreaManager) {\r\n this.hitAreaManager.destroy();\r\n this.hitAreaManager = undefined;\r\n }\r\n }\r\n\r\n updatePenManager(text, wrapMode, wrapWidth, lineHeight, penManager) {\r\n if (penManager === undefined) {\r\n penManager = this.penManager;\r\n }\r\n penManager.freePens();\r\n if (text === \"\") {\r\n return penManager;\r\n }\r\n\r\n var canvas = this.canvas;\r\n var context = this.context;\r\n\r\n var cursorX = 0,\r\n cursorY = 0;\r\n\r\n var plainText, curProp, curStyle;\r\n var match = this.parser.splitText(text),\r\n result, wrapLines;\r\n for (var i = 0, len = match.length; i < len; i++) {\r\n result = this.parser.tagTextToProp(match[i], curProp);\r\n plainText = result.plainText;\r\n curProp = result.prop;\r\n\r\n if (curProp.img) { // Image tag \r\n var imgWidth = this.imageManager.getOuterWidth(curProp.img);\r\n if ((wrapWidth > 0) && (wrapMode !== NO_WRAP)) { // Wrap mode\r\n if (wrapWidth < (cursorX + imgWidth)) {\r\n penManager.addNewLinePen();\r\n cursorY += lineHeight;\r\n cursorX = 0;\r\n }\r\n }\r\n penManager.addImagePen(cursorX, cursorY, imgWidth, Object(_utils_object_Clone_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(curProp));\r\n cursorX += imgWidth;\r\n\r\n } else if (plainText !== '') {\r\n // wrap text to lines\r\n // Save the current context.\r\n this.context.save();\r\n curStyle = this.parser.propToContextStyle(\r\n this.defatultStyle,\r\n curProp\r\n );\r\n curStyle.buildFont();\r\n curStyle.syncFont(canvas, context);\r\n curStyle.syncStyle(canvas, context);\r\n wrapLines = Object(_WrapText_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(plainText, this.getTextWidth, wrapMode, wrapWidth, cursorX);\r\n\r\n // add pens\r\n var n;\r\n for (var j = 0, jLen = wrapLines.length; j < jLen; j++) {\r\n n = wrapLines[j];\r\n penManager.addTextPen(n.text, cursorX, cursorY, n.width, Object(_utils_object_Clone_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(curProp), n.newLineMode);\r\n\r\n if (n.newLineMode !== NO_NEWLINE) {\r\n cursorX = 0;\r\n cursorY += lineHeight;\r\n } else {\r\n cursorX += n.width;\r\n }\r\n\r\n }\r\n this.context.restore();\r\n\r\n }\r\n\r\n }\r\n\r\n return penManager;\r\n }\r\n\r\n get startXOffset() {\r\n var defatultStyle = this.defatultStyle;\r\n return (defatultStyle.strokeThickness / 2);\r\n }\r\n\r\n get startYOffset() {\r\n var defatultStyle = this.defatultStyle;\r\n return (defatultStyle.strokeThickness / 2) + defatultStyle.metrics.ascent;\r\n }\r\n\r\n get lines() {\r\n return this.penManager.lines;\r\n }\r\n\r\n get desplayLinesCount() {\r\n var linesCount = this.penManager.linesCount,\r\n maxLines = this.defatultStyle.maxLines;\r\n if ((maxLines > 0) && (linesCount > maxLines)) {\r\n linesCount = maxLines;\r\n }\r\n return linesCount;\r\n }\r\n\r\n get linesWidth() {\r\n return this.penManager.getMaxLineWidth();\r\n }\r\n\r\n get linesHeight() {\r\n var linesCount = this.desplayLinesCount;\r\n var linesHeight = (this.defatultStyle.lineHeight * linesCount);\r\n if (linesCount > 0) {\r\n linesHeight -= this.defatultStyle.lineSpacing;\r\n }\r\n return linesHeight;\r\n }\r\n\r\n get imageManager() {\r\n return this.parent.imageManager;\r\n }\r\n\r\n newPenManager() {\r\n return new _penmanger_PenManager_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]({\r\n pensPool: this.pensPool,\r\n tagToText: this.parser.propToTagText,\r\n tagToTextScope: this.parser\r\n });\r\n }\r\n\r\n get tmpPenManager() {\r\n if (this._tmpPenManager === null) {\r\n this._tmpPenManager = this.newPenManager();\r\n }\r\n return this._tmpPenManager;\r\n }\r\n\r\n getPlainText(text, start, end) {\r\n var plainText;\r\n if (text == null) {\r\n plainText = this.penManager.plainText;\r\n } else {\r\n var m, match = this.parser.splitText(text, 1); // PLAINTEXTONLY_MODE\r\n plainText = \"\";\r\n for (var i = 0, len = match.length; i < len; i++) {\r\n plainText += match[i];\r\n }\r\n }\r\n\r\n if ((start != null) || (end != null)) {\r\n if (start == null) {\r\n start = 0;\r\n }\r\n if (end == null) {\r\n end = plainText.length;\r\n }\r\n plainText = plainText.substring(start, end);\r\n }\r\n\r\n return plainText;\r\n }\r\n\r\n getPenManager(text, retPenManager) {\r\n if (text === undefined) {\r\n return this.copyPenManager(retPenManager, this.penManager);\r\n }\r\n\r\n if (retPenManager === undefined) {\r\n retPenManager = this.newPenManager();\r\n }\r\n\r\n var defatultStyle = this.defatultStyle;\r\n this.updatePenManager(\r\n text,\r\n defatultStyle.wrapMode,\r\n defatultStyle.wrapWidth,\r\n defatultStyle.lineHeight,\r\n retPenManager\r\n );\r\n return retPenManager;\r\n }\r\n\r\n getText(text, start, end, wrap) {\r\n if (text == null) {\r\n return this.penManager.getSliceTagText(start, end, wrap);\r\n }\r\n\r\n var penManager = this.tmpPenManager;\r\n var defatultStyle = this.defatultStyle;\r\n this.updatePenManager(\r\n text,\r\n defatultStyle.wrapMode,\r\n defatultStyle.wrapWidth,\r\n defatultStyle.lineHeight,\r\n penManager\r\n );\r\n\r\n return penManager.getSliceTagText(start, end, wrap);\r\n }\r\n\r\n copyPenManager(ret, src) {\r\n if (src === undefined) {\r\n src = this.penManager;\r\n }\r\n return src.copy(ret);\r\n }\r\n\r\n getTextWidth(penManager) {\r\n if (penManager === undefined) {\r\n penManager = this.penManager;\r\n }\r\n\r\n return penManager.getMaxLineWidth();\r\n }\r\n\r\n getLastPen(penManager) {\r\n if (penManager === undefined) {\r\n penManager = this.penManager;\r\n }\r\n\r\n return penManager.lastPen;\r\n }\r\n};\r\n\r\nvar methods = {\r\n setInteractive: _SetInteractive_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\r\n}\r\n\r\nObject.assign(\r\n CanvasText.prototype,\r\n _DrawMethods_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\r\n methods\r\n);\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (CanvasText);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/CanvasText.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/DrawMethods.js": /*!******************************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/DrawMethods.js ***! \******************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _const_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../const.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/const.js\");\n\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\r\n draw(startX, startY, boxWidth, boxHeight) {\r\n var penManager = this.penManager;\r\n this.hitAreaManager.clear();\r\n\r\n var context = this.context;\r\n context.save();\r\n\r\n // this.clear();\r\n this.drawBackground(this.defatultStyle.backgroundColor);\r\n\r\n // draw lines\r\n var defatultStyle = this.defatultStyle;\r\n startX += this.startXOffset;\r\n startY += this.startYOffset;\r\n var halign = defatultStyle.halign,\r\n valign = defatultStyle.valign;\r\n\r\n var lineWidth, lineHeight = defatultStyle.lineHeight;\r\n var lines = penManager.lines;\r\n var totalLinesNum = lines.length,\r\n maxLines = defatultStyle.maxLines;\r\n var drawLinesNum, drawLineStartIdx, drawLineEndIdx;\r\n if ((maxLines > 0) && (totalLinesNum > maxLines)) {\r\n drawLinesNum = maxLines;\r\n if (valign === 'center') { // center\r\n drawLineStartIdx = Math.floor((totalLinesNum - drawLinesNum) / 2);\r\n } else if (valign === 'bottom') { // bottom\r\n drawLineStartIdx = totalLinesNum - drawLinesNum;\r\n } else {\r\n drawLineStartIdx = 0;\r\n }\r\n } else {\r\n drawLinesNum = totalLinesNum;\r\n drawLineStartIdx = 0;\r\n }\r\n drawLineEndIdx = drawLineStartIdx + drawLinesNum;\r\n\r\n var offsetX, offsetY;\r\n if (valign === 'center') { // center\r\n offsetY = Math.max((boxHeight - (drawLinesNum * lineHeight)) / 2, 0);\r\n } else if (valign === 'bottom') { // bottom\r\n offsetY = Math.max(boxHeight - (drawLinesNum * lineHeight) - 2, 0);\r\n } else {\r\n offsetY = 0;\r\n }\r\n offsetY += startY;\r\n for (var lineIdx = drawLineStartIdx; lineIdx < drawLineEndIdx; lineIdx++) {\r\n lineWidth = penManager.getLineWidth(lineIdx);\r\n if (lineWidth === 0) {\r\n continue;\r\n }\r\n\r\n if (halign === 'center') { // center\r\n offsetX = (boxWidth - lineWidth) / 2;\r\n } else if (halign === 'right') { // right\r\n offsetX = boxWidth - lineWidth;\r\n } else {\r\n offsetX = 0;\r\n }\r\n offsetX += startX;\r\n\r\n var pens = lines[lineIdx];\r\n for (var penIdx = 0, pensLen = pens.length; penIdx < pensLen; penIdx++) {\r\n this.drawPen(pens[penIdx], offsetX, offsetY);\r\n }\r\n }\r\n\r\n context.restore();\r\n },\r\n\r\n drawPen(pen, offsetX, offsetY) {\r\n offsetX += pen.x;\r\n offsetY += pen.y;\r\n\r\n var canvas = this.canvas;\r\n var context = this.context;\r\n context.save();\r\n\r\n var curStyle = this.parser.propToContextStyle(\r\n this.defatultStyle,\r\n pen.prop\r\n );\r\n curStyle.buildFont();\r\n curStyle.syncFont(canvas, context);\r\n curStyle.syncStyle(canvas, context);\r\n\r\n // Underline\r\n if ((curStyle.underlineThickness > 0) && (pen.width > 0)) {\r\n this.drawUnderline(offsetX, offsetY, pen.width, curStyle);\r\n }\r\n\r\n // Text\r\n if (pen.isTextPen) {\r\n this.drawText(offsetX, offsetY, pen.text, curStyle);\r\n }\r\n\r\n // Image\r\n if (pen.isImagePen) {\r\n this.drawImage(offsetX, offsetY, pen.prop.img, curStyle);\r\n }\r\n\r\n context.restore();\r\n\r\n if (pen.hasAreaMarker && (pen.width > 0)) {\r\n this.hitAreaManager.add(\r\n pen.prop.area,\r\n offsetX, (offsetY - this.startYOffset),\r\n pen.width, this.defatultStyle.lineHeight);\r\n }\r\n },\r\n\r\n clear() {\r\n var canvas = this.canvas;\r\n this.context.clearRect(0, 0, canvas.width, canvas.height);\r\n },\r\n\r\n drawBackground(color) {\r\n if (color === null) {\r\n return;\r\n }\r\n this.context.fillStyle = color;\r\n this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);\r\n },\r\n\r\n drawUnderline(x, y, width, style) {\r\n y += style.underlineOffset - (style.underlineThickness / 2);\r\n if (this.autoRound) {\r\n x = Math.round(x);\r\n y = Math.round(y);\r\n }\r\n\r\n var context = this.context;\r\n var savedLineCap = context.lineCap;\r\n context.lineCap = 'butt';\r\n context.beginPath();\r\n context.strokeStyle = style.underlineColor;\r\n context.lineWidth = style.underlineThickness;\r\n context.moveTo(x, y);\r\n context.lineTo((x + width), y);\r\n context.stroke();\r\n context.lineCap = savedLineCap;\r\n },\r\n\r\n drawText(x, y, text, style) {\r\n if (this.autoRound) {\r\n x = Math.round(x);\r\n y = Math.round(y);\r\n }\r\n\r\n var context = this.context;\r\n if (style.strokeThickness) {\r\n style.syncShadow(context, style.shadowStroke);\r\n context.strokeText(text, x, y);\r\n }\r\n\r\n if (style.color && (style.color !== 'none')) {\r\n style.syncShadow(context, style.shadowFill);\r\n context.fillText(text, x, y);\r\n }\r\n },\r\n\r\n drawImage(x, y, imgKey, style) {\r\n var imageManager = this.parent.imageManager;\r\n var imgData = imageManager.get(imgKey);\r\n var frame = imageManager.getFrame(imgKey);\r\n\r\n x += imgData.left;\r\n y += - this.startYOffset + imgData.y;\r\n if (this.autoRound) {\r\n x = Math.round(x);\r\n y = Math.round(y);\r\n }\r\n\r\n var context = this.context;\r\n context.drawImage(\r\n frame.source.image,\r\n frame.cutX, frame.cutY, frame.cutWidth, frame.cutHeight,\r\n x, y, imgData.width, imgData.height\r\n );\r\n }\r\n\r\n});\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/DrawMethods.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/SetInteractive.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/SetInteractive.js ***! \*********************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\nvar SetInteractive = function () {\r\n this.parent\r\n .on('pointerdown', function (pointer, localX, localY, event) {\r\n FireEvent.call(this, 'areadown', pointer, localX, localY);\r\n }, this)\r\n .on('pointerup', function (pointer, localX, localY, event) {\r\n FireEvent.call(this, 'areaup', pointer, localX, localY);\r\n }, this)\r\n}\r\n\r\nvar FireEvent = function (eventName, pointer, localX, localY) {\r\n var key = this.hitAreaManager.contains(localX, localY);\r\n if (key === false) {\r\n return;\r\n }\r\n this.parent.emit(`${eventName}-${key}`, pointer, localX, localY)\r\n this.parent.emit(eventName, key, pointer, localX, localY)\r\n}\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (SetInteractive);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/SetInteractive.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/WrapText.js": /*!***************************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/WrapText.js ***! \***************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _pool_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../pool.js */ \"./node_modules/phaser3-rex-plugins/plugins/pool.js\");\n/* harmony import */ var _const_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../const.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/const.js\");\n\r\n\r\n\r\nconst NO_NEWLINE = _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].NO_NEWLINE;\r\nconst RAW_NEWLINE = _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].RAW_NEWLINE;\r\nconst WRAPPED_NEWLINE = _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].WRAPPED_NEWLINE;\r\nconst NO_WRAP = _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].NO_WRAP;\r\nconst WORD_WRAP = _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].WORD_WRAP;\r\nconst CHAR_WRAP = _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].CHAR_WRAP;\r\nconst splitRegExp = _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].SPLITREGEXP;\r\n\r\nvar WRAP_RESULT = [];\r\nvar WrapText = function (text, getTextWidth, wrapMode, wrapWidth, offset) {\r\n if (wrapWidth <= 0) {\r\n wrapMode = NO_WRAP;\r\n }\r\n\r\n var retLines = WRAP_RESULT;\r\n LinesPool.pushMultiple(retLines);\r\n\r\n if (!text || !text.length) {\r\n return retLines;\r\n }\r\n\r\n var lines = text.split(splitRegExp),\r\n line, remainWidth, isLaseLine, newLineMode;\r\n for (var i = 0, linesLen = lines.length; i < linesLen; i++) {\r\n line = lines[i];\r\n newLineMode = (i === (linesLen - 1)) ? NO_NEWLINE : RAW_NEWLINE;\r\n\r\n if (wrapMode === NO_WRAP) {\r\n var textWidth = getTextWidth(line);\r\n retLines.push(LinesPool.newline(line, textWidth, newLineMode));\r\n continue;\r\n } else {\r\n if (i === 0) {\r\n remainWidth = wrapWidth - offset;\r\n } else {\r\n remainWidth = wrapWidth;\r\n }\r\n }\r\n\r\n // short string testing\r\n if (line.length <= 100) {\r\n var textWidth = getTextWidth(line);\r\n if (textWidth <= remainWidth) {\r\n retLines.push(LinesPool.newline(line, textWidth, newLineMode));\r\n continue;\r\n }\r\n }\r\n\r\n // character mode\r\n var tokenArray;\r\n if (wrapMode === WORD_WRAP) {\r\n // word mode\r\n tokenArray = line.split(' ');\r\n } else {\r\n tokenArray = line;\r\n }\r\n var token;\r\n var curLineText = '',\r\n lineText = '',\r\n currLineWidth, lineWidth = 0;\r\n for (var j = 0, tokenLen = tokenArray.length; j < tokenLen; j++) {\r\n token = tokenArray[j];\r\n\r\n if (wrapMode === WORD_WRAP) {\r\n curLineText += token;\r\n\r\n if (j < (tokenLen - 1)) {\r\n curLineText += ' ';\r\n }\r\n } else {\r\n curLineText += token;\r\n }\r\n\r\n currLineWidth = getTextWidth(curLineText);\r\n if (currLineWidth > remainWidth) {\r\n // new line\r\n if (j === 0) {\r\n retLines.push(LinesPool.newline('', 0, WRAPPED_NEWLINE));\r\n } else {\r\n retLines.push(LinesPool.newline(lineText, lineWidth, WRAPPED_NEWLINE));\r\n curLineText = token;\r\n if (wrapMode === WORD_WRAP) {\r\n if (j < (tokenLen - 1)) {\r\n curLineText += ' ';\r\n }\r\n }\r\n currLineWidth = getTextWidth(curLineText);\r\n }\r\n\r\n remainWidth = wrapWidth;\r\n }\r\n\r\n lineText = curLineText;\r\n lineWidth = currLineWidth;\r\n } // for token in tokenArray\r\n\r\n // flush remain text\r\n retLines.push(LinesPool.newline(lineText, lineWidth, newLineMode));\r\n\r\n } // for each line in lines\r\n\r\n return retLines;\r\n};\r\n\r\nvar LinesPool = new _pool_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\r\nLinesPool.newline = function (text, width, newLineMode) {\r\n var l = this.pop();\r\n if (l === null) {\r\n l = {};\r\n }\r\n l.text = text;\r\n l.width = width;\r\n l.newLineMode = newLineMode;\r\n return l;\r\n};\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (WrapText);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/canvastext/WrapText.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/const.js": /*!*************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/const.js ***! \*************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\nvar CONST = {\r\n // new line mode\r\n NO_NEWLINE: 0,\r\n RAW_NEWLINE: 1,\r\n WRAPPED_NEWLINE: 2,\r\n\r\n // wrap mode\r\n NO_WRAP: 0,\r\n WORD_WRAP: 1,\r\n CHAR_WRAP: 2,\r\n\r\n // split lines\r\n SPLITREGEXP: /(?:\\r\\n|\\r|\\n)/\r\n};\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (CONST);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/const.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/hitareamanager/HitAreaManager.js": /*!*************************************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/hitareamanager/HitAreaManager.js ***! \*************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _pool_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../pool.js */ \"./node_modules/phaser3-rex-plugins/plugins/pool.js\");\n\r\n\r\nconst Rectangle = Phaser.Geom.Rectangle;\r\n\r\nvar RectanglePool = new _pool_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\r\nclass HitAreaManager {\r\n constructor() {\r\n this.hitAreas = [];\r\n }\r\n\r\n destroy() {\r\n this.clear();\r\n }\r\n\r\n clear() {\r\n RectanglePool.pushMultiple(this.hitAreas);\r\n return this;\r\n }\r\n\r\n add(key, x, y, width, height) {\r\n var rectangle = RectanglePool.pop();\r\n if (rectangle === null) {\r\n rectangle = new Rectangle(x, y, width, height);\r\n } else {\r\n rectangle.setTo(x, y, width, height);\r\n }\r\n rectangle.key = key;\r\n this.hitAreas.push(rectangle);\r\n return this;\r\n }\r\n\r\n contains(x, y) {\r\n var hitAreas = this.hitAreas, hitArea;\r\n for (var i = 0, cnt = hitAreas.length; i < cnt; i++) {\r\n hitArea = hitAreas[i];\r\n if (hitArea.contains(x, y)) {\r\n return hitArea.key;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n drawBounds(graphics, color, parent) {\r\n if (color === undefined) {\r\n color = 0xffffff;\r\n }\r\n\r\n if (parent) {\r\n graphics\r\n .save()\r\n .scaleCanvas(parent.scaleX, parent.scaleY)\r\n .rotateCanvas(parent.rotation)\r\n .translateCanvas(parent.x, parent.y)\r\n }\r\n\r\n var hitAreas = this.hitAreas, hitArea;\r\n for (var i = 0, cnt = hitAreas.length; i < cnt; i++) {\r\n hitArea = hitAreas[i];\r\n graphics.lineStyle(1, color).strokeRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height);\r\n }\r\n\r\n if (parent) {\r\n graphics\r\n .restore()\r\n }\r\n return this;\r\n }\r\n}\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (HitAreaManager);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/hitareamanager/HitAreaManager.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/imagemanager/GetGlobImageManager.js": /*!****************************************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/imagemanager/GetGlobImageManager.js ***! \****************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ImageManager_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ImageManager.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/imagemanager/ImageManager.js\");\n\r\n\r\nvar globImageManager;\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(textureManager) {\r\n if (globImageManager === undefined) {\r\n globImageManager = new _ImageManager_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](textureManager);\r\n }\r\n return globImageManager;\r\n});\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/imagemanager/GetGlobImageManager.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/imagemanager/ImageManager.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/imagemanager/ImageManager.js ***! \*********************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\nconst GetValue = Phaser.Utils.Objects.GetValue;\r\n\r\nclass ImageManager {\r\n constructor(textureManager) {\r\n this.textureManager = textureManager;\r\n this.images = {};\r\n }\r\n\r\n add(key, config) {\r\n if (typeof (key) === 'string') {\r\n this._add(key, config);\r\n } else if (Array.isArray(key)) {\r\n var data = key;\r\n for (var i = 0, cnt = data.length; i < cnt; i++) {\r\n this._add(data[i]);\r\n }\r\n } else {\r\n var data = key;\r\n for (var key in data) {\r\n this._add(key, data[key]);\r\n }\r\n }\r\n return this;\r\n }\r\n\r\n _add(key, config) {\r\n if (config === undefined) {\r\n config = {\r\n key: key\r\n }\r\n }\r\n\r\n var textureKey = config.key, frameKey = config.frame;\r\n var width = config.width, height = config.height;\r\n\r\n if ((width === undefined) || (height === undefined)) {\r\n var frame = this.textureManager.getFrame(textureKey, frameKey);\r\n var frameWidth = (frame) ? frame.cutWidth : 0;\r\n var frameHeight = (frame) ? frame.cutHeight : 0;\r\n if ((width === undefined) && (height === undefined)) {\r\n width = frameWidth;\r\n height = frameHeight;\r\n } else if (width === undefined) {\r\n width = frameWidth * (height / frameHeight);\r\n } else if (height === undefined) {\r\n height = frameHeight * (width / frameWidth);\r\n }\r\n }\r\n\r\n this.images[key] = {\r\n key: textureKey,\r\n frame: frameKey,\r\n width: width,\r\n height: height,\r\n y: GetValue(config, 'y', 0),\r\n left: GetValue(config, 'left', 0),\r\n right: GetValue(config, 'right', 0)\r\n }\r\n }\r\n\r\n remove(key) {\r\n if (this.images.hasOwnProperty(key)) {\r\n delete this.images[key];\r\n }\r\n return this;\r\n }\r\n\r\n get(key) {\r\n if (!this.images.hasOwnProperty(key)) {\r\n if (this.textureManager.exists(key)) {\r\n this.add(key);\r\n }\r\n }\r\n return this.images[key];\r\n }\r\n\r\n getOuterWidth(key) {\r\n var data = this.get(key);\r\n return (data) ? (data.width + data.left + data.right) : 0;\r\n }\r\n\r\n getFrame(key) {\r\n var data = this.get(key);\r\n return (data) ? this.textureManager.getFrame(data.key, data.frame) : undefined;\r\n }\r\n\r\n hasTexture(key) {\r\n return !!this.getFrame(key);\r\n }\r\n}\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (ImageManager);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/imagemanager/ImageManager.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/penmanger/Pen.js": /*!*********************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/penmanger/Pen.js ***! \*********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _const_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../const.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/const.js\");\n\r\n\r\nconst GetValue = Phaser.Utils.Objects.GetValue;\r\nconst NO_NEWLINE = _const_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].NO_NEWLINE;\r\nconst RAW_NEWLINE = _const_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].RAW_NEWLINE;\r\n\r\nclass Pen {\r\n constructor(config) {\r\n this.prop = {};\r\n this.resetFromJSON(config);\r\n }\r\n\r\n resetFromJSON(o) { // (txt, x, y, width, prop, newLineMode, startIndex)\r\n this.text = GetValue(o, 'text', '');\r\n this.x = GetValue(o, 'x', 0);\r\n this.y = GetValue(o, 'y', 0);\r\n this.width = GetValue(o, 'width', 0);\r\n\r\n var prop = GetValue(o, 'prop', null);\r\n if (prop === null) {\r\n prop = {};\r\n }\r\n this.prop = prop;\r\n this.newLineMode = GetValue(o, 'newLineMode', 0);\r\n this.startIndex = GetValue(o, 'startIndex', 0);\r\n }\r\n\r\n get plainText() {\r\n var txt = this.text\r\n if (this.newLineMode === RAW_NEWLINE) {\r\n txt += \"\\n\";\r\n }\r\n\r\n return txt;\r\n }\r\n\r\n get wrapText() {\r\n var txt = this.text;\r\n if (this.newLineMode !== NO_NEWLINE) {\r\n txt += \"\\n\";\r\n }\r\n\r\n return txt;\r\n }\r\n\r\n get rawTextLength() {\r\n var len = this.text.length;\r\n if (this.newLineMode === RAW_NEWLINE) {\r\n len += 1;\r\n }\r\n return len;\r\n }\r\n\r\n get endIndex() {\r\n return this.startIndex + this.rawTextLength;\r\n }\r\n\r\n get lastX() {\r\n return this.x + this.width;\r\n }\r\n\r\n get isTextPen() {\r\n return (this.text !== '');\r\n }\r\n\r\n get isImagePen() {\r\n return !!this.prop.img;\r\n }\r\n\r\n get hasAreaMarker() {\r\n return !!this.prop.area;\r\n }\r\n};\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (Pen);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/penmanger/Pen.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/penmanger/PenManager.js": /*!****************************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/penmanger/PenManager.js ***! \****************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _pool_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../pool.js */ \"./node_modules/phaser3-rex-plugins/plugins/pool.js\");\n/* harmony import */ var _Pen_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Pen.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/penmanger/Pen.js\");\n/* harmony import */ var _const_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../const.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/const.js\");\n/* harmony import */ var _utils_object_Clone_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../utils/object/Clone.js */ \"./node_modules/phaser3-rex-plugins/plugins/utils/object/Clone.js\");\n/* harmony import */ var _utils_object_NOOP_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../utils/object/NOOP.js */ \"./node_modules/phaser3-rex-plugins/plugins/utils/object/NOOP.js\");\n\r\n\r\n\r\n\r\n\r\n\r\nconst GetFastValue = Phaser.Utils.Objects.GetFastValue;\r\nconst NO_NEWLINE = _const_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].NO_NEWLINE;\r\nconst WRAPPED_NEWLINE = _const_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].WRAPPED_NEWLINE;\r\n\r\nvar PensPool = new _pool_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](); // default pens pool\r\nvar LinesPool = new _pool_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](); // default lines pool\r\nclass PenManager {\r\n constructor(config) {\r\n this.pens = []; // all pens\r\n this.lines = []; // pens in lines [ [],[],[],.. ]\r\n this.maxLinesWidth = undefined;\r\n\r\n this.PensPool = GetFastValue(config, 'pensPool', PensPool);\r\n this.LinesPool = GetFastValue(config, 'linesPool', LinesPool);\r\n this.tagToText = GetFastValue(config, 'tagToText', _utils_object_NOOP_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\r\n this.tagToTextScope = GetFastValue(config, 'tagToTextScope', undefined);\r\n }\r\n\r\n destroy() {\r\n this.freePens();\r\n this.tagToText = undefined;\r\n this.tagToTextScope = undefined;\r\n }\r\n\r\n freePens() {\r\n for (var i = 0, len = this.lines.length; i < len; i++)\r\n this.lines[i].length = 0;\r\n\r\n this.PensPool.pushMultiple(this.pens);\r\n this.LinesPool.pushMultiple(this.lines);\r\n this.maxLinesWidth = undefined;\r\n }\r\n\r\n addTextPen(text, x, y, width, prop, newLineMode) {\r\n var pen = this.PensPool.pop();\r\n if (pen == null) {\r\n pen = new _Pen_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\r\n }\r\n PEN_CONFIG.text = text;\r\n PEN_CONFIG.x = x;\r\n PEN_CONFIG.y = y;\r\n PEN_CONFIG.width = width;\r\n PEN_CONFIG.prop = prop;\r\n PEN_CONFIG.newLineMode = newLineMode;\r\n pen.resetFromJSON(PEN_CONFIG);\r\n this.addPen(pen);\r\n return this;\r\n }\r\n\r\n addImagePen(x, y, width, prop) {\r\n this.addTextPen('', x, y, width, prop, NO_NEWLINE);\r\n return this;\r\n }\r\n\r\n addNewLinePen() {\r\n var previousPen = this.lastPen;\r\n var x = (previousPen) ? previousPen.lastX : 0;\r\n var y = (previousPen) ? previousPen.y : 0;\r\n var prop = (previousPen) ? Object(_utils_object_Clone_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(previousPen.prop) : null;\r\n this.addTextPen('', x, y, 0, prop, WRAPPED_NEWLINE);\r\n return this;\r\n }\r\n\r\n addPen(pen) {\r\n var previousPen = this.lastPen;\r\n if (previousPen == null) {\r\n pen.startIndex = 0;\r\n } else {\r\n pen.startIndex = previousPen.endIndex;\r\n }\r\n this.pens.push(pen);\r\n\r\n // maintan lines\r\n var line = this.lastLine;\r\n if (line == null) {\r\n line = this.LinesPool.pop() || [];\r\n this.lines.push(line);\r\n }\r\n line.push(pen);\r\n\r\n // new line, add an empty line\r\n if (pen.newLineMode !== NO_NEWLINE) {\r\n line = this.LinesPool.pop() || [];\r\n this.lines.push(line);\r\n }\r\n this.maxLinesWidth = undefined;\r\n }\r\n\r\n clone(targetPenManager) {\r\n if (targetPenManager == null)\r\n targetPenManager = new PenManager();\r\n\r\n targetPenManager.freePens();\r\n\r\n for (var li = 0, llen = this.lines.length; li < llen; li++) {\r\n var pens = this.lines[li];\r\n for (var pi = 0, plen = pens.length; pi < plen; pi++) {\r\n var pen = pens[pi];\r\n targetPenManager.addPen(\r\n pen.text,\r\n pen.x,\r\n pen.y,\r\n pen.width,\r\n Object(_utils_object_Clone_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(pen.prop),\r\n pen.newLineMode\r\n );\r\n }\r\n }\r\n\r\n return targetPenManager;\r\n }\r\n\r\n get lastPen() {\r\n return this.pens[this.pens.length - 1];\r\n }\r\n\r\n get lastLine() {\r\n return this.lines[this.lines.length - 1];\r\n }\r\n\r\n getLineStartIndex(i) {\r\n if (i >= this.lines.length) {\r\n return this.getLineEndIndex(i);\r\n } else {\r\n var line = this.lines[i];\r\n return (line && line[0]) ? line[0].startIndex : 0;\r\n }\r\n }\r\n\r\n getLineEndIndex(i) {\r\n if (i >= this.lines.length) {\r\n i = this.lines.length - 1;\r\n }\r\n var li, hasLastPen = false,\r\n line;\r\n for (li = i; li >= 0; li--) {\r\n line = this.lines[li];\r\n hasLastPen = (line != null) && (line.length > 0);\r\n if (hasLastPen) {\r\n break;\r\n }\r\n }\r\n if (!hasLastPen) {\r\n return 0;\r\n }\r\n\r\n var lastPen = line[line.length - 1];\r\n return lastPen.endIndex;\r\n }\r\n\r\n getLineWidth(i) {\r\n var line = this.lines[i];\r\n if (!line) {\r\n return 0;\r\n }\r\n\r\n var lastPen = line[line.length - 1];\r\n if (lastPen == null) {\r\n return 0;\r\n }\r\n\r\n var lineWidth = lastPen.lastX; // start from 0\r\n return lineWidth;\r\n }\r\n\r\n getMaxLineWidth() {\r\n if (this.maxLinesWidth !== undefined) {\r\n return this.maxLinesWidth;\r\n }\r\n var w, maxW = 0;\r\n for (var i = 0, len = this.lines.length; i < len; i++) {\r\n w = this.getLineWidth(i);\r\n if (w > maxW) {\r\n maxW = w;\r\n }\r\n }\r\n this.maxLinesWidth = maxW;\r\n return maxW;\r\n }\r\n\r\n getLineWidths() {\r\n var result = [];\r\n for (var i = 0, len = this.lines.length; i < len; i++) {\r\n result.push(this.getLineWidth(i));\r\n }\r\n return result;\r\n }\r\n\r\n get linesCount() {\r\n return this.lines.length;\r\n }\r\n\r\n get plainText() {\r\n var txt = \"\",\r\n pens = this.pens;\r\n for (var i = 0, len = pens.length; i < len; i++) {\r\n txt += pens[i].plainText;\r\n }\r\n\r\n return txt;\r\n }\r\n\r\n get rawTextLength() {\r\n var l = 0,\r\n pens = this.pens;\r\n for (var i = 0, len = this.pens.length; i < len; i++) {\r\n l += pens[i].rawTextLength;\r\n }\r\n\r\n return l;\r\n }\r\n\r\n getSliceTagText(start, end, wrap) {\r\n if (start === undefined) {\r\n start = 0;\r\n }\r\n if (end === undefined) {\r\n var lastPen = this.lastPen;\r\n if (lastPen == null) {\r\n return \"\";\r\n }\r\n\r\n end = lastPen.endIndex;\r\n }\r\n if (wrap === undefined) {\r\n wrap = false;\r\n }\r\n\r\n var txt = \"\",\r\n formatTxt,\r\n pen, penTxt, penStartIdx, penEndIdx, isInRange;\r\n var currentProp, previousProp;\r\n for (var i = 0, len = this.pens.length; i < len; i++) {\r\n pen = this.pens[i];\r\n penEndIdx = pen.endIndex;\r\n if (penEndIdx <= start) {\r\n continue;\r\n }\r\n pen = this.pens[i];\r\n penTxt = (!wrap) ? pen.plainText : pen.wrapText;\r\n currentProp = pen.prop;\r\n penStartIdx = pen.startIndex;\r\n\r\n isInRange = (penStartIdx >= start) && (penEndIdx <= end);\r\n if (!isInRange) {\r\n penTxt = penTxt.substring(start - penStartIdx, end - penStartIdx);\r\n }\r\n\r\n if (this.tagToTextScope) {\r\n txt += this.tagToText.call(this.tagToTextScope, penTxt, currentProp, previousProp);\r\n } else {\r\n txt += this.tagToText(penTxt, currentProp, previousProp);\r\n }\r\n\r\n previousProp = currentProp;\r\n if (penEndIdx >= end) {\r\n break;\r\n }\r\n }\r\n\r\n return txt;\r\n }\r\n};\r\n\r\nvar PEN_CONFIG = {};\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (PenManager);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/penmanger/PenManager.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/render/CanvasRenderer.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/render/CanvasRenderer.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the Canvas Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Text#renderCanvas\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\r\n * @param {Phaser.GameObjects.Text} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar TextCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) {\r\n if ((src.width === 0) || (src.height === 0)) {\r\n return;\r\n }\r\n\r\n renderer.batchSprite(src, src.frame, camera, parentMatrix);\r\n};\r\n\r\nmodule.exports = TextCanvasRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/render/CanvasRenderer.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/render/Render.js": /*!*********************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/render/Render.js ***! \*********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _WebGLRenderer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./WebGLRenderer.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/render/WebGLRenderer.js\");\n/* harmony import */ var _WebGLRenderer_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_WebGLRenderer_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _CanvasRenderer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CanvasRenderer.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/render/CanvasRenderer.js\");\n/* harmony import */ var _CanvasRenderer_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_CanvasRenderer_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _utils_object_NOOP__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../utils/object/NOOP */ \"./node_modules/phaser3-rex-plugins/plugins/utils/object/NOOP.js\");\n\r\n\r\n\r\n\r\nvar renderWebGL = _utils_object_NOOP__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\r\nvar renderCanvas = _utils_object_NOOP__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\r\n\r\nif (true) {\r\n renderWebGL = _WebGLRenderer_js__WEBPACK_IMPORTED_MODULE_0___default.a;\r\n}\r\n\r\nif (true) {\r\n renderCanvas = _CanvasRenderer_js__WEBPACK_IMPORTED_MODULE_1___default.a;\r\n}\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n});\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/render/Render.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/render/WebGLRenderer.js": /*!****************************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/render/WebGLRenderer.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\r\n * @author Richard Davey \r\n * @copyright 2019 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Utils = Phaser.Renderer.WebGL.Utils;\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Text#renderWebGL\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Text} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar TextWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) {\r\n if ((src.width === 0) || (src.height === 0)) {\r\n return;\r\n }\r\n\r\n var frame = src.frame;\r\n var width = frame.width;\r\n var height = frame.height;\r\n var getTint = Utils.getTintAppendFloatAlpha;\r\n\r\n this.pipeline.batchTexture(\r\n src,\r\n frame.glTexture,\r\n width, height,\r\n src.x, src.y,\r\n width / src.style.resolution, height / src.style.resolution,\r\n src.scaleX, src.scaleY,\r\n src.rotation,\r\n src.flipX, src.flipY,\r\n src.scrollFactorX, src.scrollFactorY,\r\n src.displayOriginX, src.displayOriginY,\r\n 0, 0, width, height,\r\n getTint(src._tintTL, camera.alpha * src._alphaTL),\r\n getTint(src._tintTR, camera.alpha * src._alphaTR),\r\n getTint(src._tintBL, camera.alpha * src._alphaBL),\r\n getTint(src._tintBR, camera.alpha * src._alphaBR),\r\n (src._isTinted && src.tintFill),\r\n 0, 0,\r\n camera,\r\n parentMatrix\r\n );\r\n};\r\n\r\nmodule.exports = TextWebGLRenderer;\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/render/WebGLRenderer.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/textstyle/MeasureText.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/textstyle/MeasureText.js ***! \*****************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nconst CanvasPool = Phaser.Display.Canvas.CanvasPool;\r\n\r\n/**\r\n * Calculates the ascent, descent and fontSize of a given font style.\r\n *\r\n * @function Phaser.GameObjects.Text.MeasureText\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Text.TextStyle} textStyle - The TextStyle object to measure.\r\n *\r\n * @return {object} An object containing the ascent, descent and fontSize of the TextStyle.\r\n */\r\nvar MeasureText = function (textStyle) {\r\n // @property {HTMLCanvasElement} canvas - The canvas element that the text is rendered.\r\n var canvas = CanvasPool.create(this);\r\n\r\n // @property {HTMLCanvasElement} context - The context of the canvas element that the text is rendered to.\r\n var context = canvas.getContext('2d');\r\n\r\n textStyle.syncFont(canvas, context);\r\n\r\n var width = Math.ceil(context.measureText(textStyle.testString).width * textStyle.baselineX);\r\n var baseline = width;\r\n var height = 2 * baseline;\r\n\r\n baseline = baseline * textStyle.baselineY | 0;\r\n\r\n canvas.width = width;\r\n canvas.height = height;\r\n\r\n context.fillStyle = '#f00';\r\n context.fillRect(0, 0, width, height);\r\n\r\n context.font = textStyle._font;\r\n\r\n context.textBaseline = 'alphabetic';\r\n context.fillStyle = '#000';\r\n context.fillText(textStyle.testString, 0, baseline);\r\n\r\n var output = {\r\n ascent: 0,\r\n descent: 0,\r\n fontSize: 0\r\n };\r\n\r\n if (!context.getImageData(0, 0, width, height)) {\r\n output.ascent = baseline;\r\n output.descent = baseline + 6;\r\n output.fontSize = output.ascent + output.descent;\r\n\r\n CanvasPool.remove(canvas);\r\n\r\n return output;\r\n }\r\n\r\n var imagedata = context.getImageData(0, 0, width, height).data;\r\n var pixels = imagedata.length;\r\n var line = width * 4;\r\n var i;\r\n var j;\r\n var idx = 0;\r\n var stop = false;\r\n\r\n // ascent. scan from top to bottom until we find a non red pixel\r\n for (i = 0; i < baseline; i++) {\r\n for (j = 0; j < line; j += 4) {\r\n if (imagedata[idx + j] !== 255) {\r\n stop = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!stop) {\r\n idx += line;\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n output.ascent = baseline - i;\r\n\r\n idx = pixels - line;\r\n stop = false;\r\n\r\n // descent. scan from bottom to top until we find a non red pixel\r\n for (i = height; i > baseline; i--) {\r\n for (j = 0; j < line; j += 4) {\r\n if (imagedata[idx + j] !== 255) {\r\n stop = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!stop) {\r\n idx -= line;\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n output.descent = (i - baseline);\r\n output.fontSize = output.ascent + output.descent;\r\n\r\n CanvasPool.remove(canvas);\r\n\r\n return output;\r\n};\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (MeasureText);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/textstyle/MeasureText.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/textstyle/TextStyle.js": /*!***************************************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/textstyle/TextStyle.js ***! \***************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _MeasureText_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./MeasureText.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/textstyle/MeasureText.js\");\n/* harmony import */ var _const_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../const.js */ \"./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/const.js\");\n/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\n\r\n\r\n\r\nconst GetAdvancedValue = Phaser.Utils.Objects.GetAdvancedValue;\r\nconst GetValue = Phaser.Utils.Objects.GetValue;\r\n\r\n// Key: [ Object Key, Default Value ]\r\n\r\n/**\r\n * A custom function that will be responsible for wrapping the text.\r\n * @callback TextStyleWordWrapCallback\r\n *\r\n * @param {string} text - The string to wrap.\r\n * @param {Phaser.GameObjects.Text} textObject - The Text instance.\r\n *\r\n * @return {(string|string[])} Should return the wrapped lines either as an array of lines or as a string with\r\n * newline characters in place to indicate where breaks should happen.\r\n */\r\n\r\nvar propertyMap = {\r\n // background\r\n backgroundColor: ['backgroundColor', null],\r\n\r\n // font\r\n fontFamily: ['fontFamily', 'Courier'],\r\n fontSize: ['fontSize', '16px'],\r\n fontStyle: ['fontStyle', ''],\r\n color: ['color', '#fff'],\r\n stroke: ['stroke', '#fff'],\r\n strokeThickness: ['strokeThickness', 0],\r\n shadowOffsetX: ['shadow.offsetX', 0],\r\n shadowOffsetY: ['shadow.offsetY', 0],\r\n shadowColor: ['shadow.color', '#000'],\r\n shadowBlur: ['shadow.blur', 0],\r\n shadowStroke: ['shadow.stroke', false],\r\n shadowFill: ['shadow.fill', false],\r\n\r\n // underline\r\n underlineColor: ['underline.color', '#000'],\r\n underlineThickness: ['underline.thickness', 0],\r\n underlineOffset: ['underline.offset', 0],\r\n\r\n // align\r\n halign: ['halign', 'left'],\r\n valign: ['valign', 'top'],\r\n\r\n // size\r\n maxLines: ['maxLines', 0],\r\n fixedWidth: ['fixedWidth', 0],\r\n fixedHeight: ['fixedHeight', 0],\r\n resolution: ['resolution', 0],\r\n lineSpacing: ['lineSpacing', 0],\r\n\r\n rtl: ['rtl', false],\r\n testString: ['testString', '|MÉqgy'],\r\n baselineX: ['baselineX', 1.2],\r\n baselineY: ['baselineY', 1.4],\r\n\r\n // wrap\r\n wrapMode: ['wrap.mode', 1],\r\n wrapWidth: ['wrap.width', 0]\r\n //wrapCallback: ['wrap.callback', null],\r\n //wrapCallbackScope: ['wrap.callbackScope', null]\r\n};\r\n\r\nclass TextStyle {\r\n constructor(text, style) {\r\n this.parent = text;\r\n\r\n this.backgroundColor;\r\n\r\n this.fontFamily;\r\n this.fontSize;\r\n this.fontStyle;\r\n this.color;\r\n this.stroke;\r\n this.strokeThickness;\r\n this.shadowOffsetX;\r\n this.shadowOffsetY;\r\n this.shadowColor;\r\n this.shadowBlur;\r\n this.shadowStroke;\r\n this.shadowFill;\r\n\r\n this.underlineColor;\r\n this.underlineThickness;\r\n this.underlineOffset;\r\n\r\n this.halign;\r\n this.valign;\r\n\r\n this.maxLines;\r\n this.fixedWidth;\r\n this.fixedHeight;\r\n this.resolution;\r\n this.lineSpacing;\r\n\r\n this.rtl;\r\n this.testString;\r\n\r\n\r\n this.baselineX;\r\n this.baselineY;\r\n\r\n this._font;\r\n\r\n // Set to defaults + user style\r\n this.setStyle(style, false);\r\n\r\n var metrics = GetValue(style, 'metrics', false);\r\n\r\n // Provide optional TextMetrics in the style object to avoid the canvas look-up / scanning\r\n // Doing this is reset if you then change the font of this TextStyle after creation\r\n if (metrics) {\r\n this.metrics = {\r\n ascent: GetValue(metrics, 'ascent', 0),\r\n descent: GetValue(metrics, 'descent', 0),\r\n fontSize: GetValue(metrics, 'fontSize', 0)\r\n };\r\n } else {\r\n this.metrics = Object(_MeasureText_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this);\r\n }\r\n }\r\n\r\n setStyle(style, updateText) {\r\n if (updateText === undefined) {\r\n updateText = true;\r\n }\r\n\r\n if (style && style.hasOwnProperty('wrap')) {\r\n var wrap = style.wrap;\r\n if (wrap.hasOwnProperty('mode')) {\r\n var mode = wrap.mode;\r\n if (typeof mode === 'string') {\r\n wrap.mode = WRAPMODE[mode];\r\n }\r\n } else {\r\n if (wrap.hasOwnProperty('width')) {\r\n wrap.mode = 1;\r\n }\r\n }\r\n }\r\n\r\n // Avoid type mutation\r\n if (style && style.hasOwnProperty('fontSize') && typeof style.fontSize === 'number') {\r\n style.fontSize = style.fontSize.toString() + 'px';\r\n }\r\n\r\n for (var key in propertyMap) {\r\n if (key === 'wrapCallback' || key === 'wrapCallbackScope') {\r\n // Callback & scope should be set without processing the values\r\n this[key] = GetValue(style, propertyMap[key][0], propertyMap[key][1]);\r\n } else {\r\n this[key] = GetAdvancedValue(style, propertyMap[key][0], propertyMap[key][1]);\r\n }\r\n }\r\n\r\n // Allow for 'font' override\r\n var font = GetValue(style, 'font', null);\r\n\r\n if (font === null) {\r\n this._font = this.fontStyle + ' ' + this.fontSize + ' ' + this.fontFamily;\r\n } else {\r\n this._font = font;\r\n }\r\n\r\n // Allow for 'fill' to be used in place of 'color'\r\n var fill = GetValue(style, 'fill', null);\r\n\r\n if (fill !== null) {\r\n this.color = fill;\r\n }\r\n\r\n if (updateText) {\r\n return this.update(true);\r\n } else {\r\n return this.parent;\r\n }\r\n }\r\n\r\n syncFont(canvas, context) {\r\n context.font = this._font;\r\n }\r\n\r\n syncStyle(canvas, context) {\r\n context.textBaseline = 'alphabetic';\r\n\r\n context.fillStyle = this.color;\r\n context.strokeStyle = this.stroke;\r\n\r\n context.lineWidth = this.strokeThickness;\r\n context.lineCap = 'round';\r\n context.lineJoin = 'round';\r\n }\r\n\r\n syncShadow(context, enabled) {\r\n if (enabled) {\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n } else {\r\n context.shadowOffsetX = 0;\r\n context.shadowOffsetY = 0;\r\n context.shadowColor = 0;\r\n context.shadowBlur = 0;\r\n }\r\n }\r\n\r\n update(recalculateMetrics) {\r\n if (recalculateMetrics) {\r\n this._font = this.fontStyle + ' ' + this.fontSize + ' ' + this.fontFamily;\r\n\r\n this.metrics = Object(_MeasureText_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this);\r\n }\r\n\r\n return this.parent.updateText(recalculateMetrics);\r\n }\r\n\r\n buildFont() {\r\n var newFont = this.fontStyle + ' ' + this.fontSize + ' ' + this.fontFamily;\r\n if (newFont !== this._font) {\r\n this._font = newFont;\r\n //this.metrics = MeasureText(this);\r\n }\r\n return this;\r\n }\r\n\r\n setFont(font) {\r\n if (typeof font === 'string') {\r\n this.fontFamily = font;\r\n this.fontSize = '';\r\n this.fontStyle = '';\r\n } else {\r\n this.fontFamily = GetValue(font, 'fontFamily', 'Courier');\r\n this.fontSize = GetValue(font, 'fontSize', '16px');\r\n this.fontStyle = GetValue(font, 'fontStyle', '');\r\n }\r\n\r\n return this.update(true);\r\n }\r\n\r\n setFontFamily(family) {\r\n this.fontFamily = family;\r\n\r\n return this.update(true);\r\n }\r\n\r\n setFontStyle(style) {\r\n this.fontStyle = style;\r\n\r\n return this.update(true);\r\n }\r\n\r\n setFontSize(size) {\r\n if (typeof size === 'number') {\r\n size = size.toString() + 'px';\r\n }\r\n\r\n this.fontSize = size;\r\n\r\n return this.update(true);\r\n }\r\n\r\n setTestString(string) {\r\n this.testString = string;\r\n\r\n return this.update(true);\r\n }\r\n\r\n setFixedSize(width, height) {\r\n this.fixedWidth = width;\r\n this.fixedHeight = height;\r\n\r\n if (width) {\r\n this.parent.width = width;\r\n }\r\n\r\n if (height) {\r\n this.parent.height = height;\r\n }\r\n\r\n return this.update(false);\r\n }\r\n\r\n setResolution(value) {\r\n this.resolution = value;\r\n\r\n return this.update(false);\r\n }\r\n\r\n setLineSpacing(value) {\r\n this.lineSpacing = value;\r\n\r\n return this.update(false);\r\n }\r\n\r\n setBackgroundColor(color) {\r\n this.backgroundColor = color;\r\n\r\n return this.update(false);\r\n }\r\n\r\n setFill(color) {\r\n this.color = color;\r\n\r\n return this.update(false);\r\n }\r\n\r\n setColor(color) {\r\n this.color = color;\r\n\r\n return this.update(false);\r\n }\r\n\r\n setStroke(color, thickness) {\r\n if (color === undefined) {\r\n // Reset the stroke to zero (disabling it)\r\n this.strokeThickness = 0;\r\n } else {\r\n if (thickness === undefined) {\r\n thickness = this.strokeThickness;\r\n }\r\n\r\n this.stroke = color;\r\n this.strokeThickness = thickness;\r\n }\r\n\r\n return this.update(true);\r\n }\r\n\r\n setShadow(x, y, color, blur, shadowStroke, shadowFill) {\r\n if (x === undefined) {\r\n x = 0;\r\n }\r\n if (y === undefined) {\r\n y = 0;\r\n }\r\n if (color === undefined) {\r\n color = '#000';\r\n }\r\n if (blur === undefined) {\r\n blur = 0;\r\n }\r\n if (shadowStroke === undefined) {\r\n shadowStroke = false;\r\n }\r\n if (shadowFill === undefined) {\r\n shadowFill = true;\r\n }\r\n\r\n this.shadowOffsetX = x;\r\n this.shadowOffsetY = y;\r\n this.shadowColor = color;\r\n this.shadowBlur = blur;\r\n this.shadowStroke = shadowStroke;\r\n this.shadowFill = shadowFill;\r\n\r\n return this.update(false);\r\n }\r\n\r\n setShadowOffset(x, y) {\r\n if (x === undefined) {\r\n x = 0;\r\n }\r\n if (y === undefined) {\r\n y = x;\r\n }\r\n\r\n this.shadowOffsetX = x;\r\n this.shadowOffsetY = y;\r\n\r\n return this.update(false);\r\n }\r\n\r\n setShadowColor(color) {\r\n if (color === undefined) {\r\n color = '#000';\r\n }\r\n\r\n this.shadowColor = color;\r\n\r\n return this.update(false);\r\n }\r\n\r\n setShadowBlur(blur) {\r\n if (blur === undefined) {\r\n blur = 0;\r\n }\r\n\r\n this.shadowBlur = blur;\r\n\r\n return this.update(false);\r\n }\r\n\r\n setShadowStroke(enabled) {\r\n this.shadowStroke = enabled;\r\n\r\n return this.update(false);\r\n }\r\n\r\n setShadowFill(enabled) {\r\n this.shadowFill = enabled;\r\n\r\n return this.update(false);\r\n }\r\n\r\n setUnderline(color, thickness, offset) {\r\n if (color === undefined) {\r\n color = '#000';\r\n }\r\n if (thickness === undefined) {\r\n thickness = 0;\r\n }\r\n if (offset === undefined) {\r\n offset = 0;\r\n }\r\n\r\n this.underlineColor = color;\r\n this.underlineThickness = thickness;\r\n this.underlineOffset = offset;\r\n\r\n return this.update(false);\r\n }\r\n\r\n setUnderlineColor(color) {\r\n if (color === undefined) {\r\n color = '#000';\r\n }\r\n\r\n this.underlineColor = color;\r\n return this.update(false);\r\n }\r\n\r\n setUnderlineThickness(thickness) {\r\n if (thickness === undefined) {\r\n thickness = 0;\r\n }\r\n\r\n this.underlineThickness = thickness;\r\n return this.update(false);\r\n }\r\n\r\n setUnderlineOffset(offset) {\r\n if (offset === undefined) {\r\n offset = 0;\r\n }\r\n\r\n this.underlineOffset = offset;\r\n return this.update(false);\r\n }\r\n\r\n setWrapMode(mode) {\r\n if (typeof mode === 'string') {\r\n mode = WRAPMODE[mode.toLowerCase()] || 0;\r\n }\r\n this.wrapMode = mode;\r\n return this.update(true);\r\n }\r\n\r\n setWrapWidth(width) {\r\n this.wrapWidth = width;\r\n return this.update(false);\r\n }\r\n\r\n setAlign(halign, valign) {\r\n if (halign === undefined) {\r\n halign = 'left';\r\n }\r\n if (valign === undefined) {\r\n valign = 'top';\r\n }\r\n this.halign = halign;\r\n this.valign = valign;\r\n\r\n return this.update(false);\r\n }\r\n\r\n setHAlign(halign) {\r\n if (halign === undefined) {\r\n halign = 'left';\r\n }\r\n this.halign = halign;\r\n\r\n return this.update(false);\r\n }\r\n\r\n setVAlign(valign) {\r\n if (valign === undefined) {\r\n valign = 'top';\r\n }\r\n this.valign = valign;\r\n\r\n return this.update(false);\r\n }\r\n\r\n setMaxLines(max) {\r\n if (max === undefined) {\r\n max = 0;\r\n }\r\n\r\n this.maxLines = max;\r\n\r\n return this.update(false);\r\n }\r\n\r\n getTextMetrics() {\r\n var metrics = this.metrics;\r\n\r\n return {\r\n ascent: metrics.ascent,\r\n descent: metrics.descent,\r\n fontSize: metrics.fontSize\r\n };\r\n }\r\n\r\n get lineHeight() {\r\n return this.metrics.fontSize + this.strokeThickness + this.lineSpacing;\r\n }\r\n\r\n toJSON() {\r\n var output = {};\r\n\r\n for (var key in propertyMap) {\r\n output[key] = this[key];\r\n }\r\n\r\n output.metrics = this.getTextMetrics();\r\n\r\n return output;\r\n }\r\n\r\n destroy() {\r\n this.parent = undefined;\r\n }\r\n\r\n}\r\n\r\nconst HALIGNMODE = {\r\n left: _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].hleft,\r\n center: _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].hcenter,\r\n right: _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].hright,\r\n};\r\nconst VALIGNMODE = {\r\n top: _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vtop,\r\n center: _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vcenter,\r\n bottom: _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vbottom,\r\n};\r\nconst WRAPMODE = {\r\n none: _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].NO_WRAP,\r\n word: _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].WORD_WRAP,\r\n char: _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].CHAR_WRAP,\r\n character: _const_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].CHAR_WRAP\r\n};\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (TextStyle);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/text/textbase/textstyle/TextStyle.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/pool.js": /*!**********************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/pool.js ***! \**********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils_struct_Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/struct/Stack.js */ \"./node_modules/phaser3-rex-plugins/plugins/utils/struct/Stack.js\");\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (_utils_struct_Stack_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/pool.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/utils/object/Clear.js": /*!************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/utils/object/Clear.js ***! \************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\nvar Clear = function (obj) {\r\n if (Array.isArray(obj)) {\r\n obj.length = 0;\r\n } else {\r\n for (var key in obj) {\r\n delete obj[key];\r\n }\r\n }\r\n}\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (Clear);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/utils/object/Clear.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/utils/object/Clone.js": /*!************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/utils/object/Clone.js ***! \************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Clear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Clear.js */ \"./node_modules/phaser3-rex-plugins/plugins/utils/object/Clear.js\");\n\r\n\r\n/**\r\n * Shallow Object Clone. Will not out nested objects.\r\n * @param {object} obj JSON object\r\n * @param {object} ret JSON object to return, set null to return a new object\r\n * @returns {object} this object\r\n */\r\nvar Clone = function (obj, out) {\r\n var objIsArray = Array.isArray(obj);\r\n\r\n if (out === undefined) {\r\n out = (objIsArray) ? [] : {};\r\n } else {\r\n Object(_Clear_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(out);\r\n }\r\n\r\n if (objIsArray) {\r\n out.length = obj.length;\r\n }\r\n for (var key in obj) {\r\n out[key] = obj[key];\r\n }\r\n\r\n return out;\r\n};\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (Clone);\r\n\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/utils/object/Clone.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/utils/object/NOOP.js": /*!***********************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/utils/object/NOOP.js ***! \***********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\nvar NOOP = function () {\r\n // NOOP\r\n};\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (NOOP);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/utils/object/NOOP.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/utils/object/SetValue.js": /*!***************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/utils/object/SetValue.js ***! \***************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\nvar IsInValidKey = function (keys) {\r\n return (keys == null) || (keys === '') || (keys.length === 0);\r\n};\r\n\r\nvar GetEntry = function (target, keys, defaultEntry) {\r\n var entry = target;\r\n if (IsInValidKey(keys)) {\r\n //entry = root;\r\n } else {\r\n if (typeof (keys) === 'string') {\r\n keys = keys.split('.');\r\n }\r\n\r\n var key;\r\n for (var i = 0, cnt = keys.length; i < cnt; i++) {\r\n key = keys[i];\r\n if ((entry[key] == null) || (typeof (entry[key]) !== 'object')) {\r\n var newEntry;\r\n if (i === cnt - 1) {\r\n if (defaultEntry === undefined) {\r\n newEntry = {};\r\n } else {\r\n newEntry = defaultEntry;\r\n }\r\n } else {\r\n newEntry = {};\r\n }\r\n\r\n entry[key] = newEntry;\r\n }\r\n\r\n entry = entry[key];\r\n }\r\n }\r\n\r\n return entry;\r\n};\r\n\r\nvar SetValue = function (target, keys, value) {\r\n // no object\r\n if (typeof (target) !== 'object') {\r\n return;\r\n }\r\n\r\n // invalid key\r\n else if (IsInValidKey(keys)) {\r\n // don't erase target\r\n if (value == null) {\r\n return;\r\n }\r\n // set target to another object\r\n else if (typeof (value) === 'object') {\r\n target = value;\r\n }\r\n } else {\r\n if (typeof (keys) === 'string') {\r\n keys = keys.split('.');\r\n }\r\n\r\n var lastKey = keys.pop();\r\n var entry = GetEntry(target, keys);\r\n entry[lastKey] = value;\r\n }\r\n\r\n return target;\r\n};\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (SetValue);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/utils/object/SetValue.js?"); /***/ }), /***/ "./node_modules/phaser3-rex-plugins/plugins/utils/struct/Stack.js": /*!************************************************************************!*\ !*** ./node_modules/phaser3-rex-plugins/plugins/utils/struct/Stack.js ***! \************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\nclass Stack {\r\n constructor() {\r\n this.items = [];\r\n }\r\n\r\n destroy() {\r\n this.items.length = 0;\r\n this.items = undefined;\r\n }\r\n\r\n pop() {\r\n return (this.items.length > 0) ? this.items.pop() : null;\r\n }\r\n\r\n push(l) {\r\n this.items.push(l);\r\n return this;\r\n }\r\n\r\n pushMultiple(arr) {\r\n this.items.push.apply(this.items, arr);\r\n arr.length = 0;\r\n return this;\r\n }\r\n}\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (Stack);\n\n//# sourceURL=webpack:///./node_modules/phaser3-rex-plugins/plugins/utils/struct/Stack.js?"); /***/ }), /***/ "./node_modules/process/browser.js": /*!*****************************************!*\ !*** ./node_modules/process/browser.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=webpack:///./node_modules/process/browser.js?"); /***/ }), /***/ "./node_modules/typestate/dist/typestate-node.js": /*!*******************************************************!*\ !*** ./node_modules/typestate/dist/typestate-node.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\r\n/*! typestate - v1.0.6 - 2018-05-17\r\n* https://github.com/eonarheim/TypeState\r\n* Copyright (c) 2018 Erik Onarheim; Licensed BSD-2-Clause*/\r\nvar typestate;\r\n(function (typestate) {\r\n /**\r\n * Transition grouping to faciliate fluent api\r\n */\r\n var Transitions = (function () {\r\n function Transitions(fsm) {\r\n this.fsm = fsm;\r\n }\r\n /**\r\n * Specify the end state(s) of a transition function\r\n */\r\n Transitions.prototype.to = function () {\r\n var states = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n states[_i - 0] = arguments[_i];\r\n }\r\n this.toStates = states;\r\n this.fsm.addTransitions(this);\r\n };\r\n /**\r\n * Specify that any state in the state enum is value\r\n * Takes the state enum as an argument\r\n */\r\n Transitions.prototype.toAny = function (states) {\r\n var toStates = [];\r\n for (var s in states) {\r\n if (states.hasOwnProperty(s)) {\r\n toStates.push(states[s]);\r\n }\r\n }\r\n this.toStates = toStates;\r\n this.fsm.addTransitions(this);\r\n };\r\n return Transitions;\r\n }());\r\n typestate.Transitions = Transitions;\r\n /**\r\n * Internal representation of a transition function\r\n */\r\n var TransitionFunction = (function () {\r\n function TransitionFunction(fsm, from, to) {\r\n this.fsm = fsm;\r\n this.from = from;\r\n this.to = to;\r\n }\r\n return TransitionFunction;\r\n }());\r\n typestate.TransitionFunction = TransitionFunction;\r\n /**\r\n * A simple finite state machine implemented in TypeScript, the templated argument is meant to be used\r\n * with an enumeration.\r\n */\r\n var FiniteStateMachine = (function () {\r\n function FiniteStateMachine(startState, allowImplicitSelfTransition) {\r\n if (allowImplicitSelfTransition === void 0) { allowImplicitSelfTransition = false; }\r\n this._transitionFunctions = [];\r\n this._onCallbacks = {};\r\n this._exitCallbacks = {};\r\n this._enterCallbacks = {};\r\n this._invalidTransitionCallback = null;\r\n this.currentState = startState;\r\n this._startState = startState;\r\n this._allowImplicitSelfTransition = allowImplicitSelfTransition;\r\n }\r\n FiniteStateMachine.prototype.addTransitions = function (fcn) {\r\n var _this = this;\r\n fcn.fromStates.forEach(function (from) {\r\n fcn.toStates.forEach(function (to) {\r\n // Only add the transition if the state machine is not currently able to transition.\r\n if (!_this._canGo(from, to)) {\r\n _this._transitionFunctions.push(new TransitionFunction(_this, from, to));\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Listen for the transition to this state and fire the associated callback\r\n */\r\n FiniteStateMachine.prototype.on = function (state, callback) {\r\n var key = state.toString();\r\n if (!this._onCallbacks[key]) {\r\n this._onCallbacks[key] = [];\r\n }\r\n this._onCallbacks[key].push(callback);\r\n return this;\r\n };\r\n /**\r\n * Listen for the transition to this state and fire the associated callback, returning\r\n * false in the callback will block the transition to this state.\r\n */\r\n FiniteStateMachine.prototype.onEnter = function (state, callback) {\r\n var key = state.toString();\r\n if (!this._enterCallbacks[key]) {\r\n this._enterCallbacks[key] = [];\r\n }\r\n this._enterCallbacks[key].push(callback);\r\n return this;\r\n };\r\n /**\r\n * Listen for the transition to this state and fire the associated callback, returning\r\n * false in the callback will block the transition from this state.\r\n */\r\n FiniteStateMachine.prototype.onExit = function (state, callback) {\r\n var key = state.toString();\r\n if (!this._exitCallbacks[key]) {\r\n this._exitCallbacks[key] = [];\r\n }\r\n this._exitCallbacks[key].push(callback);\r\n return this;\r\n };\r\n /**\r\n * List for an invalid transition and handle the error, returning a falsy value will throw an\r\n * exception, a truthy one will swallow the exception\r\n */\r\n FiniteStateMachine.prototype.onInvalidTransition = function (callback) {\r\n if (!this._invalidTransitionCallback) {\r\n this._invalidTransitionCallback = callback;\r\n }\r\n return this;\r\n };\r\n /**\r\n * Declares the start state(s) of a transition function, must be followed with a '.to(...endStates)'\r\n */\r\n FiniteStateMachine.prototype.from = function () {\r\n var states = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n states[_i - 0] = arguments[_i];\r\n }\r\n var _transition = new Transitions(this);\r\n _transition.fromStates = states;\r\n return _transition;\r\n };\r\n FiniteStateMachine.prototype.fromAny = function (states) {\r\n var fromStates = [];\r\n for (var s in states) {\r\n if (states.hasOwnProperty(s)) {\r\n fromStates.push(states[s]);\r\n }\r\n }\r\n var _transition = new Transitions(this);\r\n _transition.fromStates = fromStates;\r\n return _transition;\r\n };\r\n FiniteStateMachine.prototype._validTransition = function (from, to) {\r\n return this._transitionFunctions.some(function (tf) {\r\n return (tf.from === from && tf.to === to);\r\n });\r\n };\r\n /**\r\n * Check whether a transition between any two states is valid.\r\n * If allowImplicitSelfTransition is true, always allow transitions from a state back to itself.\r\n * Otherwise, check if it's a valid transition.\r\n */\r\n FiniteStateMachine.prototype._canGo = function (fromState, toState) {\r\n return (this._allowImplicitSelfTransition && fromState === toState) || this._validTransition(fromState, toState);\r\n };\r\n /**\r\n * Check whether a transition to a new state is valid\r\n */\r\n FiniteStateMachine.prototype.canGo = function (state) {\r\n return this._canGo(this.currentState, state);\r\n };\r\n /**\r\n * Transition to another valid state\r\n */\r\n FiniteStateMachine.prototype.go = function (state, event) {\r\n if (!this.canGo(state)) {\r\n if (!this._invalidTransitionCallback || !this._invalidTransitionCallback(this.currentState, state)) {\r\n throw new Error('Error no transition function exists from state ' + this.currentState.toString() + ' to ' + state.toString());\r\n }\r\n }\r\n else {\r\n this._transitionTo(state, event);\r\n }\r\n };\r\n /**\r\n * This method is availble for overridding for the sake of extensibility.\r\n * It is called in the event of a successful transition.\r\n */\r\n FiniteStateMachine.prototype.onTransition = function (from, to) {\r\n // pass, does nothing until overidden\r\n };\r\n /**\r\n * Reset the finite state machine back to the start state, DO NOT USE THIS AS A SHORTCUT for a transition.\r\n * This is for starting the fsm from the beginning.\r\n */\r\n FiniteStateMachine.prototype.reset = function () {\r\n this.currentState = this._startState;\r\n };\r\n /**\r\n * Whether or not the current state equals the given state\r\n */\r\n FiniteStateMachine.prototype.is = function (state) {\r\n return this.currentState === state;\r\n };\r\n FiniteStateMachine.prototype._transitionTo = function (state, event) {\r\n var _this = this;\r\n if (!this._exitCallbacks[this.currentState.toString()]) {\r\n this._exitCallbacks[this.currentState.toString()] = [];\r\n }\r\n if (!this._enterCallbacks[state.toString()]) {\r\n this._enterCallbacks[state.toString()] = [];\r\n }\r\n if (!this._onCallbacks[state.toString()]) {\r\n this._onCallbacks[state.toString()] = [];\r\n }\r\n var canExit = this._exitCallbacks[this.currentState.toString()].reduce(function (accum, next) {\r\n return accum && next.call(_this, state);\r\n }, true);\r\n var canEnter = this._enterCallbacks[state.toString()].reduce(function (accum, next) {\r\n return accum && next.call(_this, _this.currentState, event);\r\n }, true);\r\n if (canExit && canEnter) {\r\n var old = this.currentState;\r\n this.currentState = state;\r\n this._onCallbacks[this.currentState.toString()].forEach(function (fcn) {\r\n fcn.call(_this, old, event);\r\n });\r\n this.onTransition(old, state);\r\n }\r\n };\r\n return FiniteStateMachine;\r\n }());\r\n typestate.FiniteStateMachine = FiniteStateMachine;\r\n})(typestate || (typestate = {}));\r\nexports.typestate = typestate;\r\nexports.TypeState = typestate;\r\n// maintain backwards compatibility for people using the pascal cased version\r\nvar TypeState = typestate;\r\n;\r\n// concat to the back of typestate.ts for node to work :/ typescript modules make me sad\r\n//# sourceMappingURL=typestate-node.js.map\n\n//# sourceURL=webpack:///./node_modules/typestate/dist/typestate-node.js?"); /***/ }), /***/ "./node_modules/webpack/buildin/global.js": /*!***********************************!*\ !*** (webpack)/buildin/global.js ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n\n\n//# sourceURL=webpack:///(webpack)/buildin/global.js?"); /***/ }), /***/ "./src/app.ts": /*!********************!*\ !*** ./src/app.ts ***! \********************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar gameScene_1 = __webpack_require__(/*! ./scenes/gameScene */ \"./src/scenes/gameScene.ts\");\nvar feedbackScene_1 = __webpack_require__(/*! ./scenes/feedbackScene */ \"./src/scenes/feedbackScene.ts\");\nvar gameOverScene_1 = __webpack_require__(/*! ./scenes/gameOverScene */ \"./src/scenes/gameOverScene.ts\");\nvar preloadScene_1 = __webpack_require__(/*! ./scenes/preloadScene */ \"./src/scenes/preloadScene.ts\");\nvar menuScene_1 = __webpack_require__(/*! ./scenes/menuScene */ \"./src/scenes/menuScene.ts\");\nvar winScene_1 = __webpack_require__(/*! ./scenes/winScene */ \"./src/scenes/winScene.ts\");\nvar waterDistortShader_1 = __webpack_require__(/*! ./waterDistortShader */ \"./src/waterDistortShader.ts\");\nvar brightnessShader_1 = __webpack_require__(/*! ./brightnessShader */ \"./src/brightnessShader.ts\");\nvar bbcodetext_plugin_js_1 = __webpack_require__(/*! phaser3-rex-plugins/plugins/bbcodetext-plugin.js */ \"./node_modules/phaser3-rex-plugins/plugins/bbcodetext-plugin.js\");\nvar DEBUG = true;\nvar config = {\n title: \"Antiphishing Phil Clone\",\n width: 800,\n height: 450,\n parent: \"game\",\n scene: [preloadScene_1.PreloadScene, menuScene_1.MenuScene /*, TutorialScene*/, feedbackScene_1.FeedbackScene, gameScene_1.GameScene, gameOverScene_1.GameOverScene, winScene_1.WinScene],\n physics: {\n default: \"arcade\",\n arcade: {\n debug: false\n }\n },\n scale: {\n mode: Phaser.Scale.FIT,\n autoCenter: Phaser.Scale.CENTER_BOTH\n },\n backgroundColor: 0xffffff,\n plugins: {\n global: [{\n key: 'rexBBCodeTextPlugin',\n plugin: bbcodetext_plugin_js_1.default,\n start: true\n },\n ]\n }\n};\nvar AntiphishingPhillClone = /** @class */ (function (_super) {\n __extends(AntiphishingPhillClone, _super);\n function AntiphishingPhillClone(config) {\n var _this = _super.call(this, config) || this;\n // add shaders\n new waterDistortShader_1.WaterDistortShader(_this);\n new brightnessShader_1.BrightnessShader(_this);\n return _this;\n }\n return AntiphishingPhillClone;\n}(Phaser.Game));\nexports.AntiphishingPhillClone = AntiphishingPhillClone;\n;\nwindow.onload = function () {\n var game = new AntiphishingPhillClone(config);\n //game.scene.start(\"FeedbackScene\")\n // TODO: switch debug/production\n if (!DEBUG) {\n console.log = function () { };\n }\n};\n\n\n//# sourceURL=webpack:///./src/app.ts?"); /***/ }), /***/ "./src/brightnessShader.ts": /*!*********************************!*\ !*** ./src/brightnessShader.ts ***! \*********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar BrightnessShader = /** @class */ (function () {\n function BrightnessShader(game) {\n this.game = game;\n this.pipeline = null;\n if (this.isWebGLAvalialble()) {\n this.pipeline = new Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline({\n game: game,\n renderer: game.renderer,\n fragShader: \"\\n precision mediump float;\\n uniform float time;\\n uniform vec2 resolution;\\n uniform sampler2D uMainSampler;\\n varying vec2 outTexCoord;\\n void main(void) {\\n vec2 uv = outTexCoord;\\n vec4 texColor = texture2D(uMainSampler, uv);\\n if(texColor.a > 0.1){\\n texColor.r = clamp(texColor.r*1.9, 0.0, 1.0);\\n texColor.g = clamp(texColor.g*1.9, 0.0, 1.0);\\n texColor.b = clamp(texColor.b*1.9, 0.0, 1.0);\\n }\\n gl_FragColor = texColor;\\n }\"\n });\n var webGLRenderer = game.renderer;\n webGLRenderer.addPipeline('brightness', this.pipeline);\n }\n else {\n this.update = function (e) { };\n }\n BrightnessShader.instance = this;\n }\n BrightnessShader.prototype.apply = function (object) {\n object.setPipeline(this.pipeline);\n };\n BrightnessShader.prototype.update = function (elapsed) {\n };\n BrightnessShader.prototype.isWebGLAvalialble = function () {\n return this.game.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer;\n };\n BrightnessShader.get_instance = function () {\n return BrightnessShader.instance;\n };\n return BrightnessShader;\n}());\nexports.BrightnessShader = BrightnessShader;\n\n\n//# sourceURL=webpack:///./src/brightnessShader.ts?"); /***/ }), /***/ "./src/bubble.ts": /*!***********************!*\ !*** ./src/bubble.ts ***! \***********************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Bubble = /** @class */ (function (_super) {\n __extends(Bubble, _super);\n function Bubble(scene) {\n var _this = _super.call(this, scene, 0, 0, 'bubble') || this;\n scene.physics.world.enable(_this);\n scene.add.existing(_this);\n _this.reinit();\n return _this;\n }\n Bubble.prototype.preUpdate = function (time, delta) {\n if (this.y <= this.target_y) {\n this.reinit();\n }\n else {\n this.x = this.base_x + this.mov_amp * Math.sin(time * this.mov_freq);\n this.y = this.y - this.speed * delta / 1000;\n }\n };\n Bubble.prototype.reinit = function () {\n this.base_x = Phaser.Math.Between(0, this.scene.game.renderer.width);\n this.scale = Phaser.Math.FloatBetween(0.05, 0.2);\n this.target_y = -this.texture.getSourceImage().height * this.scale;\n this.mov_amp = Phaser.Math.Between(5, 10);\n this.mov_freq = Phaser.Math.FloatBetween(0.001, 0.005);\n this.y = this.scene.game.renderer.height + Phaser.Math.Between(1, 4) * this.texture.getSourceImage().height * this.scale;\n this.speed = Phaser.Math.Between(50, 150);\n };\n return Bubble;\n}(Phaser.GameObjects.Sprite));\nexports.Bubble = Bubble;\n\n\n//# sourceURL=webpack:///./src/bubble.ts?"); /***/ }), /***/ "./src/button.ts": /*!***********************!*\ !*** ./src/button.ts ***! \***********************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar Button = /** @class */ (function (_super) {\n __extends(Button, _super);\n //make the back of the message box\n function Button(scene, x, y, callback) {\n var _this = _super.call(this, scene, x, y, Button.TEXTURE_NORMAL) || this;\n _this.button_pressed = false;\n _this.texture_normal = Button.TEXTURE_NORMAL;\n _this.texture_hover = Button.TEXTURE_HOVER;\n _this.texture_pushed = Button.TEXTURE_PUSHED;\n _this.text_color_normal = Button.TEXT_COLOR_NORMAL;\n _this.text_color_hover = Button.TEXT_COLOR_HOVER;\n _this.text_color_pushed = Button.TEXT_COLOR_PUSHED;\n _this.tween = null;\n scene.add.existing(_this);\n _this.setInteractive();\n _this.callback = callback;\n _this.on('pointerover', _this.on_pointer_over, _this);\n _this.on('pointerout', _this.on_pointer_out, _this);\n _this.on('pointerdown', _this.on_pointer_down, _this);\n //this.on('pointerup', this.on_pointer_up, this)\n _this.depth = 1000;\n return _this;\n }\n Button.prototype.set_skin = function (_tex_normal, _tex_hover, _tex_pushed, _text_color_normal, _text_color_hover, _text_color_pushed, _text_size) {\n this.texture_normal = _tex_normal;\n this.texture_hover = _tex_hover;\n this.texture_pushed = _tex_pushed;\n this.text_color_normal = _text_color_normal;\n this.text_color_hover = _text_color_hover;\n this.text_color_pushed = _text_color_pushed;\n this.text_object.setFontSize(_text_size);\n this.on_pointer_out();\n };\n Button.prototype.on_pointer_over = function () {\n this.setTexture(this.texture_hover);\n this.text_object.setColor(this.text_color_hover);\n this.scene.game.canvas.style.cursor = \"pointer\";\n this.scene.sound.play(\"menu_click\", {\n volume: 0.1,\n });\n this.button_pressed = false;\n this.cancelTween();\n this.tween = this.scene.tweens.add({\n targets: [this, this.text_object],\n scaleX: 1.1,\n scaleY: 1.1,\n ease: 'Quad.easeOut',\n duration: 50,\n });\n };\n Button.prototype.on_pointer_out = function () {\n this.setTexture(this.texture_normal);\n this.text_object.setColor(this.text_color_normal);\n this.scene.game.canvas.style.cursor = \"default\";\n this.cancelTween();\n this.tween = this.scene.tweens.add({\n targets: [this, this.text_object],\n scaleX: 1,\n scaleY: 1,\n ease: 'Quad.easeOut',\n duration: 50,\n });\n };\n Button.prototype.on_pointer_down = function (pointer, x, y, event) {\n if (this.button_pressed)\n return;\n this.setTexture(this.texture_pushed);\n this.text_object.setColor(this.text_color_pushed);\n this.scene.game.canvas.style.cursor = \"pointer\";\n this.button_pressed = true;\n this.scene.sound.add(\"bubble_pop\").play();\n event.stopPropagation();\n this.cancelTween();\n var theCallback = this.callback;\n theCallback();\n var theButton = this;\n this.tween = this.scene.tweens.add({\n targets: [this, this.text_object],\n scaleX: 0.8,\n scaleY: 0.8,\n ease: 'Quad.easeOut',\n yoyo: true,\n duration: 50,\n onComplete: function () {\n theButton.button_pressed = false;\n theButton.setTexture(theButton.texture_hover);\n theButton.text_object.setColor(theButton.text_color_hover);\n theButton.scene.game.canvas.style.cursor = \"pointer\";\n }\n });\n };\n Button.prototype.add_text = function (text) {\n this.text_object = this.scene.add.text(0, 0, text);\n this.text_object.setColor(this.text_color_normal);\n this.text_object.setDepth(this.depth);\n this.text_object.setFontFamily('\"Baloo Chettan\"');\n this.text_object.setFontSize(18);\n this.text_object.setOrigin(0.5, 0.5);\n this.center_text_on_button();\n };\n Button.prototype.set_button_position = function (x, y) {\n this.setPosition(x, y);\n this.center_text_on_button();\n };\n Button.prototype.center_text_on_button = function () {\n this.text_object.x = this.x;\n this.text_object.y = this.y;\n };\n Button.prototype.set_callback = function (callback) {\n this.callback = callback;\n };\n Button.prototype.cancelTween = function () {\n if (this.tween) {\n this.tween.stop();\n this.tween = null;\n }\n };\n Button.TEXTURE_NORMAL = \"button_normal\";\n Button.TEXTURE_HOVER = \"button_hover\";\n Button.TEXTURE_PUSHED = \"button_hover\";\n Button.TEXT_COLOR_NORMAL = \"#3f7731\";\n Button.TEXT_COLOR_HOVER = \"#65925a\";\n Button.TEXT_COLOR_PUSHED = \"#65925a\";\n return Button;\n}(Phaser.GameObjects.Sprite));\nexports.Button = Button;\n\n\n//# sourceURL=webpack:///./src/button.ts?"); /***/ }), /***/ "./src/config.ts": /*!***********************!*\ !*** ./src/config.ts ***! \***********************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Config = /** @class */ (function () {\n function Config() {\n }\n Config.FONT_NORMAL = \"'Martel Sans'\";\n Config.FONT_DISPLAY = '\"Baloo Chettan\"';\n return Config;\n}());\nexports.Config = Config;\n\n\n//# sourceURL=webpack:///./src/config.ts?"); /***/ }), /***/ "./src/dialogBalloon.ts": /*!******************************!*\ !*** ./src/dialogBalloon.ts ***! \******************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar config_1 = __webpack_require__(/*! ./config */ \"./src/config.ts\");\nvar animatedString_1 = __webpack_require__(/*! ./utils/animatedString */ \"./src/utils/animatedString.ts\");\nvar typestate_1 = __webpack_require__(/*! typestate */ \"./node_modules/typestate/dist/typestate-node.js\");\nvar bbcodetext_js_1 = __webpack_require__(/*! phaser3-rex-plugins/plugins/bbcodetext.js */ \"./node_modules/phaser3-rex-plugins/plugins/bbcodetext.js\");\nvar soundWrapper_1 = __webpack_require__(/*! ./utils/soundWrapper */ \"./src/utils/soundWrapper.ts\");\nvar States;\n(function (States) {\n States[States[\"Hidden\"] = 0] = \"Hidden\";\n States[States[\"AnimatingIn\"] = 1] = \"AnimatingIn\";\n States[States[\"AnimatingText\"] = 2] = \"AnimatingText\";\n States[States[\"Idle\"] = 3] = \"Idle\";\n States[States[\"AnimatingOut\"] = 4] = \"AnimatingOut\"; // animating out\n})(States || (States = {}));\nvar DialogBalloon = /** @class */ (function (_super) {\n __extends(DialogBalloon, _super);\n function DialogBalloon(x, y, scene, parent) {\n var _this = _super.call(this, scene) || this;\n _this.TEXT_PADDING = 30;\n _this.IDLE_DELAY = 3000; // how many time the message is shown before animating the balloon out\n _this.parent = parent;\n _this.tween = null;\n _this.timeout = null;\n _this.fsm = new typestate_1.TypeState.FiniteStateMachine(States.Hidden);\n //this.fsm = new FSM(['hidden', 'animating_in', 'animating_text', 'idle', 'animating_out'])\n // create back sprite\n _this.back = scene.add.sprite(0, 0, \"dialog_balloon\");\n _this.back.setOrigin(0.5, 0.5);\n _this.base_y = y - _this.back.height / 2.0;\n _this.back.y = _this.base_y;\n _this.back.x = _this.back.width / 2.0 + 20;\n _this.back.setScale(0, 0);\n // create text\n _this.text = new bbcodetext_js_1.default(scene, 0, 0, \"\");\n scene.add.existing(_this.text);\n _this.text.setAlign(\"center\");\n _this.text.setFontFamily(config_1.Config.FONT_NORMAL);\n _this.text.setFontSize(18);\n _this.text.width = _this.back.width;\n _this.text.setColor(\"#333344\");\n _this.text.setOrigin(0.5, 0.5);\n _this.text.setWrapWidth(scene.game.renderer.width - 300);\n _this.text.y = _this.base_y;\n _this.text.visible = false;\n _this.text.x = _this.back.x - 20; // compensate callout tip width\n _this.anim_str = new animatedString_1.AnimatedString('');\n _this.anim_str.onPlaySound = function () {\n soundWrapper_1.SoundWrapper.playTalkSound(scene);\n };\n // add valid states\n _this.fsm.from(States.Hidden).to(States.AnimatingIn);\n _this.fsm.from(States.AnimatingIn).to(States.AnimatingText);\n _this.fsm.from(States.AnimatingText).to(States.Idle);\n _this.fsm.from(States.Idle).to(States.AnimatingOut);\n _this.fsm.from(States.AnimatingOut).to(States.Hidden);\n _this.fsm.from(States.AnimatingText).to(States.AnimatingText);\n _this.fsm.from(States.Idle).to(States.AnimatingText);\n _this.fsm.from(States.AnimatingOut).to(States.AnimatingIn);\n // add fsm callbacks\n _this.fsm.on(States.AnimatingIn, _this.on_enter_animating_in.bind(_this));\n _this.fsm.on(States.AnimatingText, _this.on_enter_animating_text.bind(_this));\n _this.fsm.on(States.Idle, _this.on_enter_idle.bind(_this));\n _this.fsm.on(States.AnimatingOut, _this.on_enter_animating_out.bind(_this));\n return _this;\n }\n DialogBalloon.prototype.preUpdate = function (time, delta) {\n if (this.fsm.is(States.AnimatingText)) {\n this.anim_str.update(time, delta);\n this.text.text = this.anim_str.getString();\n if (this.anim_str.getStatus() == \"stopped\") {\n this.fsm.go(States.Idle);\n }\n }\n };\n DialogBalloon.prototype.on_enter_animating_text = function (from) {\n console.log(\"Enter animating text\");\n this.anim_str.reset(this.text.text);\n this.text.visible = true;\n this.text.text = '';\n this.anim_str.play();\n };\n DialogBalloon.prototype.on_enter_animating_in = function (from) {\n console.log(\"Enter animating in \");\n var t = this;\n this.cancelTween();\n this.tween = this.scene.tweens.add({\n targets: this.back,\n scaleX: 1,\n scaleY: 1,\n ease: 'Quad.easeOut',\n duration: 200,\n onComplete: function () {\n t.fsm.go(States.AnimatingText);\n }\n });\n };\n DialogBalloon.prototype.on_enter_animating_out = function (from) {\n console.log(\"Enter animating out\");\n this.text.visible = false;\n this.cancelTween();\n var self = this;\n this.tween = this.scene.tweens.add({\n targets: this.back,\n scaleX: 0,\n scaleY: 0,\n ease: 'Quad.easeOut',\n duration: 200,\n onComplete: function () {\n self.fsm.go(States.Hidden);\n self.parent.on_notity_message_hide();\n }\n });\n };\n DialogBalloon.prototype.on_enter_idle = function (from) {\n console.log(\"Enter idle\");\n var self = this;\n console.log(\"Enter IDLE \" + this.autoHide);\n if (this.autoHide) {\n this.cancelTimeout();\n this.timeout = setTimeout(function () {\n self.hide();\n }, self.IDLE_DELAY);\n }\n };\n DialogBalloon.prototype.cancelTimeout = function () {\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n };\n DialogBalloon.prototype.show = function (text, autoHide) {\n if (autoHide === void 0) { autoHide = true; }\n this.text.text = text;\n this.autoHide = autoHide;\n this.cancelTimeout();\n if (this.fsm.is(States.Hidden)) {\n this.fsm.go(States.AnimatingIn);\n }\n else if (this.fsm.is(States.AnimatingIn)) {\n // do nothing\n }\n else if (this.fsm.is(States.AnimatingText)) {\n // animate pulse DialogBalloon\n this.pulse_animation();\n this.fsm.go(States.AnimatingText);\n }\n else if (this.fsm.is(States.AnimatingOut)) {\n this.fsm.go(States.AnimatingIn);\n }\n else if (this.fsm.is(States.Idle)) {\n this.pulse_animation();\n this.fsm.go(States.AnimatingText);\n }\n };\n DialogBalloon.prototype.pulse_animation = function () {\n this.cancelTween();\n this.tween = this.scene.tweens.add({\n targets: this.back,\n scaleX: 1.2,\n scaleY: 1.2,\n yoyo: true,\n ease: 'Quad.easeOut',\n duration: 100,\n });\n };\n DialogBalloon.prototype.cancelTween = function () {\n if (this.tween) {\n this.tween.stop();\n this.tween = null;\n }\n };\n Object.defineProperty(DialogBalloon.prototype, \"width\", {\n get: function () {\n return this.back.width;\n },\n enumerable: true,\n configurable: true\n });\n DialogBalloon.prototype.hide = function () {\n var self = this;\n this.fsm.go(States.AnimatingOut);\n };\n return DialogBalloon;\n}(Phaser.GameObjects.Group));\nexports.DialogBalloon = DialogBalloon;\n\n\n//# sourceURL=webpack:///./src/dialogBalloon.ts?"); /***/ }), /***/ "./src/effects.ts": /*!************************!*\ !*** ./src/effects.ts ***! \************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar soundWrapper_1 = __webpack_require__(/*! ./utils/soundWrapper */ \"./src/utils/soundWrapper.ts\");\nvar Effects = /** @class */ (function (_super) {\n __extends(Effects, _super);\n function Effects(scene) {\n var _this = _super.call(this, scene) || this;\n _this.deadFish = scene.add.sprite(0, 0, \"guppy_dead_hook\");\n _this.deadFish.setOrigin(0.5, 1 - (_this.deadFish.frame.halfWidth / _this.deadFish.frame.height));\n _this.cloudSprite = scene.add.sprite(0, 0, \"cloud\");\n _this.eatCloudSprite = scene.add.sprite(0, 0, \"callout_eat\");\n _this.runningEffectCounter = 0;\n _this.add(_this.cloudSprite);\n _this.cloudSprite.visible = false;\n _this.eatCloudSprite.visible = false;\n _this.deadFish.visible = false;\n return _this;\n }\n // is called by the scene\n Effects.prototype.showDeadCloudEffect = function (guppy) {\n this.runningEffectCounter = this.runningEffectCounter + 1;\n this.cloudSprite.depth = 20;\n this.cloudSprite.visible = true;\n this.cloudSprite.alpha = 1;\n this.cloudSprite.setPosition(guppy.x, guppy.y);\n this.cloudSprite.scaleX = this.cloudSprite.scaleY = 1;\n var final_y = guppy.y - 20;\n var cloudSprite = this.cloudSprite;\n var scene = this.scene;\n var effectsInstance = this;\n soundWrapper_1.SoundWrapper.playHookedSound(scene);\n var tween1 = this.scene.tweens.add({\n targets: cloudSprite,\n scaleX: 1.2,\n scaleY: 1.2,\n ease: 'Linear',\n duration: 100,\n onComplete: function () {\n var tween2 = scene.tweens.add({\n targets: cloudSprite,\n y: final_y,\n alpha: 0,\n ease: 'Linear',\n duration: 800,\n onComplete: function () {\n effectsInstance.runningEffectCounter = effectsInstance.runningEffectCounter - 1;\n }\n });\n }\n });\n };\n // is called by the scene\n Effects.prototype.showEatCloudEffect = function (guppy) {\n this.runningEffectCounter = this.runningEffectCounter + 1;\n this.eatCloudSprite.depth = 20;\n this.eatCloudSprite.visible = true;\n this.eatCloudSprite.alpha = 1;\n this.eatCloudSprite.depth = 10000;\n this.eatCloudSprite.setPosition(guppy.x, guppy.y);\n this.eatCloudSprite.scaleX = this.cloudSprite.scaleY = 1;\n var eatCloudSprite = this.eatCloudSprite;\n var scene = this.scene;\n var effectsInstance = this;\n var tween1 = this.scene.tweens.add({\n targets: eatCloudSprite,\n alpha: 0,\n ease: 'Linear',\n delay: 300,\n duration: 600,\n onComplete: function () {\n effectsInstance.runningEffectCounter = effectsInstance.runningEffectCounter - 1;\n }\n });\n };\n // is called by Guppy\n Effects.prototype.showDeadFishEffect = function (guppy) {\n this.deadFish.visible = true;\n this.deadFish.alpha = 0;\n this.deadFish.setPosition(guppy.x, guppy.y);\n var timeline = this.scene.tweens.createTimeline({});\n timeline.add({\n targets: this.deadFish,\n alpha: 1,\n duration: 500,\n delay: 200,\n });\n timeline.add({\n targets: this.deadFish,\n y: -this.deadFish.frame.height,\n ease: 'Quad.easeIn',\n duration: 1000,\n });\n timeline.play();\n timeline.setCallback('onComplete', function () {\n guppy.notify_dead_animation_ended();\n }, []);\n };\n Effects.prototype.isAnyEffectRunning = function () {\n return this.runningEffectCounter != 0;\n };\n return Effects;\n}(Phaser.GameObjects.Group));\nexports.Effects = Effects;\n\n\n//# sourceURL=webpack:///./src/effects.ts?"); /***/ }), /***/ "./src/guppy.ts": /*!**********************!*\ !*** ./src/guppy.ts ***! \**********************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar observable_1 = __webpack_require__(/*! ./utils/observable */ \"./src/utils/observable.ts\");\nvar soundWrapper_1 = __webpack_require__(/*! ./utils/soundWrapper */ \"./src/utils/soundWrapper.ts\");\nvar Status;\n(function (Status) {\n Status[Status[\"IDLE\"] = 0] = \"IDLE\";\n Status[Status[\"MOVING\"] = 1] = \"MOVING\";\n Status[Status[\"DIYING\"] = 2] = \"DIYING\";\n Status[Status[\"EATING\"] = 3] = \"EATING\";\n Status[Status[\"DEAD\"] = 4] = \"DEAD\";\n Status[Status[\"FOLLOWING_PATH\"] = 5] = \"FOLLOWING_PATH\";\n Status[Status[\"DEMO\"] = 6] = \"DEMO\";\n})(Status || (Status = {}));\nvar Direction;\n(function (Direction) {\n Direction[Direction[\"LEFT\"] = 0] = \"LEFT\";\n Direction[Direction[\"RIGHT\"] = 1] = \"RIGHT\";\n})(Direction || (Direction = {}));\nvar Guppy = /** @class */ (function (_super) {\n __extends(Guppy, _super);\n function Guppy(scene, x, y) {\n var _this = _super.call(this, scene, x, y, 'guppy') || this;\n _this.status = Status.IDLE;\n _this.direction = Direction.RIGHT;\n // idle status attribs\n _this.idle_time = 0;\n _this.idle_time_offset = 0;\n _this.idle_mov_amp = 10;\n _this.idle_mov_freqX = 0;\n _this.idle_mov_freqY = 0;\n _this.idle_x = 0;\n _this.idle_y = 0;\n _this.last_mov_dir_x = 0;\n _this.last_mov_dir_y = 0;\n _this.time_to_next_bubble = 0;\n _this.bubble_creation_avg_time = 0;\n _this.bubble_creation_time_var = 0;\n // idle status constants\n _this.IDLE_MOV_MAX_AMP = 10;\n _this.BUBBLE_CREATION_AVG_TIME_IDLE = 2000;\n _this.BUBBLE_CREATION_TIME_VARIATION_IDLE = 1000;\n _this.BUBBLE_CREATION_AVG_TIME_MOVE = 60;\n _this.BUBBLE_CREATION_TIME_VARIATION_MOVE = 20;\n _this.idle_x = x;\n _this.idle_y = y;\n scene.physics.world.enable(_this);\n scene.add.existing(_this);\n _this.path_point = new Phaser.Math.Vector2();\n // no hace nada\n //scene.sys.updateList.add(this)\n _this.set_status(Status.IDLE, true);\n _this.setSize(40, 40);\n _this.observable = new observable_1.Observable();\n // create group for bubbles\n _this.bubbles_group = scene.add.group({\n defaultKey: 'bubble_small',\n maxSize: 200,\n createCallback: function (bubble) {\n scene.physics.world.enable(bubble);\n }\n });\n return _this;\n }\n Guppy.prototype.preUpdate = function (time, delta) {\n _super.prototype.update.call(this, time, delta);\n this.update_bubbles(time, delta);\n if (this.status == Status.IDLE) {\n this.update_idle(time, delta);\n }\n else if (this.status == Status.MOVING) {\n this.update_moving(time, delta);\n }\n else if (this.status == Status.FOLLOWING_PATH) {\n this.update_following_path(time, delta);\n }\n };\n Guppy.prototype.update_bubbles = function (time, delta) {\n var scene = this;\n this.bubbles_group.children.iterate(function (bubble) {\n bubble.alpha -= 0.005;\n if (bubble.alpha <= 0 || bubble.y < 0) {\n scene.bubbles_group.killAndHide(bubble);\n }\n });\n // create new bubbles\n this.time_to_next_bubble -= delta;\n if (this.time_to_next_bubble <= 0) {\n var bubble = this.bubbles_group.get(this.x, this.y);\n if (bubble) {\n this.activate_bubble(bubble);\n }\n this.time_to_next_bubble = Phaser.Math.FloatBetween(this.bubble_creation_avg_time - this.bubble_creation_time_var, this.bubble_creation_avg_time + this.bubble_creation_time_var);\n }\n };\n Guppy.prototype.move_fish = function (new_x, new_y) {\n if (this.status != Status.IDLE)\n return;\n this.observable.publish(\"guppy_move\");\n this.set_status(Status.MOVING);\n var vel = 0.2;\n this.last_mov_dir_x = this.x - new_x;\n this.last_mov_dir_y = this.y - new_y;\n this.direction = this.x > new_x ? Direction.RIGHT : Direction.LEFT;\n this.flipX = this.direction == Direction.RIGHT;\n var distance = Phaser.Math.Distance.Between(this.x, this.y, new_x, new_y);\n var time = distance / vel;\n //this.moving_by_tween = true\n var tween = this.scene.tweens.add({\n targets: this,\n x: new_x,\n y: new_y,\n ease: Phaser.Math.Easing.Quadratic.Out,\n duration: time\n });\n var theFish = this;\n tween.setCallback(\"onComplete\", function () {\n theFish.set_status(Status.IDLE);\n tween.stop();\n }, []);\n soundWrapper_1.SoundWrapper.playFishSwimSound(this.scene);\n };\n Guppy.prototype.animate_death = function () {\n this.visible = false;\n this.active = false;\n var currentScene = this.scene;\n var guppy = this;\n this.set_status(Status.DIYING);\n currentScene.effects.showDeadFishEffect(this);\n };\n Guppy.prototype.animate_eat = function (finish_callback, callbackContext) {\n this.set_status(Status.EATING);\n var fish = this;\n setTimeout(function () {\n fish.set_status(Status.IDLE);\n }, 200);\n };\n Guppy.prototype.revive = function () {\n this.visible = true;\n this.active = true;\n this.flicker();\n this.set_status(Status.IDLE);\n };\n Guppy.prototype.flicker = function () {\n this.alpha = 1;\n var tween = this.scene.tweens.add({\n targets: this,\n alpha: 0,\n yoyo: true,\n repeat: 10,\n ease: 'Quad.easeOut',\n duration: 80\n });\n };\n Guppy.prototype.notify_dead_animation_ended = function () {\n this.set_status(Status.DEAD);\n };\n Guppy.prototype.is_dead = function () {\n return this.status == Status.DEAD;\n };\n Guppy.prototype.is_animating_dead = function () {\n return this.status == Status.DIYING;\n };\n Guppy.prototype.follow_path = function (path, time_millis) {\n if (this.status != Status.IDLE)\n return;\n this.status = Status.FOLLOWING_PATH;\n this.path_time = 0;\n this.path = path;\n this.path_duration = time_millis;\n this.path.getStartPoint(this.path_point);\n this.setPosition(this.path_point.x, this.path_point.y);\n this.disableBody();\n };\n Guppy.prototype.set_status = function (new_status, force) {\n if (force === void 0) { force = false; }\n if (this.status == new_status && !force)\n return;\n if (new_status == Status.IDLE) {\n this.idle_x = this.x;\n this.idle_y = this.y;\n this.idle_time = 0;\n this.idle_mov_amp = 0;\n this.idle_mov_freqX = Phaser.Math.Between(500, 900);\n this.idle_mov_freqY = Phaser.Math.Between(500, 900);\n this.bubble_creation_avg_time = this.BUBBLE_CREATION_AVG_TIME_IDLE;\n this.bubble_creation_time_var = this.BUBBLE_CREATION_TIME_VARIATION_IDLE;\n if (this.last_mov_dir_x < 0) {\n this.idle_time_offset = 0;\n }\n else {\n this.idle_time_offset = 3.1416;\n }\n this.idle_time = 0;\n // increase movement amplitude gradually\n var fish = this;\n var tween = this.scene.tweens.add({\n targets: fish,\n idle_mov_amp: this.IDLE_MOV_MAX_AMP,\n duration: 3000,\n });\n }\n else if (new_status == Status.MOVING) {\n this.bubble_creation_avg_time = this.BUBBLE_CREATION_AVG_TIME_MOVE;\n this.bubble_creation_time_var = this.BUBBLE_CREATION_TIME_VARIATION_MOVE;\n this.time_to_next_bubble = 0;\n }\n this.status = new_status;\n };\n Guppy.prototype.update_following_path = function (time, delta) {\n this.path_time += delta;\n var t = (this.path_time * 1.0) / this.path_duration;\n if (t >= 1) {\n this.path.getEndPoint(this.path_point);\n this.setPosition(this.path_point.x, this.path_point.y);\n this.set_status(Status.IDLE);\n this.enableBody(true, this.path_point.x, this.path_point.y, true, true);\n }\n else {\n this.path.getPoint(t, this.path_point);\n this.setPosition(this.path_point.x, this.path_point.y);\n t = t + 0.01;\n if (t > 1)\n t = 1;\n this.path.getPoint(t, this.path_point);\n this.flipX = this.x >= this.path_point.x;\n }\n };\n Guppy.prototype.update_idle = function (time, delta) {\n this.idle_time += delta;\n var normalizedTimeX = this.idle_time / this.idle_mov_freqX + this.idle_time_offset;\n this.x = this.idle_x + this.idle_mov_amp * Math.sin(normalizedTimeX);\n this.y = this.idle_y + this.idle_mov_amp * Math.sin(this.idle_time / this.idle_mov_freqY);\n // flipX on movement velocity d(sin(x))/dx = cos(x)\n this.flipX = Math.cos(normalizedTimeX) <= 0;\n };\n Guppy.prototype.update_moving = function (time, delta) {\n };\n Guppy.prototype.activate_bubble = function (bubble) {\n bubble.setActive(true);\n bubble.setVisible(true);\n bubble.alpha = 1;\n var scale = Phaser.Math.FloatBetween(0.1, 1);\n bubble.setScale(scale, scale);\n var b = bubble.body;\n b.velocity.y = -Phaser.Math.FloatBetween(30, 60);\n };\n Guppy.prototype.set_demo = function (demo) {\n if (demo === void 0) { demo = true; }\n if (demo) {\n this.set_status(Status.DEMO);\n }\n else {\n this.set_status(Status.IDLE);\n }\n };\n return Guppy;\n}(Phaser.Physics.Arcade.Sprite));\nexports.Guppy = Guppy;\n\n\n//# sourceURL=webpack:///./src/guppy.ts?"); /***/ }), /***/ "./src/jellyFish.ts": /*!**************************!*\ !*** ./src/jellyFish.ts ***! \**************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar messageBox_1 = __webpack_require__(/*! ./messageBox */ \"./src/messageBox.ts\");\nvar observable_1 = __webpack_require__(/*! ./utils/observable */ \"./src/utils/observable.ts\");\nvar Status;\n(function (Status) {\n Status[Status[\"IDLE\"] = 0] = \"IDLE\";\n Status[Status[\"MOVING\"] = 1] = \"MOVING\";\n Status[Status[\"DEMO\"] = 2] = \"DEMO\";\n})(Status || (Status = {}));\nvar JellyFishAnswers;\n(function (JellyFishAnswers) {\n JellyFishAnswers[JellyFishAnswers[\"JellyFishAnswerRight\"] = 0] = \"JellyFishAnswerRight\";\n JellyFishAnswers[JellyFishAnswers[\"JellyFishAnswerWrong\"] = 1] = \"JellyFishAnswerWrong\";\n})(JellyFishAnswers = exports.JellyFishAnswers || (exports.JellyFishAnswers = {}));\nvar JellyFish = /** @class */ (function (_super) {\n __extends(JellyFish, _super);\n function JellyFish(x, y, scene, url_data) {\n var _this = _super.call(this, scene, 0, 0, 'jelly_spritesheet') || this;\n _this.mov_amp = 10;\n _this.has_hover = false;\n _this.JELLY_SCALE = 0.8;\n _this.status = Status.IDLE;\n _this.base_x = x;\n _this.base_y = y;\n _this.mov_angle = 0;\n _this.mov_phase = Phaser.Math.Between(0, 7);\n _this.mov_speed = Phaser.Math.Between(800, 1000);\n _this.url_data = url_data;\n _this.messageBox = new messageBox_1.MessageBox(_this.scene, _this);\n _this.messageBox.observable.subscribe(_this);\n _this.observable = new observable_1.TypedObservable();\n // create animation for this particular jellyfish\n var config = {\n key: 'jellyfish_idle_' + _this.url_data.url,\n frames: scene.anims.generateFrameNumbers('jelly_spritesheet', { start: 0, end: 5 }),\n frameRate: Phaser.Math.Between(3, 10),\n yoyo: true,\n repeat: -1\n };\n scene.anims.create(config);\n _this.setFrame(Phaser.Math.Between(0, 5));\n _this.anims.play('jellyfish_idle_' + _this.url_data.url);\n //console.log(\"Create jelly: \"+this.url_data.url)\n scene.physics.world.enable(_this);\n _this.set_hover(false);\n _this.setPosition(x, y);\n // mouse cursor\n //this.setInteractive(true)\n _this.on('pointerover', _this.on_pointer_over, _this);\n //this.on('pointerout', function(){\n //scene.game.canvas.style.cursor = \"default\"\n //})\n // initial show tween\n _this.scaleX = 0;\n _this.scaleY = 0;\n var tween = _this.scene.tweens.add({\n targets: _this,\n scaleX: _this.JELLY_SCALE,\n scaleY: _this.JELLY_SCALE,\n ease: 'Quad.easeIn',\n duration: Phaser.Math.Between(200, 700),\n });\n return _this;\n }\n JellyFish.prototype.on_pointer_over = function () {\n this.scene.game.canvas.style.cursor = \"pointer\";\n };\n JellyFish.prototype.preUpdate = function (time, delta) {\n _super.prototype.preUpdate.call(this, time, delta);\n if (this.status == Status.IDLE) {\n this.mov_angle = this.mov_angle + delta;\n var mov_y = this.base_y + this.mov_amp * Math.sin((this.mov_angle / this.mov_speed + this.mov_phase));\n this.setPosition(this.base_x, mov_y);\n }\n if (this.has_hover) {\n this.messageBox.show();\n }\n else {\n this.messageBox.hide();\n }\n };\n JellyFish.prototype.getURLData = function () {\n return this.url_data;\n };\n JellyFish.prototype.getUserAnswer = function () {\n return this.userAnswer;\n };\n JellyFish.prototype.set_status = function (new_status, force) {\n if (force === void 0) { force = false; }\n if (this.status == new_status && !force)\n return;\n this.status = new_status;\n if (new_status == Status.IDLE) {\n this.base_x = this.x;\n this.base_y = this.y;\n this.mov_angle = 0;\n this.mov_phase = 0;\n }\n };\n JellyFish.prototype.set_demo = function (demo) {\n if (demo === void 0) { demo = true; }\n if (demo) {\n this.set_status(Status.DEMO);\n }\n else {\n this.set_status(Status.IDLE);\n }\n };\n JellyFish.prototype.set_hover = function (hover) {\n if (hover) {\n this.setSize(80, 100);\n }\n else {\n this.setSize(20, 50);\n this.setOffset(10, 10);\n }\n };\n JellyFish.prototype.show_hover_effect = function (hover) {\n if (hover) {\n this.setScale(this.JELLY_SCALE * 1.2, this.JELLY_SCALE * 1.2);\n this.setPipeline('brightness');\n this.has_hover = true;\n }\n else {\n this.setScale(this.JELLY_SCALE, this.JELLY_SCALE);\n this.resetPipeline();\n this.has_hover = false;\n }\n };\n JellyFish.prototype.on_notify = function (message) {\n console.log(\"Notified: \" + message);\n var answeredCorrect = false;\n if (message == messageBox_1.MessageBoxMessages.MessageBoxYes && this.getURLData().safe\n || message == messageBox_1.MessageBoxMessages.MessageBoxNo && !this.getURLData().safe) {\n answeredCorrect = true;\n }\n this.userAnswer = message == messageBox_1.MessageBoxMessages.MessageBoxYes ? \"yes\" : \"no\";\n var scene = this.scene;\n if (answeredCorrect) {\n //this.observable.publish(JellyFishAnswers.JellyFishAnswerRight)\n scene.answer(this, \"correct\");\n }\n else {\n //this.observable.publish(JellyFishAnswers.JellyFishAnswerWrong)\n scene.answer(this, \"incorrect\");\n }\n };\n return JellyFish;\n}(Phaser.Physics.Arcade.Sprite));\nexports.JellyFish = JellyFish;\n\n\n//# sourceURL=webpack:///./src/jellyFish.ts?"); /***/ }), /***/ "./src/levelManager.ts": /*!*****************************!*\ !*** ./src/levelManager.ts ***! \*****************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar LevelManager = /** @class */ (function () {\n function LevelManager() {\n console.log(\"LevelManager::constructor()\");\n if (LevelManager.instance) {\n throw new Error(\"Error - use Singleton.getInstance()\");\n }\n this.level_num = 0;\n this.lives_count = 3;\n this.levels = undefined;\n }\n LevelManager.prototype.load_levels_from_json = function (game, levelsResource, force) {\n if (levelsResource === void 0) { levelsResource = 'levels'; }\n if (force === void 0) { force = false; }\n if (this.levels == undefined || force) {\n console.log(\"LevelManager::load_levels(): Loading JSON data\");\n this.levels = game.cache.json.get(levelsResource).levels;\n console.log(\"LevelManager::load_levels(): \" + this.levels.length + \" levels loaded\");\n }\n else {\n console.log(\"LevelManager::load_levels(): Levels already loaded\");\n }\n };\n LevelManager.prototype.advance_level = function () {\n this.level_num = this.level_num + 1;\n console.log(\"LevelManager::advance_level(): level is now \" + this.level_num);\n };\n LevelManager.prototype.get_current_level = function () {\n console.log(\"LevelManager::get_current_level(): \" + this.levels[this.level_num].urls.length + \" entries\");\n return this.levels[this.level_num];\n };\n LevelManager.prototype.get_current_level_num = function () {\n return this.level_num + 1;\n };\n LevelManager.prototype.next_level_exists = function () {\n return this.level_num + 1 <= this.levels.length - 1;\n };\n LevelManager.prototype.reset = function () {\n this.level_num = 0;\n this.lives_count = 3;\n };\n LevelManager.prototype.get_lives_count = function () {\n return this.lives_count;\n };\n LevelManager.prototype.decrease_life = function () {\n this.lives_count = this.lives_count - 1;\n };\n LevelManager.get_instance = function () {\n console.log(\"Calling LevelManager::get_instance()\");\n if (LevelManager.instance === undefined) {\n console.log(\"LevelManager: Creating new instance\");\n LevelManager.instance = new LevelManager();\n }\n return LevelManager.instance;\n };\n LevelManager.instance = new LevelManager();\n return LevelManager;\n}());\nexports.LevelManager = LevelManager;\n\n\n//# sourceURL=webpack:///./src/levelManager.ts?"); /***/ }), /***/ "./src/messageBox.ts": /*!***************************!*\ !*** ./src/messageBox.ts ***! \***************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar observable_1 = __webpack_require__(/*! ./utils/observable */ \"./src/utils/observable.ts\");\nvar Status;\n(function (Status) {\n Status[Status[\"HIDDEN\"] = 0] = \"HIDDEN\";\n Status[Status[\"VISIBLE\"] = 1] = \"VISIBLE\";\n Status[Status[\"ANIMATING\"] = 2] = \"ANIMATING\";\n})(Status || (Status = {}));\n// Messages that can be emmited by this object\nvar MessageBoxMessages;\n(function (MessageBoxMessages) {\n MessageBoxMessages[MessageBoxMessages[\"MessageBoxYes\"] = 0] = \"MessageBoxYes\";\n MessageBoxMessages[MessageBoxMessages[\"MessageBoxNo\"] = 1] = \"MessageBoxNo\";\n})(MessageBoxMessages = exports.MessageBoxMessages || (exports.MessageBoxMessages = {}));\nvar MessageBox = /** @class */ (function (_super) {\n __extends(MessageBox, _super);\n //make the back of the message box\n function MessageBox(scene, jellyFish) {\n var _this = _super.call(this, scene) || this;\n _this.jellyFish = jellyFish;\n var padding = 20;\n _this.back = scene.add.image(0, 0, \"\");\n _this.text = scene.add.text(0, 0, \"\");\n _this.text.setAlign(\"center\");\n _this.text.setFontFamily(\"Arial\");\n _this.text.setFontSize(18);\n _this.text.width = _this.back.width;\n _this.text.setColor(\"#333344\");\n _this.text.setWordWrapWidth(_this.back.width - padding * 2);\n _this.button1 = scene.add.sprite(0, 0, \"button_answer_wrong\");\n _this.button2 = scene.add.sprite(0, 0, \"button_answer_right\");\n _this.observable = new observable_1.TypedObservable();\n _this.setListeners();\n _this.add(_this.back);\n _this.add(_this.text);\n _this.add(_this.button1);\n _this.add(_this.button2);\n scene.game.canvas.style.cursor = \"default\";\n _this.status = Status.HIDDEN;\n _this.getChildren().forEach(function (obj) {\n obj.setVisible(false);\n obj.depth = 40;\n });\n return _this;\n }\n MessageBox.prototype.setListeners = function () {\n this.button1.setInteractive();\n this.button1.on('pointerover', function () {\n this.setScale(1.1, 1.1);\n this.setTexture(\"button_answer_wrong_focus\");\n this.scene.game.canvas.style.cursor = \"pointer\";\n });\n this.button1.on('pointerout', function () {\n this.setScale(1, 1);\n this.setTexture(\"button_answer_wrong\");\n this.scene.game.canvas.style.cursor = \"default\";\n });\n this.button2.setInteractive();\n this.button2.on('pointerover', function () {\n this.setScale(1.1, 1.1);\n this.setTexture(\"button_answer_right_focus\");\n this.scene.game.canvas.style.cursor = \"pointer\";\n });\n this.button2.on('pointerout', function () {\n this.setScale(1, 1);\n this.setTexture(\"button_answer_right\");\n this.scene.game.canvas.style.cursor = \"default\";\n });\n var message_box = this;\n var scene = this.scene;\n this.button1.on('pointerdown', function (pointer, x, y, event) {\n event.stopPropagation();\n message_box.hide();\n message_box.observable.publish(MessageBoxMessages.MessageBoxNo);\n });\n this.button2.on('pointerdown', function (pointer, x, y, event) {\n event.stopPropagation();\n message_box.observable.publish(MessageBoxMessages.MessageBoxYes);\n message_box.hide();\n });\n };\n MessageBox.prototype.hide = function () {\n if (this.status != Status.VISIBLE)\n return;\n var self = this;\n self.button1.removeInteractive();\n self.button2.removeInteractive();\n this.status = Status.ANIMATING;\n /*this.getChildren().forEach(function(obj: Phaser.GameObjects.Sprite){\n obj.setVisible(false)\n })*/\n this.getChildren().forEach(function (obj) {\n obj.setVisible(true);\n obj.scaleX = obj.scaleY = 1;\n });\n var scene = this.scene;\n var tween = scene.tweens.add({\n targets: this.getChildren(),\n scaleX: 0,\n scaleY: 0,\n ease: 'Quad.easeIn',\n duration: 100,\n onComplete: function () {\n self.status = Status.HIDDEN;\n }\n });\n };\n MessageBox.prototype.setPosition = function (x, y) {\n var button_offset_x = 0;\n var button_offset_y = 0;\n var buttonDistance = 40;\n var text_offset_y = 0;\n var offset = this.getMessageOffset(this.jellyFish);\n if (offset.x < 0) {\n this.back.setTexture(\"message_box_horizontal\");\n this.back.flipX = false;\n button_offset_x = -12;\n }\n else if (offset.x > 0) {\n this.back.setTexture(\"message_box_horizontal\");\n this.back.flipX = true;\n button_offset_x = 12;\n }\n else if (offset.y > 0) {\n this.back.setTexture(\"message_box_vertical\");\n this.back.flipY = true;\n text_offset_y = 18;\n button_offset_y = 9;\n }\n else if (offset.y < 0) {\n this.back.setTexture(\"message_box_vertical\");\n this.back.flipY = false;\n button_offset_y = -9;\n }\n this.back.setPosition(x, y);\n this.text.setPosition(this.back.getCenter().x + button_offset_x, (y - this.back.height / 2.0) + 20 + text_offset_y);\n //this.text.setPosition(0, 0)\n this.button1.setPosition(x - buttonDistance + button_offset_x, y + button_offset_y + 30);\n this.button2.setPosition(x + buttonDistance + button_offset_x, y + button_offset_y + 30);\n };\n //show(text: string, x: integer, y: integer, answerCallback: (answer: string)=>void){\n MessageBox.prototype.show = function () {\n if (this.status != Status.HIDDEN)\n return;\n this.status = Status.ANIMATING;\n //this.answerCallback = answerCallback\n var offset = this.getMessageOffset(this.jellyFish);\n this.text.text = this.jellyFish.getURLData().url;\n this.text.setOrigin(0.5, 0.5);\n this.setPosition(this.jellyFish.getCenter().x + offset.x, this.jellyFish.getCenter().y + offset.y);\n this.getChildren().forEach(function (obj) {\n obj.setVisible(true);\n obj.scaleX = obj.scaleY = 0;\n });\n var scene = this.scene;\n var self = this;\n var tween = scene.tweens.add({\n targets: this.getChildren(),\n scaleX: 1,\n scaleY: 1,\n ease: 'Quad.easeIn',\n duration: 200,\n onComplete: function () {\n self.status = Status.VISIBLE;\n self.button1.setInteractive();\n self.button2.setInteractive();\n }\n });\n };\n MessageBox.prototype.getMessageOffset = function (j) {\n var offset_x = 0;\n var offset_y = 0;\n var HORIZONTAL_OFFSET = 270;\n if (j.x < this.scene.game.renderer.width / 3.0) {\n // msgbox positioned at jelly's right\n offset_x = HORIZONTAL_OFFSET;\n }\n else if (j.x > this.scene.game.renderer.width * 2.0 / 3.0) {\n offset_x = -HORIZONTAL_OFFSET;\n // msgbox positioned at jelly's left\n }\n else {\n offset_x = 0;\n if (j.y > this.scene.game.renderer.height / 2.0) {\n offset_y = -80;\n }\n else {\n offset_y = 80;\n }\n }\n return new Phaser.Math.Vector2(offset_x, offset_y);\n };\n MessageBox.prototype.is_visible = function () {\n return this.status == Status.VISIBLE;\n };\n return MessageBox;\n}(Phaser.GameObjects.Group));\nexports.MessageBox = MessageBox;\n\n\n//# sourceURL=webpack:///./src/messageBox.ts?"); /***/ }), /***/ "./src/oldFish.ts": /*!************************!*\ !*** ./src/oldFish.ts ***! \************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar dialogBalloon_1 = __webpack_require__(/*! ./dialogBalloon */ \"./src/dialogBalloon.ts\");\nvar typestate_1 = __webpack_require__(/*! typestate */ \"./node_modules/typestate/dist/typestate-node.js\");\nvar States;\n(function (States) {\n States[States[\"Hidden\"] = 0] = \"Hidden\";\n States[States[\"AnimatingIn\"] = 1] = \"AnimatingIn\";\n States[States[\"WaitingMessageEnd\"] = 2] = \"WaitingMessageEnd\";\n States[States[\"AnimatingOut\"] = 3] = \"AnimatingOut\"; // animating out\n})(States || (States = {}));\nvar OldFish = /** @class */ (function (_super) {\n __extends(OldFish, _super);\n function OldFish(scene) {\n var _this = _super.call(this, scene, 0, 0, 'wise_fish') || this;\n _this.moving_by_tween = false;\n _this.autoHide = true;\n _this.animating_out_callback = null;\n // const\n _this.DIALOG_BALLOON_OVERLAP = 50;\n _this.ANIMATION_DURATION = 500;\n scene.add.existing(_this);\n _this.dialog_balloon = new dialogBalloon_1.DialogBalloon(0, _this.scene.game.renderer.height - _this.height, scene, _this);\n //scene.physics.world.enable(this)\n // no hace nada\n //scene.sys.updateList.add(this)\n var config = {\n key: 'oldFish_spritesheet',\n frames: scene.anims.generateFrameNumbers('oldFish_spritesheet', { start: 0, end: 20 }),\n frameRate: 8,\n yoyo: true,\n repeat: -1\n };\n _this.depth = 30;\n _this.tween = null;\n scene.anims.create(config);\n _this.anims.play('oldFish_spritesheet');\n _this.setPosition(-_this.width / 2.0, _this.scene.game.renderer.height - _this.height / 2.0);\n _this.fsm = new typestate_1.TypeState.FiniteStateMachine(States.Hidden);\n _this.x = _this.scene.game.renderer.width + _this.width / 2.0;\n // add valid states\n _this.fsm.from(States.Hidden).to(States.AnimatingIn);\n _this.fsm.from(States.AnimatingIn).to(States.WaitingMessageEnd);\n _this.fsm.from(States.WaitingMessageEnd).to(States.AnimatingOut);\n _this.fsm.from(States.AnimatingOut).to(States.Hidden);\n _this.fsm.from(States.AnimatingOut).to(States.AnimatingIn);\n // add fsm callbacks\n _this.fsm.on(States.AnimatingIn, _this.on_enter_animating_in.bind(_this));\n _this.fsm.on(States.WaitingMessageEnd, _this.on_enter_waiting_message_end.bind(_this));\n _this.fsm.on(States.AnimatingOut, _this.on_enter_animating_out.bind(_this));\n return _this;\n }\n OldFish.prototype.on_enter_animating_in = function (from) {\n var x1 = this.scene.game.renderer.width - this.width / 4.0 + 10;\n var old_fish = this;\n this.tween = this.scene.tweens.add({\n targets: this,\n x: x1,\n ease: 'Quad.easeOut',\n duration: old_fish.ANIMATION_DURATION,\n onComplete: function () {\n old_fish.dialog_balloon.show(old_fish.msg, old_fish.autoHide);\n old_fish.fsm.go(States.WaitingMessageEnd);\n }\n });\n };\n OldFish.prototype.on_enter_waiting_message_end = function (from) {\n console.log(\"FISH: waiting message end\");\n };\n OldFish.prototype.on_enter_animating_out = function (from) {\n var x1;\n if (this.flipX) {\n x1 = -this.width / 2.0;\n }\n else {\n x1 = this.scene.game.renderer.width + this.width / 2.0;\n }\n var old_fish = this;\n this.tween = this.scene.tweens.add({\n targets: this,\n x: x1,\n ease: 'Quad.easeOut',\n duration: old_fish.ANIMATION_DURATION,\n onComplete: function () {\n old_fish.fsm.go(States.Hidden);\n }\n });\n };\n OldFish.prototype.cancelTween = function () {\n if (this.tween) {\n this.tween.stop();\n this.tween = null;\n }\n };\n OldFish.prototype.talk = function (msg, autoHide) {\n if (autoHide === void 0) { autoHide = true; }\n if (msg == '')\n return;\n this.autoHide = autoHide;\n this.msg = msg;\n if (this.fsm.is(States.Hidden)) {\n this.fsm.go(States.AnimatingIn);\n }\n else if (this.fsm.is(States.AnimatingIn)) {\n // do nothing... message already updated (can this really happen???)\n }\n else if (this.fsm.is(States.WaitingMessageEnd)) {\n this.dialog_balloon.show(this.msg, autoHide);\n }\n else if (this.fsm.is(States.AnimatingOut)) {\n this.cancelTween();\n this.fsm.go(States.AnimatingIn);\n }\n };\n OldFish.prototype.is_hidden = function () {\n return this.fsm.is(States.Hidden);\n };\n // called by DialogBalloon when it begins to hide\n OldFish.prototype.on_notity_message_hide = function () {\n if (this.fsm.is(States.WaitingMessageEnd)) {\n this.fsm.go(States.AnimatingOut);\n if (this.animating_out_callback) {\n this.animating_out_callback();\n }\n }\n };\n OldFish.prototype.preUpdate = function (time, delta) {\n _super.prototype.preUpdate.call(this, time, delta);\n this.dialog_balloon.preUpdate(time, delta);\n };\n OldFish.prototype.setAnimatingOutCallback = function (callback) {\n this.animating_out_callback = callback;\n };\n return OldFish;\n}(Phaser.GameObjects.Sprite));\nexports.OldFish = OldFish;\n\n\n//# sourceURL=webpack:///./src/oldFish.ts?"); /***/ }), /***/ "./src/questionButton.ts": /*!*******************************!*\ !*** ./src/questionButton.ts ***! \*******************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar Status;\n(function (Status) {\n Status[Status[\"HIDDEN\"] = 0] = \"HIDDEN\";\n Status[Status[\"COMING_OUT\"] = 1] = \"COMING_OUT\";\n Status[Status[\"COMING_IN\"] = 2] = \"COMING_IN\";\n Status[Status[\"VISIBLE\"] = 3] = \"VISIBLE\";\n})(Status || (Status = {}));\nvar QuestionButton = /** @class */ (function (_super) {\n __extends(QuestionButton, _super);\n function QuestionButton(scene, old_fish) {\n var _this = _super.call(this, scene, 0, 0, 'button_question') || this;\n _this.left = true;\n scene.add.existing(_this);\n _this.old_fish = old_fish;\n _this.depth = 30;\n _this.setPosition(-_this.width / 2.0, _this.scene.game.renderer.height - _this.height / 2.0 - 20);\n _this.status = Status.HIDDEN;\n _this.setInteractive();\n _this.on('pointerover', function () {\n this.setScale(1.1, 1.1);\n //this.setTexture(\"button_answer_wrong_focus\")\n this.scene.game.canvas.style.cursor = \"pointer\";\n });\n _this.on('pointerout', function () {\n this.setScale(1, 1);\n //this.setTexture(\"button_answer_wrong\")\n this.scene.game.canvas.style.cursor = \"default\";\n });\n _this.on('pointerdown', function (pointer, x, y, event) {\n event.stopPropagation();\n // call help...\n this.scene.call_help(this.jellyfish);\n console.log(this.called_out_jellyfishes);\n this.come_out();\n });\n return _this;\n }\n QuestionButton.prototype.come_in = function (j) {\n if (this.status == Status.HIDDEN &&\n this.old_fish.is_hidden()) {\n this.status = Status.COMING_IN;\n var padding = 20;\n this.jellyfish = j;\n var x0 = void 0, x1 = void 0;\n if (this.left) {\n x0 = -this.width / 2.0;\n x1 = this.width / 2.0 + padding;\n }\n console.log(\"TW: \" + x0 + \" \" + x1);\n /*else{\n x0 = this.scene.game.renderer.width+this.width/2.0\n x1 = this.scene.game.renderer.width-this.width/4.0 - padding\n }*/\n this.x = x0;\n var button_1 = this;\n var tween = this.scene.tweens.add({\n targets: this,\n x: x1,\n ease: 'Quad.easeIn',\n duration: 100,\n onComplete: function () {\n button_1.status = Status.VISIBLE;\n }\n });\n }\n };\n QuestionButton.prototype.come_out = function () {\n if (this.status == Status.VISIBLE) {\n this.status = Status.COMING_OUT;\n var x1 = void 0;\n if (this.left) {\n x1 = -this.width / 2.0;\n }\n else {\n x1 = this.scene.game.renderer.width + this.width / 2.0;\n }\n var button_2 = this;\n var tween = this.scene.tweens.add({\n targets: this,\n x: x1,\n ease: 'Quad.easeOut',\n duration: 200,\n onComplete: function () {\n button_2.status = Status.HIDDEN;\n }\n });\n }\n };\n return QuestionButton;\n}(Phaser.Physics.Arcade.Sprite));\nexports.QuestionButton = QuestionButton;\n\n\n//# sourceURL=webpack:///./src/questionButton.ts?"); /***/ }), /***/ "./src/scenes/baseMenuScene.ts": /*!*************************************!*\ !*** ./src/scenes/baseMenuScene.ts ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar waterDistortShader_1 = __webpack_require__(/*! ../waterDistortShader */ \"./src/waterDistortShader.ts\");\nvar BaseMenuScene = /** @class */ (function (_super) {\n __extends(BaseMenuScene, _super);\n function BaseMenuScene(config) {\n var _this = _super.call(this, config) || this;\n _this.next_scene_transition_started = false;\n _this.MENU_PADDING = 30;\n return _this;\n }\n BaseMenuScene.prototype.init = function ( /* params: any */) {\n };\n BaseMenuScene.prototype.preload = function () {\n };\n BaseMenuScene.prototype.create = function () {\n this.fade_tween = null;\n // background \n var background = this.add.image(this.game.renderer.width / 2, this.game.renderer.height / 2, \"voodoo_cactus_underwater\").setScale(0.4, 0.4);\n background.setPipeline('distort');\n this.fade_texture = this.make.renderTexture({\n x: 0,\n y: 0,\n width: this.game.renderer.width,\n height: this.game.renderer.height\n });\n this.fade_texture.fill(0xffffff);\n this.fade_texture.depth = 100000;\n this.fadeIn();\n this.next_scene_transition_started = false;\n };\n BaseMenuScene.prototype.fadeIn = function () {\n this.cancelTween();\n this.fade_texture.alpha = 1;\n var scene = this;\n this.add.tween({\n targets: this.fade_texture,\n alpha: 0,\n ease: 'Quad.easeOut',\n duration: BaseMenuScene.FADE_IN_DURATION,\n });\n };\n BaseMenuScene.prototype.cancelTween = function () {\n if (this.fade_tween != null) {\n //this.fade_tween.remove()\n this.fade_tween.stop();\n this.fade_tween = null;\n }\n };\n BaseMenuScene.prototype.update = function (elapsed, delta) {\n _super.prototype.update.call(this, elapsed, delta);\n waterDistortShader_1.WaterDistortShader.get_instance().update(delta);\n };\n BaseMenuScene.prototype.switchScene = function (newScene) {\n if (this.next_scene_transition_started)\n return;\n console.log(\"Starting transition to: \" + newScene);\n this.next_scene_transition_started = true;\n this.cancelTween();\n this.fade_texture.visible = true;\n var scene = this;\n this.fade_tween = this.add.tween({\n targets: this.fade_texture,\n alpha: 1,\n ease: 'Quad.easeOut',\n duration: BaseMenuScene.FADE_OUT_DURATION,\n onComplete: function () {\n scene.scene.start(newScene);\n }\n });\n };\n BaseMenuScene.FADE_IN_DURATION = 1000;\n BaseMenuScene.FADE_OUT_DURATION = 1000;\n return BaseMenuScene;\n}(Phaser.Scene));\nexports.BaseMenuScene = BaseMenuScene;\n\n\n//# sourceURL=webpack:///./src/scenes/baseMenuScene.ts?"); /***/ }), /***/ "./src/scenes/feedbackScene.ts": /*!*************************************!*\ !*** ./src/scenes/feedbackScene.ts ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar button_1 = __webpack_require__(/*! ../button */ \"./src/button.ts\");\nvar utils_1 = __webpack_require__(/*! ../utils */ \"./src/utils.ts\");\nvar levelManager_1 = __webpack_require__(/*! ../levelManager */ \"./src/levelManager.ts\");\nvar baseMenuScene_1 = __webpack_require__(/*! ./baseMenuScene */ \"./src/scenes/baseMenuScene.ts\");\nvar config_1 = __webpack_require__(/*! ../config */ \"./src/config.ts\");\nvar soundWrapper_1 = __webpack_require__(/*! ../utils/soundWrapper */ \"./src/utils/soundWrapper.ts\");\nvar bbcodetext_js_1 = __webpack_require__(/*! phaser3-rex-plugins/plugins/bbcodetext.js */ \"./node_modules/phaser3-rex-plugins/plugins/bbcodetext.js\");\nvar FeedbackScene = /** @class */ (function (_super) {\n __extends(FeedbackScene, _super);\n function FeedbackScene() {\n var _this = _super.call(this, {\n key: \"FeedbackScene\"\n }) || this;\n _this.answers = [];\n return _this;\n }\n FeedbackScene.prototype.init = function ( /* params: any */) {\n _super.prototype.init.call(this);\n };\n FeedbackScene.prototype.preload = function () {\n };\n FeedbackScene.prototype.create = function () {\n _super.prototype.create.call(this);\n // title\n var title = this.add.text(0, 0, '');\n title.text = \"¡Felicitaciones! Puedes avanzar a la siguiente ronda\";\n title.setColor('#43356b');\n title.setFontSize(24);\n title.style.setStroke('#fff', 2);\n title.setFontFamily('\"Baloo Chettan\"');\n title.y = this.MENU_PADDING;\n utils_1.Utils.center_x_on_screen(this, title);\n var URL_BASE_Y = title.y + 92;\n // continue button\n this.button_continue = new button_1.Button(this, this.game.renderer.width / 2.0, 0, this.next_scene.bind(this));\n this.button_continue.add_text(\"Continuar\");\n this.button_continue.y = this.game.renderer.height - this.MENU_PADDING - this.button_continue.height / 2.0;\n this.button_continue.center_text_on_button();\n // reference\n this.add_reference();\n //this.push_debug_answers()\n // add feedback answers\n var cont = 0;\n var scene = this;\n this.answers.forEach(function (answer) {\n scene.add_url(URL_BASE_Y, cont, answer);\n cont = cont + 1;\n });\n soundWrapper_1.SoundWrapper.fadeBGM(this, 1);\n };\n FeedbackScene.prototype.push_debug_answers = function () {\n this.answers.push({\n url: \"www.google.com\",\n correct: true,\n feedback: \"Es buena\"\n });\n this.answers.push({\n url: \"www.akshdkajhsdkjhaskjdh.com\",\n correct: false,\n feedback: \"NO Es buena\"\n });\n };\n FeedbackScene.prototype.add_url = function (URL_BASE_Y, cont, answer) {\n var URL_PADDING = 45;\n var icon;\n if (answer.correct) {\n icon = 'icon_check';\n }\n else {\n icon = 'icon_times';\n }\n var scene = this;\n // answer background\n var background = scene.add.image(0, 0, \"url_feedback_background\");\n background.alpha = 0.7;\n background.x = scene.game.renderer.width / 2.0;\n background.y = URL_BASE_Y + cont * URL_PADDING + 10;\n // answer icon\n var spIcon = scene.add.image(0, 0, icon);\n spIcon.x = scene.MENU_PADDING * 1.8;\n spIcon.y = URL_BASE_Y + cont * URL_PADDING + background.height / 4.0;\n // answer url\n var urlText = scene.add.text(0, 0, answer.url);\n urlText.setColor('#1d2c47');\n urlText.setFontSize(14);\n urlText.setFontFamily(config_1.Config.FONT_NORMAL);\n urlText.x = spIcon.x + 30;\n urlText.y = URL_BASE_Y + cont * URL_PADDING;\n // answer feedback\n var feedbackText = new bbcodetext_js_1.default(scene, 0, 0, answer.feedback);\n scene.add.existing(feedbackText);\n feedbackText.x = scene.game.renderer.width / 2.0;\n feedbackText.setFontFamily(config_1.Config.FONT_NORMAL);\n feedbackText.setWrapWidth(scene.game.renderer.width - feedbackText.x - scene.MENU_PADDING * 2);\n feedbackText.setColor('#1d2c47');\n feedbackText.setFontSize(14);\n feedbackText.y = urlText.y;\n // if text is wrapped, center it\n if (feedbackText.getWrappedText(feedbackText.text).length > 1) {\n feedbackText.y = urlText.y - urlText.height / 2.0 + urlText.height / 5.0;\n }\n };\n FeedbackScene.prototype.add_reference = function () {\n var reference_background = this.add.image(0, 0, \"feedback_reference_background\");\n reference_background.x = 220;\n reference_background.y = 92;\n reference_background.alpha = 0.7;\n var refText1 = this.add.text(0, 0, \"Elección correcta\");\n refText1.setColor('#1d2c47');\n refText1.setFontSize(11);\n refText1.setFontFamily(config_1.Config.FONT_NORMAL);\n refText1.x = 71;\n refText1.y = 85;\n var refText2 = this.add.text(0, 0, \"Elección incorrecta\");\n refText2.setColor('#1d2c47');\n refText2.setFontSize(11);\n refText2.setFontFamily(config_1.Config.FONT_NORMAL);\n refText2.x = 250;\n refText2.y = 85;\n var icon1 = this.add.image(0, 0, \"icon_check\");\n icon1.x = refText1.x - 18;\n icon1.y = 90 + 2;\n icon1.setScale(0.8, 0.8);\n icon1.alpha = 0.7;\n var icon2 = this.add.image(0, 0, \"icon_times\");\n icon2.x = refText2.x - 18;\n icon2.y = 90 + 2;\n icon2.setScale(0.8, 0.8);\n icon2.alpha = 0.7;\n };\n FeedbackScene.prototype.next_scene = function (scene) {\n var levelManager = levelManager_1.LevelManager.get_instance();\n var nextScene;\n if (levelManager.next_level_exists()) {\n nextScene = 'GameScene';\n levelManager.advance_level();\n }\n else {\n nextScene = 'WinScene';\n }\n // switch scene\n this.switchScene(nextScene);\n };\n FeedbackScene.prototype.setAnswers = function (answerData) {\n this.answers = answerData;\n };\n return FeedbackScene;\n}(baseMenuScene_1.BaseMenuScene));\nexports.FeedbackScene = FeedbackScene;\n\n\n//# sourceURL=webpack:///./src/scenes/feedbackScene.ts?"); /***/ }), /***/ "./src/scenes/gameOverScene.ts": /*!*************************************!*\ !*** ./src/scenes/gameOverScene.ts ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar utils_1 = __webpack_require__(/*! ../utils */ \"./src/utils.ts\");\nvar button_1 = __webpack_require__(/*! ../button */ \"./src/button.ts\");\nvar baseMenuScene_1 = __webpack_require__(/*! ./baseMenuScene */ \"./src/scenes/baseMenuScene.ts\");\nvar GameOverScene = /** @class */ (function (_super) {\n __extends(GameOverScene, _super);\n function GameOverScene() {\n var _this = _super.call(this, {\n key: \"GameOverScene\"\n }) || this;\n _this.TITLE_Y = 40;\n _this.BRIEF_Y = 230;\n _this.DEAD_GUPI_Y = 170;\n _this.DEAD_GUPI_MAX_ANGLE = 10;\n _this.DEAD_GUPI_MAX_DX = 50;\n _this.DEAD_GUPI_MAX_DY = 10;\n return _this;\n }\n GameOverScene.prototype.init = function ( /* params: any */) {\n };\n GameOverScene.prototype.preload = function () {\n _super.prototype.preload.call(this);\n };\n GameOverScene.prototype.create = function () {\n _super.prototype.create.call(this);\n // dead gupi\n this.DEAD_GUPI_BASE_X = this.game.renderer.width / 2.0;\n this.dead_gupi = this.add.sprite(this.DEAD_GUPI_BASE_X, this.DEAD_GUPI_Y, 'guppy_dead');\n // title\n var TITLE_STROKE_COLOR = '#43356b';\n this.title_text = this.add.text(0, 0, '');\n this.title_text.text = \"¡Ups! Gupi ha mordido el anzuelo\";\n this.title_text.setColor(\"#fb78ff\");\n this.title_text.setAlign(\"center\");\n this.title_text.style.setStroke(TITLE_STROKE_COLOR, 7);\n this.title_text.setFontSize(32);\n this.title_text.setFontFamily('\"Baloo Chettan\"');\n this.title_text.y = 100;\n utils_1.Utils.center_x_on_screen(this, this.title_text);\n this.title_text.depth = 1000;\n // brief text\n this.brief_text = this.add.text(0, 0, '');\n this.brief_text.text = \"Vuelve a intentarlo, con la práctica aprenderás a distinguir todas las URLs sospechosas\";\n this.brief_text.setColor(\"#43356b\");\n this.brief_text.setAlign(\"center\");\n this.brief_text.style.setStroke('#fff', 2);\n this.brief_text.setFontSize(24);\n this.brief_text.setFontFamily('\"Baloo Chettan\"');\n this.brief_text.setWordWrapWidth(400);\n this.brief_text.setLineSpacing(10);\n utils_1.Utils.center_x_on_screen(this, this.brief_text);\n this.brief_text.depth = 1000;\n // continue button\n this.button_continue = new button_1.Button(this, this.game.renderer.width / 2.0, 0, this.next_scene.bind(this));\n this.button_continue.add_text(\"Volver a jugar\");\n this.button_continue.y = this.game.renderer.height - this.MENU_PADDING - this.button_continue.height / 2.0;\n this.button_continue.center_text_on_button();\n };\n GameOverScene.prototype.update = function (time, delta) {\n _super.prototype.update.call(this, time, delta);\n this.title_text.y = this.TITLE_Y + Math.sin(time / 2000) * 10;\n this.brief_text.y = this.BRIEF_Y + Math.sin((time + 1500) / 2000) * 10;\n this.dead_gupi.angle = Math.sin((time) / 2000) * this.DEAD_GUPI_MAX_ANGLE;\n this.dead_gupi.x = this.DEAD_GUPI_BASE_X + Math.sin((time) / 3000) * this.DEAD_GUPI_MAX_DX;\n this.dead_gupi.y = this.DEAD_GUPI_Y + Math.sin((time) / 2500) * this.DEAD_GUPI_MAX_DY;\n };\n GameOverScene.prototype.next_scene = function (scene) {\n this.switchScene('MenuScene');\n };\n return GameOverScene;\n}(baseMenuScene_1.BaseMenuScene));\nexports.GameOverScene = GameOverScene;\n\n\n//# sourceURL=webpack:///./src/scenes/gameOverScene.ts?"); /***/ }), /***/ "./src/scenes/gameScene.ts": /*!*********************************!*\ !*** ./src/scenes/gameScene.ts ***! \*********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar jellyFish_1 = __webpack_require__(/*! ../jellyFish */ \"./src/jellyFish.ts\");\nvar guppy_1 = __webpack_require__(/*! ../guppy */ \"./src/guppy.ts\");\nvar spriteGauge_1 = __webpack_require__(/*! ../spriteGauge */ \"./src/spriteGauge.ts\");\nvar effects_1 = __webpack_require__(/*! ../effects */ \"./src/effects.ts\");\nvar oldFish_1 = __webpack_require__(/*! ../oldFish */ \"./src/oldFish.ts\");\nvar questionButton_1 = __webpack_require__(/*! ../questionButton */ \"./src/questionButton.ts\");\nvar levelManager_1 = __webpack_require__(/*! ../levelManager */ \"./src/levelManager.ts\");\nvar utils_1 = __webpack_require__(/*! ../utils */ \"./src/utils.ts\");\nvar waterDistortShader_1 = __webpack_require__(/*! ../waterDistortShader */ \"./src/waterDistortShader.ts\");\nvar config_1 = __webpack_require__(/*! ../config */ \"./src/config.ts\");\nvar soundWrapper_1 = __webpack_require__(/*! ../utils/soundWrapper */ \"./src/utils/soundWrapper.ts\");\nvar SceneStatus;\n(function (SceneStatus) {\n SceneStatus[SceneStatus[\"FADING_IN\"] = 0] = \"FADING_IN\";\n SceneStatus[SceneStatus[\"IN_GAME\"] = 1] = \"IN_GAME\";\n SceneStatus[SceneStatus[\"FADING_OUT\"] = 2] = \"FADING_OUT\";\n})(SceneStatus || (SceneStatus = {}));\nvar GameScene = /** @class */ (function (_super) {\n __extends(GameScene, _super);\n function GameScene() {\n var _this = _super.call(this, {\n key: \"GameScene\"\n }) || this;\n _this.distort_time = 0;\n return _this;\n }\n GameScene.prototype.init = function ( /*params: any*/) {\n };\n GameScene.prototype.preload = function () {\n };\n GameScene.prototype.create = function () {\n // fade-in\n utils_1.Utils.fade_scene_in(this);\n // scene variables initialization\n this.scene_status = SceneStatus.IN_GAME;\n // create and position background\n this.background = this.add.image(this.game.scale.width / 2.0, this.game.scale.height / 2.0, \"background\");\n this.background.setPipeline('distort');\n this.background.setScale(1.2, 1.2);\n this.background.y -= 23;\n // create guppy\n this.guppy = new guppy_1.Guppy(this, this.game.scale.width / 2.0, this.game.scale.height / 2.0);\n // life gauge\n this.lifeGauge = new spriteGauge_1.SpriteGauge(this, 20, 20, \"guppy_small\", levelManager_1.LevelManager.get_instance().get_lives_count());\n // old fish\n this.oldFish = new oldFish_1.OldFish(this);\n this.questionButton = new questionButton_1.QuestionButton(this, this.oldFish);\n // mouse events\n var scene = this;\n this.scene.scene.input.on('pointerdown', function (pointer) {\n scene.guppy.move_fish(pointer.x, pointer.y);\n });\n // create jellyfish group\n this.jellyfishes = this.add.group();\n this.load_level();\n // load effects\n this.effects = new effects_1.Effects(this);\n //this.scale.startFullscreen()\n this.create_round_number_text();\n // depth sort\n this.guppy.depth = 100;\n console.log(\"Fading music\");\n soundWrapper_1.SoundWrapper.fadeBGM(this, 0.5, 3000);\n };\n GameScene.prototype.create_round_number_text = function () {\n // round text\n var levelManager = levelManager_1.LevelManager.get_instance();\n var roundText = this.add.text(0, 0, \"Ronda \" + levelManager.get_current_level_num());\n roundText.setFontFamily(config_1.Config.FONT_DISPLAY);\n roundText.setFontSize(72);\n roundText.x = this.game.renderer.width / 2.0;\n roundText.y = this.game.renderer.height / 2.0;\n roundText.setOrigin(0.5, 0.5);\n roundText.setColor('#fff');\n roundText.depth = 20;\n roundText.style.setStroke('#1d2c47', 10);\n var scene = this;\n this.tweens.add({\n targets: roundText,\n y: 0,\n ease: Phaser.Math.Easing.Quadratic.Out,\n duration: 5000,\n onComplete: function () {\n roundText.alpha = 1;\n roundText.y = 20;\n roundText.setFontSize(24);\n roundText.style.setStroke('#1d2c47', 4);\n roundText.x = scene.game.renderer.width - roundText.width / 2 - 20;\n roundText.setScale(0, 0);\n scene.tweens.add({\n targets: roundText,\n scaleX: 1,\n scaleY: 1,\n ease: Phaser.Math.Easing.Quadratic.Out,\n duration: 300,\n delay: 0\n });\n }\n });\n this.tweens.add({\n targets: roundText,\n alpha: 0,\n ease: Phaser.Math.Easing.Quadratic.In,\n duration: 2000,\n delay: 1000\n });\n this.keyObj = this.input.keyboard.addKey('W');\n };\n GameScene.prototype.update = function (time, delta) {\n _super.prototype.update.call(this, time, delta);\n waterDistortShader_1.WaterDistortShader.get_instance().update(delta);\n this.jellyfishes.children.iterate(function (child) {\n var j = child;\n j.show_hover_effect(false);\n });\n /*if(this.keyObj.isDown){\n this.scene.start(\"GameScene\")\n }*/\n if (!this.physics.overlap(this.guppy, this.jellyfishes, this.onGuppyJellyfish, null, this)) {\n //this.messageBox.hide()\n this.questionButton.come_out();\n this.jellyfishes.children.iterate(function (child) {\n var j = child;\n j.set_hover(false);\n });\n }\n if (this.guppy.is_dead() && this.lifeGauge.getCount() > 0) {\n this.guppy.revive();\n }\n if (this.check_advance_to_next_scene() || this.check_game_over()) {\n this.advance_to_next_scene();\n }\n };\n // collision callback, we need it to individualice the jelly\n GameScene.prototype.onGuppyJellyfish = function (guppy, j) {\n //this.messageBox.show(j)\n this.questionButton.come_in(j);\n j.set_hover(true);\n j.show_hover_effect(true);\n };\n GameScene.prototype.getGuppy = function () {\n return this.guppy;\n };\n GameScene.prototype.load_level = function () {\n this.answers = [];\n var levelManager = levelManager_1.LevelManager.get_instance();\n levelManager.load_levels_from_json(this.game);\n var urls = levelManager.get_current_level().urls;\n this.create_jellyfishes(urls);\n };\n /*\n * Iterate over URL array and create jellifishes\n */\n GameScene.prototype.create_jellyfishes = function (urls) {\n this.jellyfishes.clear(true);\n for (var i = 0; i < urls.length; i++) {\n var newPos = this.find_new_jelly_position();\n var jelly = new jellyFish_1.JellyFish(newPos.x, newPos.y, this, urls[i]);\n jelly.observable.subscribe(this);\n this.jellyfishes.add(jelly, true);\n }\n };\n /*\n * Return new position for to be created jelly so there are no\n * two jellies relatively near\n */\n GameScene.prototype.find_new_jelly_position = function () {\n var padding = 100; // how far new pos should be away from borders \n var newPosValid = false; // flag to know if we have found new pos\n var newPos = { x: 0, y: 0 }; // new position coordinates\n var tries = 0; // amount of tries to find a new valid position\n var min_distance = 200; // initial min distance between two jellies\n while (!newPosValid) {\n newPosValid = true;\n newPos.x = Phaser.Math.Between(padding, this.game.renderer.width - padding);\n newPos.y = Phaser.Math.Between(padding, this.game.renderer.height - padding * 2);\n tries = tries + 1;\n if (Phaser.Math.Distance.Between(newPos.x, newPos.y, this.game.renderer.width / 2.0, this.game.renderer.height / 2.0) < min_distance) {\n newPosValid = false;\n continue;\n }\n for (var i = 0; i < this.jellyfishes.getChildren().length; i++) {\n var j = this.jellyfishes.getChildren()[i];\n var p = { x: j.x, y: j.y };\n if (Phaser.Math.Distance.Between(newPos.x, newPos.y, p.x, p.y) < min_distance) {\n newPosValid = false;\n break;\n }\n }\n // if can't find a valid position after 10 tries\n // reduce valid min-distance (and try again)\n if (tries >= 10) {\n min_distance = min_distance * 0.9;\n tries = 0;\n }\n }\n console.log(\"Found new\");\n return newPos;\n };\n GameScene.prototype.answer = function (j, userAnswer) {\n var old_fish_message = '';\n if (userAnswer == \"incorrect\") {\n this.lifeGauge.consume();\n levelManager_1.LevelManager.get_instance().decrease_life();\n this.guppy.animate_death();\n old_fish_message = j.getURLData().fail_msg;\n this.effects.showDeadCloudEffect(this.guppy);\n }\n else {\n this.guppy.animate_eat(null, this);\n old_fish_message = j.getURLData().congrat_msg;\n this.effects.showEatCloudEffect(this.guppy);\n soundWrapper_1.SoundWrapper.playBiteSound(this);\n }\n this.answers.push({\n url: j.getURLData().url,\n correct: userAnswer == \"correct\",\n feedback: j.getURLData().feedback\n });\n j.destroy();\n this.oldFish.talk(old_fish_message);\n };\n GameScene.prototype.on_notify = function (message) {\n // TODO: cant use this because we doesnt have the jelly\n };\n GameScene.prototype.call_help = function (j) {\n this.oldFish.talk(j.getURLData().teachable);\n };\n GameScene.prototype.onGuppyDeadFinish = function () {\n if (this.lifeGauge.getCount() > 0) {\n this.guppy.revive();\n }\n };\n GameScene.prototype.check_advance_to_next_scene = function () {\n return this.oldFish.is_hidden() &&\n this.lifeGauge.getCount() > 0 &&\n this.jellyfishes.countActive() <= 0 &&\n !this.effects.isAnyEffectRunning() &&\n !this.guppy.is_animating_dead();\n };\n GameScene.prototype.check_game_over = function () {\n return this.oldFish.is_hidden() &&\n this.lifeGauge.getCount() == 0 &&\n this.guppy.is_dead() &&\n !this.effects.isAnyEffectRunning() &&\n !this.guppy.is_animating_dead();\n };\n GameScene.prototype.advance_to_next_scene = function () {\n console.log(\"Advance to nex scene\");\n if (this.scene_status != SceneStatus.IN_GAME)\n return;\n this.scene_status = SceneStatus.FADING_OUT;\n var nextScene = this.lifeGauge.getCount() > 0 ? 'FeedbackScene' : 'GameOverScene';\n var feedbackScene = this.scene.get('FeedbackScene');\n feedbackScene.setAnswers(this.answers);\n utils_1.Utils.scene_transition(this, nextScene);\n };\n return GameScene;\n}(Phaser.Scene));\nexports.GameScene = GameScene;\n\n\n//# sourceURL=webpack:///./src/scenes/gameScene.ts?"); /***/ }), /***/ "./src/scenes/menuScene.ts": /*!*********************************!*\ !*** ./src/scenes/menuScene.ts ***! \*********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar utils_1 = __webpack_require__(/*! ../utils */ \"./src/utils.ts\");\nvar button_1 = __webpack_require__(/*! ../button */ \"./src/button.ts\");\nvar baseMenuScene_1 = __webpack_require__(/*! ./baseMenuScene */ \"./src/scenes/baseMenuScene.ts\");\nvar bubble_1 = __webpack_require__(/*! ../bubble */ \"./src/bubble.ts\");\nvar guppy_1 = __webpack_require__(/*! ../guppy */ \"./src/guppy.ts\");\nvar jellyFish_1 = __webpack_require__(/*! ../jellyFish */ \"./src/jellyFish.ts\");\nvar levelManager_1 = __webpack_require__(/*! ../levelManager */ \"./src/levelManager.ts\");\nvar soundWrapper_1 = __webpack_require__(/*! ../utils/soundWrapper */ \"./src/utils/soundWrapper.ts\");\nvar version_1 = __webpack_require__(/*! ../version */ \"./src/version.ts\");\nvar MenuScene = /** @class */ (function (_super) {\n __extends(MenuScene, _super);\n function MenuScene() {\n var _this = _super.call(this, {\n key: \"MenuScene\"\n }) || this;\n _this.guppy_anim_enter_left = false;\n return _this;\n }\n MenuScene.prototype.init = function ( /* params: any */) {\n _super.prototype.init.call(this);\n };\n MenuScene.prototype.preload = function () {\n _super.prototype.preload.call(this);\n };\n MenuScene.prototype.create = function () {\n console.log(\"create() begin\");\n _super.prototype.create.call(this);\n soundWrapper_1.SoundWrapper.playBGM(this, \"bgm\");\n var levelManager = levelManager_1.LevelManager.get_instance();\n levelManager.reset();\n this.create_bubbles();\n // version text\n this.version_text = this.add.text(0, 0, version_1.Version.version);\n this.version_text.setFontSize(14);\n this.version_text.visible = false;\n var TITLE_COLOR = '#c28dff';\n var TITLE_STROKE_COLOR = '#43356b';\n // title\n this.title_text = this.add.text(0, 0, '');\n this.title_text.text = \"Las aventuras de Gupi\";\n this.title_text.setColor(\"#ffc32f\");\n this.title_text.setAlign(\"center\");\n this.title_text.style.setStroke(TITLE_STROKE_COLOR, 10);\n this.title_text.setFontSize(56);\n this.title_text.setFontFamily('\"Baloo Chettan\"');\n this.title_text.y = 100;\n utils_1.Utils.center_x_on_screen(this, this.title_text);\n this.title_text.depth = 1000;\n // clicking 10 times in the title shows commit number\n this.title_text.setInteractive();\n var scene = this;\n var clickCount = 0;\n this.title_text.on(\"pointerdown\", function () {\n clickCount = clickCount + 1;\n if (clickCount == 10) {\n scene.version_text.visible = true;\n }\n });\n // subtitle\n this.subtitle_text = this.add.text(0, 0, '');\n this.subtitle_text.text = \"Evitando morder el anzuelo\";\n this.subtitle_text.setColor('#fb78ff');\n this.subtitle_text.setAlign(\"center\");\n this.subtitle_text.style.setStroke(TITLE_STROKE_COLOR, 7);\n this.subtitle_text.setFontSize(32);\n this.subtitle_text.setFontFamily('\"Baloo Chettan\"');\n this.subtitle_text.y = 110;\n utils_1.Utils.center_x_on_screen(this, this.subtitle_text);\n this.subtitle_text.depth = 1000;\n // continue button\n this.button_continue = new button_1.Button(this, this.game.renderer.width / 2.0, 0, this.next_scene.bind(this));\n this.button_continue.add_text(\"Comenzar\");\n this.button_continue.y = this.game.renderer.height - this.MENU_PADDING - this.button_continue.height / 2.0;\n this.button_continue.center_text_on_button();\n this.guppy = new guppy_1.Guppy(this, this.game.scale.width / 2.0, this.game.scale.height / 2.0);\n this.jelly = new jellyFish_1.JellyFish(0, 0, this, {\n url: '',\n safe: false,\n congrat_msg: '',\n fail_msg: '',\n teachable: '',\n feedback: ''\n });\n this.add.existing(this.jelly);\n this.predator = this.add.sprite(0, 0, \"predator\");\n this.guppy.set_demo();\n this.jelly.set_demo();\n // initial actors position\n this.position_fish(this.guppy_anim_enter_left);\n this.position_jellyfish(this.guppy_anim_enter_left);\n this.predator.x = -100;\n this.predator.y = this.game.renderer.height / 2.0;\n setTimeout(function () {\n scene.trigger_animation();\n }, 2000);\n console.log(\"create() end\");\n };\n MenuScene.prototype.trigger_animation = function () {\n var anim_num = Phaser.Math.Between(1, 3);\n anim_num = 1;\n if (anim_num == 1) {\n this.animation_1();\n }\n else if (anim_num == 2) {\n this.animation_2();\n }\n else {\n this.animation_3();\n }\n };\n MenuScene.prototype.create_bubbles = function () {\n // create bubble\n for (var i = 0; i < 5; i++) {\n new bubble_1.Bubble(this);\n }\n };\n MenuScene.prototype.update = function (elapsed, delta) {\n _super.prototype.update.call(this, elapsed, delta);\n this.title_text.y = this.MENU_PADDING + Math.sin(elapsed / 2000) * 20;\n this.subtitle_text.y = 80 + this.MENU_PADDING + Math.sin((elapsed + 1500) / 2000) * 20;\n };\n MenuScene.prototype.next_scene = function (scene) {\n this.switchScene('GameScene');\n };\n MenuScene.prototype.animation_1 = function () {\n this.position_fish(this.guppy_anim_enter_left);\n this.position_jellyfish(this.guppy_anim_enter_left);\n var guppy = this.guppy;\n var jelly = this.jelly;\n var scene = this;\n guppy.set_demo();\n jelly.set_demo();\n var enter_from_left = this.guppy_anim_enter_left;\n guppy.flipX = !enter_from_left;\n guppy.y = Phaser.Math.FloatBetween(0, this.game.renderer.height);\n this.tweens.timeline({\n ease: 'Linear',\n loop: 0,\n duration: 1000,\n tweens: [\n {\n targets: this.jelly,\n y: this.game.renderer.height / 2.0,\n duration: 4000,\n onComplete: function () {\n jelly.set_demo(false);\n }\n },\n {\n targets: this.guppy,\n x: this.get_semi_middle_position(!this.guppy_anim_enter_left),\n y: this.game.renderer.height / 2.0,\n duration: 3000,\n offset: '-=1000',\n onComplete: function () {\n guppy.set_demo(false);\n }\n },\n {\n targets: this.guppy,\n x: this.get_side_position(!this.guppy_anim_enter_left),\n y: Phaser.Math.FloatBetween(0, this.game.renderer.height),\n duration: 3000,\n offset: '+=5000',\n onStart: function () {\n guppy.set_demo();\n guppy.flipX = !enter_from_left;\n }\n },\n {\n targets: this.jelly,\n y: -100,\n duration: 3000,\n offset: '-=2000',\n onStart: function () {\n jelly.set_demo();\n },\n onComplete: function () {\n scene.new_animation_timeout();\n }\n },\n ]\n });\n this.guppy_anim_enter_left = !this.guppy_anim_enter_left;\n };\n MenuScene.prototype.animation_2 = function () {\n var guppy = this.guppy;\n var enter_from_left = this.guppy_anim_enter_left;\n var predator = this.predator;\n var scene = this;\n guppy.set_demo();\n guppy.x = this.get_side_position(enter_from_left);\n this.guppy.y = this.game.renderer.height / 2.0;\n guppy.flipX = !enter_from_left;\n predator.x = this.get_side_position(enter_from_left);\n predator.flipX = !enter_from_left;\n this.tweens.timeline({\n ease: 'Linear',\n loop: 0,\n duration: 1000,\n tweens: [\n {\n targets: this.guppy,\n x: this.get_side_position(!this.guppy_anim_enter_left),\n duration: 3000,\n },\n {\n targets: this.predator,\n x: this.get_side_position(!this.guppy_anim_enter_left),\n duration: 2000,\n offset: \"-=1500\",\n onComplete: function () {\n scene.new_animation_timeout();\n }\n },\n ]\n });\n this.guppy_anim_enter_left = !this.guppy_anim_enter_left;\n };\n MenuScene.prototype.animation_3 = function () {\n this.position_fish(this.guppy_anim_enter_left);\n var guppy = this.guppy;\n var jelly = this.jelly;\n var scene = this;\n guppy.set_demo();\n jelly.set_demo();\n var enter_from_left = this.guppy_anim_enter_left;\n guppy.flipX = !enter_from_left;\n this.tweens.timeline({\n ease: 'Linear',\n loop: 0,\n duration: 1000,\n tweens: [\n {\n targets: [this.guppy],\n x: this.game.renderer.width / 2.0,\n y: this.game.renderer.height / 2.0,\n duration: 3000,\n onComplete: function () {\n guppy.set_demo(false);\n }\n },\n {\n targets: this.guppy,\n x: this.get_side_position(!this.guppy_anim_enter_left),\n y: Phaser.Math.FloatBetween(0, this.game.renderer.height),\n duration: 3000,\n offset: '+=5000',\n onStart: function () {\n guppy.set_demo();\n guppy.flipX = !enter_from_left;\n },\n onComplete: function () {\n scene.new_animation_timeout();\n }\n }\n ]\n });\n this.guppy_anim_enter_left = !this.guppy_anim_enter_left;\n };\n MenuScene.prototype.position_fish = function (left) {\n if (left === void 0) { left = true; }\n var x = this.get_side_position(left);\n var y = Phaser.Math.FloatBetween(0, this.game.renderer.height);\n this.guppy.setPosition(x, y);\n };\n MenuScene.prototype.position_jellyfish = function (left) {\n if (left === void 0) { left = true; }\n this.jelly.setPosition(this.get_semi_middle_position(left), this.game.renderer.height + this.jelly.texture.get().height);\n };\n MenuScene.prototype.get_side_position = function (left) {\n if (left === void 0) { left = true; }\n if (left) {\n return -this.guppy.texture.get().width;\n }\n else {\n return this.game.renderer.width + this.guppy.texture.get().width;\n }\n };\n MenuScene.prototype.get_semi_middle_position = function (left) {\n if (left === void 0) { left = true; }\n if (left) {\n return this.game.renderer.width / 2.0 + 30;\n }\n else {\n return this.game.renderer.width / 2.0 - 30;\n }\n };\n MenuScene.prototype.new_animation_timeout = function () {\n var scene = this;\n setTimeout(function () {\n scene.trigger_animation();\n }, 10000);\n };\n return MenuScene;\n}(baseMenuScene_1.BaseMenuScene));\nexports.MenuScene = MenuScene;\n/// TODO:\n/// Jelly zindex\n/// guppy random Y\n\n\n//# sourceURL=webpack:///./src/scenes/menuScene.ts?"); /***/ }), /***/ "./src/scenes/preloadScene.ts": /*!************************************!*\ !*** ./src/scenes/preloadScene.ts ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar PreloadScene = /** @class */ (function (_super) {\n __extends(PreloadScene, _super);\n function PreloadScene() {\n var _this = _super.call(this, {\n key: \"PreloadScene\"\n }) || this;\n _this.PROGRESSBAR_WIDTH = 500;\n _this.PROGRESSBAR_HEIGHT = 15;\n _this.PROGRESSBAR_PADDING = 4;\n _this.PROGRESS_BAR_COLOR = 0x00ffff;\n return _this;\n }\n PreloadScene.prototype.init = function ( /* params: any */) {\n };\n PreloadScene.prototype.preload = function () {\n this.create_progress_bar();\n // bgm\n this.load.audio(\"bgm\", \"assets/bgm/kim_lightyear_voices.ogg\");\n // images \n this.load.image(\"background\", \"assets/images/background.png\");\n this.load.image(\"bubble\", \"assets/images/bubble_white.png\");\n this.load.image(\"bubble_small\", \"assets/images/bubble_small.png\");\n this.load.image(\"button_answer_wrong\", \"assets/images/button_answer_wrong.png\");\n this.load.image(\"button_answer_right\", \"assets/images/button_answer_right.png\");\n this.load.image(\"button_answer_wrong_focus\", \"assets/images/button_answer_wrong_focus.png\");\n this.load.image(\"button_answer_right_focus\", \"assets/images/button_answer_right_focus.png\");\n this.load.image(\"button_normal\", \"assets/images/button_normal.png\");\n this.load.image(\"button_hover\", \"assets/images/button_hover.png\");\n this.load.image(\"button_small_normal\", \"assets/images/button_small_normal.png\");\n this.load.image(\"button_small_hover\", \"assets/images/button_small_hover.png\");\n this.load.image(\"button_small_pushed\", \"assets/images/button_small_pushed.png\");\n this.load.image(\"button_question\", \"assets/images/button_question.png\");\n this.load.image(\"callout_eat\", \"assets/images/callout_eat.png\");\n this.load.image(\"cloud\", \"assets/images/id_iayaw.png\");\n this.load.image(\"dialog_balloon\", \"assets/images/dialog_balloon.png\");\n this.load.image(\"feedback_reference_background\", \"assets/images/feedback_reference_background.png\");\n this.load.image(\"guppy\", \"assets/images/guppy_medium_normal.png\");\n this.load.image(\"guppy_dead\", \"assets/images/guppy_medium_dead.png\");\n this.load.image(\"guppy_dead_hook\", \"assets/images/guppy_dead_hook.png\");\n this.load.image(\"guppy_small\", \"assets/images/guppy_small_normal.png\");\n this.load.image(\"icon_check\", \"assets/images/icon_check.png\");\n this.load.image(\"icon_times\", \"assets/images/icon_times.png\");\n this.load.image(\"predator\", \"assets/images/predator_normal.png\");\n this.load.image(\"url_feedback_background\", \"assets/images/url_feedback_background.png\");\n this.load.image(\"voodoo_cactus_underwater\", \"assets/images/voodoo_cactus_underwater.jpg\");\n this.load.image(\"message_box_horizontal\", \"assets/images/message_box_horizontal.png\");\n this.load.image(\"message_box_vertical\", \"assets/images/message_box_vertical.png\");\n this.load.spritesheet('jelly_spritesheet', 'assets/images/jellyfish_spritesheet.png', { frameWidth: 42, frameHeight: 68 });\n this.load.spritesheet('oldFish_spritesheet', 'assets/images/cartoon_fish_06_blue_idle.png', { frameWidth: 256, frameHeight: 168 });\n this.load.json(\"levels\", \"assets/levels.json\");\n // sounds\n this.load.audio(\"bubble_pop\", \"assets/sounds/pop.ogg\");\n this.load.audio(\"huh\", \"assets/sounds/huh.wav\");\n this.load.audio(\"bubble_01\", \"assets/sounds/bubble_01.ogg\");\n this.load.audio(\"bubble_02\", \"assets/sounds/bubble_02.ogg\");\n this.load.audio(\"bubble_03\", \"assets/sounds/bubble.wav\");\n this.load.audio(\"bubble_04\", \"assets/sounds/bubble2.wav\");\n this.load.audio(\"bubble_05\", \"assets/sounds/bubble3.wav\");\n this.load.audio(\"menu_click\", \"assets/sounds/menu_selection_click.wav\");\n this.load.audio(\"bite1\", \"assets/sounds/bite_small.wav\");\n this.load.audio(\"bite2\", \"assets/sounds/bite_small2.wav\");\n this.load.audio(\"bite3\", \"assets/sounds/bite_small3.wav\");\n this.load.audio(\"swish\", \"assets/sounds/swish_2.wav\");\n this.load.audio(\"cartoon_throw\", \"assets/sounds/cartoon_throw.wav\");\n };\n PreloadScene.prototype.create = function () {\n console.log('Preloading finished...');\n if (this.sys.game.device.os.desktop) {\n console.log(\"desktop\");\n }\n else {\n console.log(\"mobile\");\n this.sys.game.scale.startFullscreen();\n window.addEventListener(\"load\", function () {\n setTimeout(function () {\n // This hides the address bar:\n window.scrollTo(0, 1);\n }, 0);\n });\n }\n this.scene.start('MenuScene');\n };\n PreloadScene.prototype.create_progress_bar = function () {\n var progressBar = this.add.graphics();\n var progressBox = this.add.graphics();\n progressBox.fillStyle(this.PROGRESS_BAR_COLOR, 0.3);\n var progressBarX = (this.game.renderer.width - this.PROGRESSBAR_WIDTH) / 2.0;\n var progressBarY = (this.game.renderer.height - this.PROGRESSBAR_HEIGHT) / 2.0;\n progressBox.fillRect(progressBarX, progressBarY, this.PROGRESSBAR_WIDTH, this.PROGRESSBAR_HEIGHT);\n var scene = this;\n this.load.on('progress', function (value) {\n progressBar.clear();\n progressBar.fillStyle(scene.PROGRESS_BAR_COLOR, 1);\n progressBar.fillRect(progressBarX + scene.PROGRESSBAR_PADDING, progressBarY + scene.PROGRESSBAR_PADDING, (scene.PROGRESSBAR_WIDTH - scene.PROGRESSBAR_PADDING * 2) * value, scene.PROGRESSBAR_HEIGHT - (scene.PROGRESSBAR_PADDING * 2));\n });\n };\n return PreloadScene;\n}(Phaser.Scene));\nexports.PreloadScene = PreloadScene;\n\n\n//# sourceURL=webpack:///./src/scenes/preloadScene.ts?"); /***/ }), /***/ "./src/scenes/winScene.ts": /*!********************************!*\ !*** ./src/scenes/winScene.ts ***! \********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar utils_1 = __webpack_require__(/*! ../utils */ \"./src/utils.ts\");\nvar button_1 = __webpack_require__(/*! ../button */ \"./src/button.ts\");\nvar baseMenuScene_1 = __webpack_require__(/*! ./baseMenuScene */ \"./src/scenes/baseMenuScene.ts\");\nvar guppy_1 = __webpack_require__(/*! ../guppy */ \"./src/guppy.ts\");\nvar WinScene = /** @class */ (function (_super) {\n __extends(WinScene, _super);\n function WinScene() {\n var _this = _super.call(this, {\n key: \"WinScene\"\n }) || this;\n _this.BRIEF_Y = 230;\n _this.GUPI_Y = 170;\n return _this;\n }\n WinScene.prototype.init = function ( /* params: any */) {\n };\n WinScene.prototype.preload = function () {\n };\n WinScene.prototype.create = function () {\n _super.prototype.create.call(this);\n // fade-in\n utils_1.Utils.fade_scene_in(this);\n // background \n this.add.image(this.game.renderer.width / 2, this.game.renderer.height / 2, \"voodoo_cactus_underwater\").setScale(0.4, 0.4);\n // title\n var TITLE_STROKE_COLOR = '#43356b';\n this.title_text = this.add.text(0, 0, '');\n this.title_text.text = \"¡Felicitaciones!\";\n this.title_text.setColor(\"#ffc32f\");\n this.title_text.setAlign(\"center\");\n this.title_text.style.setStroke(TITLE_STROKE_COLOR, 10);\n this.title_text.setFontSize(56);\n this.title_text.setFontFamily('\"Baloo Chettan\"');\n this.title_text.y = 100;\n utils_1.Utils.center_x_on_screen(this, this.title_text);\n this.title_text.depth = 1000;\n // create guppy\n this.guppy = new guppy_1.Guppy(this, this.game.scale.width / 2.0, this.GUPI_Y);\n // brief text\n this.brief_text = this.add.text(0, 0, '');\n this.brief_text.text = \"Gracias a tí Gupi ha aprendido a distinguir URLs sospechosas y evitar morder el anzuelo\";\n this.brief_text.setColor(\"#43356b\");\n this.brief_text.setAlign(\"center\");\n this.brief_text.style.setStroke('#fff', 2);\n this.brief_text.setFontSize(24);\n this.brief_text.setFontFamily('\"Baloo Chettan\"');\n this.brief_text.setWordWrapWidth(400);\n this.brief_text.setLineSpacing(10);\n utils_1.Utils.center_x_on_screen(this, this.brief_text);\n this.brief_text.depth = 1000;\n // continue button\n this.button_continue = new button_1.Button(this, this.game.renderer.width / 2.0, 0, this.next_scene.bind(this));\n //this.button_continue.create_text_button(\"Continuar\")\n this.button_continue.add_text(\"Volver a jugar\");\n this.button_continue.y = this.game.renderer.height - this.MENU_PADDING - this.button_continue.height / 2.0;\n this.button_continue.center_text_on_button();\n this.add.existing(this.button_continue);\n };\n WinScene.prototype.update = function (elapsed, delta) {\n _super.prototype.update.call(this, elapsed, delta);\n this.title_text.y = this.MENU_PADDING + Math.sin(elapsed / 2000) * 20;\n this.brief_text.y = this.BRIEF_Y + Math.sin((elapsed + 1500) / 2000) * 10;\n };\n WinScene.prototype.next_scene = function (scene) {\n this.switchScene('MenuScene');\n };\n return WinScene;\n}(baseMenuScene_1.BaseMenuScene));\nexports.WinScene = WinScene;\n\n\n//# sourceURL=webpack:///./src/scenes/winScene.ts?"); /***/ }), /***/ "./src/spriteGauge.ts": /*!****************************!*\ !*** ./src/spriteGauge.ts ***! \****************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\n/**\n * Horizontal gauge made from sprites (discrete)\n */\nvar SpriteGauge = /** @class */ (function (_super) {\n __extends(SpriteGauge, _super);\n function SpriteGauge(scene, x, y, sprite_key, count, from_left) {\n if (count === void 0) { count = 3; }\n if (from_left === void 0) { from_left = true; }\n var _this = _super.call(this, scene) || this;\n _this.count = count;\n _this.from_left = from_left;\n _this.createMultiple({\n key: sprite_key,\n frameQuantity: count,\n gridAlign: {\n x: x,\n y: y,\n width: 12,\n height: 1,\n cellWidth: 30,\n },\n });\n return _this;\n }\n SpriteGauge.prototype.setCount = function (count) {\n this.count = count;\n var children = this.getChildren();\n for (var i = 0; i < children.length; i++) {\n var child = void 0;\n if (this.from_left) {\n child = children[i];\n }\n else {\n child = children[children.length - i - 1];\n }\n if (i < count) {\n child.setVisible(true);\n }\n else {\n child.setVisible(false);\n }\n }\n };\n SpriteGauge.prototype.getCount = function () {\n return this.count;\n };\n SpriteGauge.prototype.consume = function () {\n this.count = this.count - 1;\n this.setCount(this.count);\n };\n return SpriteGauge;\n}(Phaser.GameObjects.Group));\nexports.SpriteGauge = SpriteGauge;\n\n\n//# sourceURL=webpack:///./src/spriteGauge.ts?"); /***/ }), /***/ "./src/utils.ts": /*!**********************!*\ !*** ./src/utils.ts ***! \**********************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar baseMenuScene_1 = __webpack_require__(/*! ./scenes/baseMenuScene */ \"./src/scenes/baseMenuScene.ts\");\nvar Utils = /** @class */ (function () {\n function Utils() {\n }\n Utils.center_x_on_screen = function (scene, obj) {\n obj.x = (scene.game.renderer.width - obj.width) / 2.0;\n };\n Utils.scene_transition = function (scene, newScene) {\n console.log(\"Changing to: \" + newScene);\n scene.cameras.main.fade(baseMenuScene_1.BaseMenuScene.FADE_OUT_DURATION, 255, 255, 255);\n scene.cameras.main.removeAllListeners('camerafadeoutcomplete');\n scene.cameras.main.on('camerafadeoutcomplete', function () {\n console.log(\"Transition to: \" + newScene + \" complete\");\n scene.scene.start(newScene);\n });\n };\n Utils.fade_scene_in = function (scene) {\n var TRANSITION_DURATION = 800;\n scene.cameras.main.fadeIn(TRANSITION_DURATION, 255, 255, 255);\n };\n return Utils;\n}());\nexports.Utils = Utils;\n\n\n//# sourceURL=webpack:///./src/utils.ts?"); /***/ }), /***/ "./src/utils/animatedString.ts": /*!*************************************!*\ !*** ./src/utils/animatedString.ts ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AnimatedString = /** @class */ (function () {\n function AnimatedString(s) {\n this.DELAY = 50;\n this.next_sound_counter = 0;\n this.onPlaySound = null;\n this.original_string = '';\n this.reset(s);\n }\n AnimatedString.prototype.update = function (time, delta) {\n if (this.status == \"playing\") {\n this.char_elapsed = this.char_elapsed + delta;\n if (this.char_elapsed >= this.DELAY) {\n this.step_string();\n this.char_elapsed -= this.DELAY;\n }\n }\n };\n AnimatedString.prototype.step_string = function () {\n if (this.index < this.original_string.length) {\n this.current_string += this.original_string[this.index];\n }\n else {\n this.status = \"stopped\";\n }\n this.index = this.index + 1;\n while (this.isInsideTagAt(this.current_string, this.index)) {\n this.current_string += this.original_string[this.index];\n this.index = this.index + 1;\n }\n this.next_sound_counter -= 1;\n if (this.next_sound_counter <= 0) {\n if (this.onPlaySound) {\n this.onPlaySound();\n }\n this.next_sound_counter = Phaser.Math.Between(2, 5);\n }\n };\n AnimatedString.prototype.getString = function () {\n return this.current_string;\n };\n AnimatedString.prototype.play = function () {\n this.index = 0;\n this.status = \"playing\";\n };\n AnimatedString.prototype.reset = function (s) {\n if (s != '')\n this.original_string = s;\n this.index = 0;\n this.current_string = '';\n this.char_elapsed = 0;\n this.status = \"paused\";\n };\n AnimatedString.prototype.getStatus = function () {\n return this.status;\n };\n AnimatedString.prototype.isInsideTagAt = function (s, i) {\n var openTags = 0;\n var cont = 0;\n while (cont <= i) {\n if (s[cont] == \"[\") {\n openTags = openTags + 1;\n }\n else if (s[cont] == \"]\") {\n openTags = openTags - 1;\n }\n cont = cont + 1;\n }\n return openTags != 0;\n };\n return AnimatedString;\n}());\nexports.AnimatedString = AnimatedString;\n\n\n//# sourceURL=webpack:///./src/utils/animatedString.ts?"); /***/ }), /***/ "./src/utils/observable.ts": /*!*********************************!*\ !*** ./src/utils/observable.ts ***! \*********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Observable = /** @class */ (function () {\n function Observable() {\n this.subscribers = new Array();\n }\n Observable.prototype.subscribe = function (observer) {\n //we could check to see if it is already subscribed\n this.subscribers.push(observer);\n };\n Observable.prototype.unsubscribe = function (observer) {\n this.subscribers = this.subscribers.filter(function (el) {\n return el !== observer;\n });\n };\n Observable.prototype.publish = function (data) {\n this.subscribers.forEach(function (subscriber) {\n subscriber.on_notify(data);\n });\n };\n return Observable;\n}());\nexports.Observable = Observable;\nvar TypedObservable = /** @class */ (function () {\n function TypedObservable() {\n this.subscribers = new Array();\n }\n TypedObservable.prototype.subscribe = function (observer) {\n //we could check to see if it is already subscribed\n this.subscribers.push(observer);\n };\n TypedObservable.prototype.unsubscribe = function (observer) {\n this.subscribers = this.subscribers.filter(function (el) {\n return el !== observer;\n });\n };\n TypedObservable.prototype.publish = function (message) {\n this.subscribers.forEach(function (subscriber) {\n subscriber.on_notify(message);\n });\n };\n return TypedObservable;\n}());\nexports.TypedObservable = TypedObservable;\n\n\n//# sourceURL=webpack:///./src/utils/observable.ts?"); /***/ }), /***/ "./src/utils/soundWrapper.ts": /*!***********************************!*\ !*** ./src/utils/soundWrapper.ts ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(/*! phaser */ \"./node_modules/phaser/src/phaser.js\");\nvar SoundWrapper = /** @class */ (function () {\n function SoundWrapper() {\n }\n SoundWrapper.playFishSwimSound = function (scene) {\n var sounds = ['bubble_01', 'bubble_02', 'bubble_03', 'bubble_04', 'bubble_05'];\n var sound = sounds[Math.floor(Math.random() * sounds.length)];\n scene.sound.play(sound, {\n volume: 0.8,\n });\n };\n SoundWrapper.playBiteSound = function (scene) {\n var sounds = ['bite1', 'bite2', 'bite3'];\n var sound = sounds[Math.floor(Math.random() * sounds.length)];\n scene.sound.play(sound, {\n volume: 0.8,\n });\n };\n SoundWrapper.playBGM = function (scene, key) {\n if (SoundWrapper.music_is_playing)\n return;\n SoundWrapper.music_is_playing = true;\n SoundWrapper.bgm = scene.sound.add(key);\n SoundWrapper.bgm['volume'] = 0;\n SoundWrapper.bgm.play();\n var tween = scene.tweens.add({\n targets: SoundWrapper.bgm,\n volume: 1,\n delay: 0,\n duration: 2000,\n ease: 'Linear',\n });\n };\n SoundWrapper.fadeBGM = function (scene, newVolume, duration) {\n if (duration === void 0) { duration = 3000; }\n var tween = scene.tweens.add({\n targets: SoundWrapper.bgm,\n volume: newVolume,\n delay: 0,\n duration: duration,\n ease: 'Linear',\n });\n };\n SoundWrapper.playHookedSound = function (scene) {\n scene.sound.play(\"swish\", {\n volume: 1,\n });\n scene.sound.play(\"cartoon_throw\", {\n volume: 0.3,\n delay: 0.5\n });\n };\n SoundWrapper.playTalkSound = function (scene) {\n var tunes = [1000, 500, 0, 500, 1000];\n scene.sound.play(\"huh\", {\n volume: 0.5,\n detune: tunes[Phaser.Math.Between(0, tunes.length)],\n rate: Phaser.Math.FloatBetween(1.5, 2)\n });\n };\n SoundWrapper.music_is_playing = false;\n return SoundWrapper;\n}());\nexports.SoundWrapper = SoundWrapper;\n\n\n//# sourceURL=webpack:///./src/utils/soundWrapper.ts?"); /***/ }), /***/ "./src/version.ts": /*!************************!*\ !*** ./src/version.ts ***! \************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Version = /** @class */ (function () {\n function Version() {\n }\n Version.version = \"89f4da50b2af31d70e3922dd3dbf0e121ccaa067\";\n return Version;\n}());\nexports.Version = Version;\n\n\n//# sourceURL=webpack:///./src/version.ts?"); /***/ }), /***/ "./src/waterDistortShader.ts": /*!***********************************!*\ !*** ./src/waterDistortShader.ts ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar WaterDistortShader = /** @class */ (function () {\n function WaterDistortShader(game) {\n this.time = 0;\n this.game = game;\n this.pipeline = null;\n if (this.isWebGLAvalialble()) {\n this.pipeline = new Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline({\n game: game,\n renderer: game.renderer,\n fragShader: \"\\n precision mediump float;\\n uniform float time;\\n uniform vec2 resolution;\\n uniform sampler2D uMainSampler;\\n varying vec2 outTexCoord;\\n void main(void) {\\n vec2 uv = outTexCoord;\\n //uv.y += (sin((uv.x + (time * 0.5)) * 10.0) * 0.1) + (sin((uv.x + (time * 0.2)) * 32.0) * 0.01);\\n uv.x += 0.004*sin((uv.y * 60000.0 + time)*0.001);\\n vec4 texColor = texture2D(uMainSampler, uv);\\n gl_FragColor = texColor;\\n }\"\n });\n var webGLRenderer = game.renderer;\n webGLRenderer.addPipeline('distort', this.pipeline);\n }\n else {\n this.update = function (e) { };\n }\n WaterDistortShader.instance = this;\n }\n WaterDistortShader.prototype.apply = function (object) {\n object.setPipeline(this.pipeline);\n };\n WaterDistortShader.prototype.update = function (elapsed) {\n this.time += elapsed;\n this.pipeline.setFloat1(\"time\", this.time);\n };\n WaterDistortShader.prototype.isWebGLAvalialble = function () {\n return this.game.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer;\n };\n WaterDistortShader.get_instance = function () {\n return WaterDistortShader.instance;\n };\n return WaterDistortShader;\n}());\nexports.WaterDistortShader = WaterDistortShader;\n\n\n//# sourceURL=webpack:///./src/waterDistortShader.ts?"); /***/ }) /******/ });