var availableLocales=["en","es"],imgPath="media/",parseUrlParamsToJSON=function(){for(var e={},t=window.location.search.replace(/^\?/,"").split("&"),n=t.length,r=0,i;rn;n++)t[n]=ig.copy(e[n]);return t}t={};for(n in e)t[n]=ig.copy(e[n]);return t},merge:function(e,t){for(var n in t){var r=t[n];"object"!=typeof r||r instanceof HTMLElement||r instanceof ig.Class?e[n]=r:(e[n]&&"object"==typeof e[n]||(e[n]=r instanceof Array?[]:{}),ig.merge(e[n],r))}return e},ksort:function(e){if(!e||"object"!=typeof e)return[];var t=[],n=[],r;for(r in e)t.push(r);t.sort();for(r=0;t.length>r;r++)n.push(e[t[r]]);return n},module:function(e){if(ig._current)throw"Module '"+ig._current.name+"' defines nothing";if(ig.modules[e]&&ig.modules[e].body)throw"Module '"+e+"' is already defined";return ig._current={name:e,requires:[],loaded:!1,body:null},ig.modules[e]=ig._current,ig._loadQueue.push(ig._current),ig},requires:function(){return ig._current.requires=Array.prototype.slice.call(arguments),ig},defines:function(e){ig._current.body=e;ig._current=null;ig._initDOMReady()},addResource:function(e){ig.resources.push(e)},setNocache:function(e){ig.nocache=e?"?"+Date.now():""},log:function(){},assert:function(){},show:function(){},mark:function(){},_loadScript:function(e,t){ig.modules[e]={name:e,requires:[],loaded:!1,body:null};ig._waitForOnload++;var n=ig.prefix+ig.lib+e.replace(/\./g,"/")+".js"+ig.nocache,r=ig.$new("script");r.type="text/javascript";r.src=n;r.onload=function(){ig._waitForOnload--;ig._execModules()};r.onerror=function(){throw"Failed to load module "+e+" at "+n+" required from "+t};ig.$("head")[0].appendChild(r)},_execModules:function(){for(var e=!1,t=0;ig._loadQueue.length>t;t++){for(var n=ig._loadQueue[t],r=!0,i=0;n.requires.length>i;i++){var s=n.requires[i];ig.modules[s]?ig.modules[s].loaded||(r=!1):(r=!1,ig._loadScript(s,n.name))}r&&n.body&&(ig._loadQueue.splice(t,1),n.loaded=!0,n.body(),e=!0,t--)}if(e)ig._execModules();else if(!ig.baked&&0==ig._waitForOnload&&0!=ig._loadQueue.length){e=[];for(t=0;ig._loadQueue.length>t;t++){r=[];s=ig._loadQueue[t].requires;for(i=0;s.length>i;i++)(n=ig.modules[s[i]])&&n.loaded||r.push(s[i]);e.push(ig._loadQueue[t].name+" (requires: "+r.join(", ")+")")}throw"Unresolved (circular?) dependencies. Most likely there's a name/path mismatch for one of the listed modules:\n"+e.join("\n")}},_DOMReady:function(){if(!ig.modules["dom.ready"].loaded){if(!document.body)return setTimeout(ig._DOMReady,13);ig.modules["dom.ready"].loaded=!0;ig._waitForOnload--;ig._execModules()}return 0},_boot:function(){document.location.href.match(/\?nocache/)&&ig.setNocache(!0);ig.ua.pixelRatio=e.devicePixelRatio||1;ig.ua.viewport={width:e.innerWidth,height:e.innerHeight};ig.ua.screen={width:e.screen.availWidth*ig.ua.pixelRatio,height:e.screen.availHeight*ig.ua.pixelRatio};ig.ua.iPhone=/iPhone/i.test(navigator.userAgent);ig.ua.iPhone4=ig.ua.iPhone&&2==ig.ua.pixelRatio;ig.ua.iPad=/iPad/i.test(navigator.userAgent);ig.ua.android=/android/i.test(navigator.userAgent);ig.ua.iOS=ig.ua.iPhone||ig.ua.iPad;ig.ua.mobile=ig.ua.iOS||ig.ua.android},_initDOMReady:function(){return ig.modules["dom.ready"]?(ig._execModules(),void 0):(ig._boot(),ig.modules["dom.ready"]={requires:[],loaded:!1,body:null},ig._waitForOnload++,"complete"===document.readyState?ig._DOMReady():(document.addEventListener("DOMContentLoaded",ig._DOMReady,!1),e.addEventListener("load",ig._DOMReady,!1)),void 0)}};for(var t=["ms","moz","webkit","o"],n=0;t.length>n&&!e.requestAnimationFrame;n++)e.requestAnimationFrame=e[t[n]+"RequestAnimationFrame"];if(e.requestAnimationFrame){var r=1,i={};e.ig.setAnimation=function(t,n){var s=r++;i[s]=!0;var o=function(){i[s]&&(e.requestAnimationFrame(o,n),t())};return e.requestAnimationFrame(o,n),s};e.ig.clearAnimation=function(e){delete i[e]}}else e.ig.setAnimation=function(t){return e.setInterval(t,1e3/60)},e.ig.clearAnimation=function(t){e.clearInterval(t)};var s=!1,o=/xyz/.test(function(){})?/\bparent\b/:/.*/;e.ig.Class=function(){};var u=function(e){var t=this.prototype,n={},r;for(r in e)"function"==typeof e[r]&&"function"==typeof t[r]&&o.test(e[r])?(n[r]=t[r],t[r]=function(e,t){return function(){var r=this.parent;this.parent=n[e];var i=t.apply(this,arguments);return this.parent=r,i}}(r,e[r])):t[r]=e[r]};e.ig.Class.extend=function(t){function n(){if(!s){if(this.staticInstantiate){var e=this.staticInstantiate.apply(this,arguments);if(e)return e}for(var t in this)"object"==typeof this[t]&&(this[t]=ig.copy(this[t]));this.init&&this.init.apply(this,arguments)}return this}var r=this.prototype;s=!0;var i=new this;s=!1;for(var l in t)i[l]="function"==typeof t[l]&&"function"==typeof r[l]&&o.test(t[l])?function(e,t){return function(){var n=this.parent;this.parent=r[e];var i=t.apply(this,arguments);return this.parent=n,i}}(l,t[l]):t[l];return n.prototype=i,n.constructor=n,n.extend=e.ig.Class.extend,n.inject=u,n}})(window);ig.baked=!0;ig.module("impact.image").defines(function(){ig.Image=ig.Class.extend({data:null,width:0,height:0,loaded:!1,failed:!1,loadCallback:null,path:"",staticInstantiate:function(e){return ig.Image.cache[e]||null},init:function(e){this.path=e;this.load()},load:function(e){return this.loaded?(e&&e(this.path,!0),void 0):(!this.loaded&&ig.ready?(this.loadCallback=e||null,this.data=new Image,this.data.onload=this.onload.bind(this),this.data.onerror=this.onerror.bind(this),this.data.src=ig.prefix+this.path+ig.nocache):ig.addResource(this),ig.Image.cache[this.path]=this,void 0)},reload:function(){this.loaded=!1;this.data=new Image;this.data.onload=this.onload.bind(this);this.data.src=this.path+"?"+Date.now()},onload:function(){this.width=this.data.width;this.height=this.data.height;this.loaded=!0;1!=ig.system.scale&&this.resize(ig.system.scale);this.loadCallback&&this.loadCallback(this.path,!0)},onerror:function(){this.failed=!0;this.loadCallback&&this.loadCallback(this.path,!1)},resize:function(e){var t=this.width*e,n=this.height*e,r=ig.$new("canvas");r.width=this.width;r.height=this.height;r=r.getContext("2d");r.drawImage(this.data,0,0,this.width,this.height,0,0,this.width,this.height);var r=r.getImageData(0,0,this.width,this.height),i=ig.$new("canvas");i.width=t;i.height=n;for(var s=i.getContext("2d"),o=s.getImageData(0,0,t,n),u=0;n>u;u++)for(var a=0;t>a;a++){var f=4*(Math.floor(u/e)*this.width+Math.floor(a/e)),l=4*(u*t+a);o.data[l]=r.data[f];o.data[l+1]=r.data[f+1];o.data[l+2]=r.data[f+2];o.data[l+3]=r.data[f+3]}s.putImageData(o,0,0);this.data=i},draw:function(e,t,n,r,i,s){if(this.loaded){var o=ig.system.scale;i=(i?i:this.width)*o;s=(s?s:this.height)*o;ig.system.context.drawImage(this.data,n?n*o:0,r?r*o:0,i,s,ig.system.getDrawPos(e),ig.system.getDrawPos(t),i,s);ig.Image.drawCount++}},drawTile:function(e,t,n,r,i,s,o){if(i=i?i:r,this.loaded&&!(r>this.width||i>this.height)){var u=ig.system.scale,a=Math.floor(r*u),f=Math.floor(i*u),l=s?-1:1,c=o?-1:1;(s||o)&&(ig.system.context.save(),ig.system.context.scale(l,c));ig.system.context.drawImage(this.data,Math.floor(n*r)%this.width*u,Math.floor(n*r/this.width)*i*u,a,f,ig.system.getDrawPos(e)*l-(s?a:0),ig.system.getDrawPos(t)*c-(o?f:0),a,f);(s||o)&&ig.system.context.restore();ig.Image.drawCount++}}});ig.Image.drawCount=0;ig.Image.cache={};ig.Image.reloadCache=function(){for(var e in ig.Image.cache)ig.Image.cache[e].reload()}});ig.baked=!0;ig.module("impact.font").requires("impact.image").defines(function(){ig.Font=ig.Image.extend({widthMap:[],indices:[],firstChar:32,alpha:1,letterSpacing:1,lineSpacing:0,onload:function(e){this._loadMetrics(this.data);this.parent(e)},widthForString:function(e){if(-1!==e.indexOf("\n")){e=e.split("\n");for(var t=0,n=0;e.length>n;n++)t=Math.max(t,this._widthForLine(e[n]));return t}return this._widthForLine(e)},_widthForLine:function(e){for(var t=0,n=0;e.length>n;n++)t+=this.widthMap[e.charCodeAt(n)-this.firstChar]+this.letterSpacing;return t},heightForString:function(e){return e.split("\n").length*(this.height+this.lineSpacing)},draw:function(e,t,n,r){if("string"!=typeof e&&(e+=""),-1===e.indexOf("\n")){if(r==ig.Font.ALIGN.RIGHT||r==ig.Font.ALIGN.CENTER){var i=this._widthForLine(e);t-=r==ig.Font.ALIGN.CENTER?i/2:i}1!==this.alpha&&(ig.system.context.globalAlpha=this.alpha);for(i=0;e.length>i;i++)r=e.charCodeAt(i),t+=this._drawChar(r-this.firstChar,t,n);1!==this.alpha&&(ig.system.context.globalAlpha=1);ig.Image.drawCount+=e.length}else{e=e.split("\n");for(var s=this.height+this.lineSpacing,i=0;e.length>i;i++)this.draw(e[i],t,n+i*s,r)}},_drawChar:function(e,t,n){if(!this.loaded||0>e||e>=this.indices.length)return 0;var r=ig.system.scale,i=this.widthMap[e]*r,s=(this.height-2)*r;return ig.system.context.drawImage(this.data,this.indices[e]*r,0,i,s,ig.system.getDrawPos(t),ig.system.getDrawPos(n),i,s),this.widthMap[e]+this.letterSpacing},_loadMetrics:function(e){this.height=e.height-1;this.widthMap=[];this.indices=[];var t=ig.$new("canvas");t.width=e.width;t.height=e.height;t=t.getContext("2d");t.drawImage(e,0,0);for(var t=t.getImageData(0,e.height-1,e.width,1),n=0,r=0,i=0;e.width>i;i++){var s=4*i+3;0!=t.data[s]?r++:0==t.data[s]&&r&&(this.widthMap.push(r),this.indices.push(i-r),n++,r=0)}this.widthMap.push(r);this.indices.push(i-r)}});ig.Font.ALIGN={LEFT:0,RIGHT:1,CENTER:2}});ig.baked=!0;ig.module("impact.sound").defines(function(){ig.SoundManager=ig.Class.extend({clips:{},volume:1,format:null,init:function(){for(var e=new Audio,t=0;ig.Sound.use.length>t;t++){var n=ig.Sound.use[t];if(e.canPlayType(n.mime)){this.format=n;break}}this.format||(ig.Sound.enabled=!1)},load:function(e,t,n){var r=ig.prefix+e.replace(/[^\.]+$/,this.format.ext)+ig.nocache;if(this.clips[e]){if(t&&ig.Sound.channels>this.clips[e].length)for(t=this.clips[e].length;ig.Sound.channels>t;t++){var i=new Audio(r);i.load();this.clips[e].push(i)}return this.clips[e][0]}var s=new Audio(r);if(n&&(s.addEventListener("canplaythrough",function o(t){s.removeEventListener("canplaythrough",o,!1);n(e,!0,t)},!1),s.addEventListener("error",function(t){n(e,!1,t)},!1)),s.preload="auto",s.load(),this.clips[e]=[s],t)for(t=1;ig.Sound.channels>t;t++)i=new Audio(r),i.load(),this.clips[e].push(i);return s},get:function(e){for(var t=this.clips[e],n=0;e=t[n++];)if(e.paused||e.ended)return e.ended&&(e.currentTime=0),e;return t[0].pause(),t[0].currentTime=0,t[0]}});ig.Music=ig.Class.extend({tracks:[],namedTracks:{},currentTrack:null,currentIndex:0,random:!1,_volume:1,_loop:!1,_fadeInterval:0,_fadeTimer:null,_endedCallbackBound:null,init:function(){this._endedCallbackBound=this._endedCallback.bind(this);Object.defineProperty?(Object.defineProperty(this,"volume",{get:this.getVolume.bind(this),set:this.setVolume.bind(this)}),Object.defineProperty(this,"loop",{get:this.getLooping.bind(this),set:this.setLooping.bind(this)})):this.__defineGetter__&&(this.__defineGetter__("volume",this.getVolume.bind(this)),this.__defineSetter__("volume",this.setVolume.bind(this)),this.__defineGetter__("loop",this.getLooping.bind(this)),this.__defineSetter__("loop",this.setLooping.bind(this)))},add:function(e,t){if(ig.Sound.enabled){var n=ig.soundManager.load(e instanceof ig.Sound?e.path:e,!1);n.loop=this._loop;n.volume=this._volume;n.addEventListener("ended",this._endedCallbackBound,!1);this.tracks.push(n);t&&(this.namedTracks[t]=n);this.currentTrack||(this.currentTrack=n)}},next:function(){this.tracks.length&&(this.stop(),this.currentIndex=this.random?Math.floor(Math.random()*this.tracks.length):(this.currentIndex+1)%this.tracks.length,this.currentTrack=this.tracks[this.currentIndex],this.play())},pause:function(){this.currentTrack&&this.currentTrack.pause()},stop:function(){this.currentTrack&&(this.currentTrack.pause(),this.currentTrack.currentTime=0)},play:function(e){if(e&&this.namedTracks[e])e=this.namedTracks[e],e!=this.currentTrack&&(this.stop(),this.currentTrack=e);else if(!this.currentTrack)return;this.currentTrack.play()},getLooping:function(){return this._loop},setLooping:function(e){this._loop=e;for(var t in this.tracks)this.tracks[t].loop=e},getVolume:function(){return this._volume},setVolume:function(e){this._volume=e.limit(0,1);for(var t in this.tracks)this.tracks[t].volume=this._volume},fadeOut:function(e){this.currentTrack&&(clearInterval(this._fadeInterval),this.fadeTimer=new ig.Timer(e),this._fadeInterval=setInterval(this._fadeStep.bind(this),50))},_fadeStep:function(){var e=this.fadeTimer.delta().map(-this.fadeTimer.target,0,1,0).limit(0,1)*this._volume;.01>=e?(this.stop(),this.currentTrack.volume=this._volume,clearInterval(this._fadeInterval)):this.currentTrack.volume=e},_endedCallback:function(){this._loop?this.play():this.next()}});ig.Sound=ig.Class.extend({path:"",volume:1,currentClip:null,multiChannel:!0,init:function(e,t){this.path=e;this.multiChannel=!1!==t;this.load()},load:function(e){return ig.Sound.enabled?(ig.ready?ig.soundManager.load(this.path,this.multiChannel,e):ig.addResource(this),void 0):(e&&e(this.path,!0),void 0)},play:function(){ig.Sound.enabled&&(this.currentClip=ig.soundManager.get(this.path),this.currentClip.volume=ig.soundManager.volume*this.volume,this.currentClip.play())},stop:function(){this.currentClip&&(this.currentClip.pause(),this.currentClip.currentTime=0)}});ig.Sound.FORMAT={MP3:{ext:"mp3",mime:"audio/mpeg"},M4A:{ext:"m4a",mime:"audio/mp4; codecs=mp4a"},OGG:{ext:"ogg",mime:"audio/ogg; codecs=vorbis"},WEBM:{ext:"webm",mime:"audio/webm; codecs=vorbis"},CAF:{ext:"caf",mime:"audio/x-caf"}};ig.Sound.use=[ig.Sound.FORMAT.OGG,ig.Sound.FORMAT.MP3];ig.Sound.channels=4;ig.Sound.enabled=!0});ig.baked=!0;ig.module("impact.loader").requires("impact.image","impact.font","impact.sound").defines(function(){ig.Loader=ig.Class.extend({resources:[],gameClass:null,status:0,done:!1,_unloaded:[],_drawStatus:0,_intervalId:0,_loadCallbackBound:null,init:function(e,t){this.gameClass=e;this.resources=t;this._loadCallbackBound=this._loadCallback.bind(this);for(var n=0;this.resources.length>n;n++)this._unloaded.push(this.resources[n].path)},load:function(){if(ig.system.clear("#000"),!this.resources.length)return this.end(),void 0;for(var e=0;this.resources.length>e;e++)this.loadResource(this.resources[e]);this._intervalId=setInterval(this.draw.bind(this),16)},loadResource:function(e){e.load(this._loadCallbackBound)},end:function(){this.done||(this.done=!0,clearInterval(this._intervalId),ig.system.setGame(this.gameClass))},draw:function(){this._drawStatus+=(this.status-this._drawStatus)/5;var e=ig.system.scale,t=.6*ig.system.width,n=.1*ig.system.height,r=.5*ig.system.width-t/2,i=.5*ig.system.height-n/2;ig.system.context.fillStyle="#000";ig.system.context.fillRect(0,0,480,320);ig.system.context.fillStyle="#fff";ig.system.context.fillRect(r*e,i*e,t*e,n*e);ig.system.context.fillStyle="#000";ig.system.context.fillRect(r*e+e,i*e+e,t*e-e-e,n*e-e-e);ig.system.context.fillStyle="#fff";ig.system.context.fillRect(r*e,i*e,t*e*this._drawStatus,n*e)},_loadCallback:function(e,t){if(!t)throw"Failed to load resource: "+e;this._unloaded.erase(e);this.status=1-this._unloaded.length/this.resources.length;0==this._unloaded.length&&setTimeout(this.end.bind(this),250)}})});ig.baked=!0;ig.module("impact.timer").defines(function(){ig.Timer=ig.Class.extend({target:0,base:0,last:0,pausedAt:0,init:function(e){this.last=this.base=ig.Timer.time;this.target=e||0},set:function(e){this.target=e||0;this.base=ig.Timer.time;this.pausedAt=0},reset:function(){this.base=ig.Timer.time;this.pausedAt=0},tick:function(){var e=ig.Timer.time-this.last;return this.last=ig.Timer.time,this.pausedAt?0:e},delta:function(){return(this.pausedAt||ig.Timer.time)-this.base-this.target},pause:function(){this.pausedAt||(this.pausedAt=ig.Timer.time)},unpause:function(){this.pausedAt&&(this.base+=ig.Timer.time-this.pausedAt,this.pausedAt=0)}});ig.Timer._last=0;ig.Timer.time=0;ig.Timer.timeScale=1;ig.Timer.maxStep=.05;ig.Timer.step=function(){var e=Date.now();ig.Timer.time+=Math.min((e-ig.Timer._last)/1e3,ig.Timer.maxStep)*ig.Timer.timeScale;ig.Timer._last=e}});ig.baked=!0;ig.module("impact.system").requires("impact.timer","impact.image").defines(function(){ig.System=ig.Class.extend({fps:30,width:320,height:240,realWidth:320,realHeight:240,scale:1,tick:0,animationId:0,newGameClass:null,running:!1,delegate:null,clock:null,canvas:null,context:null,init:function(e,t,n,r,i){this.fps=t;this.clock=new ig.Timer;this.canvas=ig.$(e);this.resize(n,r,i);this.context=this.canvas.getContext("2d");this.getDrawPos=ig.System.drawMode},resize:function(e,t,n){this.width=e;this.height=t;this.scale=n||this.scale;this.realWidth=this.width*this.scale;this.realHeight=this.height*this.scale;this.canvas.width=this.realWidth;this.canvas.height=this.realHeight},setGame:function(e){this.running?this.newGameClass=e:this.setGameNow(e)},setGameNow:function(e){ig.game=new e;ig.system.setDelegate(ig.game)},setDelegate:function(e){if("function"!=typeof e.run)throw"System.setDelegate: No run() function in object";this.delegate=e;this.startRunLoop()},stopRunLoop:function(){ig.clearAnimation(this.animationId);this.running=!1},startRunLoop:function(){this.stopRunLoop();this.animationId=ig.setAnimation(this.run.bind(this),this.canvas);this.running=!0},clear:function(e){this.context.fillStyle=e;this.context.fillRect(0,0,this.realWidth,this.realHeight)},run:function(){!0!==SG_Pause1&&(ig.Timer.step(),this.tick=this.clock.tick(),this.delegate.run(),ig.input.clearPressed(),this.newGameClass&&(this.setGameNow(this.newGameClass),this.newGameClass=null))},getDrawPos:null});ig.System.DRAW={AUTHENTIC:function(e){return Math.round(e)*this.scale},SMOOTH:function(e){return Math.round(e*this.scale)},SUBPIXEL:function(e){return e*this.scale}};ig.System.drawMode=ig.System.DRAW.SMOOTH});ig.baked=!0;ig.module("impact.input").defines(function(){ig.KEY={MOUSE1:-1,MOUSE2:-3,MWHEEL_UP:-4,MWHEEL_DOWN:-5,BACKSPACE:8,TAB:9,ENTER:13,PAUSE:19,CAPS:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,_0:48,_1:49,_2:50,_3:51,_4:52,_5:53,_6:54,_7:55,_8:56,_9:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,MULTIPLY:106,ADD:107,SUBSTRACT:109,DECIMAL:110,DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SHIFT:16,CTRL:17,ALT:18,PLUS:187,COMMA:188,MINUS:189,PERIOD:190};ig.Input=ig.Class.extend({bindings:{},actions:{},presses:{},locks:{},delayedKeyup:{},isUsingMouse:!1,isUsingKeyboard:!1,isUsingAccelerometer:!1,mouse:{x:0,y:0},accel:{x:0,y:0,z:0},initMouse:function(){if(!this.isUsingMouse){this.isUsingMouse=!0;var e=this.mousewheel.bind(this);ig.system.canvas.addEventListener("mousewheel",e,!1);ig.system.canvas.addEventListener("DOMMouseScroll",e,!1);ig.system.canvas.addEventListener("contextmenu",this.contextmenu.bind(this),!1);ig.system.canvas.addEventListener("mousedown",this.keydown.bind(this),!1);ig.system.canvas.addEventListener("mouseup",this.keyup.bind(this),!1);ig.system.canvas.addEventListener("mousemove",this.mousemove.bind(this),!1);ig.system.canvas.addEventListener("touchstart",this.keydown.bind(this),!1);ig.system.canvas.addEventListener("touchend",this.keyup.bind(this),!1);ig.system.canvas.addEventListener("touchmove",this.mousemove.bind(this),!1)}},initKeyboard:function(){this.isUsingKeyboard||(this.isUsingKeyboard=!0,window.addEventListener("keydown",this.keydown.bind(this),!1),window.addEventListener("keyup",this.keyup.bind(this),!1))},initAccelerometer:function(){this.isUsingAccelerometer||window.addEventListener("devicemotion",this.devicemotion.bind(this),!1)},mousewheel:function(e){var t=this.bindings[0<(e.wheelDelta?e.wheelDelta:-1*e.detail)?ig.KEY.MWHEEL_UP:ig.KEY.MWHEEL_DOWN];t&&(this.actions[t]=!0,this.presses[t]=!0,this.delayedKeyup[t]=!0,e.stopPropagation(),e.preventDefault())},mousemove:function(e){for(var t=ig.system.canvas,n=0,r=0;null!=t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;var t=e.pageX,i=e.pageY;e.touches&&(t=e.touches[0].clientX,i=e.touches[0].clientY);this.mouse.x=(t-n)/ig.system.scale;this.mouse.y=(i-r)/ig.system.scale},contextmenu:function(e){this.bindings[ig.KEY.MOUSE2]&&(e.stopPropagation(),e.preventDefault())},keydown:function(e){if("text"!=e.target.type){var t="keydown"==e.type?e.keyCode:2==e.button?ig.KEY.MOUSE2:ig.KEY.MOUSE1;"touchstart"!=e.type&&"mousedown"!=e.type||this.mousemove(e);(t=this.bindings[t])&&(this.actions[t]=!0,this.locks[t]||(this.presses[t]=!0,this.locks[t]=!0),e.stopPropagation(),e.preventDefault())}},keyup:function(e){if("text"!=e.target.type){var t=this.bindings["keyup"==e.type?e.keyCode:2==e.button?ig.KEY.MOUSE2:ig.KEY.MOUSE1];t&&(this.delayedKeyup[t]=!0,e.stopPropagation(),e.preventDefault())}},devicemotion:function(e){this.accel=e.accelerationIncludingGravity},bind:function(e,t){0>e?this.initMouse():0ig.system.width||t>ig.system.height||0>e+n||0>t+n||(1!=this.alpha&&(ig.system.context.globalAlpha=this.alpha),0==this.angle?this.sheet.image.drawTile(e,t,this.tile,this.sheet.width,this.sheet.height,this.flip.x,this.flip.y):(ig.system.context.save(),ig.system.context.translate(ig.system.getDrawPos(e+this.pivot.x),ig.system.getDrawPos(t+this.pivot.y)),ig.system.context.rotate(this.angle),this.sheet.image.drawTile(-this.pivot.x,-this.pivot.y,this.tile,this.sheet.width,this.sheet.height,this.flip.x,this.flip.y),ig.system.context.restore()),1!=this.alpha&&(ig.system.context.globalAlpha=1))}})});ig.baked=!0;ig.module("impact.entity").requires("impact.animation","impact.impact").defines(function(){ig.Entity=ig.Class.extend({id:0,settings:{},size:{x:16,y:16},offset:{x:0,y:0},pos:{x:0,y:0},last:{x:0,y:0},vel:{x:0,y:0},accel:{x:0,y:0},friction:{x:0,y:0},maxVel:{x:100,y:100},zIndex:0,gravityFactor:1,standing:!1,bounciness:0,minBounceVelocity:40,anims:{},animSheet:null,currentAnim:null,health:10,type:0,checkAgainst:0,collides:0,_killed:!1,slopeStanding:{min:44..toRad(),max:136..toRad()},init:function(e,t,n){this.id=++ig.Entity._lastId;this.pos.x=e;this.pos.y=t;ig.merge(this,n)},addAnim:function(e,t,n,r){if(!this.animSheet)throw"No animSheet to add the animation "+e+" to.";t=new ig.Animation(this.animSheet,t,n,r);return this.anims[e]=t,this.currentAnim||(this.currentAnim=t),t},update:function(){this.last.x=this.pos.x;this.last.y=this.pos.y;this.vel.y+=ig.game.gravity*ig.system.tick*this.gravityFactor;this.vel.x=this.getNewVelocity(this.vel.x,this.accel.x,this.friction.x,this.maxVel.x);this.vel.y=this.getNewVelocity(this.vel.y,this.accel.y,this.friction.y,this.maxVel.y);var e=ig.game.collisionMap.trace(this.pos.x,this.pos.y,this.vel.x*ig.system.tick,this.vel.y*ig.system.tick,this.size.x,this.size.y);this.handleMovementTrace(e);this.currentAnim&&this.currentAnim.update()},getNewVelocity:function(e,t,n,r){return t?(e+t*ig.system.tick).limit(-r,r):n?(t=n*ig.system.tick,0e+t?e+t:0):e.limit(-r,r)},handleMovementTrace:function(e){if(this.standing=!1,e.collision.y&&(0this.minBounceVelocity?this.vel.y*=-this.bounciness:(0this.minBounceVelocity?this.vel.x*=-this.bounciness:this.vel.x=0),e.collision.slope){var t=e.collision.slope;if(0this.slopeStanding.min&&this.slopeStanding.max>t&&(this.standing=!0)}this.pos=e.pos},draw:function(){this.currentAnim&&this.currentAnim.draw(this.pos.x-this.offset.x-ig.game._rscreen.x,this.pos.y-this.offset.y-ig.game._rscreen.y)},kill:function(){ig.game.removeEntity(this)},receiveDamage:function(e){this.health-=e;0>=this.health&&this.kill()},touches:function(e){return!(this.pos.x>=e.pos.x+e.size.x||e.pos.x>=this.pos.x+this.size.x||this.pos.y>=e.pos.y+e.size.y||e.pos.y>=this.pos.y+this.size.y)},distanceTo:function(e){var t=this.pos.x+this.size.x/2-(e.pos.x+e.size.x/2);e=this.pos.y+this.size.y/2-(e.pos.y+e.size.y/2);return Math.sqrt(t*t+e*e)},angleTo:function(e){return Math.atan2(e.pos.y+e.size.y/2-(this.pos.y+this.size.y/2),e.pos.x+e.size.x/2-(this.pos.x+this.size.x/2))},check:function(){},collideWith:function(){},ready:function(){}});ig.Entity._lastId=0;ig.Entity.COLLIDES={NEVER:0,LITE:1,PASSIVE:2,ACTIVE:4,FIXED:8};ig.Entity.TYPE={NONE:0,A:1,B:2,BOTH:3};ig.Entity.checkPair=function(e,t){e.checkAgainst&t.type&&e.check(t);t.checkAgainst&e.type&&t.check(e);e.collides&&t.collides&&e.collides+t.collides>ig.Entity.COLLIDES.ACTIVE&&ig.Entity.solveCollision(e,t)};ig.Entity.solveCollision=function(e,t){var n=null;e.collides==ig.Entity.COLLIDES.LITE||t.collides==ig.Entity.COLLIDES.FIXED?n=e:(t.collides==ig.Entity.COLLIDES.LITE||e.collides==ig.Entity.COLLIDES.FIXED)&&(n=t);e.last.x+e.size.x>t.last.x&&t.last.x+t.size.x>e.last.x?(t.last.y>e.last.y?ig.Entity.seperateOnYAxis(e,t,n):ig.Entity.seperateOnYAxis(t,e,n),e.collideWith(t,"y"),t.collideWith(e,"y")):e.last.y+e.size.y>t.last.y&&t.last.y+t.size.y>e.last.y&&(t.last.x>e.last.x?ig.Entity.seperateOnXAxis(e,t,n):ig.Entity.seperateOnXAxis(t,e,n),e.collideWith(t,"x"),t.collideWith(e,"x"))};ig.Entity.seperateOnXAxis=function(e,t,n){var r=e.pos.x+e.size.x-t.pos.x;n?(n.vel.x=-n.vel.x*n.bounciness+(e===n?t:e).vel.x,t=ig.game.collisionMap.trace(n.pos.x,n.pos.y,n==e?-r:r,0,n.size.x,n.size.y),n.pos.x=t.pos.x):(n=(e.vel.x-t.vel.x)/2,e.vel.x=-n,t.vel.x=n,n=ig.game.collisionMap.trace(e.pos.x,e.pos.y,-r/2,0,e.size.x,e.size.y),e.pos.x=Math.floor(n.pos.x),e=ig.game.collisionMap.trace(t.pos.x,t.pos.y,r/2,0,t.size.x,t.size.y),t.pos.x=Math.ceil(e.pos.x))};ig.Entity.seperateOnYAxis=function(e,t,n){var r=e.pos.y+e.size.y-t.pos.y;if(n){t=e===n?t:e;n.vel.y=-n.vel.y*n.bounciness+t.vel.y;var i=0;n==e&&n.minBounceVelocity>Math.abs(n.vel.y-t.vel.y)&&(n.standing=!0,i=t.vel.x*ig.system.tick);e=ig.game.collisionMap.trace(n.pos.x,n.pos.y,i,n==e?-r:r,n.size.x,n.size.y);n.pos.y=e.pos.y;n.pos.x=e.pos.x}else ig.game.gravity&&(t.standing||0e.minBounceVelocity?e.vel.y*=-e.bounciness:(e.standing=!0,e.vel.y=0)):(n=(e.vel.y-t.vel.y)/2,e.vel.y=-n,t.vel.y=n,i=t.vel.x*ig.system.tick,n=ig.game.collisionMap.trace(e.pos.x,e.pos.y,i,-r/2,e.size.x,e.size.y),e.pos.y=n.pos.y,e=ig.game.collisionMap.trace(t.pos.x,t.pos.y,0,r/2,t.size.x,t.size.y),t.pos.y=e.pos.y)}});ig.baked=!0;ig.module("impact.map").defines(function(){ig.Map=ig.Class.extend({tilesize:8,width:1,height:1,data:[[]],name:null,init:function(e,t){this.tilesize=e;this.data=t;this.height=t.length;this.width=t[0].length},getTile:function(e,t){var n=Math.floor(e/this.tilesize),r=Math.floor(t/this.tilesize);return 0<=n&&this.width>n&&0<=r&&this.height>r?this.data[r][n]:0},setTile:function(e,t,n){e=Math.floor(e/this.tilesize);t=Math.floor(t/this.tilesize);0<=e&&this.width>e&&0<=t&&this.height>t&&(this.data[t][e]=n)}})});ig.baked=!0;ig.module("impact.collision-map").requires("impact.map").defines(function(){ig.CollisionMap=ig.Map.extend({lastSlope:1,tiledef:null,init:function(e,t,n){this.parent(e,t);this.tiledef=n||ig.CollisionMap.defaultTileDef;for(var r in this.tiledef)r|0>this.lastSlope&&(this.lastSlope=r|0)},trace:function(e,t,n,r,i,s){var o={collision:{x:!1,y:!1,slope:!1},pos:{x:e,y:t},tile:{x:0,y:0}},u=Math.ceil(Math.max(Math.abs(n),Math.abs(r))/this.tilesize);if(1l&&(a||f)&&(this._traceStep(o,e,t,a,f,i,s,n,r,l),e=o.pos.x,t=o.pos.y,o.collision.x&&(a=0,n=0),o.collision.y&&(f=0,r=0),!o.collision.slope);l++);else this._traceStep(o,e,t,n,r,i,s,n,r,0);return o},_traceStep:function(e,t,n,r,i,s,o,u,a,f){e.pos.x+=r;e.pos.y+=i;var l=0;if(r){var c=0r?this.tilesize:0,p=Math.max(Math.floor(n/this.tilesize),0),d=Math.min(Math.ceil((n+o)/this.tilesize),this.height);r=Math.floor((e.pos.x+c)/this.tilesize);var v=Math.floor((t+c)/this.tilesize);if((0v||v>=this.width)&&(v=-1),0<=r&&this.width>r)for(;d>p&&!(-1!=v&&(l=this.data[p][v],1=l&&this._checkTileDef(e,l,t,n,u,a,s,o,v,p)));p++)if(l=this.data[p][r],1==l||l>this.lastSlope||1=l&&e.collision.slope)break;e.collision.x=!0;e.tile.x=l;t=e.pos.x=r*this.tilesize-c+h;u=0;break}}if(i&&(c=0i?this.tilesize:0,r=Math.max(Math.floor(e.pos.x/this.tilesize),0),h=Math.min(Math.ceil((e.pos.x+s)/this.tilesize),this.width),p=Math.floor((e.pos.y+c)/this.tilesize),d=Math.floor((n+c)/this.tilesize),(0d||d>=this.height)&&(d=-1),0<=p&&this.height>p))for(;h>r&&!(-1!=d&&(l=this.data[d][r],1=l&&this._checkTileDef(e,l,t,n,u,a,s,o,r,d)));r++)if(l=this.data[p][r],1==l||l>this.lastSlope||1=l&&e.collision.slope)break;e.collision.y=!0;e.tile.y=l;e.pos.y=p*this.tilesize-c+i;break}},_checkTileDef:function(e,t,n,r,i,s,o,u,a,f){var l=this.tiledef[t];if(!l)return!1;t=(l[2]-l[0])*this.tilesize;var c=(l[3]-l[1])*this.tilesize,h=l[4];o=n+i+(0>c?o:0)-(a+l[0])*this.tilesize;u=r+s+(0i*-c+s*t)return h;a=Math.sqrt(t*t+c*c);f=c/a;a=-t/a;var p=o*f+u*a,l=f*p,p=a*p;return l*l+p*p>=i*i+s*s?h||.5>t*(u-s)-c*(o-i):(e.pos.x=n+i-l,e.pos.y=r+s-p,e.collision.slope={x:t,y:c,nx:f,ny:a},!0)}return!1}});var e=1/3,t=2/3;ig.CollisionMap.defaultTileDef={5:[0,1,1,t,!0],6:[0,t,1,e,!0],7:[0,e,1,0,!0],3:[0,1,1,.5,!0],4:[0,.5,1,0,!0],2:[0,1,1,0,!0],10:[.5,1,1,0,!0],21:[0,1,.5,0,!0],32:[t,1,1,0,!0],43:[e,1,t,0,!0],54:[0,1,e,0,!0],27:[0,0,1,e,!0],28:[0,e,1,t,!0],29:[0,t,1,1,!0],25:[0,0,1,.5,!0],26:[0,.5,1,1,!0],24:[0,0,1,1,!0],11:[0,0,.5,1,!0],22:[.5,0,1,1,!0],33:[0,0,e,1,!0],44:[e,0,t,1,!0],55:[t,0,1,1,!0],16:[1,e,0,0,!0],17:[1,t,0,e,!0],18:[1,1,0,t,!0],14:[1,.5,0,0,!0],15:[1,1,0,.5,!0],13:[1,1,0,0,!0],8:[.5,1,0,0,!0],19:[1,1,.5,0,!0],30:[e,1,0,0,!0],41:[t,1,e,0,!0],52:[1,1,t,0,!0],38:[1,t,0,1,!0],39:[1,e,0,t,!0],40:[1,0,0,e,!0],36:[1,.5,0,1,!0],37:[1,0,0,.5,!0],35:[1,0,0,1,!0],9:[1,0,.5,1,!0],20:[.5,0,0,1,!0],31:[1,0,t,1,!0],42:[t,0,e,1,!0],53:[e,0,0,1,!0],12:[0,0,1,0,!1],23:[1,1,0,1,!1],34:[1,0,1,1,!1],45:[0,1,0,0,!1]};ig.CollisionMap.staticNoCollision={trace:function(e,t,n,r){return{collision:{x:!1,y:!1,slope:!1},pos:{x:e+n,y:t+r},tile:{x:0,y:0}}}}});ig.baked=!0;ig.module("impact.background-map").requires("impact.map","impact.image").defines(function(){ig.BackgroundMap=ig.Map.extend({tiles:null,scroll:{x:0,y:0},distance:1,repeat:!1,tilesetName:"",foreground:!1,enabled:!0,preRender:!1,preRenderedChunks:null,chunkSize:512,debugChunks:!1,anims:{},init:function(e,t,n){this.parent(e,t);this.setTileset(n)},setTileset:function(e){this.tilesetName=e instanceof ig.Image?e.path:e;this.tiles=new ig.Image(this.tilesetName);this.preRenderedChunks=null},setScreenPos:function(e,t){this.scroll.x=e/this.distance;this.scroll.y=t/this.distance},preRenderMapToChunks:function(){var e=this.width*this.tilesize*ig.system.scale,t=this.height*this.tilesize*ig.system.scale,n=Math.ceil(e/this.chunkSize),r=Math.ceil(t/this.chunkSize);this.preRenderedChunks=[];for(var i=0;r>i;i++){this.preRenderedChunks[i]=[];for(var s=0;n>s;s++)this.preRenderedChunks[i][s]=this.preRenderChunk(s,i,s==n-1?e-s*this.chunkSize:this.chunkSize,i==r-1?t-i*this.chunkSize:this.chunkSize)}},preRenderChunk:function(e,t,n,r){var i=n/this.tilesize/ig.system.scale+1,s=r/this.tilesize/ig.system.scale+1,o=e*this.chunkSize/ig.system.scale%this.tilesize,u=t*this.chunkSize/ig.system.scale%this.tilesize;e=Math.floor(e*this.chunkSize/this.tilesize/ig.system.scale);t=Math.floor(t*this.chunkSize/this.tilesize/ig.system.scale);var a=ig.$new("canvas");a.width=n;a.height=r;n=ig.system.context;ig.system.context=a.getContext("2d");for(r=0;i>r;r++)for(var f=0;s>f;f++)if(this.width>r+e&&this.height>f+t){var l=this.data[f+t][r+e];l&&this.tiles.drawTile(r*this.tilesize-o,f*this.tilesize-u,l-1,this.tilesize)}return ig.system.context=n,a},draw:function(){this.tiles.loaded&&this.enabled&&(this.preRender?this.drawPreRendered():this.drawTiled())},drawPreRendered:function(){this.preRenderedChunks||this.preRenderMapToChunks();var e=ig.system.getDrawPos(this.scroll.x),t=ig.system.getDrawPos(this.scroll.y);this.repeat&&(e%=this.width*this.tilesize*ig.system.scale,t%=this.height*this.tilesize*ig.system.scale);var n=Math.max(Math.floor(e/this.chunkSize),0),r=Math.max(Math.floor(t/this.chunkSize),0),i=Math.ceil((e+ig.system.realWidth)/this.chunkSize),s=Math.ceil((t+ig.system.realHeight)/this.chunkSize),o=this.preRenderedChunks[0].length,u=this.preRenderedChunks.length;this.repeat||(i=Math.min(i,o),s=Math.min(s,u));for(var a=0;s>r;r++){for(var f=0,l=n;i>l;l++){var c=this.preRenderedChunks[r%u][l%o],h=-e+l*this.chunkSize-f,p=-t+r*this.chunkSize-a;ig.system.context.drawImage(c,h,p);ig.Image.drawCount++;this.debugChunks&&(ig.system.context.strokeStyle="#f0f",ig.system.context.strokeRect(h,p,this.chunkSize,this.chunkSize));this.repeat&&this.chunkSize>c.width&&ig.system.realWidth>h+c.width&&(f=this.chunkSize-c.width,i++)}this.repeat&&this.chunkSize>c.height&&ig.system.realHeight>p+c.height&&(a=this.chunkSize-c.height,s++)}},drawTiled:function(){for(var e=0,t=null,n=(this.scroll.x/this.tilesize).toInt(),r=(this.scroll.y/this.tilesize).toInt(),i=this.scroll.x%this.tilesize,s=this.scroll.y%this.tilesize,o=-i-this.tilesize,i=ig.system.width+this.tilesize-i,u=ig.system.height+this.tilesize-s,a=-1,s=-s-this.tilesize;u>s;a++,s+=this.tilesize){var f=a+r;if(f>=this.height||0>f){if(!this.repeat)continue;f=0c;l++,c+=this.tilesize){var h=l+n;if(h>=this.width||0>h){if(!this.repeat)continue;h=0t;t++){var n=e.entities[t];this.spawnEntity(n.type,n.x,n.y,n.settings)}this.sortEntities();this.collisionMap=ig.CollisionMap.staticNoCollision;this.backgroundMaps=[];for(t=0;e.layer.length>t;t++)if(n=e.layer[t],"collision"==n.name)this.collisionMap=new ig.CollisionMap(n.tilesize,n.data);else{var r=new ig.BackgroundMap(n.tilesize,n.data,n.tilesetName);r.anims=this.backgroundAnims[n.tilesetName]||{};r.repeat=n.repeat;r.distance=n.distance;r.foreground=!!n.foreground;r.preRender=!!n.preRender;r.name=n.name;this.backgroundMaps.push(r)}for(t=0;this.entities.length>t;t++)this.entities[t].ready()},loadLevelDeferred:function(e){this._levelToLoad=e},getMapByName:function(e){if("collision"==e)return this.collisionMap;for(var t=0;this.backgroundMaps.length>t;t++)if(this.backgroundMaps[t].name==e)return this.backgroundMaps[t];return null},getEntityByName:function(e){return this.namedEntities[e]},getEntitiesByType:function(e){e="string"==typeof e?ig.global[e]:e;for(var t=[],n=0;this.entities.length>n;n++){var r=this.entities[n];r instanceof e&&!r._killed&&t.push(r)}return t},spawnEntity:function(e,t,n,r){var i="string"==typeof e?ig.global[e]:e;if(!i)throw"Can't spawn entity of type "+e;e=new i(t,n,r||{});return this.entities.push(e),e.name&&(this.namedEntities[e.name]=e),e},sortEntities:function(){this.entities.sort(this.sortBy)},sortEntitiesDeferred:function(){this._doSortEntities=!0},removeEntity:function(e){e.name&&delete this.namedEntities[e.name];e._killed=!0;e.type=ig.Entity.TYPE.NONE;e.checkAgainst=ig.Entity.TYPE.NONE;e.collides=ig.Entity.COLLIDES.NEVER;this._deferredKill.push(e)},run:function(){this.update();this.draw()},update:function(){this._levelToLoad&&(this.loadLevel(this._levelToLoad),this._levelToLoad=null);(this._doSortEntities||this.autoSort)&&(this.sortEntities(),this._doSortEntities=!1);this.updateEntities();this.checkEntities();for(var e=0;this._deferredKill.length>e;e++)this.entities.erase(this._deferredKill[e]);this._deferredKill=[];for(var t in this.backgroundAnims){var e=this.backgroundAnims[t],n;for(n in e)e[n].update()}},updateEntities:function(){for(var e=0;this.entities.length>e;e++){var t=this.entities[e];t._killed||t.update()}},draw:function(){this.clearColor&&ig.system.clear(this.clearColor);this._rscreen.x=ig.system.getDrawPos(this.screen.x)/ig.system.scale;this._rscreen.y=ig.system.getDrawPos(this.screen.y)/ig.system.scale;var e;for(e=0;this.backgroundMaps.length>e;e++){var t=this.backgroundMaps[e];if(t.foreground)break;t.setScreenPos(this.screen.x,this.screen.y);t.draw()}this.drawEntities();for(e;this.backgroundMaps.length>e;e++)t=this.backgroundMaps[e],t.setScreenPos(this.screen.x,this.screen.y),t.draw()},drawEntities:function(){for(var e=0;this.entities.length>e;e++)this.entities[e].draw()},checkEntities:function(){for(var e={},t=0;this.entities.length>t;t++){var n=this.entities[t];if(n.type!=ig.Entity.TYPE.NONE||n.checkAgainst!=ig.Entity.TYPE.NONE||n.collides!=ig.Entity.COLLIDES.NEVER)for(var r={},i=Math.floor(n.pos.y/this.cellSize),s=Math.floor((n.pos.x+n.size.x)/this.cellSize)+1,o=Math.floor((n.pos.y+n.size.y)/this.cellSize)+1,u=Math.floor(n.pos.x/this.cellSize);s>u;u++)for(var a=i;o>a;a++)if(e[u])if(e[u][a]){for(var f=e[u][a],l=0;f.length>l;l++)n.touches(f[l])&&!r[f[l].id]&&(r[f[l].id]=!0,ig.Entity.checkPair(n,f[l]));f.push(n)}else e[u][a]=[n];else e[u]={},e[u][a]=[n]}}});ig.Game.SORT={Z_INDEX:function(e,t){return e.zIndex-t.zIndex},POS_X:function(e,t){return e.pos.x+e.size.x-(t.pos.x+t.size.x)},POS_Y:function(e,t){return e.pos.y+e.size.y-(t.pos.y+t.size.y)}}});ig.baked=!0;ig.module("plugins.path").requires("impact.entity").defines(function(){ig.Entity.inject({entityVelocity:.5,entityDelay:0,curvesCount:0,velocity:0,t:0,pathCoords:[],points:[],entityAngle:0,tiempo:new ig.Timer,followBezierPath:function(e,t,n,r,i,s){void 0!==n&&null!==n||(n=!1);t=[];i=[];s=[];var o=[],u=[];this.entityAngle+=.1;for(var a=this.pathCoords,f=0;a.length>f;f++){u.push(a[f]);for(var l=0;u[f].length-3>l;l+=3)t.push(u[f][l]),i.push(u[f][l+1]),s.push(u[f][l+2]),o.push(u[f][l+3])}this.points.push(t,i,s,o);t=this.t;(this.t+=e*ig.system.tick,this.curvesCount!==this.points[0].length)?(i=3*(this.points[1][this.curvesCount].x-this.points[0][this.curvesCount].x),s=3*(this.points[2][this.curvesCount].x-this.points[1][this.curvesCount].x)-i,e=3*(this.points[1][this.curvesCount].y-this.points[0][this.curvesCount].y),n=3*(this.points[2][this.curvesCount].y-this.points[1][this.curvesCount].y)-e,i=(this.points[3][this.curvesCount].x-this.points[0][this.curvesCount].x-i-s)*t*t*t+s*t*t+i*t+this.points[0][this.curvesCount].x,e=(this.points[3][this.curvesCount].y-this.points[0][this.curvesCount].y-e-n)*t*t*t+n*t*t+e*t+this.points[0][this.curvesCount].y,r?(this.pos.x=2*Math.sin(this.entityAngle)+i-this.size.x/2,this.pos.y=e-this.size.y/2):(this.pos.x=i-this.size.x/2,this.pos.y=e-this.size.y/2),1e;e++)ig.system.context.moveTo(this.points[0][e].x,this.points[0][e].y),ig.system.context.bezierCurveTo(this.points[1][e].x,this.points[1][e].y,this.points[2][e].x,this.points[2][e].y,this.points[3][e].x,this.points[3][e].y),ig.system.context.stroke();ig.system.context.closePath()}})});ig.baked=!0;ig.module("plugins.tween").requires("impact.entity").defines(function(){Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){for(var n=0;this.length>n;++n)if(this[n]===e)return n;return-1});ig.Entity.prototype.tweens=[];ig.Entity.prototype._preTweenUpdate=ig.Entity.prototype.update;ig.Entity.prototype.update=function(){if(this._preTweenUpdate(),0t;t++)this.tweens[t].update(),this.tweens[t].complete||e.push(this.tweens[t]);this.tweens=e}};ig.Entity.prototype.tween=function(e,t,n){e=new ig.Tween(this,e,t,n);return this.tweens.push(e),e};ig.Entity.prototype.pauseTweens=function(){for(var e=0;this.tweens.length>e;e++)this.tweens[e].pause()};ig.Entity.prototype.resumeTweens=function(){for(var e=0;this.tweens.length>e;e++)this.tweens[e].resume()};ig.Entity.prototype.stopTweens=function(e){for(var t=0;this.tweens.length>t;t++)this.tweens[t].stop(e)};ig.Tween=function(e,t,n,r){var i={},s={},o={},u=0,a=!1,f=!1,l=!1;this.duration=n;this.paused=this.complete=!1;this.easing=ig.Tween.Easing.Linear.EaseNone;this.onComplete=!1;this.loop=this.delay=0;this.loopCount=-1;ig.merge(this,r);this.loopNum=this.loopCount;this.chain=function(e){l=e};this.initEnd=function(e,t,n){if("object"!=typeof t[e])n[e]=t[e];else for(subprop in t[e])n[e]||(n[e]={}),this.initEnd(subprop,t[e],n[e])};this.initStart=function(e,t,n,r){window.scrollTo(0,1);rotationImg=document.getElementById("rotate");orientationCall(!0);if("object"!=typeof n[e])void 0!==t[e]&&(r[e]=n[e]);else for(subprop in n[e])r[e]||(r[e]={}),void 0!==t[e]&&this.initStart(subprop,t[e],n[e],r[e])};this.start=function(){this.paused=this.complete=!1;this.loopNum=this.loopCount;u=0;-1==e.tweens.indexOf(this)&&e.tweens.push(this);f=!0;a=new ig.Timer;for(var n in t)this.initEnd(n,t,s);for(n in s)this.initStart(n,s,e,i),this.initDelta(n,o,e,s)};this.initDelta=function(e,t,n,r){if("object"!=typeof r[e])t[e]=r[e]-n[e];else for(subprop in r[e])t[e]||(t[e]={}),this.initDelta(subprop,t[e],n[e],r[e])};this.propUpdate=function(e,t,n,r,i){if("object"!=typeof n[e])t[e]=void 0!==n[e]?n[e]+r[e]*i:t[e];else for(subprop in n[e])this.propUpdate(subprop,t[e],n[e],r[e],i)};this.propSet=function(e,t,n){if("object"!=typeof t[e])n[e]=t[e];else for(subprop in t[e])n[e]||(n[e]={}),this.propSet(subprop,t[e],n[e])};this.update=function(){if(!f)return!1;if(this.delay){if(this.delay>a.delta())return;this.delay=0;a.reset()}if(this.paused||this.complete)return!1;var t=(a.delta()+u)/this.duration,t=1(e*=2)?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)};ig.Tween.Easing.Back.EaseIn=function(e){return e*e*(2.70158*e-1.70158)};ig.Tween.Easing.Back.EaseOut=function(e){return(e-=1)*e*(2.70158*e+1.70158)+1};ig.Tween.Easing.Back.EaseInOut=function(e){return 1>(e*=2)?.5*e*e*(3.5949095*e-2.5949095):.5*((e-=2)*e*(3.5949095*e+2.5949095)+2)}});ig.baked=!0;ig.module("game.entities.starfield").requires("impact.entity").defines(function(){EntityStarfield=ig.Entity.extend({size:{x:32,y:32},animSheet:new ig.AnimationSheet(imgPath+"stars.png",320,480),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0])},update:function(){this.pos.y+=ig.game.velStars;this.pos.y>ig.system.width&&(this.pos.y=-452);this.parent()},draw:function(){this.parent()}})});ig.baked=!0;ig.module("game.entities.player").requires("impact.entity").defines(function(){EntityPlayer=ig.Entity.extend({type:ig.Entity.TYPE.A,checkAgainst:ig.Entity.TYPE.NONE,collides:ig.Entity.COLLIDES.PASSIVE,sound:new ig.Sound(imgPath+"audio/boom.*"),size:{x:20,y:22},maxVel:{x:200,y:200},easing:.1,offset:{x:4,y:0},zIndex:1,angle:[-Math.PI/2,-Math.PI/2,Math.PI/180*290,Math.PI/180*250,Math.PI/180*240,Math.PI/180*300],bulletTime:.125,weaponUpdate:0,secondaryWeapon:!1,vidas:5,hit:!1,hittimer:null,animSheet:new ig.AnimationSheet(imgPath+"player.png",27,22),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0]);this.addAnim("rigt",1,[1]);this.addAnim("left",1,[2]);this.addAnim("hit",.05,[3,0]);this.bullet_timer=new ig.Timer(this.bulletTime);this.bullet_timer2=new ig.Timer(.1);this.hit_timer=new ig.Timer(.1);this.explo=new ig.Timer(.1);ig.global.wm||ig.game.spawnEntity(EntityTurbo,this.pos.x+7,this.pos.y+20);ig.ua.mobile||ig.music.tracks[1].play()},onDeath:function(){for(var e,t,n=0,r=0;20>r;r++)n+=22.5,e=this.pos.x+Math.sin(n),t=this.pos.y+Math.cos(n),e=ig.game.spawnEntity(EntityExplosion,e,t),e.currentAnim.alpha=Math.random(1),e.vel.x=30*Math.sin(n)+Math.floor(10*Math.random()),e.vel.y=30*Math.cos(n)+Math.floor(10*Math.random());ig.game.spawnEntity(EntityEarthquake,0,0);this.kill()},onHit:function(){this.sound.play();for(var e,t,n=0,r=0;10>r;r++)n+=22.5,e=this.pos.x+Math.sin(n),t=this.pos.y+Math.cos(n),e=ig.game.spawnEntity(EntityExplosionEnemy,e,t),e.currentAnim=e.anims.red,e.currentAnim.alpha=Math.random(1),e.vel.x=100*Math.sin(n)+Math.floor(30*Math.random()),e.vel.y=100*Math.cos(n)+Math.floor(30*Math.random());ig.game.spawnEntity(EntityEarthquake,0,0)},update:function(){ig.game.vidas=this.vidas;this.weaponUpdate=ig.game.wUpdate;this.secondaryWeapon=ig.game.wSecondary;0>=this.vidas&&this.onDeath();var e=(ig.game.target-this.pos.x-this.size.x/2+2)*this.easing;if(0>e?this.currentAnim=this.anims.rigt:0Math.abs(e)&&!this.hit&&(this.currentAnim=this.anims.idle),this.hit&&(this.onHit(),0s;s++)ig.game.spawnEntity(EntityPlayerbullet,this.pos.x+4+7*s,this.pos.y,{angle:t,angle2:r});break;case 2:e=[];for(s=0;4>s;s++)e.push(ig.game.spawnEntity(EntityPlayerbullet,this.pos.x,this.pos.y+8,{angle1:n,angle:t,angle2:r,angle3:i}));for(t=0;e.length>t;t++)e[3].dir=1,e[3].currentAnim.angle=2.96*this.angle[3],e[0].currentAnim.angle=2.4*this.angle[2],e[0].dir=2,e[0].pos.x=this.pos.x-6,e[0].pos.y=this.pos.y+10,e[1].pos.x=this.pos.x+11,e[2].pos.x=this.pos.x+4,e[3].pos.x=this.pos.x+20,e[3].pos.y=this.pos.y+10,this.bullet_timer.set(.1);break;case 3:for(var e=[],u=0;6>u;u++)e.push(ig.game.spawnEntity(EntityPlayerbullet,this.pos.x,this.pos.y+8,{angle1:n,angle:t,angle2:r,angle3:i}));for(t=0;e.length>t;t++)e[3].dir=1,e[0].dir=2,e[3].currentAnim.angle=2.96*this.angle[3],e[0].currentAnim.angle=2.4*this.angle[2],e[4].dir=0,e[5].dir=0,e[0].pos.x=this.pos.x-1-5,e[0].pos.y=this.pos.y+10,e[1].pos.x=this.pos.x+15-5,e[5].pos.y=this.pos.y+12,e[2].pos.x=this.pos.x+8-5,e[3].pos.x=this.pos.x+23-5,e[3].pos.y=this.pos.y+12,e[4].pos.x=this.pos.x+23-5,e[5].pos.x=this.pos.x-4,e[4].pos.y=this.pos.y+12,this.bullet_timer.set(.1);break;case 4:e=[];for(u=0;8>u;u++)e.push(ig.game.spawnEntity(EntityPlayerbullet,this.pos.x,this.pos.y+8,{angle1:n,angle:t,angle2:r,angle3:i,angle4:s,angle5:o}));for(t=0;e.length>t;t++)e[3].dir=1,e[0].dir=2,e[6].dir=3,e[7].dir=4,e[3].currentAnim.angle=2.96*this.angle[3],e[0].currentAnim.angle=2.4*this.angle[2],e[7].currentAnim.angle=1.3*this.angle[5],e[6].currentAnim.angle=1.35*this.angle[4],e[4].dir=0,e[5].dir=0,e[7].pos.x=this.pos.x+23-5,e[0].pos.x=this.pos.x-1-5,e[0].pos.y=this.pos.y+10,e[1].pos.x=this.pos.x+15-5,e[5].pos.y=this.pos.y+12,e[2].pos.x=this.pos.x+8-5,e[3].pos.x=this.pos.x+23-5,e[3].pos.y=this.pos.y+12,e[4].pos.x=this.pos.x+23-5,e[5].pos.x=this.pos.x-4,e[4].pos.y=this.pos.y+12,e[6].pos.x=this.pos.x-1-4,this.bullet_timer.set(.1)}this.bullet_timer.reset()}}this.parent()},draw:function(){this.parent()}});EntityPlayerbullet=ig.Entity.extend({type:ig.Entity.TYPE.NONE,checkAgainst:ig.Entity.TYPE.B,collides:ig.Entity.COLLIDES.NEVER,size:{x:5,y:20},maxVel:{x:800,y:800},angle:1e-4,angle1:1e-4,angle2:1e-4,angle3:1e-4,angle4:1e-4,angle5:1e-4,dir:0,gravityFactor:0,animSheet:new ig.AnimationSheet(imgPath+"turbo.png",5,20),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0,1,2])},update:function(){0==this.dir?(this.vel.x=600*Math.cos(this.angle),this.vel.y=600*Math.sin(this.angle)):0==this.dir?(this.vel.x=600*Math.cos(this.angle1),this.vel.y=600*Math.sin(this.angle1)):1==this.dir?(this.vel.x=600*Math.cos(this.angle2),this.vel.y=600*Math.sin(this.angle2)):2==this.dir?(this.vel.x=600*Math.cos(this.angle3),this.vel.y=600*Math.sin(this.angle3)):3==this.dir?(this.vel.x=600*Math.cos(this.angle4),this.vel.y=600*Math.sin(this.angle4)):4==this.dir&&(this.vel.x=600*Math.cos(this.angle5),this.vel.y=600*Math.sin(this.angle5));-11>this.pos.y&&this.kill();this.parent()},onDeath:function(){ig.game.spawnEntity(EntityEnemyExplosion,this.pos.x+8,this.pos.y+8);this.kill()},check:function(e){this.onDeath();e.currentAnim=e.anims.hit;e.vidas-=1}});EntityEnemyExplosionSpark=ig.Entity.extend({size:{x:32,y:32},gravityFactor:0,animSheet:new ig.AnimationSheet(imgPath+"explosions/enemyboom.png",32,32),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",.025,[0,1,2,3,4,5,6,7,8,9]);this.currentAnim.alpha=.5+.5*Math.random()},update:function(){9<=this.currentAnim.frame&&this.kill();this.parent()}});EntityEnemyExplosion=ig.Entity.extend({zIndex:1e3,size:{x:35,y:35},init:function(e,t,n){this.parent(e,t,n);this.timer=new ig.Timer(0)},update:function(){0e;e++)ig.game.entities[e]instanceof EntityPopcorn?this.target=ig.game.entities[e]:ig.game.entities[e]instanceof EntityJuggernaut?this.target=ig.game.entities[e]:ig.game.entities[e]instanceof EntitySinuous?this.target=ig.game.entities[e]:ig.game.entities[e]instanceof EntityModular?this.target=ig.game.entities[e]:ig.game.entities[e]instanceof EntityEnemyArm?this.target=ig.game.entities[e]:ig.game.entities[e]instanceof EntityBitel?this.target=ig.game.entities[e]:ig.game.entities[e]instanceof EntityBirds&&(this.target=ig.game.entities[e]);this.target?(this.pathCoords=[[{x:this.pos.x,y:this.pos.y},{x:this.pos.x-73,y:this.pos.y},{x:this.pos.x-63,y:this.pos.y+20},{x:this.target.pos.x,y:this.target.pos.y}]],this.followBezierPath(2,!0,!1)):(this.pathCoords=[[{x:this.pos.x,y:this.pos.y},{x:this.pos.x-73,y:this.pos.y},{x:this.pos.x-63,y:this.pos.y+20},{x:this.pos.x,y:0}]],this.followBezierPath(2,!0,!1));this.parent()},check:function(e){this.onDeath();e.vidas-=.5;this.kill()}});EntityBulletsMissilLeft=ig.Entity.extend({type:ig.Entity.TYPE.NONE,checkAgainst:ig.Entity.TYPE.B,collides:ig.Entity.COLLIDES.NEVER,angle:.01,size:{x:8,y:8},maxVel:{x:200,y:200},friction:{x:600,y:600},distanceX:null,distanceY:null,distanceTotal:null,moveDistanceX:0,moveDistanceY:0,turnRate:.35,moveX:0,moveY:0,ease:4,rotation:0,totalmove:0,missileSpeed:3.5,target:null,animSheet:new ig.AnimationSheet(imgPath+"5x5.png",8,8),gravityFactor:0,pathCoords:[],init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0])},onDeath:function(){ig.game.spawnEntity(EntityEnemyExplosion,this.pos.x,this.pos.y)},update:function(){for(var e=0;ig.game.entities.length>e;e++)ig.game.entities[e]instanceof EntityPopcorn?this.target=ig.game.entities[e]:ig.game.entities[e]instanceof EntityJuggernaut?this.target=ig.game.entities[e]:ig.game.entities[e]instanceof EntitySinuous?this.target=ig.game.entities[e]:ig.game.entities[e]instanceof EntityModular?this.target=ig.game.entities[e]:ig.game.entities[e]instanceof EntityEnemyArm?this.target=ig.game.entities[e]:ig.game.entities[e]instanceof EntityBitel?this.target=ig.game.entities[e]:ig.game.entities[e]instanceof EntityBirds&&(this.target=ig.game.entities[e]);this.target?(this.pathCoords=[[{x:this.pos.x,y:this.pos.y},{x:this.pos.x+73,y:this.pos.y},{x:this.pos.x+63,y:this.pos.y+20},{x:this.target.pos.x,y:this.target.pos.y}]],this.followBezierPath(2,!0,!1)):(this.pathCoords=[[{x:this.pos.x+4,y:this.pos.y},{x:this.pos.x+73,y:this.pos.y},{x:this.pos.x+63,y:this.pos.y+20},{x:this.pos.x,y:0}]],this.followBezierPath(2,!0,!1));this.parent()},check:function(e){this.onDeath();e.vidas-=.5;this.kill()}});EntityExplosion=ig.Entity.extend({size:{x:7,y:7},animSheet:new ig.AnimationSheet(imgPath+"enemybullet.png",7,7),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0])},update:function(){this.parent()},handleMovementTrace:function(){this.pos.x+=this.vel.x*ig.system.tick;this.pos.y+=this.vel.y*ig.system.tick}});EntityExplosionEnemy=ig.Entity.extend({size:{x:16,y:16},gravityFactor:2,animSheet:new ig.AnimationSheet(imgPath+"enemy_explosion.png",16,16),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0]);this.addAnim("yellow",1,[1]);this.addAnim("orange",1,[2]);this.addAnim("green",1,[3]);this.addAnim("red",1,[4]);this.timer=new ig.Timer(1)},update:function(){0=this.currentAnim.alpha&&this.kill();this.parent()},handleMovementTrace:function(){this.pos.x+=this.vel.x*ig.system.tick;this.pos.y+=this.vel.y*ig.system.tick}});EntityTurbo=ig.Entity.extend({size:{x:5,y:20},zIndex:0,animSheet:new ig.AnimationSheet(imgPath+"turbo.png",5,20),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",.01,[0,1,2]);this.timer=new ig.Timer(1)},update:function(){ig.game.getEntitiesByType(EntityPlayer)[0]?(this.pos.x=ig.game.getEntitiesByType(EntityPlayer)[0].pos.x+7,this.pos.y=ig.game.getEntitiesByType(EntityPlayer)[0].pos.y+18):this.kill();this.parent()}})});ig.baked=!0;ig.module("game.entities.hud").requires("impact.entity").defines(function(){EntityHud=ig.Entity.extend({type:ig.Entity.TYPE.NONE,checkAgainst:ig.Entity.TYPE.NONE,collides:ig.Entity.COLLIDES.NEVER,size:{x:320,y:56},zIndex:998,animSheet:new ig.AnimationSheet(imgPath+"hud.png",320,56),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0]);ig.global.wm||(ig.game.spawnEntity(EntityHudOver,ig.system.width/2-39.5,this.pos.y+10),ig.game.spawnEntity(EntityHudBarra,256,this.pos.y+4))},update:function(){ig.game.sortEntitiesDeferred();this.parent()},draw:function(){this.parent()}});EntityHudOver=ig.Entity.extend({type:ig.Entity.TYPE.NONE,checkAgainst:ig.Entity.TYPE.NONE,collides:ig.Entity.COLLIDES.NEVER,size:{x:79,y:45},zIndex:1e3,animSheet:new ig.AnimationSheet(imgPath+"hudover.png",79,45),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0]);this.addAnim("over",1,[1])},update:function(){ig.game.target=this.pos.x+this.size.x/2;this.inFocus()&&ig.input.state("lbtn")?(ig.game.fire=!0,this.pos.x=ig.input.mouse.x/ig.game.ratOptimal-this.size.x/2,0>this.pos.x?this.pos.x=0:240=this.pos.x&&this.pos.x+this.size.x>=ig.input.mouse.x/ig.game.ratOptimal+ig.game.screen.x&&ig.input.mouse.y/ig.game.ratOptimal+ig.game.screen.y>=this.pos.y&&this.pos.y+this.size.y>=ig.input.mouse.y/ig.game.ratOptimal+ig.game.screen.y}});EntityHudBarra=ig.Entity.extend({size:{x:56,y:14},zIndex:999,animSheet:new ig.AnimationSheet(imgPath+"barra.png",56,14),init:function(e,t,n){this.parent(e,t,n);this.addAnim("one",1,[0]);this.addAnim("two",1,[1]);this.addAnim("tree",1,[2]);this.addAnim("four",1,[3]);this.addAnim("five",1,[4]);this.addAnim("six",1,[5])},update:function(){switch(ig.game.vidas){case 5:this.currentAnim=this.anims.one;break;case 4:this.currentAnim=this.anims.two;break;case 3:this.currentAnim=this.anims.tree;break;case 2:this.currentAnim=this.anims.four;break;case 1:this.currentAnim=this.anims.five;break;case 0:this.currentAnim=this.anims.six}this.parent()}})});ig.baked=!0;ig.module("game.entities.nebulosa").requires("impact.entity").defines(function(){EntityNebulosa=ig.Entity.extend({size:{x:32,y:32},animSheet:new ig.AnimationSheet(imgPath+"nebulosa.png",320,480),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0])},update:function(){this.pos.y+=ig.game.velNebula;this.pos.y>ig.system.width+180&&(this.pos.y=-452);this.parent()},draw:function(){this.parent()}})});ig.baked=!0;ig.module("game.entities.panel").requires("impact.entity").defines(function(){EntityPanel=ig.Entity.extend({type:ig.Entity.TYPE.NONE,checkAgainst:ig.Entity.TYPE.NONE,collides:ig.Entity.COLLIDES.NEVER,size:{x:320,y:283},font:new ig.Font(imgPath+"impact_big.png"),zIndex:1e3,animSheet:new ig.AnimationSheet(imgPath+"panel.png",320,283),init:function(e,t,n){/*updateShare(ig.game.score);Play68.setRankingScoreDesc(ig.game.score);Play68.shareFriend(); */this.parent(e,t,n);this.addAnim("idle",1,[0]);this.addAnim("level",1,[1]);this.addAnim("play",1,[2]);this.pos.y=-500;this.tween({pos:{x:0,y:100}},1,{easing:ig.Tween.Easing.Back.EaseOut}).start();ig.music.stop()},update:function(){this.inFocus()&&ig.input.pressed("lbtn")&&this.currentAnim==this.anims.idle&&(ig.game.target=0,ig.game.fire=!1,ig.game.score=0,ig.game.wUpdate=0,ig.game.lives=5,ig.game.enemiesDestroyed=0,ig.game.velStars=26,ig.game.velNebula=10,ig.game.wSecondary=!1,ig.game.loadLevelDeferred(ig.game.currentLevel));this.inFocus()&&ig.input.pressed("lbtn")&&this.currentAnim==this.anims.level&&(ig.game.target=0,ig.game.fire=!1,ig.game.score=0,ig.game.wUpdate=0,ig.game.lives=5,ig.game.enemiesDestroyed=0,ig.game.velStars=26,ig.game.velNebula=10,ig.game.wSecondary=!1,ig.game.loadLevelDeferred(ig.game.currentLevel));this.parent()},inFocus:function(){return ig.input.mouse.x/ig.game.ratOptimal+ig.game.screen.x>=this.pos.x&&this.pos.x+this.size.x>=ig.input.mouse.x/ig.game.ratOptimal+ig.game.screen.x&&ig.input.mouse.y/ig.game.ratOptimal+ig.game.screen.y/ig.game.ratOptimal>=this.pos.y&&this.pos.y+this.size.y>=ig.input.mouse.y/ig.game.ratOptimal+ig.game.screen.y},draw:function(){this.parent();this.font.draw(ig.game.theScore(ig.game.score+"",9),this.pos.x+98,this.pos.y+100)}})});ig.baked=!0;ig.module("game.entities.control").requires("impact.entity").defines(function(){EntityControl=ig.Entity.extend({size:{x:32,y:32},_wmScalable:!0,_wmDrawBox:!0,_wmBoxColor:"rgba(196, 255, 0, 1)",count:0,off:!0,init:function(e,t,n){this.parent(e,t,n);this.timer=new ig.Timer(this.duration)},triggeredBy:function(){this.off=!1},update:function(){if(!this.off){6>=ig.game.velStars?(ig.game.velStars=6,this.kill()):ig.game.velStars-=.1;3>=ig.game.velNebula?ig.game.velNebula=3:ig.game.velNebula-=.1;var e=ig.game.getEntitiesByType(EntityPlayer)[0];390i;i++)r+=22.5,e=this.pos.x+Math.sin(r),t=this.pos.y+Math.cos(r),e=ig.game.spawnEntity(EntityExplosionEnemy,e,t),e.currentAnim=e.anims.idle,e.currentAnim.alpha=Math.random(.5),e.vel.x=20*Math.sin(r)+Math.floor(20*Math.random()),e.vel.y=20*Math.cos(r)+Math.floor(20*Math.random()),2==Math.floor(200*Math.random())?ig.game.spawnEntity(EntityPacks,this.pos.x,this.pos.y):100==Math.floor(500*Math.random())?ig.game.spawnEntity(EntityVidas,this.pos.x,this.pos.y):6==Math.floor(200*Math.random())&&ig.game.spawnEntity(EntitySecondaryWeapon,this.pos.x,this.pos.y);this.kill()},shootBullet:function(){var e=ig.game.getEntitiesByType(EntityPlayer)[0],t=e.pos.x-this.pos.x,e=e.pos.y-this.pos.y;this.angle;this.angle=Math.atan2(e,t);this.currentAnim.angle=this.angle;ig.game.spawnEntity(EntityEnemyBullet,this.pos.x,this.pos.y,{angle:this.angle})},update:function(){var e=ig.game.getEntitiesByType(EntityPlayer)[0];if(e){if(0>=this.vidas)this.onDeath();else this.angle=Math.atan2(e.pos.y-this.pos.y,e.pos.x-this.pos.x),this.currentAnim.angle=this.angle;"left"==this.typo?(this.pathCoords=[[{x:0,y:-32},{x:5,y:169},{x:156,y:169},{x:158,y:248}],[{x:158,y:248},{x:158,y:348},{x:158,y:448},{x:158,y:848}]],this.followBezierPath(.7,!0,!1,!0,!1),this.currentAnim=this.anims.red,1==Math.floor(Math.random()*this.randomBullet)&&this.shootBullet()):"circle"==this.typo?(this.pathCoords=[[{x:352,y:217},{x:140,y:229},{x:102,y:72},{x:134,y:-128}]],1==Math.floor(Math.random()*this.randomBullet)&&this.shootBullet(),this.currentAnim=this.anims.blue,this.followBezierPath(.4,!0,!1,!0,!1)):"circle_invert"==this.typo?(this.pathCoords=[[{x:-32,y:217},{x:210,y:229},{x:160,y:72},{x:230,y:-128}]],1==Math.floor(Math.random()*this.randomBullet)&&this.shootBullet(),this.currentAnim=this.anims.blue,this.followBezierPath(.4,!0,!1,!0,!1)):"kamikaze"==this.typo&&(this.pathCoords=[[{x:320*Math.random(),y:-32},{x:51,y:10},{x:32,y:27},{x:e.pos.x,y:e.pos.y},{x:e.pos.x,y:e.pos.y},{x:151,y:10},{x:132,y:-27},{x:200,y:-162}]],this.followBezierPath(.4,!0,!1,!0,!1));450this.pos.y&&this.kill()}else this.pathCoords=[[{x:this.pos.x,y:this.pos.y},{x:5,y:169},{x:156,y:169},{x:158,y:-200}]],this.followBezierPath(.7,!1,!1,!0,!1);this.parent()},draw:function(){this.parent()},death:function(){this.kill()},check:function(e){this.onDeath();e.vidas-=1;0i;i++)r+=22.5,e=this.pos.x+Math.sin(r),t=this.pos.y+Math.cos(r),e=ig.game.spawnEntity(EntityExplosionEnemy,e,t),e.currentAnim=e.anims.yellow,e.currentAnim.alpha=Math.random(.5),e.vel.x=20*Math.sin(r)+Math.floor(20*Math.random()),e.vel.y=20*Math.cos(r)+Math.floor(20*Math.random()),2==Math.floor(300*Math.random())?ig.game.spawnEntity(EntityPacks,this.pos.x,this.pos.y):10==Math.floor(500*Math.random())?ig.game.spawnEntity(EntityVidas,this.pos.x,this.pos.y):6==Math.floor(300*Math.random())&&ig.game.spawnEntity(EntitySecondaryWeapon,this.pos.x,this.pos.y);this.kill()},update:function(){0>=this.vidas&&this.onDeath();this.angle+=.05;this.vel.y=this.speed;this.vel.x=Math.cos(this.angle)*this.force;480r;r++)n+=22.5,e=this.pos.x+Math.sin(n),t=this.pos.y+Math.cos(n),e=ig.game.spawnEntity(EntityExplosionEnemy,e,t),e.currentAnim=e.anims.orange,e.currentAnim.alpha=Math.random(1),e.vel.x=80*Math.sin(n)+Math.floor(20*Math.random()),e.vel.y=80*Math.cos(n)+Math.floor(20*Math.random());4>ig.game.wUpdate&&(ig.game.wUpdate+=1);this.kill()},update:function(){this.angle+=.1;this.vel.y=200;this.vel.x=20*Math.sin(this.angle)+20*Math.random();480r;r++)n+=22.5,e=this.pos.x+Math.sin(n),t=this.pos.y+Math.cos(n),e=ig.game.spawnEntity(EntityExplosionEnemy,e,t),e.currentAnim=e.anims.green,e.currentAnim.alpha=Math.random(1),e.vel.x=80*Math.sin(n)+Math.floor(20*Math.random()),e.vel.y=80*Math.cos(n)+Math.floor(20*Math.random());n=ig.game.getEntitiesByType(EntityPlayer)[0];5>n.vidas&&(n.vidas+=1);this.kill()},update:function(){this.angle+=.1;this.vel.y=200;this.vel.x=20*Math.sin(this.angle)+20*Math.random();480r;r++)n+=22.5,e=this.pos.x+Math.sin(n),t=this.pos.y+Math.cos(n),e=ig.game.spawnEntity(EntityExplosionEnemy,e,t),e.currentAnim=e.anims.idle,e.currentAnim.alpha=Math.random(1),e.vel.x=80*Math.sin(n)+Math.floor(20*Math.random()),e.vel.y=80*Math.cos(n)+Math.floor(20*Math.random());ig.game.wSecondary=!0;this.kill()},update:function(){this.angle+=.1;this.vel.y=200;this.vel.x=20*Math.sin(this.angle)+20*Math.random();480e?(e=this.strength*Math.pow(-e/this.duration,2),.5this.pos.x?this.kill():332this.pos.y&&this.kill();this.parent()},check:function(e){this.kill();e.vidas-=1;0i;i++)r+=22.5,e=this.pos.x+Math.sin(r),t=this.pos.y+Math.cos(r),e=ig.game.spawnEntity(EntityExplosionEnemy,e,t),e.currentAnim=e.anims.idle,e.currentAnim.alpha=Math.random(.5),e.vel.x=30*Math.sin(r)+Math.floor(30*Math.random()),e.vel.y=40*Math.cos(r)+Math.floor(30*Math.random()),2==Math.floor(300*Math.random())?ig.game.spawnEntity(EntityPacks,this.pos.x,this.pos.y):10==Math.floor(500*Math.random())?ig.game.spawnEntity(EntityVidas,this.pos.x,this.pos.y):6==Math.floor(300*Math.random())&&ig.game.spawnEntity(EntitySecondaryWeapon,this.pos.x,this.pos.y);this.kill()},update:function(){switch(0>=this.vidas&&this.onDeath(),0this.pos.y&&this.kill();this.parent()}});EntitySimpleLine=ig.Entity.extend({angle:0,gravityFactor:0,be:[],direction:12,speed:200,num:3,des:0,init:function(e,t,n){if(this.parent(e,t,n),this.timer=new ig.Timer(.01),ig.game.getEntitiesByType(EntityPlayer)[0])t=ig.game.getEntitiesByType(EntityPlayer)[0],e=t.pos.x-ig.game.getEntitiesByType(EntityJuggernaut)[0].pos.x-27,t=t.pos.y-ig.game.getEntitiesByType(EntityJuggernaut)[0].pos.y-33,this.des=Math.atan2(e,t)},update:function(){if(this.angle+=.1,0>this.timer.delta())for(var e=0;this.num>e;e++)this.be.push(ig.game.spawnEntity(EntityEnemyBullet,this.pos.x,this.pos.y));for(e=0;this.be.length>e;e++)this.be[e].vel.x=ig.game.getHeadingAngleX(this.des.toDeg()-12+e*this.direction,this.speed),this.be[e].vel.y=ig.game.getHeadingAngleY(this.des.toDeg()-12+e*this.direction,this.speed);this.parent()}})});ig.baked=!0;ig.module("game.entities.bitel").requires("impact.entity").defines(function(){EntityBitel=ig.Entity.extend({type:ig.Entity.TYPE.B,checkAgainst:ig.Entity.TYPE.A,collides:ig.Entity.COLLIDES.PASSIVE,size:{x:25,y:19},vidas:20,angle:Math.PI/180*90,anglo:0,pathCoords:null,typo:"center_r",boom:new ig.Sound(imgPath+"audio/boom.*"),animSheet:new ig.AnimationSheet(imgPath+"bitel.png",25,19),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0]);this.addAnim("hit",1,[1]);this.stay=new ig.Timer(4+4*Math.random());this.timer_shoot=new ig.Timer(1+1*Math.random())},onDeath:function(){this.boom.play();ig.game.score+=20;for(var e,t,n=ig.ua.mobile?5:20,r=0,i=0;n>i;i++)r+=22.5,e=this.pos.x+Math.sin(r),t=this.pos.y+Math.cos(r),e=ig.game.spawnEntity(EntityExplosionEnemy,e,t),e.currentAnim=e.anims.idle,e.currentAnim.alpha=Math.random(1),e.vel.x=30*Math.sin(r)+Math.floor(30*Math.random()),e.vel.y=40*Math.cos(r)+Math.floor(30*Math.random()),2==Math.floor(350*Math.random())?ig.game.spawnEntity(EntityPacks,this.pos.x,this.pos.y):500==Math.floor(500*Math.random())?ig.game.spawnEntity(EntityVidas,this.pos.x,this.pos.y):6==Math.floor(350*Math.random())&&ig.game.spawnEntity(EntitySecondaryWeapon,this.pos.x,this.pos.y);this.kill()},update:function(){if(0>=this.vidas&&this.onDeath(),480this.pos.y&&this.kill();this.parent()}})});ig.baked=!0;ig.module("game.entities.birds").requires("impact.entity").defines(function(){EntityBirds=ig.Entity.extend({type:ig.Entity.TYPE.B,checkAgainst:ig.Entity.TYPE.A,collides:ig.Entity.COLLIDES.PASSIVE,size:{x:22,y:29},vidas:5,angle:null,anglo:0,pathCoords:null,boom:new ig.Sound(imgPath+"audio/boom.*"),typo:"loop",animSheet:new ig.AnimationSheet(imgPath+"bird.png",22,29),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0]);this.addAnim("hit",1,[1]);this.currentAnim.angle=Math.PI/180*90;this.stay=new ig.Timer(4);this.timer_shoot=new ig.Timer(2)},onDeath:function(){this.boom.play();ig.game.score+=15;for(var e,t,n=ig.ua.mobile?5:20,r=0,i=0;n>i;i++)r+=22.5,e=this.pos.x+Math.sin(r),t=this.pos.y+Math.cos(r),e=ig.game.spawnEntity(EntityExplosionEnemy,e,t),e.currentAnim=e.anims.idle,e.currentAnim.alpha=Math.random(1),e.vel.x=30*Math.sin(r)+Math.floor(30*Math.random()),e.vel.y=40*Math.cos(r)+Math.floor(30*Math.random()),2==Math.floor(350*Math.random())?ig.game.spawnEntity(EntityPacks,this.pos.x,this.pos.y):500==Math.floor(600*Math.random())?ig.game.spawnEntity(EntityVidas,this.pos.x,this.pos.y):6==Math.floor(350*Math.random())&&ig.game.spawnEntity(EntitySecondaryWeapon,this.pos.x,this.pos.y);this.kill()},update:function(){switch(0>=this.vidas&&this.onDeath(),0this.pos.y&&this.kill();this.parent()}});EntitySimpleLines=ig.Entity.extend({angle:0,gravityFactor:0,be:[],direction:12,speed:200,num:5,des:0,init:function(e,t,n){if(this.parent(e,t,n),this.timer=new ig.Timer(.01),ig.game.getEntitiesByType(EntityPlayer)[0])t=ig.game.getEntitiesByType(EntityPlayer)[0],e=t.pos.x-ig.game.getEntitiesByType(EntityBirds)[0].pos.x-27,t=t.pos.y-ig.game.getEntitiesByType(EntityBirds)[0].pos.y-33,this.des=Math.atan2(e,t)},update:function(){if(this.angle+=.1,0>this.timer.delta())for(var e=0;this.num>e;e++)this.be.push(ig.game.spawnEntity(EntityEnemyBullet,this.pos.x,this.pos.y));for(e=0;this.be.length>e;e++)this.be[e].vel.x=ig.game.getHeadingAngleX(this.des.toDeg()-12+e*this.direction,this.speed),this.be[e].vel.y=ig.game.getHeadingAngleY(this.des.toDeg()-12+e*this.direction,this.speed);this.parent()}})});ig.baked=!0;ig.module("game.entities.BigYellow").requires("impact.entity").defines(function(){EntityBigYellow=ig.Entity.extend({type:ig.Entity.TYPE.B,checkAgainst:ig.Entity.TYPE.NONE,collides:ig.Entity.COLLIDES.PASSIVE,vidas:200,size:{x:60,y:67},pathCoords:[[{x:100,y:-60},{x:24,y:198},{x:107,y:209},{x:106,y:159}]],animSheet:new ig.AnimationSheet(imgPath+"big_yellow.png",60,67),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0]);this.addAnim("hit",1,[1])},update:function(){this.followBezierPath(.5,!0,!0,!1);this.parent()},draw:function(){this.parent()}})});ig.baked=!0;ig.module("game.entities.modular").requires("impact.entity").defines(function(){EntityModular=ig.Entity.extend({size:{x:80,y:80},maxVel:{x:100,y:100},friction:{x:150,y:0},gravityFactor:0,type:ig.Entity.TYPE.B,checkAgainst:ig.Entity.TYPE.A,collides:ig.Entity.COLLIDES.PASSIVE,vidas:150,speed:14,flip:!1,angle:0,angles:0,boom:new ig.Sound(imgPath+"audio/boom.*"),speedo:.025,radius:74,radio:0,anglo:0,angley:0,armOffsets:[],children:[],oscillationTimer:new ig.Timer,pathCoords:null,animSheet:new ig.AnimationSheet(imgPath+"center.png",80,80),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0]);this.addAnim("hit",1,[1]);this.anglo=Math.PI/180/10;for(e=0;9>e;e++)this.armOffsets.push({x:0,y:0,timerOffset:0});for(e=0;this.armOffsets.length>e;e++)this.addModule(e,EntityEnemyArm);this.vel.x=0},onHit:function(){this.boom.play();for(var e,t,n=ig.ua.mobile?5:20,r=0,i=0;n>i;i++)r+=22.5,e=this.pos.x+Math.sin(r),t=this.pos.y+Math.cos(r),e=ig.game.spawnEntity(EntityExplosionEnemy,e,t),e.currentAnim=e.anims.red,e.currentAnim.alpha=Math.random(1),e.vel.x=100*Math.sin(r)+Math.floor(30*Math.random()),e.vel.y=100*Math.cos(r)+Math.floor(30*Math.random());ig.game.spawnEntity(EntityEarthquake,0,0);ig.game.score+=1e3;e=ig.game.spawnEntity(EntityPanel,0,0);e.currentAnim=e.anims.level;this.kill()},update:function(){if(0>=this.vidas){this.onHit();for(var e=0;this.children.length>e;e++)this.children[e].onDeath()}if(e=ig.game.getEntitiesByType(EntityPlayer)[0]){var t=e.pos.x-this.pos.x;dy=e.pos.y-this.pos.y;this.angles=Math.atan2(dy,t);this.currentAnim.angle=this.angles;this.pathCoords=[[{x:44,y:-102},{x:319,y:305},{x:2,y:302},{x:268,y:50}],[{x:268,y:50},{x:44,y:100},{x:2,y:202},{x:268,y:200}],[{x:268,y:200},{x:44,y:50},{x:100,y:102},{x:68,y:200}],[{x:68,y:200},{x:32,y:40},{x:240,y:40},{x:100,y:200}],[{x:100,y:200},{x:32,y:40},{x:240,y:40},{x:44,y:-102}]];0>=ig.game.getEntitiesByType(EntityEnemyArm).length?this.followBezierPath(1,!1,!0,!0,!0):this.followBezierPath(.2,!1,!0,!0,!0);this.updateChildren()}this.currentAnim=this.anims.idle;this.parent();this.vel.x=0},addModule:function(e,t){var n=this.armOffsets[e],n=this.addChild(t,this.pos.x+n.x,this.pos.y+n.y,{angle:n.angle*Math.PI/180,oscillationOffset:n.timerOffset});return 4==e&&this.attachGuns(e),n},attachGuns:function(e){e=this.children[e];e.children.push(ig.game.spawnEntity(EntityEnemyGun,e.pos.x,e.pos.y-20))},addChild:function(e,t,n,r){e=ig.game.spawnEntity(e,t,n,r);return this.children.push(e),e},updateChildren:function(){if(this.angle+=this.speedo/1,this.children.length)for(var e=0;this.children.length>e;e++){5*Math.sin(this.children[e].oscillationTimer.delta()+this.children[e].oscillationOffset);var t=this.children[e];t.pos.y=this.pos.y+72*Math.sin(37*e);t.pos.x=this.pos.x+72*Math.cos(37*e);var n=t.pos.x-this.pos.x,r=t.pos.y-this.pos.y,i=Math.cos(this.angle)*n-Math.sin(this.angle)*r,n=Math.cos(this.angle)*r+Math.sin(this.angle)*n;if(t.pos.y=this.pos.y+20+n,t.pos.x=this.pos.x+20+i,t.children.length)for(i=0;t.children.length>i;i++)n=t.children[i],n.pos.y=this.pos.y+16+Math.cos(this.angle)*this.radius,n.pos.x=this.pos.x+16+Math.sin(this.angle)*this.radius,n.vel.x=t.vel.x}},receiveDamage:function(){},handleMovementTrace:function(e){this.parent(e)},spawnGibs:function(){},check:function(){}});EntityEnemyArm=ig.Entity.extend({size:{x:32,y:32},maxVel:{x:0,y:100},boom:new ig.Sound(imgPath+"audio/boom.*"),friction:{x:150,y:0},type:ig.Entity.TYPE.B,collides:ig.Entity.COLLIDES.PASSIVE,children:[],ang:0,oscillationOffset:0,vidas:50,oscillationTimer:new ig.Timer,animSheet:new ig.AnimationSheet(imgPath+"arm.png",32,32),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0]);this.addAnim("hit",1,[1]);this.oscillationOffset=n.oscillationOffset;this.oscillationTimer.set(2*Math.random());this.vel.x=n.flip?-this.maxVel.x:this.maxVel.x},handleMovementTrace:function(e){this.parent(e)},onDeath:function(){this.boom.play();var e=ig.ua.mobile?5:20;ig.game.score+=100;for(var t,n,r=0,i=0;e>i;i++)r+=22.5,t=this.pos.x+Math.sin(r),n=this.pos.y+Math.cos(r),t=ig.game.spawnEntity(EntityExplosionEnemy,t,n),t.currentAnim=t.anims.idle,t.currentAnim.alpha=Math.random(1),t.vel.x=30*Math.sin(r)+Math.floor(30*Math.random()),t.vel.y=40*Math.cos(r)+Math.floor(30*Math.random()),2==Math.floor(300*Math.random())?ig.game.spawnEntity(EntityPacks,this.pos.x,this.pos.y):500==Math.floor(600*Math.random())?ig.game.spawnEntity(EntityVidas,this.pos.x,this.pos.y):6==Math.floor(300*Math.random())&&ig.game.spawnEntity(EntitySecondaryWeapon,this.pos.x,this.pos.y);this.kill()},update:function(){if(0>=this.vidas){this.onDeath();for(var e=0;this.children.length>e;e++)this.children[e].kill()}else this.currentAnim.angle+=.01,this.currentAnim=this.anims.idle;this.parent()},check:function(){}});EntityEnemyGun=EntityEnemyArm.extend({animSheet:new ig.AnimationSheet(imgPath+"gun.png",32,32),bullets:10,firingTimer:null,reloadTime:3,type:ig.Entity.TYPE.NONE,collides:ig.Entity.COLLIDES.PASSIVE,init:function(e,t,n){this.parent(e,t,n);this.firingTimer=new ig.Timer(Math.random()*this.reloadTime*2)},update:function(){if(ig.game.getEntitiesByType(EntityModular)[0]||this.kill(),this.parent(),0n;n++)ig.game.spawnEntity(EntityEnemyBullet,this.pos.x+18,this.pos.y+18,{angle:t*Math.PI/180}),t+=e;this.firingTimer.set(this.reloadTime)}}});EntityEnemyModularBullet=ig.Entity.extend({size:{x:8,y:8},offset:{x:28,y:28},maxVel:{x:100,y:100},animSheet:new ig.AnimationSheet(imgPath+"enemybullet.png",20,20),health:10,speed:10,angle:0,maxSpeed:160,type:ig.Entity.TYPE.NONE,init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0]);this.angle=n.angle},update:function(){this.parent();this.speed=Math.min(this.maxSpeed,this.speed+100*ig.system.tick);this.vel.x=Math.cos(this.angle)*this.speed;this.vel.y=Math.sin(this.angle)*this.speed},handleMovementTrace:function(e){this.parent(e);(e.collision.y||e.collision.x)&&this.kill()}})});ig.baked=!0;ig.module("game.entities.stages").requires("impact.entity").defines(function(){EntityStages=ig.Entity.extend({type:ig.Entity.TYPE.NONE,checkAgainst:ig.Entity.TYPE.NONE,collides:ig.Entity.COLLIDES.NEVER,size:{x:320,y:100},animSheet:new ig.AnimationSheet(imgPath+"stages.png",320,100),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0]);this.currentAnim.alpha=0;this.timer=new ig.Timer(3)},update:function(){1>this.currentAnim.alpha?this.currentAnim.alpha+=.01:this.currentAnim.alpha=1;0this.pos.y&&this.kill();this.parent()},draw:function(){this.parent()}})});ig.baked=!0;ig.module("plugins.fade").requires("impact.timer","impact.animation").defines(function(){ig.Fade=ig.Class.extend({defaultOptions:{color:{r:0,g:0,b:0,a:1},fade:"in",speed:1,screenWidth:0,screenHeight:0,waitUntilLoaded:!0,visible:!0},init:function(e){this._setOptions(e);e="out"!=this.options.fade;if(this._alpha=e?0:1,this._alphaChange=e?1:-1,this.options.tileImagePath){if(isNaN(this.options.tileWidth))throw Error("ScreenFader option for tileWidth is invalid");if(isNaN(this.options.tileHeight))throw Error("ScreenFader option for tileHeight is invalid");this._sheet=new ig.AnimationSheet(this.options.tileImagePath,this.options.tileWidth,this.options.tileHeight);this._anim=new ig.Animation(this._sheet,1,[0]);this._anim.alpha=this._alpha}isNaN(this.options.delayBefore)||(e=0>=this.options.delayBefore?0:this.options.delayBefore,0this.timerDelayBefore.delta())return;delete this.timerDelayBefore}this.options.visible&&(this.isFinished||this._sheet&&!this._sheet.image.loaded&&this.options.waitUntilLoaded||this._fadeAlphaValue(),0>=this._alpha||(this._anim?this.drawImageTiledOnScreen():this.drawColorOnScreen()))},drawImageTiledOnScreen:function(){for(var e=0,t=0,n=this.options.screenWidth,r=this.options.screenHeight,i=this.options.tileWidth,s=this.options.tileHeight;r>t;){for(e=0;n>e;)this._anim.draw(e,t),e+=i;t+=s}},drawColorOnScreen:function(){ig.system.clear(this.getColorCssValue())},getColorCssValue:function(e){e=e||this.options.color;var t=(void 0!==e.a?e.a:1)*this._alpha;return 0>t?t=0:1this._alphaChange&&0>=this._alpha)&&this.finish();this._anim&&(this._anim.alpha=this._alpha)},_setOptions:function(e){this.options=ig.copy(this.defaultOptions);(isNaN(this.options.screenWidth)||0>=this.options.screenWidth)&&(this.options.screenWidth=ig.system.width);(isNaN(this.options.screenHeight)||0>=this.options.screenHeight)&&(this.options.screenHeight=ig.system.height);e&&ig.merge(this.options,e)}});ig.Fade.globalSpeedFactor=2/3;ig.Fade.globalGameIsContext=!0});ig.baked=!0;ig.module("game.entities.title").requires("impact.entity").defines(function(){EntityTitle=ig.Entity.extend({type:ig.Entity.TYPE.NONE,checkAgainst:ig.Entity.TYPE.NONE,collides:ig.Entity.COLLIDES.NEVER,size:{x:310,y:99},animSheet:new ig.AnimationSheet(imgPath+"title.png",310,99),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0]);this.tween({pos:{x:5,y:16}},1,{easing:ig.Tween.Easing.Back.EaseOut}).start();ig.game.spawnEntity(EntityPlayBtn,70,600)}});EntityPlayBtn=ig.Entity.extend({type:ig.Entity.TYPE.NONE,checkAgainst:ig.Entity.TYPE.NONE,collides:ig.Entity.COLLIDES.NEVER,size:{x:180,y:65},animSheet:new ig.AnimationSheet(imgPath+"playbtn.png",180,65),init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0]);this.addAnim("over",1,[1]);this.tween({pos:{x:70,y:396}},1,{delay:.4,easing:ig.Tween.Easing.Back.EaseOut}).start()},update:function(){this.currentAnim=this.inFocus()?this.anims.over:this.anims.idle;this.inFocus()&&ig.input.pressed("lbtn")&&ig.game.loadLevelDeferred(LevelLevels);this.parent()},inFocus:function(){return ig.input.mouse.x/ig.game.ratOptimal+ig.game.screen.x>=this.pos.x&&this.pos.x+this.size.x>=ig.input.mouse.x/ig.game.ratOptimal+ig.game.screen.x&&ig.input.mouse.y/ig.game.ratOptimal+ig.game.screen.y>=this.pos.y&&this.pos.y+this.size.y>=ig.input.mouse.y/ig.game.ratOptimal+ig.game.screen.y}})});ig.baked=!0;ig.module("game.levels.init").requires("impact.image","game.entities.nebulosa","game.entities.starfield","game.entities.title").defines(function(){LevelInit={entities:[{type:"EntityNebulosa",x:0,y:0},{type:"EntityNebulosa",x:0,y:-480},{type:"EntityStarfield",x:0,y:-32},{type:"EntityStarfield",x:0,y:-452},{type:"EntityTitle",x:5,y:-264}],layer:[{name:"new_layer_0",width:20,height:30,linkWithCollision:!1,visible:1,tilesetName:imgPath+"bg.png",repeat:!1,preRender:!0,distance:"1",tilesize:16,foreground:!1,data:[[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],[21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],[41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60],[61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80],[81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100],[101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120],[121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140],[141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160],[161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180],[181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200],[201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220],[221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240],[241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260],[261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280],[281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300],[301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320],[321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340],[341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360],[361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380],[381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400],[401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420],[421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440],[441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460],[461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480],[481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500],[501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520],[521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540],[541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560],[561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580],[581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600]]}]};LevelInitResources=[new ig.Image(imgPath+"bg.png")]});ig.baked=!0;ig.module("game.entities.levels").requires("impact.entity").defines(function(){EntityLevels=ig.Entity.extend({size:{x:32,y:32},_wmScalable:!0,_wmDrawBox:!0,_wmBoxColor:"rgba(196, 255, 0, 1)",a:[],pag:[],coord:[],init:function(e,t,n){this.parent(e,t,n);for(e=0;4>e;e++)for(t=0;3>t;t++)this.coord.push({x:32+90*t,y:90+90*e}),this.a.push(ig.game.spawnEntity(EntityLevelLevel,-80,32+90*e));for(e=0;this.a.length>e;e++)this.a[e].tween({pos:{x:this.coord[e].x,y:this.coord[e].y}},2,{delay:e/15,easing:ig.Tween.Easing.Quintic.EaseOut}).start(),this.a[e].num+=1+e,this.a[0].actiu=!0},update:function(){this.parent()}});EntityLevelLevel=ig.Entity.extend({type:ig.Entity.TYPE.NONE,checkAgainst:ig.Entity.TYPE.NONE,collides:ig.Entity.COLLIDES.NEVER,size:{x:80,y:80},animSheet:new ig.AnimationSheet(imgPath+"levels.png",80,80),num:0,actiu:!1,init:function(e,t,n){this.parent(e,t,n);this.addAnim("idle",1,[0]);this.addAnim("over",1,[1])},update:function(){this.inFocus()&&ig.input.pressed("lbtn")&&this.actiu&&(ig.ua.mobile||ig.music.fadeOut(.5),ig.game.loadLevelDeferred(LevelStars));this.currentAnim=this.inFocus()?this.anims.over:this.anims.idle;this.parent()},inFocus:function(){return ig.input.mouse.x/ig.game.ratOptimal+ig.game.screen.x>=this.pos.x&&this.pos.x+this.size.x>=ig.input.mouse.x/ig.game.ratOptimal+ig.game.screen.x&&ig.input.mouse.y/ig.game.ratOptimal+ig.game.screen.y>=this.pos.y&&this.pos.y+this.size.y>=ig.input.mouse.y/ig.game.ratOptimal+ig.game.screen.y},draw:function(){this.parent();ig.system.context.font="10pt Impact";ig.system.context.textAlign="center";this.actiu?(ig.system.context.fillStyle="white",ig.system.context.fillText("第 "+this.num+" 关",this.pos.x+42,this.pos.y+66)):(ig.system.context.fillStyle="black",ig.system.context.fillText("第 "+this.num+" 关",this.pos.x+42,this.pos.y+66))}})});ig.baked=!0;ig.module("game.levels.levels").requires("impact.image","game.entities.levels").defines(function(){LevelLevels={entities:[{type:"EntityLevels",x:200,y:128}],layer:[{name:"new_layer_0",width:20,height:30,linkWithCollision:!1,visible:1,tilesetName:imgPath+"bg_levels.png",repeat:!1,preRender:!0,distance:"1",tilesize:16,foreground:!1,data:[[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],[21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],[41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60],[61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80],[81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100],[101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120],[121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140],[141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160],[161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180],[181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200],[201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220],[221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240],[241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260],[261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280],[281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300],[301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320],[321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340],[341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360],[361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380],[381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400],[401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420],[421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440],[441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460],[461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480],[481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500],[501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520],[521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540],[541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560],[561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580],[581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600]]}]};LevelLevelsResources=[new ig.Image(imgPath+"bg_levels.png")]});ig.baked=!0;ig.module("game.levels.stars").requires("impact.image","game.entities.target","game.entities.nebulosa","game.entities.starfield","game.entities.spawner","game.entities.control","game.entities.stages","game.entities.player","game.entities.hud").defines(function(){LevelStars={entities:[{type:"EntityTarget",x:0,y:-3456,settings:{target:{1:"j1_clone_clone1",2:"j2_clone_clone1"},enemies:"juggernaut"}},{type:"EntityNebulosa",x:0,y:0},{type:"EntityStarfield",x:0,y:-32},{type:"EntityStarfield",x:0,y:-452},{type:"EntityNebulosa",x:0,y:-480},{type:"EntityTarget",x:0,y:-3148,settings:{size:{x:330,y:24},target:{1:"bitle1",2:"bitle2"}}},{type:"EntitySpawner",x:396,y:-256,settings:{enemies:"juggernaut_r_big",name:"j2",duration:6,numEnemies:1,size:{x:32,y:28}}},{type:"EntityTarget",x:0,y:-2880,settings:{size:{x:330,y:28},target:{1:"w1_clone"}}},{type:"EntityTarget",x:0,y:-1288,settings:{target:{1:"s2"}}},{type:"EntitySpawner",x:-256,y:-3152,settings:{name:"bitle2",enemies:"bitle_center_l",duration:1,numEnemies:1}},{type:"EntitySpawner",x:396,y:-2200,settings:{enemies:"juggernaut_r",name:"j2_clone",duration:6,numEnemies:1}},{type:"EntitySpawner",x:-236,y:-2172,settings:{name:"j1_clone",enemies:"juggernaut_l_big",numEnemies:1,duration:2,size:{x:32,y:32}}},{type:"EntityTarget",x:0,y:-1572,settings:{size:{x:330,y:28},target:{1:"w1"}}},{type:"EntityTarget",x:0,y:-272,settings:{target:{1:"j1",2:"j2"},enemies:"juggernaut"}},{type:"EntitySpawner",x:428,y:-3500,settings:{enemies:"juggernaut_r",name:"j2_clone_clone1",duration:6,numEnemies:1}},{type:"EntitySpawner",x:368,y:-3240,settings:{name:"bitle1",enemies:"bitle_center_r",duration:3,numEnemies:1}},{type:"EntitySpawner",x:-240,y:-3480,settings:{name:"j1_clone_clone1",enemies:"juggernaut_l",numEnemies:1,duration:2,size:{x:36,y:28}}},{type:"EntityTarget",x:0,y:-2164,settings:{target:{1:"j1_clone",2:"j2_clone"},enemies:"juggernaut"}},{type:"EntitySpawner",x:-272,y:-256,settings:{name:"j1",enemies:"juggernaut_l",numEnemies:1,duration:2,size:{x:32,y:32},js:10}},{type:"EntitySpawner",x:-228,y:-2876,settings:{name:"w1_clone",enemies:"kamikaze",duration:.5,numEnemies:10}},{type:"EntityTarget",x:0,y:-1068,settings:{target:{1:"s1"}}},{type:"EntitySpawner",x:-296,y:-1568,settings:{name:"w1",enemies:"kamikaze",duration:.5,numEnemies:5}},{type:"EntityTarget",x:0,y:-660,settings:{target:{1:"s1_clone"}}},{type:"EntityTarget",x:0,y:-1836,settings:{size:{x:336,y:28},target:{1:"sp1"}}},{type:"EntityControl",x:-196,y:-168,settings:{name:"c1"}},{type:"EntitySpawner",x:-236,y:-480,settings:{name:"s1_clone",enemies:"sinuous",duration:.25}},{type:"EntitySpawner",x:-264,y:-1816,settings:{name:"sp1",enemies:"popcorn_circle",duration:.25,numEnemies:10,size:{x:32,y:56}}},{type:"EntitySpawner",x:-232,y:-840,settings:{name:"s1",enemies:"sinuous",duration:.25}},{type:"EntityTarget",x:0,y:-160,settings:{target:{1:"c1"}}},{type:"EntitySpawner",x:-284,y:-1092,settings:{name:"s2"}},{type:"EntityTarget",x:4,y:-2640,settings:{target:{1:"j1_clone_clone",2:"j2_clone_clone"},enemies:"juggernaut"}},{type:"EntitySpawner",x:-260,y:-2644,settings:{name:"j1_clone_clone",enemies:"juggernaut_l",numEnemies:1,duration:2,size:{x:36,y:28}}},{type:"EntitySpawner",x:420,y:-2640,settings:{enemies:"juggernaut_r",name:"j2_clone_clone",duration:6,numEnemies:1}},{type:"EntityTarget",x:-28,y:-4460,settings:{target:{1:"sinuous3"},size:{x:330,y:28}}},{type:"EntityTarget",x:-16,y:-3832,settings:{target:{1:"bird1"}}},{type:"EntitySpawner",x:-196,y:-3840,settings:{name:"bird1",enemies:"birds_loop",duration:2,numEnemies:3}},{type:"EntitySpawner",x:-224,y:-4488,settings:{name:"sinuous3",enemies:"sinuous",numEnemies:10,duration:.25}},{type:"EntityTarget",x:0,y:-4988,settings:{target:{1:"c2s",2:"c2s2"}}},{type:"EntitySpawner",x:436,y:-5e3,settings:{name:"c2s2",enemies:"popcorn_circle",duration:.25,numEnemies:50}},{type:"EntitySpawner",x:-236,y:-4976,settings:{name:"c2s",enemies:"popcorn_circle_invert",duration:.25,numEnemies:50}},{type:"EntityTarget",x:0,y:-5676,settings:{target:{1:123,2:1234}}},{type:"EntitySpawner",x:-160,y:-5704,settings:{name:123,enemies:"juggernaut_l",numEnemies:1,duration:1}},{type:"EntitySpawner",x:420,y:-5712,settings:{name:1234,enemies:"juggernaut_r",numEnemies:1,duration:1}},{type:"EntityTarget",x:0,y:-6564,settings:{target:{1:"last1",2:"last2",3:"last3",4:"last4"}}},{type:"EntitySpawner",x:-184,y:-6452,settings:{name:"last4",numEnemies:1,enemies:"bitle_center_l",duration:1}},{type:"EntitySpawner",x:-200,y:-6672,settings:{name:"last2",numEnemies:1,duration:1,enemies:"juggernaut_l"}},{type:"EntitySpawner",x:356,y:-6668,settings:{name:"last1",numEnemies:1,duration:1,enemies:"juggernaut_r"}},{type:"EntitySpawner",x:356,y:-6460,settings:{name:"last3",numEnemies:1,duration:1,enemies:"bitle_center_r"}},{type:"EntityTarget",x:-24,y:-7044,settings:{target:{1:"tg1"}}},{type:"EntitySpawner",x:-164,y:-7116,settings:{name:"tg1",duration:.25,numEnemies:15,enemies:"kamikaze"}},{type:"EntityTarget",x:-24,y:-7940,settings:{size:{x:396,y:28},target:{1:"mim",2:"mim2"}}},{type:"EntitySpawner",x:464,y:-7852,settings:{duration:.25,name:"mim",enemies:"popcorn_circle",numEnemies:50}},{type:"EntitySpawner",x:-188,y:-7856,settings:{duration:.25,name:"mim2",enemies:"popcorn_circle_invert",numEnemies:50,size:{x:36,y:32}}},{type:"EntityTarget",x:0,y:-10388,settings:{target:{1:"bb1"}}},{type:"EntitySpawner",x:0,y:-10372,settings:{enemies:"big_boos_one",numEnemies:1,name:"bb1"}},{type:"EntityStages",x:-4,y:-8},{type:"EntityPlayer",x:152,y:264},{type:"EntityHud",x:0,y:424}],layer:[{name:"new_layer_0",width:20,height:30,linkWithCollision:!1,visible:1,tilesetName:imgPath+"bg.png",repeat:!1,preRender:!0,distance:"1",tilesize:16,foreground:!1,data:[[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],[21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],[41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60],[61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80],[81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100],[101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120],[121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140],[141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160],[161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180],[181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200],[201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220],[221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240],[241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260],[261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280],[281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300],[301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320],[321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340],[341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360],[361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380],[381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400],[401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420],[421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440],[441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460],[461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480],[481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500],[501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520],[521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540],[541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560],[561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580],[581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600]]}]};LevelStarsResources=[new ig.Image(imgPath+"bg.png")]});ig.baked=!0;ig.module("game.main").requires("impact.game","plugins.path","plugins.tween","game.entities.starfield","game.entities.player","game.entities.hud","game.entities.nebulosa","game.entities.panel","game.entities.control","game.entities.target","game.entities.spawner","game.entities.popcorn","game.entities.sinuous","game.entities.packs","game.entities.earthquake","game.entities.enemyBullet","game.entities.juggernaut","game.entities.bitel","game.entities.birds","game.entities.BigYellow","game.entities.modular","game.entities.stages","impact.font","plugins.fade","game.levels.init","game.levels.levels","game.levels.stars").defines(function(){MyGame=ig.Game.extend({font:new ig.Font(imgPath+"04b03.font.png"),panelOn:!1,scoreOn:!1,ratOptimal:0,song:new ig.Sound(imgPath+"audio/aegis.*"),song1:new ig.Sound(imgPath+"audio/thunder.*"),init:function(){ig.input.bind(ig.KEY.MOUSE1,"lbtn");ig.ua.mobile||(ig.music.add(this.song1),ig.music.add(this.song),ig.music.tracks[0].play());this.target=0;this.fire=!1;this.score=0;this.continues=3;this.wUpdate=0;this.lives=5;this.enemiesDestroyed=0;this.velStars=26;this.velNebula=10;this.wSecondary=!1;this.loadLevel(LevelInit);this.timer=new ig.Timer(2)},update:function(){var e=window.innerHeight,t=window.innerWidth,n=ig.$("#wrapper"),r=t/e,i=Math.min(t/320,e/480);1.77<=r&&1.79>=r?(canvas.style.width=t+"px",canvas.style.height=e+"px"):(canvas.style.width=320*i+"px",canvas.style.height=480*i+"px",n.style.width=320*i+"px",n.style.height=480*i+"px",this.ratOptimal=i);(this.player=this.getEntitiesByType(EntityPlayer)[0])||!ig.input.released("lbtn")||this.panelOn||(this.panelOn=!0,this.spawnEntity(EntityPanel,0,-500));this.parent()},loadLevel:function(e){if(this.currentLevel=e,this.screenFader=new ig.Fade({fade:"out",speed:2.25,color:{r:255,g:255,b:255,a:1}}),this.parent(e),ig.ua.mobile)for(var t=0;this.backgroundMaps.length>t;t++)this.backgroundMaps[t].preRender=!0;e===LevelInit||e==LevelLevels?(this.scoreOn=!1,this.panelOn=!0):(this.scoreOn=!0,this.panelOn=!1)},getHeadingAngleX:function(e,t){return Math.sin(e*Math.PI/180)*t},getHeadingAngleY:function(e,t){return Math.cos(e*Math.PI/180)*t},theScore:function(e,t){return e.length>=t?e:this.theScore("0"+e,t)},draw:function(){this.parent();this.scoreOn&&this.font.draw(this.theScore(ig.game.score+"",9),8,431);this.screenFader&&this.screenFader.draw()}});ig.ua.mobile&&(ig.Sound.enabled=!1);ig.main("#canvas",MyGame,60,320,480,1)})