diff --git a/dist/frozen.js b/dist/frozen.js index 8dbdfb9..bbbbbd1 100644 --- a/dist/frozen.js +++ b/dist/frozen.js @@ -8,195 +8,196 @@ Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. Available under MIT license */ -(function(c,f){var h,a,k,n=function(){},g=function(a){for(var b in a)return 0;return 1},b={}.toString,d=function(a){return"[object Function]"==b.call(a)},m=function(a){return"[object String]"==b.call(a)},e=function(a){return"[object Array]"==b.call(a)},i=function(a,b){if(a)for(var d=0;d")]),!a.def||b?H:a.cjs&& a.cjs.exports;if(!a.executed){if(!a.def)return H;var e=a.mid,i=a.deps||[],g,c=[],h=0;for(a.executed=4;hb||"undefined"==typeof a)return 1;if(ad?0:d);++ed?$(0,i+d):d)||0;i&&"number"==typeof i?g=-1<(da(a)?a.indexOf(b,d):c(a,b,d)):E(a,function(a){if(++e>=d)return!(g=a===b)});return g}function xa(a,b,d){var e=!0,b=j.createCallback(b,d),d=-1,c=a?a.length:0;if("number"==typeof c)for(;++dc&&(c=g)}else b=!b&&da(a)?k:j.createCallback(b,d),w(a,function(a,d,i){d=b(a,d,i);d>e&&(e=d,c=a)});return c}function ma(a,b){var d=-1,e=a?a.length:0;if("number"==typeof e)for(var c=K(e);++darguments.length,b=j.createCallback(b,e,4),i=-1,g=a.length;if("number"==typeof g)for(c&&(d=a[++i]);++iarguments.length;if("number"!=typeof c)var g=S(a),c=g.length;b=j.createCallback(b,e,4);w(a,function(e,h,f){h=g?g[--c]:--c;d=i?(i=!1,a[h]):b(d,a[h],h,f)});return d}function Xa(a,b,d){var e,b=j.createCallback(b,d),d=-1,c=a?a.length:0;if("number"==typeof c)for(;++d=s&&d===f;if(l){var m=g(c);m?(d=h,c=m):l=!1}for(;++bd(c,m)&&k.push(m);l&&i(c);return k}function sa(a,b,d){if(a){var e=0,c=a.length;if("number"!=typeof b&&null!=b)for(var i=-1,b=j.createCallback(b,d);++id?$(0,e+d):d||0;else if(d)return d=Ta(a,b),a[d]===b?d:-1;return a?f(a,b,d):-1}function Ka(a,b,d){if("number"!=typeof b&&null!=b)for(var e=0,c=-1,i=a?a.length:0,b=j.createCallback(b,d);++c>>1,d(a[e])d?0:d);++bk&&(h=a.apply(f,g));else{var d=new Sa;!j&&!q&&(l=d);var e=m-(d-l);0>=e?(db(j),j=null,l=d,h=a.apply(f,g)):j||(j=eb(i,e))}b!==m&&(n=eb(c,b));return h}}function ub(a){var b=I.call(arguments,1);return eb(function(){a.apply(x,b)},1)}function ib(a){return a}function vb(a){w(Q(a),function(b){var d=j[b]=a[b];j.prototype[b]=function(){var a=this.__wrapped__,b=[a];fb.apply(b,arguments);b=d.apply(j, -b);return a&&"object"==typeof a&&a===b?this:new o(b)}})}function wb(){return this.__wrapped__}var a=a?O.defaults(c.Object(),a,O.pick(c,ha)):c,K=a.Array,jb=a.Boolean,Sa=a.Date,kb=a.Function,W=a.Math,Gb=a.Number,La=a.Object,mb=a.RegExp,ca=a.String,Hb=a.TypeError,M=[],pb=La.prototype,Jb=a._,Fa=mb("^"+ca(pb.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Kb=W.ceil,db=a.clearTimeout,Ea=M.concat,Eb=W.floor,Lb=kb.prototype.toString,Na=Fa.test(Na=La.getPrototypeOf)&& -Na,J=pb.hasOwnProperty,fb=M.push,gb=a.setImmediate,eb=a.setTimeout,N=pb.toString,na=Fa.test(na=N.bind)&&na,bb=Fa.test(bb=La.create)&&bb,qb=Fa.test(qb=K.isArray)&&qb,Mb=a.isFinite,Nb=a.isNaN,hb=Fa.test(hb=La.keys)&&hb,$=W.max,cb=W.min,rb=a.parseInt,Fb=W.random,I=M.slice,W=Fa.test(a.attachEvent),W=na&&!/\n|true/.test(na+W),ea={};ea[oa]=K;ea[ba]=jb;ea[ia]=Sa;ea[Ia]=kb;ea[L]=La;ea[P]=Gb;ea[fa]=mb;ea[T]=ca;o.prototype=j.prototype;var Db=j.support={};Db.fastBind=na&&!W;j.templateSettings={escape:/<%-([\s\S]+?)%>/g, -evaluate:/<%([\s\S]+?)%>/g,interpolate:Pa,variable:"",imports:{_:j}};var R=qb,S=!hb?function(a){var b,d=[];if(!a||!B[typeof a])return d;for(b in a)J.call(a,b)&&d.push(b);return d}:function(a){return!H(a)?[]:hb(a)},Cb={"&":"&","<":"<",">":">",'"':""","'":"'"},Ib=Ua(Cb),nb=function(a,b,d){var e,c=a,i=c;if(!c)return i;var g=arguments,h=0,f="number"==typeof d?2:g.length;if(3=s&&l===f,o=c||n?d():j;if(n){var q=g(o);q?(l=h,o=q):(n=!1,o=c?o:(e(o),j))}for(;++kl(o,p))(c||n)&&o.push(p),j.push(q)}n?(e(o.array),i(o)):c&&e(o);return j});W&&ka&&"function"==typeof gb&&(ub=Da(gb,a));gb=8==rb(va+"08")?rb:function(a,b){return rb(da(a)?a.replace(Qa,""):a,b||0)};j.after=function(a,b){return 1>a?b():function(){if(1>--a)return b.apply(this,arguments)}};j.assign=nb;j.at=function(a){for(var b= --1,d=Ea.apply(M,I.call(arguments,1)),e=d.length,c=K(e);++b=s&&g(k?b[k]:q)}a:for(;++m(t?h(t,p):j(q,p))){k=c;for((t||q).push(p);--k;)if(t=l[k],0>(t?h(t,p):j(b[k],p)))continue a;o.push(p)}}for(;c--;)(t=l[c])&&i(t);e(l);e(q);return o}; -j.invert=Ua;j.invoke=function(a,b){var d=I.call(arguments,2),e=-1,c="function"==typeof b,i=a?a.length:0,g=K("number"==typeof i?i:0);w(a,function(a){g[++e]=(c?b:a[b]).apply(a,d)});return g};j.keys=S;j.map=ya;j.max=Ma;j.memoize=function(a,b){function d(){var e=d.cache,c=Ga+(b?b.apply(this,arguments):arguments[0]);return J.call(e,c)?e[c]:e[c]=a.apply(this,arguments)}d.cache={};return d};j.merge=Va;j.min=function(a,b,d){var e=Infinity,c=e;if(!b&&R(a))for(var d=-1,i=a.length;++de(g,d))i[d]=a});return i};j.once=function(a){var b,d;return function(){if(b)return d;b=!0;d=a.apply(this,arguments);a=null;return d}};j.pairs=function(a){for(var b=-1,d=S(a),e=d.length,c=K(e);++bd?$(0,e+d):cb(d,e-1))+1);e--;)if(a[e]===b)return e;return-1};j.mixin=vb;j.noConflict=function(){a._=Jb;return this};j.parseInt= -gb;j.random=function(a,b){null==a&&null==b&&(b=1);a=+a||0;null==b?(b=a,a=0):b=+b||0;var d=Fb();return a%1||b%1?a+cb(d*(b-a+parseFloat("1e-"+((d+"").length-1))),b):a+Eb(d*(b-a+1))};j.reduce=ra;j.reduceRight=Ba;j.result=function(a,b){var d=a?a[b]:x;return Z(d)?a[b]():d};j.runInContext=q;j.size=function(a){var b=a?a.length:0;return"number"==typeof b?b:S(a).length};j.some=Xa;j.sortedIndex=Ta;j.template=function(a,d,e){var c=j.templateSettings;a||(a="");var e=sb({},e,c),i=sb({},e.imports,c.imports),c= -S(i),i=qa(i),g,h=0,f=e.interpolate||aa,k="__p += '",f=mb((e.escape||aa).source+"|"+f.source+"|"+(f===Pa?ua:aa).source+"|"+(e.evaluate||aa).source+"|$","g");a.replace(f,function(d,e,c,i,f,l){c||(c=i);k+=a.slice(h,l).replace(Ha,b);e&&(k+="' +\n__e("+e+") +\n'");f&&(g=!0,k+="';\n"+f+";\n__p += '");c&&(k+="' +\n((__t = ("+c+")) == null ? '' : __t) +\n'");h=l+d.length;return d});var k=k+"';\n",l=f=e.variable;l||(f="obj",k="with ("+f+") {\n"+k+"\n}\n");k=(g?k.replace(u,""):k).replace(F,"$1").replace(C, -"$1;");k="function("+f+") {\n"+(l?"":f+" || ("+f+" = {});\n")+"var __t, __p = '', __e = _.escape"+(g?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+k+"return __p\n}";e="\n/*\n//@ sourceURL="+(e.sourceURL||"/lodash/template/source["+wa++ +"]")+"\n*/";try{var m=kb(c,"return "+k+e).apply(x,i)}catch(n){throw n.source=k,n;}if(d)return m(d);m.source=k;return m};j.unescape=function(a){return null==a?"":ca(a).replace(v,ja)};j.uniqueId=function(a){var b=++t;return ca(null== -a?"":a)+b};j.all=xa;j.any=Xa;j.detect=pa;j.findWhere=pa;j.foldl=ra;j.foldr=Ba;j.include=Wa;j.inject=ra;E(j,function(a,b){j.prototype[b]||(j.prototype[b]=function(){var b=[this.__wrapped__];fb.apply(b,arguments);return a.apply(j,b)})});j.first=sa;j.last=function(a,b,d){if(a){var e=0,c=a.length;if("number"!=typeof b&&null!=b)for(var i=c,b=j.createCallback(b,d);i--&&b(a[i],i,a);)e++;else if(e=b,null==e||d)return a[c-1];return l(a,$(0,c-e))}};j.take=sa;j.head=sa;E(j,function(a,b){j.prototype[b]||(j.prototype[b]= -function(b,d){var e=a(this.__wrapped__,b,d);return null==b||d&&"function"!=typeof b?e:new o(e)})});j.VERSION="1.3.1";j.prototype.toString=function(){return ca(this.__wrapped__)};j.prototype.value=wb;j.prototype.valueOf=wb;w(["join","pop","shift"],function(a){var b=M[a];j.prototype[a]=function(){return b.apply(this.__wrapped__,arguments)}});w(["push","reverse","sort","unshift"],function(a){var b=M[a];j.prototype[a]=function(){b.apply(this.__wrapped__,arguments);return this}});w(["concat","slice","splice"], -function(a){var b=M[a];j.prototype[a]=function(){return new o(b.apply(this.__wrapped__,arguments))}});return j}var x,A=[],o=[],t=0,p={},Ga=+new Date+"",s=75,r=40,u=/\b__p \+= '';/g,F=/\b(__p \+=) '' \+/g,C=/(__e\(.*?\)|\b__t\)) \+\n'';/g,v=/&(?:amp|lt|gt|quot|#39);/g,ua=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Oa=/\w*$/,Pa=/<%=([\s\S]+?)%>/g,ga=(ga=/\bthis\b/)&&ga.test(q)&&ga,va=" \t\u000b\u000c\u00a0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", -Qa=RegExp("^["+va+"]*0+(?=.$)"),aa=/($^)/,G=/[&<>"']/g,Ha=/['\n\r\t\u2028\u2029\\]/g,ha="Array,Boolean,Date,Function,Math,Number,Object,RegExp,String,_,attachEvent,clearTimeout,isFinite,isNaN,parseInt,setImmediate,setTimeout".split(","),wa=0,U="[object Arguments]",oa="[object Array]",ba="[object Boolean]",ia="[object Date]",Ia="[object Function]",P="[object Number]",L="[object Object]",fa="[object RegExp]",T="[object String]",y={};y[Ia]=!1;y[U]=y[oa]=y[ba]=y[ia]=y[P]=y[L]=y[fa]=y[T]=!0;var B={"boolean":!1, -"function":!0,object:!0,number:!1,string:!1,undefined:!1},z={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},ja=B[typeof exports]&&exports,ka=B[typeof module]&&module&&module.exports==ja&&module,Y=B[typeof global]&&global;if(Y&&(Y.global===Y||Y.window===Y))c=Y;var O=q();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(c._=O,define(function(){return O})):ja&&!ja.nodeType?ka?(ka.exports=O)._=O:ja._=O:c._=O})(this)},"frozen/InputManager":function(){define("frozen/InputManager", -"./GameAction,./MouseAction,./TouchAction,./utils/insideCanvas,dcl,dcl/bases/Mixer,dcl/mixins/Cleanup,dojo/has,dojo/on,lodash,hammer,dojo/domReady!".split(","),function(c,f,h,a,k,n,g,b,d,m,e){return k([n,g],{keyActions:null,mouseAction:null,touchAction:null,canvas:null,handleMouse:!0,handleTouch:!0,handleKeys:!0,gameArea:null,canvasPercentage:null,emulateMouse:!0,hammer:null,on:function(a,b){var d=this.hammer,e=this.removeCleanup;d.on(a,b);var c=this.pushCleanup([a,b],function(a){d.off.apply(d,a)}); -return{remove:function(){e(c);c()}}},constructor:function(){function a(b){b.remove()}m.bindAll(this);if(!this.hammer)this.hammer=e(document,{prevent_default:!0,drag_max_touches:0,hold:!1});if(!this.keyActions)this.keyActions={};this.handleKeys&&(this.pushCleanup(d(document,"keydown",this.keydown),a),this.pushCleanup(d(document,"keyup",this.keyup),a));if(this.emulateMouse){if(this.on("touch",this.mousedown),this.on("drag",this.mousemove),this.on("release",this.mouseup),!this.mouseAction)this.mouseAction= -new f}else if(this.on("touch",this.touchstart),this.on("drag",this.touchmove),this.on("release",this.touchend),!this.touchAction)this.touchAction=new h;this.gameArea&&this.canvasPercentage&&(this.pushCleanup(d(window,"resize",this.resize),a),this.pushCleanup(d(window,"orientationchange",this.resize),a))},insideCanvas:function(b){return a(b,this.canvas)},mapToKey:function(a,b){this.keyActions[b]=a},addKeyAction:function(a,b){var d=new c;if(b)d.behavior=d.statics.DETECT_INITAL_PRESS_ONLY;this.mapToKey(d, -a);return d},mouseUp:function(a){this.mouseup(a)},mouseup:function(a){this.mouseAction.release(this.normalizePoint(a.gesture.touches[0]))},mouseDown:function(a){this.mousedown(a)},mousedown:function(a){this.mouseAction.release(null);a=this.normalizePoint(a.gesture.touches[0]);this.mouseAction.insideCanvas=this.insideCanvas(a);this.mouseAction.press(a)},mouseMove:function(a){this.mousemove(a)},mousemove:function(a){this.mouseAction.position=this.normalizePoint(a.gesture?a.gesture.touches[0]:a)},touchStart:function(a){this.touchstart(a)}, -touchstart:function(a){this.touchAction.release(null);a=m.map(a.gesture.touches,this.normalizePoint);this.touchAction.insideCanvas=m.some(a,this.insideCanvas);this.touchAction.press(a)},touchEnd:function(a){this.touchend(a)},touchend:function(a){this.touchAction.release(m.map(a.gesture.touches,this.normalizePoint))},touchMove:function(a){this.touchmove(a)},touchmove:function(a){this.touchAction.positions=m.map(a.gesture.touches,this.normalizePoint);this.touchAction.startPositions&&a.preventDefault()}, -getKeyAction:function(a){return this.keyActions?this.keyActions[a.keyCode]||this.keyActions[String.fromCharCode(a.keyCode)]:null},keyPressed:function(a){this.keydown(a)},keyDown:function(a){this.keydown(a)},keydown:function(a){(a=this.getKeyAction(a))&&!a.isPressed()&&a.press()},keyReleased:function(a){this.keyup(a)},keyup:function(a){(a=this.getKeyAction(a))&&a.release()},getMouseLoc:function(a){return this.normalizePoint(a)},normalizePoint:function(a){var b,d;d=this.canvas.getBoundingClientRect(); -b=d.left;d=d.top;return this.zoomRatio?{x:Math.round((a.clientX-b)/this.zoomRatio),y:Math.round((a.clientY-d)/this.zoomRatio)}:{x:Math.round(a.clientX-b),y:Math.round(a.clientY-d)}},resize:function(){var a,b;if(this.gameArea&&this.canvasPercentage&&this.canvas){var d=this.canvas.width,e=this.canvas.height,c=window.getComputedStyle(document.body,null)||{};a=parseFloat(c.marginLeft)||0;var g=parseFloat(c.marginTop)||0;b=parseFloat(c.marginRight)||0;c=parseFloat(c.marginBottom)||0;a+=b;b=g+c;g=window.innerWidth- -a;a=window.innerHeight-b;e=d/e;c=b="";g/a>e?(g=a*e,b=g+"px",c=a+"px"):(b=g+"px",c=Math.round(g/e)+"px");this.zoomRatio=g/d*this.canvasPercentage;this.gameArea.style.width=b;this.gameArea.style.height=c;d=Math.floor(100*this.canvasPercentage)+"%";this.canvas.style.width=d;this.canvas.style.height=d;this.canvas.style.display="block";this.canvas.style.marginLeft="auto";this.canvas.style.marginRight="auto"}}})})},"frozen/GameAction":function(){define("frozen/GameAction",["dcl","dcl/bases/Mixer"],function(c, -f){return c(f,{name:null,behavior:0,amount:0,state:0,statics:{NORMAL:0,DETECT_INITAL_PRESS_ONLY:1,STATE_RELEASED:0,STATE_PRESSED:1,STATE_WAITING_FOR_RELEASE:2,STATE_MOVED:3},constructor:function(){this.reset()},reset:function(){this.state=this.statics.STATE_RELEASED;this.amount=0},tap:function(){this.press();this.release()},press:function(){this.state=this.statics.STATE_PRESSED;this.behavior===this.statics.DETECT_INITAL_PRESS_ONLY&&this.pressAmt(1)},pressAmt:function(c){if(this.state!==this.statics.STATE_WAITING_FOR_RELEASE)this.amount+= -c,this.state=this.statics.STATE_WAITING_FOR_RELEASE},release:function(){this.state=this.statics.STATE_RELEASED},isPressed:function(){return this.state===this.statics.STATE_PRESSED?!0:!1},getAmount:function(){var c=this.amount;if(0!==c)if(this.state===this.statics.STATE_RELEASED)this.amount=0;else if(this.behavior===this.statics.DETECT_INITAL_PRESS_ONLY)this.state=this.statics.STATE_WAITING_FOR_RELEASE,this.amount=0;return c}})})},"frozen/MouseAction":function(){define("frozen/MouseAction",["dcl", -"./GameAction"],function(c,f){return c(f,{startPosition:null,endPosition:null,position:null,insideCanvas:null,press:c.superCall(function(c){return function(a){this.position=this.startPosition=a;c.apply(this)}}),release:c.superCall(function(c){return function(a){this.endPosition=a;c.apply(this)}})})})},"frozen/TouchAction":function(){define("frozen/TouchAction",["dcl","./GameAction"],function(c,f){return c(f,{startPositions:null,endPositions:null,positions:null,insideCanvas:null,press:c.superCall(function(c){return function(a){this.positions= -this.startPositions=a;c.apply(this)}}),release:c.superCall(function(c){return function(a){this.endPositions=a;c.apply(this)}})})})},"frozen/utils/insideCanvas":function(){define("frozen/utils/insideCanvas",function(){return function(c,f){return 0>c.x||c.x>f.width||0>c.y||c.y>f.height?!1:!0}})},"dcl/mixins/Cleanup":function(){(function(c){"undefined"!=typeof define?define(["../dcl","./Destroyable"],c):"undefined"!=typeof module?module.exports=c(require("../dcl"),require("./Destroyable")):dclMixinsCleanup= -c(dcl,dclMixinsDestroyable)})(function(c,f){return c(f,{declaredClass:"dcl/mixins/Cleanup",constructor:function(){this.__cleanupStack=[]},pushCleanup:function(c,a){var f=a?function(){a(c)}:function(){c.destroy()};this.__cleanupStack.push(f);return f},popCleanup:function(c){if(c)return this.__cleanupStack.pop();this.__cleanupStack.pop()()},removeCleanup:function(c){for(var a=this.__cleanupStack.length-1;0<=a;--a)if(this.__cleanupStack[a]===c)return this.__cleanupStack.splice(a,1),!0},cleanup:function(){for(;this.__cleanupStack.length;)this.__cleanupStack.pop()()}, -destroy:function(){this.cleanup()}})})},"dcl/mixins/Destroyable":function(){(function(c){"undefined"!=typeof define?define(["../dcl"],c):"undefined"!=typeof module?module.exports=c(require("../dcl")):dclMixinsDestroyable=c(dcl)})(function(c){var f=c(null,{declaredClass:"dcl/mixins/Destroyable"});c.chainBefore(f,"destroy");return f})},"dojo/has":function(){define(["require","module"],function(c){var f=c.has||function(){};f.add("touch","ontouchstart"in document);f.add("device-width",screen.availWidth|| -innerWidth);c=document.createElement("form");f.add("dom-attributes-explicit",0==c.attributes.length);f.add("dom-attributes-specified-flag",0c.attributes.length);f.clearElement=function(c){c.innerHTML="";return c};f.normalize=function(c,a){var k=c.match(/[\?:]|[^:\?]*/g),n=0,g=function(a){var d=k[n++];if(":"==d)return 0;if("?"==k[n++]){if(!a&&f(d))return g();g(!0);return g(a)}return d||0};return(c=g())&&a(c)};f.load=function(c,a,f){c?a([c],f):f()};return f})},"dojo/on":function(){define(["require", -"./_base/kernel","./has"],function(c,f,h){function a(a,d,c,i,f){if(i=d.match(/(.*):(.*)/))return d=i[2],i=i[1],g.selector(i,d).call(f,a,c);h("touch")&&(b.test(d)&&(c=A(c)),!h("event-orientationchange")&&"orientationchange"==d&&(d="resize",a=window,c=A(c)));l&&(c=l(c));if(a.addEventListener){var k=d in e,m=k?e[d]:d;a.addEventListener(m,c,k);return{remove:function(){a.removeEventListener(m,c,k)}}}d="on"+d;throw Error("Target must be an event emitter");}function k(){this.cancelable=!1}function n(){this.bubbles= -!1}c=window.ScriptEngineMajorVersion;h.add("jscript",c&&c()+ScriptEngineMinorVersion()/10);h.add("event-orientationchange",h("touch")&&!h("android"));h.add("event-stopimmediatepropagation",window.Event&&!!window.Event.prototype&&!!window.Event.prototype.stopImmediatePropagation);var g=function(b,d,e,c){return"function"==typeof b.on&&"function"!=typeof d?b.on(d,e):g.parse(b,d,e,a,c,this)};g.pausable=function(a,b,d,e){var c,a=g(a,b,function(){if(!c)return d.apply(this,arguments)},e);a.pause=function(){c= -!0};a.resume=function(){c=!1};return a};g.once=function(a,b,d){var e=g(a,b,function(){e.remove();return d.apply(this,arguments)});return e};g.parse=function(a,b,d,e,c,i){if(b.call)return b.call(i,a,d);if(-1=e?0b.index?1:0});return this.gestures}};a.gestures=a.gestures||{};a.gestures.Hold= -{name:"hold",index:10,defaults:{hold_timeout:500,hold_threshold:1},timer:null,handler:function(b,d){switch(b.eventType){case a.EVENT_START:clearTimeout(this.timer);a.detection.current.name=this.name;this.timer=setTimeout(function(){"hold"==a.detection.current.name&&d.trigger("hold",b)},d.options.hold_timeout);break;case a.EVENT_MOVE:b.distance>d.options.hold_threshold&&clearTimeout(this.timer);break;case a.EVENT_END:clearTimeout(this.timer)}}};a.gestures.Tap={name:"tap",index:100,defaults:{tap_max_touchtime:250, -tap_max_distance:10,tap_always:!0,doubletap_distance:20,doubletap_interval:300},handler:function(b,d){if(b.eventType==a.EVENT_END){var c=a.detection.previous,e=!1;if(!(b.deltaTime>d.options.tap_max_touchtime||b.distance>d.options.tap_max_distance))if(c&&"tap"==c.name&&b.timeStamp-c.lastEvent.timeStampd.options.swipe_max_touches)&&(b.velocityX>d.options.swipe_velocity||b.velocityY>d.options.swipe_velocity))d.trigger(this.name,b),d.trigger(this.name+b.direction,b)}};a.gestures.Drag={name:"drag",index:50,defaults:{drag_min_distance:10,correct_for_drag_min_distance:!0,drag_max_touches:1,drag_block_horizontal:!1, -drag_block_vertical:!1,drag_lock_to_axis:!1,drag_lock_min_distance:25},triggered:!1,handler:function(b,d){if(a.detection.current.name!=this.name&&this.triggered)d.trigger(this.name+"end",b),this.triggered=!1;else if(!(0d.options.drag_max_touches))switch(b.eventType){case a.EVENT_START:this.triggered=!1;break;case a.EVENT_MOVE:if(b.distanceb.deltaY?a.DIRECTION_UP:a.DIRECTION_DOWN:0>b.deltaX?a.DIRECTION_LEFT:a.DIRECTION_RIGHT;if(!this.triggered)d.trigger(this.name+"start",b),this.triggered=!0;d.trigger(this.name,b);d.trigger(this.name+b.direction,b);(d.options.drag_block_vertical&&a.utils.isVertical(b.direction)||d.options.drag_block_horizontal&&!a.utils.isVertical(b.direction))&&b.preventDefault();break;case a.EVENT_END:this.triggered&&d.trigger(this.name+"end",b),this.triggered=!1}}};a.gestures.Transform={name:"transform", -index:45,defaults:{transform_min_scale:0.01,transform_min_rotation:1,transform_always_block:!1},triggered:!1,handler:function(b,d){if(a.detection.current.name!=this.name&&this.triggered)d.trigger(this.name+"end",b),this.triggered=!1;else if(!(2>b.touches.length))switch(d.options.transform_always_block&&b.preventDefault(),b.eventType){case a.EVENT_START:this.triggered=!1;break;case a.EVENT_MOVE:var c=Math.abs(1-b.scale),e=Math.abs(b.rotation);if(cd.options.transform_min_rotation&&d.trigger("rotate",b);c>d.options.transform_min_scale&&(d.trigger("pinch",b),d.trigger("pinch"+(1>b.scale?"in":"out"),b));break;case a.EVENT_END:this.triggered&&d.trigger(this.name+"end",b),this.triggered=!1}}};a.gestures.Touch={name:"touch",index:-Infinity,defaults:{prevent_default:!1,prevent_mouseevents:!1},handler:function(b,d){d.options.prevent_mouseevents&& -b.pointerType==a.POINTER_MOUSE?b.stopDetect():(d.options.prevent_default&&b.preventDefault(),b.eventType==a.EVENT_START&&d.trigger(this.name,b))}};a.gestures.Release={name:"release",index:Infinity,handler:function(b,d){b.eventType==a.EVENT_END&&d.trigger(this.name,b)}};"function"==typeof define&&"object"==typeof define.amd&&define.amd?(c.Hammer=a,define(function(){return a})):"object"===typeof module&&"object"===typeof module.exports?module.exports=a:c.Hammer=a})(this)},"dojo/domReady":function(){define(["./has"], -function(){function c(a){n?a(h):g.push(a)}var f=this,h=document,a={loaded:1,complete:1},k="string"!=typeof h.readyState,n=!!a[h.readyState];if(k)h.readyState="loading";if(!n){var g=[],b=[],d=function(b){b=b||f.event;if(!(n||"readystatechange"==b.type&&!a[h.readyState])){n=1;if(k)h.readyState="complete";for(;g.length;)g.shift()(h)}},m=function(a,b){a.addEventListener(b,d,!1);g.push(function(){a.removeEventListener(b,d,!1)})};m(h,"DOMContentLoaded");m(f,"load");"onreadystatechange"in h?m(h,"readystatechange"): -k||b.push(function(){return a[h.readyState]});if(b.length){var e=function(){if(!n){for(var a=b.length;a--;)if(b[a]()){d("poller");return}setTimeout(e,30)}};e()}}c.load=function(a,b,d){c(d)};return c})},"frozen/ResourceManager":function(){define("frozen/ResourceManager","require,./plugins/sound!,dcl,dcl/bases/Mixer,lodash,dojo/on".split(","),function(c,f,h,a,k,n){function g(a,b){var d=b;a&&(d=[a,b].join("/"));return d.replace(/\/{2,}/g,"/")}function b(a){var b=document.createElement("canvas");b.height= -a.height;b.width=a.width;var d=b.getContext("2d");d.translate(b.width,0);d.scale(-1,1);d.drawImage(a,0,0);return b.toDataURL()}function d(a){var b=document.createElement("canvas");b.height=a.height;b.width=a.width;var d=b.getContext("2d");d.translate(0,b.height);d.scale(1,-1);d.drawImage(a,0,0);return b.toDataURL()}var m=h(null,{name:"",img:null,complete:!1,constructor:function(a){var b=this;b.name=a;b.img=new Image;n.once(b.img,"load",function(){b.complete=!0})},load:function(){this.img.src=c.toUrl(this.name)}}); -return h(a,{allLoaded:!1,imageDir:null,soundDir:null,resourceList:{},loadImage:function(a){var b=!1;if("object"!==typeof a)if("string"===typeof a)b=!0,a=[a];else return;var d=this,a=k.transform(a,function(a,b,c){b=g(d.imageDir,b);if(d.resourceList[b])return a[c]=d.resourceList[b].img;d.allLoaded=!1;var e=new m(b);e.load();d.resourceList[b]=e;a[c]=e.img});return b?a[0]:a},loadSound:function(a){var b=!1;if("object"!==typeof a)if("string"===typeof a)b=!0,a=[a];else return;var d=this,a=k.transform(a, -function(a,b,c){b=g(d.soundDir,b);if(d.resourceList[b])return a[c]=d.resourceList[b];d.allLoaded=!1;var e=new f(b);d.resourceList[b]=e;a[c]=e});return b?a[0]:a},flipImage:function(a,b,d){this.allLoaded=!1;var c=new m(a);this.resourceList[a]=c;n.once(b,"load",function(){c.img.src=d(b)});k.any(this.resourceList,function(a){if(a.img===b&&a.complete)return c.img.src=d(b),!0});return c.img},flipImageX:function(a,d){return this.flipImage(a,d,b)},flipImageY:function(a,b){return this.flipImage(a,b,d)},resourcesReady:function(){if(!this.allLoaded){for(var a in this.resourceList)if(!this.resourceList[a].complete)return!1; -this.allLoaded=!0}return!0},getPercentComplete:function(){var a=0,b=0,d;for(d in this.resourceList){var c=this.resourceList[d];b++;c.complete&&(a+=1)}return 0===b?0:Math.round(100*(a/b))}})})},"frozen/plugins/sound":function(){define(["../sounds/Sound","../sounds/WebAudio","../sounds/HTML5Audio","dojo/has"],function(c,f,h,a){return{load:function(k,n,g){return a("WebAudio")?g(f):a("HTML5Audio")?g(h):g(c)}}})},"frozen/sounds/Sound":function(){define("frozen/sounds/Sound",["dcl","dojo/has","dojo/sniff"], -function(c,f){f.add("shittySound",function(){return!(!f("android")&&!f("ios")||!f("webkit"))});return c(null,{declaredClass:"frozen/sounds/Sound",name:null,complete:!1,formats:{"audio/mpeg":".mp3","audio/webm":".webm","audio/ogg":".ogg","audio/wav":".wav","audio/aac":".aac","audio/x-m4a":".m4a"},probably:null,maybe:null,constructor:function(c){if(!this.probably)this.probably=[];if(!this.maybe)this.maybe=[];"string"===typeof c&&this.load(c)},load:function(c){this.name=c;this.complete=!0},loop:function(){}, -play:function(){},_initAudio:function(){},_chooseFormat:function(){if(!this.probably.length&&!this.maybe.length){var c=new Audio,a,f;for(a in this.formats)f=c.canPlayType(a),"probably"===f?this.probably.push(this.formats[a]):"maybe"===f&&this.maybe.push(this.formats[a])}return this.probably.length?this.probably[0]:this.maybe.length?this.maybe[0]:""},_nextFormat:function(){if(1c.y!==k>c.y&&c.x<(d-g)*(c.y-b)/(k-b)+g&&(a=!a)}return a}})},"frozen/utils/translatePoints":function(){define("frozen/utils/translatePoints",["lodash"],function(c){function f(h,a){Array.isArray(h)?h=c.map(h,function(c){return f(c,a)}):(h={x:h.x,y:h.y},null!=a.x&&(h.x+=a.x),null!=a.y&&(h.y+=a.y));return h}return f})},"frozen/box2d/entities/Polygon":function(){define("frozen/box2d/entities/Polygon", -["dcl","./Entity","../../utils/scalePoints","../../utils/pointInPolygon","../../utils/translatePoints"],function(c,f,h,a,k){return c(f,{declaredClass:"frozen/box2d/entities/Polygon",points:[],draw:c.superCall(function(a){return function(c,b){var b=b||this.scale||1,d=c.lineWidth;c.lineWidth=this.lineWidth;c.save();c.translate(this.x*b,this.y*b);c.rotate(this.angle);c.translate(-this.x*b,-this.y*b);c.fillStyle=this.fillStyle;c.strokeStyle=this.strokeStyle;c.beginPath();c.moveTo((this.x+this.points[0].x)* -b,(this.y+this.points[0].y)*b);for(var f=1;f=this.x-this.halfWidth&&c.x<=this.x+this.halfWidth&&c.y>=this.y-this.halfHeight&&c.y<=this.y+this.halfHeight}})})},"frozen/box2d/joints":function(){define("frozen/box2d/joints",["./joints/Distance","./joints/Prismatic", -"./joints/Revolute"],function(){for(var c=Array.prototype.slice.call(arguments),f={},h=0;hthis.dy)this.direction=this.statics.NORTH;else if(0this.dy)this.direction=this.statics.NORTHEAST;else if(0>this.dx&&0>this.dy)this.direction=this.statics.NORTHWEST;else if(0===this.dx&&0this.dx&&0this.dx&&0===this.dy)this.direction=this.statics.WEST; -this.state=0===this.dx&&0===this.dy?this.statics.STATE_IDLE:this.statics.STATE_WALKING}},updateAnimations:function(a){this.anim=this.state===this.statics.STATE_WALKING?this.walkingAnims[this.direction]:this.state===this.statics.STATE_DYING?this.dyingAnims[this.direction]:this.idleAnims[this.direction];this.anim.update(a)},createAnimations:function(a,c,f,g,b,d){var m=[],e=Array.isArray(c),i=1;d||(d=0);for(var l=0;8>l;l++){m[l]=new h({height:g,width:b,image:f});for(var q=0;qthis.maxSpeed?0a?this.maxSpeed:0:a:a},getCurrentFrame:function(){if(this.anim)return this.anim.getCurrentFrame()},draw:function(a){this.anim&&this.anim.draw(a,this.x,this.y)}, -clone:function(){return new h({anim:this.anim.clone()})}});return h})},"frozen/Animation":function(){define("frozen/Animation",["./AnimFrame","dcl","dcl/bases/Mixer"],function(c,f,h){var a=f(h,{currFrameIndex:0,animTime:0,totalDuration:0,height:64,width:64,image:null,offsetX:0,offsetY:0,constructor:function(){this.start()},createFromSheet:function(c,f,g,b,d,h){g=new a({image:g,height:d,width:b});b=Array.isArray(f);d=1;h||(h=0);for(var e=0;e=this.totalDuration)this.animTime%=this.totalDuration,this.currFrameIndex=0;for(;this.animTime>this.frames[this.currFrameIndex].endTime;)this.currFrameIndex++}}, -getCurrentFrame:function(){return 0===this.frames.length?null:this.frames[this.currFrameIndex]},draw:function(a,c,f){var b=this.getCurrentFrame();a.drawImage(this.image,b.imgSlotX*this.width+this.offsetX,b.imgSlotY*this.height+this.offsetY,this.width,this.height,c,f,this.width,this.height)}});return a})},"frozen/AnimFrame":function(){define("frozen/AnimFrame",["dcl","dcl/bases/Mixer"],function(c,f){return c(f,{endTime:0,imgSlotX:0,imgSlotY:0,image:null})})},"frozen/utils":function(){define("frozen/utils", -"./utils/averagePoints,./utils/degreesToRadians,./utils/radiansToDegrees,./utils/pointInPolygon,./utils/distance,./utils/degreesFromCenter,./utils/radiansFromCenter,./utils/scalePoints,./utils/translatePoints,./utils/insideCanvas".split(","),function(c,f,h,a,k,n,g,b,d,m){return{averagePoints:c,degreesToRadians:f,radiansToDegrees:h,pointInPolygon:a,distance:k,degreesFromCenter:n,radiansFromCenter:g,scalePoints:b,translatePoints:d,insideCanvas:m}})},"frozen/utils/averagePoints":function(){define("frozen/utils/averagePoints", -["lodash"],function(c){return function(f){var h={x:0,y:0};c.forEach(f,function(a){h.x+=a.x;h.y+=a.y});h.x/=f.length;h.y/=f.length;return h}})},"frozen/utils/degreesToRadians":function(){define("frozen/utils/degreesToRadians",function(){var c=Math.PI/180;return function(f){return f*c}})},"frozen/utils/radiansToDegrees":function(){define("frozen/utils/radiansToDegrees",function(){var c=180/Math.PI;return function(f){return f*c}})},"frozen/utils/degreesFromCenter":function(){define("frozen/utils/degreesFromCenter", -["./radiansToDegrees","./radiansFromCenter"],function(c,f){return function(h,a){return c(f(h,a))}})},"frozen/utils/radiansFromCenter":function(){define("frozen/utils/radiansFromCenter",function(){var c={x:0,y:0};return function(f,h){f=f||c;return f.x===h.x&&f.y===h.y?0:f.x===h.x?f.y>h.y?0:Math.PI:f.y===h.y?f.x>h.x?1.5*Math.PI:Math.PI/2:f.xh.y?Math.atan((h.x-f.x)/(f.y-h.y)):f.xh.x&&f.yb||"undefined"==typeof a)return 1;if(ad?0:d);++ed?$(0,i+d):d)||0;i&&"number"==typeof i?g=-1<(da(a)?a.indexOf(b,d):c(a,b,d)):E(a,function(a){if(++e>=d)return!(g=a===b)});return g}function xa(a,b,d){var e=!0,b=j.createCallback(b, +d),d=-1,c=a?a.length:0;if("number"==typeof c)for(;++dc&&(c=g)}else b=!b&&da(a)?k:j.createCallback(b, +d),w(a,function(a,d,i){d=b(a,d,i);d>e&&(e=d,c=a)});return c}function ma(a,b){var d=-1,e=a?a.length:0;if("number"==typeof e)for(var c=K(e);++darguments.length,b=j.createCallback(b,e,4),i=-1,g=a.length;if("number"==typeof g)for(c&&(d=a[++i]);++iarguments.length;if("number"!=typeof c)var g=S(a),c=g.length; +b=j.createCallback(b,e,4);w(a,function(e,h,f){h=g?g[--c]:--c;d=i?(i=!1,a[h]):b(d,a[h],h,f)});return d}function Xa(a,b,d){var e,b=j.createCallback(b,d),d=-1,c=a?a.length:0;if("number"==typeof c)for(;++d=s&&d===f;if(k){var m=g(c);m?(d=h,c=m):k=!1}for(;++bd(c,m)&&l.push(m);k&&i(c);return l}function sa(a,b,d){if(a){var e=0, +c=a.length;if("number"!=typeof b&&null!=b)for(var i=-1,b=j.createCallback(b,d);++id?$(0,e+d):d||0;else if(d)return d=Ta(a,b),a[d]===b?d:-1;return a?f(a,b,d):-1}function Ka(a,b,d){if("number"!=typeof b&&null!=b)for(var e=0,c=-1,i=a?a.length:0,b=j.createCallback(b,d);++c>>1,d(a[e])d?0:d);++bl&&(h=a.apply(f,g));else{var d=new Sa;!j&&!q&&(k=d);var e=m-(d-k);0>=e?(db(j),j=null,k=d,h=a.apply(f,g)):j||(j=eb(i,e))}b!==m&&(n=eb(c,b));return h}}function ub(a){var b=I.call(arguments, +1);return eb(function(){a.apply(x,b)},1)}function ib(a){return a}function vb(a){w(Q(a),function(b){var d=j[b]=a[b];j.prototype[b]=function(){var a=this.__wrapped__,b=[a];fb.apply(b,arguments);b=d.apply(j,b);return a&&"object"==typeof a&&a===b?this:new o(b)}})}function wb(){return this.__wrapped__}var a=a?O.defaults(c.Object(),a,O.pick(c,ha)):c,K=a.Array,jb=a.Boolean,Sa=a.Date,kb=a.Function,W=a.Math,Gb=a.Number,La=a.Object,mb=a.RegExp,ca=a.String,Hb=a.TypeError,M=[],pb=La.prototype,Jb=a._,Fa=mb("^"+ +ca(pb.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Kb=W.ceil,db=a.clearTimeout,Ea=M.concat,Eb=W.floor,Lb=kb.prototype.toString,Na=Fa.test(Na=La.getPrototypeOf)&&Na,J=pb.hasOwnProperty,fb=M.push,gb=a.setImmediate,eb=a.setTimeout,N=pb.toString,na=Fa.test(na=N.bind)&&na,bb=Fa.test(bb=La.create)&&bb,qb=Fa.test(qb=K.isArray)&&qb,Mb=a.isFinite,Nb=a.isNaN,hb=Fa.test(hb=La.keys)&&hb,$=W.max,cb=W.min,rb=a.parseInt,Fb=W.random,I=M.slice,W=Fa.test(a.attachEvent),W= +na&&!/\n|true/.test(na+W),ea={};ea[oa]=K;ea[ba]=jb;ea[ia]=Sa;ea[Ia]=kb;ea[L]=La;ea[P]=Gb;ea[fa]=mb;ea[T]=ca;o.prototype=j.prototype;var Db=j.support={};Db.fastBind=na&&!W;j.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:Pa,variable:"",imports:{_:j}};var R=qb,S=!hb?function(a){var b,d=[];if(!a||!B[typeof a])return d;for(b in a)J.call(a,b)&&d.push(b);return d}:function(a){return!H(a)?[]:hb(a)},Cb={"&":"&","<":"<",">":">",'"':""","'":"'"},Ib=Ua(Cb), +nb=function(a,b,d){var e,c=a,i=c;if(!c)return i;var g=arguments,h=0,f="number"==typeof d?2:g.length;if(3=s&&l===f,o=c||n?d():j;if(n){var q=g(o);q?(l=h,o=q):(n=!1,o=c?o:(e(o),j))}for(;++kl(o,p))(c||n)&&o.push(p),j.push(q)}n?(e(o.array),i(o)):c&&e(o);return j});W&&ka&&"function"== +typeof gb&&(ub=Da(gb,a));gb=8==rb(va+"08")?rb:function(a,b){return rb(da(a)?a.replace(Qa,""):a,b||0)};j.after=function(a,b){return 1>a?b():function(){if(1>--a)return b.apply(this,arguments)}};j.assign=nb;j.at=function(a){for(var b=-1,d=Ea.apply(M,I.call(arguments,1)),e=d.length,c=K(e);++b=s&&g(k?b[k]:q)}a:for(;++m(t?h(t,p):j(q,p))){k=c;for((t||q).push(p);--k;)if(t=l[k],0>(t?h(t,p):j(b[k],p)))continue a;o.push(p)}}for(;c--;)(t=l[c])&&i(t);e(l);e(q);return o};j.invert=Ua;j.invoke=function(a,b){var d=I.call(arguments,2),e=-1,c="function"==typeof b,i=a?a.length:0,g=K("number"==typeof i?i:0);w(a,function(a){g[++e]=(c?b:a[b]).apply(a,d)});return g};j.keys=S;j.map=ya;j.max=Ma;j.memoize=function(a,b){function d(){var e=d.cache,c= +Ga+(b?b.apply(this,arguments):arguments[0]);return J.call(e,c)?e[c]:e[c]=a.apply(this,arguments)}d.cache={};return d};j.merge=Va;j.min=function(a,b,d){var e=Infinity,c=e;if(!b&&R(a))for(var d=-1,i=a.length;++de(g,d))i[d]=a});return i};j.once=function(a){var b,d;return function(){if(b)return d;b=!0;d=a.apply(this,arguments);a=null;return d}};j.pairs=function(a){for(var b=-1,d=S(a),e=d.length,c=K(e);++bd?$(0,e+d):cb(d,e-1))+1);e--;)if(a[e]===b)return e;return-1};j.mixin=vb;j.noConflict=function(){a._=Jb;return this};j.parseInt=gb;j.random=function(a,b){null==a&&null==b&&(b=1);a=+a||0;null==b?(b=a,a=0):b=+b||0;var d=Fb();return a%1||b%1?a+cb(d*(b-a+parseFloat("1e-"+((d+"").length-1))),b):a+Eb(d*(b-a+1))};j.reduce=ra;j.reduceRight=Ba;j.result=function(a,b){var d=a?a[b]:x;return Z(d)?a[b]():d};j.runInContext=q; +j.size=function(a){var b=a?a.length:0;return"number"==typeof b?b:S(a).length};j.some=Xa;j.sortedIndex=Ta;j.template=function(a,d,e){var c=j.templateSettings;a||(a="");var e=sb({},e,c),i=sb({},e.imports,c.imports),c=S(i),i=qa(i),g,h=0,f=e.interpolate||aa,k="__p += '",f=mb((e.escape||aa).source+"|"+f.source+"|"+(f===Pa?ua:aa).source+"|"+(e.evaluate||aa).source+"|$","g");a.replace(f,function(d,e,c,i,f,l){c||(c=i);k+=a.slice(h,l).replace(Ha,b);e&&(k+="' +\n__e("+e+") +\n'");f&&(g=!0,k+="';\n"+f+";\n__p += '"); +c&&(k+="' +\n((__t = ("+c+")) == null ? '' : __t) +\n'");h=l+d.length;return d});var k=k+"';\n",l=f=e.variable;l||(f="obj",k="with ("+f+") {\n"+k+"\n}\n");k=(g?k.replace(u,""):k).replace(F,"$1").replace(C,"$1;");k="function("+f+") {\n"+(l?"":f+" || ("+f+" = {});\n")+"var __t, __p = '', __e = _.escape"+(g?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+k+"return __p\n}";e="\n/*\n//@ sourceURL="+(e.sourceURL||"/lodash/template/source["+wa++ +"]")+"\n*/"; +try{var m=kb(c,"return "+k+e).apply(x,i)}catch(n){throw n.source=k,n;}if(d)return m(d);m.source=k;return m};j.unescape=function(a){return null==a?"":ca(a).replace(v,ja)};j.uniqueId=function(a){var b=++t;return ca(null==a?"":a)+b};j.all=xa;j.any=Xa;j.detect=pa;j.findWhere=pa;j.foldl=ra;j.foldr=Ba;j.include=Wa;j.inject=ra;E(j,function(a,b){j.prototype[b]||(j.prototype[b]=function(){var b=[this.__wrapped__];fb.apply(b,arguments);return a.apply(j,b)})});j.first=sa;j.last=function(a,b,d){if(a){var e=0, +c=a.length;if("number"!=typeof b&&null!=b)for(var i=c,b=j.createCallback(b,d);i--&&b(a[i],i,a);)e++;else if(e=b,null==e||d)return a[c-1];return m(a,$(0,c-e))}};j.take=sa;j.head=sa;E(j,function(a,b){j.prototype[b]||(j.prototype[b]=function(b,d){var e=a(this.__wrapped__,b,d);return null==b||d&&"function"!=typeof b?e:new o(e)})});j.VERSION="1.3.1";j.prototype.toString=function(){return ca(this.__wrapped__)};j.prototype.value=wb;j.prototype.valueOf=wb;w(["join","pop","shift"],function(a){var b=M[a];j.prototype[a]= +function(){return b.apply(this.__wrapped__,arguments)}});w(["push","reverse","sort","unshift"],function(a){var b=M[a];j.prototype[a]=function(){b.apply(this.__wrapped__,arguments);return this}});w(["concat","slice","splice"],function(a){var b=M[a];j.prototype[a]=function(){return new o(b.apply(this.__wrapped__,arguments))}});return j}var x,A=[],o=[],t=0,p={},Ga=+new Date+"",s=75,r=40,u=/\b__p \+= '';/g,F=/\b(__p \+=) '' \+/g,C=/(__e\(.*?\)|\b__t\)) \+\n'';/g,v=/&(?:amp|lt|gt|quot|#39);/g,ua=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, +Oa=/\w*$/,Pa=/<%=([\s\S]+?)%>/g,ga=(ga=/\bthis\b/)&&ga.test(q)&&ga,va=" \t\u000b\u000c\u00a0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",Qa=RegExp("^["+va+"]*0+(?=.$)"),aa=/($^)/,G=/[&<>"']/g,Ha=/['\n\r\t\u2028\u2029\\]/g,ha="Array,Boolean,Date,Function,Math,Number,Object,RegExp,String,_,attachEvent,clearTimeout,isFinite,isNaN,parseInt,setImmediate,setTimeout".split(","),wa=0,U="[object Arguments]",oa="[object Array]",ba="[object Boolean]", +ia="[object Date]",Ia="[object Function]",P="[object Number]",L="[object Object]",fa="[object RegExp]",T="[object String]",y={};y[Ia]=!1;y[U]=y[oa]=y[ba]=y[ia]=y[P]=y[L]=y[fa]=y[T]=!0;var B={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},z={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},ja=B[typeof exports]&&exports,ka=B[typeof module]&&module&&module.exports==ja&&module,Y=B[typeof global]&&global;if(Y&&(Y.global===Y||Y.window===Y))c=Y;var O= +q();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(c._=O,define(function(){return O})):ja&&!ja.nodeType?ka?(ka.exports=O)._=O:ja._=O:c._=O})(this)},"frozen/InputManager":function(){define("frozen/InputManager","./GameAction,./MouseAction,./TouchAction,./utils/insideCanvas,dcl,dcl/bases/Mixer,dcl/mixins/Cleanup,dojo/has,dojo/on,lodash,hammer,dojo/domReady!".split(","),function(c,f,h,a,k,n,g,b,d,l,e){return k([n,g],{keyActions:null,mouseAction:null,touchAction:null,canvas:null, +handleMouse:!0,handleTouch:!0,handleKeys:!0,gameArea:null,canvasPercentage:null,emulateMouse:!0,hammer:null,on:function(a,b){var d=this.hammer,e=this.removeCleanup;d.on(a,b);var c=this.pushCleanup([a,b],function(a){d.off.apply(d,a)});return{remove:function(){e(c);c()}}},constructor:function(){function a(b){b.remove()}l.bindAll(this);if(!this.hammer)this.hammer=e(document,{drag_max_touches:0,hold:!1});if(!this.keyActions)this.keyActions={};this.handleKeys&&(this.pushCleanup(d(document,"keydown",this.keydown), +a),this.pushCleanup(d(document,"keyup",this.keyup),a));if(this.emulateMouse){if(this.on("touch",this.mousedown),this.on("drag",this.mousemove),this.on("release",this.mouseup),!this.mouseAction)this.mouseAction=new f}else if(this.on("touch",this.touchstart),this.on("drag",this.touchmove),this.on("release",this.touchend),!this.touchAction)this.touchAction=new h;this.gameArea&&this.canvasPercentage&&(this.pushCleanup(d(window,"resize",this.resize),a),this.pushCleanup(d(window,"orientationchange",this.resize), +a))},insideCanvas:function(b){return a(b,this.canvas)},mapToKey:function(a,b){this.keyActions[b]=a},addKeyAction:function(a,b){var d=new c;if(b)d.behavior=d.statics.DETECT_INITAL_PRESS_ONLY;this.mapToKey(d,a);return d},mouseUp:function(a){this.mouseup(a)},mouseup:function(a){this.mouseAction.release(this.normalizePoint(a.gesture.touches[0]))},mouseDown:function(a){this.mousedown(a)},mousedown:function(a){this.mouseAction.release(null);a=this.normalizePoint(a.gesture.touches[0]);this.mouseAction.insideCanvas= +this.insideCanvas(a);this.mouseAction.press(a)},mouseMove:function(a){this.mousemove(a)},mousemove:function(a){this.mouseAction.position=this.normalizePoint(a.gesture?a.gesture.touches[0]:a)},touchStart:function(a){this.touchstart(a)},touchstart:function(a){this.touchAction.release(null);a=l.map(a.gesture.touches,this.normalizePoint);this.touchAction.insideCanvas=l.some(a,this.insideCanvas);this.touchAction.press(a)},touchEnd:function(a){this.touchend(a)},touchend:function(a){this.touchAction.release(l.map(a.gesture.touches, +this.normalizePoint))},touchMove:function(a){this.touchmove(a)},touchmove:function(a){this.touchAction.positions=l.map(a.gesture.touches,this.normalizePoint);this.touchAction.startPositions&&a.preventDefault()},getKeyAction:function(a){return this.keyActions?this.keyActions[a.keyCode]||this.keyActions[String.fromCharCode(a.keyCode)]:null},keyPressed:function(a){this.keydown(a)},keyDown:function(a){this.keydown(a)},keydown:function(a){(a=this.getKeyAction(a))&&!a.isPressed()&&a.press()},keyReleased:function(a){this.keyup(a)}, +keyup:function(a){(a=this.getKeyAction(a))&&a.release()},getMouseLoc:function(a){return this.normalizePoint(a)},normalizePoint:function(a){var b,d;d=this.canvas.getBoundingClientRect();b=d.left;d=d.top;return this.zoomRatio?{x:Math.round((a.clientX-b)/this.zoomRatio),y:Math.round((a.clientY-d)/this.zoomRatio)}:{x:Math.round(a.clientX-b),y:Math.round(a.clientY-d)}},resize:function(){var a,b;if(this.gameArea&&this.canvasPercentage&&this.canvas){var d=this.canvas.width,e=this.canvas.height,c=window.getComputedStyle(document.body, +null)||{};a=parseFloat(c.marginLeft)||0;var g=parseFloat(c.marginTop)||0;b=parseFloat(c.marginRight)||0;c=parseFloat(c.marginBottom)||0;a+=b;b=g+c;g=window.innerWidth-a;a=window.innerHeight-b;e=d/e;c=b="";g/a>e?(g=a*e,b=g+"px",c=a+"px"):(b=g+"px",c=Math.round(g/e)+"px");this.zoomRatio=g/d*this.canvasPercentage;this.gameArea.style.width=b;this.gameArea.style.height=c;d=Math.floor(100*this.canvasPercentage)+"%";this.canvas.style.width=d;this.canvas.style.height=d;this.canvas.style.display="block";this.canvas.style.marginLeft= +"auto";this.canvas.style.marginRight="auto"}}})})},"frozen/GameAction":function(){define("frozen/GameAction",["dcl","dcl/bases/Mixer"],function(c,f){return c(f,{name:null,behavior:0,amount:0,state:0,statics:{NORMAL:0,DETECT_INITAL_PRESS_ONLY:1,STATE_RELEASED:0,STATE_PRESSED:1,STATE_WAITING_FOR_RELEASE:2,STATE_MOVED:3},constructor:function(){this.reset()},reset:function(){this.state=this.statics.STATE_RELEASED;this.amount=0},tap:function(){this.press();this.release()},press:function(){this.state=this.statics.STATE_PRESSED; +this.behavior===this.statics.DETECT_INITAL_PRESS_ONLY&&this.pressAmt(1)},pressAmt:function(c){if(this.state!==this.statics.STATE_WAITING_FOR_RELEASE)this.amount+=c,this.state=this.statics.STATE_WAITING_FOR_RELEASE},release:function(){this.state=this.statics.STATE_RELEASED},isPressed:function(){return this.state===this.statics.STATE_PRESSED?!0:!1},getAmount:function(){var c=this.amount;if(0!==c)if(this.state===this.statics.STATE_RELEASED)this.amount=0;else if(this.behavior===this.statics.DETECT_INITAL_PRESS_ONLY)this.state= +this.statics.STATE_WAITING_FOR_RELEASE,this.amount=0;return c}})})},"frozen/MouseAction":function(){define("frozen/MouseAction",["dcl","./GameAction"],function(c,f){return c(f,{startPosition:null,endPosition:null,position:null,insideCanvas:null,press:c.superCall(function(c){return function(a){this.position=this.startPosition=a;c.apply(this)}}),release:c.superCall(function(c){return function(a){this.endPosition=a;c.apply(this)}})})})},"frozen/TouchAction":function(){define("frozen/TouchAction",["dcl", +"./GameAction"],function(c,f){return c(f,{startPositions:null,endPositions:null,positions:null,insideCanvas:null,press:c.superCall(function(c){return function(a){this.positions=this.startPositions=a;c.apply(this)}}),release:c.superCall(function(c){return function(a){this.endPositions=a;c.apply(this)}})})})},"frozen/utils/insideCanvas":function(){define("frozen/utils/insideCanvas",function(){return function(c,f){return 0>c.x||c.x>f.width||0>c.y||c.y>f.height?!1:!0}})},"dcl/mixins/Cleanup":function(){(function(c){"undefined"!= +typeof define?define(["../dcl","./Destroyable"],c):"undefined"!=typeof module?module.exports=c(require("../dcl"),require("./Destroyable")):dclMixinsCleanup=c(dcl,dclMixinsDestroyable)})(function(c,f){return c(f,{declaredClass:"dcl/mixins/Cleanup",constructor:function(){this.__cleanupStack=[]},pushCleanup:function(c,a){var f=a?function(){a(c)}:function(){c.destroy()};this.__cleanupStack.push(f);return f},popCleanup:function(c){if(c)return this.__cleanupStack.pop();this.__cleanupStack.pop()()},removeCleanup:function(c){for(var a= +this.__cleanupStack.length-1;0<=a;--a)if(this.__cleanupStack[a]===c)return this.__cleanupStack.splice(a,1),!0},cleanup:function(){for(;this.__cleanupStack.length;)this.__cleanupStack.pop()()},destroy:function(){this.cleanup()}})})},"dcl/mixins/Destroyable":function(){(function(c){"undefined"!=typeof define?define(["../dcl"],c):"undefined"!=typeof module?module.exports=c(require("../dcl")):dclMixinsDestroyable=c(dcl)})(function(c){var f=c(null,{declaredClass:"dcl/mixins/Destroyable"});c.chainBefore(f, +"destroy");return f})},"dojo/has":function(){define(["require","module"],function(c){var f=c.has||function(){};f.add("touch","ontouchstart"in document);f.add("device-width",screen.availWidth||innerWidth);c=document.createElement("form");f.add("dom-attributes-explicit",0==c.attributes.length);f.add("dom-attributes-specified-flag",0c.attributes.length);f.clearElement=function(c){c.innerHTML="";return c};f.normalize=function(c,a){var k=c.match(/[\?:]|[^:\?]*/g),n=0,g=function(a){var d= +k[n++];if(":"==d)return 0;if("?"==k[n++]){if(!a&&f(d))return g();g(!0);return g(a)}return d||0};return(c=g())&&a(c)};f.load=function(c,a,f){c?a([c],f):f()};return f})},"dojo/on":function(){define(["require","./_base/kernel","./has"],function(c,f,h){function a(a,d,c,i,f){if(i=d.match(/(.*):(.*)/))return d=i[2],i=i[1],g.selector(i,d).call(f,a,c);h("touch")&&(b.test(d)&&(c=A(c)),!h("event-orientationchange")&&"orientationchange"==d&&(d="resize",a=window,c=A(c)));m&&(c=m(c));if(a.addEventListener){var k= +d in e,l=k?e[d]:d;a.addEventListener(l,c,k);return{remove:function(){a.removeEventListener(l,c,k)}}}d="on"+d;throw Error("Target must be an event emitter");}function k(){this.cancelable=!1}function n(){this.bubbles=!1}c=window.ScriptEngineMajorVersion;h.add("jscript",c&&c()+ScriptEngineMinorVersion()/10);h.add("event-orientationchange",h("touch")&&!h("android"));h.add("event-stopimmediatepropagation",window.Event&&!!window.Event.prototype&&!!window.Event.prototype.stopImmediatePropagation);var g= +function(b,d,e,c){return"function"==typeof b.on&&"function"!=typeof d?b.on(d,e):g.parse(b,d,e,a,c,this)};g.pausable=function(a,b,d,e){var c,a=g(a,b,function(){if(!c)return d.apply(this,arguments)},e);a.pause=function(){c=!0};a.resume=function(){c=!1};return a};g.once=function(a,b,d){var e=g(a,b,function(){e.remove();return d.apply(this,arguments)});return e};g.parse=function(a,b,d,e,c,i){if(b.call)return b.call(i,a,d);if(-1=e?0b.index?1:0});return this.gestures}};a.gestures=a.gestures||{};a.gestures.Hold={name:"hold",index:10,defaults:{hold_timeout:500,hold_threshold:1},timer:null,handler:function(b,d){switch(b.eventType){case a.EVENT_START:clearTimeout(this.timer);a.detection.current.name=this.name;this.timer=setTimeout(function(){"hold"==a.detection.current.name&& +d.trigger("hold",b)},d.options.hold_timeout);break;case a.EVENT_MOVE:b.distance>d.options.hold_threshold&&clearTimeout(this.timer);break;case a.EVENT_END:clearTimeout(this.timer)}}};a.gestures.Tap={name:"tap",index:100,defaults:{tap_max_touchtime:250,tap_max_distance:10,tap_always:!0,doubletap_distance:20,doubletap_interval:300},handler:function(b,d){if(b.eventType==a.EVENT_END){var c=a.detection.previous,e=!1;if(!(b.deltaTime>d.options.tap_max_touchtime||b.distance>d.options.tap_max_distance))if(c&& +"tap"==c.name&&b.timeStamp-c.lastEvent.timeStampd.options.swipe_max_touches)&&(b.velocityX>d.options.swipe_velocity|| +b.velocityY>d.options.swipe_velocity))d.trigger(this.name,b),d.trigger(this.name+b.direction,b)}};a.gestures.Drag={name:"drag",index:50,defaults:{drag_min_distance:10,correct_for_drag_min_distance:!0,drag_max_touches:1,drag_block_horizontal:!1,drag_block_vertical:!1,drag_lock_to_axis:!1,drag_lock_min_distance:25},triggered:!1,handler:function(b,d){if(a.detection.current.name!=this.name&&this.triggered)d.trigger(this.name+"end",b),this.triggered=!1;else if(!(0 +d.options.drag_max_touches))switch(b.eventType){case a.EVENT_START:this.triggered=!1;break;case a.EVENT_MOVE:if(b.distanceb.deltaY?a.DIRECTION_UP:a.DIRECTION_DOWN:0>b.deltaX?a.DIRECTION_LEFT:a.DIRECTION_RIGHT;if(!this.triggered)d.trigger(this.name+"start",b),this.triggered=!0;d.trigger(this.name,b);d.trigger(this.name+b.direction,b);(d.options.drag_block_vertical&&a.utils.isVertical(b.direction)||d.options.drag_block_horizontal&& +!a.utils.isVertical(b.direction))&&b.preventDefault();break;case a.EVENT_END:this.triggered&&d.trigger(this.name+"end",b),this.triggered=!1}}};a.gestures.Transform={name:"transform",index:45,defaults:{transform_min_scale:0.01,transform_min_rotation:1,transform_always_block:!1},triggered:!1,handler:function(b,d){if(a.detection.current.name!=this.name&&this.triggered)d.trigger(this.name+"end",b),this.triggered=!1;else if(!(2>b.touches.length))switch(d.options.transform_always_block&&b.preventDefault(), +b.eventType){case a.EVENT_START:this.triggered=!1;break;case a.EVENT_MOVE:var c=Math.abs(1-b.scale),e=Math.abs(b.rotation);if(cd.options.transform_min_rotation&&d.trigger("rotate",b);c>d.options.transform_min_scale&&(d.trigger("pinch",b),d.trigger("pinch"+(1>b.scale?"in":"out"),b));break;case a.EVENT_END:this.triggered&& +d.trigger(this.name+"end",b),this.triggered=!1}}};a.gestures.Touch={name:"touch",index:-Infinity,defaults:{prevent_default:!1,prevent_mouseevents:!1},handler:function(b,d){d.options.prevent_mouseevents&&b.pointerType==a.POINTER_MOUSE?b.stopDetect():(d.options.prevent_default&&b.preventDefault(),b.eventType==a.EVENT_START&&d.trigger(this.name,b))}};a.gestures.Release={name:"release",index:Infinity,handler:function(b,d){b.eventType==a.EVENT_END&&d.trigger(this.name,b)}};"function"==typeof define&&"object"== +typeof define.amd&&define.amd?(c.Hammer=a,define(function(){return a})):"object"===typeof module&&"object"===typeof module.exports?module.exports=a:c.Hammer=a})(this)},"dojo/domReady":function(){define(["./has"],function(){function c(a){n?a(h):g.push(a)}var f=this,h=document,a={loaded:1,complete:1},k="string"!=typeof h.readyState,n=!!a[h.readyState];if(k)h.readyState="loading";if(!n){var g=[],b=[],d=function(b){b=b||f.event;if(!(n||"readystatechange"==b.type&&!a[h.readyState])){n=1;if(k)h.readyState= +"complete";for(;g.length;)g.shift()(h)}},l=function(a,b){a.addEventListener(b,d,!1);g.push(function(){a.removeEventListener(b,d,!1)})};l(h,"DOMContentLoaded");l(f,"load");"onreadystatechange"in h?l(h,"readystatechange"):k||b.push(function(){return a[h.readyState]});if(b.length){var e=function(){if(!n){for(var a=b.length;a--;)if(b[a]()){d("poller");return}setTimeout(e,30)}};e()}}c.load=function(a,b,d){c(d)};return c})},"frozen/ResourceManager":function(){define("frozen/ResourceManager","require,./plugins/sound!,dcl,dcl/bases/Mixer,lodash,dojo/on".split(","), +function(c,f,h,a,k,n){function g(a,b){var d=b;a&&(d=[a,b].join("/"));return d.replace(/\/{2,}/g,"/")}function b(a){var b=document.createElement("canvas");b.height=a.height;b.width=a.width;var d=b.getContext("2d");d.translate(b.width,0);d.scale(-1,1);d.drawImage(a,0,0);return b.toDataURL()}function d(a){var b=document.createElement("canvas");b.height=a.height;b.width=a.width;var d=b.getContext("2d");d.translate(0,b.height);d.scale(1,-1);d.drawImage(a,0,0);return b.toDataURL()}var l=h(null,{name:"", +img:null,complete:!1,constructor:function(a){var b=this;b.name=a;b.img=new Image;n.once(b.img,"load",function(){b.complete=!0})},load:function(){this.img.src=c.toUrl(this.name)}});return h(a,{allLoaded:!1,imageDir:null,soundDir:null,resourceList:{},loadImage:function(a){var b=!1;if("object"!==typeof a)if("string"===typeof a)b=!0,a=[a];else return;var d=this,a=k.transform(a,function(a,b,c){b=g(d.imageDir,b);if(d.resourceList[b])return a[c]=d.resourceList[b].img;d.allLoaded=!1;var e=new l(b);e.load(); +d.resourceList[b]=e;a[c]=e.img});return b?a[0]:a},loadSound:function(a){var b=!1;if("object"!==typeof a)if("string"===typeof a)b=!0,a=[a];else return;var d=this,a=k.transform(a,function(a,b,c){b=g(d.soundDir,b);if(d.resourceList[b])return a[c]=d.resourceList[b];d.allLoaded=!1;var e=new f(b);d.resourceList[b]=e;a[c]=e});return b?a[0]:a},flipImage:function(a,b,d){this.allLoaded=!1;var c=new l(a);this.resourceList[a]=c;n.once(b,"load",function(){c.img.src=d(b)});k.any(this.resourceList,function(a){if(a.img=== +b&&a.complete)return c.img.src=d(b),!0});return c.img},flipImageX:function(a,d){return this.flipImage(a,d,b)},flipImageY:function(a,b){return this.flipImage(a,b,d)},resourcesReady:function(){if(!this.allLoaded){for(var a in this.resourceList)if(!this.resourceList[a].complete)return!1;this.allLoaded=!0}return!0},getPercentComplete:function(){var a=0,b=0,d;for(d in this.resourceList){var c=this.resourceList[d];b++;c.complete&&(a+=1)}return 0===b?0:Math.round(100*(a/b))}})})},"frozen/plugins/sound":function(){define(["../sounds/Sound", +"../sounds/WebAudio","../sounds/HTML5Audio","dojo/has"],function(c,f,h,a){return{load:function(k,n,g){return a("WebAudio")?g(f):a("HTML5Audio")?g(h):g(c)}}})},"frozen/sounds/Sound":function(){define("frozen/sounds/Sound",["dcl","dojo/has","dojo/sniff"],function(c,f){f.add("shittySound",function(){return!(!f("android")&&!f("ios")||!f("webkit"))});return c(null,{declaredClass:"frozen/sounds/Sound",name:null,complete:!1,formats:{"audio/mpeg":".mp3","audio/webm":".webm","audio/ogg":".ogg","audio/wav":".wav", +"audio/aac":".aac","audio/x-m4a":".m4a"},probably:null,maybe:null,constructor:function(c){if(!this.probably)this.probably=[];if(!this.maybe)this.maybe=[];"string"===typeof c&&this.load(c)},load:function(c){this.name=c;this.complete=!0},loop:function(){},play:function(){},_initAudio:function(){},_chooseFormat:function(){if(!this.probably.length&&!this.maybe.length){var c=new Audio,a,f;for(a in this.formats)f=c.canPlayType(a),"probably"===f?this.probably.push(this.formats[a]):"maybe"===f&&this.maybe.push(this.formats[a])}return this.probably.length? +this.probably[0]:this.maybe.length?this.maybe[0]:""},_nextFormat:function(){if(1c.y!==k>c.y&&c.x<(d-g)* +(c.y-b)/(k-b)+g&&(a=!a)}return a}})},"frozen/utils/translatePoints":function(){define("frozen/utils/translatePoints",["lodash"],function(c){function f(h,a){Array.isArray(h)?h=c.map(h,function(c){return f(c,a)}):(h={x:h.x,y:h.y},null!=a.x&&(h.x+=a.x),null!=a.y&&(h.y+=a.y));return h}return f})},"frozen/box2d/entities/Polygon":function(){define("frozen/box2d/entities/Polygon",["dcl","./Entity","../../utils/scalePoints","../../utils/pointInPolygon","../../utils/translatePoints"],function(c,f,h,a,k){return c(f, +{declaredClass:"frozen/box2d/entities/Polygon",points:[],draw:c.superCall(function(a){return function(c,b){var b=b||this.scale||1,d=c.lineWidth;c.lineWidth=this.lineWidth;c.save();c.translate(this.x*b,this.y*b);c.rotate(this.angle);c.translate(-this.x*b,-this.y*b);c.fillStyle=this.fillStyle;c.strokeStyle=this.strokeStyle;c.beginPath();c.moveTo((this.x+this.points[0].x)*b,(this.y+this.points[0].y)*b);for(var f=1;f=this.x-this.halfWidth&&c.x<=this.x+this.halfWidth&&c.y>=this.y-this.halfHeight&&c.y<=this.y+this.halfHeight}})})},"frozen/box2d/joints":function(){define("frozen/box2d/joints",["./joints/Distance","./joints/Prismatic","./joints/Revolute"],function(){for(var c=Array.prototype.slice.call(arguments),f={},h=0;hthis.dy)this.direction=this.statics.NORTH;else if(0this.dy)this.direction= +this.statics.NORTHEAST;else if(0>this.dx&&0>this.dy)this.direction=this.statics.NORTHWEST;else if(0===this.dx&&0this.dx&&0this.dx&&0===this.dy)this.direction=this.statics.WEST;this.state=0===this.dx&&0===this.dy?this.statics.STATE_IDLE:this.statics.STATE_WALKING}},updateAnimations:function(a){this.anim=this.state===this.statics.STATE_WALKING? +this.walkingAnims[this.direction]:this.state===this.statics.STATE_DYING?this.dyingAnims[this.direction]:this.idleAnims[this.direction];this.anim.update(a)},createAnimations:function(a,c,f,g,b,d){var l=[],e=Array.isArray(c),i=1;d||(d=0);for(var m=0;8>m;m++){l[m]=new h({height:g,width:b,image:f});for(var q=0;qthis.maxSpeed?0a?this.maxSpeed:0:a:a},getCurrentFrame:function(){if(this.anim)return this.anim.getCurrentFrame()},draw:function(a){this.anim&&this.anim.draw(a,this.x,this.y)},clone:function(){return new h({anim:this.anim.clone()})}});return h})},"frozen/Animation":function(){define("frozen/Animation",["./AnimFrame","dcl","dcl/bases/Mixer"], +function(c,f,h){var a=f(h,{currFrameIndex:0,animTime:0,totalDuration:0,height:64,width:64,image:null,offsetX:0,offsetY:0,constructor:function(){this.start()},createFromSheet:function(c,f,g,b,d,h){g=new a({image:g,height:d,width:b});b=Array.isArray(f);d=1;h||(h=0);for(var e=0;e=this.totalDuration)this.animTime%=this.totalDuration,this.currFrameIndex=0;for(;this.animTime>this.frames[this.currFrameIndex].endTime;)this.currFrameIndex++}},getCurrentFrame:function(){return 0===this.frames.length?null:this.frames[this.currFrameIndex]},draw:function(a, +c,f){var b=this.getCurrentFrame();a.drawImage(this.image,b.imgSlotX*this.width+this.offsetX,b.imgSlotY*this.height+this.offsetY,this.width,this.height,c,f,this.width,this.height)}});return a})},"frozen/AnimFrame":function(){define("frozen/AnimFrame",["dcl","dcl/bases/Mixer"],function(c,f){return c(f,{endTime:0,imgSlotX:0,imgSlotY:0,image:null})})},"frozen/utils":function(){define("frozen/utils","./utils/averagePoints,./utils/degreesToRadians,./utils/radiansToDegrees,./utils/pointInPolygon,./utils/distance,./utils/degreesFromCenter,./utils/radiansFromCenter,./utils/scalePoints,./utils/translatePoints,./utils/insideCanvas".split(","), +function(c,f,h,a,k,n,g,b,d,l){return{averagePoints:c,degreesToRadians:f,radiansToDegrees:h,pointInPolygon:a,distance:k,degreesFromCenter:n,radiansFromCenter:g,scalePoints:b,translatePoints:d,insideCanvas:l}})},"frozen/utils/averagePoints":function(){define("frozen/utils/averagePoints",["lodash"],function(c){return function(f){var h={x:0,y:0};c.forEach(f,function(a){h.x+=a.x;h.y+=a.y});h.x/=f.length;h.y/=f.length;return h}})},"frozen/utils/degreesToRadians":function(){define("frozen/utils/degreesToRadians", +function(){var c=Math.PI/180;return function(f){return f*c}})},"frozen/utils/radiansToDegrees":function(){define("frozen/utils/radiansToDegrees",function(){var c=180/Math.PI;return function(f){return f*c}})},"frozen/utils/degreesFromCenter":function(){define("frozen/utils/degreesFromCenter",["./radiansToDegrees","./radiansFromCenter"],function(c,f){return function(h,a){return c(f(h,a))}})},"frozen/utils/radiansFromCenter":function(){define("frozen/utils/radiansFromCenter",function(){var c={x:0,y:0}; +return function(f,h){f=f||c;return f.x===h.x&&f.y===h.y?0:f.x===h.x?f.y>h.y?0:Math.PI:f.y===h.y?f.x>h.x?1.5*Math.PI:Math.PI/2:f.xh.y?Math.atan((h.x-f.x)/(f.y-h.y)):f.xh.x&&f.y