var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.owns=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,b){var c=$jscomp.propertyToPolyfillSymbol[b];if(null==c)return a[b];c=a[c];return void 0!==c?c:a[b]};
$jscomp.polyfill=function(a,b,c,d){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,b,c,d):$jscomp.polyfillUnisolated(a,b,c,d))};$jscomp.polyfillUnisolated=function(a,b,c,d){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))return;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})};
$jscomp.polyfillIsolated=function(a,b,c,d){var e=a.split(".");a=1===e.length;d=e[0];d=!a&&d in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var f=0;f<e.length-1;f++){var g=e[f];if(!(g in d))return;d=d[g]}e=e[e.length-1];c=$jscomp.IS_SYMBOL_NATIVE&&"es6"===c?d[e]:null;b=b(c);null!=b&&(a?$jscomp.defineProperty($jscomp.polyfills,e,{configurable:!0,writable:!0,value:b}):b!==c&&($jscomp.propertyToPolyfillSymbol[e]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(e):$jscomp.POLYFILL_PREFIX+e,e=
$jscomp.propertyToPolyfillSymbol[e],$jscomp.defineProperty(d,e,{configurable:!0,writable:!0,value:b})))};$jscomp.assign=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)$jscomp.owns(d,e)&&(a[e]=d[e])}return a};$jscomp.polyfill("Object.assign",function(a){return a||$jscomp.assign},"es6","es3");
$jscomp.polyfill("Array.prototype.fill",function(a){return a?a:function(b,c,d){var e=this.length||0;0>c&&(c=Math.max(0,e+c));if(null==d||d>e)d=e;d=Number(d);0>d&&(d=Math.max(0,e+d));for(c=Number(c||0);c<d;c++)this[c]=b;return this}},"es6","es3");$jscomp.typedArrayFill=function(a){return a?a:Array.prototype.fill};$jscomp.polyfill("Int8Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint8Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");
$jscomp.polyfill("Uint8ClampedArray.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Int16Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint16Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Int32Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint32Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Float32Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");
$jscomp.polyfill("Float64Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");window.tabageos=window.tabageos||{};"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(a,b){if(null==a)throw new TypeError("Cannot convert undefined or null to object");for(var c=Object(a),d=1;d<arguments.length;d++){var e=arguments[d];if(null!=e)for(var f in e)Object.prototype.hasOwnProperty.call(e,f)&&(c[f]=e[f])}return c},writable:!0,configurable:!0});
(function(){function a(){}a.started=!1;a.time=0;a.timeElapsed=1;a.newTime=0;a.slowness=60;a._aid=0;a._oaid=0;a._sae=.666666666667;a.keepTime=function(){0==tabageos.TimeKeeper.started&&(tabageos.TimeKeeper.started=!0,tabageos.TimeKeeper.time=a.now());tabageos.TimeKeeper.newTime=a.now();tabageos.TimeKeeper.timeElapsed=tabageos.TimeKeeper.newTime-tabageos.TimeKeeper.time;tabageos.TimeKeeper.time=tabageos.TimeKeeper.newTime};a._keepTime=function(b){tabageos.TimeKeeper.newTime=b;tabageos.TimeKeeper.timeElapsed=
tabageos.TimeKeeper.newTime-tabageos.TimeKeeper.time;tabageos.TimeKeeper.time=tabageos.TimeKeeper.newTime};a.status=function(b){0==b?(tabageos.TimeKeeper.timeElapsed=1,tabageos.TimeKeeper.started=!1):(tabageos.TimeKeeper.time=a.now(),tabageos.TimeKeeper.started=!0)};a.reset=function(b){tabageos.TimeKeeper.status(!1);tabageos.TimeKeeper.status(!0);window.requestAnimationFrame(function(c){tabageos.TimeKeeper.time=c})};a.init=function(){a._sae=-99;a._aid=window.requestAnimationFrame(function(b){tabageos.TimeKeeper.time=
b;window.cancelAnimationFrame(a._aid);a._oaid=window.requestAnimationFrame(function(c){a._keepTime(c);a.speedAdjustedElapsed()})})};a.speedAdjustedElapsed=function(){if(-99==a._sae){window.cancelAnimationFrame(a._oaid);var b=1;a.timeElapsed>1E3/a.slowness&&(b=a.timeElapsed/(1E3/a.slowness));a._sae=a.timeElapsed/b-Math.floor(1E3/a.slowness)}return a._sae};a.now=function(){return performance&&performance.now?performance.now():Date.now()};tabageos.TimeKeeper=a})();
(function(){function a(b,c,d,e){this.x=b||0;this.y=c||0;this.height=e||0;this.width=d||0}a.prototype.x=0;a.prototype.y=0;a.prototype.width=0;a.prototype.height=0;a.prototype.constructor=a;tabageos.Rectangle=a})();
(function(){function a(){}a.boundTo=function(b,c){var d=b.getPosition(),e=b.width;b=b.height;d.x+e>=c.x+c.width&&(d.x=c.x+c.width-e);d.x<c.x&&(d.x=c.x);d.y+b>=c.y+c.height&&(d.y=c.y+c.height-b);d.y<c.y&&(d.y=c.y)};a.bounceOff=function(b,c){var d=b.getPosition(),e=b.width,f=b.height;d.x+e>=c.x+c.width&&(d.x=c.x+c.width-e,b._veloc.x*=-1);d.x<c.x&&(d.x=c.x,b._veloc.x*=-1);d.y+f>=c.y+c.height&&(d.y=c.y+c.height-f,b._veloc.y*=-1);d.y<c.y&&(d.y=c.y,b._veloc.y*=-1)};a.wrapAround=function(b,c){var d=b.getPosition(),
e=b.width;b=b.height;d.x>c.x+c.width+e&&(d.x=c.x-e);d.x<c.x-e&&(d.x=c.x+c.width+e);d.y>c.y+c.height+b&&(d.y=c.y-b);d.y<c.y-b&&(d.y=c.y+c.height)};tabageos.BoundMethods=a})();
(function(){function a(b,c){this.x=b||0;this.y=c||0;this._angle=this._length=0}a.prototype.constructor=a;a.prototype.x=null;a.prototype.y=null;a.prototype._length=null;a.prototype._angle=null;a._poolIndex=0;a.pool=[];a.newMoverPoint=function(b,c){if(0>=tabageos.MoverPoint.pool.length){for(;250>tabageos.MoverPoint.pool.length;)tabageos.MoverPoint.pool.push(new tabageos.MoverPoint);tabageos.MoverPoint._poolIndex=249}tabageos.MoverPoint._poolIndex--; -1>=tabageos.MoverPoint._poolIndex&&(window.console.log("mppool"),
tabageos.MoverPoint._poolIndex=249);return tabageos.MoverPoint._setInstance(tabageos.MoverPoint.pool[tabageos.MoverPoint._poolIndex],b,c,0,0)};a._setInstance=function(b,c,d,e,f){b.x=c;b.y=d;b._length=e;b._angle=f;return b};a.prototype.getSquaredLength=function(){return this.x*this.x+this.y*this.y};a.prototype.perp=function(){return new tabageos.MoverPoint(-this.y,this.x)};a.prototype.getX=function(){return this.x};a.prototype.setX=function(b){this.x=b};a.prototype.getY=function(){return this.y};a.prototype.setY=
function(b){this.y=b};a.prototype.getAngle=function(){this._angle||(this._angle=Math.atan2(this.y,this.x));return this._angle};a.prototype.setAngle=function(b){var c=this.getLength();this.x=Math.cos(b)*c;this.y=Math.sin(b)*c;this._angle=b};a.prototype.getLength=function(){this._length||(this._length=Math.sqrt(this.getSquaredLength()));return this._length};a.prototype.setLength=function(b){var c=this.getAngle();this.x=Math.cos(c)*b;this.y=Math.sin(c)*b;this._length=b};a.prototype.normalize=function(){if(0==
this.getLength())return this.x=1,this;var b=this.getLength();this.x/=b;this.y/=b;return this};a.prototype.reverse=function(){this.x=-this.x;this.y=-this.y;return this};a.prototype.subtractBy=function(b,c,d){if(0!=d)return tabageos.MoverPoint.newMoverPoint(this.x-b,this.y-c);this.x-=b;this.y-=c;return this};a.prototype.truncate=function(b){this.setLength(this.getLength()>b?b:this.getLength());return this};a.prototype.subtract=function(b,c){if(0!=c)return tabageos.MoverPoint.newMoverPoint(this.x-b.x,
this.y-b.y);this.x-=b.x;this.y-=b.y;return this};a.prototype.add=function(b,c){if(0!=c)return tabageos.MoverPoint.newMoverPoint(this.x+b.x,this.y+b.y);this.x+=b.x;this.y+=b.y;return this};a.prototype.sign=function(b){return 0>this.perp().dotProduct(b)?-1:1};a.prototype.multiply=function(b,c){if(0!=c)return tabageos.MoverPoint.newMoverPoint(this.x*b,this.y*b);this.x*=b;this.y*=b;return this};a.prototype.dotProduct=function(b){return this.x*b.x+this.y*b.y};a.prototype.squaredDistance=function(b){var c=
b.x-this.x;b=b.y-this.y;return c*c+b*b};a.prototype.equals=function(b){return this.x==b.x&&this.y==b.y};a.prototype.dist=function(b){return Math.sqrt(this.squaredDistance(b))};a.prototype.clone=function(){return new tabageos.MoverPoint(this.x,this.y)};a.prototype.lesserClone=function(){return tabageos.MoverPoint.newMoverPoint(this.x+1-1,this.y+1-1)};a.prototype.addBy=function(b,c,d){if(0!=d)return tabageos.MoverPoint.newMoverPoint(this.x+b,this.y+c);this.x+=b;this.y+=c;return this};a.prototype.reset=
function(){this.y=this.x=0;this._length=Math.sqrt(this.getSquaredLength());this._angle=Math.atan2(this.y,this.x)};a.prototype.divide=function(b,c){if(0!=c)return tabageos.MoverPoint.newMoverPoint(this.x/b,this.y/b);this.x/=b;this.y/=b;return this};a.angleBetweenMoverPoints=function(b,c){1!=b.getLength()&&(b=b.clone().normalize());1!=c.getLength()&&(c=c.clone().normalize());return Math.acos(b.dotProduct(c))};a.squaredDistanceBetween=function(b,c){var d=b.x-c.x;b=b.y-c.y;return d*d+b*b};a.distBetween=
function(b,c){return Math.sqrt(tabageos.MoverPoint.squaredDistanceBetween(b,c))};tabageos.MoverPoint=a})();
(function(){function a(b,c,d,e){this.width=d||0;this.height=e||0;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(b,c);this._veloc=new tabageos.MoverPoint(0,0);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=new tabageos.MoverPoint(b,c);this.x=b||0;this.y=c||0;this.maxSpeed=20;this.mass=2;this.dY=this.dX=null;this._rect=new tabageos.Rectangle(this.x,this.y,this.width,this.height)}a.prototype.constructor=a;a.prototype.maxSpeed=20;a.prototype.mass=2;a.prototype._veloc=
null;a.prototype._pos=null;a.prototype._lastPos=null;a.prototype._lastVeloc=null;a.prototype._rect=null;a.prototype.dX=null;a.prototype.x=null;a.prototype.dY=null;a.prototype.y=null;a.prototype.width=null;a.prototype.height=null;a.prototype._middlePoint=null;a.prototype.getHeight=function(){return this.height};a.prototype.getVerticalDirection=function(){return this.dY};a.prototype.getHorizontalDirection=function(){return this.dX};a.prototype.getWidth=function(){return this.width};a.prototype.getPosition=
function(){return this._pos};a.prototype.setPosition=function(b){this._pos=b;this.x=this._pos.x+1-1;this.y=this._pos.y+1-1};a.prototype.getVelocity=function(){return this._veloc};a.prototype.setVelocity=function(b){this._veloc=b};a.prototype.getX=function(){return this.x};a.prototype.setX=function(b,c){c||(b>this.x&&(this.dX=1),b<this.x&&(this.dX=-1),b==this.x&&(this.dX=0));this.x=b+1-1;this._pos.x=b+1-1};a.prototype.getY=function(){return this.y};a.prototype.setY=function(b,c){c||(b>this.y&&(this.dY=
1),b<this.y&&(this.dY=-1),b==this.y&&(this.dY=0));this.y=b+1-1;this._pos.y=b+1-1};a.prototype.getMiddle=function(){this._middlePoint.reset();this._middlePoint.x=this.x+(this.width>>1);this._middlePoint.y=this.y+(this.height>>1);return this._middlePoint};a.prototype.getRectangle=function(b,c){this._rect.x=this.x+1-1;this._rect.y=this.y+1-1;this._rect.width=this.width+1-1+(b||0);this._rect.height=this.height+1-1+(c||0);return this._rect};a.prototype.update=function(){this._lastPos.x=this._pos.x+1-1;
this._lastPos.y=this._pos.y+1-1;this._lastVeloc.x=this._veloc.x+1-1;this._lastVeloc.y=this._veloc.y+1-1;this._unGrounded=this._grounded+1-1;this._npRight=this._pRight+1-1;this._npLeft=this._pLeft+1-1;this._unCeiling=this._atCeiling+1-1};tabageos.MoverSkeleton=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p,q){tabageos.MoverSkeleton.call(this,b,c,d,e);this.width=d||0;this.height=e||0;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(b||0,c||0);this._veloc=new tabageos.MoverPoint(0,0);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=new tabageos.MoverPoint(b||0,c||0);this._deltaTime=k||tabageos.TimeKeeper._sae;this._map=h?f:tabageos.BlitMath.cloneMultiArray(f);this._rect=new tabageos.Rectangle(this.x,this.y,this.width,
this.height);this._state=1;this.x=b||0;this.y=c||0;this._canvasAnimation=g||null;this._checkHelper=new tabageos.MoverPoint;this._jumps=0;this._jumpSpeed=4;this._jsp=1;this._walkSpeed=4;this._gravityLevel=.285;this._grounded=this._npRight=this._pRight=this._npLeft=this._pLeft=0;this._unGrounded=1;this._atCeiling=0;this._unCeiling=1;this._mt=q||0;this._mapRows=m||f.length;this._mapColumns=p||f[0].length;this._mt=this._map&&this._map[0]&&this._map[0][1]&&("array"==typeof this._map[0][1]||"object"==typeof this._map[0][1])?
1:0;this._tw=l||this.width;this._th=n||this.height}a.prototype.constructor=a;a.prototype=Object.create(tabageos.MoverSkeleton.prototype);a.prototype._mapRows=0;a.prototype._mapColumns=0;a.prototype.stand=1;a.prototype.walk=2;a.prototype.up=3;a.prototype.down=4;a.prototype._deltaTime=.666666667;a.prototype._state=1;a.prototype._jumps=0;a.prototype._jumpSpeed=4;a.prototype._jsp=1;a.prototype._walkSpeed=4;a.prototype._gravityLevel=.285;a.prototype._pLeft=0;a.prototype._npLeft=0;a.prototype._pRight=0;
a.prototype._npRight=0;a.prototype._grounded=0;a.prototype._unGrounded=1;a.prototype._atCeiling=0;a.prototype._unCeiling=1;a.prototype._checkHelper=null;a.prototype._map=null;a.prototype._canvasAnimation=null;a.prototype._tw=16;a.prototype._th=16;a.prototype._mt=0;a.prototype._directCanvasObject=null;a.prototype._autoAnimate=0;a.prototype._autoAnimationThrottle=.5;a.prototype.setupForTileMove=function(){this._jumps=0;this._deltaTime=1;this._jumpSpeed=this._tw+1-1;this.maxSpeed=this._tw+1-1;this._walkSpeed=
this._tw+1-1};a.prototype.tileMove=function(b,c,d,e){b&&!this._pLeft&&(this._veloc.x=-this._tw);c&&!this._pRight&&(this._veloc.x=this._tw);b||c||(this._veloc.x=0);d&&!this._atCeiling&&(this._veloc.y=-this._th);e&&!this._grounded&&(this._veloc.y=this._th);d||e||(this._veloc.y=0);this.update(0,1,0)};a.prototype.move=function(b,c,d,e){1==this._state?(this._veloc.x=0,this._veloc.y=0,!this._grounded||this._atCeiling?this._state=3:b&&!c||c&&!b?this._state=2:d&&!this._atCeiling?(this._jsp=this._jumpSpeed-
2,this._veloc.y=this._jumps?-(this._jumpSpeed-(this._jumpSpeed-2)):-this._jumpSpeed,this._state=3):d||this._jumps||!e||(this._veloc.y=this._walkSpeed,this._state=4),this.update()):2==this._state?(b||c?c?this._veloc.x=this._pRight?0:this._walkSpeed:b&&(this._veloc.x=this._pLeft?0:-this._walkSpeed):(this._state=1,this._veloc.x=0,this._veloc.y=0),d&&!this._atCeiling?(this._jsp=this._jumpSpeed-2,this._veloc.y=this._jumps?-(this._jumpSpeed-(this._jumpSpeed-2)):-this._jumpSpeed,this._state=3):d&&this._atCeiling?
this._jumps&&!this._grounded&&(this._state=3,this._veloc.y=this._walkSpeed):d||this._grounded||(this._state=3),this.update()):3==this._state?(this._jumps?(d&&!this._atCeiling&&this._veloc.y>-this._jumpSpeed&&0!=this._jsp?(--this._jsp,this._veloc.y=-(this._jumpSpeed-this._jsp)):this._jsp=0,this._veloc.y+=this._gravityLevel*this._deltaTime,this._veloc.y>this._jumpSpeed&&(this._veloc.y=this._jumpSpeed+1-1),!d&&0<this._veloc.y&&(this._veloc.y=this._veloc.y>this._jumpSpeed?this._jumpSpeed+1-1:this._veloc.y)):
(this._veloc.y=d&&!this._atCeiling?-this._walkSpeed:0,d)||(b||c||e?!b&&!c||e?e&&(this._state=4,this._veloc.y=this._walkSpeed):(this._state=2,this._veloc.y=0):(this._state=1,this._veloc.x=0,this._veloc.y=0)),c||b?c?this._veloc.x=this._pRight?0:this._walkSpeed:b&&(this._veloc.x=this._pLeft?0:-this._walkSpeed):this._veloc.x=0,this._grounded?(c||b?this._state=2:(this._state=1,this._veloc.x=0),this._veloc.y=0):!this._jumps&&e&&(this._veloc.y=this._walkSpeed,this._state=4),this.update()):this._jumps||4!=
this._state||(this._veloc.y=e&&!this._grounded?this._walkSpeed:0,e||(b||c?this._state=2:(this._state=1,this._veloc.x=0),this._veloc.y=0),c||b?c?this._veloc.x=this._pRight?0:this._walkSpeed:b&&(this._veloc.x=this._pLeft?0:-this._walkSpeed):this._veloc.x=0,this._atCeiling&&(c||b?this._state=2:(this._state=1,this._veloc.x=0),this._veloc.y=0),this.update())};a.prototype.update=function(b){this._lastPos.x=this._pos.x+1-1;this._lastPos.y=this._pos.y+1-1;this._lastVeloc.x=this._veloc.x+1-1;this._lastVeloc.y=
this._veloc.y+1-1;this._unGrounded=this._grounded+1-1;this._npRight=this._pRight+1-1;this._npLeft=this._pLeft+1-1;this._unCeiling=this._atCeiling+1-1;this._pos.x+=this._veloc.x*this._deltaTime;this._pos.y+=this._veloc.y*this._deltaTime;var c=this.isLeftPushingOnMap(this._lastPos,this._pos,this._veloc,this._map,this._tw,this._th);0<c?(this._pLeft=1,this._pos.x=c+1,this._veloc.x=0):this._pLeft=0;c=this.isRightPushingOnMap(this._lastPos,this._pos,this._veloc,this._map,this._tw,this._th);0<c?(this._pRight=
1,this._pos.x=c-this.width,this._veloc.x=0):this._pRight=0;c=this.isGroundedOnMap(this._lastPos,this._pos,this._veloc,this._map,this._tw,this._th);0<c?(this._grounded=1,this._pos.y=c-this.height,this._veloc.y=0):this._grounded=0;c=this.isHeadHitOnMap(this._lastPos,this._pos,this._veloc,this._map,this._tw,this._th);0<c?(this._atCeiling=1,this._jumps?(this._pos.y<c&&(this._pos.y=c),0>this._veloc.y&&(this._veloc.y=this._jumps&&!this._grounded?this._walkSpeed:0)):(this._pos.y=c,this._veloc.y=0)):this._atCeiling=
0;b||(this.setX(this._pos.x+1-1),this.setY(this._pos.y+1-1));this._autoAnimate&&this._canvasAnimation?(this._canvasAnimation.x=Math.round(this.x),this._canvasAnimation.y=Math.round(this.y),this._canvasAnimation.changeDirectionAnimation(0>this._veloc.x,0<this._lastVeloc.x,0>this._veloc.y,0<this._veloc.y),this._canvasAnimation.animate(this._autoAnimationThrottle),this._canvasAnimation.blit()):this._autoAnimate&&this._directCanvasObject&&this._directCanvasObject.context.fillRect(Math.round(this.x),Math.round(this.y),
this.width,this.height)};a.prototype.isGroundedOnMap=function(b,c,d,e,f,g){b=this._pos.x+1-1;c=this._pos.y+this.height+(Math.abs(this._veloc.y)<g?1>this._veloc.y?1:this._veloc.y:1);d=this._pos.x+this.width;e=-999;for(var h;b<d;){tabageos.BlitMath.fasterCheckTileValueAt(b,c,this._mapRows,this._mapColumns,f,g,this._checkHelper);h=this._checkHelper.y;var k=this._checkHelper.x;k=this._map[h][k];if(0===this._mt&&0!=k||1===this._mt&&(0!=k[0]||0!=k[1]))e=h*g+1-1,e<c||(e=-1);b+=(f>this.width?this.width:f)/
4}return e};a.prototype.isHeadHitOnMap=function(b,c,d,e,f,g){b=this._pos.x+1-1;c=this._pos.y-1-(Math.abs(this._veloc.y)<g?-this._veloc.y:0);d=this._pos.x+this.width;e=-999;for(var h;b<d;){tabageos.BlitMath.fasterCheckTileValueAt(b,c,this._mapRows,this._mapColumns,f,g,this._checkHelper);h=this._checkHelper.y;var k=this._checkHelper.x;k=this._map[h][k];if(0===this._mt&&0!=k||1===this._mt&&(0!=k[0]||0!=k[1]))e=h*g+g,e>c||(e=-1);b+=f>this.width?this.width:f}return e};a.prototype.isRightPushingOnMap=function(b,
c,d,e,f,g){b=this._pos.y+1-1;c=this._pos.y+this.height;d=this._pos.x+this.width+1;e=-999;for(var h;b<c;){tabageos.BlitMath.fasterCheckTileValueAt(d,b,this._mapRows,this._mapColumns,f,g,this._checkHelper);var k=this._checkHelper.y;h=this._checkHelper.x;k=this._map[k][h];if(0===this._mt&&0!=k||1===this._mt&&(0!=k[0]||0!=k[1]))if(e=h*f+1-1,e<d)break;else e=-1;b+=g>this.height?this.height:g}return e};a.prototype.isLeftPushingOnMap=function(b,c,d,e,f,g){b=this._pos.y+1-1;c=this._pos.y+this.height;d=this._pos.x-
1;e=-999;for(var h;b<c;){tabageos.BlitMath.fasterCheckTileValueAt(d,b,this._mapRows,this._mapColumns,f,g,this._checkHelper);var k=this._checkHelper.y;h=this._checkHelper.x;k=this._map[k][h];if(0===this._mt&&0!=k||1===this._mt&&(0!=k[0]||0!=k[1]))if(e=h*f+f,e>d)break;else e=-1;b+=g>this.height?this.height:g}return e};tabageos.MapMover=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p){tabageos.MoverSkeleton.call(this,b,c,d,e);tabageos.MapMover.call(this,b,c,d,e,f,g,h,k,l,n,m,p);this.width=d||0;this.height=e||0;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(b||0,c||0);this._veloc=new tabageos.MoverPoint(0,0);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=new tabageos.MoverPoint(b,c);this._deltaTime=k||tabageos.TimeKeeper._sae;this._map=h?f:tabageos.BlitMath.cloneMultiArray(f);this._rect=new tabageos.Rectangle(this.x,
this.y,this.width,this.height);this._state=1;this.x=b||0;this.y=c||0;this._tH=n||this.height;this._tW=l||this.width;this._canvasAnimation=g||null;this.tileValue=this.playerHoldingThis=null;this.weight=24;this.xDirection=1;this._eHit=this._solidSit=0;this.tileRect=null;this._checkHelper=new tabageos.MoverPoint}a.prototype.constructor=a;a.prototype=Object.create(tabageos.MoverSkeleton.prototype);Object.assign(a.prototype,tabageos.MapMover.prototype);a.prototype.playerHoldingThis;a.prototype.weight=
1;a.prototype._canvasAnimation=null;a.prototype.xDirection=1;a.prototype.tileValue=null;a.prototype.tileRect=null;a.prototype._eHit=0;a.prototype._solidSit=0;tabageos.SceneryObject=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p){tabageos.MoverSkeleton.call(this,b,c,d,e);tabageos.MapMover.call(this,b,c,d,e,f,g,h,k,l,n,m,p);this.width=d||0;this.height=e||0;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(b||0,c||0);this._veloc=new tabageos.MoverPoint(0,0);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=new tabageos.MoverPoint(b,c);this._deltaTime=k||tabageos.TimeKeeper._sae;this._map=h?f:tabageos.BlitMath.cloneMultiArray(f);this._state=1;
this.x=b||0;this.y=c||0;this._rect=new tabageos.Rectangle(this.x,this.y,this.width,this.height);this._canvasAnimation=g||null;this._tH=n||16;this._tW=l||16;this._outAltered=new tabageos.MoverPoint;this.holdingRect=new tabageos.Rectangle(0,0,d,e);this.holdingOffsetX=1;this.holdingOffsetY=3;this.health=100;this.holding=null;this.nameOfThrower="strawHat";this._checkHelper=new tabageos.MoverPoint}a.prototype.constructor=a;a.prototype=Object.create(tabageos.MoverSkeleton.prototype);Object.assign(a.prototype,
tabageos.MapMover.prototype);a.prototype.throwStrength=10;a.prototype.health=100;a.prototype.holding;a.prototype.holdingRect;a.prototype._canvasAnimation=null;a.prototype._outAltered;a.prototype.holdingOffsetX=1;a.prototype.holdingOffsetY=3;a.prototype.nameOfThrower="strawHat";a.prototype.alteredPosition=function(b,c){this._outAltered.x=this.x-(b||0);this._outAltered.y=this.y-(c||0);return this._outAltered};a.prototype.holdingImageRect=function(){return this.holdingRect};a.prototype.pickUpTileData=
function(b,c,d){return this.holding?!1:(this.holding=b,this.holdingRect.x=this.holding.value[1]*this._tw,this.holdingRect.y=this.holding.value[0]*this._th,this.holdingRect.width=this._tw,this.holdingRect.height=this._th,c&&(this.holdingRect.width+=c),d&&(this.holdingRect.height+=d),!0)};a.prototype.pickUp=function(b,c,d){return this.holding?!1:(this.holding=b,this.holdingRect.x=b.tileValue[1]*b.width,this.holdingRect.y=b.tileValue[0]*b.height,this.holdingRect.width=b.width,this.holdingRect.height=
b.height,c&&(this.holdingRect.width+=c),d&&(this.holdingRect.height+=d),!0)};a.prototype._throwHolding=function(){this.holding=null};a.prototype.throwSceneryObject=function(b,c,d){return this.holding?(b=new tabageos.SceneryObject(this.x+1-1,this.y+1-1,b||this._tw,c||this._th,this._map,null,1,this._deltaTime,this._tw,this._th,this._mapRows,this._mapColumns),b._jumps=d||0,b.playerHoldingThis=this,b.tileValue=this.holding.value||this.holding.tileValue,b.tileRect=new tabageos.Rectangle(this.holdingRect.x,
this.holdingRect.y,this.holdingRect.width,this.holdingRect.height),this._throwHolding(),b):null};tabageos.SceneryThrower=a})();
(function(){function a(b,c,d,e){this.forceApplier=new tabageos.MoverPoint;this.forceHolder=new tabageos.MoverPoint;this._w=d||0;this._h=e||0;this.wanderOffset=new tabageos.MoverPoint(0,0);this.blankMO=new tabageos.MoverPoint;this._veloc=new tabageos.MoverPoint;this._eventDispatcher=new tabageos.EventDispatcher;this.width=d||0;this.height=e||0;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(b,c);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=new tabageos.MoverPoint(b,
c);this.x=b||0;this.y=c||0;this.dY=this.dX=0;this._rect=new tabageos.Rectangle(this.x,this.y,this.width,this.height);this.separationDistance=this.circleDistance=this.spreadDistance=10;this.bypassAvoidDistance=null;this.maxForce=12;this.followDistance=this._w;this.easeProximity=2;this.wanderAngle=this.wanderProximity=10;this.avoidSpace=this.wanderRange=this.wanderRadius=20;this.avoidee=null;this.personalSpace=this.visionDistance=this.avoidDistance=20;this.mass=2;this.maxSpeed=5;this.bird=this.flockCount=
null;this._pathIndex=0;this._hp=new tabageos.MoverPoint;this._vp=new tabageos.MoverPoint;this._pathEvent=new tabageos.Event("pathComplete");this.listenerMethods=this.listenerStrings=null}a.prototype.constructor=a;a.prototype.spreadDistance=10;a.prototype.circleDistance=10;a.prototype.separationDistance=10;a.prototype.bypassAvoidDistance=null;a.prototype.maxForce=12;a.prototype.forceApplier=null;a.prototype.followDistance=null;a.prototype.easeProximity=2;a.prototype.wanderProximity=10;a.prototype.wanderAngle=
10;a.prototype.wanderRadius=20;a.prototype.wanderRange=20;a.prototype.wanderOffset=null;a.prototype.avoidSpace=20;a.prototype.avoidee=null;a.prototype.avoidDistance=20;a.prototype.visionDistance=20;a.prototype.personalSpace=20;a.prototype.mass=2;a.prototype.maxSpeed=5;a.prototype._veloc=null;a.prototype.forceHolder=null;a.prototype.blankMO=null;a.prototype.flockCount=null;a.prototype.bird=null;a.prototype._eventDispatcher=null;a.prototype._pathIndex=0;a.prototype.path=null;a.prototype._pathEvent=
null;a.prototype.listenerStrings=null;a.prototype.listenerMethods=null;a.prototype._pos=null;a.prototype._lastPos=null;a.prototype._lastVeloc=null;a.prototype._rect=null;a.prototype.dX=null;a.prototype.x=null;a.prototype.dY=null;a.prototype.y=null;a.prototype.width=null;a.prototype.height=null;a.prototype._hp=null;a.prototype._vp=null;a.prototype._middlePoint=null;a.prototype.getHeight=function(){return this.height};a.prototype.getVerticalDirection=function(){return this.dY};a.prototype.getHorizontalDirection=
function(){return this.dX};a.prototype.getWidth=function(){return this.width};a.prototype.getPosition=function(){return this._pos};a.prototype.setPosition=function(b){this._pos=b;this.x=this._pos.x+1-1;this.y=this._pos.y+1-1};a.prototype.getVelocity=function(){return this._veloc};a.prototype.setVelocity=function(b){this._veloc=b};a.prototype.getX=function(){return this.x};a.prototype.setX=function(b,c){c||(b>this.x&&(this.dX=1),b<this.x&&(this.dX=-1),b==this.x&&(this.dX=0));this.x=b+1-1;this._pos.x=
b+1-1};a.prototype.getY=function(){return this.y};a.prototype.setY=function(b,c){c||(b>this.y&&(this.dY=1),b<this.y&&(this.dY=-1),b==this.y&&(this.dY=0));this.y=b+1-1;this._pos.y=b+1-1};a.prototype.getMiddle=function(){this._middlePoint.reset();this._middlePoint.x=this.x+(this.width>>1);this._middlePoint.y=this.y+(this.height>>1);return this._middlePoint};a.prototype.getRectangle=function(b,c){this._rect.x=this.x+1-1;this._rect.y=this.y+1-1;this._rect.width=this.width+1-1+(b||0);this._rect.height=
this.height+1-1+(c||0);return this._rect};a.prototype.update=function(){this._lastPos.x=this._pos.x+1-1;this._lastPos.y=this._pos.y+1-1;this._lastVeloc.x=this._veloc.x+1-1;this._lastVeloc.y=this._veloc.y+1-1;this._unGrounded=this._grounded+1-1;this._npRight=this._pRight+1-1;this._npLeft=this._pLeft+1-1;this._unCeiling=this._atCeiling+1-1};a.prototype.getMaxForceSquared=function(){return this.maxForce*this.maxForce};a.prototype.getPathIndex=function(){return this._pathIndex};a.prototype.setPathIndex=
function(b){this._pathIndex=b};a.prototype.separate=function(b,c){this.getSeparationForce(b);1<c&&this.forceApplier.multiply(c,0)};a.prototype.separateFromThis=function(b){var c=tabageos.MoverPoint.distBetween(this._pos,b.getPosition());0<c&&c<this.separationDistance&&(this._hp.x=this._pos.x,this._hp.y=this._pos.y,this._hp.subtract(b.getPosition(),0),this._hp.multiply(c,0),this.forceApplier.add(this._hp,0))};a.prototype.getSteerForce=function(b,c,d){this._hp.x=b.x;this._hp.y=b.y;b=this._hp;b.subtract(this._pos,
0);var e=this._pos.dist(b.normalize());0<e&&(e<d&&c?b.multiply(e/d*this.maxSpeed,0):b.multiply(this.maxSpeed,0),b.subtract(this._veloc,0),b.getSquaredLength()>this.getMaxForceSquared()&&b.truncate(this.maxForce));return b};a.prototype.flee=function(b){this._hp.x=b.x;this._hp.y=b.y;b=this._hp.subtract(this._pos,0);b.normalize();b.multiply(this.maxSpeed,0);b=b.subtract(this._veloc,0);this.forceApplier.subtract(b,0)};a.prototype.easeTo=function(b){this._hp.x=b.x+1-1;this._hp.y=b.y+1-1;var c=this._hp.subtract(this._pos,
0);c.normalize();b=this._pos.dist(b);b>this.easeProximity?c.multiply(this.maxSpeed,0):c.multiply(this.maxSpeed*b/this.easeProximity,0);c=c.subtract(this._veloc,0);this.forceApplier.add(c,0)};a.prototype.getSeparationForce=function(b){var c=0,d;for(d=0;d<b.length;d++){var e=b[d];var f=tabageos.MoverPoint.distBetween(this._pos,e.getPosition());0<f&&f<this.separationDistance&&(this._hp.x=this._pos.x,this._hp.y=this._pos.y,this._hp.subtract(e.getPosition(),0),this._hp.multiply(f,0),this.forceApplier.add(this._hp,
0),c++)}0<c&&this.forceApplier.multiply(1/c,0)};a.prototype.canSeeThis=function(b){var c=!1;this._hp.x=b.x;this._hp.y=b.y;if(this._pos.dist(b)>this.visionDistance)return c;this._vp.x=this._veloc.x;this._vp.y=this._veloc.y;b=this._vp.normalize();return c=0>this._hp.subtract(this._pos,0).dotProduct(b)?!1:!0};a.prototype.getAlignmentForce=function(b){var c=0,d;for(d=0;d<b.length;d++){var e=b[d];var f=tabageos.MoverPoint.distBetween(this._pos,e.getPosition());0<f&&f<this.separationDistance&&(this.forceApplier.add(e._veloc,
0),c++)}0<c&&(this.forceApplier.multiply(1/c,0),this.forceApplier.getSquaredLength()>this.getMaxForceSquared()&&this.forceApplier.truncate(this.maxForce))};a.prototype.almostCloseTo=function(b){return this._pos.dist(b)<this.personalSpace};a.prototype.getCohesionForce=function(b){var c=0,d;for(d=0;d<b.length;d++){var e=b[d];var f=tabageos.MoverPoint.distBetween(this._pos,e.getPosition());0<f&&f<this.personalSpace&&(this.forceApplier.add(e.getPosition(),0),c++)}0<c&&(this.forceApplier.multiply(1/c,
0),this.forceApplier=this.getSteerForce(this.forceApplier,!0,this.personalSpace))};a.prototype.easeAwayFrom=function(b){if(this._pos.dist(b)<this.avoidDistance||0<this.bypassAvoidDistance){this._hp.x=b.x;this._hp.y=b.y;var c=this._hp.subtract(this._pos,0);c.normalize();b=this._pos.dist(b);b<this.easeProximity?c.multiply(this.maxSpeed,0):c.multiply(this.maxSpeed*b/this.easeProximity,0);c=c.subtract(this._veloc,0);this.forceApplier.subtract(c,0)}};a.prototype.chase=function(b){var c=this._pos.dist(b._pos)/
this.maxSpeed;this._hp.x=b._pos.x;this._hp.y=b._pos.y;this._vp.x=b._veloc.x;this._vp.y=b._veloc.y;b=this._hp.add(this._vp.multiply(c,0),0);this.easeTo(b)};a.prototype.getHideSpot=function(b,c,d){c=2*this.personalSpace+c;this._hp.x=b.x;this._hp.y=b.y;return this._hp.subtract(d._pos,0).normalize().multiply(c,0).add(b,0)};a.prototype.hide=function(b,c){for(var d=-9999,e=-1,f,g,h;e!=b.length-1;)if(e++,f=b[e])f=this.getHideSpot(f._pos,f.width,c),h=f.dist(this._pos),h<d&&(d=h,g=f);-9999!=d&&this.easeTo(g)};
a.prototype.wander=function(){this._hp.x=this._veloc.x;this._hp.y=this._veloc.y;this._hp._angle=this._veloc._angle;this._hp._length=this._veloc._length;this._hp.normalize().multiply(this.wanderProximity,0);this.wanderOffset.setLength(this.wanderRadius);this.wanderOffset.setAngle(this.wanderAngle);this.wanderAngle+=Math.random()*this.wanderRange-.5*this.wanderRange;this._hp.add(this.wanderOffset,0);this.forceApplier.add(this._hp,0)};a.prototype.evade=function(b){var c=this._pos.dist(b._pos)/this.maxSpeed;
this._hp.x=b._pos.x;this._hp.y=b._pos.y;this._vp.x=b._veloc.x;this._vp.y=b._veloc.y;b=this._hp.subtract(this._vp.multiply(c,0),0);this.easeAwayFrom(b)};a.prototype.avoid=function(b){var c=!0;this.avoidee=b;this._vp.x=this._veloc.x;this._vp.y=this._veloc.y;this._vp._angle=this._veloc._angle;this._vp._length=this._veloc._length;var d=this._vp.normalize();b=this.avoidee.getMiddle().subtract(this._pos);var e=b.dotProduct(d);0<e&&(c=d.multiply(this.avoidDistance),e=d.multiply(e),e.subtract(b).getLength()<
2*this.avoidee.width+this.avoidSpace&&e.getLength()<c.getLength()?(d=d.multiply(this.maxSpeed),d.setAngle(d.getAngle()+b.sign(this._vp)*Math.PI/2),d.multiply(1-e.getLength()/c.getLength(),0),this.forceApplier.add(d,0),this._veloc.multiply(e.getLength()/c.getLength(),0),c=!1):c=!0);return c};a.prototype.avoidThese=function(b){var c=!0,d;for(d=0;d<b.length;d++){this.avoidee=b[d];this._vp.x=this._veloc.x;this._vp.y=this._veloc.y;this._vp._angle=this._veloc._angle;this._vp._length=this._veloc._length;
var e=this._vp.normalize(),f=this.avoidee.getMiddle().subtract(this._pos),g=f.dotProduct(e);0<g&&(c=e.multiply(this.avoidDistance),g=e.multiply(g),g.subtract(f).getLength()<2*this.avoidee.width+this.avoidSpace&&g.getLength()<c.getLength()?(e=e.multiply(this.maxSpeed),e.setAngle(e.getAngle()+f.sign(this._veloc)*Math.PI/2),e=e.multiply(1-g.getLength()/c.getLength()),this.forceApplier=this.forceApplier.add(e,1),this._veloc=this._veloc.multiply(g.getLength()/c.getLength(),1),c=!1):c=!0)}return c};a.prototype.seek=
function(b){this._hp.x=b.x+1-1;this._hp.y=b.y+1-1;this._hp.subtract(this._pos,0);this._hp.normalize();this._hp.multiply(this.maxSpeed,0);this.forceApplier.add(this._hp.subtract(this._veloc,0),0)};a.prototype.followPath=function(b,c){var d=b[this._pathIndex];d&&(this._pos.dist(d)<this.followDistance?this._pathIndex>=b.length-1?(this.dispatchEvent(this._pathEvent),c&&(this._pathIndex=0)):this._pathIndex+=1:this.seek(d))};a.prototype.circle=function(b){var c=Math.sqrt((this._pos.x-b.x)*(this._pos.x-
b.x)+(this._pos.y-b.y)*(this._pos.y-b.y)),d=b.y+(this._pos.y-b.y)/c*this.circleDistance-this._pos.y+this._veloc.y;this.forceApplier.x=b.x+(this._pos.x-b.x)/c*this.circleDistance-this._pos.x+this._veloc.x;this.forceApplier.y=d;this.forceApplier._length=0;this.forceApplier._angle=0};a.prototype.addEventListener=function(b,c,d){this._eventDispatcher.addEventListener(b,c,d)};a.prototype.removeEventListener=function(b,c,d){return this._eventDispatcher.removeEventListener(b,c,d)};a.prototype.dispatchEvent=
function(b){return this._eventDispatcher.dispatchEvent(b)};a.prototype.flock=function(b,c,d,e){this.separate(b,c);this.align(b,d||1);this.cohesion(b,e||1)};a.prototype.align=function(b,c){this.getAlignmentForce(b);1<c&&this.forceApplier.multiply(c,0)};a.prototype.cohesion=function(b,c){this.getCohesionForce(b);1<c&&this.forceApplier.multiply(c,0)};tabageos.TravelerSkeleton=a})();
(function(){function a(b,c,d,e,f,g){tabageos.TravelerSkeleton.call(this,b,c,d,e);this.init(b,c,d,e,f);this._deltaTime=g||tabageos.TimeKeeper._sae}a.prototype.constructor=a;a.prototype=Object.create(tabageos.TravelerSkeleton.prototype);a.prototype.init=function(b,c,d,e,f){this.x=b||0;this.y=c||0;this.height=e||0;this.width=d||0;this.travelType=this.easeTo;this.boundingMethod=tabageos.BoundMethods.boundTo;this._wallObject=null;this._canvasAnimation=f||null;this.forceApplier=new tabageos.MoverPoint;
this.forceHolder=new tabageos.MoverPoint;this._w=d||0;this._h=e||0;this.wanderOffset=new tabageos.MoverPoint(0,0);this.blankMO=new tabageos.MoverPoint;this._veloc=new tabageos.MoverPoint(0,0);this._eventDispatcher=new tabageos.EventDispatcher;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(b,c);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=new tabageos.MoverPoint(b,c);this.dY=this.dX=0;this._rect=new tabageos.Rectangle(this.x,this.y,this.width,this.height);
this.separationDistance=this.circleDistance=this.spreadDistance=10;this.bypassAvoidDistance=null;this.maxForce=12;this.followDistance=this._w;this.easeProximity=2;this.wanderAngle=this.wanderProximity=10;this.avoidSpace=this.wanderRange=this.wanderRadius=20;this.avoidee=null;this.personalSpace=this.visionDistance=this.avoidDistance=20;this.mass=2;this.maxSpeed=5;this.bird=this.flockCount=null;this._pathIndex=0;this._hp=new tabageos.MoverPoint;this._vp=new tabageos.MoverPoint;this._pathEvent=new Event("pathComplete");
this.listenerMethods=this.listenerStrings=null};a.prototype.travelType=null;a.prototype.boundingMethod=null;a.prototype.spreadDistance=10;a.prototype.circleDistance=50;a.prototype.separationDistance=10;a.prototype.bypassAvoidDistance=null;a.prototype.maxForce=2;a.prototype.forceApplier=null;a.prototype.followDistance=10;a.prototype.easeProximity=2;a.prototype.wanderProximity=10;a.prototype.wanderAngle=5;a.prototype.wanderRadius=20;a.prototype.wanderRange=20;a.prototype.wanderOffset=null;a.prototype.avoidSpace=
20;a.prototype.avoidDistance=20;a.prototype.visionDistance=10;a.prototype.personalSpace=20;a.prototype.mass=5;a.prototype.maxSpeed=10;a.prototype.maxForce=4;a.prototype.dX;a.prototype._deltaTime;a.prototype._pos=null;a.prototype.x=0;a.prototype.y=0;a.prototype._pathIndex=0;a.prototype._hp=null;a.prototype._vp=null;a.prototype._pathEvent=null;a.prototype._lastPos;a.prototype._lastVeloc;a.prototype._veloc=null;a.prototype._canvasAnimation=null;a.prototype._eventDispatcher=null;a.prototype._destination=
null;a.prototype._wallObject=null;a.prototype._deltaTime=null;a.prototype.setWallObject=function(b){this._wallObject=b};a.prototype.getDestination=function(){return this._destination};a.prototype.setDestination=function(b){this._destination=b};a.prototype.update=function(){this.forceApplier.truncate(this.maxForce);this.forceApplier.divide(this.mass,0);this._veloc.add(this.forceApplier.multiply(this._deltaTime,0),0);this.forceApplier.reset();this._veloc._length=0;this._veloc._angle=0;this._veloc.truncate(this.maxSpeed);
this._pos.addBy(this._veloc.x*this._deltaTime,this._veloc.y*this._deltaTime,0);this._wallObject&&this.boundingMethod(this,this._wallObject);this.x=this._pos.x+1-1;this.y=this._pos.y+1-1};a.prototype.move=function(){this.forceApplier.truncate(this.maxForce);this.forceApplier.divide(this.mass,0);this._veloc.add(this.forceApplier.multiply(this._deltaTime,0),0);this.forceApplier.reset();this._veloc._length=0;this._veloc._angle=0;this._veloc.truncate(this.maxSpeed);this._pos.addBy(this._veloc.x*this._deltaTime,
this._veloc.y*this._deltaTime,0);this._wallObject&&this.boundingMethod(this,this._wallObject);this.x=this._pos.x+1-1;this.y=this._pos.y+1-1};a.prototype.travel=function(b){null!=this.travelType&&this.travelType(b||this._destination);this.move()};tabageos.Traveler=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p,q){tabageos.TravelerSkeleton.call(this,b,c,d,e);this.width=d||0;this.height=e||0;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(b,c);this._veloc=new tabageos.MoverPoint(0,0);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=new tabageos.MoverPoint(b,c);this._deltaTime=k||tabageos.TimeKeeper._sae;this._map=h?f:tabageos.BlitMath.cloneMultiArray(f);this._rect=new tabageos.Rectangle(this.x,this.y,this.width,this.height);
this._state=1;this.forceApplier=new tabageos.MoverPoint;this.forceHolder=new tabageos.MoverPoint;this._canvasAnimation=g||null;this._w=d||0;this._h=e||0;this.wanderOffset=new tabageos.MoverPoint(0,0);this.blankMO=new tabageos.MoverPoint;this._eventDispatcher=new tabageos.EventDispatcher;this.x=b||0;this.y=c||0;this._checkHelper=new tabageos.MoverPoint;this._jumps=0;this._jumpSpeed=4;this._jsp=1;this._walkSpeed=4;this._gravityLevel=.285;this.health=100;this._grounded=this._npRight=this._pRight=this._npLeft=
this._pLeft=0;this._unGrounded=1;this._atCeiling=0;this._unCeiling=1;this._wallObject=null;this.boundingMethod=tabageos.BoundMethods.bounceOff;this.path=[];this._mapRows=m||f.length;this._mapColumns=p||f[0].length;this._tw=l||this.width;this._th=n||this.height;this.destination=new tabageos.MoverPoint;this._mt=q||0;this._mt=this._map&&this._map[0]&&this._map[0][1]&&("array"==typeof this._map[0][1]||"object"==typeof this._map[0][1])?1:0}a.prototype.constructor=a;a.prototype=Object.create(tabageos.TravelerSkeleton.prototype);
a.prototype._mapRows=0;a.prototype._mapColumns=0;a.prototype.stand=1;a.prototype.walk=2;a.prototype.up=3;a.prototype._canvasAnimation=null;a.prototype._directCanvasObject=null;a.prototype.down=4;a.prototype._deltaTime=.666666667;a.prototype._state=1;a.prototype._checkHelper;a.prototype._jumps=0;a.prototype.forceGrounded=0;a.prototype._jumpSpeed=4;a.prototype._jsp=1;a.prototype._walkSpeed=4;a.prototype._gravityLevel=.285;a.prototype._pLeft=0;a.prototype._npLeft=0;a.prototype._pRight=0;a.prototype._npRight=
0;a.prototype._grounded=0;a.prototype._unGrounded=1;a.prototype.health=100;a.prototype._atCeiling=0;a.prototype._unCeiling=1;a.prototype._map=null;a.prototype._tw=16;a.prototype._th=16;a.prototype._wallObject=null;a.prototype.boundingMethod=null;a.prototype.destination=null;a.prototype._mt=1;a.prototype._autoAnimate=0;a.prototype._autoAnimationThrottle=1;a.prototype._leftRightFace=0;a.prototype.setupForTileMove=function(){this._jumps=0;this._deltaTime=1;this._jumpSpeed=this._tw+1-1;this.maxSpeed=
this._tw+1-1;this._walkSpeed=this._tw+1-1};a.prototype.tileMove=function(b,c,d,e){b&&!this._pLeft&&(this._veloc.x=-this._tw);c&&!this._pRight&&(this._veloc.x=this._tw);b||c||(this._veloc.x=0);d&&!this._atCeiling&&(this._veloc.y=-this._th);e&&!this._grounded&&(this._veloc.y=this._th);d||e||(this._veloc.y=0);this.update(0,1,0)};a.prototype.move=function(b,c,d,e,f,g,h){1==this._state?(this._veloc.x=0,this._veloc.y=0,!this._grounded||this._atCeiling?this._state=3:b&&!c||c&&!b?this._state=2:d&&!this._atCeiling?
(this._jsp=this._jumpSpeed-2,this._veloc.y=this._jumps?-(this._jumpSpeed-(this._jumpSpeed-2)):-this._jumpSpeed,this._state=3):d||this._jumps||!e||(this._veloc.y=this._walkSpeed,this._state=4),this.update(0,f,g)):2==this._state?(b||c?c?this._pRight?this._veloc.x=0:h||(this._veloc.x=this._walkSpeed):b&&(this._pLeft?this._veloc.x=0:h||(this._veloc.x=-this._walkSpeed)):(this._state=1,this._veloc.x=0,this._veloc.y=0),d&&!this._atCeiling?(this._jsp=this._jumpSpeed-2,this._veloc.y=this._jumps?-(this._jumpSpeed-
(this._jumpSpeed-2)):-this._jumpSpeed,this._state=3):d&&this._atCeiling?this._jumps&&!this._grounded&&(this._state=3,this._veloc.y=this._walkSpeed):d||this._grounded||(this._state=3),this.update(0,f,g)):3==this._state?(this._jumps?(d&&!this._atCeiling&&this._veloc.y>-this._jumpSpeed&&0!=this._jsp?(--this._jsp,this._veloc.y=-(this._jumpSpeed-this._jsp)):this._jsp=0,this._veloc.y+=this._gravityLevel*this._deltaTime,this._veloc.y>this._jumpSpeed&&(this._veloc.y=this._jumpSpeed+1-1),!d&&0<this._veloc.y&&
(this._veloc.y=this._veloc.y>this._jumpSpeed?this._jumpSpeed+1-1:this._veloc.y)):(this._veloc.y=d&&!this._atCeiling?-this._walkSpeed:0,d)||(b||c||e?!b&&!c||e?e&&(this._state=4,this._veloc.y=this._walkSpeed):(this._state=2,this._veloc.y=0):(this._state=1,this._veloc.x=0,this._veloc.y=0)),c||b?c?this._veloc.x=this._pRight?0:this._walkSpeed:b&&(this._veloc.x=this._pLeft?0:-this._walkSpeed):this._veloc.x=0,this._grounded?(c||b?this._state=2:(this._state=1,this._veloc.x=0),this._veloc.y=0):!this._jumps&&
e&&(this._veloc.y=this._walkSpeed,this._state=4),this.update(0,f,g)):this._jumps||4!=this._state||(this._veloc.y=e&&!this._grounded?this._walkSpeed:0,e||(b||c?this._state=2:(this._state=1,this._veloc.x=0),this._veloc.y=0),c||b?c?this._veloc.x=this._pRight?0:this._walkSpeed:b&&(this._veloc.x=this._pLeft?0:-this._walkSpeed):this._veloc.x=0,this._atCeiling&&(c||b?this._state=2:(this._state=1,this._veloc.x=0),this._veloc.y=0),this.update(0,f,g))};a.prototype.update=function(b,c,d){this._lastPos.x<this._pos.x&&
(this._leftRightFace=1);this._lastPos.x>this._pos.x&&(this._leftRightFace=0);this._lastPos.x=this._pos.x+1-1;this._lastPos.y=this._pos.y+1-1;this._lastVeloc.x=this._veloc.x+1-1;this._lastVeloc.y=this._veloc.y+1-1;this._unGrounded=this._grounded+1-1;this._npRight=this._pRight+1-1;this._npLeft=this._pLeft+1-1;this._unCeiling=this._atCeiling+1-1;c||(this.forceApplier.truncate(this.maxForce),this.forceApplier.divide(this.mass,0),this._veloc.add(this.forceApplier.multiply(this._deltaTime,0),0),this.forceApplier.reset(),
this._veloc._length=0,this._veloc._angle=0,this._veloc.truncate(this.maxSpeed));this._pos.addBy(this._veloc.x*this._deltaTime,this._veloc.y*this._deltaTime,0);d||(c=this.isLeftPushingOnMap(this._lastPos,this._pos,this._veloc,this._map,this._tw,this._th),0<c?(this._pLeft=1,this._pos.x=c+1,this._veloc.x=0):this._pLeft=0,c=this.isRightPushingOnMap(this._lastPos,this._pos,this._veloc,this._map,this._tw,this._th),0<c?(this._pRight=1,this._pos.x=c-this.width,this._veloc.x=0):this._pRight=0,c=this.isGroundedOnMap(this._lastPos,
this._pos,this._veloc,this._map,this._tw,this._th),0<c?(this._grounded=1,this._pos.y=c-this.height,this._veloc.y=0):(this._grounded=0,this.forceGrounded&&this._jumps&&(this._state=3,this._veloc.y=this._walkSpeed)),c=this.isHeadHitOnMap(this._lastPos,this._pos,this._veloc,this._map,this._tw,this._th),0<c?(this._atCeiling=1,this._jumps?(this._pos.y<c&&(this._pos.y=c),0>this._veloc.y&&(this._veloc.y=this._jumps&&!this._grounded?this._walkSpeed:0)):(this._pos.y=c,this._veloc.y=0)):this._atCeiling=0,this._wallObject&&
this.boundingMethod(this,this._wallObject));b||(this.x=Math.round(this._pos.x+1-1),this.y=Math.round(this._pos.y+1-1));this._autoAnimate&&this._canvasAnimation?(this._canvasAnimation.x=this.x,this._canvasAnimation.y=this.y,this._canvasAnimation.changeDirectionAnimation(0>this._veloc.x,0<this._lastVeloc.x,0>this._veloc.y,0<this._veloc.y),this._canvasAnimation.animate(this._autoAnimationThrottle),this._canvasAnimation.blit()):this._autoAnimate&&this._directCanvasObject&&this._directCanvasObject.context.fillRect(this.x,
this.y,this.width,this.height)};a.prototype.autoAnimation=function(){this._autoAnimate&&this._canvasAnimation?(this._canvasAnimation.x=this.x,this._canvasAnimation.y=this.y,this._canvasAnimation.changeDirectionAnimation(0>this._veloc.x,0<this._lastVeloc.x,0>this._veloc.y,0<this._veloc.y),this._canvasAnimation.animate(this._autoAnimationThrottle),this._canvasAnimation.blit()):this._autoAnimate&&this._directCanvasObject&&this._directCanvasObject.context.fillRect(this.x,this.y,this.width,this.height)};
a.prototype.isGroundedOnMap=function(b,c,d,e,f,g){b=this._pos.x+1-1;c=this._pos.y+this.height+(Math.abs(this._veloc.y)<g?1>this._veloc.y?1:this._veloc.y:1);d=this._pos.x+this.width;e=-999;for(var h;b<d;){tabageos.BlitMath.fasterCheckTileValueAt(b,c,this._mapRows,this._mapColumns,f,g,this._checkHelper);h=this._checkHelper.y;var k=this._checkHelper.x;k=this._map[h][k];if(0===this._mt&&0!=k||1===this._mt&&(0!=k[0]||0!=k[1]))e=h*g+1-1,e<c||(e=-1);b+=(f>this.width?this.width:f)/4}return e};a.prototype.isHeadHitOnMap=
function(b,c,d,e,f,g){b=this._pos.x+1-1;c=this._pos.y-1-(Math.abs(this._veloc.y)<g?-this._veloc.y:0);d=this._pos.x+this.width;e=-999;for(var h;b<d;){tabageos.BlitMath.fasterCheckTileValueAt(b,c,this._mapRows,this._mapColumns,f,g,this._checkHelper);h=this._checkHelper.y;var k=this._checkHelper.x;k=this._map[h][k];if(0===this._mt&&0!=k||1===this._mt&&(0!=k[0]||0!=k[1]))e=h*g+g,e>c||(e=-1);b+=f>this.width?this.width:f}return e};a.prototype.isRightPushingOnMap=function(b,c,d,e,f,g){b=this._pos.y+1-1;
c=this._pos.y+this.height;d=this._pos.x+this.width+1;e=-999;for(var h;b<c;){tabageos.BlitMath.fasterCheckTileValueAt(d,b,this._mapRows,this._mapColumns,f,g,this._checkHelper);var k=this._checkHelper.y;h=this._checkHelper.x;k=this._map[k][h];if(0===this._mt&&0!=k||1===this._mt&&(0!=k[0]||0!=k[1]))if(e=h*f+1-1,e<d)break;else e=-1;b+=g>this.height?this.height:g}return e};a.prototype.isLeftPushingOnMap=function(b,c,d,e,f,g){b=this._pos.y+1-1;c=this._pos.y+this.height;d=this._pos.x-1;e=-999;for(var h;b<
c;){tabageos.BlitMath.fasterCheckTileValueAt(d,b,this._mapRows,this._mapColumns,f,g,this._checkHelper);var k=this._checkHelper.y;h=this._checkHelper.x;k=this._map[k][h];if(0===this._mt&&0!=k||1===this._mt&&(0!=k[0]||0!=k[1]))if(e=h*f+f,e>d)break;else e=-1;b+=g>this.height?this.height:g}return e};tabageos.MapTraveler=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p){tabageos.TravelerSkeleton.call(this,b,c,d,e);tabageos.MapTraveler.call(this,b,c,d,e,f,g,h,k,l,n,m,p);this.width=d||0;this.height=e||0;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(b,c);this._veloc=new tabageos.MoverPoint(0,0);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=new tabageos.MoverPoint(b,c);this._deltaTime=k||tabageos.TimeKeeper._sae;this._map=h?f:tabageos.BlitMath.cloneMultiArray(f);this._state=1;
this.x=b||0;this.y=c||0;this._rect=new tabageos.Rectangle(this.x,this.y,this.width,this.height);this._canvasAnimation=g||null;this._tH=n||this.height;this._tW=l||this.width;this._outAltered=new tabageos.MoverPoint;this.holdingRect=new tabageos.Rectangle(0,0,d,e);this.holdingOffsetX=1;this.holdingOffsetY=3;this._jumps=0;this.easeProximity=7;this._checkHelper=new tabageos.MoverPoint;this.forceApplier=new tabageos.MoverPoint;this.forceHolder=new tabageos.MoverPoint;this._w=d||0;this._h=e||0;this.wanderOffset=
new tabageos.MoverPoint(0,0);this.blankMO=new tabageos.MoverPoint;this._eventDispatcher=new tabageos.EventDispatcher;this.holdings=[];this._holdingHelperRect=new tabageos.Rectangle(0,0,0,0)}a.prototype.constructor=a;a.prototype=Object.create(tabageos.TravelerSkeleton.prototype);Object.assign(a.prototype,tabageos.MapTraveler.prototype);a.prototype.throwStrength=10;a.prototype.health=100;a.prototype.holding;a.prototype.holdings;a.prototype.holdingRect;a.prototype._holdingHelperRect;a.prototype._canvasAnimation=
null;a.prototype._outAltered;a.prototype.holdingOffsetX=1;a.prototype.holdingOffsetY=3;a.prototype.nameOfThrower="strawHat";a.prototype.alteredPosition=function(b,c){this._outAltered.x=this.x-(b||0);this._outAltered.y=this.y-(c||0);return this._outAltered};a.prototype.holdingImageRect=function(){return this.holdingRect};a.prototype.pickUpTileData=function(b,c,d){return this.holding?!1:(this.holding=b,this.holdingRect.x=this.holding.value[1]*this._tw,this.holdingRect.y=this.holding.value[0]*this._th,
this.holdingRect.width=this._tw,this.holdingRect.height=this._th,c&&(this.holdingRect.width+=c),d&&(this.holdingRect.height+=d),!0)};a.prototype.pickUpAndStoreTileData=function(b,c,d,e){this.holdings.push(b);b=this.holdings.length-1;this.holdingRect.x=this.holdings[b].value[1]*this._tw;this.holdingRect.y=this.holdings[b].value[0]*this._th;this.holdingRect.width=this._tw;this.holdingRect.height=this._th;c&&(this.holdingRect.width+=c);d&&(this.holdingRect.height+=d);e?this.holding=null:this._readyNextThrow();
return!0};a.prototype.removeFromStorageByValue=function(b){var c=0,d=this.holdings.length;for(c;c<d;c++)if(this.holdings[c]&&this.holdings[c].value){if(this.holdings[c].value[0]==b[0]&&this.holdings[c].value[1]==b[1]){this.holdings.splice(c,1);break}}else if(this.holdings[c]&&this.holdings[c].tileValue&&this.holdings[c].tileValue[0]==b[0]&&this.holdings[c].tileValue[1]==b[1]){this.holdings.splice(c,1);break}};a.prototype.removeLastFromStorage=function(){if(this.holdings.length){var b=this.holdings.pop();
b.setX(this.x+1-1);b.setY(this.y+1-1);this.holding=null;return b}return null};a.prototype._tempDivs=[];a.prototype._displayStorageClearRect;a.prototype.displayStorage=function(b,c,d,e,f,g,h,k,l,n){var m=0,p=this.holdings.length;this._displayStorageClearRect||(this._displayStorageClearRect=new tabageos.Rectangle(d.x+g+4,d.y+h+4,g,h));var q=k+1-1;l=l+1-1;c.copyPixels(b,d,new tabageos.MoverPoint(e,f),d.width,d.height);for(m;m<p;m++){e=this.holdings[m].value?this.holdings[m].value:this.holdings[m].tileValue;
c.copyPixels(b,new tabageos.Rectangle(e[1]*g,e[0]*h,g,h),new tabageos.MoverPoint(q,l),g,h);this._tempDivs[m]||(this._tempDivs[m]=document.createElement("div"));this._tempDivs[m].sceneryThrower=this;this._tempDivs[m].cDisplay=c;this._tempDivs[m]._img=b;this._tempDivs[m]._dscr=this._displayStorageClearRect;f="";if(n&&1<=n.length)for(d=0;d<n.length;d++)n[d][0]==e[0]&&n[d][1]==e[1]&&(f=n[d][2]);this._tempDivs[m].setAttribute("title",f);this._tempDivs[m].setAttribute("id",e[0]+"v"+e[1]);this._tempDivs[m].setAttribute("style",
"position:absolute;width:"+g+"px;height:"+h+"px;top:"+l+"px;left:"+q+"px;cursor:pointer;z-index:99999999999999999999999999999999999999999999999999999999999999999");this._tempDivs[m].removeEventListener(tabageos.seekTouch()?"touchstart":"click",this.removeFromDisplayedStorage,!1);this._tempDivs[m].addEventListener(tabageos.seekTouch()?"touchstart":"click",this.removeFromDisplayedStorage,!1);c.canvas.offsetParent.appendChild(this._tempDivs[m]);q+=2*g;q>=14*g&&(q=k+1-1,l+=2*h)}};a.prototype._removedFromStorage=
[];a.prototype.removeFromDisplayedStorage=function(b){function c(e){return Number(e.replace("px",""))}b=b.target;var d=b.id.split("v");d[0]=Number(d[0]);d[1]=Number(d[1]);b.sceneryThrower.removeFromStorageByValue(d);b.sceneryThrower._removedFromStorage.push(d);b.cDisplay.copyPixels(b._img,b._dscr,new tabageos.MoverPoint(c(b.style.left),c(b.style.top)),c(b.style.width),c(b.style.height));b.removeEventListener(tabageos.seekTouch()?"touchstart":"click",b.sceneryThrower.removeFromDisplayedStorage,!1);
b.offsetParent.removeChild(b)};a.prototype.pickUpAndStore=function(b,c,d,e){this.holdings.push(b);var f=this.holdings.length-1;this.holdingRect.x=this.holdings[f].tileValue[1]*b.width;this.holdingRect.y=this.holdings[f].tileValue[0]*b.height;this.holdingRect.width=b.width;this.holdingRect.height=b.height;c&&(this.holdingRect.width+=c);d&&(this.holdingRect.height+=d);e?this.holding=null:this._readyNextThrow();return!0};a.prototype.pickUp=function(b,c,d){return this.holding?!1:(this.holding=b,this.holdingRect.x=
b.tileValue[1]*b.width,this.holdingRect.y=b.tileValue[0]*b.height,this.holdingRect.width=b.width,this.holdingRect.height=b.height,c&&(this.holdingRect.width+=c),d&&(this.holdingRect.height+=d),!0)};a.prototype._throwHolding=function(){-1!=this.holdings.indexOf(this.holding)&&this.holdings.splice(this.holdings.indexOf(this.holding),1);this.holding=null};a.prototype._readyNextThrow=function(){this.holdings.length&&(this.holding=this.holdings[this.holdings.length-1],this.holding.tileValue?(this.holdingRect.x=
this.holding.tileValue[1]*this.holding.width,this.holdingRect.y=this.holding.tileValue[0]*this.holding.height,this.holdingRect.width=this.holding.width,this.holdingRect.height=this.holding.height):(this.holdingRect.x=this.holding.value[1]*this._tW,this.holdingRect.y=this.holding.value[0]*this._tH,this.holdingRect.width=this._tW,this.holdingRect.height=this._tH))};a.prototype.valueFromHolding=function(b){return b.value||b.tileValue};a.prototype.rectFromHolding=function(b){b.tileValue?(this._holdingHelperRect.x=
b.tileValue[1]*b.width,this._holdingHelperRect.y=b.tileValue[0]*b.height,this._holdingHelperRect.width=b.width,this._holdingHelperRect.height=b.height):(this._holdingHelperRect.x=b.value[1]*this._tW,this._holdingHelperRect.y=b.value[0]*this._tH,this._holdingHelperRect.width=this._tW,this._holdingHelperRect.height=this._tH);return this._holdingHelperRect};a.prototype.throwSceneryObject=function(b,c,d){null==this.holding&&this.holdings.length&&this._readyNextThrow();return this.holding?(b=new tabageos.SceneryObject(this.x+
1-1,this.y+1-1,b||this._tw,c||this._th,this._map,null,1,this._deltaTime,this._tw,this._th,this._mapRows,this._mapColumns),b._jumps=0==d?0:1,b.playerHoldingThis=this,b.tileValue=this.holding.value||this.holding.tileValue,b.tileRect=new tabageos.Rectangle(this.holdingRect.x,this.holdingRect.y,this.holdingRect.width,this.holdingRect.height),this._throwHolding(),b):null};a.prototype.throwSceneryObjectTraveler=function(b,c,d){null==this.holding&&this.holdings.length&&this._readyNextThrow();return this.holding?
(b=new tabageos.SceneryObjectTraveler(this.x+1-1,this.y+1-1,b||this._tw,c||this._th,this._map,null,1,this._deltaTime,this._tw,this._th,this._mapRows,this._mapColumns),b._jumps=0==d?0:1,b.playerHoldingThis=this,b.tileValue=this.holding.value||this.holding.tileValue,b.tileRect=new tabageos.Rectangle(this.holdingRect.x,this.holdingRect.y,this.holdingRect.width,this.holdingRect.height),this._throwHolding(),b):null};tabageos.TravelingSceneryThrower=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p,q,r){tabageos.TravelerSkeleton.call(this,d,e,f,g);tabageos.MapTraveler.call(this,d,e,f,g,h,k,l,n,m,p,q,r);this.width=f||0;this.height=g||0;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(d,e);this._veloc=new tabageos.MoverPoint(0,0);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=new tabageos.MoverPoint(d,e);this._deltaTime=n||tabageos.TimeKeeper._sae;this._map=l?h:tabageos.BlitMath.cloneMultiArray(h);this._rect=
new tabageos.Rectangle(this.x,this.y,this.width,this.height);this._state=1;this.forceApplier=new tabageos.MoverPoint;this.forceHolder=new tabageos.MoverPoint;this._canvasAnimation=k||null;this._w=f||0;this._h=g||0;this.wanderOffset=new tabageos.MoverPoint(0,0);this.blankMO=new tabageos.MoverPoint;this._eventDispatcher=new tabageos.EventDispatcher;this.x=d||0;this.y=e||0;this._tw=m;this._th=p;this._checkHelper=new tabageos.MoverPoint;this._inp=new tabageos.MoverPoint;this._direcX=b||0;this._direcY=
-1==c?c:c||0;this._horizontal=-1==this._direcX||1==this._direcX}a.prototype.constructor=a;a.prototype=Object.create(tabageos.TravelerSkeleton.prototype);Object.assign(a.prototype,tabageos.MapTraveler.prototype);a.prototype._inp;a.prototype._tw;a.prototype._th;a.prototype._horizontal=1;a.prototype._direcX;a.prototype._direcY;tabageos.MovingPlatform=a})();
(function(){function a(){}a.easeOptions={Linear:!0,InLinear:!0,OutLinear:1,InOutLinear:1,InElastic:1,OutElastic:1,InOutElastic:1,InQuad:1,OutQuad:1,InOutQuad:1,InBounce:1,InOutBounce:1,OutBounce:1,InCirc:1,InBack:1,OutBack:1,InOutBack:1,InQuint:1,OutQuint:1,InOutQuint:1,OutCirc:1,InOutCirc:1,In:1,Out:1,InOut:1,InSine:1,OutSine:1,InOutSine:1};a.InBack=function(b,c,d,e,f){return d*(b/=e)*b*((f+1)*b-f)+c};a.OutBack=function(b,c,d,e,f){return d*((b=b/e-1)*b*((f+1)*b+f)+1)+c};a.InOutBack=function(b,c,
d,e,f){return 1>(b/=e/2)?d/2*b*b*(((f*=1.525)+1)*b-f)+c:d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c};a.OutBounce=function(b,c,d,e){return(b/=e)<1/2.75?7.5625*d*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c};a.InBounce=function(b,c,d,e){return d-a.OutBounce(e-b,0,d,e)+c};a.InOutBounce=function(b,c,d,e){return b<e/2?.5*a.InBounce(2*b,0,d,e)+c:.5*a.OutBounce(2*b-e,0,d,e)+.5*d+c};a.InCirc=function(b,c,d,e){return-d*(Math.sqrt(1-
(b/=e)*b)-1)+c};a.OutCirc=function(b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c};a.InOutCirc=function(b,c,d,e){return 1>(b/=e/2)?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c};a.In=function(b,c,d,e){return d*(b/=e)*b*b+c};a.Out=function(b,c,d,e){return d*((b=b/e-1)*b*b+1)+c};a.InOut=function(b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c};a.InElastic=function(b,c,d,e,f,g){if(0==b)return c;if(1==(b/=e))return c+d;g||(g=.3*e);!f||f<Math.abs(d)?(f=d,d=g/4):d=g/(2*Math.PI)*
Math.asin(d/f);return-(f*Math.pow(2,10*--b)*Math.sin(2*(b*e-d)*Math.PI/g))+c};a.OutElastic=function(b,c,d,e,f,g){if(0==b)return c;if(1==(b/=e))return c+d;g||(g=.3*e);if(!f||f<Math.abs(d)){f=d;var h=g/4}else h=g/(2*Math.PI)*Math.asin(d/f);return f*Math.pow(2,-10*b)*Math.sin(2*(b*e-h)*Math.PI/g)+d+c};a.InOutElastic=function(b,c,d,e,f,g){if(0==b)return c;if(2==(b/=e/2))return c+d;g||(g=.3*e*1.5);if(!f||f<Math.abs(d)){f=d;var h=g/4}else h=g/(2*Math.PI)*Math.asin(d/f);return 1>b?-.5*f*Math.pow(2,10*--b)*
Math.sin(2*(b*e-h)*Math.PI/g)+c:f*Math.pow(2,-10*--b)*Math.sin(2*(b*e-h)*Math.PI/g)*.5+d+c};a.InExpo=function(b,c,d,e){return 0==b?c:d*Math.pow(2,10*(b/e-1))+c};a.OutExpo=function(b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c};a.InOutExpo=function(b,c,d,e){return 0==b?c:b==e?c+d:1>(b/=e/2)?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c};a.Linear=function(b,c,d,e){return d*b/e+c};a.InLinear=function(b,c,d,e){return d*b/e+c};a.OutLinear=function(b,c,d,e){return d*b/e+c};a.InOutLinear=
function(b,c,d,e){return d*b/e+c};a.InQuad=function(b,c,d,e){return d*(b/=e)*b+c};a.OutQuad=function(b,c,d,e){return-d*(b/=e)*(b-2)+c};a.InOutQuad=function(b,c,d,e){return 1>(b/=e/2)?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c};a.InQuart=function(b,c,d,e){return d*(b/=e)*b*b*b+c};a.OutQuart=function(b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c};a.InOutQuart=function(b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c};a.InQuint=function(b,c,d,e){return d*(b/=e)*b*b*b*b+c};a.OutQuint=function(b,c,d,e){return d*
((b=b/e-1)*b*b*b*b+1)+c};a.InOutQuint=function(b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c};a.InSine=function(b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c};a.OutSine=function(b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c};a.InOutSine=function(b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c};tabageos.RPEase=a})();
(function(){function a(){}a.LINEAR="Linear";a.IN="In";a.OUT="Out";a.IN_OUT="InOut";a.IN_BOUNCE="InBounce";a.OUT_BOUNCE="OutBounce";a.IN_BACK="InBack";a.OUT_BACK="OutBack";a.IN_CIRC="InCirc";a.OUT_CIRC="OutCirc";a.IN_ELASTIC="InElastic";a.OUT_ELASTIC="OutElastic";a.IN_LINEAR="InLinear";a.OUT_LINEAR="OutLinear";a.IN_SINE="InSine";a.OUT_SINE="OutSine";a.IN_QUAD="InQuad";a.OUT_QUAD="OutQuad";a.easeOptions={Linear:!0,InLinear:!0,OutLinear:1,InOutLinear:1,InElastic:1,OutElastic:1,InOutElastic:1,InQuad:1,
OutQuad:1,InOutQuad:1,InBounce:1,InOutBounce:1,OutBounce:1,InCirc:1,InBack:1,OutBack:1,InOutBack:1,InQuint:1,OutQuint:1,InOutQuint:1,OutCirc:1,InOutCirc:1,In:1,Out:1,InOut:1,InSine:1,OutSine:1,InOutSine:1};a._argsers=[0,0];a.tweenArray=function(b,c,d,e,f,g){g=g||[];var h="Linear";a.easeOptions[e]&&(h=e);c-=b;tabageos.TweenMath._argsers[0]=-1!=h.indexOf("Back")?1.70158:0;e=Math.floor(d);var k=Math.floor((f?f.millisecondRate||1E3:1E3)/(f?f.frameRate||60:60));d=1<=d/k?Math.floor(d/k):1;d=0<(f?f.useSeconds||
0:0)?e:d;for(f=0;f<=d;f++)g[f]=tabageos.RPEase[h](f,b,c,d,tabageos.TweenMath._argsers[0],tabageos.TweenMath._argsers[1]);return g};tabageos.TweenMath=a})();(function(){function a(b,c){this.type=b||"event";this.potato=c||{};this.target=null}a.prototype.type="";a.prototype.potato=null;a.prototype.target=null;a.prototype.constructor=a;a.prototype.preventDefault=function(){};tabageos.Event=a})();
(function(){function a(){this._listeners={}}a.prototype.constructor=a;a.prototype._listeners={};a.prototype.addEventListener=function(b,c,d){this._listeners[b]?this._listeners[b].push({m:c,o:d}):this._listeners[b]=[{m:c,o:d}]};a.prototype.removeEventListener=function(b,c,d){if(this._listeners[b]){var e=this._listeners[b];var f=!1;for(b=0;b<e.length;b++)e[b].m==c&&e[b].o==d&&(e.splice(b,1),f=!0)}return f};a.prototype.dispatchEvent=function(b,c){var d;if(this._listeners[b.type]){c&&(b.target=this);
var e=this._listeners[b.type];for(d=e.length;d--;){var f=e[d];if(f.o&&f.o[f.m]){c&&2==c&&(b.target=f.o);try{f.o[f.m](b)}catch(g){window.console.log(g)}}}}};tabageos.EventDispatcher=a})();
(function(){function a(b,c,d,e,f,g,h){tabageos.EventDispatcher.call(this);(b||0<=c||0<=d)&&this.init(b,c,d,0,e,f,g,h)}a.prototype.constructor=a;a.prototype=Object.create(tabageos.EventDispatcher.prototype);a.prototype.init=function(b,c,d,e,f,g,h,k){this.width=c||1;this.height=d||1;this.canvas=null==b?document.createElement("canvas"):b;this.canvas.setAttribute("width",this.width);this.canvas.setAttribute("height",this.height);k?(this._wrenderer=new tabageos.WebGlRenderer(this.canvas),this.context=
this._wrenderer.getContext()):(c={alpha:!0},h&&(c.alpha=!1),this.context=this.canvas.getContext("2d",c));null==b&&e?this._pixelData=this.context.createImageData(this.width,this.height):e&&(this._pixelData=this.context.getImageData(0,0,this.width,this.height));this._pixelData&&(this.pixelDataArray=this._pixelData.data);this._alpha=1;f||(this.canvas.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;"),
g&&(b=window.devicePixelRatio||1,this.context.scale(b,b),window.console.log(window.devicePixelRatio+" is the window.devicePixelRatio. CanvasObject has been scaled to it or 1.")))};a.prototype.width=0;a.prototype.height=0;a.prototype.canvas=null;a.prototype.context=null;a.prototype._wrenderer=null;a.prototype._pixelData=null;a.prototype.pixelDataArray=null;a.prototype._alpha=1;a.prototype.setAlpha=function(b){this.context.globalAlpha=b;this._alpha=100*b};a.prototype.setStrokeStyle=function(b){this.context.strokeStyle=
b};a.prototype.setFillStyle=function(b){this.context.fillStyle=b};a.prototype.copyPixels=function(b,c,d,e,f,g){this._wrenderer?this._wrenderer.copyPixels(b,c,d,e,f):(this.context.drawImage(b,c.x,c.y,c.width,c.height,Math.round(d.x),Math.round(d.y),e||c.width,f||c.height),g&&(this._pixelData=this.context.getImageData(0,0,this.canvas.width,this.canvas.height),this.pixelDataArray=this._pixelData.data))};a.prototype.drawImage=function(b,c,d,e){this.context.drawImage(b,c,d);e&&(this._pixelData=this.context.getImageData(0,
0,this.canvas.width,this.canvas.height),this.pixelDataArray=this._pixelData.data)};a.prototype.drawTriangle=function(b,c,d,e,f,g,h){h=h||!1;g=g||!1;this.context.beginPath();this.context.moveTo(b,c);0==g?(this.context.lineTo(b+d/2,c+e),this.context.lineTo(b-d,c+e)):(this.context.lineTo(b-e,c-d/2),this.context.lineTo(b-e,c+d));this.context.closePath();this.context.stroke();f&&(this.context.fillStyle=f,this.context.fill());1==h&&(this._pixelData=this.context.getImageData(0,0,this.canvas.width,this.canvas.height),
this.pixelDataArray=this._pixelData.data)};a.mathPI=Math.PI;a.prototype.drawCircle=function(b,c,d,e,f){this.context.beginPath();this.context.arc(b,c,d,0,2*a.mathPI);this.context.closePath();this.context.stroke();e&&(this.context.fillStyle=e,this.context.fill());1==f&&(this._pixelData=this.context.getImageData(0,0,this.canvas.width,this.canvas.height),this.pixelDataArray=this._pixelData.data)};a.prototype.writeText=function(b,c,d,e,f,g,h){this.context.font=e&&f?""+f+"px "+e:"24px Arial";!f&&e&&(this.context.font=
"24px "+e);!e&&f&&(this.context.font=""+f+"px Arial");g?(this.context.fillStyle=g,this.context.fillText(b||"undefined",c||0,d||0)):this.context.strokeText(b||"undefined",c||0,d||0);1==h&&(this._pixelData=this.context.getImageData(0,0,this.canvas.width,this.canvas.height),this.pixelDataArray=this._pixelData.data)};a.prototype.clear=function(){this.context.clearRect(0,0,this.canvas.width,this.canvas.height);this._pixelData=this.context.getImageData(0,0,this.canvas.width,this.canvas.height);this.pixelDataArray=
this._pixelData.data};a.prototype.clearRect=function(b,c,d,e){this.context.clearRect(b,c,d,e)};a.prototype.webglClearRect=function(b,c,d,e){var f=this.context||this;f.enable(f.SCISSOR_TEST);f.scissor(b,f.canvas.height-c-e,d,e);f.clearColor(0,0,0,0);f.clear(f.COLOR_BUFFER_BIT);f.disable(f.SCISSOR_TEST)};a.prototype.drawRect=function(b,c,d){c?(this.context.fillStyle=c,this.context.fillRect(b.x,b.y,b.width,b.height)):this.context.strokeRect(b.x,b.y,b.width,b.height);1==d&&(this._pixelData=this.context.getImageData(0,
0,this.canvas.width,this.canvas.height),this.pixelDataArray=this._pixelData.data)};a.prototype.setPixel=function(b,c,d,e,f){var g=4*(Math.round(c)*this._pixelData.width+Math.round(b)),h=this._pixelData.data;h[g+0]=(d&16711680)>>16;h[g+1]=(d&65280)>>8;h[g+2]=d&255;1==e&&this.context.putImageData(this._pixelData,0,0,b,c,1,1);1==f&&this.context.putImageData(this._pixelData,0,0)};a.prototype.getPixel=function(b,c){b=4*(Math.round(c)*this._pixelData.width+Math.round(b));c=this._pixelData.data;return c[b+
0]<<16|c[b+1]<<8|c[b+2]};a.prototype.update=function(){this._pixelData=this.context.getImageData(0,0,this.canvas.width,this.canvas.height);this.pixelDataArray=this._pixelData.data;this.context.putImageData(this._pixelData,0,0)};tabageos.CanvasObject=a})();
(function(){function a(b,c,d,e,f){tabageos.EventDispatcher.call(this);(b||c||d||e)&&this.init(b,c,d,e,f)}a.prototype.constructor=a;a.prototype=Object.create(tabageos.EventDispatcher.prototype);a.prototype.init=function(b,c,d,e,f){this._w=c||300;this._h=d||400;b?(this.div=document.getElementById(b),this.floor=null):(this.div=document.createElement("div"),this.div.setAttribute("style","position:absolute"),this.div.setAttribute("width",this._w),this.div.setAttribute("height",this._h),e&&e.addChild(this),
f&&(this.floor=new tabageos.CanvasObject(null,this._w,this._h),this.floor.context.fillStyle=f,this.floor.context.fillRect(0,0,this._w,this._h),this.div.appendChild(this.floor.canvas),this._floorContext=this.floor.context,this.floor.canvas.setAttribute("style","position:absolute;top:0px;z-index:-1")));this._children=[]};a.prototype._w=null;a.prototype._h=null;a.prototype.div=null;a.prototype.floor=null;a.prototype._floorContext=null;a.prototype._children=[];a.prototype.getWidth=function(){return this._w};
a.prototype.getHeight=function(){return this._h};a.prototype.getNumChildren=function(){return this._children.length};a.prototype.addChild=function(b,c,d){-1==this._children.indexOf(b)&&(this._children.unshift(b),this.div.appendChild(b.canvas||b.div),this._setUpChild(b,this._children.length-1,c||0,d||0));return b};a.prototype.addChildAt=function(b,c,d,e){-1==this._children.indexOf(b)&&(this._children.splice(c,0,b),this.div.appendChild(b.canvas||b.div),this._setUpChild(b,c+1,d||0,e||0));return b};a.prototype.getChildIndex=
function(b){return this._children.indexOf(b)};a.prototype.setChildIndex=function(b,c,d,e){this.contains(b)&&this.removeChild(b);this.addChildAt(b,c,d,e)};a.prototype.removeChild=function(b){-1!=this._children.indexOf(b)&&(this.div.removeChild(b.canvas||b.div),this._children.splice(this._children.indexOf(b),1));return b};a.prototype.getChildAt=function(b){return this._children[b]||null};a.prototype.contains=function(b){return-1!=this._children.indexOf(b)};a.prototype._setUpChild=function(b,c,d,e){(b.canvas||
b.div).setAttribute("style","position:"+(b.canvas?"absolute":"relative")+";z-index:"+c+";left:"+d+";top:"+e)};tabageos.CanvasObjectContainer=a})();
(function(){function a(b,c,d){tabageos.EventDispatcher.call(this);b&&c&&this.init(b,c,d);this._aid=this.pr=this._thrott=0;if(a._instance)throw"ScreenOrganizer is a singleton, there should only be one ScreenOrganizer.";a._instance=this}a.prototype.constructor=a;a.prototype=Object.create(tabageos.EventDispatcher.prototype);a.prototype._thrott=0;a.prototype.pr=0;a.prototype._aid=0;a._instance=null;a.prototype._worker=null;a.prototype.stopWorker=function(){a._instance._worker&&(a._instance._worker.terminate(),
a._instance._worker=null)};a.prototype.startWorker=function(){a._instance._worker||(a._instance._worker=tabageos.GameSkeleton.game.__loopWorker())};a.prototype.init=function(b,c,d){this.theGame=b;if(!this.theGame.div&&!this.theGame.floor)throw"game must be a CanvasObjectContainer";this.myEvents=new tabageos.EventDispatcher;this.coverShape=new tabageos.CanvasObject(null,this.theGame.getWidth(),this.theGame.getHeight());this.coverShape.canvas.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;");
this.screenChanging=new tabageos.ScreenChangeEvent(0,tabageos.ScreenChangeEvent.SCREEN_CHANGE);this.covered=new tabageos.ScreenChangeEvent(0,tabageos.ScreenChangeEvent.COVER);this.uncovered=new tabageos.ScreenChangeEvent(0,tabageos.ScreenChangeEvent.UNCOVER);this.rectRef=new tabageos.Rectangle(0,0,0,0);this._screens=[];if(c){this.gameTitleScreen="function"==typeof c[0]?new c[0]:c[0];this._screens[0]=this.gameTitleScreen;if(null==this._screens[0])throw"The first screen should be the title screen and must be a CanvasObjectContainer.";
for(b=0;b<c.length;b++)if("function"==typeof c[b]?0!=b&&(this._screens[b]=new c[b]):0!=b&&(this._screens[b]=c[b]),d&&0!=d.length&&d[b]&&"function"==typeof d[b])d[b]()}};a.prototype.gameTitleScreen=null;a.prototype.currentScreen=null;a.prototype.bypassBasicGameObjectKill=null;a.prototype.myEvents=null;a.prototype._screens=null;a.prototype._waitForUnderCoverChanges=null;a.prototype.theGame=null;a.prototype.screenChanging=null;a.prototype.covered=null;a.prototype.uncovered=null;a.prototype.coverShape=
null;a.prototype.coverTimer=null;a.prototype.transitioning=0;a.prototype.getTransitionStatus=function(){return 0<this.transitioning};a.prototype.getScreens=function(){return this._screens};a.prototype.getGameReference=function(){return this.theGame};a.prototype.getCoverAnimationRate=function(){return this.coverTimer?this.coverTimer.delay:0};a.prototype.setCoverAnimationRate=function(b){this.coverTimer&&(this.coverTimer.delay=b)};a.prototype._cColor="#000000";a.prototype.getCoverColor=function(){return this._cColor};
a.prototype.setCoverColor=function(b){this._cColor=b;this.coverShape.fillRect(new tabageos.Rectangle(0,0,this.theGame.width,this.theGame.height),b)};a.prototype.getWaitForUnderCoverChanges=function(){return this._waitForUnderCoverChanges};a.prototype.setWaitForUnderCoverChanges=function(b){this._waitForUnderCoverChanges=b};a.prototype.showCoverNoKill=function(b){a._instance._thrott=b;a._instance.transitionForward()&&(window.cancelAnimationFrame(a._instance._aid),a._instance._worker.removeEventListener("message",
a._instance.showCoverNoKill),a._instance.myEvents.dispatchEvent(a._instance.screenChanging))};a.prototype.initializeTransition=function(){this.coverShape.setAlpha(1);this.rectRef.width=0;this.rectRef.height=0};a.prototype.addScreenUnderCover=function(b){window.cancelAnimationFrame(a._instance._aid);this.myEvents.removeEventListener(tabageos.ScreenChangeEvent.SCREEN_CHANGE,"addScreenUnderCover",this);1==this._waitForUnderCoverChanges&&this.addEventListener(tabageos.ScreenChangeEvent.UNDER_COVER_CHANGES_COMPLETE,
"initRemoveCover",this);this._screens[b.screenChangeNumber]&&this._screens[b.screenChangeNumber]!=this.theGame&&this.theGame.contains(this.coverShape)&&(this.theGame.removeChild(this.coverShape),this.theGame.addChild(this._screens[b.screenChangeNumber]),this.theGame.addChild(this.coverShape));this.currentScreen=b.screenChangeNumber;this.covered.screenChangeNumber=b.screenChangeNumber;1==this._waitForUnderCoverChanges?this.dispatchEvent(this.covered):(this.dispatchEvent(this.covered),this.initRemoveCover())};
a.prototype.rectRef=null;a.prototype.transitionBackward=function(){this.rectRef.width=this.coverShape.width;this.rectRef.height+=16;this.coverShape.context.clearRect(this.rectRef.x,this.rectRef.y,this.rectRef.width,this.rectRef.height);var b=this.rectRef.height>=this.coverShape.height;b&&(this.rectRef.width=0,this.rectRef.height=0);return b};a.prototype.transitionForward=function(){this.rectRef.width=this.coverShape.width;this.rectRef.height+=16;this.coverShape.drawRect(this.rectRef,"#000000");var b=
this.rectRef.height>=this.coverShape.height;b&&(this.rectRef.width=0,this.rectRef.height=0);return b};a.prototype.changeScreen=function(b){0==this.transitioning&&(window.cancelAnimationFrame(a._instance._aid),this.myEvents.addEventListener(tabageos.ScreenChangeEvent.SCREEN_CHANGE,"addScreenUnderCover",this),0!=this.theGame.getNumChildren()&&this.theGame.contains(this.coverShape)||(this.theGame.contains(this.coverShape)&&this.theGame.removeChild(this.coverShape),this.theGame.addChild(this.coverShape)),
this.transitioning=1,this.initializeTransition(),this.screenChanging.screenChangeNumber=b,a._instance._worker||(a._instance._worker=tabageos.GameSkeleton.game.__loopWorker()),a._instance._worker.addEventListener("message",a._instance.showCoverNoKill))};a.prototype.switchScreen=function(b){0==this.transitioning&&(window.cancelAnimationFrame(a._instance._aid),this.myEvents.addEventListener(tabageos.ScreenChangeEvent.SCREEN_CHANGE,"addScreenUnderCover",this),0!=this.theGame.getNumChildren()&&this.theGame.contains(this.coverShape)||
(this.theGame.contains(this.coverShape)&&this.theGame.removeChild(this.coverShape),this.theGame.addChild(this.coverShape)),this.transitioning=1,this.initializeTransition(),this.screenChanging.screenChangeNumber=b,a._instance._worker||(a._instance._worker=tabageos.GameSkeleton.game.__loopWorker()),a._instance._worker.addEventListener("message",this.showCoverAndKill))};a.prototype.initRemoveCover=function(b){this.removeEventListener(tabageos.ScreenChangeEvent.UNDER_COVER_CHANGES_COMPLETE,"initRemoveCover",
this);this.myEvents.addEventListener(tabageos.ScreenChangeEvent.SCREEN_CHANGE,"uncoverDone",this);a._instance._worker.addEventListener("message",a._instance.removeCoverByFadeOut)};a.prototype.removeCoverByFadeOut=function(b){a._instance._throt=b;a._instance.transitionBackward()&&(a._instance._worker.removeEventListener("message",a._instance.removeCoverByFadeOut),a._instance.theGame.contains(a._instance.coverShape)&&a._instance.theGame.removeChild(a._instance.coverShape),a._instance.myEvents.dispatchEvent(a._instance.screenChanging))};
a.prototype.showCoverAndKill=function(b){a._instance._thrott=b;if(a._instance.transitionForward()){for(a._instance._worker.removeEventListener("message",a._instance.showCoverAndKill);0<a._instance.theGame.getNumChildren();)a._instance.theGame.removeChild(a._instance.theGame.getChildAt(a._instance.theGame.getNumChildren()-1));a._instance.theGame.addChildAt(a._instance.coverShape,0);a._instance.myEvents.dispatchEvent(a._instance.screenChanging)}};a.prototype.uncoverDone=function(b){this.myEvents.removeEventListener(tabageos.ScreenChangeEvent.SCREEN_CHANGE,
"uncoverDone",this);this.uncovered.screenChangeNumber=b.screenChangeNumber;this.transitioning=0;this.dispatchEvent(this.uncovered);this.dispatchEvent(new tabageos.ScreenChangeEvent(b.screenChangeNumber,tabageos.ScreenChangeEvent.SCREEN_CHANGE));this.stopWorker()};tabageos.ScreenOrganizer=a})();
(function(){function a(b,c,d){tabageos.EventDispatcher.call(this);tabageos.ScreenOrganizer.call(this,b,c,d);this.fullRect=new tabageos.Rectangle;this.init(b,c,d)}a.prototype.constructor=a;a.prototype=Object.create(tabageos.EventDispatcher.prototype);Object.assign(a.prototype,tabageos.ScreenOrganizer.prototype);a.prototype.fullRect=null;a.prototype.initializeTransition=function(){this.coverShape.setAlpha(1);this.rectRef.width=this.coverShape.width;this.rectRef.height=this.coverShape.height;this.fullRect.x=
0;this.fullRect.y=0;this.fullRect.width=this.coverShape.width;this.fullRect.height=this.coverShape.height;this.coverShape.clear()};a.prototype.transitionBackward=function(){this.rectRef.height+=16*tabageos.TimeKeeper._sae;var b=this.coverShape.width,c=this.coverShape.height;this.coverShape.context.fillStyle="#000000";this.coverShape.context.fillRect(0,0,b,c);this.coverShape.context.save();this.coverShape.context.beginPath();this.coverShape.context.arc(b/2,c/2,0<=this.rectRef.height?this.rectRef.height:
0,0,2*Math.PI);this.coverShape.context.clip();this.coverShape.context.clearRect(0,0,b,c);this.coverShape.context.restore();b=this.coverShape.height>this.coverShape.width?this.coverShape.height:this.coverShape.width;if(c=this.rectRef.height>=b)this.rectRef.width=0,this.rectRef.height=b;return c};a.prototype.transitionForward=function(){this.rectRef.height-=16*tabageos.TimeKeeper._sae;var b=this.coverShape.width,c=this.coverShape.height;this.coverShape.context.fillStyle="#000000";this.coverShape.context.fillRect(0,
0,b,c);this.coverShape.context.save();this.coverShape.context.beginPath();this.coverShape.context.arc(b/2,c/2,0<=this.rectRef.height?this.rectRef.height:0,0,2*Math.PI);this.coverShape.context.clip();this.coverShape.context.clearRect(0,0,b,c);this.coverShape.context.restore();if(b=0>=this.rectRef.height)this.rectRef.width=0,this.rectRef.height=0;return b};tabageos.IrisScreenOrganizer=a})();
(function(){function a(b,c,d,e,f,g){tabageos.EventDispatcher.call(this);tabageos.CanvasObjectContainer.call(this,c,d,e,f,g);this._screenOrg=b||null;this.init(c,d,e,f,g)}a.prototype.constructor=a;a.prototype=Object.create(tabageos.EventDispatcher.prototype);Object.assign(a.prototype,tabageos.CanvasObjectContainer.prototype);a.prototype._buttons={};a.prototype._screenOrg=null;a.prototype._index=null;a.prototype._currentArea="";a.prototype.establishClickArea=function(b,c,d,e,f,g,h,k,l){this._buttons[b]=
[c,d,e,f,g,h,k,l];tabageos.MouseController.removeEventListener("mouseUp","handleClicks",this);tabageos.MouseController.removeEventListener("mouseMove","mousePositionHandler",this);tabageos.MouseController.addEventListener("mouseUp","handleClicks",this);tabageos.MouseController.addEventListener("mouseMove","mousePositionHandler",this);this._index=this._screenOrg._screens.indexOf(this)};a.prototype.disableClickAreas=function(){tabageos.MouseController.removeEventListener("mouseUp","handleClicks",this);
tabageos.MouseController.removeEventListener("mouseMove","mousePositionHandler",this)};a.prototype.enableClickAreas=function(){tabageos.MouseController.removeEventListener("mouseUp","handleClicks",this);tabageos.MouseController.removeEventListener("mouseMove","mousePositionHandler",this);tabageos.MouseController.addEventListener("mouseUp","handleClicks",this);tabageos.MouseController.addEventListener("mouseMove","mousePositionHandler",this)};a.prototype.remove=function(b){this._screenOrg.removeEventListener(tabageos.ScreenChangeEvent.COVER,
"remove",this);b&&b.screenChangeNumber==this._index||this._screenOrg.theGame.removeChild(this);tabageos.MouseController.removeEventListener("mouseUp","handleClicks",this);tabageos.MouseController.removeEventListener("mouseMove","mousePositionHandler",this)};a.prototype.handleClicks=function(b){var c,d=this._screenOrg.currentScreen;for(c in this._buttons){var e=this._buttons[c];if(b.x>e[2]&&b.x<e[3]&&b.y>e[4]&&b.y<e[5]&&d==this._index&&null!=e[0]&&e[0][e[1]])e[0][e[1]]()}};a.prototype.mousePositionHandler=
function(b){var c;for(c in this._buttons){var d=this._buttons[c];if(b.x>d[2]&&b.x<d[3]&&b.y>d[4]&&b.y<d[5]){var e=!0;this._currentArea=c;if(null!=d[6])d[6]()}else null!=d[7]&&this._currentArea==c&&(d[7](),this._currentArea=""),this._currentArea==c&&(this._currentArea="")}e?this.floor.canvas.setAttribute("style","position:absolute;z-index:-1;cursor:pointer"):this.floor.canvas.setAttribute("style","position:absolute;z-index:-1;cursor:auto")};tabageos.ScreenSkeleton=a})();
(function(){function a(b,c){tabageos.Event.call(this,b,c);this.type=b||"mouseEvent";this.potato=c;this.target=null;this.y=this.x=0}a.prototype.constructor=a;a.prototype=Object.create(tabageos.Event.prototype);a.prototype.x=0;a.prototype.y=0;a.MOUSE_UP="mouseUp";a.MOUSE_DOWN="mouseDown";a.MOUSE_EVENT="mouseEvent";a.MOUSE_MOVE="mouseMove";tabageos.MouseEvent=a})();
(function(){function a(){throw"This is a static class, construction is not needed.";}a.ready=!1;a._mX=0;a._mY=0;a._oX=1;a._oY=1;a._mmp=new tabageos.MoverPoint;a._ed=new tabageos.EventDispatcher;a._muE=new tabageos.MouseEvent(tabageos.MouseEvent.MOUSE_UP);a._mdE=new tabageos.MouseEvent(tabageos.MouseEvent.MOUSE_DOWN);a._mmE=new tabageos.MouseEvent(tabageos.MouseEvent.MOUSE_MOVE);a.mouseX=function(){if(0==tabageos.MouseController.ready||document.onmousemove!=tabageos.MouseController.updateMousePosition)document.onmousemove=
tabageos.MouseController.updateMousePosition,tabageos.MouseController.ready=!0,tabageos.MouseController._mmp=new tabageos.MoverPoint;return tabageos.MouseController._mX};a.mouseY=function(){if(0==tabageos.MouseController.ready||document.onmousemove!=tabageos.MouseController.updateMousePosition)document.onmousemove=tabageos.MouseController.updateMousePosition,tabageos.MouseController.ready=!0,tabageos.MouseController._mmp=new tabageos.MoverPoint;return tabageos.MouseController._mY};a.mouseMoverPoint=
function(){if(0==tabageos.MouseController.ready||document.onmousemove!=tabageos.MouseController.updateMousePosition)document.onmousemove=tabageos.MouseController.updateMousePosition,tabageos.MouseController.ready=!0,tabageos.MouseController._mmp=new tabageos.MoverPoint;return tabageos.MouseController._mmp};a.updateMousePosition=function(b){b=tabageos.MouseController._defineMouseEvent(b);tabageos.MouseController._origPX=b.pageX;tabageos.MouseController._origPY=b.pageY;tabageos.MouseController._mX=
b.pageX*a._oX;tabageos.MouseController._mY=b.pageY*a._oY;tabageos.MouseController._mmp.y=b.pageY*a._oY;tabageos.MouseController._mmp.x=b.pageX*a._oX;tabageos.MouseController._mmE.x=b.pageX*a._oX;tabageos.MouseController._mmE.y=b.pageY*a._oY;tabageos.MouseController.dispatchEvent(tabageos.MouseController._mmE)};a.mouseUpHandler=function(b){b=tabageos.MouseController._defineMouseEvent(b);tabageos.MouseController._muE.x=b.pageX*a._oX;tabageos.MouseController._muE.y=b.pageY*a._oY;tabageos.MouseController.dispatchEvent(tabageos.MouseController._muE)};
a.mouseDownHandler=function(b){b=tabageos.MouseController._defineMouseEvent(b);tabageos.MouseController._mdE.x=b.pageX*a._oX;tabageos.MouseController._mdE.y=b.pageY*a._oY;tabageos.MouseController.dispatchEvent(tabageos.MouseController._mdE)};a.addEventListener=function(b,c,d){tabageos.MouseController._ed.addEventListener(b,c,d);if("mouseUp"==b||"MouseUp"==b||"up"==b||"onmouseup"==b||"UP"==b||"Up"==b)document.onmouseup=tabageos.MouseController.mouseUpHandler;if("mouseDown"==b||"MouseDown"==b||"down"==
b||"onmousedown"==b||"DOWN"==b||"Down"==b)document.onmousedown=tabageos.MouseController.mouseDownHandler;if("mouseMove"==b||"MouseMove"==b||"move"==b||"onmousemove"==b||"MOVE"==b||"Move"==b)document.onmousemove=tabageos.MouseController.updateMousePosition};a.removeEventListener=function(b,c,d){return tabageos.MouseController._ed.removeEventListener(b,c,d)};a.dispatchEvent=function(b){tabageos.MouseController._ed.dispatchEvent(b)};a.defineMousePositionOffset=function(b,c,d,e){a._oX=b/d;a._oY=c/e};
a._defineMouseEvent=function(b){"undefined"==typeof b&&(b=window.event);return b};tabageos.MouseController=a})();
(function(){function a(b,c,d){tabageos.Event.call(this,c,d);this.target=null;this.screenChangeNumber=b||0;this.type=c||"screenChange";this.potato=d||{}}a.prototype.constructor=a;a.prototype=Object.create(tabageos.Event.prototype);a.prototype.screenChangeNumber=0;a.SCREEN_CHANGE="screenChange";a.COVER="cover";a.UNCOVER="unCover";a.UNDER_COVER_CHANGES_COMPLETE="underCoverChangesComplete";tabageos.ScreenChangeEvent=a})();
(function(){function a(b,c,d){a.transColor=b;this._bmdRef=c;this.multipleBitmapDatas=d;this._lastBitmapHit=null}a.prototype.constructor=a;a.transColor=0;a.bitmapData=null;a.prototype._lastBitmapHit=null;a.prototype._bmdRef=null;a.prototype._defaultReturn=!1;a.prototype.multipleBitmapDatas=null;a.prototype.wayIsClear=function(b,c){var d=this._bmdRef?this._bmdRef:a.bitmapData;if(!d)return this._defaultReturn;b=d.getPixel(b,c);return b==a.transColor||0==b?!0:!1};a.prototype.multipleWaysClear=function(b,
c,d){var e=!1;d=d||this.multipleBitmapDatas;var f;for(f=0;f<d.length&&(e=d[f],e=e.getPixel(b,c),e=e==a.transColor||0==e,e);f++);return e};a.prototype.multipleWaysClearAndRegister=function(b,c,d){var e=!1,f=d||this.multipleBitmapDatas,g;for(g=0;g<f.length;g++)if(d=f[g],e=d.getPixel(b,c),e=e==a.transColor,!e){this._lastBitmapHit=d;break}return e};tabageos.WayDeterminer=a})();
(function(){function a(b,c,d,e,f,g,h,k){tabageos.TravelerSkeleton.call(this,e,f,g,h);tabageos.Traveler.call(this,e,f,g,h);(b||c)&&this.init(b,c,d,e,f,g,h);this.health=100;this._deltaTime=k||tabageos.TimeKeeper._sae}a.prototype.constructor=a;a.prototype=Object.create(tabageos.TravelerSkeleton.prototype);Object.assign(a.prototype,tabageos.Traveler.prototype);a.prototype.init=function(b,c,d,e,f,g,h){this._source=b;this._canvas=c;this.toPoint=new tabageos.MoverPoint;this.fromRect=d||new tabageos.Rectangle(0,
0,32,32);this.x=e||0;this.y=f||0;this.height=h||0;this.width=g||0;this.travelType=null;this.blankRect=new tabageos.Rectangle;this.boundingMethod=tabageos.BoundMethods.bounceOff;this.mass=10;this.avoidSpace=35;this.maxSpeed=14;this.maxForce=25;this.separationDistance=this.spreadDistance=this.circleDistance=this.visionDistance=this.personalSpace=20;this.bypassAvoidDistance=null;this.wanderProximity=this.easeProximity=this.followDistance=20;this.wanderAngle=30;this.avoidDistance=this.wanderRange=this.wanderRadius=
20;this.health=100;this._blitType=this.fromHeightOffset=this.fromWidthOffset=0};a.prototype.fromRect=null;a.prototype.fromWidthOffset=0;a.prototype.fromHeightOffset=0;a.prototype.alphaPoint=null;a.prototype.fillColor=null;a.prototype.mergeAlpha=null;a.prototype.toPoint=null;a.prototype.blankRect=null;a.prototype.alphaBitmapData=null;a.prototype.travelType=null;a.prototype.boundingMethod=null;a.prototype.personalSpace=20;a.prototype.visionDistance=20;a.prototype.circleDistance=20;a.prototype.spreadDistance=
20;a.prototype.separationDistance=20;a.prototype.bypassAvoidDistance=null;a.prototype.maxForce=20;a.prototype.forceApplier=null;a.prototype.followDistance=20;a.prototype.easeProximity=20;a.prototype.wanderProximity=20;a.prototype.wanderAngle=30;a.prototype.wanderRadius=20;a.prototype.wanderRange=20;a.prototype.wanderOffset=null;a.prototype.avoidDistance=20;a.prototype.health=100;a.prototype.avoidSpace=20;a.prototype.mass=5;a.prototype.maxSpeed=20;a.prototype._source=null;a.prototype._canvas=null;
a.prototype._blitType=null;a.prototype._destination=null;a.prototype._wallObject=null;a.prototype._deltaTime=null;a.prototype.getDestination=function(){return this._destination};a.prototype.setDestination=function(b){this._destination=b};a.prototype.getSource=function(){return this._source};a.prototype.setSource=function(b){this._source=b};a.prototype.getBlitType=function(){var b=tabageos.BlittedTraveler.JUST_COPY;1==this._blitType&&(b=tabageos.BlittedTraveler.FILL_RECT_THEN_COPY);2==this._blitType&&
(b=tabageos.BlittedTraveler.COPY_THEN_COPY);return b};a.JUST_COPY="justCopy";a.FILL_RECT_THEN_COPY="fillRectTheCopy";a.COPY_THEN_COPY="copyThenCopy";a.prototype.setBlitType=function(b){b==tabageos.BlittedTraveler.JUST_COPY&&(this._blitType=0);b==tabageos.BlittedTraveler.FILL_RECT_THEN_COPY&&(this._blitType=1);if(b==tabageos.BlittedTraveler.COPY_THEN_COPY){if(!this.blankRect.width||!this.blankRect.height)throw Error("blankRect has no width or height, please set blankRect for copy_then_copy style blitting");
this._blitType=2}};a.prototype.getCanvas=function(){return this._canvas||null};a.prototype.setCanvas=function(b){this._canvas=b};a.prototype.getWallObject=function(){return this._wallObject};a.prototype.setWallObject=function(b){this._wallObject=b};a.prototype.update=function(){this.forceApplier.truncate(this.maxForce);this.forceApplier.divide(this.mass,0);this._veloc.add(this.forceApplier.multiply(this._deltaTime,0),0);this.forceApplier.reset();this._veloc._length=0;this._veloc._angle=0;this._veloc.truncate(this.maxSpeed);
this._pos.addBy(this._veloc.x*this._deltaTime,this._veloc.y*this._deltaTime,0);this._wallObject&&this.boundingMethod(this,this._wallObject);this.x=this._pos.x+1-1;this.y=this._pos.y+1-1;this._autoAnimation()};a.prototype.move=function(){this.forceApplier.truncate(this.maxForce);this.forceApplier.divide(this.mass,0);this._veloc.add(this.forceApplier.multiply(this._deltaTime,0),0);this.forceApplier.reset();this._veloc._length=0;this._veloc._angle=0;this._veloc.truncate(this.maxSpeed);this._pos.addBy(this._veloc.x*
this._deltaTime,this._veloc.y*this._deltaTime,0);this._wallObject&&this.boundingMethod(this,this._wallObject);this.x=this._pos.x+1-1;this.y=this._pos.y+1-1;this._autoAnimation()};a.prototype._autoAnimation=function(){this._autoAnimate&&this._source&&1<=this.currentAnimation.length?(this.changeDirectionAnimation(0>this._veloc.x,0<this._lastVeloc.x,0>this._veloc.y,0<this._veloc.y),this.animate(),this.blit()):this._autoAnimate&&this._canvas.context.fillRect(this.x,this.y,this.width,this.height)};a.prototype.travel=
function(){null!=this.travelType&&this.travelType(this._destination);this.move();this._autoAnimate||this.blit()};a.prototype.checkFutureWayIsClear=function(b){var c=this._pos.add(this._veloc.clone().truncate(this.maxSpeed));return b.wayIsClear(c.x,c.y)};a.prototype.checkCurrentWayIsClear=function(b){return b.wayIsClear(this.x,this.y)};a.prototype.checkPastWayIsClear=function(b){var c=this._pos.subtract(this._veloc.clone().truncate(this.maxSpeed));return b.wayIsClear(c.x,c.y)};a.prototype.blit=function(b,
c,d){b&&(this.fromRect=b);c?this.toPoint=c:d?d&&(this.toPoint.x=this.x,this.toPoint.y=this.y):(this.toPoint.x=this.x-(0!=this.fromWidthOffset?this.fromWidthOffset/2:0),this.toPoint.y=this.y-this.fromHeightOffset);1==this._blitType&&this._canvas.fillRect(this.fromRect,this.fillColor);2==this._blitType&&this._canvas.copyPixels(this._source,this.blankRect,this.toPoint);this._canvas.copyPixels(this._source,this.fromRect,this.toPoint,this.fromRect.width,this.fromRect.height)};a.prototype.currentAnimation=
"";a.prototype.animationSpecs={left:[4,[1,2,3,4,5,6,7]]};a.prototype.animationIndexOrder;a.prototype.ani=0;a.prototype.blitIndex;a.prototype.fromXOffset=0;a.prototype.fromYOffset=0;a.prototype.lastAnim="";a.prototype.toPoint;a.prototype.onlyHorizontalAnimations=0;a._onlyHorizontalAni=0;a.prototype.addedAnimationChanges=null;a.prototype._cpos;a.prototype._addedPos;a.prototype._playerRef=null;a.prototype._inDelay=0;a.prototype._autoAnimate=0;a.prototype.defineAnimation=function(b,c,d){this.animationSpecs[b]=
[d||1,c]};a.prototype.getPosition=function(){return this._pos};a.prototype.getCAPosition=function(b,c){this._cpos&&this._addedPos||(this._cpos=new tabageos.MoverPoint,this._addedPos=new tabageos.MoverPoint);this._cpos.x=this.x;this._cpos.y=this.y;if(b||c)this._addedPos.x=this.x+(b||0),this._addedPos.y=this.y+(c||0);return b||c?this._addedPos:this._cpos};a.prototype.changeLeftRightUpDownAnimation=function(b,c,d,e,f){this.currentAnimation=d||e||b||c||!this.lastAnim?d?"up":e?"down":b?"left":"right":
this.lastAnim;f||(this.lastAnim=this.currentAnimation)};a.prototype.changeFaceAnimation=function(b,c){this.y>=b.y+b.height&&(this.currentAnimation="up");this.y+this.height<b.y&&(this.currentAnimation="down");this.x>b.x+b.width&&(this.currentAnimation="left");this.x+this.width<b.x&&(this.currentAnimation="right");c&&(this.lastAnim=this.currentAnimation)};a.prototype.getDirectionOfAnimation=function(b,c,d){var e="";d||(-1!=b.indexOf("left")&&(e="left"),-1!=b.indexOf("right")&&(e="right"));c||(-1!=b.indexOf("up")&&
(e="up"),-1!=b.indexOf("down")&&(e="down"));return e};a.prototype.changeDirectionAnimation=function(b,c,d,e,f,g){var h=this.currentAnimation+"";this.currentAnimation=(d?"up":e?"down":"")+(b?"left":c?"right":(d||e)&&this.lastAnim.match("left")?"left":(d||e)&&this.lastAnim.match("right")?"right":"");0>=this.currentAnimation.length&&(this.currentAnimation=this.lastAnim.replace("idle","").replace("down","").replace("up","")+(g?"":"idle"));0>=this.currentAnimation.length&&(this.currentAnimation=h);f&&
(this.lastAnim=this.currentAnimation);this.addedAnimationChanges&&this._playerRef&&this.addedAnimationChanges(b,c,d,e,f,g)};a.prototype.animate=function(b){this.blitIndex=this.animationSpecs[this.currentAnimation]?this.animationSpecs[this.currentAnimation][0]:this.blitIndex;this.animationIndexOrder=this.animationSpecs[this.currentAnimation]?this.animationSpecs[this.currentAnimation][1]:this.animationIndexOrder;this.ani=this.ani>=this.animationIndexOrder.length-1?0:this.ani+(b||(0===this.onlyHorizontalAnimations?
2:1));if(this.currentAnimation!=this.lastAnim||0===this.onlyHorizontalAnimations&&this.ani>this.animationIndexOrder.length-2)this.ani=0;this.lastAnim=this.currentAnimation;b=Math.floor(this.ani);0!=b%2&&--b;0===this.onlyHorizontalAnimations?(this.fromRect.x=this.animationIndexOrder[b]*(this.width+this.fromXOffset),this.fromRect.y=this.animationIndexOrder[b+1]*(this.height+this.fromYOffset)):(this.fromRect.x=this.animationIndexOrder[b]*(this.width+this.fromXOffset),this.fromRect.y=this.blitIndex*(this.height+
this.fromYOffset));this.fromRect.width=this.width+this.fromWidthOffset;this.fromRect.height=this.height+this.fromHeightOffset};a.prototype.finishedCurrentAnimation=function(){return this.animationSpecs[this.currentAnimation]?this.ani>=this.animationSpecs[this.currentAnimation][1].length-1:!1};a.prototype._throttRef;a.prototype._cBB;a.prototype.delayedAnimateAndBlit=function(b,c,d,e){this._inDelay=1;d&&(this.currentAnimation=d);this._throttRef=b||0;this._cBB=e||0;var f=this;window.setTimeout(function(g){f._delayedFunction()},
c)};a.prototype._delayedFunction=function(b){this._inDelay&&(this.animate(this._throttRef),this._cBB&&this._canvas.context.clearRect(this.x,this.y,this.width,this.height),this.blit(),this._inDelay=0)};a.prototype.basicDepthSort=function(b,c,d,e,f){var g=!1;tabageos.GeometricMath.testForPointInCircle(this._pos,e,b._pos)&&(this.y>b.y+f?(this._canvas=c,b._canvas=d):(this._canvas=d,b._canvas=c),g=!0);return g};tabageos.BlittedTraveler=a})();
(function(){function a(b,c,d,e,f,g,h,k,l){tabageos.TravelerSkeleton.call(this,f,g,h,k);tabageos.Traveler.call(this,f,g,h,k);tabageos.BlittedTraveler.call(this,c,d,e,f,g,h,k,l);this.health=100;this._wayDeterminer=b;this.init(c,d,e,f,g,h,k);this.vCheckOffset=this.ani=0;this.currentAnimation=this.lastAnim="";this.animationSpecs={};this.animationIndexOrder=null;this._inDelay=this._throttRef=this._cBB=this.blitIndex=this.hCheckOffset=this.hCheckOffsetRight=this.fromYOffset=this.fromXOffset=this.fromWidthOffset=
this.fromHeightOffset=0;this._addedPos=this._cpos=null;this._deltaTime=l||tabageos.TimeKeeper._sae}a.prototype.constructor=a;a.prototype=Object.create(tabageos.TravelerSkeleton.prototype);Object.assign(a.prototype,tabageos.Traveler.prototype,tabageos.BlittedTraveler.prototype);a.prototype.currentAnimation="";a.prototype.animationSpecs={};a.prototype.animationIndexOrder=[];a.prototype.ani=0;a.prototype.lastAnim="";a.prototype.fromHeightOffset=0;a.prototype.fromWidthOffset=0;a.prototype.fromXOffset=
0;a.prototype.fromYOffset=0;a.prototype.hCheckOffsetRight=0;a.prototype.hCheckOffset=0;a.prototype.blitIndex=0;a.prototype.sae=null;a.prototype._wic=null;a.prototype._cpos=null;a.prototype._addedPos=null;a.prototype._wayDeterminer=null;a.prototype._moveY=null;a.prototype.vCheckOffsetUp=0;a.prototype.vCheckOffset=0;a.prototype._moveX=null;a.prototype._deltaTime=null;a.prototype._throttRef;a.prototype._cBB;a.prototype._inDelay=0;a.prototype.getUnreferencedPosition=function(b,c){this._cpos&&this._addedPos||
(this._cpos=new tabageos.MoverPoint,this._addedPos=new tabageos.MoverPoint);this._cpos.x=this.x;this._cpos.y=this.y;if(b||c)this._addedPos.x=this.x+(b||0),this._addedPos.y=this.y+(c||0);return b||c?this._addedPos:this._cpos};a.prototype.getBottomY=function(){return this.y+this.height};a.prototype.getMiddleY=function(){return this.y+this.height/2};a.prototype.getTopY=function(){return this.y+1-1};a.prototype.getRightX=function(){return this.x+this.width};a.prototype.getMiddleX=function(){return this.x+
this.width/2};a.prototype.getLeftX=function(){return this.x+1-1};a.prototype.move=function(){this.forceApplier.truncate(this.maxForce);this.forceApplier.divide(this.mass,0);var b=this._veloc.x+1-1,c=this._veloc.y+1-1;this._veloc.add(this.forceApplier.multiply(this._deltaTime,0),0);this.forceApplier.reset();this._veloc._length=0;this._veloc._angle=0;this._veloc.truncate(this.maxSpeed);var d=this._pos.y+this._veloc.y<this._pos.y?-1:1,e=this._pos.x+this._veloc.x*this._deltaTime,f=this._pos.y+this._veloc.y*
this._deltaTime;this._moveX=this.landCheckHorizontal(this._pos.x+this._veloc.x<this._pos.x?-1:1,e);this._moveY=this.landCheckVertical(d,f);this._moveX?this._pos.x=e:this._veloc.x=b;this._moveY?this._pos.y=f:this._veloc.y=c;this._wallObject&&this.boundingMethod(this,this._wallObject);this._moveX&&(this.x=this._pos.x+1-1);this._moveY&&(this.y=this._pos.y+1-1);this._autoAnimation()};a.prototype.landCheckHorizontal=function(b){var c=0;this._wayDeterminer.wayIsClear(-1==b?this.x-this.hCheckOffset:this.x+
this.width+this.hCheckOffsetRight,this.getMiddleY())&&(c=1);return c};a.prototype.landCheckVertical=function(b){var c=0;b=-1==b?this.getTopY()-this.vCheckOffsetUp:this.getBottomY()+this.vCheckOffset;this._wayDeterminer.wayIsClear(this.getMiddleX(),b)&&(c=1);return c};tabageos.WDTraveler=a})();
(function(){function a(b,c,d,e,f,g,h,k){tabageos.Event.call(this,g);this.type=g||"patternActionEvent";this.potato=this.potato||{};this.target=null;this.typeToBe=g;this.tileValue=b;this.tileXIndex=c;this.tileYIndex=d;this.autoCompute=f;this.patternIndex=e;this.x=h||0;this.y=k||0;f&&(this.x=this.tileXIndex*tabageos.BlitMath._specs.blitWidth,this.y=this.tileYIndex*tabageos.BlitMath._specs.blitHeight)}a.prototype.constructor=a;a.prototype=Object.create(tabageos.Event.prototype);a.PATTERN_ACTION_EVENT=
"patternActionEvent";a.FUNCTION_ASSIGNMENT="functionAssignment";a.prototype.tileValue=null;a.prototype.tileXIndex=0;a.prototype.tileYIndex=0;a.prototype.patternIndex=0;a.prototype.typeToBe=null;a.prototype.autoCompute=!1;a.prototype.x=0;a.prototype.y=0;a.prototype.clone=function(){var b=new a(this.tileValue,this.tileXIndex,this.tileYIndex,this.patternIndex,this.autoCompute,this.typeToBe,this.x,this.y);b.hitEvent=this.hitEvent||null;return b};tabageos.PatternActionEvent=a})();
(function(){function a(b,c,d){this.blitWidth=b||16;this.blitHeight=c||16;this.blitIndex=d||0}a.prototype.blitWidth=16;a.prototype.blitHeight=16;a.prototype.blitIndex=0;a.prototype.constructor=a;tabageos.BlitSpecs=a})();
(function(){function a(){}a.globalImageSource=null;a.ignoredY=0;a.pPointPool=[];a.ignored=0;a.ignoredArrays=[];a.basicPattern=null;a.levelPieceFunction=null;a.ignorSet=[];a.aLevelPiece=null;a._mpoint=new tabageos.MoverPoint;a._rect=new tabageos.Rectangle;a._specs=new tabageos.BlitSpecs(16,16,0);a.levelPieceFactory=function(){return a.aLevelPiece};a.getPositionPoint=function(){if(0>=a.pPointPool.length)for(;50>a.pPointPool.length;)a.pPointPool[a.pPointPool.length]=new tabageos.MoverPoint;return a.pPointPool.pop()};
a.getSpecs=function(){a._specs||(a._specs=new tabageos.BlitSpecs);return a._specs};a.setSpecs=function(b){a._specs=b};a.valuesMatch=function(b,c){var d=!1;if(b[0]||0===b[0]){var e=0,f=b.length;for(e;e<f;e++)if(b[e]!=c[e]){d=!1;break}else d=!0}else b==c&&(d=!0);return d};a.drawSquaresFromPattern=function(b,c,d,e,f){var g=0;d=d||16;e=e||16;for(g;g<c.length;g++){var h=0;for(h;h<c[g].length;h++){var k=c[g][h];k=0===k[0]||k[0]?k[0]:k;k=f&&f[k]?f[k]:-1;-1!=k&&(b.context.fillStyle=k,b.context.fillRect(h*
d,g*e,d,e))}}};a.drawSquaresFromAreaOfPattern=function(b,c,d,e,f,g,h,k,l,n,m){var p=d;h=h||16;k=k||16;for(p;p<e;p++){var q=f;for(q;q<g;q++){var r=c[p][q];r=0===r[0]||r[0]?r[0]:r;r=l&&l[r]?l[r]:0!=r?0:-1;if(-1!=r){var t=(m||0)+(p-d)*k;var v=(n||0)+(q-f)*h;b.context.fillStyle=r;b.context.fillRect(v,t,h,k)}}}};a.patternBlit=function(b,c,d,e,f,g,h){var k,l=d.length,n,m=d[0].length,p=new tabageos.Rectangle,q=new tabageos.MoverPoint;for(k=0;k<l;k++)for(n=0;n<m;n++){var r=d[k],t=e?e(r[n]):r[n],v=f?f(r[n]):
a._specs.blitIndex;-1!=a.ignorSet.indexOf(t)&&(t=a.ignored,v=0);r=(h||0)+k*a._specs.blitHeight;var w=(g||0)+n*a._specs.blitWidth;t*=a._specs.blitWidth;v*=a._specs.blitHeight;p.width=a._specs.blitWidth;p.height=a._specs.blitHeight;p.x=t;p.y=v;q.x=w;q.y=r;b.copyPixels(c,p,q)}};a.patternAreaBlit=function(b,c,d,e,f,g,h,k,l,n,m){var p=e,q=a._rect,r=a._mpoint;for(p;p<f;p++){var t=g;for(t;t<h;t++){var v=d[p],w=k?k(v[t]):v[t],u=l?l(v[t]):a._specs.blitIndex;-1!=a.ignorSet.indexOf(w)&&(w=a.ignored,u=0);v=(p-
e)*a._specs.blitHeight+(m||0);var x=(t-g)*a._specs.blitWidth+(n||0);w*=a._specs.blitWidth;u*=a._specs.blitHeight;q.width=a._specs.blitWidth;q.height=a._specs.blitHeight;q.x=w;q.y=u;r.x=x;r.y=v;b.copyPixels(c,q,r)}}};a.specificPatternAreaBlit=function(b,c,d,e,f,g,h,k,l){var n=e,m=a._rect,p=a._mpoint;for(n;n<f;n++){var q=g;for(q;q<h;q++){var r=d[n],t=r[q][1],v=r[q][0];-1!=a.ignorSet.indexOf(t)&&(t=a.ignored,v=0);r=(n-e)*a._specs.blitHeight+(l||0);var w=(q-g)*a._specs.blitWidth+(k||0);t*=a._specs.blitWidth;
v*=a._specs.blitHeight;m.width=a._specs.blitWidth;m.height=a._specs.blitHeight;m.x=t;m.y=v;p.x=w;p.y=r;b.copyPixels(c,m,p)}}};a.combinedPatternBlit=function(b,c,d,e,f){var g,h=d.length,k,l=d[0].length,n=a._rect,m=a._mpoint;for(g=0;g<h;g++)for(k=0;k<l;k++){var p=d[g],q=p[k]>>16,r=p[k]&65535;-1!=a.ignorSet.indexOf(q)&&(q=a.ignored,r=0);p=(f||0)+g*a._specs.blitHeight;var t=(e||0)+k*a._specs.blitWidth;q*=a._specs.blitWidth;r*=a._specs.blitHeight;n.width=a._specs.blitWidth;n.height=a._specs.blitHeight;
n.x=q;n.y=r;m.x=t;m.y=p;b.copyPixels(c,n,m)}};a.xySwitch=function(b,c,d){var e,f;for(e=0;e<b.length;e++)for(c=b[e],f=0;f<c.length;f++){d=c[f];var g=d.shift();var h=d.shift();d[0]=h;d[1]=g}};a.specificPatternBlit=function(b,c,d,e,f,g,h){var k,l=d.length,n,m=d[0].length,p=new tabageos.Rectangle,q=new tabageos.MoverPoint;for(k=0;k<l;k++)for(n=0;n<m;n++){var r=d[k],t=r[n][1],v=r[n][0],w;for(w=0;w<a.ignoredArrays.length;w++){var u=a.ignoredArrays[w];if(r[n][0]==u[0]&&r[n][1]==u[1]){t=a.ignored;v=a.ignoredY;
break}}var x=(h||0)+k*a._specs.blitHeight,z=(g||0)+n*a._specs.blitWidth;t*=a._specs.blitWidth;v*=a._specs.blitHeight;p.width=a._specs.blitWidth;p.height=a._specs.blitHeight;if(r[n][2]&&r[n][3]){w=0;var B=r[n][3];var y=r[n][2];for(w;w<a.ignoredArrays.length;w++)if(u=a.ignoredArrays[w],r[n][2]==u[0]&&r[n][3]==u[1]){B=a.ignored;y=a.ignoredY;break}p.x=B*a._specs.blitWidth;p.y=y*a._specs.blitHeight;q.x=z;q.y=x;b.copyPixels(c,p,q,e||a._specs.blitWidth,f||a._specs.blitHeight)}p.x=t;p.y=v;q.x=z;q.y=x;b.copyPixels(c,
p,q,e||a._specs.blitWidth,f||a._specs.blitHeight)}};a.patternActionEvent=new tabageos.PatternActionEvent;a.functionAssignments=[];a.dispatchFunctionAssignments=function(b,c,d,e,f,g){null!=c&&(b.addEventListener(tabageos.PatternActionEvent.FUNCTION_ASSIGNMENT,c,d),a.patternActionEvent.type==tabageos.PatternActionEvent.PATTERN_ACTION_EVENT&&(a.patternActionEvent=new tabageos.PatternActionEvent(0,0,0,0,!1,tabageos.PatternActionEvent.FUNCTION_ASSIGNMENT,0,0)));var h,k;if(e){var l=-1;var n=e.length,m;
for(m=0;m<n;m++){l++;var p=e[m];var q=p.length;for(h=0;h<q;h++){var r=p[h];for(k=0;k<a.functionAssignments.length;k++){var t=a.functionAssignments[k];if(("array"==typeof t||"object"==typeof t)&&a.valuesMatch(t,r)||"number"==typeof t&&t===r){a.patternActionEvent.tileValue=r;a.patternActionEvent.tileXIndex=h;a.patternActionEvent.tileYIndex=l;a.patternActionEvent.x=h*f;a.patternActionEvent.y=l*g;a.patternActionEvent.patternIndex=0;a.patternActionEvent.typeToBe=tabageos.PatternActionEvent.FUNCTION_ASSIGNMENT;
b.dispatchEvent(a.patternActionEvent);break}}}}null!=c&&b.removeEventListener(tabageos.PatternActionEvent.FUNCTION_ASSIGNMENT,c,d)}};a.isATileAt=function(b,c,d,e,f){var g,h,k=!1,l=d.length,n=d[0].length;for(g=0;g<l;g++)for(h=0;h<n;h++){var m=h*e;var p=g*f;if(b>=m&&b<m+e&&c>=p&&c<p+f&&(m=d[g][h],m[0]&&0!=m[0]||m[1]&&0!=m[1]||0!=m)){k=!0;break}}return k};a.tileDataHolder=[];a.convertInternalValues=function(b,c,d,e){var f=[],g=0;for(g;g<b.length;g++){var h=new tabageos.MoverPoint(g*c,e*d);h=new tabageos.TileData(h,
b[g]);f.push(h)}return f};a.isANonZeroTileAt=function(b,c,d,e,f){var g,h,k=!1,l=d.length,n=d[0].length;for(g=0;g<l;g++)for(h=0;h<n;h++){var m=h*e;var p=g*f;if(b>=m&&b<m+e&&c>=p&&c<p+f&&(m=d[g][h],m[0]&&m[1]&&0!=m[0]&&0!=m[1]||0!=m)){k=!0;break}}return k};a.getLocationOfTile=function(b,c,d,e,f){var g,h,k=null,l=c.length,n=c[0].length;for(g=0;g<l;g++)for(h=0;h<n;h++){var m=h*d;var p=g*e;var q=c[g][h];if(q[0]&&q[1]&&q[0]==b[0]&&q[1]==b[1]||q==b){f?(f.x=m,f.y=p):k=new tabageos.MoverPoint(m,p);break}}return k};
a.addSpecificValuesToMultiArray=function(b,c){var d=0,e=b.length;for(d;d<e;d++){var f=b[d];var g=0;var h=b[d].length;if(b[d][0]&&b[d][0].length)for(g;g<h;g++)g==h-1&&(f[g+1]=c[d]||[0,0]);else for(g;g<h;g++)g==h-1&&(f[g+1]=c[d]||0)}};a.cloneMultiArray=function(b){var c=0,d=b.length,e=[];for(c;c<d;c++){var f=b[c];var g=0;var h=b[c].length;if(b[c][0]&&b[c][0].length)for(e[c]=[],g;g<h;g++){var k=["number"==typeof f[g][0]?f[g][0]+1-1:f[g][0],"number"==typeof f[g][1]?f[g][1]+1-1:f[g][1]];e[c].push(k);f[g][2]&&
k.push("number"==typeof f[g][2]?f[g][2]+1-1:f[g][2]);f[g][3]&&k.push("number"==typeof f[g][3]?f[g][3]+1-1:f[g][3])}else for(e[c]=[],g;g<h;g++)e[c].push(f[g]+1-1)}return e};a.replaceAllOfValueFromMultiArray=function(b,c,d,e){var f=0,g=b.length,h=[];for(f;f<g;f++){var k=b[f];var l=0;var n=b[f].length;if(b[f][0]&&b[f][0].length)for(h[f]=[],l;l<n;l++){var m=["number"==typeof k[l][0]?k[l][0]+1-1:k[l][0],"number"==typeof k[l][1]?k[l][1]+1-1:k[l][1]];m[0]==c[0]&&m[1]==c[1]&&(m=[d||0,e||0]);h[f].push(m);
k[l][2]&&m.push("number"==typeof k[l][2]?k[l][2]+1-1:k[l][2]);k[l][3]&&m.push("number"==typeof k[l][3]?k[l][3]+1-1:k[l][3])}else for(h[f]=[],l;l<n;l++)h[f].push(k[l]!=c?k[l]+1-1:d||0)}return h};a.replaceValuesFromMultiArray=function(b,c,d,e){var f=1,g=c.length;b=a.replaceAllOfValueFromMultiArray(b,c[0],d,e);for(f;f<g;f++)b=a.replaceAllOfValueFromMultiArray(b,c[f],d,e);return b};a.resetTileDataHolder=function(){a.tileDataHolder=[]};a.convertToTileDataHolder=function(b,c,d){a.tileDataHolder=[];var e=
0;for(e;e<b.length;e++)a.tileDataHolder.push(a.convertInternalValues(b[e],c,d,b.indexOf(b[e])))};a.checkTileValueAt=function(b,c,d,e,f,g,h){var k,l,n=d.length,m=d[0].length;for(k=0;k<n;k++)for(l=0;l<m;l++){var p=l*e;var q=k*f;if(b>=p&&b<p+e&&c>=q&&c<q+f)return g&&!h&&(g.x=l+1-1,g.y=k+1-1),b=d[k][l],b[0]&&h&&h[0]&&h[0]==b[0]?b[1]&&h[1]&&h[1]==b[1]&&(g.x=l+1-1,g.y=k+1-1):b&&h&&b==h&&(g.x=l+1-1,g.y=k+1-1),b}return 0};a._wasmGetIndexFromArbitraryBitwise=null;a._wasmLeftBit=null;a._wasmRightBit=null;a.fasterCheckTileValueAt=
function(b,c,d,e,f,g,h){var k,l;for(k=0;k<d;k++)for(l=0;l<e;l++){var n=l*f;var m=k*g;if(b>=n&&b<n+f&&c>=m&&c<m+g){h&&(h.x=l+1-1,h.y=k+1-1);return}}};a.getTileDataAt=function(b,c,d,e,f){var g;(!a.tileDataHolder||0>=a.tileDataHolder.length)&&a.convertToTileDataHolder(d,e,f);var h,k=d.length,l=d[0].length;for(d=0;d<k;d++)for(h=0;h<l;h++){var n=h*e;var m=d*f;if(b>=n&&b<n+e&&c>=m&&c<m+f)return g=a.tileDataHolder[d][h]}return g||null};a.specificBlit=function(b,c,d,e,f,g,h){var k=h||0;g=g||0;h=new tabageos.Rectangle;
var l=new tabageos.MoverPoint;d=d[k];var n=d[g][1],m=d[g][0],p;for(p=0;p<a.ignoredArrays.length;p++){var q=a.ignoredArrays[p];if(d[g][0]==q[0]&&d[g][1]==q[1]){n=a.ignored;m=a.ignoredY;break}}k*=a._specs.blitHeight;var r=g*a._specs.blitWidth;n*=a._specs.blitWidth;m*=a._specs.blitHeight;h.width=a._specs.blitWidth;h.height=a._specs.blitHeight;if(d[g][2]&&d[g][3]){p=0;var t=d[g][3];var v=d[g][2];for(p;p<a.ignoredArrays.length;p++)if(q=a.ignoredArrays[p],d[g][2]==q[0]&&d[g][3]==q[1]){t=a.ignored;v=a.ignoredY;
break}h.x=t*a._specs.blitWidth;h.y=v*a._specs.blitHeight;l.x=r;l.y=k;b.copyPixels(c,h,l,e||a._specs.blitWidth,f||a._specs.blitHeight)}h.x=n;h.y=m;l.x=r;l.y=k;b.copyPixels(c,h,l,e||a._specs.blitWidth,f||a._specs.blitHeight)};a.removeTileData=function(b,c,d,e,f,g,h,k,l){c[b.position.y/f][b.position.x/g]=[0,0];d.context.clearRect(b.position.x,b.position.y,f,g);tabageos.BlitMath._specs.blitWidth=f;tabageos.BlitMath._specs.blitHeight=g;tabageos.BlitMath.specificBlit(d,e,c,f,g,b.position.x/g,b.position.y/
f);l||tabageos.BlitMath.convertToTileDataHolder(c,f,g)};a.addValueToTileDataPosition=function(b,c,d,e,f,g,h,k,l,n){d[b.position.y/g][b.position.x/h]=c;e.context.clearRect(b.position.x,b.position.y,g,h);tabageos.BlitMath._specs.blitWidth=g;tabageos.BlitMath._specs.blitHeight=h;tabageos.BlitMath.specificBlit(e,f,d,g,h,b.position.x/h,b.position.y/g);n||tabageos.BlitMath.convertToTileDataHolder(d,g,h)};a.addValueToPosition=function(b,c,d,e,f,g,h,k,l,n,m){e[c/h][b/k]=d;f&&(f.context.clearRect(b,c,h,k),
tabageos.BlitMath._specs.blitWidth=h,tabageos.BlitMath._specs.blitHeight=k,tabageos.BlitMath.specificBlit(f,g,e,h,k,b/k,c/h),m||tabageos.BlitMath.convertToTileDataHolder(e,h,k))};a.getBasicPatternOf=function(b,c,d,e,f){var g=c.length,h=c[0].length,k=[];if(f){f=g-1;var l=0;for(f;0<=f;f--){var n=l*d;var m=f*e;"number"!=typeof c[f][l]?c[f][l][0]==b[0]&&c[f][l][1]==b[1]&&(n=new tabageos.MoverPoint(n,m),k.push(n)):c[f][l]==b&&(n=new tabageos.MoverPoint(n,m),k.push(n));0===f&&l<h-1&&(l++,f=g-1)}}else for(f=
0;f<g;f++)for(l=0;l<h;l++)n=l*d,m=f*e,"number"!=typeof c[f][l]?c[f][l][0]==b[0]&&c[f][l][1]==b[1]&&(n=new tabageos.MoverPoint(n,m),k.push(n)):c[f][l]==b&&(n=new tabageos.MoverPoint(n,m),k.push(n));return k};tabageos.BlitMath=a})();
(function(){function a(b,c,d,e,f,g,h){(b||c)&&this.init(b,c,d,e,f,g,h)}a.prototype.constructor=a;a.prototype.init=function(b,c,d,e,f,g,h){this._source=b;this._canvas=c;this.currentAnimation="";this.ani=0;this.animationIndexOrder=null;this.animationSpecs={left:[4,[1,2,3,4,5,6,7]]};this.blitIndex=0;this.x=e||0;this.y=f||0;this.width=g||0;this.height=h||0;this.toPoint=new tabageos.MoverPoint;this.fromRect=d||new tabageos.Rectangle(0,0,this.width,this.height);this.fromHeightOffset=this.fromWidthOffset=
this.fromYOffset=this.fromXOffset=0;this.lastAnim="";this._addedPos=this._cpos=null;this._cBB=this._throttRef=this._inDelay=0;tabageos.CanvasAnimation._onlyHorizontalAni&&(this.onlyHorizontalAnimations=1)};a.prototype._source;a.prototype._canvas;a.prototype.currentAnimation="";a.prototype.animationSpecs={left:[4,[1,2,3,4,5,6,7]]};a.prototype.animationIndexOrder;a.prototype.ani=0;a.prototype.blitIndex;a.prototype.width=0;a.prototype.height=0;a.prototype.x=0;a.prototype.y=0;a.prototype.fromRect;a.prototype.fromXOffset=
0;a.prototype.fromYOffset=0;a.prototype.fromWidthOffset=0;a.prototype.fromHeightOffset=0;a.prototype.lastAnim="";a.prototype.toPoint;a.prototype.onlyHorizontalAnimations=0;a._onlyHorizontalAni=0;a.prototype.addedAnimationChanges=null;a.prototype._cpos;a.prototype._addedPos;a.prototype._playerRef=null;a.prototype._inDelay=0;a.prototype.defineAnimation=function(b,c,d){this.animationSpecs[b]=[d||1,c]};a.prototype.getPosition=function(b,c){this._cpos&&this._addedPos||(this._cpos=new tabageos.MoverPoint,
this._addedPos=new tabageos.MoverPoint);this._cpos.x=this.x;this._cpos.y=this.y;if(b||c)this._addedPos.x=this.x+(b||0),this._addedPos.y=this.y+(c||0);return b||c?this._addedPos:this._cpos};a.prototype.matchPosition=function(b,c,d){this.x=b.x+1-1-(c||0);this.y=b.y+1-1-(d||0)};a.prototype.changeLeftRightUpDownAnimation=function(b,c,d,e,f){this.currentAnimation=d||e||b||c||!this.lastAnim?d?"up":e?"down":b?"left":"right":this.lastAnim;f||(this.lastAnim=this.currentAnimation)};a.prototype.changeFaceAnimation=
function(b,c){this.y>=b.y+b.height&&(this.currentAnimation="up");this.y+this.height<b.y&&(this.currentAnimation="down");this.x>b.x+b.width&&(this.currentAnimation="left");this.x+this.width<b.x&&(this.currentAnimation="right");c&&(this.lastAnim=this.currentAnimation)};a.prototype.getDirectionOfAnimation=function(b,c,d){var e="";d||(-1!=b.indexOf("left")&&(e="left"),-1!=b.indexOf("right")&&(e="right"));c||(-1!=b.indexOf("up")&&(e="up"),-1!=b.indexOf("down")&&(e="down"));return e};a.prototype.changeDirectionAnimation=
function(b,c,d,e,f,g,h){var k=this.currentAnimation+"";this.currentAnimation=(d?"up":e?"down":"")+(b?"left":c?"right":(d||e)&&this.lastAnim.match("left")?"left":(d||e)&&this.lastAnim.match("right")?"right":"");0>=this.currentAnimation.length&&!h&&(this.currentAnimation=this.lastAnim.replace("idle","").replace("down","").replace("up","")+(g?"":"idle"));0>=this.currentAnimation.length&&(this.currentAnimation=k);f&&(this.lastAnim=this.currentAnimation);this.addedAnimationChanges&&this._playerRef&&this.addedAnimationChanges(b,
c,d,e,f,g)};a.prototype.resetCurrentAnimation=function(){this.ani=0};a.prototype.animate=function(b){this.blitIndex=this.animationSpecs[this.currentAnimation]?this.animationSpecs[this.currentAnimation][0]:this.blitIndex;this.animationIndexOrder=this.animationSpecs[this.currentAnimation]?this.animationSpecs[this.currentAnimation][1]:this.animationIndexOrder;this.ani=this.ani>=this.animationIndexOrder.length-1?0:this.ani+(b||(0===this.onlyHorizontalAnimations?2:1));if(this.currentAnimation!=this.lastAnim||
0===this.onlyHorizontalAnimations&&this.ani>this.animationIndexOrder.length-2)this.ani=0;this.lastAnim=this.currentAnimation;b=Math.floor(this.ani);0!=b%2&&--b;0===this.onlyHorizontalAnimations?(this.fromRect.x=this.animationIndexOrder[b]*(this.width+this.fromXOffset),this.fromRect.y=this.animationIndexOrder[b+1]*(this.height+this.fromYOffset)):(this.fromRect.x=this.animationIndexOrder[b]*(this.width+this.fromXOffset),this.fromRect.y=this.blitIndex*(this.height+this.fromYOffset));this.fromRect.width=
this.width+this.fromWidthOffset;this.fromRect.height=this.height+this.fromHeightOffset};a.prototype.finishedCurrentAnimation=function(){return this.animationSpecs[this.currentAnimation]?this.onlyHorizontalAnimations?Math.round(this.ani)>=this.animationSpecs[this.currentAnimation][1].length-1:Math.round(this.ani)>=this.animationSpecs[this.currentAnimation][1].length-3:!1};a.prototype._throttRef;a.prototype._cBB;a.prototype.delayedAnimateAndBlit=function(b,c,d,e){this._inDelay=1;d&&(this.currentAnimation=
d);this._throttRef=b||0;this._cBB=e||0;var f=this;window.setTimeout(function(g){f._delayedFunction()},c)};a.prototype._delayedFunction=function(b){this._inDelay&&(this.animate(this._throttRef),this._cBB&&this._canvas.context.clearRect(this.x,this.y,this.width,this.height),this.blit(),this._inDelay=0)};a.prototype.blit=function(b,c,d){b&&(this.fromRect=b);c?this.toPoint=c:d?d&&(this.toPoint.x=this.x,this.toPoint.y=this.y):(this.toPoint.x=this.x-(0!=this.fromWidthOffset?this.fromWidthOffset/2:0),this.toPoint.y=
this.y-this.fromHeightOffset);this._canvas.copyPixels(this._source,this.fromRect,this.toPoint,this.fromRect.width,this.fromRect.height)};tabageos.CanvasAnimation=a})();
(function(){function a(b,c,d,e){this.x=b||0;this.y=c||0;this.z=d||0;this.spacing=e||45}a.prototype.constructor=a;a.prototype.x=0;a.prototype.y=0;a.prototype.z=0;a.prototype.spacing=45;a.prototype.mpIntoIso=function(b,c){c?(c.x=b.x-b.y,c.y=(b.x+b.y)/2):(this.x=b.x-b.y,this.y=(b.x+b.y)/2)};a.prototype.isoIntoMp=function(b,c){c?(b.x=(2*c.y+c.x)/2,b.y=(2*c.y-c.x)/2):(b.x=(2*this.y+this.x)/2,b.y=(2*this.y-this.x)/2)};a.rawToIsoWithSpacing=function(b,c,d,e,f){b/=f;c/=f;return d?(b+2*c)/2:(b-2*c)/2};a.rawToScreenWithSpacing=
function(b,c,d,e,f,g){return e?g*(b+c):g/2*(b-c)-d*g*1.2};a.rawToScreen=function(b,c,d,e,f){return e?(2*c+b)/2:(2*c-b)/2};a.rawToIso=function(b,c,d,e){return d?b-c:(b+c)/2};tabageos.SimpleIsoPoint=a})();
(function(){function a(b,c,d,e,f,g){tabageos.MoverSkeleton.call(this,b,c,e,f);this.width=e||0;this.height=f||0;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(b||0,c||0);this._veloc=new tabageos.MoverPoint(0,0);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=new tabageos.MoverPoint(b||0,c||0);this.x=b||0;this.y=c||0;this._rect=new tabageos.Rectangle(this.x,this.y,this.width,this.height);this.z=d||0;this.dY=this.dX=0;this.face=1;this.depth=g||this.height+1-1;
this._passCalcs={x1:0,y1:0,x2:0,y2:0,x3:0,y3:0};this._ddY=this._ddX=0;this.moveLimits=[];this.directions={1:"north",3:"south",2:"east",4:"west",6:"northeast",7:"southeast",5:"northwest",8:"southwest"}}a.prototype.constructor=a;a.prototype=Object.create(tabageos.MoverSkeleton.prototype);a.prototype.z=0;a.prototype.depth=100;a.prototype.face=1;a.prototype.moveLimits=[];a.prototype.directions={1:"north",3:"south",2:"east",4:"west",6:"northeast",7:"southeast",5:"northwest",8:"southwest"};a.prototype.directionFacing=
function(){return this.directions[this.face]};a.prototype.getX=function(){return this.x};a.prototype.setX=function(b){b>this.x&&(this.dX=1,this.face=0==this.dY?2:1==this.dY?7:6);b<this.x&&(this.dX=-1,this.face=0==this.dY?4:1==this.dY?8:5);b==this.x&&(this.dX=0,0!=this.dY&&(this.face=1==this.dY?3:1));this.x=b+1-1;this._pos.x=b+1-1};a.prototype.getY=function(){return this.y};a.prototype.setY=function(b){b>this.y&&(this.dY=1,this.face=0==this.dX?3:1==this.dX?7:8);b<this.y&&(this.dY=-1,this.face=0==this.dX?
1:1==this.dX?6:5);b==this.y&&(this.dY=0,0!=this.dX&&(this.face=1==this.dX?2:4));this.y=b+1-1;this._pos.y=b+1-1};a.prototype._ddX=0;a.prototype._ddY=0;a.prototype.desiredDirection=function(b,c,d,e,f){var g=this.x+1-1,h=this.y+1-1,k=this.dX+1-1,l=this.dY+1-1;this.dY=this.dX=0;f=f||this;d&&this.setY(f.y-f._veloc.y);e&&this.setY(f.y+f._veloc.y);b&&this.setX(f.x-f._veloc.x);c&&this.setX(f.x+f._veloc.x);this._ddX=this.dX+1-1;this._ddY=this.dY+1-1;this.x=g;this.y=h;this._pos.x=g;this._pos.y=h;this.dX=k;
this.dY=l};a.prototype.move=function(b,c,d,e,f,g,h,k,l,n){this.dY=this.dX=0;this.desiredDirection(b,c,d,e);var m=1;f&&(this.canPassOnMap(f,g||this.width,h||this.height,k,l,n)||(m=0));f=this.x+1-1;g=this.y+1-1;m&&(d&&this.setY(this.y-this._veloc.y),e&&this.setY(this.y+this._veloc.y),b&&this.setX(this.x-this._veloc.x),c&&this.setX(this.x+this._veloc.x));f==this.x&&g==this.y&&(m=0);return m};a.prototype._passCalcs={x1:0,y1:0,x2:0,y2:0,x3:0,y3:0};a.prototype.canPassOnMap=function(b,c,d,e,f,g){var h=1,
k=d||this.height,l=c||this.width;c=this.x+(Math.abs(this._veloc.x)-c/(f||2)*-this._ddX-(g||0))+this._veloc.x*this._ddX;d=this.y+(Math.abs(this._veloc.y)-d/(f||2)*-this._ddY-(g||0))+this._veloc.y*this._ddY;f=c+l;g=d+k;this._passCalcs.x3=-99999;this._passCalcs.y3=-99999;switch(this.face){case 1:this._passCalcs.x1=c;this._passCalcs.y1=d;this._passCalcs.x2=f;this._passCalcs.y2=d;break;case 3:this._passCalcs.x1=c;this._passCalcs.y1=g;this._passCalcs.x2=f;this._passCalcs.y2=g;break;case 2:this._passCalcs.x1=
f;this._passCalcs.y1=g;this._passCalcs.x2=f;this._passCalcs.y2=d;break;case 4:this._passCalcs.x1=c;this._passCalcs.y1=d;this._passCalcs.x2=c;this._passCalcs.y2=g;break;case 6:this._passCalcs.x1=f;this._passCalcs.y1=d;this._passCalcs.x2=f;this._passCalcs.y2=g;this._passCalcs.x3=c;this._passCalcs.y3=d;break;case 7:this._passCalcs.x1=f;this._passCalcs.y1=d;this._passCalcs.x2=f;this._passCalcs.y2=g;this._passCalcs.x3=c;this._passCalcs.y3=g;break;case 5:this._passCalcs.x1=f;this._passCalcs.y1=d;this._passCalcs.x2=
c;this._passCalcs.y2=g;this._passCalcs.x3=c;this._passCalcs.y3=d;break;case 8:this._passCalcs.x1=c,this._passCalcs.y1=d,this._passCalcs.x2=f,this._passCalcs.y2=g,this._passCalcs.x3=c,this._passCalcs.y3=g}c=0;d=e.length;if(b[Math.floor(this._passCalcs.y1/k)]&&b[Math.floor(this._passCalcs.y1/k)][Math.floor(this._passCalcs.x1/l)])for(g=b[Math.floor(this._passCalcs.y1/k)][Math.floor(this._passCalcs.x1/l)],c;c<d;c++){if(f=e[c],g==f||g&&0<=g[0]&&g[0]==f[0]&&g[1]==f[1])h=0}else return 0;if(b[Math.floor(this._passCalcs.y2/
k)]&&b[Math.floor(this._passCalcs.y2/k)][Math.floor(this._passCalcs.x2/l)])for(g=b[Math.floor(this._passCalcs.y2/k)][Math.floor(this._passCalcs.x2/l)],c=0,c;c<d;c++){if(f=e[c],g==f||g&&0<=g[0]&&g[0]==f[0]&&g[1]==f[1])h=0}else return 0;if(-99999!=this._passCalcs.x3)if(b[Math.floor(this._passCalcs.y3/k)]&&b[Math.floor(this._passCalcs.y3/k)][Math.floor(this._passCalcs.x3/l)])for(g=b[Math.floor(this._passCalcs.y3/k)][Math.floor(this._passCalcs.x3/l)],c=0,c;c<d;c++){if(f=e[c],g==f||g&&0<=g[0]&&g[0]==f[0]&&
g[1]==f[1])h=0}else return 0;return h};tabageos.SimpleIsoBox=a})();
(function(){function a(b,c,d,e,f,g,h){tabageos.CanvasAnimation.call(this,b,c,d,e,f,g,h);(b||c)&&this.init(b,c,d,e,f,g,h);this._currentValue=[]}a.prototype.constructor=a;a.prototype=Object.create(tabageos.CanvasAnimation.prototype);a.prototype._currentValue=[];a.prototype.getAnimationValue=function(){if(this.onlyHorizontalAnimations)var b=this.animationSpecs[this.currentAnimation][0],c=this.animationSpecs[this.currentAnimation][1][Math.floor(this.ani)];else c=this.animationSpecs[this.currentAnimation][1][Math.floor(this.ani)],
b=this.animationSpecs[this.currentAnimation][1][Math.floor(this.ani)+1];this._currentValue[0]=b+1-1;this._currentValue[1]=c+1-1;return this._currentValue};tabageos.SimpleIsoAnimation=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p){tabageos.MoverSkeleton.call(this,e,f,h,k);tabageos.SimpleIsoBox.call(this,e,f,g,h,k,l);this.width=h||0;this.height=k||0;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(e,f);this._veloc=new tabageos.MoverPoint(0,0);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=new tabageos.MoverPoint(e,f);this.x=e||0;this.y=f||0;this._rect=new tabageos.Rectangle(this.x,this.y,this.width,this.height);this.z=g||0;this.dY=this.dX=
0;this.depth=l||this.height+1-1;this._passCalcs={x1:0,y1:0,x2:0,y2:0,x3:0,y3:0};this._ddY=this._ddX=0;this.moveLimits=[];this.scene=n;this.animation=new tabageos.SimpleIsoAnimation(b,c,d,e,f,m||h,p||k);this.traveler=new tabageos.Traveler(e,f,h,k)}a.prototype.constructor=a;a.prototype=Object.create(tabageos.MoverSkeleton.prototype);Object.assign(a.prototype,tabageos.SimpleIsoBox.prototype);a.prototype.scene;a.prototype.animation;a.prototype.traveler;a.prototype.animateInScene=function(b){this.animation.currentAnimation=
this.directionFacing();this.animation.animate(b||1)};a.prototype.matchTraveler=function(b,c,d){this._veloc.x=this.traveler._veloc.x+1-1;this._veloc.y=this.traveler._veloc.y+1-1;b?(this.setX(this.traveler.x+1-1),this.setY(this.traveler.y+1-1)):c?this.setX(this.traveler.x+1-1):d&&this.setY(this.traveler.y+1-1)};a.prototype.travelerMatchThis=function(b){this.traveler._veloc.x=this._veloc.x+1-1;this.traveler._veloc.y=this._veloc.y+1-1;b&&(this.traveler.x=this.x+1-1,this.traveler.y=this.y+1-1,this.traveler._pos.x=
this._pos.x+1-1,this.traveler._pos.y=this._pos.y+1-1)};tabageos.SimpleIsoCharacter=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p,q,r,t,v){this._helperPoint=new tabageos.SimpleIsoPoint(0,0,0);this._mp=new tabageos.MoverPoint;this._rect=new tabageos.Rectangle;this._rect2=new tabageos.Rectangle;this._focusTile=new tabageos.SimpleIsoPoint;this._focusPoint=new tabageos.SimpleIsoPoint;this.sceneXOffset=m||100;this.sceneYOffset=p||100;this._twidth=b;this._theight=c;this._canvas=e;this._floor=d||null;this._player=f;this._map=g;this._img=h;this._yIndex=0;this.noPassValue=l||[1,3];this.floorValues=
n||[0,0];this._spread=q||.009;2<=this._spread&&window.console.warn("spread spreads out each tile, normally it should be 0 through .9, default is .009, smaller and negative values will bring tiles closer together, each decimal place moves things greatly");this.playerTileValue=k;this._secondDraws=[];this._overDraws=[];this._xSpreadShifter=r||0;this._ySpreadShifter=t||0;this.movingBoxes=[];this._floorScreenCordsArray=[];this._cam=v||null;this._effRect1=new tabageos.Rectangle;this._effRect2=new tabageos.Rectangle;
this._blittOnce=0}a.prototype.constructor=a;a.prototype.sceneYOffset=500;a.prototype.sceneXOffset=250;a.prototype._helperPoint;a.prototype._rect;a.prototype._rect2;a.prototype._mp;a.prototype._focusTile;a.prototype._focusPoint;a.prototype._canvas;a.prototype._floor;a.prototype._player;a.prototype.playerTileValue;a.prototype._map;a.prototype._spread=.009;a.prototype._img;a.prototype._twidth=50;a.prototype._theight=50;a.prototype._xSpreadShifter=0;a.prototype._ySpreadShifter=.02;a.prototype._upperTileOffset=
1;a.prototype.noPassValue=[1,3];a.prototype.floorValues=[0,0];a.prototype.movingBoxes=[];a.prototype._floorScreenCordsArray=[];a.prototype._cam;a.prototype._secondDraws=[];a.prototype._overDraws=[];a.prototype.updateTileCoordinates=function(b,c,d,e,f){this._focusTile.x=Math.round(b/d);this._focusTile.y=Math.round(c/e);f?(this._focusPoint.x=f.x+1-1,this._focusPoint.y=f.y+1-1):(this._focusPoint.x=this._focusTile.x*d,this._focusPoint.y=this._focusTile.y*e)};a.prototype.getPosition=function(b,c,d,e,f,
g,h){h=h||this._spread;var k=(b>c?b/c:c/b)+this._xSpreadShifter;var l=(c>b?b/c:c/b)+this._ySpreadShifter;var n=l/2+h;this._mp.x=l/k*(k/2+h)*tabageos.SimpleIsoPoint.rawToIso(d,e,1,0)+(f||this.sceneXOffset);this._mp.y=k/l*n*tabageos.SimpleIsoPoint.rawToIso(d,e,0,1)+(g||this.sceneYOffset);this._mp.x-=b-this._twidth;this._mp.y-=c-this._theight;return new tabageos.MoverPoint(this._mp.x,this._mp.y)};a.prototype.draw=function(b,c,d,e,f,g,h,k,l,n){n=n||this._spread;var m=d[1];d=d[0];this._rect.width=e;this._rect.height=
f;this._rect.x=m*e;this._rect.y=d*f;d=(e>f?e/f:f/e)+this._xSpreadShifter;m=(f>e?e/f:f/e)+this._ySpreadShifter;var p=m/2+n;this._mp.x=m/d*(d/2+n)*tabageos.SimpleIsoPoint.rawToIso(g,h,1,0)+(k||this.sceneXOffset);this._mp.y=d/m*p*tabageos.SimpleIsoPoint.rawToIso(g,h,0,1)+(l||this.sceneYOffset);this._mp.x-=e-this._twidth;this._mp.y-=f-this._theight;this._cam?(this._effRect1.x=this._cam.v.x,this._effRect1.y=this._cam.v.y,this._effRect1.width=this._cam.viewPortWidth,this._effRect1.height=this._cam.viewPortHeight,
this._effRect2.x=this._mp.x,this._effRect2.y=this._mp.y,this._effRect2.width=e,this._effRect2.height=f,1<=tabageos.GeometricMath.rectanglesOverlapAmount(this._effRect1,this._effRect2)/e&&b.copyPixels(c,this._rect,this._mp,e,f)):b.copyPixels(c,this._rect,this._mp,e,f)};a.prototype.rectUpdate=function(b,c,d,e){this._rect.x=this._focusPoint.x;this._rect.y=this._focusPoint.y;this._rect.width=(d>e?d:e)+d/2;this._rect.height=e+d/2;this._rect2.x=b;this._rect2.y=c;this._rect2.width=(d>e?d:e)+d/2;this._rect2.height=
e+d/2};a.prototype._yIndex=0;a.prototype._effRect1;a.prototype._effRect2;a.prototype._blittOnce=0;a.prototype.checkTileValueAt=function(b,c,d,e,f,g){return tabageos.BlitMath.checkTileValueAt(b,c,d,e,f,g)};a.prototype.specificPatternBlit=function(b,c,d,e,f,g,h,k){var l=this._floorScreenCordsArray.length=0,n=d.length,m=d[0].length;k=k||this._spread;this._overDraws.length=0;this._secondDraws.length=0;for(l;l<n;l++){var p=0;for(p;p<m;p++){var q=d[l];var r=0<=q[p][1]?q[p][1]:q[p];var t=0<=q[p][0]?q[p][0]:
this._yIndex;var v=l*f;var w=p*e;var u=r*e;var x=t*f;this._rect.width=e;this._rect.height=f;this._rect.x=u;this._rect.y=x;var z=e>f?e/f:f/e;var B=f>e?e/f:f/e;z+=this._xSpreadShifter;B+=this._ySpreadShifter;var y=z/2+k;var D=B/2+k;this._mp.x=B/z*y*tabageos.SimpleIsoPoint.rawToIso(w,v,1,0)+(g||this.sceneXOffset);this._mp.y=z/B*D*tabageos.SimpleIsoPoint.rawToIso(w,v,0,1)+(h||this.sceneYOffset);var A=x=0;for(A;A<this.floorValues.length;A+=2)if(r==this.floorValues[A+1]&&t==this.floorValues[A]){x=1;break}x?
(0==this._blittOnce&&this._floor?this._floor.copyPixels(c,this._rect,this._mp,e,f):this._floor||(this._cam?(this._effRect1.x=this._cam.v.x,this._effRect1.y=this._cam.v.y,this._effRect1.width=this._cam.viewPortWidth,this._effRect1.height=this._cam.viewPortHeight,this._effRect2.x=this._mp.x,this._effRect2.y=this._mp.y,this._effRect2.width=e,this._effRect2.height=f,1<=tabageos.GeometricMath.rectanglesOverlapAmount(this._effRect1,this._effRect2)/e&&b.copyPixels(c,this._rect,this._mp,e,f)):b.copyPixels(c,
this._rect,this._mp,e,f)),this._floorScreenCordsArray.push(this._mp.x+1-1),this._floorScreenCordsArray.push(this._mp.y+1-1),this._floorScreenCordsArray.push(p+1-1),this._floorScreenCordsArray.push(l+1-1)):(this._secondDraws.push(l*f),this._secondDraws.push(p*e),this._secondDraws.push(q[p]));x&&q[p][2]&&this.draw(b,c,[q[p][2],q[p][3]],e,f,w,v,this.sceneXOffset,this.sceneYOffset,k);this._rect.x=this._focusPoint.x;this._rect.y=this._focusPoint.y;this._rect.width=(e>f?e:f)+e/2;this._rect.height=f+e/2;
this._rect2.x=w;this._rect2.y=v;this._rect2.width=(e>f?e:f)+e/2;this._rect2.height=f+e/2;A=e>f?e:f;tabageos.GeometricMath.rectanglesOverlapAmount(this._rect,this._rect2);t=0;var C=this.movingBoxes.length;for(t;t<C;t++)u=this.movingBoxes[t],u.x<this._player.x+this._player.width/2&&(this.updateTileCoordinates(u.x,u.y,u.width,u.height,u),this.rectUpdate(w,v,e,f),r=tabageos.GeometricMath.rectanglesOverlapAmount(this._rect,this._rect2)/A,(this._focusTile.x==p&&this._focusTile.y==l&&x||.01<=r&&x)&&this.draw(b,
c,u.animation.getAnimationValue(),u.animation.width,u.animation.height,this._focusPoint.x,this._focusPoint.y,this.sceneXOffset,this.sceneYOffset,k));this.updateTileCoordinates(this._player.x,this._player.y,this._player.width,this._player.height,this._player);this.rectUpdate(w,v,e,f);r=tabageos.GeometricMath.rectanglesOverlapAmount(this._rect,this._rect2)/A;this._focusTile.x==p&&this._focusTile.y==l&&x&&this._player.animation||.01<=r&&x&&this._player.animation?this.draw(b,c,this._player.animation.getAnimationValue(),
this._player.animation.width,this._player.animation.height,this._focusPoint.x,this._focusPoint.y,this.sceneXOffset,this.sceneYOffset,k):w>this._focusPoint.x+e-1&&!x&&(this._overDraws.push(l*f),this._overDraws.push(p*e),this._overDraws.push(q[p]));t=0;for(t;t<C;t++)u=this.movingBoxes[t],u.x>this._player.x+this._player.width/2&&(this.updateTileCoordinates(u.x,u.y,u.width,u.height,u),this.rectUpdate(w,v,e,f),r=tabageos.GeometricMath.rectanglesOverlapAmount(this._rect,this._rect2)/A,(this._focusTile.x==
p&&this._focusTile.y==l&&x||.01<=r&&x)&&this.draw(b,c,u.animation.getAnimationValue(),u.animation.width,u.animation.height,this._focusPoint.x,this._focusPoint.y,this.sceneXOffset,this.sceneYOffset,k))}}l=0;n=this._secondDraws.length;for(l;l<n;l+=3){d=this._secondDraws[l+2];m=this._secondDraws[l+1];p=this._secondDraws[l];this.draw(b,c,d,e,f,m,p,this.sceneXOffset,this.sceneYOffset,k);this.updateTileCoordinates(this._player.x,this._player.y,this._player.width,this._player.height,this._player);this._rect.x=
this._focusPoint.x;this._rect.y=this._focusPoint.y;this._rect.width=(e>f?e:f)+4*e;this._rect.height=f+4*e;this._rect2.x=m;this._rect2.y=p;this._rect2.width=(e>f?e:f)+4*e;this._rect2.height=f+4*e;A=2*e;tabageos.GeometricMath.rectanglesOverlapAmount(this._rect,this._rect2);t=0;for(t;t<C;t++)u=this.movingBoxes[t],u.x<this._player.x+this._player.width/2&&(this.updateTileCoordinates(u.x,u.y,u.width,u.height,u),this.rectUpdate(m,p,e,f),r=tabageos.GeometricMath.rectanglesOverlapAmount(this._rect,this._rect2)/
A,.01<=r&&this._rect2.x<this._focusPoint.x+e+1&&this._focusPoint.y+f>this._rect2.y&&this.draw(b,c,u.animation.getAnimationValue(),u.animation.width,u.animation.height,this._focusPoint.x,this._focusPoint.y,this.sceneXOffset,this.sceneYOffset,k));this.updateTileCoordinates(this._player.x,this._player.y,this._player.width,this._player.height,this._player);this.rectUpdate(m,p,e,f);r=tabageos.GeometricMath.rectanglesOverlapAmount(this._rect,this._rect2)/A;.01<=r&&this._rect2.x<this._focusPoint.x+e+1&&
this._focusPoint.y+f>this._rect2.y&&this._player.animation&&this.draw(b,c,this._player.animation.getAnimationValue(),this._player.animation.width,this._player.animation.height,this._focusPoint.x,this._focusPoint.y,this.sceneXOffset,this.sceneYOffset,k);t=0;for(t;t<C;t++)u=this.movingBoxes[t],u.x>this._player.x+this._player.width/2&&(this.updateTileCoordinates(u.x,u.y,u.width,u.height,u),this.rectUpdate(m,p,e,f),r=tabageos.GeometricMath.rectanglesOverlapAmount(this._rect,this._rect2)/A,.01<=r&&this._rect2.x<
this._focusPoint.x+e+1&&this._focusPoint.y+f>this._rect2.y&&this.draw(b,c,u.animation.getAnimationValue(),u.animation.width,u.animation.height,this._focusPoint.x,this._focusPoint.y,this.sceneXOffset,this.sceneYOffset,k));for(q=2;0<=d[q]&&15>=q;)if(0<=d[q])r=0<=d[q+1]?d[q+1]:d,t=0<=d[q]?d[q]:0,u=r*e,x=t*f,this._rect.width=e,this._rect.height=f,this._rect.x=u,this._rect.y=x,this._mp.x=B/z*y*tabageos.SimpleIsoPoint.rawToIso(m,p,1,0)+(g||this.sceneXOffset),this._mp.y=z/B*D*tabageos.SimpleIsoPoint.rawToIso(m,
p,0,1)+(h||this.sceneYOffset)-f/this._upperTileOffset*(q/2),this._cam?(this._effRect1.x=this._cam.v.x,this._effRect1.y=this._cam.v.y,this._effRect1.width=this._cam.viewPortWidth,this._effRect1.height=this._cam.viewPortHeight,this._effRect2.x=this._mp.x,this._effRect2.y=this._mp.y,this._effRect2.width=e,this._effRect2.height=f,1<=tabageos.GeometricMath.rectanglesOverlapAmount(this._effRect1,this._effRect2)/e&&b.copyPixels(c,this._rect,this._mp,e,f)):b.copyPixels(c,this._rect,this._mp,e,f),q+=2;else break}l=
0;n=this._overDraws.length;for(l;l<n;l+=3){d=this._overDraws[l+2];m=this._overDraws[l+1];p=this._overDraws[l];this.draw(b,c,d,e,f,m,p,this.sceneXOffset,this.sceneYOffset,k);for(q=2;0<=d[q]&&15>=q;)if(0<=d[q])r=0<=d[q+1]?d[q+1]:d,t=0<=d[q]?d[q]:0,u=r*e,x=t*f,this._rect.width=e,this._rect.height=f,this._rect.x=u,this._rect.y=x,this._mp.x=B/z*y*tabageos.SimpleIsoPoint.rawToIso(m,p,1,0)+(g||this.sceneXOffset),this._mp.y=z/B*D*tabageos.SimpleIsoPoint.rawToIso(m,p,0,1)+(h||this.sceneYOffset)-f/this._upperTileOffset*
(q/2),this._cam?(this._effRect1.x=this._cam.v.x,this._effRect1.y=this._cam.v.y,this._effRect1.width=this._cam.viewPortWidth,this._effRect1.height=this._cam.viewPortHeight,this._effRect2.x=this._mp.x,this._effRect2.y=this._mp.y,this._effRect2.width=e,this._effRect2.height=f,1<=tabageos.GeometricMath.rectanglesOverlapAmount(this._effRect1,this._effRect2)/e&&b.copyPixels(c,this._rect,this._mp,e,f)):b.copyPixels(c,this._rect,this._mp,e,f),q+=2;else break;t=0;for(t;t<C;t++)u=this.movingBoxes[t],u.x>this._player.x+
this._player.width/2&&(this.updateTileCoordinates(u.x,u.y,u.width,u.height,u),this.rectUpdate(m,p,e,f),r=tabageos.GeometricMath.rectanglesOverlapAmount(this._rect,this._rect2)/A,.01<=r&&this._rect2.x<this._focusPoint.x+e+1&&this._focusPoint.y+f>this._rect2.y&&this.draw(b,c,u.animation.getAnimationValue(),u.animation.width,u.animation.height,this._focusPoint.x,this._focusPoint.y,this.sceneXOffset,this.sceneYOffset,k))}this._blittOnce=1};a.prototype.render=function(b,c){this.updateTileCoordinates(this._player.x,
this._player.y,this._player.width,this._player.height,this._player);this._canvas.context.clearRect(0,0,b||1E3,c||1E3);this.specificPatternBlit(this._canvas,this._img,this._map,this._twidth,this._theight,this.sceneXOffset,this.sceneYOffset,this._spread)};tabageos.SimpleIsoScene=a})();
(function(){function a(b,c,d,e,f,g,h){tabageos.EventDispatcher.call(this);this.mainChar=h;this._source=b;this.sW=d;this.sH=e;this.tW=f;this.tH=g;this._display=c;this._cameraPoint=new tabageos.MoverPoint;this._totalScenes=[0]}a.prototype.constructor=a;a.prototype=Object.create(tabageos.EventDispatcher.prototype);a.prototype.sW;a.prototype.sH;a.prototype.tW;a.prototype.tH;a.prototype.mainChar;a.prototype._source;a.prototype._display;a.prototype._cameraPoint;a.prototype.currentMap;a.prototype._mapNumber=
1;a.prototype.currentScene=1;a.prototype._map1;a.prototype._map2;a.prototype._totalScenes=[0];a.prototype._direcs={left:0,right:1,down:2,up:3};a.prototype._enemyArrays=[0];a.prototype.addEnemyArray=function(b,c){var d=[],e=0;for(e;e<b.length;e++)d[e]=b[e];this._enemyArrays[c||this.currentScene]=d};a.prototype.getEnemyArray=function(b){return this._enemyArrays[b]};a.prototype._otherArrays=[0];a.prototype.addStoredArray=function(b,c){var d=[],e=0;for(e;e<b.length;e++)d[e]=b[e];0==e&&(d=[0],d.length=
0);this._otherArrays[c||this.currentScene]=d};a.prototype.getStoredArray=function(b){if(!b||0>=b)b=1;return this._otherArrays[b]};a.prototype.defineMap1=function(b){this._map1=tabageos.BlitMath.cloneMultiArray(b)};a.prototype.defineMap2=function(b){this._map2=tabageos.BlitMath.cloneMultiArray(b)};a.prototype.addScene=function(b){this._totalScenes.push(tabageos.BlitMath.cloneMultiArray(b));this._desiredMap&&this._totalScenes[this._desiredMap]&&(this.currentMap=this._totalScenes[this._desiredMap+1-
1],this._desiredMap=0)};a.prototype.add5Scenes=function(b,c,d,e,f){this._totalScenes.push(tabageos.BlitMath.cloneMultiArray(b));this._totalScenes.push(tabageos.BlitMath.cloneMultiArray(c));this._totalScenes.push(tabageos.BlitMath.cloneMultiArray(d));this._totalScenes.push(tabageos.BlitMath.cloneMultiArray(e));this._totalScenes.push(tabageos.BlitMath.cloneMultiArray(f));this._desiredMap&&this._totalScenes[this._desiredMap]&&(this.currentMap=this._totalScenes[this._desiredMap+1-1],this._desiredMap=
0)};a.prototype.referenceScene=function(b){return this._totalScenes[b]||null};a.prototype.clearAllArrays=function(){this._totalScenes.length=0;this._otherArrays.length=0;this._enemyArrays.length=0};a.prototype._desiredMap=0;a.prototype.changeCurrentMap=function(b){1==b&&this._map1?(this.currentMap=this._map1,this._mapNumber=1):(this.currentMap=this._map2||this._totalScenes[b],this.currentMap||(this._desiredMap=b+1-1),this._mapNumber=b)};a.prototype.changeSceneEnemies=function(b){var c=this.getEnemyArray(b);
c||(this.addEnemyArray([],b),c=this.getEnemyArray(b));return c};a.prototype.changeSceneryObjects=function(b){var c=this.getStoredArray(b);c||(this.addStoredArray([],b),c=this.getStoredArray(b));return c};a.prototype.sceneryObjectSceneChange=function(b,c,d,e,f,g){if(b){var h=0;d&&b.x<=d&&(this._totalScenes[this.currentScene-1]?(h=this.getStoredArray(this.currentScene-1),h||(this.addStoredArray([],this.currentScene-1),h=this.getStoredArray(this.currentScene-1)),h.push(b),c.splice(c.indexOf(b),1)):this._totalScenes[this._totalScenes.length-
1]&&(h=this.getStoredArray(this._totalScenes.length-1),h||(this.addStoredArray([],this._totalScenes.length-1),h=this.getStoredArray(this._totalScenes.length-1)),h.push(b),c.splice(c.indexOf(b),1)),b.setX(e-5),h=1);e&&b.x>=e&&(this._totalScenes[this.currentScene+1]?(h=this.getStoredArray(this.currentScene+1),h||(this.addStoredArray([],this.currentScene+1),h=this.getStoredArray(this.currentScene+1)),h.push(b),c.splice(c.indexOf(b),1)):this._totalScenes[1]&&(h=this.getStoredArray(1),h||(this.addStoredArray([],
1),h=this.getStoredArray(1)),h.push(b),c.splice(c.indexOf(b),1)),b.setX(d+4),h=1);f&&b.y<=f&&(this._totalScenes[this.currentScene-1]?(h=this.getStoredArray(this.currentScene-1),h||(this.addStoredArray([],this.currentScene-1),h=this.getStoredArray(this.currentScene-1)),h.push(b),c.splice(c.indexOf(b),1)):this._totalScenes[this._totalScenes.length-1]&&(h=this.getStoredArray(this._totalScenes.length-1),h||(this.addStoredArray([],this._totalScenes.length-1),h=this.getStoredArray(this._totalScenes.length-
1)),h.push(b),c.splice(c.indexOf(b),1)),b.setY(g-b.width-1),h=1);g&&b.y>=g&&(this._totalScenes[this.currentScene+1]?(h=this.getStoredArray(this.currentScene+1),h||(this.addStoredArray([],this.currentScene+1),h=this.getStoredArray(this.currentScene+1)),h.push(b),c.splice(c.indexOf(b),1)):this._totalScenes[1]&&(h=this.getStoredArray(1),h||(this.addStoredArray([],1),h=this.getStoredArray(1)),h.push(b),c.splice(c.indexOf(b),1)),b.setY(f+4),h=1);return h}};a.prototype.changeScene=function(b,c,d,e,f,g,
h,k,l,n,m,p){c="number"==typeof c?c:this._direcs[c]||1;g?this._totalScenes[g]&&(this.currentScene=g,this.currentMap=this._totalScenes[this.currentScene],this.mainChar._map=tabageos.BlitMath.cloneMultiArray(this.currentMap)):(0==b&&(0==c&&(--this.currentScene,this._totalScenes[this.currentScene]?this.currentMap=this._totalScenes[this.currentScene]:(this.currentScene=this._totalScenes.length-1,this.currentMap=this._totalScenes[this.currentScene]||this._map2),this.mainChar.setX(this.sW-2*this.mainChar.width)),
1==c&&(this.currentScene+=1,this._totalScenes[this.currentScene]?this.currentMap=this._totalScenes[this.currentScene]:(this.currentScene=1,this.currentMap=this._totalScenes[this.currentScene]||this._map1),this.mainChar.setX(2*this.mainChar.width)),2==c&&(this.currentScene+=1,this._totalScenes[this.currentScene]?this.currentMap=this._totalScenes[this.currentScene]:(this.currentScene=1,this.currentMap=this._totalScenes[this.currentScene]||this._map1),this.mainChar.setY(2)),3==c&&(--this.currentScene,
this._totalScenes[this.currentScene]?this.currentMap=this._totalScenes[this.currentScene]:(this.currentScene=this._totalScenes.length-1,this.currentMap=this._totalScenes[this.currentScene]||this._map2),this.mainChar.setY(this.sH-(this.mainChar.width+1)))),1!=b&&2!=b||this.changeCurrentMap(b),this.mainChar._map=tabageos.BlitMath.cloneMultiArray(this.currentMap));b=0;var q=this.getEnemyArray(this.currentScene);if(q&&!l){for(b;b<q.length;b++)l=q[b],l._map=this.mainChar._map;b=0;if(q=this.getStoredArray(this.currentScene))for(b;b<
q.length;b++)l=q[b],l._map=this.mainChar._map}this._display.context.clearRect(0,0,this.sW,this.sH);e&&tabageos.BlitMath.dispatchFunctionAssignments(this,e,f,this.currentMap,this.tW,this.tH);this._source?tabageos.BlitMath.specificPatternBlit(this._display,this._source,this.currentMap,this.tW,this.tH):tabageos.BlitMath.drawSquaresFromPattern(this._display,this.currentMap,this.tW,this.tH,d?d.colorValues:{});!g&&d&&(this._cameraPoint.x=Math.round(this.mainChar.x)-(0!=c?d.cameraFollowOffsetX:2*-this.tW),
this._cameraPoint.y=Math.round(this.mainChar.y)-(3==c?2*-this.tH:d.cameraFollowOffsetY),d.reset(h?d.v.x:1==c?0:d.v.width,k?d.v.y:2==c?0:d.v.height),d.tweenedBlitLayerRender(this._cameraPoint,0,0,n&&m?Math.round(n/m):16,p||"Linear",0,0))};tabageos.TileSceneChanger=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n){tabageos.TravelerSkeleton.call(this,f,g,h,k);tabageos.Traveler.call(this,f,g,h,k);tabageos.BlittedTraveler.call(this,c,d,e,f,g,h,k);tabageos.WDTraveler.call(this,b,c,d,e,f,g,h,k);this.init(c,d,e,f,g,h,k);this._wayDeterminer=this._cWD=b;this.rImageHolder=l;this.rFromRect=n;this.roExA=0;l&&(this.rToPoint=new tabageos.MoverPoint(-((this.rImageHolder.width-this.roExA)/2),-((this.rImageHolder.height-this.roExA)/2)),this._brFromRct=new tabageos.Rectangle(0,0,
this.rFromRect.width,this.rFromRect.height))}a.prototype.constructor=a;a.prototype=Object.create(tabageos.TravelerSkeleton.prototype);Object.assign(a.prototype,tabageos.Traveler.prototype,tabageos.BlittedTraveler.prototype,tabageos.WDTraveler.prototype);a.prototype.nr;a.prototype.getRotation=function(){return this.nr};a.prototype.setRotation=function(b){this.nr=b;b=(this.rImageHolder.width-this.roExA)/2;var c=(this.rImageHolder.height-this.roExA)/2;this.rImageHolder.context.clearRect(0,0,this.rImageHolder.width,
this.rImageHolder.height);this.rImageHolder.context.save();this.rImageHolder.context.translate(b,c);this.rImageHolder.context.rotate(this.nr/360*Math.PI*2);this.rImageHolder.copyPixels(this._source,this.rFromRect,this.rToPoint,this.rFromRect.width,this.rFromRect.height);this.rImageHolder.context.restore()};a.prototype.roExA=0;a.prototype.rFromRect;a.prototype._brFromRct;a.prototype.rToPoint;a.prototype._aro=0;a.prototype._defaultAro=0;a.prototype.alwaysDisplayRotationOnly=function(){this._defaultAro=
0==this._defaultAro?1:0;this._aro=1};a.prototype.rotateWithMoverPoint=function(b,c,d,e){this.nr=180*Math.atan2(b.y+(c||0)-this.y,b.x+(d||0)-this.x)/Math.PI;b=(this.rImageHolder.width-this.roExA)/2;c=(this.rImageHolder.height-this.roExA)/2;this.rImageHolder.context.clearRect(0,0,this.rImageHolder.width,this.rImageHolder.height);this.rImageHolder.context.save();this.rImageHolder.context.translate(b,c);this.rImageHolder.context.rotate(this.nr/360*Math.PI*2);this.rImageHolder.copyPixels(this._source,
this.rFromRect,this.rToPoint,this.rFromRect.width,this.rFromRect.height);this.rImageHolder.context.restore()};a.prototype.animateRotationOnly=function(){this.animate();this.rFromRect.width=this.fromRect.width;this.rFromRect.height=this.fromRect.height;this.rFromRect.x=this.fromRect.x;this.rFromRect.y=this.fromRect.y;this._aro=1};a.prototype.blit=function(b,c,d){b&&(this.fromRect=b);c?this.toPoint=c:(this.toPoint.x=this.x+1-1,this.toPoint.y=this.y+1-1);0==this._aro?this._canvas.copyPixels(this._source,
this.fromRect,this.toPoint,this.fromRect.width+this.fromWidthOffset,this.fromRect.height+this.fromHeightOffset):this._aro=this._defaultAro;this._canvas.copyPixels(this.rImageHolder.canvas,this._brFromRct,d||this.toPoint,this.rFromRect.width,this.rFromRect.height)};tabageos.RotatingTraveler=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p,q){tabageos.TravelerSkeleton.call(this,f,g,h,k);tabageos.Traveler.call(this,f,g,h,k);tabageos.BlittedTraveler.call(this,c,d,e,f,g,h,k);tabageos.WDTraveler.call(this,b,c,d,e,f,g,h,k);tabageos.RotatingTraveler.call(this,b,c,d,e,f,g,h,k,l,n);this.init(c,d,e,f,g,h,k);this._wayDeterminer=this._cWD=b;this.rImageHolder=l;this.rFromRect=n;this.roExA=0;this.rToPoint=new tabageos.MoverPoint(-((this.rImageHolder.width-this.roExA)/2),-((this.rImageHolder.height-
this.roExA)/2));this._brFromRct=new tabageos.Rectangle(0,0,this.rFromRect.width,this.rFromRect.height);this.bulletHolder=[];this._bulletCanvas=m;this.bulletFromRect=p;this.bulletSpeed=14;if(this.bulletMap=q||null)this.bulletType=2}a.prototype.constructor=a;a.prototype=Object.create(tabageos.TravelerSkeleton.prototype);Object.assign(a.prototype,tabageos.Traveler.prototype,tabageos.BlittedTraveler.prototype,tabageos.WDTraveler.prototype,tabageos.RotatingTraveler.prototype);a.prototype.bulletHolder=
[];a.prototype.bulletFromRect;a.prototype._bulletCanvas;a.prototype.bulletSpeed=14;a.prototype.bulletType=1;a.prototype.bulletMap=null;a.prototype.reload=function(b){for(var c;this.bulletHolder.length<b;)c=new tabageos.Rectangle(this.bulletFromRect.x+1-1,this.bulletFromRect.y+1-1,this.bulletFromRect.width+1-1,this.bulletFromRect.height+1-1),1===this.bulletType?c=new tabageos.BlittedTraveler(this._source,this._bulletCanvas,c,0,0,this.bulletFromRect.width,this.bulletFromRect.height):(c=new tabageos.CanvasAnimation(this._source,
this._bulletCanvas,c,0,0,this.bulletFromRect.width,this.bulletFromRect.height),c=new tabageos.MapTraveler(0,0,this.bulletFromRect.width,this.bulletFromRect.height,this.bulletMap,c,1)),this.bulletHolder.push(c)};a.prototype.shoot=function(b,c){0>=this.bulletHolder.length&&this.reload(100);var d=this.bulletHolder.pop();d.setX(this.x+this.width/2+(b||0));d.setY(this.y+this.height/2+(c||0));d._veloc.x=Math.cos(this.nr/180*Math.PI)*this.bulletSpeed;d._veloc.y=Math.sin(this.nr/180*Math.PI)*this.bulletSpeed;
return d};a.prototype.reclaimBullet=function(b){b&&(b.setX(0),b.setY(0),b._veloc.x=0,b._veloc.y=0,this.bulletHolder.unshift(b))};tabageos.RotatingShooter=a})();
(function(){function a(b,c,d,e,f,g,h){tabageos.TravelerSkeleton.call(this,e,f,g,h);tabageos.Traveler.call(this,e,f,g,h);tabageos.BlittedTraveler.call(this,b,canvasObejct,d,e,f,g,h);this.init(b,c,d,e,f,g,h);this.tileValue=this.playerHoldingThis=null;this.xDirection=this.weight=1}a.prototype.constructor=a;a.prototype=Object.create(tabageos.TravelerSkeleton.prototype);Object.assign(a.prototype,tabageos.Traveler.prototype,tabageos.BlittedTraveler.prototype);a.prototype.playerHoldingThis;a.prototype.weight=
1;a.prototype.xDirection=1;a.prototype.tileValue=null;a.prototype._fromEnemyAi=0;tabageos.SceneryObjectBlittedTraveler=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p){tabageos.TravelerSkeleton.call(this,b,c,d,e);tabageos.MapTraveler.call(this,b,c,d,e,f,g,h,k,l,n,m,p);this.tileValue=this.playerHoldingThis=null;this.xDirection=this.weight=1;this._fromEnemyAi=0}a.prototype.constructor=a;a.prototype=Object.create(tabageos.TravelerSkeleton.prototype);Object.assign(a.prototype,tabageos.MapTraveler.prototype);a.prototype.playerHoldingThis;a.prototype._fromEnemyAi=0;a.prototype.weight=1;a.prototype.xDirection=1;a.prototype.tileValue=
null;tabageos.SceneryObjectTraveler=a})();
(function(){function a(b,c){this.position=b||new tabageos.MoverPoint;this.value=c}a.prototype.constructor=a;a.prototype.position;a.prototype.value;a._pool=[];a.make=function(b,c,d){if(0>=tabageos.TileData._pool.length){var e=0;for(e;50>e;e++)tabageos.TileData._pool.push(new tabageos.TileData(new tabageos.MoverPoint,null))}e=tabageos.TileData._pool.pop();e.position.x=Math.floor(b);e.position.y=Math.floor(c);e.value=d;return e};a.prototype.clone=function(){return new tabageos.TileData(this.position,this.value)};
tabageos.TileData=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p,q){this.layerToRender=b;this.b1=c;this.b2=d;this.b3=e;this.b4=f;this.b5=g;this.c1=l||0;this.c2=n||0;this.c3=m||0;this.c4=p||0;this.c5=q||0;this.tweens1=[];this.tweens2=[];this.p=new tabageos.MoverPoint;this.v=new tabageos.Rectangle(0,0);this.layerToRender&&(this.v=new tabageos.Rectangle(0,0,this.layerToRender.width,this.layerToRender.height));this.viewPortWidth=h;this.viewPortHeight=k;this._justMoveParallax=0;this._cbRect=new tabageos.Rectangle(0,0,0,
0);this._isoPoint=new tabageos.MoverPoint;this._constantV=new tabageos.Rectangle(0,0,this.layerToRender.width,this.layerToRender.height)}a.prototype.constructor=a;a.prototype.layerToRender;a.prototype.b1;a.prototype.b1ActualMover;a.prototype.b2;a.prototype.b2ActualMover;a.prototype.b3;a.prototype.b3ActualMover;a.prototype.b4;a.prototype.b4ActualMover;a.prototype.b5;a.prototype.b5ActualMover;a.prototype.c1=0;a.prototype.c2=0;a.prototype.c3=0;a.prototype.c4=0;a.prototype.c5=0;a.prototype.rfm1=0;a.prototype.rfm2=
0;a.prototype.rfm3=0;a.prototype.rfm4=0;a.prototype.rfm5=0;a.prototype.viewPortWidth;a.prototype.viewPortHeight;a.prototype.lastVXr=0;a.prototype.p;a.prototype.trsh=0;a.prototype.v;a.prototype._constantV;a.prototype.tweens1=[];a.prototype.tweens2=[];a.prototype.lastvx=0;a.prototype.lastvy=0;a.prototype.p1Tweens1=[];a.prototype.p1Tweens2=[];a.prototype.p2Tweens1=[];a.prototype.p2Tweens2=[];a.prototype._pLayer1;a.prototype._pLayer2;a.prototype._pV1;a.prototype._pV2;a.prototype.pTweenType1="Linear";
a.prototype.pTweenTime1=0;a.prototype.pTweenType2="Linear";a.prototype.pTweenTime2=0;a.prototype.pTween1XOffset=2;a.prototype.pTween2XOffset=4;a.prototype.pTween1YOffset=1;a.prototype.pTween2YOffset=1;a.prototype.pLastVs={p1x:0,p1y:0,p2x:0,p2y:0};a.prototype._map=null;a.prototype._tileSheetImage=null;a.prototype.setMap=function(b){this._map=tabageos.BlitMath.cloneMultiArray(b)};a.prototype._tw=16;a.prototype._th=16;a.prototype._mapIndexXMethod=function(b){return b[1]};a.prototype._mapIndexYMethod=
function(b){return b[0]};a.prototype._vRenderWidth=0;a.prototype._vRenderHeight=0;a.prototype.constantBackgroundFromRect=0;a.prototype._cbRect=null;a.prototype.mapUpdateMethod=null;a.prototype.colorValues={1:"#000000",2:"#000000",3:"#FFFFFF"};a.prototype.setupForRenderFromMap=function(b,c,d,e,f,g,h,k,l){this._map=b;this._tileSheetImage=c;this._tw=d;this._th=e;this._mapIndexXMethod=k||function(n){return n[1]};this._mapIndexYMethod=l||function(n){return n[0]};g&&(this._vRenderWidth=g);h&&(this._vRenderHeight=
h);f&&(1==f&&(this.rfm1=1),2==f&&(this.rfm2=1),3==f&&(this.rfm3=1),4==f&&(this.rfm4=1),5==f&&(this.rfm5=1))};a.prototype.addParallaxLayer=function(b){this._pLayer1?this._pLayer2||(this._pLayer2=b,this._pV2=new tabageos.Rectangle(0,0,this._pLayer2.width,this._pLayer2.height)):(this._pLayer1=b,this._pV1=new tabageos.Rectangle(0,0,this._pLayer1.width,this._pLayer1.height))};a.prototype._justMoveParallax=0;a.prototype.addParallaxLayerForMove=function(b){this._justMoveParallax=1;this.addParallaxLayer(b)};
a.prototype.blitLayerRenderView=function(){return this.v};a.prototype.renderP1=function(){this._pLayer1&&0==this._justMoveParallax?this.layerToRender.copyPixels(this._pLayer1.canvas,this._pV1,this.p,this._pV1.width,this._pV1.height):this._pLayer1.canvas.setAttribute("style","position:absolute;z-index:-9;top:"+-this._pV1.y+"px;left:"+-this._pV1.x+"px;image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;")};a.prototype.renderP2=
function(){this._pLayer2&&0==this._justMoveParallax?this.layerToRender.copyPixels(this._pLayer2.canvas,this._pV2,this.p,this._pV2.width,this._pV2.height):this._pLayer2.canvas.setAttribute("style","position:absolute;z-index:-8;top:"+-this._pV2.y+"px;left:"+-this._pV2.x+"px;image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;")};a.prototype.drawDirectlyFromMap=function(){var b=Math.floor(this.v.x/this._tw),c=Math.floor(this.v.y/
this._th),d=b+(this._vRenderWidth||this.v.width)/this._tw+1>=this._map[0].length?this._map[0].length:b+(this._vRenderWidth||this.v.width)/this._tw+1,e=c+(this._vRenderHeight||this.v.height)/this._th>=this._map.length?this._map.length:c+(this._vRenderHeight||this.v.height)/this._th;d>this._map[0].length/2&&this.mapUpdateMethod&&this.mapUpdateMethod();this._tileSheetImage?0===this._map[0][0]||this._map[0][0]?tabageos.BlitMath.specificPatternAreaBlit(this.layerToRender,this._tileSheetImage,this._map,
c,e,b,d,-this.v.x+b*this._tw,-this.v.y+c*this._th):tabageos.BlitMath.patternAreaBlit(this.layerToRender,this._tileSheetImage,this._map,c,e,b,d,this._mapIndexXMethod,this._mapIndexYMethod,-this.v.x+b*this._tw,-this.v.y+c*this._th):tabageos.BlitMath.drawSquaresFromAreaOfPattern(this.layerToRender,this._map,c,e,b,d,this._tw,this._th,this.colorValues,-this.v.x+b*this._tw,-this.v.y+c*this._th)};a.prototype.renderB1=function(){if(this.b1&&!this.c1)1===this.rfm1?this.drawDirectlyFromMap():(this.constantBackgroundFromRect&&
(this._cbRect.width=this.v.width,this._cbRect.height=this.v.height),this.layerToRender.copyPixels(this.b1.canvas,this.constantBackgroundFromRect?this._cbRect:this.v,this.p,this.v.width,this.v.height));else if(this.b1&&this.c1||this.b1ActualMover)this.b1ActualMover?this.b1ActualMover.setAttribute("style","position:absolute;z-index:-7;top:"+-this.v.y+"px;left:"+-this.v.x+"px;image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;"):
this.b1.canvas.setAttribute("style","position:absolute;z-index:-7;top:"+-this.v.y+"px;left:"+-this.v.x+"px;image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;")};a.prototype.renderB2=function(){if(this.b2&&!this.c2||this.rfm2)1===this.rfm2?this.drawDirectlyFromMap():this.layerToRender.copyPixels(this.b2.canvas,this.v,this.p,this.v.width,this.v.height);else if(this.b2&&this.c2||this.b2ActualMover)this.b2ActualMover?this.b2ActualMover.setAttribute("style",
"position:absolute;z-index:-6;top:"+-this.v.y+"px;left:"+-this.v.x+"px;image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;"):this.b2.canvas.setAttribute("style","position:absolute;z-index:-6;top:"+-this.v.y+"px;left:"+-this.v.x+"px;image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;")};a.prototype.renderB3=function(){if(this.b3&&!this.c3)1===this.rfm3?
this.drawDirectlyFromMap():this.layerToRender.copyPixels(this.b3.canvas,this.v,this.p,this.v.width,this.v.height);else if(this.b3&&this.c3||this.b3ActualMover)this.b3ActualMover?this.b3ActualMover.setAttribute("style","position:absolute;z-index:-5;top:"+-this.v.y+"px;left:"+-this.v.x+"px;image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;"):this.b3.canvas.setAttribute("style","position:absolute;z-index:-5;top:"+-this.v.y+
"px;left:"+-this.v.x+"px;image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;")};a.prototype.renderB4=function(){this.b4&&!this.c4?1===this.rfm4?this.drawDirectlyFromMap():this.layerToRender.copyPixels(this.b4.canvas,this.v,this.p,this.v.width,this.v.height):this.b4&&this.c4&&this.b4.canvas.setAttribute("style","position:absolute;z-index:-4;top:"+-this.v.y+"px;left:"+-this.v.x+"px;image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;")};
a.prototype.renderB5=function(){this.b5&&!this.c5?1===this.rfm5?this.drawDirectlyFromMap():this.layerToRender.copyPixels(this.b5.canvas,this.v,this.p,this.v.width,this.v.height):this.b5&&this.c5&&this.b5.canvas.setAttribute("style","position:absolute;z-index:-3;top:"+-this.v.y+"px;left:"+-this.v.x+"px;image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;")};a.prototype.blitLayerRender=function(b,c,d){var e=Math.floor(b.x-this.v.width);
b=Math.floor(b.y-this.v.height);this.v.x=0<e&&e<=(c||this.v.width)?e:this.v.x;this.v.y=0<b&&b<=(d||this.v.height)?b:this.v.y;this.renderB1();this.renderB2();this.renderB3();this.renderB4();this.renderB5()};a.prototype.reset=function(b,c){this.tweens1=[];this.tweens2=[];this.p1Tweens1=[];this.p1Tweens2=[];this.p2Tweens1=[];this.p2Tweens2=[];this.v.x=b||0;this.lastvx=b||0;this.v.y=c||0;this.lastvy=c||0;this._pV1&&(this._pV1.x=b||0,this.pLastVs.p1x=b||0,this._pV1.y=c||0,this.pLastVs.p1y=c||0);this._pV2&&
(this._pV2.x=b||0,this.pLastVs.p2x=b||0,this._pV2.y=c||0,this.pLastVs.p2y=c||0)};a.prototype.resetTween=function(){this.tweens1.length=0;this.tweens2.length=0;this.p1Tweens1.length=0;this.p1Tweens2.length=0;this.p2Tweens1.length=0;this.p2Tweens2.length=0};a.prototype.focus=function(b,c,d){this.resetTween();this.v.x=b.x-c;0>this.v.x&&(this.v.x=0);this.v.x>this.v.width&&(this.v.x=this.v.width);this.v.y=b.y-d;0>this.v.y&&(this.v.y=0);this.v.y>this.v.height&&(this.v.y=this.v.height);this.justRender();
this.blitLayerRender(b.subtractBy(-c,-d,1),0,0)};a.prototype._shkincer=717;a.prototype.shakeTime=0;a.prototype.shakeForce=4;a.prototype.shakeContainer=null;a.prototype._shakeOriginals={x:0,y:0};a.prototype.shake=function(b,c,d){d&&0!=this.shakeTime||717!==this._shkincer||(this.shakeTime=b||100);this.shakeContainer=c;this._shakeOriginals.x||(this._shakeOriginals.x=c.style.left,this._shakeOriginals.y=c.style.top);d&&this.executeShake()};a.prototype.executeShake=function(){if(0<this.shakeTime){this._shkincer=
-1===this._shkincer?1:-1;var b=this.shakeForce*this._shkincer;this.shakeContainer.style.left=Number(this.shakeContainer.style.left.replace("px",""))+b+"px";this.shakeContainer.style.top=Number(this.shakeContainer.style.top.replace("px",""))-b+"px";this.shakeTime-=33.3}else 0>=this.shakeTime&&717!=this._shkincer&&(this.shakeTime=0,this._shkincer=717,this.shakeContainer.style.left=this._shakeOriginals.x,this.shakeContainer.style.top=this._shakeOriginals.y)};a.prototype.shakeInterval=null;a.prototype.windowLoopExecuteShake=
function(){this.shakeInterval=window.setInterval(function(b){-40<=tabageos.GameSkeleton.game.camera.shakeTime?tabageos.GameSkeleton.game.camera.executeShake():(tabageos.GameSkeleton.game.camera.executeShake(),window.clearTimeout(tabageos.GameSkeleton.game.camera.shakeInterval))},33.3)};a.prototype._tweenLoopOptions={frameRate:60,useSceonds:0,millisecondRate:1E3};a.prototype.tweenedBlitLayerRender=function(b,c,d,e,f,g,h){var k=b.x-this.v.width;b=b.y-this.v.height;this.v.x=k>(0!=g?g:0)&&k<=(c||this.v.width)?
k:this.v.x;this.v.y=b>(0!=h?h:0)&&b<=(d||this.v.height)?b:this.v.y;this._pV1&&(this._pV1.x=this.v.x/this.pTween1XOffset,this._pV1.y=this.v.y/this.pTween1YOffset);this._pV2&&(this._pV2.x=this.v.x/this.pTween2XOffset,this._pV2.y=this.v.y/this.pTween2YOffset);this.tweens1.length&&this.tweens2.length||(tabageos.TweenMath.tweenArray(this.lastvx,this.v.x,e,f||"Linear",this._tweenLoopOptions,this.tweens1),this.trsh=this.tweens1.shift(),tabageos.TweenMath.tweenArray(this.lastvy,this.v.y,e,f||"Linear",this._tweenLoopOptions,
this.tweens2),this.trsh=this.tweens2.shift());this.v.x=Math.floor(this.tweens1.shift());this.v.y=Math.floor(this.tweens2.shift());this.lastvx=this.v.x+1-1;this.lastvy=this.v.y+1-1;this.p1Tweens1.length&&this.p1Tweens2.length?(this._pV1.x=this.p1Tweens1.shift(),this._pV1.y=this.p1Tweens2.shift(),this.pLastVs.p1x=this._pV1.x,this.pLastVs.p1y=this._pV1.y):this._pLayer1&&(tabageos.TweenMath.tweenArray(this.pLastVs.p1x,this._pV1.x,this.pTweenTime||2*e,this.pTweenType||"Linear",this._tweenLoopOptions,this.p1Tweens1),
this.trsh=this.p1Tweens1.shift(),this._pV1.x=this.p1Tweens1.shift(),tabageos.TweenMath.tweenArray(this.pLastVs.p1y,this._pV1.y,this.pTweenTime||2*e,this.pTweenType||"Linear",this._tweenLoopOptions,this.p1Tweens2),this.trsh=this.p1Tweens2.shift(),this._pV1.y=this.p1Tweens2.shift(),this.pLastVs.p1x=this._pV1.x,this.pLastVs.p1y=this._pV1.y);this.p2Tweens1.length&&this.p2Tweens2.length?(this._pV2.x=this.p2Tweens1.shift(),this._pV1.y=this.p2Tweens2.shift(),this.pLastVs.p2x=this._pV2.x,this.pLastVs.p2y=
this._pV2.y):this._pLayer2&&(tabageos.TweenMath.tweenArray(this.pLastVs.p2x,this._pV2.x,this.pTweenTime2||2*e,this.pTweenType2||"Linear",this._tweenLoopOptions,this.p2Tweens1),this.trsh=this.p2Tweens1.shift(),this._pV2.x=this.p2Tweens1.shift(),tabageos.TweenMath.tweenArray(this.pLastVs.p2y,this._pV2.y,this.pTweenTime2||2*e,this.pTweenType2||"Linear",this._tweenLoopOptions,this.p2Tweens2),this.trsh=this.p2Tweens2.shift(),this._pV2.y=this.p2Tweens2.shift(),this.pLastVs.p2x=this._pV2.x,this.pLastVs.p2y=
this._pV2.y);this._pLayer1&&this.renderP1();this._pLayer2&&this.renderP2();this.renderB1();this.renderB2();this.renderB3();this.renderB4();this.renderB5();0<this.shakeTime?(this._shkincer=-1===this._shkincer?1:-1,c=this.shakeForce*this._shkincer,this.shakeContainer.style.left=Number(this.shakeContainer.style.left.replace("px",""))+c+"px",this.shakeContainer.style.top=Number(this.shakeContainer.style.top.replace("px",""))-c+"px",this.shakeTime-=33.3):0>=this.shakeTime&&717!=this._shkincer&&(this.shakeTime=
0,this._shkincer=717,this.shakeContainer.style.left=this._shakeOriginals.x,this.shakeContainer.style.top=this._shakeOriginals.y)};a.prototype._dragPosition=null;a.prototype.releaseDrag=function(){this._dragPosition=null};a.prototype.drag=function(b,c,d,e,f,g){if(this._dragPosition){var h=c||64;c=this.v.x+(this._dragPosition.x-b.x)/(this.v.width/h);b=this.v.y+(this._dragPosition.y-b.y)/(this.v.height/h);this.v.x=0<c&&c<=(d||this.v.width)?c:this.v.x;this.v.y=0<b&&b<=(e||this.v.height)?b:this.v.y;this.tweens1.length&&
this.tweens2.length||(this.tweens1=tabageos.TweenMath.tweenArray(this.lastvx,this.v.x,f,g||"Linear"),this.trsh=this.tweens1.shift(),this.tweens2=tabageos.TweenMath.tweenArray(this.lastvy,this.v.y,f,g||"Linear"),this.trsh=this.tweens2.shift());this.v.x=this.tweens1.shift();this.v.y=this.tweens2.shift();this.lastvx=this.v.x;this.lastvy=this.v.y;this.renderB1();this.renderB2();this.renderB3();this.renderB4();this.renderB5()}else this._dragPosition=b};a.prototype.justRender=function(){this.renderB1();
this.renderB2();this.renderB3();this.renderB4();this.renderB5()};a.prototype._isoPoint;a.prototype.cameraFollowOffsetX=0;a.prototype.cameraFollowOffsetY=0;a.prototype.setIsoFollowOffsets=function(b,c,d,e){this.v.width=b-this.viewPortWidth;this.v.height=c-this.viewPortHeight;this.cameraFollowOffsetY=-(this.viewPortHeight/2-e)-(c-2*this.viewPortWidth+2*e);this.cameraFollowOffsetX=-(this.viewPortWidth/2+d)-(b-2*this.viewPortWidth)};a.prototype.isoTweenedBlitLayerRender=function(b,c,d,e,f,g,h,k,l,n,m,
p){var q=(b>c?b/c:c/b)+d._xSpreadShifter;b=(c>b?b/c:c/b)+d._ySpreadShifter;c=b/2+d._spread;this._isoPoint.x=b/q*(q/2+d._spread)*tabageos.SimpleIsoPoint.rawToIso(e.x,e.y,1,0)+d.sceneXOffset;this._isoPoint.y=q/b*c*tabageos.SimpleIsoPoint.rawToIso(e.x,e.y,0,1)+d.sceneYOffset;this._isoPoint.x-=f;this._isoPoint.y-=g;this.tweenedBlitLayerRender(this._isoPoint,h,k,l,n||"Linear",m||0,p||0)};tabageos.TweenMath.doubleTweenArray=function(b,c,d,e,f,g,h,k){return(tabageos.TweenMath.tweenArray(b,c,f,g,k).join(",")+
tabageos.TweenMath.tweenArray(d,e,f,h,k).join(",")).split(",")};tabageos.BasicCamera=a})();
(function(){function a(b,c,d){tabageos.EventDispatcher.call(this);tabageos.CanvasObject.call(this,b,c,d);this.init(b,c,d);this.bI=0;this.fRect=new tabageos.Rectangle;this.tPoint=new tabageos.MoverPoint}a.prototype.constructor=a;a.prototype=Object.create(tabageos.EventDispatcher.prototype);Object.assign(a.prototype,tabageos.CanvasObject.prototype);a.prototype.fRect=null;a.prototype.bI=0;a.prototype.tPoint=null;a.prototype.loopHorizontal=function(b,c,d,e){this.fRect.x=this.bI;this.fRect.y=0;this.fRect.width=
c;this.fRect.height=d;this.tPoint.x=0;this.copyPixels(b,this.fRect,this.tPoint,c,d);0<this.bI&&(this.fRect.x=0,this.tPoint.x=c-this.bI,this.fRect.width=this.bI,this.copyPixels(b,this.fRect,this.tPoint,this.fRect.width,d));this.bI=this.bI<c?this.bI+(e||1):0};tabageos.LoopingImage=a})();
(function(){function a(b){a._musicInterval=b||60}a.prototype.constructor=a;a.prototype._soundPlaying="";a.prototype._sounds=[];a.prototype._soundTracks=[];a.prototype._soundIndex=0;a.prototype._soundNames=[];a.prototype._currentTrack;a._trackPaused=0;a._musicInterval=60;a.prototype._trackTimer;a.prototype.addSound=function(b,c,d,e){var f=[],g=0;e=e||1;for(g;g<e;g++){var h=new Audio(b);h.volume=d;h.load();f[f.length]=h}this._soundNames.push(c);this._sounds[this._sounds.length]=f};a.prototype.clearAllSounds=
function(){this._sounds.length=0;this._soundNames.length=0};a.prototype.addMusic=function(b,c,d){b=new Audio(b);b.volume=c;b.loop=!1===d||0===d||-1===d?!1:!0;b.load();this._soundTracks[this._soundTracks.length]=b};a.prototype.playSound=function(b,c){this._soundPlaying!=b&&(this._soundIndex=0,this._soundPlaying=b);b=this._sounds[this._soundNames.indexOf(b)];c=c?this._soundIndex:0;b[c]&&(0==b[c].currentTime||b[c].ended)&&(b[c].play(),this._soundIndex=this._soundIndex<b.length-1?this._soundIndex+1:0)};
a.prototype.playMusic=function(b,c){c&&(a._musicInterval=c);(b=this._soundTracks[b||0])&&(0==b.currentTime||b.ended||b.paused)&&(b.play(),this._currentTrack=b);this._currentTrack&&(a._trackPaused=0)};a.prototype.clearMusicTracks=function(){var b=0;for(b;b<this._soundTracks.length;b++)this._soundTracks[b].pause();this._soundTracks.length=0};a.prototype.stopMusic=function(){this._currentTrack&&(this._currentTrack.pause(),a._trackPaused=1)};tabageos.SoundSystem=a})();
(function(){function a(b,c,d,e,f){this.explosionRect=new tabageos.Rectangle(0,0,b,c);this.explosionPoint=new tabageos.MoverPoint;this.explosions=[];this.explosionHold=[];this.eWidth=b;this.eHeight=c;this.sFromX=e||96;this.sFromY=f||0;this.countStop=d;this.readyExplosions(51)}a.prototype.constructor=a;a.prototype.eWidth;a.prototype.eHeight;a.prototype.countStop=6;a.prototype.explosions=[];a.prototype.explosionRect;a.prototype.explosionPoint;a.prototype.sFromX=96;a.prototype.sFromY=0;a.prototype.explosionHold=
[];a.prototype.readyExplosions=function(b){for(;0<b;)--b,this.explosionHold.push({x:0,y:0,count:1,fromX:0,fromY:0,width:0,height:0,throttle:1})};a.prototype.addExplosion=function(b,c,d,e,f,g,h,k){this.explosions[this.explosions.length]=this.explosionHold.pop();this.explosions[this.explosions.length-1].x=b;this.explosions[this.explosions.length-1].y=c;this.explosions[this.explosions.length-1].count=d||1;this.explosions[this.explosions.length-1].fromX=e||0;this.explosions[this.explosions.length-1].fromY=
f||0;this.explosions[this.explosions.length-1].width=g||0;this.explosions[this.explosions.length-1].height=h||0;this.explosions[this.explosions.length-1].throttle=k||1};a.prototype.displayExplosions=function(b,c,d){var e=0,f=this.explosions.length,g;for(e;e<f;e++)if(g=this.explosions[e])this.explosionRect.x=(g.fromX||this.sFromX)+(d?0:Math.round(g.count)*(g.width||this.eWidth)),this.explosionRect.y=(g.fromY||this.sFromY)+(d?Math.round(g.count)*(g.height||this.eHeight):0),this.explosionRect.width=
g.width||this.eWidth,this.explosionRect.height=g.height||this.eHeight,this.explosionPoint.x=g.x,this.explosionPoint.y=g.y,b.copyPixels(c,this.explosionRect,this.explosionPoint,this.explosionRect.width,this.explosionRect.height),g.count+=g.throttle||1,g.count>=this.countStop&&(tabageos.GeometricMath.splice(this.explosions,this.explosions.indexOf(g)),this.explosionHold[this.explosionHold.length]=g)};tabageos.ExplosionFactory=a})();
(function(){function a(){}a.arcCurvePoint=function(b,c,d,e,f,g,h){var k=new tabageos.MoverPoint,l=(1-b)*(1-b),n=b*b;k.x=l*c+2*(1-b)*b*e+n*g;k.y=l*d+2*(1-b)*b*f+n*h;return k};a.updateArcCurvePoint=function(b,c,d,e,f,g,h,k){var l=(1-c)*(1-c),n=c*c;b.x=l*d+2*(1-c)*c*f+n*h;b.y=l*e+2*(1-c)*c*g+n*k};a.getArcCurvePath=function(b,c,d,e){var f=0;e=100/e/100;for(var g=[],h;1>f;)h=a.arcCurvePoint(f,b.x,b.y,c.x,c.y,d.x,d.y),g[g.length]=h,f+=e;return g};a.updateArcCurvePath=function(b,c,d,e){for(var f=0,g=b.length,
h,k=100/g/100,l=0;f<g;)h=b[f],a.updateArcCurvePoint(h,l,c.x,c.y,d.x,d.y,e.x,e.y),f+=1,l+=k};a.getRawArcCurvePath=function(b,c,d,e,f,g,h,k){var l=0;h=100/h/100;var n=k||[];for(n.length=0;1>l;){var m=(1-l)*(1-l),p=l*l;n[n.length]=m*b+2*(1-l)*l*d+p*f;n[n.length]=m*c+2*(1-l)*l*e+p*g;l+=h}return k?0:n};a.hermiteCurvePoint=function(b,c,d,e,f,g,h,k,l){var n=new tabageos.MoverPoint;n.x=(2*Math.pow(b,3)-3*b*b+1)*c+(Math.pow(b,3)-2*b*b+b)*e+(-2*Math.pow(b,3)+3*b*b)*g+(Math.pow(b,3)-b*b)*k;n.y=(2*Math.pow(b,
3)-3*b*b+1)*d+(Math.pow(b,3)-2*b*b+b)*f+(-2*Math.pow(b,3)+3*b*b)*h+(Math.pow(b,3)-b*b)*l;return n};a.getHermiteCurvePath=function(b,c,d,e,f){var g=0;f=100/f/100;for(var h=[];1>g;){var k=a.hermiteCurvePoint(g,b.x,b.y,c.x,c.y,d.x,d.y,e.x,e.y);h[h.length]=k;g+=f}return h};a.getRawHermiteCurvePath=function(b,c,d,e,f,g,h,k,l,n){var m=0;l=100/l/100;var p=n||[];for(p.length=0;1>m;)p[p.length]=(2*Math.pow(m,3)-3*m*m+1)*b+(Math.pow(m,3)-2*m*m+m)*d+(-2*Math.pow(m,3)+3*m*m)*f+(Math.pow(m,3)-m*m)*h,p[p.length]=
(2*Math.pow(m,3)-3*m*m+1)*c+(Math.pow(m,3)-2*m*m+m)*e+(-2*Math.pow(m,3)+3*m*m)*g+(Math.pow(m,3)-m*m)*k,m+=l;return n?0:p};a.lineIntersectionTest=function(b,c,d,e){var f=(c.x-b.x)*(e.y-d.y)-(c.y-b.y)*(e.x-d.x);if(0==f)return!1;f=1/f;e=((b.y-d.y)*(e.x-d.x)-(b.x-d.x)*(e.y-d.y))*f;b=((b.y-d.y)*(c.x-b.x)-(b.x-d.x)*(c.y-b.y))*f;return 0<e&&1>e&&0<b&&1>b?!0:!1};a.lineIntersectionPoint=function(b,c,d,e){var f=(c.x-b.x)*(e.y-d.y)-(c.y-b.y)*(e.x-d.x);if(0==f)return null;e=((b.y-d.y)*(e.x-d.x)-(b.x-d.x)*(e.y-
d.y))/f;d=((b.y-d.y)*(c.x-b.x)-(b.x-d.x)*(c.y-b.y))/f;return 0<e&&1>e&&0<d&&1>d?(c=c.subtract(b).multiply(e),b.add(c)):null};a._rPoint;a.testForPointInCircle=function(b,c,d){a._rPoint||(a._rPoint=new tabageos.MoverPoint);a._rPoint.x=d.x+1-1;a._rPoint.y=d.y+1-1;return a._rPoint.subtract(b,0).getSquaredLength()<c*c?!0:!1};a.testForPointInArea=function(b,c,d,e,f){return!(b.x<c||b.x>e||b.y<d||b.y>f)};a.getMoverPointsOnCircle=function(b,c,d){for(var e=2*Math.PI/d,f=[],g,h=-1;h<d;)h+=1,g=e*h,g=new tabageos.MoverPoint(Math.cos(g)*
c,Math.sin(g)*c),f[h]=b.add(g);return f};a.getRawPointsOnCircle=function(b,c,d,e){var f=2*Math.PI/e,g=[],h=-1;var k=e%2;for(0!=k&&(e-=Math.round(k));h<2*e;){h+=2;var l=f*Math.floor(h/2);k=Math.cos(l)*d;l=Math.sin(l)*d;g[h-1]=b+k;g[h]=c+l}return g};a.mergeArrays=function(b,c){var d=0,e=1;if(2<arguments.length){var f=arguments.length;for(e;e<f;e++){d=0;var g=arguments[e].length;for(d;d<g;d++)b[b.length]=arguments[e][d]}}else for(d;d<c.length;d++)b[b.length]=c[d];return b};a.splice=function(b,c){var d=
b.length-1;for(c;c<d;c++)b[c]=b[c+1];b.length=d};a.rectanglesIntersect=function(b,c){return!(c.x>b.x+b.width||c.x+c.width<b.x||c.y>b.y+b.height||c.y+c.height<b.y)};a._efRect={top:0,bottom:0,left:0,right:0,si:0};a.rectanglesOverlapAmount=function(b,c){a._efRect.top=Math.max(b.y,c.y);a._efRect.bottom=Math.min(b.y+b.height,c.y+c.height);a._efRect.left=Math.max(b.x,c.x);a._efRect.right=Math.min(b.x+b.width,c.x+c.width);a._efRect.si=Math.max(0,a._efRect.right-a._efRect.left)*Math.max(0,a._efRect.bottom-
a._efRect.top);return a._efRect.si+1-1};a.isPowerOfTwo=function(b){return 0<b&&0==(b&b-1)};tabageos.GeometricMath=a})();
tabageos.ResizeGame=function(a,b,c,d,e,f,g,h,k,l,n,m,p,q,r){l=window.innerWidth/a;var t=window.innerHeight/b;f&&!g?f.hide():g&&f&&f.show(n||640,m||192,h||1);e&&(e.style.transformOrigin="0 0",e.style.transform="scale("+(c?l/c:1)+","+(d?t/d:1)+")",e=e.getBoundingClientRect(),p&&(p.layerToRender.canvas.style.transformOrigin="0 0",p.layerToRender.canvas.style.transform="scale("+(c?q/c:1)+","+(d?r/d:1)+")"),k&&(k.width=e.width,k.height=e.height),tabageos.MouseController.defineMousePositionOffset(a,b,e.width,
e.height))};tabageos._touched=0;tabageos._edge=0;tabageos.seekTouch=function(){var a="ontouchstart"in window?1:navigator.maxTouchPoints?1:0;tabageos._edge=-1!=window.navigator.userAgent.toLowerCase().indexOf("edg");tabageos._edge&&(a=!1);tabageos._touched||(window.removeEventListener("pointerdown",tabageos.getPointerType,!1),window.addEventListener("pointerdown",tabageos.getPointerType,!1));return tabageos._touched||a};
tabageos.getPointerType=function(a){window.removeEventListener("pointerdown",tabageos.getPointerType,!1);(a=a.pointerType&&"touch"==a.pointerType?1:0)||tabageos.GameSkeleton.game&&tabageos.GameSkeleton.game.controller&&tabageos.GameSkeleton.game.controller.hide();(tabageos._touched=a)&&tabageos.GameSkeleton.game&&tabageos.GameSkeleton.game.__instanceBasicTwoLayerResize()};tabageos._pointerEvents=function(){return window.PointerEvent?1:0};tabageos.combineTwoNumbers=function(a,b){return a<<16|b};
tabageos.getAFromCombined=function(a){return a>>16};tabageos.getBFromCombined=function(a){return a&65535};tabageos.splitNumberAtDecimal=function(a,b){var c=Math.abs(a),d=Math.floor(c);if(1===b)return d*(0>a?-1:1);a=Math.round(1E3*(c-d));b=Math.round(100*(c-d));var e=Math.round(10*(c-d));return d+e/10===c?e:d+b/100<=c+.001&&d+b/100>=c?b:a};tabageos.stringSplitNumberAtDecimal=function(a,b){var c=Math.floor(Math.abs(a));return 1===b?c*(0>a?-1:1):Number((a+"").split(".")[1])};
tabageos.stringSplitter=function(a,b,c){b=b||10;10<b&&(b=10);var d=a.length/b,e=0;for(e;e<b;e++)window.console.log((c?"tabageos.GameSkeleton._str["+e+']="':"")+a.substr(d*e,d).replace('"data:image/png;base64,',"")+'";')};
tabageos.loadSpriteSheetAndStart=function(a,b,c,d){window.addEventListener("GameSkeleton",d,!1);window.setTimeout(function(e){var f=new Image;f.onload=function(g){g=0;for(g;10>g;g++)if(tabageos.GameSkeleton._str[g]){g=77;break}77!=g?(tabageos.GameSkeleton.__sprites=new tabageos.CanvasObject(null,b,c),tabageos.GameSkeleton.__sprites.copyPixels(f,new tabageos.Rectangle(0,0,b,c),new tabageos.MoverPoint),g=document.createEvent("MouseEvents"),g.initEvent("GameSkeleton",!0,!0),window.dispatchEvent(g)):
(g=tabageos.GameSkeleton._str,tabageos.GameSkeleton.__baseToCol(b,c,g[0]+g[1]+g[2]+g[3]+g[4]+g[5]+g[6]+g[7]+g[8]+g[9]))};f.src=a},700)};
(function(){function a(b){if(a.game)throw"An instance of GameSkeleton has been created already.";this.gameWidth=b.gWidth||640;this.gameHeight=b.gHeight||320;this.tileWidth=b.tileW||16;this.tileHeight=b.tileH||16;this.lives=b.initialLives||3;this.controllerHeight=b.controllerHeight||144;this.initialPlayerPosition=b.initPlayerPosition||new tabageos.MoverPoint(32,32);this.cameraWidth=b.cameraWidth||this.gameWidth/2;this.cameraHeight=b.cameraHeight||this.gameHeight+1-1;this.cameraFollowOffsetX=b.cameraFollowOffsetX||
0==b.cameraFollowOffsetX?b.cameraFollowOffsetX:-(this.cameraWidth/2);this.cameraFollowOffsetY=b.cameraFollowOffsetY||0;this._initLives=b.initialLives||3;this._scaleRectRef=new tabageos.Rectangle;this.gameFunction=b.gameLoop;this.addedInitializationMethod=b.initializationSpecifics;this.addedResizeMethod=b.addedResizeMethod;this.sceneResetSpecifics=b.sceneResetSpecifics;this.sceneChangeSpecifics=b.sceneChangeSpecifics;this.fullResetSpecifics=b.fullResetSpecifics;this.additionalSceneResetSpecifics=b.additionalSceneResetSpecifics;
this.positionResetSpecifics=b.positionResetSpecifics;this._cameraType=b.cameraType||0;this.backgroundColor=b.backgroundColor||"#FFFFFF";this.disableBackgroundAlpha=0===b.disableBackgroundAlpha?0:b.disableBackgroundAlpha||1;this.initForISO=b.initForISO||0;this.beforeStartGameLoop=b.beforeStartGameLoop||null;this.useSceneChanger=0===b.useSceneChanger?0:1;this.tweenLimitX=b.tweenLimitX||0;this.tweenLimitY=b.tweenLimitY||0;this.cameraTweenType=b.cameraTweenType||"InOutLinear";this.frameRate=b.frameRate||
60;this._helperPoint=new tabageos.MoverPoint;this._helperRect=new tabageos.Rectangle(0,0,this.tileWidth,this.tileHeight);this.gameScale=b.gameScale||1.01;this.hudScale=b.hudScale||this.gameScale;this.walkthroughLink=b.walkthroughLink||"";this.topDownSceneChange=b.topDownSceneChange||0;this.startLocations=b.startLocations||null;this.enableGamePad=b.enableGamePad||0;this.underCoverSpecifics=b.underCoverSpecifics||null;this.priorToSceneChange=b.priorToSceneChange||null;this.afterSceneChange=b.afterSceneChange||
null;this._manuelControllerUse=b.specialControllerUse||0;a.game=this;this.__specs=b;b.controllerDivId||window.console.log("GameSkeleton: no controller div id given, a ControllerPad will not be created");a.establish(this,b.spriteSheetImage||null,b.containerDivId||"container",b.rootDivId||"root",b.controllerDivId,0===b.gameScale?0:b.gameScale||2,!1===b.useScreenOrganizer?!1:!0,b.startWidth||50,b.startHeight||25)}a.STANDARD_CAMERA=1;a.STILL_CAMERA=2;a.prototype._cameraType=0;a.prototype.enableGamePad=
0;a.prototype.backgroundColor="#FFFFFF";a.prototype.disableBackgroundAlpha=1;a.prototype.useSceneChanger=1;a.prototype.topDownSceneChange=0;a.prototype.device=0;a.prototype.paused=0;a.prototype._thrott=0;a.prototype._aid;a.prototype._pr=-1;a.prototype._ts=0;a.prototype._textTime=0;a.prototype._doReset=0;a.prototype._doAlternate=0;a.game=null;a.prototype.cameraLayer;a.prototype.backgroundLayer;a.prototype.display;a.prototype.charLayer;a.prototype.gameWidth;a.prototype.gameHeight;a.prototype.camera=
null;a.prototype.sceneChanger=null;a.prototype.cameraWidth;a.prototype.cameraHeight;a.prototype.cameraFollowOffsetX;a.prototype.cameraFollowOffsetY;a.prototype.title;a.prototype.startButton;a.prototype.controllerHeight;a.prototype.container;a.prototype.root;a.prototype.controller;a.prototype.gameScale=1.01;a.prototype.hudScale=1.01;a.prototype.tileWidth=16;a.prototype.tileHeight=16;a.prototype.startLocations=null;a.prototype.gameOverContainer;a.prototype.creditsContainer;a.prototype.speechBubble;
a.prototype.player=null;a.prototype.initialPlayerPosition;a.prototype.lives=3;a.prototype._initLives=3;a.prototype.screenOrganizer=null;a.prototype._image=null;a.prototype.resizeRootForNoTouch=0;a.prototype.dontResizeVertical=0;a.prototype.dontResizeHorizontal=0;a.prototype.horizontalCameraMove=0;a.prototype.verticalCameraMove=0;a.prototype.cameraTweenType="InOutLinear";a.prototype.frameRate=60;a.prototype.frameTime=1E3/60-1E3/60*.5;a.prototype.addedInitializationMethod=null;a.prototype.addedResizeMethod=
null;a.prototype.gameFunction=null;a.prototype.sceneResetSpecifics=null;a.prototype.fullResetSpecifics=null;a.prototype.additionalSceneResetSpecifics=null;a.prototype.positionResetSpecifics=null;a.prototype.alternateLoopMethod=null;a.prototype.sceneChangeSpecifics=null;a.prototype.priorToSceneChange=null;a.prototype.afterSceneChange=null;a.prototype.beforeStartGameLoop=null;a.prototype.underCoverSpecifics=null;a.prototype._HUD=null;a.prototype.hPause=null;a.prototype.hReset=null;a.prototype.hMute=
null;a.prototype.hExit=null;a.prototype.hWalkthrough=null;a.prototype.walkthroughLink="";a.prototype._playerHUD=null;a.prototype._healthBar=null;a.prototype._scoreTextDisplay=null;a.prototype._manuelControllerUse=0;a.prototype.initForISO=0;a.prototype._helperPoint=null;a.prototype._helperRect=null;a.prototype.__specs=null;a._str="           ".split(" ");a.prototype.healthBarIsDisplayed=0;a.prototype.scoreTextIsDisplayed=0;a.prototype.soundSystem=null;a.prototype._mute=0;a.prototype.createHud=function(){var b=
tabageos.seekTouch()?tabageos._pointerEvents?"pointerdown":"touchstart":"click",c=a.game;c._HUD=document.createElement("div");c._HUD.setAttribute("id","headsUpDisplay");c._HUD.setAttribute("style","position:absolute; top:0px;width:160px;height:32px;z-index:999999999999999999999999999999999999999999999999999999999999999999999999999999999999;background: no-repeat url('data:image/png;base64, '");
document.body.appendChild(c._HUD);c.hPause=document.createElement("div");c.hPause.setAttribute("style","position:absolute;top:0px;left:0px;width:32px;height:32px;background:rgba(255,255,255,0.1)");c._HUD.appendChild(c.hPause);c.hPause.addEventListener(b,c.pause,!1);c.hReset=document.createElement("div");c.hReset.setAttribute("style","position:absolute;top:0px;left:32px;width:32px;height:32px;background:rgba(255,255,255,0.1)");c._HUD.appendChild(c.hReset);c.hReset.addEventListener(b,c.goBack,!1);c.hMute=
document.createElement("div");c.hMute.setAttribute("style","position:absolute;top:0px;left:64px;width:32px;height:32px;background:rgba(255,255,255,0.1)");c._HUD.appendChild(c.hMute);c.hMute.addEventListener(b,c.muteUnmute,!1);c.hExit=document.createElement("div");c.hExit.setAttribute("style","position:absolute;top:0px;left:96px;width:32px;height:32px;background:rgba(255,255,255,0.1)");c._HUD.appendChild(c.hExit);c.hExit.addEventListener(b,c.hudExit,!1);c.hWalkthrough=document.createElement("div");
c.hWalkthrough.setAttribute("style","position:absolute;top:0px;left:128px;width:32px;height:32px;background:rgba(255,255,255,0.1)");c._HUD.appendChild(c.hWalkthrough);c.hWalkthrough.addEventListener(b,c.hudToWalkthrough,!1);c._playerHUD=document.createElement("div");c._playerHUD.setAttribute("id","playerStatDisplay");c._playerHUD.setAttribute("style","position:absolute; top:0px;width:"+c.cameraWidth+"px;height:"+c.cameraHeight/4+"px;z-index:999999999999999999999999999999999999999999999999999999999999999999999999999999999999;");
c._healthBar=document.createElement("div");c._scoreTextDisplay=document.createElement("div");c._playerHUD.appendChild(c._healthBar);c._playerHUD.appendChild(c._scoreTextDisplay);this.container.appendChild(c._playerHUD)};a.prototype._playerHudParts=[0];a.prototype.setupCustomHealthHud=function(b){a.game.hideHUD();a.game._playerHUD.style.display="inline";b&&a.game._healthBar.setAttribute("id",b)};a.prototype.addToCustomHud=function(b,c){var d=document.createElement("div");d.setAttribute("id",b);d.setAttribute("style",
c);a.game._healthBar.appendChild(d);a.game._playerHudParts.push(d);return a.game._playerHudParts.length-1};a.prototype.getCustomHudPart=function(b){return a.game._playerHudParts[b||1]};a.prototype.removeCustomHudParts=function(){var b=1;for(b;b<a.game._playerHudParts.length;b++)a.game._healthBar.removeChild(a.game._playerHudParts[b]);a.game._playerHudParts=[0]};a.prototype.hideCustomHud=function(){a.game.hideHealthBar()};a.prototype.showCustomHud=function(b,c,d,e,f,g){a.game.showHealthBar(b,c,d,e,
f,g)};a.prototype.showHealthBar=function(b,c,d,e,f,g){e&&80<e&&(e=80);a.game._healthBar.setAttribute("style",f||"position:absolute; top:0px;width:"+(b||100)+"px;height:"+(e||10)+"px;border:thin solid black;background:linear-gradient("+(c||"red")+","+(d||"#ffc8c8")+","+(c||"red")+");"+g);a.game.healthBarIsDisplayed=1};a.prototype.hideHealthBar=function(){a.game._healthBar.setAttribute("style","display:none");a.game.healthBarIsDisplayed=0};a.prototype.showScoreText=function(b,c,d,e,f){a.game._scoreTextDisplay.setAttribute("style",
"position:absolute; top:"+(c||0)+"px;width:"+(d||160)+"px;height:"+(e||70)+"px;"+f);a.game._scoreTextDisplay.innerHTML=b+"";a.game.scoreTextIsDisplayed=1};a.prototype.hideScoreText=function(){a.game._scoreTextDisplay.setAttribute("style","display:none");a.game.scoreTextIsDisplayed=0};a.prototype.changeHUDBackgroundImage=function(b){a.game._HUD.setAttribute("style","position:absolute; top:0px;width:160px;height:32px;z-index:999999999999999999999999999999999999999999999999999999999999999999999999999999999999;background: no-repeat url('"+
b+"')")};a.prototype.establishKeyEventsForReset=function(){window.removeEventListener("keyup",this.reset,!1);window.addEventListener("keyup",this.reset,!1)};a.prototype.mouseMoveOffset=32;a.prototype.mousePoint=null;a.prototype.setupMouseTouchHandle=function(b){this.mousePoint=new tabageos.MoverPoint;this.container.removeEventListener("mousemove",this.handleMouseTouchMove,!1);this.container.removeEventListener("touchmove",this.handleMouseTouchMove,!1);this.container.addEventListener("mousemove",this.handleMouseTouchMove,
!1);this.container.addEventListener("touchmove",this.handleMouseTouchMove,!1);this.container.removeEventListener("pointermove",this.handleMouseTouchMove,!1);this.container.addEventListener("pointermove",this.handleMouseTouchMove,!1);b&&(this.container.removeEventListener("mousedown",this.handleMouseDown,!1),this.container.addEventListener("mousedown",this.handleMouseDown,!1),this.container.removeEventListener("pointerdown",this.handleMouseDown,!1),this.container.addEventListener("pointerdown",this.handleMouseDown,
!1),this.container.removeEventListener("pointerup",this.handleMouseUp,!1),this.container.addEventListener("pointerup",this.handleMouseUp,!1),this.container.removeEventListener("mouseup",this.handleMouseUp,!1),this.container.addEventListener("mouseup",this.handleMouseUp,!1))};a.prototype.takeDownMouseTouchHandle=function(){this.container.removeEventListener("mousemove",this.handleMouseTouchMove,!1);this.container.removeEventListener("touchmove",this.handleMouseTouchMove,!1);this.container.removeEventListener("pointermove",
this.handleMouseTouchMove,!1);this.container.removeEventListener("mousedown",this.handleMouseDown,!1);this.container.removeEventListener("pointerdown",this.handleMouseDown,!1);this.container.removeEventListener("pointerup",this.handleMouseUp,!1);this.container.removeEventListener("mouseup",this.handleMouseUp,!1)};a.prototype.handleMouseTouchMove=function(b){var c=tabageos.GameSkeleton.game.container.getBoundingClientRect();if(b&&b.targetTouches&&b.targetTouches.length){var d=0;for(d;d<b.targetTouches.length;d++){var e=
b.targetTouches[d],f=e.pageY;tabageos.GameSkeleton.game.mousePoint.x=e.pageX-c.x+tabageos.GameSkeleton.game.camera.v.x-tabageos.GameSkeleton.game.mouseMoveOffset;tabageos.GameSkeleton.game.mousePoint.y=f-c.y+tabageos.GameSkeleton.game.camera.v.y-tabageos.GameSkeleton.game.mouseMoveOffset}}else b=tabageos.MouseController.mouseMoverPoint(),tabageos.GameSkeleton.game.mousePoint.x=b.x-c.x+tabageos.GameSkeleton.game.camera.v.x-tabageos.GameSkeleton.game.mouseMoveOffset,tabageos.GameSkeleton.game.mousePoint.y=
b.y-c.y+tabageos.GameSkeleton.game.camera.v.y-tabageos.GameSkeleton.game.mouseMoveOffset};a.prototype.mouseIsDown=0;a.prototype.handleMouseDown=function(b){tabageos.GameSkeleton.game.mouseIsDown=1};a.prototype.handleMouseUp=function(b){tabageos.GameSkeleton.game.mouseIsDown=0};a.prototype.basicInitialize=function(b,c,d,e,f,g,h,k,l,n,m,p){this.container=document.getElementById(b);this.root=k?new tabageos.CanvasObjectContainer(c,f,g):document.getElementById(c);this.cameraWidth=f;this.cameraHeight=g;
this.frameTime=1E3/60*(60/this.frameRate)-1E3/60*.5;this.backgroundLayer=new tabageos.CanvasObject(null,d,e,0,0,a.game.disableBackgroundAlpha,0);this.backgroundLayer.drawRect(new tabageos.Rectangle(0,0,d,e),this.backgroundColor);this.display=4E3>d?new tabageos.CanvasObject(null,d,e,0,0,0):{placeHolder:1};this.charLayer=new tabageos.CanvasObject(null,d,e);this.cameraLayer=new tabageos.CanvasObject(null,f,g,0,0,1);k||this.root.appendChild(this.cameraLayer.canvas);this.speechBubble=document.createElement("textarea");
this.speechBubble.setAttribute("style","background: #ffffffaa;border-radius:20px;width:250px;height:150px;position:absolute;border: thin solid black;display:none");h&&!this.controller&&(this.controller=new tabageos.ControllerPad(p?null:document.getElementById(h)),this.controller.establish(),p||this.controller.basicControllerButtonSetup(),this.controller.acceptWASDAndArrows(),p||this.controller.assignStartAndBackMethods("maybeStartGame","maybeGoBack",a.game));this.camera=new tabageos.BasicCamera(this.cameraLayer,
this.backgroundLayer,this.display,this.charLayer);this.initForISO&&(this.camera.viewPortWidth=f,this.camera.viewPortHeight=g);this.camera.v.width=d>f?d-f:f;this.camera.cameraFollowOffsetX=this.cameraFollowOffsetX;this.camera.cameraFollowOffsetY=this.cameraFollowOffsetY;this.camera.v.height=g;this.cameraPoint=new tabageos.MoverPoint;a.game._doReset=0;a.game._doAlternate=0;a.game._endingLevel=0;a.game.paused=0;k&&(this.title=new tabageos.CanvasObjectContainer(null,f,g,null,"#ffffff"),this.gameOverContainer=
new tabageos.CanvasObjectContainer(null,f,g,null,"#ffffff"),this.startButton=document.createElement("div"),this.startButton.innerHTML=" Start ",b=l||f/8,n=n||g/8,this.startButton.setAttribute("style","color:black;position:absolute;text-align:center;width:"+b+"px;height:"+n+"px;left:"+(this.startLocations?this.startLocations.x:f/2-b/2)+"px;top:"+(this.startLocations?this.startLocations.y:g/2-n/2)+"px;cursor:pointer;z-index:9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999"),
this.startButton.addEventListener(tabageos.seekTouch()?tabageos._pointerEvents?"pointerdown":"touchstart":"mouseup",a.game.changeToMainCamera,!1),this.title.div.appendChild(this.startButton),this.screenOrganizer=new tabageos.IrisScreenOrganizer(this.root,[this.title,this.cameraLayer,this.gameOverContainer]),this.screenOrganizer.changeScreen(0),m||(this.sceneChanger=new tabageos.TileSceneChanger(this._image,this.display,this.gameWidth,this.gameHeight,this.tileWidth,this.tileHeight,this.player)));this.createHud();
this.soundSystem=new tabageos.SoundSystem;this.useClintBlockFont();this.addedInitializationMethod&&(this.addedInitializationMethod(),this.player&&this.initialPlayerPosition&&(this.player.setX(this.initialPlayerPosition.x),this.player.setY(this.initialPlayerPosition.y)),this.sceneChanger&&this.player&&(this.sceneChanger.mainChar=this.player));this.title.floor.canvas.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;");
this.gameOverContainer.floor.canvas.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;");this.horizontalCameraMove&&(a.game.cameraPoint.x=-9999);this.verticalCameraMove&&(a.game.cameraPoint.y=-9999);this.player||window.console.log("a player has not been created, set this.player to some new Character Class");this.__worker||this.initWorkerLoop()};a.prototype.muteUnmute=function(){a.game._mute=a.game._mute?
0:1;a.game._mute?a.game.soundSystem.stopMusic():a.game.soundSystem.playMusic();return a.game._mute+1-1};a.prototype.playSound=function(b,c,d){-1===this.soundSystem._soundNames.indexOf(b)&&this.soundSystem.addSound(b+(d||".ogg"),b,1,c||2);this._mute||this.soundSystem.playSound(b,1)};a.prototype.playMusic=function(b,c,d){this.soundSystem.clearMusicTracks();this.soundSystem.addMusic(b+(d||".ogg"),1,0===c||-1===c?0:1);this._mute||this.soundSystem.playMusic(0)};a.seeAndChaseRoutine=function(b,c,d,e,f,
g,h,k,l,n){if(k){var m=tabageos.BlitMath.checkTileValueAt(b.x+b.width+4,b.y+b.height+2,k,l,n);var p=tabageos.BlitMath.checkTileValueAt(b.x-4,b.y+b.height+2,k,l,n);p=0===p[0]||p[0]?0==p[0]&&(!p[1]||0==p[1]):0==p;m=0===m[0]||m[0]?0==m[0]&&(!m[1]||0==m[1]):0==m}!b._grounded&&b._jumps&&(b._state=3,b._veloc.y=4);if(b._pRight||k&&m)b.dX=b._pLeft?0:1;else if(b._pLeft||k&&p)b.dX=0;if(!tabageos.GeometricMath.testForPointInCircle(b._pos,f||128,d._pos)||b._pRight||b._pLeft){if(b._pRight||k&&m)b.dX=b._pLeft?
0:1;else if(b._pLeft||k&&p)b.dX=0;b.move(b.dX,b.dX?0:1,0,0,0)}else e.x=d.x+1-1,e.y=g?d.y+1-1:b.y+1-1,b.easeTo(e),b.separationDistance=h||48,c&&2<=c.length&&(b.separate(c),b.align(c)),b._pRight||k&&m&&d.x>b.x||b._pLeft||k&&p&&d.x<b.x?b.autoAnimation&&b.autoAnimation():b.update(0,0,0),b.x<d.x?b.dX=0:b.x>d.x+d.width&&(b.dX=1)};a.prototype.maybeStartGame=function(b){0===tabageos.GameSkeleton.game.screenOrganizer.currentScreen&&tabageos.GameSkeleton.game.changeToMainCamera(b);2===tabageos.GameSkeleton.game.screenOrganizer.currentScreen&&
tabageos.GameSkeleton.game.hudExit();1===tabageos.GameSkeleton.game.screenOrganizer.currentScreen&&tabageos.GameSkeleton.game.pause(b)};a.prototype.maybeGoBack=function(b){2===tabageos.GameSkeleton.game.screenOrganizer.currentScreen&&tabageos.GameSkeleton.game.hudExit();1===tabageos.GameSkeleton.game.screenOrganizer.currentScreen&&tabageos.GameSkeleton.game.goBack()};a.prototype.changeToMainCamera=function(b){b&&b.preventDefault();a.game.startButton.removeEventListener(tabageos.seekTouch()?tabageos._pointerEvents?
"pointerdown":"touchstart":"mouseup",a.game.changeToMainCamera,!1);a.game.screenOrganizer?(a.game.screenOrganizer.addEventListener(tabageos.ScreenChangeEvent.COVER,"startGameLoop",a.game),a.game.screenOrganizer.switchScreen(1)):a.game.startGameLoop()};a.prototype.updateAndResetCamera=function(b,c,d){b&&(this.sceneChanger._cameraPoint.x=Math.round(this.player.x)+b,this.sceneChanger._cameraPoint.y=Math.round(this.player.y)-this.camera.cameraFollowOffsetY,this.camera.reset(this.camera.width,this.camera.v.y),
this.camera.tweenedBlitLayerRender(this.cameraPoint,this.tweenLimitX||0,this.tweenLimitY||0,Math.round(this.frameTime/(d||this._ts)),this.cameraTweenType,0,0));c&&(this.sceneChanger._cameraPoint.x=Math.round(this.player.x)-this.camera.cameraFollowOffsetX,this.sceneChanger._cameraPoint.y=Math.round(this.player.y)+c,this.camera.reset(this.camera.v.x,this.camera.height),this.camera.tweenedBlitLayerRender(this.cameraPoint,this.tweenLimitX||0,this.tweenLimitY||0,Math.round(this.frameTime/(d||this._ts)),
this.cameraTweenType,0,0))};a.prototype.changeSceneEnemies=function(b){var c=this.sceneChanger.getEnemyArray(b);c?(b=c,this.updateEnemyMaps(b)):(this.sceneChanger.addEnemyArray([],b),b=c=this.sceneChanger.getEnemyArray(b));return b};a.prototype.changeSceneScenery=function(b){var c=this.sceneChanger.getStoredArray(b);c||(this.sceneChanger.addStoredArray([],b),c=this.sceneChanger.getStoredArray(b));return c};a.prototype.updateEnemyMaps=function(b){var c=0;for(c;c<b.length;c++){var d=b[c];d._map=this.player._map}};
a.prototype.updateSceneryObjectMaps=function(b){var c=0;for(c;c<b.length;c++){var d=b[c];d._map=this.player._map}};a.prototype.startGameLoop=function(b){a.game.screenOrganizer.removeEventListener(tabageos.ScreenChangeEvent.COVER,"startGameLoop",a.game);a.game.beforeStartGameLoop&&a.game.beforeStartGameLoop();b&&!this.gameFunction&&(this.gameFunction=b);this.charLayer.canvas.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;");
this.cameraLayer.canvas.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;");this.display&&this.display.canvas&&this.display.canvas.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;");this.backgroundLayer.canvas.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;");
this.__worker?this.__workLoop=1:(this._aid&&window.cancelAnimationFrame(this._aid),this._aid=window.requestAnimationFrame(this._loop))};a.prototype.readyHorizontalCameraMove=function(){this.cameraPoint.x=-9999};a.prototype.readyVerticalCameraMove=function(){this.cameraPoint.y=-9999};a.prototype.tweenLimitX=0;a.prototype.tweenLimitY=0;a.prototype.screenRightExitOffset=1;a.prototype.screenLeftExitOffset=1;a.prototype.screenUpExitOffset=1;a.prototype.screenDownExitOffset=1;a.prototype._shakesToInclude=
0;a.prototype.shake=function(b){a.game.camera.shake(b,a.game.container);2==a.game._cameraType&&a.game.includeShake(b)};a.prototype.includeShake=function(b){a.game._shakesToInclude=Math.round(b/33.3)+1;0===a.game._shakesToInclude%2&&(a.game._shakesToInclude+=3)};a.prototype.__workLoop=0;a.prototype.__worker=null;a.prototype.__loopWorker=function(){var b=URL.createObjectURL(new Blob(["(",function(){var c={tick:1};setInterval(function(){self.postMessage(c)},16)}.toString(),")()"],{type:"application/javascript"}));
return new Worker(b)};a.prototype.__methodForWorker=null;a.prototype.initWorkerLoop=function(){this.__worker||(this.__worker=a.game.__loopWorker(),this.__workLoop=0,this.__methodForWorker=a.game._loop,this.__worker.addEventListener("message",function(b){b.data.tick&&a.game.__methodForWorker()}))};a.prototype._loop=function(b){a.game._ts=b;0===a.game._thrott&&(a.game._thrott=b);a.game.__worker||(a.game._pr=b-a.game._thrott);if(!a.game.paused&&a.game.__workLoop||!a.game.__workLoop&&a.game._pr>=a.game.frameTime){0<
a.game._textTime&&(a.game._textTime-=33.3,0>=a.game._textTime&&(a.game.hideText(),a.game._textTime=0));if(1==a.game._doAlternate&&a.game.alternateLoopMethod){a.game.alternateLoopMethod(b);a.game._thrott=b;return}1<=a.game._cameraType&&a.game.charLayer.context.clearRect(a.game.camera.v.x,a.game.camera.v.y,a.game.camera.v.width,a.game.camera.v.height);if(a.game.sceneChanger&&a.game.player.x>a.game.gameWidth-this.screenRightExitOffset){var c=a.game.sceneChanger.currentScene+1;c>a.game.sceneChanger._totalScenes.length-
1&&(c=1);a.game.sceneChanger._totalScenes[c]||(c=a.game.sceneChanger.currentScene);a.game.priorToSceneChange&&a.game.priorToSceneChange(c);a.game.sceneChanger.changeScene(0,1,a.game.camera,"sceneChangeSpecifics",a.game,0,0,1,0,a.game.frameTime,a.game._ts,a.game.cameraTweenType);a.game.afterSceneChange&&a.game.afterSceneChange(c);a.game.camera.renderB1();a.game.camera.renderB2()}a.game.sceneChanger&&a.game.player.x<=a.game.tileWidth-this.screenLeftExitOffset&&(c=a.game.sceneChanger.currentScene-1,
0==c&&(c=a.game.sceneChanger._totalScenes.length-1),a.game.sceneChanger._totalScenes[c]||(c=a.game.sceneChanger.currentScene),a.game.priorToSceneChange&&a.game.priorToSceneChange(c),a.game.sceneChanger.changeScene(0,0,a.game.camera,"sceneChangeSpecifics",a.game,0,0,1,0,a.game.frameTime,a.game._ts,a.game.cameraTweenType),a.game.afterSceneChange&&a.game.afterSceneChange(c),a.game.camera.renderB1(),a.game.camera.renderB2());a.game.topDownSceneChange&&a.game.sceneChanger&&a.game.player.y>=a.game.gameHeight-
this.screenDownExitOffset&&(c=a.game.sceneChanger.currentScene+1,c>a.game.sceneChanger._totalScenes.length-1&&(c=1),a.game.sceneChanger._totalScenes[c]||(c=a.game.sceneChanger.currentScene),a.game.priorToSceneChange&&a.game.priorToSceneChange(c),a.game.sceneChanger.changeScene(0,2,a.game.camera,"sceneChangeSpecifics",a.game,0,1,0,0,a.game.frameTime,a.game._ts,a.game.cameraTweenType),a.game.afterSceneChange&&a.game.afterSceneChange(c),a.game.camera.renderB1(),a.game.camera.renderB2());a.game.topDownSceneChange&&
a.game.sceneChanger&&a.game.player.y<=this.screenUpExitOffset&&(c=a.game.sceneChanger.currentScene-1,0==c&&(c=a.game.sceneChanger._totalScenes.length-1),a.game.sceneChanger._totalScenes[c]||(c=a.game.sceneChanger.currentScene),a.game.priorToSceneChange&&a.game.priorToSceneChange(c),a.game.sceneChanger.changeScene(0,3,a.game.camera,"sceneChangeSpecifics",a.game,0,1,0,0,a.game.frameTime,a.game._ts,a.game.cameraTweenType),a.game.afterSceneChange&&a.game.afterSceneChange(c),a.game.camera.renderB1(),a.game.camera.renderB2());
a.game.gameFunction();2===a.game._cameraType&&(a.game.camera.justRender(),a.game._shakesToInclude&&(a.game.camera.executeShake(),--a.game._shakesToInclude));1===a.game._cameraType&&(a.game.horizontalCameraMove?(-9999==a.game.cameraPoint.x&&(a.game.cameraPoint.x=Math.round(a.game.player.x)-a.game.cameraFollowOffsetX+a.game.gameWidth/10),a.game.cameraPoint.y=Math.round(a.game.player.y)-a.game.cameraFollowOffsetY,a.game.cameraPoint.x+=a.game.horizontalCameraMove):a.game.verticalCameraMove?(-9999==a.game.cameraPoint.y&&
(a.game.cameraPoint.y=Math.round(a.game.player.y)-a.game.cameraFollowOffsetY-a.game.gameHeight/10),a.game.cameraPoint.y-=a.game.verticalCameraMove,a.game.cameraPoint.x=Math.round(a.game.player.x)-a.game.cameraFollowOffsetX):(a.game.cameraPoint.x=Math.round(a.game.player.x)-a.game.cameraFollowOffsetX,a.game.cameraPoint.y=Math.round(a.game.player.y)-a.game.cameraFollowOffsetY),a.game.camera.tweenedBlitLayerRender(a.game.cameraPoint,a.game.tweenLimitX||0,a.game.tweenLimitY||0,Math.round(a.game.frameTime/
a.game._ts),a.game.cameraTweenType,0,0));a.game._thrott=b;!a.game.controller.gamePadButtonsUserDefined&&a.game.enableGamePad?a.game.controller.configureGamePadButtons():a.game.enableGamePad&&a.game.controller.gamePadButtonsUserDefined&&a.game.controller.handleGamePad()}else a.game._thrott=b;1===a.game._doReset||a.game.paused||a.game.__workLoop||a.game.__worker||(a.game._aid=window.requestAnimationFrame(a.game._loop))};a.prototype.callCamera=function(b,c,d,e){a.game.cameraPoint.x=Math.round(a.game.player.x)-
a.game.cameraFollowOffsetX+c;a.game.cameraPoint.y=Math.round(a.game.player.y)-a.game.cameraFollowOffsetY+d;c=a.game;if(e){d=e.y<c.camera.v.y?0:c.camera.v.y;var f=e.x<c.camera.v.x?0:c.camera.v.x;f=c.camera.v.x+c.cameraWidth<e.x?c.camera.v.x+(e.x-(c.camera.v.x+c.cameraWidth))+-(c.cameraFollowOffsetX/(c.tileWidth/2)):f;d=c.camera.v.y+c.cameraHeight/2<e.y?e.y- -(2*c.cameraFollowOffsetY)+c.tileHeight+c.tileHeight+c.player.height+c.tileHeight:d;c.player.setX(e.x);c.player.setY(e.y);c.camera.reset(f,d)}a.game.camera.tweenedBlitLayerRender(a.game.cameraPoint,
a.game.tweenLimitX||0,a.game.tweenLimitY||0,Math.round(a.game.frameTime/(b||a.game._ts)),a.game.cameraTweenType,0,0)};a.prototype.cancelAniFrame=function(){window.cancelAnimationFrame(a.game._aid)};a.prototype.pause=function(b){b&&b.preventDefault();if(!a.game.screenOrganizer||a.game.screenOrganizer&&1==a.game.screenOrganizer.currentScreen)a.game.paused?(a.game.paused=0,a.game.__worker?a.game.__methodForWorker=a.game._loop:(window.cancelAnimationFrame(a.game._aid),a.game._aid=window.requestAnimationFrame(a.game._loop))):
(a.game.paused=1,a.game.__worker?a.game.__methodForWorker=a.game._justGamePad:(window.cancelAnimationFrame(a.game._aid),a.game._aid=window.requestAnimationFrame(a.game._justGamePad)))};a.prototype._justGamePad=function(b){0===a.game._thrott&&(a.game._thrott=b);a.game._pr=b-a.game._thrott;if(a.game.__worker||15<=a.game._pr)!a.game.controller.gamePadButtonsUserDefined&&a.game.enableGamePad?a.game.controller.configureGamePadButtons():a.game.controller.gamePadButtonsUserDefined&&a.game.enableGamePad&&
a.game.controller.handleGamePad(),a.game._thrott=b;a.game.paused&&!a.game.__worker&&(window.cancelAnimationFrame(a.game._aid),a.game._aid=window.requestAnimationFrame(a.game._justGamePad))};a.prototype._textTimeChosen=0;a.prototype.showText=function(b,c,d,e,f,g,h,k,l,n){a.game.container.contains(a.game.speechBubble)||(a.game._textTime=c||4E3,a.game._textTimeChosen=a.game._textTime+1-1,a.game.speechBubble.setAttribute("style",(k?"font-family:"+k:"")+";font-size:"+(d||16)/5+"vmin; background: "+(l||
"rgba(255,255,255,0.3)")+";text-align:center;border-radius:20px;width:"+(e?e+"px":"75%")+";height:"+(f?f+"px":"44%")+";position:absolute;border: thin solid black;top:"+(g||0)+"px;left:"+(h||0)+"px;"+(n||"")),a.game.speechBubble.value="\n"+b.replace(/&#13/g,"\n"),a.game.container.appendChild(a.game.speechBubble),a.game.textShown=1)};a.prototype.hideText=function(){a.game.container.contains(a.game.speechBubble)&&(a.game.container.removeChild(a.game.speechBubble),a.game.textShown=0)};a.prototype.textIsShown=
function(){return a.game.container.contains(a.game.speechBubble)};a.prototype.textShown=0;a.prototype.textFinished=function(){return a.game.container.contains(a.game.speechBubble)&&a.game._textTime<Math.floor(a.game._textTimeChosen/4)};a.prototype._setATimeO=0;a.prototype.levelComplete=function(b,c,d){c&&1E3>=c&&b&&window.console.warn("levelCompleteMethod will not happen until 1000, so if levelCompleteTime is less than 1000, its like there is no levelCompleteMethod");a.game._endingLevel||(b&&!d?(a.game._doReset=
1,a.game.__workLoop=0,a.game.reset({keyCode:399}),a.game.alternateLoopMethod=b||null):a.game._doAlternate=1,c&&!a.game._endingLevel&&0==a.game._setATimeO&&(a.game._setATimeO=1,window.setTimeout(function(){a.game._setATimeO=0;a.game._doAlternate&&!a.game._endingLevel&&(a.game._endingLevel=1,a.game.screenOrganizer.addEventListener(tabageos.ScreenChangeEvent.COVER,"_changeDoAlternate",a.game),a.game.screenOrganizer.changeScreen(1))},c)))};a.prototype._transitionByDoorTo=0;a.prototype._endingLevel=0;
a.prototype.endLevelComplete=function(b){a.game._endingLevel||(a.game._endingLevel=1,a.game.screenOrganizer.addEventListener(tabageos.ScreenChangeEvent.COVER,"_changeDoAlternate",a.game),a.game.screenOrganizer.changeScreen(1))};a.prototype._changeDoAlternate=function(b){a.game.screenOrganizer.removeEventListener(tabageos.ScreenChangeEvent.COVER,"_changeDoAlternate",a.game);a.game.positionResetSpecifics&&a.game.positionResetSpecifics();a.game.underCoverSpecifics&&a.game.underCoverSpecifics();a.game._transitionByDoorTo&&
(a.game.priorToSceneChange&&a.game.priorToSceneChange(a.game._transitionByDoorTo),a.game.sceneChanger.changeScene(0,0,a.game.camera,"sceneChangeSpecifics",a.game,a.game._transitionByDoorTo,0,0,0,a.game.frameTime,a.game._ts,a.game.cameraTweenType),a.game.afterSceneChange&&a.game.afterSceneChange(a.game._transitionByDoorTo),a.game.camera.renderB1(),a.game.camera.renderB2(),a.game._transitionByDoorTo=0);a.game._doAlternate=0;a.game._endingLevel=0};a.prototype.gameComplete=function(b,c){a.game._doReset=
1;a.game.__workLoop=0;a.game.reset({keyCode:399});a.game.alternateLoopMethod=b||null;c&&window.setTimeout(function(){a.game.__workLoop=0;window.cancelAnimationFrame(a.game._aid);a.game.fullResetToTitle(0)},c)};a.prototype.waitForStart=function(b){this.controller.buttons.start&&(this.controller.buttons.start=0,a.game._doAlternate=0,a.game.fullResetToTitle(0))};a.prototype.gameOver=function(b,c){1<this.lives?(--this.lives,a.game._doReset=1,a.game.__workLoop=0,a.game.reset({keyCode:b?82:299})):1==this.lives&&
(this.lives=0,window.cancelAnimationFrame(a.game._aid),a.game._doReset=1,a.game.__workLoop=0,a.game.alternateLoopMethod=a.game.waitForStart,this.screenOrganizer.addEventListener(tabageos.ScreenChangeEvent.SCREEN_CHANGE,"endLevel",a.game),this.screenOrganizer.switchScreen(2))};a.prototype.goBack=function(b){b&&b.preventDefault();if(!a.game.screenOrganizer||a.game.screenOrganizer&&1==a.game.screenOrganizer.currentScreen)a.game.paused?a.game.fullResetToTitle(0):(window.cancelAnimationFrame(a.game._aid),
a.game.__workLoop=0,a.game.reset({keyCode:82}))};a.prototype.fullResetToTitle=function(b){window.cancelAnimationFrame(a.game._aid);a.game._doReset=1;a.game.__workLoop=0;a.game._theReset()};a.prototype.simpleReset=function(){a.game._doReset=1;a.game.__workLoop=0;a.game.reset({keyCode:82})};a.prototype.reset=function(b){"undefined"==typeof b&&(b=window.event);b&&82==b.keyCode?(window.cancelAnimationFrame(a.game._aid),a.game.screenOrganizer?(a.game.screenOrganizer.addEventListener(tabageos.ScreenChangeEvent.COVER,
"resetPosition",a.game),a.game.screenOrganizer.changeScreen(1)):a.game.resetPosition(0)):b&&299==b.keyCode?(window.cancelAnimationFrame(a.game._aid),a.game.sceneResetSpecifics&&a.game.sceneResetSpecifics(),a.game.screenOrganizer?(a.game.screenOrganizer.addEventListener(tabageos.ScreenChangeEvent.COVER,"resetScene",a.game),a.game.screenOrganizer.changeScreen(1)):a.game.resetScene(0)):b&&399==b.keyCode&&(window.cancelAnimationFrame(a.game._aid),a.game.endLevel(0))};a.prototype.resetPosition=function(b){a.game.screenOrganizer&&
a.game.screenOrganizer.removeEventListener(tabageos.ScreenChangeEvent.COVER,"resetPosition",a.game);a.game.positionResetSpecifics&&a.game.positionResetSpecifics();window.setTimeout(function(){a.game._doReset=0;a.game.__worker?a.game.__workLoop=1:a.game._aid=window.requestAnimationFrame(a.game._loop)},1E3)};a.prototype.resetScene=function(b){a.game.screenOrganizer&&a.game.screenOrganizer.removeEventListener(tabageos.ScreenChangeEvent.COVER,"resetScene",a.game);a.game.positionResetSpecifics&&a.game.positionResetSpecifics();
a.game.additionalSceneResetSpecifics&&a.game.additionalSceneResetSpecifics();window.setTimeout(function(){a.game._doReset=0;a.game.__worker?a.game.__workLoop=1:a.game._aid=window.requestAnimationFrame(a.game._loop)},1E3)};a.prototype.moveForwardOneScene=function(){var b=a.game.sceneChanger.currentScene+1;b>a.game.sceneChanger._totalScenes.length-1&&(b=1);a.game.sceneChanger._totalScenes[b]||(b=a.game.sceneChanger.currentScene);a.game.priorToSceneChange&&a.game.priorToSceneChange(b);a.game.sceneChanger.changeScene(0,
1,a.game.camera,"sceneChangeSpecifics",a.game,0,0,1,0,a.game.frameTime,a.game._ts,a.game.cameraTweenType);a.game.afterSceneChange&&a.game.afterSceneChange(b);a.game.camera.renderB1();a.game.camera.renderB2()};a.prototype.moveBackOneScene=function(){var b=a.game.sceneChanger.currentScene-1;0==b&&(b=a.game.sceneChanger._totalScenes.length-1);a.game.sceneChanger._totalScenes[b]||(b=a.game.sceneChanger.currentScene);a.game.priorToSceneChange&&a.game.priorToSceneChange(b);a.game.sceneChanger.changeScene(0,
0,a.game.camera,"sceneChangeSpecifics",a.game,0,0,1,0,a.game.frameTime,a.game._ts,a.game.cameraTweenType);a.game.afterSceneChange&&a.game.afterSceneChange(b);a.game.camera.renderB1();a.game.camera.renderB2()};a.prototype.moveUpOneScene=function(){var b=a.game.sceneChanger.currentScene-1;0==b&&(b=a.game.sceneChanger._totalScenes.length-1);a.game.sceneChanger._totalScenes[b]||(b=a.game.sceneChanger.currentScene);a.game.priorToSceneChange&&a.game.priorToSceneChange(b);a.game.sceneChanger.changeScene(0,
3,a.game.camera,"sceneChangeSpecifics",a.game,0,1,0,0,a.game.frameTime,a.game._ts,a.game.cameraTweenType);a.game.afterSceneChange&&a.game.afterSceneChange(b);a.game.camera.renderB1();a.game.camera.renderB2()};a.prototype.moveDownOneScene=function(){var b=a.game.sceneChanger.currentScene+1;b>a.game.sceneChanger._totalScenes.length-1&&(b=1);a.game.sceneChanger._totalScenes[b]||(b=a.game.sceneChanger.currentScene);a.game.priorToSceneChange&&a.game.priorToSceneChange(b);a.game.sceneChanger.changeScene(0,
2,a.game.camera,"sceneChangeSpecifics",a.game,0,1,0,0,a.game.frameTime,a.game._ts,a.game.cameraTweenType);a.game.afterSceneChange&&a.game.afterSceneChange(b);a.game.camera.renderB1();a.game.camera.renderB2()};a.prototype.gotoSceneByDoor=function(b){a.game.priorToSceneChange&&a.game.priorToSceneChange(b);a.game.sceneChanger.changeScene(0,0,a.game.camera,"sceneChangeSpecifics",a.game,b,0,0,0,a.game.frameTime,a.game._ts,a.game.cameraTweenType);a.game.afterSceneChange&&a.game.afterSceneChange(b);a.game.camera.renderB1();
a.game.camera.renderB2()};a.prototype.transitionToSceneByDoor=function(b,c){this._transitionByDoorTo=b;this.levelComplete(null,c||1E3)};a.prototype._toScene=function(b){};a.prototype._endLevelTime=1E3;a.prototype.endLevel=function(b){a.game.screenOrganizer&&(a.game.screenOrganizer.removeEventListener(tabageos.ScreenChangeEvent.COVER,"endLevel",a.game),a.game.screenOrganizer.removeEventListener(tabageos.ScreenChangeEvent.SCREEN_CHANGE,"endLevel",a.game));window.setTimeout(function(){a.game._doReset=
0;a.game._doAlternate=1;a.game.__worker?a.game.__workLoop=1:a.game._aid=window.requestAnimationFrame(a.game._loop)},a.game._endLevelTime)};a.prototype._pixelTypeSpecs={dialogBackImage:null,sourceImg:null,canvas:null,lineFromXp:0,lineFromYp:0,tw:10,th:10,space:8,s33:0,s34:10,s35:20,s36:30,s37:40,s38:50,s39:60,s40:70,s41:80,s42:90,s43:100,s44:110,s45:120,s46:130,s47:140,s58:250,s59:260,s60:270,s61:280,s62:290,s63:300,s64:310,l0:150,l1:160,l2:170,l3:180,l4:190,l5:200,l6:210,l7:220,l8:230,l9:240,la:320,
lb:330,lc:340,ld:350,le:360,lf:370,lg:380,lh:390,li:400,lj:410,lk:420,ll:430,lm:440,ln:450,lo:460,lp:470,lq:480,lr:490,ls:500,lt:510,lu:520,lv:530,lw:540,lx:550,ly:560,lz:570,ua:320,ub:330,uc:340,ud:350,ue:360,uf:370,ug:380,uh:390,ui:400,uj:410,uk:420,ul:430,um:440,un:450,uo:460,up:470,uq:480,ur:490,us:500,ut:510,uu:520,uv:530,uw:540,ux:550,uy:560,uz:570};a.prototype.__alphabet={a0:"a",a1:"b",a2:"c",a3:"d",a4:"e",a5:"f",a6:"g",a7:"h",a8:"i",a9:"j",a10:"k",a11:"l",a12:"m",a13:"n",a14:"o",a15:"p",a16:"q",
a17:"r",a18:"s",a19:"t",a20:"u",a21:"v",a22:"w",a23:"x",a24:"y",a25:"z"};a.prototype.__ClintBlockLine="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqgAAAAKCAYAAAB486yQAAAGWUlEQVR4Xu1b0XbjOgjc/P9Hd0/cWJUQwwxYrvug+3STUBAwDAh7X//G/77M55f5/P5oZXqRXn6VXKTnbbti8zyz4m9GVtW3Ws5J069/hXxSceBh6y/gD+X/btzfZVeNc0YuKxuBU6kNlRNUuSd4jeXXYl+to6fkKhiIcl31Q+GMt4xn+ym8qL6uxulf8RflQ/X3Dj+Q7RNfCk9ZnvPOqeI129Ar51NrWNWtykHfJhL8+vrW+XodP7nB62WA/KEkkOt1f51yQ8f/sT/8/jnXods5I9M1AUbwtyVNkG32z3M6MZxi8zkUjTXIRxa4d8lb31shk/z250E6XBmAl9b4RbuDzSDHKrb+utynNGmdp+RsvSPcO+BjHOTxkBtjh7dUucHX1bjK6gPc8Tiu3uciHKjUr1rv6bpUe1ZHELbXTfz9S3yg5nY1Tkv1QXCg5M3rkwhbJX0L8jbF2uAri3Wmr8HS4VI0i0W9vHQ+gcdTfcHkweXyyAnWHOjQhAZUbzg4D+Il+gR9R86nM0eg+9+74XTg/u+Z+KfxOsGxAVKTqAyeR+KEBE+k4A3agERbCKOkgt/QLdPLcVZ95LdCMJ27dHAa/IiIyHRC24xcmwqxGYwyTFmMDkQUNMtL51s0SCj1oV64FNyjGqIxZjzUX2wPZfMFXMVpSc4U1PDUR7jwe00B4grwHo1hp7ByvkzjUuq9GuewZ5257/tTh4VpGaLywUU51dcpxqpdgL/GpdleqdpV6rLv705tKrFJXSzEvoBqblq8BMso20fZfDD83pr9N1fZ+rW6J1vCcFj9G6UvIC6fnnjbWuzPXRpQg8gM628yLKobNnjLMwlsjwkc8oEb16BxGBwPgxMCCwNgugHbWAdbAhmwTty8v1XX82xAUQhGaViTTH9oEBdlKFK3F8vlRKJcbbdhsLOPLikKBlKXNwdo8BFX8fLR16aLPacJDs2I4AphynKCuyXyNsvZAZXU79XzQT8y9RZtM6u4Z5tlZYPqER0aUFUcqBvFQF+JIw0OKnl7fEAl+Zj6ZVe7Q51/CnhQx/BSwDO0KQ6pbD7IDNq03/cxEeeG6YKmPEUPnuwyfYyfp0f4UkMKIhMOnYBYhyIxm9Tp3ZRgm3rIemQPQJ1q1OJthAGwNUL2qsIZK+Fm20RNXtR32OBwQrZw3RGn4X0oZLEBD0OC0mzYJlNthKvlEv6iGFY2WOpmWY2zKscuKJOPgAcGHJN6Q08DmurP/6Ah0cpNvl7cEHmxG/ph90EdTiJfIF46O+EyYoG/Ml7E+lgZl0kXGCpZ/yjVpbDRjnztuTSFU5HXlufto7CZd4Y3uKnuerW7qUQb2US/VOsI1fCwhOt9FYZANh+ovHaYNf1+4j7nd/a0VF42qLMBiQ/zdx5QRcMgNu3rle+gDg3OPqozgHa3Bwt8YsCamnBwo2LAGsCXGVCJn4pdw2n0cTsr4uH3oUP77zgrjw5WbxTVwW61XTXWd9hV4txweF4K0W0aNIfqBUndPJax5zTBVOPvn9C0rhC8MkBwn954qvqc16VczGX0MY4RuDaN59UbygCvmQ1WyQ/TOOlCZ8WrKL/Nu318AQbdGldfB0D16wxDh6iJuZq3qXehV/EEzE/zQeTDR3gahO0/CLc8FL0qaHSakLSP1TlHXXLZfLAB9eflhs8RlQ0qcs5+Hxmf3kMASlW503HmsAdYxR9PL3w0CUiogRQAUNEXPopNFErF5+pjYBUHByGQ2HkyA/92HzJ2bW7Ozyr+KnL9uSO/VT9UOTXOV+TcxiDUOMrvHdjLkGUlv2o+7pZTY7eijp6oXyV+al9gcitwoPC8LZUVdlF+1TpX4ox4NFNrlnuv2M3GWrlUM5loS6nOEZX+7PUsRU/Uh9C8pNR5lsvds14JNnO+d+Jtx36OwMwGBKvvDCQjGBRw5ku1iNlKndmVgSC+gsDsqUNTRu4pgsnYRVi8uzE8ZVfFlcV9hnyr2K+eLTMUZ/nlThwgnDJuVgfKlQNqxONVjlT9uCLnYYp9h3rMlb6lNnzL0wh/K/rq6rx58WFYjmKtzhF3+KEMlFf4auU84nFapt8rvSgjo+YjPGO1iVQc339zXwSUQrrP+ta8I7AjsCOwI7AjsCOwI7AwAntAXRjMB1VlbnEPHnOb3hHYEdgR2BHYEdgR2BHgEfgPKvKuYf4jz+EAAAAASUVORK5CYII=";
a.prototype.__dialogBack="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANIAAAAyCAYAAAAp3YXAAAABk0lEQVR4Xu3ToXECYRhF0V2TWlARqDjog14Q9EIf4KIQUdQSQ+bPBCaSnbmOgwDE7hNnvjtPf5/Nan27//dLgMBzAufrZR5P/n6NiI777XNveooAgYfA7nCaRkzzPaK39w88BAgsFPj++pxGTEJaCOdxAv8FhOQeCAQCQgoQTRAQkhsgEAgIKUA0QUBIboBAICCkANEEASG5AQKBgJACRBMEhOQGCAQCQgoQTRAQkhsgEAgIKUA0QUBIboBAICCkANEEASG5AQKBgJACRBMEhOQGCAQCQgoQTRAQkhsgEAgIKUA0QUBIboBAICCkANEEASG5AQKBgJACRBMEhOQGCAQCQgoQTRAQkhsgEAgIKUA0QUBIboBAICCkANEEASG5AQKBgJACRBMEhOQGCAQCQgoQTRAQkhsgEAgIKUA0QUBIboBAICCkANEEASG5AQKBgJACRBMEhOQGCAQCQgoQTRAQkhsgEAgIKUA0QeAR0qDYrNa3435LhQCBhQK7w2k6Xy/zfH9vxLRww+MEXl5gRDQQfgCimXOSRF7rtQAAAABJRU5ErkJggg==";
a.prototype.__OldSchoolLine="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdsAAAAHCAYAAABA8efUAAAEE0lEQVRoQ81a2W7cMAzs/v9Hb7BFFBCTuWhv0vZlW1uiKGoOWujjz+ef5/P5fDweD/z3fH7+rsa+5r7evX5nrPmcvTvvzxyMj+9Pjv/i9+wP98FqcvKb+8JnWLMZf47FddtxTe1/qo6sVs0z3JuqHxvH6sL294rJaooc2NSGzWU8SOMmzxQGJv4SNlj93L6a/Bj+N8/U+lgvlydqDdMNnP+uMSyvFFtpo9LguYaL7TR3U88N1t81NtXsXeu0cVrvuZL3N3PFg09mq8QNCe6MdJppAtURSfb706bsGhIUv0aw0l4aEs4xrdhdaWoSuFwDhg3FlZzbveE4hQnVHLGGM+GKiZ0TwJOja9yu7neTC8NXW5c7+alGPDUmzuBmg5IMZovlO0K95XDKXeXSmkS7l98al87it/JwHFc5bnOXZoubdKaakmmJ0CQ/Y50clUC+86BQxFAomyZh5sPiTfPFsY6Eqr5KeLeExoYL68rM24k2YqlpTBoTdQbXCLlrGNL5smbLCaDDcWuYd8YpfN0x29QAN/VgutNg/w7XGZdnPHczxbCc4rFmi+XPbl+YhqAOOr2dmGEYRBzP2Iq3zBtm7u3NCtO/Oxh3c5mGJR/bYvPbGlc6LyW+zvQ2RuqIww5WjWckVcBIa6av0PagEOxJJJBwaDpKHBVpmGk1e095Ohwh+RXJ3Tk6oZ5rKxKheKp4TSPBSKfEOZm8Ez/WhKR9OHyjCbAzu2u2r5jNWeE4pw9X37WYZQZ2pQFU4q5MpFnD3UIp3Dc3V8jBJhemPeoZ0x+lx8k32nWTRjNsusak8cbG106cW1+2eKgqcSW2TLTSVxcT6vbLdlMYJUQIogbYjPRM1FxzwPaYYrSih2LjDCKJeZrbNA8NuRRxWDOR6nDFhJxAOwInM3O5uL0l8WzOpa2pahDUl60TuUbQlIG75xujdZg+azS4YnHOvG1zt21GmC453Ce8OBP9Mo/P/+OT6seaAqWbiR/qPOY8FYPl3XiH8o2tn3yZbQNOZppzHnZwTDhSgu69Mm1X6GQkbt8bM9uMbcQHAfoTZptMaFO7dK5KGO+Q66opb0yFicLVnDfrXtmbMvl0zkmo1BfDNBIUMmcWKR/Fyavzthxvaj8bDsfV+c59SKh4/zv+sLZsH6z+DKuuBkn71XuWH7tpUPr0rud/82vBMBdNxsLANwuZhPk3SOUAkAo8hWU2FI7U+EWnvjQw3iQbCpqqExvHxFAB0e1j+04Z0xRqdoU111E1YLVS5+FuDTa5KINx+8SaNVd2DC+KN8gtZRaspgzrs4aq828bDmUWCkfpZmvOc8LOcKBiJw4nDmJdFS4Z51FLEhc2+GswlAzO5ac0FPF3MObwN+c4DXQfHcqXEM8OG633OC4qfn8AOLtMi72b33wAAAAASUVORK5CYII=";
a.prototype.__GoodNeighborsLine="data:image/png;base64, ";
a.prototype.useClintBlockFont=function(b,c){this.setPixelTypingSpecs(null,c||this.charLayer,0,0,10,10,b||7,1);this.calibratePixelType(150,320,null,10,10)};a.prototype.useOldSchoolFont=function(b,c){this.setPixelTypingSpecs(null,c||this.charLayer,0,0,5,7,b||6,2);this.calibratePixelType(75,320,160,5,7)};a.prototype.useGoodNeighborsFont=function(b,c){this.setPixelTypingSpecs(null,c||this.charLayer,0,0,16,16,b||9,3);this.calibratePixelType(240,1024,512,16,16)};a.prototype.setPixelTypingSpecs=function(b,
c,d,e,f,g,h,k){b||(b=new Image,2==k&&(b.src=a.game.__OldSchoolLine),k&&1!=k||(b.src=a.game.__ClintBlockLine),3==k&&(b.src=a.game.__GoodNeighborsLine));a.game._pixelTypeSpecs.dialogBackImage||(a.game._pixelTypeSpecs.dialogBackImage=new Image,a.game._pixelTypeSpecs.dialogBackImage.src=a.game.__dialogBack);a.game._pixelTypeSpecs.sourceImg=b;a.game._pixelTypeSpecs.canvas=c;a.game._pixelTypeSpecs.lineFromXp=d||0;a.game._pixelTypeSpecs.lineFromYp=e||0;a.game._pixelTypeSpecs.tw=f||5;a.game._pixelTypeSpecs.th=
g||7;a.game._pixelTypeSpecs.space=h||8};a.prototype.calibratePixelType=function(b,c,d,e,f){f=a.prototype._pixelTypeSpecs;var g=0,h=0,k=9;if(b||0===b)for(h;h<=k;h++)f["l"+h]=b+h*e;if(b||0===b)for(h=58,k=64,h;h<=k;h++)f["s"+h]=b+g*e+10*e,g++;h=33;k=47;g=0;for(h;h<=k;h++)f["s"+h]=g*e,g++;h=0;k=26;if(c||0===c)for(h;h<k;h++)f["l"+a.prototype.__alphabet["a"+h]]=c+h*e;h=0;k=26;if(d||0===d)for(h;h<k;h++)f["u"+a.prototype.__alphabet["a"+h]]=d+h*e};a.prototype.pixelType=function(b,c,d,e,f,g,h,k,l,n,m,p){var q=
a.game._pixelTypeSpecs,r=0,t=d.length;a.game._helperPoint.x=b+1-1;a.game._helperPoint.y=c+1-1;c=n||q.space;for(r;r<t;r++)n=void 0!=q["l"+d.charAt(r)]?q["l"+d.charAt(r)]:void 0!=q["s"+d.charCodeAt(r)]?q["s"+d.charCodeAt(r)]:q["u"+d.charAt(r).toLowerCase()],a.game._helperRect.x=(g||q.lineFromXp)+n,a.game._helperRect.y=h||q.lineFromYp,a.game._helperRect.width=k||q.tw,a.game._helperRect.height=l||q.th,a.game._helperPoint.x=b+r*c,(f||q.canvas).copyPixels(e||q.sourceImg,a.game._helperRect,a.game._helperPoint,
m||a.game._helperRect.width,p||a.game._helperRect.height)};a.prototype.pixelParagraph=function(b,c,d,e,f,g,h){e=e.split(".");var k=0,l=e.length;for(k;k<l;k++)this.pixelType(b,c+k*(d||9),e[k],0,f,0,0,0,0,0,g,h)};a.prototype._pixli=0;a.prototype.animatePixelParagraph=function(b,c,d,e,f,g,h,k){e=e.split(".");var l=0,n=e.length;if(0<a.game._pixli){var m=a.game._pixli-1;for(l;l<=m;l++)this.pixelType(b,c+l*(d||9),e[l],0,f,0,0,0,0,0,g,h)}l=a.game._pixli;0===this.animatePixelType(b,c+l*(d||9),e[l],k,0,f,
0,0,0,0,0,g,h)&&(a.game._pixli+=1);a.game._pixli>=n&&(a.game._pixli=0)};a.prototype.pixelDialogBox=function(b,c,d,e,f,g,h,k,l,n,m,p,q,r,t){p?(a.game._helperRect.x=p.x,a.game._helperRect.y=p.y,a.game._helperRect.width=p.width,a.game._helperRect.height=p.height):(a.game._helperRect.x=0,a.game._helperRect.y=0,a.game._helperRect.width=210,a.game._helperRect.height=50);a.game._helperPoint.x=c;a.game._helperPoint.y=d;(m||a.game.charLayer).copyPixels(q||a.game._pixelTypeSpecs.dialogBackImage,a.game._helperRect,
a.game._helperPoint,r||a.game._helperRect.width,t||a.game._helperRect.height);h?a.game.animatePixelParagraph(e,f,g,b,m||a.game.charLayer,l,n,k):a.game.pixelParagraph(e,f,g,b,m||a.game.charLayer,l,n)};a.prototype._pixai=0;a.prototype.animatePixelType=function(b,c,d,e,f,g,h,k,l,n,m,p,q){var r=a.game._pixelTypeSpecs,t=0,v=d.length,w=Math.round(a.game._pixai);a.game._helperPoint.x=b+1-1;a.game._helperPoint.y=c+1-1;c=m||r.space;for(t;t<=w;t++)m=void 0!=r["l"+d.charAt(t)]?r["l"+d.charAt(t)]:void 0!=r["s"+
d.charCodeAt(t)]?r["s"+d.charCodeAt(t)]:r["u"+d.charAt(t).toLowerCase()],a.game._helperRect.x=(h||r.lineFromXp)+m,a.game._helperRect.y=k||r.lineFromYp,a.game._helperRect.width=l||r.tw,a.game._helperRect.height=n||r.th,a.game._helperPoint.x=b+t*c,(g||r.canvas).copyPixels(f||r.sourceImg,a.game._helperRect,a.game._helperPoint,p||a.game._helperRect.width,q||a.game._helperRect.height);a.game._pixai+=e||1;a.game._pixai>=v&&(a.game._pixai=0);return a.game._pixai};a.prototype.hudExit=function(b){b&&b.preventDefault();
a.game.screenOrganizer&&0==a.game.screenOrganizer.currentScreen||(a.game.paused=1,window.cancelAnimationFrame(a.game._aid),a.game._doReset=1,window.setTimeout(function(){a.game._theReset()},700))};a.prototype.hudToWalkthrough=function(b){b&&b.preventDefault();a.game.walkthroughLink&&-1!=a.game.walkthroughLink.indexOf("http")&&window.open(a.game.walkthroughLink,"_blank")};a.prototype._reEstablish=function(b){a.game.screenOrganizer.removeEventListener(tabageos.ScreenOrganizer.COVER,"_reEstablish",a.game);
a.establish(a.game,a.game.__specs.spriteSheetImage||null,a.game.__specs.containerDivId||"container",a.game.__specs.rootDivId||"root",a.game.__specs.controllerDivId,0===a.game.__specs.gameScale?0:a.game.__specs.gameScale||2,!1===a.game.__specs.useScreenOrganizer?!1:!0,a.game.__specs.startWidth||50,a.game.__specs.startHeight||25)};a.prototype._theReset=function(){a.game._doReset=1;a.game.__workLoop=0;a.game.__worker&&(a.game.__worker.terminate(),a.game.__worker=null);window.cancelAnimationFrame(a.game._aid);
window.removeEventListener("keyup",a.game.reset,!1);a.game.fullResetSpecifics&&a.game.fullResetSpecifics();this.hideScoreText();this.hideHealthBar();this.hideText();this.removeHUD();this.takeDownMouseTouchHandle();this.cameraLayer.context.clearRect(0,0,this.gameWidth,this.gameHeight);this.cameraLayer=this.camera=this.gameOverContainer=this.backgroundLayer=null;this.charLayer.context.clearRect(0,0,this.gameWidth,this.gameHeight);this.charLayer=null;this.display&&this.display.context&&(this.display.context.clearRect(0,
0,this.gameWidth,this.gameHeight),this.display=null);this.title.div.removeChild(this.startButton);for(this.paused=this._thrott=0;this.screenOrganizer&&this.screenOrganizer.theGame.getNumChildren();)this.screenOrganizer.theGame.removeChild(this.screenOrganizer.theGame.getChildAt(this.screenOrganizer.theGame.getNumChildren()-1));!this.screenOrganizer&&this.root.contains(this.cameraLayer.canavs)&&this.root.removeChild(this.cameraLayer.canvas);this.container=this.player=this.root=this.title=null;tabageos.ScreenOrganizer._instance=
null;a.game._reEstablish(0)};a.prototype._scaleRectRef=null;a.prototype.removeHUD=function(){var b=tabageos.seekTouch()?tabageos._pointerEvents?"pointerdown":"touchstart":"click";a.game._HUD&&(a.game.hExit.removeEventListener(b,a.game.hudExit,!1),a.game.hPause.removeEventListener(b,a.game.pause,!1),a.game.hMute.removeEventListener(b,a.game.muteUnmute,!1),a.game.hWalkthrough.removeEventListener(b,a.game.hudToWalkthrough,!1),a.game.hReset.removeEventListener(b,a.game.goBack,!1),a.game._playerHUD&&this.container.contains(a.game._playerHUD)&&
this.container.removeChild(a.game._playerHUD),document.body.contains(a.game._HUD)&&document.body.removeChild(a.game._HUD))};a.prototype.hideHUD=function(){a.game._HUD&&(a.game._playerHUD&&(a.game._playerHUD.style.display="none"),a.game._HUD.style.display="none")};a.prototype.showHUD=function(){a.game._HUD&&(a.game._playerHUD&&(a.game._playerHUD.style.display="block"),a.game._HUD.style.display="block",a.game.__instanceBasicTwoLayerResize())};a.prototype._basicTwoLayerResize=function(b,c,d,e,f,g,h,
k,l){b.context.webkitImageSmoothingEnabled=!1;b.context.mozImageSmoothingEnabled=!1;b.context.imageSmoothingEnabled=!1;c&&c.context&&(c.context.webkitImageSmoothingEnabled=!1,c.context.mozImageSmoothingEnabled=!1,c.context.imageSmoothingEnabled=!1);d.context.webkitImageSmoothingEnabled=!1;d.context.mozImageSmoothingEnabled=!1;d.context.imageSmoothingEnabled=!1;a.game.device=tabageos.seekTouch();1==a.game.device?tabageos.ResizeGame(e,f+g,a.game.dontResizeHorizontal?0:l||1,a.game.dontResizeVertical?
0:l||1,l?a.game.container:null,a.game._manuelControllerUse?null:a.game.controller,1,a.game.controller?a.game.controller._style:1,a.game._scaleRectRef,1,e,g):tabageos.ResizeGame(e,f,a.game.dontResizeHorizontal?0:l||1,a.game.dontResizeVertical?0:l||1,l?a.game.resizeRootForNoTouch?a.game.screenOrganizer?a.game.root.div:a.game.root:a.game.container:null,a.game._manuelControllerUse?null:a.game.controller,0,1,a.game._scaleRectRef,1)};a.__baseToCol=function(b,c,d){d=window.atob(d);var e=d.length,f=new Uint8Array(e),
g=0;for(g;g<e;g++)f[g]=d.charCodeAt(g);d=new Uint8ClampedArray(f.buffer);d=new PNG(d);a.__eventBuildObject={w:b,h:c,c:d.decode(),imd:null};a.__eventBuildColors()};a.__binaryToCol=function(b,c,d,e){try{var f=new JSZip}catch(h){window.console.log("GameSkeleton.__binaryToCol requires JSZip");return}if(!d||!e)throw"for GameSkeleton.__binaryToCol w and h must be defined as the width and height of the binary";tabageos.GameSkeleton.__bnCords=new tabageos.Rectangle(0,0,d,e);var g=new XMLHttpRequest;g.onreadystatechange=
function(){200==g.status&&4==g.readyState&&f.loadAsync(g.response).then(function(h){h.file(c).async("string").then(function(k){k=k.split(",").map(Number);tabageos.GameSkeleton.__buildColors(tabageos.GameSkeleton.__bnCords.width,tabageos.GameSkeleton.__bnCords.height,k)})})};g.open("GET",b);g.responseType="blob";g.send()};a.__streamlineWorker=null;a.__streamWorker=function(){var b=URL.createObjectURL(new Blob(["(",function(){self.onmessage=function(c){var d=c.data.data;c=c.data.c;var e,f;for(f=e=0;f<
c.length;f+=4)d[e]=c[f],d[e+1]=c[f+1],d[e+2]=c[f+2],d[e+3]=c[f+3],e+=4;self.postMessage({imd:d})}}.toString(),")()"],{type:"application/javascript"}));return new Worker(b)};a.__eventBuildCA=null;a.__eventBuildObject={w:0,h:0,c:0,imd:null};a.__eventBuildColors=function(){try{a.__eventBuildCA||(a.__eventBuildCA=new tabageos.CanvasObject(null,a.__eventBuildObject.w,a.__eventBuildObject.h)),a.__eventBuildObject.imd||(a.__eventBuildObject.imd=a.__eventBuildCA.context.createImageData(a.__eventBuildObject.w,
a.__eventBuildObject.h)),a.__streamlineWorker=a.__streamWorker(),a.__streamlineWorker.addEventListener("message",function(b){a.__sprites=a.__eventBuildCA;b=new ImageData(b.data.imd,a.__eventBuildObject.w,a.__eventBuildObject.h);a.__sprites.context.putImageData(b,0,0);a.__streamlineWorker.terminate();a.__streamlineWorker=null;b=document.createEvent("MouseEvents");b.initEvent("GameSkeleton",!0,!0);window.dispatchEvent(b)},!1),a.__streamlineWorker.postMessage({data:a.__eventBuildObject.imd.data,c:a.__eventBuildObject.c})}catch(b){window.console.log(b),
window.document.body.getElementsByTagName("div")[8].innerHTML+=b+""}};a.__buildColors=function(b,c,d){var e,f;try{var g=new tabageos.CanvasObject(null,b,c),h=g.context.createImageData(b,c),k=h.data;for(f=e=0;f<d.length;f+=4)k[e]=d[f],k[e+1]=d[f+1],k[e+2]=d[f+2],k[e+3]=d[f+3],e+=4;a.__sprites=g;a.__sprites.context.putImageData(h,0,0);var l=document.createEvent("MouseEvents");l.initEvent("GameSkeleton",!0,!0);window.dispatchEvent(l)}catch(n){window.console.log(n)}};a.__sprites=null;a.__dispatch=function(){var b=
document.createEvent("MouseEvents");b.initEvent("GameSkeleton",!0,!0);window.dispatchEvent(b)};a.__initializei=function(b,c,d){tabageos.GameSkeleton.__sprites=new tabageos.CanvasObject(null,b,c);tabageos.GameSkeleton.__sprites.context.putImageData(d,0,0);b=document.createEvent("MouseEvents");b.initEvent("GameSkeleton",!0,!0);window.dispatchEvent(b)};a.establish=function(b,c,d,e,f,g,h,k,l){if(c)if(a.img="streamline"==c||a.__sprites?a.__sprites.canvas:new Image,a.img.onload=function(p){a.game=b;a.game._image=
a.img;a.game.basicInitialize(d,e,a.game.gameWidth,a.game.gameHeight,a.game.cameraWidth,a.game.cameraHeight,f,h,k,l,0===a.game.useSceneChanger?1:0,a.game._manuelControllerUse);a.game.gameScale=g||0;a.game._basicTwoLayerResize(a.game.cameraLayer,a.game.display,a.game.charLayer,a.game.cameraWidth,a.game.cameraHeight,a.game.controllerHeight,a.game.containerDiv,a.game.controller,a.game.gameScale);if(1<=a.game.gameScale||0===a.game.gameScale){p=a.game._scaleRectRef.width||a.game.cameraWidth;a.game.container.style.left=
"calc(50% - "+p/2+"px)";a.game._HUD.style.left="calc(50% - "+(p/2-(p-160))+"px)";var q=window.innerWidth/a.game.cameraWidth,r=window.innerHeight/a.game.cameraHeight;a.game._HUD.style.transformOrigin="0 0";a.game._HUD.style.transform="scale("+q/a.game.hudScale+","+r/a.game.hudScale+")";q=a.game._HUD.getBoundingClientRect();a.game._HUD.style.left="calc(50% - "+(p/2-(p-q.width))+"px)"}a.game.addedResizeMethod&&a.game.addedResizeMethod();window.addEventListener("resize",a.game.__instanceBasicTwoLayerResize,
!1);window.addEventListener("orientationchange",a.game.__instanceBasicTwoLayerResize,!1)},"streamline"!=c)a.img.src=c;else a.img.onload(0);else{a.game=b;a.game.basicInitialize(d,e,a.game.gameWidth,a.game.gameHeight,a.game.cameraWidth,a.game.cameraHeight,f,h,k,l,0===a.game.useSceneChanger?1:0,a.game._manuelControllerUse);a.game.gameScale=g||0;a.game._basicTwoLayerResize(a.game.cameraLayer,a.game.display,a.game.charLayer,a.game.cameraWidth,a.game.cameraHeight,a.game.controllerHeight,a.game.containerDiv,
a.game.controller,a.game.gameScale);if(1<=a.game.gameScale||0===a.game.gameScale){c=a.game._scaleRectRef.width||a.game.cameraWidth;a.game.container.style.left="calc(50% - "+c/2+"px)";a.game._HUD.style.left="calc(50% - "+(c/2-(c-160))+"px)";var n=window.innerWidth/a.game.cameraWidth,m=window.innerHeight/a.game.cameraHeight;a.game._HUD.style.transformOrigin="0 0";a.game._HUD.style.transform="scale("+n/a.game.hudScale+","+m/a.game.hudScale+")";n=a.game._HUD.getBoundingClientRect();a.game._HUD.style.left=
"calc(50% - "+(c/2-(c-n.width))+"px)"}a.game.addedResizeMethod&&a.game.addedResizeMethod();window.addEventListener("resize",a.game.__instanceBasicTwoLayerResize,!1);window.addEventListener("orientationchange",a.game.__instanceBasicTwoLayerResize,!1)}};a.prototype.__instanceBasicTwoLayerResize=function(){a.game._basicTwoLayerResize(a.game.cameraLayer,a.game.display,a.game.charLayer,a.game.cameraWidth,a.game.cameraHeight,a.game.controllerHeight,a.game.container,a.game.controller,a.game.gameScale);if(1<=
a.game.gameScale||0===a.game.gameScale){var b=a.game._scaleRectRef.width||a.game.cameraWidth;a.game.container.style.left="calc(50% - "+b/2+"px)";a.game._HUD.style.left="calc(50% - "+(b/2-(b-160))+"px)";var c=window.innerWidth/a.game.cameraWidth,d=window.innerHeight/a.game.cameraHeight;a.game._HUD.style.transformOrigin="0 0";a.game._HUD.style.transform="scale("+c/a.game.hudScale+","+d/a.game.hudScale+")";c=a.game._HUD.getBoundingClientRect();a.game._HUD.style.left="calc(50% - "+(b/2-(b-c.width))+"px)"}a.game.addedResizeMethod&&
a.game.addedResizeMethod()};tabageos.GameSkeleton=a})();
(function(){function a(b,c){this.context=b&&!c?b.getContext("webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!0}):c}a.prototype.context=null;a.prototype.getContext=function(){return this.context};a.prototype._program=null;a.prototype._positionLocation=null;a.prototype._texcoordLocation=null;a.prototype._matrixLocation=null;a.prototype._textureMatrixLocation=null;a.prototype._textureLocation=null;a.prototype._positionBuffer=null;a.prototype._positions=[0,0,0,1,1,0,1,0,0,1,1,
1];a.prototype._texcoordBuffer=null;a.prototype._texcoords=[0,0,0,1,1,0,1,0,0,1,1,1];a.prototype._texture=null;a.prototype._imgWidth=1;a.prototype._imgHeight=1;a.prototype._assembleProgram=function(){var b=this.context.createShader(this.context.VERTEX_SHADER);this.context.shaderSource(b,this.__vs());this.context.compileShader(b);window.console.log(this.context.getShaderParameter(b,this.context.COMPILE_STATUS)?"vShader compiled":"shader compile error");var c=this.context.createShader(this.context.FRAGMENT_SHADER);
this.context.shaderSource(c,this.__fs());this.context.compileShader(c);window.console.log(this.context.getShaderParameter(c,this.context.COMPILE_STATUS)?"fShader compiled":"f shader compile error");this._program=this.context.createProgram();this.context.attachShader(this._program,b);this.context.attachShader(this._program,c);this.context.linkProgram(this._program);window.console.log(this.context.getProgramParameter(this._program,this.context.LINK_STATUS)?"program linked":"program link error")};a.prototype.readyWebglProgram=
function(){this._program||(this._assembleProgram(),this._positionLocation=this.context.getAttribLocation(this._program,"a_position"),this._texcoordLocation=this.context.getAttribLocation(this._program,"a_texcoord"),this._matrixLocation=this.context.getUniformLocation(this._program,"u_matrix"),this._textureMatrixLocation=this.context.getUniformLocation(this._program,"u_textureMatrix"),this._textureLocation=this.context.getUniformLocation(this._program,"u_texture"),this._positionBuffer=this.context.createBuffer(),
this.context.bindBuffer(this.context.ARRAY_BUFFER,this._positionBuffer),this.context.bufferData(this.context.ARRAY_BUFFER,new Float32Array(this._positions),this.context.STATIC_DRAW),this._texcoordBuffer=this.context.createBuffer(),this.context.bindBuffer(this.context.ARRAY_BUFFER,this._texcoordBuffer),this.context.bufferData(this.context.ARRAY_BUFFER,new Float32Array(this._texcoords),this.context.STATIC_DRAW))};a.prototype._bindImageForWebglCopyPixels=function(b,c){c||(c=this.context);this._texture=
c.createTexture();c.bindTexture(c.TEXTURE_2D,this._texture);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,1,1,0,c.RGBA,c.UNSIGNED_BYTE,new Uint8Array([0,0,255,255]));c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR);c.bindTexture(c.TEXTURE_2D,this._texture);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,b);this._imgWidth=b.width;this._imgHeight=b.height};a.prototype.__vs=
function(){return"precision mediump float;attribute vec4 a_position;attribute vec2 a_texcoord;uniform mat4 u_matrix;uniform mat4 u_textureMatrix;varying vec2 v_texcoord;void main() {gl_Position = u_matrix * a_position;v_texcoord = (u_textureMatrix * vec4(a_texcoord, 0, 1)).xy; }"};a.prototype.__fs=function(){return"precision mediump float;varying vec2 v_texcoord;uniform sampler2D u_texture; void main() {gl_FragColor = texture2D(u_texture, v_texcoord);}"};a.__scripts=0;a.prototype.__injectScripts=
function(){if(!a.__scripts){var b=document.createElement("script");b.setAttribute("type","x-shader/x-vertex");b.setAttribute("id","vsh");b.text="attribute vec4 a_position;  attribute vec2 a_texcoord;  uniform mat4 u_matrix;  uniform mat4 u_textureMatrix;  varying vec2 v_texcoord; void main() { gl_Position = u_matrix * a_position; v_texcoord = (u_textureMatrix * vec4(a_texcoord, 0, 1)).xy; }";document.getElementsByTagName("body")[0].appendChild(b);b=document.createElement("script");b.setAttribute("type",
"x-shader/x-fragment");b.setAttribute("id","fsh");b.text="precision mediump float;  varying vec2 v_texcoord;  uniform sampler2D u_texture;  void main() {   gl_FragColor = texture2D(u_texture, v_texcoord); }";document.getElementsByTagName("body")[0].appendChild(b);a.__scripts=1}};try{a.prototype._orA=new Float32Array(16)}catch(b){a.prototype._orA=[],window.console.log(b.message)}a.prototype._orthographic=function(b,c,d,e,f,g,h){h=h||this._orA;h[0]=2/(c-b);h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/(e-d);h[6]=
0;h[7]=0;h[8]=0;h[9]=0;h[10]=2/(f-g);h[11]=0;h[12]=(b+c)/(b-c);h[13]=(d+e)/(d-e);h[14]=(f+g)/(f-g);h[15]=1;return h};try{a.prototype._trA=new Float32Array(16)}catch(b){a.prototype._trA=[],window.console.log(b.message)}a.prototype._translate=function(b,c,d,e,f){f=f||this._trA;var g=b[0],h=b[1],k=b[2],l=b[3],n=b[4],m=b[5],p=b[6],q=b[7],r=b[8],t=b[9],v=b[10],w=b[11],u=b[12],x=b[13],z=b[14],B=b[15];b!==f&&(f[0]=g,f[1]=h,f[2]=k,f[3]=l,f[4]=n,f[5]=m,f[6]=p,f[7]=q,f[8]=r,f[9]=t,f[10]=v,f[11]=w);f[12]=g*
c+n*d+r*e+u;f[13]=h*c+m*d+t*e+x;f[14]=k*c+p*d+v*e+z;f[15]=l*c+q*d+w*e+B;return f};try{a.prototype._tranA=new Float32Array(16)}catch(b){a.prototype._tranA=[],window.console.log(b.message)}a.prototype._translation=function(b,c,d,e){e=e||this._tranA;e[0]=1;e[1]=0;e[2]=0;e[3]=0;e[4]=0;e[5]=1;e[6]=0;e[7]=0;e[8]=0;e[9]=0;e[10]=1;e[11]=0;e[12]=b;e[13]=c;e[14]=d;e[15]=1;return e};try{a.prototype._scA=new Float32Array(16)}catch(b){a.prototype._scA=[],window.console.log(b.message)}a.prototype._scale=function(b,
c,d,e,f){f=f||this._scA;f[0]=c*b[0];f[1]=c*b[1];f[2]=c*b[2];f[3]=c*b[3];f[4]=d*b[4];f[5]=d*b[5];f[6]=d*b[6];f[7]=d*b[7];f[8]=e*b[8];f[9]=e*b[9];f[10]=e*b[10];f[11]=e*b[11];b!==f&&(f[12]=b[12],f[13]=b[13],f[14]=b[14],f[15]=b[15]);return f};a.prototype._matrix=null;a.prototype.copyPixels=function(b,c,d,e,f){this._program||(this.readyWebglProgram(),this._bindImageForWebglCopyPixels(b),this.context.bindTexture(this.context.TEXTURE_2D,this._texture),this.context.useProgram(this._program),this.context.bindBuffer(this.context.ARRAY_BUFFER,
this._positionBuffer),this.context.enableVertexAttribArray(this._positionLocation),this.context.vertexAttribPointer(this._positionLocation,2,this.context.FLOAT,!1,0,0),this.context.bindBuffer(this.context.ARRAY_BUFFER,this._texcoordBuffer),this.context.enableVertexAttribArray(this._texcoordLocation),this.context.vertexAttribPointer(this._texcoordLocation,2,this.context.FLOAT,!1,0,0),this._matrix=this._orthographic(0,this.context.canvas.width,this.context.canvas.height,0,-1,1),window.console.log("cp setup"));
this._matrix=this._translate(this._matrix,d.x,d.y,0);this._matrix=this._scale(this._matrix,e||c.width,f||c.height,1);this.context.uniformMatrix4fv(this._matrixLocation,!1,this._matrix);b=this._translation(c.x/this._imgWidth,c.y/this._imgHeight,0);b=this._scale(b,c.width/this._imgWidth,c.height/this._imgHeight,1);this.context.uniformMatrix4fv(this._textureMatrixLocation,!1,b);this.context.uniform1i(this._textureLocation,0);this.context.drawArrays(this.context.TRIANGLES,0,6)};a.prototype.clearRect=
function(b,c,d,e){var f=this.context||this;f.enable(f.SCISSOR_TEST);f.scissor(b,f.canvas.height-c-e,d,e);f.clearColor(0,0,0,0);f.clear(f.COLOR_BUFFER_BIT);f.disable(f.SCISSOR_TEST)};tabageos.WebglRenderer=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p,q,r,t){tabageos.TravelerSkeleton.call(this,b,c,d,e);tabageos.MapTraveler.call(this,b,c,d,e,f,g,h,k,l,n,m,p);tabageos.TravelingSceneryThrower.call(this,b,c,d,e,f,g,h,k,l,n,m,p);this.width=d||0;this.height=e||0;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(b,c);this._veloc=new tabageos.MoverPoint(0,0);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=new tabageos.MoverPoint(b,c);this._deltaTime=k||tabageos.TimeKeeper._sae;
this._map=h?f:tabageos.BlitMath.cloneMultiArray(f);this._state=1;this.x=b||0;this.y=c||0;this._rect=new tabageos.Rectangle(this.x,this.y,this.width,this.height);this._canvasAnimation=g||null;this._tH=n||this.height;this._tW=l||this.width;this._outAltered=new tabageos.MoverPoint;this.holdingRect=new tabageos.Rectangle(0,0,d,e);this.holdingOffsetX=1;this.holdingOffsetY=3;this._jumps=1;this.easeProximity=7;this._checkHelper=new tabageos.MoverPoint;this.forceApplier=new tabageos.MoverPoint;this.forceHolder=
new tabageos.MoverPoint;this._w=d||0;this._h=e||0;this.wanderOffset=new tabageos.MoverPoint(0,0);this.blankMO=new tabageos.MoverPoint;this._eventDispatcher=new tabageos.EventDispatcher;this.holdings=[];this._holdingHelperRect=new tabageos.Rectangle(0,0,0,0);this.personalSpace=9*this.width;this._hpt=new tabageos.MoverPoint;this.throwStrength=this._jumpSpeed=10;this._canvasAnimation&&(this._canvasAnimation.addedAnimationChanges=this._addedToChangeDirectionAni,this._canvasAnimation._playerRef=this);
this.tileMap=q;this._controllerRef=r;this.ladderValue=t;this._hlpp=new tabageos.MoverPoint}a.prototype.constructor=a;a.prototype=Object.create(tabageos.TravelerSkeleton.prototype);Object.assign(a.prototype,tabageos.MapTraveler.prototype,tabageos.TravelingSceneryThrower.prototype);a.prototype.onLadder=0;a.prototype.onMovingPlatform=0;a.prototype.ladderValue=0;a.prototype.tileMap=null;a.prototype.tile=null;a.prototype.tilelUp=null;a.prototype.tileDown=null;a.prototype.tileLeft=null;a.prototype.tileRight=
null;a.prototype._hlpp=null;a.prototype.getValuesOfCloseTiles=function(b){var c=Math.floor(this.x),d=Math.floor(this.y);this.tile=tabageos.BlitMath.checkTileValueAt(c,d,b||this.tileMap,this._tW,this._tH);this.tileUp=tabageos.BlitMath.checkTileValueAt(c,d-this._tH,b||this.tileMap,this._tW,this._tH);this.tileDown=tabageos.BlitMath.checkTileValueAt(c,d+this._tH,b||this.tileMap,this._tW,this._tH);this.tileLeft=tabageos.BlitMath.checkTileValueAt(c-this._tW,d,b||this.tileMap,this._tW,this._tH);this.tileRight=
tabageos.BlitMath.checkTileValueAt(c+this._tW,d,b||this.tileMap,this._tW,this._tH)};a.prototype.valuesMatch=function(b,c){var d=!1;if(b[0]||0===b[0]){var e=0,f=b.length;for(e;e<f;e++)if(b[e]!=c[e]){d=!1;break}else d=!0}else b==c&&(d=!0);return d};a.prototype._addedToChangeDirectionAni=function(b,c,d,e,f,g){e=this._playerRef._controllerRef.buttons;this._playerRef.ladderValue&&(this._playerRef.getValuesOfCloseTiles(),f=this._playerRef,d||b||c||!f.valuesMatch(f.tileDown,f.ladderValue)||f.valuesMatch(f.tileUp,
f.ladderValue)||(this._playerRef._veloc.y=0,this._playerRef._grounded=1,this._playerRef._state=1),e.up&&(f.valuesMatch(f.tileUp,f.ladderValue)||f.valuesMatch(f.tile,f.ladderValue)||f.valuesMatch(f.tileDown,f.ladderValue))?(this._playerRef._veloc.y=0,--this._playerRef._pos.y,--this._playerRef.y,this._playerRef.onLadder=1,this.animationSpecs.climb&&(this.currentAnimation="climb")):e.down&&f.valuesMatch(f.tileDown,f.ladderValue)?(this._playerRef._veloc.y=0,this._playerRef._pos.y+=1,this._playerRef.y+=
1,this._playerRef.onLadder=1,this.animationSpecs.climb&&(this.currentAnimation="climb")):this._playerRef.onLadder=0)};tabageos.BasicPlatformer=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p,q,r,t,v,w){tabageos.TravelerSkeleton.call(this,b,c,d,e);tabageos.MapTraveler.call(this,b,c,d,e,f,g,h,k,l,n,m,p);tabageos.TravelingSceneryThrower.call(this,b,c,d,e,f,g,h,k,l,n,m,p);tabageos.BasicPlatformer.call(this,b,c,d,e,f,g,h,k,l,n,m,p,q,r,t);this.width=d||0;this.height=e||0;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(b,c);this._veloc=new tabageos.MoverPoint(0,0);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=
new tabageos.MoverPoint(b,c);this._deltaTime=k||tabageos.TimeKeeper._sae;this._map=h?f:tabageos.BlitMath.cloneMultiArray(f);this._state=1;this.x=b||0;this.y=c||0;this._rect=new tabageos.Rectangle(this.x,this.y,this.width,this.height);this._canvasAnimation=g||null;this._tH=n||this.height;this._tW=l||this.width;this._outAltered=new tabageos.MoverPoint;this.holdingRect=new tabageos.Rectangle(0,0,d,e);this.holdingOffsetX=1;this.holdingOffsetY=3;this._jumps=1;this.easeProximity=7;this._checkHelper=new tabageos.MoverPoint;
this.forceApplier=new tabageos.MoverPoint;this.forceHolder=new tabageos.MoverPoint;this._w=d||0;this._h=e||0;this.wanderOffset=new tabageos.MoverPoint(0,0);this.blankMO=new tabageos.MoverPoint;this._eventDispatcher=new tabageos.EventDispatcher;this.holdings=[];this._holdingHelperRect=new tabageos.Rectangle(0,0,0,0);this.personalSpace=9*this.width;this._hpt=new tabageos.MoverPoint;this.throwStrength=this._jumpSpeed=10;this._canvasAnimation&&(this._canvasAnimation.addedAnimationChanges=this._addedToChangeDirectionAni,
this._canvasAnimation._playerRef=this);this._controllerRef=r;this.tileMap=q;this.ladderValue=t;this._attackB=v||0;this._attackC=w||0;this._attackB&&(this._controllerRef.basicArrows.b=this._attackB,this._controllerRef.basicWasd.b=this._attackB);this._attackC[0]?(this._comboC=1,this._controllerRef.basicArrows.c=this._attackC[0],this._controllerRef.basicWasd.c=this._attackC[0]):this._attackC&&(this._controllerRef.basicArrows.c=this._attackC,this._controllerRef.basicWasd.c=this._attackC)}a.prototype.constructor=
a;a.prototype=Object.create(tabageos.TravelerSkeleton.prototype);Object.assign(a.prototype,tabageos.MapTraveler.prototype,tabageos.TravelingSceneryThrower.prototype,tabageos.BasicPlatformer.prototype);a.prototype.crouchHeightOffset=16;a.prototype.crouchWidthOffset=32;a.prototype.attackWidthOffset=32;a.prototype.attackHeightOffset=32;a.prototype.attackTwoWidthOffset=32;a.prototype.attackTwoHeightOffset=32;a.prototype._alternate=0;a.prototype._controllerRef=null;a.prototype._fwoHold=-9999;a.prototype._fhoHold=
-9999;a.prototype._attackB=0;a.prototype._attackC=0;a.prototype._comboC=0;a.prototype.hurt=0;a.prototype.attackTwoName="attack2";a.prototype.atApexOfAttack=0;a.prototype._dashTime=0;a.prototype.dashSpeed=10;a.prototype._originalWalkSpeed=-7777;a.prototype.totalDashTime=500;a.prototype.setupForTopDown=function(){this.crouchWidthOffset=this.crouchHeightOffset=0;this._canvasAnimation&&(this._canvasAnimation.addedAnimationChanges=this._addedToChangeDirectionAniRpger)};a.prototype._addedToChangeDirectionAniRpger=
function(b,c,d,e,f,g){var h=this._playerRef._controllerRef.buttons;f=-1!=this.currentAnimation.indexOf("right")?"right":-1!=this.currentAnimation.indexOf("left")?"left":-1!=this.currentAnimation.indexOf("down")?"down":-1!=this.currentAnimation.indexOf("up")?"up":"";0<=this._playerRef._fwoHold&&(this.fromHeightOffset=this._playerRef._fhoHold+1-1,this.fromWidthOffset=this._playerRef._fwoHold+1-1);this.currentAnimation=this.currentAnimation.replace("idle","");!h.b||b||c||d||-1!=this.currentAnimation.indexOf("attack")||
"climb"==this.currentAnimation?-1!=this.currentAnimation.indexOf("attack")&&this.finishedCurrentAnimation()?(-9999!=this._playerRef._fhoHold&&(this.fromHeightOffset=this._playerRef._fhoHold+1-1,this.fromWidthOffset=this._playerRef._fwoHold+1-1),this.currentAnimation=this.currentAnimation.replace("attack",""),this._playerRef.atApexOfAttack=0,this._playerRef._alternate=0):h.b&&-1!=this.currentAnimation.indexOf("attack")&&!this.finishedCurrentAnimation()?(this.fromHeightOffset=this._playerRef.attackHeightOffset+
1-1,this.fromWidthOffset=this._playerRef.attackWidthOffset+1-1,0==this._playerRef._alternate?(g=this.animationSpecs[this.currentAnimation][1].length,this.ani>g/4+2&&(this.ani=g/4,this._playerRef.atApexOfAttack=1),this.ani<g/4&&this.ani++,this._playerRef._alternate=1):(g=this.animationSpecs[this.currentAnimation][1].length,this.ani>g/4+2&&(this._playerRef.atApexOfAttack=1))):h.b||-1==this.currentAnimation.indexOf("attack")||this.finishedCurrentAnimation()||(this.fromHeightOffset=this._playerRef.attackHeightOffset+
1-1,this.fromWidthOffset=this._playerRef.attackWidthOffset+1-1,1==this._playerRef._alternate?this._playerRef._alternate=0:(g=this.animationSpecs[this.currentAnimation][1].length,this.ani>g/4+2&&(this._playerRef.atApexOfAttack=1))):(this.currentAnimation="attack"+f,-9999==this._playerRef._fwoHold&&(this._playerRef._fwoHold=this.fromWidthOffset+1-1),-9999==this._playerRef._fhoHold&&(this._playerRef._fhoHold=this.fromHeightOffset+1-1),this.fromHeightOffset=this._playerRef.attackHeightOffset+1-1,this.fromWidthOffset=
this._playerRef.attackWidthOffset+1-1,this._playerRef.atApexOfAttack=0);!this._playerRef._comboC&&h.c&&-1==this.currentAnimation.indexOf(this._playerRef.attackTwoName)&&"climb"!=this.currentAnimation?(this.currentAnimation=this._playerRef.attackTwoName+f,-9999==this._playerRef._fwoHold&&(this._playerRef._fwoHold=this.fromWidthOffset+1-1),-9999==this._playerRef._fhoHold&&(this._playerRef._fhoHold=this.fromHeightOffset+1-1),this.fromHeightOffset=this._playerRef.attackTwoHeightOffset+1-1,this.fromWidthOffset=
this._playerRef.attackTwoWidthOffset+1-1):h.c||-1==this.currentAnimation.indexOf(this._playerRef.attackTwoName)||(this.currentAnimation=this.currentAnimation.replace(this._playerRef.attackTwoName,""),0<=this._playerRef._fwoHold&&(this.fromHeightOffset=this._playerRef._fhoHold+1-1,this.fromWidthOffset=this._playerRef._fwoHold+1-1));-1!=this.currentAnimation.indexOf(this._playerRef.attackTwoName)||-1!=this.currentAnimation.indexOf("attack")||h.left||h.right||h.up||h.down||b||d||c||e||(this.currentAnimation+=
"idle",0<=this._playerRef._fwoHold&&(this.fromHeightOffset=this._playerRef._fhoHold+1-1,this.fromWidthOffset=this._playerRef._fwoHold+1-1))};a.prototype._addedToChangeDirectionAni=function(b,c,d,e,f,g){e=this._playerRef._controllerRef.buttons;f=-1!=this.currentAnimation.indexOf("right")?"right":-1!=this.currentAnimation.indexOf("left")?"left":0<this._playerRef._lastVeloc.x?"right":"left";e.down&&(e.right||e.left)&&(-1!=this.currentAnimation.indexOf("duck")&&(this.currentAnimation=this.currentAnimation.replace("duck",
"")),0<this._playerRef._fwoHold&&(this.fromHeightOffset=this._playerRef._fhoHold+1-1,this.fromWidthOffset=this._playerRef._fwoHold+1-1));!e.down||e.left||b||c||e.right||d||0!=this._playerRef.onLadder?-1!=this.currentAnimation.indexOf("duck")&&(this.fromHeightOffset=this._playerRef._fhoHold+1-1,this.fromWidthOffset=this._playerRef._fwoHold+1-1,this.currentAnimation=this.currentAnimation.replace("duck","")):(this.currentAnimation="duck"+f,-9999==this._playerRef._fwoHold&&(this._playerRef._fwoHold=this.fromWidthOffset+
1-1),-9999==this._playerRef._fhoHold&&(this._playerRef._fhoHold=this.fromHeightOffset+1-1),this.fromHeightOffset=this._playerRef.crouchHeightOffset+1-1,this.fromWidthOffset=this._playerRef.crouchWidthOffset+1-1);-1==this.currentAnimation.indexOf("duck")&&this.fromWidthOffset==this._playerRef.crouchWidthOffset&&this.fromHeightOffset==this._playerRef.crouchHeightOffset&&(this.fromWidthOffset=this._playerRef._fwoHold+1-1,this.fromHeightOffset=this._playerRef._fhoHold+1-1);!e.b||b||c||d||-1!=this.currentAnimation.indexOf("attack")||
"climb"==this.currentAnimation?-1!=this.currentAnimation.indexOf("attack")&&this.finishedCurrentAnimation()?(this.fromHeightOffset=this._playerRef._fhoHold+1-1,this.fromWidthOffset=this._playerRef._fwoHold+1-1,this.currentAnimation=this.currentAnimation.replace("attack",""),this._playerRef.atApexOfAttack=0,this._playerRef._alternate=0):e.b&&-1!=this.currentAnimation.indexOf("attack")&&!this.finishedCurrentAnimation()?0==this._playerRef._alternate?(g=this.animationSpecs[this.currentAnimation][1].length,
this.ani>g/4+2&&(this.ani=g/4,this._playerRef.atApexOfAttack=1),this.ani<g/4&&this.ani++,this._playerRef._alternate=1):(g=this.animationSpecs[this.currentAnimation][1].length,this.ani>g/4+2&&(this._playerRef.atApexOfAttack=1)):e.b||-1==this.currentAnimation.indexOf("attack")||this.finishedCurrentAnimation()||(1==this._playerRef._alternate?this._playerRef._alternate=0:(g=this.animationSpecs[this.currentAnimation][1].length,this.ani>g/4+2&&(this._playerRef.atApexOfAttack=1))):(this.currentAnimation=
"attack"+f,-9999==this._playerRef._fwoHold&&(this._playerRef._fwoHold=this.fromWidthOffset+1-1),-9999==this._playerRef._fhoHold&&(this._playerRef._fhoHold=this.fromHeightOffset+1-1),this.fromHeightOffset=this._playerRef.attackHeightOffset+1-1,this.fromWidthOffset=this._playerRef.attackWidthOffset+1-1,this._playerRef.atApexOfAttack=0);!this._playerRef._comboC&&e.c&&-1==this.currentAnimation.indexOf(this._playerRef.attackTwoName)&&"climb"!=this.currentAnimation&&(this.currentAnimation=this._playerRef.attackTwoName+
f,-9999==this._playerRef._fwoHold&&(this._playerRef._fwoHold=this.fromWidthOffset+1-1),-9999==this._playerRef._fhoHold&&(this._playerRef._fhoHold=this.fromHeightOffset+1-1),this.fromHeightOffset=this._playerRef.attackTwoHeightOffset+1-1,this.fromWidthOffset=this._playerRef.attackTwoWidthOffset+1-1);e.c&&this._playerRef._dashTime<=this._playerRef.totalDashTime&&-1!=this.currentAnimation.indexOf("dash")&&(-7777==this._playerRef._originalWalkSpeed&&(this._playerRef._originalWalkSpeed=this._playerRef._walkSpeed+
1-1),this._playerRef._walkSpeed=this._playerRef.dashSpeed+1-1,this._playerRef._dashTime+=33.3);if(this._playerRef._dashTime>this._playerRef.totalDashTime&&-1!=this.currentAnimation.indexOf("dash")||!e.c&&-1!=this.currentAnimation.indexOf("dash"))e.c||(this._playerRef._dashTime=0),this._playerRef._walkSpeed=this._playerRef._originalWalkSpeed,this.currentAnimation=this.currentAnimation.replace("dash","");-1==this.currentAnimation.indexOf("dash")&&0<this._playerRef._dashTime&&(e.c||(this._playerRef._dashTime=
0),-7777==this._playerRef._originalWalkSpeed&&(this._playerRef._originalWalkSpeed=this._playerRef._walkSpeed+1-1),this._playerRef._walkSpeed=this._playerRef._originalWalkSpeed+1-1);this._playerRef.ladderValue&&(this._playerRef.getValuesOfCloseTiles(),f=this._playerRef,d||b||c||!f.valuesMatch(f.tileDown,f.ladderValue)||f.valuesMatch(f.tileUp,f.ladderValue)||(this._playerRef._veloc.y=0,this._playerRef._grounded=1,this._playerRef._state=1),e.up&&(f.valuesMatch(f.tileUp,f.ladderValue)||f.valuesMatch(f.tile,
f.ladderValue)||f.valuesMatch(f.tileDown,f.ladderValue))?(this._playerRef._veloc.y=0,--this._playerRef._pos.y,--this._playerRef.y,this._playerRef.onLadder=1,this.animationSpecs.climb&&(this.currentAnimation="climb")):e.down&&f.valuesMatch(f.tileDown,f.ladderValue)?(this._playerRef._veloc.y=0,this._playerRef._pos.y+=1,this._playerRef.y+=1,this._playerRef.onLadder=1,this.animationSpecs.climb&&(this.currentAnimation="climb")):this._playerRef.onLadder=0)};tabageos.WeaponHoldingAttacker=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p,q){tabageos.TravelerSkeleton.call(this,b,c,d,e);this.width=d||0;this.height=e||0;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(b,c);this._veloc=new tabageos.MoverPoint(0,0);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=new tabageos.MoverPoint(b,c);this._deltaTime=k||tabageos.TimeKeeper._sae;this._map=h?f:tabageos.BlitMath.cloneMultiArray(f);this._rect=new tabageos.Rectangle(this.x,this.y,this.width,this.height);
this._state=1;this.forceApplier=new tabageos.MoverPoint;this.forceHolder=new tabageos.MoverPoint;if(this._canvasAnimation=g||null)this._canvasAnimation.addedAnimationChanges=this._addedToChangeDirectionAnimation,this._canvasAnimation._playerRef=this;this._w=d||0;this._h=e||0;this.wanderOffset=new tabageos.MoverPoint(0,0);this.blankMO=new tabageos.MoverPoint;this._eventDispatcher=new tabageos.EventDispatcher;this.x=b||0;this.y=c||0;this._checkHelper=new tabageos.MoverPoint;this._jumps=1;this._jumpSpeed=
4;this._jsp=1;this._walkSpeed=4;this._gravityLevel=.285;this.health=100;this._grounded=this._npRight=this._pRight=this._npLeft=this._pLeft=0;this._unGrounded=1;this._atCeiling=0;this._unCeiling=1;this._wallObject=null;this.boundingMethod=tabageos.BoundMethods.bounceOff;this.path=[];this._mapRows=m||f.length;this._mapColumns=p||f[0].length;this._tw=l||this.width;this._th=n||this.height;this.destination=new tabageos.MoverPoint;this._mt=q||0;this._mt=this._map&&this._map[0]&&this._map[0][1]&&("array"==
typeof this._map[0][1]||"object"==typeof this._map[0][1])?1:0}a.prototype.constructor=a;a.prototype=Object.create(tabageos.TravelerSkeleton.prototype);a.prototype._mapRows=0;a.prototype._mapColumns=0;a.prototype.stand=1;a.prototype.walk=2;a.prototype.up=3;a.prototype._canvasAnimation=null;a.prototype._directCanvasObject=null;a.prototype.down=4;a.prototype._deltaTime=.666666667;a.prototype._state=1;a.prototype._checkHelper;a.prototype._jumps=1;a.prototype.forceGrounded=0;a.prototype._jumpSpeed=4;a.prototype._jsp=
1;a.prototype._walkSpeed=4;a.prototype._gravityLevel=.285;a.prototype._pLeft=0;a.prototype._npLeft=0;a.prototype._pRight=0;a.prototype._npRight=0;a.prototype._grounded=0;a.prototype._unGrounded=1;a.prototype.health=100;a.prototype._atCeiling=0;a.prototype._unCeiling=1;a.prototype._map=null;a.prototype._tw=16;a.prototype._th=16;a.prototype._wallObject=null;a.prototype.boundingMethod=null;a.prototype.destination=null;a.prototype._mt=1;a.prototype._autoAnimate=0;a.prototype._inDoubleJump=0;a.prototype._onWall=
0;a.prototype._autoAnimationThrottle=.5;a.prototype._leftRightFace=0;a.prototype.move=function(b,c,d,e,f,g,h){1==this._state?(this._veloc.x=0,this._veloc.y=0,!this._grounded||this._atCeiling?this._state=3:b&&!c||c&&!b?this._state=2:d&&!this._atCeiling?(this._jsp=this._jumpSpeed-2,this._veloc.y=this._jumps?-(this._jumpSpeed-(this._jumpSpeed-2)):-this._jumpSpeed,this._state=3):d||this._jumps||!e||(this._veloc.y=this._walkSpeed,this._state=4),this.update(0,f,g)):2==this._state?(b||c?c?this._pRight?this._veloc.x=
0:h||(this._veloc.x=this._walkSpeed):b&&(this._pLeft?this._veloc.x=0:h||(this._veloc.x=-this._walkSpeed)):(this._state=1,this._veloc.x=0,this._veloc.y=0),d&&!this._atCeiling?(this._jsp=this._jumpSpeed-2,this._veloc.y=this._jumps?-(this._jumpSpeed-(this._jumpSpeed-2)):-this._jumpSpeed,this._state=3):d&&this._atCeiling?this._jumps&&!this._grounded&&(this._state=3,this._veloc.y=this._walkSpeed):d||this._grounded||(this._state=3),this.update(0,f,g)):3==this._state?(this._jumps?(d&&!this._atCeiling&&this._veloc.y>
-this._jumpSpeed&&0!=this._jsp?(--this._jsp,this._veloc.y=-(this._jumpSpeed-this._jsp)):this._jsp=0,0!=this._jsp||d||0!==this._inDoubleJump||(this._inDoubleJump=1),this._veloc.y+=this._gravityLevel*this._deltaTime,this._veloc.y>this._jumpSpeed&&(this._veloc.y=this._jumpSpeed+1-1),!d&&0<this._veloc.y&&(this._veloc.y=this._veloc.y>this._jumpSpeed?this._jumpSpeed+1-1:this._veloc.y),1===this._inDoubleJump&&d&&!this._atCeiling&&(--this._jsp,this._veloc.y=-(this._jumpSpeed-this._jsp),this._inDoubleJump=
2)):(this._veloc.y=d&&!this._atCeiling?-this._walkSpeed:0,d)||(b||c||e?!b&&!c||e?e&&(this._state=4,this._veloc.y=this._walkSpeed):(this._state=2,this._veloc.y=0):(this._state=1,this._veloc.x=0,this._veloc.y=0)),c||b?c?this._pRight?(this._veloc.x=0,this._grounded||(this._veloc.y=this._jumpSpeed/4,this._onWall=1)):(!this._grounded&&1==this._onWall&&d&&this._jumps&&(--this._jsp,this._veloc.y=-(this._jumpSpeed-this._jsp),this._onWall=0),this._veloc.x=this._walkSpeed):b&&(this._pLeft?(this._veloc.x=0,
this._grounded||(this._veloc.y=this._jumpSpeed/4,this._onWall=1)):(!this._grounded&&1==this._onWall&&d&&this._jumps&&this._pRight&&(--this._jsp,this._veloc.y=-(this._jumpSpeed-this._jsp),this._onWall=0),this._veloc.x=-this._walkSpeed)):this._veloc.x=0,this._grounded?(c||b?this._state=2:(this._state=1,this._veloc.x=0),this._inDoubleJump=this._veloc.y=0):!this._jumps&&e&&(this._veloc.y=this._walkSpeed,this._state=4),this.update(0,f,g)):this._jumps||4!=this._state||(this._veloc.y=e&&!this._grounded?
this._walkSpeed:0,e||(b||c?this._state=2:(this._state=1,this._veloc.x=0),this._veloc.y=0),c||b?c?this._veloc.x=this._pRight?0:this._walkSpeed:b&&(this._veloc.x=this._pLeft?0:-this._walkSpeed):this._veloc.x=0,this._atCeiling&&(c||b?this._state=2:(this._state=1,this._veloc.x=0),this._veloc.y=0),this.update(0,f,g))};a.prototype._addedToChangeDirectionAnimation=function(b,c,d,e,f,g){1===this._playerRef._onWall&&(this._playerRef._pLeft?this.currentAnimation="onwallleft":this._playerRef._pRight&&(this.currentAnimation=
"onwallright"));2===this._playerRef._inDoubleJump&&0>this._playerRef._veloc.y&&(this.currentAnimation="flip"+this.getDirectionOfAnimation(this.currentAnimation,1))};a.prototype.update=function(b,c,d){this._lastPos.x<this._pos.x&&(this._leftRightFace=1);this._lastPos.x>this._pos.x&&(this._leftRightFace=0);this._lastPos.x=this._pos.x+1-1;this._lastPos.y=this._pos.y+1-1;this._lastVeloc.x=this._veloc.x+1-1;this._lastVeloc.y=this._veloc.y+1-1;this._unGrounded=this._grounded+1-1;this._npRight=this._pRight+
1-1;this._npLeft=this._pLeft+1-1;this._unCeiling=this._atCeiling+1-1;c||(this.forceApplier.truncate(this.maxForce),this.forceApplier.divide(this.mass,0),this._veloc.add(this.forceApplier.multiply(this._deltaTime,0),0),this.forceApplier.reset(),this._veloc._length=0,this._veloc._angle=0,this._veloc.truncate(this.maxSpeed));this._pos.addBy(this._veloc.x*this._deltaTime,this._veloc.y*this._deltaTime,0);d||(c=this.isLeftPushingOnMap(this._lastPos,this._pos,this._veloc,this._map,this._tw,this._th),0<c?
(this._pLeft=1,this._pos.x=c,this._veloc.x=0):this._pLeft=0,c=this.isRightPushingOnMap(this._lastPos,this._pos,this._veloc,this._map,this._tw,this._th),0<c?(this._pRight=1,this._pos.x=c-this.width,this._veloc.x=0):this._pRight=0,c=this.isGroundedOnMap(this._lastPos,this._pos,this._veloc,this._map,this._tw,this._th),0<c?(this._grounded=1,this._pos.y=c-this.height,this._veloc.y=0):(this._grounded=0,this.forceGrounded&&this._jumps&&(this._state=3,this._veloc.y=this._walkSpeed)),c=this.isHeadHitOnMap(this._lastPos,
this._pos,this._veloc,this._map,this._tw,this._th),0<c?(this._atCeiling=1,this._pos.y<c&&(this._pos.y=c),0>this._veloc.y&&(this._veloc.y=this._jumps&&!this._grounded?this._walkSpeed:0)):this._atCeiling=0,this._wallObject&&this.boundingMethod(this,this._wallObject));b||(this.x=Math.round(this._pos.x+1-1),this.y=Math.round(this._pos.y+1-1));this._autoAnimate&&this._canvasAnimation?(this._canvasAnimation.x=this.x,this._canvasAnimation.y=this.y,this._canvasAnimation.changeDirectionAnimation(0>this._veloc.x,
0<this._lastVeloc.x,0>this._veloc.y,0<this._veloc.y),this._canvasAnimation.animate(this._autoAnimationThrottle),this._canvasAnimation.blit()):this._autoAnimate&&this._directCanvasObject&&this._directCanvasObject.context.fillRect(this.x,this.y,this.width,this.height)};a.prototype.autoAnimation=function(){this._autoAnimate&&this._canvasAnimation?(this._canvasAnimation.x=this.x,this._canvasAnimation.y=this.y,this._canvasAnimation.changeDirectionAnimation(0>this._veloc.x,0<this._lastVeloc.x,0>this._veloc.y,
0<this._veloc.y),this._canvasAnimation.animate(this._autoAnimationThrottle),this._canvasAnimation.blit()):this._autoAnimate&&this._directCanvasObject&&this._directCanvasObject.context.fillRect(this.x,this.y,this.width,this.height)};a.prototype.isGroundedOnMap=function(b,c,d,e,f,g){b=this._pos.x+1-1;c=this._pos.y+this.height+(1>this._veloc.y?1:this._veloc.y);d=this._pos.x+this.width;e=-999;for(var h;b<d;){tabageos.BlitMath.fasterCheckTileValueAt(b,c,this._mapRows,this._mapColumns,f,g,this._checkHelper);
h=this._checkHelper.y;var k=this._checkHelper.x;k=this._map[h][k];if(0===this._mt&&0!=k||1===this._mt&&(0!=k[0]||0!=k[1]))e=h*g+1-1,e<c||(e=-1);b+=(f>this.width?this.width:f)/4}return e};a.prototype.isHeadHitOnMap=function(b,c,d,e,f,g){b=this._pos.x+1-1;c=this._pos.y-1- -this._veloc.y;d=this._pos.x+this.width;e=-999;for(var h;b<d;){tabageos.BlitMath.fasterCheckTileValueAt(b,c,this._mapRows,this._mapColumns,f,g,this._checkHelper);h=this._checkHelper.y;var k=this._checkHelper.x;k=this._map[h][k];if(0===
this._mt&&0!=k||1===this._mt&&(0!=k[0]||0!=k[1]))e=h*g+g,e>c||(e=-1);b+=f>this.width?this.width:f}return e};a.prototype.isRightPushingOnMap=function(b,c,d,e,f,g){b=this._pos.y+1-1;c=this._pos.y+this.height;d=this._pos.x+this.width+1;e=-999;for(var h;b<c;){tabageos.BlitMath.fasterCheckTileValueAt(d,b,this._mapRows,this._mapColumns,f,g,this._checkHelper);var k=this._checkHelper.y;h=this._checkHelper.x;k=this._map[k][h];if(0===this._mt&&0!=k||1===this._mt&&(0!=k[0]||0!=k[1]))if(e=h*f+1-1,e<d)break;else e=
-1;b+=g>this.height?this.height:g}return e};a.prototype.isLeftPushingOnMap=function(b,c,d,e,f,g){b=this._pos.y+1-1;c=this._pos.y+this.height;d=this._pos.x-1;e=-999;for(var h;b<c;){tabageos.BlitMath.fasterCheckTileValueAt(d,b,this._mapRows,this._mapColumns,f,g,this._checkHelper);var k=this._checkHelper.y;h=this._checkHelper.x;k=this._map[k][h];if(0===this._mt&&0!=k||1===this._mt&&(0!=k[0]||0!=k[1]))if(e=h*f+f,e>d)break;else e=-1;b+=g>this.height?this.height:g}return e};tabageos.BasicNinja=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p){tabageos.TravelerSkeleton.call(this,b,c,d,e);tabageos.MapTraveler.call(this,b,c,d,e,f,g,h,k,l,n,m,p);tabageos.TravelingSceneryThrower.call(this,b,c,d,e,f,g,h,k,l,n,m,p);this.width=d||0;this.height=e||0;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(b,c);this._veloc=new tabageos.MoverPoint(0,0);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=new tabageos.MoverPoint(b,c);this._deltaTime=k||tabageos.TimeKeeper._sae;
this._map=h?f:tabageos.BlitMath.cloneMultiArray(f);this._state=1;this.x=b||0;this.y=c||0;this._rect=new tabageos.Rectangle(this.x,this.y,this.width,this.height);this._canvasAnimation=g||null;this._tH=n||this.height;this._tW=l||this.width;this._outAltered=new tabageos.MoverPoint;this.holdingRect=new tabageos.Rectangle(0,0,d,e);this.holdingOffsetX=1;this.holdingOffsetY=3;this._jumps=1;this.easeProximity=7;this._checkHelper=new tabageos.MoverPoint;this.forceApplier=new tabageos.MoverPoint;this.forceHolder=
new tabageos.MoverPoint;this._w=d||0;this._h=e||0;this.wanderOffset=new tabageos.MoverPoint(0,0);this.blankMO=new tabageos.MoverPoint;this._eventDispatcher=new tabageos.EventDispatcher;this.holdings=[];this._holdingHelperRect=new tabageos.Rectangle(0,0,0,0);this.personalSpace=9*this.width;this._hpt=new tabageos.MoverPoint;this.throwStrength=this._jumpSpeed=10}a.prototype.constructor=a;a.prototype=Object.create(tabageos.TravelerSkeleton.prototype);Object.assign(a.prototype,tabageos.MapTraveler.prototype,
tabageos.TravelingSceneryThrower.prototype);a.prototype.backUp=300;a.prototype.watchingThrow=750;a.prototype.afterAttackDelay=750;a.prototype._hpt=null;a.prototype._target=null;a.prototype.setTarget=function(b){this._target=b};a.prototype.pickUpMethodToUse=0;a.prototype.smarts=function(b,c,d){c=this.x<this._target._pos.x&&1===this._leftRightFace||this.x>this._target._pos.x+(c||16)&&0===this._leftRightFace;if(!b||1>=b)return this.personalSpace=9*this.width,this.throwStrength=10,this.almostCloseTo(this._target._pos)&&
c;if(b&&2==b)return this.personalSpace=4*this.width,this.throwStrength=5,this.almostCloseTo(this._target._pos)&&c;if(b&&3==b)return this.personalSpace=2*this.width,this.throwStrength=3,this.almostCloseTo(this._target._pos)&&c};a.prototype.thinkAboutWhatToDo=function(b,c,d,e,f,g,h,k){c=tabageos.BlitMath.checkTileValueAt(Math.floor(this.x),Math.floor(this.y)+this.height/2,c,f||16,g||16,this._hpt);if(!this.holding&&this.watchingThrow>=this.afterAttackDelay)if(d(c))b=tabageos.TileData.make(this._hpt.x*
(f||16),this._hpt.y*(g||16),c),this.pickUpTileData(b),e&&e(b);else{d=e=0;for(d;d<b.length;d++){var l=b[d];e=l.x+1-1;if(l._grounded&&tabageos.GeometricMath.testForPointInCircle(this._pos,360,l._pos)&&l.y>=this.y-this.height/2){e=l.x+1-1;break}}e?(this.walkOrJump(e>this.x&&!this.pRight?0:e<this.x&&!this.pLeft?1:0,f,g,e,k),this.x>=e-(f?f:16)&&this.x<=e+(f||16)&&Math.abs(l.y-this.y)<=2*(g||16)&&(1==this.pickUpMethodToUse?this.pickUpAndStore(l):this.pickUp(l),b.splice(b.indexOf(l),1))):(this._pRight?this.dX=
this._pLeft?0:1:this._pLeft&&(this.dX=0),this.walkOrJump(this.dX,f,g,0,k))}else this.walkJumpOrAttack(this._target.x<this.x?1:0,f,g,b,h||1,k)};a.prototype.walkOrJump=function(b,c,d,e,f){var g=tabageos.BlitMath.checkTileValueAt(this.x+(0<=this._veloc.x&&(!e||e>this.x)?2*this.width:-this.width),this.y+this.height/2,this._map,c||16,d||16);c=tabageos.BlitMath.checkTileValueAt(this.x+(0<=this._veloc.x&&(!e||e>this.x)?2*this.width:-this.width),this.y-this.height/2,this._map,c||16,d||16);g=f?f(g):0!=g[0]||
0!=g[1];f=f?f(c):0!=c[0]||0!=c[1];!b&&this.pRight&&(b=1);b&&this.pLeft&&(b=0);if((g||!this._grounded||250<this.backUp)&&1E3>this.backUp&&!f)this.jump(),this.backUp+=33.3;else{1E3<=this.backUp&&this.walk(b);if(g||f)this.backUp=300;g&&0<this.backUp?(300!=this.backUp&&(this.backUp=300),this.backUp-=33.3,this.walk(b)):0>=this.backUp?(this.walk(b),this.backUp=300):this.walk(b)}};a.prototype.walkJumpOrAttack=function(b,c,d,e,f,g){if(this.watchingThrow<this.afterAttackDelay)this.watchingThrow+=33.3,this.autoAnimation();
else{var h=tabageos.BlitMath.checkTileValueAt(this.x+(1<=this._veloc.x?2*this.width:-this.width),this.y+this.height/2,this._map,c||16,d||16),k=tabageos.BlitMath.checkTileValueAt(this.x+(1<=this._veloc.x?2*this.width:-this.width),this.y-this.height/2,this._map,c||16,d||16);h=g?g(h):0!=h[0]||0!=h[1];g=g?g(k):0!=k[0]||0!=k[1];!b&&this.pRight&&(b=1);b&&this.pLeft&&(b=0);(h||!this._grounded||300<this.backUp)&&1E3>this.backUp&&!g?(this.jump(),this.backUp+=33.3):(1E3<=this.backUp&&this.walk(b),h&&0<this.backUp?
(300<this.backUp&&(this.backUp=300),this.backUp-=33.3,this.walk(b)):this.smarts(f||1,c||16,d||16)?(b=1==this.pickUpMethodToUse?this.removeLastFromStorage():this.throwSceneryObjectTraveler(c||16,d||16,1),b.xDirection=1===this._leftRightFace?1:0,b._jumpSpeed=this.throwStrength+1-1,b._fromEnemyAi=1,b._walkSpeed=Math.abs(this._veloc.x)>=this._walkSpeed?14:4,b._veloc.y=-(Math.abs(this._veloc.x)<this._walkSpeed?2:3),b._state=3,b._solidSit=0,b._eHit=0,b._grounded=0,e.push(b),this.autoAnimation(),this.watchingThrow=
0):this.walk(b))}};a.prototype.walk=function(b){this.move(b?1:0,b?0:1,0,0)};a.prototype.jump=function(b){this.move(0,0,1,0)};tabageos.AISceneryThrower=a})();
(function(){function a(b,c,d,e,f,g,h,k,l,n,m,p){tabageos.TravelerSkeleton.call(this,b,c,d,e);tabageos.BasicNinja.call(this,b,c,d,e,f,g,h,k,l,n,m,p);this.width=d||0;this.height=e||0;this._middlePoint=new tabageos.MoverPoint;this._pos=new tabageos.MoverPoint(b,c);this._veloc=new tabageos.MoverPoint(0,0);this._lastVeloc=new tabageos.MoverPoint(0,0);this._lastPos=new tabageos.MoverPoint(b,c);this._deltaTime=k||tabageos.TimeKeeper._sae;this._map=h?f:tabageos.BlitMath.cloneMultiArray(f);this._state=1;this.x=
b||0;this.y=c||0;this._rect=new tabageos.Rectangle(this.x,this.y,this.width,this.height);this._canvasAnimation=g||null;this._tH=n||this.height;this._tW=l||this.width;this._outAltered=new tabageos.MoverPoint;this.holdingRect=new tabageos.Rectangle(0,0,d,e);this.holdingOffsetX=1;this.holdingOffsetY=3;this._jumps=1;this.easeProximity=7;this._checkHelper=new tabageos.MoverPoint;this.forceApplier=new tabageos.MoverPoint;this.forceHolder=new tabageos.MoverPoint;this._w=d||0;this._h=e||0;this.wanderOffset=
new tabageos.MoverPoint(0,0);this.blankMO=new tabageos.MoverPoint;this._eventDispatcher=new tabageos.EventDispatcher;this.holdings=[];this._holdingHelperRect=new tabageos.Rectangle(0,0,0,0)}a.prototype.constructor=a;a.prototype=Object.create(tabageos.TravelerSkeleton.prototype);Object.assign(a.prototype,tabageos.BasicNinja.prototype);a.prototype.throwStrength=10;a.prototype.health=100;a.prototype.holding;a.prototype.holdings;a.prototype.holdingRect;a.prototype._holdingHelperRect;a.prototype._canvasAnimation=
null;a.prototype._outAltered;a.prototype.holdingOffsetX=1;a.prototype.holdingOffsetY=3;a.prototype.nameOfThrower="strawHat";a.prototype.alteredPosition=function(b,c){this._outAltered.x=this.x-(b||0);this._outAltered.y=this.y-(c||0);return this._outAltered};a.prototype.holdingImageRect=function(){return this.holdingRect};a.prototype.pickUpTileData=function(b,c,d){return this.holding?!1:(this.holding=b,this.holdingRect.x=this.holding.value[1]*this._tw,this.holdingRect.y=this.holding.value[0]*this._th,
this.holdingRect.width=this._tw,this.holdingRect.height=this._th,c&&(this.holdingRect.width+=c),d&&(this.holdingRect.height+=d),!0)};a.prototype.pickUpAndStoreTileData=function(b,c,d,e){this.holdings.push(b);b=this.holdings.length-1;this.holdingRect.x=this.holdings[b].value[1]*this._tw;this.holdingRect.y=this.holdings[b].value[0]*this._th;this.holdingRect.width=this._tw;this.holdingRect.height=this._th;c&&(this.holdingRect.width+=c);d&&(this.holdingRect.height+=d);e?this.holding=null:this._readyNextThrow();
return!0};a.prototype.removeFromStorageByValue=function(b){var c=0,d=this.holdings.length;for(c;c<d;c++)if(this.holdings[c]&&this.holdings[c].value){if(this.holdings[c].value[0]==b[0]&&this.holdings[c].value[1]==b[1]){this.holdings.splice(c,1);break}}else if(this.holdings[c]&&this.holdings[c].tileValue&&this.holdings[c].tileValue[0]==b[0]&&this.holdings[c].tileValue[1]==b[1]){this.holdings.splice(c,1);break}};a.prototype.removeLastFromStorage=function(){if(this.holdings.length){var b=this.holdings.pop();
b.setX(this.x+1-1);b.setY(this.y+1-1);this.holding=null;return b}return null};a.prototype._tempDivs=[];a.prototype._displayStorageClearRect;a.prototype.displayStorage=function(b,c,d,e,f,g,h,k,l,n){var m=0,p=this.holdings.length;this._displayStorageClearRect||(this._displayStorageClearRect=new tabageos.Rectangle(d.x+g+4,d.y+h+4,g,h));var q=k+1-1;l=l+1-1;c.copyPixels(b,d,new tabageos.MoverPoint(e,f),d.width,d.height);for(m;m<p;m++){e=this.holdings[m].value?this.holdings[m].value:this.holdings[m].tileValue;
c.copyPixels(b,new tabageos.Rectangle(e[1]*g,e[0]*h,g,h),new tabageos.MoverPoint(q,l),g,h);this._tempDivs[m]||(this._tempDivs[m]=document.createElement("div"));this._tempDivs[m].sceneryThrower=this;this._tempDivs[m].cDisplay=c;this._tempDivs[m]._img=b;this._tempDivs[m]._dscr=this._displayStorageClearRect;f="";if(n&&1<=n.length)for(d=0;d<n.length;d++)n[d][0]==e[0]&&n[d][1]==e[1]&&(f=n[d][2]);this._tempDivs[m].setAttribute("title",f);this._tempDivs[m].setAttribute("id",e[0]+"v"+e[1]);this._tempDivs[m].setAttribute("style",
"position:absolute;width:"+g+"px;height:"+h+"px;top:"+l+"px;left:"+q+"px;cursor:pointer;z-index:99999999999999999999999999999999999999999999999999999999999999999");this._tempDivs[m].removeEventListener(tabageos.seekTouch()?"touchstart":"click",this.removeFromDisplayedStorage,!1);this._tempDivs[m].addEventListener(tabageos.seekTouch()?"touchstart":"click",this.removeFromDisplayedStorage,!1);c.canvas.offsetParent.appendChild(this._tempDivs[m]);q+=2*g;q>=14*g&&(q=k+1-1,l+=2*h)}};a.prototype._removedFromStorage=
[];a.prototype.removeFromDisplayedStorage=function(b){function c(e){return Number(e.replace("px",""))}b=b.target;var d=b.id.split("v");d[0]=Number(d[0]);d[1]=Number(d[1]);b.sceneryThrower.removeFromStorageByValue(d);b.sceneryThrower._removedFromStorage.push(d);b.cDisplay.copyPixels(b._img,b._dscr,new tabageos.MoverPoint(c(b.style.left),c(b.style.top)),c(b.style.width),c(b.style.height));b.removeEventListener(tabageos.seekTouch()?"touchstart":"click",b.sceneryThrower.removeFromDisplayedStorage,!1);
b.offsetParent.removeChild(b)};a.prototype.pickUpAndStore=function(b,c,d,e){this.holdings.push(b);var f=this.holdings.length-1;this.holdingRect.x=this.holdings[f].tileValue[1]*b.width;this.holdingRect.y=this.holdings[f].tileValue[0]*b.height;this.holdingRect.width=b.width;this.holdingRect.height=b.height;c&&(this.holdingRect.width+=c);d&&(this.holdingRect.height+=d);e?this.holding=null:this._readyNextThrow();return!0};a.prototype.pickUp=function(b,c,d){return this.holding?!1:(this.holding=b,this.holdingRect.x=
b.tileValue[1]*b.width,this.holdingRect.y=b.tileValue[0]*b.height,this.holdingRect.width=b.width,this.holdingRect.height=b.height,c&&(this.holdingRect.width+=c),d&&(this.holdingRect.height+=d),!0)};a.prototype._throwHolding=function(){-1!=this.holdings.indexOf(this.holding)&&this.holdings.splice(this.holdings.indexOf(this.holding),1);this.holding=null};a.prototype._readyNextThrow=function(){this.holdings.length&&(this.holding=this.holdings[this.holdings.length-1],this.holding.tileValue?(this.holdingRect.x=
this.holding.tileValue[1]*this.holding.width,this.holdingRect.y=this.holding.tileValue[0]*this.holding.height,this.holdingRect.width=this.holding.width,this.holdingRect.height=this.holding.height):(this.holdingRect.x=this.holding.value[1]*this._tW,this.holdingRect.y=this.holding.value[0]*this._tH,this.holdingRect.width=this._tW,this.holdingRect.height=this._tH))};a.prototype.valueFromHolding=function(b){return b.value||b.tileValue};a.prototype.rectFromHolding=function(b){b.tileValue?(this._holdingHelperRect.x=
b.tileValue[1]*b.width,this._holdingHelperRect.y=b.tileValue[0]*b.height,this._holdingHelperRect.width=b.width,this._holdingHelperRect.height=b.height):(this._holdingHelperRect.x=b.value[1]*this._tW,this._holdingHelperRect.y=b.value[0]*this._tH,this._holdingHelperRect.width=this._tW,this._holdingHelperRect.height=this._tH);return this._holdingHelperRect};a.prototype.throwSceneryObject=function(b,c,d){null==this.holding&&this.holdings.length&&this._readyNextThrow();return this.holding?(b=new tabageos.SceneryObject(this.x+
1-1,this.y+1-1,b||this._tw,c||this._th,this._map,null,1,this._deltaTime,this._tw,this._th,this._mapRows,this._mapColumns),b._jumps=0==d?0:1,b.playerHoldingThis=this,b.tileValue=this.holding.value||this.holding.tileValue,b.tileRect=new tabageos.Rectangle(this.holdingRect.x,this.holdingRect.y,this.holdingRect.width,this.holdingRect.height),this._throwHolding(),b):null};a.prototype.throwSceneryObjectTraveler=function(b,c,d){null==this.holding&&this.holdings.length&&this._readyNextThrow();return this.holding?
(b=new tabageos.SceneryObjectTraveler(this.x+1-1,this.y+1-1,b||this._tw,c||this._th,this._map,null,1,this._deltaTime,this._tw,this._th,this._mapRows,this._mapColumns),b._jumps=0==d?0:1,b.playerHoldingThis=this,b.tileValue=this.holding.value||this.holding.tileValue,b.tileRect=new tabageos.Rectangle(this.holdingRect.x,this.holdingRect.y,this.holdingRect.width,this.holdingRect.height),this._throwHolding(),b):null};tabageos.NinjaSceneryThrower=a})();
function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function _defineProperties(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}function _createClass(a,b,c){b&&_defineProperties(a.prototype,b);c&&_defineProperties(a,c);return a}
window.PNG=function(){var a=document.createElement("canvas"),b=a.getContext("2d");return function(){function c(d){_classCallCheck(this,c);var e;this.data=d;this.pos=8;this.palette=[];this.imgData=[];this.transparency={};this.animation=null;this.text={};for(d=null;;){var f=this.readUInt32();var g="";for(e=0;4>e;e++)g+=String.fromCharCode(this.data[this.pos++]);switch(g){case "IHDR":this.width=this.readUInt32();this.height=this.readUInt32();this.bits=this.data[this.pos++];this.colorType=this.data[this.pos++];
this.compressionMethod=this.data[this.pos++];this.filterMethod=this.data[this.pos++];this.interlaceMethod=this.data[this.pos++];break;case "acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||Infinity,frames:[]};break;case "PLTE":this.palette=this.read(f);break;case "fcTL":d&&this.animation.frames.push(d);this.pos+=4;d={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()};e=this.readUInt16();f=this.readUInt16()||100;d.delay=
1E3*e/f;d.disposeOp=this.data[this.pos++];d.blendOp=this.data[this.pos++];d.data=[];break;case "IDAT":case "fdAT":"fdAT"===g&&(this.pos+=4,f-=4);g=d&&d.data||this.imgData;for(e=0;e<f;e++)g.push(this.data[this.pos++]);break;case "tRNS":this.transparency={};switch(this.colorType){case 3:this.transparency.indexed=this.read(f);f=255-this.transparency.indexed.length;if(0<f)for(e=0;e<f;e++)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(f)[0];break;case 2:this.transparency.rgb=
this.read(f)}break;case "tEXt":e=this.read(f);f=e.indexOf(0);g=String.fromCharCode.apply(String,e.slice(0,f));this.text[g]=String.fromCharCode.apply(String,e.slice(f+1));break;case "IEND":d&&this.animation.frames.push(d);switch(this.colorType){case 0:case 3:case 4:this.colors=1;break;case 2:case 6:this.colors=3}this.hasAlphaChannel=-1!=[4,6].indexOf(this.colorType);this.pixelBitlength=this.bits*(this.colors+(this.hasAlphaChannel?1:0));switch(this.colors){case 1:this.colorSpace="DeviceGray";break;
case 3:this.colorSpace="DeviceRGB"}this.imgData=new Uint8Array(this.imgData);return;default:this.pos+=f}this.pos+=4;if(this.pos>this.data.length)throw Error("Incomplete or corrupt PNG file");}}_createClass(c,[{key:"read",value:function(d){for(var e=Array(d),f=0;f<d;f++)e[f]=this.data[this.pos++];return e}},{key:"readUInt32",value:function(){var d=this.data[this.pos++]<<24,e=this.data[this.pos++]<<16,f=this.data[this.pos++]<<8,g=this.data[this.pos++];return d|e|f|g}},{key:"readUInt16",value:function(){var d=
this.data[this.pos++]<<8,e=this.data[this.pos++];return d|e}},{key:"decodePixels",value:function(d){function e(m,p,q,r){for(var t=4<arguments.length&&void 0!==arguments[4]?arguments[4]:!1,v=Math.ceil((f-m)/q),w=Math.ceil((g-p)/r),u=h*v,x=t?k:new Uint8Array(u*w),z=0,B=0;z<w&&n<l;){var y;switch(d[n++]){case 0:for(y=0;y<u;y++)x[B++]=d[n++];break;case 1:for(y=0;y<u;y++){var D=d[n++];var A=y<h?0:x[B-h];x[B++]=(D+A)%256}break;case 2:for(y=0;y<u;y++){D=d[n++];var C=(y-y%h)/h;var E=z&&x[(z-1)*u+C*h+y%h];
x[B++]=(E+D)%256}break;case 3:for(y=0;y<u;y++)D=d[n++],C=(y-y%h)/h,A=y<h?0:x[B-h],E=z&&x[(z-1)*u+C*h+y%h],x[B++]=(D+Math.floor((A+E)/2))%256;break;case 4:for(y=0;y<u;y++){D=d[n++];C=(y-y%h)/h;A=y<h?0:x[B-h];0===z?E=C=0:(E=x[(z-1)*u+C*h+y%h],C=C&&x[(z-1)*u+(C-1)*h+y%h]);var F=A+E-C,G=Math.abs(F-A),H=Math.abs(F-E);F=Math.abs(F-C);A=G<=H&&G<=F?A:H<=F?E:C;x[B++]=(D+A)%256}break;default:throw Error("Invalid filter algorithm: ".concat(d[n-1]));}if(!t)for(D=((p+z*r)*f+m)*h,A=z*u,y=0;y<v;y++){for(E=0;E<h;E++)k[D++]=
x[A++];D+=(q-1)*h}z++}}null==d&&(d=this.imgData);if(0===d.length)return new Uint8Array(0);d=new FlateStream(d);d=d.getBytes();var f=this.width,g=this.height,h=this.pixelBitlength/8,k=new Uint8Array(f*g*h),l=d.length,n=0;1===this.interlaceMethod?(e(0,0,8,8),e(4,0,8,8),e(0,4,4,8),e(2,0,4,4),e(0,2,2,4),e(1,0,2,2),e(0,1,1,2)):e(0,0,1,1,!0);return k}},{key:"decodePalette",value:function(){for(var d=this.palette,e=d.length,f=this.transparency.indexed||[],g=new Uint8Array((f.length||0)+e),h=0,k=0,l=0;l<
e;l+=3){var n;g[h++]=d[l];g[h++]=d[l+1];g[h++]=d[l+2];g[h++]=null!=(n=f[k++])?n:255}return g}},{key:"copyToImageData",value:function(d,e){var f;var g=this.colors;var h=null,k=this.hasAlphaChannel;this.palette.length&&(h=this._decodedPalette||(this._decodedPalette=this.decodePalette()),g=4,k=!0);d=d.data||d;var l=d.length,n=h||e,m=f=0;if(1===g)for(;m<l;)g=h?4*e[m/4]:f,f=n[g++],d[m++]=f,d[m++]=f,d[m++]=f,d[m++]=k?n[g++]:255,f=g;else for(;m<l;)g=h?4*e[m/4]:f,d[m++]=n[g++],d[m++]=n[g++],d[m++]=n[g++],
d[m++]=k?n[g++]:255,f=g}},{key:"decode",value:function(){var d=new Uint8Array(this.width*this.height*4);this.copyToImageData(d,this.decodePixels());return d}},{key:"decodeFrames",value:function(d){if(this.animation)for(var e=0;e<this.animation.frames.length;e++){var f=this.animation.frames[e],g=d.createImageData(f.width,f.height),h=this.decodePixels(new Uint8Array(f.data));this.copyToImageData(g,h);f.imageData=g;b.width=g.width;b.height=g.height;b.clearRect(0,0,g.width,g.height);b.putImageData(g,
0,0);g=new Image;g.src=a.toDataURL();f.image=g}}},{key:"renderFrame",value:function(d,e){var f=this.animation.frames,g=f[e];f=f[e-1];0===e&&d.clearRect(0,0,this.width,this.height);1===(f&&f.disposeOp)?d.clearRect(f.xOffset,f.yOffset,f.width,f.height):2===(f&&f.disposeOp)&&d.putImageData(f.imageData,f.xOffset,f.yOffset);0===g.blendOp&&d.clearRect(g.xOffset,g.yOffset,g.width,g.height);return d.drawImage(g.image,g.xOffset,g.yOffset)}},{key:"animate",value:function(d){var e=this,f=0,g=this.animation,
h=g.numFrames,k=g.frames,l=g.numPlays;(function m(){var p=f++%h,q=k[p];e.renderFrame(d,p);1<h&&f/h<l&&(e.animation._timeout=setTimeout(m,q.delay))})()}},{key:"stopAnimation",value:function(){return clearTimeout(this.animation&&this.animation._timeout)}},{key:"render",value:function(d){d._png&&d._png.stopAnimation();d._png=this;d.width=this.width;d.height=this.height;d=d.getContext("2d");if(this.animation)return this.decodeFrames(d),this.animate(d);var e=d.createImageData(this.width,this.height);this.copyToImageData(e,
this.decodePixels());return d.putImageData(e,0,0)}}],[{key:"load",value:function(d,e,f){"function"===typeof e&&(f=e);var g=new XMLHttpRequest;g.open("GET",d,!0);g.responseType="arraybuffer";g.onload=function(){var h=new Uint8Array(g.response||g.mozResponseArrayBuffer);h=new c(h);"function"===typeof(e&&e.getContext)&&h.render(e);return"function"===typeof f?f(h):void 0};return g.send(null)}}]);return c}()}();
window.DecodeStream=function(){function a(){this.bufferLength=this.pos=0;this.eof=!1;this.buffer=null}a.prototype={ensureBuffer:function(b){var c=this.buffer,d=c?c.byteLength:0;if(b<d)return c;for(var e=512;e<b;)e<<=1;b=new Uint8Array(e);for(e=0;e<d;++e)b[e]=c[e];return this.buffer=b},getByte:function(){for(var b=this.pos;this.bufferLength<=b;){if(this.eof)return null;this.readBlock()}return this.buffer[this.pos++]},getBytes:function(b){var c=this.pos;if(b){this.ensureBuffer(c+b);for(b=c+b;!this.eof&&
this.bufferLength<b;)this.readBlock();var d=this.bufferLength;b>d&&(b=d)}else{for(;!this.eof;)this.readBlock();b=this.bufferLength}this.pos=b;return this.buffer.subarray(c,b)},lookChar:function(){for(var b=this.pos;this.bufferLength<=b;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var b=this.pos;this.bufferLength<=b;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(b,
c,d){for(var e=b+c;this.bufferLength<=e&&!this.eof;)this.readBlock();return new Stream(this.buffer,b,c,d)},skip:function(b){b||(b=1);this.pos+=b},reset:function(){this.pos=0}};return a}();
window.FlateStream=function(){function a(h){throw Error(h);}function b(h){var k=0,l=h[k++],n=h[k++];-1!=l&&-1!=n||a("Invalid header in flate stream");8!=(l&15)&&a("Unknown compression method in flate stream");0!=((l<<8)+n)%31&&a("Bad FCHECK in flate stream");n&32&&a("FDICT bit set in flate stream");this.bytes=h;this.bytesPos=k;this.codeBuf=this.codeSize=0;DecodeStream.call(this)}var c=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,
65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),e=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),f=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,
459028,524408,524344,590032,459020,524392,524328,59E4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,
524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,
459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,
524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,
459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,
524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,
459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],g=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,
327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];b.prototype=Object.create(DecodeStream.prototype);b.prototype.getBits=function(h){for(var k=this.codeSize,l=this.codeBuf,n=this.bytes,m=this.bytesPos,p;k<h;)"undefined"==typeof(p=n[m++])&&a("Bad encoding in flate stream"),l|=p<<k,k+=8;this.codeBuf=l>>h;this.codeSize=k-h;this.bytesPos=m;return l&(1<<h)-1};b.prototype.getCode=function(h){var k=
h[0],l=h[1];h=this.codeSize;for(var n=this.codeBuf,m=this.bytes,p=this.bytesPos;h<l;){var q;"undefined"==typeof(q=m[p++])&&a("Bad encoding in flate stream");n|=q<<h;h+=8}l=k[n&(1<<l)-1];k=l>>16;l&=65535;(0==h||h<k||0==k)&&a("Bad encoding in flate stream");this.codeBuf=n>>k;this.codeSize=h-k;this.bytesPos=p;return l};b.prototype.generateHuffmanTable=function(h){for(var k=h.length,l=0,n=0;n<k;++n)h[n]>l&&(l=h[n]);for(var m=1<<l,p=new Uint32Array(m),q=1,r=0,t=2;q<=l;++q,r<<=1,t<<=1)for(var v=0;v<k;++v)if(h[v]==
q){var w=0,u=r;for(n=0;n<q;++n)w=w<<1|u&1,u>>=1;for(n=w;n<m;n+=t)p[n]=q<<16|v;++r}return[p,l]};b.prototype.readBlock=function(){function h(w,u,x,z,B){for(w=w.getBits(x)+z;0<w--;)u[r++]=B}var k=this.getBits(3);k&1&&(this.eof=!0);k>>=1;if(0==k){var l=this.bytes,n=this.bytesPos,m;"undefined"==typeof(m=l[n++])&&a("Bad block header in flate stream");var p=m;"undefined"==typeof(m=l[n++])&&a("Bad block header in flate stream");p|=m<<8;"undefined"==typeof(m=l[n++])&&a("Bad block header in flate stream");
k=m;"undefined"==typeof(m=l[n++])&&a("Bad block header in flate stream");(k|m<<8)!=(~p&65535)&&a("Bad uncompressed block length in flate stream");this.codeSize=this.codeBuf=0;m=this.bufferLength;k=this.ensureBuffer(m+p);this.bufferLength=p=m+p;for(var q=m;q<p;++q){if("undefined"==typeof(m=l[n++])){this.eof=!0;break}k[q]=m}this.bytesPos=n}else{if(1==k)n=f,m=g;else if(2==k){k=this.getBits(5)+257;m=this.getBits(5)+1;l=this.getBits(4)+4;n=Array(c.length);for(var r=0;r<l;)n[c[r++]]=this.getBits(3);n=this.generateHuffmanTable(n);
r=l=0;m=k+m;for(p=Array(m);r<m;)q=this.getCode(n),16==q?h(this,p,2,3,l):17==q?h(this,p,3,3,l=0):18==q?h(this,p,7,11,l=0):p[r++]=l=q;n=this.generateHuffmanTable(p.slice(0,k));m=this.generateHuffmanTable(p.slice(k,m))}else a("Unknown block type in flate stream");p=(k=this.buffer)?k.length:0;for(q=this.bufferLength;;){var t=this.getCode(n);if(256>t)q+1>=p&&(k=this.ensureBuffer(q+1),p=k.length),k[q++]=t;else{if(256==t){this.bufferLength=q;break}t-=257;t=d[t];var v=t>>16;0<v&&(v=this.getBits(v));l=(t&
65535)+v;t=this.getCode(m);t=e[t];v=t>>16;0<v&&(v=this.getBits(v));t=(t&65535)+v;q+l>=p&&(k=this.ensureBuffer(q+l),p=k.length);for(v=0;v<l;++v,++q)k[q]=k[q-t]}}}};return b}();window.console.log("tabageos version 1.3790");
