var RythmoosEngine=function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=10)}([function(a,b){'use strict';Object.defineProperty(b,'__esModule',{value:!0});var c=function(){function a(){this._keys=[],this._values=[]}return a.prototype.get=function(a){var b=this._keys.indexOf(a);return-1===b?null:this._values[b]},a.prototype.set=function(a,b){var c=this._keys.indexOf(a);-1===c?(this._keys.push(a),this._values.push(b)):this._values[c]=b},a.prototype.remove=function(a){var b=this._keys.indexOf(a);return-1!==b&&(this._keys.splice(b,1),this._values.splice(b,1),!0)},a.prototype.getAll=function(){return this._values.slice()},a.prototype.removeAll=function(){this._keys=[],this._values=[]},a}();b.Map=c},function(a,b){'use strict';Object.defineProperty(b,'__esModule',{value:!0});var c=function(){function a(a){this.backgroundColour='#000000',this._context=a}return Object.defineProperty(a.prototype,'context',{get:function(){return this._context},enumerable:!0,configurable:!0}),a.prototype.contextProperties=function(){},a.prototype.render=function(a){this._context.fillStyle=this.backgroundColour,this._context.fillRect(0,0,this._context.canvas.width,this._context.canvas.height),this.contextProperties(this._context);for(var b,c=0,d=a.getAll();ca.deltaX?-1:0,b._scrollY=0a.deltaY?-1:0}),window.addEventListener('blur',function(){b._leftButton=!1,b._middleButton=!1,b._rightButton=!1})})},a._update=function(){this._movementX=0,this._movementY=0,this._scrollX=0,this._scrollY=0,this._leftClick=!1,this._middleClick=!1,this._rightClick=!1},a._cursorX=0,a._cursorY=0,a._movementX=0,a._movementY=0,a._leftButton=!1,a._leftClick=!1,a._middleButton=!1,a._middleClick=!1,a._rightButton=!1,a._rightClick=!1,a._scrollX=0,a._scrollY=0,a}();b.Mouse=c},function(a,b,c){'use strict';Object.defineProperty(b,'__esModule',{value:!0});var d=c(0),e=function(){function a(){}return a.keyDown=function(a){return this._keys.get(a)||!1},a.keyPressed=function(a){return-1!==this._pressed.indexOf(a)},Object.defineProperty(a,'lastKey',{get:function(){return this._lastKey},enumerable:!0,configurable:!0}),a._init=function(){var a=this;this.preventDefault=!1,this._keys=new d.Map,this._pressed=[],this._lastKey=null,window.addEventListener('keydown',function(b){a.preventDefault&&b.preventDefault(),a._keys.set(b.code,!0),a._pressed.push(b.code),a._lastKey=b.code}),window.addEventListener('keyup',function(b){a.preventDefault&&b.preventDefault(),a._keys.set(b.code,!1)}),window.addEventListener('keypress',function(b){a.preventDefault&&b.preventDefault()})},a._update=function(){this._pressed=[],this._lastKey=null},a}();b.Keyboard=e},function(a,b){'use strict';Object.defineProperty(b,'__esModule',{value:!0});var c=function(){function a(){}return Object.defineProperty(a,'width',{get:function(){return this._canvas.width},enumerable:!0,configurable:!0}),Object.defineProperty(a,'height',{get:function(){return this._canvas.height},enumerable:!0,configurable:!0}),Object.defineProperty(a,'offsetWidth',{get:function(){return this._canvas.offsetWidth},enumerable:!0,configurable:!0}),Object.defineProperty(a,'offsetHeight',{get:function(){return this._canvas.offsetHeight},enumerable:!0,configurable:!0}),Object.defineProperty(a,'offsetX',{get:function(){return this._canvas.offsetLeft},enumerable:!0,configurable:!0}),Object.defineProperty(a,'offsetY',{get:function(){return this._canvas.offsetTop},enumerable:!0,configurable:!0}),a._init=function(a){this._canvas=a},a}();b.Screen=c},function(a,b,c){'use strict';Object.defineProperty(b,'__esModule',{value:!0});var d=c(0),e=function(){function a(){}return a._init=function(a){this._game=a,this._game.load(),0===this._files.getAll().length&&this._fileLoaded()},a.loadImage=function(a,b){var c=this,d=document.createElement('img');b=this.basePath+'/'+b,this._images.set(a,d),this._files.set(a,!1),d.addEventListener('load',function(){c._files.set(a,!0),c._loaded||c._fileLoaded()}),d.addEventListener('error',function(){console.log('Could not load file: '+b+'.')}),d.src=b},a.loadVideo=function(a,b){var c=this,d=document.createElement('video');b=this.basePath+'/'+b,this._videos.set(a,d),this._files.set(a,!1),d.addEventListener('loadeddata',function(){c._files.set(a,!0),c._loaded||c._fileLoaded()}),d.addEventListener('error',function(){console.log('Could not load file: '+b+'.')}),d.src=b},a.loadAudio=function(a,b){var c=this,d=document.createElement('audio');b=this.basePath+'/'+b,this._audios.set(a,d),this._files.set(a,!1),d.addEventListener('loadeddata',function(){c._files.set(a,!0),c._loaded||c._fileLoaded()}),d.addEventListener('error',function(){console.log('Could not load file: '+b+'.')}),d.src=b},a.loadJSON=function(a,b){var c=this,d=new XMLHttpRequest;b=this.basePath+'/'+b,this._json.set(a,{}),this._files.set(a,!1),d.addEventListener('load',function(){c._files.set(a,!0),c._json.set(a,JSON.parse(d.responseText)),c._loaded||c._fileLoaded()}),d.addEventListener('error',function(){console.log('Could not load file: '+b)}),d.open('GET',b,!0),d.send()},a.get=function(a){return null===this._images.get(a)?null===this._videos.get(a)?null===this._audios.get(a)?null===this._json.get(a)?null:this.json(a):this.audio(a):this.video(a):this.image(a)},a.image=function(a){return this._images.get(a)},a.video=function(a){return this._videos.get(a)},a.audio=function(a){return this._audios.get(a)},a.json=function(a){return this._json.get(a)},a.loaded=function(a){return this._files.get(a)||!1},a._fileLoaded=function(){-1===this._files.getAll().indexOf(!1)&&(this._loaded=!0,this._game._start())},a.basePath='.',a._loaded=!1,a._images=new d.Map,a._videos=new d.Map,a._audios=new d.Map,a._json=new d.Map,a._files=new d.Map,a}();b.Loader=e},function(a,b,c){'use strict';Object.defineProperty(b,'__esModule',{value:!0});var d=c(0),e=function(){function a(){}return a._init=function(){this._states=new d.Map},a.set=function(a,b){this._states.set(a,b)},a.get=function(a){return this._states.get(a)},a.inc=function(a){'number'==typeof this._states.get(a)&&this._states.set(a,this._states.get(a)+1)},a.dec=function(a){'number'==typeof this._states.get(a)&&this._states.set(a,this._states.get(a)-1)},a.reverse=function(a){'boolean'==typeof this._states.get(a)&&this._states.set(a,!this._states.get(a))},a}();b.State=e},function(a,b){'use strict';Object.defineProperty(b,'__esModule',{value:!0});var c=function(){function a(){}return a._setFrame=function(a){this._deltaTime=a-this._time,this._time=a},Object.defineProperty(a,'deltaTime',{get:function(){return this._deltaTime},enumerable:!0,configurable:!0}),Object.defineProperty(a,'time',{get:function(){return this._time},enumerable:!0,configurable:!0}),Object.defineProperty(a,'second',{get:function(){return this._deltaTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(a,'FPS',{get:function(){return 1e3/this._deltaTime},enumerable:!0,configurable:!0}),a._deltaTime=0,a._time=0,a}();b.Time=c},function(a,b){'use strict';Object.defineProperty(b,'__esModule',{value:!0});var c=function(){function a(){}return a._init=function(){this._context=document.createElement('canvas').getContext('2d'),this._width=0,this._height=0},a.requestBuffer=function(a,b){return this._context.restore(),this._context.clearRect(0,0,this._width,this._height),this._context.save(),this._width=a,this._height=b,this._context},a.getImageData=function(a,b,c){b=void 0===b?a.width:b,c=void 0===c?a.height:c;var d=this.requestBuffer(b,c);return d.drawImage(a,0,0,b,c),d.getImageData(0,0,b,c)},a.measureText=function(a,b){this._context.save(),this._context.font=b;var c=this._context.measureText(a);return this._context.restore(),c.width},a}();b.VirtualContext=c},function(a,b,c){'use strict';function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}Object.defineProperty(b,'__esModule',{value:!0}),d(c(11)),d(c(12)),d(c(4)),d(c(13)),d(c(6)),d(c(0)),d(c(3)),d(c(1)),d(c(2)),d(c(5)),d(c(7)),d(c(8)),d(c(9))},function(a,b,c){'use strict';Object.defineProperty(b,'__esModule',{value:!0});var d=c(1),e=c(2),f=c(3),g=c(4),h=c(5),i=c(6),j=c(7),k=c(8),l=c(9),m=function(){function a(a,b,c){this._container=c,this._scene=new e.Scene,this._scene.game=this,this._canvas=document.createElement('canvas'),this._renderer=new d.Renderer(this._canvas.getContext('2d')),this._running=!1,this._framerate=60,this._frameID=0,this._startTime=0,this._loopEngine=0,this._now=void 0===window.performance?function(){return Date.now()}:void 0===performance.now?function(){return Date.now()}:function(){return performance.now()},this._canvas.width=a,this._canvas.height=b,this._container.appendChild(this._canvas),l.VirtualContext._init(),h.Screen._init(this._canvas),f.Mouse._init(this._canvas),g.Keyboard._init(),j.State._init(),i.Loader._init(this)}return Object.defineProperty(a.prototype,'width',{get:function(){return this._canvas.width},set:function(a){this._canvas.width=a},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,'height',{get:function(){return this._canvas.height},set:function(a){this._canvas.height=a},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,'container',{get:function(){return this._container},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,'canvas',{get:function(){return this._canvas},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,'running',{get:function(){return this._running},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,'renderer',{get:function(){return this._renderer},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,'scene',{get:function(){return this._scene},set:function(a){a.game=this,this._scene=a},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,'framerate',{get:function(){return this._framerate},enumerable:!0,configurable:!0}),a.prototype.setFramerate=function(a){this._framerate===a||(0===this._loopEngine?cancelAnimationFrame(this._frameID):clearInterval(this._frameID),this._framerate=a,this._startLoop())},a.prototype.load=function(){},a.prototype.create=function(){},a.prototype.update=function(){},a.prototype._start=function(){this._running||(this._running=!0,this.create(),window.focus(),this._startTime=this._now(),this._startLoop())},a.prototype._startLoop=function(){var a=this;60===this.framerate?(this._loopEngine=0,this._loop()):(this._loopEngine=1,this._frameID=setInterval(function(){a._loop()},1e3/this.framerate))},a.prototype._loop=function(){var a=this;0===this._loopEngine?this._frameID=requestAnimationFrame(function(b){k.Time._setFrame(b),a._loop()}):k.Time._setFrame(this._getNewTime()),this.update(),this._scene.update();for(var b,c=0,d=this._scene.getAll();c