/*! Built with IMPACT - impactjs.com */ (function(window){"use strict";Number.prototype.map=function(istart,istop,ostart,ostop){return ostart+(ostop-ostart)*((this-istart)/(istop-istart));};Number.prototype.limit=function(min,max){return Math.min(max,Math.max(min,this));};Number.prototype.round=function(precision){precision=Math.pow(10,precision||0);return Math.round(this*precision)/precision;};Number.prototype.floor=function(){return Math.floor(this);};Number.prototype.ceil=function(){return Math.ceil(this);};Number.prototype.toInt=function(){return(this|0);};Number.prototype.toRad=function(){return(this/180)*Math.PI;};Number.prototype.toDeg=function(){return(this*180)/Math.PI;};Object.defineProperty(Array.prototype,'erase',{value:function(item){for(var i=this.length;i--;){if(this[i]===item){this.splice(i,1);}} return this;}});Object.defineProperty(Array.prototype,'random',{value:function(item){return this[Math.floor(Math.random()*this.length)];}});Function.prototype.bind=Function.prototype.bind||function(oThis){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");} var aArgs=Array.prototype.slice.call(arguments,1),fToBind=this,fNOP=function(){},fBound=function(){return fToBind.apply((this instanceof fNOP&&oThis?this:oThis),aArgs.concat(Array.prototype.slice.call(arguments)));};fNOP.prototype=this.prototype;fBound.prototype=new fNOP();return fBound;};window.ig={game:null,debug:null,version:'1.23',global:window,modules:{},resources:[],ready:false,baked:false,nocache:'',ua:{},prefix:(window.ImpactPrefix||''),lib:'lib/',_current:null,_loadQueue:[],_waitForOnload:0,$:function(selector){return selector.charAt(0)=='#'?document.getElementById(selector.substr(1)):document.getElementsByTagName(selector);},$new:function(name){return document.createElement(name);},copy:function(object){if(!object||typeof(object)!='object'||object instanceof HTMLElement||object instanceof ig.Class){return object;} else if(object instanceof Array){var c=[];for(var i=0,l=object.length;ithis.width||tileHeight>this.height){return;} var scale=ig.system.scale;var tileWidthScaled=Math.floor(tileWidth*scale);var tileHeightScaled=Math.floor(tileHeight*scale);var scaleX=flipX?-1:1;var scaleY=flipY?-1:1;if(flipX||flipY){ig.system.context.save();ig.system.context.scale(scaleX,scaleY);} ig.system.context.drawImage(this.data,(Math.floor(tile*tileWidth)%this.width)*scale,(Math.floor(tile*tileWidth/this.width)*tileHeight)*scale,tileWidthScaled,tileHeightScaled,ig.system.getDrawPos(targetX)*scaleX-(flipX?tileWidthScaled:0),ig.system.getDrawPos(targetY)*scaleY-(flipY?tileHeightScaled:0),tileWidthScaled,tileHeightScaled);if(flipX||flipY){ig.system.context.restore();} ig.Image.drawCount++;}});ig.Image.drawCount=0;ig.Image.cache={};ig.Image.reloadCache=function(){for(var path in ig.Image.cache){ig.Image.cache[path].reload();}};}); // /home/jgilman/git/purelymental-games/tools/../launcher/lib/impact/font.js ig.baked=true;ig.module('impact.font').requires('impact.image').defines(function(){"use strict";ig.Font=ig.Image.extend({widthMap:[],indices:[],firstChar:32,alpha:1,letterSpacing:1,lineSpacing:0,onload:function(ev){this._loadMetrics(this.data);this.parent(ev);},widthForString:function(text){if(text.indexOf('\n')!==-1){var lines=text.split('\n');var width=0;for(var i=0;i=this.indices.length){return 0;} var scale=ig.system.scale;var charX=this.indices[c]*scale;var charY=0;var charWidth=this.widthMap[c]*scale;var charHeight=(this.height-2)*scale;ig.system.context.drawImage(this.data,charX,charY,charWidth,charHeight,ig.system.getDrawPos(targetX),ig.system.getDrawPos(targetY),charWidth,charHeight);return this.widthMap[c]+this.letterSpacing;},_loadMetrics:function(image){this.height=image.height-1;this.widthMap=[];this.indices=[];var px=ig.getImagePixels(image,0,image.height-1,image.width,1);var currentChar=0;var currentWidth=0;for(var x=0;x127){currentWidth++;} else if(px.data[index]<128&¤tWidth){this.widthMap.push(currentWidth);this.indices.push(x-currentWidth);currentChar++;currentWidth=0;}} this.widthMap.push(currentWidth);this.indices.push(x-currentWidth);}});ig.Font.ALIGN={LEFT:0,RIGHT:1,CENTER:2};}); // /home/jgilman/git/purelymental-games/tools/../launcher/lib/impact/sound.js ig.baked=true;ig.module('impact.sound').defines(function(){"use strict";ig.SoundManager=ig.Class.extend({clips:{},volume:1,format:null,init:function(){if(!ig.Sound.enabled||!window.Audio){ig.Sound.enabled=false;return;} var probe=new Audio();for(var i=0;i0?ig.KEY.MWHEEL_UP:ig.KEY.MWHEEL_DOWN;var action=this.bindings[code];if(action){this.actions[action]=true;this.presses[action]=true;this.delayedKeyup[action]=true;event.stopPropagation();event.preventDefault();}},mousemove:function(event){var internalWidth=parseInt(ig.system.canvas.offsetWidth)||ig.system.realWidth;var scale=ig.system.scale*(internalWidth/ig.system.realWidth);var pos={left:0,top:0};if(ig.system.canvas.getBoundingClientRect){pos=ig.system.canvas.getBoundingClientRect();} var ev=event.touches?event.touches[0]:event;this.mouse.x=(ev.clientX-pos.left)/scale;this.mouse.y=(ev.clientY-pos.top)/scale;},contextmenu:function(event){if(this.bindings[ig.KEY.MOUSE2]){event.stopPropagation();event.preventDefault();}},keydown:function(event){var tag=event.target.tagName;if(tag=='INPUT'||tag=='TEXTAREA'){return;} var code=event.type=='keydown'?event.keyCode:(event.button==2?ig.KEY.MOUSE2:ig.KEY.MOUSE1);if(event.type=='touchstart'||event.type=='mousedown'){this.mousemove(event);} var action=this.bindings[code];if(action){this.actions[action]=true;if(!this.locks[action]){this.presses[action]=true;this.locks[action]=true;} event.stopPropagation();event.preventDefault();}},keyup:function(event){var tag=event.target.tagName;if(tag=='INPUT'||tag=='TEXTAREA'){return;} var code=event.type=='keyup'?event.keyCode:(event.button==2?ig.KEY.MOUSE2:ig.KEY.MOUSE1);var action=this.bindings[code];if(action){this.delayedKeyup[action]=true;event.stopPropagation();event.preventDefault();}},devicemotion:function(event){this.accel=event.accelerationIncludingGravity;},bind:function(key,action){if(key<0){this.initMouse();} else if(key>0){this.initKeyboard();} this.bindings[key]=action;},bindTouch:function(selector,action){var element=ig.$(selector);var that=this;element.addEventListener('touchstart',function(ev){that.touchStart(ev,action);},false);element.addEventListener('touchend',function(ev){that.touchEnd(ev,action);},false);element.addEventListener('MSPointerDown',function(ev){that.touchStart(ev,action);},false);element.addEventListener('MSPointerUp',function(ev){that.touchEnd(ev,action);},false);},unbind:function(key){var action=this.bindings[key];this.delayedKeyup[action]=true;this.bindings[key]=null;},unbindAll:function(){this.bindings={};this.actions={};this.presses={};this.locks={};this.delayedKeyup={};},state:function(action){return this.actions[action];},pressed:function(action){return this.presses[action];},released:function(action){return!!this.delayedKeyup[action];},clearPressed:function(){for(var action in this.delayedKeyup){this.actions[action]=false;this.locks[action]=false;} this.delayedKeyup={};this.presses={};},touchStart:function(event,action){this.actions[action]=true;this.presses[action]=true;event.stopPropagation();event.preventDefault();return false;},touchEnd:function(event,action){this.delayedKeyup[action]=true;event.stopPropagation();event.preventDefault();return false;}});}); // /home/jgilman/git/purelymental-games/tools/../launcher/lib/impact/impact.js ig.baked=true;ig.module('impact.impact').requires('dom.ready','impact.loader','impact.system','impact.input','impact.sound').defines(function(){"use strict";ig.main=function(canvasId,gameClass,fps,width,height,scale,loaderClass){ig.system=new ig.System(canvasId,fps,width,height,scale||1);ig.input=new ig.Input();ig.soundManager=new ig.SoundManager();ig.music=new ig.Music();ig.ready=true;var loader=new(loaderClass||ig.Loader)(gameClass,ig.resources);loader.load();};}); // /home/jgilman/git/purelymental-games/tools/../launcher/lib/impact/animation.js ig.baked=true;ig.module('impact.animation').requires('impact.timer','impact.image').defines(function(){"use strict";ig.AnimationSheet=ig.Class.extend({width:8,height:8,image:null,init:function(path,width,height){this.width=width;this.height=height;this.image=new ig.Image(path);}});ig.Animation=ig.Class.extend({sheet:null,timer:null,sequence:[],flip:{x:false,y:false},pivot:{x:0,y:0},frame:0,tile:0,loopCount:0,alpha:1,angle:0,init:function(sheet,frameTime,sequence,stop){this.sheet=sheet;this.pivot={x:sheet.width/2,y:sheet.height/2};this.timer=new ig.Timer();this.frameTime=frameTime;this.sequence=sequence;this.stop=!!stop;this.tile=this.sequence[0];},rewind:function(){this.timer.set();this.loopCount=0;this.frame=0;this.tile=this.sequence[0];return this;},gotoFrame:function(f){this.timer.set(this.frameTime*-f-0.0001);this.update();},gotoRandomFrame:function(){this.gotoFrame(Math.floor(Math.random()*this.sequence.length))},update:function(){var frameTotal=Math.floor(this.timer.delta()/this.frameTime);this.loopCount=Math.floor(frameTotal/this.sequence.length);if(this.stop&&this.loopCount>0){this.frame=this.sequence.length-1;} else{this.frame=frameTotal%this.sequence.length;} this.tile=this.sequence[this.frame];},draw:function(targetX,targetY){var bbsize=Math.max(this.sheet.width,this.sheet.height);if(targetX>ig.system.width||targetY>ig.system.height||targetX+bbsize<0||targetY+bbsize<0){return;} if(this.alpha!=1){ig.system.context.globalAlpha=this.alpha;} if(this.angle==0){this.sheet.image.drawTile(targetX,targetY,this.tile,this.sheet.width,this.sheet.height,this.flip.x,this.flip.y);} else{ig.system.context.save();ig.system.context.translate(ig.system.getDrawPos(targetX+this.pivot.x),ig.system.getDrawPos(targetY+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();} if(this.alpha!=1){ig.system.context.globalAlpha=1;}}});}); // /home/jgilman/git/purelymental-games/tools/../launcher/lib/impact/entity.js ig.baked=true;ig.module('impact.entity').requires('impact.animation','impact.impact').defines(function(){"use strict";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:false,bounciness:0,minBounceVelocity:40,anims:{},animSheet:null,currentAnim:null,health:10,type:0,checkAgainst:0,collides:0,_killed:false,slopeStanding:{min:(44).toRad(),max:(136).toRad()},init:function(x,y,settings){this.id=++ig.Entity._lastId;this.pos.x=this.last.x=x;this.pos.y=this.last.y=y;ig.merge(this,settings);},reset:function(x,y,settings){var proto=this.constructor.prototype;this.pos.x=x;this.pos.y=y;this.last.x=x;this.last.y=y;this.vel.x=proto.vel.x;this.vel.y=proto.vel.y;this.accel.x=proto.accel.x;this.accel.y=proto.accel.y;this.health=proto.health;this._killed=proto._killed;this.standing=proto.standing;this.type=proto.type;this.checkAgainst=proto.checkAgainst;this.collides=proto.collides;ig.merge(this,settings);},addAnim:function(name,frameTime,sequence,stop){if(!this.animSheet){throw('No animSheet to add the animation '+name+' to.');} var a=new ig.Animation(this.animSheet,frameTime,sequence,stop);this.anims[name]=a;if(!this.currentAnim){this.currentAnim=a;} return a;},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 mx=this.vel.x*ig.system.tick;var my=this.vel.y*ig.system.tick;var res=ig.game.collisionMap.trace(this.pos.x,this.pos.y,mx,my,this.size.x,this.size.y);this.handleMovementTrace(res);if(this.currentAnim){this.currentAnim.update();}},getNewVelocity:function(vel,accel,friction,max){if(accel){return(vel+accel*ig.system.tick).limit(-max,max);} else if(friction){var delta=friction*ig.system.tick;if(vel-delta>0){return vel-delta;} else if(vel+delta<0){return vel+delta;} else{return 0;}} return vel.limit(-max,max);},handleMovementTrace:function(res){this.standing=false;if(res.collision.y){if(this.bounciness>0&&Math.abs(this.vel.y)>this.minBounceVelocity){this.vel.y*=-this.bounciness;} else{if(this.vel.y>0){this.standing=true;} this.vel.y=0;}} if(res.collision.x){if(this.bounciness>0&&Math.abs(this.vel.x)>this.minBounceVelocity){this.vel.x*=-this.bounciness;} else{this.vel.x=0;}} if(res.collision.slope){var s=res.collision.slope;if(this.bounciness>0){var proj=this.vel.x*s.nx+this.vel.y*s.ny;this.vel.x=(this.vel.x-s.nx*proj*2)*this.bounciness;this.vel.y=(this.vel.y-s.ny*proj*2)*this.bounciness;} else{var lengthSquared=s.x*s.x+s.y*s.y;var dot=(this.vel.x*s.x+this.vel.y*s.y)/lengthSquared;this.vel.x=s.x*dot;this.vel.y=s.y*dot;var angle=Math.atan2(s.x,s.y);if(angle>this.slopeStanding.min&&angle=other.pos.x+other.size.x||this.pos.x+this.size.x<=other.pos.x||this.pos.y>=other.pos.y+other.size.y||this.pos.y+this.size.y<=other.pos.y);},distanceTo:function(other){var xd=(this.pos.x+this.size.x/2)-(other.pos.x+other.size.x/2);var yd=(this.pos.y+this.size.y/2)-(other.pos.y+other.size.y/2);return Math.sqrt(xd*xd+yd*yd);},angleTo:function(other){return Math.atan2((other.pos.y+other.size.y/2)-(this.pos.y+this.size.y/2),(other.pos.x+other.size.x/2)-(this.pos.x+this.size.x/2));},check:function(other){},collideWith:function(other,axis){},ready:function(){},erase: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(a,b){if(a.checkAgainst&b.type){a.check(b);} if(b.checkAgainst&a.type){b.check(a);} if(a.collides&&b.collides&&a.collides+b.collides>ig.Entity.COLLIDES.ACTIVE){ig.Entity.solveCollision(a,b);}};ig.Entity.solveCollision=function(a,b){var weak=null;if(a.collides==ig.Entity.COLLIDES.LITE||b.collides==ig.Entity.COLLIDES.FIXED){weak=a;} else if(b.collides==ig.Entity.COLLIDES.LITE||a.collides==ig.Entity.COLLIDES.FIXED){weak=b;} if(a.last.x+a.size.x>b.last.x&&a.last.xb.last.y&&a.last.y0)){var resTop=ig.game.collisionMap.trace(top.pos.x,top.pos.y,0,-(top.pos.y+top.size.y-bottom.pos.y),top.size.x,top.size.y);top.pos.y=resTop.pos.y;if(top.bounciness>0&&top.vel.y>top.minBounceVelocity){top.vel.y*=-top.bounciness;} else{top.standing=true;top.vel.y=0;}} else{var v2=(top.vel.y-bottom.vel.y)/2;top.vel.y=-v2;bottom.vel.y=v2;var nudgeX=bottom.vel.x*ig.system.tick;var resTop=ig.game.collisionMap.trace(top.pos.x,top.pos.y,nudgeX,-nudge/2,top.size.x,top.size.y);top.pos.y=resTop.pos.y;var resBottom=ig.game.collisionMap.trace(bottom.pos.x,bottom.pos.y,0,nudge/2,bottom.size.x,bottom.size.y);bottom.pos.y=resBottom.pos.y;}};}); // /home/jgilman/git/purelymental-games/tools/../launcher/lib/impact/map.js ig.baked=true;ig.module('impact.map').defines(function(){"use strict";ig.Map=ig.Class.extend({tilesize:8,width:1,height:1,data:[[]],name:null,init:function(tilesize,data){this.tilesize=tilesize;this.data=data;this.height=data.length;this.width=data[0].length;this.pxWidth=this.width*this.tilesize;this.pxHeight=this.height*this.tilesize;},getTile:function(x,y){var tx=Math.floor(x/this.tilesize);var ty=Math.floor(y/this.tilesize);if((tx>=0&&tx=0&&ty=0&&tx=0&&tythis.lastSlope){this.lastSlope=t|0;}}},trace:function(x,y,vx,vy,objectWidth,objectHeight){var res={collision:{x:false,y:false,slope:false},pos:{x:x,y:y},tile:{x:0,y:0}};var steps=Math.ceil(Math.max(Math.abs(vx),Math.abs(vy))/this.tilesize);if(steps>1){var sx=vx/steps;var sy=vy/steps;for(var i=0;i0?width:0);var tileOffsetX=(vx<0?this.tilesize:0);var firstTileY=Math.max(Math.floor(y/this.tilesize),0);var lastTileY=Math.min(Math.ceil((y+height)/this.tilesize),this.height);var tileX=Math.floor((res.pos.x+pxOffsetX)/this.tilesize);var prevTileX=Math.floor((x+pxOffsetX)/this.tilesize);if(step>0||tileX==prevTileX||prevTileX<0||prevTileX>=this.width){prevTileX=-1;} if(tileX>=0&&tileX1&&t<=this.lastSlope&&this._checkTileDef(res,t,x,y,rvx,rvy,width,height,prevTileX,tileY)){break;}} t=this.data[tileY][tileX];if(t==1||t>this.lastSlope||(t>1&&this._checkTileDef(res,t,x,y,rvx,rvy,width,height,tileX,tileY))){if(t>1&&t<=this.lastSlope&&res.collision.slope){break;} res.collision.x=true;res.tile.x=t;x=res.pos.x=tileX*this.tilesize-pxOffsetX+tileOffsetX;rvx=0;break;}}}} if(vy){var pxOffsetY=(vy>0?height:0);var tileOffsetY=(vy<0?this.tilesize:0);var firstTileX=Math.max(Math.floor(res.pos.x/this.tilesize),0);var lastTileX=Math.min(Math.ceil((res.pos.x+width)/this.tilesize),this.width);var tileY=Math.floor((res.pos.y+pxOffsetY)/this.tilesize);var prevTileY=Math.floor((y+pxOffsetY)/this.tilesize);if(step>0||tileY==prevTileY||prevTileY<0||prevTileY>=this.height){prevTileY=-1;} if(tileY>=0&&tileY1&&t<=this.lastSlope&&this._checkTileDef(res,t,x,y,rvx,rvy,width,height,tileX,prevTileY)){break;}} t=this.data[tileY][tileX];if(t==1||t>this.lastSlope||(t>1&&this._checkTileDef(res,t,x,y,rvx,rvy,width,height,tileX,tileY))){if(t>1&&t<=this.lastSlope&&res.collision.slope){break;} res.collision.y=true;res.tile.y=t;res.pos.y=tileY*this.tilesize-pxOffsetY+tileOffsetY;break;}}}}},_checkTileDef:function(res,t,x,y,vx,vy,width,height,tileX,tileY){var def=this.tiledef[t];if(!def){return false;} var lx=(tileX+def[0])*this.tilesize,ly=(tileY+def[1])*this.tilesize,lvx=(def[2]-def[0])*this.tilesize,lvy=(def[3]-def[1])*this.tilesize,solid=def[4];var tx=x+vx+(lvy<0?width:0)-lx,ty=y+vy+(lvx>0?height:0)-ly;if(lvx*ty-lvy*tx>0){if(vx*-lvy+vy*lvx<0){return solid;} var length=Math.sqrt(lvx*lvx+lvy*lvy);var nx=lvy/length,ny=-lvx/length;var proj=tx*nx+ty*ny;var px=nx*proj,py=ny*proj;if(px*px+py*py>=vx*vx+vy*vy){return solid||(lvx*(ty-vy)-lvy*(tx-vx)<0.5);} res.pos.x=x+vx-px;res.pos.y=y+vy-py;res.collision.slope={x:lvx,y:lvy,nx:nx,ny:ny};return true;} return false;}});var H=1/2,N=1/3,M=2/3,SOLID=true,NON_SOLID=false;ig.CollisionMap.defaultTileDef={5:[0,1,1,M,SOLID],6:[0,M,1,N,SOLID],7:[0,N,1,0,SOLID],3:[0,1,1,H,SOLID],4:[0,H,1,0,SOLID],2:[0,1,1,0,SOLID],10:[H,1,1,0,SOLID],21:[0,1,H,0,SOLID],32:[M,1,1,0,SOLID],43:[N,1,M,0,SOLID],54:[0,1,N,0,SOLID],27:[0,0,1,N,SOLID],28:[0,N,1,M,SOLID],29:[0,M,1,1,SOLID],25:[0,0,1,H,SOLID],26:[0,H,1,1,SOLID],24:[0,0,1,1,SOLID],11:[0,0,H,1,SOLID],22:[H,0,1,1,SOLID],33:[0,0,N,1,SOLID],44:[N,0,M,1,SOLID],55:[M,0,1,1,SOLID],16:[1,N,0,0,SOLID],17:[1,M,0,N,SOLID],18:[1,1,0,M,SOLID],14:[1,H,0,0,SOLID],15:[1,1,0,H,SOLID],13:[1,1,0,0,SOLID],8:[H,1,0,0,SOLID],19:[1,1,H,0,SOLID],30:[N,1,0,0,SOLID],41:[M,1,N,0,SOLID],52:[1,1,M,0,SOLID],38:[1,M,0,1,SOLID],39:[1,N,0,M,SOLID],40:[1,0,0,N,SOLID],36:[1,H,0,1,SOLID],37:[1,0,0,H,SOLID],35:[1,0,0,1,SOLID],9:[1,0,H,1,SOLID],20:[H,0,0,1,SOLID],31:[1,0,M,1,SOLID],42:[M,0,N,1,SOLID],53:[N,0,0,1,SOLID],12:[0,0,1,0,NON_SOLID],23:[1,1,0,1,NON_SOLID],34:[1,0,1,1,NON_SOLID],45:[0,1,0,0,NON_SOLID]};ig.CollisionMap.staticNoCollision={trace:function(x,y,vx,vy){return{collision:{x:false,y:false,slope:false},pos:{x:x+vx,y:y+vy},tile:{x:0,y:0}};}};}); // /home/jgilman/git/purelymental-games/tools/../launcher/lib/impact/background-map.js ig.baked=true;ig.module('impact.background-map').requires('impact.map','impact.image').defines(function(){"use strict";ig.BackgroundMap=ig.Map.extend({tiles:null,scroll:{x:0,y:0},distance:1,repeat:false,tilesetName:'',foreground:false,enabled:true,preRender:false,preRenderedChunks:null,chunkSize:512,debugChunks:false,anims:{},init:function(tilesize,data,tileset){this.parent(tilesize,data);this.setTileset(tileset);},setTileset:function(tileset){this.tilesetName=tileset instanceof ig.Image?tileset.path:tileset;this.tiles=new ig.Image(this.tilesetName);this.preRenderedChunks=null;},setScreenPos:function(x,y){this.scroll.x=x/this.distance;this.scroll.y=y/this.distance;},preRenderMapToChunks:function(){var totalWidth=this.width*this.tilesize*ig.system.scale,totalHeight=this.height*this.tilesize*ig.system.scale;this.chunkSize=Math.min(Math.max(totalWidth,totalHeight),this.chunkSize);var chunkCols=Math.ceil(totalWidth/this.chunkSize),chunkRows=Math.ceil(totalHeight/this.chunkSize);this.preRenderedChunks=[];for(var y=0;y=this.height||tileY<0){if(!this.repeat){continue;} tileY=(tileY%this.height+this.height)%this.height;} for(var mapX=-1,pxX=pxMinX;pxX=this.width||tileX<0){if(!this.repeat){continue;} tileX=(tileX%this.width+this.width)%this.width;} if((tile=this.data[tileY][tileX])){if((anim=this.anims[tile-1])){anim.draw(pxX,pxY);} else{this.tiles.drawTile(pxX,pxY,tile-1,this.tilesize);}}}}}});}); // /home/jgilman/git/purelymental-games/tools/../launcher/lib/impact/game.js ig.baked=true;ig.module('impact.game').requires('impact.impact','impact.entity','impact.collision-map','impact.background-map').defines(function(){"use strict";ig.Game=ig.Class.extend({clearColor:'#000000',gravity:0,screen:{x:0,y:0},_rscreen:{x:0,y:0},entities:[],namedEntities:{},collisionMap:ig.CollisionMap.staticNoCollision,backgroundMaps:[],backgroundAnims:{},autoSort:false,sortBy:null,cellSize:64,_deferredKill:[],_levelToLoad:null,_doSortEntities:false,staticInstantiate:function(){this.sortBy=this.sortBy||ig.Game.SORT.Z_INDEX;ig.game=this;return null;},loadLevel:function(data){this.screen={x:0,y:0};this.entities=[];this.namedEntities={};for(var i=0;i=1){displayTime=this.formatForMinutes(seconds);}else{displayTime=this.formatForSeconds(seconds);} displayTime+=":";if(milliseconds<100){displayTime+="0";} displayTime+=Math.floor(milliseconds/10);return displayTime;},formatForSeconds:function(seconds){var displayTime="00";if(seconds<10){displayTime="0"+seconds;}else if(seconds>=10){displayTime=""+seconds;} return displayTime;},formatForMinutes:function(seconds){var displayTime="0:00";if(seconds>=60){displayTime=Math.floor(seconds/60)+":";if(seconds%60<10){displayTime+="0";} displayTime+=seconds%60;}else{displayTime="0:"+this.formatForSeconds(delta);} return displayTime;},draw:function(){ig.draw.reset();ig.draw.setFill(this.clearColor);ig.draw.setStroke(null);ig.draw.rect(0,0,this.size.x,this.size.y);if(this.stopwatchEnabled||this.timerEnabled){this.timerImage.draw(10,10);this.numberFont.draw(this.displayTime,50,12,ig.Font.ALIGN.LEFT);} if(this.lifeEnabled){var lastPipDrawn=620;for(var i=Math.min(this.totalPips-1,this.activePips-1);i>=0;i--){this.trueLifePip.drawActive(lastPipDrawn-i*30,25);} lastPipDrawn-=this.activePips*30;for(var i=0;ithis.pos.x&&ig.input.mouse.x+ig.game.screen.xthis.pos.y&&ig.input.mouse.y+ig.game.screen.y=1){this.currentAnim.alpha=1;this.isDoingFade=false;} if(this.currentAnim.alpha<=0){this.currentAnim.alpha=0;this.isDoingFade=false;}} this.parent();},draw:function(){this.parent();}});Credits=ig.Game.extend({clearColor:"#000000",font:new ig.Font('common/proxima-extrabold-30-white.font.png'),scrollPos:0,creditsText:"Credits\n\n\nProgramming and Game Design:\nJustin Gilman\n\n\nArt and UI Design:\nJason Calleiro\n\n\nServer API:\nScott Shervington",loopCredits:false,endCredits:true,buttonClick:new ig.Sound(pmGameData.assetPath+'common/button-click.*'),init:function(){ig.game.spawnEntity(EntityButton,650,450,{size:{x:128,y:128},animSheet:new ig.AnimationSheet('common/backbutton.png',128,128),onRelease:function(){ig.game.buttonClick.play();ig.system.setGame(MainMenu);}});if(this.font.heightForString(this.creditsText)>ig.system.height){this.loopCredits=true;}},update:function(){if(this.loopCredits){if(this.scrollPos+ig.system.height>-100-this.font.heightForString(this.creditsText)){this.scrollPos--;}else{if(this.endCredits){ig.system.setGame(MainMenu);}else{this.scrollPos=0;}}}else{if(this.scrollPos+ig.system.height>(ig.system.height-this.font.heightForString(this.creditsText))/2){this.scrollPos--;}} this.parent();},draw:function(){this.parent();this.font.draw(this.creditsText,ig.system.width/2,this.scrollPos+ig.system.height,ig.Font.ALIGN.CENTER);}});}); // /home/jgilman/git/purelymental-games/tools/../launcher/lib/plugins/midas/browserinfo.js ig.baked=true;ig.module('plugins.midas.browserinfo').requires('impact.impact').defines(function(){PluginBrowserInfo=function(){this.getName=function(){var name=navigator.appName;var userAgent=navigator.userAgent;var nameMatch=userAgent.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);if(nameMatch){name=nameMatch[1];} return name;};this.getVersion=function(){var version=navigator.appVersion;var userAgent=navigator.userAgent;var versionMatch=userAgent.match(/version\/([\.\d]+)/i);var nameMatch=userAgent.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);if(nameMatch){version=nameMatch[2];if(versionMatch!=null){version=versionMatch[1];}} return version;};this.getMajorVersion=function(){return this.getVersion().split('.')[0];};this.getMinorVersion=function(){return this.getVersion().split('.')[1];};this.shouldBlock=function(browserFilter){for(var i=0;ithis.pos.x&&ig.input.mouse.x+ig.game.screen.xthis.pos.y&&ig.input.mouse.y+ig.game.screen.y0){var currentTweens=[];for(var i=0;i1?1:elapsed;var value=this.easing(elapsed);for(property in valuesDelta){this.propUpdate(property,_object,valuesStart,valuesDelta,value);} if(elapsed>=1){if(this.loopNum==0||!this.loop){this.complete=true;if(this.onComplete)this.onComplete();if(_chained)_chained.start();return false;}else if(this.loop==ig.Tween.Loop.Revert){for(property in valuesStart){this.propSet(property,valuesStart,_object);} _elapsed=0;timer.reset();if(this.loopNum!=-1)this.loopNum--;}else if(this.loop==ig.Tween.Loop.Reverse){var _start={},_end={},_delta={};ig.merge(_start,valuesEnd);ig.merge(_end,valuesStart);ig.merge(valuesStart,_start);ig.merge(valuesEnd,_end);for(property in valuesEnd){this.initDelta(property,valuesDelta,_object,valuesEnd);} _elapsed=0;timer.reset();if(this.loopNum!=-1)this.loopNum--;}}};this.pause=function(){this.paused=true;_elapsed+=timer.delta();};this.resume=function(){this.paused=false;timer.reset();};this.stop=function(doComplete){if(doComplete){this.paused=false;this.complete=false;this.loop=false;_elapsed+=duration;this.update();} this.complete=true;}};ig.Tween.Loop={Revert:1,Reverse:2};ig.Tween.Easing={Linear:{},Quadratic:{},Cubic:{},Quartic:{},Quintic:{},Sinusoidal:{},Exponential:{},Circular:{},Elastic:{},Back:{},Bounce:{}};ig.Tween.Easing.Linear.EaseNone=function(k){return k;};ig.Tween.Easing.Quadratic.EaseIn=function(k){return k*k;};ig.Tween.Easing.Quadratic.EaseOut=function(k){return-k*(k-2);};ig.Tween.Easing.Quadratic.EaseInOut=function(k){if((k*=2)<1)return 0.5*k*k;return-0.5*(--k*(k-2)-1);};ig.Tween.Easing.Cubic.EaseIn=function(k){return k*k*k;};ig.Tween.Easing.Cubic.EaseOut=function(k){return--k*k*k+1;};ig.Tween.Easing.Cubic.EaseInOut=function(k){if((k*=2)<1)return 0.5*k*k*k;return 0.5*((k-=2)*k*k+2);};ig.Tween.Easing.Quartic.EaseIn=function(k){return k*k*k*k;};ig.Tween.Easing.Quartic.EaseOut=function(k){return-(--k*k*k*k-1);} ig.Tween.Easing.Quartic.EaseInOut=function(k){if((k*=2)<1)return 0.5*k*k*k*k;return-0.5*((k-=2)*k*k*k-2);};ig.Tween.Easing.Quintic.EaseIn=function(k){return k*k*k*k*k;};ig.Tween.Easing.Quintic.EaseOut=function(k){return(k=k-1)*k*k*k*k+1;};ig.Tween.Easing.Quintic.EaseInOut=function(k){if((k*=2)<1)return 0.5*k*k*k*k*k;return 0.5*((k-=2)*k*k*k*k+2);};ig.Tween.Easing.Sinusoidal.EaseIn=function(k){return-Math.cos(k*Math.PI/2)+1;};ig.Tween.Easing.Sinusoidal.EaseOut=function(k){return Math.sin(k*Math.PI/2);};ig.Tween.Easing.Sinusoidal.EaseInOut=function(k){return-0.5*(Math.cos(Math.PI*k)-1);};ig.Tween.Easing.Exponential.EaseIn=function(k){return k==0?0:Math.pow(2,10*(k-1));};ig.Tween.Easing.Exponential.EaseOut=function(k){return k==1?1:-Math.pow(2,-10*k)+1;};ig.Tween.Easing.Exponential.EaseInOut=function(k){if(k==0)return 0;if(k==1)return 1;if((k*=2)<1)return 0.5*Math.pow(2,10*(k-1));return 0.5*(-Math.pow(2,-10*(k-1))+2);};ig.Tween.Easing.Circular.EaseIn=function(k){return-(Math.sqrt(1-k*k)-1);};ig.Tween.Easing.Circular.EaseOut=function(k){return Math.sqrt(1-(--k*k));};ig.Tween.Easing.Circular.EaseInOut=function(k){if((k/=0.5)<1)return-0.5*(Math.sqrt(1-k*k)-1);return 0.5*(Math.sqrt(1-(k-=2)*k)+1);};ig.Tween.Easing.Elastic.EaseIn=function(k){var s,a=0.1,p=0.4;if(k==0)return 0;if(k==1)return 1;if(!p)p=0.3;if(!a||a<1){a=1;s=p/4;} else s=p/(2*Math.PI)*Math.asin(1/a);return-(a*Math.pow(2,10*(k-=1))*Math.sin((k-s)*(2*Math.PI)/p));};ig.Tween.Easing.Elastic.EaseOut=function(k){var s,a=0.1,p=0.4;if(k==0)return 0;if(k==1)return 1;if(!p)p=0.3;if(!a||a<1){a=1;s=p/4;} else s=p/(2*Math.PI)*Math.asin(1/a);return(a*Math.pow(2,-10*k)*Math.sin((k-s)*(2*Math.PI)/p)+1);};ig.Tween.Easing.Elastic.EaseInOut=function(k){var s,a=0.1,p=0.4;if(k==0)return 0;if(k==1)return 1;if(!p)p=0.3;if(!a||a<1){a=1;s=p/4;} else s=p/(2*Math.PI)*Math.asin(1/a);if((k*=2)<1)return-0.5*(a*Math.pow(2,10*(k-=1))*Math.sin((k-s)*(2*Math.PI)/p));return a*Math.pow(2,-10*(k-=1))*Math.sin((k-s)*(2*Math.PI)/p)*0.5+1;};ig.Tween.Easing.Back.EaseIn=function(k){var s=1.70158;return k*k*((s+1)*k-s);};ig.Tween.Easing.Back.EaseOut=function(k){var s=1.70158;return(k=k-1)*k*((s+1)*k+s)+1;};ig.Tween.Easing.Back.EaseInOut=function(k){var s=1.70158*1.525;if((k*=2)<1)return 0.5*(k*k*((s+1)*k-s));return 0.5*((k-=2)*k*((s+1)*k+s)+2);};ig.Tween.Easing.Bounce.EaseIn=function(k){return 1-ig.Tween.Easing.Bounce.EaseOut(1-k);};ig.Tween.Easing.Bounce.EaseOut=function(k){if((k/=1)<(1/2.75)){return 7.5625*k*k;}else if(k<(2/2.75)){return 7.5625*(k-=(1.5/2.75))*k+0.75;}else if(k<(2.5/2.75)){return 7.5625*(k-=(2.25/2.75))*k+0.9375;}else{return 7.5625*(k-=(2.625/2.75))*k+0.984375;}};ig.Tween.Easing.Bounce.EaseInOut=function(k){if(k<0.5)return ig.Tween.Easing.Bounce.EaseIn(k*2)*0.5;return ig.Tween.Easing.Bounce.EaseOut(k*2-1)*0.5+0.5;};}); // /home/jgilman/git/purelymental-games/tools/../launcher/lib/com/purelymental/lights/entities/light.js ig.baked=true;ig.module('com.purelymental.lights.entities.light').requires('impact.entity','impact.sound','plugins.midas.draw','plugins.tween').defines(function(){LightingState={UNLIT:1,UNLIT_HOVERED:2,LIGHTING:3,LIT:4,LIT_HOVERED:5,DELIGHTING:6};EntityLight=ig.Entity.extend({size:{x:50,y:50},state:LightingState.LIT,font:new ig.Font(pmGameData.assetPath+'common/proxima-extrabold-12-white.font.png'),slot:[0,0],board:null,hintOnHover:false,hoverHintTrigger:null,clickSound:new ig.Sound(pmGameData.assetPath+'common/click.*'),hintDuration:null,init:function(x,y,settings){this.parent(x,y,settings);this.hintDuration=new ig.Timer();},update:function(){if(this.board.hintingEnabled){if(this.hoverHintTrigger!=null&&this.hoverHintTrigger.isHovered()){this.hintOnHover=true;}else{this.hintOnHover=false;}} if(this.isHovered()){if(this.board.hintingEnabled){this.hintOnHover=true;this.board.hoverHint(this.slot);} if(this.state==LightingState.UNLIT){this.state=LightingState.UNLIT_HOVERED;}else if(this.state==LightingState.LIT){this.state=LightingState.LIT_HOVERED;} if(ig.input.pressed('click')){this.clickSound.play();this.trigger();this.board.reportClick(this.slot);}}else{if(this.state==LightingState.UNLIT_HOVERED){this.state=LightingState.UNLIT;}else if(this.state==LightingState.LIT_HOVERED){this.state=LightingState.LIT;}} if(this.state==LightingState.LIGHTING||this.state==LightingState.DELIGHTING){this.size.x=70;this.size.y=70;this.tween({size:{x:50,y:50}},0.3,{easing:ig.Tween.Easing.Elastic.EaseOut}).start();} if(this.state==LightingState.LIGHTING){this.state=LightingState.LIT;}else if(this.state==LightingState.DELIGHTING){this.state=LightingState.UNLIT;} this.parent();},draw:function(){this.parent();ig.draw.reset();ig.draw.setLineWidth(5);ig.draw.setStroke("#888888");switch(this.state){case LightingState.UNLIT_HOVERED:ig.draw.setStroke("#FFFFFF");case LightingState.UNLIT:ig.draw.setFill("#222222");break;case LightingState.LIT_HOVERED:ig.draw.setStroke("#222222");case LightingState.LIT:ig.draw.setFill("#FFFFFF");break;} if(this.board.hintingEnabled&&this.hintOnHover||this.hintDuration.delta()<0){ig.draw.setStroke("#77FF77");} ig.draw.rect(this.pos.x-this.size.x/2,this.pos.y-this.size.y/2,this.size.x,this.size.y);if(ig.game.debug){this.font.draw(""+this.state,this.pos.x-this.size.x/2+5,this.pos.y-this.size.y/2+5,ig.Font.ALIGN.LEFT);}},isHovered:function(){return ig.input.mouse.x+ig.game.screen.x>this.pos.x-this.size.x/2&&ig.input.mouse.x+ig.game.screen.xthis.pos.y-this.size.y/2&&ig.input.mouse.y+ig.game.screen.y=ig.system.width/2){randomOutOfBoundsX+=ig.system.width/2;} var randomOutOfBoundsY=Math.floor(Math.random()*ig.system.height);if(randomOutOfBoundsY=ig.system.height/2){randomOutOfBoundsY+=ig.system.height/2;} this.lights[x][y].pos.x=randomOutOfBoundsX;this.lights[x][y].pos.y=randomOutOfBoundsY;this.lights[x][y].tween({pos:{x:destinationX,y:destinationY}},1.2,{easing:ig.Tween.Easing.Bounce.EaseOut,onComplete:function(){self.lightsStopped++;}}).start();}}},outtro:function(){if(this.inOuttro){return;} this.lightsStopped=0;this.inOuttro=true;for(var x=0;x=ig.system.width/2){randomOutOfBoundsX+=ig.system.width/2;} var randomOutOfBoundsY=Math.floor(Math.random()*ig.system.height);if(randomOutOfBoundsY=ig.system.height/2){randomOutOfBoundsY+=ig.system.height/2;} this.lights[x][y].tween({pos:{x:randomOutOfBoundsX,y:randomOutOfBoundsY}},0.7,{easing:ig.Tween.Easing.Quadratic.EaseOut,onComplete:function(){self.lightsStopped++;}}).start();}}},update:function(){this.parent();},draw:function(){this.parent();},isReady:function(){return this.lightsStopped==this.maxTiles.x*this.maxTiles.y;},toggleLight:function(positionArray){this.lights[positionArray[0]][positionArray[1]].trigger();this.triggerNeighbors(positionArray);},hintLight:function(positionArray){this.lights[positionArray[0]][positionArray[1]].hint();},toggleRandom:function(){this.originalLights=[];if(this.randomLightCount==-1){this.randomLightCount=Math.floor((this.maxTiles.x+this.maxTiles.y)/3)+1;} var validSpots=[];for(var y=0;y=0){this.lights[x][y-1].trigger();} if(x-1>=0){this.lights[x-1][y].trigger();} if(x+1=0){this.lights[x][y-1].hoverHint(this.lights[x][y]);} if(x-1>=0){this.lights[x-1][y].hoverHint(this.lights[x][y]);} if(x+10){var suggestion=incorrectLights.slice(0,1)[0];this.hintLight(suggestion);for(var i=0;i<4;i++){this.countClick();}}else{this.incorrectSound.play();}}});}); // /home/jgilman/git/purelymental-games/tools/../launcher/lib/com/purelymental/lights/game.js ig.baked=true;ig.module('com.purelymental.lights.game').requires('impact.game','impact.sound','com.purelymental.lights.entities.lightboard','plugins.midas.drawnbutton').defines(function(){Lights=ig.Game.extend({clearColor:"#26455C",debug:false,board:null,timerStarted:false,clickHistory:[],undoButton:null,roundData:null,buttonClick:new ig.Sound(pmGameData.assetPath+'common/button-click.*'),winSound:new ig.Sound(pmGameData.assetPath+'common/correct.*'),init:function(){ig.input.bind(ig.KEY.MOUSE1,'click');var lightsX=ig.global['paramData'].lightsx.shift();var lightsY=ig.global['paramData'].lightsy.shift();var randomCount=ig.global['paramData'].randomcount.shift();this.roundData={clicks:0,lightsx:lightsX,lightsy:lightsY,randomcount:randomCount,duration:0};ig.global['headerui'].enableLife();ig.global['headerui'].setPips(0,randomCount);ig.global['headerui'].enableStopwatch();ig.global['headerui'].clearStopwatch();var boardSettings={maxTiles:{x:lightsX,y:lightsY},randomLightCount:randomCount};this.board=ig.game.spawnEntity(EntityLightboard,50,50,boardSettings);this.board.intro();var self=this;this.undoButton=ig.game.spawnEntity(EntityDrawnButton,650,500,{text:"Undo",font:new ig.Font(pmGameData.assetPath+'common/proxima-extrabold-30-white.font.png'),fillColors:{idle:null,hover:pmGameData.complementColor,active:pmGameData.complementHighlightColor},onRelease:function(){self.undo();}});this.hintButton=ig.game.spawnEntity(EntityDrawnButton,15,500,{text:"Hint",font:new ig.Font(pmGameData.assetPath+'common/proxima-extrabold-30-white.font.png'),fillColors:{idle:null,hover:pmGameData.complementColor,active:pmGameData.complementHighlightColor},onRelease:function(){self.hint();}});},update:function(){this.undoButton.text="Undo ("+this.clickHistory.length+")";if(!this.timerStarted&&this.board.isReady()){ig.global['headerui'].startStopwatch();this.timerStarted=true;} this.parent();if(this.areAllLightsLit()&&this.board.isReady()&&!this.board.inOuttro){ig.global['headerui'].pauseStopwatch();this.board.outtro();this.winSound.play();} if(this.board.isReady()&&this.board.inOuttro){this.roundData.duration=ig.global['headerui'].getClock();ig.global['gameData'].rounds.push(this.roundData);if(ig.global['paramData'].randomcount.length==0){this.gameEnd();}else{ig.system.setGame(Lights);}} ig.global['headerui'].update();},areAllLightsLit:function(){var lightEntities=this.getEntitiesByType(EntityLight);for(var i=0;i0){ig.game.buttonClick.play();var lightSlotToUndo=this.clickHistory.splice(-1,1)[0];this.board.toggleLight(lightSlotToUndo);ig.global['headerui'].deactivateNextPip();}},hint:function(){ig.game.buttonClick.play();ig.game.board.randomHint(this.clickHistory);}});}); // /home/jgilman/git/purelymental-games/tools/../launcher/lib/com/purelymental/lights/gamewrapper.js ig.baked=true;ig.module('com.purelymental.lights.gamewrapper').requires('impact.game','plugins.midas.ajax','launcher.endgame','com.purelymental.lights.game').defines(function(){GameWrapper=ig.Game.extend({clearColor:pmGameData.backgroundColor,init:function(){if(ig.global["wrapperState"]=="starting"){this.start();ig.global["wrapperState"]="started";} if(ig.global["wrapperState"]=="ending"){this.end();ig.global["wrapperState"]="ended";}},update:function(){this.parent();},draw:function(){this.parent();},start:function(){ig.global['gameData']={};var gameDataPromise=ig.ajax.postJson("/api/games/"+pmGameData.id+"/start.json",{});gameDataPromise.done(function(result){ig.global['paramData']=result.paramData;});gameDataPromise.fail(function(){ig.global['paramData']={lightsx:[3,4,4],lightsy:[3,4,4],randomcount:[2,3,4]};});gameDataPromise.always(function(){ig.global['score']=0;ig.global['gameData'].rounds=[];ig.system.setGame(Lights);pmGameData.start();});},end:function(){var gameFinishPromise=ig.ajax.postJson("/api/games/"+pmGameData.id+"/finish.json",ig.global['gameData']);gameFinishPromise.done(function(result){ig.global['score']=result.score;ig.global['nextGame']=result.nextScreenData;});gameFinishPromise.fail(function(){var clickCost=0;var boardBalance=0;for(var i=0;i=0){this.callToActionTimer.set(1);var randomBoardIndex=Math.floor(Math.random()*this.demoBoards.length);this.demoBoards[randomBoardIndex].randomLightCount=1;this.demoBoards[randomBoardIndex].toggleRandom();}},reportClick:function(positionArray){},draw:function(){this.parent();this.font.draw("Lights is a game of logic and pattern recognition.\n\nClick a tile that is off to turn it on, but clicking one\nlight will also cause it's neighbors to switch.",20,50,ig.Font.ALIGN.LEFT);this.font.draw("You win when all of the lights are on.",20,500,ig.Font.ALIGN.LEFT);}});}); // /home/jgilman/git/purelymental-games/tools/../launcher/lib/launcher/mainmenu.js ig.baked=true;ig.module('launcher.mainmenu').requires('impact.game','impact.font','impact.sound','launcher.ui.header','launcher.ui.credits','plugins.midas.button','plugins.midas.browserinfo','com.purelymental.'+pmGameData.includePath+'.gamewrapper','com.purelymental.'+pmGameData.includePath+'.howtoplay').defines(function(){MainMenu=ig.Game.extend({font:new ig.Font(pmGameData.assetPath+'common/proxima-extrabold-30-white.font.png'),gameIcon:new ig.AnimationSheet(pmGameData.gameIcon,108,108),clearColor:pmGameData.backgroundColor,gameIconAnimation:null,buttonClick:new ig.Sound(pmGameData.assetPath+'common/button-click.*'),init:function(){this.gameIconAnimation=new ig.Animation(this.gameIcon,1,[pmGameData.gameIconIndex]);ig.global['score']=0;ig.global['gameData']={};document.body.style.cursor="default";ig.global['headerui']=new HeaderUI();ig.input.bind(ig.KEY.MOUSE1,'click');var x=ig.system.width/2,y=ig.system.height/2;ig.game.spawnEntity(EntityButton,x+24,y+150,{size:{x:190,y:48},animSheet:new ig.AnimationSheet(pmGameData.assetPath+'common/btnstartgame.png',190,48),onRelease:function(){ig.game.buttonClick.play();ig.global["wrapperState"]="starting";ig.system.setGame(GameWrapper);}});ig.game.spawnEntity(EntityButton,x-214,y+150,{size:{x:190,y:48},animSheet:new ig.AnimationSheet(pmGameData.assetPath+'common/btnhowtoplay.png',190,48),onRelease:function(){ig.game.buttonClick.play();ig.system.setGame(HowToPlay);}});ig.game.spawnEntity(CreditsButton,4,580,{size:{x:16,y:16},animSheet:new ig.AnimationSheet('common/credits.png',16,16),onRelease:function(){ig.game.buttonClick.play();ig.system.setGame(Credits);}});},update:function(){this.parent();ig.global['headerui'].update();},draw:function(){this.parent();var x=ig.system.width/2,y=ig.system.height/2;this.gameIconAnimation.draw(x-54,y-54);this.font.draw(pmGameData.displayName,x,y-150,ig.Font.ALIGN.CENTER);ig.global['headerui'].draw();}});var browsers=[{name:"Safari",version:6}];ig.ua.safari=/safari/i.test(navigator.userAgent);if(ig.ua.mobile||ig.browserInfo.shouldBlock(browsers)){ig.Sound.enabled=false;} ig.main('#canvas',MainMenu,60,800,600);});