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AAW,4CAAyC,CAAC;OACzE;KACF;;;0BACK,aAAa,EAAE;AACnB,UAAI,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE;AACpC,eAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;OACzC,MAAM;AACL,cAAM,IAAI,KAAK,CAAI,aAAa,2CAAwC,CAAC;OAC1E;KACF;;;wBAv9Be;AACd,aAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAA;KAC7B;;;;;;;wBAIS;AACR,aAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;KAC1B;sBACO,KAAK,EAAE;AACb,UAAI,CAAC,QAAQ,CAAC,GAAG,GAAG,KAAK,CAAC;KAC3B;;;wBAEe;AACd,aAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;KAChC;sBACa,KAAK,EAAE;AACnB,UAAI,CAAC,QAAQ,CAAC,SAAS,GAAG,KAAK,CAAC;KACjC;;;wBAEiB;AAChB,aAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;KAClC;sBACe,KAAK,EAAE;AACrB,UAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,KAAK,CAAC;KACnC;;;wBAE6B;AAC5B,aAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;KACjC;sBAC2B,KAAK,EAAE;AACjC,UAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,KAAK,CAAC;KAClC;;;;;;sBAGU,KAAK,EAAE;AAChB,UAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;KAClC;;;;;;;sBAImB,KAAK,EAAE;AACzB,UAAI,CAAC,QAAQ,CAAC,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KACnD;;;SA1vBG,IAAI","file":"core.js","sourcesContent":["\n/*\nHexi\n====\n\nWelcome to Hexi's source code!\nThis file, `core.js` is the glue that holds Hexi together. Most of Hexi's functionality comes\nfrom some external libraries, written for Hexi, that `core.js` instantiates and wires\ntogether. Here are the external libraries that Hexi is currently using:\n\n- [Pixi](https://github.com/pixijs/pixi.js/): The world's fastest 2D WebGL and canvas renderer.\n- [Bump](https://github.com/kittykatattack/bump): A complete suite of 2D collision functions for games.\n- [Tink](https://github.com/kittykatattack/tink): Drag-and-drop, buttons, a universal pointer and other\n helpful interactivity tools.\n- [Charm](https://github.com/kittykatattack/charm): Easy-to-use tweening animation effects for Pixi sprites.\n- [Dust](https://github.com/kittykatattack/dust): Particle effects for creating things like explosions, fire\n and magic.\n- [Sprite Utilities](https://github.com/kittykatattack/spriteUtilities): Easier and more intuitive ways to\n create and use Pixi sprites, as well adding a state machine and animation player\n- [Game Utilities](https://github.com/kittykatattack/gameUtilities): A collection of useful methods for games.\n- [Tile Utilities](https://github.com/kittykatattack/tileUtilities): A collection of useful methods for making tile-based game worlds with [Tiled Editor](http://www.mapeditor.org).\n- [Sound.js](https://github.com/kittykatattack/sound.js): A micro-library for loading, controlling and generating\n sound and music effects. Everything you need to add sound to games.\n- [fullScreen.js](https://github.com/kittykatattack/fullScreen): Adds an easy-to-implement full screen feature.\n- [Smoothie](https://github.com/kittykatattack/smoothie): Ultra-smooth sprite animation using\n true delta-time interpolation. It also lets you specify the fps (frames-per-second) at which\n your game or application runs, and completely separates your sprite rendering loop from your\n application logic loop.\n\nThe job of `core.js` (this file!) is to instantiate Hexi, load the assets, start the game loop, and\ncreate top-level access to most of the properties and methods in the external libraries.\nIt also customizes some of those methods and runs them with some useful side-effects, such as\nautomatically adding sprites to Hexi's `stage`. (Hexi's `stage` is the root Pixi `Container` for the display list.)\n\nI've divided this `core.js` file into \"Chapters\" which describes what each major section of code does.\nYou'll find a \"Table of Contents\" ahead, which is your guide to this file.\nAll this code is fully commented, but if there's something you don't understand, please ask\nin this repository's Issues and we will do our best to help. All this code is in one single file for now, just for the sake of simplicity,\nuntil the total scope of this project stabilizes.\n\nHexi's build system\n-------------------\n\nAll of Hexi's source code is written in JavaScript ES6, transpiled to ES5 using Babel, and minified using Uglify2.\nMake is currently being used as the build\nsystem. So, to build Hexi, make sure you have Node, Babel and Uglify2 installed, and call `make` in the\ncommand line from Hexi's root directory. Make will compile the `core.js` file, concatenate all files (including\nthe modules) and produce the `hexi.min.js` file using Uglify2.\n\nYou can also use Make to build individual sections of Hexi's code base.\nIf you just want to watch and compile the core.js file from ES6 to ES5, run:\n\n make watchSrc\n\nIf you want to concatenate all the modules, run:\n\n make concatModules\n\nIf you want to concatenate all the files, run:\n\n make concatAllFiles\n\nTo watch and compile the example files from ES6 to ES5, run:\n\n make watchExamples\n\nTo watch and compile the tutorial files from ES6 to ES5, run:\n\n make watchTutorials\n\nIf anyone reading this wishes to contribute a simpler, more automated system using Grunt of Gulp,\nwe would welcome the contribution!\n\nTable of Contents\n-----------------\n\nHere's your handy guide to this `core.js` file.\n\n1. Setup and instantiation.\n2. The `Hexi` class constructor.\n3. Hexi's engine: `start`, `load` and `update` methods.\n4. Module interfaces: Hexi's top-level access to the module properties and methods.\n5. Sprite creation methods: `sprite`, `tilingSprite`, `text`, `bitmapText`, `rectangle`, `circle`, `line`, `button`.\n6. Display utilities: `group`, `batch`, `grid`, `makeTiledWorld`, `remove`, `flowRight`, `flowDown`, `flowLeft`, `flowUp`.\n7. Sprite properties: Hexi's custom sprite properties (also known as super-powers!).\n8. Utilities: `scaleToWindow`, `log`, `makeProgressBar`, `loadingBar`, `compensateForStageSize`, `image`, `id`, `json`, `xml`, `sound`\n\n*/\n\n\n//1. SETUP AND INSTANTIATION\n//---------------------------\n\n//IMPORTANT: Make sure to load Pixi and the modules before instantiating Hexi!\n\n//The high level `hexi` function lets you quickly create an instance\n//of Hexi using sensible defaults.\nfunction hexi(width, height, setup, thingsToLoad = undefined, load = undefined) {\n\n //If you need to, you can also instantiate Hexi with a configuration\n //object, which lets you fine-tune the options.\n let hexi = new Hexi({\n\n //Required options:\n width: width, //Width, in pixels\n height: height, //Height, in pixels\n setup: setup, //Function to run when Hexi starts\n\n //Optional options:\n assets: thingsToLoad, //Array of assets that should be loaded\n load: load, //Function to run while Hexi is loading asssets\n /*\n renderer: \"auto\", //\"auto\", \"canvas\" or \"webgl\"\n backgroundColor: 0xCCCCCC, //Hexadecimal color code\n border: \"1px dashed black\", //CSS border string\n scaleToWindow: true, //Boolean\n scaleBorderColor: \"gray\", //Color string\n fps: 30, //The frames per second the logic loop should run at\n\n //An an object of Boolean (true/false) properties that describe which sprite\n //properties should be smoothly animated. These can be any of 5\n //properties: `position`, `rotation`, `size`, `scale` or `alpha`.\n //(Position and rotation are on by default, unless you set Hexi's\n //`interpolate` property to `false`)\n */\n interpolationProperties: {\n position: true,\n rotation: true,\n size: true,\n alpha: true\n },\n interpolate: true,\n\n //To change PIXI's renderer, set the `renderer` option to\n //\"auto\", \"canvas\" or \"webgl\", like this:\n //renderer: \"auto\"\n //Add any other Pixi initialization options you need, depending\n //on which Pixi renderer you're using\n });\n\n return hexi;\n}\n\n//The Hexi main class. It contains all of Hexi's properties and\n//methods, and sets up bindings between Hexi and the module libraries.\n//If you need more find control over Hexi's initialization options,\n//you can create a new instance of the Hexi class directly in your application\n//code. See how it's done in the `hexi` function above for a good example\n//of how to do that.\n\n//2. THE HEXI CLASS CONSTRUCTOR\n//----------------------------\n\nclass Hexi {\n\n /*\n Initialize Hexi's constructor with an options object literal called `o`.\n Here are the required options:\n\n `width`: Value in pixels that describes the canvas's width\n `height`: Value in pixels that describes the canvas's height\n `setup`: A function that should run as soon as Hexi is initialized\n\n Here are the optional options:\n\n `assets`: Array of assets (files) that should be loaded\n `load`: A function that should run while Hexi is loading assets\n `renderer`: The type of renderer to use: \"auto\" (the default), \"canvas\" or \"webgl\"\n `backgroundColor`: Hexadecimal color code that defines the canvas color\n `border`: The canvas border style as a CSS border string, such as \"1px dashed black\"\n `scaleToWindow`: A Boolean that determines whether the canvas should scale to maximum window size.\n `scaleBorderColor`: Color string that defines the color of the border around a scaled canvas.\n `interpolationProperties: An object that defines 5 Boolean properties that determines which sprite properties are interpolated\n (smoothly animated) by Hexi's rendering engine (Smoothie): `position`, `size`, `rotation`, `scale` or `alpha`\n `interpolate`: A Boolean which should be `false` if you *don't* want any sprite animation smoothing.\n `fps`: The frames-per-second the engine's game logic loop should run at (the default is 60).\n `renderFps`: Clamps the fps rendering to the supplied frame rate.\n\n You can also add any of Pixi's initialization options, and those will be applied\n to Pixi's renderer when Hexi creates it.\n\n */\n constructor(o) {\n\n //Initialize all the helper modules.\n //(See Hexi's README.md on information about these libraries)\n this.charm = new Charm(PIXI);\n this.dust = new Dust(PIXI);\n this.bump = new Bump(PIXI);\n this.spriteUtilities = new SpriteUtilities(PIXI);\n this.tileUtilities = new TileUtilities(PIXI);\n this.gameUtilities = new GameUtilities();\n\n //Any modules that have an `update` method that should updated\n //each frame in the game loop should be added to the\n //`modulesToUpdate` array. The game loop will call the `update`\n //method on each of these modules while the game is running.\n //This is very efficient and does not effect performance: no modules are updated unless they\n //contain objects that need updating.\n this.modulesToUpdate = [];\n this.modulesToUpdate.push(this.charm);\n this.modulesToUpdate.push(this.dust);\n this.modulesToUpdate.push(this.spriteUtilities);\n\n //Create the stage and renderer\n //Auto renderer (default)\n if (o.renderer === \"auto\" || o.renderer === undefined) {\n this.renderer = PIXI.autoDetectRenderer(\n o.width,\n o.height,\n o,\n o.noWebGL\n );\n\n //Canvas renderer\n } else if (o.renderer === \"canvas\") {\n this.renderer = new PIXI.CanvasRenderer(\n o.width,\n o.height,\n o\n );\n\n //WebGL renderer\n } else if (o.renderer === \"webgl\") {\n this.renderer = new PIXI.WebGLRenderer(\n o.width,\n o.height,\n o\n );\n }\n\n //Get a reference to the `renderer.view`, which is the\n //HTML canvas element\n this.canvas = this.renderer.view;\n\n //Initialize the Tink interactive module (it needs a reference to the canvas)\n this.tink = new Tink(PIXI, this.canvas);\n this.modulesToUpdate.push(this.tink);\n\n //Create local aliases for the important methods and properties of\n //these libraries, including the most useful Pixi properties.\n //Take a look at Hexi's `createModulePropertyAliases` method in the\n //source code ahead to see how this works\n this.createModulePropertyAliases();\n\n //Add `halfWidth` and `halfHeight` properties to the canvas\n Object.defineProperties.bind(this, this.canvas, {\n \"halfWidth\": {\n get() {\n return this.canvas.width / 2\n },\n enumerable: true,\n configurable: true\n },\n \"halfHeight\": {\n get() {\n return this.canvas.height / 2\n },\n enumerable: true,\n configurable: true\n }\n });\n\n //A Boolean to flag whether the canvas has been scaled\n this.canvas.scaled = false;\n\n //Add the FullScreen module and supply it with the canvas element\n //this.fullScreen = new FullScreen(this.canvas);\n\n //Note: Hexi's `update` function checks whether we're in full screen\n //mode and updates the global scale value accordingly\n\n //Set the canvas's optional background color and border style\n if (o.backgroundColor) {\n this.renderer.backgroundColor = this.color(o.backgroundColor);\n } else {\n this.renderer.backgroundColor = 0xFFFFFF;\n }\n if (o.border) this.canvas.style.border = o.border;\n\n //Add the canvas to the HTML document\n document.body.appendChild(this.canvas);\n\n //Create a container object called the `stage`\n this.stage = new this.Container();\n\n //Add Hexi's special sprite properties to the stage\n this.addProperties(this.stage);\n this.stage._stage = true;\n\n //The game's scale\n if (o.scaleToWindow) {\n this.scaleToWindow(o.scaleBorderColor);\n } else {\n this.scale = 1;\n }\n\n //Make the pointer\n this.pointer = this.makePointer(this.canvas, this.scale);\n\n //Set the game `state`\n this.state = undefined;\n\n //Set the user-defined `load` and `setup` states\n if (o.load !== undefined) this.loadState = o.load;\n\n //The `setup` function is required, so throw an error if it's\n //missing\n if (!o.setup) {\n throw new Error(\n \"Please supply the setup option in the constructor to tell Hexi which function should run first when it starts.\"\n );\n } else {\n this.setupState = o.setup;\n }\n\n //A variable to track the current percentage of loading assets\n this.loadingProgress = 0;\n\n //A variable to track the currently loading asset\n this.loadingFile = \"\";\n\n //Load any assets if they've been provided\n if (o.assets !== undefined) {\n this.assetsToLoad = o.assets;\n }\n\n //Tell Hexi that we're not using a loading progress bar.\n //(This will be set to `true` if the user invokes the `loadingBar`\n //function, which you'll see ahead)\n this._progressBarAdded = false;\n\n //The `soundObjects` object is used to store all sounds\n this.soundObjects = {};\n\n //Create a new instance of Smoothie, which manages Hexi's game\n //loop and adds smooth sprite interpolation\n this.smoothie = new Smoothie({\n engine: PIXI,\n renderer: this.renderer,\n root: this.stage,\n update: this.update.bind(this),\n properties: o.interpolationProperties,\n interpolate: o.interpolate,\n fps: o.fps,\n renderFps: o.renderFps,\n properties: {\n position: true,\n scale: true,\n tile: true\n }\n });\n }\n\n //3. HEXI'S ENGINE: START, LOAD AND SETUP\n //---------------------------------------\n\n //The `start` method must be called by the user after Hexi has been\n //initialized to start the loading process and turn on the engine.\n start() {\n\n //If there are assets to load, load them, and set the game's state\n //to the user-defined `loadState` (which can be supplied by the user in the\n //constructor)\n if (this.assetsToLoad) {\n\n //Call Hexi's `load` method (ahead) to load the assets\n this.load(this.assetsToLoad, this.validateAssets);\n\n //After the assets have been loaded, a method called\n //`validateAssets` will run (see `validateAssets` ahead.)\n //`validateAssets` checks to see what has been loaded and,\n //in the case of sound files, decodes them and creates sound\n //objects.\n\n //If the user has supplied Hexi with a `load` function (in\n //Hexi's constructor), it will be assigned to Hexi's current\n //`state` and, as you'll see ahead, called in a loop while the\n //assets load\n if (this.loadState) this.state = this.loadState;\n } else {\n\n //If there's nothing to load, run the `setup` state, which will\n //just run once\n this.setupState();\n }\n\n //Start the game loop\n this.smoothie.start();\n }\n\n //Use the `load` method to load any files into Hexi. Pass it a\n //callback function as the second argument to launch a function that\n //should run when all the assets have finished loading. Hexi's\n //default callback function is `validateAssets`, which you'll find\n //in the code ahead\n load(assetsToLoad, callbackFunction = undefined) {\n\n //Handle special file types that Pixi's loader doesn't understand\n //The `findAssets` function will return an array to get an array just\n //containing those file source paths you're interested in\n let findAssets = fileExtensionArray => {\n let fileSourcePaths = assetsToLoad.filter(source => {\n\n //Find the file extension of the asset\n let extension = source.split(\".\").pop();\n if (fileExtensionArray.indexOf(extension) !== -1) {\n return true;\n }\n });\n\n return fileSourcePaths;\n };\n\n /* Load fonts */\n\n //First, define the file extensions for the special file types\n //you're interested in\n //Fonts\n let fontExtensions = [\"ttf\", \"otf\", \"ttc\", \"woff\"];\n\n //Get the font source paths\n let fontFiles = findAssets(fontExtensions);\n\n //If there are any font files, load them into the browser using an\n //old trick that forces the browser to load them\n if (fontFiles.length > 0) {\n this.spanElements = [];\n fontFiles.forEach(source => {\n\n //Loads the font files by writing CSS code to the HTML document head.\n //Use the font's filename as the `fontFamily` name. This code captures\n //the font file's name without the extension or file path\n let fontFamily = source.split(\"/\").pop().split(\".\")[0];\n\n //Push the font family name into Hexi's `fontFamilies` array\n if (this.fontFamilies) this.fontFamilies.push(fontFamily);\n\n //Append an `@afont-face` style rule to the head of the HTML document\n let newStyle = document.createElement(\"style\");\n let fontFace = \"@font-face {font-family: '\" + fontFamily + \"'; src: url('\" + source + \"');}\";\n newStyle.appendChild(document.createTextNode(fontFace));\n document.head.appendChild(newStyle);\n\n //Trick the browser into loading the font file by\n //displaying an invisible element\n let span = document.createElement(\"span\");\n span.style.fontFamily = fontFamily;\n document.body.appendChild(span);\n span.innerHTML = \"?\";\n span.style.display = \"block\";\n span.style.opacity = \"0\";\n this.spanElements.push(span);\n });\n }\n\n /* Load sound */\n\n //Set default loading mechanism for sound file extensions to use XHR\n let Resource = PIXI.loaders.Resource;\n Resource.setExtensionLoadType(\"wav\", Resource.LOAD_TYPE.XHR);\n Resource.setExtensionLoadType(\"mp3\", Resource.LOAD_TYPE.XHR);\n Resource.setExtensionLoadType(\"ogg\", Resource.LOAD_TYPE.XHR);\n Resource.setExtensionLoadType(\"webm\", Resource.LOAD_TYPE.XHR);\n\n //Set default loading type for sound file extensions to be arraybuffer\n Resource.setExtensionXhrType(\"wav\", Resource.XHR_RESPONSE_TYPE.BUFFER);\n Resource.setExtensionXhrType(\"mp3\", Resource.XHR_RESPONSE_TYPE.BUFFER);\n Resource.setExtensionXhrType(\"ogg\", Resource.XHR_RESPONSE_TYPE.BUFFER);\n Resource.setExtensionXhrType(\"webm\", Resource.XHR_RESPONSE_TYPE.BUFFER);\n\n /* Load ordinary assets */\n\n let loadProgressHandler = (loader, resource) => {\n\n //Display the file `url` currently being loaded\n this.loadingFile = resource.url;\n\n //Display the percentage of files currently loaded\n this.loadingProgress = loader.progress;\n };\n\n //Load the files and call the `loadProgressHandler` while they're\n //loading\n this.loader.reset();\n this.loadingProgress = 0;\n this.loadingFile = \"\";\n this.loader\n .add(assetsToLoad)\n .on(\"progress\", loadProgressHandler)\n .load(callbackFunction.bind(this));\n }\n\n //The `validateAssets` method runs when all the assets have finished\n //loading. It checks to see if there are any sounds files and, if\n //there are, decodes them and turns them into sound objects using the\n //`sounds.js` module's `makeSound` function. If there are no sounds\n //to load, the loading state is finished and the setup state is run.\n //But, if there are sounds to load, the setup state will only run\n //after the sounds have been decoded.\n validateAssets() {\n console.log(\"All assets loaded\");\n\n //The `finishLoadingState` method will be called if everything has\n //finished loading and any possible sounds have been decoded\n let finishLoadingState = () => {\n\n //Reset the `assetsToLoad` array\n this.assetsToLoad = [];\n\n //Clear the `loadState`\n this.loadState = undefined;\n\n //Clear the game `state` function for now to stop the loop.\n this.state = undefined;\n\n //Remove the loading progress bar if the user invoked the `loadingBar`\n //function\n if (this._progressBarAdded) {\n this.progressBar.remove();\n }\n\n //If any fonts were tricked into loading\n //make the tags that use them invisible\n if (this.spanElements) {\n this.spanElements.forEach(element => {\n element.style.display = \"none\";\n });\n }\n\n //Call the `setup` state\n this.setupState();\n };\n\n //We need to check if any possible sound file have been loaded\n //because, if there have, they need to fist be decoded before we\n //can launch the `setup` state.\n\n //Variables to count the number of sound files and the sound files\n //that have been decoded. If both these numbers are the same at\n //some point, then we know all the sounds have been decoded and we\n //can call the `finishLoadingState` function\n let soundsToDecode = 0,\n soundsDecoded = 0;\n\n //First, create a list of the kind of sound files we want to check\n let soundExtensions = [\"wav\", \"mp3\", \"ogg\", \"webm\"];\n\n //The `decodeHandler` will run when each sound file is decoded\n let decodeHandler = () => {\n\n //Count 1 more sound as having been decoded\n soundsDecoded += 1;\n\n //If the decoded sounds match the number of sounds to decode,\n //then we know all the sounds have been decoded and we can call\n //`finishLoadingState`\n if (soundsToDecode === soundsDecoded) {\n finishLoadingState();\n }\n };\n\n //Loop through all the loader's resources and look for sound files\n Object.keys(this.loader.resources).forEach(resource => {\n\n //Find the file extension of the asset\n let extension = resource.split(\".\").pop();\n\n //If one of the resource file extensions matches the sound file\n //extensions, then we know we have a sound file\n if (soundExtensions.indexOf(extension) !== -1) {\n\n //Count one more sound to load\n soundsToDecode += 1;\n\n //Create aliases for the sound's `xhr` object and `url` (its\n //file name)\n let xhr = this.loader.resources[resource].xhr,\n url = this.loader.resources[resource].url;\n\n //Create a sound sprite using the `sound.js` module's\n //`makeSound` function. Notice the 4th argument is the loaded\n //sound's `xhr` object. Setting the 3rd argument to `false`\n //means that `makeSound` won't attempt to load the sounds\n //again. When the sound has been decoded, the `decodeHandler`\n //(see above!) will be run\n let soundSprite = makeSound(url, decodeHandler.bind(this), false, xhr);\n\n //Get the sound file name.\n soundSprite.name = this.loader.resources[resource].name;\n\n //Add the sound object to Hexi's `soundObjects` object.\n //You'll be able to access them in your application through\n //Hexi's higher-level `sound` method, like this:\n //`hexi.sound(\"soundFileName.wav\");`\n this.soundObjects[soundSprite.name] = soundSprite;\n }\n });\n\n //If there are no sound files, we can skip the decoding step and\n //just call `finishLoadingState` directly\n if (soundsToDecode === 0) {\n finishLoadingState();\n }\n }\n\n //The `update` method is run by Hexi's game loop each frame.\n //It manages the game state and updates the modules\n update() {\n\n //Update all the modules in the `modulesToUpdate` array.\n //These are modules that contain `update` methods that need to be\n //called every frame\n this.modulesToUpdate.forEach(module => module.update());\n //If the application is in full screen mode, make sure that Hexi\n //is using the correct scale value\n /*\n if (document.fullscreenEnabled === true) {\n console.log(\"fullscreenEnabled\")\n\n //Note: Check Firefox's current FullScreen API and specifically:\n //https://github.com/neovov/Fullscreen-API-Polyfill/blob/master/fullscreen-api-polyfill.js\n //if (this.fullScreen.fullscreenScale !== 1) {\n this.scale = this.fullScreen.fullscreenScale;\n //console.log(\"this.fullScreen.fullscreenScale: \" + this.fullScreen.fullscreenScale)\n this.pointer.scale = this.scale;\n //Find out if the pointer scale is propagating to Tink's pointer?\n console.log(this.pointer.scale)\n } else {\n if (!this.canvas.scaled) {\n this.scale = 1;\n this.pointer.scale = 1;\n }\n }\n */\n\n //Run the current game `state` function if it's been defined and\n //the game isn't `paused`\n if (this.state && !this.paused) {\n this.state();\n }\n }\n\n //Pause and resume methods\n pause() {\n this.paused = true;\n }\n resume() {\n this.paused = false;\n }\n\n //4. MODULE INTERFACES\n\n //A method that helpfully creates local, top-level references to the\n //most useful properties and methods from the loaded modules\n createModulePropertyAliases() {\n\n //Pixi - Rendering\n this.Container = PIXI.Container;\n this.loader = PIXI.loader;\n this.TextureCache = PIXI.utils.TextureCache;\n this.filters = PIXI.filters;\n //Filters\n this.dropShadowFilter = () => new this.filters.DropShadowFilter();\n this.asciiFilter = () => new this.filters.AsciiFilter();\n this.alphaMaskFilter = () => new this.filters.AlphaMaskFilter();\n this.bloomFilter = () => new this.filters.BloomFilter();\n this.blurDirFilter = () => new this.filters.BlurDirFilter();\n this.blurFilter = () => new this.filters.BlurFilter();\n this.colorMatrixFilter = () => new this.filters.ColorMatrixFilter();\n this.colorStepFilter = () => new this.filters.ColorStepFilter();\n this.crossHatchFilter = () => new this.filters.CrossHatchFilter();\n this.displacementFilter = () => new this.filters.DisplacementFilter();\n this.dotScreenFilter = () => new this.filters.DotScreenFilter();\n this.grayFilter = () => new this.filters.GrayFilter();\n this.invertFilter = () => new this.filters.InvertFilter();\n this.pixelateFilter = () => new this.filters.PixelateFilter();\n this.sepiaFilter = () => new this.filters.SepiaFilter();\n this.shockwaveFilter = () => new this.filters.ShockwaveFilter();\n this.twistFilter = () => new this.filters.TwistFilter();\n this.rgbSplitFilter = () => new this.filters.RGBSplitFilter();\n this.smartBlurFilter = () => new this.filters.SmartBlurFilter();\n this.tiltShiftFilter = () => new this.filters.TiltShiftFilter();\n\n //Tink - Interactivity\n this.draggableSprites = this.tink.draggableSprites;\n this.pointers = this.tink.pointers;\n this.buttons = this.tink.buttons;\n this.makePointer = (canvas, scale) => this.tink.makePointer(canvas, scale);\n this.makeDraggable = (...sprites) => this.tink.makeDraggable(...sprites);\n this.makeUndraggable = (...sprites) => this.tink.makeUndraggable(...sprites);\n this.makeInteractive = (o) => this.tink.makeInteractive(o);\n this.keyboard = this.tink.keyboard;\n this.arrowControl = (sprite, speed) => this.tink.arrowControl(sprite, speed);\n\n //Add the arrow key objects\n /*\n this.upArrow = this.keyboard(38);\n this.rightArrow = this.keyboard(39);\n this.downArrow = this.keyboard(40);\n this.leftArrow = this.keyboard(37);\n this.spaceBar = this.keyboard(32);\n */\n\n //Dust - Particle effects\n this.createParticles = (\n x, y, spriteFunction, container, numberOfParticles, gravity, randomSpacing, minAngle, maxAngle, minSize, maxSize,\n minSpeed, maxSpeed, minScaleSpeed, maxScaleSpeed, minAlphaSpeed, maxAlphaSpeed, minRotationSpeed, maxRotationSpeed\n ) => this.dust.create(\n x, y, spriteFunction, container, numberOfParticles, gravity, randomSpacing, minAngle, maxAngle, minSize, maxSize,\n minSpeed, maxSpeed, minScaleSpeed, maxScaleSpeed, minAlphaSpeed, maxAlphaSpeed, minRotationSpeed, maxRotationSpeed\n );\n this.particleEmitter = (interval, particleFunction) => this.dust.emitter(interval, particleFunction);\n\n //SpriteUtilities - Sprite creation tools\n this.filmstrip = (texture, frameWidth, frameHeight, spacing) => this.spriteUtilities.filmstrip(texture, frameWidth, frameHeight, spacing);\n this.frame = (source, x, y, width, height) => this.spriteUtilities.frame(source, x, y, width, height);\n this.frames = (source, coordinates, frameWidth, frameHeight) => this.spriteUtilities.frames(source, coordinates, frameWidth, frameHeight);\n this.frameSeries = (startNumber, endNumber, baseName, extension) => this.spriteUtilities.frames(startNumber, endNumber, baseName, extension);\n this.colorToRGBA = value => this.spriteUtilities.colorToRGBA(value);\n this.colorToHex = value => this.spriteUtilities.colorToHex(value);\n this.byteToHex = value => this.spriteUtilities.byteToHex(value);\n this.color = value => this.spriteUtilities.color(value);\n this.shoot = (shooter, angle, x, y, container, bulletSpeed, bulletArray, bulletSprite) => {\n return this.spriteUtilities.shoot(shooter, angle, x, y, container, bulletSpeed, bulletArray, bulletSprite)\n };\n this.shake = (sprite, magnitude = 16, angular = false) => {\n console.log(\"shake\")\n return this.spriteUtilities.shake(sprite, magnitude, angular);\n }\n\n //Charm - Tweening\n this.fadeOut = (sprite, frames = 60) => this.charm.fadeOut(sprite, frames);\n this.fadeIn = (sprite, frames = 60) => this.charm.fadeIn(sprite, frames);\n this.pulse = (sprite, frames = 60, minAlpha = 0) => this.charm.pulse(sprite, frames, minAlpha);\n this.slide = (sprite, endX, endY, frames = 60, type = \"smoothstep\", yoyo = false, delayBeforeRepeat = 0) => {\n return this.charm.slide(sprite, endX, endY, frames, type, yoyo, delayBeforeRepeat = 0);\n };\n this.breathe = (sprite, endScaleX = 0.8, endScaleY = 0.8, frames = 60, yoyo = true, delayBeforeRepeat = 0) => {\n return this.charm.breathe(sprite, endScaleX, endScaleY, frames, yoyo, delayBeforeRepeat);\n };\n this.scale = (sprite, endScaleX = 0.5, endScaleY = 0.5, frames = 60) => this.charm.scale(sprite, endScaleX, endScaleY, frames);\n this.strobe = (sprite, scaleFactor = 1.3, startMagnitude = 10, endMagnitude = 20, frames = 10, yoyo = true, delayBeforeRepeat = 0) => {\n return this.charm.strobe(sprite, scaleFactor, startMagnitude, endMagnitude, frames, yoyo, delayBeforeRepeat);\n };\n this.wobble = (\n sprite, scaleFactorX = 1.2, scaleFactorY = 1.2, frames = 10, xStartMagnitude = 10, xEndMagnitude = 10,\n yStartMagnitude = -10, yEndMagnitude = -10, friction = 0.98, yoyo = true, delayBeforeRepeat = 0\n ) => {\n return this.charm.wobble(\n sprite, scaleFactorX = 1.2, scaleFactorY = 1.2, frames = 10, xStartMagnitude = 10, xEndMagnitude = 10,\n yStartMagnitude = -10, yEndMagnitude = -10, friction = 0.98, yoyo = true, delayBeforeRepeat = 0\n );\n };\n this.followCurve = (sprite, pointsArray, totalFrames, type = \"smoothstep\", yoyo = false, delayBeforeRepeat = 0) => {\n return this.charm.followCurve(sprite, pointsArray, totalFrames, type, yoyo, delayBeforeRepeat);\n };\n this.walkPath = (sprite, originalPathArray, totalFrames = 300, type = \"smoothstep\", loop = false, yoyo = false, delayBetweenSections = 0) => {\n return this.charm.walkPath(sprite, originalPathArray, totalFrames, type, loop, yoyo, delayBetweenSections);\n };\n this.walkCurve = (sprite, pathArray, totalFrames = 300, type = \"smoothstep\", loop = false, yoyo = false, delayBeforeContinue = 0) => {\n return this.charm.walkCurve(sprite, pathArray, totalFrames, type, loop, yoyo, delayBeforeContinue);\n };\n this.removeTween = (tweenObject) => this.charm.removeTween(tweenObject);\n this.makeTween = (tweensToAdd) => this.charm.makeTween(tweensToAdd);\n this.tweenProperty = (sprite, property, startValue, endValue, totalFrames, type = \"smoothstep\", yoyo = false, delayBeforeRepeat = 0) => {\n return this.charm.tweenProperty(sprite, property, startValue, endValue, totalFrames, type, yoyo, delayBeforeRepeat);\n };\n\n //Bump - Collision\n this.hitTestPoint = (point, sprite) => this.bump.hitTestPoint(point, sprite);\n this.hitTestCircle = (c1, c2, global = false) => this.bump.hitTestCircle(c1, c2, global);\n this.circleCollision = (c1, c2, bounce = false, global = false) => this.bump.circleCollision(c1, c2, bounce, global);\n this.movingCircleCollision = (c1, c2, global = false) => this.bump.movingCircleCollision(c1, c2, global);\n this.multipleCircleCollision = (arrayOfCircles, global = false) => this.bump.multipleCircleCollision(arrayOfCircles, global);\n this.rectangleCollision = (r1, r2, bounce = false, global = true) => this.bump.rectangleCollision(r1, r2, bounce, global);\n this.hitTestRectangle = (r1, r2, global = false) => this.bump.hitTestRectangle(r1, r2, global);\n this.hitTestCircleRectangle = (c1, r1, global = false) => this.bump.hitTestCircleRectangle(c1, r1, global);\n this.hitTestCirclePoint = (c1, point, global = false) => this.bump.hitTestCirclePoint(c1, point, global);\n this.circleRectangleCollision = (c1, r1, bounce = false, global = false) => this.bump.circleRectangleCollision(c1, r1, bounce, global);\n this.circlePointCollision = (c1, point, bounce = false, global = false) => this.bump.circlePointCollision(c1, point, bounce, global);\n this.bounceOffSurface = (o, s) => this.bump.bounceOffSurface(o, s);\n this.hit = (a, b, react = false, bounce = false, global, extra = undefined) => this.bump.hit(a, b, react, bounce, global, extra);\n this.shortestPath = (startIndex, destinationIndex, mapArray, mapWidthInTiles, obstacleGids = [], heuristic = \"manhattan\", useDiagonalNodes = true) => this.tileUtilities.shortestPath(startIndex, destinationIndex, mapArray, mapWidthInTiles, obstacleGids, heuristic, useDiagonalNodes)\n this.tileBasedLineOfSight = (spriteOne, spriteTwo, mapArray, world, emptyGid = 0, segment = 32, angles = []) => this.tileUtilities.tileBasedLineOfSight(spriteOne, spriteTwo, mapArray, world, emptyGid, segment, angles);\n\n //Intercept the Bump library's `contain` and `outsideBounds` methods to make sure that\n //the stage `width` and `height` match the canvas width and height\n this.contain = (sprite, container, bounce = false, extra = undefined) => {\n let o = {};\n if (container._stage) {\n o = this.compensateForStageSize(container);\n } else {\n o = container\n }\n return this.bump.contain(sprite, o, bounce, extra);\n };\n\n this.outsideBounds = (sprite, container, extra = undefined) => {\n let o = {};\n if (container._stage) {\n o = this.compensateForStageSize(container);\n } else {\n o = container\n }\n return this.bump.outsideBounds(sprite, o, extra);\n };\n\n //GameUtilities - Useful utilities\n this.distance = (s1, s2) => this.gameUtilities.distance(s1, s2);\n this.followEase = (follower, leader, speed) => this.gameUtilities.followEase(follower, leader, speed);\n this.followConstant = (follower, leader, speed) => this.gameUtilities.followConstant(follower, leader, speed);\n this.angle = (s1, s2) => this.gameUtilities.angle(s1, s2);\n this.rotateAroundSprite = (rotatingSprite, centerSprite, distance, angle) => this.gameUtilities.rotateAroundSprite(rotatingSprite, centerSprite, distance, angle);\n this.rotateAroundPoint = this.gameUtilities.rotateAroundPoint;\n this.randomInt = this.gameUtilities.randomInt;\n this.randomFloat = this.gameUtilities.randomFloat;\n this.move = this.gameUtilities.move;\n this.wait = this.gameUtilities.wait;\n this.worldCamera = (world, worldWidth, worldHeight, canvas = this.canvas) => this.gameUtilities.worldCamera(world, worldWidth, worldHeight, canvas);\n this.lineOfSight = (spriteOne, spriteTwo, obstacles, segment = 32) => this.gameUtilities.lineOfSight(spriteOne, spriteTwo, obstacles, segment);\n\n //Sound.js - Sound\n this.soundEffect = (\n frequencyValue, attack, decay, type, volumeValue, panValue, wait, pitchBendAmount, reverse,\n randomValue, dissonance, echo, reverb\n ) => {\n return soundEffect(\n frequencyValue, attack, decay, type, volumeValue, panValue, wait, pitchBendAmount, reverse,\n randomValue, dissonance, echo, reverb\n );\n };\n\n //FullScreen\n //this.enableFullScreen = (exitKeyCodes) => this.fullScreen.enableFullScreen(exitKeyCodes);\n\n //TileUtilities\n this.hitTestTile = (sprite, mapArray, gidToCheck, world, pointsToCheck) => {\n return this.tileUtilities.hitTestTile(sprite, mapArray, gidToCheck, world, pointsToCheck);\n };\n this.getIndex = (x, y, tilewidth, tileheight, mapWidthInTiles) => {\n return this.tileUtilities.getIndex(x, y, tilewidth, tileheight, mapWidthInTiles);\n };\n this.getTile = this.tileUtilities.getTile;\n this.surroundingCells = this.tileUtilities.surroundingCells;\n this.getPoints = this.tileUtilities.getPoints;\n this.updateMap = (mapArray, spritesToUpdate, world) => {\n return this.tileUtilities.updateMap(mapArray, spritesToUpdate, world);\n };\n this.byDepth = this.tileUtilities.byDepth;\n this.hitTestIsoTile = (sprite, mapArray, gidToCheck, world, pointsToCheck) => {\n return this.tileUtilities.hitTestIsoTile(sprite, mapArray, gidToCheck, world, pointsToCheck);\n };\n this.getIsoPoints = this.tileUtilities.getIsoPoints;\n this.makeIsoPointer = (pointer, world) => {\n return this.tileUtilities.makeIsoPointer(pointer, world);\n };\n this.isoRectangle = (width, height, fillStyle) => {\n return this.tileUtilities.isoRectangle(width, height, fillStyle);\n };\n this.addIsoProperties = (sprite, x, y, width, height) => {\n return this.tileUtilities.addIsoProperties(sprite, x, y, width, height);\n };\n this.makeIsoTiledWorld = (jsonTiledMap, tileset) => {\n return this.tileUtilities.makeIsoTiledWorld(jsonTiledMap, tileset);\n };\n\n }\n\n //Getters and setters\n\n //Pixi's loader resources\n get resources() {\n return this.loader.resources\n }\n\n //Add Smoothie getters and setters to access the `fps`,\n //`properties`, `renderFps` and `interpolate` properties\n get fps() {\n return this.smoothie.fps;\n }\n set fps(value) {\n this.smoothie.fps = value;\n }\n\n get renderFps() {\n return this.smoothie.renderFps;\n }\n set renderFps(value) {\n this.smoothie.renderFps = value;\n }\n\n get interpolate() {\n return this.smoothie.interpolate;\n }\n set interpolate(value) {\n this.smoothie.interpolate = value;\n }\n\n get interpolationProperties() {\n return this.smoothie.properties;\n }\n set interpolationProperties(value) {\n this.smoothie.properties = value;\n }\n\n //The `border` property lets you set the border style on the canvas\n set border(value) {\n this.canvas.style.border = value;\n }\n\n //The `backgroundColor` property lets you set the background color\n //of the renderer\n set backgroundColor(value) {\n this.renderer.backgroundColor = this.color(value);\n }\n\n\n //5. SPRITE CREATION METHODS\n\n //Hexi uses methods from the\n //SpriteUtilities module to help create sprites. But, as a helpful bonus, Hexi automatically adds sprites\n //to the `stage` container. (The `stage` is Hexi's root container for all\n //Hexi sprites.) Hexi also adds a whole bunch of\n //extra, useful properties and methods to sprites with the\n //`addProperties` method\n\n //Universal sprites\n sprite(source, x = 0, y = 0, tiling = false, width, height) {\n let o = this.spriteUtilities.sprite(source, x, y, tiling, width, height);\n this.addProperties(o);\n this.stage.addChild(o);\n return o;\n }\n\n //Tiling sprites\n tilingSprite(source, width, height, x = 0, y = 0) {\n let o = this.spriteUtilities.tilingSprite(source, width, height, x, y);\n this.addProperties(o);\n this.stage.addChild(o);\n return o;\n }\n\n //Hexi's `text` method is a quick way to create a Pixi Text sprite\n //and add it to the stage\n text(content = \"message\", font = \"16px sans\", fillStyle = \"red\", x = 0, y = 0) {\n let message = this.spriteUtilities.text(content, font, fillStyle, x, y);\n this.addProperties(message);\n this.stage.addChild(message);\n return message;\n }\n\n //The `bitmapText` method is a quick way to create a Pixi BitmapText sprite\n bitmapText(content = \"message\", font, align, tint, x = 0, y = 0) {\n let message = this.spriteUtilities.bitmapText(content, font, align, tint, x, y);\n this.addProperties(message);\n this.stage.addChild(message);\n return message;\n }\n\n //Make a rectangle and add it to the stage\n rectangle(width = 32, height = 32, fillStyle = 0xFF3300, strokeStyle = 0x0033CC, lineWidth = 0, x = 0, y = 0) {\n let o = this.spriteUtilities.rectangle(width, height, fillStyle, strokeStyle, lineWidth, x, y);\n this.addProperties(o);\n this.stage.addChild(o);\n return o;\n }\n\n //Make a circle and add it to the stage\n circle(diameter = 32, fillStyle = 0xFF3300, strokeStyle = 0x0033CC, lineWidth = 0, x = 0, y = 0) {\n let o = this.spriteUtilities.circle(diameter, fillStyle, strokeStyle, lineWidth, x, y);\n this.addProperties(o);\n\n //Add diameter and radius properties to the circle\n o.circular = true;\n this.stage.addChild(o);\n return o;\n }\n\n //Draw a line\n line(strokeStyle = 0x000000, lineWidth = 1, ax = 0, ay = 0, bx = 32, by = 32) {\n let o = this.spriteUtilities.line(strokeStyle, lineWidth, ax, ay, bx, by);\n this.addProperties(o);\n this.stage.addChild(o);\n return o;\n }\n\n //Make a button and add it to the stage\n button(source, x, y) {\n let o = this.tink.button(source, x, y);\n this.addProperties(o);\n this.stage.addChild(o);\n return o;\n }\n\n //6. DISPLAY UTILITIES\n //--------------------\n\n //Use `group` to create a Container\n group(...sprites) {\n let o = this.spriteUtilities.group(...sprites);\n this.addProperties(o);\n this.stage.addChild(o);\n return o;\n }\n\n //`batch` creates a Pixi ParticleContainer\n batch(size, options) {\n let o = this.spriteUtilities.batch(size, options);\n this.addProperties(o);\n this.stage.addChild(o);\n return o;\n }\n\n //Create a grid of sprite\n grid(\n columns = 0, rows = 0, cellWidth = 32, cellHeight = 32,\n centerCell = false, xOffset = 0, yOffset = 0,\n makeSprite = undefined,\n extra = undefined\n ) {\n\n let o = this.spriteUtilities.grid(\n columns, rows, cellWidth, cellHeight,\n centerCell, xOffset, yOffset, makeSprite, extra\n );\n this.addProperties(o);\n this.stage.addChild(o);\n return o;\n }\n\n //`makeTiledWorld` uses a Tiled Editor JSON file to generate a game\n //world. It uses the `makeTiledWorld` method from the\n //`tileUtilities` module to do help do this.\n makeTiledWorld(jsonTiledMap, tileset) {\n let o = this.tileUtilities.makeTiledWorld(jsonTiledMap, tileset);\n this.addProperties(o);\n\n //Add Hexi's special sprite properties to the world object and all\n //its child objects\n let addHexiSpriteProperties = object => {\n this.addProperties(object);\n if (object.children) {\n if (object.children.length > 0) {\n object.children.forEach(child => {\n addHexiSpriteProperties(child);\n });\n }\n }\n };\n if (o.children) {\n if (o.children.length > 0) {\n o.children.forEach(child => {\n addHexiSpriteProperties(child);\n });\n }\n }\n\n //Return the world object\n this.stage.addChild(o);\n return o;\n }\n\n //Use `remove` to remove a sprite from its parent. You can supply a\n //single sprite, a list of sprites, or an array of sprites\n remove(...sprites) {\n this.spriteUtilities.remove(...sprites);\n }\n\n //The flow methods: `flowRight`, `flowDown`, `flowLeft` and\n //`flowUp`.\n //Use them to easily align a row of sprites horizontally or\n //vertically. The flow methods take two arguments: the padding (in\n //pixels) between the sprites, and list of sprites (or an array\n //containing sprites) that you want to align.\n //(This feature was inspired by the Elm programming language)\n\n //flowRight\n flowRight(padding, ...sprites) {\n\n //A function to flow the sprites\n let flowSprites = (spritesToFlow) => {\n if (spritesToFlow.length > 0) {\n for (let i = 0; i < spritesToFlow.length - 1; i++) {\n let sprite = spritesToFlow[i];\n sprite.putRight(spritesToFlow[i + 1], +padding);\n }\n }\n };\n\n //Check if `sprites` is a an array of sprites, or an\n //array containing sprite objects\n if (!(sprites[0] instanceof Array)) {\n\n //It's an array of sprites\n flowSprites(sprites);\n } else {\n\n //It's an array containing sprite objects\n let spritesArray = sprites[0];\n flowSprites(spritesArray);\n }\n }\n\n //flowDown\n flowDown(padding, ...sprites) {\n let flowSprites = (spritesToFlow) => {\n if (spritesToFlow.length > 0) {\n for (let i = 0; i < spritesToFlow.length - 1; i++) {\n let sprite = spritesToFlow[i];\n sprite.putBottom(spritesToFlow[i + 1], 0, +padding);\n }\n }\n };\n if (!(sprites[0] instanceof Array)) {\n flowSprites(sprites);\n } else {\n let spritesArray = sprites[0];\n flowSprites(spritesArray);\n }\n }\n\n //flowLeft\n flowLeft(padding, ...sprites) {\n let flowSprites = (spritesToFlow) => {\n if (spritesToFlow.length > 0) {\n for (let i = 0; i < spritesToFlow.length - 1; i++) {\n let sprite = spritesToFlow[i];\n sprite.putLeft(spritesToFlow[i + 1], -padding);\n }\n }\n };\n if (!(sprites[0] instanceof Array)) {\n flowSprites(sprites);\n } else {\n let spritesArray = sprites[0];\n flowSprites(spritesArray);\n }\n }\n\n //flowUp\n flowUp(padding, ...sprites) {\n let flowSprites = (spritesToFlow) => {\n if (spritesToFlow.length > 0) {\n for (let i = 0; i < spritesToFlow.length - 1; i++) {\n let sprite = spritesToFlow[i];\n sprite.putTop(spritesToFlow[i + 1], 0, -padding);\n }\n }\n };\n if (!(sprites[0] instanceof Array)) {\n flowSprites(sprites);\n } else {\n let spritesArray = sprites[0];\n flowSprites(spritesArray);\n }\n }\n\n //7. SPRITE PROPERTIES\n\n //The sprite creation methods above all run the `addProperties`\n //method on each sprite they create. `addProperties` adds special\n //properties and methods (super powers!) to Hexi sprites.\n\n addProperties(o) {\n\n //Velocity\n o.vx = 0;\n o.vy = 0;\n\n //A \"private\" `_layer` property\n o._layer = 0;\n\n //Is the sprite circular? If it is, it will be given a `radius`\n //and `diameter`\n o._circular = false;\n\n //Is the sprite interactive? Setting this to `true` makes the\n //sprite behave like a button\n o._interact = false;\n\n //Is the sprite draggable?\n o._draggable = false;\n\n //Flag this object for compatibility with the Bump collision\n //library\n o._bumpPropertiesAdded = true;\n\n //Swap the depth layer positions of two child sprites\n o.swapChildren = (child1, child2) => {\n let index1 = o.children.indexOf(child1),\n index2 = o.children.indexOf(child2);\n if (index1 !== -1 && index2 !== -1) {\n\n //Swap the indexes\n child1.childIndex = index2;\n child2.childIndex = index1;\n\n //Swap the array positions\n o.children[index1] = child2;\n o.children[index2] = child1;\n } else {\n throw new Error(child + \" Both objects must be a child of the caller \" + o);\n }\n };\n\n //`add` and `remove` convenience methods let you add and remove\n //many sprites at the same time.\n o.add = (...sprites) => {\n if (sprites.length > 1) {\n sprites.forEach(sprite => o.addChild(sprite));\n } else {\n o.addChild(sprites[0]);\n }\n };\n o.remove = (...sprites) => {\n if (sprites.length > 1) {\n sprites.forEach(sprite => o.removeChild(sprite));\n } else {\n o.removeChild(sprites[0]);\n }\n };\n\n //The `put` methods are conveniences that help you position a\n //another sprite in and around this sprite.\n //First, get a short form reference to the sprite to make the code\n //easier to read\n let a = o;\n\n //The `nudgeAnchor`, `compensateForAnchor` and\n //`compensateForAnchors` (with an \"s\"!) methods are used by\n //the `put` methods to adjust the position of the sprite based on\n //its x/y anchor point.\n let nudgeAnchor = (o, value, axis) => {\n if (o.anchor !== undefined) {\n if (o.anchor[axis] !== 0) {\n return value * ((1 - o.anchor[axis]) - o.anchor[axis]);\n } else {\n return value;\n }\n } else {\n return value;\n }\n };\n\n let compensateForAnchor = (o, value, axis) => {\n if (o.anchor !== undefined) {\n if (o.anchor[axis] !== 0) {\n return value * o.anchor[axis];\n } else {\n return 0;\n }\n } else {\n return 0;\n }\n };\n\n let compensateForAnchors = (a, b, property1, property2) => {\n return compensateForAnchor(a, a[property1], property2) + compensateForAnchor(b, b[property1], property2)\n };\n\n //The `put` methods:\n //Center a sprite inside this sprite. `xOffset` and `yOffset`\n //arguments determine by how much the other sprite's position\n //should be offset from the center. These methods use the\n //sprites' global coordinates (`gx` and `gy`).\n //In all these functions, `b` is the second sprite that is being\n //positioned relative to the first sprite (this one), `a`.\n //Center `b` inside `a`.\n o.putCenter = (b, xOffset = 0, yOffset = 0) => {\n if (o._stage) a = this.compensateForStageSize(o);\n //b.x = (a.x + a.halfWidth - (b.halfWidth * ((1 - b.anchor.x) - b.anchor.x))) + xOffset;\n b.x = (a.x + nudgeAnchor(a, a.halfWidth, \"x\") - nudgeAnchor(b, b.halfWidth, \"x\")) + xOffset;\n b.y = (a.y + nudgeAnchor(a, a.halfHeight, \"y\") - nudgeAnchor(b, b.halfHeight, \"y\")) + yOffset;\n\n //Compensate for the parent's position\n if (!o._stage) o.compensateForParentPosition(a, b);\n };\n\n //Position `b` to the left of `a`.\n o.putLeft = (b, xOffset = 0, yOffset = 0) => {\n if (o._stage) a = this.compensateForStageSize(o);\n b.x = (a.x - nudgeAnchor(b, b.width, \"x\")) + xOffset - compensateForAnchors(a, b, \"width\", \"x\");\n b.y = (a.y + nudgeAnchor(a, a.halfHeight, \"y\") - nudgeAnchor(b, b.halfHeight, \"y\")) + yOffset;\n\n //Compensate for the parent's position\n if (!o._stage) o.compensateForParentPosition(a, b);\n };\n\n //Position `b` above `a`.\n o.putTop = (b, xOffset = 0, yOffset = 0) => {\n if (o._stage) a = this.compensateForStageSize(o);\n b.x = (a.x + nudgeAnchor(a, a.halfWidth, \"x\") - nudgeAnchor(b, b.halfWidth, \"x\")) + xOffset;\n b.y = (a.y - nudgeAnchor(b, b.height, \"y\")) + yOffset - compensateForAnchors(a, b, \"height\", \"y\");\n\n //Compensate for the parent's position\n if (!o._stage) o.compensateForParentPosition(a, b);\n };\n\n //Position `b` to the right of `a`.\n o.putRight = (b, xOffset = 0, yOffset = 0) => {\n if (o._stage) a = this.compensateForStageSize(o);\n b.x = (a.x + nudgeAnchor(a, a.width, \"x\")) + xOffset + compensateForAnchors(a, b, \"width\", \"x\");\n b.y = (a.y + nudgeAnchor(a, a.halfHeight, \"y\") - nudgeAnchor(b, b.halfHeight, \"y\")) + yOffset;\n //b.x = (a.x + a.width) + xOffset;\n //b.y = (a.y + a.halfHeight - b.halfHeight) + yOffset;\n\n //Compensate for the parent's position\n if (!o._stage) o.compensateForParentPosition(a, b);\n };\n\n //Position `b` below `a`.\n o.putBottom = (b, xOffset = 0, yOffset = 0) => {\n if (o._stage) a = this.compensateForStageSize(o);\n //b.x = (a.x + a.halfWidth - b.halfWidth) + xOffset;\n b.x = (a.x + nudgeAnchor(a, a.halfWidth, \"x\") - nudgeAnchor(b, b.halfWidth, \"x\")) + xOffset;\n //b.y = (a.y + a.height) + yOffset;\n b.y = (a.y + nudgeAnchor(a, a.height, \"y\")) + yOffset + compensateForAnchors(a, b, \"height\", \"y\");\n\n //Compensate for the parent's position\n if (!o._stage) o.compensateForParentPosition(a, b);\n };\n\n //`compensateForParentPosition` is a helper function for the above\n //`put` methods that subracts the parent's global position from\n //the nested child's position.\n o.compensateForParentPosition = (a, b) => {\n if (b.parent.gx !== 0 || b.parent.gy !== 0) {\n b.x -= a.gx;\n b.y -= a.gy;\n }\n };\n\n let self = this;\n Object.defineProperties(o, {\n \"gx\": {\n get() {\n return o.getGlobalPosition().x\n },\n enumerable: true,\n configurable: true\n },\n \"gy\": {\n get() {\n return o.getGlobalPosition().y\n },\n enumerable: true,\n configurable: true\n },\n \"centerX\": {\n get() {\n return o.x + (o.width / 2) - o.xAnchorOffset\n },\n enumerable: true,\n configurable: true\n },\n \"centerY\": {\n get() {\n return o.y + (o.height / 2) - o.yAnchorOffset\n },\n enumerable: true,\n configurable: true\n },\n \"halfWidth\": {\n get() {\n return o.width / 2\n },\n enumerable: true,\n configurable: true\n },\n \"halfHeight\": {\n get() {\n return o.height / 2\n },\n enumerable: true,\n configurable: true\n },\n \"scaleModeNearest\": {\n set(value) {\n if (o.texture.baseTexture) {\n if (value) {\n o.texture.baseTexture.scaleMode = PIXI.SCALE_MODES.NEAREST;\n } else {\n o.texture.baseTexture.scaleMode = PIXI.SCALE_MODES.LINEAR;\n }\n } else {\n throw new Error(`The scale mode of ${o} cannot be modified`)\n }\n },\n enumerable: true,\n configurable: true\n },\n \"pivotX\": {\n get() {\n return o.anchor.x\n },\n set(value) {\n if (o.anchor === undefined) {\n throw new Error(`${o} does not have a PivotX value`);\n }\n o.anchor.x = value;\n if (!o._previousPivotX) {\n o.x += value * o.width;\n } else {\n o.x += (value - o._previousPivotX) * o.width;\n }\n o._previousPivotX = value;\n },\n enumerable: true,\n configurable: true\n },\n \"pivotY\": {\n get() {\n return o.anchor.y\n },\n set(value) {\n if (o.anchor === undefined) {\n throw new Error(`${o} does not have a PivotY value`);\n }\n o.anchor.y = value;\n if (!o._previousPivotY) {\n o.y += value * o.height;\n } else {\n o.y += (value - o._previousPivotY) * o.height;\n }\n o._previousPivotY = value;\n },\n enumerable: true,\n configurable: true\n },\n \"xAnchorOffset\": {\n get() {\n if (o.anchor !== undefined) {\n return o.height * o.anchor.x;\n } else {\n return 0;\n }\n },\n enumerable: true,\n configurable: true\n },\n \"yAnchorOffset\": {\n get() {\n if (o.anchor !== undefined) {\n return o.width * o.anchor.y;\n } else {\n return 0;\n }\n },\n enumerable: true,\n configurable: true\n },\n \"scaleX\": {\n get() {\n return o.scale.x\n },\n set(value) {\n o.scale.x = value;\n },\n enumerable: true,\n configurable: true\n },\n \"scaleY\": {\n get() {\n return o.scale.y\n },\n set(value) {\n o.scale.y = value;\n },\n enumerable: true,\n configurable: true\n },\n\n //Depth layer\n \"layer\": {\n get() {\n return o._layer\n },\n set(value) {\n o._layer = value;\n if (o.parent) {\n\n //Sort the sprite’s parent’s `children` array so that sprites with a\n //higher `layer` value are moved to the end of the array\n o.parent.children.sort((a, b) => a.layer - b.layer);\n }\n },\n enumerable: true,\n configurable: true\n },\n\n //Interactivity\n \"interact\": {\n get() {\n return o._interact\n },\n set(value) {\n if (value === true) {\n if (!o._interact) {\n self.makeInteractive(o);\n o._interact = true;\n }\n } else {\n if (self.tink.buttons.indexOf(o) !== -1) {\n self.tink.buttons.splice(self.tink.buttons.indexOf(o), 1);\n o._interact = false;\n }\n }\n },\n enumerable: true,\n configurable: true\n },\n\n //Drag and drop\n \"draggable\": {\n get() {\n return o._draggable\n },\n set(value) {\n if (value === true) {\n if (!o._draggable) {\n self.makeDraggable(o);\n o._draggable = true;\n }\n } else {\n self.makeUndraggable(o)\n o._draggable = false;\n }\n },\n enumerable: true,\n configurable: true\n },\n\n //The `localBounds` and `globalBounds` methods return an object\n //with `x`, `y`, `width`, and `height` properties that define\n //the dimensions and position of the sprite. This is a convenience\n //to help you set or test boundaries without having to know\n //these numbers or request them specifically in your code.\n \"localBounds\": {\n get() {\n return {\n x: 0,\n y: 0,\n width: o.width,\n height: o.height\n };\n },\n enumerable: true,\n configurable: true\n },\n \"globalBounds\": {\n get() {\n return {\n x: o.gx,\n y: o.gy,\n width: o.gx + o.width,\n height: o.gy + o.height\n };\n },\n enumerable: true,\n configurable: true\n },\n\n //`empty` is a convenience property that will return `true` or\n //`false` depending on whether or not this sprite's `children`\n //array is empty\n \"empty\": {\n get() {\n if (o.children.length === 0) {\n return true;\n } else {\n return false;\n }\n },\n enumerable: true,\n configurable: true\n },\n\n //The `circular` property lets you define whether a sprite\n //should be interpreted as a circular object. If you set\n //`circular` to `true`, the sprite is given `radius` and `diameter`\n //properties. If you set `circular` to `false`, the `radius`\n //and `diameter` properties are deleted from the sprite\n \"circular\": {\n get() {\n return o._circular;\n },\n set(value) {\n\n //Give the sprite `diameter` and `radius` properties\n //if `circular` is `true`\n if (value === true && o._circular === false) {\n Object.defineProperties(o, {\n \"diameter\": {\n get() {\n return o.width;\n },\n set(value) {\n o.width = value;\n o.height = value;\n },\n enumerable: true,\n configurable: true\n },\n \"radius\": {\n get() {\n return o.halfWidth;\n },\n set(value) {\n o.width = value * 2;\n o.height = value * 2;\n },\n enumerable: true,\n configurable: true\n }\n });\n\n //Set o.sprite's `_circular` property to `true`\n o._circular = true;\n }\n\n //Remove the sprite's `diameter` and `radius` properties\n //if `circular` is `false`\n if (value === false && o._circular === true) {\n delete o.diameter;\n delete o.radius;\n o._circular = false;\n }\n },\n enumerable: true,\n configurable: true\n }\n });\n\n //A `setPosition` convenience method to let you set the\n //x any y position of a sprite with one line of code.\n o.setPosition = (x, y) => {\n o.x = x;\n o.y = y;\n };\n\n //A similar `setScale` convenience method\n o.setScale = (xScale, yScale) => {\n o.scale.x = xScale;\n o.scale.y = yScale;\n };\n\n //And a matching `setPivot` method\n o.setPivot = (xPivot, yPivot) => {\n o.pivotX = xPivot;\n o.pivotY = yPivot;\n };\n\n if (o.circular) {\n Object.defineProperty(o, \"radius\", {\n get() {\n return o.width / 2\n },\n enumerable: true,\n configurable: true\n });\n }\n\n }\n\n //8. Utilities\n\n //A method to scale and align the canvas in the browser\n //window using the `scaleToWindow.js` function module\n scaleToWindow(scaleBorderColor = \"#2C3539\") {\n\n //Set the default CSS padding and margins of HTML elements to 0\n //\n let newStyle = document.createElement(\"style\");\n let style = \"* {padding: 0; margin: 0}\";\n newStyle.appendChild(document.createTextNode(style));\n document.head.appendChild(newStyle);\n\n //Use the `scaleToWindow` function module to scale the canvas to\n //the maximum window size\n this.scale = scaleToWindow(this.canvas, scaleBorderColor);\n this.pointer.scale = this.scale;\n //this.pointer = this.makePointer(this.canvas, this.scale);\n console.log(this.pointer)\n\n //Re-scale on each browser resize\n window.addEventListener(\"resize\", event => {\n //Scale the canvas and update Hexi's global `scale` value and\n //the pointer's `scale` value\n this.scale = scaleToWindow(this.canvas, scaleBorderColor);\n this.pointer.scale = this.scale;\n });\n\n //Flag that the canvas has been scaled\n this.canvas.scaled = true;\n }\n\n //`log` is a shortcut for `console.log`, so that you have less to\n //type when you're debugging\n log(value) {\n return console.log(value);\n }\n\n //The `makeProgressBar` method creates a `progressBar` object with\n //`create`, `update` and `remove` methods. It's called by the\n //`loadingBar` method, which should be run inside the `load`\n //function of your application code.\n makeProgressBar(hexiObject) {\n\n let hexi = hexiObject;\n\n //The `progressBar` object\n hexi.progressBar = {\n maxWidth: 0,\n height: 0,\n backgroundColor: \"0x808080\",\n foregroundColor: \"0x00FFFF\",\n backBar: null,\n frontBar: null,\n percentage: null,\n assets: null,\n initialized: false,\n\n //Use the `create` method to create the progress bar\n create() {\n\n //Set the maximum width to half the width of the canvas\n this.maxWidth = hexi.canvas.width / 2;\n\n //Build the progress bar using two rectangle sprites and\n //one text sprite\n\n //1. Create the background bar's gray background\n this.backBar = hexi.rectangle(this.maxWidth, 32, this.backgroundColor);\n this.backBar.x = (hexi.canvas.width / 2) - (this.maxWidth / 2);\n this.backBar.y = (hexi.canvas.height / 2) - 16;\n\n //2. Create the blue foreground bar. This is the element of the\n //progress bar that will increase in width as assets load\n this.frontBar = hexi.rectangle(this.maxWidth, 32, this.foregroundColor);\n this.frontBar.x = (hexi.canvas.width / 2) - (this.maxWidth / 2);\n this.frontBar.y = (hexi.canvas.height / 2) - 16;\n\n //3. A text sprite that will display the percentage\n //of assets that have loaded\n this.percentage = hexi.text(\"0%\", \"28px sans-serif\", \"black\");\n this.percentage.x = (hexi.canvas.width / 2) - (this.maxWidth / 2) + 12;\n this.percentage.y = (hexi.canvas.height / 2) - 17;\n },\n\n //Use the `update` method to update the width of the bar and\n //percentage loaded each frame\n update() {\n\n //Change the width of the blue `frontBar` to match the\n //ratio of assets that have loaded.\n let ratio = hexi.loadingProgress / 100;\n //console.log(`ratio: ${ratio}`);\n this.frontBar.width = this.maxWidth * ratio;\n\n //Display the percentage\n this.percentage.content = `${Math.round(hexi.loadingProgress)} %`;\n },\n\n //Use the `remove` method to remove the progress bar when all the\n //game assets have finished loading\n remove() {\n\n //Remove the progress bar using the universal sprite `remove`\n //function\n hexi.stage.removeChild(this.frontBar);\n hexi.stage.removeChild(this.backBar);\n hexi.stage.removeChild(this.percentage);\n }\n };\n }\n\n //The `loadingBar` method should be called inside the user-definable\n //`load` method in the application code. This function will run in a\n //loop. It will create the loading bar, and then call the loading\n //bar's `update` method each frame. After all the assets have been\n //loaded, Hexi's `validateAssets` method removes the loading bar.\n loadingBar() {\n\n if (!this._progressBarAdded) {\n\n //Run the method that creates the progress bar object\n this.makeProgressBar(this);\n\n //Create the loading bar\n this.progressBar.create();\n\n //Tell Hexi that a progress bar has been added\n this._progressBarAdded = true;\n } else {\n\n //Update the progress bar each frame\n this.progressBar.update();\n }\n }\n\n //Hexi's root `stage` object will have a width and height equal to\n //its contents, not the size of the canvas. So, let's use the more\n //useful canvas width and height for relative positioning instead\n compensateForStageSize(o) {\n if (o._stage === true) {\n let a = {};\n a.x = 0;\n a.y = 0;\n a.width = this.canvas.width;\n a.height = this.canvas.height;\n a.halfWidth = this.canvas.width / 2;\n a.halfHeight = this.canvas.height / 2;\n a.xAnchorOffset = 0;\n a.yAnchorOffset = 0;\n return a;\n }\n }\n\n //High level functions for accessing the loaded resources and custom parsed\n //objects, like sounds.\n image(imageFileName) {\n if (this.TextureCache[imageFileName]) {\n return this.TextureCache[imageFileName];\n } else {\n throw new Error(`${imageFileName} does not appear to be an image`);\n }\n }\n id(textureAtlasFrameId) {\n if (this.TextureCache[textureAtlasFrameId]) {\n return this.TextureCache[textureAtlasFrameId];\n } else {\n throw new Error(`${textureAtlasFrameId} does not appear to be a texture atlas frame id`);\n }\n }\n json(jsonFileName) {\n if (this.loader.resources[jsonFileName].data) {\n return this.resources[jsonFileName].data;\n } else {\n throw new Error(`${jsonFileName} does not appear to be a JSON data file`);\n }\n }\n xml(xmlFileName) {\n if (this.loader.resources[xmlFileName].data) {\n return this.resources[xmlFileName].data;\n } else {\n throw new Error(`${xmlFileName} does not appear to be a XML data file`);\n }\n }\n sound(soundFileName) {\n if (this.soundObjects[soundFileName]) {\n return this.soundObjects[soundFileName];\n } else {\n throw new Error(`${soundFileName} does not appear to be a sound object`);\n }\n }\n}\n"]}