app.js 140 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234
  1. function bacplay() {}
  2. function saveData() {
  3. if ("undefined" != typeof Storage) {
  4. for (var e = "", t = 0; t < aLevelStore.length; t++) e += aLevelStore[t], t < aLevelStore.length - 1 && (e += ",");
  5. localStorage.setItem("bubblefishBuddiesData", e)
  6. }
  7. }
  8. function ananss() {
  9. if (GameAPI.Branding.getLogo().image) {
  10. gameState = "splash", resizeCanvas(), splash = new Elements.Splash(assetLib.getData("splash"), canvas.width, canvas.height), userInput.addHitArea("logoClick", bacplay, null, "rect", {
  11. aRect: [0, 0, canvas.width, canvas.height]
  12. }, !0), previousTime = (new Date).getTime(), updateSplashScreenEvent()
  13. } else {
  14. initStartScreen()
  15. }
  16. }
  17. function initStartScreen() {
  18. gameState = "start", 1 == audioType && music.volume(.25), userInput.removeHitArea("logoClick"), levelScore = 0, background = new Elements.Background(assetLib.getData("background"), canvas.width, canvas.height), userInput.addHitArea("mute", butEventHandler, null, "rect", {
  19. aRect: [337, 0, canvas.width, 46]
  20. }, !0);
  21. var e = {
  22. oImgData: assetLib.getData("uiButs"),
  23. aPos: [canvas.width / 2, 360],
  24. scale: 1,
  25. type: 1,
  26. frame: 0
  27. },
  28. t = {
  29. oImgData: assetLib.getData("uiButs"),
  30. aPos: [canvas.width / 2 + 60, 480],
  31. scale: 1,
  32. type: 1,
  33. frame: 1
  34. },
  35. n = {
  36. oImgData: assetLib.getData("uiButs"),
  37. aPos: [canvas.width / 2 - 60, 480],
  38. scale: 1,
  39. type: 1,
  40. frame: 7
  41. };
  42. oLogoBut = {
  43. oImgData: assetLib.getData("logo"),
  44. aPos: [canvas.width / 2, 42],
  45. scale: getScaleImageToMax(assetLib.getData("logo"), [0, 0]),
  46. type: 0
  47. }, userInput.addHitArea("levelSelect", butEventHandler, null, "image", e), userInput.addHitArea("moreGames", butEventHandler, null, "image", t), userInput.addHitArea("logoClick", butEventHandler, null, "image", oLogoBut), userInput.addHitArea("credits", butEventHandler, null, "image", n);
  48. var r = new Array(e, t, oLogoBut, n);
  49. panel = new Elements.Panel(assetLib.getData("panels"), assetLib.getData("tutorials"), assetLib.getData("numbers"), assetLib.getData("goldFish"), gameState, r, canvas.width, canvas.height), panel.startTween1(), aBubbles = new Array;
  50. for (var i = 0; 6 > i; i++) {
  51. var s = new Elements.Bubble(assetLib.getData("bubble"), 0, aLevelData[0][0], canvas.width, canvas.height);
  52. s.x = Math.random() * canvas.width, s.y = Math.random() * canvas.height, aBubbles.push(s)
  53. }
  54. previousTime = (new Date).getTime(), updateStartScreenEvent()
  55. }
  56. function initLevelSelect() {
  57. gameState = "levelSelect";
  58. for (var e = new Array, t = 0; 12 > t; t++) {
  59. var n = 123 * (t % 3) + 68,
  60. r = 100 * Math.floor(t / 3) + 93,
  61. i = {
  62. oImgData: assetLib.getData("levelButs"),
  63. aPos: [n, r],
  64. scale: 1,
  65. type: 1,
  66. frame: aLevelStore[2 * (t + 12 * levelButsPage)]
  67. };
  68. 1 != aLevelStore[2 * (t + 12 * levelButsPage)] && userInput.addHitArea("startLevel", butEventHandler, {
  69. id: t + 12 * levelButsPage
  70. }, "image", i), e.push(i)
  71. }
  72. var s = getScaleImageToMax(assetLib.getData("logo"), [0, 0]);
  73. oLogoBut = {
  74. oImgData: assetLib.getData("logo"),
  75. aPos: getCentreFromTopLeft([0, 0], assetLib.getData("logo"), s),
  76. scale: s,
  77. type: 0
  78. };
  79. var o = {
  80. oImgData: assetLib.getData("uiButs"),
  81. aPos: [73, 500],
  82. scale: 1,
  83. type: 1,
  84. frame: 5
  85. },
  86. u = {
  87. oImgData: assetLib.getData("uiButs"),
  88. aPos: [canvas.width / 2, 500],
  89. scale: 1,
  90. type: 1,
  91. frame: 6
  92. };
  93. if (userInput.addHitArea("logoClick", butEventHandler, null, "image", oLogoBut), userInput.addHitArea("prevScreen", butEventHandler, null, "image", o), userInput.addHitArea("clearData", butEventHandler, null, "image", u), e.push(oLogoBut, o, u), 2 > levelButsPage) {
  94. var a = {
  95. oImgData: assetLib.getData("uiButs"),
  96. aPos: [310, 500],
  97. scale: 1,
  98. type: 1,
  99. frame: 4
  100. };
  101. userInput.addHitArea("nextScreen", butEventHandler, null, "image", a), e.push(a)
  102. }
  103. panel = new Elements.Panel(assetLib.getData("panels"), assetLib.getData("tutorials"), assetLib.getData("numbers"), assetLib.getData("goldFish"), gameState, e, canvas.width, canvas.height), panel.oScoreData = {
  104. levelButsPage: levelButsPage
  105. }, panel.startTween2(), previousTime = (new Date).getTime(), updateLevelSelectEvent()
  106. }
  107. function initCreditsScreen() {
  108. gameState = "credits";
  109. var e = {
  110. oImgData: assetLib.getData("uiButs"),
  111. aPos: [73, 500],
  112. scale: 1,
  113. type: 1,
  114. frame: 5
  115. };
  116. userInput.addHitArea("backFromCredits", butEventHandler, null, "image", e);
  117. var t = new Array(e);
  118. panel = new Elements.Panel(assetLib.getData("panels"), assetLib.getData("tutorials"), assetLib.getData("numbers"), assetLib.getData("goldFish"), gameState, t, canvas.width, canvas.height), panel.startTween3(), aBubbles = new Array, previousTime = (new Date).getTime(), updateCreditsScreenEvent()
  119. }
  120. function initGame() {
  121. gameState = "game", 1 == audioType && music.volume(.5), userInput.addHitArea("replayFromInGame", butEventHandler, null, "rect", {
  122. aRect: [249, 0, 292, 46]
  123. }, !0), userInput.addHitArea("pause", butEventHandler, null, "rect", {
  124. aRect: [292, 0, 337, 46]
  125. }, !0), userInput.addHitArea("shoot", butEventHandler, null, "rect", {
  126. aRect: [0, 50, canvas.width, 460]
  127. }, !0), userInput.addHitArea("moveBase", butEventHandler, {
  128. multiTouch: !0,
  129. isDraggable: !0
  130. }, "rect", {
  131. aRect: [0, 460, canvas.width, 550]
  132. }, !0), userInput.addKey("moveRightEvent", butEventHandler, null, 39), userInput.addKey("moveLeftEvent", butEventHandler, null, 37);
  133. var e = getScaleImageToMax(assetLib.getData("logo"), [0, 0]);
  134. oLogoBut = {
  135. oImgData: assetLib.getData("logo"),
  136. aPos: getCentreFromTopLeft([0, 0], assetLib.getData("logo"), e),
  137. scale: e,
  138. type: 0
  139. }, userInput.addHitArea("logoClick", butEventHandler, null, "image", oLogoBut), aBubbles = new Array, aFishes = new Array, aLogs = new Array, fishCaught = 0, levelThrows = 0, levelScore = bonusScore = 0, bubbleTarg = 0;
  140. for (var t = new Array({
  141. type: "line",
  142. p0: {
  143. x: -25,
  144. y: -300
  145. },
  146. p1: {
  147. x: -25,
  148. y: 550
  149. },
  150. subType: "normal"
  151. }, {
  152. type: "line",
  153. p0: {
  154. x: 408,
  155. y: -300
  156. },
  157. p1: {
  158. x: 408,
  159. y: 550
  160. },
  161. subType: "normal"
  162. }), n = 0; n < aLevelData[levelNum].length; n++)
  163. if ("bubble" == aLevelData[levelNum][n].type) {
  164. var r = new Elements.Bubble(assetLib.getData("bubble"), n, aLevelData[levelNum][n], canvas.width, canvas.height);
  165. aBubbles.push(r), "ice" == aLevelData[levelNum][n].subType && t.push({
  166. p0: aLevelData[levelNum][n].p0,
  167. p1: {
  168. x: aLevelData[levelNum][n].p0.x + 1,
  169. y: aLevelData[levelNum][n].p0.y
  170. },
  171. b: 1,
  172. f: 1,
  173. id: n,
  174. subType: aLevelData[levelNum][n].subType
  175. }), "jellyfish" != aLevelData[levelNum][n].subType && bubbleTarg++
  176. } else if ("line" == aLevelData[levelNum][n].type && (t.push({
  177. p0: aLevelData[levelNum][n].p0,
  178. p1: aLevelData[levelNum][n].p1,
  179. b: 1,
  180. f: 1,
  181. id: -1,
  182. subType: aLevelData[levelNum][n].subType
  183. }), "log" == aLevelData[levelNum][n].subType)) {
  184. var i = new Elements.Log(assetLib.getData("log"), aLevelData[levelNum][n], canvas.width, canvas.height);
  185. aLogs.push(i)
  186. }
  187. physics2D = new Utils.Physics2D(t, defrostBubble), hud = new Elements.Hud(assetLib.getData("hud"), assetLib.getData("numbers"), canvas.width, canvas.height, getTotalScore(), levelNum + 1), base = new Elements.Base(assetLib.getData("base"), {
  188. x: canvas.width / 2,
  189. y: 490
  190. }, canvas.width, canvas.height), addFish(), tutorialIsOn = !1;
  191. for (var n = 0; n < aTutorials.length; n++) aTutorials[n].levelNum == levelNum && (panel = new Elements.Panel(assetLib.getData("panels"), assetLib.getData("tutorials"), assetLib.getData("numbers"), assetLib.getData("goldFish"), aTutorials[n].panelType, null, canvas.width, canvas.height), panel.startTween2(), tutorialIsOn = !0);
  192. previousTime = (new Date).getTime(), updateGameEvent()
  193. }
  194. function butEventHandler(e, t) {
  195. switch (e) {
  196. case "langSelect":
  197. console.log(t.lang), curLang = t.lang, ctx.clearRect(0, 0, canvas.width, canvas.height), userInput.removeHitArea("langSelect"), initLoadAssets();
  198. break;
  199. case "levelSelect":
  200. playSound("click"), userInput.removeHitArea("levelSelect"), userInput.removeHitArea("moreGames"), userInput.removeHitArea("logoClick"), userInput.removeHitArea("credits"), initLevelSelect();
  201. break;
  202. case "credits":
  203. playSound("click"), userInput.removeHitArea("levelSelect"), userInput.removeHitArea("moreGames"), userInput.removeHitArea("logoClick"), userInput.removeHitArea("credits"), initCreditsScreen();
  204. break;
  205. case "backFromCredits":
  206. playSound("click"), userInput.removeHitArea("backFromCredits"), initStartScreen();
  207. break;
  208. case "clearData":
  209. playSound("click"), userInput.removeHitArea("startLevel"), userInput.removeHitArea("prevScreen"), userInput.removeHitArea("clearData"), userInput.removeHitArea("nextScreen"), levelButsPage = 0, aLevelStore = new Array, aLevelStore.push(0), aLevelStore.push(0);
  210. for (var n = 0; 35 > n; n++) aLevelStore.push(1), aLevelStore.push(0);
  211. saveData(), initLevelSelect();
  212. break;
  213. case "prevScreen":
  214. playSound("click"), userInput.removeHitArea("startLevel"), userInput.removeHitArea("prevScreen"), userInput.removeHitArea("clearData"), userInput.removeHitArea("nextScreen"), 0 == levelButsPage ? initStartScreen() : (levelButsPage = 0, initLevelSelect());
  215. break;
  216. case "nextScreen":
  217. playSound("click"), userInput.removeHitArea("startLevel"), userInput.removeHitArea("prevScreen"), userInput.removeHitArea("clearData"), userInput.removeHitArea("nextScreen"), levelButsPage++, initLevelSelect();
  218. break;
  219. case "startLevel":
  220. playSound("click"), userInput.removeHitArea("startLevel"), userInput.removeHitArea("prevScreen"), userInput.removeHitArea("clearData"), userInput.removeHitArea("nextScreen"), levelNum = t.id, initGame();
  221. break;
  222. case "moreGames":
  223. case "moreGamesPause":
  224. Play68.goHome();
  225. break;
  226. case "logoClick":
  227. Play68.goHome();
  228. break;
  229. case "nextLevel":
  230. playSound("click"), userInput.removeHitArea("nextLevel"), userInput.removeHitArea("quitFromEndLevel"), userInput.removeHitArea("replayFromEndLevel"), userInput.removeHitArea("moreGames"), userInput.removeHitArea("logoClick"), ++levelNum < 36 ? (initGame(), 0 == levelNum % 3 && spilAPI.GameBreak.request(adPauseOn, adPauseOff)) : (levelNum = 35, initStartScreen());
  231. break;
  232. case "quitFromEndLevel":
  233. playSound("click"), userInput.removeHitArea("nextLevel"), userInput.removeHitArea("quitFromEndLevel"), userInput.removeHitArea("replayFromEndLevel"), userInput.removeHitArea("moreGames"), userInput.removeHitArea("logoClick"), initStartScreen();
  234. break;
  235. case "replayFromEndLevel":
  236. playSound("click"), userInput.removeHitArea("nextLevel"), userInput.removeHitArea("quitFromEndLevel"), userInput.removeHitArea("replayFromEndLevel"), userInput.removeHitArea("moreGames"), userInput.removeHitArea("logoClick"), initGame();
  237. break;
  238. case "shoot":
  239. t.isDown && "held" == aFishes[aFishes.length - 1].state && (playSound("crabThrow"), aFishes[aFishes.length - 1].thrown(t.x, t.y), base.throwFish(), aFishes.length < bubbleTarg && addFish(), levelThrows++);
  240. break;
  241. case "moveBase":
  242. t.isDown || t.isBeingDragged ? base.startMoving(t.x) : base.stopMoving();
  243. break;
  244. case "moveLeftEvent":
  245. base.leftPull = t.isDown ? -200 : 0;
  246. break;
  247. case "moveRightEvent":
  248. base.rightPull = t.isDown ? 200 : 0;
  249. break;
  250. case "retryLevel":
  251. playSound("click"), userInput.removeHitArea("retryLevel"), userInput.removeHitArea("quitFromEnd"), levelScore = 0, bonusScore = 0, initGame();
  252. break;
  253. case "replayFromInGame":
  254. playSound("click"), userInput.removeHitArea("pause"), userInput.removeHitArea("replayFromInGame"), userInput.removeHitArea("shoot"), userInput.removeHitArea("moveBase"), userInput.removeKey("moveRightEvent"), userInput.removeKey("moveLeftEvent"), userInput.removeHitArea("moreGames"), userInput.removeHitArea("logoClick"), initGame();
  255. break;
  256. case "mute":
  257. playSound("click"), toggleMute();
  258. break;
  259. case "pause":
  260. case "resumeFromPause":
  261. playSound("click"), toggleManualPause();
  262. break;
  263. case "quitFromPause":
  264. playSound("click"), toggleManualPause(), userInput.removeHitArea("pause"), userInput.removeHitArea("replayFromInGame"), userInput.removeHitArea("shoot"), userInput.removeHitArea("moveBase"), userInput.removeKey("moveRightEvent"), userInput.removeKey("moveLeftEvent"), userInput.removeHitArea("moreGamesPause"), userInput.removeHitArea("logoClick"), userInput.removeHitArea("quitFromPause"), userInput.removeHitArea("resumeFromPause"), levelScore = 0, initStartScreen()
  265. }
  266. }
  267. function initLevelComplete() {
  268. gameState = "levelComplete", 1 == audioType && music.volume(.25), playSound("levelComplete"), userInput.removeHitArea("pause"), userInput.removeHitArea("replayFromInGame"), userInput.removeHitArea("shoot"), userInput.removeHitArea("moveBase"), userInput.removeKey("moveRightEvent"), userInput.removeKey("moveLeftEvent"), userInput.removeHitArea("logoClick");
  269. var e = getScaleImageToMax(assetLib.getData("logo"), [0, 0]);
  270. oLogoBut = {
  271. oImgData: assetLib.getData("logo"),
  272. aPos: getCentreFromTopLeft([0, 0], assetLib.getData("logo"), e),
  273. scale: e,
  274. type: 0
  275. };
  276. var t = {
  277. oImgData: assetLib.getData("uiButs"),
  278. aPos: [73, 420],
  279. scale: 1,
  280. type: 1,
  281. frame: 2
  282. },
  283. n = {
  284. oImgData: assetLib.getData("uiButs"),
  285. aPos: [canvas.width / 2, 420],
  286. scale: 1,
  287. type: 1,
  288. frame: 3
  289. },
  290. r = {
  291. oImgData: assetLib.getData("uiButs"),
  292. aPos: [310, 420],
  293. scale: 1,
  294. type: 1,
  295. frame: 0
  296. },
  297. i = {
  298. oImgData: assetLib.getData("uiButs"),
  299. aPos: [canvas.width / 2, 500],
  300. scale: 1,
  301. type: 1,
  302. frame: 1
  303. };
  304. userInput.addHitArea("replayFromEndLevel", butEventHandler, null, "image", t), userInput.addHitArea("quitFromEndLevel", butEventHandler, null, "image", n), userInput.addHitArea("nextLevel", butEventHandler, null, "image", r), userInput.addHitArea("logoClick", butEventHandler, null, "image", oLogoBut), userInput.addHitArea("moreGames", butEventHandler, null, "image", i);
  305. var s = new Array(t, n, r, oLogoBut, i);
  306. panel = new Elements.Panel(assetLib.getData("panels"), assetLib.getData("tutorials"), assetLib.getData("numbers"), assetLib.getData("goldFish"), gameState, s, canvas.width, canvas.height);
  307. var o = getLevelResult();
  308. levelScore = o.levelScore, aLevelStore[2 * levelNum] < o.stars + 1 && (aLevelStore[2 * levelNum] = o.stars + 1), aLevelStore[2 * levelNum + 1] < levelScore && (aLevelStore[2 * levelNum + 1] = levelScore), levelNum < aLevelData.length - 1 && 1 == aLevelStore[2 * (levelNum + 1)] && (aLevelStore[2 * (levelNum + 1)] = 0), saveData(), panel.oScoreData = {
  309. stars: o.stars,
  310. levelScore: levelScore,
  311. totalScore: getTotalScore()
  312. }, panel.startTweenEndLevel(), previousTime = (new Date).getTime(), updateLevelComplete();
  313. }
  314. function getTotalScore() {
  315. for (var e = 0, t = 0; t < aLevelData.length; t++) e += aLevelStore[2 * t + 1];
  316. return e
  317. }
  318. function bubbleHit(e, t) {
  319. if ("jellyfish" == e.subType) t.stung(), playSound("hitJellyfish");
  320. else {
  321. t.caught(e);
  322. var n = !1;
  323. e.caughtFish ? (e.caughtFish.release(e), "fire" == e.oData.subType && (playSound("launchFire"), n = !0)) : ++fishCaught == bubbleTarg && (levelCompleteTimer = 0), n || playSound("bubbleLand" + Math.ceil(4 * Math.random())), e.changeState("caught", {
  324. caughtFish: t
  325. })
  326. }
  327. }
  328. function addFish() {
  329. var e = new Elements.Fish(assetLib.getData("fish"), {
  330. x: base.x,
  331. y: base.y,
  332. type: 0,
  333. id: aFishes.length,
  334. colourId: fishColourInc
  335. }, canvas.width, canvas.height);
  336. fishColourInc = ++fishColourInc % 9, aFishes.push(e), physics2D.aFishes = aFishes, playSound("newFish")
  337. }
  338. function defrostBubble(e) {
  339. for (var t = 0; t < aBubbles.length; t++) aBubbles[t].id == e && aBubbles[t].changeState("normal");
  340. playSound("breakIce");
  341. for (var t = 0; t < physics2D.aLines.length; t++) physics2D.aLines[t].id == e && (physics2D.aLines.splice(t, 1), t -= 1)
  342. }
  343. function getLevelResult() {
  344. for (var e = 0, t = 0; t < aLevelData[levelNum].length; t++) "bubble" == aLevelData[levelNum][t].type && ("jellyfish" != aLevelData[levelNum][t].subType && e++, "ice" == aLevelData[levelNum][t].subType && e++);
  345. e += Math.ceil(e / 6);
  346. var n = 1,
  347. r = 2e3;
  348. return e >= levelThrows ? n = 3 : levelThrows <= e + Math.ceil(e / 6) && (n = 2), r = Math.max(r - 50 * (levelThrows - e), 500), {
  349. stars: n,
  350. levelScore: r
  351. }
  352. }
  353. function updateGameEvent() {
  354. if (!manualPause && !rotatePause && "game" == gameState) {
  355. var e = getDelta();
  356. levelCompleteTimer >= 0 && (levelCompleteTimer += e, levelCompleteTimer > 1 && (initLevelComplete(), levelCompleteTimer = -1)), background.updateScroll(e), background.render(ctx);
  357. for (var t = 0; t < aFishes.length; t++) aFishes[t].update(base.x, base.y, e), renderSprite(aFishes[t]), aFishes[t].removeMe && (aFishes.splice(t, 1), t -= 1, (0 == aFishes.length || "held" != aFishes[aFishes.length - 1].state) && addFish());
  358. for (var t = 0; t < aBubbles.length; t++)
  359. if (aBubbles[t].update(e), renderSprite(aBubbles[t]), 1 != aBubbles[t].type)
  360. for (var n = 0; n < aFishes.length; n++) "flying" == aFishes[n].state && aFishes[n].skipBubble != aBubbles[t] && checkSpriteCollision(aBubbles[t], aFishes[n]) && bubbleHit(aBubbles[t], aFishes[n]);
  361. for (var t = 0; t < aLogs.length; t++) renderSprite(aLogs[t]);
  362. base.update(e), renderSprite(base), physics2D.update(e), hud.render(ctx), tutorialIsOn && panel.render(ctx), renderMuteBut(), renderLogoBut(), requestAnimFrame(updateGameEvent)
  363. }
  364. }
  365. function updateLevelSelectEvent() {
  366. if (!rotatePause && "levelSelect" == gameState) {
  367. var e = getDelta();
  368. background.updateScroll(e), background.render(ctx), panel.renderButs(ctx), panel.render(ctx), renderMuteBut(), requestAnimFrame(updateLevelSelectEvent)
  369. }
  370. }
  371. function updateCreditsScreenEvent() {
  372. if (!rotatePause && "credits" == gameState) {
  373. var e = getDelta();
  374. panel.update(e), panel.render(ctx), panel.renderButs(ctx), renderMuteBut(), requestAnimFrame(updateCreditsScreenEvent)
  375. }
  376. }
  377. function updateLevelComplete() {
  378. if (!rotatePause && "levelComplete" == gameState) {
  379. var e = getDelta();
  380. background.updateScroll(e), background.render(ctx), panel.update(e), panel.render(ctx), panel.renderButs(ctx), renderMuteBut(), requestAnimFrame(updateLevelComplete)
  381. }
  382. }
  383. function updateSplashScreenEvent() {
  384. if (!rotatePause && "splash" == gameState) {
  385. var e = getDelta();
  386. if (splashTimer += e, splashTimer > 2.5) return 1 != audioType || muted || music.play(), initStartScreen(), void 0;
  387. splash.render(ctx, e), requestAnimFrame(updateSplashScreenEvent)
  388. }
  389. }
  390. function updateStartScreenEvent() {
  391. if (!rotatePause && "start" == gameState) {
  392. var e = getDelta();
  393. background.updateScroll(e), background.render(ctx);
  394. for (var t = 0; t < aBubbles.length; t++) aBubbles[t].y -= (30 + 2 * t) * e, aBubbles[t].x = aBubbles[t].x - 50 * Math.sin(aBubbles[t].y / 50) * e, aBubbles[t].y < -100 && (aBubbles[t].x = Math.random() * canvas.width, aBubbles[t].y = canvas.height + 200 * Math.random() + 100), aBubbles[t].update(e), renderSprite(aBubbles[t]);
  395. panel.update(e), panel.render(ctx), panel.renderButs(ctx), renderMuteBut(), requestAnimFrame(updateStartScreenEvent)
  396. }
  397. }
  398. function getDelta() {
  399. var e = (new Date).getTime(),
  400. t = (e - previousTime) / 1e3;
  401. return previousTime = e, t > .5 && (t = 0), t
  402. }
  403. function renderSprite(e) {
  404. ctx.save(), ctx.translate(e.x, e.y), ctx.scale(e.scaleX, e.scaleY), ctx.rotate(e.rotation), e.render(ctx), ctx.restore()
  405. }
  406. function checkSpriteCollision(e, t, n) {
  407. "undefined" == typeof n && (n = 0);
  408. var r = e.x,
  409. i = e.y,
  410. s = t.x,
  411. o = t.y,
  412. u = (r - s) * (r - s) + (i - o) * (i - o),
  413. a = (e.radius + n) * (t.radius + n);
  414. return a > u ? !0 : !1
  415. }
  416. function getScaleImageToMax(e, t) {
  417. var n;
  418. return n = e.isSpriteSheet ? t[0] / e.oData.spriteWidth < t[1] / e.oData.spriteHeight ? Math.min(t[0] / e.oData.spriteWidth, 1) : Math.min(t[1] / e.oData.spriteHeight, 1) : t[0] / e.img.width < t[1] / e.img.height ? Math.min(t[0] / e.img.width, 1) : Math.min(t[1] / e.img.height, 1)
  419. }
  420. function getCentreFromTopLeft(e, t, n) {
  421. var r = new Array;
  422. return r.push(e[0] + t.oData.spriteWidth / 2 * n), r.push(e[1] + t.oData.spriteHeight / 2 * n), r
  423. }
  424. function loadPreAssets() {
  425. aLangs.length > 1 ? (preAssetLib = new Utils.AssetLoader(curLang, [{
  426. id: "langSelect",
  427. file: "images/langSelect.jpg"
  428. }, {
  429. id: "preloadImage",
  430. file: "images/preloadImage.jpg"
  431. }], ctx, canvas.width, canvas.height, !1), preAssetLib.onReady(initLangSelect)) : (curLang = aLangs[0], preAssetLib = new Utils.AssetLoader(curLang, [{
  432. id: "preloadImage",
  433. file: "images/preloadImage.jpg"
  434. }], ctx, canvas.width, canvas.height, !1), preAssetLib.onReady(initLoadAssets))
  435. }
  436. function initLangSelect() {
  437. var e = preAssetLib.getData("langSelect");
  438. ctx.drawImage(e.img, canvas.width / 2 - e.img.width / 2, canvas.height / 2 - e.img.height / 2);
  439. for (var t = 140, n = 0; n < aLangs.length; n++) {
  440. var r = canvas.width / 2 - t * aLangs.length / 2 + n * t,
  441. i = canvas.height / 2 - t / 2;
  442. userInput.addHitArea("langSelect", butEventHandler, {
  443. lang: aLangs[n]
  444. }, "rect", {
  445. aRect: [r, i, r + t, i + 140]
  446. })
  447. }
  448. }
  449. function initLoadAssets() {
  450. var e = preAssetLib.getData("preloadImage");
  451. ctx.drawImage(e.img, canvas.width / 2 - e.img.width / 2, canvas.height / 2 - e.img.height - 10), loadAssets()
  452. }
  453. function loadAssets() {
  454. assetLib = new Utils.AssetLoader(curLang, [{
  455. id: "background",
  456. file: "images/background.jpg"
  457. }, {
  458. id: "rotateDeviceMessage",
  459. file: "images/rotateDeviceMessage.jpg"
  460. }, {
  461. id: "splash",
  462. file: "images/splashScreen.jpg"
  463. }, {
  464. id: "credits",
  465. file: "images/creditsScreen.jpg"
  466. }, {
  467. id: "hud",
  468. file: "images/" + curLang + "/hud.png"
  469. }, {
  470. id: "goldFish",
  471. file: "images/goldFish.png"
  472. }, {
  473. id: "uiButs",
  474. file: "images/" + curLang + "/uiButs_112x76.png",
  475. oData: {
  476. columns: 6,
  477. spriteWidth: 112,
  478. spriteHeight: 76
  479. }
  480. }, {
  481. id: "levelButs",
  482. file: "images/levelButs_119x96.png",
  483. oData: {
  484. columns: 5,
  485. spriteWidth: 119,
  486. spriteHeight: 96
  487. }
  488. }, {
  489. id: "panels",
  490. file: "images/" + curLang + "/panels_383x550.png",
  491. oData: {
  492. columns: 2,
  493. spriteWidth: 383,
  494. spriteHeight: 550
  495. }
  496. }, {
  497. id: "tutorials",
  498. file: "images/" + curLang + "/tutorials_383x550.png",
  499. oData: {
  500. columns: 2,
  501. spriteWidth: 383,
  502. spriteHeight: 550
  503. }
  504. }, {
  505. id: "numbers",
  506. file: "images/numbers_25x35.png",
  507. oData: {
  508. columns: 10,
  509. spriteWidth: 25,
  510. spriteHeight: 35
  511. }
  512. }, {
  513. id: "muteBut",
  514. file: "images/mute_35x35.png",
  515. oData: {
  516. columns: 2,
  517. spriteWidth: 35,
  518. spriteHeight: 35
  519. }
  520. }, {
  521. id: "log",
  522. file: "images/log_256x59.png",
  523. oData: {
  524. columns: 1,
  525. spriteWidth: 256,
  526. spriteHeight: 59
  527. }
  528. }, {
  529. id: "bubble",
  530. file: "images/bubble_77x128.png",
  531. oData: {
  532. oAnims: {
  533. normal: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
  534. caught: [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33],
  535. holding: [33],
  536. ice: [34],
  537. fire: [35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46],
  538. jellyfish: [47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61]
  539. },
  540. columns: 13,
  541. spriteWidth: 77,
  542. spriteHeight: 128
  543. }
  544. }, {
  545. id: "fish",
  546. file: "images/fish_47x90.png",
  547. oData: {
  548. oAnims: {
  549. normal0: [0, 1, 2, 3, 4],
  550. normal1: [5, 6, 7, 8, 9],
  551. normal2: [10, 11, 12, 13, 14],
  552. normal3: [15, 16, 17, 18, 19],
  553. normal4: [20, 21, 22, 23, 24],
  554. normal5: [25, 26, 27, 28, 29],
  555. normal6: [30, 31, 32, 33, 34],
  556. normal7: [35, 36, 37, 38, 39],
  557. normal8: [40, 41, 42, 43, 44],
  558. onFire: [45, 46, 47, 48, 49, 50],
  559. stung: [51]
  560. },
  561. columns: 21,
  562. spriteWidth: 47,
  563. spriteHeight: 90
  564. }
  565. }, {
  566. id: "base",
  567. file: "images/base_139x140.png",
  568. oData: {
  569. oAnims: {
  570. ambient: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
  571. walkRight: [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28],
  572. walkLeft: [28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17],
  573. throwFish: [29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]
  574. },
  575. columns: 7,
  576. spriteWidth: 139,
  577. spriteHeight: 140
  578. }
  579. }, {
  580. id: "logo",
  581. file: oLogoData.image
  582. }], ctx, canvas.width, canvas.height), dcdcdc()
  583. }
  584. function dcdcdc() {
  585. assetLib.onReady(ananss);
  586. }
  587. function resizeCanvas() {
  588. var e = window.innerWidth,
  589. t = window.innerHeight;
  590. e > 480 && (e -= 1, t -= 1), window.innerWidth > window.innerHeight && isMobile ? ("loading" != gameState && rotatePauseOn(), e / canvas.width < t / canvas.height ? (canvas.style.width = e + "px", canvas.style.height = e / canvas.width * canvas.height + "px", canvasX = 0, canvasY = (t - e / canvas.width * canvas.height) / 2, canvasScaleX = canvasScaleY = canvas.width / e, div.style.marginTop = canvasY + "px", div.style.marginLeft = canvasX + "px") : (canvas.style.width = t / canvas.height * canvas.width + "px", canvas.style.height = t + "px", canvasX = (e - t / canvas.height * canvas.width) / 2, canvasY = 0, canvasScaleX = canvasScaleY = canvas.height / t, div.style.marginTop = canvasY + "px", div.style.marginLeft = canvasX + "px")) : isMobile ? (rotatePause && rotatePauseOff(), canvasX = canvasY = 0, canvasScaleX = canvas.width / e, canvasScaleY = canvas.height / t, canvas.style.width = e + "px", canvas.style.height = t + "px", div.style.marginTop = "0px", div.style.marginLeft = "0px") : (rotatePause && rotatePauseOff(), e / canvas.width < t / canvas.height ? (canvas.style.width = e + "px", canvas.style.height = e / canvas.width * canvas.height + "px", canvasX = 0, canvasY = (t - e / canvas.width * canvas.height) / 2, canvasScaleX = canvasScaleY = canvas.width / e, div.style.marginTop = canvasY + "px", div.style.marginLeft = canvasX + "px") : (canvas.style.width = t / canvas.height * canvas.width + "px", canvas.style.height = t + "px", canvasX = (e - t / canvas.height * canvas.width) / 2, canvasY = 0, canvasScaleX = canvasScaleY = canvas.height / t, div.style.marginTop = canvasY + "px", div.style.marginLeft = canvasX + "px")), userInput.setCanvas(canvasX, canvasY, canvasScaleX, canvasScaleY)
  591. }
  592. function playSound(e) {
  593. 1 == audioType && sound.play(e)
  594. }
  595. function toggleMute() {
  596. muted = !muted, 1 == audioType ? muted ? Howler.mute() : Howler.unmute() : 2 == audioType && (muted ? music.pause() : music.play()), renderMuteBut()
  597. }
  598. function renderLogoBut() {
  599. 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)
  600. }
  601. function renderMuteBut() {
  602. if (0 != audioType) {
  603. var e = assetLib.getData("muteBut"),
  604. t = 0;
  605. muted && (t = 1);
  606. var n = t * e.oData.spriteWidth % e.img.width,
  607. r = Math.floor(t / (e.img.width / e.oData.spriteWidth)) * e.oData.spriteHeight;
  608. ctx.drawImage(e.img, n, r, e.oData.spriteWidth, e.oData.spriteHeight, 340, 10, e.oData.spriteWidth, e.oData.spriteHeight)
  609. }
  610. }
  611. function adPauseOn() {
  612. toggleManualPause()
  613. }
  614. function adPauseOff() {
  615. manualPause && toggleManualPause()
  616. }
  617. function toggleManualPause() {
  618. if (manualPause) manualPause = !1, userInput.removeHitArea("quitFromPause"), userInput.removeHitArea("resumeFromPause"), userInput.removeHitArea("moreGamesPause"), pauseCoreOff();
  619. else {
  620. manualPause = !0, pauseCoreOn();
  621. var e = {
  622. oImgData: assetLib.getData("uiButs"),
  623. aPos: [120, 380],
  624. scale: 1,
  625. type: 1,
  626. frame: 3
  627. },
  628. t = {
  629. oImgData: assetLib.getData("uiButs"),
  630. aPos: [263, 380],
  631. scale: 1,
  632. type: 1,
  633. frame: 0
  634. },
  635. n = {
  636. oImgData: assetLib.getData("uiButs"),
  637. aPos: [canvas.width / 2, 460],
  638. scale: 1,
  639. type: 1,
  640. frame: 1
  641. },
  642. r = new Array(e, t, n);
  643. userInput.addHitArea("quitFromPause", butEventHandler, null, "image", e), userInput.addHitArea("resumeFromPause", butEventHandler, null, "image", t), userInput.addHitArea("moreGamesPause", butEventHandler, null, "image", n);
  644. var i = new Elements.Panel(assetLib.getData("panels"), assetLib.getData("tutorials"), assetLib.getData("numbers"), assetLib.getData("goldFish"), "pause", r, canvas.width, canvas.height);
  645. i.render(ctx), i.renderButs(ctx)
  646. }
  647. }
  648. function rotatePauseOn() {
  649. rotatePause = !0, ctx.drawImage(assetLib.getImg("rotateDeviceMessage"), 0, 0), userInput.pauseIsOn = !0, pauseCoreOn()
  650. }
  651. function rotatePauseOff() {
  652. rotatePause = !1, userInput.removeHitArea("quitFromPause"), userInput.removeHitArea("resumeFromPause"), pauseCoreOff()
  653. }
  654. function pauseCoreOn() {
  655. switch (1 == audioType ? Howler.mute() : 2 == audioType && music.pause(), gameState) {
  656. case "start":
  657. break;
  658. case "levelSelect":
  659. break;
  660. case "game":
  661. userInput.removeHitArea("shoot"), userInput.removeHitArea("moveBase"), userInput.removeKey("moveRightEvent"), userInput.removeKey("moveLeftEvent");
  662. break;
  663. case "levelComplete":
  664. }
  665. }
  666. function pauseCoreOff() {
  667. switch (1 == audioType ? muted || Howler.unmute() : 2 == audioType && (muted || music.play()), previousTime = (new Date).getTime(), userInput.pauseIsOn = !1, gameState) {
  668. case "splash":
  669. updateSplashScreenEvent();
  670. break;
  671. case "start":
  672. initStartScreen();
  673. break;
  674. case "credits":
  675. initCreditsScreen();
  676. break;
  677. case "levelSelect":
  678. initLevelSelect();
  679. break;
  680. case "game":
  681. manualPause = !1, userInput.addHitArea("shoot", butEventHandler, null, "rect", {
  682. aRect: [0, 50, canvas.width, 460]
  683. }, !0), userInput.addHitArea("moveBase", butEventHandler, {
  684. multiTouch: !0,
  685. isDraggable: !0
  686. }, "rect", {
  687. aRect: [0, 460, canvas.width, 550]
  688. }, !0), userInput.addKey("moveRightEvent", butEventHandler, null, 39), userInput.addKey("moveLeftEvent", butEventHandler, null, 37), updateGameEvent();
  689. break;
  690. case "levelComplete":
  691. initLevelComplete();
  692. break;
  693. case "end":
  694. }
  695. }
  696. var Utils;
  697. ! function(e) {
  698. var t = function() {
  699. function e(e, t, n, r, i, s) {
  700. "undefined" == typeof s && (s = !0), this.oAssetData = {}, this.assetsLoaded = 0, this.totalAssets = t.length, this.ctx = n, this.canvasWidth = r, this.canvasHeight = i, this.showBar = s, this.topLeftX = this.canvasWidth / 2 - r / 4, this.topLeftY = this.canvasHeight / 2, this.showBar && (ctx.strokeStyle = "#aaaaaa", ctx.lineWidth = 2, ctx.fillStyle = "#ffffff", ctx.moveTo(this.topLeftX, this.topLeftY), ctx.lineTo(this.topLeftX + r / 2, this.topLeftY + 0), ctx.lineTo(this.topLeftX + r / 2, this.topLeftY + 20), ctx.lineTo(this.topLeftX + 0, this.topLeftY + 20), ctx.lineTo(this.topLeftX + 0, this.topLeftY + 0), ctx.stroke());
  701. for (var o = 0; o < t.length; o++) this.loadImage(t[o])
  702. }
  703. return e.prototype.loadImage = function(e) {
  704. var t = this,
  705. n = new Image;
  706. n.onload = function() {
  707. t.oAssetData[e.id] = {}, t.oAssetData[e.id].img = n, void 0 != e.oData ? (t.oAssetData[e.id].oData = e.oData, t.oAssetData[e.id].isSpriteSheet = !0) : (t.oAssetData[e.id].isSpriteSheet = !1, t.oAssetData[e.id].oData = {}, t.oAssetData[e.id].oData.spriteWidth = t.oAssetData[e.id].img.width, t.oAssetData[e.id].oData.spriteHeight = t.oAssetData[e.id].img.height), ++t.assetsLoaded, t.showBar && ctx.fillRect(t.topLeftX + 2, t.topLeftY + 2, (t.canvasWidth / 2 - 4) / t.totalAssets * t.assetsLoaded, 16), t.checkLoadComplete()
  708. }, n.src = e.file
  709. }, e.prototype.checkLoadComplete = function() {
  710. this.assetsLoaded == this.totalAssets && this.loadedCallback()
  711. }, e.prototype.onReady = function(e) {
  712. this.loadedCallback = e
  713. }, e.prototype.getImg = function(e) {
  714. return this.oAssetData[e].img
  715. }, e.prototype.getData = function(e) {
  716. return this.oAssetData[e]
  717. }, e
  718. }();
  719. e.AssetLoader = t
  720. }(Utils || (Utils = {}));
  721. var Utils;
  722. ! function(e) {
  723. var t = function() {
  724. function e(e, t, n, r) {
  725. 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 = e, this.oAnims = this.oImgData.oData.oAnims, this.fps = t, this.radius = n, this.animId = r
  726. }
  727. return e.prototype.updateAnimation = function(e) {
  728. this.frameInc += this.fps * e
  729. }, e.prototype.resetAnim = function() {
  730. this.frameInc = 0
  731. }, e.prototype.setFrame = function(e) {
  732. this.fixedFrame = e
  733. }, e.prototype.setAnimType = function(e, t, n) {
  734. switch ("undefined" == typeof n && (n = !0), this.animId = t, this.animType = e, n && this.resetAnim(), e) {
  735. case "loop":
  736. break;
  737. case "once":
  738. this.maxIdx = this.oAnims[this.animId].length - 1
  739. }
  740. }, e.prototype.render = function(e) {
  741. if (null != this.animId) {
  742. var t = this.oAnims[this.animId].length,
  743. n = Math.floor(this.frameInc),
  744. r = this.oAnims[this.animId][n % t],
  745. i = r * this.oImgData.oData.spriteWidth % this.oImgData.img.width,
  746. s = Math.floor(r / (this.oImgData.img.width / this.oImgData.oData.spriteWidth)) * this.oImgData.oData.spriteHeight;
  747. if ("once" == this.animType && n > this.maxIdx) {
  748. this.fixedFrame = this.oAnims[this.animId][t - 1], this.animId = null, this.animEndedFunc();
  749. var i = this.fixedFrame * this.oImgData.oData.spriteWidth % this.oImgData.img.width,
  750. s = Math.floor(this.fixedFrame / (this.oImgData.img.width / this.oImgData.oData.spriteWidth)) * this.oImgData.oData.spriteHeight
  751. }
  752. } else var i = this.fixedFrame * this.oImgData.oData.spriteWidth % this.oImgData.img.width,
  753. s = Math.floor(this.fixedFrame / (this.oImgData.img.width / this.oImgData.oData.spriteWidth)) * this.oImgData.oData.spriteHeight;
  754. e.drawImage(this.oImgData.img, i, s, 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)
  755. }, e
  756. }();
  757. e.AnimSprite = t
  758. }(Utils || (Utils = {}));
  759. var Utils;
  760. ! function(e) {
  761. var t = function() {
  762. function e(e, t, n) {
  763. "undefined" == typeof n && (n = 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 = e, this.radius = t, this.setFrame(n)
  764. }
  765. return e.prototype.setFrame = function(e) {
  766. this.frameNum = e
  767. }, e.prototype.render = function(e) {
  768. var t = this.frameNum * this.oImgData.oData.spriteWidth % this.oImgData.img.width,
  769. n = Math.floor(this.frameNum / (this.oImgData.img.width / this.oImgData.oData.spriteWidth)) * this.oImgData.oData.spriteHeight;
  770. e.drawImage(this.oImgData.img, t, n, 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)
  771. }, e
  772. }();
  773. e.BasicSprite = t
  774. }(Utils || (Utils = {}));
  775. var Utils;
  776. ! function(e) {
  777. var t = function() {
  778. function e(e, t) {
  779. var n = this;
  780. 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 = t, e.addEventListener("touchstart", function(e) {
  781. for (var t = 0; t < e.changedTouches.length; t++) n.hitDown(e, e.changedTouches[t].pageX, e.changedTouches[t].pageY, e.changedTouches[t].identifier)
  782. }, !1), e.addEventListener("touchend", function(e) {
  783. for (var t = 0; t < e.changedTouches.length; t++) n.hitUp(e, e.changedTouches[t].pageX, e.changedTouches[t].pageY, e.changedTouches[t].identifier)
  784. }, !1), e.addEventListener("touchmove", function(e) {
  785. for (var t = 0; t < n.aHitAreas.length; t++) n.move(e, e.changedTouches[t].pageX, e.changedTouches[t].pageY, e.changedTouches[t].identifier, !0)
  786. }, !1), e.addEventListener("mousedown", function(e) {
  787. n.isDown = !0, n.hitDown(e, e.pageX, e.pageY, 1)
  788. }, !1), e.addEventListener("mouseup", function(e) {
  789. n.isDown = !1, n.hitUp(e, e.pageX, e.pageY, 1)
  790. }, !1), e.addEventListener("mousemove", function(e) {
  791. n.move(e, e.pageX, e.pageY, 1, n.isDown)
  792. }, !1), this.aHitAreas = new Array, this.aKeys = new Array
  793. }
  794. return e.prototype.setCanvas = function(e, t, n, r) {
  795. this.canvasX = e, this.canvasY = t, this.canvasScaleX = n, this.canvasScaleY = r
  796. }, e.prototype.hitDown = function(e, t, n, r) {
  797. if (!this.pauseIsOn) {
  798. var i = (new Date).getTime();
  799. if (!(i - this.prevHitTime < 500 && isBugBrowser)) {
  800. this.prevHitTime = i, e.preventDefault(), e.stopPropagation(), t = (t - this.canvasX) * this.canvasScaleX, n = (n - this.canvasY) * this.canvasScaleY;
  801. for (var s = 0; s < this.aHitAreas.length; s++)
  802. if (this.aHitAreas[s].rect && t > this.aHitAreas[s].area[0] && n > this.aHitAreas[s].area[1] && t < this.aHitAreas[s].area[2] && n < this.aHitAreas[s].area[3]) {
  803. this.aHitAreas[s].aTouchIdentifiers.push(r), this.aHitAreas[s].oData.isDown || (this.aHitAreas[s].oData.isDown = !0, this.aHitAreas[s].oData.x = t, this.aHitAreas[s].oData.y = n, this.aHitAreas[s].callback(this.aHitAreas[s].id, this.aHitAreas[s].oData));
  804. break
  805. }
  806. }
  807. }
  808. }, e.prototype.hitUp = function(e, t, n, r) {
  809. if (!this.pauseIsOn) {
  810. e.preventDefault(), e.stopPropagation(), t = (t - this.canvasX) * this.canvasScaleX, n = (n - this.canvasY) * this.canvasScaleY;
  811. for (var i = 0; i < this.aHitAreas.length; i++)
  812. if (this.aHitAreas[i].rect && t > this.aHitAreas[i].area[0] && n > this.aHitAreas[i].area[1] && t < this.aHitAreas[i].area[2] && n < this.aHitAreas[i].area[3]) {
  813. for (var s = 0; s < this.aHitAreas[i].aTouchIdentifiers.length; s++) this.aHitAreas[i].aTouchIdentifiers[s] == r && (this.aHitAreas[i].aTouchIdentifiers.splice(s, 1), s -= 1);
  814. 0 == this.aHitAreas[i].aTouchIdentifiers.length && (this.aHitAreas[i].oData.isDown = !1, this.aHitAreas[i].oData.multiTouch && this.aHitAreas[i].callback(this.aHitAreas[i].id, this.aHitAreas[i].oData));
  815. break
  816. }
  817. }
  818. }, e.prototype.move = function(e, t, n, r, i) {
  819. if (!this.pauseIsOn && i) {
  820. t = (t - this.canvasX) * this.canvasScaleX, n = (n - this.canvasY) * this.canvasScaleY;
  821. for (var s = 0; s < this.aHitAreas.length; s++)
  822. if (this.aHitAreas[s].rect)
  823. if (t > this.aHitAreas[s].area[0] && n > this.aHitAreas[s].area[1] && t < this.aHitAreas[s].area[2] && n < this.aHitAreas[s].area[3]) this.aHitAreas[s].oData.isDown || (this.aHitAreas[s].oData.isDown = !0, this.aHitAreas[s].oData.x = t, this.aHitAreas[s].oData.y = n, this.aHitAreas[s].aTouchIdentifiers.push(r), this.aHitAreas[s].oData.multiTouch && this.aHitAreas[s].callback(this.aHitAreas[s].id, this.aHitAreas[s].oData)), this.aHitAreas[s].oData.isDraggable && (this.aHitAreas[s].oData.isBeingDragged = !0, this.aHitAreas[s].oData.x = t, this.aHitAreas[s].oData.y = n, this.aHitAreas[s].callback(this.aHitAreas[s].id, this.aHitAreas[s].oData), this.aHitAreas[s].oData.isBeingDragged = !1);
  824. else if (this.aHitAreas[s].oData.isDown) {
  825. for (var o = 0; o < this.aHitAreas[s].aTouchIdentifiers.length; o++) this.aHitAreas[s].aTouchIdentifiers[o] == r && (this.aHitAreas[s].aTouchIdentifiers.splice(o, 1), o -= 1);
  826. 0 == this.aHitAreas[s].aTouchIdentifiers.length && (this.aHitAreas[s].oData.isDown = !1, this.aHitAreas[s].oData.multiTouch && this.aHitAreas[s].callback(this.aHitAreas[s].id, this.aHitAreas[s].oData))
  827. }
  828. }
  829. }, e.prototype.keyDown = function(e) {
  830. for (var t = 0; t < this.aKeys.length; t++) e.keyCode == this.aKeys[t].keyCode && (this.aKeys[t].oData.isDown = !0, this.aKeys[t].callback(this.aKeys[t].id, this.aKeys[t].oData))
  831. }, e.prototype.keyUp = function(e) {
  832. for (var t = 0; t < this.aKeys.length; t++) e.keyCode == this.aKeys[t].keyCode && (this.aKeys[t].oData.isDown = !1, this.aKeys[t].callback(this.aKeys[t].id, this.aKeys[t].oData))
  833. }, e.prototype.addKey = function(e, t, n, r) {
  834. var i = this;
  835. this.isDetectingKeys || (window.addEventListener("keydown", function(e) {
  836. i.keyDown(e)
  837. }, !1), window.addEventListener("keyup", function(e) {
  838. i.keyUp(e)
  839. }, !1), this.isDetectingKeys = !0), null == n && (n = new Object), this.aKeys.push({
  840. id: e,
  841. callback: t,
  842. oData: n,
  843. keyCode: r
  844. })
  845. }, e.prototype.removeKey = function(e) {
  846. for (var t = 0; t < this.aKeys.length; t++) this.aKeys[t].id == e && (this.aKeys.splice(t, 1), t -= 1)
  847. }, e.prototype.addHitArea = function(e, t, n, r, i, s) {
  848. "undefined" == typeof s && (s = !1), null == n && (n = new Object), s && this.removeHitArea(e);
  849. var o = new Array;
  850. switch (r) {
  851. case "image":
  852. void 0 == i.scale && (i.scale = 1);
  853. var u;
  854. i.oImgData.isSpriteSheet ? (u = new Array(i.aPos[0] - i.oImgData.oData.spriteWidth / 2 * i.scale, i.aPos[1] - i.oImgData.oData.spriteHeight / 2 * i.scale, i.aPos[0] + i.oImgData.oData.spriteWidth / 2 * i.scale, i.aPos[1] + i.oImgData.oData.spriteHeight / 2 * i.scale), this.aHitAreas.push({
  855. id: e,
  856. aTouchIdentifiers: o,
  857. callback: t,
  858. oData: n,
  859. rect: !0,
  860. area: u
  861. })) : (u = new Array(i.aPos[0] - i.oImgData.img.width / 2 * i.scale, i.aPos[1] - i.oImgData.img.height / 2 * i.scale, i.aPos[0] + i.oImgData.img.width / 2 * i.scale, i.aPos[1] + i.oImgData.img.height / 2 * i.scale), this.aHitAreas.push({
  862. id: e,
  863. aTouchIdentifiers: o,
  864. callback: t,
  865. oData: n,
  866. rect: !0,
  867. area: u
  868. }));
  869. break;
  870. case "rect":
  871. this.aHitAreas.push({
  872. id: e,
  873. aTouchIdentifiers: o,
  874. callback: t,
  875. oData: n,
  876. rect: !0,
  877. area: i.aRect
  878. })
  879. }
  880. }, e.prototype.removeHitArea = function(e) {
  881. for (var t = 0; t < this.aHitAreas.length; t++) this.aHitAreas[t].id == e && (this.aHitAreas.splice(t, 1), t -= 1)
  882. }, e
  883. }();
  884. e.UserInput = t
  885. }(Utils || (Utils = {}));
  886. var Utils;
  887. ! function(e) {
  888. var t = function() {
  889. function e(e) {
  890. this.updateFreq = 10, this.updateInc = 0, this.frameAverage = 0, this.display = 1, this.log = "", this.render = function(e) {
  891. this.frameAverage += this.delta / this.updateFreq, ++this.updateInc >= this.updateFreq && (this.updateInc = 0, this.display = this.frameAverage, this.frameAverage = 0), e.textAlign = "left", ctx.font = "10px Helvetica", e.fillStyle = "#333333", e.beginPath(), e.rect(0, this.canvasHeight - 15, 40, 15), e.closePath(), e.fill(), e.fillStyle = "#ffffff", e.fillText(Math.round(1e3 / (1e3 * this.display)) + " fps " + this.log, 5, this.canvasHeight - 5)
  892. }, this.canvasHeight = e
  893. }
  894. return e.prototype.update = function(e) {
  895. this.delta = e
  896. }, e
  897. }();
  898. e.FpsMeter = t
  899. }(Utils || (Utils = {}));
  900. var Elements;
  901. ! function(e) {
  902. var t = function() {
  903. function e(e, t, n) {
  904. this.x = 0, this.y = 0, this.targY = 0, this.incY = 0, this.posY = 0, this.oImgData = e, this.canvasWidth = t, this.canvasHeight = n
  905. }
  906. return e.prototype.updateScroll = function(e) {
  907. this.incY += 3 * e, this.posY -= 8 * this.posY * e
  908. }, e.prototype.render = function(e) {
  909. var t = 40;
  910. e.drawImage(this.oImgData.img, 0, 0);
  911. for (var n = 0; t > n; n++) e.drawImage(this.oImgData.img, 0, n * (this.canvasHeight / t), this.canvasWidth, this.canvasHeight / t, 4 * Math.sin(this.incY + n / 3) - this.posY, n * (this.canvasHeight / t), this.canvasWidth, this.canvasHeight / t)
  912. }, e
  913. }();
  914. e.Background = t
  915. }(Elements || (Elements = {}));
  916. var Elements;
  917. ! function(e) {
  918. var t = function() {
  919. function e(e, t, n, r, i) {
  920. this.incY = 0, this.score = 0, this.highestScore = 0, this.posY = 0, this.bgX = 0, this.bgY = 0, this.atmosX = 0, this.atmosY = 0, this.oButs = e, this.oBgImgData = t, this.oTitleImgData = n, this.canvasWidth = r, this.canvasHeight = i, this.posY = -this.canvasHeight
  921. }
  922. return e.prototype.setRenderFunc = function(e) {
  923. switch (this.posY = -this.canvasHeight, e) {
  924. case "start":
  925. this.renderFunc = this.renderStartScreen, TweenLite.to(this, .5, {
  926. posY: 0
  927. });
  928. break;
  929. case "help":
  930. break;
  931. case "end":
  932. }
  933. }, e.prototype.render = function(e, t) {
  934. this.renderFunc(e, t)
  935. }, e.prototype.renderStartScreen = function(e, t) {
  936. this.incY += 5 * t, this.bgY -= 50 * t, this.bgX -= 50 * Math.sin(this.incY / 10) * t;
  937. var n = this.bgX % this.canvasWidth,
  938. r = this.bgY % this.canvasHeight;
  939. 0 > n && (n += this.canvasWidth), 0 > r && (r += this.canvasHeight), e.drawImage(this.oBgImgData.img, n, r, this.canvasWidth, this.canvasHeight, 0, 0, this.canvasWidth, this.canvasHeight), e.drawImage(this.oTitleImgData.img, 15 + this.posY, 60), e.drawImage(this.oButs.play.imageData.img, this.oButs.play.pos[0] - this.oButs.play.imageData.img.width / 2, this.oButs.play.pos[1] - this.oButs.play.imageData.img.height / 2 - 5 * Math.sin(this.incY) - this.posY), e.drawImage(this.oButs.moreGames.imageData.img, this.oButs.moreGames.pos[0] - this.oButs.moreGames.imageData.img.width / 2, this.oButs.moreGames.pos[1] - this.oButs.moreGames.imageData.img.height / 2 - 5 * Math.sin(this.incY) - this.posY)
  940. }, e
  941. }();
  942. e.Screens = t
  943. }(Elements || (Elements = {}));
  944. var Elements;
  945. ! function(e) {
  946. var t = function() {
  947. function e(e, t, n) {
  948. this.inc = 0, this.oSplashScreenImgData = e, this.canvasWidth = t, this.canvasHeight = n, this.posY = -this.canvasHeight, TweenLite.to(this, .5, {
  949. posY: 0
  950. })
  951. }
  952. return e.prototype.render = function(e, t) {
  953. this.inc += 5 * t, e.drawImage(this.oSplashScreenImgData.img, 0, 0 - this.posY)
  954. }, e
  955. }();
  956. e.Splash = t
  957. }(Elements || (Elements = {}));
  958. var Elements;
  959. ! function(e) {
  960. var t = function() {
  961. function e(e, t, n, r, i, s, o, u) {
  962. this.timer = .3, this.endTime = 0, this.posY = 0, this.numberSpace = 18, this.incY = 0, this.oPanelsImgData = e, this.oTutorialsImgData = t, this.oNumbersImgData = n, this.oGoldFishImgData = r, this.panelType = i, this.aButs = s, this.canvasWidth = o, this.canvasHeight = u
  963. }
  964. return e.prototype.update = function(e) {
  965. this.incY += 5 * e
  966. }, e.prototype.startTween1 = function() {
  967. this.posY = 550, TweenLite.to(this, .8, {
  968. posY: 0,
  969. ease: "Back.easeOut"
  970. })
  971. }, e.prototype.startTween2 = function() {
  972. this.posY = 50, TweenLite.to(this, .5, {
  973. posY: 0,
  974. ease: "Back.easeOut"
  975. })
  976. }, e.prototype.startTween3 = function() {
  977. this.posY = 550, TweenLite.to(this, .5, {
  978. posY: 0,
  979. ease: "Quad.easeOut"
  980. })
  981. }, e.prototype.startTweenEndLevel = function() {
  982. this.aStarPos = new Array;
  983. for (var e = 0; e < this.oScoreData.stars; e++) this.aStarPos.push({
  984. posY: -300
  985. }), TweenLite.to(this.aStarPos[e], 1.5, {
  986. posY: 0,
  987. ease: "Bounce.easeOut",
  988. delay: .3 * e
  989. });
  990. this.posY = 550, TweenLite.to(this, .8, {
  991. posY: 0,
  992. ease: "Back.easeOut"
  993. })
  994. }, e.prototype.renderButs = function(e) {
  995. if (null != this.aButs)
  996. for (var t = 0; t < this.aButs.length; t++) {
  997. var n = this.posY,
  998. r = 0;
  999. if (0 != this.incY && (r = 3 * Math.sin(this.incY + 45 * t)), 0 == t % 2 && (n = -this.posY), 0 == this.aButs[t].type) e.drawImage(this.aButs[t].oImgData.img, 0, 0, this.aButs[t].oImgData.img.width, this.aButs[t].oImgData.img.height, this.aButs[t].aPos[0] - this.aButs[t].oImgData.img.width / 2 * this.aButs[t].scale + n, this.aButs[t].aPos[1] - this.aButs[t].oImgData.img.height / 2 * this.aButs[t].scale - r, this.aButs[t].oImgData.img.width * this.aButs[t].scale, this.aButs[t].oImgData.img.height * this.aButs[t].scale);
  1000. else {
  1001. var i = this.aButs[t].frame,
  1002. s = i * this.aButs[t].oImgData.oData.spriteWidth % this.aButs[t].oImgData.img.width,
  1003. o = Math.floor(i / (this.aButs[t].oImgData.img.width / this.aButs[t].oImgData.oData.spriteWidth)) * this.aButs[t].oImgData.oData.spriteHeight;
  1004. e.drawImage(this.aButs[t].oImgData.img, s, o, this.aButs[t].oImgData.oData.spriteWidth, this.aButs[t].oImgData.oData.spriteHeight, this.aButs[t].aPos[0] - this.aButs[t].oImgData.oData.spriteWidth / 2 + n, this.aButs[t].aPos[1] - this.aButs[t].oImgData.oData.spriteHeight / 2 - r, this.aButs[t].oImgData.oData.spriteWidth * this.aButs[t].scale, this.aButs[t].oImgData.oData.spriteHeight * this.aButs[t].scale)
  1005. }
  1006. }
  1007. }, e.prototype.render = function(e) {
  1008. switch (this.panelType) {
  1009. case "start":
  1010. var t = 0,
  1011. n = t * this.oPanelsImgData.oData.spriteWidth % this.oPanelsImgData.img.width,
  1012. r = Math.floor(t / (this.oPanelsImgData.img.width / this.oPanelsImgData.oData.spriteWidth)) * this.oPanelsImgData.oData.spriteHeight;
  1013. e.drawImage(this.oPanelsImgData.img, n, r, this.oPanelsImgData.oData.spriteWidth, this.oPanelsImgData.oData.spriteHeight, 0, 0 + this.posY, this.oPanelsImgData.oData.spriteWidth, this.oPanelsImgData.oData.spriteHeight);
  1014. break;
  1015. case "credits":
  1016. var t = 3,
  1017. n = t * this.oPanelsImgData.oData.spriteWidth % this.oPanelsImgData.img.width,
  1018. r = Math.floor(t / (this.oPanelsImgData.img.width / this.oPanelsImgData.oData.spriteWidth)) * this.oPanelsImgData.oData.spriteHeight;
  1019. e.drawImage(this.oPanelsImgData.img, n, r, this.oPanelsImgData.oData.spriteWidth, this.oPanelsImgData.oData.spriteHeight, 0, 0 + this.posY, this.oPanelsImgData.oData.spriteWidth, this.oPanelsImgData.oData.spriteHeight);
  1020. break;
  1021. case "levelSelect":
  1022. for (var i = 0; 12 > i; i++)
  1023. for (var s = i + 12 * this.oScoreData.levelButsPage + 1, o = 0; o < s.toString().length; o++) {
  1024. t = parseFloat(s.toString().charAt(o));
  1025. var n = t * this.oNumbersImgData.oData.spriteWidth % this.oNumbersImgData.img.width,
  1026. r = Math.floor(t / (this.oNumbersImgData.img.width / this.oNumbersImgData.oData.spriteWidth)) * this.oNumbersImgData.oData.spriteHeight,
  1027. u = this.posY;
  1028. 0 == i % 2 && (u = -this.posY), e.drawImage(this.oNumbersImgData.img, n, r, this.oNumbersImgData.oData.spriteWidth, this.oNumbersImgData.oData.spriteHeight, this.aButs[i].aPos[0] + o * this.numberSpace - this.numberSpace * s.toString().length / 2 + u, this.aButs[i].aPos[1] + 2, this.oNumbersImgData.oData.spriteWidth, this.oNumbersImgData.oData.spriteHeight)
  1029. }
  1030. break;
  1031. case "levelComplete":
  1032. var t = 1,
  1033. n = t * this.oPanelsImgData.oData.spriteWidth % this.oPanelsImgData.img.width,
  1034. r = Math.floor(t / (this.oPanelsImgData.img.width / this.oPanelsImgData.oData.spriteWidth)) * this.oPanelsImgData.oData.spriteHeight;
  1035. e.drawImage(this.oPanelsImgData.img, n, r, this.oPanelsImgData.oData.spriteWidth, this.oPanelsImgData.oData.spriteHeight, 0, 0 + this.posY, this.oPanelsImgData.oData.spriteWidth, this.oPanelsImgData.oData.spriteHeight);
  1036. for (var s = this.oScoreData.levelScore, o = 0; o < s.toString().length; o++) {
  1037. t = parseFloat(s.toString().charAt(o));
  1038. var n = t * this.oNumbersImgData.oData.spriteWidth % this.oNumbersImgData.img.width,
  1039. r = Math.floor(t / (this.oNumbersImgData.img.width / this.oNumbersImgData.oData.spriteWidth)) * this.oNumbersImgData.oData.spriteHeight;
  1040. e.drawImage(this.oNumbersImgData.img, n, r, this.oNumbersImgData.oData.spriteWidth, this.oNumbersImgData.oData.spriteHeight, 115 + o * this.numberSpace - this.numberSpace * s.toString().length / 2, 320 + this.posY, this.oNumbersImgData.oData.spriteWidth, this.oNumbersImgData.oData.spriteHeight)
  1041. }
  1042. for (var s = this.oScoreData.totalScore, o = 0; o < s.toString().length; o++) {
  1043. t = parseFloat(s.toString().charAt(o));
  1044. var n = t * this.oNumbersImgData.oData.spriteWidth % this.oNumbersImgData.img.width,
  1045. r = Math.floor(t / (this.oNumbersImgData.img.width / this.oNumbersImgData.oData.spriteWidth)) * this.oNumbersImgData.oData.spriteHeight;
  1046. e.drawImage(this.oNumbersImgData.img, n, r, this.oNumbersImgData.oData.spriteWidth, this.oNumbersImgData.oData.spriteHeight, 268 + o * this.numberSpace - this.numberSpace * s.toString().length / 2, 320 + this.posY, this.oNumbersImgData.oData.spriteWidth, this.oNumbersImgData.oData.spriteHeight)
  1047. }
  1048. for (var o = 0; o < this.oScoreData.stars; o++) e.drawImage(this.oGoldFishImgData.img, 52 + 82 * o, 155 + this.aStarPos[o].posY);
  1049. break;
  1050. case "tutorial0":
  1051. case "tutorial1":
  1052. case "tutorial2":
  1053. case "tutorial3":
  1054. var t = parseFloat(this.panelType.charAt(this.panelType.length - 1)),
  1055. n = t * this.oTutorialsImgData.oData.spriteWidth % this.oTutorialsImgData.img.width,
  1056. r = Math.floor(t / (this.oTutorialsImgData.img.width / this.oTutorialsImgData.oData.spriteWidth)) * this.oTutorialsImgData.oData.spriteHeight;
  1057. e.drawImage(this.oTutorialsImgData.img, n, r, this.oTutorialsImgData.oData.spriteWidth, this.oTutorialsImgData.oData.spriteHeight, 0, 0 + this.posY, this.oTutorialsImgData.oData.spriteWidth, this.oTutorialsImgData.oData.spriteHeight);
  1058. break;
  1059. case "pause":
  1060. var t = 2,
  1061. n = t * this.oPanelsImgData.oData.spriteWidth % this.oPanelsImgData.img.width,
  1062. r = Math.floor(t / (this.oPanelsImgData.img.width / this.oPanelsImgData.oData.spriteWidth)) * this.oPanelsImgData.oData.spriteHeight;
  1063. e.drawImage(this.oPanelsImgData.img, n, r, this.oPanelsImgData.oData.spriteWidth, this.oPanelsImgData.oData.spriteHeight, 0, 0, this.oPanelsImgData.oData.spriteWidth, this.oPanelsImgData.oData.spriteHeight)
  1064. }
  1065. }, e
  1066. }();
  1067. e.Panel = t
  1068. }(Elements || (Elements = {}));
  1069. var Elements;
  1070. ! function(e) {
  1071. var t = function() {
  1072. function e(e, t, n, r, i, s) {
  1073. this.score = 0, this.letterSpace = 18, this.oHudImgData = e, this.oNumbersImgData = t, this.canvasWidth = n, this.canvasHeight = r, this.score = i, this.levelNum = s
  1074. }
  1075. return e.prototype.render = function(e) {
  1076. e.drawImage(this.oHudImgData.img, 0, 0);
  1077. for (var t = 0; t < this.levelNum.toString().length; t++) {
  1078. var n = parseFloat(this.levelNum.toString().charAt(t)),
  1079. r = n * this.oNumbersImgData.oData.spriteWidth % this.oNumbersImgData.img.width,
  1080. i = Math.floor(n / (this.oNumbersImgData.img.width / this.oNumbersImgData.oData.spriteWidth)) * this.oNumbersImgData.oData.spriteHeight;
  1081. e.drawImage(this.oNumbersImgData.img, r, i, this.oNumbersImgData.oData.spriteWidth, this.oNumbersImgData.oData.spriteHeight, 65 + t * this.letterSpace, 40, this.oNumbersImgData.oData.spriteWidth, this.oNumbersImgData.oData.spriteHeight)
  1082. }
  1083. if (this.score > 0)
  1084. for (var t = 0; t < this.score.toString().length; t++) {
  1085. var n = parseFloat(this.score.toString().charAt(t)),
  1086. r = n * this.oNumbersImgData.oData.spriteWidth % this.oNumbersImgData.img.width,
  1087. i = Math.floor(n / (this.oNumbersImgData.img.width / this.oNumbersImgData.oData.spriteWidth)) * this.oNumbersImgData.oData.spriteHeight;
  1088. e.drawImage(this.oNumbersImgData.img, r, i, this.oNumbersImgData.oData.spriteWidth, this.oNumbersImgData.oData.spriteHeight, 170 + t * this.letterSpace - this.letterSpace * this.score.toString().length / 2, 10, this.oNumbersImgData.oData.spriteWidth, this.oNumbersImgData.oData.spriteHeight)
  1089. }
  1090. }, e.prototype.updateScore = function(e) {
  1091. this.score = e
  1092. }, e
  1093. }();
  1094. e.Hud = t
  1095. }(Elements || (Elements = {}));
  1096. var __extends = this.__extends || function(e, t) {
  1097. function n() {
  1098. this.constructor = e
  1099. }
  1100. n.prototype = t.prototype, e.prototype = new n
  1101. },
  1102. Elements;
  1103. ! function(e) {
  1104. var t = function(e) {
  1105. function t(t, n, r, i) {
  1106. e.call(this, t, 2, 43, "normal" + n.colourId), this.radian = Math.PI / 180, this.angle = 0, this.state = "held", this.skipBubble = null, this.isOnFire = !1, this.inc = 0, this.vx = 0, this.vy = 0, this.m = 1, this.f = 1, this.b = 1, this.oData = n, this.x = this.oData.x, this.y = this.oData.y + 10, this.p0 = {
  1107. x: this.x,
  1108. y: this.y
  1109. }, this.p1 = {
  1110. x: this.x,
  1111. y: this.y
  1112. }, this.offsetY = 10, this.canvasWidth = r, this.canvasHeight = i, this.updateFunc = this.updateHeld
  1113. }
  1114. return __extends(t, e), t.prototype.caught = function(e) {
  1115. this.state = "caught", this.isOnFire = !1, this.caughtBubble = e, this.updateFunc = this.updateCaught, this.setAnimType("loop", "normal" + this.oData.colourId), -1 == this.caughtBubble.movingDir && TweenLite.to(this, .7, {
  1116. x: this.caughtBubble.x,
  1117. y: this.caughtBubble.y,
  1118. ease: "Elastic.easeOut"
  1119. }), this.fps = 2
  1120. }, t.prototype.stung = function() {
  1121. this.state = "stung", this.isOnFire = !1, this.updateFunc = this.updateStung, this.setAnimType("loop", "stung")
  1122. }, t.prototype.thrown = function(e, t) {
  1123. this.rotation = Math.atan2(e - this.x, -(t - this.y)), this.state = "flying", this.p0 = {
  1124. x: this.x,
  1125. y: this.y
  1126. }, this.p1 = {
  1127. x: this.x,
  1128. y: this.y
  1129. }, this.vx = 4 * Math.cos(this.rotation - 90 * this.radian), this.vy = 4 * Math.sin(this.rotation - 90 * this.radian), this.updateFunc = this.updateFlying
  1130. }, t.prototype.release = function(e) {
  1131. TweenLite.killTweensOf(this), this.state = "flying", this.updateFunc = this.updateFlying, this.skipBubble = e, this.vx = 4 * Math.cos(this.rotation - 90 * this.radian), this.vy = 4 * Math.sin(this.rotation - 90 * this.radian), this.p0 = {
  1132. x: this.x,
  1133. y: this.y
  1134. }, this.p1 = {
  1135. x: this.x,
  1136. y: this.y
  1137. }, "fire" == e.oData.subType && (this.setAnimType("loop", "onFire"), this.fps = 10, this.isOnFire = !0)
  1138. }, t.prototype.update = function(e, t, n) {
  1139. this.updateFunc(e, t, n)
  1140. }, t.prototype.updateFlying = function(t, n, r) {
  1141. e.prototype.updateAnimation.call(this, r), this.vy = this.vy + 5 * r, this.angle = Math.atan2(this.vy, this.vx) + 90 * this.radian, this.angle - this.rotation > 180 * this.radian ? this.angle -= 360 * this.radian : this.angle - this.rotation < -180 * this.radian && (this.angle += 360 * this.radian), this.rotation -= 60 * ((this.rotation - this.angle) / 5) * r, this.y > this.canvasHeight + 100 && (this.removeMe = !0)
  1142. }, t.prototype.updateStung = function(t, n, r) {
  1143. e.prototype.updateAnimation.call(this, r), this.vy = this.vy + 5 * r, this.y += this.vy, this.rotation += this.vy / 100, this.y > this.canvasHeight + 100 && (this.removeMe = !0)
  1144. }, t.prototype.updateCaught = function(t, n, r) {
  1145. e.prototype.updateAnimation.call(this, r), -1 != this.caughtBubble.movingDir && (this.x = this.caughtBubble.x, this.y = this.caughtBubble.y)
  1146. }, t.prototype.updateHeld = function(t, n, r) {
  1147. e.prototype.updateAnimation.call(this, r), this.x = t, this.y -= (this.y - n + 20) / 5, this.inc += r, this.rotation = Math.sin(20 * this.inc) / 5
  1148. }, t
  1149. }(Utils.AnimSprite);
  1150. e.Fish = t
  1151. }(Elements || (Elements = {}));
  1152. var Elements;
  1153. ! function(e) {
  1154. var t = function(e) {
  1155. function t(t, n, r, i, s) {
  1156. e.call(this, t, 20, 20, r.subType), this.state = "normal", this.movingDir = -1, this.isBiggerX = !0, this.vx = 0, this.vy = 0, this.m = 1, this.f = 1, this.b = 1, this.oData = r, this.subType = r.subType, this.offsetY = -24, this.offsetX = 2, this.frameInc = Math.ceil(10 * Math.random()), this.x = this.oData.p0.x, this.y = this.oData.p0.y, this.p0 = this.oData.p0, this.p1 = this.oData.p1, (this.p0.x != this.p1.x || this.p0.y != this.p1.y) && (this.movingDir = 0), Math.abs(this.p0.x - this.p1.x) < Math.abs(this.p0.y - this.p1.y) && (this.isBiggerX = !1), this.id = n, this.canvasWidth = i, this.canvasHeight = s
  1157. }
  1158. return __extends(t, e), t.prototype.changeState = function(e, t) {
  1159. switch (this.state = e, this.state) {
  1160. case "holding":
  1161. this.setAnimType("loop", this.state);
  1162. break;
  1163. case "caught":
  1164. this.caughtFish = t.caughtFish, "normal" == this.subType ? (this.animEndedFunc = function() {
  1165. this.changeState("holding")
  1166. }, this.setAnimType("once", this.state)) : "fire" == this.subType;
  1167. break;
  1168. case "normal":
  1169. this.setAnimType("loop", this.state), this.subType = "normal"
  1170. }
  1171. }, t.prototype.update = function(t) {
  1172. e.prototype.updateAnimation.call(this, t), 0 == this.movingDir ? (this.x -= (this.p0.x - this.p1.x) / 3 * t, this.y -= (this.p0.y - this.p1.y) / 3 * t, this.isBiggerX ? (this.p0.x < this.p1.x && this.x > this.p1.x || this.p1.x < this.p0.x && this.x < this.p1.x) && (this.movingDir = 1) : (this.p0.y < this.p1.y && this.y > this.p1.y || this.p1.y < this.p0.y && this.y < this.p1.y) && (this.movingDir = 1)) : 1 == this.movingDir && (this.x += (this.p0.x - this.p1.x) / 3 * t, this.y += (this.p0.y - this.p1.y) / 3 * t, this.isBiggerX ? (this.p0.x < this.p1.x && this.x < this.p0.x || this.p1.x < this.p0.x && this.x > this.p0.x) && (this.movingDir = 0) : (this.p0.y < this.p1.y && this.y < this.p0.y || this.p1.y < this.p0.y && this.y > this.p0.y) && (this.movingDir = 0))
  1173. }, t
  1174. }(Utils.AnimSprite);
  1175. e.Bubble = t
  1176. }(Elements || (Elements = {}));
  1177. var Elements;
  1178. ! function(e) {
  1179. var t = function(e) {
  1180. function t(t, n, r, i) {
  1181. e.call(this, t, 24, 15, "ambient"), this.acc = 0, this.targX = 0, this.isMoving = !1, this.rightPull = 0, this.leftPull = 0, this.oBaseImgData = t, this.oData = n, this.offsetY = -20, this.x = this.oData.x, this.y = this.oData.y, this.canvasWidth = r, this.canvasHeight = i
  1182. }
  1183. return __extends(t, e), t.prototype.update = function(t) {
  1184. e.prototype.updateAnimation.call(this, t), this.isMoving ? this.acc = Math.max(Math.min((this.targX - this.x) / 10, 4), -4) : this.acc *= .5, this.x += 60 * this.acc * t
  1185. }, t.prototype.startMoving = function(e) {
  1186. this.targX = Math.max(Math.min(e, 308), 75), this.isMoving = !0, e > this.x && "walkRight" != this.animId ? this.setAnimType("loop", "walkRight") : e < this.x && "walkLeft" != this.animId && this.setAnimType("loop", "walkLeft")
  1187. }, t.prototype.throwFish = function() {
  1188. this.animEndedFunc = function() {
  1189. this.stopMoving()
  1190. }, this.setAnimType("once", "throwFish")
  1191. }, t.prototype.stopMoving = function() {
  1192. this.isMoving = !1, this.setAnimType("loop", "ambient")
  1193. }, t
  1194. }(Utils.AnimSprite);
  1195. e.Base = t
  1196. }(Elements || (Elements = {}));
  1197. var Elements;
  1198. ! function(e) {
  1199. var t = function(e) {
  1200. function t(t, n, r, i) {
  1201. e.call(this, t, 0, 0), this.radian = Math.PI / 180, this.oData = n, this.x = (this.oData.p1.x - this.oData.p0.x) / 2 + this.oData.p0.x, this.y = (this.oData.p1.y - this.oData.p0.y) / 2 + this.oData.p0.y, this.rotation = Math.atan2(this.oData.p1.x - this.oData.p0.x, -(this.oData.p1.y - this.oData.p0.y)) - 90 * this.radian, this.canvasWidth = r, this.canvasHeight = i
  1202. }
  1203. return __extends(t, e), t
  1204. }(Utils.BasicSprite);
  1205. e.Log = t
  1206. }(Elements || (Elements = {}));
  1207. var Utils;
  1208. ! function(e) {
  1209. var t = function() {
  1210. function e(e, t) {
  1211. this.aLines = new Array, this.aFishes = new Array, this.aBalls = new Array, this.aLines = e, this.defrostBubble = t, this.inc = 1;
  1212. for (var n = 0; n < this.aLines.length; n++) this.updateVector(this.aLines[n], null, !0)
  1213. }
  1214. return e.prototype.drawAll = function(e) {
  1215. for (var t = 0; t < this.aFishes.length; t++)
  1216. if ("flying" == this.aFishes[t].state) {
  1217. var n = this.aFishes[t];
  1218. n.x = n.p1.x, n.y = n.p1.y, n.p0 = n.p1, this.updateVector(n, e)
  1219. }
  1220. }, e.prototype.update = function(e) {
  1221. var t;
  1222. for (t = 0; t < this.aFishes.length; t++)
  1223. if ("flying" == this.aFishes[t].state) {
  1224. var n = this.aFishes[t];
  1225. this.updateVector(n, e);
  1226. for (var r = 0; r < this.aLines.length; r++) {
  1227. this.fi = this.findIntersection(n, this.aLines[r]), this.updateVector(this.fi, e, !1);
  1228. var i = n.radius - this.fi.len;
  1229. if (i >= 0) {
  1230. "ice" == this.aLines[r].subType ? this.aFishes[t].isOnFire ? this.defrostBubble(this.aLines[r].id) : playSound("hitIce") : playSound("hitSide"), n.p1.x += this.fi.dx * i, n.p1.y += this.fi.dy * i;
  1231. var s = {
  1232. dx: this.fi.lx,
  1233. dy: this.fi.ly,
  1234. lx: this.fi.dx,
  1235. ly: this.fi.dy,
  1236. b: 1,
  1237. f: 1
  1238. },
  1239. o = this.bounce(n, s);
  1240. n.vx = o.vx, n.vy = o.vy
  1241. }
  1242. }
  1243. }
  1244. this.drawAll(e)
  1245. }, e.prototype.updateVector = function(e, t, n) {
  1246. "undefined" == typeof n && (n = !1), null == t && (t = .016), 1 == n ? (e.vx = e.p1.x - e.p0.x, e.vy = e.p1.y - e.p0.y) : (e.p1.x = e.p0.x + 60 * e.vx * t, e.p1.y = e.p0.y + 60 * e.vy * t), this.makeVector(e)
  1247. }, e.prototype.makeVector = function(e) {
  1248. e.len = Math.sqrt(e.vx * e.vx + e.vy * e.vy), e.len > 0 ? (e.dx = e.vx / e.len, e.dy = e.vy / e.len) : (e.dx = 0, e.dy = 0), e.rx = -e.dy, e.ry = e.dx, e.lx = e.dy, e.ly = -e.dx
  1249. }, e.prototype.dotP = function(e, t) {
  1250. var n = e.vx * t.vx + e.vy * t.vy;
  1251. return n
  1252. }, e.prototype.projectVector = function(e, t, n) {
  1253. var r = e.vx * t + e.vy * n,
  1254. i = {};
  1255. return i.vx = r * t, i.vy = r * n, i
  1256. }, e.prototype.bounceBalls = function(e, t, n) {
  1257. var r = this.projectVector(e, n.dx, n.dy),
  1258. i = this.projectVector(e, n.lx, n.ly),
  1259. s = this.projectVector(t, n.dx, n.dy),
  1260. o = this.projectVector(t, n.lx, n.ly),
  1261. u = e.m * r.vx + t.m * s.vx,
  1262. a = r.vx - s.vx,
  1263. f = (u + a * e.m) / (e.m + t.m),
  1264. l = f - a;
  1265. u = e.m * r.vy + t.m * s.vy, a = r.vy - s.vy;
  1266. var c = (u + a * e.m) / (e.m + t.m),
  1267. h = c - a,
  1268. p = {};
  1269. return p.vx1 = i.vx + l, p.vy1 = i.vy + h, p.vx2 = o.vx + f, p.vy2 = o.vy + c, p
  1270. }, e.prototype.bounce = function(e, t) {
  1271. var n = this.projectVector(e, t.dx, t.dy),
  1272. r = this.projectVector(e, t.lx, t.ly),
  1273. i = {};
  1274. return r.len = Math.sqrt(r.vx * r.vx + r.vy * r.vy), r.vx = t.lx * r.len, r.vy = t.ly * r.len, i.vx = e.f * t.f * n.vx + e.b * t.b * r.vx, i.vy = e.f * t.f * n.vy + e.b * t.b * r.vy, i
  1275. }, e.prototype.findIntersection = function(e, t) {
  1276. var n = {},
  1277. r = {};
  1278. r.vx = e.p1.x - t.p0.x, r.vy = e.p1.y - t.p0.y;
  1279. var i = r.vx * t.dx + r.vy * t.dy;
  1280. if (0 > i) n = r;
  1281. else {
  1282. var s = {};
  1283. s.vx = e.p1.x - t.p1.x, s.vy = e.p1.y - t.p1.y, i = s.vx * t.dx + s.vy * t.dy, n = i > 0 ? s : this.projectVector(r, t.lx, t.ly)
  1284. }
  1285. return n.p0 = {
  1286. x: 0,
  1287. y: 0
  1288. }, n.p1 = {
  1289. x: 0,
  1290. y: 0
  1291. }, n
  1292. }, e
  1293. }();
  1294. e.Physics2D = t
  1295. }(Utils || (Utils = {}));
  1296. var requestAnimFrame = function() {
  1297. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e) {
  1298. window.setTimeout(e, 1e3 / 60, (new Date).getTime())
  1299. }
  1300. }(),
  1301. previousTime, canvas = document.getElementById("canvas"),
  1302. ctx = canvas.getContext("2d");
  1303. canvas.width = 383, canvas.height = 550;
  1304. var canvasX, canvasY, canvasScaleX, canvasScaleY, div = document.getElementById("viewporter"),
  1305. sound, music, audioType = 0,
  1306. muted = !1,
  1307. splash, splashTimer = 0,
  1308. assetLib, preAssetLib, rotatePause = !1,
  1309. manualPause = !1,
  1310. isMobile = !1,
  1311. gameState = "loading",
  1312. aLangs = new Array("EN"),
  1313. curLang = "",
  1314. isBugBrowser = !1,
  1315. spilAPI, oLogoData = {},
  1316. oMoreGamesData = {},
  1317. isIE10 = !1;
  1318. navigator.userAgent.match(/MSIE\s([\d]+)/) && (isIE10 = !0);
  1319. var deviceAgent = navigator.userAgent.toLowerCase();
  1320. (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));
  1321. var userInput = new Utils.UserInput(canvas, isBugBrowser);
  1322. resizeCanvas(), window.onresize = function() {
  1323. setTimeout(function() {
  1324. resizeCanvas()
  1325. }, 1)
  1326. }, document.addEventListener("visibilitychange", function() {
  1327. document.hidden ? Howler.mute() : muted || Howler.unmute()
  1328. }, !1), window.addEventListener("load", function() {
  1329. setTimeout(function() {
  1330. resizeCanvas()
  1331. }, 0), window.addEventListener("orientationchange", function() {
  1332. resizeCanvas()
  1333. }, !1), GameAPI.loadAPI(function(e) {
  1334. spilAPI = e;
  1335. if (spilAPI.Branding.getLogo().image) {
  1336. oLogoData = spilAPI.Branding.getLogo()
  1337. } else {
  1338. oLogoData = spilAPI.Branding.getLogo();
  1339. oLogoData.image = "images/blank.png"
  1340. }
  1341. oMoreGamesData = spilAPI.Branding.getLink("more_games");
  1342. curLang = aLangs[0], loadAssets()
  1343. }, {
  1344. id: "576742227280291504"
  1345. })
  1346. }), isIE10 || "undefined" == typeof window.AudioContext && "undefined" == typeof window.webkitAudioContext && -1 != navigator.userAgent.indexOf("Android") ? audioType = 0 : (audioType = 1, sound = new Howl({
  1347. urls: ["audio/sound.ogg", "audio/sound.m4a"],
  1348. sprite: {
  1349. bubbleLand1: [0, 350],
  1350. bubbleLand2: [500, 350],
  1351. bubbleLand3: [1e3, 350],
  1352. bubbleLand4: [1500, 350],
  1353. crabThrow: [2e3, 750],
  1354. hitJellyfish: [3e3, 850],
  1355. hitIce: [4e3, 350],
  1356. breakIce: [4500, 800],
  1357. launchFire: [5500, 800],
  1358. hitSide: [6500, 500],
  1359. newFish: [7500, 1750],
  1360. levelComplete: [9500, 2e3],
  1361. click: [12e3, 350]
  1362. }
  1363. }), music = new Howl({
  1364. urls: ["audio/music.ogg", "audio/music.m4a"],
  1365. volume: .25,
  1366. loop: !0
  1367. }));
  1368. var panel, hud, background, levelScore = 0,
  1369. levelNum = 0,
  1370. aLevelUps, bonusScore, aTutorials = new Array({
  1371. levelNum: 0,
  1372. shown: !1,
  1373. panelType: "tutorial0"
  1374. }, {
  1375. levelNum: 2,
  1376. shown: !1,
  1377. panelType: "tutorial1"
  1378. }, {
  1379. levelNum: 4,
  1380. shown: !1,
  1381. panelType: "tutorial2"
  1382. }, {
  1383. levelNum: 11,
  1384. shown: !1,
  1385. panelType: "tutorial3"
  1386. }),
  1387. panelFrame, aBubbles, aFishes, aLogs, physics2D, base, fishCaught, fishColourInc = 0,
  1388. levelCompleteTimer = -1,
  1389. tutorialIsOn, levelButsPage = 0,
  1390. levelThrows, bubbleTarg, oLogoBut, aLevelData = new Array([{
  1391. type: "bubble",
  1392. p0: {
  1393. x: 192,
  1394. y: 318
  1395. },
  1396. p1: {
  1397. x: 192,
  1398. y: 318
  1399. },
  1400. subType: "normal"
  1401. }], [{
  1402. type: "line",
  1403. p0: {
  1404. x: 0,
  1405. y: 0
  1406. },
  1407. p1: {
  1408. x: 275,
  1409. y: 145
  1410. },
  1411. subType: "log"
  1412. }, {
  1413. type: "bubble",
  1414. p0: {
  1415. x: 292,
  1416. y: 338
  1417. },
  1418. p1: {
  1419. x: 292,
  1420. y: 338
  1421. },
  1422. subType: "normal"
  1423. }, {
  1424. type: "bubble",
  1425. p0: {
  1426. x: 92,
  1427. y: 338
  1428. },
  1429. p1: {
  1430. x: 92,
  1431. y: 338
  1432. },
  1433. subType: "normal"
  1434. }, {
  1435. type: "bubble",
  1436. p0: {
  1437. x: 192,
  1438. y: 308
  1439. },
  1440. p1: {
  1441. x: 192,
  1442. y: 308
  1443. },
  1444. subType: "normal"
  1445. }], [{
  1446. type: "bubble",
  1447. p0: {
  1448. x: 192,
  1449. y: 223
  1450. },
  1451. p1: {
  1452. x: 192,
  1453. y: 223
  1454. },
  1455. subType: "normal"
  1456. }, {
  1457. type: "bubble",
  1458. p0: {
  1459. x: 192,
  1460. y: 336
  1461. },
  1462. p1: {
  1463. x: 192,
  1464. y: 336
  1465. },
  1466. subType: "normal"
  1467. }], [{
  1468. type: "bubble",
  1469. p0: {
  1470. x: 192,
  1471. y: 112
  1472. },
  1473. p1: {
  1474. x: 192,
  1475. y: 112
  1476. },
  1477. subType: "normal"
  1478. }, {
  1479. type: "bubble",
  1480. p0: {
  1481. x: 192,
  1482. y: 223
  1483. },
  1484. p1: {
  1485. x: 192,
  1486. y: 223
  1487. },
  1488. subType: "normal"
  1489. }, {
  1490. type: "bubble",
  1491. p0: {
  1492. x: 192,
  1493. y: 336
  1494. },
  1495. p1: {
  1496. x: 192,
  1497. y: 336
  1498. },
  1499. subType: "normal"
  1500. }], [{
  1501. type: "bubble",
  1502. p0: {
  1503. x: 293,
  1504. y: 239
  1505. },
  1506. p1: {
  1507. x: 293,
  1508. y: 239
  1509. },
  1510. subType: "normal"
  1511. }, {
  1512. type: "bubble",
  1513. p0: {
  1514. x: 197,
  1515. y: 344
  1516. },
  1517. p1: {
  1518. x: 197,
  1519. y: 344
  1520. },
  1521. subType: "normal"
  1522. }], [{
  1523. type: "bubble",
  1524. p0: {
  1525. x: 126,
  1526. y: 249
  1527. },
  1528. p1: {
  1529. x: 218,
  1530. y: 277
  1531. },
  1532. subType: "normal"
  1533. }, {
  1534. type: "line",
  1535. p0: {
  1536. x: 514,
  1537. y: 130
  1538. },
  1539. p1: {
  1540. x: 323,
  1541. y: 192
  1542. },
  1543. subType: "log"
  1544. }, {
  1545. type: "line",
  1546. p0: {
  1547. x: -166,
  1548. y: 211
  1549. },
  1550. p1: {
  1551. x: 28,
  1552. y: 261
  1553. },
  1554. subType: "log"
  1555. }, {
  1556. type: "bubble",
  1557. p0: {
  1558. x: 64,
  1559. y: 199
  1560. },
  1561. p1: {
  1562. x: 64,
  1563. y: 199
  1564. },
  1565. subType: "normal"
  1566. }, {
  1567. type: "bubble",
  1568. p0: {
  1569. x: 259,
  1570. y: 174
  1571. },
  1572. p1: {
  1573. x: 259,
  1574. y: 174
  1575. },
  1576. subType: "normal"
  1577. }, {
  1578. type: "bubble",
  1579. p0: {
  1580. x: 298,
  1581. y: 263
  1582. },
  1583. p1: {
  1584. x: 298,
  1585. y: 263
  1586. },
  1587. subType: "normal"
  1588. }, {
  1589. type: "bubble",
  1590. p0: {
  1591. x: 166,
  1592. y: 160
  1593. },
  1594. p1: {
  1595. x: 166,
  1596. y: 160
  1597. },
  1598. subType: "normal"
  1599. }, {
  1600. type: "bubble",
  1601. p0: {
  1602. x: 67,
  1603. y: 325
  1604. },
  1605. p1: {
  1606. x: 67,
  1607. y: 325
  1608. },
  1609. subType: "normal"
  1610. }, {
  1611. type: "bubble",
  1612. p0: {
  1613. x: 280,
  1614. y: 350
  1615. },
  1616. p1: {
  1617. x: 280,
  1618. y: 350
  1619. },
  1620. subType: "normal"
  1621. }, {
  1622. type: "bubble",
  1623. p0: {
  1624. x: 163,
  1625. y: 356
  1626. },
  1627. p1: {
  1628. x: 163,
  1629. y: 356
  1630. },
  1631. subType: "normal"
  1632. }], [{
  1633. type: "bubble",
  1634. p0: {
  1635. x: 331,
  1636. y: 250
  1637. },
  1638. p1: {
  1639. x: 331,
  1640. y: 250
  1641. },
  1642. subType: "normal"
  1643. }, {
  1644. type: "bubble",
  1645. p0: {
  1646. x: 289,
  1647. y: 345
  1648. },
  1649. p1: {
  1650. x: 289,
  1651. y: 345
  1652. },
  1653. subType: "normal"
  1654. }, {
  1655. type: "line",
  1656. p0: {
  1657. x: -63,
  1658. y: 174
  1659. },
  1660. p1: {
  1661. x: 88,
  1662. y: 304
  1663. },
  1664. subType: "log"
  1665. }, {
  1666. type: "bubble",
  1667. p0: {
  1668. x: 152,
  1669. y: 230
  1670. },
  1671. p1: {
  1672. x: 152,
  1673. y: 230
  1674. },
  1675. subType: "normal"
  1676. }, {
  1677. type: "bubble",
  1678. p0: {
  1679. x: 40,
  1680. y: 143
  1681. },
  1682. p1: {
  1683. x: 343,
  1684. y: 143
  1685. },
  1686. subType: "normal"
  1687. }, {
  1688. type: "bubble",
  1689. p0: {
  1690. x: 192,
  1691. y: 328
  1692. },
  1693. p1: {
  1694. x: 192,
  1695. y: 328
  1696. },
  1697. subType: "normal"
  1698. }], [{
  1699. type: "line",
  1700. p0: {
  1701. x: 168,
  1702. y: 43
  1703. },
  1704. p1: {
  1705. x: 364,
  1706. y: 1
  1707. },
  1708. subType: "log"
  1709. }, {
  1710. type: "bubble",
  1711. p0: {
  1712. x: 192,
  1713. y: 173
  1714. },
  1715. p1: {
  1716. x: 192,
  1717. y: 173
  1718. },
  1719. subType: "normal"
  1720. }, {
  1721. type: "bubble",
  1722. p0: {
  1723. x: 192,
  1724. y: 293
  1725. },
  1726. p1: {
  1727. x: 192,
  1728. y: 293
  1729. },
  1730. subType: "normal"
  1731. }, {
  1732. type: "bubble",
  1733. p0: {
  1734. x: 40,
  1735. y: 113
  1736. },
  1737. p1: {
  1738. x: 343,
  1739. y: 113
  1740. },
  1741. subType: "normal"
  1742. }, {
  1743. type: "bubble",
  1744. p0: {
  1745. x: 343,
  1746. y: 233
  1747. },
  1748. p1: {
  1749. x: 40,
  1750. y: 233
  1751. },
  1752. subType: "normal"
  1753. }, {
  1754. type: "bubble",
  1755. p0: {
  1756. x: 40,
  1757. y: 353
  1758. },
  1759. p1: {
  1760. x: 343,
  1761. y: 353
  1762. },
  1763. subType: "normal"
  1764. }], [{
  1765. type: "bubble",
  1766. p0: {
  1767. x: 186,
  1768. y: 250
  1769. },
  1770. p1: {
  1771. x: 186,
  1772. y: 250
  1773. },
  1774. subType: "normal"
  1775. }, {
  1776. type: "bubble",
  1777. p0: {
  1778. x: 237,
  1779. y: 304
  1780. },
  1781. p1: {
  1782. x: 237,
  1783. y: 304
  1784. },
  1785. subType: "normal"
  1786. }, {
  1787. type: "bubble",
  1788. p0: {
  1789. x: 131,
  1790. y: 304
  1791. },
  1792. p1: {
  1793. x: 131,
  1794. y: 304
  1795. },
  1796. subType: "normal"
  1797. }, {
  1798. type: "bubble",
  1799. p0: {
  1800. x: 85,
  1801. y: 367
  1802. },
  1803. p1: {
  1804. x: 285,
  1805. y: 367
  1806. },
  1807. subType: "jellyfish"
  1808. }], [{
  1809. type: "bubble",
  1810. p0: {
  1811. x: 87,
  1812. y: 104
  1813. },
  1814. p1: {
  1815. x: 87,
  1816. y: 104
  1817. },
  1818. subType: "normal"
  1819. }, {
  1820. type: "bubble",
  1821. p0: {
  1822. x: 86,
  1823. y: 235
  1824. },
  1825. p1: {
  1826. x: 86,
  1827. y: 235
  1828. },
  1829. subType: "normal"
  1830. }, {
  1831. type: "bubble",
  1832. p0: {
  1833. x: 83,
  1834. y: 363
  1835. },
  1836. p1: {
  1837. x: 83,
  1838. y: 363
  1839. },
  1840. subType: "normal"
  1841. }, {
  1842. type: "bubble",
  1843. p0: {
  1844. x: 297,
  1845. y: 104
  1846. },
  1847. p1: {
  1848. x: 297,
  1849. y: 104
  1850. },
  1851. subType: "normal"
  1852. }, {
  1853. type: "bubble",
  1854. p0: {
  1855. x: 296,
  1856. y: 235
  1857. },
  1858. p1: {
  1859. x: 296,
  1860. y: 235
  1861. },
  1862. subType: "normal"
  1863. }, {
  1864. type: "bubble",
  1865. p0: {
  1866. x: 293,
  1867. y: 363
  1868. },
  1869. p1: {
  1870. x: 293,
  1871. y: 363
  1872. },
  1873. subType: "normal"
  1874. }, {
  1875. type: "bubble",
  1876. p0: {
  1877. x: 300,
  1878. y: 169
  1879. },
  1880. p1: {
  1881. x: 80,
  1882. y: 171
  1883. },
  1884. subType: "jellyfish"
  1885. }, {
  1886. type: "bubble",
  1887. p0: {
  1888. x: 187,
  1889. y: 104
  1890. },
  1891. p1: {
  1892. x: 187,
  1893. y: 104
  1894. },
  1895. subType: "normal"
  1896. }, {
  1897. type: "bubble",
  1898. p0: {
  1899. x: 186,
  1900. y: 235
  1901. },
  1902. p1: {
  1903. x: 186,
  1904. y: 235
  1905. },
  1906. subType: "normal"
  1907. }, {
  1908. type: "bubble",
  1909. p0: {
  1910. x: 183,
  1911. y: 363
  1912. },
  1913. p1: {
  1914. x: 183,
  1915. y: 363
  1916. },
  1917. subType: "normal"
  1918. }, {
  1919. type: "bubble",
  1920. p0: {
  1921. x: 73,
  1922. y: 301
  1923. },
  1924. p1: {
  1925. x: 293,
  1926. y: 299
  1927. },
  1928. subType: "jellyfish"
  1929. }], [{
  1930. type: "bubble",
  1931. p0: {
  1932. x: 118,
  1933. y: 236
  1934. },
  1935. p1: {
  1936. x: 204,
  1937. y: 236
  1938. },
  1939. subType: "jellyfish"
  1940. }, {
  1941. type: "bubble",
  1942. p0: {
  1943. x: 52,
  1944. y: 195
  1945. },
  1946. p1: {
  1947. x: 52,
  1948. y: 195
  1949. },
  1950. subType: "normal"
  1951. }, {
  1952. type: "bubble",
  1953. p0: {
  1954. x: 52,
  1955. y: 284
  1956. },
  1957. p1: {
  1958. x: 52,
  1959. y: 284
  1960. },
  1961. subType: "normal"
  1962. }, {
  1963. type: "bubble",
  1964. p0: {
  1965. x: 49,
  1966. y: 103
  1967. },
  1968. p1: {
  1969. x: 334,
  1970. y: 207
  1971. },
  1972. subType: "normal"
  1973. }, {
  1974. type: "bubble",
  1975. p0: {
  1976. x: 49,
  1977. y: 367
  1978. },
  1979. p1: {
  1980. x: 334,
  1981. y: 263
  1982. },
  1983. subType: "normal"
  1984. }], [{
  1985. type: "bubble",
  1986. p0: {
  1987. x: 201,
  1988. y: 246
  1989. },
  1990. p1: {
  1991. x: 201,
  1992. y: 246
  1993. },
  1994. subType: "ice"
  1995. }, {
  1996. type: "bubble",
  1997. p0: {
  1998. x: 121,
  1999. y: 298
  2000. },
  2001. p1: {
  2002. x: 121,
  2003. y: 298
  2004. },
  2005. subType: "ice"
  2006. }, {
  2007. type: "bubble",
  2008. p0: {
  2009. x: 260,
  2010. y: 324
  2011. },
  2012. p1: {
  2013. x: 260,
  2014. y: 324
  2015. },
  2016. subType: "ice"
  2017. }, {
  2018. type: "bubble",
  2019. p0: {
  2020. x: 182,
  2021. y: 372
  2022. },
  2023. p1: {
  2024. x: 182,
  2025. y: 372
  2026. },
  2027. subType: "fire"
  2028. }], [{
  2029. type: "bubble",
  2030. p0: {
  2031. x: 195,
  2032. y: 98
  2033. },
  2034. p1: {
  2035. x: 195,
  2036. y: 98
  2037. },
  2038. subType: "normal"
  2039. }, {
  2040. type: "bubble",
  2041. p0: {
  2042. x: 194,
  2043. y: 215
  2044. },
  2045. p1: {
  2046. x: 194,
  2047. y: 215
  2048. },
  2049. subType: "normal"
  2050. }, {
  2051. type: "bubble",
  2052. p0: {
  2053. x: 332,
  2054. y: 115
  2055. },
  2056. p1: {
  2057. x: 332,
  2058. y: 115
  2059. },
  2060. subType: "normal"
  2061. }, {
  2062. type: "bubble",
  2063. p0: {
  2064. x: 62,
  2065. y: 115
  2066. },
  2067. p1: {
  2068. x: 62,
  2069. y: 115
  2070. },
  2071. subType: "normal"
  2072. }, {
  2073. type: "bubble",
  2074. p0: {
  2075. x: 272,
  2076. y: 218
  2077. },
  2078. p1: {
  2079. x: 272,
  2080. y: 218
  2081. },
  2082. subType: "ice"
  2083. }, {
  2084. type: "bubble",
  2085. p0: {
  2086. x: 122,
  2087. y: 218
  2088. },
  2089. p1: {
  2090. x: 122,
  2091. y: 218
  2092. },
  2093. subType: "ice"
  2094. }, {
  2095. type: "bubble",
  2096. p0: {
  2097. x: 192,
  2098. y: 339
  2099. },
  2100. p1: {
  2101. x: 192,
  2102. y: 339
  2103. },
  2104. subType: "fire"
  2105. }], [{
  2106. type: "bubble",
  2107. p0: {
  2108. x: 191,
  2109. y: 362
  2110. },
  2111. p1: {
  2112. x: 191,
  2113. y: 362
  2114. },
  2115. subType: "normal"
  2116. }, {
  2117. type: "bubble",
  2118. p0: {
  2119. x: 85,
  2120. y: 365
  2121. },
  2122. p1: {
  2123. x: 85,
  2124. y: 365
  2125. },
  2126. subType: "normal"
  2127. }, {
  2128. type: "bubble",
  2129. p0: {
  2130. x: 298,
  2131. y: 220
  2132. },
  2133. p1: {
  2134. x: 298,
  2135. y: 220
  2136. },
  2137. subType: "normal"
  2138. }, {
  2139. type: "bubble",
  2140. p0: {
  2141. x: 344,
  2142. y: 283
  2143. },
  2144. p1: {
  2145. x: 344,
  2146. y: 283
  2147. },
  2148. subType: "normal"
  2149. }, {
  2150. type: "bubble",
  2151. p0: {
  2152. x: 241,
  2153. y: 287
  2154. },
  2155. p1: {
  2156. x: 241,
  2157. y: 287
  2158. },
  2159. subType: "normal"
  2160. }, {
  2161. type: "bubble",
  2162. p0: {
  2163. x: 341,
  2164. y: 139
  2165. },
  2166. p1: {
  2167. x: 341,
  2168. y: 139
  2169. },
  2170. subType: "fire"
  2171. }, {
  2172. type: "bubble",
  2173. p0: {
  2174. x: 34,
  2175. y: 250
  2176. },
  2177. p1: {
  2178. x: 34,
  2179. y: 250
  2180. },
  2181. subType: "ice"
  2182. }, {
  2183. type: "bubble",
  2184. p0: {
  2185. x: 289,
  2186. y: 348
  2187. },
  2188. p1: {
  2189. x: 289,
  2190. y: 348
  2191. },
  2192. subType: "normal"
  2193. }, {
  2194. type: "line",
  2195. p0: {
  2196. x: 129,
  2197. y: 320
  2198. },
  2199. p1: {
  2200. x: 254,
  2201. y: 164
  2202. },
  2203. subType: "log"
  2204. }], [{
  2205. type: "bubble",
  2206. p0: {
  2207. x: 83,
  2208. y: 359
  2209. },
  2210. p1: {
  2211. x: 83,
  2212. y: 359
  2213. },
  2214. subType: "normal"
  2215. }, {
  2216. type: "bubble",
  2217. p0: {
  2218. x: 52,
  2219. y: 224
  2220. },
  2221. p1: {
  2222. x: 52,
  2223. y: 224
  2224. },
  2225. subType: "normal"
  2226. }, {
  2227. type: "bubble",
  2228. p0: {
  2229. x: 315,
  2230. y: 355
  2231. },
  2232. p1: {
  2233. x: 315,
  2234. y: 355
  2235. },
  2236. subType: "normal"
  2237. }, {
  2238. type: "bubble",
  2239. p0: {
  2240. x: 188,
  2241. y: 383
  2242. },
  2243. p1: {
  2244. x: 122,
  2245. y: 195
  2246. },
  2247. subType: "normal"
  2248. }, {
  2249. type: "bubble",
  2250. p0: {
  2251. x: 157,
  2252. y: 118
  2253. },
  2254. p1: {
  2255. x: 227,
  2256. y: 306
  2257. },
  2258. subType: "normal"
  2259. }, {
  2260. type: "bubble",
  2261. p0: {
  2262. x: 342,
  2263. y: 111
  2264. },
  2265. p1: {
  2266. x: 342,
  2267. y: 111
  2268. },
  2269. subType: "normal"
  2270. }, {
  2271. type: "bubble",
  2272. p0: {
  2273. x: 281,
  2274. y: 125
  2275. },
  2276. p1: {
  2277. x: 281,
  2278. y: 125
  2279. },
  2280. subType: "normal"
  2281. }, {
  2282. type: "bubble",
  2283. p0: {
  2284. x: 219,
  2285. y: 116
  2286. },
  2287. p1: {
  2288. x: 219,
  2289. y: 116
  2290. },
  2291. subType: "normal"
  2292. }, {
  2293. type: "bubble",
  2294. p0: {
  2295. x: 306,
  2296. y: 218
  2297. },
  2298. p1: {
  2299. x: 306,
  2300. y: 218
  2301. },
  2302. subType: "normal"
  2303. }, {
  2304. type: "bubble",
  2305. p0: {
  2306. x: 96,
  2307. y: 113
  2308. },
  2309. p1: {
  2310. x: 96,
  2311. y: 113
  2312. },
  2313. subType: "normal"
  2314. }, {
  2315. type: "bubble",
  2316. p0: {
  2317. x: 39,
  2318. y: 109
  2319. },
  2320. p1: {
  2321. x: 39,
  2322. y: 109
  2323. },
  2324. subType: "normal"
  2325. }], [{
  2326. type: "line",
  2327. p0: {
  2328. x: 183,
  2329. y: 16
  2330. },
  2331. p1: {
  2332. x: 366,
  2333. y: 96
  2334. },
  2335. subType: "log"
  2336. }, {
  2337. type: "line",
  2338. p0: {
  2339. x: -1,
  2340. y: 69
  2341. },
  2342. p1: {
  2343. x: 197,
  2344. y: 43
  2345. },
  2346. subType: "log"
  2347. }, {
  2348. type: "bubble",
  2349. p0: {
  2350. x: 272,
  2351. y: 129
  2352. },
  2353. p1: {
  2354. x: 272,
  2355. y: 129
  2356. },
  2357. subType: "ice"
  2358. }, {
  2359. type: "bubble",
  2360. p0: {
  2361. x: 100,
  2362. y: 132
  2363. },
  2364. p1: {
  2365. x: 100,
  2366. y: 132
  2367. },
  2368. subType: "ice"
  2369. }, {
  2370. type: "bubble",
  2371. p0: {
  2372. x: 189,
  2373. y: 222
  2374. },
  2375. p1: {
  2376. x: 189,
  2377. y: 222
  2378. },
  2379. subType: "fire"
  2380. }, {
  2381. type: "bubble",
  2382. p0: {
  2383. x: 324,
  2384. y: 273
  2385. },
  2386. p1: {
  2387. x: 324,
  2388. y: 273
  2389. },
  2390. subType: "normal"
  2391. }, {
  2392. type: "bubble",
  2393. p0: {
  2394. x: 280,
  2395. y: 322
  2396. },
  2397. p1: {
  2398. x: 280,
  2399. y: 322
  2400. },
  2401. subType: "normal"
  2402. }, {
  2403. type: "bubble",
  2404. p0: {
  2405. x: 217,
  2406. y: 346
  2407. },
  2408. p1: {
  2409. x: 217,
  2410. y: 346
  2411. },
  2412. subType: "normal"
  2413. }, {
  2414. type: "bubble",
  2415. p0: {
  2416. x: 156,
  2417. y: 344
  2418. },
  2419. p1: {
  2420. x: 156,
  2421. y: 344
  2422. },
  2423. subType: "normal"
  2424. }, {
  2425. type: "bubble",
  2426. p0: {
  2427. x: 104,
  2428. y: 320
  2429. },
  2430. p1: {
  2431. x: 104,
  2432. y: 320
  2433. },
  2434. subType: "normal"
  2435. }, {
  2436. type: "bubble",
  2437. p0: {
  2438. x: 60,
  2439. y: 280
  2440. },
  2441. p1: {
  2442. x: 60,
  2443. y: 280
  2444. },
  2445. subType: "normal"
  2446. }], [{
  2447. type: "bubble",
  2448. p0: {
  2449. x: 219,
  2450. y: 314
  2451. },
  2452. p1: {
  2453. x: 219,
  2454. y: 314
  2455. },
  2456. subType: "fire"
  2457. }, {
  2458. type: "bubble",
  2459. p0: {
  2460. x: 172,
  2461. y: 64
  2462. },
  2463. p1: {
  2464. x: 172,
  2465. y: 64
  2466. },
  2467. subType: "fire"
  2468. }, {
  2469. type: "bubble",
  2470. p0: {
  2471. x: 47,
  2472. y: 134
  2473. },
  2474. p1: {
  2475. x: 47,
  2476. y: 134
  2477. },
  2478. subType: "fire"
  2479. }, {
  2480. type: "bubble",
  2481. p0: {
  2482. x: 186,
  2483. y: 133
  2484. },
  2485. p1: {
  2486. x: 186,
  2487. y: 133
  2488. },
  2489. subType: "fire"
  2490. }, {
  2491. type: "bubble",
  2492. p0: {
  2493. x: 190,
  2494. y: 231
  2495. },
  2496. p1: {
  2497. x: 190,
  2498. y: 231
  2499. },
  2500. subType: "fire"
  2501. }, {
  2502. type: "bubble",
  2503. p0: {
  2504. x: 161,
  2505. y: 290
  2506. },
  2507. p1: {
  2508. x: 161,
  2509. y: 290
  2510. },
  2511. subType: "fire"
  2512. }, {
  2513. type: "bubble",
  2514. p0: {
  2515. x: 324,
  2516. y: 134
  2517. },
  2518. p1: {
  2519. x: 324,
  2520. y: 134
  2521. },
  2522. subType: "fire"
  2523. }, {
  2524. type: "bubble",
  2525. p0: {
  2526. x: 250,
  2527. y: 85
  2528. },
  2529. p1: {
  2530. x: 250,
  2531. y: 85
  2532. },
  2533. subType: "fire"
  2534. }, {
  2535. type: "bubble",
  2536. p0: {
  2537. x: 124,
  2538. y: 109
  2539. },
  2540. p1: {
  2541. x: 124,
  2542. y: 109
  2543. },
  2544. subType: "fire"
  2545. }, {
  2546. type: "bubble",
  2547. p0: {
  2548. x: 48,
  2549. y: 209
  2550. },
  2551. p1: {
  2552. x: 48,
  2553. y: 209
  2554. },
  2555. subType: "ice"
  2556. }, {
  2557. type: "bubble",
  2558. p0: {
  2559. x: 332,
  2560. y: 214
  2561. },
  2562. p1: {
  2563. x: 332,
  2564. y: 214
  2565. },
  2566. subType: "ice"
  2567. }, {
  2568. type: "line",
  2569. p0: {
  2570. x: 305,
  2571. y: 359
  2572. },
  2573. p1: {
  2574. x: 248,
  2575. y: 168
  2576. },
  2577. subType: "log"
  2578. }, {
  2579. type: "line",
  2580. p0: {
  2581. x: 71,
  2582. y: 358
  2583. },
  2584. p1: {
  2585. x: 135,
  2586. y: 169
  2587. },
  2588. subType: "log"
  2589. }], [{
  2590. type: "bubble",
  2591. p0: {
  2592. x: 50,
  2593. y: 260
  2594. },
  2595. p1: {
  2596. x: 50,
  2597. y: 260
  2598. },
  2599. subType: "fire"
  2600. }, {
  2601. type: "bubble",
  2602. p0: {
  2603. x: 337,
  2604. y: 137
  2605. },
  2606. p1: {
  2607. x: 236,
  2608. y: 78
  2609. },
  2610. subType: "normal"
  2611. }, {
  2612. type: "bubble",
  2613. p0: {
  2614. x: 236,
  2615. y: 153
  2616. },
  2617. p1: {
  2618. x: 337,
  2619. y: 211
  2620. },
  2621. subType: "normal"
  2622. }, {
  2623. type: "bubble",
  2624. p0: {
  2625. x: 180,
  2626. y: 286
  2627. },
  2628. p1: {
  2629. x: 180,
  2630. y: 286
  2631. },
  2632. subType: "fire"
  2633. }, {
  2634. type: "bubble",
  2635. p0: {
  2636. x: 106,
  2637. y: 326
  2638. },
  2639. p1: {
  2640. x: 106,
  2641. y: 326
  2642. },
  2643. subType: "fire"
  2644. }, {
  2645. type: "bubble",
  2646. p0: {
  2647. x: 264,
  2648. y: 247
  2649. },
  2650. p1: {
  2651. x: 264,
  2652. y: 247
  2653. },
  2654. subType: "ice"
  2655. }, {
  2656. type: "bubble",
  2657. p0: {
  2658. x: 108,
  2659. y: 183
  2660. },
  2661. p1: {
  2662. x: 108,
  2663. y: 183
  2664. },
  2665. subType: "ice"
  2666. }, {
  2667. type: "bubble",
  2668. p0: {
  2669. x: 33,
  2670. y: 164
  2671. },
  2672. p1: {
  2673. x: 33,
  2674. y: 164
  2675. },
  2676. subType: "ice"
  2677. }, {
  2678. type: "bubble",
  2679. p0: {
  2680. x: 192,
  2681. y: 209
  2682. },
  2683. p1: {
  2684. x: 192,
  2685. y: 209
  2686. },
  2687. subType: "ice"
  2688. }, {
  2689. type: "line",
  2690. p0: {
  2691. x: 215,
  2692. y: 350
  2693. },
  2694. p1: {
  2695. x: 404,
  2696. y: 287
  2697. },
  2698. subType: "log"
  2699. }, {
  2700. type: "line",
  2701. p0: {
  2702. x: -56,
  2703. y: 84
  2704. },
  2705. p1: {
  2706. x: 139,
  2707. y: 130
  2708. },
  2709. subType: "log"
  2710. }], [{
  2711. type: "bubble",
  2712. p0: {
  2713. x: 38,
  2714. y: 96
  2715. },
  2716. p1: {
  2717. x: 94,
  2718. y: 96
  2719. },
  2720. subType: "jellyfish"
  2721. }, {
  2722. type: "bubble",
  2723. p0: {
  2724. x: 213,
  2725. y: 100
  2726. },
  2727. p1: {
  2728. x: 353,
  2729. y: 100
  2730. },
  2731. subType: "jellyfish"
  2732. }, {
  2733. type: "bubble",
  2734. p0: {
  2735. x: 154,
  2736. y: 98
  2737. },
  2738. p1: {
  2739. x: 154,
  2740. y: 98
  2741. },
  2742. subType: "normal"
  2743. }, {
  2744. type: "bubble",
  2745. p0: {
  2746. x: 33,
  2747. y: 159
  2748. },
  2749. p1: {
  2750. x: 351,
  2751. y: 159
  2752. },
  2753. subType: "jellyfish"
  2754. }, {
  2755. type: "bubble",
  2756. p0: {
  2757. x: 247,
  2758. y: 224
  2759. },
  2760. p1: {
  2761. x: 350,
  2762. y: 224
  2763. },
  2764. subType: "jellyfish"
  2765. }, {
  2766. type: "bubble",
  2767. p0: {
  2768. x: 38,
  2769. y: 224
  2770. },
  2771. p1: {
  2772. x: 126,
  2773. y: 224
  2774. },
  2775. subType: "jellyfish"
  2776. }, {
  2777. type: "bubble",
  2778. p0: {
  2779. x: 185,
  2780. y: 224
  2781. },
  2782. p1: {
  2783. x: 185,
  2784. y: 224
  2785. },
  2786. subType: "normal"
  2787. }, {
  2788. type: "bubble",
  2789. p0: {
  2790. x: 33,
  2791. y: 290
  2792. },
  2793. p1: {
  2794. x: 351,
  2795. y: 290
  2796. },
  2797. subType: "jellyfish"
  2798. }, {
  2799. type: "bubble",
  2800. p0: {
  2801. x: 231,
  2802. y: 359
  2803. },
  2804. p1: {
  2805. x: 231,
  2806. y: 359
  2807. },
  2808. subType: "normal"
  2809. }, {
  2810. type: "bubble",
  2811. p0: {
  2812. x: 291,
  2813. y: 358
  2814. },
  2815. p1: {
  2816. x: 347,
  2817. y: 358
  2818. },
  2819. subType: "jellyfish"
  2820. }, {
  2821. type: "bubble",
  2822. p0: {
  2823. x: 32,
  2824. y: 357
  2825. },
  2826. p1: {
  2827. x: 172,
  2828. y: 357
  2829. },
  2830. subType: "jellyfish"
  2831. }], [{
  2832. type: "bubble",
  2833. p0: {
  2834. x: 301,
  2835. y: 252
  2836. },
  2837. p1: {
  2838. x: 301,
  2839. y: 252
  2840. },
  2841. subType: "ice"
  2842. }, {
  2843. type: "bubble",
  2844. p0: {
  2845. x: 58,
  2846. y: 324
  2847. },
  2848. p1: {
  2849. x: 58,
  2850. y: 324
  2851. },
  2852. subType: "fire"
  2853. }, {
  2854. type: "bubble",
  2855. p0: {
  2856. x: 55,
  2857. y: 219
  2858. },
  2859. p1: {
  2860. x: 200,
  2861. y: 355
  2862. },
  2863. subType: "jellyfish"
  2864. }, {
  2865. type: "bubble",
  2866. p0: {
  2867. x: 90,
  2868. y: 72
  2869. },
  2870. p1: {
  2871. x: 290,
  2872. y: 72
  2873. },
  2874. subType: "normal"
  2875. }, {
  2876. type: "bubble",
  2877. p0: {
  2878. x: 244,
  2879. y: 208
  2880. },
  2881. p1: {
  2882. x: 244,
  2883. y: 208
  2884. },
  2885. subType: "fire"
  2886. }, {
  2887. type: "line",
  2888. p0: {
  2889. x: 290,
  2890. y: 167
  2891. },
  2892. p1: {
  2893. x: 433,
  2894. y: 26
  2895. },
  2896. subType: "log"
  2897. }, {
  2898. type: "line",
  2899. p0: {
  2900. x: 146,
  2901. y: 206
  2902. },
  2903. p1: {
  2904. x: 293,
  2905. y: 342
  2906. },
  2907. subType: "log"
  2908. }, {
  2909. type: "line",
  2910. p0: {
  2911. x: -92,
  2912. y: -12
  2913. },
  2914. p1: {
  2915. x: 54,
  2916. y: 124
  2917. },
  2918. subType: "log"
  2919. }, {
  2920. type: "bubble",
  2921. p0: {
  2922. x: 98,
  2923. y: 166
  2924. },
  2925. p1: {
  2926. x: 98,
  2927. y: 166
  2928. },
  2929. subType: "ice"
  2930. }], [{
  2931. type: "bubble",
  2932. p0: {
  2933. x: 187,
  2934. y: 312
  2935. },
  2936. p1: {
  2937. x: 187,
  2938. y: 312
  2939. },
  2940. subType: "normal"
  2941. }, {
  2942. type: "bubble",
  2943. p0: {
  2944. x: 185,
  2945. y: 381
  2946. },
  2947. p1: {
  2948. x: 185,
  2949. y: 381
  2950. },
  2951. subType: "normal"
  2952. }, {
  2953. type: "bubble",
  2954. p0: {
  2955. x: 252,
  2956. y: 376
  2957. },
  2958. p1: {
  2959. x: 252,
  2960. y: 376
  2961. },
  2962. subType: "normal"
  2963. }, {
  2964. type: "bubble",
  2965. p0: {
  2966. x: 123,
  2967. y: 374
  2968. },
  2969. p1: {
  2970. x: 123,
  2971. y: 374
  2972. },
  2973. subType: "normal"
  2974. }, {
  2975. type: "bubble",
  2976. p0: {
  2977. x: 31,
  2978. y: 297
  2979. },
  2980. p1: {
  2981. x: 31,
  2982. y: 297
  2983. },
  2984. subType: "normal"
  2985. }, {
  2986. type: "bubble",
  2987. p0: {
  2988. x: 34,
  2989. y: 179
  2990. },
  2991. p1: {
  2992. x: 34,
  2993. y: 179
  2994. },
  2995. subType: "normal"
  2996. }, {
  2997. type: "bubble",
  2998. p0: {
  2999. x: 343,
  3000. y: 177
  3001. },
  3002. p1: {
  3003. x: 343,
  3004. y: 177
  3005. },
  3006. subType: "normal"
  3007. }, {
  3008. type: "bubble",
  3009. p0: {
  3010. x: 346,
  3011. y: 299
  3012. },
  3013. p1: {
  3014. x: 346,
  3015. y: 299
  3016. },
  3017. subType: "normal"
  3018. }, {
  3019. type: "bubble",
  3020. p0: {
  3021. x: 189,
  3022. y: 160
  3023. },
  3024. p1: {
  3025. x: 189,
  3026. y: 160
  3027. },
  3028. subType: "normal"
  3029. }, {
  3030. type: "bubble",
  3031. p0: {
  3032. x: 254,
  3033. y: 95
  3034. },
  3035. p1: {
  3036. x: 254,
  3037. y: 95
  3038. },
  3039. subType: "normal"
  3040. }, {
  3041. type: "bubble",
  3042. p0: {
  3043. x: 189,
  3044. y: 97
  3045. },
  3046. p1: {
  3047. x: 189,
  3048. y: 97
  3049. },
  3050. subType: "normal"
  3051. }, {
  3052. type: "bubble",
  3053. p0: {
  3054. x: 124,
  3055. y: 96
  3056. },
  3057. p1: {
  3058. x: 124,
  3059. y: 96
  3060. },
  3061. subType: "normal"
  3062. }, {
  3063. type: "bubble",
  3064. p0: {
  3065. x: 30,
  3066. y: 238
  3067. },
  3068. p1: {
  3069. x: 348,
  3070. y: 238
  3071. },
  3072. subType: "jellyfish"
  3073. }, {
  3074. type: "bubble",
  3075. p0: {
  3076. x: 326,
  3077. y: 359
  3078. },
  3079. p1: {
  3080. x: 50,
  3081. y: 117
  3082. },
  3083. subType: "jellyfish"
  3084. }, {
  3085. type: "bubble",
  3086. p0: {
  3087. x: 51,
  3088. y: 359
  3089. },
  3090. p1: {
  3091. x: 326,
  3092. y: 117
  3093. },
  3094. subType: "jellyfish"
  3095. }], [{
  3096. type: "bubble",
  3097. p0: {
  3098. x: 283,
  3099. y: 352
  3100. },
  3101. p1: {
  3102. x: 283,
  3103. y: 352
  3104. },
  3105. subType: "fire"
  3106. }, {
  3107. type: "bubble",
  3108. p0: {
  3109. x: 159,
  3110. y: 349
  3111. },
  3112. p1: {
  3113. x: 159,
  3114. y: 349
  3115. },
  3116. subType: "fire"
  3117. }, {
  3118. type: "bubble",
  3119. p0: {
  3120. x: 34,
  3121. y: 346
  3122. },
  3123. p1: {
  3124. x: 34,
  3125. y: 346
  3126. },
  3127. subType: "fire"
  3128. }, {
  3129. type: "bubble",
  3130. p0: {
  3131. x: 347,
  3132. y: 277
  3133. },
  3134. p1: {
  3135. x: 347,
  3136. y: 277
  3137. },
  3138. subType: "fire"
  3139. }, {
  3140. type: "bubble",
  3141. p0: {
  3142. x: 224,
  3143. y: 282
  3144. },
  3145. p1: {
  3146. x: 224,
  3147. y: 282
  3148. },
  3149. subType: "fire"
  3150. }, {
  3151. type: "bubble",
  3152. p0: {
  3153. x: 348,
  3154. y: 352
  3155. },
  3156. p1: {
  3157. x: 348,
  3158. y: 352
  3159. },
  3160. subType: "ice"
  3161. }, {
  3162. type: "bubble",
  3163. p0: {
  3164. x: 281,
  3165. y: 276
  3166. },
  3167. p1: {
  3168. x: 281,
  3169. y: 276
  3170. },
  3171. subType: "ice"
  3172. }, {
  3173. type: "bubble",
  3174. p0: {
  3175. x: 216,
  3176. y: 352
  3177. },
  3178. p1: {
  3179. x: 216,
  3180. y: 352
  3181. },
  3182. subType: "ice"
  3183. }, {
  3184. type: "bubble",
  3185. p0: {
  3186. x: 163,
  3187. y: 280
  3188. },
  3189. p1: {
  3190. x: 163,
  3191. y: 280
  3192. },
  3193. subType: "ice"
  3194. }, {
  3195. type: "bubble",
  3196. p0: {
  3197. x: 95,
  3198. y: 346
  3199. },
  3200. p1: {
  3201. x: 95,
  3202. y: 346
  3203. },
  3204. subType: "ice"
  3205. }, {
  3206. type: "bubble",
  3207. p0: {
  3208. x: 101,
  3209. y: 277
  3210. },
  3211. p1: {
  3212. x: 101,
  3213. y: 277
  3214. },
  3215. subType: "fire"
  3216. }, {
  3217. type: "bubble",
  3218. p0: {
  3219. x: 39,
  3220. y: 275
  3221. },
  3222. p1: {
  3223. x: 39,
  3224. y: 275
  3225. },
  3226. subType: "ice"
  3227. }, {
  3228. type: "bubble",
  3229. p0: {
  3230. x: 283,
  3231. y: 215
  3232. },
  3233. p1: {
  3234. x: 283,
  3235. y: 215
  3236. },
  3237. subType: "fire"
  3238. }, {
  3239. type: "bubble",
  3240. p0: {
  3241. x: 159,
  3242. y: 212
  3243. },
  3244. p1: {
  3245. x: 159,
  3246. y: 212
  3247. },
  3248. subType: "fire"
  3249. }, {
  3250. type: "bubble",
  3251. p0: {
  3252. x: 34,
  3253. y: 209
  3254. },
  3255. p1: {
  3256. x: 34,
  3257. y: 209
  3258. },
  3259. subType: "fire"
  3260. }, {
  3261. type: "bubble",
  3262. p0: {
  3263. x: 347,
  3264. y: 140
  3265. },
  3266. p1: {
  3267. x: 347,
  3268. y: 140
  3269. },
  3270. subType: "fire"
  3271. }, {
  3272. type: "bubble",
  3273. p0: {
  3274. x: 224,
  3275. y: 145
  3276. },
  3277. p1: {
  3278. x: 224,
  3279. y: 145
  3280. },
  3281. subType: "fire"
  3282. }, {
  3283. type: "bubble",
  3284. p0: {
  3285. x: 348,
  3286. y: 215
  3287. },
  3288. p1: {
  3289. x: 348,
  3290. y: 215
  3291. },
  3292. subType: "ice"
  3293. }, {
  3294. type: "bubble",
  3295. p0: {
  3296. x: 281,
  3297. y: 139
  3298. },
  3299. p1: {
  3300. x: 281,
  3301. y: 139
  3302. },
  3303. subType: "ice"
  3304. }, {
  3305. type: "bubble",
  3306. p0: {
  3307. x: 216,
  3308. y: 215
  3309. },
  3310. p1: {
  3311. x: 216,
  3312. y: 215
  3313. },
  3314. subType: "ice"
  3315. }, {
  3316. type: "bubble",
  3317. p0: {
  3318. x: 163,
  3319. y: 143
  3320. },
  3321. p1: {
  3322. x: 163,
  3323. y: 143
  3324. },
  3325. subType: "ice"
  3326. }, {
  3327. type: "bubble",
  3328. p0: {
  3329. x: 95,
  3330. y: 209
  3331. },
  3332. p1: {
  3333. x: 95,
  3334. y: 209
  3335. },
  3336. subType: "ice"
  3337. }, {
  3338. type: "bubble",
  3339. p0: {
  3340. x: 101,
  3341. y: 140
  3342. },
  3343. p1: {
  3344. x: 101,
  3345. y: 140
  3346. },
  3347. subType: "fire"
  3348. }, {
  3349. type: "bubble",
  3350. p0: {
  3351. x: 39,
  3352. y: 138
  3353. },
  3354. p1: {
  3355. x: 39,
  3356. y: 138
  3357. },
  3358. subType: "ice"
  3359. }], [{
  3360. type: "bubble",
  3361. p0: {
  3362. x: 184,
  3363. y: 242
  3364. },
  3365. p1: {
  3366. x: 184,
  3367. y: 242
  3368. },
  3369. subType: "normal"
  3370. }, {
  3371. type: "bubble",
  3372. p0: {
  3373. x: 166,
  3374. y: 309
  3375. },
  3376. p1: {
  3377. x: 198,
  3378. y: 309
  3379. },
  3380. subType: "jellyfish"
  3381. }, {
  3382. type: "bubble",
  3383. p0: {
  3384. x: 169,
  3385. y: 180
  3386. },
  3387. p1: {
  3388. x: 201,
  3389. y: 180
  3390. },
  3391. subType: "jellyfish"
  3392. }, {
  3393. type: "bubble",
  3394. p0: {
  3395. x: 113,
  3396. y: 358
  3397. },
  3398. p1: {
  3399. x: 113,
  3400. y: 358
  3401. },
  3402. subType: "normal"
  3403. }, {
  3404. type: "bubble",
  3405. p0: {
  3406. x: 61,
  3407. y: 306
  3408. },
  3409. p1: {
  3410. x: 61,
  3411. y: 306
  3412. },
  3413. subType: "normal"
  3414. }, {
  3415. type: "bubble",
  3416. p0: {
  3417. x: 257,
  3418. y: 360
  3419. },
  3420. p1: {
  3421. x: 257,
  3422. y: 360
  3423. },
  3424. subType: "normal"
  3425. }, {
  3426. type: "bubble",
  3427. p0: {
  3428. x: 320,
  3429. y: 311
  3430. },
  3431. p1: {
  3432. x: 320,
  3433. y: 311
  3434. },
  3435. subType: "normal"
  3436. }, {
  3437. type: "bubble",
  3438. p0: {
  3439. x: 311,
  3440. y: 175
  3441. },
  3442. p1: {
  3443. x: 311,
  3444. y: 175
  3445. },
  3446. subType: "normal"
  3447. }, {
  3448. type: "bubble",
  3449. p0: {
  3450. x: 252,
  3451. y: 128
  3452. },
  3453. p1: {
  3454. x: 252,
  3455. y: 128
  3456. },
  3457. subType: "normal"
  3458. }, {
  3459. type: "bubble",
  3460. p0: {
  3461. x: 122,
  3462. y: 127
  3463. },
  3464. p1: {
  3465. x: 122,
  3466. y: 127
  3467. },
  3468. subType: "normal"
  3469. }, {
  3470. type: "bubble",
  3471. p0: {
  3472. x: 69,
  3473. y: 169
  3474. },
  3475. p1: {
  3476. x: 69,
  3477. y: 169
  3478. },
  3479. subType: "normal"
  3480. }, {
  3481. type: "bubble",
  3482. p0: {
  3483. x: 41,
  3484. y: 234
  3485. },
  3486. p1: {
  3487. x: 41,
  3488. y: 234
  3489. },
  3490. subType: "normal"
  3491. }, {
  3492. type: "bubble",
  3493. p0: {
  3494. x: 183,
  3495. y: 379
  3496. },
  3497. p1: {
  3498. x: 183,
  3499. y: 379
  3500. },
  3501. subType: "normal"
  3502. }, {
  3503. type: "bubble",
  3504. p0: {
  3505. x: 344,
  3506. y: 240
  3507. },
  3508. p1: {
  3509. x: 344,
  3510. y: 240
  3511. },
  3512. subType: "normal"
  3513. }, {
  3514. type: "bubble",
  3515. p0: {
  3516. x: 188,
  3517. y: 111
  3518. },
  3519. p1: {
  3520. x: 188,
  3521. y: 111
  3522. },
  3523. subType: "normal"
  3524. }], [{
  3525. type: "bubble",
  3526. p0: {
  3527. x: 131,
  3528. y: 381
  3529. },
  3530. p1: {
  3531. x: 131,
  3532. y: 381
  3533. },
  3534. subType: "normal"
  3535. }, {
  3536. type: "bubble",
  3537. p0: {
  3538. x: 38,
  3539. y: 289
  3540. },
  3541. p1: {
  3542. x: 38,
  3543. y: 289
  3544. },
  3545. subType: "normal"
  3546. }, {
  3547. type: "bubble",
  3548. p0: {
  3549. x: 37,
  3550. y: 161
  3551. },
  3552. p1: {
  3553. x: 37,
  3554. y: 161
  3555. },
  3556. subType: "normal"
  3557. }, {
  3558. type: "bubble",
  3559. p0: {
  3560. x: 132,
  3561. y: 76
  3562. },
  3563. p1: {
  3564. x: 132,
  3565. y: 76
  3566. },
  3567. subType: "normal"
  3568. }, {
  3569. type: "bubble",
  3570. p0: {
  3571. x: 256,
  3572. y: 381
  3573. },
  3574. p1: {
  3575. x: 256,
  3576. y: 381
  3577. },
  3578. subType: "normal"
  3579. }, {
  3580. type: "bubble",
  3581. p0: {
  3582. x: 349,
  3583. y: 289
  3584. },
  3585. p1: {
  3586. x: 349,
  3587. y: 289
  3588. },
  3589. subType: "normal"
  3590. }, {
  3591. type: "bubble",
  3592. p0: {
  3593. x: 350,
  3594. y: 161
  3595. },
  3596. p1: {
  3597. x: 350,
  3598. y: 161
  3599. },
  3600. subType: "normal"
  3601. }, {
  3602. type: "bubble",
  3603. p0: {
  3604. x: 255,
  3605. y: 76
  3606. },
  3607. p1: {
  3608. x: 255,
  3609. y: 76
  3610. },
  3611. subType: "normal"
  3612. }, {
  3613. type: "bubble",
  3614. p0: {
  3615. x: 130,
  3616. y: 277
  3617. },
  3618. p1: {
  3619. x: 53,
  3620. y: 381
  3621. },
  3622. subType: "normal"
  3623. }, {
  3624. type: "bubble",
  3625. p0: {
  3626. x: 131,
  3627. y: 220
  3628. },
  3629. p1: {
  3630. x: 36,
  3631. y: 222
  3632. },
  3633. subType: "normal"
  3634. }, {
  3635. type: "bubble",
  3636. p0: {
  3637. x: 131,
  3638. y: 164
  3639. },
  3640. p1: {
  3641. x: 47,
  3642. y: 82
  3643. },
  3644. subType: "normal"
  3645. }, {
  3646. type: "bubble",
  3647. p0: {
  3648. x: 257,
  3649. y: 277
  3650. },
  3651. p1: {
  3652. x: 335,
  3653. y: 381
  3654. },
  3655. subType: "normal"
  3656. }, {
  3657. type: "bubble",
  3658. p0: {
  3659. x: 257,
  3660. y: 220
  3661. },
  3662. p1: {
  3663. x: 351,
  3664. y: 222
  3665. },
  3666. subType: "normal"
  3667. }, {
  3668. type: "bubble",
  3669. p0: {
  3670. x: 256,
  3671. y: 164
  3672. },
  3673. p1: {
  3674. x: 341,
  3675. y: 82
  3676. },
  3677. subType: "normal"
  3678. }, {
  3679. type: "line",
  3680. p0: {
  3681. x: 195,
  3682. y: 179
  3683. },
  3684. p1: {
  3685. x: 195,
  3686. y: 379
  3687. },
  3688. subType: "log"
  3689. }, {
  3690. type: "line",
  3691. p0: {
  3692. x: 195,
  3693. y: -75
  3694. },
  3695. p1: {
  3696. x: 195,
  3697. y: 125
  3698. },
  3699. subType: "log"
  3700. }], [{
  3701. type: "bubble",
  3702. p0: {
  3703. x: 158,
  3704. y: 107
  3705. },
  3706. p1: {
  3707. x: 346,
  3708. y: 107
  3709. },
  3710. subType: "jellyfish"
  3711. }, {
  3712. type: "bubble",
  3713. p0: {
  3714. x: 32,
  3715. y: 275
  3716. },
  3717. p1: {
  3718. x: 220,
  3719. y: 275
  3720. },
  3721. subType: "jellyfish"
  3722. }, {
  3723. type: "bubble",
  3724. p0: {
  3725. x: 171,
  3726. y: 367
  3727. },
  3728. p1: {
  3729. x: 171,
  3730. y: 367
  3731. },
  3732. subType: "normal"
  3733. }, {
  3734. type: "bubble",
  3735. p0: {
  3736. x: 74,
  3737. y: 86
  3738. },
  3739. p1: {
  3740. x: 74,
  3741. y: 86
  3742. },
  3743. subType: "normal"
  3744. }, {
  3745. type: "bubble",
  3746. p0: {
  3747. x: 231,
  3748. y: 356
  3749. },
  3750. p1: {
  3751. x: 231,
  3752. y: 356
  3753. },
  3754. subType: "normal"
  3755. }, {
  3756. type: "bubble",
  3757. p0: {
  3758. x: 276,
  3759. y: 312
  3760. },
  3761. p1: {
  3762. x: 276,
  3763. y: 312
  3764. },
  3765. subType: "normal"
  3766. }, {
  3767. type: "bubble",
  3768. p0: {
  3769. x: 287,
  3770. y: 253
  3771. },
  3772. p1: {
  3773. x: 287,
  3774. y: 253
  3775. },
  3776. subType: "normal"
  3777. }, {
  3778. type: "bubble",
  3779. p0: {
  3780. x: 253,
  3781. y: 203
  3782. },
  3783. p1: {
  3784. x: 253,
  3785. y: 203
  3786. },
  3787. subType: "normal"
  3788. }, {
  3789. type: "bubble",
  3790. p0: {
  3791. x: 199,
  3792. y: 179
  3793. },
  3794. p1: {
  3795. x: 199,
  3796. y: 179
  3797. },
  3798. subType: "normal"
  3799. }, {
  3800. type: "bubble",
  3801. p0: {
  3802. x: 138,
  3803. y: 174
  3804. },
  3805. p1: {
  3806. x: 138,
  3807. y: 174
  3808. },
  3809. subType: "normal"
  3810. }, {
  3811. type: "bubble",
  3812. p0: {
  3813. x: 87,
  3814. y: 142
  3815. },
  3816. p1: {
  3817. x: 87,
  3818. y: 142
  3819. },
  3820. subType: "normal"
  3821. }], [{
  3822. type: "bubble",
  3823. p0: {
  3824. x: 293,
  3825. y: 89
  3826. },
  3827. p1: {
  3828. x: 293,
  3829. y: 89
  3830. },
  3831. subType: "ice"
  3832. }, {
  3833. type: "bubble",
  3834. p0: {
  3835. x: 169,
  3836. y: 272
  3837. },
  3838. p1: {
  3839. x: 169,
  3840. y: 272
  3841. },
  3842. subType: "normal"
  3843. }, {
  3844. type: "bubble",
  3845. p0: {
  3846. x: 198,
  3847. y: 94
  3848. },
  3849. p1: {
  3850. x: 198,
  3851. y: 94
  3852. },
  3853. subType: "fire"
  3854. }, {
  3855. type: "bubble",
  3856. p0: {
  3857. x: 97,
  3858. y: 299
  3859. },
  3860. p1: {
  3861. x: 97,
  3862. y: 299
  3863. },
  3864. subType: "normal"
  3865. }, {
  3866. type: "bubble",
  3867. p0: {
  3868. x: 296,
  3869. y: 202
  3870. },
  3871. p1: {
  3872. x: 296,
  3873. y: 202
  3874. },
  3875. subType: "normal"
  3876. }, {
  3877. type: "bubble",
  3878. p0: {
  3879. x: 264,
  3880. y: 350
  3881. },
  3882. p1: {
  3883. x: 264,
  3884. y: 350
  3885. },
  3886. subType: "normal"
  3887. }, {
  3888. type: "bubble",
  3889. p0: {
  3890. x: 188,
  3891. y: 183
  3892. },
  3893. p1: {
  3894. x: 188,
  3895. y: 183
  3896. },
  3897. subType: "normal"
  3898. }, {
  3899. type: "bubble",
  3900. p0: {
  3901. x: 158,
  3902. y: 356
  3903. },
  3904. p1: {
  3905. x: 158,
  3906. y: 356
  3907. },
  3908. subType: "fire"
  3909. }, {
  3910. type: "bubble",
  3911. p0: {
  3912. x: 255,
  3913. y: 140
  3914. },
  3915. p1: {
  3916. x: 255,
  3917. y: 140
  3918. },
  3919. subType: "fire"
  3920. }, {
  3921. type: "bubble",
  3922. p0: {
  3923. x: 116,
  3924. y: 217
  3925. },
  3926. p1: {
  3927. x: 116,
  3928. y: 217
  3929. },
  3930. subType: "fire"
  3931. }, {
  3932. type: "bubble",
  3933. p0: {
  3934. x: 243,
  3935. y: 263
  3936. },
  3937. p1: {
  3938. x: 243,
  3939. y: 263
  3940. },
  3941. subType: "ice"
  3942. }, {
  3943. type: "bubble",
  3944. p0: {
  3945. x: 118,
  3946. y: 120
  3947. },
  3948. p1: {
  3949. x: 118,
  3950. y: 120
  3951. },
  3952. subType: "ice"
  3953. }, {
  3954. type: "bubble",
  3955. p0: {
  3956. x: 28,
  3957. y: 301
  3958. },
  3959. p1: {
  3960. x: -70,
  3961. y: 301
  3962. },
  3963. subType: "jellyfish"
  3964. }, {
  3965. type: "bubble",
  3966. p0: {
  3967. x: 26,
  3968. y: 179
  3969. },
  3970. p1: {
  3971. x: -72,
  3972. y: 179
  3973. },
  3974. subType: "jellyfish"
  3975. }, {
  3976. type: "bubble",
  3977. p0: {
  3978. x: -74,
  3979. y: 362
  3980. },
  3981. p1: {
  3982. x: 24,
  3983. y: 362
  3984. },
  3985. subType: "jellyfish"
  3986. }, {
  3987. type: "bubble",
  3988. p0: {
  3989. x: -73,
  3990. y: 241
  3991. },
  3992. p1: {
  3993. x: 25,
  3994. y: 241
  3995. },
  3996. subType: "jellyfish"
  3997. }, {
  3998. type: "bubble",
  3999. p0: {
  4000. x: -72,
  4001. y: 116
  4002. },
  4003. p1: {
  4004. x: 26,
  4005. y: 116
  4006. },
  4007. subType: "jellyfish"
  4008. }, {
  4009. type: "bubble",
  4010. p0: {
  4011. x: 460,
  4012. y: 301
  4013. },
  4014. p1: {
  4015. x: 362,
  4016. y: 301
  4017. },
  4018. subType: "jellyfish"
  4019. }, {
  4020. type: "bubble",
  4021. p0: {
  4022. x: 458,
  4023. y: 179
  4024. },
  4025. p1: {
  4026. x: 360,
  4027. y: 179
  4028. },
  4029. subType: "jellyfish"
  4030. }, {
  4031. type: "bubble",
  4032. p0: {
  4033. x: 358,
  4034. y: 362
  4035. },
  4036. p1: {
  4037. x: 456,
  4038. y: 362
  4039. },
  4040. subType: "jellyfish"
  4041. }, {
  4042. type: "bubble",
  4043. p0: {
  4044. x: 359,
  4045. y: 241
  4046. },
  4047. p1: {
  4048. x: 457,
  4049. y: 241
  4050. },
  4051. subType: "jellyfish"
  4052. }, {
  4053. type: "bubble",
  4054. p0: {
  4055. x: 360,
  4056. y: 116
  4057. },
  4058. p1: {
  4059. x: 458,
  4060. y: 116
  4061. },
  4062. subType: "jellyfish"
  4063. }], [{
  4064. type: "line",
  4065. p0: {
  4066. x: 297,
  4067. y: 326
  4068. },
  4069. p1: {
  4070. x: 355,
  4071. y: 134
  4072. },
  4073. subType: "log"
  4074. }, {
  4075. type: "bubble",
  4076. p0: {
  4077. x: 55,
  4078. y: 244
  4079. },
  4080. p1: {
  4081. x: 220,
  4082. y: 178
  4083. },
  4084. subType: "normal"
  4085. }, {
  4086. type: "bubble",
  4087. p0: {
  4088. x: 220,
  4089. y: 104
  4090. },
  4091. p1: {
  4092. x: 220,
  4093. y: 104
  4094. },
  4095. subType: "normal"
  4096. }, {
  4097. type: "bubble",
  4098. p0: {
  4099. x: 140,
  4100. y: 134
  4101. },
  4102. p1: {
  4103. x: 140,
  4104. y: 134
  4105. },
  4106. subType: "normal"
  4107. }, {
  4108. type: "bubble",
  4109. p0: {
  4110. x: 221,
  4111. y: 254
  4112. },
  4113. p1: {
  4114. x: 221,
  4115. y: 254
  4116. },
  4117. subType: "ice"
  4118. }, {
  4119. type: "bubble",
  4120. p0: {
  4121. x: 141,
  4122. y: 281
  4123. },
  4124. p1: {
  4125. x: 141,
  4126. y: 281
  4127. },
  4128. subType: "ice"
  4129. }, {
  4130. type: "bubble",
  4131. p0: {
  4132. x: 61,
  4133. y: 314
  4134. },
  4135. p1: {
  4136. x: 61,
  4137. y: 314
  4138. },
  4139. subType: "ice"
  4140. }, {
  4141. type: "bubble",
  4142. p0: {
  4143. x: 60,
  4144. y: 164
  4145. },
  4146. p1: {
  4147. x: 60,
  4148. y: 164
  4149. },
  4150. subType: "normal"
  4151. }, {
  4152. type: "bubble",
  4153. p0: {
  4154. x: 163,
  4155. y: 369
  4156. },
  4157. p1: {
  4158. x: 163,
  4159. y: 369
  4160. },
  4161. subType: "fire"
  4162. }], [{
  4163. type: "bubble",
  4164. p0: {
  4165. x: 349,
  4166. y: 351
  4167. },
  4168. p1: {
  4169. x: 345,
  4170. y: 201
  4171. },
  4172. subType: "normal"
  4173. }, {
  4174. type: "bubble",
  4175. p0: {
  4176. x: 188,
  4177. y: 216
  4178. },
  4179. p1: {
  4180. x: 188,
  4181. y: 216
  4182. },
  4183. subType: "normal"
  4184. }, {
  4185. type: "bubble",
  4186. p0: {
  4187. x: 326,
  4188. y: 117
  4189. },
  4190. p1: {
  4191. x: 326,
  4192. y: 117
  4193. },
  4194. subType: "fire"
  4195. }, {
  4196. type: "bubble",
  4197. p0: {
  4198. x: 43,
  4199. y: 355
  4200. },
  4201. p1: {
  4202. x: 43,
  4203. y: 355
  4204. },
  4205. subType: "normal"
  4206. }, {
  4207. type: "bubble",
  4208. p0: {
  4209. x: 225,
  4210. y: 323
  4211. },
  4212. p1: {
  4213. x: 225,
  4214. y: 323
  4215. },
  4216. subType: "ice"
  4217. }, {
  4218. type: "line",
  4219. p0: {
  4220. x: 290,
  4221. y: 338
  4222. },
  4223. p1: {
  4224. x: 259,
  4225. y: 140
  4226. },
  4227. subType: "log"
  4228. }, {
  4229. type: "line",
  4230. p0: {
  4231. x: -61,
  4232. y: 139
  4233. },
  4234. p1: {
  4235. x: 66,
  4236. y: 293
  4237. },
  4238. subType: "log"
  4239. }], [{
  4240. type: "bubble",
  4241. p0: {
  4242. x: 308,
  4243. y: 150
  4244. },
  4245. p1: {
  4246. x: 354,
  4247. y: 130
  4248. },
  4249. subType: "normal"
  4250. }, {
  4251. type: "line",
  4252. p0: {
  4253. x: 256,
  4254. y: 229
  4255. },
  4256. p1: {
  4257. x: 440,
  4258. y: 151
  4259. },
  4260. subType: "log"
  4261. }, {
  4262. type: "bubble",
  4263. p0: {
  4264. x: 278,
  4265. y: 380
  4266. },
  4267. p1: {
  4268. x: 278,
  4269. y: 380
  4270. },
  4271. subType: "normal"
  4272. }, {
  4273. type: "bubble",
  4274. p0: {
  4275. x: 211,
  4276. y: 279
  4277. },
  4278. p1: {
  4279. x: 211,
  4280. y: 279
  4281. },
  4282. subType: "normal"
  4283. }, {
  4284. type: "bubble",
  4285. p0: {
  4286. x: 152,
  4287. y: 192
  4288. },
  4289. p1: {
  4290. x: 152,
  4291. y: 192
  4292. },
  4293. subType: "normal"
  4294. }, {
  4295. type: "bubble",
  4296. p0: {
  4297. x: 78,
  4298. y: 107
  4299. },
  4300. p1: {
  4301. x: 78,
  4302. y: 408
  4303. },
  4304. subType: "normal"
  4305. }], [{
  4306. type: "line",
  4307. p0: {
  4308. x: -156,
  4309. y: 121
  4310. },
  4311. p1: {
  4312. x: 35,
  4313. y: 179
  4314. },
  4315. subType: "log"
  4316. }, {
  4317. type: "bubble",
  4318. p0: {
  4319. x: 102,
  4320. y: 173
  4321. },
  4322. p1: {
  4323. x: 302,
  4324. y: 179
  4325. },
  4326. subType: "normal"
  4327. }, {
  4328. type: "bubble",
  4329. p0: {
  4330. x: 315,
  4331. y: 335
  4332. },
  4333. p1: {
  4334. x: 315,
  4335. y: 335
  4336. },
  4337. subType: "ice"
  4338. }, {
  4339. type: "bubble",
  4340. p0: {
  4341. x: 51,
  4342. y: 352
  4343. },
  4344. p1: {
  4345. x: 51,
  4346. y: 352
  4347. },
  4348. subType: "ice"
  4349. }, {
  4350. type: "bubble",
  4351. p0: {
  4352. x: 347,
  4353. y: 99
  4354. },
  4355. p1: {
  4356. x: 347,
  4357. y: 99
  4358. },
  4359. subType: "ice"
  4360. }, {
  4361. type: "bubble",
  4362. p0: {
  4363. x: 189,
  4364. y: 394
  4365. },
  4366. p1: {
  4367. x: 189,
  4368. y: 394
  4369. },
  4370. subType: "fire"
  4371. }, {
  4372. type: "bubble",
  4373. p0: {
  4374. x: 344,
  4375. y: 228
  4376. },
  4377. p1: {
  4378. x: 344,
  4379. y: 228
  4380. },
  4381. subType: "fire"
  4382. }, {
  4383. type: "bubble",
  4384. p0: {
  4385. x: 142,
  4386. y: 115
  4387. },
  4388. p1: {
  4389. x: 142,
  4390. y: 115
  4391. },
  4392. subType: "fire"
  4393. }, {
  4394. type: "bubble",
  4395. p0: {
  4396. x: 58,
  4397. y: 245
  4398. },
  4399. p1: {
  4400. x: 58,
  4401. y: 245
  4402. },
  4403. subType: "fire"
  4404. }, {
  4405. type: "bubble",
  4406. p0: {
  4407. x: 127,
  4408. y: 276
  4409. },
  4410. p1: {
  4411. x: 127,
  4412. y: 276
  4413. },
  4414. subType: "ice"
  4415. }, {
  4416. type: "bubble",
  4417. p0: {
  4418. x: 227,
  4419. y: 305
  4420. },
  4421. p1: {
  4422. x: 227,
  4423. y: 305
  4424. },
  4425. subType: "ice"
  4426. }, {
  4427. type: "bubble",
  4428. p0: {
  4429. x: 197,
  4430. y: 235
  4431. },
  4432. p1: {
  4433. x: 197,
  4434. y: 235
  4435. },
  4436. subType: "ice"
  4437. }, {
  4438. type: "bubble",
  4439. p0: {
  4440. x: 85,
  4441. y: 85
  4442. },
  4443. p1: {
  4444. x: 85,
  4445. y: 85
  4446. },
  4447. subType: "ice"
  4448. }], [{
  4449. type: "bubble",
  4450. p0: {
  4451. x: 39,
  4452. y: 182
  4453. },
  4454. p1: {
  4455. x: 144,
  4456. y: 234
  4457. },
  4458. subType: "normal"
  4459. }, {
  4460. type: "bubble",
  4461. p0: {
  4462. x: 276,
  4463. y: 154
  4464. },
  4465. p1: {
  4466. x: 276,
  4467. y: 154
  4468. },
  4469. subType: "normal"
  4470. }, {
  4471. type: "bubble",
  4472. p0: {
  4473. x: 146,
  4474. y: 379
  4475. },
  4476. p1: {
  4477. x: 146,
  4478. y: 379
  4479. },
  4480. subType: "normal"
  4481. }, {
  4482. type: "bubble",
  4483. p0: {
  4484. x: 137,
  4485. y: 91
  4486. },
  4487. p1: {
  4488. x: 137,
  4489. y: 91
  4490. },
  4491. subType: "normal"
  4492. }, {
  4493. type: "bubble",
  4494. p0: {
  4495. x: 338,
  4496. y: 326
  4497. },
  4498. p1: {
  4499. x: 338,
  4500. y: 326
  4501. },
  4502. subType: "normal"
  4503. }, {
  4504. type: "bubble",
  4505. p0: {
  4506. x: 338,
  4507. y: 91
  4508. },
  4509. p1: {
  4510. x: 210,
  4511. y: 94
  4512. },
  4513. subType: "jellyfish"
  4514. }, {
  4515. type: "bubble",
  4516. p0: {
  4517. x: 352,
  4518. y: 263
  4519. },
  4520. p1: {
  4521. x: 49,
  4522. y: 122
  4523. },
  4524. subType: "jellyfish"
  4525. }, {
  4526. type: "bubble",
  4527. p0: {
  4528. x: 337,
  4529. y: 197
  4530. },
  4531. p1: {
  4532. x: 43,
  4533. y: 358
  4534. },
  4535. subType: "jellyfish"
  4536. }, {
  4537. type: "bubble",
  4538. p0: {
  4539. x: 269,
  4540. y: 359
  4541. },
  4542. p1: {
  4543. x: 41,
  4544. y: 254
  4545. },
  4546. subType: "jellyfish"
  4547. }], [{
  4548. type: "line",
  4549. p0: {
  4550. x: 384,
  4551. y: -151
  4552. },
  4553. p1: {
  4554. x: 217,
  4555. y: -42
  4556. },
  4557. subType: "log"
  4558. }, {
  4559. type: "line",
  4560. p0: {
  4561. x: 403,
  4562. y: 30
  4563. },
  4564. p1: {
  4565. x: 216,
  4566. y: -43
  4567. },
  4568. subType: "log"
  4569. }, {
  4570. type: "bubble",
  4571. p0: {
  4572. x: 33,
  4573. y: 315
  4574. },
  4575. p1: {
  4576. x: 35,
  4577. y: -44
  4578. },
  4579. subType: "jellyfish"
  4580. }, {
  4581. type: "bubble",
  4582. p0: {
  4583. x: 150,
  4584. y: 276
  4585. },
  4586. p1: {
  4587. x: 151,
  4588. y: 372
  4589. },
  4590. subType: "normal"
  4591. }, {
  4592. type: "bubble",
  4593. p0: {
  4594. x: 221,
  4595. y: 205
  4596. },
  4597. p1: {
  4598. x: 221,
  4599. y: 205
  4600. },
  4601. subType: "fire"
  4602. }, {
  4603. type: "bubble",
  4604. p0: {
  4605. x: 227,
  4606. y: 337
  4607. },
  4608. p1: {
  4609. x: 227,
  4610. y: 337
  4611. },
  4612. subType: "ice"
  4613. }, {
  4614. type: "bubble",
  4615. p0: {
  4616. x: 32,
  4617. y: 375
  4618. },
  4619. p1: {
  4620. x: 32,
  4621. y: 375
  4622. },
  4623. subType: "ice"
  4624. }, {
  4625. type: "bubble",
  4626. p0: {
  4627. x: 326,
  4628. y: 81
  4629. },
  4630. p1: {
  4631. x: 326,
  4632. y: 81
  4633. },
  4634. subType: "fire"
  4635. }, {
  4636. type: "bubble",
  4637. p0: {
  4638. x: 356,
  4639. y: 148
  4640. },
  4641. p1: {
  4642. x: 356,
  4643. y: 148
  4644. },
  4645. subType: "fire"
  4646. }, {
  4647. type: "bubble",
  4648. p0: {
  4649. x: 344,
  4650. y: 229
  4651. },
  4652. p1: {
  4653. x: 344,
  4654. y: 229
  4655. },
  4656. subType: "fire"
  4657. }, {
  4658. type: "bubble",
  4659. p0: {
  4660. x: 353,
  4661. y: 305
  4662. },
  4663. p1: {
  4664. x: 353,
  4665. y: 305
  4666. },
  4667. subType: "fire"
  4668. }, {
  4669. type: "bubble",
  4670. p0: {
  4671. x: 327,
  4672. y: 374
  4673. },
  4674. p1: {
  4675. x: 327,
  4676. y: 374
  4677. },
  4678. subType: "fire"
  4679. }, {
  4680. type: "line",
  4681. p0: {
  4682. x: 286,
  4683. y: 127
  4684. },
  4685. p1: {
  4686. x: 91,
  4687. y: 172
  4688. },
  4689. subType: "log"
  4690. }, {
  4691. type: "line",
  4692. p0: {
  4693. x: 287,
  4694. y: 133
  4695. },
  4696. p1: {
  4697. x: 287,
  4698. y: 333
  4699. },
  4700. subType: "log"
  4701. }, {
  4702. type: "line",
  4703. p0: {
  4704. x: 89,
  4705. y: 173
  4706. },
  4707. p1: {
  4708. x: 89,
  4709. y: 373
  4710. },
  4711. subType: "log"
  4712. }], [{
  4713. type: "bubble",
  4714. p0: {
  4715. x: 183,
  4716. y: 108
  4717. },
  4718. p1: {
  4719. x: 183,
  4720. y: 108
  4721. },
  4722. subType: "normal"
  4723. }, {
  4724. type: "bubble",
  4725. p0: {
  4726. x: 37,
  4727. y: 205
  4728. },
  4729. p1: {
  4730. x: 37,
  4731. y: 205
  4732. },
  4733. subType: "fire"
  4734. }, {
  4735. type: "bubble",
  4736. p0: {
  4737. x: 346,
  4738. y: 221
  4739. },
  4740. p1: {
  4741. x: 346,
  4742. y: 221
  4743. },
  4744. subType: "fire"
  4745. }, {
  4746. type: "bubble",
  4747. p0: {
  4748. x: 238,
  4749. y: 140
  4750. },
  4751. p1: {
  4752. x: 238,
  4753. y: 140
  4754. },
  4755. subType: "ice"
  4756. }, {
  4757. type: "bubble",
  4758. p0: {
  4759. x: 128,
  4760. y: 136
  4761. },
  4762. p1: {
  4763. x: 128,
  4764. y: 136
  4765. },
  4766. subType: "ice"
  4767. }, {
  4768. type: "bubble",
  4769. p0: {
  4770. x: 61,
  4771. y: 372
  4772. },
  4773. p1: {
  4774. x: 61,
  4775. y: 372
  4776. },
  4777. subType: "fire"
  4778. }, {
  4779. type: "bubble",
  4780. p0: {
  4781. x: 323,
  4782. y: 374
  4783. },
  4784. p1: {
  4785. x: 323,
  4786. y: 374
  4787. },
  4788. subType: "fire"
  4789. }, {
  4790. type: "bubble",
  4791. p0: {
  4792. x: 143,
  4793. y: 197
  4794. },
  4795. p1: {
  4796. x: 219,
  4797. y: 369
  4798. },
  4799. subType: "jellyfish"
  4800. }, {
  4801. type: "bubble",
  4802. p0: {
  4803. x: 338,
  4804. y: 294
  4805. },
  4806. p1: {
  4807. x: 35,
  4808. y: 273
  4809. },
  4810. subType: "jellyfish"
  4811. }, {
  4812. type: "bubble",
  4813. p0: {
  4814. x: 159,
  4815. y: 351
  4816. },
  4817. p1: {
  4818. x: 197,
  4819. y: 228
  4820. },
  4821. subType: "jellyfish"
  4822. }, {
  4823. type: "bubble",
  4824. p0: {
  4825. x: 285,
  4826. y: 237
  4827. },
  4828. p1: {
  4829. x: 106,
  4830. y: 326
  4831. },
  4832. subType: "jellyfish"
  4833. }, {
  4834. type: "bubble",
  4835. p0: {
  4836. x: 93,
  4837. y: 239
  4838. },
  4839. p1: {
  4840. x: 271,
  4841. y: 329
  4842. },
  4843. subType: "jellyfish"
  4844. }], [{
  4845. type: "bubble",
  4846. p0: {
  4847. x: 191,
  4848. y: 359
  4849. },
  4850. p1: {
  4851. x: 191,
  4852. y: 359
  4853. },
  4854. subType: "normal"
  4855. }, {
  4856. type: "bubble",
  4857. p0: {
  4858. x: 130,
  4859. y: 310
  4860. },
  4861. p1: {
  4862. x: 130,
  4863. y: 310
  4864. },
  4865. subType: "normal"
  4866. }, {
  4867. type: "bubble",
  4868. p0: {
  4869. x: 311,
  4870. y: 79
  4871. },
  4872. p1: {
  4873. x: 281,
  4874. y: 132
  4875. },
  4876. subType: "normal"
  4877. }, {
  4878. type: "bubble",
  4879. p0: {
  4880. x: 60,
  4881. y: 119
  4882. },
  4883. p1: {
  4884. x: 38,
  4885. y: 317
  4886. },
  4887. subType: "normal"
  4888. }, {
  4889. type: "bubble",
  4890. p0: {
  4891. x: 207,
  4892. y: 97
  4893. },
  4894. p1: {
  4895. x: 207,
  4896. y: 97
  4897. },
  4898. subType: "fire"
  4899. }, {
  4900. type: "bubble",
  4901. p0: {
  4902. x: 335,
  4903. y: 340
  4904. },
  4905. p1: {
  4906. x: 335,
  4907. y: 340
  4908. },
  4909. subType: "normal"
  4910. }, {
  4911. type: "bubble",
  4912. p0: {
  4913. x: 178,
  4914. y: 160
  4915. },
  4916. p1: {
  4917. x: 349,
  4918. y: 264
  4919. },
  4920. subType: "jellyfish"
  4921. }, {
  4922. type: "bubble",
  4923. p0: {
  4924. x: 119,
  4925. y: 120
  4926. },
  4927. p1: {
  4928. x: 119,
  4929. y: 120
  4930. },
  4931. subType: "ice"
  4932. }, {
  4933. type: "bubble",
  4934. p0: {
  4935. x: 336,
  4936. y: 187
  4937. },
  4938. p1: {
  4939. x: 336,
  4940. y: 187
  4941. },
  4942. subType: "fire"
  4943. }, {
  4944. type: "line",
  4945. p0: {
  4946. x: 115,
  4947. y: 192
  4948. },
  4949. p1: {
  4950. x: 281,
  4951. y: 304
  4952. },
  4953. subType: "log"
  4954. }], [{
  4955. type: "bubble",
  4956. p0: {
  4957. x: 214,
  4958. y: 141
  4959. },
  4960. p1: {
  4961. x: 214,
  4962. y: 141
  4963. },
  4964. subType: "normal"
  4965. }, {
  4966. type: "bubble",
  4967. p0: {
  4968. x: 131,
  4969. y: 157
  4970. },
  4971. p1: {
  4972. x: 131,
  4973. y: 157
  4974. },
  4975. subType: "fire"
  4976. }, {
  4977. type: "line",
  4978. p0: {
  4979. x: -87,
  4980. y: 185
  4981. },
  4982. p1: {
  4983. x: 72,
  4984. y: 307
  4985. },
  4986. subType: "log"
  4987. }, {
  4988. type: "bubble",
  4989. p0: {
  4990. x: 264,
  4991. y: 307
  4992. },
  4993. p1: {
  4994. x: 264,
  4995. y: 307
  4996. },
  4997. subType: "normal"
  4998. }, {
  4999. type: "bubble",
  5000. p0: {
  5001. x: 183,
  5002. y: 225
  5003. },
  5004. p1: {
  5005. x: 183,
  5006. y: 225
  5007. },
  5008. subType: "fire"
  5009. }, {
  5010. type: "bubble",
  5011. p0: {
  5012. x: 60,
  5013. y: 109
  5014. },
  5015. p1: {
  5016. x: 60,
  5017. y: 109
  5018. },
  5019. subType: "fire"
  5020. }, {
  5021. type: "bubble",
  5022. p0: {
  5023. x: 346,
  5024. y: 115
  5025. },
  5026. p1: {
  5027. x: 346,
  5028. y: 397
  5029. },
  5030. subType: "normal"
  5031. }, {
  5032. type: "bubble",
  5033. p0: {
  5034. x: 145,
  5035. y: 288
  5036. },
  5037. p1: {
  5038. x: 145,
  5039. y: 288
  5040. },
  5041. subType: "ice"
  5042. }, {
  5043. type: "bubble",
  5044. p0: {
  5045. x: 35,
  5046. y: 166
  5047. },
  5048. p1: {
  5049. x: 35,
  5050. y: 166
  5051. },
  5052. subType: "ice"
  5053. }, {
  5054. type: "bubble",
  5055. p0: {
  5056. x: 97,
  5057. y: 215
  5058. },
  5059. p1: {
  5060. x: 97,
  5061. y: 215
  5062. },
  5063. subType: "ice"
  5064. }], [{
  5065. type: "bubble",
  5066. p0: {
  5067. x: 325,
  5068. y: 194
  5069. },
  5070. p1: {
  5071. x: 336,
  5072. y: -2
  5073. },
  5074. subType: "jellyfish"
  5075. }, {
  5076. type: "bubble",
  5077. p0: {
  5078. x: 125,
  5079. y: 244
  5080. },
  5081. p1: {
  5082. x: 125,
  5083. y: 244
  5084. },
  5085. subType: "normal"
  5086. }, {
  5087. type: "bubble",
  5088. p0: {
  5089. x: 139,
  5090. y: 88
  5091. },
  5092. p1: {
  5093. x: 139,
  5094. y: 88
  5095. },
  5096. subType: "normal"
  5097. }, {
  5098. type: "bubble",
  5099. p0: {
  5100. x: 51,
  5101. y: 136
  5102. },
  5103. p1: {
  5104. x: 51,
  5105. y: 136
  5106. },
  5107. subType: "normal"
  5108. }, {
  5109. type: "line",
  5110. p0: {
  5111. x: 227,
  5112. y: 90
  5113. },
  5114. p1: {
  5115. x: 266,
  5116. y: -106
  5117. },
  5118. subType: "log"
  5119. }, {
  5120. type: "bubble",
  5121. p0: {
  5122. x: 346,
  5123. y: 350
  5124. },
  5125. p1: {
  5126. x: 346,
  5127. y: 350
  5128. },
  5129. subType: "normal"
  5130. }, {
  5131. type: "bubble",
  5132. p0: {
  5133. x: 229,
  5134. y: 352
  5135. },
  5136. p1: {
  5137. x: 229,
  5138. y: 352
  5139. },
  5140. subType: "normal"
  5141. }, {
  5142. type: "bubble",
  5143. p0: {
  5144. x: 50,
  5145. y: 304
  5146. },
  5147. p1: {
  5148. x: 50,
  5149. y: 304
  5150. },
  5151. subType: "normal"
  5152. }, {
  5153. type: "line",
  5154. p0: {
  5155. x: 158,
  5156. y: 418
  5157. },
  5158. p1: {
  5159. x: 197,
  5160. y: 222
  5161. },
  5162. subType: "log"
  5163. }, {
  5164. type: "bubble",
  5165. p0: {
  5166. x: 288,
  5167. y: 324
  5168. },
  5169. p1: {
  5170. x: 288,
  5171. y: 324
  5172. },
  5173. subType: "ice"
  5174. }, {
  5175. type: "bubble",
  5176. p0: {
  5177. x: 201,
  5178. y: 152
  5179. },
  5180. p1: {
  5181. x: 201,
  5182. y: 152
  5183. },
  5184. subType: "fire"
  5185. }]),
  5186. aLevelStore = new Array;
  5187. aLevelStore.push(0), aLevelStore.push(0);
  5188. for (var i = 0; 35 > i; i++) aLevelStore.push(1), aLevelStore.push(0);
  5189. if ("undefined" != typeof Storage)
  5190. if (null != localStorage.getItem("bubblefishBuddiesData")) {
  5191. aLevelStore = localStorage.getItem("bubblefishBuddiesData").split(",");
  5192. for (var a in aLevelStore) aLevelStore[a] = parseInt(aLevelStore[a])
  5193. } else saveData()