-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js.map
1 lines (1 loc) · 61.4 KB
/
index.js.map
1
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./sources/game/components/demo/direction.js","webpack:///./sources/game/components/demo/spritesheet.js","webpack:///./sources/game/components/demo/image.js","webpack:///./sources/game/scenes/loading/index.js","webpack:///(webpack)/buildin/harmony-module.js","webpack:///./sources/game/scenes/loading/destroy.js","webpack:///./sources/game/scenes/loading/render.js","webpack:///./sources/game/scenes/loading/setup.js","webpack:///./sources/game/scenes/loading/start.js","webpack:///./sources/game/scenes/loading/update.js","webpack:///./sources/game/scenes/demo/index.js","webpack:///./sources/game/scenes/demo/destroy.js","webpack:///./sources/theatre/modules/world.js","webpack:///./sources/game/components/demo/position.js","webpack:///./sources/game/scenes/demo/start.js","webpack:///./sources/game/components/demo/input.js","webpack:///./sources/game/components/demo/text.js","webpack:///./sources/game/components/demo/framerate.js","webpack:///./sources/game/components/demo/alphabet.js","webpack:///./sources/game/systems/demo/animate.js","webpack:///./sources/game/components/demo/animation.js","webpack:///./sources/game/components/demo/run.js","webpack:///./sources/game/systems/demo/input.js","webpack:///./sources/game/systems/demo/reframe.js","webpack:///./sources/game/scenes/demo/update.js","webpack:///./sources/game/systems/demo/framerate.js","webpack:///./sources/game/systems/demo/image.js","webpack:///./sources/game/systems/demo/text.js","webpack:///./sources/game/scenes/demo/render.js","webpack:///./sources/theatre/modules/keynames.js","webpack:///./sources/theatre/modules/keycodes.js","webpack:///./sources/game/scenes/demo/setup.js","webpack:///./sources/theatre/modules/keyboard.js","webpack:///./sources/game/assets/images/demo/[email protected]","webpack:///./sources/game/assets/images/demo/[email protected]","webpack:///./sources/game/assets/datasets/index.js","webpack:///./sources/game/assets/images/index.js","webpack:///./sources/game/assets/index.js","webpack:///./sources/index.js","webpack:///./sources/theatre/core/theatre.js","webpack:///./sources/theatre/core/canvas.js","webpack:///./sources/theatre/core/loop.js","webpack:///./sources/theatre/core/preload.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Direction","direction","this","__webpack_exports__","Spritesheet","spritesheet","Image","image","size","frame","_destroy_js__WEBPACK_IMPORTED_MODULE_0__","_render_js__WEBPACK_IMPORTED_MODULE_1__","_setup_js__WEBPACK_IMPORTED_MODULE_2__","_start_js__WEBPACK_IMPORTED_MODULE_3__","_update_js__WEBPACK_IMPORTED_MODULE_4__","hot","accept","originalModule","webpackPolyfill","children","destroy","console","log","state","redirect","render","context","fillStyle","fillRect","width","height","font","textAlign","textBaseline","fillText","preloading","setup","start","update","_this","setTimeout","load","keyboard","inputs","world","Entity","components","add","Array","isArray","forEach","component","has","iterator","length","search","replace","exclude","remove","Position","x","y","entities","_this2","entity","system","handler","arguments","undefined","chosen","entries","_ref","_ref2","_slicedToArray","demo_image","assets","images","demo","datasets","text","elapsed","frames","animate","animationComponent","delta","duration","framerate","current","Animation","Run","input_input","input_slicedToArray","input","directionComponent","imageComponent","inputComponent","spritesheetComponent","indexOf","action","reframe","reframe_slicedToArray","framerateComponent","Math","round","image_image","image_slicedToArray","positionComponent","drawImage","text_text","text_slicedToArray","alphabetComponent","split","character","index","keynames","LEFT","UP","RIGHT","DOWN","setup_setup","codes","names","states","blur","push","type","keydown","event","code","keyCode","preventDefault","keyup","addEventListener","removeEventListener","scope","source","images_images","assets_assets","concat","_toConsumableArray","config","container","scenes","expose","sharp","speed","loading","restarting","version","scene","restart","canvas","identifier","element","document","createElement","getContext","ratio","window","devicePixelRatio","setAttribute","style","scale","imageRendering","imageSmoothingEnabled","appendChild","loop","elapsedTime","lastRender","lastUpdate","currentRender","Date","now","requestAnimationFrame","currentUpdate","max","timeframe","promises","asset","promise","Promise","resolve","reject","src","onload","sound","Audio","oncanplaythrough","cloneNode","all","then","preload","theatre","body","scenes_namespaceObject"],"mappings":"aACA,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C,EAAMgL,IAAML,EAAM3C,OAGlBhI,EAAMiL,OAAS,WAEXN,EAAM1M,OAAS,kBAAM+B,GAErB8K,EAAQH,SAKX,GAAmB,UAAfA,EAAMrD,KAAkB,CAE7B,IAAM4D,EAAQ,IAAIC,MAAMR,EAAM3C,QAG9BkD,EAAME,iBAAmB,WAErBT,EAAM1M,OAAS,kBAAMiN,EAAMG,aAE3BP,EAAQH,OAKpBD,EAASrD,KAAKuD,KAIlBC,QAAQS,IAAIZ,GAAUa,KAAK5H,GHuBvB6H,CAAQpH,EAAQ,SAACA,GAEbA,EAAOzB,QAAQ,SAACgI,QAEiC,IAAlC3I,EAAKoC,OAAOuG,EAAMrD,KAAO,OAEhCtF,EAAKoC,OAAOuG,EAAMrD,KAAO,cAG6B,IAA/CtF,EAAKoC,OAAOuG,EAAMrD,KAAO,KAAKqD,EAAM5C,SAE3C/F,EAAKoC,OAAOuG,EAAMrD,KAAO,KAAKqD,EAAM5C,WAGxC/F,EAAKoC,OAAOuG,EAAMrD,KAAO,KAAKqD,EAAM5C,OAAO4C,EAAM3M,MAAQ2M,EAAM1M,SAGnE+D,EAAKJ,YAAa,IAGtBjC,KAAKoK,KAAOA,EACZpK,KAAKiC,YAAa,GAsBXhE,KAAK+B,KAAM0I,IAEP,IAAXG,IAEAe,OAAOkC,QAAU9L,MDtHzB,EAEIyE,OAAU8D,EACVI,UAAaa,SAASuC,KACtBlD,QAAU,EACVD,OAAUoD,EACVlD,OAAS,EACTxI,MAEIqB,MAAS,IACTC,OAAU","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 20);\n","function Direction(direction) {\n\n this.name = 'direction';\n\n this.direction = direction;\n}\n\nexport {Direction};\n","function Spritesheet(spritesheet) {\n\n this.name = 'spritesheet';\n\n this.spritesheet = spritesheet;\n}\n\nexport {Spritesheet};\n","function Image(image, size, frame) {\n\n this.name = 'image';\n\n this.image = image;\n this.size = size;\n this.frame = frame;\n}\n\nexport {Image};\n","import {destroy} from './destroy.js';\nimport {render} from './render.js';\nimport {setup} from './setup.js';\nimport {start} from './start.js';\nimport {update} from './update.js';\n\nif (typeof module.hot !== 'undefined') {\n\n module.hot.accept([\n\n './destroy.js',\n './render.js',\n './setup.js',\n './start.js',\n './update.js'\n ]);\n}\n\nexport {destroy, render, setup, start, update};\n","module.exports = function(originalModule) {\n\tif (!originalModule.webpackPolyfill) {\n\t\tvar module = Object.create(originalModule);\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"exports\", {\n\t\t\tenumerable: true\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","function destroy() {\n\n console.log('destroy loading scene');\n console.log('-------');\n\n delete this.state.redirect;\n}\n\nexport {destroy};\n","function render() {\n\n // console.log('render loading scene');\n\n this.context.fillStyle = '#181a1f';\n this.context.fillRect(0, 0, this.size.width, this.size.height);\n\n this.context.font = '16px Courier New';\n this.context.textAlign = 'start';\n this.context.textBaseline = 'top';\n this.context.fillStyle = '#6b717d';\n this.context.fillText('/ Theatre', 8, 8);\n this.context.fillStyle = '#d7dae0';\n\n this.context.fillText('$ preloading assets...', 8, 32);\n\n if (this.preloading === false) {\n\n this.context.fillText('$ preloading completed', 8, 32 + 24);\n this.context.fillText('$ loading demo scene...', 8, 32 + 24 + 24);\n }\n}\n\nexport {render};\n","function setup() {\n\n console.log('setup loading scene');\n}\n\nexport {setup};\n","function start() {\n\n console.log('start loading scene');\n\n this.state.redirect = false;\n}\n\nexport {start};\n","function update() {\n\n // console.log('update loading scene');\n\n if (this.preloading === false && this.state.redirect === false) {\n\n setTimeout(() => {\n\n this.load('demo');\n\n }, 3000);\n\n this.state.redirect = true;\n }\n}\n\nexport {update};\n","import {destroy} from './destroy.js';\nimport {render} from './render.js';\nimport {setup} from './setup.js';\nimport {start} from './start.js';\nimport {update} from './update.js';\n\nif (typeof module.hot !== 'undefined') {\n\n module.hot.accept([\n\n './destroy.js',\n './render.js',\n './setup.js',\n './start.js',\n './update.js'\n ]);\n}\n\nexport {destroy, render, setup, start, update};\n","function destroy() {\n\n console.log('destroy demo scene');\n\n this.keyboard.destroy();\n\n delete this.inputs;\n delete this.world;\n\n delete this.keyboard;\n\n console.log('-------');\n}\n\nexport {destroy};\n","function Entity(name, components) {\n\n function add(components) {\n\n if (Array.isArray(components) === false) {\n\n components = [components];\n }\n\n components.forEach((component) => {\n\n this.components[component.name] = component;\n });\n }\n\n function get(component) {\n\n return this.components[component];\n }\n\n function has(components) {\n\n if (Array.isArray(components) === false) {\n\n components = [components];\n }\n\n for (let iterator = 0, length = components.length; iterator < length; iterator += 1) {\n\n const search = components[iterator];\n const component = search.replace('not:', '');\n const exclude = search !== component;\n\n if (this.components.hasOwnProperty(component) === exclude) {\n\n return false;\n }\n }\n\n return true;\n }\n\n function remove(components) {\n\n if (Array.isArray(components) === false) {\n\n components = [components];\n }\n\n for (let iterator = 0, length = components.length; iterator < length; iterator += 1) {\n\n const component = components[iterator];\n\n if (this.components.hasOwnProperty(component) === true) {\n\n delete this.components[component];\n }\n }\n }\n\n this.components = {};\n this.name = name;\n\n this.add = add;\n this.get = get;\n this.has = has;\n this.remove = remove;\n\n this.add(components);\n}\n\nfunction World(context) {\n\n function add(entities) {\n\n if (Array.isArray(entities) === false) {\n\n entities = [entities];\n }\n\n entities.forEach((entity) => {\n\n this.entities[entity.name] = entity;\n });\n }\n\n function get(entity) {\n\n return this.entities[entity];\n }\n\n function remove(entities) {\n\n if (Array.isArray(entities) === false) {\n\n entities = [entities];\n }\n\n for (let iterator = 0, length = entities.length; iterator < length; iterator += 1) {\n\n const entity = entities[iterator];\n const key = entity.name || entity;\n\n if (this.entities.hasOwnProperty(key) === true) {\n\n delete this.entities[key];\n }\n }\n }\n\n function system(components, handler, entities = this.entities) {\n\n const chosen = {};\n\n Object.entries(entities).forEach(([name, entity]) => {\n\n if (entity.has(components) === true) {\n\n chosen[name] = entity;\n }\n });\n\n handler.call(context, chosen);\n }\n\n this.entities = {};\n\n this.add = add;\n this.get = get;\n this.remove = remove;\n this.system = system;\n}\n\nexport {\n\n // exports current module as an object\n World,\n\n // exports helpers for current module\n Entity\n};\n","function Position(x, y) {\n\n this.name = 'position';\n\n this.x = x;\n this.y = y;\n}\n\nexport {Position};\n","import {Entity, World} from 'modules/world.js';\n\nimport {Alphabet} from 'components/demo/alphabet.js';\nimport {Direction} from 'components/demo/direction.js';\nimport {Framerate} from 'components/demo/framerate.js';\nimport {Image} from 'components/demo/image.js';\nimport {Input} from 'components/demo/input.js';\nimport {Position} from 'components/demo/position.js';\nimport {Spritesheet} from 'components/demo/spritesheet.js';\nimport {Text} from 'components/demo/text.js';\n\nfunction start() {\n\n console.log('start demo scene');\n\n this.inputs.length = 0;\n this.world = new World(this);\n\n this.world.add(new Entity('hero', [\n\n new Direction('DOWN'),\n new Image(this.assets.images.demo['wizard'](), [32, 32], [3, 2]),\n new Input(['KEY_UP', 'KEY_RIGHT', 'KEY_DOWN', 'KEY_LEFT']),\n new Position(this.size.width / 2 - 16, this.size.height / 2 - 16),\n new Spritesheet(this.assets.datasets.demo['wizard']())\n ]));\n\n this.world.add(new Entity('framerate', [\n\n new Position(8, 8),\n new Text('fps:60'),\n new Framerate(),\n new Alphabet(this.assets.images.demo['font'](), [16, 32]),\n new Spritesheet(this.assets.datasets.demo['font']())\n ]));\n}\n\nexport {start};\n","function Input(inputs) {\n\n this.name = 'input';\n\n this.inputs = inputs;\n}\n\nexport {Input};\n","function Text(text) {\n\n this.name = 'text';\n\n this.text = text;\n}\n\nexport {Text};\n","function Framerate() {\n\n this.name = 'framerate';\n\n this.elapsed = 0;\n this.frames = 0;\n}\n\nexport {Framerate};\n","function Alphabet(image, size) {\n\n this.name = 'alphabet';\n\n this.image = image;\n this.size = size;\n}\n\nexport {Alphabet};\n","function animate(entities) {\n\n Object.entries(entities).forEach(([name, entity]) => {\n\n const animationComponent = entity.get('animation');\n\n if (animationComponent.frames.length > 1) {\n\n animationComponent.elapsed += this.delta.update;\n\n const duration = 1000 / animationComponent.framerate;\n\n while (animationComponent.elapsed >= duration) {\n\n animationComponent.elapsed -= duration;\n animationComponent.frame = (animationComponent.frame === animationComponent.frames.length - 1) ? 0 : animationComponent.frame + 1;\n animationComponent.current = animationComponent.frames[animationComponent.frame];\n }\n }\n });\n}\n\nexport {animate};\n","function Animation(frames, framerate) {\n\n this.name = 'animation';\n\n this.framerate = framerate || 8;\n this.frames = frames;\n\n this.frame = 0;\n this.current = this.frames[this.frame];\n this.elapsed = 0;\n}\n\nexport {Animation};\n","function Run() {\n\n this.name = 'run';\n}\n\nexport {Run};\n","import {Animation} from 'components/demo/animation.js';\nimport {Direction} from 'components/demo/direction.js';\nimport {Image} from 'components/demo/image.js';\nimport {Run} from 'components/demo/run.js';\nimport {Spritesheet} from 'components/demo/spritesheet.js';\n\nfunction input(entities) {\n\n Object.entries(entities).forEach(([name, entity]) => {\n\n this.inputs.forEach((input) => {\n\n const directionComponent = entity.get('direction');\n const imageComponent = entity.get('image');\n const inputComponent = entity.get('input');\n const spritesheetComponent = entity.get('spritesheet');\n\n if (inputComponent.inputs.indexOf(input.action) !== -1\n && input.state === 'DOWN') {\n\n switch (input.action) {\n\n case 'KEY_UP':\n\n entity.add([\n\n new Run(),\n new Direction('UP'),\n new Animation(spritesheetComponent.spritesheet['RUN_UP'])\n ]);\n\n break;\n\n case 'KEY_RIGHT':\n\n entity.add([\n\n new Run(),\n new Direction('RIGHT'),\n new Animation(spritesheetComponent.spritesheet['RUN_RIGHT'])\n ]);\n\n break;\n\n case 'KEY_DOWN':\n\n entity.add([\n\n new Run(),\n new Direction('DOWN'),\n new Animation(spritesheetComponent.spritesheet['RUN_DOWN'])\n ]);\n\n break;\n\n case 'KEY_LEFT':\n\n entity.add([\n\n new Run(),\n new Direction('LEFT'),\n new Animation(spritesheetComponent.spritesheet['RUN_LEFT'])\n ]);\n\n break;\n }\n }\n\n else if (entity.has(['run']) === true\n && inputComponent.inputs.indexOf(input.action) !== -1\n && input.state === 'UP') {\n\n switch (input.action) {\n\n case 'KEY_UP':\n\n if (directionComponent.direction === 'UP') {\n\n entity.remove(['animation', 'run']);\n imageComponent.frame = spritesheetComponent.spritesheet['IDLE_UP'];\n }\n\n break;\n\n case 'KEY_RIGHT':\n\n if (directionComponent.direction === 'RIGHT') {\n\n entity.remove(['animation', 'run']);\n imageComponent.frame = spritesheetComponent.spritesheet['IDLE_RIGHT'];\n }\n\n break;\n\n case 'KEY_DOWN':\n\n if (directionComponent.direction === 'DOWN') {\n\n entity.remove(['animation', 'run']);\n imageComponent.frame = spritesheetComponent.spritesheet['IDLE_DOWN'];\n }\n\n break;\n\n case 'KEY_LEFT':\n\n if (directionComponent.direction === 'LEFT') {\n\n entity.remove(['animation', 'run']);\n imageComponent.frame = spritesheetComponent.spritesheet['IDLE_LEFT'];\n }\n\n break;\n }\n }\n });\n });\n}\n\nexport {input};\n","function reframe(entities) {\n\n Object.entries(entities).forEach(([name, entity]) => {\n\n entity.get('image').frame = entity.get('animation').current;\n });\n}\n\nexport {reframe};\n","import {animate} from 'systems/demo/animate.js';\nimport {input} from 'systems/demo/input.js';\nimport {reframe} from 'systems/demo/reframe.js';\n\nfunction update() {\n\n // console.log('update demo scene');\n\n this.world.system(['input'], input);\n this.world.system(['animation'], animate);\n this.world.system(['animation', 'image'], reframe);\n\n this.inputs.length = 0;\n}\n\nexport {update};\n","function framerate(entities) {\n\n Object.entries(entities).forEach(([name, entity]) => {\n\n const framerateComponent = entity.get('framerate');\n\n framerateComponent.elapsed += this.delta.render;\n framerateComponent.frames += 1;\n\n if (framerateComponent.elapsed >= 1000) {\n\n entity.get('text').text = 'fps:' + Math.round(framerateComponent.frames * 1000 / framerateComponent.elapsed);\n framerateComponent.elapsed = 0;\n framerateComponent.frames = 0;\n }\n });\n}\n\nexport {framerate};\n","function image(entities) {\n\n Object.entries(entities).forEach(([name, entity]) => {\n\n const imageComponent = entity.get('image');\n const positionComponent = entity.get('position');\n\n this.context.drawImage(\n\n imageComponent.image,\n imageComponent.frame[0] * imageComponent.size[0], imageComponent.frame[1] * imageComponent.size[1], imageComponent.size[0], imageComponent.size[1],\n positionComponent.x, positionComponent.y, imageComponent.size[0], imageComponent.size[1]\n );\n });\n}\n\nexport {image};\n","function text(entities) {\n\n Object.entries(entities).forEach(([name, entity]) => {\n\n const alphabetComponent = entity.get('alphabet');\n const positionComponent = entity.get('position');\n const spritesheetComponent = entity.get('spritesheet');\n const textComponent = entity.get('text');\n\n textComponent.text.split('').forEach((character, index) => {\n\n this.context.drawImage(\n\n alphabetComponent.image,\n spritesheetComponent.spritesheet[character][0] * alphabetComponent.size[0], spritesheetComponent.spritesheet[character][1] * alphabetComponent.size[1], alphabetComponent.size[0], alphabetComponent.size[1],\n positionComponent.x + index * alphabetComponent.size[0], positionComponent.y, alphabetComponent.size[0], alphabetComponent.size[1]\n );\n });\n });\n}\n\nexport {text};\n","import {framerate} from 'systems/demo/framerate.js';\nimport {image} from 'systems/demo/image.js';\nimport {text} from 'systems/demo/text.js';\n\nfunction render() {\n\n // console.log('render demo scene');\n\n this.context.fillStyle = '#a8c0b0';\n this.context.fillRect(0, 0, this.size.width, this.size.height);\n\n this.world.system(['framerate'], framerate);\n this.world.system(['image', 'position'], image);\n this.world.system(['alphabet', 'position'], text);\n}\n\nexport {render};\n","const keynames = [];\n\nkeynames[9] = 'TAB';\nkeynames[13] = 'ENTER';\nkeynames[16] = 'SHIFT';\nkeynames[17] = 'CTRL';\nkeynames[18] = 'ALT';\nkeynames[27] = 'ESC';\nkeynames[32] = 'SPACE';\n\nkeynames[37] = 'LEFT';\nkeynames[38] = 'UP';\nkeynames[39] = 'RIGHT';\nkeynames[40] = 'DOWN';\n\nkeynames[48] = 'ZERO';\nkeynames[49] = 'ONE';\nkeynames[50] = 'TWO';\nkeynames[51] = 'THREE';\nkeynames[52] = 'FOUR';\nkeynames[53] = 'FIVE';\nkeynames[54] = 'SIX';\nkeynames[55] = 'SEVEN';\nkeynames[56] = 'EIGHT';\nkeynames[57] = 'NINE';\n\nkeynames[65] = 'A';\nkeynames[66] = 'B';\nkeynames[67] = 'C';\nkeynames[68] = 'D';\nkeynames[69] = 'E';\nkeynames[70] = 'F';\nkeynames[71] = 'G';\nkeynames[72] = 'H';\nkeynames[73] = 'I';\nkeynames[74] = 'J';\nkeynames[75] = 'K';\nkeynames[76] = 'L';\nkeynames[77] = 'M';\nkeynames[78] = 'N';\nkeynames[79] = 'O';\nkeynames[80] = 'P';\nkeynames[81] = 'Q';\nkeynames[82] = 'R';\nkeynames[83] = 'S';\nkeynames[84] = 'T';\nkeynames[85] = 'U';\nkeynames[86] = 'V';\nkeynames[87] = 'W';\nkeynames[88] = 'X';\nkeynames[89] = 'Y';\nkeynames[90] = 'Z';\n\n// exports current module as an array\nexport {keynames};\n","const TAB = 9;\nconst ENTER = 13;\nconst SHIFT = 16;\nconst CTRL = 17;\nconst ALT = 18;\nconst ESC = 27;\nconst SPACE = 32;\n\nconst LEFT = 37;\nconst UP = 38;\nconst RIGHT = 39;\nconst DOWN = 40;\n\nconst ZERO = 48;\nconst ONE = 49;\nconst TWO = 50;\nconst THREE = 51;\nconst FOUR = 52;\nconst FIVE = 53;\nconst SIX = 54;\nconst SEVEN = 55;\nconst EIGHT = 56;\nconst NINE = 57;\n\nconst A = 65;\nconst B = 66;\nconst C = 67;\nconst D = 68;\nconst E = 69;\nconst F = 70;\nconst G = 71;\nconst H = 72;\nconst I = 73;\nconst J = 74;\nconst K = 75;\nconst L = 76;\nconst M = 77;\nconst N = 78;\nconst O = 79;\nconst P = 80;\nconst Q = 81;\nconst R = 82;\nconst S = 83;\nconst T = 84;\nconst U = 85;\nconst V = 86;\nconst W = 87;\nconst X = 88;\nconst Y = 89;\nconst Z = 90;\n\nexport {\n\n // exports control keys\n TAB, ENTER, SHIFT, CTRL, ALT, ESC, SPACE,\n\n // exports arrow keys\n LEFT, UP, RIGHT, DOWN,\n\n // exports numeric keys\n ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE,\n\n // exports alhabetic keys\n A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z\n};\n","import {Keyboard} from 'modules/keyboard.js';\nimport {DOWN, LEFT, RIGHT, UP} from 'modules/keycodes.js';\n\nfunction setup() {\n\n console.log('setup demo scene');\n\n this.inputs = [];\n\n this.keyboard = new Keyboard([UP, RIGHT, DOWN, LEFT], this.inputs);\n}\n\nexport {setup};\n","import {keynames} from './keynames.js';\n\nfunction Keyboard(codes, inputs) {\n\n const names = [];\n const states = {};\n\n function blur() {\n\n for (let state in states) {\n\n if (states.hasOwnProperty(state)\n && states[state] === true) {\n\n states[state] = false;\n\n inputs.push({\n\n 'type': 'KEYBOARD',\n 'action': state,\n 'state': 'UP'\n });\n }\n }\n }\n\n function destroy() {\n\n removeEventListener('blur', blur);\n removeEventListener('keydown', keydown);\n removeEventListener('keyup', keyup);\n }\n\n function keydown(event) {\n\n const code = event.keyCode;\n const index = codes.indexOf(code);\n\n if (index !== -1\n && states[names[index]] === false) {\n\n event.preventDefault();\n\n states[names[index]] = true;\n\n inputs.push({\n\n 'type': 'KEYBOARD',\n 'action': names[index],\n 'state': 'DOWN'\n });\n }\n }\n\n function keyup(event) {\n\n const code = event.keyCode;\n const index = codes.indexOf(code);\n\n if (index !== -1\n && states[names[index]] === true) {\n\n event.preventDefault();\n\n states[names[index]] = false;\n\n inputs.push({\n\n 'type': 'KEYBOARD',\n 'action': names[index],\n 'state': 'UP'\n });\n }\n }\n\n function setup() {\n\n addEventListener('blur', blur);\n addEventListener('keydown', keydown);\n addEventListener('keyup', keyup);\n }\n\n codes.forEach((code) => {\n\n if (typeof keynames[code] !== 'undefined') {\n\n const name = 'KEY_' + keynames[code];\n\n codes.push(code);\n names.push(name);\n\n states[name] = false;\n }\n });\n\n setup.call(this);\n\n this.destroy = destroy;\n this.setup = setup;\n}\n\n// exports current module as an object\nexport {Keyboard};\n","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAGACAYAAADbINq/AAAWiUlEQVR42u3dSZLbuhIF0L8ML6P2vxoPPfQO/Kd+FSGjyUw05DkRGjjKICESzRVIUf/7HwAAAPBCP76+/vzrNVuuVX73/nvLf9pOtHz0fYxuP/v4R7dT/ffR+o4ev93H//b+l93+V/cf5XPGPwQAAUAAEAAEAAFAAGDXxK8D1By/3eVnB+JV7eqUAPB9O7MTkP6zpv9Ft3f78WttJ9r/RseP0X6BACAACAACgP4nAAgA3B4Aqpbgdtd/1SWI2Ymlail2dQBYXd/qS0Am8Nr+99QAMDqRR/vDbIAw8QsAAoAAIAAIAAKAACAA3B4ATr2JZncHPnUJ3yWAmuMfncDfehNa9gRQHQhPXYLfHQCybuI0wwoAAoAAIAAIAAKAAMDTLwE8tbwAUFuvp34NcHUAyLoEFZ3AZtvfUwLAqq8hVy/hm/gFAAFAABAABAABQAAQAASAmiXApzwIKOs8ZA3g1QNYdCDInkBvexDMqvMfbX9PvQkwq/1n739XAKt6gJNgIAAIAAKAACAACAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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ePwDAxKvY6yBOmtDoQhFRS47qfmh3MAYAAEBIREKwVfUgsGrp0RE+AAAAAPQF8vSJR/gAAAAAUH8CvMOCpfTgWSkKu9gPAAAAAAhfn4DZsqlSmLH1ICTqUnoX+wEAAACgs+CvToB3ENg4HunAKEuAu9sPAAAAAJ2FPzsBs0Fg0ji08cxuQrvbDwAAAAAAMD8BXp8btauJVQS4q/0AAAAAQKszAdor3qtQR3f7AQAAAICWPwFa8llpPKcIMNt+AAAAAACAfAFmXQjpbj8AAAAAAED+BEQV55vtNyocOsp+AAAAAGDp8xSP/K8KYfWmVOvfC3ytf69gtCj7pdYuMxwAAEBrAKQOtAl4/bxKANqmc/VFkKsFMbRw6d3svyu845LjAgAAtAZAO/DRAPASwLg0ywJA89Ou9gMAAABAZwBmBeENQPRl8NnPn7vb324TDAAAAACP+6n4sj+Dep+HaGCfYj8HYgAAAACwTzryrLTkXecDAAAAADZufwAiKq0jDY371gAAAABJRU5ErkJggg==\"","const datasets = [\n\n {\n 'name': 'font',\n 'scope': 'demo',\n 'source': require('./demo/font.json'),\n 'type': 'dataset'\n },\n {\n 'name': 'wizard',\n 'scope': 'demo',\n 'source': require('./demo/wizard.json'),\n 'type': 'dataset'\n }\n];\n\nexport {datasets};\n","const images = [\n\n {\n 'name': 'font',\n 'scope': 'demo',\n 'source': require('./demo/[email protected]'),\n 'type': 'image'\n },\n {\n 'name': 'wizard',\n 'scope': 'demo',\n 'source': require('./demo/[email protected]'),\n 'type': 'image'\n }\n];\n\nexport {images};\n","import {datasets} from './datasets/index.js';\nimport {images} from './images/index.js';\nimport {sounds} from './sounds/index.js';\n\nconst assets = [\n\n ...datasets,\n ...images,\n ...sounds\n];\n\nexport {assets};\n","import {assets} from 'assets/index.js';\nimport * as scenes from 'scenes/index.js';\n\nimport {Theatre} from 'core/theatre.js';\n\nnew Theatre({\n\n 'assets': assets,\n 'container': document.body,\n 'expose': true,\n 'scenes': scenes,\n 'sharp': true,\n 'size': {\n\n 'width': 320,\n 'height': 288\n }\n});\n","import {Canvas} from 'core/canvas.js';\nimport {Loop} from 'core/loop.js';\n\nimport {preload} from 'core/preload.js';\n\nfunction Theatre(config) {\n\n const {assets, container, scenes, size} = config;\n\n const expose = config.expose || false;\n const framerate = config.framerate || 60;\n const sharp = config.sharp || false;\n const speed = config.speed || 1;\n\n let loading = null;\n let restarting = false;\n\n function initialize() {\n\n const canvas = new Canvas('2d', 'theatre', this.size.width, this.size.height);\n\n if (sharp === true) {\n\n canvas.sharp();\n }\n\n container.appendChild(canvas.element);\n\n this.container = container;\n this.context = canvas.context;\n this.element = canvas.element;\n\n this.assets = {};\n this.delta = {};\n this.delta.render = 0;\n this.delta.update = 0;\n\n this.scene = this.scenes.loading;\n this.scene.setup.call(this);\n this.scene.start.call(this);\n\n const loop = new Loop(framerate, speed);\n\n loop.update((timeframe) => {\n\n this.delta.update = timeframe;\n this.scene.update.call(this);\n\n if (restarting === true) {\n\n this.scene.start.call(this);\n\n restarting = false;\n\n return;\n }\n\n if (loading !== null) {\n\n this.scene.destroy.call(this);\n this.scene = this.scenes[loading];\n this.scene.setup.call(this);\n this.scene.start.call(this);\n\n loading = null;\n\n return;\n }\n });\n\n loop.render((timeframe) => {\n\n this.delta.render = timeframe;\n this.scene.render.call(this);\n });\n\n preload(assets, (assets) => {\n\n assets.forEach((asset) => {\n\n if (typeof this.assets[asset.type + 's'] === 'undefined') {\n\n this.assets[asset.type + 's'] = {};\n }\n\n if (typeof this.assets[asset.type + 's'][asset.scope] === 'undefined') {\n\n this.assets[asset.type + 's'][asset.scope] = {};\n }\n\n this.assets[asset.type + 's'][asset.scope][asset.name] = asset.getter;\n });\n\n this.preloading = false;\n });\n\n this.loop = loop;\n this.preloading = true;\n }\n\n function load(scene) {\n\n loading = scene;\n }\n\n function restart() {\n\n restarting = true;\n }\n\n this.preloading = false;\n this.scenes = scenes;\n this.size = size;\n this.state = {};\n this.version = '0.32.0';\n\n this.load = load;\n this.restart = restart;\n\n initialize.call(this, config);\n\n if (expose === true) {\n\n window.theatre = this;\n }\n}\n\n// exports current module as an object\nexport {Theatre};\n","function Canvas(type, identifier, width, height) {\n\n const element = document.createElement('canvas');\n const context = element.getContext(type);\n const ratio = window.devicePixelRatio || 1;\n\n function sharp() {\n\n this.element.style.imageRendering = '-moz-crisp-edges';\n this.element.style.imageRendering = '-webkit-crisp-edges';\n this.element.style.imageRendering = 'crisp-edges';\n this.element.style.imageRendering = 'pixelated';\n this.context.imageSmoothingEnabled = false;\n }\n\n element.setAttribute('id', identifier);\n element.setAttribute('height', ratio * height);\n element.setAttribute('width', ratio * width);\n\n element.style.height = height + 'px';\n element.style.width = width + 'px';\n\n context.scale(ratio, ratio);\n\n this.context = context;\n this.element = element;\n this.sharp = sharp;\n}\n\n// exports current module as an object\nexport {Canvas};\n","function Loop(framerate = 60, speed = 1) {\n\n let elapsedTime = 0;\n let lastRender = null;\n let lastUpdate = null;\n\n function render(handler) {\n\n const currentRender = Date.now();\n\n if (lastRender !== null) {\n\n handler(currentRender - lastRender);\n }\n\n // call user's render handler on each available frame\n requestAnimationFrame(this.render.bind(this, handler));\n\n lastRender = currentRender;\n }\n\n function update(handler) {\n\n const currentUpdate = Date.now();\n\n if (lastUpdate !== null) {\n\n // define elapsed time since last update\n elapsedTime += currentUpdate - lastUpdate;\n }\n\n // call user's update handler matching timeframe, speed and fixing browser time handling\n while (elapsedTime >= 1000 / this.framerate / this.speed) {\n\n // define elapsed time since last user's update handler matching timeframe and speed\n elapsedTime -= 1000 / this.framerate / this.speed;\n\n handler(1000 / this.framerate);\n }\n\n lastUpdate = currentUpdate;\n\n // call update loop at least 60 times per second to quickly catch framerate or speed changes\n setTimeout(this.update.bind(this, handler), 1000 / Math.max(this.framerate, 60));\n }\n\n this.framerate = framerate;\n this.speed = speed;\n\n this.render = render;\n this.update = update;\n}\n\n// exports current module as an object\nexport {Loop};\n","function preload(assets, handler) {\n\n let promises = [];\n\n // preloads each asset\n assets.forEach(function (asset) {\n\n // creates a promise for current asset preloading\n const promise = new Promise(function (resolve, reject) {\n\n // if current asset is a dataset then preload it\n if (asset.type === 'dataset') {\n\n asset.getter = () => asset.source;\n\n resolve(asset);\n }\n\n // if current asset is an image then preload it\n if (asset.type === 'image') {\n\n const image = new Image();\n\n image.src = asset.source;\n\n // when current image is loaded then resolve current promise\n image.onload = function () {\n\n asset.getter = () => image;\n\n resolve(asset);\n };\n }\n\n // if current asset is a sound then preload it\n else if (asset.type === 'sound') {\n\n const sound = new Audio(asset.source);\n\n // when current sound is loaded then resolve current promise\n sound.oncanplaythrough = function () {\n\n asset.getter = () => sound.cloneNode();\n\n resolve(asset);\n };\n }\n });\n\n promises.push(promise);\n });\n\n // call user's success handler when all assets are preloaded\n Promise.all(promises).then(handler);\n}\n\n// exports current module as a function\nexport {preload};\n"],"sourceRoot":""}