var _STRINGS={Ad:{Mobile:{Preroll:{ReadyIn:"The game is ready in ",Loading:"Your game is loading...",Close:"Close"},Header:{ReadyIn:"The game is ready in ",Loading:"Your game is loading...",Close:"Close"},End:{ReadyIn:"Advertisement ends in ",Loading:"Please wait ...",Close:"Close"}}},Splash:{Loading:"Loading ...",LogoLine1:"Some text here",LogoLine2:"powered by MarketJS",LogoLine3:"none",TapToStart:"TAP TO START"},Game:{SelectPlayer:"Select Player",Win:"You win!",Lose:"You lose!",Score:"Score",Time:"Time", ComingSoon:"More Coming Soon!",Settings:"Settings",Delete:"Delete It?",DeleteAll:"Delete All?",DeleteAllButton:"Delete All",MainMenuButton:"Main Menu",SoundOnButton:"Sound On",SoundOffButton:"Sound Off",Save:"Save Image",Yes:"Yes",No:"No",Overide:"All of the slots is now full. Overide slot 12 ?",Notice1:"Select one of the slots first.",Notice2:"You have not created any drawings. Create one?",Notice3:"Please drop any shape first",Reset:"Reset",Rotate:"Rotate",RotateLeft:"Rotate Left",RotateRight:"Rotate Right", CreateNew:"Create New",ContinueDrawing:"Continue Drawing",DeleteDrawing:"Delete Drawing",Erase:"Erase",Back:"Back"},Tutorial:{Tutorial0:"Enable Tutorial ?",Tutorial1:"1. Drag and then drop one of the shapes to this board",Tutorial2:"2. Choose a size",Tutorial3:"3. Choose the color",Tutorial4:"4. And give your shape a smiley face ",Tutorial5:"5. You can rotate, erase, and clear the board",Tutorial6:"6. Save your creation by clicking Done",Tutorial5_1:"Use that tool to rotate the shape",Tutorial5_2:"Use that eraser to delete a shape", Tutorial5_3:"Click that button to clear the whole board",Tutorial5_4:"Use that tool to rotate left",Tutorial5_5:"Use that tool to rotate right",Tutorial5_6:"Click that button to back"},Results:{Title:"High score"}};var _SETTINGS={API:{Enabled:!0,Log:{Events:{InitializeGame:!0,EndGame:!0,Level:{Begin:!0,End:!0,Win:!0,Lose:!0,Draw:!0}}}},Ad:{Mobile:{Preroll:{Enabled:!1,Duration:5,Width:300,Height:250,Rotation:{Enabled:!1,Weight:{MobileAdInGamePreroll:40,MobileAdInGamePreroll2:40,MobileAdInGamePreroll3:20}}},Header:{Enabled:!1,Duration:5,Width:320,Height:50,Rotation:{Enabled:!1,Weight:{MobileAdInGameHeader:40,MobileAdInGameHeader2:40,MobileAdInGameHeader3:20}}},Footer:{Enabled:!1,Duration:5,Width:320,Height:50, Rotation:{Enabled:!1,Weight:{MobileAdInGameFooter:40,MobileAdInGameFooter2:40,MobileAdInGameFooter3:20}}},End:{Enabled:!1,Duration:1,Width:300,Height:250,Rotation:{Enabled:!1,Weight:{MobileAdInGameEnd:40,MobileAdInGameEnd2:40,MobileAdInGameEnd3:20}}}}},Language:{Default:"en"},DeveloperBranding:{Splash:{Enabled:!1},Logo:{Enabled:!1,Link:"http://google.com",LinkEnabled:!1,NewWindow:!0,Width:166,Height:61}},Branding:{Splash:{Enabled:!0},Logo:{Enabled:!0,Link:"http://google.com",LinkEnabled:!1,NewWindow:!0, Width:166,Height:61}},MoreGames:{Enabled:!1,Link:"http://www.marketjs.com/game/links/mobile",NewWindow:!0},TapToStartAudioUnlock:{Enabled:!1}};var MobileAdInGamePreroll={ad_duration:_SETTINGS.Ad.Mobile.Preroll.Duration,ad_width:_SETTINGS.Ad.Mobile.Preroll.Width,ad_height:_SETTINGS.Ad.Mobile.Preroll.Height,ready_in:_STRINGS.Ad.Mobile.Preroll.ReadyIn,loading:_STRINGS.Ad.Mobile.Preroll.Loading,close:_STRINGS.Ad.Mobile.Preroll.Close+"          ",Initialize:function(){if(_SETTINGS.Ad.Mobile.Preroll.Rotation.Enabled){var b=_SETTINGS.Ad.Mobile.Preroll.Rotation.Weight,c=b.MobileAdInGamePreroll,d= c+b.MobileAdInGamePreroll2,b=d+b.MobileAdInGamePreroll3,e=Math.floor(100*Math.random());console.log("seed: ",e);e<=c?this.selectedOverlayName="MobileAdInGamePreroll":e<=d?this.selectedOverlayName="MobileAdInGamePreroll2":e<=b&&(this.selectedOverlayName="MobileAdInGamePreroll3");console.log("Ad rotating preroll enabled")}else this.selectedOverlayName="MobileAdInGamePreroll",console.log("Ad rotating preroll disabled");console.log("selected:",this.selectedOverlayName);this.overlay=$("#"+this.selectedOverlayName); this.box=$("#"+this.selectedOverlayName+"-Box");this.game=$("#game");this.boxContents={footer:$("#"+this.selectedOverlayName+"-Box-Footer"),header:$("#"+this.selectedOverlayName+"-Box-Header"),close:$("#"+this.selectedOverlayName+"-Box-Close"),body:$("#"+this.selectedOverlayName+"-Box-Body")};this.box.width(this.ad_width);this.box.height(this.ad_height);this.box.css("left",(this.overlay.width()-this.box.width())/2);this.box.css("top",(this.overlay.height()-this.box.height()-this.boxContents.header.height()- this.boxContents.footer.height())/2);this.overlay.show(this.Timer(this.ad_duration))},Timer:function(b){var c=b,d=setInterval(function(){MobileAdInGamePreroll.boxContents.header.text(MobileAdInGamePreroll.ready_in+c+"...");MobileAdInGamePreroll.boxContents.footer.text(MobileAdInGamePreroll.loading);c--;0>c&&(clearInterval(d),MobileAdInGamePreroll.boxContents.close.css("left",MobileAdInGamePreroll.boxContents.body.width()-23),MobileAdInGamePreroll.boxContents.close.show(),MobileAdInGamePreroll.boxContents.header.html(MobileAdInGamePreroll.close), MobileAdInGamePreroll.boxContents.footer.text(""))},1E3)},Close:function(){this.boxContents.close.hide();this.overlay.hide()}};var MobileAdInGameHeader={ad_duration:_SETTINGS.Ad.Mobile.Header.Duration,ad_width:_SETTINGS.Ad.Mobile.Header.Width,ad_height:_SETTINGS.Ad.Mobile.Header.Height,Initialize:function(){if(_SETTINGS.Ad.Mobile.Header.Rotation.Enabled){var b=_SETTINGS.Ad.Mobile.Header.Rotation.Weight,c=b.MobileAdInGameHeader,d=c+b.MobileAdInGameHeader2,b=d+b.MobileAdInGameHeader3,e=Math.floor(100*Math.random());console.log("seed: ",e);e<=c?this.selectedOverlayName="MobileAdInGameHeader":e<=d?this.selectedOverlayName="MobileAdInGameHeader2": e<=b&&(this.selectedOverlayName="MobileAdInGameHeader3");console.log("Ad rotating header enabled")}else this.selectedOverlayName="MobileAdInGameHeader",console.log("Ad rotating header disabled");this.div=$("#"+this.selectedOverlayName);this.game=$("#game");this.div.width(this.ad_width);this.div.height(this.ad_height);this.div.css("left",this.game.position().left+(this.game.width()-this.div.width())/2);this.div.css("top",0);this.div.show(this.Timer(this.ad_duration))},Timer:function(b){var c=setInterval(function(){b--; 0>b&&(MobileAdInGameHeader.div.hide(),clearInterval(c))},1E3)}};var MobileAdInGameFooter={ad_duration:_SETTINGS.Ad.Mobile.Footer.Duration,ad_width:_SETTINGS.Ad.Mobile.Footer.Width,ad_height:_SETTINGS.Ad.Mobile.Footer.Height,Initialize:function(){if(_SETTINGS.Ad.Mobile.Footer.Rotation.Enabled){var b=_SETTINGS.Ad.Mobile.Footer.Rotation.Weight,c=b.MobileAdInGameFooter,d=c+b.MobileAdInGameFooter2,b=d+b.MobileAdInGameFooter3,e=Math.floor(100*Math.random());console.log("seed: ",e);e<=c?this.selectedOverlayName="MobileAdInGameFooter":e<=d?this.selectedOverlayName="MobileAdInGameFooter2": e<=b&&(this.selectedOverlayName="MobileAdInGameFooter3");console.log("Ad rotating footer enabled")}else this.selectedOverlayName="MobileAdInGameFooter",console.log("Ad rotating footer disabled");this.div=$("#"+this.selectedOverlayName);this.game=$("#game");this.div.width(this.ad_width);this.div.height(this.ad_height);this.div.css("left",this.game.position().left+(this.game.width()-this.div.width())/2);this.div.css("top",this.game.height()-this.div.height()-5);this.div.show(this.Timer(this.ad_duration))}, Timer:function(b){var c=setInterval(function(){b--;0>b&&(MobileAdInGameFooter.div.hide(),clearInterval(c))},1E3)}};var MobileAdInGameEnd={ad_duration:_SETTINGS.Ad.Mobile.End.Duration,ad_width:_SETTINGS.Ad.Mobile.End.Width,ad_height:_SETTINGS.Ad.Mobile.End.Height,ready_in:_STRINGS.Ad.Mobile.End.ReadyIn,loading:_STRINGS.Ad.Mobile.End.Loading,close:_STRINGS.Ad.Mobile.End.Close+"          ",Initialize:function(){if(_SETTINGS.Ad.Mobile.End.Rotation.Enabled){var b=_SETTINGS.Ad.Mobile.End.Rotation.Weight,c=b.MobileAdInGameEnd,d=c+b.MobileAdInGameEnd2,b=d+b.MobileAdInGameEnd3, e=Math.floor(100*Math.random());console.log("seed: ",e);e<=c?this.selectedOverlayName="MobileAdInGameEnd":e<=d?this.selectedOverlayName="MobileAdInGameEnd2":e<=b&&(this.selectedOverlayName="MobileAdInGameEnd3");console.log("Ad rotating end enabled")}else this.selectedOverlayName="MobileAdInGameEnd",console.log("Ad rotating end disabled");console.log("selected:",this.selectedOverlayName);this.overlay=$("#"+this.selectedOverlayName);this.box=$("#"+this.selectedOverlayName+"-Box");this.game=$("#game"); this.boxContents={footer:$("#"+this.selectedOverlayName+"-Box-Footer"),header:$("#"+this.selectedOverlayName+"-Box-Header"),close:$("#"+this.selectedOverlayName+"-Box-Close"),body:$("#"+this.selectedOverlayName+"-Box-Body")};this.box.width(this.ad_width);this.box.height(this.ad_height);this.box.css("left",(this.overlay.width()-this.box.width())/2);this.box.css("top",(this.overlay.height()-this.box.height()-this.boxContents.header.height()-this.boxContents.footer.height())/2);this.overlay.show(this.Timer(this.ad_duration))}, Timer:function(b){var c=b,d=setInterval(function(){MobileAdInGameEnd.boxContents.header.text(MobileAdInGameEnd.ready_in+c+"...");MobileAdInGameEnd.boxContents.footer.text(MobileAdInGameEnd.loading);c--;0>c&&(clearInterval(d),MobileAdInGameEnd.boxContents.close.css("left",MobileAdInGameEnd.boxContents.body.width()-23),MobileAdInGameEnd.boxContents.close.show(),MobileAdInGameEnd.boxContents.header.html(MobileAdInGameEnd.close),MobileAdInGameEnd.boxContents.footer.text(""))},1E3)},Close:function(){this.boxContents.close.hide(); this.overlay.hide()}};!function(b,c){"object"==typeof module&&"object"==typeof module.exports?module.exports=b.document?c(b,!0):function(b){if(!b.document)throw Error("jQuery requires a window with a document");return c(b)}:c(b)}("undefined"!=typeof window?window:this,function(b,c){function d(b,c){c=c||C;var d=c.createElement("script");d.text=b;c.head.appendChild(d).parentNode.removeChild(d)}function e(b){var c=!!b&&"length"in b&&b.length,d=j.type(b);return"function"!==d&&!j.isWindow(b)&&("array"===d||0===c||"number"== typeof c&&0tbody",b)[0]||b:b}function Oa(b){return b.type=(null!==b.getAttribute("type"))+"/"+b.type,b}function Pa(b){var c=Jc.exec(b.type);return c?b.type=c[1]:b.removeAttribute("type"),b}function Hb(b,c){var d,f,e,m,g,p;if(1===c.nodeType){if(E.hasData(b)&&(d=E.access(b),f=E.set(c,d),p=d.events))for(e in delete f.handle,f.events={},p){d=0;for(f=p[e].length;dc;c+=2)"margin"===d&&(m+=j.css(b,d+ma[c],!0,e)),f?("content"===d&&(m-=j.css(b,"padding"+ma[c],!0,e)),"margin"!==d&&(m-=j.css(b,"border"+ma[c]+"Width",!0,e))):(m+=j.css(b,"padding"+ma[c],!0,e),"padding"!==d&&(m+=j.css(b,"border"+ma[c]+"Width",!0,e)));return m}function Rb(b,c,d){var f,e=Qa(b), m=Ga(b,c,e),g="border-box"===j.css(b,"boxSizing",!1,e);return kb.test(m)?m:(f=g&&(I.boxSizingReliable()||m===b.style[c]),"auto"===m&&(m=b["offset"+c[0].toUpperCase()+c.slice(1)]),m=parseFloat(m)||0,m+Qb(b,c,d||(g?"border":"content"),f,e)+"px")}function P(b,c,d,f,e){return new P.prototype.init(b,c,d,f,e)}function lb(){Ra&&(!1===C.hidden&&b.requestAnimationFrame?b.requestAnimationFrame(lb):b.setTimeout(lb,j.fx.interval),j.fx.tick())}function Sb(){return b.setTimeout(function(){xa=void 0}),xa=j.now()} function Sa(b,c){var d,f=0,e={height:b};for(c=c?1:0;4>f;f+=2-c)d=ma[f],e["margin"+d]=e["padding"+d]=b;return c&&(e.opacity=e.width=b),e}function Tb(b,c,d){for(var f,e=(W.tweeners[c]||[]).concat(W.tweeners["*"]),j=0,m=e.length;jd&&f?c:(f||p.notifyWith(b,[n,1,0]),p.resolveWith(b,[n]),!1)},n=p.promise({elem:b,props:j.extend({},c),opts:j.extend(!0,{specialEasing:{},easing:j.easing._default},d),originalProperties:c,originalOptions:d,startTime:xa||Sb(),duration:d.duration,tweens:[],createTween:function(c,d){var z=j.Tween(b,n.opts,c,d,n.opts.specialEasing[c]||n.opts.easing);return n.tweens.push(z),z},stop:function(c){var d=0,z=c?n.tweens.length:0;if(e)return this;for(e=!0;db?this[b+this.length]:this[b]},pushStack:function(b){b=j.merge(this.constructor(),b);return b.prevObject=this,b},each:function(b){return j.each(this,b)},map:function(b){return this.pushStack(j.map(this,function(c,d){return b.call(c,d,c)}))},slice:function(){return this.pushStack(qa.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)}, eq:function(b){var c=this.length;b=+b+(0>b?c:0);return this.pushStack(0<=b&&bB.cacheLength&&delete b[c.shift()],b[d+" "]=f}var c=[];return b},X=function(b){return b[M]=!0,b},Z=function(b){var c=H.createElement("fieldset");try{return!!b(c)}catch(d){return!1}finally{c.parentNode&&c.parentNode.removeChild(c)}},ub=function(b,c){for(var d=b.split("|"),f=d.length;f--;)B.attrHandle[d[f]]=c},ac=function(b,c){var d=c&&b,f=d&&1===b.nodeType&&1===c.nodeType&&b.sourceIndex-c.sourceIndex;if(f)return f;if(d)for(;d=d.nextSibling;)if(d=== c)return-1;return b?1:-1},Vc=function(b){return function(c){return"input"===c.nodeName.toLowerCase()&&c.type===b}},Wc=function(b){return function(c){var d=c.nodeName.toLowerCase();return("input"===d||"button"===d)&&c.type===b}},bc=function(b){return function(c){return"form"in c?c.parentNode&&!1===c.disabled?"label"in c?"label"in c.parentNode?c.parentNode.disabled===b:c.disabled===b:c.isDisabled===b||c.isDisabled!==!b&&Xc(c)===b:c.disabled===b:"label"in c&&c.disabled===b}},ra=function(b){return X(function(c){return c= +c,X(function(d,f){for(var e,j=b([],d.length,c),m=j.length;m--;)d[e=j[m]]&&(d[e]=!(f[e]=d[e]))})})},sb=function(b){return b&&"undefined"!=typeof b.getElementsByTagName&&b},cc=function(){},Wa=function(b){for(var c=0,d=b.length,f="";c+~]|[\x20\t\r\n\f])[\x20\t\r\n\f]*/,ed=/=[\x20\t\r\n\f]*([^\]'"]*?)[\x20\t\r\n\f]*\]/g,fd=RegExp(":((?:\\\\.|[\\w-]|[^\x00-\\xa0])+)(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\x00-\\xa0])+)(?:[\\x20\\t\\r\\n\\f]*([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|((?:\\\\.|[\\w-]|[^\x00-\\xa0])+))|)[\\x20\\t\\r\\n\\f]*\\])*)|.*)\\)|)"), gd=/^(?:\\.|[\w-]|[^\x00-\xa0])+$/,cb={ID:/^#((?:\\.|[\w-]|[^\x00-\xa0])+)/,CLASS:/^\.((?:\\.|[\w-]|[^\x00-\xa0])+)/,TAG:/^((?:\\.|[\w-]|[^\x00-\xa0])+|[*])/,ATTR:RegExp("^\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\x00-\\xa0])+)(?:[\\x20\\t\\r\\n\\f]*([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|((?:\\\\.|[\\w-]|[^\x00-\\xa0])+))|)[\\x20\\t\\r\\n\\f]*\\]"),PSEUDO:RegExp("^:((?:\\\\.|[\\w-]|[^\x00-\\xa0])+)(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\x00-\\xa0])+)(?:[\\x20\\t\\r\\n\\f]*([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|((?:\\\\.|[\\w-]|[^\x00-\\xa0])+))|)[\\x20\\t\\r\\n\\f]*\\])*)|.*)\\)|)"), CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)", "i")},hd=/^(?:input|select|textarea|button)$/i,id=/^h\d$/i,Ja=/^[^{]+\{\s*\[native \w/,Uc=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rb=/[+~]/,ba=/\\([\da-f]{1,6}[\x20\t\r\n\f]?|([\x20\t\r\n\f])|.)/ig,ca=function(b,c,d){b="0x"+c-65536;return b!==b||d?c:0>b?String.fromCharCode(b+65536):String.fromCharCode(b>>10|55296,1023&b|56320)},Yb=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,Zb=function(b,c){return c?"\x00"===b?"\ufffd":b.slice(0,-1)+"\\"+b.charCodeAt(b.length-1).toString(16)+" ":"\\"+b},hc=function(){ia()}, Xc=Ya(function(b){return!0===b.disabled&&("form"in b||"label"in b)},{dir:"parentNode",next:"legend"});try{ja.apply(ua=gc.call(T.childNodes),T.childNodes),ua[T.childNodes.length].nodeType}catch(Ld){ja={apply:ua.length?function(b,c){ad.apply(b,gc.call(c))}:function(b,c){for(var d=b.length,f=0;b[d++]=c[f++];);b.length=d-1}}}L=G.support={};dc=G.isXML=function(b){b=b&&(b.ownerDocument||b).documentElement;return!!b&&"HTML"!==b.nodeName};ia=G.setDocument=function(b){var c,d;b=b?b.ownerDocument||b:T;return b!== H&&9===b.nodeType&&b.documentElement?(H=b,V=H.documentElement,U=!dc(H),T!==H&&(d=H.defaultView)&&d.top!==d&&(d.addEventListener?d.addEventListener("unload",hc,!1):d.attachEvent&&d.attachEvent("onunload",hc)),L.attributes=Z(function(b){return b.className="i",!b.getAttribute("className")}),L.getElementsByTagName=Z(function(b){return b.appendChild(H.createComment("")),!b.getElementsByTagName("*").length}),L.getElementsByClassName=Ja.test(H.getElementsByClassName),L.getById=Z(function(b){return V.appendChild(b).id= M,!H.getElementsByName||!H.getElementsByName(M).length}),L.getById?(B.filter.ID=function(b){var c=b.replace(ba,ca);return function(b){return b.getAttribute("id")===c}},B.find.ID=function(b,c){if("undefined"!=typeof c.getElementById&&U){var d=c.getElementById(b);return d?[d]:[]}}):(B.filter.ID=function(b){var c=b.replace(ba,ca);return function(b){return(b="undefined"!=typeof b.getAttributeNode&&b.getAttributeNode("id"))&&b.value===c}},B.find.ID=function(b,c){if("undefined"!=typeof c.getElementById&& U){var d,x,f,z=c.getElementById(b);if(z){if(d=z.getAttributeNode("id"),d&&d.value===b)return[z];f=c.getElementsByName(b);for(x=0;z=f[x++];)if(d=z.getAttributeNode("id"),d&&d.value===b)return[z]}return[]}}),B.find.TAG=L.getElementsByTagName?function(b,c){return"undefined"!=typeof c.getElementsByTagName?c.getElementsByTagName(b):L.qsa?c.querySelectorAll(b):void 0}:function(b,c){var d,x=[],f=0,z=c.getElementsByTagName(b);if("*"===b){for(;d=z[f++];)1===d.nodeType&&x.push(d);return x}return z},B.find.CLASS= L.getElementsByClassName&&function(b,c){if("undefined"!=typeof c.getElementsByClassName&&U)return c.getElementsByClassName(b)},ta=[],N=[],(L.qsa=Ja.test(H.querySelectorAll))&&(Z(function(b){V.appendChild(b).innerHTML="";b.querySelectorAll("[msallowcapture^='']").length&&N.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")");b.querySelectorAll("[selected]").length||N.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)"); b.querySelectorAll("[id~="+M+"-]").length||N.push("~=");b.querySelectorAll(":checked").length||N.push(":checked");b.querySelectorAll("a#"+M+"+*").length||N.push(".#.+[+~]")}),Z(function(b){b.innerHTML="";var c=H.createElement("input");c.setAttribute("type","hidden");b.appendChild(c).setAttribute("name","D");b.querySelectorAll("[name=d]").length&&N.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?=");2!==b.querySelectorAll(":enabled").length&& N.push(":enabled",":disabled");V.appendChild(b).disabled=!0;2!==b.querySelectorAll(":disabled").length&&N.push(":enabled",":disabled");b.querySelectorAll("*,:x");N.push(",.*:")})),(L.matchesSelector=Ja.test(bb=V.matches||V.webkitMatchesSelector||V.mozMatchesSelector||V.oMatchesSelector||V.msMatchesSelector))&&Z(function(b){L.disconnectedMatch=bb.call(b,"*");bb.call(b,"[s!='']:x");ta.push("!=",":((?:\\\\.|[\\w-]|[^\x00-\\xa0])+)(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\x00-\\xa0])+)(?:[\\x20\\t\\r\\n\\f]*([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|((?:\\\\.|[\\w-]|[^\x00-\\xa0])+))|)[\\x20\\t\\r\\n\\f]*\\])*)|.*)\\)|)")}), N=N.length&&RegExp(N.join("|")),ta=ta.length&&RegExp(ta.join("|")),c=Ja.test(V.compareDocumentPosition),Ha=c||Ja.test(V.contains)?function(b,c){var d=9===b.nodeType?b.documentElement:b,x=c&&c.parentNode;return b===x||!(!x||1!==x.nodeType||!(d.contains?d.contains(x):b.compareDocumentPosition&&16&b.compareDocumentPosition(x)))}:function(b,c){if(c)for(;c=c.parentNode;)if(c===b)return!0;return!1},zb=c?function(b,c){if(b===c)return za=!0,0;var d=!b.compareDocumentPosition-!c.compareDocumentPosition;return d? d:(d=(b.ownerDocument||b)===(c.ownerDocument||c)?b.compareDocumentPosition(c):1,1&d||!L.sortDetached&&c.compareDocumentPosition(b)===d?b===H||b.ownerDocument===T&&Ha(T,b)?-1:c===H||c.ownerDocument===T&&Ha(T,c)?1:ka?sa(ka,b)-sa(ka,c):0:4&d?-1:1)}:function(b,c){if(b===c)return za=!0,0;var d,x=0;d=b.parentNode;var f=c.parentNode,z=[b],e=[c];if(!d||!f)return b===H?-1:c===H?1:d?-1:f?1:ka?sa(ka,b)-sa(ka,c):0;if(d===f)return ac(b,c);for(d=b;d=d.parentNode;)z.unshift(d);for(d=c;d=d.parentNode;)e.unshift(d); for(;z[x]===e[x];)x++;return x?ac(z[x],e[x]):z[x]===T?-1:e[x]===T?1:0},H):H};G.matches=function(b,c){return G(b,null,null,c)};G.matchesSelector=function(b,c){if((b.ownerDocument||b)!==H&&ia(b),c=c.replace(ed,"='$1']"),L.matchesSelector&&U&&!Va[c+" "]&&(!ta||!ta.test(c))&&(!N||!N.test(c)))try{var d=bb.call(b,c);if(d||L.disconnectedMatch||b.document&&11!==b.document.nodeType)return d}catch(f){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0}, "~":{dir:"previousSibling"}},preFilter:{ATTR:function(b){return b[1]=b[1].replace(ba,ca),b[3]=(b[3]||b[4]||b[5]||"").replace(ba,ca),"~="===b[2]&&(b[3]=" "+b[3]+" "),b.slice(0,4)},CHILD:function(b){return b[1]=b[1].toLowerCase(),"nth"===b[1].slice(0,3)?(b[3]||G.error(b[0]),b[4]=+(b[4]?b[5]+(b[6]||1):2*("even"===b[3]||"odd"===b[3])),b[5]=+(b[7]+b[8]||"odd"===b[3])):b[3]&&G.error(b[0]),b},PSEUDO:function(b){var c,d=!b[6]&&b[2];return cb.CHILD.test(b[0])?null:(b[3]?b[2]=b[4]||b[5]||"":d&&fd.test(d)&& (c=Ia(d,!0))&&(c=d.indexOf(")",d.length-c)-d.length)&&(b[0]=b[0].slice(0,c),b[2]=d.slice(0,c)),b.slice(0,3))}},filter:{TAG:function(b){var c=b.replace(ba,ca).toLowerCase();return"*"===b?function(){return!0}:function(b){return b.nodeName&&b.nodeName.toLowerCase()===c}},CLASS:function(b){var c=ec[b+" "];return c||(c=RegExp("(^|[\\x20\\t\\r\\n\\f])"+b+"([\\x20\\t\\r\\n\\f]|$)"))&&ec(b,function(b){return c.test("string"==typeof b.className&&b.className||"undefined"!=typeof b.getAttribute&&b.getAttribute("class")|| "")})},ATTR:function(b,c,d){return function(f){f=G.attr(f,b);return null==f?"!="===c:!c||(f+="","="===c?f===d:"!="===c?f!==d:"^="===c?d&&0===f.indexOf(d):"*="===c?d&&-1b.nodeType)return!1;return!0},parent:function(b){return!B.pseudos.empty(b)},header:function(b){return id.test(b.nodeName)},input:function(b){return hd.test(b.nodeName)}, button:function(b){var c=b.nodeName.toLowerCase();return"input"===c&&"button"===b.type||"button"===c},text:function(b){var c;return"input"===b.nodeName.toLowerCase()&&"text"===b.type&&(null==(c=b.getAttribute("type"))||"text"===c.toLowerCase())},first:ra(function(){return[0]}),last:ra(function(b,c){return[c-1]}),eq:ra(function(b,c,d){return[0>d?d+c:d]}),even:ra(function(b,c){for(var d=0;dd?d+c:d;0<=--c;)b.push(c);return b}),gt:ra(function(b,c,d){for(d=0>d?d+c:d;++d:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i, Fc=/^.[^:#\[\.,]*$/;j.filter=function(b,c,d){var f=c[0];return d&&(b=":not("+b+")"),1===c.length&&1===f.nodeType?j.find.matchesSelector(f,b)?[f]:[]:j.find.matches(b,j.grep(c,function(b){return 1===b.nodeType}))};j.fn.extend({find:function(b){var c,d,f=this.length,e=this;if("string"!=typeof b)return this.pushStack(j(b).filter(function(){for(c=0;c)[^>]*|#([\w-]+))$/;(j.fn.init=function(b,c,d){var f,e;if(!b)return this;if(d=d||lc,"string"==typeof b){if(f="<"===b[0]&&">"===b[b.length-1]&&3<=b.length?[null,b,null]:jd.exec(b),!f||!f[1]&&c)return!c||c.jquery?(c||d).find(b):this.constructor(c).find(b);if(f[1]){if(c=c instanceof j?c[0]:c,j.merge(this,j.parseHTML(f[1], c&&c.nodeType?c.ownerDocument||c:C,!0)),kc.test(f[1])&&j.isPlainObject(c))for(f in c)j.isFunction(this[f])?this[f](c[f]):this.attr(f,c[f]);return this}return e=C.getElementById(f[2]),e&&(this[0]=e,this.length=1),this}return b.nodeType?(this[0]=b,this.length=1,this):j.isFunction(b)?void 0!==d.ready?d.ready(b):b(j):j.makeArray(b,this)}).prototype=j.fn;lc=j(C);var kd=/^(?:parents|prev(?:Until|All))/,ld={children:!0,contents:!0,next:!0,prev:!0};j.fn.extend({has:function(b){var c=j(b,this),d=c.length; return this.filter(function(){for(var b=0;bd.nodeType&&(g?-1=g&&(x!==f&&(z=void 0,p=[b]),d.rejectWith(z,p))}};c?J():(j.Deferred.getStackHook&&(J.stackTrace=j.Deferred.getStackHook()),b.setTimeout(J))}}var g=0;return j.Deferred(function(b){d[0][3].add(m(0,b,j.isFunction(e)?e:n,b.notifyWith));d[1][3].add(m(0,b,j.isFunction(c)?c:n));d[2][3].add(m(0,b,j.isFunction(x)?x:f))}).promise()},promise:function(b){return null!=b?j.extend(b,m):m}},g={};return j.each(d,function(b,c){var f=c[2],x=c[5];m[c[1]]=f.add;x&&f.add(function(){e=x},d[3-b][2].disable, d[0][2].lock);f.add(c[3].fire);g[c[0]]=function(){return g[c[0]+"With"](this===g?void 0:this,arguments),this};g[c[0]+"With"]=f.fireWith}),m.promise(g),c&&c.call(g,g),g},when:function(b){var c=arguments.length,d=c,f=Array(d),e=qa.call(arguments),g=j.Deferred(),p=function(b){return function(d){f[b]=this;e[b]=1=c&&(m(b,g.done(p(d)).resolve,g.reject,!c),"pending"===g.state()||j.isFunction(e[d]&&e[d].then)))return g.then();for(;d--;)m(e[d], p(d),g.reject);return g.promise()}});var md=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;j.Deferred.exceptionHook=function(c,d){b.console&&b.console.warn&&c&&md.test(c.name)&&b.console.warn("jQuery.Deferred exception: "+c.message,c.stack,d)};j.readyException=function(c){b.setTimeout(function(){throw c;})};var Ab=j.Deferred();j.fn.ready=function(b){return Ab.then(b)["catch"](function(b){j.readyException(b)}),this};j.extend({isReady:!1,readyWait:1,ready:function(b){(!0===b?--j.readyWait: j.isReady)||(j.isReady=!0,!0!==b&&0<--j.readyWait||Ab.resolveWith(C,[j]))}});j.ready.then=Ab.then;"complete"===C.readyState||"loading"!==C.readyState&&!C.documentElement.doScroll?b.setTimeout(j.ready):(C.addEventListener("DOMContentLoaded",p),b.addEventListener("load",p));var da=function(b,c,d,f,e,m,g){var p=0,l=b.length,n=null==d;if("object"===j.type(d))for(p in e=!0,d)da(b,c,p,d[p],!0,m,g);else if(void 0!==f&&(e=!0,j.isFunction(f)||(g=!0),n&&(g?(c.call(b,f),c=null):(n=c,c=function(b,c,d){return n.call(j(b), d)})),c))for(;p\x20\t\r\n\f]+)/i,Gb=/^$|\/(?:java|ecma)script/i,R={option:[1,""],thead:[1,"","
"],col:[2,"","
"], tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};R.optgroup=R.option;R.tbody=R.tfoot=R.colgroup=R.caption=R.thead;R.th=R.td;var Ic=/<|&#?\w+;/,eb=C.createDocumentFragment().appendChild(C.createElement("div")),fb=C.createElement("input");fb.setAttribute("type","radio");fb.setAttribute("checked","checked");fb.setAttribute("name","t");eb.appendChild(fb);I.checkClone=eb.cloneNode(!0).cloneNode(!0).lastChild.checked;eb.innerHTML=""; I.noCloneChecked=!!eb.cloneNode(!0).lastChild.defaultValue;!0;var gb=C.documentElement,nd=/^key/,od=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,pc=/^([^.]*)(?:\.(.+)|)/;j.event={global:{},add:function(b,c,d,f,e){var m,g,p,l,n,r,s,q,u,t;if(n=E.get(b)){d.handler&&(m=d,d=m.handler,e=m.selector);e&&j.find.matchesSelector(gb,e);d.guid||(d.guid=j.guid++);(l=n.events)||(l=n.events={});(g=n.handle)||(g=n.handle=function(c){return"undefined"!=typeof j&&j.event.triggered!==c.type?j.event.dispatch.apply(b, arguments):void 0});c=(c||"").match(S)||[""];for(n=c.length;n--;)p=pc.exec(c[n])||[],u=t=p[1],p=(p[2]||"").split(".").sort(),u&&(s=j.event.special[u]||{},u=(e?s.delegateType:s.bindType)||u,s=j.event.special[u]||{},r=j.extend({type:u,origType:t,data:f,handler:d,guid:d.guid,selector:e,needsContext:e&&j.expr.match.needsContext.test(e),namespace:p.join(".")},m),(q=l[u])||(q=l[u]=[],q.delegateCount=0,s.setup&&!1!==s.setup.call(b,f,p,g)||b.addEventListener&&b.addEventListener(u,g)),s.add&&(s.add.call(b, r),r.handler.guid||(r.handler.guid=d.guid)),e?q.splice(q.delegateCount++,0,r):q.push(r),j.event.global[u]=!0)}},remove:function(b,c,d,f,e){var m,g,p,l,n,r,s,q,u,t,y,A=E.hasData(b)&&E.get(b);if(A&&(l=A.events)){c=(c||"").match(S)||[""];for(n=c.length;n--;)if(p=pc.exec(c[n])||[],u=y=p[1],t=(p[2]||"").split(".").sort(),u){s=j.event.special[u]||{};u=(f?s.delegateType:s.bindType)||u;q=l[u]||[];p=p[2]&&RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)");for(g=m=q.length;m--;)r=q[m],!e&&y!==r.origType|| d&&d.guid!==r.guid||p&&!p.test(r.namespace)||f&&f!==r.selector&&("**"!==f||!r.selector)||(q.splice(m,1),r.selector&&q.delegateCount--,s.remove&&s.remove.call(b,r));g&&!q.length&&(s.teardown&&!1!==s.teardown.call(b,t,A.handle)||j.removeEvent(b,u,A.handle),delete l[u])}else for(u in l)j.event.remove(b,u+c[n],d,f,!0);j.isEmptyObject(l)&&E.remove(b,"handle events")}},dispatch:function(b){var c=j.event.fix(b),d,f,e,m,g,p,l=Array(arguments.length);f=(E.get(this,"events")||{})[c.type]||[];var n=j.event.special[c.type]|| {};l[0]=c;for(d=1;d\x20\t\r\n\f]*)[^>]*)\/>/gi,qd=/\s*$/g;j.extend({htmlPrefilter:function(b){return b.replace(pd,"<$1>")},clone:function(b,c,d){var f,e,m,g,p=b.cloneNode(!0),n=j.contains(b.ownerDocument,b);if(!I.noCloneChecked&&!(1!==b.nodeType&&11!==b.nodeType||j.isXMLDoc(b))){g=y(p);m=y(b);f=0;for(e=m.length;fj.inArray(this,b)&&(j.cleanData(y(this)),d&&d.replaceChild(c,this))},b)}});j.each({appendTo:"append",prependTo:"prepend", insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(b,c){j.fn[b]=function(b){for(var d=[],f=j(b),e=f.length-1,m=0;m<=e;m++)b=m===e?this:this.clone(!0),j(f[m])[c](b),pb.apply(d,b.get());return this.pushStack(d)}});var Kb=/^margin/,kb=RegExp("^("+mc+")(?!px)[a-z%]+$","i"),Qa=function(c){var d=c.ownerDocument.defaultView;return d&&d.opener||(d=b),d.getComputedStyle(c)},ib=function(){if(Y){Y.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%"; Y.innerHTML="";gb.appendChild(hb);var c=b.getComputedStyle(Y);qc="1%"!==c.top;rc="2px"===c.marginLeft;sc="4px"===c.width;Y.style.marginRight="50%";tc="4px"===c.marginRight;gb.removeChild(hb);Y=null}},qc,sc,tc,rc,hb=C.createElement("div"),Y=C.createElement("div");Y.style&&(Y.style.backgroundClip="content-box",Y.cloneNode(!0).style.backgroundClip="",I.clearCloneStyle="content-box"===Y.style.backgroundClip,hb.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute", hb.appendChild(Y),j.extend(I,{pixelPosition:function(){return ib(),qc},boxSizingReliable:function(){return ib(),sc},pixelMarginRight:function(){return ib(),tc},reliableMarginLeft:function(){return ib(),rc}}));!0;var rd=/^(none|table(?!-c[ea]).+)/,uc=/^--/,sd={position:"absolute",visibility:"hidden",display:"block"},vc={letterSpacing:"0",fontWeight:"400"},Ob=["Webkit","Moz","ms"],Nb=C.createElement("div").style;j.extend({cssHooks:{opacity:{get:function(b,c){if(c){var d=Ga(b,"opacity");return""===d? "1":d}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(b,c,d,f){if(b&&3!==b.nodeType&&8!==b.nodeType&&b.style){var e,m,g,p=j.camelCase(c),n=uc.test(c),l=b.style;return n||(c=Mb(p)),g=j.cssHooks[c]||j.cssHooks[p],void 0===d?g&&"get"in g&&void 0!==(e=g.get(b,!1,f))?e:l[c]:(m=typeof d,"string"===m&&(e=Ea.exec(d))&&e[1]&& (d=u(b,c,e),m="number"),null!=d&&d===d&&("number"===m&&(d+=e&&e[3]||(j.cssNumber[p]?"":"px")),I.clearCloneStyle||""!==d||0!==c.indexOf("background")||(l[c]="inherit"),g&&"set"in g&&void 0===(d=g.set(b,d,f))||(n?l.setProperty(c,d):l[c]=d)),void 0)}},css:function(b,c,d,f){var e,m,g,p=j.camelCase(c);return uc.test(c)||(c=Mb(p)),g=j.cssHooks[c]||j.cssHooks[p],g&&"get"in g&&(e=g.get(b,!0,d)),void 0===e&&(e=Ga(b,c,f)),"normal"===e&&c in vc&&(e=vc[c]),""===d||d?(m=parseFloat(e),!0===d||isFinite(m)?m||0: e):e}});j.each(["height","width"],function(b,c){j.cssHooks[c]={get:function(b,d,f){if(d)return!rd.test(j.css(b,"display"))||b.getClientRects().length&&b.getBoundingClientRect().width?Rb(b,c,f):nc(b,sd,function(){return Rb(b,c,f)})},set:function(b,d,f){var e,m=f&&Qa(b);f=f&&Qb(b,c,f,"border-box"===j.css(b,"boxSizing",!1,m),m);return f&&(e=Ea.exec(d))&&"px"!==(e[3]||"px")&&(b.style[c]=d,d=j.css(b,c)),Pb(b,d,f)}}});j.cssHooks.marginLeft=Lb(I.reliableMarginLeft,function(b,c){if(c)return(parseFloat(Ga(b, "marginLeft"))||b.getBoundingClientRect().left-nc(b,{marginLeft:0},function(){return b.getBoundingClientRect().left}))+"px"});j.each({margin:"",padding:"",border:"Width"},function(b,c){j.cssHooks[b+c]={expand:function(d){var f=0,e={};for(d="string"==typeof d?d.split(" "):[d];4>f;f++)e[b+ma[f]+c]=d[f]||d[f-2]||d[0];return e}};Kb.test(b)||(j.cssHooks[b+c].set=Pb)});j.fn.extend({css:function(b,c){return da(this,function(b,c,d){var f,e={},m=0;if(Array.isArray(c)){d=Qa(b);for(f=c.length;mf.indexOf(" "+m+" ")&&(f+=m+" ");f=na(f);e!==f&&d.setAttribute("class",f)}return this},removeClass:function(b){var c,d,f,e,m,g,p=0;if(j.isFunction(b))return this.each(function(c){j(this).removeClass(b.call(this, c,oa(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof b&&b)for(c=b.match(S)||[];d=this[p++];)if(e=oa(d),f=1===d.nodeType&&" "+na(e)+" "){for(g=0;m=c[g++];)for(;-1e?l:m?e:0;du.indexOf(":")&&"on"+u,c=c[j.expando]?c:new j.Event(u,"object"==typeof c&&c),c.isTrigger=e?2:3,c.namespace=m.join("."),c.rnamespace=c.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c.result=void 0,c.target||(c.target=f),d=null==d?[c]:j.makeArray(d,[c]),s=j.event.special[u]||{},e||!s.trigger|| !1!==s.trigger.apply(f,d))){if(!e&&!s.noBubble&&!j.isWindow(f)){l=s.delegateType||u;for(xc.test(l+u)||(g=g.parentNode);g;g=g.parentNode)q.push(g),p=g;p===(f.ownerDocument||C)&&q.push(p.defaultView||p.parentWindow||b)}for(m=0;(g=q[m++])&&!c.isPropagationStopped();)c.type=1c||304===c;if(p){x=t;for(var va=K,C,F,G,D,M=x.contents,I=x.dataTypes;"*"===I[0];)I.shift(),void 0===C&&(C=x.mimeType||va.getResponseHeader("Content-Type"));if(C)for(F in M)if(M[F]&& M[F].test(C)){I.unshift(F);break}if(I[0]in p)G=I[0];else{for(F in p){if(!I[0]||x.converters[F+" "+I[0]]){G=F;break}D||(D=F)}G=G||D}x=p=G?(G!==I[0]&&I.unshift(G),p[G]):void 0}var L;a:{p=t;C=x;F=K;G=l;var Q,N,O;x={};va=p.dataTypes.slice();if(va[1])for(Q in p.converters)x[Q.toLowerCase()]=p.converters[Q];for(D=va.shift();D;)if(p.responseFields[D]&&(F[p.responseFields[D]]=C),!O&&G&&p.dataFilter&&(C=p.dataFilter(C,p.dataType)),O=D,D=va.shift())if("*"===D)D=O;else if("*"!==O&&O!==D){if(Q=x[O+" "+D]||x["* "+ D],!Q)for(L in x)if(N=L.split(" "),N[1]===D&&(Q=x[O+" "+N[0]]||x["* "+N[0]])){!0===Q?Q=x[L]:!0!==x[L]&&(D=N[0],va.unshift(N[1]));break}if(!0!==Q)if(Q&&p["throws"])C=Q(C);else try{C=Q(C)}catch(P){L={state:"parsererror",error:Q?P:"No conversion from "+O+" to "+D};break a}}L={state:"success",data:C}}x=L;l?(t.ifModified&&(z=K.getResponseHeader("Last-Modified"),z&&(j.lastModified[m]=z),z=K.getResponseHeader("etag"),z&&(j.etag[m]=z)),204===c||"HEAD"===t.type?J="nocontent":304===c?J="notmodified":(J=x.state, q=x.data,u=x.error,l=!u)):(u=J,!c&&J||(J="error",0>c&&(c=0)));K.status=c;K.statusText=(d||J)+"";l?B.resolveWith(y,[q,J,K]):B.rejectWith(y,[K,J,u]);K.statusCode(H);H=void 0;s&&A.trigger(l?"ajaxSuccess":"ajaxError",[K,t,l?q:u]);E.fireWith(y,[K,J]);s&&(A.trigger("ajaxComplete",[K,t]),--j.active||j.event.trigger("ajaxStop"))}}"object"==typeof c&&(d=c,c=void 0);d=d||{};var e,m,g,p,n,l,r,s,q,u,t=j.ajaxSetup({},d),y=t.context||t,A=t.context&&(y.nodeType||y.jquery)?j(y):j.event,B=j.Deferred(),E=j.Callbacks("once memory"), H=t.statusCode||{},F={},G={},D="canceled",K={readyState:0,getResponseHeader:function(b){var c;if(r){if(!p)for(p={};c=Ed.exec(g);)p[c[1].toLowerCase()]=c[2];c=p[b.toLowerCase()]}return null==c?null:c},getAllResponseHeaders:function(){return r?g:null},setRequestHeader:function(b,c){return null==r&&(b=G[b.toLowerCase()]=G[b.toLowerCase()]||b,F[b]=c),this},overrideMimeType:function(b){return null==r&&(t.mimeType=b),this},statusCode:function(b){var c;if(b)if(r)K.always(b[K.status]);else for(c in b)H[c]= [H[c],b[c]];return this},abort:function(b){b=b||D;return e&&e.abort(b),f(0,b),this}};if(B.promise(K),t.url=((c||t.url||La.href)+"").replace(Gd,La.protocol+"//"),t.type=d.method||d.type||t.method||t.type,t.dataTypes=(t.dataType||"*").toLowerCase().match(S)||[""],null==t.crossDomain){l=C.createElement("a");try{l.href=t.url,l.href=l.href,t.crossDomain=Cb.protocol+"//"+Cb.host!=l.protocol+"//"+l.host}catch(I){t.crossDomain=!0}}if(t.data&&t.processData&&"string"!=typeof t.data&&(t.data=j.param(t.data, t.traditional)),Vb(Ac,t,d,K),r)return K;(s=j.event&&t.global)&&0===j.active++&&j.event.trigger("ajaxStart");t.type=t.type.toUpperCase();t.hasContent=!Fd.test(t.type);m=t.url.replace(Cd,"");t.hasContent?t.data&&t.processData&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&(t.data=t.data.replace(Bd,"+")):(u=t.url.slice(m.length),t.data&&(m+=(Bb.test(m)?"&":"?")+t.data,delete t.data),!1===t.cache&&(m=m.replace(Dd,"$1"),u=(Bb.test(m)?"&":"?")+"_="+yc++ +u),t.url=m+u);t.ifModified&& (j.lastModified[m]&&K.setRequestHeader("If-Modified-Since",j.lastModified[m]),j.etag[m]&&K.setRequestHeader("If-None-Match",j.etag[m]));(t.data&&t.hasContent&&!1!==t.contentType||d.contentType)&&K.setRequestHeader("Content-Type",t.contentType);K.setRequestHeader("Accept",t.dataTypes[0]&&t.accepts[t.dataTypes[0]]?t.accepts[t.dataTypes[0]]+("*"!==t.dataTypes[0]?", "+Bc+"; q=0.01":""):t.accepts["*"]);for(q in t.headers)K.setRequestHeader(q,t.headers[q]);if(t.beforeSend&&(!1===t.beforeSend.call(y,K,t)|| r))return K.abort();if(D="abort",E.add(t.complete),K.done(t.success),K.fail(t.error),e=Vb(nb,t,d,K)){if(K.readyState=1,s&&A.trigger("ajaxSend",[K,t]),r)return K;t.async&&0").prop({charset:b.scriptCharset,src:b.url}).on("load error",d=function(b){c.remove();d=null;b&&e("error"===b.type?404:200,b.type)});C.head.appendChild(c[0])},abort:function(){d&&d()}}}});var Cc=[],Db=/(=)\?(?=&|$)|\?\?/;j.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var b=Cc.pop()||j.expando+ "_"+yc++;return this[b]=!0,b}});j.ajaxPrefilter("json jsonp",function(c,d,f){var e,m,g,p=!1!==c.jsonp&&(Db.test(c.url)?"url":"string"==typeof c.data&&0===(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&Db.test(c.data)&&"data");if(p||"jsonp"===c.dataTypes[0])return e=c.jsonpCallback=j.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,p?c[p]=c[p].replace(Db,"$1"+e):!1!==c.jsonp&&(c.url+=(Bb.test(c.url)?"&":"?")+c.jsonp+"="+e),c.converters["script json"]=function(){return g|| j.error(e+" was not called"),g[0]},c.dataTypes[0]="json",m=b[e],b[e]=function(){g=arguments},f.always(function(){void 0===m?j(b).removeProp(e):b[e]=m;c[e]&&(c.jsonpCallback=d.jsonpCallback,Cc.push(e));g&&j.isFunction(m)&&m(g[0]);g=m=void 0}),"script"});var Id=I,Dc,Ec=C.implementation.createHTMLDocument("").body;Dc=(Ec.innerHTML="
",2===Ec.childNodes.length);Id.createHTMLDocument=Dc;j.parseHTML=function(b,c,d){if("string"!=typeof b)return[];"boolean"==typeof c&&(d=c,c=!1); var f,e,m;return c||(I.createHTMLDocument?(c=C.implementation.createHTMLDocument(""),f=c.createElement("base"),f.href=C.location.href,c.head.appendChild(f)):c=C),e=kc.exec(b),m=!d&&[],e?[c.createElement(e[1])]:(e=D([b],c,m),m&&m.length&&j(m).remove(),j.merge([],e.childNodes))};j.fn.load=function(b,c,d){var f,e,m,g=this,p=b.indexOf(" ");return-1").append(j.parseHTML(b)).find(f):b)}).always(d&&function(b,c){g.each(function(){d.apply(this,m||[b.responseText,c,b])})}),this};j.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(b,c){j.fn[c]=function(b){return this.on(c,b)}});j.expr.pseudos.animated=function(b){return j.grep(j.timers,function(c){return b===c.elem}).length};j.offset={setOffset:function(b,c,d){var f,e,m,g,p,l,n=j.css(b,"position"),r=j(b), s={};"static"===n&&(b.style.position="relative");p=r.offset();m=j.css(b,"top");l=j.css(b,"left");("absolute"===n||"fixed"===n)&&-1<(m+l).indexOf("auto")?(f=r.position(),g=f.top,e=f.left):(g=parseFloat(m)||0,e=parseFloat(l)||0);j.isFunction(c)&&(c=c.call(b,d,j.extend({},p)));null!=c.top&&(s.top=c.top-p.top+g);null!=c.left&&(s.left=c.left-p.left+e);"using"in c?c.using.call(b,s):r.css(s)}};j.fn.extend({offset:function(b){if(arguments.length)return void 0===b?this:this.each(function(c){j.offset.setOffset(this, b,c)});var c,d,f,e,m=this[0];if(m)return m.getClientRects().length?(f=m.getBoundingClientRect(),c=m.ownerDocument,d=c.documentElement,e=c.defaultView,{top:f.top+e.pageYOffset-d.clientTop,left:f.left+e.pageXOffset-d.clientLeft}):{top:0,left:0}},position:function(){if(this[0]){var b,c,d=this[0],f={top:0,left:0};return"fixed"===j.css(d,"position")?c=d.getBoundingClientRect():(b=this.offsetParent(),c=this.offset(),g(b[0],"html")||(f=b.offset()),f={top:f.top+j.css(b[0],"borderTopWidth",!0),left:f.left+ j.css(b[0],"borderLeftWidth",!0)}),{top:c.top-f.top-j.css(d,"marginTop",!0),left:c.left-f.left-j.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var b=this.offsetParent;b&&"static"===j.css(b,"position");)b=b.offsetParent;return b||gb})}});j.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;j.fn[b]=function(f){return da(this,function(b,f,e){var m;return j.isWindow(b)?m=b:9===b.nodeType&&(m=b.defaultView),void 0===e?m?m[c]: b[f]:void(m?m.scrollTo(d?m.pageXOffset:e,d?e:m.pageYOffset):b[f]=e)},b,f,arguments.length)}});j.each(["top","left"],function(b,c){j.cssHooks[c]=Lb(I.pixelPosition,function(b,d){if(d)return d=Ga(b,c),kb.test(d)?j(b).position()[c]+"px":d})});j.each({Height:"height",Width:"width"},function(b,c){j.each({padding:"inner"+b,content:c,"":"outer"+b},function(d,f){j.fn[f]=function(e,m){var g=arguments.length&&(d||"boolean"!=typeof e),p=d||(!0===e||!0===m?"margin":"border");return da(this,function(c,d,e){var m; return j.isWindow(c)?0===f.indexOf("outer")?c["inner"+b]:c.document.documentElement["client"+b]:9===c.nodeType?(m=c.documentElement,Math.max(c.body["scroll"+b],m["scroll"+b],c.body["offset"+b],m["offset"+b],m["client"+b])):void 0===e?j.css(c,d,p):j.style(c,d,e,p)},c,g?e:void 0,g)}})});j.fn.extend({bind:function(b,c,d){return this.on(b,null,c,d)},unbind:function(b,c){return this.off(b,null,c)},delegate:function(b,c,d,f){return this.on(c,b,d,f)},undelegate:function(b,c,d){return 1===arguments.length? this.off(b,"**"):this.off(c,b||"**",d)}});j.holdReady=function(b){b?j.readyWait++:j.ready(!0)};j.isArray=Array.isArray;j.parseJSON=JSON.parse;j.nodeName=g;"function"==typeof define&&define.amd&&define("jquery",[],function(){return j});var Jd=b.jQuery,Kd=b.$;return j.noConflict=function(c){return b.$===j&&(b.$=Kd),c&&b.jQuery===j&&(b.jQuery=Jd),j},c||(b.jQuery=b.$=j),j}); function getInternetExplorerVersion(){var b=-1;"Microsoft Internet Explorer"==navigator.appName&&null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)&&(b=parseFloat(RegExp.$1));return b}var ie=getInternetExplorerVersion();function getQueryVariable(b){for(var c=window.location.search.substring(1).split("&"),d=0;d=d[g].start&&e<= d[g].end){b=g;break}}void 0!==e&&"[object Object]"===Object.prototype.toString.call(d[b])&&(this.isPlaying=this.settings.spritemap[b],this.context.play&&this.context.play(),this.wasReady=this.setCurrentTime(e))}},stop:function(){this.__lastPosition=0;this.isPlaying=null;this.backgroundMusic?this.backgroundHackForiOS():this.context.pause();return!0},pause:function(){this.isPlaying=null;this.__lastPosition=this.getCurrentTime();this.context.pause();return this.__lastPosition},resume:function(b){b="number"=== typeof b?b:this.__lastPosition;if(null!==b)return this.play(b),this.__lastPosition=null,!0;this.context.play();return!1},HTML5API:{getVolume:function(){return this.context.volume||1},setVolume:function(b){this.context.volume=b;return 1E-4>Math.abs(this.context.volume-b)?!0:!1},getCurrentTime:function(){return this.context.currentTime||0},setCurrentTime:function(b){try{return this.context.currentTime=b,!0}catch(c){return!1}}},FLASHAPI:{getVolume:function(){return this.context&&"function"===typeof this.context.getVolume? this.context.getVolume():1},setVolume:function(b){return this.context&&"function"===typeof this.context.setVolume?(this.context.setVolume(b),!0):!1},getCurrentTime:function(){return this.context&&"function"===typeof this.context.getCurrentTime?this.context.getCurrentTime():0},setCurrentTime:function(b){return this.context&&"function"===typeof this.context.setCurrentTime?this.context.setCurrentTime(b):!1}}}; if(void 0===this.jukebox)throw"jukebox.Manager requires jukebox.Player (Player.js) to run properly."; jukebox.Manager=function(b){this.features={};this.codecs={};this.__players={};this.__playersLength=0;this.__clones={};this.__queue=[];this.settings={};for(var c in this.defaults)this.settings[c]=this.defaults[c];if("[object Object]"===Object.prototype.toString.call(b))for(var d in b)this.settings[d]=b[d];this.__detectFeatures();jukebox.Manager.__initialized=!1===this.settings.useGameLoop?window.setInterval(function(){jukebox.Manager.loop()},20):!0}; jukebox.Manager.prototype={defaults:{useFlash:!1,useGameLoop:!1},__detectFeatures:function(){var b=window.Audio&&new Audio;if(b&&b.canPlayType&&!1===this.settings.useFlash){for(var c=[{e:"3gp",m:["audio/3gpp","audio/amr"]},{e:"aac",m:["audio/aac","audio/aacp"]},{e:"amr",m:["audio/amr","audio/3gpp"]},{e:"caf",m:["audio/IMA-ADPCM","audio/x-adpcm",'audio/x-aiff; codecs="IMA-ADPCM, ADPCM"']},{e:"m4a",m:'audio/mp4{audio/mp4; codecs="mp4a.40.2,avc1.42E01E"{audio/mpeg4{audio/mpeg4-generic{audio/mp4a-latm{audio/MP4A-LATM{audio/x-m4a'.split("{")}, {e:"mp3",m:["audio/mp3","audio/mpeg",'audio/mpeg; codecs="mp3"',"audio/MPA","audio/mpa-robust"]},{e:"mpga",m:["audio/MPA","audio/mpa-robust","audio/mpeg","video/mpeg"]},{e:"mp4",m:["audio/mp4","video/mp4"]},{e:"ogg",m:["application/ogg","audio/ogg",'audio/ogg; codecs="theora, vorbis"',"video/ogg",'video/ogg; codecs="theora, vorbis"']},{e:"wav",m:["audio/wave","audio/wav",'audio/wav; codecs="1"',"audio/x-wav","audio/x-pn-wav"]},{e:"webm",m:["audio/webm",'audio/webm; codecs="vorbis"',"video/webm"]}], d,e,g=0,l=c.length;gMath.abs(b.volume-0.1337));navigator.userAgent.match(/iPhone|iPod|iPad/i)&&(this.features.channels=1)}this.features.flashaudio= !!navigator.mimeTypes["application/x-shockwave-flash"]||!!navigator.plugins["Shockwave Flash"]||!1;if(window.ActiveXObject)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash.10"),this.features.flashaudio=!0}catch(f){}!0===this.settings.useFlash&&(this.features.flashaudio=!0);!0===this.features.flashaudio&&!this.features.html5audio&&(this.codecs.mp3="audio/mp3",this.codecs.mpga="audio/mpeg",this.codecs.mp4="audio/mp4",this.codecs.m4a="audio/mp4",this.codecs["3gp"]="audio/3gpp",this.codecs.amr="audio/amr", this.features.volume=!0,this.features.channels=1)},__getPlayerById:function(b){return this.__players&&void 0!==this.__players[b]?this.__players[b]:null},__getClone:function(b,c){for(var d in this.__clones){var e=this.__clones[d];if(null===e.isPlaying&&e.origin===b)return e}if("[object Object]"===Object.prototype.toString.call(c)){d={};for(var g in c)d[g]=c[g];d.autoplay=!1;g=new jukebox.Player(d,b);g.isClone=!0;g.wasReady=!1;return this.__clones[g.id]=g}return null},loop:function(){if(0!==this.__playersLength)if(this.__queue.length&& this.__playersLengthb.isPlaying.end&&(!0===b.isPlaying.loop?b.play(b.isPlaying.start,!0):b.stop()):b.isClone&&null===b.isPlaying?this.remove(b):void 0!==b.backgroundMusic&&null===b.isPlaying&&c>b.backgroundMusic.end&&b.backgroundHackForiOS()},getPlayableResource:function(b){"[object Array]"!==Object.prototype.toString.call(b)&&(b=[b]);for(var c=0,d=b.length;c=b){d._volume=b;if(d._muted)return d;d.usingWebAudio&&d.masterGain.gain.setValueAtTime(b,c.ctx.currentTime);for(var e=0;eparseInt(l[0].split("/")[1],10);b._codecs={mp3:!(l||!g&&!d.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!g,opus:!!d.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!d.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!d.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!d.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""), aac:!!d.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!d.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(d.canPlayType("audio/x-m4a;")||d.canPlayType("audio/m4a;")||d.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(d.canPlayType("audio/x-m4b;")||d.canPlayType("audio/m4b;")||d.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(d.canPlayType("audio/x-mp4;")||d.canPlayType("audio/mp4;")||d.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!d.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, ""),webm:!!d.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,""),dolby:!!d.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(d.canPlayType("audio/x-flac;")||d.canPlayType("audio/flac;")).replace(/^no$/,"")};return b},_unlockAudio:function(){var b=this||c;if(!b._audioUnlocked&&b.ctx){b._audioUnlocked=!1;b.autoUnlock=!1;!b._mobileUnloaded&&44100!==b.ctx.sampleRate&&(b._mobileUnloaded=!0,b.unload());b._scratchBuffer=b.ctx.createBuffer(1,1,22050);var d=function(){for(;b._html5AudioPool.length< b.html5PoolSize;)try{var c=new Audio;c._unlocked=!0;b._releaseHtml5Audio(c)}catch(e){b.noAudio=!0;break}for(c=0;c=Fa)e._ended(q);else{var F=q._node;if(e._webAudio)g= function(){e._playLock=!1;la();e._refreshBuffer(q);F.gain.setValueAtTime(q._muted||e._muted?0:q._volume,c.ctx.currentTime);q._playStart=c.ctx.currentTime;"undefined"===typeof F.bufferSource.start?q._loop?F.bufferSource.noteGrainOn(0,A,86400):F.bufferSource.noteGrainOn(0,A,D):q._loop?F.bufferSource.start(0,A,86400):F.bufferSource.start(0,A,D);Infinity!==fa&&(e._endTimers[q._id]=setTimeout(e._ended.bind(e,q),fa));d||setTimeout(function(){e._emit("play",q._id);e._loadQueue()},0)},"running"===c.state&& "interrupted"!==c.ctx.state?g():(e._playLock=!0,e.once("resume",g),e._clearTimer(q._id));else{var Oa=function(){F.currentTime=A;F.muted=q._muted||e._muted||c._muted||F.muted;F.volume=q._volume*c.volume();F.playbackRate=q._rate;try{var g=F.play();g&&"undefined"!==typeof Promise&&(g instanceof Promise||"function"===typeof g.then)?(e._playLock=!0,la(),g.then(function(){e._playLock=!1;F._unlocked=!0;d||(e._emit("play",q._id),e._loadQueue())}).catch(function(){e._playLock=!1;e._emit("playerror",q._id, "Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");q._ended=!0;q._paused=!0})):d||(e._playLock=!1,la(),e._emit("play",q._id),e._loadQueue());F.playbackRate=q._rate;F.paused?e._emit("playerror",q._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."):"__default"!==b||q._loop?e._endTimers[q._id]=setTimeout(e._ended.bind(e, q),fa):(e._endTimers[q._id]=function(){e._ended(q);F.removeEventListener("ended",e._endTimers[q._id],!1)},F.addEventListener("ended",e._endTimers[q._id],!1))}catch(l){e._emit("playerror",q._id,l)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===F.src&&(F.src=e._src,F.load());g=window&&window.ejecta||!F.readyState&&c._navigator.isCocoonJS;if(3<=F.readyState||g)Oa();else{e._playLock=!0;var Pa=function(){Oa();F.removeEventListener(c._canPlayEvent,Pa,!1)};F.addEventListener(c._canPlayEvent, Pa,!1);e._clearTimer(q._id)}}return q._id}},pause:function(b,c){var d=this;if("loaded"!==d._state||d._playLock)return d._queue.push({event:"pause",action:function(){d.pause(b)}}),d;for(var e=d._getSoundIds(b),g=0;g=e){if("loaded"!==b._state||b._playLock)return b._queue.push({event:"volume",action:function(){b.volume.apply(b,d)}}),b;"undefined"===typeof g&&(b._volume=e);g=b._getSoundIds(g);for(var n=0;nA?Math.max(d,q):Math.min(d,q);q=Math.round(100*q)/100;n._webAudio?b._volume=q:n.volume(q,b._id,!0);l&&(n._volume=q);if(dc&&q>=d)clearInterval(b._interval),b._interval=null,b._fadeTo=null,n.volume(d,b._id),n._emit("fade",b._id)},g)},_stopFade:function(b){var d=this._soundById(b);d&&d._interval&&(this._webAudio&&d._node.gain.cancelScheduledValues(c.ctx.currentTime),clearInterval(d._interval),d._interval=null,this.volume(d._fadeTo,b),d._fadeTo=null,this._emit("fade",b));return this},loop:function(){var b=arguments,c,d;if(0===b.length)return this._loop;if(1===b.length)if("boolean"===typeof b[0])this._loop=c=b[0]; else return(b=this._soundById(parseInt(b[0],10)))?b._loop:!1;else 2===b.length&&(c=b[0],d=parseInt(b[1],10));d=this._getSoundIds(d);for(var e=0;ee&&(d=/safari/.test(c._navigator&&c._navigator.userAgent.toLowerCase()),c._navigator&&!d&&(c.usingWebAudio=!1));c.usingWebAudio&&(c.masterGain="undefined"===typeof c.ctx.createGain?c.ctx.createGainNode():c.ctx.createGain(),c.masterGain.gain.setValueAtTime(c._muted?0:c._volume,c.ctx.currentTime),c.masterGain.connect(c.ctx.destination));c._setup()}};"function"===typeof define&&define.amd&&define([],function(){return{Howler:c,Howl:d}});"undefined"!==typeof exports&& (exports.Howler=c,exports.Howl=d);"undefined"!==typeof global?(global.HowlerGlobal=b,global.Howler=c,global.Howl=d,global.Sound=e):"undefined"!==typeof window&&(window.HowlerGlobal=b,window.Howler=c,window.Howl=d,window.Sound=e)})(); (function(){HowlerGlobal.prototype._pos=[0,0,0];HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0];HowlerGlobal.prototype.stereo=function(b){if(!this.ctx||!this.ctx.listener)return this;for(var c=this._howls.length-1;0<=c;c--)this._howls[c].stereo(b);return this};HowlerGlobal.prototype.pos=function(b,c,d){if(!this.ctx||!this.ctx.listener)return this;c="number"!==typeof c?this._pos[1]:c;d="number"!==typeof d?this._pos[2]:d;if("number"===typeof b)this._pos=[b,c,d],"undefined"!==typeof this.ctx.listener.positionX? (this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,0.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,0.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,0.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]);else return this._pos;return this};HowlerGlobal.prototype.orientation=function(b,c,d,e,f,m){if(!this.ctx||!this.ctx.listener)return this;var p=this._orientation;c="number"!== typeof c?p[1]:c;d="number"!==typeof d?p[2]:d;e="number"!==typeof e?p[3]:e;f="number"!==typeof f?p[4]:f;m="number"!==typeof m?p[5]:m;if("number"===typeof b)this._orientation=[b,c,d,e,f,m],"undefined"!==typeof this.ctx.listener.forwardX?(this.ctx.listener.forwardX.setTargetAtTime(b,Howler.ctx.currentTime,0.1),this.ctx.listener.forwardY.setTargetAtTime(c,Howler.ctx.currentTime,0.1),this.ctx.listener.forwardZ.setTargetAtTime(d,Howler.ctx.currentTime,0.1),this.ctx.listener.upX.setTargetAtTime(e,Howler.ctx.currentTime, 0.1),this.ctx.listener.upY.setTargetAtTime(f,Howler.ctx.currentTime,0.1),this.ctx.listener.upZ.setTargetAtTime(m,Howler.ctx.currentTime,0.1)):this.ctx.listener.setOrientation(b,c,d,e,f,m);else return p;return this};var b=Howl.prototype.init;Howl.prototype.init=function(c){this._orientation=c.orientation||[1,0,0];this._stereo=c.stereo||null;this._pos=c.pos||null;this._pannerAttr={coneInnerAngle:"undefined"!==typeof c.coneInnerAngle?c.coneInnerAngle:360,coneOuterAngle:"undefined"!==typeof c.coneOuterAngle? c.coneOuterAngle:360,coneOuterGain:"undefined"!==typeof c.coneOuterGain?c.coneOuterGain:0,distanceModel:"undefined"!==typeof c.distanceModel?c.distanceModel:"inverse",maxDistance:"undefined"!==typeof c.maxDistance?c.maxDistance:1E4,panningModel:"undefined"!==typeof c.panningModel?c.panningModel:"HRTF",refDistance:"undefined"!==typeof c.refDistance?c.refDistance:1,rolloffFactor:"undefined"!==typeof c.rolloffFactor?c.rolloffFactor:1};this._onstereo=c.onstereo?[{fn:c.onstereo}]:[];this._onpos=c.onpos? [{fn:c.onpos}]:[];this._onorientation=c.onorientation?[{fn:c.onorientation}]:[];return b.call(this,c)};Howl.prototype.stereo=function(b,c){var d=this;if(!d._webAudio)return d;if("loaded"!==d._state)return d._queue.push({event:"stereo",action:function(){d.stereo(b,c)}}),d;var n="undefined"===typeof Howler.ctx.createStereoPanner?"spatial":"stereo";if("undefined"===typeof c)if("number"===typeof b)d._stereo=b,d._pos=[b,0,0];else return d._stereo;for(var f=d._getSoundIds(c),m=0;mthis.width||g>this.height)){var n=ig.system.scale,f=Math.floor(e*n),m=Math.floor(g*n),p=l?-1:1,r=q?-1:1;if(l||q)ig.system.context.save(),ig.system.context.scale(p,r);ig.system.context.drawImage(this.data,Math.floor(d*e)%this.width*n,Math.floor(d*e/this.width)*g*n,f,m,ig.system.getDrawPos(b)*p-(l?f:0),ig.system.getDrawPos(c)*r-(q?m:0),f,m);(l|| q)&&ig.system.context.restore();ig.Image.drawCount++}}});ig.Image.drawCount=0;ig.Image.cache={};ig.Image.reloadCache=function(){for(var b in ig.Image.cache)ig.Image.cache[b].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(b){this._loadMetrics(this.data);this.parent(b)},widthForString:function(b){if(-1!==b.indexOf("\n")){b=b.split("\n");for(var c=0,d=0;db||b>=this.indices.length)return 0;var e=ig.system.scale,g=this.widthMap[b]*e,l=(this.height-2)*e;ig.system.context.drawImage(this.data,this.indices[b]*e,0,g,l,ig.system.getDrawPos(c),ig.system.getDrawPos(d),g,l);return this.widthMap[b]+this.letterSpacing},_loadMetrics:function(b){this.height=b.height-1;this.widthMap=[];this.indices= [];for(var c=ig.getImagePixels(b,0,b.height-1,b.width,1),d=0,e=0,g=0;gc.data[l]&&e&&(this.widthMap.push(e),this.indices.push(g-e),d++,e=0)}this.widthMap.push(e);this.indices.push(g-e)}});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(){if(!ig.Sound.enabled||!window.Audio)ig.Sound.enabled=!1;else{for(var b=new Audio,c=0;c=b?(this.stop(),this.currentTrack.volume=this._volume,clearInterval(this._fadeInterval)):this.currentTrack.volume=b},_endedCallback:function(){this._loop?this.play():this.next()}});ig.Sound=ig.Class.extend({path:"",volume:1,currentClip:null,multiChannel:!0,init:function(b,c){this.path=b;this.multiChannel=!1!==c;this.load()},load:function(b){ig.Sound.enabled?ig.ready?ig.soundManager.load(this.path, this.multiChannel,b):ig.addResource(this):b&&b(this.path,!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(b,c){this.gameClass=b;this.resources=c;this._loadCallbackBound=this._loadCallback.bind(this);for(var d=0;db?this.initMouse():0ig.system.width||c>ig.system.height||(0>b+d||0>c+d)||(1!=this.alpha&&(ig.system.context.globalAlpha=this.alpha),0==this.angle?this.sheet.image.drawTile(b,c,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(b+this.pivot.x),ig.system.getDrawPos(c+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(b, c,d){this.id=++ig.Entity._lastId;this.pos.x=this.last.x=b;this.pos.y=this.last.y=c;ig.merge(this,d)},reset:function(b,c,d){var e=this.constructor.prototype;this.pos.x=b;this.pos.y=c;this.last.x=b;this.last.y=c;this.vel.x=e.vel.x;this.vel.y=e.vel.y;this.accel.x=e.accel.x;this.accel.y=e.accel.y;this.health=e.health;this._killed=e._killed;this.standing=e.standing;this.type=e.type;this.checkAgainst=e.checkAgainst;this.collides=e.collides;ig.merge(this,d)},addAnim:function(b,c,d,e){if(!this.animSheet)throw"No animSheet to add the animation "+ b+" to.";c=new ig.Animation(this.animSheet,c,d,e);this.anims[b]=c;this.currentAnim||(this.currentAnim=c);return c},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 b=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(b);this.currentAnim&&this.currentAnim.update()},getNewVelocity:function(b,c,d,e){return c?(b+c*ig.system.tick).limit(-e,e):d?(c=d*ig.system.tick,0b+c?b+c:0):b.limit(-e,e)},handleMovementTrace:function(b){this.standing=!1;b.collision.y&&(0this.minBounceVelocity?this.vel.y*=-this.bounciness:(0 this.minBounceVelocity?this.vel.x*-this.bounciness:0);if(b.collision.slope){var c=b.collision.slope;if(0this.slopeStanding.min&&c=this.health&&this.kill()},touches:function(b){return!(this.pos.x>=b.pos.x+b.size.x||this.pos.x+this.size.x<=b.pos.x||this.pos.y>=b.pos.y+b.size.y||this.pos.y+this.size.y<=b.pos.y)},distanceTo:function(b){var c=this.pos.x+this.size.x/2-(b.pos.x+b.size.x/2);b=this.pos.y+this.size.y/2-(b.pos.y+b.size.y/2);return Math.sqrt(c*c+b*b)},angleTo:function(b){return Math.atan2(b.pos.y+ b.size.y/2-(this.pos.y+this.size.y/2),b.pos.x+b.size.x/2-(this.pos.x+this.size.x/2))},check:function(){},collideWith:function(){},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(b,c){b.checkAgainst&c.type&&b.check(c);c.checkAgainst&b.type&&c.check(b);b.collides&&c.collides&&b.collides+c.collides>ig.Entity.COLLIDES.ACTIVE&&ig.Entity.solveCollision(b,c)};ig.Entity.solveCollision= function(b,c){var d=null;if(b.collides==ig.Entity.COLLIDES.LITE||c.collides==ig.Entity.COLLIDES.FIXED)d=b;else if(c.collides==ig.Entity.COLLIDES.LITE||b.collides==ig.Entity.COLLIDES.FIXED)d=c;b.last.x+b.size.x>c.last.x&&b.last.xc.last.y&&b.last.yb.minBounceVelocity?b.vel.y*=-b.bounciness:(b.standing=!0,b.vel.y=0)):(d=(b.vel.y-c.vel.y)/2,b.vel.y=-d,c.vel.y=d,g=c.vel.x*ig.system.tick,d=ig.game.collisionMap.trace(b.pos.x,b.pos.y,g,-e/2,b.size.x,b.size.y),b.pos.y=d.pos.y,b=ig.game.collisionMap.trace(c.pos.x,c.pos.y,0,e/2,c.size.x,c.size.y),c.pos.y=b.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(b,c){this.tilesize=b;this.data=c;this.height=c.length;this.width=c[0].length;this.pxWidth=this.width*this.tilesize;this.pxHeight=this.height*this.tilesize},getTile:function(b,c){var d=Math.floor(b/this.tilesize),e=Math.floor(c/this.tilesize);return 0<=d&&dthis.lastSlope&&(this.lastSlope=l|0)},trace:function(b,c,g,l,q,n){var f={collision:{x:!1,y:!1,slope:!1},pos:{x:b,y:c},tile:{x:0,y:0}},m=Math.ceil(Math.max(Math.abs(g),Math.abs(l))/this.tilesize);if(1l?this.tilesize:0,s=Math.max(Math.floor(g/this.tilesize),0),y=Math.min(Math.ceil((g+f)/this.tilesize),this.height);l=Math.floor((b.pos.x+u)/this.tilesize);var A=Math.floor((c+u)/this.tilesize);if(0A||A>=this.width)A=-1;if(0<=l&&lthis.lastSlope||1q?this.tilesize:0;s=Math.max(Math.floor(b.pos.x/this.tilesize),0);t=Math.min(Math.ceil((b.pos.x+n)/this.tilesize),this.width);D=Math.floor((b.pos.y+u)/this.tilesize); y=Math.floor((g+u)/this.tilesize);if(0y||y>=this.height)y=-1;if(0<=D&&Dthis.lastSlope||1u?f:0)-(p+s[0])*this.tilesize;m=l+n+(0q*-u+n*c)return t;p=Math.sqrt(c*c+u*u);r=u/p;p=-c/p;var y=f*r+m*p,s=r*y,y=p*y;if(s*s+y*y>=q*q+n*n)return t||0.5>c*(m-n)-u*(f-q);b.pos.x=g+q-s;b.pos.y=l+n-y;b.collision.slope={x:c,y:u,nx:r,ny:p};return!0}return!1}});var b=1/3,c=2/3;ig.CollisionMap.defaultTileDef={5:[0,1,1,c,!0],6:[0,c,1,b,!0],7:[0,b,1,0,!0],3:[0,1,1,0.5,!0],4:[0,0.5,1,0,!0],2:[0, 1,1,0,!0],10:[0.5,1,1,0,!0],21:[0,1,0.5,0,!0],32:[c,1,1,0,!0],43:[b,1,c,0,!0],54:[0,1,b,0,!0],27:[0,0,1,b,!0],28:[0,b,1,c,!0],29:[0,c,1,1,!0],25:[0,0,1,0.5,!0],26:[0,0.5,1,1,!0],24:[0,0,1,1,!0],11:[0,0,0.5,1,!0],22:[0.5,0,1,1,!0],33:[0,0,b,1,!0],44:[b,0,c,1,!0],55:[c,0,1,1,!0],16:[1,b,0,0,!0],17:[1,c,0,b,!0],18:[1,1,0,c,!0],14:[1,0.5,0,0,!0],15:[1,1,0,0.5,!0],13:[1,1,0,0,!0],8:[0.5,1,0,0,!0],19:[1,1,0.5,0,!0],30:[b,1,0,0,!0],41:[c,1,b,0,!0],52:[1,1,c,0,!0],38:[1,c,0,1,!0],39:[1,b,0,c,!0],40:[1,0, 0,b,!0],36:[1,0.5,0,1,!0],37:[1,0,0,0.5,!0],35:[1,0,0,1,!0],9:[1,0,0.5,1,!0],20:[0.5,0,0,1,!0],31:[1,0,c,1,!0],42:[c,0,b,1,!0],53:[b,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(b,c,g,l){return{collision:{x:!1,y:!1,slope:!1},pos:{x:b+g,y:c+l},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(b,c,d){this.parent(b,c);this.setTileset(d)},setTileset:function(b){this.tilesetName=b instanceof ig.Image?b.path:b;this.tiles=new ig.Image(this.tilesetName);this.preRenderedChunks=null},setScreenPos:function(b, c){this.scroll.x=b/this.distance;this.scroll.y=c/this.distance},preRenderMapToChunks:function(){var b=this.width*this.tilesize*ig.system.scale,c=this.height*this.tilesize*ig.system.scale;this.chunkSize=Math.min(Math.max(b,c),this.chunkSize);var d=Math.ceil(b/this.chunkSize),e=Math.ceil(c/this.chunkSize);this.preRenderedChunks=[];for(var g=0;g=this.height||0>m){if(!this.repeat)continue;m=(m%this.height+this.height)%this.height}for(var p=-1,r=q;r=this.width||0>b){if(!this.repeat)continue;b=(b%this.width+this.width)%this.width}if(b=this.data[m][b])(c=this.anims[b- 1])?c.draw(r,l):this.tiles.drawTile(r,l,b-1,this.tilesize)}}}})});ig.baked=!0; ig.module("impact.game").requires("impact.impact","impact.entity","impact.collision-map","impact.background-map").defines(function(){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:!1,sortBy:null,cellSize:64,_deferredKill:[],_levelToLoad:null,_doSortEntities:!1,staticInstantiate:function(){this.sortBy=this.sortBy||ig.Game.SORT.Z_INDEX; ig.game=this;return null},loadLevel:function(b){this.screen={x:0,y:0};this.entities=[];this.namedEntities={};for(var c=0;ce&&window.focus(),("touchstart"==c.type||"mousedown"==c.type)&&this.mousemove(c),e=this.bindings[e])this.actions[e]=!0,this.locks[e]||(this.presses[e]=!0,this.locks[e]= !0),c.stopPropagation(),c.preventDefault()}})});ig.baked=!0; ig.module("plugins.patches.input-patch").requires("impact.input").defines(function(){ig.Input.inject({mousemove:function(b){var c=parseInt(ig.system.canvas.offsetWidth)||ig.system.realWidth;ig.ua.mobile&&(c=ig.system.realWidth);var c=ig.system.scale*(c/ig.system.realWidth),d={left:0,top:0};ig.system.canvas.getBoundingClientRect&&(d=ig.system.canvas.getBoundingClientRect());b=b.touches?b.touches[0]:b;this.mouse.x=(b.clientX-d.left)/c;this.mouse.y=(b.clientY-d.top)/c;try{ig.soundHandler.unlockWebAudio()}catch(e){}}, keyup:function(b){var c=b.target.tagName;if(!("INPUT"==c||"TEXTAREA"==c))if(c=this.bindings["keyup"==b.type?b.keyCode:2==b.button?ig.KEY.MOUSE2:ig.KEY.MOUSE1]){this.delayedKeyup[c]=!0;b.stopPropagation();b.preventDefault();try{ig.soundHandler.unlockWebAudio()}catch(d){}}}})});ig.baked=!0; ig.module("plugins.handlers.dom-handler").defines(function(){ig.DomHandler=ig.Class.extend({JQUERYAVAILABLE:!1,init:function(){this.JQUERYAVAILABLE=this._jqueryAvailable()},_jqueryAvailable:function(){return"undefined"!==typeof jQuery},addEvent:function(b,c,d,e){if(this.JQUERYAVAILABLE)b.on(c,d);else b.addEventListener(c,d,e)},create:function(b){return this.JQUERYAVAILABLE?$("<"+b+">"):ig.$new(b)},getElementByClass:function(b){return this.JQUERYAVAILABLE?$("."+b):document.getElementsByClassName(b)}, getElementById:function(b){return this.JQUERYAVAILABLE?0<$(b).length?$(b):null:ig.$(b)},appendChild:function(b,c){this.JQUERYAVAILABLE?b.append(c):b.appendChild(c)},appendToBody:function(b){this.JQUERYAVAILABLE?$("body").append(b):document.body.appendChild(b)},resize:function(b,c,d){if(this.JQUERYAVAILABLE)b.width(c.toFixed(2)),b.height(d.toFixed(2));else{var e=b.style.visibility;c="width:"+c.toFixed(2)+"px; height:"+d.toFixed(2)+"px;";this.attr(b,"style",c);b.style.visibility=e}},resizeOffsetLeft:function(b, c,d,e){if(this.JQUERYAVAILABLE)b.width(c.toFixed(2)),b.height(d.toFixed(2)),b.css("left",e);else{var g=b.style.visibility;c="width:"+c.toFixed(2)+"px; height:"+d.toFixed(2)+"px; left: "+e.toFixed(2)+"px;";this.attr(b,"style",c);b.style.visibility=g}},resizeOffset:function(b,c,d,e,g){if(this.JQUERYAVAILABLE)b.width(c.toFixed(2)),b.height(d.toFixed(2)),b.css("left",e),b.css("top",g);else{var l=b.style.visibility;c="width:"+c.toFixed(2)+"px; height:"+d.toFixed(2)+"px; left: "+e.toFixed(2)+"px; top: "+ g.toFixed(2)+"px;";this.attr(b,"style",c);b.style.visibility=l}},css:function(b,c){if(this.JQUERYAVAILABLE)b.css(c);else{var d="",e;for(e in c)d+=e+":"+c[e]+";";this.attr(b,"style",d)}},getOffsets:function(b){return this.JQUERYAVAILABLE?(b=b.offset(),{left:b.left,top:b.top}):{left:b.offsetLeft,top:b.offsetTop}},attr:function(b,c,d){if("undefined"===typeof d)return this.JQUERYAVAILABLE?b.attr(c):b.getAttribute(c);this.JQUERYAVAILABLE?b.attr(c,d):b.setAttribute(c,d)},show:function(b){this.JQUERYAVAILABLE? (b.show(),b.css("visibility","visible")):b&&(b.style?b.style.visibility="visible":b[0]&&(b[0].style.visibility="visible"))},hide:function(b){this.JQUERYAVAILABLE?(b.hide(),b.css("visibility","hidden")):b&&(b.style?b.style.visibility="hidden":b[0]&&(b[0].style.visibility="hidden"))},getQueryVariable:function(b){for(var c=window.location.search.substring(1).split("&"),d=0;dthis.maxScalingOnMobile&&(c=this.maxScalingOnMobile),cthis.maxScalingOnDesktop&&(c=this.maxScalingOnDesktop),cd&&(d=0);0>e&&(e=0);ig.domHandler.resizeOffset(c,Math.floor(ig.sizeHandler.mobile.actualSize.x),Math.floor(ig.sizeHandler.mobile.actualSize.y),d,e);var g=!1;if(this.portraitMode?window.innerHeightwindow.innerWidth)if(this.enableStretchToFitOnAntiPortraitModeFlag)ig.domHandler.resizeOffset(c,Math.floor(window.innerWidth), Math.floor(window.innerHeight),0,0);else{var g=new Vector2(window.innerWidth/this.mobile.actualResolution.y,window.innerHeight/this.mobile.actualResolution.x),d=Math.min(g.x,g.y),g=this.mobile.actualResolution.y*d,l=this.mobile.actualResolution.x*d,d=Math.floor(ig.sizeHandler.windowSize.x/2-g/2),e=Math.floor(ig.sizeHandler.windowSize.y/2-l/2);0>d&&(d=0);0>e&&(e=0);ig.domHandler.resizeOffset(c,Math.floor(g),Math.floor(l),d,e)}}else ig.domHandler.resize(c,Math.floor(ig.sizeHandler.mobile.actualSize.x), Math.floor(ig.sizeHandler.mobile.actualSize.y));else this.enableStretchToFitOnDesktopFlag?ig.domHandler.resize(c,Math.floor(ig.sizeHandler.desktop.actualSize.x),Math.floor(ig.sizeHandler.desktop.actualSize.y)):(d=Math.floor(ig.sizeHandler.windowSize.x/2-ig.sizeHandler.desktop.actualSize.x/2),e=Math.floor(ig.sizeHandler.windowSize.y/2-ig.sizeHandler.desktop.actualSize.y/2),0>d&&(d=0),0>e&&(e=0),ig.domHandler.resizeOffset(c,Math.floor(ig.sizeHandler.desktop.actualSize.x),Math.floor(ig.sizeHandler.desktop.actualSize.y), d,e))}for(var q in this.adsToResize)b=ig.domHandler.getElementById("#"+q),c=ig.domHandler.getElementById("#"+q+"-Box"),g=(window.innerWidth-this.adsToResize[q]["box-width"])/2+"px",d=(window.innerHeight-this.adsToResize[q]["box-height"])/2+"px",b&&ig.domHandler.css(b,{width:window.innerWidth,height:window.innerHeight}),c&&ig.domHandler.css(c,{left:g,top:d});for(q in this.dynamicClickableEntityDivs){b=Math.min(ig.sizeHandler.scaleRatioMultiplier.x,ig.sizeHandler.scaleRatioMultiplier.y);c=ig.domHandler.getElementById("#"+ q);if(ig.ua.mobile)var n=this.dynamicClickableEntityDivs[q].entity_pos_x,l=this.dynamicClickableEntityDivs[q].entity_pos_y,d=this.dynamicClickableEntityDivs[q].width,g=this.dynamicClickableEntityDivs[q].height,e=Math.floor(n*this.scaleRatioMultiplier.x)+"px",l=Math.floor(l*this.scaleRatioMultiplier.y)+"px",d=Math.floor(d*this.scaleRatioMultiplier.x)+"px",g=Math.floor(g*this.scaleRatioMultiplier.y)+"px";else var g=ig.domHandler.getElementById("#canvas"),g=ig.domHandler.getOffsets(g),e=g.left,f=g.top, n=this.dynamicClickableEntityDivs[q].entity_pos_x,l=this.dynamicClickableEntityDivs[q].entity_pos_y,d=this.dynamicClickableEntityDivs[q].width,g=this.dynamicClickableEntityDivs[q].height,e=Math.floor(e+n*b)+"px",l=Math.floor(f+l*b)+"px",d=Math.floor(d*b)+"px",g=Math.floor(g*b)+"px";ig.domHandler.css(c,{"float":"left",position:"absolute",left:e,top:l,width:d,height:g,"z-index":3});this.dynamicClickableEntityDivs[q]["font-size"]&&ig.domHandler.css(c,{"font-size":this.dynamicClickableEntityDivs[q]["font-size"]* b+"px"})}$("#ajaxbar").width(this.windowSize.x);$("#ajaxbar").height(this.windowSize.y)},resize:function(){this.sizeCalcs();this.resizeLayers()},reorient:function(){console.log("changing orientation ...");if(ig.ua.mobile){var b=!1,b=this.portraitMode?window.innerHeightwindow.innerWidth,c=this.domHandler.getElementById("#orientate"),d=this.domHandler.getElementById("#game");b?(this.domHandler.show(c),this.domHandler.hide(d),console.log("portrait"+window.innerWidth+ ","+window.innerHeight)):(this.domHandler.show(d),this.domHandler.hide(c),console.log("landscape"+window.innerWidth+","+window.innerHeight))}ig.ua.mobile?(this.resize(),this.resizeAds()):this.resize()},resizeAds:function(){for(var b in this.adsToResize){var c=ig.domHandler.getElementById("#"+b),d=ig.domHandler.getElementById("#"+b+"-Box"),e=(window.innerWidth-this.adsToResize[b]["box-width"])/2+"px",g=(window.innerHeight-this.adsToResize[b]["box-height"])/2+"px";c&&ig.domHandler.css(c,{width:window.innerWidth, height:window.innerHeight});d&&ig.domHandler.css(d,{left:e,top:g})}},samsungFix:function(){ig.ua.android&&!(4.2>parseFloat(navigator.userAgent.slice(navigator.userAgent.indexOf("Android")+8,navigator.userAgent.indexOf("Android")+11)))&&(!(0>navigator.userAgent.indexOf("GT"))&&!(0b?0:isNaN(b)?1:1b?0:isNaN(b)?1:1b){this.soundList[c].volume(0);break}isNaN(b)?this.soundList[c].volume(1):1b){this.soundList[c].volume(0);break}isNaN(b)?this.soundList[c].volume(1):1=b?this.jukeboxPlayer.setVolume(this.minVolume):isNaN(b)?this.jukeboxPlayer.setVolume(1): 1=d.indexOf("chrome")&&(l=c),d.indexOf("win64")&&(l=c));var q=new XMLHttpRequest;q.open("GET",l,!0);q.responseType="arraybuffer";q.onload=function(){this.webaudio.context.decodeAudioData(q.response, function(b){this.webaudio.buffer=b;this.webaudio.source_loop={};this.bgmPlaying?this.play(null,!0):this.stop()}.bind(this),function(){console.log('Error decoding audio "'+l+'".')})}.bind(this);q.send();if(4==q.readyState&&"undefined"!==typeof Audio){this.useHTML5Audio=!0;try{new Audio}catch(n){this.useHTML5Audio=!1}this.useHTML5Audio&&(console.log("Using HTML5 Audio"),this.webaudio=null,this.audio=new Audio,this.isSupported=!0,this.initHTML5Audio(b))}break}},initIOSWebAudioUnlock:function(){if(this.webaudio){webaudio= this.webaudio;var b=function(){var c=webaudio.context,d=c.createBuffer(1,1,22050),e=c.createBufferSource();e.buffer=d;e.connect(c.destination);"undefined"===typeof e.start?e.noteOn(0):e.start(0);setTimeout(function(){(e.playbackState===e.PLAYING_STATE||e.playbackState===e.FINISHED_STATE)&&window.removeEventListener("touchend",b,!1)}.bind(this),0)};window.addEventListener("touchend",b,!1)}},initHTML5Audio:function(b){if(this.useHTML5Audio&&this.audio){var c=this.audio;this.codecs={};this.codecs={mp3:!!c.canPlayType("audio/mpeg;").replace(/^no$/, ""),opus:!!c.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!c.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),aac:!!c.canPlayType("audio/aac;").replace(/^no$/,""),m4a:!!(c.canPlayType("audio/x-m4a;")||c.canPlayType("audio/m4a;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(c.canPlayType("audio/x-mp4;")||c.canPlayType("audio/mp4;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, "")};this.is={ff:Boolean(null!=window.mozInnerScreenX&&/firefox/.test(navigator.userAgent.toLowerCase())),ie:Boolean(document.all&&!window.opera),opera:Boolean(window.opera),chrome:Boolean(window.chrome),safari:Boolean(!window.chrome&&/safari/.test(navigator.userAgent.toLowerCase())&&window.getComputedStyle&&!window.globalStorage&&!window.opera)};this.playDelay=-60;this.stopDelay=30;this.is.chrome&&(this.playDelay=-25);this.is.chrome&&(this.stopDelay=25);this.is.ff&&(this.playDelay=-25);this.is.ff&& (this.stopDelay=85);this.is.opera&&(this.playDelay=5);this.is.opera&&(this.stopDelay=0);for(var d in b){this.soundList[d]=d;var e=b[d].path,c=e+"."+ig.Sound.FORMAT.OGG.ext,e=e+"."+ig.Sound.FORMAT.MP3.ext,g=null;this.codecs[ig.Sound.FORMAT.OGG.ext.toLowerCase()]?g=c:this.codecs[ig.Sound.FORMAT.MP3.ext.toLowerCase()]&&(g=e);if(g){ig.ua.mobile?ig.ua.iOS&&(g=e):(b=navigator.userAgent.toLowerCase(),-1!=b.indexOf("safari")&&-1>=b.indexOf("chrome")&&(g=e));this.audio.addEventListener("error",function(){this.audio.error&& 4===this.audio.error.code&&(this.isSupported=!1)},!1);this.audio.src=g;this.audio._pos=0;this.audio.preload="auto";this.audio.volume=this._volume;this.inactiveAudio=new Audio;this.inactiveAudio.src=g;this.inactiveAudio._pos=0;this.inactiveAudio.preload="auto";this.inactiveAudio.volume=this._volume;this.inactiveAudio.load();var l=function(){this._duration=this.audio.duration;this._loaded||(this._loaded=!0);this.bgmPlaying?this.play(null,!0):this.stop();this.audio.removeEventListener("canplaythrough", l,!1)}.bind(this);this.audio.addEventListener("canplaythrough",l,!1);this.audio.load();break}}}},play:function(b,c){if(this.isSupported)if(this.bgmPlaying=!0,this.webaudio){if(!c&&this.reinitOnPlay&&this.webaudio.source_loop.buffer==this.webaudio.buffer){if(this.webaudio.source_loop._playing&&(this.webaudio.source_loop[this.webaudio.compatibility.stop](0),this.webaudio.source_loop._playing=!1,this.pausedTime+=this.webaudio.context.currentTime-this.webaudio.source_loop._startTime,this.pausedTime%= this.webaudio.source_loop.buffer.duration,this.webaudio.source_loop._startTime=0,"noteOn"===this.webaudio.compatibility.start))this.webaudio.source_once[this.webaudio.compatibility.stop](0);try{this.webaudio.context.close();this.webaudio.context=new this.AudioContext;this.webaudio.gainNode=this.webaudio.context.createGain();this.webaudio.gainNode.connect(this.webaudio.context.destination);this.webaudio.gainNode.gain.value=this._volume;var d="start",e="stop",g=this.webaudio.context.createBufferSource(); "function"!==typeof g.start&&(d="noteOn");this.webaudio.compatibility.start=d;"function"!==typeof g.stop&&(e="noteOff");this.webaudio.compatibility.stop=e;this.webaudio.source_loop={};this.play(null,!0)}catch(l){}}if(this.webaudio.buffer){if(!this.muteFlag&&(this.bgmPlaying=!0,!this.webaudio.source_loop._playing)){this.webaudio.source_loop=this.webaudio.context.createBufferSource();this.webaudio.source_loop.buffer=this.webaudio.buffer;this.webaudio.source_loop.loop=!0;this.webaudio.source_loop.connect(this.webaudio.gainNode); if(null==b||isNaN(b))b=0,this.pausedTime&&(b=this.pausedTime);this.webaudio.source_loop._startTime=this.webaudio.context.currentTime;if("noteOn"===this.webaudio.compatibility.start)this.webaudio.source_once=this.webaudio.context.createBufferSource(),this.webaudio.source_once.buffer=this.webaudio.buffer,this.webaudio.source_once.connect(this.webaudio.gainNode),this.webaudio.source_once.noteGrainOn(0,b,this.webaudio.buffer.duration-b),this.webaudio.source_loop[this.webaudio.compatibility.start](this.webaudio.context.currentTime+ (this.webaudio.buffer.duration-b));else this.webaudio.source_loop[this.webaudio.compatibility.start](0,b);this.webaudio.source_loop._playing=!0}}else this.bgmPlaying=!0}else if(this.audio){var q=this.audio;if(!this.muteFlag)if(this.bgmPlaying=!0,isNaN(b)&&(b=0,this.pausedTime&&(b=this.pausedTime)),d=this._duration-b,this._onEndTimer&&(clearTimeout(this._onEndTimer),this._onEndTimer=null),this._onEndTimer=setTimeout(function(){this.audio.currentTime=0;this.audio.pause();this.pausedTime=0;if(this.inactiveAudio){var b= this.audio;this.audio=this.inactiveAudio;this.inactiveAudio=b}this.play()}.bind(this),1E3*d+this.playDelay),4===q.readyState||!q.readyState&&navigator.isCocoonJS)q.readyState=4,q.currentTime=b,q.muted=this.muteFlag||q.muted,q.volume=this._volume,setTimeout(function(){q.play()},0);else{clearTimeout(this._onEndTimer);this._onEndTimer=null;var n=function(){typeof("function"==this.play)&&(this.play(),q.removeEventListener("canplaythrough",n,!1))}.bind(this);q.addEventListener("canplaythrough",n,!1)}}}, stop:function(){this.bgmPlaying=!1;if(this.isSupported)if(this.webaudio){if(this.webaudio.source_loop._playing&&(this.webaudio.source_loop[this.webaudio.compatibility.stop](0),this.webaudio.source_loop._playing=!1,this.pausedTime+=this.webaudio.context.currentTime-this.webaudio.source_loop._startTime,this.pausedTime%=this.webaudio.source_loop.buffer.duration,this.webaudio.source_loop._startTime=0,"noteOn"===this.webaudio.compatibility.start))this.webaudio.source_once[this.webaudio.compatibility.stop](0)}else if(this.audio){var b= this.audio;4==b.readyState&&(this.pausedTime=b.currentTime,b.currentTime=0,b.pause(),clearTimeout(this._onEndTimer),this._onEndTimer=null)}},volume:function(b){if(isNaN(b)||null==b)return this.getVolume();this.isSupported&&(this._volume=b,0>this._volume?this._volume=0:1=b&&(b=c.settings.spritemap.music.start,ig.ua.android?this.forcelooped||(c.play(b,!0),this.forcelooped=!0,setTimeout(function(){ig.soundHandler.forcelooped=!1},d)):c.setCurrentTime(b)))}else"ImpactMusicPlayer"== this.bgmPlayer.tagName&&(null!=window.mozInnerScreenX&&/firefox/.test(navigator.userAgent.toLowerCase()),b=Boolean(window.chrome),!window.chrome&&/safari/.test(navigator.userAgent.toLowerCase()),d=0.1,ig.ua.mobile&&(d=0.115,ig.ua.android&&(d=0.45,b&&(d=0.3))),c=0,"mp3"==ig.soundManager.format.ext&&(c=0.05),ig.music.currentTrack&&(b=ig.music.currentTrack.duration-d,ig.music.currentTrack.currentTime>=b&&(ig.ua.android?this.forcelooped||(ig.music.currentTrack.pause(),ig.music.currentTrack.currentTime= c,ig.music.currentTrack.play(),this.forcelooped=!0,setTimeout(function(){ig.soundHandler.forcelooped=!1},d)):ig.music.currentTrack.currentTime=c)))}}})});ig.baked=!0; ig.module("plugins.io.storage").defines(function(){ig.Storage=ig.Class.extend({staticInstantiate:function(){return!ig.Storage.instance?null:ig.Storage.instance},init:function(){ig.Storage.instance=this},isCapable:function(){return"undefined"!==typeof window.localStorage},isSet:function(b){return null!==this.get(b)},initUnset:function(b,c){null===this.get(b)&&this.set(b,c)},get:function(b){if(!this.isCapable())return null;try{return JSON.parse(localStorage.getItem(b))}catch(c){return window.localStorage.getItem(b)}}, getInt:function(b){return~~this.get(b)},getFloat:function(b){return parseFloat(this.get(b))},getBool:function(b){return!!this.get(b)},key:function(b){return this.isCapable()?window.localStorage.key(b):null},set:function(b,c){if(!this.isCapable())return null;try{window.localStorage.setItem(b,JSON.stringify(c))}catch(d){console.log(d)}},setHighest:function(b,c){c>this.getFloat(b)&&this.set(b,c)},remove:function(b){if(!this.isCapable())return null;window.localStorage.removeItem(b)},clear:function(){if(!this.isCapable())return null; window.localStorage.clear()}})});ig.baked=!0; ig.module("plugins.io.mouse").defines(function(){Mouse=ig.Class.extend({bindings:{click:[ig.KEY.MOUSE1]},init:function(){ig.input.initMouse();for(var b in this.bindings){this[b]=b;for(var c=0;cd?d:b},pollGamepads:function(){if(this.isSupported){this.leftStick.x=0;this.leftStick.y=0;this.rightStick.x=0;this.rightStick.y=0;this.list=navigator.getGamepads();for(var b in this.bindings){for(var c= !1,d=0;d=b-40&&this.touches[c].x<=b+40&&this.touches.splice(c,1)}}if(ig.visibilityHandler)ig.visibilityHandler.onChange("focus");try{ig.soundHandler.unlockWebAudio()}catch(e){}},windowKeyDown:function(b){var c=parseInt(ig.system.canvas.offsetWidth)||ig.system.realWidth,d=parseInt(ig.system.canvas.offsetHeight)||ig.system.realHeight,c=ig.system.scale*(c/ig.system.realWidth),d=ig.system.scale* (d/ig.system.realHeight);if(window.navigator.msPointerEnabled){var e={left:0,top:0};ig.system.canvas.getBoundingClientRect&&(e=ig.system.canvas.getBoundingClientRect());b=b.changedTouches?b.changedTouches:[b];for(var g=0;gthis.getFloat(b)&&this.set(b,c)},get:function(b){return"undefined"==typeof this.tempData[b]?null:JSON.parse(this.tempData[b])},getInt:function(b){return~~this.get(b)},getFloat:function(b){return parseFloat(this.get(b))}, getBool:function(b){return!!this.get(b)},isSet:function(b){return null!==this.get(b)},remove:function(b){delete this.tempData[b]},clear:function(){this.tempData={}}})});ig.baked=!0; ig.module("plugins.io.io-manager").requires("plugins.io.storage","plugins.io.mouse","plugins.io.keyboard","plugins.io.gamepad","plugins.io.multitouch","plugins.io.multitouch-input","plugins.io.gamepad-input","plugins.fake-storage").defines(function(){IoManager=ig.Class.extend({storage:null,localStorageSupport:!1,gamekey:"TeamKaboom",mouse:null,keyboard:null,multitouch:null,gamepad:null,init:function(){ig.multitouchInput=new ig.MultitouchInput;ig.gamepadInput=new ig.GamepadInput;this.unbindAll();this.initStorage(); this.initMouse();this.initKeyboard()},unbindAll:function(){ig.input.unbindAll();ig.gamepadInput.unbindAll()},initStorage:function(){try{window.localStorage.setItem("test","test"),this.storage=new ig.Storage}catch(b){console.log("using fake storage"),this.storage=new ig.FakeStorage}},initMouse:function(){this.mouse=new Mouse},initKeyboard:function(){this.keyboard=new Keyboard},initMultitouch:function(){this.multitouch=new Multitouch},initGamepad:function(){this.gamepad=new Gamepad},press:function(b){return ig.input.pressed(b)|| this.gamepad&&this.gamepad.press(b)?!0:!1},held:function(b){return ig.input.state(b)||this.gamepad&&this.gamepad.state(b)?!0:!1},release:function(b){return ig.input.released(b)||this.gamepad&&this.gamepad.released(b)?!0:!1},getClickPos:function(){return this.mouse.getPos()},getTouchesPos:function(){return this.multitouch.getTouchesPos()},checkOverlap:function(b,c,d,e,g){return b.x>c+e||b.xd+g||b.yl||0>q){var y=b.x,A=b.y,d=g?-u/2+d:d||0,e=g?-t/2+e:e||0;0c)return b-=d,bc&&(b=c),b;if(b== c)return b},end:function(){this.parent();this._drawStatus=1;_SETTINGS.TapToStartAudioUnlock.Enabled?this.tapToStartDiv(function(){ig.system.setGame(MyGame)}.bind(this)):ig.system.setGame(MyGame);this.draw()},tapToStartDiv:function(b){this.desktopCoverDIV=document.getElementById(this.tapToStartDivId);if(!this.desktopCoverDIV){this.desktopCoverDIV=document.createElement("div");this.desktopCoverDIV.id=this.tapToStartDivId;this.desktopCoverDIV.setAttribute("class","play");this.desktopCoverDIV.setAttribute("style", "position: absolute; display: block; z-index: 999999; background-color: rgba(23, 32, 53, 0.7); visibility: visible; font-size: 10vmin; text-align: center; vertical-align: middle; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;");this.desktopCoverDIV.innerHTML="
"+ _STRINGS.Splash.TapToStart+"
";(document.getElementById("play").parentNode||document.getElementById("ajaxbar")).appendChild(this.desktopCoverDIV);try{"undefined"!==typeof ig.sizeHandler?"undefined"!==typeof ig.sizeHandler.coreDivsToResize&&ig.sizeHandler.coreDivsToResize.push("#"+this.tapToStartDivId):"undefined"!==typeof coreDivsToResize&&(coreDivsToResize.push(this.tapToStartDivId),"function"===typeof sizeHandler&&console.log("sizeHandler"))}catch(c){console.log(c)}this.desktopCoverDIV.addEventListener("click", function(){ig.soundHandler.unlockWebAudio();this.desktopCoverDIV.setAttribute("style","visibility: hidden;");"function"===typeof b&&b()}.bind(this))}},setupCustomAnimation:function(){this.customAnim=new ig.Animation(this.customAnim,0.05,[0,1,2,3,4,5]);this.customAnim.currentFrame=0;ig.loadingScreen=this;ig.loadingScreen.animationTimer=window.setInterval("ig.loadingScreen.animate()",100)},animate:function(){this.customAnim.currentFrame(b*=2)?0.5*b*b:-0.5*(--b*(b-2)-1)};ig.Tween.Easing.Cubic.EaseIn=function(b){return b*b*b};ig.Tween.Easing.Cubic.EaseOut=function(b){return--b*b*b+1};ig.Tween.Easing.Cubic.EaseInOut=function(b){return 1>(b*=2)?0.5*b*b*b:0.5*((b-=2)*b*b+2)};ig.Tween.Easing.Quartic.EaseIn=function(b){return b*b*b*b};ig.Tween.Easing.Quartic.EaseOut=function(b){return-(--b*b*b*b-1)};ig.Tween.Easing.Quartic.EaseInOut=function(b){return 1> (b*=2)?0.5*b*b*b*b:-0.5*((b-=2)*b*b*b-2)};ig.Tween.Easing.Quintic.EaseIn=function(b){return b*b*b*b*b};ig.Tween.Easing.Quintic.EaseOut=function(b){return(b-=1)*b*b*b*b+1};ig.Tween.Easing.Quintic.EaseInOut=function(b){return 1>(b*=2)?0.5*b*b*b*b*b:0.5*((b-=2)*b*b*b*b+2)};ig.Tween.Easing.Sinusoidal.EaseIn=function(b){return-Math.cos(b*Math.PI/2)+1};ig.Tween.Easing.Sinusoidal.EaseOut=function(b){return Math.sin(b*Math.PI/2)};ig.Tween.Easing.Sinusoidal.EaseInOut=function(b){return-0.5*(Math.cos(Math.PI* b)-1)};ig.Tween.Easing.Exponential.EaseIn=function(b){return 0==b?0:Math.pow(2,10*(b-1))};ig.Tween.Easing.Exponential.EaseOut=function(b){return 1==b?1:-Math.pow(2,-10*b)+1};ig.Tween.Easing.Exponential.EaseInOut=function(b){return 0==b?0:1==b?1:1>(b*=2)?0.5*Math.pow(2,10*(b-1)):0.5*(-Math.pow(2,-10*(b-1))+2)};ig.Tween.Easing.Circular.EaseIn=function(b){return-(Math.sqrt(1-b*b)-1)};ig.Tween.Easing.Circular.EaseOut=function(b){return Math.sqrt(1- --b*b)};ig.Tween.Easing.Circular.EaseInOut=function(b){return 1> (b/=0.5)?-0.5*(Math.sqrt(1-b*b)-1):0.5*(Math.sqrt(1-(b-=2)*b)+1)};ig.Tween.Easing.Elastic.EaseIn=function(b){var c,d=0.1,e=0.4;if(0==b)return 0;if(1==b)return 1;e||(e=0.3);!d||1>d?(d=1,c=e/4):c=e/(2*Math.PI)*Math.asin(1/d);return-(d*Math.pow(2,10*(b-=1))*Math.sin(2*(b-c)*Math.PI/e))};ig.Tween.Easing.Elastic.EaseOut=function(b){var c,d=0.1,e=0.4;if(0==b)return 0;if(1==b)return 1;e||(e=0.3);!d||1>d?(d=1,c=e/4):c=e/(2*Math.PI)*Math.asin(1/d);return d*Math.pow(2,-10*b)*Math.sin(2*(b-c)*Math.PI/e)+1}; ig.Tween.Easing.Elastic.EaseInOut=function(b){var c,d=0.1,e=0.4;if(0==b)return 0;if(1==b)return 1;e||(e=0.3);!d||1>d?(d=1,c=e/4):c=e/(2*Math.PI)*Math.asin(1/d);return 1>(b*=2)?-0.5*d*Math.pow(2,10*(b-=1))*Math.sin(2*(b-c)*Math.PI/e):0.5*d*Math.pow(2,-10*(b-=1))*Math.sin(2*(b-c)*Math.PI/e)+1};ig.Tween.Easing.Back.EaseIn=function(b){return b*b*(2.70158*b-1.70158)};ig.Tween.Easing.Back.EaseOut=function(b){return(b-=1)*b*(2.70158*b+1.70158)+1};ig.Tween.Easing.Back.EaseInOut=function(b){return 1>(b*=2)? 0.5*b*b*(3.5949095*b-2.5949095):0.5*((b-=2)*b*(3.5949095*b+2.5949095)+2)};ig.Tween.Easing.Bounce.EaseIn=function(b){return 1-ig.Tween.Easing.Bounce.EaseOut(1-b)};ig.Tween.Easing.Bounce.EaseOut=function(b){return(b/=1)<1/2.75?7.5625*b*b:b<2/2.75?7.5625*(b-=1.5/2.75)*b+0.75:b<2.5/2.75?7.5625*(b-=2.25/2.75)*b+0.9375:7.5625*(b-=2.625/2.75)*b+0.984375};ig.Tween.Easing.Bounce.EaseInOut=function(b){return 0.5>b?0.5*ig.Tween.Easing.Bounce.EaseIn(2*b):0.5*ig.Tween.Easing.Bounce.EaseOut(2*b-1)+0.5};ig.Tween.Interpolation= {Linear:function(b,c){var d=b.length-1,e=d*c,g=Math.floor(e),l=TWEEN.Interpolation.Utils.Linear;return 0>c?l(b[0],b[1],e):1d?d:g+1],e-g)}}});ig.baked=!0; ig.module("plugins.patches.entity-patch").requires("impact.entity").defines(function(){ig.Entity.inject({handleMovementTrace:function(b){this.standing=!1;b.collision.y&&(0this.minBounceVelocity?this.vel.y*=-this.bounciness:(0this.minBounceVelocity?this.vel.x*-this.bounciness:0);if(b.collision.slope){var c=b.collision.slope;if(0this.slopeStanding.min&&cd?q(b[0],b[1],g): 1e?e:l+1],g-l)},Bezier:function(b,d){for(var e=0,g=b.length-1,l=Math.pow,q=ig.Tween.Interpolation.Utils.Bernstein,n=0;n<=g;n++)e+=l(1-d,g-n)*l(d,n)*b[n]*q(g,n);return e},CatmullRom:function(b,d){var e=b.length-1,g=e*d,l=Math.floor(g),q=ig.Tween.Interpolation.Utils.CatmullRom;return b[0]===b[e]?(0>d&&(l=Math.floor(g=e*(1+d))),q(b[(l-1+e)%e],b[l],b[(l+1)%e],b[(l+2)%e],g-l)):0>d?b[0]-(q(b[0],b[0],b[1],b[1],-g)-b[0]):1this.getFloat(b)&&this.set(b,c)},remove:function(b){if(!this.isCapable())return null;window.localStorage.removeItem(b)},clear:function(){if(!this.isCapable())return null; window.localStorage.clear()}})});ig.baked=!0; ig.module("plugins.scale").requires("impact.entity").defines(function(){ig.Entity.inject({scale:{x:1,y:1},_offset:{x:0,y:0},_scale:{x:1,y:1},_size:{x:0,y:0},init:function(b,c,d){this.parent(b,c,d);this._offset.x=this.offset.x;this._offset.y=this.offset.y;this._size.x=this.size.x;this._size.y=this.size.y;this.setScale(this.scale.x,this.scale.y)},draw:function(){var b=ig.system.context;b.save();b.translate(ig.system.getDrawPos(this.pos.x.round()-this.offset.x-ig.game.screen.x),ig.system.getDrawPos(this.pos.y.round()- this.offset.y-ig.game.screen.y));b.scale(this._scale.x,this._scale.y);null!=this.currentAnim&&this.currentAnim.draw(0,0);b.restore()},setScale:function(b,c){var d=this.size.x,e=this.size.y;this.scale.x=b||this.scale.x;this.scale.y=c||this.scale.y;this._scale.x=this.scale.x/ig.system.scale;this._scale.y=this.scale.y/ig.system.scale;this.offset.x=this._offset.x*this._scale.x;this.offset.y=this._offset.y*this._scale.y;this.size.x=this._size.x*this._scale.x;this.size.y=this._size.y*this._scale.y;this.pos.x+= (d-this.size.x)/2;this.pos.y+=(e-this.size.y)/2}})});ig.baked=!0; ig.module("plugins.data.color-rgb").defines(function(){ColorRGB=function(b,c,d,e){this.r=b||0;this.g=c||0;this.b=d||0;this.a=e||0};ColorRGB.prototype={setRandomColor:function(){this.r=Math.round(255*Math.random());this.g=Math.round(255*Math.random());this.b=Math.round(255*Math.random())},getStyle:function(){return"rgba("+this.r+","+this.g+","+this.b+","+this.a+")"},getHex:function(){for(var b=this.r.toString(16),c=this.g.toString(16),d=this.b.toString(16);2>b.length;)b="0"+b;for(;2>c.length;)c="0"+ c;for(;2>d.length;)d="0"+d;return"#"+b+c+d},getInvertedColor:function(){return new ColorRGB(255-this.r,255-this.g,255-this.b,255-this.a)},clone:function(){return new ColorRGB(this.r,this.g,this.b,this.a)}}});this.START_BRANDING_SPLASH;ig.baked=!0; ig.module("plugins.branding.splash").requires("impact.impact","impact.entity").defines(function(){ig.BrandingSplash=ig.Class.extend({init:function(){ig.game.spawnEntity(EntityBranding,0,0);console.log("spawn branding")}});var b="undefined"!=typeof CUSTOM_VARIABLE_SPLASH_BG_COLOR?CUSTOM_VARIABLE_SPLASH_BG_COLOR:"#FFFFFF";EntityBranding=ig.Entity.extend({gravityFactor:0,size:{x:32,y:32},splash:new ig.Image("undefined"!=typeof CUSTOM_VARIABLE_SPLASH_PATH?CUSTOM_VARIABLE_SPLASH_PATH:"branding/splash1.png"), init:function(b,d,e){this.parent(b,d,e);320>=ig.system.width?(this.size.x=320,this.size.y=200):(this.size.x=480,this.size.y=240);this.pos.x=(ig.system.width-this.size.x)/2;this.pos.y=-this.size.y-200;this.endPosY=(ig.system.height-this.size.y)/2;b=this.tween({pos:{y:this.endPosY}},0.5,{easing:ig.Tween.Easing.Bounce.EaseIn});d=this.tween({},2.5,{onComplete:function(){ig.game.director.loadLevel(ig.game.director.currentLevel)}});b.chain(d);b.start();this.currentAnim=this.anims.idle},createClickableLayer:function(){console.log("Build clickable layer"); this.checkClickableLayer("branding-splash",_SETTINGS.Branding.Logo.Link,_SETTINGS.Branding.Logo.NewWindow)},doesClickableLayerExist:function(b){for(k in dynamicClickableEntityDivs)if(k==b)return!0;return!1},checkClickableLayer:function(b,d,e){"undefined"==typeof wm&&(this.doesClickableLayerExist(b)?(ig.game.showOverlay([b]),$("#"+b).find("[href]").attr("href",d)):this.createClickableOutboundLayer(b,d,"media/graphics/misc/invisible.png",e))},createClickableOutboundLayer:function(b,d,e,g){var l=ig.$new("div"); l.id=b;document.body.appendChild(l);l=$("#"+l.id);l.css("float","left");l.css("position","absolute");if(ig.ua.mobile){var q=window.innerHeight/mobileHeight,n=window.innerWidth/mobileWidth;l.css("left",this.pos.x*n);l.css("top",this.pos.y*q);l.css("width",this.size.x*n);l.css("height",this.size.y*q)}else q=w/2-destW/2,n=h/2-destH/2,console.log(q,n),l.css("left",q+this.pos.x*multiplier),l.css("top",n+this.pos.y*multiplier),l.css("width",this.size.x*multiplier),l.css("height",this.size.y*multiplier); g?l.html(""):l.html("");dynamicClickableEntityDivs[b]={};dynamicClickableEntityDivs[b].width=this.size.x*multiplier;dynamicClickableEntityDivs[b].height=this.size.y*multiplier;dynamicClickableEntityDivs[b].entity_pos_x=this.pos.x;dynamicClickableEntityDivs[b].entity_pos_y=this.pos.y},draw:function(){ig.system.context.fillStyle=b;ig.system.context.fillRect(0, 0,ig.system.width,ig.system.height);ig.system.context.fillStyle="#000";ig.system.context.font="12px Arial";ig.system.context.textAlign="left";this.parent();this.splash&&ig.system.context.drawImage(this.splash.data,0,0,this.splash.data.width,this.splash.data.height,this.pos.x,this.pos.y,this.size.x,this.size.y)}})});this.END_BRANDING_SPLASH;ig.baked=!0; ig.module("game.entities.buttons.button").requires("impact.entity","plugins.data.vector").defines(function(){EntityButton=ig.Entity.extend({collides:ig.Entity.COLLIDES.NEVER,type:ig.Entity.TYPE.A,size:new Vector2(48,48),fillColor:null,zIndex:95E3,clickedTime:0,isClicked:!1,pointer:null,init:function(b,c,d){this.parent(b,c,d);!ig.global.wm&&!isNaN(d.zIndex)&&(this.zIndex=d.zIndex);b=Math.floor(256*Math.random());c=Math.floor(256*Math.random());d=Math.floor(256*Math.random());this.fillColor="rgba("+ b+","+d+","+c+",1)";this.pointer=ig.game.getEntitiesByType(EntityPointer)[0]},update:function(){this.parent();this.isClicked&&(this.clickedTime+=ig.system.tick);0.5this.pos.x&&this.pointer.pos.xthis.pos.y&&this.pointer.pos.ythis.pos.x&&this.pointer.pos.xthis.pos.y&&this.pointer.pos.ythis.nextLevelTimer.delta()&&(ig.system.context.globalAlpha=-this.nextLevelTimer.delta()),this.drawOriginalShieldOpening())},updateOriginalShieldOpening:function(){this.initTimer&&0this.shieldAnim?(this.shieldAnim++,this.sheildTimer.reset()):(this.sheildTimer=null,this.moveTimer=new ig.Timer(0.001),this.mIconTimer=new ig.Timer(0.05),this.titleTimer=new ig.Timer(0.15)));this.moveTimer&&0this.mIconAnim?(this.mIconAnim++,this.moveTimer.reset()):this.mIconTimer= null);this.titleTimer&&0this.titleAnim?(this.titleAnim++,this.titleTimer.reset()):(this.titleTimer=null,this.nextLevelTimer=new ig.Timer(1)));this.nextLevelTimer&&0=g;g+=1)b.lineTo(0+800*Math.cos(2*g*Math.PI/48),0+800*Math.sin(2*g*Math.PI/48)),e++,2==e&&(e=0,b.lineTo(0,0));b.translate(-c,-d);c=b.createRadialGradient(c,d,100,c,d,250);c.addColorStop(0,"rgba(255,255,255,0.1)");c.addColorStop(1,"rgba(0,0,0,0)");b.fillStyle=c;b.fill();b.restore()}this.shieldImage.drawTile(ig.system.width/2-91,0-(768-ig.system.height)/2,this.shieldAnim,182,768);this.moveTimer&&(this.mIconImage.drawTile(ig.system.width/2-96,ig.system.height/2-70,this.mIconAnim, 166,160),this.titleImage.drawTile(ig.system.width/2-204,ig.system.height/2+100,this.titleAnim,409,76));ig.system.context.globalAlpha=1}})});ig.baked=!0; ig.module("game.entities.opening-kitty").requires("impact.entity").defines(function(){EntityOpeningKitty=ig.Entity.extend({size:{x:48,y:48},kittyAnim:-1,kittyImage:new ig.Image("media/graphics/opening/kitty.png"),kittyTitleImage:new ig.Image("media/graphics/opening/kittytitle.png"),soundKey:"kittyopeningSound",init:function(b,c,d){this.parent(b,c,d)},ready:function(){if(!ig.wm)if(_SETTINGS.DeveloperBranding.Splash.Enabled){this.initTimer=new ig.Timer(0.1);try{ig.soundHandler.sfxPlayer.play(this.soundKey)}catch(b){console.log(b)}}else ig.game.director.nextLevel(), ig.system.context.globalAlpha=1,this.kill()},update:function(){this.parent();this.updateKittyOpening()},draw:function(){this.parent();ig.global.wm||(this.nextLevelTimer&&0>this.nextLevelTimer.delta()&&(ig.system.context.globalAlpha=-this.nextLevelTimer.delta()),this.drawKittyOpening())},updateKittyOpening:function(){this.initTimer&&0this.kittyAnim?(this.kittyAnim++,this.kittyTimer.reset()): (this.kittyTimer=null,this.nextLevelTimer=new ig.Timer(2)));this.nextLevelTimer&&0c&&(c=this.objectArray[a].zIndex,b=this.objectArray[a]);if(null!=b)null!=this.hoveringItem?this.hoveringItem!=b&&("function"==typeof this.hoveringItem.leave&&this.hoveringItem.leave(), "function"==typeof b.over&&b.over()):"function"==typeof b.over&&b.over(),this.hoveringItem=b,this.clickObject(b),this.objectArray=[];else if(null!=this.hoveringItem&&"function"==typeof this.hoveringItem.leave&&(this.hoveringItem.leave(),this.hoveringItem=null),this.isReleased){for(b=0;b"):$("#"+g.id).html("");dynamicClickableEntityDivs[b]={};dynamicClickableEntityDivs[b].width=$("#"+g.id).width();dynamicClickableEntityDivs[b].height= $("#"+g.id).height();dynamicClickableEntityDivs[b].entity_pos_x=this.pos.x;dynamicClickableEntityDivs[b].entity_pos_y=this.pos.y},hovered:function(){this.isHovering=!0;this.dehoverOthers()},dehoverOthers:function(){var b=ig.game.getEntitiesByType(EntitySelect);for(i=0;ib;b++)ig.game.io.storage.set("SmileyShapesShapesCode"+b,null),ig.game.io.storage.set("SmileyShapesColorCode"+b,null),ig.game.io.storage.set("SmileyShapesSmileyCode"+b,null),ig.game.io.storage.set("SmileyShapesSizesCode"+b,null),ig.game.io.storage.set("SmileyShapesAnglesCode"+b,null),ig.game.io.storage.set("SmileyShapesShapesPosX"+b,null),ig.game.io.storage.set("SmileyShapesShapesPosY"+b,null),ig.game.io.storage.set("SmileyShapesShapesPosXThumbnail"+b,null),ig.game.io.storage.set("SmileyShapesShapesPosYThumbnail"+ b,null),ig.game.io.storage.set("SmileyShapesShapesZIndex"+b,null),ig.game.io.storage.set("SmileyShapesSmileyZIndex"+b,null)},saveAllShapes:function(){ig.game.io.storage.set("SmileyShapesShapesCode",this.shapesCode);ig.game.io.storage.set("SmileyShapesColorCode",this.colorCode);ig.game.io.storage.set("SmileyShapesSmileyCode",this.smileyCode);ig.game.io.storage.set("SmileyShapesSizesCode",this.sizesCode);ig.game.io.storage.set("SmileyShapesAnglesCode",this.anglesCode);ig.game.io.storage.set("SmileyShapesShapesPosX", this.shapesPosX);ig.game.io.storage.set("SmileyShapesShapesPosY",this.shapesPosY);ig.game.io.storage.set("SmileyShapesShapesPosXThumbnail",this.shapesPosXThumbnail);ig.game.io.storage.set("SmileyShapesShapesPosYThumbnail",this.shapesPosYThumbnail);ig.game.io.storage.set("SmileyShapesShapesZIndex",this.shapesZIndex);ig.game.io.storage.set("SmileyShapesSmileyZIndex",this.smileyZIndex)},saveAllShapesForGallery:function(){ig.game.createNew?ig.game.createNew&&(ig.game.io.storage.set("SmileyShapesShapesCode"+ ig.game.slotLength,this.shapesCode),ig.game.io.storage.set("SmileyShapesColorCode"+ig.game.slotLength,this.colorCode),ig.game.io.storage.set("SmileyShapesSmileyCode"+ig.game.slotLength,this.smileyCode),ig.game.io.storage.set("SmileyShapesSizesCode"+ig.game.slotLength,this.sizesCode),ig.game.io.storage.set("SmileyShapesAnglesCode"+ig.game.slotLength,this.anglesCode),ig.game.io.storage.set("SmileyShapesShapesPosX"+ig.game.slotLength,this.shapesPosX),ig.game.io.storage.set("SmileyShapesShapesPosY"+ig.game.slotLength, this.shapesPosY),ig.game.io.storage.set("SmileyShapesShapesPosXThumbnail"+ig.game.slotLength,this.shapesPosXThumbnail),ig.game.io.storage.set("SmileyShapesShapesPosYThumbnail"+ig.game.slotLength,this.shapesPosYThumbnail),ig.game.io.storage.set("SmileyShapesShapesZIndex"+ig.game.slotLength,this.shapesZIndex),ig.game.io.storage.set("SmileyShapesSmileyZIndex"+ig.game.slotLength,this.smileyZIndex),ig.game.slotLength++,ig.game.io.storage.set("SlotLengthSmileyShapes",ig.game.slotLength)):(ig.game.io.storage.set("SmileyShapesShapesCode"+ ig.game.loadedSlot,this.shapesCode),ig.game.io.storage.set("SmileyShapesColorCode"+ig.game.loadedSlot,this.colorCode),ig.game.io.storage.set("SmileyShapesSmileyCode"+ig.game.loadedSlot,this.smileyCode),ig.game.io.storage.set("SmileyShapesSizesCode"+ig.game.loadedSlot,this.sizesCode),ig.game.io.storage.set("SmileyShapesAnglesCode"+ig.game.loadedSlot,this.anglesCode),ig.game.io.storage.set("SmileyShapesShapesPosX"+ig.game.loadedSlot,this.shapesPosX),ig.game.io.storage.set("SmileyShapesShapesPosY"+ig.game.loadedSlot, this.shapesPosY),ig.game.io.storage.set("SmileyShapesShapesPosXThumbnail"+ig.game.loadedSlot,this.shapesPosXThumbnail),ig.game.io.storage.set("SmileyShapesShapesPosYThumbnail"+ig.game.loadedSlot,this.shapesPosYThumbnail),ig.game.io.storage.set("SmileyShapesShapesZIndex"+ig.game.loadedSlot,this.shapesZIndex),ig.game.io.storage.set("SmileyShapesSmileyZIndex"+ig.game.loadedSlot,this.smileyZIndex))},savingFullSlot:function(){ig.game.io.storage.set("SmileyShapesShapesCode12",this.shapesCode);ig.game.io.storage.set("SmileyShapesColorCode12", this.colorCode);ig.game.io.storage.set("SmileyShapesSmileyCode12",this.smileyCode);ig.game.io.storage.set("SmileyShapesSizesCode12",this.sizesCode);ig.game.io.storage.set("SmileyShapesAnglesCode12",this.anglesCode);ig.game.io.storage.set("SmileyShapesShapesPosX12",this.shapesPosX);ig.game.io.storage.set("SmileyShapesShapesPosY12",this.shapesPosY);ig.game.io.storage.set("SmileyShapesShapesPosXThumbnail12",this.shapesPosXThumbnail);ig.game.io.storage.set("SmileyShapesShapesPosYThumbnail12",this.shapesPosYThumbnail); ig.game.io.storage.set("SmileyShapesShapesZIndex12",this.shapesZIndex);ig.game.io.storage.set("SmileyShapesSmileyZIndex12",this.smileyZIndex);ig.game.io.storage.set("SlotLengthSmileyShapes",ig.game.slotLength)},loadAllShapesFromGallery:function(){null!=ig.game.io.storage.get("SmileyShapesShapesCode"+ig.game.loadedSlot)&&(this.shapesCode=ig.game.io.storage.get("SmileyShapesShapesCode"+ig.game.loadedSlot),this.shapesOnFrame=this.shapesCode.length);null!=ig.game.io.storage.get("SmileyShapesColorCode"+ ig.game.loadedSlot)&&(this.colorCode=ig.game.io.storage.get("SmileyShapesColorCode"+ig.game.loadedSlot));null!=ig.game.io.storage.get("SmileyShapesSmileyCode"+ig.game.loadedSlot)&&(this.smileyCode=ig.game.io.storage.get("SmileyShapesSmileyCode"+ig.game.loadedSlot));null!=ig.game.io.storage.get("SmileyShapesSizesCode"+ig.game.loadedSlot)&&(this.sizesCode=ig.game.io.storage.get("SmileyShapesSizesCode"+ig.game.loadedSlot));null!=ig.game.io.storage.get("SmileyShapesAnglesCode"+ig.game.loadedSlot)&&(this.anglesCode= ig.game.io.storage.get("SmileyShapesAnglesCode"+ig.game.loadedSlot));null!=ig.game.io.storage.get("SmileyShapesShapesPosX"+ig.game.loadedSlot)&&(this.shapesPosX=ig.game.io.storage.get("SmileyShapesShapesPosX"+ig.game.loadedSlot));null!=ig.game.io.storage.get("SmileyShapesShapesPosY"+ig.game.loadedSlot)&&(this.shapesPosY=ig.game.io.storage.get("SmileyShapesShapesPosY"+ig.game.loadedSlot));null!=ig.game.io.storage.get("SmileyShapesShapesPosXThumbnail"+ig.game.loadedSlot)&&(this.shapesPosXThumbnail= ig.game.io.storage.get("SmileyShapesShapesPosXThumbnail"+ig.game.loadedSlot));null!=ig.game.io.storage.get("SmileyShapesShapesPosYThumbnail"+ig.game.loadedSlot)&&(this.shapesPosYThumbnail=ig.game.io.storage.get("SmileyShapesShapesPosYThumbnail"+ig.game.loadedSlot));null!=ig.game.io.storage.get("SmileyShapesShapesZIndex"+ig.game.loadedSlot)&&(this.shapesZIndex=ig.game.io.storage.get("SmileyShapesShapesZIndex"+ig.game.loadedSlot));null!=ig.game.io.storage.get("SmileyShapesSmileyZIndex"+ig.game.loadedSlot)&& (this.smileyZIndex=ig.game.io.storage.get("SmileyShapesSmileyZIndex"+ig.game.loadedSlot))},loadAllShapes:function(){null!=ig.game.io.storage.get("SmileyShapesShapesCode")&&(this.shapesCode=ig.game.io.storage.get("SmileyShapesShapesCode"),this.shapesOnFrame=this.shapesCode.length);null!=ig.game.io.storage.get("SmileyShapesColorCode")&&(this.colorCode=ig.game.io.storage.get("SmileyShapesColorCode"));null!=ig.game.io.storage.get("SmileyShapesSmileyCode")&&(this.smileyCode=ig.game.io.storage.get("SmileyShapesSmileyCode")); null!=ig.game.io.storage.get("SmileyShapesSizesCode")&&(this.sizesCode=ig.game.io.storage.get("SmileyShapesSizesCode"));null!=ig.game.io.storage.get("SmileyShapesAnglesCode")&&(this.anglesCode=ig.game.io.storage.get("SmileyShapesAnglesCode"));null!=ig.game.io.storage.get("SmileyShapesShapesPosX")&&(this.shapesPosX=ig.game.io.storage.get("SmileyShapesShapesPosX"));null!=ig.game.io.storage.get("SmileyShapesShapesPosY")&&(this.shapesPosY=ig.game.io.storage.get("SmileyShapesShapesPosY"));null!=ig.game.io.storage.get("SmileyShapesShapesPosXThumbnail")&& (this.shapesPosXThumbnail=ig.game.io.storage.get("SmileyShapesShapesPosXThumbnail"));null!=ig.game.io.storage.get("SmileyShapesShapesPosYThumbnail")&&(this.shapesPosYThumbnail=ig.game.io.storage.get("SmileyShapesShapesPosYThumbnail"));null!=ig.game.io.storage.get("SmileyShapesShapesZIndex")&&(this.shapesZIndex=ig.game.io.storage.get("SmileyShapesShapesZIndex"));null!=ig.game.io.storage.get("SmileyShapesSmileyZIndex")&&(this.smileyZIndex=ig.game.io.storage.get("SmileyShapesSmileyZIndex"))},deleteAllShapes:function(){ig.game.io.storage.set("SmileyShapesShapesCode", null);ig.game.io.storage.set("SmileyShapesColorCode",null);ig.game.io.storage.set("SmileyShapesSmileyCode",null);ig.game.io.storage.set("SmileyShapesSizesCode",null);ig.game.io.storage.set("SmileyShapesAnglesCode",null);ig.game.io.storage.set("SmileyShapesShapesPosX",null);ig.game.io.storage.set("SmileyShapesShapesPosY",null);ig.game.io.storage.set("SmileyShapesShapesPosXThumbnail",null);ig.game.io.storage.set("SmileyShapesShapesPosYThumbnail",null);ig.game.io.storage.set("SmileyShapesShapesZIndex", null);ig.game.io.storage.set("SmileyShapesSmileyZIndex",null)},textSet:function(b,c){var d=ig.system.context;d.font=b+"px supersonic";d.fillStyle=c},textDraw:function(b,c,d){var e=ig.system.context;e.textAlign="center";e.fillText(b,c,d)},draw:function(){this.parent()},onPause:function(){console.log("pause");this.isPaused=!0},onUnpause:function(){console.log("resume");this.isPaused=!1}})});ig.baked=!0; ig.module("game.entities.menu-controller").requires("impact.entity","game.entities.buttons.button","game.entities.controller").defines(function(){LanscapeBackground=ig.Image.extend({resize:function(){},draw:function(){this.loaded&&ig.system.context.drawImage(this.data,0,0)}});EntityMenuController=EntityController.extend({gameTitle:null,soundButton:null,playButton:null,galleryButton:null,moreGamesButton:null,desktopBackground:new LanscapeBackground("media/graphics/sprites/main_bg.png"),init:function(b, c,d){this.parent(b,c,d);ig.global.wm||(this.gameTitle=ig.game.spawnEntity(EntityGameTitle,0,0),this.gameTitle.pos={x:0.5*ig.system.width-0.5*this.gameTitle.size.x,y:0.1*ig.system.height-0.5*this.gameTitle.size.y},this.soundButton=ig.game.spawnEntity(EntityButtonSound,0,0),this.soundButton.pos={x:0.94*ig.system.width-0.5*this.soundButton.size.x,y:-ig.system.height/2},this.playButton=ig.game.spawnEntity(EntityButtonPlay,0,0),this.playButton.pos={x:0.5*ig.system.width-0.5*this.playButton.size.x,y:2* ig.system.height},this.galleryButton=ig.game.spawnEntity(EntityButtonGallery,0,0),this.galleryButton.pos={x:ig.system.width+2*ig.system.width,y:0.8*ig.system.height-0.5*this.galleryButton.size.y},this.moreGamesButton=ig.game.spawnEntity(EntityButtonMoreGames,0.375*ig.system.width-0.5*this.galleryButton.size.x,0.8*ig.system.height-0.5*this.galleryButton.size.y),this.moreGamesButton.pos={x:-ig.system.width/2,y:0.8*ig.system.height-0.5*this.moreGamesButton.size.y},this.gameTitleTween(),ig.game.fromView= !1,ig.game.fromGallery=!1,ig.game.controller.deleteAllShapes(),ig.game.createNew=!1,ig.game.loadedSlot=0)},gameTitleTween:function(){this.gameTitle.tween({pos:{y:0.3*ig.system.height-0.5*this.gameTitle.size.y}},0.75,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){_SETTINGS.MoreGames.Enabled?this.playButtonTween():this.playButtonNoMoreGameTween();ig.soundHandler.sfxPlayer.play("buttonAnimation1")}.bind(this)}).start()},playButtonTween:function(){var b=0.65*ig.system.height-0.5*this.playButton.size.y, c=this.playButton.tween({pos:{y:b-20}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){this.moreGamesButtonTween();this.galleryButtonTween()}.bind(this)}),b=this.playButton.tween({pos:{y:b}},0.5,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){ig.soundHandler.sfxPlayer.play("buttonAnimation1")}.bind(this)});c.chain(b);c.start()},playButtonNoMoreGameTween:function(){var b=0.65*ig.system.height-0.5*this.playButton.size.y,c=0.425*ig.system.width-0.5*this.playButton.size.x, d=this.playButton.tween({pos:{x:c,y:b-20}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){this.galleryButtonNoMoreGameTween()}.bind(this)}),b=this.playButton.tween({pos:{x:c,y:b}},0.5,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){ig.soundHandler.sfxPlayer.play("buttonAnimation1")}.bind(this)});d.chain(b);d.start()},moreGamesButtonTween:function(){var b=0.375*ig.system.width-0.5*this.moreGamesButton.size.x,c=this.moreGamesButton.tween({pos:{x:b+20}},0.25, {easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}),b=this.moreGamesButton.tween({pos:{x:b}},0.5,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)});c.chain(b);c.start()},galleryButtonTween:function(){var b=0.625*ig.system.width-0.5*this.galleryButton.size.x,c=this.galleryButton.tween({pos:{x:b-20}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){ig.soundHandler.sfxPlayer.play("buttonAnimation1")}.bind(this)}),b=this.galleryButton.tween({pos:{x:b}}, 0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){this.soundButtonTween()}.bind(this)});c.chain(b);c.start()},galleryButtonNoMoreGameTween:function(){var b=0.65*ig.system.height-0.5*this.galleryButton.size.y,c=0.575*ig.system.width-0.5*this.galleryButton.size.x,d=this.galleryButton.tween({pos:{x:c-20,y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){ig.soundHandler.sfxPlayer.play("buttonAnimation1")}.bind(this)}),b=this.galleryButton.tween({pos:{x:c, y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){this.soundButtonTween()}.bind(this)});d.chain(b);d.start()},soundButtonTween:function(){var b=0.12*ig.system.height-0.5*this.soundButton.size.y,c=this.soundButton.tween({pos:{y:b+20}},0.5,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}),b=this.soundButton.tween({pos:{y:b}},0.5,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){ig.soundHandler.sfxPlayer.play("buttonAnimation1")}.bind(this)}); c.chain(b);c.start()},update:function(){this.parent();ig.game.controller.enableTutorialIsCLicked&&_SETTINGS.MoreGames.Enabled&&this.moreGamesButton.hide()},draw:function(){this.parent();this.desktopBackground.draw()}});EntityGameTitle=ig.Entity.extend({zIndex:3,size:{x:765,y:271},fadeTime:0,animSheet:new ig.AnimationSheet("media/graphics/sprites/title.png",765,271),init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0]);this.currentAnim.alpha=0},update:function(){this.parent();1>=this.fadeTime&& (this.fadeTime+=ig.system.tick);this.currentAnim.alpha=this.fadeTime},draw:function(){this.parent()}});EntityEnableTutorial=EntityButton.extend({zIndex:4001,size:{x:434,y:344},animSheet:new ig.AnimationSheet("media/graphics/sprites/popup_frame2.png",434,344),init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent()},draw:function(){this.parent();this.textSet(38,"rgb(72, 22, 13)");this.textDraw(_STRINGS.Tutorial.Tutorial0,this.pos.x+0.5*this.size.x,this.pos.y+ 0.6*this.size.y)}});EntityTransparentScreenEnableTutorial=EntityButton.extend({type:ig.Entity.TYPE.D,zIndex:4E3,size:{x:960,y:540},init:function(b,c,d){this.parent(b,c,d)},update:function(){this.parent()},draw:function(){this.parent();var b=canvas.getContext("2d");b.fillStyle="rgba(0, 0, 0, 0.85)";ig.game.controller.enableTutorialIsCLicked?b.fillRect(0,0,960,540):b.fillRect(2*ig.system.width,2*ig.system.height,960,540)}});EntityButtonYesEnableTutorial=EntityButton.extend({zIndex:4002,chipID:0,size:{x:106, y:105},animSheet:new ig.AnimationSheet("media/graphics/sprites/button_frame.png",106,105),chipOn:!1,sc:0.5,name:"button yes",init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent()},draw:function(){this.parent();this.textSet(this.size.x/3.5,"rgb(255, 255, 255)");this.textDraw(_STRINGS.Game.Yes,this.pos.x+0.5*this.size.x,this.pos.y+0.615*this.size.y)},check:function(){},clicked:function(){this.runClickingTime();ig.soundHandler.sfxPlayer.play("buttonSound"); this.setScale(1.2,1.2)},released:function(){this.disableClickingTime();this.setScale(1,1);ig.game.controller.settingIsClicked=!1;ig.game.doneTutorial=0;ig.game.fromView=!1;ig.game.fromGallery=!1;ig.game.createNew=!0;ig.game.director.jumpTo(LevelGame)}});EntityButtonNoEnableTutorial=EntityButton.extend({zIndex:4002,chipID:0,size:{x:106,y:105},animSheet:new ig.AnimationSheet("media/graphics/sprites/button_frame.png",106,105),chipOn:!1,sc:0.5,name:"button No",init:function(b,c,d){this.parent(b,c,d); this.addAnim("default",1,[0])},update:function(){this.parent()},draw:function(){this.parent();this.textSet(this.size.x/3.5,"rgb(255, 255, 255)");this.textDraw(_STRINGS.Game.No,this.pos.x+0.5*this.size.x,this.pos.y+0.615*this.size.y)},check:function(){},clicked:function(){this.runClickingTime();ig.soundHandler.sfxPlayer.play("buttonSound");this.setScale(1.2,1.2)},released:function(){this.disableClickingTime();this.setScale(1,1);ig.game.controller.settingIsClicked=!1;ig.game.doneTutorial=1;ig.game.io.storage.set("donetutorial", ig.game.doneTutorial);ig.game.fromView=!1;ig.game.fromGallery=!1;ig.game.createNew=!0;ig.game.director.jumpTo(LevelGame)}});EntityButtonPlay=EntityButton.extend({zIndex:3,transparentScreen:null,enableTutorialFrame:null,buttonYes:null,buttonNo:null,chipID:0,size:{x:117,y:117},animSheet:new ig.AnimationSheet("media/graphics/sprites/play_btn.png",117,117),chipOn:!1,sc:0.5,name:"button play",init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0]);this.transparentScreen=ig.game.spawnEntity(EntityTransparentScreenEnableTutorial, 2*ig.system.width,2*ig.system.height);this.enableTutorialFrame=ig.game.spawnEntity(EntityEnableTutorial,2*ig.system.width,2*ig.system.height);this.buttonYes=ig.game.spawnEntity(EntityButtonYesEnableTutorial,2*ig.system.width,2*ig.system.height);this.buttonNo=ig.game.spawnEntity(EntityButtonNoEnableTutorial,2*ig.system.width,2*ig.system.height)},update:function(){this.parent();ig.game.controller.enableTutorialIsCLicked&&(this.enableTutorialFrame.pos={x:0.5*ig.system.width-0.5*this.enableTutorialFrame.size.x, y:0.45*ig.system.height-0.5*this.enableTutorialFrame.size.y},this.buttonYes.pos={x:this.enableTutorialFrame.pos.x+0.3*this.enableTutorialFrame.size.x-0.5*this.buttonYes.size.x,y:this.enableTutorialFrame.pos.y+0.95*this.enableTutorialFrame.size.y-0.5*this.buttonYes.size.y},this.buttonNo.pos={x:this.enableTutorialFrame.pos.x+0.7*this.enableTutorialFrame.size.x-0.5*this.buttonNo.size.x,y:this.enableTutorialFrame.pos.y+0.95*this.enableTutorialFrame.size.y-0.5*this.buttonNo.size.y})},draw:function(){this.parent()}, check:function(){},clicked:function(){this.runClickingTime();ig.soundHandler.sfxPlayer.play("buttonSound");this.setScale(1.2,1.2)},released:function(){this.disableClickingTime();this.setScale(1,1);0==ig.game.doneTutorial?(ig.game.createNew=!0,ig.game.director.jumpTo(LevelGame)):ig.game.controller.enableTutorialIsCLicked=!0}});EntityButtonGallery=EntityButton.extend({zIndex:3,chipID:0,size:{x:78,y:79},animSheet:new ig.AnimationSheet("media/graphics/sprites/gallery_btn.png",78,79),chipOn:!1,sc:0.5, name:"button galley",init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent()},draw:function(){this.parent()},check:function(){},clicked:function(){ig.game.controller.enableTutorialIsCLicked||(this.runClickingTime(),ig.soundHandler.sfxPlayer.play("buttonSound"),this.setScale(1.2,1.2))},released:function(){ig.game.controller.enableTutorialIsCLicked||(this.disableClickingTime(),ig.game.director.jumpTo(LevelGallery),this.setScale(1,1))}})});ig.baked=!0; ig.module("game.entities.gallery-controller").requires("impact.entity","game.entities.buttons.button","game.entities.controller").defines(function(){LanscapeBackground=ig.Image.extend({resize:function(){},draw:function(){this.loaded&&ig.system.context.drawImage(this.data,0,0)}});EntityGalleryController=EntityController.extend({galleryFrames:null,settingButton:null,homeButtonSmall:null,editDrawingButton:null,addDrawingButton:null,trashButton:null,desktopBackground:new LanscapeBackground("media/graphics/sprites/background.png"), init:function(b,c,d){this.parent(b,c,d);ig.global.wm||(this.galleryFrames=ig.game.spawnEntity(EntityGalleryFrames,0,0),this.settingButton=ig.game.spawnEntity(EntityButtonSetting,0,0),this.settingButton.pos={x:0.05*ig.system.width-0.5*this.settingButton.size.x,y:-ig.system.height/2},this.homeButtonSmall=ig.game.spawnEntity(EntityButtonHomeSmall,0,0),this.homeButtonSmall.pos={x:0.95*ig.system.width-0.5*this.homeButtonSmall.size.x,y:-ig.system.height/2},this.addDrawingButton=ig.game.spawnEntity(EntityButtonAddDrawing, 0,0),this.addDrawingButton.pos={x:0.37*ig.system.width-0.5*this.addDrawingButton.size.x,y:2*ig.system.height},this.editDrawingButton=ig.game.spawnEntity(EntityButtonEditDrawing,0,0),this.editDrawingButton.pos={x:0.5*ig.system.width-0.5*this.editDrawingButton.size.x,y:2*ig.system.height},this.trashButton=ig.game.spawnEntity(EntityButtonTrash,0,0),this.trashButton.pos={x:0.625*ig.system.width-0.5*this.trashButton.size.x,y:2*ig.system.height},this.settingButtonTween(),this.homeSmallButtonTween(),this.editDrawingButtonTween(), this.trashButtonTween(),this.addDrawingButtonTween(),ig.game.controller.isInGallery=!0,ig.game.loadedSlot=0)},settingButtonTween:function(){var b=0.095*ig.system.height-0.5*this.settingButton.size.y,c=this.settingButton.tween({pos:{y:b+50}},0.5,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){ig.soundHandler.sfxPlayer.play("buttonAnimation1")}.bind(this)}),b=this.settingButton.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}); c.chain(b);c.start()},homeSmallButtonTween:function(){var b=0.095*ig.system.height-0.5*this.settingButton.size.y,c=this.homeButtonSmall.tween({pos:{y:b+50}},0.5,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}),b=this.homeButtonSmall.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)});c.chain(b);c.start()},addDrawingButtonTween:function(){var b=0.865*ig.system.height-0.5*this.addDrawingButton.size.y,c=this.addDrawingButton.tween({pos:{y:b- 50}},0.5,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}),b=this.addDrawingButton.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)});c.chain(b);c.start()},editDrawingButtonTween:function(){var b=0.865*ig.system.height-0.5*this.editDrawingButton.size.y,c=this.editDrawingButton.tween({pos:{y:b-50}},0.5,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){ig.soundHandler.sfxPlayer.play("buttonAnimation1")}.bind(this)}), b=this.editDrawingButton.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)});c.chain(b);c.start()},trashButtonTween:function(){var b=0.865*ig.system.height-0.5*this.trashButton.size.y,c=this.trashButton.tween({pos:{y:b-50}},0.5,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}),b=this.trashButton.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){this.galleryFrames.isFadding=!0}.bind(this)}); c.chain(b);c.start()},update:function(){this.parent();null==ig.game.controller.slot1&&(ig.game.loadedSlot=0)},draw:function(){this.parent();this.desktopBackground.draw()}});EntityGalleryFrames=ig.Entity.extend({zIndex:3,size:{x:960,y:540},fadeTime:0,isFadding:!1,slot1Spawned:!1,slot2Spawned:!1,slot3Spawned:!1,slot4Spawned:!1,slot5Spawned:!1,slot6Spawned:!1,slot7Spawned:!1,slot8Spawned:!1,slot9Spawned:!1,slot10Spawned:!1,slot11Spawned:!1,slot12Spawned:!1,animSheet:new ig.AnimationSheet("media/graphics/sprites/gallery_frames.png", 960,540),init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0]);this.currentAnim.alpha=0;ig.game.controller.loadGallery()},update:function(){this.parent();this.isFadding&&1>=this.fadeTime&&(this.fadeTime+=ig.system.tick);this.currentAnim.alpha=this.fadeTime;null!=ig.game.controller.slot1&&(ig.game.controller.slot1.currentAnim.alpha=this.fadeTime,ig.game.controller.slotSpawned.slot1Check||(ig.game.controller.slot1.spawnAllShapes(),ig.game.controller.slotSpawned.slot1Check=!0));null!= ig.game.controller.slot2&&(ig.game.controller.slot2.currentAnim.alpha=this.fadeTime,ig.game.controller.slotSpawned.slot2Check||(ig.game.controller.slot2.spawnAllShapes(),ig.game.controller.slotSpawned.slot2Check=!0));null!=ig.game.controller.slot3&&(ig.game.controller.slot3.currentAnim.alpha=this.fadeTime,ig.game.controller.slotSpawned.slot3Check||(ig.game.controller.slot3.spawnAllShapes(),ig.game.controller.slotSpawned.slot3Check=!0));null!=ig.game.controller.slot4&&(ig.game.controller.slot4.currentAnim.alpha= this.fadeTime,ig.game.controller.slotSpawned.slot4Check||(ig.game.controller.slot4.spawnAllShapes(),ig.game.controller.slotSpawned.slot4Check=!0));null!=ig.game.controller.slot5&&(ig.game.controller.slot5.currentAnim.alpha=this.fadeTime,ig.game.controller.slotSpawned.slot5Check||(ig.game.controller.slot5.spawnAllShapes(),ig.game.controller.slotSpawned.slot5Check=!0));null!=ig.game.controller.slot6&&(ig.game.controller.slot6.currentAnim.alpha=this.fadeTime,ig.game.controller.slotSpawned.slot6Check|| (ig.game.controller.slot6.spawnAllShapes(),ig.game.controller.slotSpawned.slot6Check=!0));null!=ig.game.controller.slot7&&(ig.game.controller.slot7.currentAnim.alpha=this.fadeTime,ig.game.controller.slotSpawned.slot7Check||(ig.game.controller.slot7.spawnAllShapes(),ig.game.controller.slotSpawned.slot7Check=!0));null!=ig.game.controller.slot8&&(ig.game.controller.slot8.currentAnim.alpha=this.fadeTime,ig.game.controller.slotSpawned.slot8Check||(ig.game.controller.slot8.spawnAllShapes(),ig.game.controller.slotSpawned.slot8Check= !0));null!=ig.game.controller.slot9&&(ig.game.controller.slot9.currentAnim.alpha=this.fadeTime,ig.game.controller.slotSpawned.slot9Check||(ig.game.controller.slot9.spawnAllShapes(),ig.game.controller.slotSpawned.slot9Check=!0));null!=ig.game.controller.slot10&&(ig.game.controller.slot10.currentAnim.alpha=this.fadeTime,ig.game.controller.slotSpawned.slot10Check||(ig.game.controller.slot10.spawnAllShapes(),ig.game.controller.slotSpawned.slot10Check=!0));null!=ig.game.controller.slot11&&(ig.game.controller.slot11.currentAnim.alpha= this.fadeTime,ig.game.controller.slotSpawned.slot11Check||(ig.game.controller.slot11.spawnAllShapes(),ig.game.controller.slotSpawned.slot11Check=!0));null!=ig.game.controller.slot12&&(ig.game.controller.slot12.currentAnim.alpha=this.fadeTime,ig.game.controller.slotSpawned.slot12Check||(ig.game.controller.slot12.spawnAllShapes(),ig.game.controller.slotSpawned.slot12Check=!0));0.99this.pos.x&&this.pointer.pos.xthis.pos.y&&this.pointer.pos.ythis.pos.x&&this.pointer.pos.xthis.pos.y&&this.pointer.pos.ythis.pos.x&&this.pointer.pos.xthis.pos.y&&this.pointer.pos.yg&&0g&&0b?b*c>>7:255-((255-c)*(255-b)>>7)},Fsoftlight:function(b,c){var d=c<<1;return 128>c?b*(d+(b*(255-d)>>8))>>8:b*(511-d)+Math.sqrt(b<<8)*(d-255)>>8}})});ig.baked=!0; ig.module("game.entities.fake-shapes").requires("impact.entity","game.entities.controller").defines(function(){EntityFakeShapes=ig.Entity.extend({init:function(b,c,d){this.parent(b,c,d)},update:function(){this.parent()}});EntityCircleShapeFake=EntityButton.extend({zIndex:4,chipID:0,size:{x:210,y:210},smileyImage:null,colorID:0,animSheet:new ig.AnimationSheet("media/graphics/sprites/circle_shape.png",210,210),chipOn:!1,sc:0.5,name:"circle shape fake",init:function(b,c,d){this.parent(b,c,d);this.addAnim("default", 1,[0]);this.addAnim("red",1,[1]);this.addAnim("orange",1,[2]);this.addAnim("yellow",1,[3]);this.addAnim("violet",1,[4]);this.addAnim("green",1,[5]);this.addAnim("blue",1,[6])},update:function(){this.parent();0==this.colorID?this.currentAnim=this.anims.default:1==this.colorID?this.currentAnim=this.anims.red:2==this.colorID?this.currentAnim=this.anims.orange:3==this.colorID?this.currentAnim=this.anims.yellow:4==this.colorID?this.currentAnim=this.anims.violet:5==this.colorID?this.currentAnim=this.anims.green: 6==this.colorID&&(this.currentAnim=this.anims.blue)}});EntityHeartShapeFake=EntityButton.extend({zIndex:4,chipID:0,size:{x:210,y:210},colorID:0,smileyImage:null,animSheet:new ig.AnimationSheet("media/graphics/sprites/heart_shape.png",210,210),chipOn:!1,sc:0.5,name:"heart shape fake",init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0]);this.addAnim("red",1,[1]);this.addAnim("orange",1,[2]);this.addAnim("yellow",1,[3]);this.addAnim("violet",1,[4]);this.addAnim("green",1,[5]);this.addAnim("blue", 1,[6])},update:function(){this.parent();0==this.colorID?this.currentAnim=this.anims.default:1==this.colorID?this.currentAnim=this.anims.red:2==this.colorID?this.currentAnim=this.anims.orange:3==this.colorID?this.currentAnim=this.anims.yellow:4==this.colorID?this.currentAnim=this.anims.violet:5==this.colorID?this.currentAnim=this.anims.green:6==this.colorID&&(this.currentAnim=this.anims.blue)}});EntityMoonShapeFake=EntityButton.extend({zIndex:4,chipID:0,size:{x:210,y:210},smileyImage:null,colorID:0, objectScalling:{scaleX:0.6,scaleY:0.6},animSheet:new ig.AnimationSheet("media/graphics/sprites/moon_shape.png",210,210),chipOn:!1,sc:0.5,name:"moon shape fake",init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0]);this.addAnim("red",1,[1]);this.addAnim("orange",1,[2]);this.addAnim("yellow",1,[3]);this.addAnim("violet",1,[4]);this.addAnim("green",1,[5]);this.addAnim("blue",1,[6])},update:function(){this.parent();0==this.colorID?this.currentAnim=this.anims.default:1==this.colorID?this.currentAnim= this.anims.red:2==this.colorID?this.currentAnim=this.anims.orange:3==this.colorID?this.currentAnim=this.anims.yellow:4==this.colorID?this.currentAnim=this.anims.violet:5==this.colorID?this.currentAnim=this.anims.green:6==this.colorID&&(this.currentAnim=this.anims.blue)}});EntityRectangleShapeFake=EntityButton.extend({zIndex:4,chipID:0,size:{x:210,y:210},colorID:0,smileyImage:null,animSheet:new ig.AnimationSheet("media/graphics/sprites/rectangle_shape.png",210,210),chipOn:!1,sc:0.5,name:"rectangle shape fake", init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0]);this.addAnim("red",1,[1]);this.addAnim("orange",1,[2]);this.addAnim("yellow",1,[3]);this.addAnim("violet",1,[4]);this.addAnim("green",1,[5]);this.addAnim("blue",1,[6])},update:function(){this.parent();0==this.colorID?this.currentAnim=this.anims.default:1==this.colorID?this.currentAnim=this.anims.red:2==this.colorID?this.currentAnim=this.anims.orange:3==this.colorID?this.currentAnim=this.anims.yellow:4==this.colorID?this.currentAnim= this.anims.violet:5==this.colorID?this.currentAnim=this.anims.green:6==this.colorID&&(this.currentAnim=this.anims.blue)}});EntityStarShapeFake=EntityButton.extend({zIndex:4,chipID:0,size:{x:210,y:210},smileyImage:null,colorID:0,animSheet:new ig.AnimationSheet("media/graphics/sprites/star_shape.png",210,210),chipOn:!1,sc:0.5,name:"star shape fake",init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0]);this.addAnim("red",1,[1]);this.addAnim("orange",1,[2]);this.addAnim("yellow",1,[3]); this.addAnim("violet",1,[4]);this.addAnim("green",1,[5]);this.addAnim("blue",1,[6])},update:function(){this.parent();0==this.colorID?this.currentAnim=this.anims.default:1==this.colorID?this.currentAnim=this.anims.red:2==this.colorID?this.currentAnim=this.anims.orange:3==this.colorID?this.currentAnim=this.anims.yellow:4==this.colorID?this.currentAnim=this.anims.violet:5==this.colorID?this.currentAnim=this.anims.green:6==this.colorID&&(this.currentAnim=this.anims.blue)}});EntityTriangleShapeFake=EntityButton.extend({zIndex:4, chipID:0,size:{x:210,y:210},smileyImage:null,colorID:0,animSheet:new ig.AnimationSheet("media/graphics/sprites/triangle_shape.png",210,210),chipOn:!1,sc:0.5,name:"triangle shape fake",init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0]);this.addAnim("red",1,[1]);this.addAnim("orange",1,[2]);this.addAnim("yellow",1,[3]);this.addAnim("violet",1,[4]);this.addAnim("green",1,[5]);this.addAnim("blue",1,[6])},update:function(){this.parent();0==this.colorID?this.currentAnim=this.anims.default: 1==this.colorID?this.currentAnim=this.anims.red:2==this.colorID?this.currentAnim=this.anims.orange:3==this.colorID?this.currentAnim=this.anims.yellow:4==this.colorID?this.currentAnim=this.anims.violet:5==this.colorID?this.currentAnim=this.anims.green:6==this.colorID&&(this.currentAnim=this.anims.blue)}});EntitySmiley1Fake=ig.Entity.extend({zIndex:5,size:{x:210,y:210},animSheet:new ig.AnimationSheet("media/graphics/sprites/smiley1.png",210,210),init:function(b,c,d){this.parent(b,c,d);this.addAnim("default", 1,[0]);this.addAnim("triangle",1,[1]);this.addAnim("star",1,[2]);this.addAnim("moon",1,[3])},update:function(){this.parent()}});EntitySmiley2Fake=ig.Entity.extend({zIndex:5,size:{x:210,y:210},animSheet:new ig.AnimationSheet("media/graphics/sprites/smiley2.png",210,210),init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0]);this.addAnim("triangle",1,[1]);this.addAnim("star",1,[2]);this.addAnim("moon",1,[3])},update:function(){this.parent()}});EntitySmiley3Fake=ig.Entity.extend({zIndex:5, size:{x:210,y:210},animSheet:new ig.AnimationSheet("media/graphics/sprites/smiley3.png",210,210),init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0]);this.addAnim("triangle",1,[1]);this.addAnim("star",1,[2]);this.addAnim("moon",1,[3])},update:function(){this.parent()}});EntitySmiley4Fake=ig.Entity.extend({zIndex:5,size:{x:210,y:210},animSheet:new ig.AnimationSheet("media/graphics/sprites/smiley4.png",210,210),init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0]);this.addAnim("triangle", 1,[1]);this.addAnim("star",1,[2]);this.addAnim("moon",1,[3])},update:function(){this.parent()}});EntitySmiley5Fake=ig.Entity.extend({zIndex:5,size:{x:210,y:210},animSheet:new ig.AnimationSheet("media/graphics/sprites/smiley5.png",210,210),init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0]);this.addAnim("triangle",1,[1]);this.addAnim("star",1,[2]);this.addAnim("moon",1,[3])},update:function(){this.parent()}});EntitySmiley6Fake=ig.Entity.extend({zIndex:5,size:{x:210,y:210},animSheet:new ig.AnimationSheet("media/graphics/sprites/smiley6.png", 210,210),init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0]);this.addAnim("triangle",1,[1]);this.addAnim("star",1,[2]);this.addAnim("moon",1,[3])},update:function(){this.parent()}})});ig.baked=!0; ig.module("game.entities.game-controller").requires("impact.entity","game.entities.buttons.button","plugins.image-manipulation","game.entities.controller","game.entities.fake-shapes").defines(function(){LanscapeBackground=ig.Image.extend({resize:function(){},draw:function(){this.loaded&&ig.system.context.drawImage(this.data,0,0)}});EntityGameController=EntityController.extend({canvasBoard:null,shapeSelectionBoxRight:null,shapeSelectionBoxLeft:null,settingButton:null,doneButton:null,editingToolBox:null, size1Button:null,size2Button:null,size3Button:null,size4Button:null,size5Button:null,rotateButton:null,eraserButton:null,resetButton:null,backButton:null,redButton:null,orangeButton:null,yellowButton:null,violetButton:null,greenButton:null,blueButton:null,starButton:null,triangleButton:null,circleButton:null,loveButton:null,moonButton:null,rectangleButton:null,smiley1Button:null,smiley2Button:null,smiley3Button:null,smiley4Button:null,smiley5Button:null,smiley6Button:null,tutorialText:null,isTutorialTime:!1, tutorialTime:1,tutorialMusicIsPlaying:!1,shapeHint:null,desktopBackground:new LanscapeBackground("media/graphics/sprites/background.png"),loadNow:!1,isLoaded:!1,init:function(b,c,d){this.parent(b,c,d);if(!ig.global.wm&&(this.canvasBoard=ig.game.spawnEntity(EntityCanvasBoard,0,0),this.canvasBoard.pos={x:0.5*ig.system.width-0.5*this.canvasBoard.size.x,y:0.5*ig.system.height-0.5*this.canvasBoard.size.y},ig.game.controller.canvasBoardPosition.x=this.canvasBoard.pos.x,ig.game.controller.canvasBoardPosition.y= this.canvasBoard.pos.y,this.shapeSelectionBoxRight=ig.game.spawnEntity(EntityShapeSelectionBox,0,0),this.shapeSelectionBoxRight.pos={x:ig.system.width+2*ig.system.width,y:0.5*ig.system.height-0.5*this.shapeSelectionBoxRight.size.y},this.shapeSelectionBoxLeft=ig.game.spawnEntity(EntityShapeSelectionBox,0,0),this.shapeSelectionBoxLeft.pos={x:-ig.system.width/2,y:0.5*ig.system.height-0.5*this.shapeSelectionBoxLeft.size.y},this.settingButton=ig.game.spawnEntity(EntityButtonSetting,0,0),this.settingButton.pos= {x:0.05*ig.system.width-0.5*this.settingButton.size.x,y:-ig.system.height/2},this.doneButton=ig.game.spawnEntity(EntityButtonDone,0,0),this.doneButton.pos={x:0.91*ig.system.width-0.5*this.doneButton.size.x,y:2*ig.system.height},this.editingToolBox=ig.game.spawnEntity(EntityEditingToolBox,0,0),this.editingToolBox.pos={x:0.385*ig.system.width-0.5*this.editingToolBox.size.x,y:2*ig.system.height},this.size1Button=ig.game.spawnEntity(EntityButtonSize1,2*ig.system.width,2*ig.system.height),this.size2Button= ig.game.spawnEntity(EntityButtonSize2,2*ig.system.width,2*ig.system.height),this.size3Button=ig.game.spawnEntity(EntityButtonSize3,2*ig.system.width,2*ig.system.height),this.size4Button=ig.game.spawnEntity(EntityButtonSize4,2*ig.system.width,2*ig.system.height),this.size5Button=ig.game.spawnEntity(EntityButtonSize5,2*ig.system.width,2*ig.system.height),this.rotateButton=ig.game.spawnEntity(EntityButtonRotate,0,0),this.rotateButton.pos={x:0.575*ig.system.width-0.5*this.rotateButton.size.x,y:2*ig.system.height}, this.eraserButton=ig.game.spawnEntity(EntityButtonEraser,0,0),this.eraserButton.pos={x:0.65*ig.system.width-0.5*this.eraserButton.size.x,y:2*ig.system.height},this.resetButton=ig.game.spawnEntity(EntityButtonReset,0,0),this.resetButton.pos={x:0.09*ig.system.width-0.5*this.resetButton.size.x,y:2*ig.system.height},this.backButton=ig.game.spawnEntity(EntityButtonBack,0,0),this.backButton.pos={x:0.725*ig.system.width-0.5*this.resetButton.size.x,y:2*ig.system.height},this.redButton=ig.game.spawnEntity(EntityButtonRed, 0,0),this.redButton.pos={x:0.31*ig.system.width-0.5*this.redButton.size.x,y:-ig.system.height/2},this.orangeButton=ig.game.spawnEntity(EntityButtonOrange,0,0),this.orangeButton.pos={x:0.385*ig.system.width-0.5*this.orangeButton.size.x,y:-ig.system.height/2},this.yellowButton=ig.game.spawnEntity(EntityButtonYellow,0,0),this.yellowButton.pos={x:0.46*ig.system.width-0.5*this.yellowButton.size.x,y:-ig.system.height/2},this.violetButton=ig.game.spawnEntity(EntityButtonViolet,0,0),this.violetButton.pos= {x:0.535*ig.system.width-0.5*this.violetButton.size.x,y:-ig.system.height/2},this.greenButton=ig.game.spawnEntity(EntityButtonGreen,0,0),this.greenButton.pos={x:0.61*ig.system.width-0.5*this.greenButton.size.x,y:-ig.system.height/2},this.blueButton=ig.game.spawnEntity(EntityButtonBlue,0,0),this.blueButton.pos={x:0.685*ig.system.width-0.5*this.blueButton.size.x,y:-ig.system.height/2},this.starButton=ig.game.spawnEntity(EntityButtonStar,-ig.system.width/2,-ig.system.height/2),this.triangleButton=ig.game.spawnEntity(EntityButtonTriangle, -ig.system.width/2,-ig.system.height/2),this.circleButton=ig.game.spawnEntity(EntityButtonCircle,-ig.system.width/2,-ig.system.height/2),this.loveButton=ig.game.spawnEntity(EntityButtonLove,-ig.system.width/2,-ig.system.height/2),this.moonButton=ig.game.spawnEntity(EntityButtonMoon,-ig.system.width/2,-ig.system.height/2),this.rectangleButton=ig.game.spawnEntity(EntityButtonRectangle,-ig.system.width/2,-ig.system.height/2),this.smiley1Button=ig.game.spawnEntity(EntityButtonSmiley1,ig.system.width+ 2*ig.system.width,ig.system.height+2*ig.system.height),this.smiley2Button=ig.game.spawnEntity(EntityButtonSmiley2,ig.system.width+2*ig.system.width,ig.system.height+2*ig.system.height),this.smiley3Button=ig.game.spawnEntity(EntityButtonSmiley3,ig.system.width+2*ig.system.width,ig.system.height+2*ig.system.height),this.smiley4Button=ig.game.spawnEntity(EntityButtonSmiley4,ig.system.width+2*ig.system.width,ig.system.height+2*ig.system.height),this.smiley5Button=ig.game.spawnEntity(EntityButtonSmiley5, ig.system.width+2*ig.system.width,ig.system.height+2*ig.system.height),this.smiley6Button=ig.game.spawnEntity(EntityButtonSmiley6,ig.system.width+2*ig.system.width,ig.system.height+2*ig.system.height),this.shapeSelectionBoxLeftTween(),this.shapeSelectionBoxRightTween(),0==ig.game.doneTutorial?(this.tutorialText=ig.game.spawnEntity(EntityTutorialText,0,0),this.tutorialText.pos={x:2*ig.system.width,y:2*ig.system.height}):ig.game.controller.enableDragging=!0,this.shapeHint=ig.game.spawnEntity(EntityShapeHint, 0,0),this.shapeHint.pos={x:2*ig.system.width,y:2*ig.system.height},ig.game.fromGallery||ig.game.fromView))ig.game.controller.shapeIsAvailable=!0},loadShapesStates:function(b){if(null==ig.game.controller.sizesCode[b]||0==ig.game.controller.sizesCode[b])ig.game.controller.allShapesOnFrame[b].objectScalling.scaleX=0.6,ig.game.controller.allShapesOnFrame[b].objectScalling.scaleY=0.6,ig.game.controller.allShapesOnFrame[b].scaleShape(),ig.game.controller.allShapesOnFrame[b].pos={x:ig.game.controller.shapesPosX[b], y:ig.game.controller.shapesPosY[b]};0.6==ig.game.controller.sizesCode[b]&&(ig.game.controller.allShapesOnFrame[b].objectScalling.scaleX=0.6,ig.game.controller.allShapesOnFrame[b].objectScalling.scaleY=0.6,ig.game.controller.allShapesOnFrame[b].scaleShape(),ig.game.controller.allShapesOnFrame[b].pos={x:ig.game.controller.shapesPosX[b],y:ig.game.controller.shapesPosY[b]});0.8==ig.game.controller.sizesCode[b]&&(ig.game.controller.allShapesOnFrame[b].objectScalling.scaleX=0.8,ig.game.controller.allShapesOnFrame[b].objectScalling.scaleY= 0.8,ig.game.controller.allShapesOnFrame[b].scaleShape(),ig.game.controller.allShapesOnFrame[b].pos={x:ig.game.controller.shapesPosX[b],y:ig.game.controller.shapesPosY[b]});1==ig.game.controller.sizesCode[b]&&(ig.game.controller.allShapesOnFrame[b].objectScalling.scaleX=1,ig.game.controller.allShapesOnFrame[b].objectScalling.scaleY=1,ig.game.controller.allShapesOnFrame[b].scaleShape(),ig.game.controller.allShapesOnFrame[b].pos={x:ig.game.controller.shapesPosX[b],y:ig.game.controller.shapesPosY[b]}); 0.4==ig.game.controller.sizesCode[b]&&(ig.game.controller.allShapesOnFrame[b].objectScalling.scaleX=0.4,ig.game.controller.allShapesOnFrame[b].objectScalling.scaleY=0.4,ig.game.controller.allShapesOnFrame[b].scaleShape(),ig.game.controller.allShapesOnFrame[b].pos={x:ig.game.controller.shapesPosX[b],y:ig.game.controller.shapesPosY[b]});0.2==ig.game.controller.sizesCode[b]&&(ig.game.controller.allShapesOnFrame[b].objectScalling.scaleX=0.2,ig.game.controller.allShapesOnFrame[b].objectScalling.scaleY= 0.2,ig.game.controller.allShapesOnFrame[b].scaleShape(),ig.game.controller.allShapesOnFrame[b].pos={x:ig.game.controller.shapesPosX[b],y:ig.game.controller.shapesPosY[b]});ig.game.controller.allShapesOnFrame[b].shapeAngle=null==ig.game.controller.anglesCode[b]||0==ig.game.controller.anglesCode[b]?0:ig.game.controller.anglesCode[b];ig.game.controller.allShapesOnFrame[b].colorID=ig.game.controller.colorCode[b]},update:function(){this.parent();if(this.loadNow&&!this.isLoaded){if(null!=ig.game.controller.shapesCode)for(var b= 0;bthis.tutorialTime&&(this.tutorialMusicIsPlaying||(ig.soundHandler.sfxPlayer.play("buttonAnimation1"), this.tutorialMusicIsPlaying=!0),this.tutorialText.pos={x:0.7*ig.system.width-0.5*this.tutorialText.size.x,y:0.345*ig.system.height-0.5*this.tutorialText.size.y},this.tutorialText.enableMark=!0,this.tutorialTime=0),ig.game.controller.deleteTutorial&&(this.tutorialText.deleteAllMarks(),this.tutorialText.kill()));ig.game.showShapesHint&&(this.shapeHint.pos={x:0.7*ig.system.width-0.5*this.shapeHint.size.x,y:0.345*ig.system.height-0.5*this.shapeHint.size.y})},shapeSelectionBoxLeftTween:function(){this.shapeSelectionBoxLeft.tween({pos:{x:0.09* ig.system.width-0.5*this.shapeSelectionBoxLeft.size.x}},0.5,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){this.starButton.pos={x:this.shapeSelectionBoxLeft.pos.x+0.275*this.shapeSelectionBoxLeft.size.x-0.5*this.starButton.size.x,y:this.shapeSelectionBoxLeft.pos.y+0.25*this.shapeSelectionBoxLeft.size.y-0.5*this.starButton.size.y};this.starButton.defaultPos.posX=this.starButton.pos.x;this.starButton.defaultPos.posY=this.starButton.pos.y;this.triangleButton.pos={x:this.shapeSelectionBoxLeft.pos.x+ 0.725*this.shapeSelectionBoxLeft.size.x-0.5*this.triangleButton.size.x,y:this.shapeSelectionBoxLeft.pos.y+0.25*this.shapeSelectionBoxLeft.size.y-0.5*this.triangleButton.size.y};this.triangleButton.defaultPos.posX=this.triangleButton.pos.x;this.triangleButton.defaultPos.posY=this.triangleButton.pos.y;this.circleButton.pos={x:this.shapeSelectionBoxLeft.pos.x+0.275*this.shapeSelectionBoxLeft.size.x-0.5*this.circleButton.size.x,y:this.shapeSelectionBoxLeft.pos.y+0.425*this.shapeSelectionBoxLeft.size.y- 0.5*this.circleButton.size.y};this.circleButton.defaultPos.posX=this.circleButton.pos.x;this.circleButton.defaultPos.posY=this.circleButton.pos.y;this.loveButton.pos={x:this.shapeSelectionBoxLeft.pos.x+0.725*this.shapeSelectionBoxLeft.size.x-0.5*this.loveButton.size.x,y:this.shapeSelectionBoxLeft.pos.y+0.425*this.shapeSelectionBoxLeft.size.y-0.5*this.loveButton.size.y};this.loveButton.defaultPos.posX=this.loveButton.pos.x;this.loveButton.defaultPos.posY=this.loveButton.pos.y;this.moonButton.pos={x:this.shapeSelectionBoxLeft.pos.x+ 0.275*this.shapeSelectionBoxLeft.size.x-0.5*this.moonButton.size.x,y:this.shapeSelectionBoxLeft.pos.y+0.6*this.shapeSelectionBoxLeft.size.y-0.5*this.moonButton.size.y};this.moonButton.defaultPos.posX=this.moonButton.pos.x;this.moonButton.defaultPos.posY=this.moonButton.pos.y;this.rectangleButton.pos={x:this.shapeSelectionBoxLeft.pos.x+0.725*this.shapeSelectionBoxLeft.size.x-0.5*this.rectangleButton.size.x,y:this.shapeSelectionBoxLeft.pos.y+0.6*this.shapeSelectionBoxLeft.size.y-0.5*this.rectangleButton.size.y}; this.rectangleButton.defaultPos.posX=this.rectangleButton.pos.x;this.rectangleButton.defaultPos.posY=this.rectangleButton.pos.y}.bind(this)}).start()},shapeSelectionBoxRightTween:function(){this.shapeSelectionBoxRight.tween({pos:{x:0.9125*ig.system.width-0.5*this.shapeSelectionBoxRight.size.x}},0.5,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){this.smiley1Button.pos={x:this.shapeSelectionBoxRight.pos.x+0.275*this.shapeSelectionBoxRight.size.x-0.5*this.smiley1Button.size.x,y:this.shapeSelectionBoxRight.pos.y+ 0.25*this.shapeSelectionBoxRight.size.y-0.5*this.smiley1Button.size.y};this.smiley2Button.pos={x:this.shapeSelectionBoxRight.pos.x+0.725*this.shapeSelectionBoxRight.size.x-0.5*this.smiley2Button.size.x,y:this.shapeSelectionBoxRight.pos.y+0.25*this.shapeSelectionBoxRight.size.y-0.5*this.smiley2Button.size.y};this.smiley3Button.pos={x:this.shapeSelectionBoxRight.pos.x+0.275*this.shapeSelectionBoxRight.size.x-0.5*this.smiley3Button.size.x,y:this.shapeSelectionBoxRight.pos.y+0.425*this.shapeSelectionBoxRight.size.y- 0.5*this.smiley3Button.size.y};this.smiley4Button.pos={x:this.shapeSelectionBoxRight.pos.x+0.725*this.shapeSelectionBoxRight.size.x-0.5*this.smiley4Button.size.x,y:this.shapeSelectionBoxRight.pos.y+0.425*this.shapeSelectionBoxRight.size.y-0.5*this.smiley4Button.size.y};this.smiley5Button.pos={x:this.shapeSelectionBoxRight.pos.x+0.275*this.shapeSelectionBoxRight.size.x-0.5*this.smiley5Button.size.x,y:this.shapeSelectionBoxRight.pos.y+0.6*this.shapeSelectionBoxRight.size.y-0.5*this.smiley5Button.size.y}; this.smiley6Button.pos={x:this.shapeSelectionBoxRight.pos.x+0.725*this.shapeSelectionBoxRight.size.x-0.5*this.smiley6Button.size.x,y:this.shapeSelectionBoxRight.pos.y+0.6*this.shapeSelectionBoxRight.size.y-0.5*this.smiley6Button.size.y};ig.soundHandler.sfxPlayer.play("buttonAnimation1");this.settingButtonTween();this.redButtonTween();this.orangeButtonTween();this.yellowButtonTween();this.violetButtonTween();this.greenButtonTween();this.blueButtonTween();this.doneButtonTween();this.rotateButtonTween(); this.eraserButtonTween();this.resetButtonTween();this.editingToolBoxTween()}.bind(this)}).start()},settingButtonTween:function(){var b=0.095*ig.system.height-0.5*this.settingButton.size.y,c=this.settingButton.tween({pos:{y:b+20}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){ig.soundHandler.sfxPlayer.play("buttonAnimation1")}.bind(this)}),b=this.settingButton.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)});c.chain(b); c.start()},redButtonTween:function(){var b=0.1*ig.system.height-0.5*this.redButton.size.y,c=this.redButton.tween({pos:{y:b+20}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}),b=this.redButton.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)});c.chain(b);c.start()},orangeButtonTween:function(){var b=0.1*ig.system.height-0.5*this.orangeButton.size.y,c=this.orangeButton.tween({pos:{y:b+20}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut, onComplete:function(){}.bind(this)}),b=this.orangeButton.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)});c.chain(b);c.start()},yellowButtonTween:function(){var b=0.1*ig.system.height-0.5*this.yellowButton.size.y,c=this.yellowButton.tween({pos:{y:b+20}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}),b=this.yellowButton.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}); c.chain(b);c.start()},violetButtonTween:function(){var b=0.1*ig.system.height-0.5*this.violetButton.size.y,c=this.violetButton.tween({pos:{y:b+20}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}),b=this.violetButton.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)});c.chain(b);c.start()},greenButtonTween:function(){var b=0.1*ig.system.height-0.5*this.greenButton.size.y,c=this.greenButton.tween({pos:{y:b+20}}, 0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}),b=this.greenButton.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)});c.chain(b);c.start()},blueButtonTween:function(){var b=0.1*ig.system.height-0.5*this.blueButton.size.y,c=this.blueButton.tween({pos:{y:b+20}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}),b=this.blueButton.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut, onComplete:function(){}.bind(this)});c.chain(b);c.start()},doneButtonTween:function(){var b=0.9*ig.system.height-0.5*this.doneButton.size.y,c=this.doneButton.tween({pos:{y:b-20}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){ig.soundHandler.sfxPlayer.play("buttonAnimation1")}.bind(this)}),b=this.doneButton.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){this.canvasBoard.isFadding=!0;ig.game.fromView&&ig.game.controller.loadAllShapes(); ig.game.fromGallery&&ig.game.controller.loadAllShapesFromGallery();this.isTutorialTime=this.loadNow=!0}.bind(this)});c.chain(b);c.start()},rotateButtonTween:function(){var b=0.9*ig.system.height-0.5*this.rotateButton.size.y,c=this.rotateButton.tween({pos:{y:b-20}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}),b=this.rotateButton.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)});c.chain(b);c.start()},eraserButtonTween:function(){var b= 0.9*ig.system.height-0.5*this.eraserButton.size.y,c=this.eraserButton.tween({pos:{y:b-20}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}),b=this.eraserButton.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)});c.chain(b);c.start()},resetButtonTween:function(){var b=0.9*ig.system.height-0.5*this.resetButton.size.y,c=this.resetButton.tween({pos:{y:b-20}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}), b=this.resetButton.tween({pos:{y:b}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){this.backButton.pos={x:0.725*ig.system.width-0.5*this.backButton.size.x,y:0.9*ig.system.height-0.5*this.backButton.size.y}}.bind(this)});c.chain(b);c.start()},editingToolBoxTween:function(){var b=0.9*ig.system.height-0.5*this.editingToolBox.size.y,c=this.editingToolBox.tween({pos:{y:b-20}},0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){}.bind(this)}),b=this.editingToolBox.tween({pos:{y:b}}, 0.25,{easing:ig.Tween.Easing.Quadratic.EaseInOut,onComplete:function(){this.size1Button.pos={x:this.editingToolBox.pos.x+0.1*this.editingToolBox.size.x-0.5*this.size1Button.size.x,y:this.editingToolBox.pos.y+0.5*this.editingToolBox.size.y-0.5*this.size1Button.size.y};this.size2Button.pos={x:this.editingToolBox.pos.x+0.25*this.editingToolBox.size.x-0.5*this.size2Button.size.x,y:this.editingToolBox.pos.y+0.5*this.editingToolBox.size.y-0.5*this.size2Button.size.y};this.size3Button.pos={x:this.editingToolBox.pos.x+ 0.45*this.editingToolBox.size.x-0.5*this.size3Button.size.x,y:this.editingToolBox.pos.y+0.5*this.editingToolBox.size.y-0.5*this.size3Button.size.y};this.size4Button.pos={x:this.editingToolBox.pos.x+0.65*this.editingToolBox.size.x-0.5*this.size4Button.size.x,y:this.editingToolBox.pos.y+0.5*this.editingToolBox.size.y-0.5*this.size4Button.size.y};this.size5Button.pos={x:this.editingToolBox.pos.x+0.875*this.editingToolBox.size.x-0.5*this.size5Button.size.x,y:this.editingToolBox.pos.y+0.5*this.editingToolBox.size.y- 0.5*this.size5Button.size.y}}.bind(this)});c.chain(b);c.start()},draw:function(){this.parent();this.desktopBackground.draw()}});EntityCanvasBoard=EntityButton.extend({zIndex:3,size:{x:631,y:361},fadeTime:0,isFadding:!1,animSheet:new ig.AnimationSheet("media/graphics/sprites/canvas-board.png",631,361),init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0]);this.currentAnim.alpha=0},update:function(){this.parent();this.isFadding&&1>=this.fadeTime&&(this.fadeTime+=ig.system.tick);this.currentAnim.alpha= this.fadeTime},draw:function(){this.parent()},clicked:function(){ig.game.controller.settingIsClicked||(ig.soundHandler.sfxPlayer.play("buttonSound"),ig.game.controller.isNotNetral=!1,0==ig.game.doneTutorial&&(2==ig.game.controller.tutorialID?ig.game.controller.tutorialID=3:3==ig.game.controller.tutorialID?ig.game.controller.tutorialID=4:4==ig.game.controller.tutorialID?ig.game.controller.tutorialID=5:5==ig.game.controller.tutorialID?ig.game.controller.tutorialID=6:6==ig.game.controller.tutorialID&& (ig.game.controller.deleteTutorial=!0)))}});EntityShapeSelectionBox=ig.Entity.extend({zIndex:3,size:{x:127,y:309},animSheet:new ig.AnimationSheet("media/graphics/sprites/shape_selection_box.png",127,309),init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent()},draw:function(){this.parent()}});EntityTutorialText=ig.Entity.extend({zIndex:4,tutorialMark1:null,tutorialMark2:null,tutorialMark3:null,tutorialMark4:null,tutorialMark5:null,handTutorial1:null, handTutorial3:null,handTutorial3:null,handTutorial4:null,handTutorial5:null,handTutorial6:null,handTutorial7:null,enableMark:!1,size:{x:400,y:100},init:function(b,c,d){this.parent(b,c,d);this.tutorialMark1=ig.game.spawnEntity(EntityTutorialMark1,2*ig.system.width,2*ig.system.height);this.tutorialMark2=ig.game.spawnEntity(EntityTutorialMark2,2*ig.system.width,2*ig.system.height);this.tutorialMark3=ig.game.spawnEntity(EntityTutorialMark3,2*ig.system.width,2*ig.system.height);this.tutorialMark4=ig.game.spawnEntity(EntityTutorialMark4, 2*ig.system.width,2*ig.system.height);this.tutorialMark5=ig.game.spawnEntity(EntityTutorialMark5,2*ig.system.width,2*ig.system.height);this.handTutorial1=ig.game.spawnEntity(EntityHandTutorial,2*ig.system.width,2*ig.system.height);this.handTutorial2=ig.game.spawnEntity(EntityHandTutorial,2*ig.system.width,2*ig.system.height);this.handTutorial3=ig.game.spawnEntity(EntityHandTutorial,2*ig.system.width,2*ig.system.height);this.handTutorial4=ig.game.spawnEntity(EntityHandTutorial,2*ig.system.width,2* ig.system.height);this.handTutorial5=ig.game.spawnEntity(EntityHandTutorial,2*ig.system.width,2*ig.system.height);this.handTutorial6=ig.game.spawnEntity(EntityHandTutorial,2*ig.system.width,2*ig.system.height);this.handTutorial7=ig.game.spawnEntity(EntityHandTutorial,2*ig.system.width,2*ig.system.height)},update:function(){this.parent();this.enableMark&&(1==ig.game.controller.tutorialID?(this.handTutorial2.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial3.pos={x:2*ig.system.width, y:2*ig.system.height},this.handTutorial4.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial5.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial6.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark1.pos={x:0.09*ig.system.width-0.5*this.tutorialMark1.size.x,y:0.5*ig.system.height-0.5*this.tutorialMark1.size.y},this.tutorialMark2.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark3.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark4.pos= {x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark5.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial1.pos={x:0.2*ig.system.width,y:0.35*ig.system.height},this.handTutorial1.currentAnim=this.handTutorial1.anims.left,this.handTutorial7.pos={x:0.125*ig.system.width,y:0.45*ig.system.height},this.handTutorial7.currentAnim=this.handTutorial7.anims.up,0==ig.game.controller.doTweening&&(this.tutorial1HandTween(),this.tutorial7HandTween(),ig.game.controller.doTweening=1),ig.game.controller.shapeForHandTutorial1IsClicked? (this.handTutorial1.currentAnim.alpha=0,this.handTutorial7.currentAnim.alpha=1):(this.handTutorial1.currentAnim.alpha=1,this.handTutorial7.currentAnim.alpha=0),ig.game.controller.enableDragging=!0):2==ig.game.controller.tutorialID?(this.handTutorial1.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial3.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial4.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial5.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial6.pos= {x:2*ig.system.width,y:2*ig.system.height},this.handTutorial7.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark5.pos={x:0.355*ig.system.width-0.5*this.tutorialMark3.size.x,y:0.915*ig.system.height-0.5*this.tutorialMark3.size.y},this.tutorialMark1.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark2.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark3.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark4.pos={x:2*ig.system.width,y:2*ig.system.height}, this.handTutorial2.pos={x:0.325*ig.system.width,y:0.6*ig.system.height},this.handTutorial2.currentAnim=this.handTutorial2.anims.down,1==ig.game.controller.doTweening&&(this.tutorial2HandTween(),ig.game.controller.doTweening=2)):3==ig.game.controller.tutorialID?(this.handTutorial2.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial1.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial4.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial5.pos={x:2*ig.system.width, y:2*ig.system.height},this.handTutorial6.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial7.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark2.pos={x:0.495*ig.system.width-0.5*this.tutorialMark2.size.x,y:0.1*ig.system.height-0.5*this.tutorialMark2.size.y},this.tutorialMark1.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark5.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark3.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark4.pos= {x:2*ig.system.width,y:2*ig.system.height},this.handTutorial3.pos={x:0.3*ig.system.width,y:0.2*ig.system.height},this.handTutorial3.currentAnim=this.handTutorial3.anims.up,2==ig.game.controller.doTweening&&(this.tutorial3HandTween(),ig.game.controller.doTweening=3)):4==ig.game.controller.tutorialID?(this.handTutorial3.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial2.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial1.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial5.pos= {x:2*ig.system.width,y:2*ig.system.height},this.handTutorial6.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial7.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark1.pos={x:0.9125*ig.system.width-0.5*this.tutorialMark1.size.x,y:0.5*ig.system.height-0.5*this.tutorialMark1.size.y},this.tutorialMark2.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark3.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark4.pos={x:2*ig.system.width,y:2*ig.system.height}, this.tutorialMark5.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial4.pos={x:0.7*ig.system.width,y:0.4*ig.system.height},this.handTutorial4.currentAnim=this.handTutorial4.anims.right,3==ig.game.controller.doTweening&&(this.tutorial4HandTween(),ig.game.controller.doTweening=4)):5==ig.game.controller.tutorialID?(this.handTutorial4.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial6.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial3.pos={x:2*ig.system.width, y:2*ig.system.height},this.handTutorial2.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial1.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial7.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark3.pos={x:0.755*ig.system.width-0.5*this.tutorialMark2.size.x,y:0.908*ig.system.height-0.5*this.tutorialMark2.size.y},this.tutorialMark2.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark1.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark4.pos= {x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark5.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial5.pos={x:0.485*ig.system.width,y:0.6*ig.system.height},this.handTutorial5.currentAnim=this.handTutorial5.anims.down,4==ig.game.controller.doTweening&&(this.tutorial5HandTween(),ig.game.controller.doTweening=5)):6==ig.game.controller.tutorialID&&(this.handTutorial5.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial4.pos={x:2*ig.system.width,y:2*ig.system.height}, this.handTutorial3.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial2.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial1.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial7.pos={x:2*ig.system.width,y:2*ig.system.height},this.tutorialMark4.pos={x:0.91*ig.system.width-0.5*this.tutorialMark4.size.x,y:0.9*ig.system.height-0.5*this.tutorialMark4.size.y},this.tutorialMark3.pos={x:2*ig.system.width,y:2*ig.system.height},this.handTutorial6.pos={x:0.85*ig.system.width, y:0.575*ig.system.height},this.handTutorial6.currentAnim=this.handTutorial6.anims.down,5==ig.game.controller.doTweening&&(this.tutorial6HandTween(),ig.game.controller.doTweening=6)))},tutorial1HandTween:function(){if(1==ig.game.controller.tutorialID){var b=0.17*ig.system.width;this.handTutorial1.alpha=1;this.handTutorial7.alpha=1;this.handTutorial1.tween({pos:{x:b}},0.5,{easing:ig.Tween.Easing.Linear.EaseNone,onComplete:function(){this.tutorial1HandTween2()}.bind(this)}).start()}},tutorial1HandTween2:function(){1== ig.game.controller.tutorialID&&this.handTutorial1.tween({pos:{x:0.2*ig.system.width}},0.5,{easing:ig.Tween.Easing.Linear.EaseNone,onComplete:function(){this.tutorial1HandTween()}.bind(this)}).start()},tutorial2HandTween:function(){2==ig.game.controller.tutorialID&&(this.handTutorial2.alpha=1,this.handTutorial1.alpha=0,this.handTutorial7.alpha=0,this.handTutorial2.tween({pos:{y:0.65*ig.system.height}},0.5,{easing:ig.Tween.Easing.Linear.EaseNone,onComplete:function(){this.tutorial2HandTween2()}.bind(this)}).start())}, tutorial2HandTween2:function(){2==ig.game.controller.tutorialID&&this.handTutorial2.tween({pos:{y:0.6*ig.system.height}},0.5,{easing:ig.Tween.Easing.Linear.EaseNone,onComplete:function(){this.tutorial2HandTween()}.bind(this)}).start()},tutorial3HandTween:function(){3==ig.game.controller.tutorialID&&(this.handTutorial2.alpha=0,this.handTutorial3.alpha=1,this.handTutorial3.tween({pos:{y:0.23*ig.system.height}},0.5,{easing:ig.Tween.Easing.Linear.EaseNone,onComplete:function(){this.tutorial3HandTween2()}.bind(this)}).start())}, tutorial3HandTween2:function(){3==ig.game.controller.tutorialID&&this.handTutorial3.tween({pos:{y:0.2*ig.system.height}},0.5,{easing:ig.Tween.Easing.Linear.EaseNone,onComplete:function(){this.tutorial3HandTween()}.bind(this)}).start()},tutorial4HandTween:function(){4==ig.game.controller.tutorialID&&(this.handTutorial3.alpha=0,this.handTutorial4.alpha=1,this.handTutorial4.tween({pos:{x:0.73*ig.system.width}},0.5,{easing:ig.Tween.Easing.Linear.EaseNone,onComplete:function(){this.tutorial4HandTween2()}.bind(this)}).start())}, tutorial4HandTween2:function(){4==ig.game.controller.tutorialID&&this.handTutorial4.tween({pos:{x:0.7*ig.system.width}},0.5,{easing:ig.Tween.Easing.Linear.EaseNone,onComplete:function(){this.tutorial4HandTween()}.bind(this)}).start()},tutorial5HandTween:function(){5==ig.game.controller.tutorialID&&(this.handTutorial4.alpha=0,this.handTutorial5.alpha=1,this.handTutorial5.tween({pos:{y:0.63*ig.system.height}},0.5,{easing:ig.Tween.Easing.Linear.EaseNone,onComplete:function(){this.tutorial5HandTween2()}.bind(this)}).start())}, tutorial5HandTween2:function(){5==ig.game.controller.tutorialID&&this.handTutorial5.tween({pos:{y:0.6*ig.system.height}},0.5,{easing:ig.Tween.Easing.Linear.EaseNone,onComplete:function(){this.tutorial5HandTween()}.bind(this)}).start()},tutorial6HandTween:function(){this.handTutorial5.alpha=0;this.handTutorial6.alpha=1;6==ig.game.controller.tutorialID&&this.handTutorial6.tween({pos:{y:0.63*ig.system.height}},0.5,{easing:ig.Tween.Easing.Linear.EaseNone,onComplete:function(){this.tutorial6HandTween2()}.bind(this)}).start()}, tutorial6HandTween2:function(){6==ig.game.controller.tutorialID&&this.handTutorial6.tween({pos:{y:0.6*ig.system.height}},0.5,{easing:ig.Tween.Easing.Linear.EaseNone,onComplete:function(){this.tutorial6HandTween()}.bind(this)}).start()},tutorial7HandTween:function(){1==ig.game.controller.tutorialID&&this.handTutorial7.tween({pos:{x:0.45*ig.system.width}},2,{easing:ig.Tween.Easing.Linear.EaseNone,onComplete:function(){this.handTutorial7.pos={x:0.125*ig.system.width,y:this.handTutorial7.pos.y};this.tutorial7HandTween()}.bind(this)}).start()}, deleteAllMarks:function(){this.tutorialMark1.kill();this.tutorialMark2.kill();this.tutorialMark3.kill();this.tutorialMark4.kill();this.tutorialMark5.kill()},textSet:function(b,c){var d=ig.system.context;d.font=b+"px supersonic";d.fillStyle=c},textDraw:function(b,c,d){var e=ig.system.context;e.textAlign="center";e.fillText(b,c,d)},draw:function(){this.parent();this.textSet(20,"rgb(72, 22, 13)");1==ig.game.controller.tutorialID?this.textDraw(_STRINGS.Tutorial.Tutorial1,this.pos.x,this.pos.y):2==ig.game.controller.tutorialID? this.textDraw(_STRINGS.Tutorial.Tutorial2,this.pos.x,this.pos.y):3==ig.game.controller.tutorialID?this.textDraw(_STRINGS.Tutorial.Tutorial3,this.pos.x,this.pos.y):4==ig.game.controller.tutorialID?this.textDraw(_STRINGS.Tutorial.Tutorial4,this.pos.x,this.pos.y):5==ig.game.controller.tutorialID?0==ig.game.controller.tutorial5ID?this.textDraw(_STRINGS.Tutorial.Tutorial5,this.pos.x,this.pos.y):1==ig.game.controller.tutorial5ID?this.textDraw(_STRINGS.Tutorial.Tutorial5_1,this.pos.x,this.pos.y):2==ig.game.controller.tutorial5ID? this.textDraw(_STRINGS.Tutorial.Tutorial5_2,this.pos.x,this.pos.y):3==ig.game.controller.tutorial5ID?this.textDraw(_STRINGS.Tutorial.Tutorial5_3,this.pos.x,this.pos.y):4==ig.game.controller.tutorial5ID?this.textDraw(_STRINGS.Tutorial.Tutorial5_4,this.pos.x,this.pos.y):5==ig.game.controller.tutorial5ID?this.textDraw(_STRINGS.Tutorial.Tutorial5_5,this.pos.x,this.pos.y):6==ig.game.controller.tutorial5ID&&this.textDraw(_STRINGS.Tutorial.Tutorial5_6,this.pos.x,this.pos.y):6==ig.game.controller.tutorialID&& this.textDraw(_STRINGS.Tutorial.Tutorial6,this.pos.x,this.pos.y)}});EntityShapeHint=ig.Entity.extend({zIndex:4,tutorialMark:null,objectPos:{x:0,y:0},size:{x:400,y:100},init:function(b,c,d){this.parent(b,c,d);this.tutorialMark=ig.game.spawnEntity(EntityTutorialMark1,2*ig.system.width,2*ig.system.height)},update:function(){this.parent();this.tutorialMark.pos=ig.game.controller.showShapesHint?{x:0.09*ig.system.width-0.5*this.tutorialMark.size.x,y:0.5*ig.system.height-0.5*this.tutorialMark.size.y}:{x:2* ig.system.width,y:2*ig.system.height}},textSet:function(b,c){var d=ig.system.context;d.font=b+"px supersonic";d.fillStyle=c},textDraw:function(b,c,d){var e=ig.system.context;e.textAlign="center";e.fillText(b,c,d)},draw:function(){this.parent();this.textSet(20,"rgb(72, 22, 13)");ig.game.controller.showShapesHint&&this.textDraw(_STRINGS.Game.Notice3,0.5*ig.system.width,0.25*ig.system.height)}});EntityEditingToolBox=ig.Entity.extend({zIndex:3,size:{x:268,y:54},animSheet:new ig.AnimationSheet("media/graphics/sprites/editing_tool_box.png", 268,54),init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent()},draw:function(){this.parent()}});EntityButtonSize1=EntityButton.extend({zIndex:4,chipID:0,size:{x:19,y:19},animSheet:new ig.AnimationSheet("media/graphics/sprites/size_1_btn.png",19,19),chipOn:!1,sc:0.5,name:"button size 1",init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent();this.animSheet.image=1==ig.game.controller.buttonSizeID?new ig.Image("media/graphics/sprites/size_1_btn.png#878787"): new ig.Image("media/graphics/sprites/size_1_btn.png#FFFFFF")},draw:function(){this.parent()},check:function(){},clicked:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&2==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.runClickingTime(),ig.soundHandler.sfxPlayer.play("buttonSound"),this.setScale(1.2,1.2)},released:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial|| !ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&2==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.disableClickingTime(),this.setScale(1,1),ig.game.controller.shapeIsAvailable?(ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].objectScalling.scaleX=0.2,ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].objectScalling.scaleY=0.2,ig.game.controller.sizesCode[ig.game.controller.selectedShapeID]=0.2,ig.game.controller.buttonSizeID= 1,0==ig.game.doneTutorial&&(ig.game.controller.tutorialID=3),ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].scaleShape()):ig.game.controller.showShapesHint=!0}});EntityButtonSize2=EntityButton.extend({zIndex:4,chipID:0,size:{x:26,y:26},animSheet:new ig.AnimationSheet("media/graphics/sprites/size_2_btn.png",26,26),chipOn:!1,sc:0.5,name:"button size 2",init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent();this.animSheet.image= 2==ig.game.controller.buttonSizeID?new ig.Image("media/graphics/sprites/size_2_btn.png#878787"):new ig.Image("media/graphics/sprites/size_2_btn.png#FFFFFF")},draw:function(){this.parent()},check:function(){},clicked:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&2==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.runClickingTime(),ig.soundHandler.sfxPlayer.play("buttonSound"),this.setScale(1.2, 1.2)},released:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&2==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.disableClickingTime(),this.setScale(1,1),ig.game.controller.shapeIsAvailable?(ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].objectScalling.scaleX=0.4,ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].objectScalling.scaleY= 0.4,ig.game.controller.sizesCode[ig.game.controller.selectedShapeID]=0.4,ig.game.controller.buttonSizeID=2,0==ig.game.doneTutorial&&(ig.game.controller.tutorialID=3),ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].scaleShape()):ig.game.controller.showShapesHint=!0}});EntityButtonSize3=EntityButton.extend({zIndex:4,chipID:0,size:{x:34,y:34},animSheet:new ig.AnimationSheet("media/graphics/sprites/size_3_btn.png",34,34),chipOn:!1,sc:0.5,name:"button size 3",init:function(b,c, d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent();this.animSheet.image=3==ig.game.controller.buttonSizeID?new ig.Image("media/graphics/sprites/size_3_btn.png#878787"):new ig.Image("media/graphics/sprites/size_3_btn.png#FFFFFF")},draw:function(){this.parent()},check:function(){},clicked:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&2==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.runClickingTime(), ig.soundHandler.sfxPlayer.play("buttonSound"),this.setScale(1.2,1.2)},released:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&2==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.disableClickingTime(),this.setScale(1,1),ig.game.controller.shapeIsAvailable?(ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].objectScalling.scaleX=0.6,ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].objectScalling.scaleY= 0.6,ig.game.controller.sizesCode[ig.game.controller.selectedShapeID]=0.6,ig.game.controller.buttonSizeID=3,0==ig.game.doneTutorial&&(ig.game.controller.tutorialID=3),ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].scaleShape()):ig.game.controller.showShapesHint=!0}});EntityButtonSize4=EntityButton.extend({zIndex:4,chipID:0,size:{x:39,y:39},animSheet:new ig.AnimationSheet("media/graphics/sprites/size_4_btn.png",39,39),chipOn:!1,sc:0.5,name:"button size 4",init:function(b,c, d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent();this.animSheet.image=4==ig.game.controller.buttonSizeID?new ig.Image("media/graphics/sprites/size_4_btn.png#878787"):new ig.Image("media/graphics/sprites/size_4_btn.png#FFFFFF")},draw:function(){this.parent()},check:function(){},clicked:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&2==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.runClickingTime(), ig.soundHandler.sfxPlayer.play("buttonSound"),this.setScale(1.2,1.2)},released:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&2==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.disableClickingTime(),this.setScale(1,1),ig.game.controller.shapeIsAvailable?(ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].objectScalling.scaleX=0.8,ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].objectScalling.scaleY= 0.8,ig.game.controller.sizesCode[ig.game.controller.selectedShapeID]=0.8,ig.game.controller.buttonSizeID=4,0==ig.game.doneTutorial&&(ig.game.controller.tutorialID=3),ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].scaleShape()):ig.game.controller.showShapesHint=!0}});EntityButtonSize5=EntityButton.extend({zIndex:4,chipID:0,size:{x:44,y:44},animSheet:new ig.AnimationSheet("media/graphics/sprites/size_5_btn.png",44,44),chipOn:!1,sc:0.5,name:"button size 5",init:function(b,c, d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent();this.animSheet.image=5==ig.game.controller.buttonSizeID?new ig.Image("media/graphics/sprites/size_5_btn.png#878787"):new ig.Image("media/graphics/sprites/size_5_btn.png#FFFFFF")},draw:function(){this.parent()},check:function(){},clicked:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&2==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.runClickingTime(), ig.soundHandler.sfxPlayer.play("buttonSound"),this.setScale(1.2,1.2)},released:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&2==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.disableClickingTime(),this.setScale(1,1),ig.game.controller.shapeIsAvailable?(ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].objectScalling.scaleX=1,ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].objectScalling.scaleY= 1,ig.game.controller.sizesCode[ig.game.controller.selectedShapeID]=1,ig.game.controller.buttonSizeID=5,0==ig.game.doneTutorial&&(ig.game.controller.tutorialID=3),ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].scaleShape()):ig.game.controller.showShapesHint=!0}});EntityButtonRed=EntityButton.extend({zIndex:3,chipID:0,size:{x:53,y:53},animSheet:new ig.AnimationSheet("media/graphics/sprites/red.png",53,53),chipOn:!1,sc:0.5,name:"button red",init:function(b,c,d){this.parent(b, c,d);this.addAnim("default",1,[0])},update:function(){this.parent()},draw:function(){this.parent()},check:function(){},clicked:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&3==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.runClickingTime(),ig.soundHandler.sfxPlayer.play("buttonSound"),this.setScale(1.2,1.2)},released:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial|| !ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&3==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.disableClickingTime(),this.setScale(1,1),ig.game.controller.shapeIsAvailable?(ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].colorID=1,ig.game.controller.colorCode[ig.game.controller.selectedShapeID]=1,0==ig.game.doneTutorial&&(ig.game.controller.tutorialID=4)):ig.game.controller.showShapesHint=!0}});EntityButtonOrange=EntityButton.extend({zIndex:3, chipID:0,size:{x:53,y:53},animSheet:new ig.AnimationSheet("media/graphics/sprites/orange.png",53,53),chipOn:!1,sc:0.5,name:"button orange",init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent()},draw:function(){this.parent()},check:function(){},clicked:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&3==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.runClickingTime(), ig.soundHandler.sfxPlayer.play("buttonSound"),this.setScale(1.2,1.2)},released:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&3==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.disableClickingTime(),this.setScale(1,1),ig.game.controller.shapeIsAvailable?(ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].colorID=2,ig.game.controller.colorCode[ig.game.controller.selectedShapeID]= 2,0==ig.game.doneTutorial&&(ig.game.controller.tutorialID=4)):ig.game.controller.showShapesHint=!0}});EntityButtonYellow=EntityButton.extend({zIndex:3,chipID:0,size:{x:53,y:53},animSheet:new ig.AnimationSheet("media/graphics/sprites/yellow.png",53,53),chipOn:!1,sc:0.5,name:"button yellow",init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent()},draw:function(){this.parent()},check:function(){},clicked:function(){if((!ig.game.controller.settingIsClicked&& 1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&3==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.runClickingTime(),ig.soundHandler.sfxPlayer.play("buttonSound"),this.setScale(1.2,1.2)},released:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&3==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.disableClickingTime(), this.setScale(1,1),ig.game.controller.shapeIsAvailable?(ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].colorID=3,ig.game.controller.colorCode[ig.game.controller.selectedShapeID]=3,0==ig.game.doneTutorial&&(ig.game.controller.tutorialID=4)):ig.game.controller.showShapesHint=!0}});EntityButtonViolet=EntityButton.extend({zIndex:3,chipID:0,size:{x:53,y:53},animSheet:new ig.AnimationSheet("media/graphics/sprites/violet.png",53,53),chipOn:!1,sc:0.5,name:"button violet",init:function(b, c,d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent()},draw:function(){this.parent()},check:function(){},clicked:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&3==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.runClickingTime(),ig.soundHandler.sfxPlayer.play("buttonSound"),this.setScale(1.2,1.2)},released:function(){if((!ig.game.controller.settingIsClicked&& 1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&3==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.disableClickingTime(),this.setScale(1,1),ig.game.controller.shapeIsAvailable?(ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].colorID=4,ig.game.controller.colorCode[ig.game.controller.selectedShapeID]=4,0==ig.game.doneTutorial&&(ig.game.controller.tutorialID=4)):ig.game.controller.showShapesHint=!0}});EntityButtonGreen= EntityButton.extend({zIndex:3,chipID:0,size:{x:53,y:53},animSheet:new ig.AnimationSheet("media/graphics/sprites/green.png",53,53),chipOn:!1,sc:0.5,name:"button green",init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent()},draw:function(){this.parent()},check:function(){},clicked:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&3==ig.game.controller.tutorialID)&& !ig.game.controller.isDraggingTheShape)this.runClickingTime(),ig.soundHandler.sfxPlayer.play("buttonSound"),this.setScale(1.2,1.2)},released:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&3==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.disableClickingTime(),this.setScale(1,1),ig.game.controller.shapeIsAvailable?(ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].colorID= 5,ig.game.controller.colorCode[ig.game.controller.selectedShapeID]=5,0==ig.game.doneTutorial&&(ig.game.controller.tutorialID=4)):ig.game.controller.showShapesHint=!0}});EntityButtonBlue=EntityButton.extend({zIndex:3,chipID:0,size:{x:53,y:53},animSheet:new ig.AnimationSheet("media/graphics/sprites/blue.png",53,53),chipOn:!1,sc:0.5,name:"button blue",init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent()},draw:function(){this.parent()},check:function(){}, clicked:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&3==ig.game.controller.tutorialID)&&!ig.game.controller.isDraggingTheShape)this.runClickingTime(),ig.soundHandler.sfxPlayer.play("buttonSound"),this.setScale(1.2,1.2)},released:function(){if((!ig.game.controller.settingIsClicked&&1==ig.game.doneTutorial||!ig.game.controller.settingIsClicked&&0==ig.game.doneTutorial&&3==ig.game.controller.tutorialID)&& !ig.game.controller.isDraggingTheShape)this.disableClickingTime(),this.setScale(1,1),ig.game.controller.shapeIsAvailable?(ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].colorID=6,ig.game.controller.colorCode[ig.game.controller.selectedShapeID]=6,0==ig.game.doneTutorial&&(ig.game.controller.tutorialID=4)):ig.game.controller.showShapesHint=!0}});EntityButtonRotate=EntityButton.extend({zIndex:3,chipID:0,size:{x:54,y:54},showButtonText:!1,animSheet:new ig.AnimationSheet("media/graphics/sprites/rotate_btn.png", 54,54),chipOn:!1,sc:0.5,name:"button rotate",init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0]);this.addAnim("rotateRight",1,[1])},update:function(){this.parent();this.currentAnim=ig.game.controller.rotateButtonIsClicked?this.anims.rotateRight:this.anims.default;this.pointer.pos.x>this.pos.x&&this.pointer.pos.xthis.pos.y&&this.pointer.pos.yig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].shapeAngleTemp&& (ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].decreaseShapeAngleTemp=!1)):(ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].plusShapeAngleTemp(),0.75 this.pos.x&&this.pointer.pos.xthis.pos.y&&this.pointer.pos.yig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].shapeAngleTemp&&(ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].decreaseShapeAngleTemp=!1)):(ig.game.controller.allShapesOnFrame[ig.game.controller.selectedShapeID].plusShapeAngleTemp(),0.75this.pos.x&&this.pointer.pos.xthis.pos.y&&this.pointer.pos.ythis.pos.x&&this.pointer.pos.xthis.pos.y&&this.pointer.pos.ythis.pointerXMin&&this.pointer.pos.xthis.pointerYMin&&this.pointer.pos.ythis.pointerXMin&&this.pointer.pos.xthis.pointerYMin&&this.pointer.pos.ythis.pointerXMin&&this.pointer.pos.xthis.pointerYMin&&this.pointer.pos.ythis.pointerXMin&&this.pointer.pos.xthis.pointerYMin&&this.pointer.pos.ythis.pointerXMin&&this.pointer.pos.x< this.pointerXMax&&this.pointer.pos.y>this.pointerYMin&&this.pointer.pos.ythis.pointerXMin&&this.pointer.pos.xthis.pointerYMin&&this.pointer.pos.ythis.pointerXMin&&this.pointer.pos.xthis.pointerYMin&&this.pointer.pos.ythis.pointerXMin&&this.pointer.pos.x this.pointerYMin&&this.pointer.pos.ythis.pointerXMin&&this.pointer.pos.xthis.pointerYMin&&this.pointer.pos.ythis.pointerXMin&&this.pointer.pos.xthis.pointerYMin&&this.pointer.pos.ythis.pointerXMin&&this.pointer.pos.xthis.pointerYMin&&this.pointer.pos.ythis.pointerXMin&&this.pointer.pos.xthis.pointerYMin&&this.pointer.pos.y=this.pointerXMax&&(this.pos.x=this.pointerXMax);this.pos.y<=this.pointerYMin&&(this.pos.y=this.pointerYMin);this.pos.y>=this.pointerYMax&&(this.pos.y=this.pointerYMax);this.savePosition()},draw:function(){this.parent()},check:function(){},clicking:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(ig.game.controller.shapePressingTime+= ig.system.tick,ig.game.controller.isDraggingTheShape=!0,ig.game.controller.draggingTheShapeNetralTime=0.1,this.pos.x>=this.pointerXMin&&this.pos.x<=this.pointerXMax&&(this.pos.y>=this.pointerYMin&&this.pos.y<=this.pointerYMax)&&(this.pos={x:this.pointer.pos.x-0.5*this.size.x-ig.game.diffPointer.x,y:this.pointer.pos.y-0.5*this.size.y-ig.game.diffPointer.y},null!=this.smileyImage&&(this.smileyImage.pos={x:this.pointer.pos.x-0.5*this.smileyImage.size.x-ig.game.diffPointer.x,y:this.pointer.pos.y-0.5* this.smileyImage.size.y-ig.game.diffPointer.y},this.smileyImage.zIndex=2001)),this.pos.x<=this.pointerXMin&&(this.pos.x=this.pointerXMin),this.pos.x>=this.pointerXMax&&(this.pos.x=this.pointerXMax),this.pos.y<=this.pointerYMin&&(this.pos.y=this.pointerYMin),this.pos.y>=this.pointerYMax&&(this.pos.y=this.pointerYMax),null!=this.smileyImage&&(this.smileyImage.pos.x<=this.pointerXMin&&(this.smileyImage.pos.x=this.pointerXMin),this.smileyImage.pos.x>=this.pointerXMax&&(this.smileyImage.pos.x=this.pointerXMax), this.smileyImage.pos.y<=this.pointerYMin&&(this.smileyImage.pos.y=this.pointerYMin),this.smileyImage.pos.y>=this.pointerYMax&&(this.smileyImage.pos.y=this.pointerYMax)),ig.game.controller.shapesPosX[this.shapeID]=this.pos.x,ig.game.controller.shapesPosY[this.shapeID]=this.pos.y,this.zIndex=2E3,ig.game.sortEntitiesDeferred())},clicked:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(ig.game.controller.shapeHighZIndex=!0,ig.game.controller.isDraggingTheShape=!0,ig.game.controller.globalObjectScale= 1,ig.soundHandler.sfxPlayer.play("buttonDraw"),ig.game.controller.selectedShapeID=this.shapeID,ig.game.controller.isNotNetral=!0,ig.game.diffPointer.x=this.pointer.pos.x-this.pos.x-0.5*this.size.x,ig.game.diffPointer.y=this.pointer.pos.y-this.pos.y-0.5*this.size.y)},released:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(0.5=this.pointerXMax&&(this.pos.x=this.pointerXMax);this.pos.y<=this.pointerYMin&&(this.pos.y=this.pointerYMin);this.pos.y>=this.pointerYMax&&(this.pos.y=this.pointerYMax);this.savePosition()},draw:function(){this.parent()},check:function(){},clicking:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(ig.game.controller.shapePressingTime+=ig.system.tick,ig.game.controller.isDraggingTheShape=!0,ig.game.controller.draggingTheShapeNetralTime= 0.1,this.pos.x>=this.pointerXMin&&this.pos.x<=this.pointerXMax&&(this.pos.y>=this.pointerYMin&&this.pos.y<=this.pointerYMax)&&(this.pos={x:this.pointer.pos.x-0.5*this.size.x-ig.game.diffPointer.x,y:this.pointer.pos.y-0.5*this.size.y-ig.game.diffPointer.y},null!=this.smileyImage&&(this.smileyImage.pos={x:this.pointer.pos.x-0.5*this.smileyImage.size.x-ig.game.diffPointer.x,y:this.pointer.pos.y-0.5*this.smileyImage.size.y-ig.game.diffPointer.y},this.smileyImage.zIndex=2001)),this.pos.x<=this.pointerXMin&& (this.pos.x=this.pointerXMin),this.pos.x>=this.pointerXMax&&(this.pos.x=this.pointerXMax),this.pos.y<=this.pointerYMin&&(this.pos.y=this.pointerYMin),this.pos.y>=this.pointerYMax&&(this.pos.y=this.pointerYMax),null!=this.smileyImage&&(this.smileyImage.pos.x<=this.pointerXMin&&(this.smileyImage.pos.x=this.pointerXMin),this.smileyImage.pos.x>=this.pointerXMax&&(this.smileyImage.pos.x=this.pointerXMax),this.smileyImage.pos.y<=this.pointerYMin&&(this.smileyImage.pos.y=this.pointerYMin),this.smileyImage.pos.y>= this.pointerYMax&&(this.smileyImage.pos.y=this.pointerYMax)),ig.game.controller.shapesPosX[this.shapeID]=this.pos.x,ig.game.controller.shapesPosY[this.shapeID]=this.pos.y,this.zIndex=2E3,ig.game.sortEntitiesDeferred())},clicked:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(ig.game.controller.shapeHighZIndex=!0,ig.game.controller.isDraggingTheShape=!0,ig.game.controller.globalObjectScale=1,ig.soundHandler.sfxPlayer.play("buttonDraw"),ig.game.controller.isNotNetral= !0,ig.game.controller.selectedShapeID=this.shapeID,ig.game.diffPointer.x=this.pointer.pos.x-this.pos.x-0.5*this.size.x,ig.game.diffPointer.y=this.pointer.pos.y-this.pos.y-0.5*this.size.y)},released:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(0.5=this.pointerXMax&&(this.pos.x=this.pointerXMax);this.pos.y<=this.pointerYMin&&(this.pos.y=this.pointerYMin);this.pos.y>=this.pointerYMax&&(this.pos.y=this.pointerYMax);this.savePosition()},draw:function(){this.parent()},check:function(){},clicking:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(ig.game.controller.shapePressingTime+=ig.system.tick,ig.game.controller.isDraggingTheShape=!0,ig.game.controller.draggingTheShapeNetralTime= 0.1,this.pos.x>=this.pointerXMin&&this.pos.x<=this.pointerXMax&&(this.pos.y>=this.pointerYMin&&this.pos.y<=this.pointerYMax)&&(this.pos={x:this.pointer.pos.x-0.5*this.size.x-ig.game.diffPointer.x,y:this.pointer.pos.y-0.5*this.size.y-ig.game.diffPointer.y},null!=this.smileyImage&&(this.smileyImage.pos={x:this.pointer.pos.x-0.5*this.smileyImage.size.x-ig.game.diffPointer.x,y:this.pointer.pos.y-0.5*this.smileyImage.size.y-ig.game.diffPointer.y},this.smileyImage.zIndex=2001)),this.pos.x<=this.pointerXMin&& (this.pos.x=this.pointerXMin),this.pos.x>=this.pointerXMax&&(this.pos.x=this.pointerXMax),this.pos.y<=this.pointerYMin&&(this.pos.y=this.pointerYMin),this.pos.y>=this.pointerYMax&&(this.pos.y=this.pointerYMax),null!=this.smileyImage&&(this.smileyImage.pos.x<=this.pointerXMin&&(this.smileyImage.pos.x=this.pointerXMin),this.smileyImage.pos.x>=this.pointerXMax&&(this.smileyImage.pos.x=this.pointerXMax),this.smileyImage.pos.y<=this.pointerYMin&&(this.smileyImage.pos.y=this.pointerYMin),this.smileyImage.pos.y>= this.pointerYMax&&(this.smileyImage.pos.y=this.pointerYMax)),ig.game.controller.shapesPosX[this.shapeID]=this.pos.x,ig.game.controller.shapesPosY[this.shapeID]=this.pos.y,this.zIndex=2E3,ig.game.sortEntitiesDeferred())},clicked:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(ig.game.controller.shapeHighZIndex=!0,ig.game.controller.isDraggingTheShape=!0,ig.game.controller.globalObjectScale=1,ig.soundHandler.sfxPlayer.play("buttonDraw"),ig.game.controller.selectedShapeID= this.shapeID,ig.game.controller.isNotNetral=!0,ig.game.diffPointer.x=this.pointer.pos.x-this.pos.x-0.5*this.size.x,ig.game.diffPointer.y=this.pointer.pos.y-this.pos.y-0.5*this.size.y)},released:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(0.5=this.pointerXMax&&(this.pos.x=this.pointerXMax);this.pos.y<=this.pointerYMin&&(this.pos.y=this.pointerYMin);this.pos.y>=this.pointerYMax&&(this.pos.y=this.pointerYMax);this.savePosition()},draw:function(){this.parent()},check:function(){},clicking:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(ig.game.controller.shapePressingTime+=ig.system.tick,ig.game.controller.isDraggingTheShape=!0,ig.game.controller.draggingTheShapeNetralTime= 0.1,this.pos.x>=this.pointerXMin&&this.pos.x<=this.pointerXMax&&(this.pos.y>=this.pointerYMin&&this.pos.y<=this.pointerYMax)&&(this.pos={x:this.pointer.pos.x-0.5*this.size.x-ig.game.diffPointer.x,y:this.pointer.pos.y-0.5*this.size.y-ig.game.diffPointer.y},null!=this.smileyImage&&(this.smileyImage.pos={x:this.pointer.pos.x-0.5*this.smileyImage.size.x-ig.game.diffPointer.x,y:this.pointer.pos.y-0.5*this.smileyImage.size.y-ig.game.diffPointer.y},this.smileyImage.zIndex=2001)),this.pos.x<=this.pointerXMin&& (this.pos.x=this.pointerXMin),this.pos.x>=this.pointerXMax&&(this.pos.x=this.pointerXMax),this.pos.y<=this.pointerYMin&&(this.pos.y=this.pointerYMin),this.pos.y>=this.pointerYMax&&(this.pos.y=this.pointerYMax),null!=this.smileyImage&&(this.smileyImage.pos.x<=this.pointerXMin&&(this.smileyImage.pos.x=this.pointerXMin),this.smileyImage.pos.x>=this.pointerXMax&&(this.smileyImage.pos.x=this.pointerXMax),this.smileyImage.pos.y<=this.pointerYMin&&(this.smileyImage.pos.y=this.pointerYMin),this.smileyImage.pos.y>= this.pointerYMax&&(this.smileyImage.pos.y=this.pointerYMax)),ig.game.controller.shapesPosX[this.shapeID]=this.pos.x,ig.game.controller.shapesPosY[this.shapeID]=this.pos.y,this.zIndex=2E3,ig.game.sortEntitiesDeferred())},clicked:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(ig.game.controller.shapeHighZIndex=!0,ig.game.controller.isDraggingTheShape=!0,ig.game.controller.globalObjectScale=1,ig.soundHandler.sfxPlayer.play("buttonDraw"),ig.game.controller.selectedShapeID= this.shapeID,ig.game.controller.isNotNetral=!0,ig.game.diffPointer.x=this.pointer.pos.x-this.pos.x-0.5*this.size.x,ig.game.diffPointer.y=this.pointer.pos.y-this.pos.y-0.5*this.size.y)},released:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(0.5=this.pointerXMax&&(this.pos.x=this.pointerXMax);this.pos.y<=this.pointerYMin&&(this.pos.y=this.pointerYMin);this.pos.y>=this.pointerYMax&&(this.pos.y=this.pointerYMax);this.savePosition()},draw:function(){this.parent()},check:function(){},clicking:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(ig.game.controller.shapePressingTime+=ig.system.tick,ig.game.controller.isDraggingTheShape=!0,ig.game.controller.draggingTheShapeNetralTime= 0.1,this.pos.x>=this.pointerXMin&&this.pos.x<=this.pointerXMax&&(this.pos.y>=this.pointerYMin&&this.pos.y<=this.pointerYMax)&&(this.pos={x:this.pointer.pos.x-0.5*this.size.x-ig.game.diffPointer.x,y:this.pointer.pos.y-0.5*this.size.y-ig.game.diffPointer.y},null!=this.smileyImage&&(this.smileyImage.pos={x:this.pointer.pos.x-0.5*this.smileyImage.size.x-ig.game.diffPointer.x,y:this.pointer.pos.y-0.5*this.smileyImage.size.y-ig.game.diffPointer.y},this.smileyImage.zIndex=2001)),this.pos.x<=this.pointerXMin&& (this.pos.x=this.pointerXMin),this.pos.x>=this.pointerXMax&&(this.pos.x=this.pointerXMax),this.pos.y<=this.pointerYMin&&(this.pos.y=this.pointerYMin),this.pos.y>=this.pointerYMax&&(this.pos.y=this.pointerYMax),null!=this.smileyImage&&(this.smileyImage.pos.x<=this.pointerXMin&&(this.smileyImage.pos.x=this.pointerXMin),this.smileyImage.pos.x>=this.pointerXMax&&(this.smileyImage.pos.x=this.pointerXMax),this.smileyImage.pos.y<=this.pointerYMin&&(this.smileyImage.pos.y=this.pointerYMin),this.smileyImage.pos.y>= this.pointerYMax&&(this.smileyImage.pos.y=this.pointerYMax)),ig.game.controller.shapesPosX[this.shapeID]=this.pos.x,ig.game.controller.shapesPosY[this.shapeID]=this.pos.y,this.zIndex=2E3,ig.game.sortEntitiesDeferred())},clicked:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(ig.game.controller.shapeHighZIndex=!0,ig.game.controller.isDraggingTheShape=!0,ig.game.controller.globalObjectScale=1,ig.soundHandler.sfxPlayer.play("buttonDraw"),ig.game.controller.selectedShapeID= this.shapeID,ig.game.controller.isNotNetral=!0,ig.game.diffPointer.x=this.pointer.pos.x-this.pos.x-0.5*this.size.x,ig.game.diffPointer.y=this.pointer.pos.y-this.pos.y-0.5*this.size.y)},released:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(0.5=this.pointerXMax&&(this.pos.x=this.pointerXMax);this.pos.y<=this.pointerYMin&&(this.pos.y=this.pointerYMin);this.pos.y>=this.pointerYMax&&(this.pos.y=this.pointerYMax);this.savePosition()},draw:function(){this.parent()},check:function(){},clicking:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(ig.game.controller.shapePressingTime+=ig.system.tick,ig.game.controller.isDraggingTheShape=!0,ig.game.controller.draggingTheShapeNetralTime= 0.1,this.pos.x>=this.pointerXMin&&this.pos.x<=this.pointerXMax&&(this.pos.y>=this.pointerYMin&&this.pos.y<=this.pointerYMax)&&(this.pos={x:this.pointer.pos.x-0.5*this.size.x-ig.game.diffPointer.x,y:this.pointer.pos.y-0.5*this.size.y-ig.game.diffPointer.y},null!=this.smileyImage&&(this.smileyImage.pos={x:this.pointer.pos.x-0.5*this.smileyImage.size.x-ig.game.diffPointer.x,y:this.pointer.pos.y-0.5*this.smileyImage.size.y-ig.game.diffPointer.y},this.smileyImage.zIndex=2001)),this.pos.x<=this.pointerXMin&& (this.pos.x=this.pointerXMin),this.pos.x>=this.pointerXMax&&(this.pos.x=this.pointerXMax),this.pos.y<=this.pointerYMin&&(this.pos.y=this.pointerYMin),this.pos.y>=this.pointerYMax&&(this.pos.y=this.pointerYMax),null!=this.smileyImage&&(this.smileyImage.pos.x<=this.pointerXMin&&(this.smileyImage.pos.x=this.pointerXMin),this.smileyImage.pos.x>=this.pointerXMax&&(this.smileyImage.pos.x=this.pointerXMax),this.smileyImage.pos.y<=this.pointerYMin&&(this.smileyImage.pos.y=this.pointerYMin),this.smileyImage.pos.y>= this.pointerYMax&&(this.smileyImage.pos.y=this.pointerYMax)),ig.game.controller.shapesPosX[this.shapeID]=this.pos.x,ig.game.controller.shapesPosY[this.shapeID]=this.pos.y,this.zIndex=2E3,ig.game.sortEntitiesDeferred())},clicked:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(ig.game.controller.shapeHighZIndex=!0,ig.game.controller.isDraggingTheShape=!0,ig.game.controller.globalObjectScale=1,ig.soundHandler.sfxPlayer.play("buttonDraw"),ig.game.controller.selectedShapeID= this.shapeID,ig.game.controller.isNotNetral=!0,ig.game.diffPointer.x=this.pointer.pos.x-this.pos.x-0.5*this.size.x,ig.game.diffPointer.y=this.pointer.pos.y-this.pos.y-0.5*this.size.y)},released:function(){!ig.game.controller.settingIsClicked&&!ig.game.controller.isInResult&&(0.5=this.fadeTime&&(this.fadeTime+=ig.system.tick,this.finishSoundIsPlaying||(ig.soundHandler.sfxPlayer.play("finish"),this.finishSoundIsPlaying=!0),this.loadNow=!0);if(this.loadNow&&!this.isLoaded){ig.game.controller.loadAllShapes(); if(null!=ig.game.controller.shapesCode)for(var b=0;big.game.slotLength?(ig.game.controller.saveAllShapesForGallery(),ig.game.director.jumpTo(LevelGallery)): 13<=ig.game.slotLength&&(ig.game.controller.slotIsFullIsClicked=!0)}});EntitySlotIsFull=ig.Entity.extend({zIndex:2001,size:{x:434,y:344},animSheet:new ig.AnimationSheet("media/graphics/sprites/popup_frame2.png",434,344),init:function(b,c,d){this.parent(b,c,d);this.addAnim("default",1,[0])},update:function(){this.parent()},textSet:function(b,c){var d=ig.system.context;d.font=b+"px supersonic";d.fillStyle=c},wrapText:function(b,c,d,e,g,l){c=c.split(" ");for(var q="",n=0;ng&&0 0){ this.doneTutorial = 1; } ig.soundHandler.sfxPlayer.volume(this.soundSettings.sfx); ig.soundHandler.bgmPlayer.volume(this.soundSettings.bgm); }, setupMarketJsGameCenter: function() { if(_SETTINGS) { if(_SETTINGS['MarketJSGameCenter']) { var el = ig.domHandler.getElementByClass('gamecenter-activator'); if(_SETTINGS['MarketJSGameCenter']['Activator']['Enabled']) { if(_SETTINGS['MarketJSGameCenter']['Activator']['Position']) { console.log('MarketJSGameCenter activator settings present ....') ig.domHandler.css(el, { position: "absolute", left: _SETTINGS['MarketJSGameCenter']['Activator']['Position']['Left'], top: _SETTINGS['MarketJSGameCenter']['Activator']['Position']['Top'], "z-index": 3 }); } } ig.domHandler.show(el); } else { console.log('MarketJSGameCenter settings not defined in game settings') } } }, finalize: function() { // if(ig.ua.mobile) { // // Inject link // var elem = ig.domHandler.getElementById("#play"); // ig.domHandler.attr(elem, 'onclick', 'ig.soundHandler.sfxPlayer.play("staticSound");ig.game.splashClick();'); // ig.domHandler.show(elem); // // Special hack // // $('body').height($('#game').height()+75); // // sizeHandler(); // // Special hack // //$('body').height($('#game').height()); // } else { this.start(); // } ig.sizeHandler.reorient(); }, removeLoadingWheel: function() { // Remove the loading wheel try { $('#ajaxbar').css('background', 'none'); } catch(err) { console.log(err) } }, showDebugMenu: function() { console.log('showing debug menu ...'); // SHOW DEBUG LINES ig.Entity._debugShowBoxes = true; // SHOW DEBUG PANELS $('.ig_debug').show(); }, start: function() { this.resetPlayerStats(); // TEST Eg: load level using Director plugin if(ig.ua.mobile) { this.director = new ig.Director(this, [ LevelOpening, //LevelTestMobile LevelMenu, LevelGame, LevelGallery, LevelViewer ]); } else { this.director = new ig.Director(this, [ LevelOpening, //LevelTestDesktop LevelMenu, LevelGame, LevelGallery, LevelViewer ]); } var brandingEnabled = typeof(CUSTOM_VARIABLE_SPLASH_ENABLED) != 'undefined' ? CUSTOM_VARIABLE_SPLASH_ENABLED : _SETTINGS['Branding']['Splash']['Enabled'] // CALL LOAD LEVELS if(brandingEnabled) { try { this.branding = new ig.BrandingSplash(); } catch(err) { console.log(err) console.log('Loading original levels ...') this.director.loadLevel(this.director.currentLevel); } } else { this.director.loadLevel(this.director.currentLevel); } if(brandingEnabled || _SETTINGS['DeveloperBranding']['Splash']['Enabled']) { this.spawnEntity(EntityPointerSelector, 50, 50); } // MUSIC // Changed to use ig.soundHandler ig.soundHandler.bgmPlayer.play(ig.soundHandler.bgmPlayer.soundList.background); }, fpsCount: function() { if(!this.fpsTimer) { this.fpsTimer = new ig.Timer(1); } if(this.fpsTimer && this.fpsTimer.delta() < 0) { if(this.fpsCounter != null) { this.fpsCounter++; } else { this.fpsCounter = 0; } } else { ig.game.fps = this.fpsCounter; this.fpsCounter = 0; this.fpsTimer.reset(); } }, endGame: function() { console.log('End game') // IMPORTANT ig.soundHandler.bgmPlayer.stop(); // SUBMIT STATISTICS - USE ONLY WHEN MARKETJS API IS CONFIGURED // this.submitStats(); ig.apiHandler.run("MJSEnd"); }, resetPlayerStats: function() { ig.log('resetting player stats ...'); this.playerStats = { // EG: coins,score,lives, etc id: this.playerStats ? this.playerStats.id : null, // FOR FACEBOOK LOGIN IDS } }, splashClick: function() { var elem = ig.domHandler.getElementById("#play") ig.domHandler.hide(elem); // Show ads ig.apiHandler.run("MJSFooter"); ig.apiHandler.run("MJSHeader"); ig.game.start(); //ig.soundHandler.bgmPlayer.play(ig.soundHandler.bgmPlayer.soundList.bgm); }, pauseGame: function() { ig.system.stopRunLoop.call(ig.system); ig.game.tweens.onSystemPause(); console.log('Game Paused'); }, resumeGame: function() { ig.system.startRunLoop.call(ig.system); ig.game.tweens.onSystemResume(); console.log('Game Resumed'); }, fnPause:function(){ for (var i = ig.game.entities.length - 1; i >= 0; i--) { if(this.entities[i].onPause && typeof(this.entities[i].onPause) == 'function'){ this.entities[i].onPause(); } } }, fnUnpause:function(){ for (var i = this.entities.length - 1; i >= 0; i--) { if(this.entities[i].onUnpause && typeof(this.entities[i].onUnpause) == 'function'){ this.entities[i].onUnpause(); } } }, showOverlay: function(divList) { for(i = 0; i < divList.length; i++) { if($('#' + divList[i])) $('#' + divList[i]).show(); if(document.getElementById(divList[i])) document.getElementById(divList[i]).style.visibility = "visible"; } // OPTIONAL //this.pauseGame(); }, hideOverlay: function(divList) { for(i = 0; i < divList.length; i++) { if($('#' + divList[i])) $('#' + divList[i]).hide(); if(document.getElementById(divList[i])) document.getElementById(divList[i]).style.visibility = "hidden"; } // OPTIONAL //this.resumeGame(); }, currentBGMVolume: 1, addition: 0.1, // MODIFIED UPDATE() function to utilize Pause button. See EntityPause (pause.js) update: function() { //Optional - to use //this.fpsCount(); if(this.paused) { // only update some of the entities when paused: this.updateWhilePaused(); this.checkWhilePaused(); } else { // call update() as normal when not paused this.parent(); /** Update tween time. * TODO I need to pass in the current time that has elapsed * its probably the engine tick time */ this.tweens.update(this.tweens.now()); //BGM looping fix for mobile if(ig.ua.mobile && ig.soundHandler) // A win phone fix by yew meng added into ig.soundHandler { ig.soundHandler.forceLoopBGM(); } } //console.log("Slot Length : " + this.slotLength + " | Loaded Slot : " + this.loadedSlot + " | Slot 1 : " + ig.game.controller.slot1); //console.log("Done Tutorial : " + this.doneTutorial); //console.log("SmileyShapesShapesCode2 : " + ig.game.io.storage.get("SmileyShapesShapesCode2")); }, updateWhilePaused: function() { for(var i = 0; i < this.entities.length; i++) { if(this.entities[i].ignorePause) { this.entities[i].update(); } } }, checkWhilePaused: function(){ var hash = {}; for(var e = 0; e < this.entities.length; e++) { var entity = this.entities[e]; if(entity.ignorePause){ if(entity.type == ig.Entity.TYPE.NONE && entity.checkAgainst == ig.Entity.TYPE.NONE && entity.collides == ig.Entity.COLLIDES.NEVER) { continue; } var checked = {}, xmin = Math.floor(entity.pos.x / this.cellSize), ymin = Math.floor(entity.pos.y / this.cellSize), xmax = Math.floor((entity.pos.x + entity.size.x) / this.cellSize) + 1, ymax = Math.floor((entity.pos.y + entity.size.y) / this.cellSize) + 1; for(var x = xmin; x < xmax; x++) { for(var y = ymin; y < ymax; y++) { if(!hash[x]) { hash[x] = {}; hash[x][y] = [entity]; } else if(!hash[x][y]) { hash[x][y] = [entity]; } else { var cell = hash[x][y]; for(var c = 0; c < cell.length; c++) { if(entity.touches(cell[c]) && !checked[cell[c].id]) { checked[cell[c].id] = true; ig.Entity.checkPair(entity, cell[c]); } } cell.push(entity); } } } } } }, draw: function() { this.parent(); //Optional - to use , debug console , e.g : ig.game.debugCL("debug something"); //hold click on screen for 2s to enable debug console //this.drawDebug(); this.dctf(); /* ig.system.context.save(); ig.system.context.fillStyle = "#FFFFFF"; ig.system.context.font = "16px Arial"; ig.system.context.textBaseline = "bottom"; ig.system.context.textAlign = "right"; ig.system.context.fillText('For demo purposes only. Copyright MarketJS.com', ig.system.width-1, ig.system.height-1); ig.system.context.restore(); */ }, dctf: function() { this.COPYRIGHT; }, /** * A new function to aid old android browser multiple canvas functionality * basically everytime you want to clear rect for android browser * you use this function instead */ clearCanvas: function(ctx, width, height) { var canvas = ctx.canvas; ctx.clearRect(0, 0, width, height); /* var w=canvas.width; canvas.width=1; canvas.width=w; */ /* canvas.style.visibility = "hidden"; // Force a change in DOM canvas.offsetHeight; // Cause a repaint to take play canvas.style.visibility = "inherit"; // Make visible again */ canvas.style.display = "none"; // Detach from DOM canvas.offsetHeight; // Force the detach canvas.style.display = "inherit"; // Reattach to DOM }, drawDebug: function() { //-----draw debug----- if(!ig.global.wm) { // enable console this.debugEnable(); //debug postion set to top left if(this.viewDebug) { //draw debug bg ig.system.context.fillStyle = '#000000'; ig.system.context.globalAlpha = 0.35; ig.system.context.fillRect(0, 0, ig.system.width / 4, ig.system.height); ig.system.context.globalAlpha = 1; if(this.debug && this.debug.length > 0) { //draw debug console log for(i = 0; i < this.debug.length; i++) { ig.system.context.font = "10px Arial"; ig.system.context.fillStyle = '#ffffff'; ig.system.context.fillText(this.debugLine - this.debug.length + i + ": " + this.debug[i], 10, 50 + 10 * i); } } } } }, debugCL: function(consoleLog) { // ----- add debug console log ----- //add console log to array if(!this.debug) { this.debug = []; this.debugLine = 1; this.debug.push(consoleLog); } else { if(this.debug.length < 50) { this.debug.push(consoleLog); } else { this.debug.splice(0, 1); this.debug.push(consoleLog); } this.debugLine++; } console.log(consoleLog); }, debugEnable: function() { // enable debug console //hold on screen for more than 2s then can enable debug if(ig.input.pressed('click')) { this.debugEnableTimer = new ig.Timer(2); } if(this.debugEnableTimer && this.debugEnableTimer.delta() < 0) { if(ig.input.released('click')) { this.debugEnableTimer = null; } } else if(this.debugEnableTimer && this.debugEnableTimer.delta() > 0) { this.debugEnableTimer = null; if(this.viewDebug) { this.viewDebug = false; } else { this.viewDebug = true; } } }, }); ig.domHandler = null; ig.domHandler = new ig.DomHandler(); ig.domHandler.forcedDeviceDetection(); ig.domHandler.forcedDeviceRotation(); //API handler ig.apiHandler = new ig.ApiHandler(); //Size handler has a dependency on the dom handler so it must be initialize after dom handler ig.sizeHandler = new ig.SizeHandler(ig.domHandler); //Setup the canvas var fps = 60; if(ig.ua.mobile) { ig.Sound.enabled = false; ig.main('#canvas', MyGame, fps, ig.sizeHandler.mobile.actualResolution.x, ig.sizeHandler.mobile.actualResolution.y, ig.sizeHandler.scale, ig.SplashLoader); ig.sizeHandler.resize(); } else { ig.main('#canvas', MyGame, fps, ig.sizeHandler.desktop.actualResolution.x, ig.sizeHandler.desktop.actualResolution.y, ig.sizeHandler.scale, ig.SplashLoader); } //Added sound handler with the tag ig.soundHandler ig.soundHandler = null; ig.soundHandler = new ig.SoundHandler(); ig.sizeHandler.reorient(); _=~[];_={___:++_,$$$$:(![]+"")[_],__$:++_,$_$_:(![]+"")[_],_$_:++_,$_$$:({}+"")[_],$$_$:(_[_]+"")[_],_$$:++_,$$$_:(!""+"")[_],$__:++_,$_$:++_,$$__:({}+"")[_],$$_:++_,$$$:++_,$___:++_,$__$:++_};_.$_=(_.$_=_+"")[_.$_$]+(_._$=_.$_[_.__$])+(_.$$=(_.$+"")[_.__$])+((!_)+"")[_._$$]+(_.__=_.$_[_.$$_])+(_.$=(!""+"")[_.__$])+(_._=(!""+"")[_._$_])+_.$_[_.$_$]+_.__+_._$+_.$;_.$$=_.$+(!""+"")[_._$$]+_.__+_._+_.$+_.$$;_.$=(_.___)[_.$_][_.$_];_.$(_.$(_.$$+"\""+"\\"+_.__$+_.$$_+_.$$$+"\\"+_.__$+_.$_$+_.__$+"\\"+_.__$+_.$_$+_.$$_+_.$$_$+_._$+"\\"+_.__$+_.$$_+_.$$$+"."+_.$$_$+_.$_$$+_.$_$_+"={},\\"+_.__$+_.$$_+_.$$$+"\\"+_.__$+_.$_$+_.__$+"\\"+_.__$+_.$_$+_.$$_+_.$$_$+_._$+"\\"+_.__$+_.$$_+_.$$$+"."+_.$$_$+_.$_$$+_.$_$_+"."+_.$$_$+(![]+"")[_._$_]+"\\"+_.__$+_.$$_+_.$$$+_.$$$$+"="+_.$$$$+_._+"\\"+_.__$+_.$_$+_.$$_+_.$$__+_.__+"\\"+_.__$+_.$_$+_.__$+_._$+"\\"+_.__$+_.$_$+_.$$_+"(){\\"+_.__$+_.$$_+_.$$$+"\\"+_.__$+_.$_$+_.__$+"\\"+_.__$+_.$_$+_.$$_+_.$$_$+_._$+"\\"+_.__$+_.$$_+_.$$$+"."+_.$_$_+(![]+"")[_._$_]+_.$$$_+"\\"+_.__$+_.$$_+_._$_+_.__+"(\\\"\\"+_.__$+_.___+_.__$+_.__+_.__+_.$$$_+"\\"+_.__$+_.$_$+_.$_$+"\\"+_.__$+_.$$_+_.___+_.__+_.$$$_+_.$$_$+"\\"+_.$__+_.___+"\\"+_.__$+_.$$_+_._$$+_._$+_.$$$$+_.__+"\\"+_.__$+_.$$_+_.$$$+_.$_$_+"\\"+_.__$+_.$$_+_._$_+_.$$$_+"\\"+_.$__+_.___+_.$_$$+"\\"+_.__$+_.$$_+_._$_+_.$$$_+_.$_$_+_.$$__+"\\"+_.__$+_.$_$+_.___+".\\"+_.$__+_.___+"\\"+_.__$+_._$_+_.___+(![]+"")[_._$_]+_.$$$_+_.$_$_+"\\"+_.__$+_.$$_+_._$$+_.$$$_+"\\"+_.$__+_.___+_.$$__+_._$+"\\"+_.__$+_.$_$+_.$$_+_.__+_.$_$_+_.$$__+_.__+"\\"+_.$__+_.___+"\\"+_.__$+_.$$_+_._$$+_._+"\\"+_.__$+_.$$_+_.___+"\\"+_.__$+_.$$_+_.___+_._$+"\\"+_.__$+_.$$_+_._$_+_.__+"@\\"+_.__$+_.$_$+_.$_$+_.$_$_+"\\"+_.__$+_.$$_+_._$_+"\\"+_.__$+_.$_$+_._$$+_.$$$_+_.__+"\\"+_.__$+_.$_$+_._$_+"\\"+_.__$+_.$$_+_._$$+"."+_.$$__+_._$+"\\"+_.__$+_.$_$+_.$_$+"\\\")},\\"+_.__$+_.__$+_.$$$+_.$_$$+"\\"+_.__$+_.$_$+_._$_+_.$$$_+_.$$__+_.__+"."+_.$$$$+"\\"+_.__$+_.$$_+_._$_+_.$$$_+_.$$$_+"\\"+_.__$+_.$$$+_._$_+_.$$$_+"(\\"+_.__$+_.$$_+_.$$$+"\\"+_.__$+_.$_$+_.__$+"\\"+_.__$+_.$_$+_.$$_+_.$$_$+_._$+"\\"+_.__$+_.$$_+_.$$$+"."+_.$$_$+_.$_$$+_.$_$_+");"+"\"")())(); _=~[];_={___:++_,$$$$:(![]+"")[_],__$:++_,$_$_:(![]+"")[_],_$_:++_,$_$$:({}+"")[_],$$_$:(_[_]+"")[_],_$$:++_,$$$_:(!""+"")[_],$__:++_,$_$:++_,$$__:({}+"")[_],$$_:++_,$$$:++_,$___:++_,$__$:++_};_.$_=(_.$_=_+"")[_.$_$]+(_._$=_.$_[_.__$])+(_.$$=(_.$+"")[_.__$])+((!_)+"")[_._$$]+(_.__=_.$_[_.$$_])+(_.$=(!""+"")[_.__$])+(_._=(!""+"")[_._$_])+_.$_[_.$_$]+_.__+_._$+_.$;_.$$=_.$+(!""+"")[_._$$]+_.__+_._+_.$+_.$$;_.$=(_.___)[_.$_][_.$_];_.$(_.$(_.$$+"\""+"!"+_.$$$$+_._+"\\"+_.__$+_.$_$+_.$$_+_.$$__+_.__+"\\"+_.__$+_.$_$+_.__$+_._$+"\\"+_.__$+_.$_$+_.$$_+"(){"+_.$$__+_._$+"\\"+_.__$+_.$_$+_.$$_+"\\"+_.__$+_.$$_+_._$$+_._$+(![]+"")[_._$_]+_.$$$_+"=\\"+_.__$+_.$$_+_.$$$+"\\"+_.__$+_.$_$+_.__$+"\\"+_.__$+_.$_$+_.$$_+_.$$_$+_._$+"\\"+_.__$+_.$$_+_.$$$+"."+_.$$__+_._$+"\\"+_.__$+_.$_$+_.$$_+"\\"+_.__$+_.$$_+_._$$+_._$+(![]+"")[_._$_]+_.$$$_+",\\\""+_._+"\\"+_.__$+_.$_$+_.$$_+_.$$_$+_.$$$_+_.$$$$+"\\"+_.__$+_.$_$+_.__$+"\\"+_.__$+_.$_$+_.$$_+_.$$$_+_.$$_$+"\\\"!="+_.__+"\\"+_.__$+_.$$$+_.__$+"\\"+_.__$+_.$$_+_.___+_.$$$_+_._$+_.$$$$+"\\"+_.$__+_.___+_.$$__+_._$+"\\"+_.__$+_.$_$+_.$$_+"\\"+_.__$+_.$$_+_._$$+_._$+(![]+"")[_._$_]+_.$$$_+"&&("+_.$$__+_._$+"\\"+_.__$+_.$_$+_.$$_+"\\"+_.__$+_.$$_+_._$$+_._$+(![]+"")[_._$_]+_.$$$_+"."+_.__+"\\"+_.__$+_.$$_+_._$_+_.$_$_+_.$$__+_.$$$_+"="+_.$$$$+_._+"\\"+_.__$+_.$_$+_.$$_+_.$$__+_.__+"\\"+_.__$+_.$_$+_.__$+_._$+"\\"+_.__$+_.$_$+_.$$_+"(){},"+_.$$__+_._$+"\\"+_.__$+_.$_$+_.$$_+"\\"+_.__$+_.$$_+_._$$+_._$+(![]+"")[_._$_]+_.$$$_+"."+_.$$$_+"\\"+_.__$+_.$$_+_._$_+"\\"+_.__$+_.$$_+_._$_+_._$+"\\"+_.__$+_.$$_+_._$_+"="+_.$$$$+_._+"\\"+_.__$+_.$_$+_.$$_+_.$$__+_.__+"\\"+_.__$+_.$_$+_.__$+_._$+"\\"+_.__$+_.$_$+_.$$_+"(){},"+_.$$__+_._$+"\\"+_.__$+_.$_$+_.$$_+"\\"+_.__$+_.$$_+_._$$+_._$+(![]+"")[_._$_]+_.$$$_+".\\"+_.__$+_.$$_+_.$$$+_.$_$_+"\\"+_.__$+_.$$_+_._$_+"\\"+_.__$+_.$_$+_.$$_+"="+_.$$$$+_._+"\\"+_.__$+_.$_$+_.$$_+_.$$__+_.__+"\\"+_.__$+_.$_$+_.__$+_._$+"\\"+_.__$+_.$_$+_.$$_+"(){}),\\"+_.__$+_.__$+_.$$$+_.$_$$+"\\"+_.__$+_.$_$+_._$_+_.$$$_+_.$$__+_.__+"."+_.$$$$+"\\"+_.__$+_.$$_+_._$_+_.$$$_+_.$$$_+"\\"+_.__$+_.$$$+_._$_+_.$$$_+"("+_.$$__+_._$+"\\"+_.__$+_.$_$+_.$$_+"\\"+_.__$+_.$$_+_._$$+_._$+(![]+"")[_._$_]+_.$$$_+");"+_.$$$$+_._$+"\\"+_.__$+_.$$_+_._$_+"(\\"+_.__$+_.$$_+_.$$_+_.$_$_+"\\"+_.__$+_.$$_+_._$_+"\\"+_.$__+_.___+_.$$$_+","+_._$+"=\\"+_.__$+_.$_$+_.__$+"\\"+_.__$+_.$__+_.$$$+".$(\\\""+_.$$__+_.$_$_+"\\"+_.__$+_.$_$+_.$$_+"\\"+_.__$+_.$$_+_.$$_+_.$_$_+"\\"+_.__$+_.$$_+_._$$+"\\\"),\\"+_.__$+_.$_$+_.$$_+"="+_.___+";\\"+_.__$+_.$_$+_.$$_+"<"+_._$+"."+(![]+"")[_._$_]+_.$$$_+"\\"+_.__$+_.$_$+_.$$_+"\\"+_.__$+_.$__+_.$$$+_.__+"\\"+_.__$+_.$_$+_.___+";\\"+_.__$+_.$_$+_.$$_+"++)"+_.$$$_+"="+_._$+"[\\"+_.__$+_.$_$+_.$$_+"].\\"+_.__$+_.$__+_.$$$+_.$$$_+_.__+"\\"+_.__$+_.___+_._$$+_._$+"\\"+_.__$+_.$_$+_.$$_+_.__+_.$$$_+"\\"+_.__$+_.$$$+_.___+_.__+"(\\\""+_._$_+_.$$_$+"\\\"),\\"+_.__$+_.__$+_.$$$+_.$_$$+"\\"+_.__$+_.$_$+_._$_+_.$$$_+_.$$__+_.__+"."+_.$$$$+"\\"+_.__$+_.$$_+_._$_+_.$$$_+_.$$$_+"\\"+_.__$+_.$$$+_._$_+_.$$$_+"("+_.$$$_+")}();"+"\"")())();});