app.js 112 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565
  1. function initSplash() {
  2. gameState = "splash", resizeCanvas(), 1 != audioType || muted || music.play(), initStartScreen()
  3. }
  4. function initStartScreen() {
  5. gameState = "start", userInput.removeHitArea("moreGames"), 1 == audioType && (musicTween && musicTween.kill(), musicTween = TweenLite.to(music, 1, {volume: .5, ease: "Linear.easeNone"})), background = new Elements.Background(assetLib.getData("background"), canvas.width, canvas.height), userInput.addHitArea("mute", butEventHandler, null, "rect", {aRect: [538, 0, canvas.width, 60]}, !0);
  6. var a = {oImgData: assetLib.getData("uiButs"), aPos: [canvas.width / 2 + 4, 610], scale: 1, frame: 0},
  7. b = {oImgData: assetLib.getData("uiButs"), aPos: [canvas.width / 2 + 4, 735], scale: 1, frame: 2};
  8. // c = {oImgData: assetLib.getData("uiButs"), aPos: [104, 735], scale: 1, frame: 3};
  9. userInput.addHitArea("selectCourse", butEventHandler, null, "image", a),
  10. userInput.addHitArea("moreGames", butEventHandler, null, "image", b)
  11. /*, userInput.addHitArea("credits", butEventHandler, null, "image", c)*/;
  12. var d = new Array(a, b);
  13. panel = new Elements.Panel(assetLib.getData("panels1"), assetLib.getData("panels2"), assetLib.getData("bigNumbersDark"), assetLib.getData("smallNumbers"), gameState, d, canvas.width, canvas.height), panel.startTween1(), previousTime = (new Date).getTime(), aPickUps = new Array;
  14. for (var e = 0, f = 0; 10 > f; f++) {
  15. var g = new Elements.FallingGem(assetLib.getData("pickUps"), {x: Math.random() * canvas.width, y: Math.random() * canvas.height, id: ++e % 5}, canvas.width, canvas.height);
  16. aPickUps.push(g)
  17. }
  18. updateStartScreenEvent()
  19. }
  20. function initCreditsScreen() {
  21. gameState = "credits";
  22. var a = {oImgData: assetLib.getData("uiButs"), aPos: [104, 735], scale: 1, frame: 4};
  23. userInput.addHitArea("backFromCredits", butEventHandler, null, "image", a);
  24. var b = new Array(a);
  25. panel = new Elements.Panel(assetLib.getData("panels1"), assetLib.getData("panels2"), assetLib.getData("bigNumbersDark"), assetLib.getData("smallNumbers"), gameState, b, canvas.width, canvas.height), panel.startTween2(), previousTime = (new Date).getTime(), updateCreditsScreenEvent()
  26. }
  27. function initCourseSelectScreen() {
  28. gameState = "courseSelect", levelScore = 0, totalScore = 0, levelNum = 0;
  29. var a = {oImgData: assetLib.getData("uiButs"), aPos: [104, 735], scale: 1, frame: 4}, b = {oImgData: assetLib.getData("uiButs"), aPos: [460, 300], scale: 1, frame: 0}, c = {oImgData: assetLib.getData("uiButs"), aPos: [460, 553], scale: 1, frame: 0};
  30. userInput.addHitArea("backFromCourseSelect", butEventHandler, null, "image", a), userInput.addHitArea("startGame", butEventHandler, {courseNum: 0}, "image", b), userInput.addHitArea("startGame", butEventHandler, {courseNum: 1}, "image", c);
  31. var d = new Array(a, b, c);
  32. panel = new Elements.Panel(assetLib.getData("panels1"), assetLib.getData("panels2"), assetLib.getData("bigNumbersDark"), assetLib.getData("smallNumbers"), gameState, d, canvas.width, canvas.height), panel.aLevelStore = saveDataHandler.aLevelStore, panel.startTween1(), aPickUps = new Array;
  33. for (var e = 0, f = 0; 10 > f; f++) {
  34. var g = new Elements.FallingGem(assetLib.getData("pickUps"), {x: Math.random() * canvas.width, y: Math.random() * canvas.height, id: ++e % 5}, canvas.width, canvas.height);
  35. aPickUps.push(g)
  36. }
  37. previousTime = (new Date).getTime(), updateCourseSelectScreenEvent()
  38. }
  39. function initGame() {
  40. gameState = "game", 1 == audioType && (musicTween.kill(), musicTween = TweenLite.to(music, 2, {volume: 0, ease: "Linear.easeNone"})), userInput.addHitArea("pause", butEventHandler, null, "rect", {aRect: [480, 0, 538, 60]}, !0), userInput.addHitArea("gameTouch", butEventHandler, {isDraggable: !0, multiTouch: !0}, "rect", {aRect: [0, 0, canvas.width, canvas.height]}, !0), hud = new Elements.Hud(assetLib.getData("hud"), assetLib.getData("bigNumbersLight"), assetLib.getData("bigNumbersDark"), assetLib.getData("smallNumbers"), {hole: levelNum + 1, par: aLevelData[courseNum][levelNum].par, shotNum: 1, pickUps: 0}, canvas.width, canvas.height);
  41. var a = new Array, b = new Array;
  42. aPickUps = new Array, aBounces = new Array;
  43. for (var c = 0, d = 0; d < aLevelData[courseNum][levelNum].aData.length; d++)
  44. if ("tee" == aLevelData[courseNum][levelNum].aData[d].type)
  45. ball = new Elements.Ball(assetLib.getData("ball"), assetLib.getData("remarks"), {x: aLevelData[courseNum][levelNum].aData[d].p0.x, y: aLevelData[courseNum][levelNum].aData[d].p0.y}, ballCallback, canvas.width, canvas.height);
  46. else if ("hole" == aLevelData[courseNum][levelNum].aData[d].type)
  47. oHolePos = {x: aLevelData[courseNum][levelNum].aData[d].p0.x, y: aLevelData[courseNum][levelNum].aData[d].p0.y};
  48. else if ("pickUp" == aLevelData[courseNum][levelNum].aData[d].type) {
  49. var e = new Elements.PickUp(assetLib.getData("pickUps"), {x: aLevelData[courseNum][levelNum].aData[d].p0.x, y: aLevelData[courseNum][levelNum].aData[d].p0.y, id: ++c % 5}, canvas.width, canvas.height);
  50. aPickUps.push(e)
  51. } else
  52. "wall" == aLevelData[courseNum][levelNum].aData[d].type ? a.push({p0: aLevelData[courseNum][levelNum].aData[d].p0, p1: aLevelData[courseNum][levelNum].aData[d].p1, b: 1, f: 1}) : "slope" == aLevelData[courseNum][levelNum].aData[d].type.slice(0, 5) ? b.push({type: "slope", dir: parseInt(aLevelData[courseNum][levelNum].aData[d].type.slice(-1)), p0: aLevelData[courseNum][levelNum].aData[d].p0, p1: aLevelData[courseNum][levelNum].aData[d].p1}) : "mud" == aLevelData[courseNum][levelNum].aData[d].type ? b.push({type: "mud", p0: aLevelData[courseNum][levelNum].aData[d].p0, p1: aLevelData[courseNum][levelNum].aData[d].p1}) : "water" == aLevelData[courseNum][levelNum].aData[d].type ? b.push({type: "water", p0: aLevelData[courseNum][levelNum].aData[d].p0, p1: aLevelData[courseNum][levelNum].aData[d].p1}) : "teleport" == aLevelData[courseNum][levelNum].aData[d].type && b.push({type: "teleport", p0: aLevelData[courseNum][levelNum].aData[d].p0, p1: aLevelData[courseNum][levelNum].aData[d].p1});
  53. ball.aSurfaces = b, oPosData = {prevBallX: ball.oData.x, prevBallY: ball.oData.y, stageX: -(levelWidth - canvas.width) / 2, stageY: -(levelHeight - canvas.height) / 2, targStageX: -(levelWidth - canvas.width) / 2, targStageY: -(levelHeight - canvas.height) / 2, startDragX: 0, startDragY: 0, startStageX: 0, startStageY: 0}, gameTouchState = 0, level = new Elements.Level(assetLib.getData("level" + courseNum + levelNum), canvas.width, canvas.height), arrow = new Elements.Arrow(assetLib.getData("arrow"), canvas.width, canvas.height), physics2D = new Utils.Physics2D(a, ball), playSound("start"), previousTime = (new Date).getTime(), updateGameEvent()
  54. }
  55. function butEventHandler(a, b) {
  56. switch (a) {
  57. case "langSelect":
  58. console.log(b.lang), curLang = b.lang, ctx.clearRect(0, 0, canvas.width, canvas.height), userInput.removeHitArea("langSelect"), initLoadAssets();
  59. break;
  60. case "selectCourse":
  61. playSound("click"), userInput.removeHitArea("selectCourse"), userInput.removeHitArea("moreGames"), userInput.removeHitArea("credits"), initCourseSelectScreen();
  62. break;
  63. case "backFromCourseSelect":
  64. playSound("click"), userInput.removeHitArea("backFromCourseSelect"), userInput.removeHitArea("startGame"), initStartScreen();
  65. break;
  66. case "startGame":
  67. playSound("click"), userInput.removeHitArea("backFromCourseSelect"), userInput.removeHitArea("startGame"), courseNum = b.courseNum, aScores = new Array;
  68. for (var c = 0; c < aLevelData[courseNum].length; c++)
  69. aScores[c] = {}, aScores[c].par = aLevelData[courseNum][c].par, aScores[c].shotNum = 0, aScores[c].pickUps = 0;
  70. initGame();
  71. break;
  72. case "credits":
  73. playSound("click"), userInput.removeHitArea("selectCourse"), userInput.removeHitArea("moreGames"), userInput.removeHitArea("credits"), initCreditsScreen();
  74. break;
  75. case "backFromCredits":
  76. playSound("click"), userInput.removeHitArea("backFromCredits"), initStartScreen();
  77. break;
  78. case "moreGames":
  79. case "moreGamesPause":
  80. window.top.location.href =Play68.goHome();// btGame.URL.getMoreGame();
  81. break;
  82. case "gameTouch":
  83. if (gameTouchState >= 3)
  84. return;
  85. if (b.isBeingDragged)
  86. 2 == gameTouchState && (targAimX = b.x, targAimY = b.y);
  87. else if (b.isDown)
  88. TweenLite.killTweensOf(oPosData), toggleHudButs(!1), b.x < ball.x + 40 && b.x > ball.x - 40 && b.y < ball.y + 40 && b.y > ball.y - 40 && (gameTouchState = 2, aimX = targAimX = b.x, aimY = targAimY = b.y, ball.changeState("aiming"));
  89. else {
  90. if (toggleHudButs(!0), 2 == gameTouchState && arrow.scaleX > .05)
  91. return gameTouchState = 3, ball.changeState("moving", {power: arrow.hyp, angle: arrow.rotation}), aimX = targAimX = null, aimY = targAimY = null, playSound("hit"), void 0;
  92. gameTouchState = 0, "waiting" != ball.state && ball.changeState("waiting")
  93. }
  94. break;
  95. case "nextLevel":
  96. window.shareFlag = false;
  97. playSound("click"), userInput.removeHitArea("nextLevel"), userInput.removeHitArea("moreGames"), userInput.removeHitArea("exitFromEnd"), levelScore = 0, ++levelNum < 9 ? initGame() : (totalScore = 0, levelNum = 0, initCourseSelectScreen());
  98. break;
  99. case "exitFromEnd":
  100. playSound("click"), userInput.removeHitArea("nextLevel"), userInput.removeHitArea("moreGames"), userInput.removeHitArea("exitFromEnd"), initCourseSelectScreen();
  101. break;
  102. case "mute":
  103. playSound("click"), toggleMute();
  104. break;
  105. case "pause":
  106. case "resumeFromPause":
  107. playSound("click"), toggleManualPause();
  108. break;
  109. case "quitFromPause":
  110. playSound("click"), toggleManualPause(),
  111. userInput.removeHitArea("pause"),
  112. userInput.removeHitArea("quitFromPause"),
  113. userInput.removeHitArea("resumeFromPause"),
  114. userInput.removeHitArea("moreGamesPause"),
  115. levelScore = 0, totalScore = 0, initStartScreen()
  116. }
  117. }
  118. function initLevelComplete() {
  119. gameState = "levelComplete", 1 == audioType && (musicTween.kill(), musicTween = TweenLite.to(music, .5, {volume: .5, ease: "Linear.easeNone"})), userInput.removeHitArea("gameTouch"), userInput.removeHitArea("pause");
  120. var a = {oImgData: assetLib.getData("uiButs"), aPos: [504, 735], scale: 1, frame: 2}, b = {oImgData: assetLib.getData("uiButs"), aPos: [canvas.width / 2 + 4, 610], scale: 1, frame: 0}, c = {oImgData: assetLib.getData("uiButs"), aPos: [104, 735], scale: 1, frame: 4};
  121. userInput.addHitArea("moreGames", butEventHandler, null, "image", a), userInput.addHitArea("nextLevel", butEventHandler, null, "image", b), userInput.addHitArea("exitFromEnd", butEventHandler, null, "image", c);
  122. var d = new Array(a, b, c);
  123. panel = new Elements.Panel(assetLib.getData("panels1"), assetLib.getData("panels2"), assetLib.getData("bigNumbersDark"), assetLib.getData("smallNumbers"), gameState, d, canvas.width, canvas.height), panel.startTween1(), aPickUps = new Array;
  124. for (var e = 0, f = 0; 10 > f; f++) {
  125. var g = new Elements.FallingGem(assetLib.getData("pickUps"), {x: Math.random() * canvas.width, y: Math.random() * canvas.height, id: ++e % 5}, canvas.width, canvas.height);
  126. aPickUps.push(g)
  127. }
  128. aScores[levelNum].shotNum = hud.oLevelData.shotNum, aScores[levelNum].pickUps = hud.oLevelData.pickUps, panel.aScores = aScores;
  129. try {
  130. window.kaisergames.submitHighscore(levelNum, saveDataHandler.aLevelStore[0] + saveDataHandler.aLevelStore[1])
  131. } catch (h) {
  132. }
  133. previousTime = (new Date).getTime(), updateLevelComplete()
  134. }
  135. function ballCallback(a) {
  136. switch (a) {
  137. case "moveEnded":
  138. gameTouchState = 0, oPosData.prevBallX = ball.trackX, oPosData.prevBallY = ball.trackY, hud.oLevelData.shotNum++, playSound("bounce1");
  139. break;
  140. case "holeEnded":
  141. initLevelComplete();
  142. break;
  143. case "bounce":
  144. addBounce(ball.trackX, ball.trackY), playSound("bounce" + Math.ceil(2 * Math.random()));
  145. break;
  146. case "reset":
  147. gameTouchState = 0, ball.trackX = oPosData.prevBallX, ball.trackY = oPosData.prevBallY, hud.oLevelData.shotNum++, playSound("reset");
  148. break;
  149. case "teleport":
  150. playSound("teleport");
  151. for (var b = 0; 5 > b; b++)
  152. addBounce(ball.trackX + 40 * Math.random() - 20, ball.trackY + 40 * Math.random() - 20)
  153. }
  154. }
  155. function isNearHole() {
  156. var a = ball.trackX - oHolePos.x, b = ball.trackY - oHolePos.y, c = a * a + b * b;
  157. return 500 > c ? !0 : !1
  158. }
  159. function toggleHudButs(a) {
  160. a ? (userInput.addHitArea("mute", butEventHandler, null, "rect", {aRect: [538, 0, canvas.width, 60]}, !0), userInput.addHitArea("pause", butEventHandler, null, "rect", {aRect: [480, 0, 538, 60]}, !0), userInput.addHitArea("gameTouch", butEventHandler, {isDraggable: !0, multiTouch: !0}, "rect", {aRect: [0, 0, canvas.width, canvas.height]}, !0)) : (userInput.removeHitArea("mute"), userInput.removeHitArea("pause"))
  161. }
  162. function addBounce(a, b) {
  163. var c = new Elements.Bounce(assetLib.getData("bounce"), {x: a, y: b});
  164. aBounces.push(c)
  165. }
  166. function updateGameEvent() {
  167. if (!manualPause && !rotatePause && "game" == gameState) {
  168. var a = getDelta();
  169. 2 == gameTouchState ? (aimX += (targAimX - aimX) / .1 * a, aimY += (targAimY - aimY) / .1 * a, oPosData.targStageX = buffer > targAimX && ball.trackX < 200 ? -buffer / buffer * targAimX : targAimX > canvas.width - buffer && ball.trackX > levelWidth - 200 ? -buffer - buffer / buffer * (buffer - (canvas.width - targAimX)) : -buffer, oPosData.targStageY = buffer > targAimY && ball.trackY < 200 ? -buffer / buffer * targAimY : targAimY > canvas.height - buffer && ball.trackY > levelHeight - 200 ? -buffer - buffer / buffer * (buffer - (canvas.height - targAimY)) : -buffer, oPosData.targStageX > 0 ? oPosData.targStageX = 0 : oPosData.targStageX < -200 && (oPosData.targStageX = -200), oPosData.targStageY > 0 ? oPosData.targStageY = 0 : oPosData.targStageY < -200 && (oPosData.targStageY = -200)) : (oPosData.targStageX = -buffer, oPosData.targStageY = -buffer), oPosData.stageX += (oPosData.targStageX - oPosData.stageX) / .3 * a, oPosData.stageY += (oPosData.targStageY - oPosData.stageY) / .3 * a, level.update(oPosData.stageX, oPosData.stageY, a), level.render(ctx);
  170. for (var b = 0; b < aPickUps.length; b++)
  171. aPickUps[b].update(oPosData.stageX, oPosData.stageY, a), renderSprite(aPickUps[b]), aPickUps[b].canHit && checkSpriteCollision(ball, aPickUps[b]) && (aPickUps[b].hit(), hud.oLevelData.pickUps++, playSound("gem" + Math.ceil(4 * Math.random()))), aPickUps[b].removeMe && (aPickUps.splice(b, 1), b -= 1);
  172. ball.update(oPosData.stageX, oPosData.stageY, a), renderSprite(ball);
  173. for (var b = 0; b < aBounces.length; b++)
  174. aBounces[b].update(oPosData.stageX, oPosData.stageY, a), renderSprite(aBounces[b]), aBounces[b].removeMe && (aBounces.splice(b, 1), b -= 1);
  175. if (2 == gameTouchState)
  176. arrow.update(ball.x, ball.y, aimX, aimY, a), arrow.render(ctx);
  177. else if (3 == gameTouchState && isNearHole()) {
  178. var c = 0;
  179. hud.oLevelData.shotNum > 1 && (c = Math.min(Math.max(hud.oLevelData.shotNum - hud.oLevelData.par + 5, 1), 7)), userInput.removeHitArea("pause"), playSound("holed"), ball.changeState("holed", {x: oHolePos.x, y: oHolePos.y, remarkId: c}), gameTouchState = 4
  180. }
  181. hud.render(ctx), "moving" == ball.state && physics2D.update(a), renderMuteBut(), requestAnimFrame(updateGameEvent)
  182. }
  183. }
  184. function updateCreditsScreenEvent() {
  185. if (!rotatePause && "credits" == gameState) {
  186. var a = getDelta();
  187. panel.update(a), panel.render(ctx), renderMuteBut(), requestAnimFrame(updateCreditsScreenEvent)
  188. }
  189. }
  190. function updateCourseSelectScreenEvent() {
  191. if (!rotatePause && "courseSelect" == gameState) {
  192. var a = getDelta();
  193. background.updateScroll(a), background.renderScroll(ctx);
  194. for (var b = 0; b < aPickUps.length; b++)
  195. aPickUps[b].y += (150 + 20 * b) * a, aPickUps[b].rotation = aPickUps[b].y / 50, aPickUps[b].x = aPickUps[b].x - 100 * Math.sin(aPickUps[b].y / 100) * a, aPickUps[b].y > canvas.height + 100 && (aPickUps[b].x = Math.random() * canvas.width, aPickUps[b].y = -200), aPickUps[b].update(a), renderSprite(aPickUps[b]);
  196. panel.update(a), panel.render(ctx), renderMuteBut(), requestAnimFrame(updateCourseSelectScreenEvent)
  197. }
  198. }
  199. function updateLevelComplete() {
  200. if (!rotatePause && "levelComplete" == gameState) {
  201. var a = getDelta();
  202. background.updateScroll(a), background.renderScroll(ctx);
  203. for (var b = 0; b < aPickUps.length; b++)
  204. aPickUps[b].y += (150 + 20 * b) * a, aPickUps[b].rotation = aPickUps[b].y / 50, aPickUps[b].x = aPickUps[b].x - 100 * Math.sin(aPickUps[b].y / 100) * a, aPickUps[b].y > canvas.height + 100 && (aPickUps[b].x = Math.random() * canvas.width, aPickUps[b].y = -200), aPickUps[b].update(a), renderSprite(aPickUps[b]);
  205. panel.update(a), panel.render(ctx), renderMuteBut(), requestAnimFrame(updateLevelComplete)
  206. }
  207. }
  208. function updateSplashScreenEvent() {
  209. if (!rotatePause && "splash" == gameState) {
  210. var a = getDelta();
  211. if (splashTimer += a, splashTimer > 2.5)
  212. return 1 != audioType || muted || music.play(), initStartScreen(), void 0;
  213. splash.render(ctx, a), requestAnimFrame(updateSplashScreenEvent)
  214. }
  215. }
  216. function updateStartScreenEvent() {
  217. if (!rotatePause && "start" == gameState) {
  218. var a = getDelta();
  219. background.updateScroll(a), background.renderScroll(ctx);
  220. for (var b = 0; b < aPickUps.length; b++)
  221. aPickUps[b].y += (150 + 20 * b) * a, aPickUps[b].rotation = aPickUps[b].y / 50, aPickUps[b].x = aPickUps[b].x - 100 * Math.sin(aPickUps[b].y / 100) * a, aPickUps[b].y > canvas.height + 100 && (aPickUps[b].x = Math.random() * canvas.width, aPickUps[b].y = -200), aPickUps[b].update(a), renderSprite(aPickUps[b]);
  222. panel.update(a), panel.render(ctx), renderMuteBut(), requestAnimFrame(updateStartScreenEvent)
  223. }
  224. }
  225. function getDelta() {
  226. var a = (new Date).getTime(), b = (a - previousTime) / 1e3;
  227. return previousTime = a, b > .5 && (b = 0), b
  228. }
  229. function renderSprite(a) {
  230. ctx.save(), ctx.translate(a.x, a.y), ctx.scale(a.scaleX, a.scaleY), ctx.rotate(a.rotation), a.render(ctx), ctx.restore()
  231. }
  232. function checkSpriteCollision(a, b) {
  233. var c = a.x - b.x, d = a.y - b.y, e = c * c + d * d, f = a.radius * b.radius;
  234. return f > e ? !0 : !1
  235. }
  236. function getScaleImageToMax(a, b) {
  237. var c;
  238. return c = a.isSpriteSheet ? b[0] / a.oData.spriteWidth < b[1] / a.oData.spriteHeight ? Math.min(b[0] / a.oData.spriteWidth, 1) : Math.min(b[1] / a.oData.spriteHeight, 1) : b[0] / a.img.width < b[1] / a.img.height ? Math.min(b[0] / a.img.width, 1) : Math.min(b[1] / a.img.height, 1)
  239. }
  240. function getCentreFromTopLeft(a, b, c) {
  241. var d = new Array;
  242. return d.push(a[0] + b.oData.spriteWidth / 2 * c), d.push(a[1] + b.oData.spriteHeight / 2 * c), d
  243. }
  244. function loadPreAssets() {
  245. aLangs.length > 1 ? (preAssetLib = new Utils.AssetLoader(curLang, [
  246. {id: "langSelect", file: "images/langSelect.jpg"},
  247. {id: "preloadImage", file: "images/preloadImage.jpg"}
  248. ], ctx, canvas.width, canvas.height, !1), preAssetLib.onReady(initLangSelect)) : (curLang = aLangs[0], preAssetLib = new Utils.AssetLoader(curLang, [
  249. {id: "preloadImage", file: "images/preloadImage.jpg"}
  250. ], ctx, canvas.width, canvas.height, !1), preAssetLib.onReady(initLoadAssets))
  251. }
  252. function initLangSelect() {
  253. curLang = "EN", ctx.clearRect(0, 0, canvas.width, canvas.height), userInput.removeHitArea("langSelect"), initLoadAssets();
  254. }
  255. function initLoadAssets() {
  256. var a = preAssetLib.getData("preloadImage");
  257. // ctx.drawImage(a.img, 0, 0),
  258. loadAssets();
  259. }
  260. function loadAssets() {
  261. assetLib = new Utils.AssetLoader(curLang, [
  262. {id: "background", file: "images/background.jpg"},
  263. // {id: "rotateDeviceMessage", file: "images/rotateDeviceMessage.jpg"},
  264. {id: "hud", file: "images/" + curLang + "/hud.png"},
  265. {id: "uiButs", file: "images/" + curLang + "/uiButs_191x109.png"},
  266. {id: "panels1", file: "images/" + curLang + "/panels1_600x800.png"},
  267. {id: "panels2", file: "images/" + curLang + "/panels2_600x800.png"},
  268. {id: "bigNumbersLight", file: "images/bigNumbersLight_24x45.png"},
  269. {id: "bigNumbersDark", file: "images/bigNumbersDark_24x45.png"},
  270. {id: "smallNumbers", file: "images/smallNumbers_17x32.png"},
  271. {id: "ball", file: "images/ball_118x169.png", oAnims: {waiting: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19], moving: [19], inWater: [21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34]}},
  272. {id: "bounce", file: "images/bounce_46x44.png", oAnims: {explode: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}},
  273. {id: "arrow", file: "images/arrow_101x60.png"},
  274. {id: "remarks", file: "images/" + curLang + "/remarks_560x255.png"},
  275. {id: "level00", file: "images/" + curLang + "/levelA0.jpg"},
  276. {id: "level01", file: "images/" + curLang + "/levelA1.jpg"},
  277. {id: "level02", file: "images/levelA2.jpg"},
  278. {id: "level03", file: "images/levelA3.jpg"},
  279. {id: "level04", file: "images/levelA4.jpg"},
  280. {id: "level05", file: "images/levelA5.jpg"},
  281. {id: "level06", file: "images/levelA6.jpg"},
  282. {id: "level07", file: "images/levelA7.jpg"},
  283. {id: "level08", file: "images/levelA8.jpg"},
  284. {id: "level10", file: "images/levelB0.jpg"},
  285. {id: "level11", file: "images/levelB1.jpg"},
  286. {id: "level12", file: "images/levelB2.jpg"},
  287. {id: "level13", file: "images/levelB3.jpg"},
  288. {id: "level14", file: "images/levelB4.jpg"},
  289. {id: "level15", file: "images/levelB5.jpg"},
  290. {id: "level16", file: "images/levelB6.jpg"},
  291. {id: "level17", file: "images/levelB7.jpg"},
  292. {id: "level18", file: "images/levelB8.jpg"},
  293. {id: "muteBut", file: "images/mute_53x53.png"},
  294. {id: "pickUps", file: "images/pickUps_108x99.png",
  295. oAnims: {waiting0: [0, 1, 2, 3, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  296. waiting1: [5, 6, 7, 8, 9, 8, 7, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5],
  297. waiting2: [10, 11, 12, 13, 14, 13, 12, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10],
  298. waiting3: [15, 16, 17, 18, 19, 18, 17, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15],
  299. waiting4: [20, 21, 22, 23, 24, 23, 22, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20],
  300. explode: [25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35],
  301. falling0: [36], falling1: [37],
  302. falling2: [38], falling3: [39],
  303. falling4: [40]}}
  304. ], ctx, canvas.width, canvas.height, !1), assetLib.onReady(initSplash)
  305. }
  306. function resizeCanvas() {
  307. var a = window.innerWidth, b = window.innerHeight;
  308. a > 480 && (a -= 1, b -= 1), window.innerWidth > window.innerHeight && isMobile ? ("loading" != gameState && rotatePauseOn(), a / canvas.width < b / canvas.height ? (canvas.style.width = a + "px", canvas.style.height = a / canvas.width * canvas.height + "px", canvasX = 0, canvasY = (b - a / canvas.width * canvas.height) / 2, canvasScaleX = canvasScaleY = canvas.width / a, div.style.marginTop = canvasY + "px", div.style.marginLeft = canvasX + "px") : (canvas.style.width = b / canvas.height * canvas.width + "px", canvas.style.height = b + "px", canvasX = (a - b / canvas.height * canvas.width) / 2, canvasY = 0, canvasScaleX = canvasScaleY = canvas.height / b, div.style.marginTop = canvasY + "px", div.style.marginLeft = canvasX + "px")) : isMobile ? (rotatePause && rotatePauseOff(), canvasX = canvasY = 0, canvasScaleX = canvas.width / a, canvasScaleY = canvas.height / b, canvas.style.width = a + "px", canvas.style.height = b + "px", div.style.marginTop = "0px", div.style.marginLeft = "0px") : (rotatePause && rotatePauseOff(), a / canvas.width < b / canvas.height ? (canvas.style.width = a + "px", canvas.style.height = a / canvas.width * canvas.height + "px", canvasX = 0, canvasY = (b - a / canvas.width * canvas.height) / 2, canvasScaleX = canvasScaleY = canvas.width / a, div.style.marginTop = canvasY + "px", div.style.marginLeft = canvasX + "px") : (canvas.style.width = b / canvas.height * canvas.width + "px", canvas.style.height = b + "px", canvasX = (a - b / canvas.height * canvas.width) / 2, canvasY = 0, canvasScaleX = canvasScaleY = canvas.height / b, div.style.marginTop = canvasY + "px", div.style.marginLeft = canvasX + "px")), userInput.setCanvas(canvasX, canvasY, canvasScaleX, canvasScaleY)
  309. }
  310. function playSound(a) {
  311. 1 == audioType && sound.play(a)
  312. }
  313. function toggleMute() {
  314. muted = !muted, 1 == audioType ? muted ? Howler.mute() : Howler.unmute() : 2 == audioType && (muted ? music.pause() : music.play()), renderMuteBut()
  315. }
  316. function renderLogoBut() {
  317. ctx.drawImage(oLogoBut.oImgData.img, 0, 0, oLogoBut.oImgData.img.width, oLogoBut.oImgData.img.height, oLogoBut.aPos[0] - oLogoBut.oImgData.img.width / 2 * oLogoBut.scale, oLogoBut.aPos[1] - oLogoBut.oImgData.img.height / 2 * oLogoBut.scale, oLogoBut.oImgData.img.width * oLogoBut.scale, oLogoBut.oImgData.img.height * oLogoBut.scale)
  318. }
  319. function renderMuteBut() {
  320. if (0 != audioType) {
  321. var a = assetLib.getData("muteBut"), b = 0;
  322. muted && (b = 1);
  323. var c = b * a.oData.spriteWidth % a.img.width, d = Math.floor(b / (a.img.width / a.oData.spriteWidth)) * a.oData.spriteHeight;
  324. ctx.drawImage(a.img, c, d, a.oData.spriteWidth, a.oData.spriteHeight, 538, 7, a.oData.spriteWidth, a.oData.spriteHeight)
  325. }
  326. }
  327. function toggleManualPause() {
  328. if (manualPause)
  329. manualPause = !1,
  330. userInput.removeHitArea("quitFromPause"),
  331. userInput.removeHitArea("resumeFromPause"),
  332. userInput.removeHitArea("moreGamesPause"), pauseCoreOff();
  333. else {
  334. manualPause = !0, pauseCoreOn();
  335. var a = {oImgData: assetLib.getData("uiButs"),
  336. aPos: [104, 535], scale: 1, frame: 1}, b = {oImgData: assetLib.getData("uiButs"),
  337. aPos: [504, 535], scale: 1, frame: 0}, c = {oImgData: assetLib.getData("uiButs"),
  338. aPos: [canvas.width / 2 + 4, 535], scale: 1, frame: 2}, d = new Array(a, b, c);
  339. userInput.addHitArea("quitFromPause", butEventHandler, null, "image", a),
  340. userInput.addHitArea("resumeFromPause", butEventHandler, null, "image", b),
  341. userInput.addHitArea("moreGamesPause", butEventHandler, null, "image", c),
  342. panel = new Elements.Panel(assetLib.getData("panels1"),
  343. assetLib.getData("panels2"), assetLib.getData("bigNumbersDark"),
  344. assetLib.getData("smallNumbers"), "pause", d, canvas.width, canvas.height),
  345. panel.render(ctx), userInput.addHitArea("pause", butEventHandler, null, "rect", {aRect: [480, 0, 538, 60]}, !0)
  346. }
  347. }
  348. function rotatePauseOn() {
  349. }
  350. function rotatePauseOff() {
  351. rotatePause = !1, userInput.removeHitArea("quitFromPause"),
  352. userInput.removeHitArea("resumeFromPause"),
  353. userInput.removeHitArea("moreGamesPause"), pauseCoreOff()
  354. }
  355. function pauseCoreOn() {
  356. switch (1 == audioType ? Howler.mute() : 2 == audioType && music.pause(), gameState) {
  357. case "start":
  358. break;
  359. case "help":
  360. break;
  361. case "game":
  362. userInput.removeHitArea("gameTouch");
  363. break;
  364. case "end":
  365. }
  366. }
  367. function pauseCoreOff() {
  368. switch (1 == audioType ? muted || Howler.unmute() : 2 == audioType && (muted || music.play()), previousTime = (new Date).getTime(), userInput.pauseIsOn = !1, gameState) {
  369. case "splash":
  370. updateSplashScreenEvent();
  371. break;
  372. case "start":
  373. initStartScreen();
  374. break;
  375. case "courseSelect":
  376. initCourseSelectScreen();
  377. break;
  378. case "credits":
  379. initCreditsScreen();
  380. break;
  381. case "game":
  382. manualPause = !1, userInput.addHitArea("gameTouch", butEventHandler,
  383. {isDraggable: !0, multiTouch: !0}, "rect",
  384. {aRect: [0, 0, canvas.width, canvas.height]}, !0), updateGameEvent();
  385. break;
  386. case "levelComplete":
  387. initLevelComplete()
  388. }
  389. }
  390. var Utils;
  391. !function (a) {
  392. var b = function () {
  393. function a(a, b, c, d, e, f) {
  394. "undefined" == typeof f && (f = !0), this.oAssetData = {}, this.assetsLoaded = 0, this.totalAssets = b.length, this.ctx = c, this.canvasWidth = d, this.canvasHeight = e, this.showBar = f, this.topLeftX = this.canvasWidth / 2 - d / 4, this.topLeftY = 440, this.showBar && (ctx.strokeStyle = "#5B6394", ctx.lineWidth = 2, ctx.fillStyle = "#95A8E9", ctx.moveTo(this.topLeftX, this.topLeftY), ctx.lineTo(this.topLeftX + d / 2, this.topLeftY + 0), ctx.lineTo(this.topLeftX + d / 2, this.topLeftY + 40), ctx.lineTo(this.topLeftX + 0, this.topLeftY + 40), ctx.lineTo(this.topLeftX + 0, this.topLeftY + 0), ctx.stroke());
  395. for (var g = 0; g < b.length; g++)
  396. this.loadImage(b[g])
  397. }
  398. return a.prototype.loadImage = function (a) {
  399. var b = this, c = new Image;
  400. c.onload = function () {
  401. b.oAssetData[a.id] = {}, b.oAssetData[a.id].img = c, b.oAssetData[a.id].oData = {};
  402. var d = b.getSpriteSize(a.file);
  403. 0 != d[0] ? (b.oAssetData[a.id].oData.spriteWidth = d[0],
  404. b.oAssetData[a.id].oData.spriteHeight = d[1]) : (b.oAssetData[a.id].oData.spriteWidth = b.oAssetData[a.id].img.width,
  405. b.oAssetData[a.id].oData.spriteHeight = b.oAssetData[a.id].img.height),
  406. a.oAnims && (b.oAssetData[a.id].oData.oAnims = a.oAnims), ++b.assetsLoaded,
  407. b.showBar && ctx.fillRect(b.topLeftX + 2, b.topLeftY + 2,
  408. (b.canvasWidth / 2 - 4) / b.totalAssets * b.assetsLoaded, 36),
  409. b.checkLoadComplete()
  410. }, c.src = a.file
  411. }, a.prototype.getSpriteSize = function (a) {
  412. for (var b = new Array, c = "", d = "", e = 0, f = a.lastIndexOf("."), g = !0; g;)
  413. f--, 0 == e && this.isNumber(a.charAt(f)) ? c = a.charAt(f) + c : 0 == e && c.length > 0 && "x" == a.charAt(f) ? (f--, e = 1, d = a.charAt(f) + d) : 1 == e && this.isNumber(a.charAt(f)) ? d = a.charAt(f) + d : 1 == e && d.length > 0 && "_" == a.charAt(f) ? (g = !1, b = [parseInt(d), parseInt(c)]) : (g = !1, b = [0, 0]);
  414. return b
  415. }, a.prototype.isNumber = function (a) {
  416. return !isNaN(parseFloat(a)) && isFinite(a)
  417. }, a.prototype.checkLoadComplete = function () {
  418. this.assetsLoaded == this.totalAssets && this.loadedCallback()
  419. }, a.prototype.onReady = function (a) {
  420. this.loadedCallback = a
  421. }, a.prototype.getImg = function (a) {
  422. return this.oAssetData[a].img
  423. }, a.prototype.getData = function (a) {
  424. return this.oAssetData[a]
  425. }, a
  426. }();
  427. a.AssetLoader = b
  428. }(Utils || (Utils = {}));
  429. var Utils;
  430. !function (a) {
  431. var b = function () {
  432. function a(a, b, c, d) {
  433. this.x = 0, this.y = 0, this.rotation = 0, this.radius = 10, this.removeMe = !1, this.frameInc = 0, this.animType = "loop", this.offsetX = 0, this.offsetY = 0, this.scaleX = 1, this.scaleY = 1, this.oImgData = a, this.oAnims = this.oImgData.oData.oAnims, this.fps = b, this.radius = c, this.animId = d
  434. }
  435. return a.prototype.updateAnimation = function (a) {
  436. this.frameInc += this.fps * a
  437. }, a.prototype.resetAnim = function () {
  438. this.frameInc = 0
  439. }, a.prototype.setFrame = function (a) {
  440. this.fixedFrame = a
  441. }, a.prototype.setAnimType = function (a, b, c) {
  442. switch ("undefined" == typeof c && (c = !0), this.animId = b, this.animType = a, c && this.resetAnim(), a) {
  443. case "loop":
  444. break;
  445. case "once":
  446. this.maxIdx = this.oAnims[this.animId].length - 1
  447. }
  448. }, a.prototype.render = function (a) {
  449. if (null != this.animId) {
  450. var b = this.oAnims[this.animId].length, c = Math.floor(this.frameInc), d = this.oAnims[this.animId][c % b], e = d * this.oImgData.oData.spriteWidth % this.oImgData.img.width, f = Math.floor(d / (this.oImgData.img.width / this.oImgData.oData.spriteWidth)) * this.oImgData.oData.spriteHeight;
  451. if ("once" == this.animType && c > this.maxIdx) {
  452. this.fixedFrame = this.oAnims[this.animId][b - 1], this.animId = null, this.animEndedFunc();
  453. var e = this.fixedFrame * this.oImgData.oData.spriteWidth % this.oImgData.img.width, f = Math.floor(this.fixedFrame / (this.oImgData.img.width / this.oImgData.oData.spriteWidth)) * this.oImgData.oData.spriteHeight
  454. }
  455. } else
  456. var e = this.fixedFrame * this.oImgData.oData.spriteWidth % this.oImgData.img.width, f = Math.floor(this.fixedFrame / (this.oImgData.img.width / this.oImgData.oData.spriteWidth)) * this.oImgData.oData.spriteHeight;
  457. a.drawImage(this.oImgData.img, e, f, this.oImgData.oData.spriteWidth, this.oImgData.oData.spriteHeight, -this.oImgData.oData.spriteWidth / 2 + this.offsetX, -this.oImgData.oData.spriteHeight / 2 + this.offsetY, this.oImgData.oData.spriteWidth, this.oImgData.oData.spriteHeight)
  458. }, a
  459. }();
  460. a.AnimSprite = b
  461. }(Utils || (Utils = {}));
  462. var Utils;
  463. !function (a) {
  464. var b = function () {
  465. function a(a, b, c) {
  466. "undefined" == typeof c && (c = 0), this.x = 0, this.y = 0, this.rotation = 0, this.radius = 10, this.removeMe = !1, this.offsetX = 0, this.offsetY = 0, this.scaleX = 1, this.scaleY = 1, this.oImgData = a, this.radius = b, this.setFrame(c)
  467. }
  468. return a.prototype.setFrame = function (a) {
  469. this.frameNum = a
  470. }, a.prototype.render = function (a) {
  471. var b = this.frameNum * this.oImgData.oData.spriteWidth % this.oImgData.img.width, c = Math.floor(this.frameNum / (this.oImgData.img.width / this.oImgData.oData.spriteWidth)) * this.oImgData.oData.spriteHeight;
  472. a.drawImage(this.oImgData.img, b, c, this.oImgData.oData.spriteWidth, this.oImgData.oData.spriteHeight, -this.oImgData.oData.spriteWidth / 2 + this.offsetX, -this.oImgData.oData.spriteHeight / 2 + this.offsetY, this.oImgData.oData.spriteWidth, this.oImgData.oData.spriteHeight)
  473. }, a
  474. }();
  475. a.BasicSprite = b
  476. }(Utils || (Utils = {}));
  477. var Utils;
  478. !function (a) {
  479. var b = function () {
  480. function a(a, b) {
  481. var c = this;
  482. this.canvasX = 0, this.canvasY = 0, this.canvasScaleX = 1, this.canvasScaleY = 1, this.prevHitTime = 0, this.pauseIsOn = !1, this.isDown = !1, this.isDetectingKeys = !1, this.isBugBrowser = b, a.addEventListener("touchstart", function (a) {
  483. for (var b = 0; b < a.changedTouches.length; b++)
  484. c.hitDown(a, a.changedTouches[b].pageX, a.changedTouches[b].pageY, a.changedTouches[b].identifier)
  485. }, !1), a.addEventListener("touchend", function (a) {
  486. for (var b = 0; b < a.changedTouches.length; b++)
  487. c.hitUp(a, a.changedTouches[b].pageX, a.changedTouches[b].pageY, a.changedTouches[b].identifier)
  488. }, !1), a.addEventListener("touchmove", function (a) {
  489. for (var b = 0; b < c.aHitAreas.length; b++)
  490. c.move(a, a.changedTouches[b].pageX, a.changedTouches[b].pageY, a.changedTouches[b].identifier, !0)
  491. }, !1), a.addEventListener("mousedown", function (a) {
  492. c.isDown = !0, c.hitDown(a, a.pageX, a.pageY, 1)
  493. }, !1), a.addEventListener("mouseup", function (a) {
  494. c.isDown = !1, c.hitUp(a, a.pageX, a.pageY, 1)
  495. }, !1), a.addEventListener("mousemove", function (a) {
  496. c.move(a, a.pageX, a.pageY, 1, c.isDown)
  497. }, !1), this.aHitAreas = new Array, this.aKeys = new Array
  498. }
  499. return a.prototype.setCanvas = function (a, b, c, d) {
  500. this.canvasX = a, this.canvasY = b, this.canvasScaleX = c, this.canvasScaleY = d
  501. }, a.prototype.hitDown = function (a, b, c, d) {
  502. if (!this.pauseIsOn) {
  503. var e = (new Date).getTime();
  504. if (!(e - this.prevHitTime < 500 && isBugBrowser)) {
  505. this.prevHitTime = e, a.preventDefault(), a.stopPropagation(), b = (b - this.canvasX) * this.canvasScaleX, c = (c - this.canvasY) * this.canvasScaleY;
  506. for (var f = 0; f < this.aHitAreas.length; f++)
  507. if (this.aHitAreas[f].rect && b > this.aHitAreas[f].area[0] && c > this.aHitAreas[f].area[1] && b < this.aHitAreas[f].area[2] && c < this.aHitAreas[f].area[3]) {
  508. this.aHitAreas[f].aTouchIdentifiers.push(d), this.aHitAreas[f].oData.isDown || (this.aHitAreas[f].oData.isDown = !0, this.aHitAreas[f].oData.x = b, this.aHitAreas[f].oData.y = c, this.aHitAreas[f].callback(this.aHitAreas[f].id, this.aHitAreas[f].oData));
  509. break
  510. }
  511. }
  512. }
  513. }, a.prototype.hitUp = function (a, b, c, d) {
  514. if (!this.pauseIsOn) {
  515. a.preventDefault(), a.stopPropagation(), b = (b - this.canvasX) * this.canvasScaleX, c = (c - this.canvasY) * this.canvasScaleY;
  516. for (var e = 0; e < this.aHitAreas.length; e++)
  517. if (this.aHitAreas[e].rect && b > this.aHitAreas[e].area[0] && c > this.aHitAreas[e].area[1] && b < this.aHitAreas[e].area[2] && c < this.aHitAreas[e].area[3]) {
  518. for (var f = 0; f < this.aHitAreas[e].aTouchIdentifiers.length; f++)
  519. this.aHitAreas[e].aTouchIdentifiers[f] == d && (this.aHitAreas[e].aTouchIdentifiers.splice(f, 1), f -= 1);
  520. 0 == this.aHitAreas[e].aTouchIdentifiers.length && (this.aHitAreas[e].oData.isDown = !1, this.aHitAreas[e].oData.multiTouch && this.aHitAreas[e].callback(this.aHitAreas[e].id, this.aHitAreas[e].oData));
  521. break
  522. }
  523. }
  524. }, a.prototype.move = function (a, b, c, d, e) {
  525. if (!this.pauseIsOn && e) {
  526. b = (b - this.canvasX) * this.canvasScaleX, c = (c - this.canvasY) * this.canvasScaleY;
  527. for (var f = 0; f < this.aHitAreas.length; f++)
  528. if (this.aHitAreas[f].rect)
  529. if (b > this.aHitAreas[f].area[0] && c > this.aHitAreas[f].area[1] && b < this.aHitAreas[f].area[2] && c < this.aHitAreas[f].area[3]) {
  530. try {
  531. (this.aHitAreas[f] != undefined) && (this.aHitAreas[f].oData && (this.aHitAreas[f].oData.isDown || (this.aHitAreas[f].oData.isDown = !0, this.aHitAreas[f].oData.x = b, this.aHitAreas[f].oData.y = c, this.aHitAreas[f].aTouchIdentifiers.push(d), (this.aHitAreas[f] != undefined) && this.aHitAreas[f].oData.multiTouch && this.aHitAreas[f].callback(this.aHitAreas[f].id, this.aHitAreas[f].oData)), this.aHitAreas[f].oData.isDraggable && (this.aHitAreas[f].oData.isBeingDragged = !0, this.aHitAreas[f].oData.x = b, this.aHitAreas[f].oData.y = c, this.aHitAreas[f].callback(this.aHitAreas[f].id, this.aHitAreas[f].oData), this.aHitAreas[f].oData.isBeingDragged = !1)));
  532. } catch (eee) {
  533. }
  534. }
  535. else if (this.aHitAreas[f].oData.isDown) {
  536. for (var g = 0; g < this.aHitAreas[f].aTouchIdentifiers.length; g++)
  537. this.aHitAreas[f].aTouchIdentifiers[g] == d && (this.aHitAreas[f].aTouchIdentifiers.splice(g, 1), g -= 1);
  538. 0 == this.aHitAreas[f].aTouchIdentifiers.length && (this.aHitAreas[f].oData.isDown = !1, this.aHitAreas[f].oData.multiTouch && this.aHitAreas[f].callback(this.aHitAreas[f].id, this.aHitAreas[f].oData))
  539. }
  540. }
  541. }, a.prototype.keyDown = function (a) {
  542. for (var b = 0; b < this.aKeys.length; b++)
  543. a.keyCode == this.aKeys[b].keyCode && (this.aKeys[b].oData.isDown = !0, this.aKeys[b].callback(this.aKeys[b].id, this.aKeys[b].oData))
  544. }, a.prototype.keyUp = function (a) {
  545. for (var b = 0; b < this.aKeys.length; b++)
  546. a.keyCode == this.aKeys[b].keyCode && (this.aKeys[b].oData.isDown = !1, this.aKeys[b].callback(this.aKeys[b].id, this.aKeys[b].oData))
  547. }, a.prototype.addKey = function (a, b, c, d) {
  548. var e = this;
  549. this.isDetectingKeys || (window.addEventListener("keydown", function (a) {
  550. e.keyDown(a)
  551. }, !1), window.addEventListener("keyup", function (a) {
  552. e.keyUp(a)
  553. }, !1), this.isDetectingKeys = !0), null == c && (c = new Object), this.aKeys.push({id: a, callback: b, oData: c, keyCode: d})
  554. }, a.prototype.removeKey = function (a) {
  555. for (var b = 0; b < this.aKeys.length; b++)
  556. this.aKeys[b].id == a && (this.aKeys.splice(b, 1), b -= 1)
  557. }, a.prototype.addHitArea = function (a, b, c, d, e, f) {
  558. "undefined" == typeof f && (f = !1), null == c && (c = new Object), f && this.removeHitArea(a);
  559. var g = new Array;
  560. switch (d) {
  561. case "image":
  562. var h;
  563. h = new Array(e.aPos[0] - e.oImgData.oData.spriteWidth / 2 * e.scale, e.aPos[1] - e.oImgData.oData.spriteHeight / 2 * e.scale, e.aPos[0] + e.oImgData.oData.spriteWidth / 2 * e.scale, e.aPos[1] + e.oImgData.oData.spriteHeight / 2 * e.scale), this.aHitAreas.push({id: a, aTouchIdentifiers: g, callback: b, oData: c, rect: !0, area: h});
  564. break;
  565. case "rect":
  566. this.aHitAreas.push({id: a, aTouchIdentifiers: g, callback: b, oData: c, rect: !0, area: e.aRect})
  567. }
  568. }, a.prototype.removeHitArea = function (a) {
  569. for (var b = 0; b < this.aHitAreas.length; b++)
  570. this.aHitAreas[b].id == a && (this.aHitAreas.splice(b, 1), b -= 1)
  571. }, a
  572. }();
  573. a.UserInput = b
  574. }(Utils || (Utils = {}));
  575. var Utils;
  576. !function (a) {
  577. var b = function () {
  578. function a(a) {
  579. this.updateFreq = 10, this.updateInc = 0, this.frameAverage = 0, this.display = 1, this.log = "", this.render = function (a) {
  580. this.frameAverage += this.delta / this.updateFreq, ++this.updateInc >= this.updateFreq && (this.updateInc = 0, this.display = this.frameAverage, this.frameAverage = 0), a.textAlign = "left", ctx.font = "10px Helvetica", a.fillStyle = "#333333", a.beginPath(), a.rect(0, this.canvasHeight - 15, 40, 15), a.closePath(), a.fill(), a.fillStyle = "#ffffff", a.fillText(Math.round(1e3 / (1e3 * this.display)) + " fps " + this.log, 5, this.canvasHeight - 5)
  581. }, this.canvasHeight = a
  582. }
  583. return a.prototype.update = function (a) {
  584. this.delta = a
  585. }, a
  586. }();
  587. a.FpsMeter = b
  588. }(Utils || (Utils = {}));
  589. var Elements;
  590. !function (a) {
  591. var b = function () {
  592. function a(a, b, c) {
  593. this.x = 0, this.y = 0, this.targY = 0, this.incY = 0, this.aScrollPos = new Array({offsetX: 0, offsetY: 0}, {offsetX: 1, offsetY: 0}, {offsetX: 1, offsetY: 1}, {offsetX: 0, offsetY: 1}), this.oImgData = a, this.canvasWidth = b, this.canvasHeight = c
  594. }
  595. return a.prototype.updateScroll = function (a) {
  596. this.incY += 5 * a, this.x = this.x - 50 * Math.sin(this.incY / 10) * a, this.y = this.y - 50 * a
  597. }, a.prototype.renderScroll = function (a) {
  598. this.x = this.x % this.canvasWidth, this.y = this.y % this.canvasHeight;
  599. for (var b = 0; 4 > b; b++)
  600. a.drawImage(this.oImgData.img, 0, 0, this.oImgData.img.width, this.oImgData.img.height, this.x + this.aScrollPos[b].offsetX * this.canvasWidth, this.y + this.aScrollPos[b].offsetY * this.canvasHeight, this.canvasWidth, this.canvasHeight)
  601. }, a
  602. }();
  603. a.Background = b
  604. }(Elements || (Elements = {}));
  605. var Elements;
  606. !function (a) {
  607. var b = function () {
  608. function a(a, b, c) {
  609. this.inc = 0, this.oSplashScreenImgData = a, this.canvasWidth = b, this.canvasHeight = c, this.posY = -this.canvasHeight, TweenLite.to(this, .5, {posY: 0})
  610. }
  611. return a.prototype.render = function (a, b) {
  612. this.inc += 5 * b, a.drawImage(this.oSplashScreenImgData.img, 0, 0 - this.posY)
  613. }, a
  614. }();
  615. a.Splash = b
  616. }(Elements || (Elements = {}));
  617. var Elements;
  618. !function (a) {
  619. var b = function () {
  620. function a(a, b, c, d, e, f, g, h) {
  621. this.timer = .3, this.endTime = 0, this.aScores = new Array, this.posY = 0, this.bigCharSpace = 24, this.smallCharSpace = 16, this.incY = 0, this.aLevelStore = new Array, this.oPanels1ImgData = a, this.oPanels2ImgData = b, this.oBigNumbersImgData = c, this.oSmallNumbersImgData = d, this.panelType = e, this.aButs = f, this.canvasWidth = g, this.canvasHeight = h
  622. }
  623. return a.prototype.update = function (a) {
  624. this.incY += 5 * a
  625. }, a.prototype.startTween1 = function () {
  626. this.posY = 800, TweenLite.to(this, .8, {posY: 0, ease: "Back.easeOut"})
  627. }, a.prototype.startTween2 = function () {
  628. this.posY = 800, TweenLite.to(this, .5, {posY: 0, ease: "Quad.easeOut"})
  629. }, a.prototype.render = function (a) {
  630. switch (this.panelType) {
  631. case "start":
  632. var b = 0, c = b * this.oPanels1ImgData.oData.spriteWidth % this.oPanels1ImgData.img.width, d = Math.floor(b / (this.oPanels1ImgData.img.width / this.oPanels1ImgData.oData.spriteWidth)) * this.oPanels1ImgData.oData.spriteHeight;
  633. a.drawImage(this.oPanels1ImgData.img, c, d, this.oPanels1ImgData.oData.spriteWidth, this.oPanels1ImgData.oData.spriteHeight, 0, 0 + this.posY, this.oPanels1ImgData.oData.spriteWidth, this.oPanels1ImgData.oData.spriteHeight);
  634. break;
  635. case "credits":
  636. var b = 1, c = b * this.oPanels1ImgData.oData.spriteWidth % this.oPanels1ImgData.img.width, d = Math.floor(b / (this.oPanels1ImgData.img.width / this.oPanels1ImgData.oData.spriteWidth)) * this.oPanels1ImgData.oData.spriteHeight;
  637. a.drawImage(this.oPanels1ImgData.img, c, d, this.oPanels1ImgData.oData.spriteWidth, this.oPanels1ImgData.oData.spriteHeight, 0, 0 + this.posY, this.oPanels1ImgData.oData.spriteWidth, this.oPanels1ImgData.oData.spriteHeight);
  638. break;
  639. case "courseSelect":
  640. var b = 2, c = b * this.oPanels1ImgData.oData.spriteWidth % this.oPanels1ImgData.img.width, d = Math.floor(b / (this.oPanels1ImgData.img.width / this.oPanels1ImgData.oData.spriteWidth)) * this.oPanels1ImgData.oData.spriteHeight;
  641. a.drawImage(this.oPanels1ImgData.img, c, d, this.oPanels1ImgData.oData.spriteWidth, this.oPanels1ImgData.oData.spriteHeight, 0, 0 + this.posY, this.oPanels1ImgData.oData.spriteWidth, this.oPanels1ImgData.oData.spriteHeight);
  642. for (var e = 0; e < this.aLevelStore.length; e++) {
  643. g = this.aLevelStore[e];
  644. for (var f = 0; f < g.toString().length; f++) {
  645. b = parseFloat(g.toString().charAt(f));
  646. var c = b * this.oSmallNumbersImgData.oData.spriteWidth % this.oSmallNumbersImgData.img.width, d = Math.floor(b / (this.oSmallNumbersImgData.img.width / this.oSmallNumbersImgData.oData.spriteWidth)) * this.oSmallNumbersImgData.oData.spriteHeight;
  647. a.drawImage(this.oSmallNumbersImgData.img, c, d, this.oSmallNumbersImgData.oData.spriteWidth, this.oSmallNumbersImgData.oData.spriteHeight, 255 + f * this.smallCharSpace - this.smallCharSpace * g.toString().length / 2, 308 + 256 * e + this.posY, this.oSmallNumbersImgData.oData.spriteWidth, this.oSmallNumbersImgData.oData.spriteHeight)
  648. }
  649. }
  650. window.shareFlag = false;
  651. break;
  652. case "levelComplete":
  653. var b = 1, c = b * this.oPanels2ImgData.oData.spriteWidth % this.oPanels2ImgData.img.width, d = Math.floor(b / (this.oPanels2ImgData.img.width / this.oPanels2ImgData.oData.spriteWidth)) * this.oPanels2ImgData.oData.spriteHeight;
  654. a.drawImage(this.oPanels2ImgData.img, c, d, this.oPanels2ImgData.oData.spriteWidth, this.oPanels2ImgData.oData.spriteHeight, 0, 0 + this.posY, this.oPanels2ImgData.oData.spriteWidth, this.oPanels2ImgData.oData.spriteHeight);
  655. for (var g, h = 0, i = 0, j = 0, k = 0, e = 0; e < this.aScores.length && 0 != this.aScores[e].shotNum; e++) {
  656. k++, h += this.aScores[e].par, i += this.aScores[e].shotNum, j += this.aScores[e].pickUps, g = this.aScores[e].par;
  657. for (var f = 0; f < g.toString().length; f++) {
  658. b = parseFloat(g.toString().charAt(f));
  659. var c = b * this.oSmallNumbersImgData.oData.spriteWidth % this.oSmallNumbersImgData.img.width, d = Math.floor(b / (this.oSmallNumbersImgData.img.width / this.oSmallNumbersImgData.oData.spriteWidth)) * this.oSmallNumbersImgData.oData.spriteHeight;
  660. a.drawImage(this.oSmallNumbersImgData.img, c, d, this.oSmallNumbersImgData.oData.spriteWidth, this.oSmallNumbersImgData.oData.spriteHeight, 143 + 50 * e + f * this.smallCharSpace - this.smallCharSpace * g.toString().length / 2, 270 + this.posY, this.oSmallNumbersImgData.oData.spriteWidth, this.oSmallNumbersImgData.oData.spriteHeight)
  661. }
  662. g = this.aScores[e].shotNum;
  663. for (var f = 0; f < g.toString().length; f++) {
  664. b = parseFloat(g.toString().charAt(f));
  665. var c = b * this.oSmallNumbersImgData.oData.spriteWidth % this.oSmallNumbersImgData.img.width, d = Math.floor(b / (this.oSmallNumbersImgData.img.width / this.oSmallNumbersImgData.oData.spriteWidth)) * this.oSmallNumbersImgData.oData.spriteHeight;
  666. a.drawImage(this.oSmallNumbersImgData.img, c, d, this.oSmallNumbersImgData.oData.spriteWidth, this.oSmallNumbersImgData.oData.spriteHeight, 143 + 50 * e + f * this.smallCharSpace - this.smallCharSpace * g.toString().length / 2, 320 + this.posY, this.oSmallNumbersImgData.oData.spriteWidth, this.oSmallNumbersImgData.oData.spriteHeight)
  667. }
  668. }
  669. for (var e = 0; e < h.toString().length; e++) {
  670. b = parseFloat(h.toString().charAt(e));
  671. var c = b * this.oSmallNumbersImgData.oData.spriteWidth % this.oSmallNumbersImgData.img.width, d = Math.floor(b / (this.oSmallNumbersImgData.img.width / this.oSmallNumbersImgData.oData.spriteWidth)) * this.oSmallNumbersImgData.oData.spriteHeight;
  672. a.drawImage(this.oSmallNumbersImgData.img, c, d, this.oSmallNumbersImgData.oData.spriteWidth, this.oSmallNumbersImgData.oData.spriteHeight, 262 + e * this.smallCharSpace - this.smallCharSpace * h.toString().length / 2, 404 + this.posY, this.oSmallNumbersImgData.oData.spriteWidth, this.oSmallNumbersImgData.oData.spriteHeight)
  673. }
  674. for (var e = 0; e < i.toString().length; e++) {
  675. b = parseFloat(i.toString().charAt(e));
  676. var c = b * this.oSmallNumbersImgData.oData.spriteWidth % this.oSmallNumbersImgData.img.width, d = Math.floor(b / (this.oSmallNumbersImgData.img.width / this.oSmallNumbersImgData.oData.spriteWidth)) * this.oSmallNumbersImgData.oData.spriteHeight;
  677. a.drawImage(this.oSmallNumbersImgData.img, c, d, this.oSmallNumbersImgData.oData.spriteWidth, this.oSmallNumbersImgData.oData.spriteHeight, 262 + e * this.smallCharSpace - this.smallCharSpace * i.toString().length / 2, 454 + this.posY, this.oSmallNumbersImgData.oData.spriteWidth, this.oSmallNumbersImgData.oData.spriteHeight)
  678. }
  679. for (var e = 0; e < j.toString().length; e++) {
  680. b = parseFloat(j.toString().charAt(e));
  681. var c = b * this.oSmallNumbersImgData.oData.spriteWidth % this.oSmallNumbersImgData.img.width, d = Math.floor(b / (this.oSmallNumbersImgData.img.width / this.oSmallNumbersImgData.oData.spriteWidth)) * this.oSmallNumbersImgData.oData.spriteHeight;
  682. a.drawImage(this.oSmallNumbersImgData.img, c, d, this.oSmallNumbersImgData.oData.spriteWidth, this.oSmallNumbersImgData.oData.spriteHeight, 375 + e * this.smallCharSpace - this.smallCharSpace * j.toString().length / 2, 429 + this.posY, this.oSmallNumbersImgData.oData.spriteWidth, this.oSmallNumbersImgData.oData.spriteHeight)
  683. }
  684. for (var l = 10 * j + 100 * Math.max(h - i, 0) + 50 * k, e = 0; e < l.toString().length; e++) {
  685. b = parseFloat(l.toString().charAt(e));
  686. var c = b * this.oBigNumbersImgData.oData.spriteWidth % this.oBigNumbersImgData.img.width, d = Math.floor(b / (this.oBigNumbersImgData.img.width / this.oBigNumbersImgData.oData.spriteWidth)) * this.oBigNumbersImgData.oData.spriteHeight;
  687. a.drawImage(this.oBigNumbersImgData.img, c, d, this.oBigNumbersImgData.oData.spriteWidth, this.oBigNumbersImgData.oData.spriteHeight, 495 + e * this.bigCharSpace - this.bigCharSpace * l.toString().length / 2, 438 + this.posY, this.oBigNumbersImgData.oData.spriteWidth, this.oBigNumbersImgData.oData.spriteHeight)
  688. }
  689. if (!window.shareFlag) {
  690. window.shareFlag = true;
  691. var shareLevel = this.aScores.length;
  692. for (var i = 0; i < this.aScores.length; i++) {
  693. if (this.aScores[i].pickUps == 0) {
  694. shareLevel = i;
  695. break;
  696. }
  697. }
  698. var shareScore = l;
  699. // updateShare(shareLevel,l);
  700. // Play68.setRankingLevelScoreDesc(shareLevel,l);
  701. if (shareLevel == 9) {
  702. var shareScore = l;
  703. // play68_submitScore(shareLevel,shareScore);
  704. }
  705. }
  706. saveDataHandler.aLevelStore[courseNum] < l && (saveDataHandler.aLevelStore[courseNum] = l, saveDataHandler.saveData());
  707. break;
  708. case "pause":
  709. var b = 0, c = b * this.oPanels2ImgData.oData.spriteWidth % this.oPanels2ImgData.img.width, d = Math.floor(b / (this.oPanels2ImgData.img.width / this.oPanels2ImgData.oData.spriteWidth)) * this.oPanels2ImgData.oData.spriteHeight;
  710. a.drawImage(this.oPanels2ImgData.img, c, d, this.oPanels2ImgData.oData.spriteWidth, this.oPanels2ImgData.oData.spriteHeight, 0, 0, this.oPanels2ImgData.oData.spriteWidth, this.oPanels2ImgData.oData.spriteHeight)
  711. }
  712. for (var e = 0; e < this.aButs.length; e++) {
  713. var m = this.posY, n = 0;
  714. 0 != this.incY && (n = 3 * Math.sin(this.incY + 45 * e));
  715. var b = this.aButs[e].frame, c = b * this.aButs[e].oImgData.oData.spriteWidth % this.aButs[e].oImgData.img.width, d = Math.floor(b / (this.aButs[e].oImgData.img.width / this.aButs[e].oImgData.oData.spriteWidth)) * this.aButs[e].oImgData.oData.spriteHeight;
  716. a.drawImage(this.aButs[e].oImgData.img, c, d, this.aButs[e].oImgData.oData.spriteWidth, this.aButs[e].oImgData.oData.spriteHeight, this.aButs[e].aPos[0] - this.aButs[e].oImgData.oData.spriteWidth / 2 + m, this.aButs[e].aPos[1] - this.aButs[e].oImgData.oData.spriteHeight / 2 - n, this.aButs[e].oImgData.oData.spriteWidth * this.aButs[e].scale, this.aButs[e].oImgData.oData.spriteHeight * this.aButs[e].scale)
  717. }
  718. }, a
  719. }();
  720. a.Panel = b
  721. }(Elements || (Elements = {}));
  722. var Elements;
  723. !function (a) {
  724. var b = function () {
  725. function a(a, b, c, d, e, f, g) {
  726. this.bigCharSpace = 20, this.smallCharSpace = 10, this.oHudImgData = a, this.oBigNumbersLightImgData = b, this.oBigNumbersDarkImgData = c, this.oSmallNumbersImgData = d, this.oLevelData = e, this.canvasWidth = f, this.canvasHeight = g
  727. }
  728. return a.prototype.render = function (a) {
  729. a.drawImage(this.oHudImgData.img, 0, 0);
  730. for (var b = 0; b < this.oLevelData.hole.toString().length; b++) {
  731. var c = parseFloat(this.oLevelData.hole.toString().charAt(b)), d = c * this.oBigNumbersLightImgData.oData.spriteWidth % this.oBigNumbersLightImgData.img.width, e = Math.floor(c / (this.oBigNumbersLightImgData.img.width / this.oBigNumbersLightImgData.oData.spriteWidth)) * this.oBigNumbersLightImgData.oData.spriteHeight;
  732. a.drawImage(this.oBigNumbersLightImgData.img, d, e, this.oBigNumbersLightImgData.oData.spriteWidth, this.oBigNumbersLightImgData.oData.spriteHeight, 150 + b * this.bigCharSpace, 10, this.oBigNumbersLightImgData.oData.spriteWidth, this.oBigNumbersLightImgData.oData.spriteHeight)
  733. }
  734. for (var b = 0; b < this.oLevelData.par.toString().length; b++) {
  735. var c = parseFloat(this.oLevelData.par.toString().charAt(b)), d = c * this.oSmallNumbersImgData.oData.spriteWidth % this.oSmallNumbersImgData.img.width, e = Math.floor(c / (this.oSmallNumbersImgData.img.width / this.oSmallNumbersImgData.oData.spriteWidth)) * this.oSmallNumbersImgData.oData.spriteHeight;
  736. a.drawImage(this.oSmallNumbersImgData.img, d, e, this.oSmallNumbersImgData.oData.spriteWidth, this.oSmallNumbersImgData.oData.spriteHeight, 293 + b * this.smallCharSpace, 16, this.oSmallNumbersImgData.oData.spriteWidth, this.oSmallNumbersImgData.oData.spriteHeight)
  737. }
  738. for (var b = 0; b < this.oLevelData.shotNum.toString().length; b++) {
  739. var c = parseFloat(this.oLevelData.shotNum.toString().charAt(b)), d = c * this.oBigNumbersDarkImgData.oData.spriteWidth % this.oBigNumbersDarkImgData.img.width, e = Math.floor(c / (this.oBigNumbersDarkImgData.img.width / this.oBigNumbersDarkImgData.oData.spriteWidth)) * this.oBigNumbersDarkImgData.oData.spriteHeight;
  740. a.drawImage(this.oBigNumbersDarkImgData.img, d, e, this.oBigNumbersDarkImgData.oData.spriteWidth, this.oBigNumbersDarkImgData.oData.spriteHeight, 432 + b * this.bigCharSpace, 10, this.oBigNumbersDarkImgData.oData.spriteWidth, this.oBigNumbersDarkImgData.oData.spriteHeight)
  741. }
  742. }, a
  743. }();
  744. a.Hud = b
  745. }(Elements || (Elements = {}));
  746. var __extends = this.__extends || function (a, b) {
  747. function c() {
  748. this.constructor = a
  749. }
  750. c.prototype = b.prototype, a.prototype = new c
  751. }, Elements;
  752. !function (a) {
  753. var b = function (a) {
  754. function b(b, c, d, e, f, g) {
  755. a.call(this, b, 24, 36, "waiting"), this.radian = Math.PI / 180, this.angle = 0, this.inc = 0, this.aTilt = new Array({vx: 0, vy: -3}, {vx: 3, vy: 0}, {vx: 0, vy: 3}, {vx: -3, vy: 0}), this.surfaceOn = null, this.vx = 0, this.vy = 0, this.m = 1, this.f = 1, this.b = 1, this.oRemarkImgData = c, this.oData = d, this.ballCallback = e, this.trackX = this.oData.x, this.trackY = this.oData.y, this.p0 = {x: this.x, y: this.y}, this.p1 = {x: this.x, y: this.y}, this.bounceY = -50, this.bounceInc = 0, this.offsetY = -26, this.canvasWidth = f, this.canvasHeight = g, this.animEndedFunc = this.inWaterEnded, this.renderFunc = this.renderBall, this.changeState("waiting")
  756. }
  757. return __extends(b, a), b.prototype.changeState = function (a, b) {
  758. switch ("undefined" == typeof b && (b = null), this.state = a, a) {
  759. case "reset":
  760. this.fps = 24, this.updateFunc = this.updateWaiting, this.renderFunc = this.renderBall, this.bounceY = -50, this.bounceInc = 0, this.setAnimType("loop", "waiting");
  761. break;
  762. case "waiting":
  763. this.updateFunc = this.updateWaiting, this.setAnimType("loop", "waiting");
  764. break;
  765. case "aiming":
  766. this.updateFunc = this.updateWaiting, this.setAnimType("loop", "moving");
  767. break;
  768. case "moving":
  769. this.vx = b.power / 15 * Math.cos(b.angle), this.vy = b.power / 15 * Math.sin(b.angle), this.vz = 1, this.dec = 1, this.surfaceOn = null;
  770. for (var c = 0; c < this.aSurfaces.length; c++)
  771. this.trackX > this.aSurfaces[c].p0.x && this.trackX < this.aSurfaces[c].p1.x && this.trackY > this.aSurfaces[c].p0.y && this.trackY < this.aSurfaces[c].p1.y && "teleport" == this.aSurfaces[c].type && (this.surfaceOn = "teleport");
  772. this.setAnimType("loop", "moving"), this.tween = TweenLite.to(this, 4 * (Math.max(Math.abs(this.vx), Math.abs(this.vy)) / 6.67), {dec: 0, ease: "Quad.easeOut", onComplete: this.moveEnded, onCompleteParams: [this]}), this.bounceY = 0, this.bounceInc = 1.5 * -b.power, this.p0 = {x: this.trackX, y: this.trackY}, this.p1 = {x: this.trackX, y: this.trackY}, this.updateFunc = this.updateMoving;
  773. break;
  774. case "holed":
  775. this.tween.kill(), this.remarkId = b.remarkId, this.tween = TweenLite.to(this, .5, {trackX: b.x, trackY: b.y, scaleX: 0, scaleY: 0, ease: "Quad.easeOut", onComplete: this.ballHoled, onCompleteParams: [this]}), this.updateFunc = this.updateWaiting;
  776. break;
  777. case "remarking":
  778. this.scaleX = this.scaleY = 1, this.remarkX = this.x, this.remarkY = this.y, this.x = this.y = 0, this.remarkScale = 0, this.tween = TweenLite.to(this, 2, {remarkX: this.canvasWidth / 2, remarkY: this.canvasHeight / 2, remarkScale: 1, ease: "Back.easeOut", onComplete: this.remarkEnded, onCompleteParams: [this]}), this.updateFunc = this.updateRemarking, this.renderFunc = this.renderRemarking;
  779. break;
  780. case "inWater":
  781. this.tween.kill(), this.fps = 15, this.setAnimType("once", "inWater"), this.updateFunc = this.updateInWater, this.renderFunc = this.renderInWater
  782. }
  783. }, b.prototype.moveEnded = function (a) {
  784. a.changeState("waiting"), a.ballCallback("moveEnded")
  785. }, b.prototype.ballHoled = function (a) {
  786. a.changeState("remarking")
  787. }, b.prototype.remarkEnded = function (a) {
  788. a.ballCallback("holeEnded")
  789. }, b.prototype.inWaterEnded = function () {
  790. this.ballCallback("reset"), this.changeState("reset")
  791. }, b.prototype.update = function (a, b, c) {
  792. this.updateFunc(a, b, c)
  793. }, b.prototype.updateInWater = function (b, c, d) {
  794. a.prototype.updateAnimation.call(this, d)
  795. }, b.prototype.render = function (a) {
  796. this.renderFunc(a)
  797. }, b.prototype.updateMoving = function (b, c, d) {
  798. a.prototype.updateAnimation.call(this, d);
  799. var e = this.dec / this.vz;
  800. this.vz *= e, this.vx *= e, this.vy *= e, this.x = this.trackX + b, this.y = this.trackY + c;
  801. for (var f = !1, g = 0; g < this.aSurfaces.length; g++)
  802. if (this.trackX > this.aSurfaces[g].p0.x && this.trackX < this.aSurfaces[g].p1.x && this.trackY > this.aSurfaces[g].p0.y && this.trackY < this.aSurfaces[g].p1.y)
  803. if ("slope" == this.aSurfaces[g].type) {
  804. this.tween.kill(), this.surfaceOn = "slope", f = !0, this.vx = this.vx + this.aTilt[this.aSurfaces[g].dir].vx * d, this.vy = this.vy + this.aTilt[this.aSurfaces[g].dir].vy * d;
  805. var h = Math.abs(this.vx), i = Math.abs(this.vy);
  806. h > 6.67 ? (this.vx = Math.max(Math.min(this.vx, 6.67), -6.67), this.vy = this.vy * (6.67 / h)) : i > 6.67 && (this.vy = Math.max(Math.min(this.vy, 6.67), -6.67), this.vx = this.vx * (6.67 / i))
  807. } else
  808. "mud" == this.aSurfaces[g].type ? ("mud" != this.surfaceOn && (this.tween.timeScale(4), playSound("mud"), this.surfaceOn = "mud"), f = !0) : "water" == this.aSurfaces[g].type && (this.bounceY > -15 && this.bounceInc >= 0 || this.bounceY > -1) ? (playSound("splash"), this.changeState("inWater")) : "teleport" == this.aSurfaces[g].type && ("teleport" != this.surfaceOn && this.teleportMe(g), f = !0);
  809. f || ("slope" == this.surfaceOn ? (this.tween = TweenLite.to(this, 4 * (Math.max(Math.abs(this.vx), Math.abs(this.vy)) / 6.67), {dec: 0, ease: "Quad.easeOut", onComplete: this.moveEnded, onCompleteParams: [this]}), this.surfaceOn = null) : "mud" == this.surfaceOn ? (this.tween.kill(), this.tween = TweenLite.to(this, 4 * (Math.max(Math.abs(this.vx), Math.abs(this.vy)) / 6.67), {dec: 0, ease: "Quad.easeOut", onComplete: this.moveEnded, onCompleteParams: [this]}), this.surfaceOn = null) : "teleport" == this.surfaceOn && (this.surfaceOn = null)), this.bounceInc += 650 * d, this.bounceY += this.bounceInc * d, this.bounceY > 0 && (this.bounceY = 0, this.bounceInc > 75 && this.ballCallback("bounce"), this.bounceInc *= -.8)
  810. }, b.prototype.teleportMe = function (a) {
  811. for (var b = new Array, c = 0; c < this.aSurfaces.length; c++)
  812. "teleport" == this.aSurfaces[c].type && c != a && b.push(this.aSurfaces[c]);
  813. var d = b[Math.floor(Math.random() * b.length)];
  814. this.ballCallback("teleport"), this.trackX = d.p0.x + (d.p1.x - d.p0.x) / 2, this.trackY = d.p0.y + (d.p1.y - d.p0.y) / 2, this.p0 = {x: this.trackX, y: this.trackY}, this.p1 = {x: this.trackX, y: this.trackY}, this.surfaceOn = "teleport"
  815. }, b.prototype.updateWaiting = function (b, c, d) {
  816. a.prototype.updateAnimation.call(this, d), this.x = this.trackX + b, this.y = this.trackY + c, this.bounceInc += 800 * d, this.bounceY += this.bounceInc * d, this.bounceY > 0 && (this.bounceY = 0, this.bounceInc *= -.5)
  817. }, b.prototype.updateRemarking = function () {
  818. }, b.prototype.renderInWater = function (b) {
  819. a.prototype.render.call(this, b)
  820. }, b.prototype.renderBall = function (b) {
  821. a.prototype.render.call(this, b);
  822. var c = 20 * this.oImgData.oData.spriteWidth % this.oImgData.img.width, d = Math.floor(20 / (this.oImgData.img.width / this.oImgData.oData.spriteWidth)) * this.oImgData.oData.spriteHeight;
  823. b.drawImage(this.oImgData.img, c, d, this.oImgData.oData.spriteWidth, this.oImgData.oData.spriteHeight, -this.oImgData.oData.spriteWidth / 2, -this.oImgData.oData.spriteHeight / 2 + this.bounceY - 26, this.oImgData.oData.spriteWidth, this.oImgData.oData.spriteHeight)
  824. }, b.prototype.renderRemarking = function (a) {
  825. var b = this.remarkId * this.oRemarkImgData.oData.spriteWidth % this.oRemarkImgData.img.width, c = Math.floor(this.remarkId / (this.oRemarkImgData.img.width / this.oRemarkImgData.oData.spriteWidth)) * this.oRemarkImgData.oData.spriteHeight;
  826. a.drawImage(this.oRemarkImgData.img, b, c, this.oRemarkImgData.oData.spriteWidth, this.oRemarkImgData.oData.spriteHeight, this.remarkX - this.oRemarkImgData.oData.spriteWidth / 2 * this.remarkScale, this.remarkY - this.oRemarkImgData.oData.spriteHeight / 2 * this.remarkScale, this.oRemarkImgData.oData.spriteWidth * this.remarkScale, this.oRemarkImgData.oData.spriteHeight * this.remarkScale)
  827. }, b
  828. }(Utils.AnimSprite);
  829. a.Ball = b
  830. }(Elements || (Elements = {}));
  831. var Elements;
  832. !function (a) {
  833. var b = function () {
  834. function a(a, b, c) {
  835. this.radian = Math.PI / 180, this.oLevelImgData = a, this.canvasWidth = b, this.canvasHeight = c
  836. }
  837. return a.prototype.update = function (a, b) {
  838. this.x = a, this.y = b
  839. }, a.prototype.render = function (a) {
  840. a.drawImage(this.oLevelImgData.img, -this.x, -this.y, this.canvasWidth, this.canvasHeight, 0, 0, this.canvasWidth, this.canvasHeight)
  841. }, a
  842. }();
  843. a.Level = b
  844. }(Elements || (Elements = {}));
  845. var Elements;
  846. !function (a) {
  847. var b = function () {
  848. function a(a, b, c) {
  849. this.x = 0, this.y = 0, this.scaleX = 0, this.scaleY = 1, this.maxLength = 100, this.oArrowImgData = a, this.canvasWidth = b, this.canvasHeight = c
  850. }
  851. return a.prototype.update = function (a, b, c, d) {
  852. this.x = a, this.y = b, this.lengthX = this.x - c, this.lengthY = this.y - d, this.hyp = Math.min(Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY), this.maxLength), this.scaleX = Math.min(this.hyp / this.maxLength, 1), this.rotation = Math.atan2(this.lengthY, this.lengthX)
  853. }, a.prototype.render = function (a) {
  854. a.save(), a.translate(this.x, this.y), a.rotate(this.rotation), a.scale(this.scaleX, this.scaleY);
  855. var b = 0 * this.oArrowImgData.oData.spriteWidth % this.oArrowImgData.img.width, c = Math.floor(0 / (this.oArrowImgData.img.width / this.oArrowImgData.oData.spriteWidth)) * this.oArrowImgData.oData.spriteHeight;
  856. a.drawImage(this.oArrowImgData.img, b, c, this.oArrowImgData.oData.spriteWidth, this.oArrowImgData.oData.spriteHeight, 0, -this.oArrowImgData.oData.spriteHeight / 2, this.oArrowImgData.oData.spriteWidth, this.oArrowImgData.oData.spriteHeight), a.restore(), a.save(), a.translate(this.x, this.y), a.rotate(this.rotation);
  857. var b = 1 * this.oArrowImgData.oData.spriteWidth % this.oArrowImgData.img.width, c = Math.floor(1 / (this.oArrowImgData.img.width / this.oArrowImgData.oData.spriteWidth)) * this.oArrowImgData.oData.spriteHeight;
  858. a.drawImage(this.oArrowImgData.img, b, c, this.oArrowImgData.oData.spriteWidth, this.oArrowImgData.oData.spriteHeight, this.hyp - 1, -this.oArrowImgData.oData.spriteHeight / 2, this.oArrowImgData.oData.spriteWidth, this.oArrowImgData.oData.spriteHeight), a.restore()
  859. }, a
  860. }();
  861. a.Arrow = b
  862. }(Elements || (Elements = {}));
  863. var Elements;
  864. !function (a) {
  865. var b = function (a) {
  866. function b(b, c, d, e) {
  867. a.call(this, b, 22, 45, "waiting" + c.id), this.canHit = !0, this.oData = c, this.canvasWidth = d, this.canvasHeight = e, this.trackX = this.oData.x, this.trackY = this.oData.y, this.offsetY = -4, this.offsetX = -3, this.frameInc = Math.ceil(100 * Math.random()), this.animEndedFunc = function () {
  868. this.removeMe = !0
  869. }
  870. }
  871. return __extends(b, a), b.prototype.hit = function () {
  872. this.canHit = !1, this.setAnimType("once", "explode")
  873. }, b.prototype.update = function (b, c, d) {
  874. a.prototype.updateAnimation.call(this, d), this.x = this.trackX + b, this.y = this.trackY + c
  875. }, b
  876. }(Utils.AnimSprite);
  877. a.PickUp = b
  878. }(Elements || (Elements = {}));
  879. var Elements;
  880. !function (a) {
  881. var b = function (a) {
  882. function b(b, c) {
  883. a.call(this, b, 20, 30, "explode"), this.oData = c, this.trackX = this.oData.x, this.trackY = this.oData.y, this.setAnimType("once", "explode"), this.animEndedFunc = function () {
  884. this.removeMe = !0
  885. }
  886. }
  887. return __extends(b, a), b.prototype.update = function (b, c, d) {
  888. a.prototype.updateAnimation.call(this, d), this.x = this.trackX + b, this.y = this.trackY + c
  889. }, b
  890. }(Utils.AnimSprite);
  891. a.Bounce = b
  892. }(Elements || (Elements = {}));
  893. var Elements;
  894. !function (a) {
  895. var b = function (a) {
  896. function b(b, c, d, e) {
  897. a.call(this, b, 22, 45, "falling" + c.id), this.oData = c, this.x = this.oData.x, this.y = this.oData.y, this.canvasWidth = d, this.canvasHeight = e
  898. }
  899. return __extends(b, a), b.prototype.update = function (b) {
  900. a.prototype.updateAnimation.call(this, b)
  901. }, b
  902. }(Utils.AnimSprite);
  903. a.FallingGem = b
  904. }(Elements || (Elements = {}));
  905. var Utils;
  906. !function (a) {
  907. var b = function () {
  908. function a(a, b) {
  909. this.aLines = new Array, this.aBalls = new Array, this.aLines = a, this.aBalls.push(b);
  910. for (var c = 0; c < this.aLines.length; c++)
  911. this.updateVector(this.aLines[c], null, !0)
  912. }
  913. return a.prototype.drawAll = function (a) {
  914. for (var b = 0; b < this.aBalls.length; b++)
  915. if ("moving" == this.aBalls[b].state) {
  916. var c = this.aBalls[b];
  917. c.trackX = c.p1.x, c.trackY = c.p1.y, c.p0 = c.p1, this.updateVector(c, a)
  918. }
  919. }, a.prototype.update = function (a) {
  920. var b;
  921. for (b = 0; b < this.aBalls.length; b++) {
  922. var c = this.aBalls[b];
  923. this.updateVector(c, a);
  924. for (var d = 0; d < this.aLines.length; d++) {
  925. this.fi = this.findIntersection(c, this.aLines[d]), this.updateVector(this.fi, a, !1);
  926. var e = c.radius - this.fi.len;
  927. if (e >= 0) {
  928. addBounce(c.p1.x, c.p1.y), playSound("wall" + Math.ceil(2 * Math.random())), c.p1.x += this.fi.dx * e, c.p1.y += this.fi.dy * e;
  929. var f = {dx: this.fi.lx, dy: this.fi.ly, lx: this.fi.dx, ly: this.fi.dy, b: 1, f: 1}, g = this.bounce(c, f);
  930. c.vx = g.vx, c.vy = g.vy
  931. }
  932. }
  933. }
  934. this.drawAll(a)
  935. }, a.prototype.updateVector = function (a, b, c) {
  936. "undefined" == typeof c && (c = !1), null == b && (b = .016), 1 == c ? (a.vx = a.p1.x - a.p0.x, a.vy = a.p1.y - a.p0.y) : (a.p1.x = a.p0.x + 60 * a.vx * b, a.p1.y = a.p0.y + 60 * a.vy * b), this.makeVector(a)
  937. }, a.prototype.makeVector = function (a) {
  938. a.len = Math.sqrt(a.vx * a.vx + a.vy * a.vy), a.len > 0 ? (a.dx = a.vx / a.len, a.dy = a.vy / a.len) : (a.dx = 0, a.dy = 0), a.rx = -a.dy, a.ry = a.dx, a.lx = a.dy, a.ly = -a.dx
  939. }, a.prototype.dotP = function (a, b) {
  940. var c = a.vx * b.vx + a.vy * b.vy;
  941. return c
  942. }, a.prototype.projectVector = function (a, b, c) {
  943. var d = a.vx * b + a.vy * c, e = {};
  944. return e.vx = d * b, e.vy = d * c, e
  945. }, a.prototype.bounceBalls = function (a, b, c) {
  946. var d = this.projectVector(a, c.dx, c.dy), e = this.projectVector(a, c.lx, c.ly), f = this.projectVector(b, c.dx, c.dy), g = this.projectVector(b, c.lx, c.ly), h = a.m * d.vx + b.m * f.vx, i = d.vx - f.vx, j = (h + i * a.m) / (a.m + b.m), k = j - i;
  947. h = a.m * d.vy + b.m * f.vy, i = d.vy - f.vy;
  948. var l = (h + i * a.m) / (a.m + b.m), m = l - i, n = {};
  949. return n.vx1 = e.vx + k, n.vy1 = e.vy + m, n.vx2 = g.vx + j, n.vy2 = g.vy + l, n
  950. }, a.prototype.bounce = function (a, b) {
  951. var c = this.projectVector(a, b.dx, b.dy), d = this.projectVector(a, b.lx, b.ly), e = {};
  952. return d.len = Math.sqrt(d.vx * d.vx + d.vy * d.vy), d.vx = b.lx * d.len, d.vy = b.ly * d.len, e.vx = a.f * b.f * c.vx + a.b * b.b * d.vx, e.vy = a.f * b.f * c.vy + a.b * b.b * d.vy, e
  953. }, a.prototype.findIntersection = function (a, b) {
  954. var c = {}, d = {};
  955. d.vx = a.p1.x - b.p0.x, d.vy = a.p1.y - b.p0.y;
  956. var e = d.vx * b.dx + d.vy * b.dy;
  957. if (0 > e)
  958. c = d;
  959. else {
  960. var f = {};
  961. f.vx = a.p1.x - b.p1.x, f.vy = a.p1.y - b.p1.y, e = f.vx * b.dx + f.vy * b.dy, c = e > 0 ? f : this.projectVector(d, b.lx, b.ly)
  962. }
  963. return c.p0 = {x: 0, y: 0}, c.p1 = {x: 0, y: 0}, c
  964. }, a
  965. }();
  966. a.Physics2D = b
  967. }(Utils || (Utils = {}));
  968. var Utils;
  969. !function (a) {
  970. var b = function () {
  971. function a(a, b) {
  972. this.saveDataId = a, this.totalLevels = b, this.aLevelStore = new Array;
  973. for (var c = 0; c < this.totalLevels; c++)
  974. this.aLevelStore.push(0);
  975. this.setInitialData()
  976. }
  977. return a.prototype.setInitialData = function () {
  978. if ("undefined" != typeof Storage)
  979. if (null != localStorage.getItem(this.saveDataId)) {
  980. this.aLevelStore = localStorage.getItem(this.saveDataId).split(",");
  981. for (var a in this.aLevelStore)
  982. this.aLevelStore[a] = parseInt(this.aLevelStore[a])
  983. } else
  984. this.saveData()
  985. }, a.prototype.saveData = function () {
  986. if ("undefined" != typeof Storage) {
  987. for (var a = "", b = 0; b < this.aLevelStore.length; b++)
  988. a += this.aLevelStore[b], b < this.aLevelStore.length - 1 && (a += ",");
  989. localStorage.setItem(this.saveDataId, a)
  990. }
  991. }, a
  992. }();
  993. a.SaveDataHandler = b
  994. }(Utils || (Utils = {}));
  995. var requestAnimFrame = function () {
  996. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (a) {
  997. window.setTimeout(a, 1e3 / 60, (new Date).getTime())
  998. }
  999. }(), previousTime, canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d");
  1000. canvas.width = 600, canvas.height = 800;
  1001. var canvasX, canvasY, canvasScaleX, canvasScaleY, div = document.getElementById("viewporter"), sound, music, audioType = 0, muted = !1, splash, splashTimer = 0, assetLib, preAssetLib, rotatePause = !1, manualPause = !1, isMobile = !1, gameState = "loading", aLangs = new Array("EN", "DE", "TR"), curLang = "", isBugBrowser = !1, isIE10 = !1;
  1002. navigator.userAgent.match(/MSIE\s([\d]+)/) && (isIE10 = !0);
  1003. var deviceAgent = navigator.userAgent.toLowerCase();
  1004. (deviceAgent.match(/(iphone|ipod|ipad)/) || deviceAgent.match(/(android)/) || deviceAgent.match(/(iemobile)/) || deviceAgent.match(/iphone/i) || deviceAgent.match(/ipad/i) || deviceAgent.match(/ipod/i) || deviceAgent.match(/blackberry/i) || deviceAgent.match(/bada/i)) && (isMobile = !0, deviceAgent.match(/(android)/) && !/Chrome/.test(navigator.userAgent) && (isBugBrowser = !0));
  1005. var userInput = new Utils.UserInput(canvas, isBugBrowser);
  1006. resizeCanvas(), window.onresize = function () {
  1007. setTimeout(function () {
  1008. resizeCanvas()
  1009. }, 1)
  1010. }, window.addEventListener("load", function () {
  1011. setTimeout(function () {
  1012. resizeCanvas()
  1013. }, 0), window.addEventListener("orientationchange", function () {
  1014. resizeCanvas()
  1015. }, !1)
  1016. }), isIE10 || "undefined" == typeof window.AudioContext && "undefined" == typeof window.webkitAudioContext && -1 != navigator.userAgent.indexOf("Android") ? (audioType = 0, music = new Audio("audio/music.ogg"), music.addEventListener("ended", function () {
  1017. this.currentTime = 0, this.play()
  1018. }, !1), music.play()) : (audioType = 1,
  1019. sound = new Howl({urls: ["audio/sound.ogg", "audio/sound.m4a"],
  1020. sprite: {splash: [0, 1500], bounce1: [2e3, 300],
  1021. wall1: [2500, 300], bounce2: [3e3, 300], wall2: [3500, 500],
  1022. teleport: [4500, 750], start: [5500, 1500], reset: [7500, 1200],
  1023. gem1: [9e3, 750], gem2: [10500, 750], gem3: [12e3, 750], gem4: [13500, 750],
  1024. holed: [15e3, 2500], hit: [18e3, 500], mud: [19e3, 500], click: [2e4, 500]}}),
  1025. music = new Howl({urls: ["audio/music.ogg", "audio/music.m4a"], volume: .5, loop: !0}));
  1026. var panel, hud, background, totalScore = 0, levelScore = 0, levelNum, aScores, aTutorials = new Array, panelFrame, oLogoData = {}, oLogoBut, ball, oHolePos, physics2D, level, gameTouchState, oPosData = {prevBallX: 0, prevBallY: 0, stageX: 0, stageY: 0, targStageX: 0, targStageY: 0, startDragX: 0, startDragY: 0, startStageX: 0, startStageY: 0}, aimX, aimY, targAimX, targAimY, vx, vy, arrow, scollBackInc, levelWidth = 800, levelHeight = 1e3, buffer = 100, aPickUps, aBounces, courseNum, musicTween, saveDataHandler = new Utils.SaveDataHandler("miniPutt1", 2), aLevelData = new Array([
  1027. {par: 2, aData: [
  1028. {type: "tee", p0: {x: 469, y: 732}, p1: {x: 469, y: 732}},
  1029. {type: "hole", p0: {x: 322, y: 317}, p1: {x: 322, y: 317}},
  1030. {type: "pickUp", p0: {x: 455, y: 611}, p1: {x: 455, y: 611}},
  1031. {type: "pickUp", p0: {x: 428, y: 531}, p1: {x: 428, y: 531}},
  1032. {type: "pickUp", p0: {x: 400, y: 450}, p1: {x: 400, y: 450}},
  1033. {type: "pickUp", p0: {x: 373, y: 370}, p1: {x: 373, y: 370}},
  1034. {type: "pickUp", p0: {x: 396, y: 631}, p1: {x: 396, y: 631}},
  1035. {type: "pickUp", p0: {x: 369, y: 551}, p1: {x: 369, y: 551}},
  1036. {type: "pickUp", p0: {x: 341, y: 470}, p1: {x: 341, y: 470}},
  1037. {type: "pickUp", p0: {x: 314, y: 390}, p1: {x: 314, y: 390}},
  1038. {type: "wall", p0: {x: 267, y: 196}, p1: {x: 177, y: 387}},
  1039. {type: "wall", p0: {x: 286, y: 189}, p1: {x: 477, y: 280}},
  1040. {type: "wall", p0: {x: 184, y: 274}, p1: {x: 401, y: 196}},
  1041. {type: "wall", p0: {x: 607, y: 770}, p1: {x: 401, y: 196}},
  1042. {type: "wall", p0: {x: 390, y: 848}, p1: {x: 607, y: 770}},
  1043. {type: "wall", p0: {x: 184, y: 274}, p1: {x: 390, y: 848}}
  1044. ]},
  1045. {par: 2, aData: [
  1046. {type: "tee", p0: {x: 236, y: 771}, p1: {x: 236, y: 771}},
  1047. {type: "hole", p0: {x: 589, y: 409}, p1: {x: 589, y: 409}},
  1048. {type: "pickUp", p0: {x: 478, y: 318}, p1: {x: 478, y: 318}},
  1049. {type: "pickUp", p0: {x: 432, y: 362}, p1: {x: 432, y: 362}},
  1050. {type: "pickUp", p0: {x: 525, y: 367}, p1: {x: 525, y: 367}},
  1051. {type: "pickUp", p0: {x: 479, y: 411}, p1: {x: 479, y: 411}},
  1052. {type: "pickUp", p0: {x: 225, y: 489}, p1: {x: 225, y: 489}},
  1053. {type: "pickUp", p0: {x: 225, y: 553}, p1: {x: 225, y: 553}},
  1054. {type: "pickUp", p0: {x: 293, y: 489}, p1: {x: 293, y: 489}},
  1055. {type: "pickUp", p0: {x: 304, y: 379}, p1: {x: 304, y: 379}},
  1056. {type: "pickUp", p0: {x: 293, y: 553}, p1: {x: 293, y: 553}},
  1057. {type: "wall", p0: {x: 89, y: 449}, p1: {x: 511, y: 28}},
  1058. {type: "wall", p0: {x: 444, y: 136}, p1: {x: 865, y: 557}},
  1059. {type: "wall", p0: {x: 667, y: 224}, p1: {x: 667, y: 820}},
  1060. {type: "wall", p0: {x: 747, y: 831}, p1: {x: 151, y: 831}},
  1061. {type: "wall", p0: {x: 947, y: 537}, p1: {x: 359, y: 442}},
  1062. {type: "wall", p0: {x: 355, y: 441}, p1: {x: 259, y: 1029}},
  1063. {type: "wall", p0: {x: 757, y: 245}, p1: {x: 161, y: 245}},
  1064. {type: "wall", p0: {x: 177, y: 245}, p1: {x: 177, y: 841}}
  1065. ]},
  1066. {par: 4, aData: [
  1067. {type: "tee", p0: {x: 624, y: 801}, p1: {x: 624, y: 801}},
  1068. {type: "hole", p0: {x: 175, y: 801}, p1: {x: 175, y: 801}},
  1069. {type: "pickUp", p0: {x: 622, y: 409}, p1: {x: 622, y: 409}},
  1070. {type: "pickUp", p0: {x: 622, y: 510}, p1: {x: 622, y: 510}},
  1071. {type: "pickUp", p0: {x: 621, y: 611}, p1: {x: 621, y: 611}},
  1072. {type: "pickUp", p0: {x: 354, y: 708}, p1: {x: 354, y: 708}},
  1073. {type: "pickUp", p0: {x: 452, y: 711}, p1: {x: 452, y: 711}},
  1074. {type: "pickUp", p0: {x: 354, y: 608}, p1: {x: 354, y: 608}},
  1075. {type: "pickUp", p0: {x: 452, y: 611}, p1: {x: 452, y: 611}},
  1076. {type: "pickUp", p0: {x: 175, y: 409}, p1: {x: 175, y: 409}},
  1077. {type: "pickUp", p0: {x: 175, y: 510}, p1: {x: 175, y: 510}},
  1078. {type: "pickUp", p0: {x: 174, y: 611}, p1: {x: 174, y: 611}},
  1079. {type: "pickUp", p0: {x: 177, y: 710}, p1: {x: 177, y: 710}},
  1080. {type: "pickUp", p0: {x: 263, y: 357}, p1: {x: 263, y: 357}},
  1081. {type: "pickUp", p0: {x: 354, y: 354}, p1: {x: 354, y: 354}},
  1082. {type: "pickUp", p0: {x: 452, y: 357}, p1: {x: 452, y: 357}},
  1083. {type: "pickUp", p0: {x: 543, y: 360}, p1: {x: 543, y: 360}},
  1084. {type: "wall", p0: {x: 94, y: 301}, p1: {x: 250, y: 145}},
  1085. {type: "wall", p0: {x: 712, y: 301}, p1: {x: 556, y: 145}},
  1086. {type: "wall", p0: {x: 403, y: 301}, p1: {x: 247, y: 145}},
  1087. {type: "wall", p0: {x: 403, y: 301}, p1: {x: 559, y: 145}},
  1088. {type: "wall", p0: {x: 540, y: 1100}, p1: {x: 540, y: 410}},
  1089. {type: "wall", p0: {x: 260, y: 410}, p1: {x: 260, y: 1100}},
  1090. {type: "wall", p0: {x: 100, y: 190}, p1: {x: 700, y: 190}},
  1091. {type: "wall", p0: {x: 700, y: 880}, p1: {x: 700, y: 190}},
  1092. {type: "wall", p0: {x: 100, y: 880}, p1: {x: 700, y: 880}},
  1093. {type: "wall", p0: {x: 100, y: 190}, p1: {x: 100, y: 880}},
  1094. {type: "slope0", p0: {x: 256, y: 414}, p1: {x: 540, y: 874}}
  1095. ]},
  1096. {par: 4, aData: [
  1097. {type: "tee", p0: {x: 543, y: 769}, p1: {x: 543, y: 769}},
  1098. {type: "hole", p0: {x: 168, y: 310}, p1: {x: 168, y: 310}},
  1099. {type: "pickUp", p0: {x: 242, y: 532}, p1: {x: 242, y: 532}},
  1100. {type: "pickUp", p0: {x: 391, y: 371}, p1: {x: 391, y: 371}},
  1101. {type: "pickUp", p0: {x: 633, y: 329}, p1: {x: 633, y: 329}},
  1102. {type: "pickUp", p0: {x: 636, y: 510}, p1: {x: 636, y: 510}},
  1103. {type: "pickUp", p0: {x: 500, y: 447}, p1: {x: 500, y: 447}},
  1104. {type: "pickUp", p0: {x: 188, y: 760}, p1: {x: 188, y: 760}},
  1105. {type: "pickUp", p0: {x: 281, y: 299}, p1: {x: 281, y: 299}},
  1106. {type: "pickUp", p0: {x: 147, y: 436}, p1: {x: 147, y: 436}},
  1107. {type: "pickUp", p0: {x: 645, y: 678}, p1: {x: 645, y: 678}},
  1108. {type: "pickUp", p0: {x: 448, y: 680}, p1: {x: 448, y: 680}},
  1109. {type: "wall", p0: {x: 592, y: 441}, p1: {x: 506, y: 526}},
  1110. {type: "wall", p0: {x: 734, y: 338}, p1: {x: 592, y: 196}},
  1111. {type: "wall", p0: {x: 588, y: 701}, p1: {x: 504, y: 701}},
  1112. {type: "wall", p0: {x: 588, y: 628}, p1: {x: 588, y: 697}},
  1113. {type: "wall", p0: {x: 277, y: 625}, p1: {x: 277, y: 826}},
  1114. {type: "wall", p0: {x: 281, y: 425}, p1: {x: 281, y: 343}},
  1115. {type: "wall", p0: {x: 734, y: 718}, p1: {x: 592, y: 860}},
  1116. {type: "wall", p0: {x: 355, y: 718}, p1: {x: 497, y: 860}},
  1117. {type: "wall", p0: {x: 100, y: 826}, p1: {x: 700, y: 826}},
  1118. {type: "wall", p0: {x: 504, y: 628}, p1: {x: 588, y: 628}},
  1119. {type: "wall", p0: {x: 277, y: 625}, p1: {x: 390, y: 625}},
  1120. {type: "wall", p0: {x: 280, y: 425}, p1: {x: 198, y: 425}},
  1121. {type: "wall", p0: {x: 504, y: 701}, p1: {x: 504, y: 632}},
  1122. {type: "wall", p0: {x: 391, y: 625}, p1: {x: 391, y: 826}},
  1123. {type: "wall", p0: {x: 100, y: 236}, p1: {x: 700, y: 236}},
  1124. {type: "wall", p0: {x: 700, y: 880}, p1: {x: 700, y: 190}},
  1125. {type: "wall", p0: {x: 100, y: 190}, p1: {x: 100, y: 880}},
  1126. {type: "slope1", p0: {x: 188, y: 420}, p1: {x: 290, y: 614}},
  1127. {type: "slope2", p0: {x: 291, y: 245}, p1: {x: 475, y: 427}}
  1128. ]},
  1129. {par: 4, aData: [
  1130. {type: "tee", p0: {x: 395, y: 454}, p1: {x: 395, y: 454}},
  1131. {type: "hole", p0: {x: 394, y: 575}, p1: {x: 394, y: 575}},
  1132. {type: "pickUp", p0: {x: 215, y: 264}, p1: {x: 215, y: 264}},
  1133. {type: "pickUp", p0: {x: 587, y: 264}, p1: {x: 587, y: 264}},
  1134. {type: "pickUp", p0: {x: 215, y: 814}, p1: {x: 215, y: 814}},
  1135. {type: "pickUp", p0: {x: 587, y: 814}, p1: {x: 587, y: 814}},
  1136. {type: "pickUp", p0: {x: 557, y: 522}, p1: {x: 557, y: 522}},
  1137. {type: "pickUp", p0: {x: 243, y: 522}, p1: {x: 243, y: 522}},
  1138. {type: "pickUp", p0: {x: 504, y: 586}, p1: {x: 504, y: 586}},
  1139. {type: "pickUp", p0: {x: 288, y: 586}, p1: {x: 288, y: 586}},
  1140. {type: "pickUp", p0: {x: 504, y: 457}, p1: {x: 504, y: 457}},
  1141. {type: "pickUp", p0: {x: 288, y: 457}, p1: {x: 288, y: 457}},
  1142. {type: "wall", p0: {x: 400, y: 258}, p1: {x: 192, y: 173}},
  1143. {type: "wall", p0: {x: 399, y: 258}, p1: {x: 608, y: 173}},
  1144. {type: "wall", p0: {x: 399, y: 801}, p1: {x: 191, y: 886}},
  1145. {type: "wall", p0: {x: 398, y: 801}, p1: {x: 607, y: 886}},
  1146. {type: "wall", p0: {x: -28, y: 512}, p1: {x: 197, y: 512}},
  1147. {type: "wall", p0: {x: 611, y: 512}, p1: {x: 836, y: 512}},
  1148. {type: "wall", p0: {x: 100, y: 866}, p1: {x: 700, y: 866}},
  1149. {type: "wall", p0: {x: 286, y: 512}, p1: {x: 511, y: 512}},
  1150. {type: "wall", p0: {x: 100, y: 197}, p1: {x: 700, y: 197}},
  1151. {type: "wall", p0: {x: 640, y: 880}, p1: {x: 640, y: 190}},
  1152. {type: "wall", p0: {x: 160, y: 190}, p1: {x: 160, y: 880}},
  1153. {type: "slope0", p0: {x: 254, y: 303}, p1: {x: 540, y: 403}},
  1154. {type: "slope2", p0: {x: 250, y: 631}, p1: {x: 536, y: 733}}
  1155. ]},
  1156. {par: 5, aData: [
  1157. {type: "tee", p0: {x: 190, y: 244}, p1: {x: 190, y: 244}},
  1158. {type: "hole", p0: {x: 343, y: 498}, p1: {x: 343, y: 498}},
  1159. {type: "pickUp", p0: {x: 486, y: 700}, p1: {x: 486, y: 700}},
  1160. {type: "pickUp", p0: {x: 493, y: 378}, p1: {x: 493, y: 378}},
  1161. {type: "pickUp", p0: {x: 340, y: 572}, p1: {x: 340, y: 572}},
  1162. {type: "pickUp", p0: {x: 486, y: 542}, p1: {x: 486, y: 542}},
  1163. {type: "pickUp", p0: {x: 214, y: 392}, p1: {x: 214, y: 392}},
  1164. {type: "pickUp", p0: {x: 199, y: 819}, p1: {x: 199, y: 819}},
  1165. {type: "pickUp", p0: {x: 595, y: 805}, p1: {x: 595, y: 805}},
  1166. {type: "pickUp", p0: {x: 610, y: 543}, p1: {x: 610, y: 543}},
  1167. {type: "pickUp", p0: {x: 614, y: 259}, p1: {x: 614, y: 259}},
  1168. {type: "pickUp", p0: {x: 339, y: 255}, p1: {x: 339, y: 255}},
  1169. {type: "wall", p0: {x: 716, y: 302}, p1: {x: 574, y: 160}},
  1170. {type: "wall", p0: {x: 217, y: 303}, p1: {x: 75, y: 444}},
  1171. {type: "wall", p0: {x: 705, y: 774}, p1: {x: 564, y: 916}},
  1172. {type: "wall", p0: {x: 432, y: 635}, p1: {x: 432, y: 421}},
  1173. {type: "wall", p0: {x: 253, y: 420}, p1: {x: 432, y: 420}},
  1174. {type: "wall", p0: {x: 252, y: 755}, p1: {x: 252, y: 420}},
  1175. {type: "wall", p0: {x: 252, y: 755}, p1: {x: 547, y: 755}},
  1176. {type: "wall", p0: {x: 547, y: 755}, p1: {x: 547, y: 301}},
  1177. {type: "wall", p0: {x: 2, y: 300}, p1: {x: 546, y: 300}},
  1178. {type: "wall", p0: {x: 132, y: 190}, p1: {x: 676, y: 190}},
  1179. {type: "wall", p0: {x: 676, y: 880}, p1: {x: 676, y: 190}},
  1180. {type: "wall", p0: {x: 132, y: 880}, p1: {x: 676, y: 880}},
  1181. {type: "wall", p0: {x: 132, y: 190}, p1: {x: 132, y: 880}},
  1182. {type: "slope0", p0: {x: 135, y: 455}, p1: {x: 251, y: 636}},
  1183. {type: "slope2", p0: {x: 550, y: 455}, p1: {x: 672, y: 636}}
  1184. ]},
  1185. {par: 4, aData: [
  1186. {type: "tee", p0: {x: 398, y: 277}, p1: {x: 398, y: 277}},
  1187. {type: "hole", p0: {x: 403, y: 780}, p1: {x: 403, y: 780}},
  1188. {type: "pickUp", p0: {x: 245, y: 461}, p1: {x: 245, y: 461}},
  1189. {type: "pickUp", p0: {x: 557, y: 623}, p1: {x: 557, y: 623}},
  1190. {type: "pickUp", p0: {x: 426, y: 645}, p1: {x: 426, y: 645}},
  1191. {type: "pickUp", p0: {x: 319, y: 645}, p1: {x: 319, y: 645}},
  1192. {type: "pickUp", p0: {x: 456, y: 412}, p1: {x: 456, y: 412}},
  1193. {type: "pickUp", p0: {x: 349, y: 412}, p1: {x: 349, y: 412}},
  1194. {type: "pickUp", p0: {x: 191, y: 542}, p1: {x: 191, y: 542}},
  1195. {type: "pickUp", p0: {x: 605, y: 541}, p1: {x: 605, y: 541}},
  1196. {type: "pickUp", p0: {x: 318, y: 719}, p1: {x: 318, y: 719}},
  1197. {type: "pickUp", p0: {x: 457, y: 337}, p1: {x: 457, y: 337}},
  1198. {type: "wall", p0: {x: 361, y: 691}, p1: {x: 905, y: 691}},
  1199. {type: "wall", p0: {x: -128, y: 348}, p1: {x: 416, y: 347}},
  1200. {type: "wall", p0: {x: 401, y: 178}, p1: {x: 700, y: 534}},
  1201. {type: "wall", p0: {x: 401, y: 890}, p1: {x: 700, y: 534}},
  1202. {type: "wall", p0: {x: 101, y: 534}, p1: {x: 401, y: 890}},
  1203. {type: "wall", p0: {x: 401, y: 178}, p1: {x: 101, y: 534}},
  1204. {type: "mud", p0: {x: 258, y: 445}, p1: {x: 550, y: 604}}
  1205. ]},
  1206. {par: 4, aData: [
  1207. {type: "tee", p0: {x: 289, y: 275}, p1: {x: 289, y: 275}},
  1208. {type: "hole", p0: {x: 529, y: 419}, p1: {x: 529, y: 419}},
  1209. {type: "pickUp", p0: {x: 546, y: 650}, p1: {x: 546, y: 650}},
  1210. {type: "pickUp", p0: {x: 504, y: 730}, p1: {x: 504, y: 730}},
  1211. {type: "pickUp", p0: {x: 437, y: 773}, p1: {x: 437, y: 773}},
  1212. {type: "pickUp", p0: {x: 355, y: 773}, p1: {x: 355, y: 773}},
  1213. {type: "pickUp", p0: {x: 303, y: 722}, p1: {x: 303, y: 722}},
  1214. {type: "pickUp", p0: {x: 284, y: 646}, p1: {x: 284, y: 646}},
  1215. {type: "pickUp", p0: {x: 538, y: 348}, p1: {x: 538, y: 348}},
  1216. {type: "pickUp", p0: {x: 463, y: 412}, p1: {x: 463, y: 412}},
  1217. {type: "pickUp", p0: {x: 592, y: 427}, p1: {x: 592, y: 427}},
  1218. {type: "wall", p0: {x: 546, y: 477}, p1: {x: 540, y: 520}},
  1219. {type: "wall", p0: {x: 485, y: 513}, p1: {x: 540, y: 520}},
  1220. {type: "wall", p0: {x: 491, y: 470}, p1: {x: 485, y: 513}},
  1221. {type: "wall", p0: {x: 546, y: 477}, p1: {x: 491, y: 470}},
  1222. {type: "wall", p0: {x: 398, y: 230}, p1: {x: 398, y: 636}},
  1223. {type: "wall", p0: {x: 203, y: 201}, p1: {x: 680, y: 268}},
  1224. {type: "wall", p0: {x: 595, y: 877}, p1: {x: 680, y: 268}},
  1225. {type: "wall", p0: {x: 118, y: 810}, p1: {x: 595, y: 877}},
  1226. {type: "wall", p0: {x: 203, y: 201}, p1: {x: 118, y: 810}},
  1227. {type: "mud", p0: {x: 247, y: 333}, p1: {x: 395, y: 392}},
  1228. {type: "mud", p0: {x: 169, y: 441}, p1: {x: 317, y: 500}},
  1229. {type: "slope0", p0: {x: 396, y: 302}, p1: {x: 682, y: 375}},
  1230. {type: "mud", p0: {x: 251, y: 557}, p1: {x: 399, y: 616}},
  1231. {type: "slope2", p0: {x: 400, y: 549}, p1: {x: 686, y: 620}},
  1232. {type: "slope0", p0: {x: 107, y: 673}, p1: {x: 659, y: 886}}
  1233. ]},
  1234. {par: 5, aData: [
  1235. {type: "tee", p0: {x: 604, y: 266}, p1: {x: 604, y: 266}},
  1236. {type: "hole", p0: {x: 196, y: 825}, p1: {x: 196, y: 825}},
  1237. {type: "pickUp", p0: {x: 413, y: 813}, p1: {x: 413, y: 813}},
  1238. {type: "pickUp", p0: {x: 413, y: 681}, p1: {x: 413, y: 681}},
  1239. {type: "pickUp", p0: {x: 560, y: 720}, p1: {x: 560, y: 720}},
  1240. {type: "pickUp", p0: {x: 272, y: 646}, p1: {x: 272, y: 646}},
  1241. {type: "pickUp", p0: {x: 413, y: 530}, p1: {x: 413, y: 530}},
  1242. {type: "pickUp", p0: {x: 560, y: 569}, p1: {x: 560, y: 569}},
  1243. {type: "pickUp", p0: {x: 272, y: 495}, p1: {x: 272, y: 495}},
  1244. {type: "pickUp", p0: {x: 413, y: 382}, p1: {x: 413, y: 382}},
  1245. {type: "pickUp", p0: {x: 560, y: 421}, p1: {x: 560, y: 421}},
  1246. {type: "pickUp", p0: {x: 272, y: 347}, p1: {x: 272, y: 347}},
  1247. {type: "wall", p0: {x: 126, y: 752}, p1: {x: 438, y: 752}},
  1248. {type: "wall", p0: {x: 420, y: 323}, p1: {x: 718, y: 398}},
  1249. {type: "wall", p0: {x: 677, y: 747}, p1: {x: 590, y: 899}},
  1250. {type: "wall", p0: {x: 674, y: 194}, p1: {x: 599, y: 511}},
  1251. {type: "wall", p0: {x: 599, y: 512}, p1: {x: 680, y: 743}},
  1252. {type: "wall", p0: {x: 207, y: 162}, p1: {x: 207, y: 592}},
  1253. {type: "wall", p0: {x: 207, y: 594}, p1: {x: 133, y: 729}},
  1254. {type: "wall", p0: {x: 674, y: 880}, p1: {x: 130, y: 880}},
  1255. {type: "wall", p0: {x: 130, y: 190}, p1: {x: 130, y: 880}},
  1256. {type: "wall", p0: {x: 130, y: 191}, p1: {x: 674, y: 190}},
  1257. {type: "wall", p0: {x: 413, y: 595}, p1: {x: 743, y: 678}},
  1258. {type: "wall", p0: {x: 138, y: 386}, p1: {x: 436, y: 461}},
  1259. {type: "slope1", p0: {x: 140, y: 185}, p1: {x: 330, y: 752}},
  1260. {type: "slope3", p0: {x: 444, y: 757}, p1: {x: 666, y: 872}}
  1261. ]}
  1262. ], [
  1263. {par: 3, aData: [
  1264. {type: "tee", p0: {x: 391, y: 288}, p1: {x: 391, y: 288}},
  1265. {type: "hole", p0: {x: 392, y: 747}, p1: {x: 392, y: 747}},
  1266. {type: "pickUp", p0: {x: 323, y: 742}, p1: {x: 323, y: 742}},
  1267. {type: "pickUp", p0: {x: 234, y: 762}, p1: {x: 234, y: 762}},
  1268. {type: "pickUp", p0: {x: 237, y: 610}, p1: {x: 237, y: 610}},
  1269. {type: "pickUp", p0: {x: 246, y: 463}, p1: {x: 246, y: 463}},
  1270. {type: "pickUp", p0: {x: 273, y: 363}, p1: {x: 273, y: 363}},
  1271. {type: "pickUp", p0: {x: 461, y: 742}, p1: {x: 461, y: 742}},
  1272. {type: "pickUp", p0: {x: 558, y: 762}, p1: {x: 558, y: 762}},
  1273. {type: "pickUp", p0: {x: 550, y: 610}, p1: {x: 550, y: 610}},
  1274. {type: "pickUp", p0: {x: 541, y: 463}, p1: {x: 541, y: 463}},
  1275. {type: "pickUp", p0: {x: 514, y: 363}, p1: {x: 514, y: 363}},
  1276. {type: "wall", p0: {x: 610, y: 351}, p1: {x: 468, y: 210}},
  1277. {type: "wall", p0: {x: 170, y: 351}, p1: {x: 311, y: 210}},
  1278. {type: "wall", p0: {x: 678, y: 730}, p1: {x: 536, y: 871}},
  1279. {type: "wall", p0: {x: 130, y: 730}, p1: {x: 271, y: 871}},
  1280. {type: "wall", p0: {x: 316, y: 411}, p1: {x: 316, y: 618}},
  1281. {type: "wall", p0: {x: 474, y: 411}, p1: {x: 474, y: 618}},
  1282. {type: "wall", p0: {x: 568, y: 222}, p1: {x: 665, y: 852}},
  1283. {type: "wall", p0: {x: 210, y: 221}, p1: {x: 143, y: 859}},
  1284. {type: "wall", p0: {x: 144, y: 847}, p1: {x: 664, y: 847}},
  1285. {type: "wall", p0: {x: 210, y: 220}, p1: {x: 568, y: 220}},
  1286. {type: "water", p0: {x: 315, y: 422}, p1: {x: 476, y: 641}}
  1287. ]},
  1288. {par: 3, aData: [
  1289. {type: "tee", p0: {x: 591, y: 733}, p1: {x: 591, y: 733}},
  1290. {type: "hole", p0: {x: 388, y: 261}, p1: {x: 388, y: 261}},
  1291. {type: "pickUp", p0: {x: 473, y: 700}, p1: {x: 473, y: 700}},
  1292. {type: "pickUp", p0: {x: 375, y: 673}, p1: {x: 375, y: 673}},
  1293. {type: "pickUp", p0: {x: 273, y: 658}, p1: {x: 273, y: 658}},
  1294. {type: "pickUp", p0: {x: 273, y: 558}, p1: {x: 273, y: 558}},
  1295. {type: "pickUp", p0: {x: 273, y: 467}, p1: {x: 273, y: 467}},
  1296. {type: "pickUp", p0: {x: 310, y: 293}, p1: {x: 310, y: 293}},
  1297. {type: "pickUp", p0: {x: 273, y: 377}, p1: {x: 273, y: 377}},
  1298. {type: "wall", p0: {x: 212, y: 290}, p1: {x: -103, y: 290}},
  1299. {type: "wall", p0: {x: 215, y: 286}, p1: {x: 343, y: 158}},
  1300. {type: "wall", p0: {x: 207, y: 567}, p1: {x: 118, y: 806}},
  1301. {type: "wall", p0: {x: 208, y: 565}, p1: {x: -107, y: 565}},
  1302. {type: "wall", p0: {x: 671, y: 672}, p1: {x: 602, y: 858}},
  1303. {type: "wall", p0: {x: 670, y: 677}, p1: {x: 447, y: 583}},
  1304. {type: "wall", p0: {x: 670, y: 872}, p1: {x: 447, y: 778}},
  1305. {type: "wall", p0: {x: 446, y: 183}, p1: {x: 446, y: 583}},
  1306. {type: "wall", p0: {x: 446, y: 778}, p1: {x: 126, y: 778}},
  1307. {type: "wall", p0: {x: 445, y: 180}, p1: {x: 130, y: 180}},
  1308. {type: "wall", p0: {x: 127, y: 180}, p1: {x: 127, y: 776}},
  1309. {type: "mud", p0: {x: 221, y: 636}, p1: {x: 332, y: 686}},
  1310. {type: "water", p0: {x: 328, y: 340}, p1: {x: 441, y: 517}},
  1311. {type: "water", p0: {x: 103, y: 299}, p1: {x: 216, y: 558}}
  1312. ]},
  1313. {par: 5, aData: [
  1314. {type: "tee", p0: {x: 588, y: 240}, p1: {x: 588, y: 240}},
  1315. {type: "hole", p0: {x: 169, y: 804}, p1: {x: 169, y: 804}},
  1316. {type: "pickUp", p0: {x: 315, y: 519}, p1: {x: 315, y: 519}},
  1317. {type: "pickUp", p0: {x: 624, y: 639}, p1: {x: 624, y: 639}},
  1318. {type: "pickUp", p0: {x: 429, y: 311}, p1: {x: 429, y: 311}},
  1319. {type: "pickUp", p0: {x: 206, y: 307}, p1: {x: 206, y: 307}},
  1320. {type: "pickUp", p0: {x: 319, y: 273}, p1: {x: 319, y: 273}},
  1321. {type: "pickUp", p0: {x: 174, y: 402}, p1: {x: 174, y: 402}},
  1322. {type: "pickUp", p0: {x: 464, y: 396}, p1: {x: 464, y: 396}},
  1323. {type: "pickUp", p0: {x: 264, y: 797}, p1: {x: 264, y: 797}},
  1324. {type: "wall", p0: {x: 332, y: 715}, p1: {x: 546, y: 715}},
  1325. {type: "wall", p0: {x: -83, y: 700}, p1: {x: 212, y: 700}},
  1326. {type: "wall", p0: {x: 213, y: 699}, p1: {x: 57, y: 543}},
  1327. {type: "wall", p0: {x: 92, y: 308}, p1: {x: 248, y: 152}},
  1328. {type: "wall", p0: {x: 543, y: 308}, p1: {x: 387, y: 152}},
  1329. {type: "wall", p0: {x: 545, y: 551}, p1: {x: 545, y: 310}},
  1330. {type: "wall", p0: {x: 330, y: 716}, p1: {x: 330, y: 942}},
  1331. {type: "wall", p0: {x: 100, y: 190}, p1: {x: 700, y: 190}},
  1332. {type: "wall", p0: {x: 700, y: 880}, p1: {x: 700, y: 190}},
  1333. {type: "wall", p0: {x: 100, y: 880}, p1: {x: 700, y: 880}},
  1334. {type: "wall", p0: {x: 100, y: 190}, p1: {x: 100, y: 880}},
  1335. {type: "water", p0: {x: 242, y: 332}, p1: {x: 389, y: 454}},
  1336. {type: "water", p0: {x: 333, y: 720}, p1: {x: 554, y: 878}},
  1337. {type: "slope3", p0: {x: 320, y: 563}, p1: {x: 555, y: 704}}
  1338. ]},
  1339. {par: 6, aData: [
  1340. {type: "tee", p0: {x: 582, y: 496}, p1: {x: 582, y: 496}},
  1341. {type: "hole", p0: {x: 555, y: 253}, p1: {x: 555, y: 253}},
  1342. {type: "pickUp", p0: {x: 607, y: 647}, p1: {x: 607, y: 647}},
  1343. {type: "pickUp", p0: {x: 588, y: 770}, p1: {x: 588, y: 770}},
  1344. {type: "pickUp", p0: {x: 426, y: 798}, p1: {x: 426, y: 798}},
  1345. {type: "pickUp", p0: {x: 197, y: 416}, p1: {x: 197, y: 416}},
  1346. {type: "pickUp", p0: {x: 377, y: 682}, p1: {x: 377, y: 682}},
  1347. {type: "pickUp", p0: {x: 212, y: 534}, p1: {x: 212, y: 534}},
  1348. {type: "pickUp", p0: {x: 319, y: 285}, p1: {x: 319, y: 285}},
  1349. {type: "pickUp", p0: {x: 263, y: 634}, p1: {x: 263, y: 634}},
  1350. {type: "pickUp", p0: {x: 204, y: 292}, p1: {x: 204, y: 292}},
  1351. {type: "wall", p0: {x: 62, y: 322}, p1: {x: 222, y: 154}},
  1352. {type: "wall", p0: {x: 421, y: 245}, p1: {x: 255, y: 148}},
  1353. {type: "wall", p0: {x: 487, y: 131}, p1: {x: 421, y: 244}},
  1354. {type: "wall", p0: {x: 568, y: 900}, p1: {x: 728, y: 731}},
  1355. {type: "wall", p0: {x: 518, y: 727}, p1: {x: 449, y: 706}},
  1356. {type: "wall", p0: {x: 555, y: 600}, p1: {x: 518, y: 726}},
  1357. {type: "wall", p0: {x: 486, y: 580}, p1: {x: 555, y: 600}},
  1358. {type: "wall", p0: {x: 449, y: 706}, p1: {x: 486, y: 580}},
  1359. {type: "wall", p0: {x: 470, y: 347}, p1: {x: 647, y: 263}},
  1360. {type: "wall", p0: {x: 515, y: 444}, p1: {x: 470, y: 347}},
  1361. {type: "wall", p0: {x: 694, y: 360}, p1: {x: 516, y: 443}},
  1362. {type: "wall", p0: {x: 350, y: 780}, p1: {x: 290, y: 857}},
  1363. {type: "wall", p0: {x: 209, y: 669}, p1: {x: 349, y: 780}},
  1364. {type: "wall", p0: {x: 149, y: 746}, p1: {x: 209, y: 670}},
  1365. {type: "wall", p0: {x: 319, y: 470}, p1: {x: 253, y: 463}},
  1366. {type: "wall", p0: {x: 332, y: 349}, p1: {x: 319, y: 470}},
  1367. {type: "wall", p0: {x: 266, y: 342}, p1: {x: 332, y: 349}},
  1368. {type: "wall", p0: {x: 253, y: 463}, p1: {x: 266, y: 343}},
  1369. {type: "wall", p0: {x: 675, y: 840}, p1: {x: 160, y: 869}},
  1370. {type: "wall", p0: {x: 638, y: 175}, p1: {x: 675, y: 839}},
  1371. {type: "wall", p0: {x: 122, y: 204}, p1: {x: 638, y: 175}},
  1372. {type: "wall", p0: {x: 159, y: 869}, p1: {x: 122, y: 206}},
  1373. {type: "water", p0: {x: 298, y: 341}, p1: {x: 522, y: 606}}
  1374. ]},
  1375. {par: 6, aData: [
  1376. {type: "tee", p0: {x: 200, y: 775}, p1: {x: 200, y: 775}},
  1377. {type: "hole", p0: {x: 398, y: 703}, p1: {x: 398, y: 703}},
  1378. {type: "pickUp", p0: {x: 239, y: 433}, p1: {x: 239, y: 433}},
  1379. {type: "pickUp", p0: {x: 562, y: 431}, p1: {x: 562, y: 431}},
  1380. {type: "pickUp", p0: {x: 562, y: 504}, p1: {x: 562, y: 504}},
  1381. {type: "pickUp", p0: {x: 482, y: 504}, p1: {x: 482, y: 504}},
  1382. {type: "pickUp", p0: {x: 239, y: 504}, p1: {x: 239, y: 504}},
  1383. {type: "pickUp", p0: {x: 563, y: 364}, p1: {x: 563, y: 364}},
  1384. {type: "pickUp", p0: {x: 483, y: 364}, p1: {x: 483, y: 364}},
  1385. {type: "pickUp", p0: {x: 403, y: 364}, p1: {x: 403, y: 364}},
  1386. {type: "pickUp", p0: {x: 323, y: 364}, p1: {x: 323, y: 364}},
  1387. {type: "pickUp", p0: {x: 243, y: 364}, p1: {x: 243, y: 364}},
  1388. {type: "wall", p0: {x: 442, y: 586}, p1: {x: 364, y: 586}},
  1389. {type: "wall", p0: {x: 755, y: 275}, p1: {x: 541, y: 275}},
  1390. {type: "wall", p0: {x: 698, y: 388}, p1: {x: 586, y: 277}},
  1391. {type: "wall", p0: {x: 302, y: 721}, p1: {x: 566, y: 1336}},
  1392. {type: "wall", p0: {x: 214, y: 666}, p1: {x: -1, y: 666}},
  1393. {type: "wall", p0: {x: 46, y: 275}, p1: {x: 261, y: 275}},
  1394. {type: "wall", p0: {x: 104, y: 388}, p1: {x: 215, y: 277}},
  1395. {type: "wall", p0: {x: 426, y: 430}, p1: {x: 162, y: 1046}},
  1396. {type: "wall", p0: {x: 316, y: 450}, p1: {x: 370, y: 542}},
  1397. {type: "wall", p0: {x: 316, y: 449}, p1: {x: 421, y: 429}},
  1398. {type: "wall", p0: {x: 81, y: 853}, p1: {x: 721, y: 853}},
  1399. {type: "wall", p0: {x: 81, y: 204}, p1: {x: 721, y: 204}},
  1400. {type: "wall", p0: {x: 657, y: 866}, p1: {x: 657, y: 197}},
  1401. {type: "wall", p0: {x: 145, y: 197}, p1: {x: 145, y: 866}},
  1402. {type: "water", p0: {x: 315, y: 762}, p1: {x: 660, y: 843}},
  1403. {type: "water", p0: {x: 140, y: 206}, p1: {x: 662, y: 287}},
  1404. {type: "slope0", p0: {x: 145, y: 418}, p1: {x: 653, y: 581}}
  1405. ]},
  1406. {par: 6, aData: [
  1407. {type: "tee", p0: {x: 416, y: 817}, p1: {x: 416, y: 817}},
  1408. {type: "hole", p0: {x: 189, y: 264}, p1: {x: 189, y: 264}},
  1409. {type: "pickUp", p0: {x: 605, y: 804}, p1: {x: 605, y: 804}},
  1410. {type: "pickUp", p0: {x: 515, y: 724}, p1: {x: 515, y: 724}},
  1411. {type: "pickUp", p0: {x: 605, y: 724}, p1: {x: 605, y: 724}},
  1412. {type: "pickUp", p0: {x: 515, y: 804}, p1: {x: 515, y: 804}},
  1413. {type: "pickUp", p0: {x: 402, y: 358}, p1: {x: 402, y: 358}},
  1414. {type: "pickUp", p0: {x: 312, y: 278}, p1: {x: 312, y: 278}},
  1415. {type: "pickUp", p0: {x: 402, y: 278}, p1: {x: 402, y: 278}},
  1416. {type: "pickUp", p0: {x: 313, y: 825}, p1: {x: 313, y: 825}},
  1417. {type: "pickUp", p0: {x: 312, y: 358}, p1: {x: 312, y: 358}},
  1418. {type: "wall", p0: {x: 277, y: 427}, p1: {x: 341, y: 427}},
  1419. {type: "wall", p0: {x: 381, y: 764}, p1: {x: 445, y: 764}},
  1420. {type: "wall", p0: {x: 243, y: 229}, p1: {x: 384, y: 87}},
  1421. {type: "wall", p0: {x: 243, y: 229}, p1: {x: 102, y: 87}},
  1422. {type: "wall", p0: {x: 638, y: 643}, p1: {x: 780, y: 502}},
  1423. {type: "wall", p0: {x: 638, y: 643}, p1: {x: 780, y: 785}},
  1424. {type: "wall", p0: {x: 249, y: 891}, p1: {x: 108, y: 750}},
  1425. {type: "wall", p0: {x: 200, y: 352}, p1: {x: 58, y: 211}},
  1426. {type: "wall", p0: {x: 200, y: 352}, p1: {x: 58, y: 493}},
  1427. {type: "wall", p0: {x: 132, y: 190}, p1: {x: 676, y: 190}},
  1428. {type: "wall", p0: {x: 676, y: 880}, p1: {x: 676, y: 190}},
  1429. {type: "wall", p0: {x: 132, y: 880}, p1: {x: 676, y: 880}},
  1430. {type: "wall", p0: {x: 132, y: 190}, p1: {x: 132, y: 880}},
  1431. {type: "water", p0: {x: 451, y: 188}, p1: {x: 676, y: 646}},
  1432. {type: "water", p0: {x: 247, y: 433}, p1: {x: 373, y: 775}},
  1433. {type: "mud", p0: {x: 379, y: 651}, p1: {x: 447, y: 769}},
  1434. {type: "slope0", p0: {x: 135, y: 433}, p1: {x: 242, y: 873}},
  1435. {type: "slope2", p0: {x: 377, y: 432}, p1: {x: 448, y: 646}}
  1436. ]},
  1437. {par: 7, aData: [
  1438. {type: "tee", p0: {x: 192, y: 271}, p1: {x: 192, y: 271}},
  1439. {type: "hole", p0: {x: 592, y: 808}, p1: {x: 592, y: 808}},
  1440. {type: "pickUp", p0: {x: 424, y: 728}, p1: {x: 424, y: 728}},
  1441. {type: "pickUp", p0: {x: 202, y: 411}, p1: {x: 202, y: 411}},
  1442. {type: "pickUp", p0: {x: 358, y: 395}, p1: {x: 358, y: 395}},
  1443. {type: "pickUp", p0: {x: 508, y: 285}, p1: {x: 508, y: 285}},
  1444. {type: "pickUp", p0: {x: 338, y: 285}, p1: {x: 338, y: 285}},
  1445. {type: "pickUp", p0: {x: 518, y: 395}, p1: {x: 518, y: 395}},
  1446. {type: "pickUp", p0: {x: 192, y: 557}, p1: {x: 192, y: 557}},
  1447. {type: "pickUp", p0: {x: 204, y: 708}, p1: {x: 204, y: 708}},
  1448. {type: "wall", p0: {x: 193, y: 768}, p1: {x: 139, y: 714}},
  1449. {type: "wall", p0: {x: 193, y: 334}, p1: {x: 139, y: 389}},
  1450. {type: "wall", p0: {x: 442, y: 139}, p1: {x: 662, y: 359}},
  1451. {type: "wall", p0: {x: 149, y: 331}, p1: {x: 460, y: 331}},
  1452. {type: "wall", p0: {x: 140, y: 214}, p1: {x: 569, y: 214}},
  1453. {type: "wall", p0: {x: 245, y: 447}, p1: {x: 461, y: 447}},
  1454. {type: "wall", p0: {x: 463, y: 448}, p1: {x: 463, y: 571}},
  1455. {type: "wall", p0: {x: 572, y: 215}, p1: {x: 571, y: 571}},
  1456. {type: "wall", p0: {x: 574, y: 572}, p1: {x: 665, y: 572}},
  1457. {type: "wall", p0: {x: 371, y: 572}, p1: {x: 463, y: 572}},
  1458. {type: "wall", p0: {x: 139, y: 217}, p1: {x: 139, y: 785}},
  1459. {type: "wall", p0: {x: 245, y: 453}, p1: {x: 245, y: 663}},
  1460. {type: "wall", p0: {x: 246, y: 664}, p1: {x: 369, y: 663}},
  1461. {type: "wall", p0: {x: 114, y: 772}, p1: {x: 369, y: 772}},
  1462. {type: "wall", p0: {x: 370, y: 774}, p1: {x: 370, y: 865}},
  1463. {type: "wall", p0: {x: 660, y: 866}, p1: {x: 660, y: 572}},
  1464. {type: "wall", p0: {x: 370, y: 866}, p1: {x: 658, y: 866}},
  1465. {type: "wall", p0: {x: 370, y: 572}, p1: {x: 370, y: 664}},
  1466. {type: "slope2", p0: {x: 470, y: 436}, p1: {x: 559, y: 584}},
  1467. {type: "water", p0: {x: 475, y: 673}, p1: {x: 552, y: 752}}
  1468. ]},
  1469. {par: 7, aData: [
  1470. {type: "tee", p0: {x: 207, y: 249}, p1: {x: 207, y: 249}},
  1471. {type: "hole", p0: {x: 427, y: 675}, p1: {x: 427, y: 675}},
  1472. {type: "pickUp", p0: {x: 603, y: 671}, p1: {x: 603, y: 671}},
  1473. {type: "pickUp", p0: {x: 609, y: 550}, p1: {x: 609, y: 550}},
  1474. {type: "pickUp", p0: {x: 313, y: 278}, p1: {x: 313, y: 278}},
  1475. {type: "pickUp", p0: {x: 606, y: 278}, p1: {x: 606, y: 278}},
  1476. {type: "pickUp", p0: {x: 311, y: 390}, p1: {x: 311, y: 390}},
  1477. {type: "pickUp", p0: {x: 311, y: 749}, p1: {x: 311, y: 749}},
  1478. {type: "pickUp", p0: {x: 208, y: 749}, p1: {x: 208, y: 749}},
  1479. {type: "pickUp", p0: {x: 254, y: 809}, p1: {x: 254, y: 809}},
  1480. {type: "pickUp", p0: {x: 499, y: 671}, p1: {x: 499, y: 671}},
  1481. {type: "wall", p0: {x: 264, y: 246}, p1: {x: 399, y: 111}},
  1482. {type: "wall", p0: {x: 256, y: 904}, p1: {x: 391, y: 769}},
  1483. {type: "wall", p0: {x: 116, y: 758}, p1: {x: 251, y: 893}},
  1484. {type: "wall", p0: {x: 257, y: 430}, p1: {x: 257, y: 747}},
  1485. {type: "wall", p0: {x: 257, y: -315}, p1: {x: 257, y: 333}},
  1486. {type: "wall", p0: {x: 568, y: 781}, p1: {x: 704, y: 646}},
  1487. {type: "wall", p0: {x: 573, y: 162}, p1: {x: 709, y: 297}},
  1488. {type: "wall", p0: {x: 361, y: 360}, p1: {x: 553, y: 360}},
  1489. {type: "wall", p0: {x: 361, y: 448}, p1: {x: 553, y: 448}},
  1490. {type: "wall", p0: {x: 365, y: 736}, p1: {x: 674, y: 736}},
  1491. {type: "wall", p0: {x: 157, y: 202}, p1: {x: 669, y: 202}},
  1492. {type: "wall", p0: {x: 675, y: 191}, p1: {x: 675, y: 737}},
  1493. {type: "wall", p0: {x: 361, y: 589}, p1: {x: 553, y: 589}},
  1494. {type: "wall", p0: {x: 157, y: 202}, p1: {x: 157, y: 850}},
  1495. {type: "wall", p0: {x: 160, y: 850}, p1: {x: 358, y: 850}},
  1496. {type: "wall", p0: {x: 359, y: 590}, p1: {x: 359, y: 873}},
  1497. {type: "slope2", p0: {x: 352, y: 211}, p1: {x: 559, y: 270}},
  1498. {type: "slope2", p0: {x: 559, y: 358}, p1: {x: 666, y: 464}},
  1499. {type: "water", p0: {x: 353, y: 296}, p1: {x: 559, y: 368}},
  1500. {type: "water", p0: {x: 353, y: 455}, p1: {x: 559, y: 520}}
  1501. ]},
  1502. {par: 6, aData: [
  1503. {type: "tee", p0: {x: 485, y: 235}, p1: {x: 485, y: 235}},
  1504. {type: "hole", p0: {x: 395, y: 518}, p1: {x: 395, y: 518}},
  1505. {type: "pickUp", p0: {x: 454, y: 659}, p1: {x: 454, y: 659}},
  1506. {type: "pickUp", p0: {x: 394, y: 659}, p1: {x: 394, y: 659}},
  1507. {type: "pickUp", p0: {x: 334, y: 659}, p1: {x: 334, y: 659}},
  1508. {type: "pickUp", p0: {x: 459, y: 370}, p1: {x: 459, y: 370}},
  1509. {type: "pickUp", p0: {x: 399, y: 370}, p1: {x: 399, y: 370}},
  1510. {type: "pickUp", p0: {x: 339, y: 370}, p1: {x: 339, y: 370}},
  1511. {type: "pickUp", p0: {x: 484, y: 566}, p1: {x: 484, y: 566}},
  1512. {type: "pickUp", p0: {x: 484, y: 516}, p1: {x: 484, y: 516}},
  1513. {type: "pickUp", p0: {x: 484, y: 466}, p1: {x: 484, y: 466}},
  1514. {type: "pickUp", p0: {x: 314, y: 566}, p1: {x: 314, y: 566}},
  1515. {type: "pickUp", p0: {x: 314, y: 516}, p1: {x: 314, y: 516}},
  1516. {type: "pickUp", p0: {x: 314, y: 466}, p1: {x: 314, y: 466}},
  1517. {type: "wall", p0: {x: 541, y: 473}, p1: {x: 562, y: 494}},
  1518. {type: "wall", p0: {x: 237, y: 540}, p1: {x: 258, y: 561}},
  1519. {type: "wall", p0: {x: 135, y: 187}, p1: {x: 660, y: 187}},
  1520. {type: "wall", p0: {x: 660, y: 857}, p1: {x: 660, y: 187}},
  1521. {type: "wall", p0: {x: 135, y: 857}, p1: {x: 660, y: 857}},
  1522. {type: "wall", p0: {x: 135, y: 187}, p1: {x: 135, y: 857}},
  1523. {type: "water", p0: {x: 353, y: 166}, p1: {x: 441, y: 292}},
  1524. {type: "water", p0: {x: 353, y: 738}, p1: {x: 441, y: 864}},
  1525. {type: "mud", p0: {x: 151, y: 451}, p1: {x: 181, y: 581}},
  1526. {type: "mud", p0: {x: 611, y: 451}, p1: {x: 641, y: 581}},
  1527. {type: "water", p0: {x: 352, y: 552}, p1: {x: 440, y: 587}},
  1528. {type: "water", p0: {x: 352, y: 444}, p1: {x: 440, y: 479}},
  1529. {type: "slope2", p0: {x: 144, y: 590}, p1: {x: 655, y: 735}},
  1530. {type: "slope0", p0: {x: 144, y: 296}, p1: {x: 655, y: 440}}
  1531. ]}
  1532. ]), loc = window.top.location;
  1533. loadPreAssets();