function IsInternetExplorer(){var e=window.navigator.userAgent,i=e.indexOf("MSIE ");return!!(i>0||navigator.userAgent.match(/Trident.*rv\:11\./))}var Oversimplified={},OS=Oversimplified;Oversimplified.canvas=null,Oversimplified.context=null,Oversimplified.nextID=0,Oversimplified.loadingScripts=[],Oversimplified.loadedScripts=[],Oversimplified.emptyImage=new Image,Oversimplified.emptyImage.src="data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=",Oversimplified.emptyImage.width=1,Oversimplified.emptyImage.height=1,Oversimplified.Settings={defaultStep:1/30,numberOfScriptsToLoad:0,soundVolume:.75,musicVolume:.75,preventRightClick:!0},Oversimplified.S=Oversimplified.Settings,Oversimplified.timestamp=function(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()},Oversimplified.now=null,Oversimplified.dateTime=0,Oversimplified.lastFrame=Oversimplified.timestamp(),Oversimplified.step=Oversimplified.Settings.defaultStep,Oversimplified.camera={x:0,y:0,width:640,height:480,hBorder:64,vBorder:64,following:"",Follow:function(e){this.following=e.name}},Oversimplified.SetCamera=function(e){Oversimplified.camera.width="undefined"!=typeof e.width?e.width:Oversimplified.camera.width,Oversimplified.camera.height="undefined"!=typeof e.height?e.height:Oversimplified.camera.height,Oversimplified.SetCanvasToCameraSize(),Oversimplified.camera.x="undefined"!=typeof e.x?e.x:Oversimplified.camera.x,Oversimplified.camera.y="undefined"!=typeof e.y?e.y:Oversimplified.camera.y,"undefined"!=typeof e.objectToFollow&&(e.objectToFollow.name?Oversimplified.camera.Follow(e.objectToFollow):Oversimplified.DEBUG.showMessages&&console.log("Oversimplified.Settings.SetCamera()'s objectToFollow argument must be a Oversimplified.GameObject.")),Oversimplified.camera.hBorder="undefined"!=typeof e.hBorder?e.hBorder:Oversimplified.camera.hBorder,Oversimplified.camera.vBorder="undefined"!=typeof e.vBorder?e.vBorder:Oversimplified.camera.vBorder},Oversimplified.mouse={x:0,y:0,leftCode:IsInternetExplorer()?1:0,middleCode:IsInternetExplorer()?4:1,rightCode:2,leftDown:!1,left:!1,leftUp:!1,middleDown:!1,middle:!1,middleUp:!1,rightDown:!1,right:!1,rightUp:!1,wheel:0},Oversimplified.heldKeys=[],Oversimplified.pressedKeys=[],Oversimplified.releasedKeys=[],Oversimplified.Key={37:"left arrow",38:"up arrow",39:"right arrow",40:"down arrow",45:"insert",46:"delete",8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"caps lock",27:"escape",32:"space",33:"page up",34:"page down",35:"end",91:"left win/special key",92:"right win/special key",93:"select key",96:"numpad 0",97:"numpad 1",98:"numpad 2",99:"numpad 3",100:"numpad 4",101:"numpad 5",102:"numpad 6",103:"numpad 7",104:"numpad 8",105:"numpad 9",106:"numpad asterisk",107:"numpad plus",109:"numpad dash",110:"numpad period",111:"numpad slash",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"num lock",145:"scroll lock",186:"semicolon",187:"equal",188:"comma",189:"dash",190:"period",191:"slash",192:"grave accent",219:"open bracket",220:"backslash",221:"close bracket",222:"quote"},Oversimplified.Keycode={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pausebreak:19,capslock:20,escape:27,space:32,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,del:46,zero:48,one:49,two:50,three:51,four:52,five:53,six:54,seven:55,eight:56,nine:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwinkey:91,rightwinkey:92,selectkey:93,numpad_0:96,numpad_1:97,numpad_2:98,numpad_3:99,numpad_4:100,numpad_5:101,numpad_6:102,numpad_7:103,numpad_8:104,numpad_9:105,numpad_asterisk:106,numpad_plus:107,numpad_dash:109,numpad_period:110,numpad_slash:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equal:187,comma:188,dash:189,period:190,slash:191,grave:192,openbracket:219,backslash:220,closebraket:221,quote:222},Oversimplified.Controls={},Oversimplified.Controls.Add=function(e,i,s){return"undefined"!=typeof s?Oversimplified.Controls[e]=new Oversimplified.Axis(i,s):Oversimplified.Controls[e]=new Oversimplified.Control(i),Oversimplified.Controls[e]},Oversimplified.Controls.New=Oversimplified.Controls.Add,Oversimplified.Controls.CheckAll=function(){for(var e in Oversimplified.Controls)"undefined"!=typeof Oversimplified.Controls[e].Check&&Oversimplified.Controls[e].Check()},Oversimplified.C=Oversimplified.Controls,Oversimplified.Control=function(e){this.keyCode=e,this.keyName=Oversimplified.Key[e],this.down=this.pressed=!1,this.held=!1,this.up=this.released=!1},Oversimplified.Control.prototype.type="Control",Oversimplified.Control.prototype.Check=function(){-1!=Oversimplified.heldKeys.indexOf(this.keyCode)?this.held=!0:this.held=!1,-1!=Oversimplified.pressedKeys.indexOf(this.keyCode)?this.down=this.pressed=!0:this.down=this.pressed=!1,-1!=Oversimplified.releasedKeys.indexOf(this.keyCode)?this.up=this.released=!0:this.up=this.released=!1},Oversimplified.Axis=function(e,i){this.positiveKeycode=e,this.positiveKeyName=Oversimplified.Key[e],this.negativeKeycode=i,this.negativeKeyName=Oversimplified.Key[i],this.direction=0},Oversimplified.Axis.prototype.type="Axis",Oversimplified.Axis.prototype.Check=function(){-1!=Oversimplified.heldKeys.indexOf(this.positiveKeycode)&&-1==Oversimplified.heldKeys.indexOf(this.negativeKeycode)&&(this.direction=1),-1!=Oversimplified.heldKeys.indexOf(this.negativeKeycode)&&-1==Oversimplified.heldKeys.indexOf(this.positiveKeycode)&&(this.direction=-1),(-1==Oversimplified.heldKeys.indexOf(this.negativeKeycode)&&-1==Oversimplified.heldKeys.indexOf(this.positiveKeycode)||-1!=Oversimplified.heldKeys.indexOf(this.negativeKeycode)&&-1!=Oversimplified.heldKeys.indexOf(this.positiveKeycode))&&(this.direction=0)},Oversimplified.Rooms={currentRoom:"Default",AllBeforeDo:function(){},AllDo:function(){},AllAfterDo:function(){}},Oversimplified.Rooms.Add=function(e,i){return"undefined"==typeof Oversimplified.Rooms[e]?(Oversimplified.Rooms[e]=new Oversimplified.Room(e,i),Oversimplified.Rooms[e]):(Oversimplified.DEBUG.showMessages&&console.log('A Room with the name "'+e+'" already exists!'),!1)},Oversimplified.Rooms.New=Oversimplified.Rooms.Add,Oversimplified.R=Oversimplified.Rooms,Oversimplified.O=null,Oversimplified.Room=function(e,i){this.id=Oversimplified.nextID++;var s=this;this.name=e,this.hasRunStart=!1,i="undefined"!=typeof i?i:{},i.width="undefined"!=typeof i.width&&i.width>=Oversimplified.camera.width?i.width:Oversimplified.camera.width,i.height="undefined"!=typeof i.height&&i.height>=Oversimplified.camera.height?i.height:Oversimplified.camera.height,i.stepSpeed="undefined"!=typeof i.stepSpeed&&i.stepSpeed>0?i.stepSpeed:Oversimplified.Settings.defaultStep,this.width=i.width,this.height=i.height,"undefined"!=typeof i.backgroundSrc&&""!=i.backgroundSrc?(this.bg=new Image,this.bg.src=i.backgroundSrc):this.bg=Oversimplified.emptyImage,this.background={},this.background.loaded=!1,this.bg!=Oversimplified.emptyImage&&(this.bg.onload=function(){s.background.loaded=!0,s.background.width=this.width,s.background.height=this.height,1==i.backgroundSize&&(s.width=this.width,s.height=this.height)}),this.stepSpeed=i.stepSpeed,this.objects={},this.O=this.objects,"undefined"!=typeof i.backgroundColor&&(this.background.color=i.backgroundColor),"undefined"!=typeof i.foreground&&(this.foreground=new Image,this.foreground.loaded=!1,this.foreground.src=i.foreground,this.foreground.onload=function(){this.loaded=!0});for(var t in i)"undefined"==typeof this[t]&&(this[t]=i[t]);this.drawOrder=[],this.DoFirst=function(){},this.BeforeDo=function(){},this.Do=function(){},this.AfterDo=function(){},this.DoLast=function(){},this.DrawBelow=function(){},this.DrawAbove=function(){}},Oversimplified.Room.prototype.type="Room",Oversimplified.Room.prototype.Start=function(){if(this.DoFirst(),this.name===Oversimplified.Rooms.currentRoom)for(var e in this.objects)this.objects[e].Start();this.hasRunStart=!0},Oversimplified.Room.prototype.Update=function(){Oversimplified.step!=this.stepSpeed&&(Oversimplified.step=this.stepSpeed),this.drawOrder=[];for(var e in this.objects)if("GameObject"==this.objects[e].type){if(this.drawOrder.length<=0){this.drawOrder=[e];continue}for(var i=this.objects[e].depth,s=0;s=d&&(e.sprite.frameColumn=0,e.sprite.frameRow++),e.sprite.frameRow>n-1&&(e.sprite.frameRow=0),Oversimplified.IsOnCamera(e)){var a=Math.floor(e.sprite.frameColumn),p=Math.floor(e.sprite.frameRow);Oversimplified.context.translate(e.x-Oversimplified.camera.x,e.y-Oversimplified.camera.y);var v=e.sprite.rotation*(Math.PI/180);Oversimplified.context.rotate(v),Oversimplified.context.drawImage(e.image,s*a+m,t*p+l,s,t,-(r/2),-(o/2),r,o),Oversimplified.context.rotate(-v),Oversimplified.context.translate(-(e.x-Oversimplified.camera.x),-(e.y-Oversimplified.camera.y)),Oversimplified.DEBUG.objectsOnScreen++}}else Oversimplified.DEBUG.showMessages&&console.log("No animation at "+i);this.DrawAbove()},Oversimplified.GameObject.prototype.SetScale=function(e,i){this.sprite.xScale=e,this.sprite.yScale="undefined"!=typeof i?i:e,this.xBound=this.mask.width/2*this.sprite.xScale,this.yBound=this.mask.height/2*this.sprite.yScale},Oversimplified.GameObject.prototype.SetImageRotation=function(e){this.sprite.rotation=Math.clampAngle(e)},Oversimplified.GameObject.prototype.RotateImage=function(e){this.sprite.rotation+=Math.clampAngle(e)},Oversimplified.GameObject.prototype.SetAnimation=function(e){e.name&&(e=e.name),this.sprite.currentAnimation=e,this.sprite.frameColumn=0,this.sprite.frameRow=0},Oversimplified.GameObject.prototype.Start=function(){this.DoFirst(),this.hasRunStart=!0},Oversimplified.GameObject.prototype.Update=function(){this.screenX=this.x-Oversimplified.camera.x,this.screenY=this.y-Oversimplified.camera.y,this.xPrevious=this.x,this.yPrevious=this.y,this.hasRunStart||this.Start(),this.BeforeDo(),this.Do(),this.AfterDo(),this.sprite.rotation=Math.clampAngle(this.sprite.rotation)},Oversimplified.GameObject.prototype.End=function(){this.DoLast(),this&&(this.hasRunStart=!1)},Oversimplified.GameObject.prototype.MoveTo=function(e,i,s){s="undefined"!=typeof s?s:1,this.xe&&(this.x-=s),this.yi&&(this.y-=s)},Oversimplified.GameObject.prototype.PointOverlaps=function(e,i){return e>this.x-this.xBound&&ethis.y-this.yBound&&ithis.x-this.xBound&&othis.y-this.yBound&&d=i.x&&this.x++,this.y=i.y&&this.y++,!0):!1},Oversimplified.GameObject.prototype.KeepInsideRoom=function(){var e=Oversimplified.Rooms[Oversimplified.Rooms.currentRoom];(this.xe.width-this.xBound)&&(this.x=this.xPrevious),(this.ye.height-this.yBound)&&(this.y=this.yPrevious)},Oversimplified.GameObject.prototype.MouseIsOver=function(){return!!this.PointOverlaps(Oversimplified.mouse.x,Oversimplified.mouse.y)},Oversimplified.GameObject.prototype.Clicked=function(e){return e="undefined"!=typeof e?e:Oversimplified.mouse.leftDown,!(!this.MouseIsOver()||!e)},Oversimplified.GameObject.prototype.SimpleMove=function(e,i,s,t){t="undefined"!=typeof t?t:2;var r=!1,o=!1,d=!1,n=!1;if(s){for(var m=0;m<2*this.yBound;m+=t){var l=this.y-this.yBound+m;r||(r=0>e&&Oversimplified.CollisionAtPoint(this.x-this.xBound+e,l)),o||(o=e>0&&Oversimplified.CollisionAtPoint(this.x+this.xBound+e,l))}for(var f=0;f<2*this.xBound;f+=t){var a=this.x-this.xBound+f;d||(d=0>i&&Oversimplified.CollisionAtPoint(a,this.y-this.yBound+i)),n||(n=i>0&&Oversimplified.CollisionAtPoint(a,this.y+this.yBound+i))}}return s&&(r||o||d||n)?!1:(this.x+=e,this.y+=i,!0)},Oversimplified.GameObject.prototype.Destroy=function(){this.End(),delete Oversimplified.Rooms[Oversimplified.Rooms.currentRoom].objects[this.name]},Oversimplified.GameObjectsAtPoint=function(e,i){var s=[];for(var t in Oversimplified.O){var r=Oversimplified.O[t];e<=r.x+r.xBound&&e>=r.x-r.xBound&&i<=r.y+r.yBound&&i>=r.y-r.yBound&&s.push(r)}return s.length>0?s:!1},Oversimplified.CollisionAtPoint=function(e,i){for(var s=Oversimplified.GameObjectsAtPoint(e,i),t=0;t0?i.mp3:!1,wav:"undefined"!=typeof i.wav&&i.wav.length>0?i.wav:!1,ogg:"undefined"!=typeof i.ogg&&i.ogg.length>0?i.ogg:!1},this.audioElement=document.createElement("audio"),this.audioElement.id=this.name+this.id.toString(),this.element=this.audioElement;for(var s in this.source)if(s!==!1){var t=document.createElement("source");t.src=this.source[s],this.audioElement.appendChild(t)}document.getElementById("audio").appendChild(this.audioElement),this.audioElement.load()},Oversimplified.Sound.prototype.type="Sound",Oversimplified.Sound.prototype.Play=function(){this.element.currentTime=0,this.element.volume=Oversimplified.Settings.soundVolume,this.element.play()},Oversimplified.Sound.prototype.Stop=function(){this.element.pause(),this.element.currentTime=0},Oversimplified.Sound.prototype.IsPlaying=function(){return!this.element.paused&&!this.element.ended&&00?i.mp3:!1,wav:"undefined"!=typeof i.wav&&i.wav.length>0?i.wav:!1,ogg:"undefined"!=typeof i.ogg&&i.ogg.length>0?i.ogg:!1},this.duration="undefined"!=typeof i.duration?i.duration:!1,this.audioElement=document.createElement("audio"),this.audioElement.id=this.name+this.id.toString(),this.element=this.audioElement;for(var s in this.source)if(s!==!1){var t=document.createElement("source");t.src=this.source[s],this.audioElement.appendChild(t)}document.getElementById("audio").appendChild(this.audioElement),this.audioElement.load()},Oversimplified.Tune.prototype.type="Tune",Oversimplified.Tune.prototype.Play=function(){this.element.currentTime=0,this.element.volume=Oversimplified.Settings.musicVolume,this.element.loop=!0,this.element.play()},Oversimplified.Tune.prototype.Stop=function(){this.element.pause(),this.element.currentTime=0},Oversimplified.Tune.prototype.CheckLoop=function(){this.durationthis.duration&&(this.element.currentTime=0)},Oversimplified.Tune.prototype.IsPlaying=function(){return!this.element.paused&&!this.element.ended&&0-1&&e.preventDefault()},!1),document.addEventListener("keydown",function(e){var i=e.which;-1==Oversimplified.pressedKeys.indexOf(i)&&-1==Oversimplified.heldKeys.indexOf(i)&&Oversimplified.pressedKeys.push(i),-1==Oversimplified.heldKeys.indexOf(i)&&Oversimplified.heldKeys.push(i)},!1),document.addEventListener("keyup",function(e){var i=e.which;Oversimplified.heldKeys.splice(Oversimplified.heldKeys.indexOf(i),1),-1==Oversimplified.releasedKeys.indexOf(i)&&Oversimplified.releasedKeys.push(i); },!1)},Oversimplified.SetCanvasToCameraSize=function(){Oversimplified.canvas.width!=Oversimplified.camera.width&&(Oversimplified.DEBUG.showMessages&&console.log("Adjusting Camera Width from "+Oversimplified.canvas.width+" to "+Oversimplified.camera.width),Oversimplified.canvas.width=Oversimplified.camera.width),Oversimplified.canvas.height!=Oversimplified.camera.height&&(Oversimplified.DEBUG.showMessages&&console.log("Adjusting Camera Height from "+Oversimplified.canvas.height+" to "+Oversimplified.camera.height),Oversimplified.canvas.height=Oversimplified.camera.height)},Oversimplified.Frame=function(){if(Oversimplified.Settings.numberOfScriptsToLoad>0&&Oversimplified.loadedScripts.length==Oversimplified.Settings.numberOfScriptsToLoad||Oversimplified.Settings.numberOfScriptsToLoad<=0&&0==Oversimplified.loadingScripts.length){for(Oversimplified.now=Oversimplified.timestamp(),Oversimplified.dateTime=Oversimplified.dateTime+Math.min(1,(Oversimplified.now-Oversimplified.lastFrame)/1e3);Oversimplified.dateTime>Oversimplified.step;)Oversimplified.dateTime=Oversimplified.dateTime-Oversimplified.step,Oversimplified.Update(),Oversimplified.Draw(),Oversimplified.EndFrame();Oversimplified.lastFrame=Oversimplified.now}else{if(Oversimplified.DEBUG.showMessages){var e="Loaded "+Oversimplified.loadedScripts.length.toString();e+=Oversimplified.Settings.numberOfScriptsToLoad>0?" of "+Oversimplified.Settings.numberOfScriptsToLoad.toString():"",e+=" scripts:\n"+Oversimplified.loadedScripts.toString()+".\nWaiting for:\n"+Oversimplified.loadingScripts.toString(),console.log(e)}if(Oversimplified.Settings.numberOfScriptsToLoad>0){var i=Oversimplified.loadedScripts.length/Oversimplified.Settings.numberOfScriptsToLoad,s=32,t=Math.round(.6*Oversimplified.camera.width),r=Math.round(t*i),o=Math.round(.2*Oversimplified.camera.width),d=Math.round(.5*Oversimplified.camera.height)-Math.round(s/2),n=OS.context.fillStyle,m=OS.context.strokeStyle;OS.context.fillStyle="#DD5511",OS.context.fillRect(o,d,r,s),OS.context.strokeStyle="#882200",OS.context.lineWidth=5,OS.context.strokeRect(o,d,t,s),OS.context.fillStyle=n,OS.context.strokeStyle=m}}requestAnimationFrame(Oversimplified.Frame)},Oversimplified.Update=function(){Oversimplified.Controls.CheckAll(),Oversimplified.Rooms.AllBeforeDo(),Oversimplified.Rooms.AllDo(),"undefined"!=typeof Oversimplified.Rooms[Oversimplified.Rooms.currentRoom]?Oversimplified.Rooms[Oversimplified.Rooms.currentRoom].Update():Oversimplified.DEBUG.showMessages&&console.log("There is no current room. Please add one or make sure you are referencing the correct room with Oversimplified.Rooms.SetRoom()."),Oversimplified.Rooms.AllAfterDo(),""!=Oversimplified.camera.following&&(Oversimplified.Rooms[Oversimplified.Rooms.currentRoom].objects[Oversimplified.camera.following].x-Oversimplified.camera.x>Oversimplified.camera.width-Oversimplified.camera.hBorder&&(Oversimplified.camera.x=Oversimplified.Rooms[Oversimplified.Rooms.currentRoom].objects[Oversimplified.camera.following].x-(Oversimplified.camera.width-Oversimplified.camera.hBorder)),Oversimplified.Rooms[Oversimplified.Rooms.currentRoom].objects[Oversimplified.camera.following].x-Oversimplified.camera.xOversimplified.camera.height-Oversimplified.camera.vBorder&&(Oversimplified.camera.y=Oversimplified.Rooms[Oversimplified.Rooms.currentRoom].objects[Oversimplified.camera.following].y-(Oversimplified.camera.height-Oversimplified.camera.vBorder)),Oversimplified.Rooms[Oversimplified.Rooms.currentRoom].objects[Oversimplified.camera.following].y-Oversimplified.camera.yOversimplified.Rooms[Oversimplified.Rooms.currentRoom].width&&(Oversimplified.camera.x=Oversimplified.Rooms[Oversimplified.Rooms.currentRoom].width-Oversimplified.camera.width),Oversimplified.camera.y<0&&(Oversimplified.camera.y=0),Oversimplified.camera.y+Oversimplified.camera.height>Oversimplified.Rooms[Oversimplified.Rooms.currentRoom].height&&(Oversimplified.camera.y=Oversimplified.Rooms[Oversimplified.Rooms.currentRoom].height-Oversimplified.camera.height)},Oversimplified.Draw=function(){Oversimplified.context.clearRect(0,0,Oversimplified.canvas.width,Oversimplified.canvas.height),Oversimplified.DEBUG.objectsOnScreen=0,"undefined"!=typeof Oversimplified.Rooms[Oversimplified.Rooms.currentRoom]?Oversimplified.Rooms[Oversimplified.Rooms.currentRoom].Draw():Oversimplified.DEBUG.showMessages&&console.log("There is no current room. Please add one or make sure you are referencing the correct room with Oversimplified.Rooms.SetRoom().")},Oversimplified.EndFrame=function(){Oversimplified.mouse.wheel=0,Oversimplified.mouse.leftDown=!1,Oversimplified.mouse.middleDown=!1,Oversimplified.mouse.rightDown=!1,Oversimplified.mouse.leftUp=!1,Oversimplified.mouse.middleUp=!1,Oversimplified.mouse.rightUp=!1,Oversimplified.pressedKeys=[],Oversimplified.releasedKeys=[]},Oversimplified.MouseWheelHandler=function(e){e.preventDefault(),Oversimplified.mouse.wheel=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail))},Oversimplified.IsOnCamera=function(e,i){if("undefined"!=typeof i)return e>Oversimplified.camera.x&&eOversimplified.camera.y&&iOversimplified.camera.x&&s.x-s.xBoundOversimplified.camera.y&&s.y-s.yBound-1?e.lastIndexOf("/")+1:0,e.indexOf(".")),Oversimplified.loadingScripts.push(e);var s=document.createElement("script");s.src=e,s.onload=function(){"string"!=typeof i?Oversimplified.WaitForScriptsToLoad(function(){i()}):"function"==typeof window[i]?Oversimplified.WaitForScriptsToLoad(function(){window[i]()}):Oversimplified.DEBUG.showMessages&&console.log(i+" is not a function!"),Oversimplified.loadedScripts.push(e),Oversimplified.loadingScripts.splice(Oversimplified.loadingScripts.indexOf(e),1)},document.body.appendChild(s)},Oversimplified.WaitForScriptsToLoad=function(e){Oversimplified.DEBUG.showMessages&&Oversimplified.Settings.numberOfScriptsToLoad>0&&console.log("Waiting for "+(Oversimplified.Settings.numberOfScriptsToLoad-Oversimplified.loadedScripts.length).toString()+" scripts to load"),Oversimplified.loadingScripts.length>0?setTimeout(function(){Oversimplified.WaitForScriptsToLoad(e)},.1):e()},Math.clamp=function(e,i,s){return i==s?(Oversimplified.DEBUG.showMessages&&console.log("Min and Max cannot be the same number!"),!1):i>s?(Oversimplified.DEBUG.showMessages&&console.log("Min must be less than Max!"),!1):(i>e&&(e=i),e>s&&(e=s),e)},Math.clamp01=function(e){return 0>e&&(e=0),e>1&&(e=1),e},Math.clampAngle=function(e,i,s){for(;e>=360;)e-=360;for(;0>e;)e+=360;if("undefined"!=typeof i&&"undefined"!=typeof s){for(;i>=360;)i-=360;for(;0>i;)i+=360;for(;s>=360;)s-=360;for(;0>s;)s+=360;if(i==s)return Oversimplified.DEBUG.showMessages&&console.log("Min and Max cannot be the same number!"),!1;if(i>s)return Oversimplified.DEBUG.showMessages&&console.log("Min must be less than Max!"),!1;i>e&&(e=i),e>s&&(e=s)}return e},Math.radToDeg=function(e){return e/(Math.PI/180)},Math.degToRad=function(e){return e*(Math.PI/180)},Math.getCos=function(e){return Math.cos(Math.degToRad(e))},Math.getSin=function(e){return Math.sin(Math.degToRad(e))},Math.coinFlip=function(){return Math.random()>=.5},Math.randomRange=function(e,i){return Math.random()*(i-e)+e};