game.js 517 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102
  1. function logW() {
  2. console.log("window.c2_score =" + window.c2_score)
  3. }
  4. function isMobile() {
  5. if (navigator.appName == "Microsoft Internet Explorer") return true;
  6. var e = window.orientation;
  7. return e == null || e == undefined ? false : true
  8. }
  9. function getHighScore() {
  10. var e = localStorage[gameID + "high_score"];
  11. if ("" + e == "undefined") return "0";
  12. return e
  13. }
  14. function orientationListener() {
  15. if (!isMobile()) return;
  16. var e = window.innerWidth;
  17. var t = window.innerHeight;
  18. var n = e > t * 1.1 ? 0 : 1;
  19. if (n == 1) {
  20. document.getElementById("rotation").style.display = "none";
  21. document.getElementById("c2canvasdiv").style.display = "block"
  22. } else {
  23. document.getElementById("rotation").style.display = "block";
  24. document.getElementById("c2canvasdiv").style.display = "none"
  25. }
  26. }
  27. function easeOutBounce(e, t, n, r) {
  28. if ((e /= r) < 1 / 2.75) {
  29. return n * 7.5625 * e * e + t
  30. } else if (e < 2 / 2.75) {
  31. return n * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + t
  32. } else if (e < 2.5 / 2.75) {
  33. return n * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + t
  34. } else {
  35. return n * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + t
  36. }
  37. }
  38. function integerize(e, t) {
  39. return Math.round(e / t * litetween_precision)
  40. }
  41. function easeFunc(e, t, n, r, i) {
  42. switch (e) {
  43. case 0:
  44. return r * t / i + n;
  45. case 1:
  46. return r * (t /= i) * t + n;
  47. case 2:
  48. return -r * (t /= i) * (t - 2) + n;
  49. case 3:
  50. if ((t /= i / 2) < 1) return r / 2 * t * t + n;
  51. return -r / 2 * (--t * (t - 2) - 1) + n;
  52. case 4:
  53. return r * (t /= i) * t * t + n;
  54. case 5:
  55. return r * ((t = t / i - 1) * t * t + 1) + n;
  56. case 6:
  57. if ((t /= i / 2) < 1) return r / 2 * t * t * t + n;
  58. return r / 2 * ((t -= 2) * t * t + 2) + n;
  59. case 7:
  60. return r * (t /= i) * t * t * t + n;
  61. case 8:
  62. return -r * ((t = t / i - 1) * t * t * t - 1) + n;
  63. case 9:
  64. if ((t /= i / 2) < 1) return r / 2 * t * t * t * t + n;
  65. return -r / 2 * ((t -= 2) * t * t * t - 2) + n;
  66. case 10:
  67. return r * (t /= i) * t * t * t * t + n;
  68. case 11:
  69. return r * ((t = t / i - 1) * t * t * t * t + 1) + n;
  70. case 12:
  71. if ((t /= i / 2) < 1) return r / 2 * t * t * t * t * t + n;
  72. return r / 2 * ((t -= 2) * t * t * t * t + 2) + n;
  73. case 13:
  74. return easeInCircle[integerize(t, i)];
  75. case 14:
  76. return easeOutCircle[integerize(t, i)];;
  77. case 15:
  78. return easeInOutCircle[integerize(t, i)];;
  79. case 16:
  80. var s = 0;
  81. if (s == 0) s = 1.70158;
  82. return r * (t /= i) * t * ((s + 1) * t - s) + n;
  83. case 17:
  84. return easeOutBack[integerize(t, i)];
  85. case 18:
  86. return easeInOutBack[integerize(t, i)];
  87. case 19:
  88. return easeInElasticArray[integerize(t, i)];
  89. case 20:
  90. return easeOutElasticArray[integerize(t, i)];
  91. case 21:
  92. return easeInOutElasticArray[integerize(t, i)];
  93. case 22:
  94. return r - easeOutBounceArray[integerize(i - t, i)] + n;
  95. case 23:
  96. return easeOutBounceArray[integerize(t, i)];
  97. case 24:
  98. if (t < i / 2) return (r - easeOutBounceArray[integerize(i - t * 2, i)] + n) * .5 + n;
  99. else return easeOutBounceArray[integerize(t * 2 - i, i)] * .5 + r * .5 + n;
  100. case 25:
  101. var o = t / i / 2;
  102. return 2 * o * o * (3 - 2 * o);
  103. case 26:
  104. var o = (t / i + 1) / 2;
  105. return 2 * o * o * (3 - 2 * o) - 1;
  106. case 27:
  107. var o = t / i;
  108. return o * o * (3 - 2 * o)
  109. }
  110. return 0
  111. }
  112. function trim(e) {
  113. return e.replace(/^\s\s*/, "").replace(/\s\s*$/, "")
  114. }
  115. function startCutting() {
  116. kye();
  117. }
  118. function kye() {
  119. function t() {
  120. if (document.hidden || document.mozHidden || document.webkitHidden || document.msHidden) cr_setSuspended(true);
  121. else cr_setSuspended(false)
  122. }
  123. var e = function() {
  124. cr_sizeCanvas(jQuery(window).width(), jQuery(window).height())
  125. };
  126. jQuery(window).resize(e);
  127. SG.setOrientationHandler(e);
  128. SG.setResizeHandler(e);
  129. cr_createRuntime("c2canvas");
  130. document.addEventListener("visibilitychange", t, false);
  131. document.addEventListener("mozvisibilitychange", t, false);
  132. document.addEventListener("webkitvisibilitychange", t, false);
  133. document.addEventListener("msvisibilitychange", t, false)
  134. }
  135. var gameID = "fruit_cut_ninja_";
  136. document.getElementById("rotation").style.display = "none";
  137. var cr = {};
  138. cr.plugins_ = {};
  139. cr.behaviors = {};
  140. if (typeof Object.getPrototypeOf !== "function") {
  141. if (typeof "test".__proto__ === "object") {
  142. Object.getPrototypeOf = function(e) {
  143. return e.__proto__
  144. }
  145. } else {
  146. Object.getPrototypeOf = function(e) {
  147. return e.constructor.prototype
  148. }
  149. }
  150. }(function() {
  151. function e(e, t) {
  152. this.x = e;
  153. this.y = t;
  154. cr.seal(this)
  155. }
  156. function t(e, t, n, r) {
  157. this.set(e, t, n, r);
  158. cr.seal(this)
  159. }
  160. function n() {
  161. this.tlx = 0;
  162. this.tly = 0;
  163. this.trx = 0;
  164. this.try_ = 0;
  165. this.brx = 0;
  166. this.bry = 0;
  167. this.blx = 0;
  168. this.bly = 0;
  169. cr.seal(this)
  170. }
  171. function s() {
  172. if (i) {
  173. this.s = new Set
  174. } else {
  175. this.items = {};
  176. this.item_count = 0
  177. }
  178. this.values_cache = [];
  179. this.cache_valid = true;
  180. cr.seal(this)
  181. }
  182. function a(e) {
  183. o[u++] = e
  184. }
  185. function f() {
  186. this.c = 0;
  187. this.y = 0;
  188. this.t = 0;
  189. this.sum = 0;
  190. cr.seal(this)
  191. }
  192. function l(e) {
  193. this.pts_cache = [];
  194. this.set_pts(e);
  195. cr.seal(this)
  196. }
  197. cr.logexport = function(e) {
  198. if (window.console && window.console.log) window.console.log(e)
  199. };
  200. cr.seal = function(e) {
  201. return e
  202. };
  203. cr.freeze = function(e) {
  204. return e
  205. };
  206. cr.is_undefined = function(e) {
  207. return typeof e === "undefined"
  208. };
  209. cr.is_number = function(e) {
  210. return typeof e === "number"
  211. };
  212. cr.is_string = function(e) {
  213. return typeof e === "string"
  214. };
  215. cr.isPOT = function(e) {
  216. return e > 0 && (e - 1 & e) === 0
  217. };
  218. cr.abs = function(e) {
  219. return e < 0 ? -e : e
  220. };
  221. cr.max = function(e, t) {
  222. return e > t ? e : t
  223. };
  224. cr.min = function(e, t) {
  225. return e < t ? e : t
  226. };
  227. cr.PI = Math.PI;
  228. cr.round = function(e) {
  229. return e + .5 | 0
  230. };
  231. cr.floor = function(e) {
  232. return e | 0
  233. };
  234. e.prototype.offset = function(e, t) {
  235. this.x += e;
  236. this.y += t;
  237. return this
  238. };
  239. e.prototype.mul = function(e, t) {
  240. this.x *= e;
  241. this.y *= t;
  242. return this
  243. };
  244. cr.vector2 = e;
  245. cr.segments_intersect = function(e, t, n, r, i, s, o, u) {
  246. if (cr.max(e, n) < cr.min(i, o) || cr.min(e, n) > cr.max(i, o) || cr.max(t, r) < cr.min(s, u) || cr.min(t, r) > cr.max(s, u)) {
  247. return false
  248. }
  249. var a = i - e + o - n;
  250. var f = s - t + u - r;
  251. var l = n - e;
  252. var c = r - t;
  253. var h = o - i;
  254. var p = u - s;
  255. var d = cr.abs(c * h - p * l);
  256. var v = h * f - p * a;
  257. var m = l * f - c * a;
  258. return cr.abs(v) <= d && cr.abs(m) <= d
  259. };
  260. t.prototype.set = function(e, t, n, r) {
  261. this.left = e;
  262. this.top = t;
  263. this.right = n;
  264. this.bottom = r
  265. };
  266. t.prototype.width = function() {
  267. return this.right - this.left
  268. };
  269. t.prototype.height = function() {
  270. return this.bottom - this.top
  271. };
  272. t.prototype.offset = function(e, t) {
  273. this.left += e;
  274. this.top += t;
  275. this.right += e;
  276. this.bottom += t;
  277. return this
  278. };
  279. t.prototype.intersects_rect = function(e) {
  280. return !(e.right < this.left || e.bottom < this.top || e.left > this.right || e.top > this.bottom)
  281. };
  282. t.prototype.contains_pt = function(e, t) {
  283. return e >= this.left && e <= this.right && t >= this.top && t <= this.bottom
  284. };
  285. cr.rect = t;
  286. n.prototype.set_from_rect = function(e) {
  287. this.tlx = e.left;
  288. this.tly = e.top;
  289. this.trx = e.right;
  290. this.try_ = e.top;
  291. this.brx = e.right;
  292. this.bry = e.bottom;
  293. this.blx = e.left;
  294. this.bly = e.bottom
  295. };
  296. n.prototype.set_from_rotated_rect = function(e, t) {
  297. if (t === 0) {
  298. this.set_from_rect(e)
  299. } else {
  300. var n = Math.sin(t);
  301. var r = Math.cos(t);
  302. var i = e.left * n;
  303. var s = e.top * n;
  304. var o = e.right * n;
  305. var u = e.bottom * n;
  306. var a = e.left * r;
  307. var f = e.top * r;
  308. var l = e.right * r;
  309. var c = e.bottom * r;
  310. this.tlx = a - s;
  311. this.tly = f + i;
  312. this.trx = l - s;
  313. this.try_ = f + o;
  314. this.brx = l - u;
  315. this.bry = c + o;
  316. this.blx = a - u;
  317. this.bly = c + i
  318. }
  319. };
  320. n.prototype.offset = function(e, t) {
  321. this.tlx += e;
  322. this.tly += t;
  323. this.trx += e;
  324. this.try_ += t;
  325. this.brx += e;
  326. this.bry += t;
  327. this.blx += e;
  328. this.bly += t;
  329. return this
  330. };
  331. n.prototype.bounding_box = function(e) {
  332. e.left = cr.min(cr.min(this.tlx, this.trx), cr.min(this.brx, this.blx));
  333. e.top = cr.min(cr.min(this.tly, this.try_), cr.min(this.bry, this.bly));
  334. e.right = cr.max(cr.max(this.tlx, this.trx), cr.max(this.brx, this.blx));
  335. e.bottom = cr.max(cr.max(this.tly, this.try_), cr.max(this.bry, this.bly))
  336. };
  337. n.prototype.contains_pt = function(e, t) {
  338. var n = this.trx - this.tlx;
  339. var r = this.try_ - this.tly;
  340. var i = this.brx - this.tlx;
  341. var s = this.bry - this.tly;
  342. var o = e - this.tlx;
  343. var u = t - this.tly;
  344. var a = n * n + r * r;
  345. var f = n * i + r * s;
  346. var l = n * o + r * u;
  347. var c = i * i + s * s;
  348. var h = i * o + s * u;
  349. var p = 1 / (a * c - f * f);
  350. var d = (c * l - f * h) * p;
  351. var v = (a * h - f * l) * p;
  352. if (d >= 0 && v > 0 && d + v < 1) return true;
  353. n = this.blx - this.tlx;
  354. r = this.bly - this.tly;
  355. var a = n * n + r * r;
  356. var f = n * i + r * s;
  357. var l = n * o + r * u;
  358. p = 1 / (a * c - f * f);
  359. d = (c * l - f * h) * p;
  360. v = (a * h - f * l) * p;
  361. return d >= 0 && v > 0 && d + v < 1
  362. };
  363. n.prototype.at = function(e, t) {
  364. switch (e) {
  365. case 0:
  366. return t ? this.tlx : this.tly;
  367. case 1:
  368. return t ? this.trx : this.try_;
  369. case 2:
  370. return t ? this.brx : this.bry;
  371. case 3:
  372. return t ? this.blx : this.bly;
  373. case 4:
  374. return t ? this.tlx : this.tly;
  375. default:
  376. return t ? this.tlx : this.tly
  377. }
  378. };
  379. n.prototype.midX = function() {
  380. return (this.tlx + this.trx + this.brx + this.blx) / 4
  381. };
  382. n.prototype.midY = function() {
  383. return (this.tly + this.try_ + this.bry + this.bly) / 4
  384. };
  385. n.prototype.intersects_segment = function(e, t, n, r) {
  386. if (this.contains_pt(e, t) || this.contains_pt(n, r)) return true;
  387. var i, s, o, u;
  388. var a;
  389. for (a = 0; a < 4; a++) {
  390. i = this.at(a, true);
  391. s = this.at(a, false);
  392. o = this.at(a + 1, true);
  393. u = this.at(a + 1, false);
  394. if (cr.segments_intersect(e, t, n, r, i, s, o, u)) return true
  395. }
  396. return false
  397. };
  398. n.prototype.intersects_quad = function(e) {
  399. var t = e.midX();
  400. var n = e.midY();
  401. if (this.contains_pt(t, n)) return true;
  402. t = this.midX();
  403. n = this.midY();
  404. if (e.contains_pt(t, n)) return true;
  405. var r, i, s, o, u, a, f, l;
  406. var c, h;
  407. for (c = 0; c < 4; c++) {
  408. for (h = 0; h < 4; h++) {
  409. r = this.at(c, true);
  410. i = this.at(c, false);
  411. s = this.at(c + 1, true);
  412. o = this.at(c + 1, false);
  413. u = e.at(h, true);
  414. a = e.at(h, false);
  415. f = e.at(h + 1, true);
  416. l = e.at(h + 1, false);
  417. if (cr.segments_intersect(r, i, s, o, u, a, f, l)) return true
  418. }
  419. }
  420. return false
  421. };
  422. cr.quad = n;
  423. cr.RGB = function(e, t, n) {
  424. return Math.max(Math.min(e, 255), 0) | Math.max(Math.min(t, 255), 0) << 8 | Math.max(Math.min(n, 255), 0) << 16
  425. };
  426. cr.GetRValue = function(e) {
  427. return e & 255
  428. };
  429. cr.GetGValue = function(e) {
  430. return (e & 65280) >> 8
  431. };
  432. cr.GetBValue = function(e) {
  433. return (e & 16711680) >> 16
  434. };
  435. cr.shallowCopy = function(e, t, n) {
  436. var r;
  437. for (r in t) {
  438. if (t.hasOwnProperty(r)) {
  439. e[r] = t[r]
  440. }
  441. }
  442. return e
  443. };
  444. cr.arrayRemove = function(e, t) {
  445. var n, r;
  446. t = cr.floor(t);
  447. if (t < 0 || t >= e.length) return;
  448. if (t === 0) e.shift();
  449. else if (t === e.length - 1) e.pop();
  450. else {
  451. for (n = t, r = e.length - 1; n < r; n++) e[n] = e[n + 1];
  452. e.length = r
  453. }
  454. };
  455. cr.shallowAssignArray = function(e, t) {
  456. e.length = t.length;
  457. var n, r;
  458. for (n = 0, r = t.length; n < r; n++) e[n] = t[n]
  459. };
  460. cr.arrayFindRemove = function(e, t) {
  461. var n = e.indexOf(t);
  462. if (n !== -1) cr.arrayRemove(e, n)
  463. };
  464. cr.clamp = function(e, t, n) {
  465. if (e < t) return t;
  466. else if (e > n) return n;
  467. else return e
  468. };
  469. cr.to_radians = function(e) {
  470. return e / (180 / cr.PI)
  471. };
  472. cr.to_degrees = function(e) {
  473. return e * (180 / cr.PI)
  474. };
  475. cr.clamp_angle_degrees = function(e) {
  476. e %= 360;
  477. if (e < 0) e += 360;
  478. return e
  479. };
  480. cr.clamp_angle = function(e) {
  481. e %= 2 * cr.PI;
  482. if (e < 0) e += 2 * cr.PI;
  483. return e
  484. };
  485. cr.to_clamped_degrees = function(e) {
  486. return cr.clamp_angle_degrees(cr.to_degrees(e))
  487. };
  488. cr.to_clamped_radians = function(e) {
  489. return cr.clamp_angle(cr.to_radians(e))
  490. };
  491. cr.angleTo = function(e, t, n, r) {
  492. var i = n - e;
  493. var s = r - t;
  494. return Math.atan2(s, i)
  495. };
  496. cr.angleDiff = function(e, t) {
  497. if (e === t) return 0;
  498. var n = Math.sin(e);
  499. var r = Math.cos(e);
  500. var i = Math.sin(t);
  501. var s = Math.cos(t);
  502. var o = n * i + r * s;
  503. if (o >= 1) return 0;
  504. if (o <= -1) return cr.PI;
  505. return Math.acos(o)
  506. };
  507. cr.angleRotate = function(e, t, n) {
  508. var r = Math.sin(e);
  509. var i = Math.cos(e);
  510. var s = Math.sin(t);
  511. var o = Math.cos(t);
  512. if (Math.acos(r * s + i * o) > n) {
  513. if (i * s - r * o > 0) return cr.clamp_angle(e + n);
  514. else return cr.clamp_angle(e - n)
  515. } else return cr.clamp_angle(t)
  516. };
  517. cr.angleClockwise = function(e, t) {
  518. var n = Math.sin(e);
  519. var r = Math.cos(e);
  520. var i = Math.sin(t);
  521. var s = Math.cos(t);
  522. return r * i - n * s <= 0
  523. };
  524. cr.rotatePtAround = function(e, t, n, r, i, s) {
  525. if (n === 0) return s ? e : t;
  526. var o = Math.sin(n);
  527. var u = Math.cos(n);
  528. e -= r;
  529. t -= i;
  530. var a = e * o;
  531. var f = t * o;
  532. var l = e * u;
  533. var c = t * u;
  534. e = l - f;
  535. t = c + a;
  536. e += r;
  537. t += i;
  538. return s ? e : t
  539. };
  540. cr.distanceTo = function(e, t, n, r) {
  541. var i = n - e;
  542. var s = r - t;
  543. return Math.sqrt(i * i + s * s)
  544. };
  545. cr.xor = function(e, t) {
  546. return !e !== !t
  547. };
  548. cr.lerp = function(e, t, n) {
  549. return e + (t - e) * n
  550. };
  551. cr.hasAnyOwnProperty = function(e) {
  552. var t;
  553. for (t in e) {
  554. if (e.hasOwnProperty(t)) return true
  555. }
  556. return false
  557. };
  558. cr.wipe = function(e) {
  559. var t;
  560. for (t in e) {
  561. if (e.hasOwnProperty(t)) delete e[t]
  562. }
  563. };
  564. var r = +(new Date);
  565. cr.performance_now = function() {
  566. if (typeof window["performance"] !== "undefined") {
  567. var e = window["performance"];
  568. if (typeof e.now !== "undefined") return e.now();
  569. else if (typeof e["webkitNow"] !== "undefined") return e["webkitNow"]();
  570. else if (typeof e["msNow"] !== "undefined") return e["msNow"]()
  571. }
  572. return Date.now() - r
  573. };
  574. var i = typeof Set !== "undefined" && typeof Set.prototype["forEach"] !== "undefined";
  575. s.prototype.contains = function(e) {
  576. if (i) return this.s["has"](e);
  577. else return this.items.hasOwnProperty(e.toString())
  578. };
  579. s.prototype.add = function(e) {
  580. if (i) {
  581. if (!this.s["has"](e)) {
  582. this.s["add"](e);
  583. this.cache_valid = false
  584. }
  585. } else {
  586. var t = e.toString();
  587. if (!this.items.hasOwnProperty(t)) {
  588. this.items[t] = e;
  589. this.item_count++;
  590. this.cache_valid = false
  591. }
  592. }
  593. return this
  594. };
  595. s.prototype.remove = function(e) {
  596. if (i) {
  597. if (this.s["has"](e)) {
  598. this.s["delete"](e);
  599. this.cache_valid = false
  600. }
  601. } else {
  602. var t = e.toString();
  603. if (this.items.hasOwnProperty(t)) {
  604. delete this.items[t];
  605. this.item_count--;
  606. this.cache_valid = false
  607. }
  608. }
  609. return this
  610. };
  611. s.prototype.clear = function() {
  612. if (i) {
  613. this.s["clear"]()
  614. } else {
  615. cr.wipe(this.items);
  616. this.item_count = 0
  617. }
  618. this.values_cache.length = 0;
  619. this.cache_valid = true;
  620. return this
  621. };
  622. s.prototype.isEmpty = function() {
  623. if (i) return this.s["size"] === 0;
  624. else return this.item_count === 0
  625. };
  626. s.prototype.count = function() {
  627. if (i) return this.s["size"];
  628. else return this.item_count
  629. };
  630. var o = null;
  631. var u = 0;
  632. s.prototype.update_cache = function() {
  633. if (this.cache_valid) return;
  634. if (i) {
  635. this.values_cache.length = this.s["size"];
  636. o = this.values_cache;
  637. u = 0;
  638. this.s["forEach"](a);
  639. o = null;
  640. u = 0
  641. } else {
  642. this.values_cache.length = this.item_count;
  643. var e, t = 0;
  644. for (e in this.items) {
  645. if (this.items.hasOwnProperty(e)) this.values_cache[t++] = this.items[e]
  646. }
  647. }
  648. this.cache_valid = true
  649. };
  650. s.prototype.values = function() {
  651. this.update_cache();
  652. return this.values_cache.slice(0)
  653. };
  654. s.prototype.valuesRef = function() {
  655. this.update_cache();
  656. return this.values_cache
  657. };
  658. cr.ObjectSet = s;
  659. f.prototype.add = function(e) {
  660. this.y = e - this.c;
  661. this.t = this.sum + this.y;
  662. this.c = this.t - this.sum - this.y;
  663. this.sum = this.t
  664. };
  665. f.prototype.reset = function() {
  666. this.c = 0;
  667. this.y = 0;
  668. this.t = 0;
  669. this.sum = 0
  670. };
  671. cr.KahanAdder = f;
  672. cr.regexp_escape = function(e) {
  673. return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")
  674. };
  675. l.prototype.set_pts = function(e) {
  676. this.pts_array = e;
  677. this.pts_count = e.length / 2;
  678. this.pts_cache.length = e.length;
  679. this.cache_width = -1;
  680. this.cache_height = -1;
  681. this.cache_angle = 0
  682. };
  683. l.prototype.is_empty = function() {
  684. return !this.pts_array.length
  685. };
  686. l.prototype.set_from_quad = function(e, t, n, r, i) {
  687. this.pts_cache.length = 8;
  688. this.pts_count = 4;
  689. var s = this.pts_cache;
  690. s[0] = e.tlx - t;
  691. s[1] = e.tly - n;
  692. s[2] = e.trx - t;
  693. s[3] = e.try_ - n;
  694. s[4] = e.brx - t;
  695. s[5] = e.bry - n;
  696. s[6] = e.blx - t;
  697. s[7] = e.bly - n;
  698. this.cache_width = r;
  699. this.cache_height = i
  700. };
  701. l.prototype.set_from_poly = function(e) {
  702. this.pts_count = e.pts_count;
  703. cr.shallowAssignArray(this.pts_cache, e.pts_cache)
  704. };
  705. l.prototype.cache_poly = function(e, t, n) {
  706. if (this.cache_width === e && this.cache_height === t && this.cache_angle === n) return;
  707. this.cache_width = e;
  708. this.cache_height = t;
  709. this.cache_angle = n;
  710. var r, i, s, o;
  711. var u = 0;
  712. var a = 1;
  713. var f = this.pts_array;
  714. var l = this.pts_cache;
  715. if (n !== 0) {
  716. u = Math.sin(n);
  717. a = Math.cos(n)
  718. }
  719. for (r = 0, i = this.pts_count; r < i; r++) {
  720. s = f[r * 2] * e;
  721. o = f[r * 2 + 1] * t;
  722. l[r * 2] = s * a - o * u;
  723. l[r * 2 + 1] = o * a + s * u
  724. }
  725. };
  726. l.prototype.contains_pt = function(e, t) {
  727. var n = this.pts_cache;
  728. if (e === n[0] && t === n[1]) return true;
  729. var r, i, s, o = this.pts_count;
  730. var u = n[0];
  731. var a = u;
  732. var f = n[1];
  733. var l = f;
  734. for (r = 1; r < o; r++) {
  735. i = n[r * 2];
  736. s = n[r * 2 + 1];
  737. if (i < u) u = i;
  738. if (i > a) a = i;
  739. if (s < f) f = s;
  740. if (s > l) l = s
  741. }
  742. var c = u - 110;
  743. var h = f - 101;
  744. var p = a + 131;
  745. var d = l + 120;
  746. var v, m, g, y;
  747. var b = 0,
  748. w = 0;
  749. for (r = 0; r < o; r++) {
  750. v = n[r * 2];
  751. m = n[r * 2 + 1];
  752. g = n[(r + 1) % o * 2];
  753. y = n[(r + 1) % o * 2 + 1];
  754. if (cr.segments_intersect(c, h, e, t, v, m, g, y)) b++;
  755. if (cr.segments_intersect(p, d, e, t, v, m, g, y)) w++
  756. }
  757. return b % 2 === 1 || w % 2 === 1
  758. };
  759. l.prototype.intersects_poly = function(e, t, n) {
  760. var r = e.pts_cache;
  761. var i = this.pts_cache;
  762. if (this.contains_pt(r[0] + t, r[1] + n)) return true;
  763. if (e.contains_pt(i[0] - t, i[1] - n)) return true;
  764. var s, o, u, a;
  765. var f, l, c, h, p, d, v, m;
  766. for (s = 0, o = this.pts_count; s < o; s++) {
  767. f = i[s * 2];
  768. l = i[s * 2 + 1];
  769. c = i[(s + 1) % o * 2];
  770. h = i[(s + 1) % o * 2 + 1];
  771. for (u = 0, a = e.pts_count; u < a; u++) {
  772. p = r[u * 2] + t;
  773. d = r[u * 2 + 1] + n;
  774. v = r[(u + 1) % a * 2] + t;
  775. m = r[(u + 1) % a * 2 + 1] + n;
  776. if (cr.segments_intersect(f, l, c, h, p, d, v, m)) return true
  777. }
  778. }
  779. return false
  780. };
  781. l.prototype.intersects_segment = function(e, t, n, r, i, s) {
  782. var o = this.pts_cache;
  783. if (this.contains_pt(n - e, r - t)) return true;
  784. var u, a;
  785. var f, l, c, h;
  786. for (u = 0, a = this.pts_count; u < a; u++) {
  787. f = o[u * 2] + e;
  788. l = o[u * 2 + 1] + t;
  789. c = o[(u + 1) % a * 2] + e;
  790. h = o[(u + 1) % a * 2 + 1] + t;
  791. if (cr.segments_intersect(n, r, i, s, f, l, c, h)) return true
  792. }
  793. return false
  794. };
  795. cr.CollisionPoly = l;
  796. var c = ["lighter", "xor", "copy", "destination-over", "source-in", "destination-in", "source-out", "destination-out", "source-atop", "destination-atop"];
  797. cr.effectToCompositeOp = function(e) {
  798. if (e <= 0 || e >= 11) return "source-over";
  799. return c[e - 1]
  800. };
  801. cr.setGLBlend = function(e, t, n) {
  802. if (!n) return;
  803. e.srcBlend = n.ONE;
  804. e.destBlend = n.ONE_MINUS_SRC_ALPHA;
  805. switch (t) {
  806. case 1:
  807. e.srcBlend = n.ONE;
  808. e.destBlend = n.ONE;
  809. break;
  810. case 2:
  811. break;
  812. case 3:
  813. e.srcBlend = n.ONE;
  814. e.destBlend = n.ZERO;
  815. break;
  816. case 4:
  817. e.srcBlend = n.ONE_MINUS_DST_ALPHA;
  818. e.destBlend = n.ONE;
  819. break;
  820. case 5:
  821. e.srcBlend = n.DST_ALPHA;
  822. e.destBlend = n.ZERO;
  823. break;
  824. case 6:
  825. e.srcBlend = n.ZERO;
  826. e.destBlend = n.SRC_ALPHA;
  827. break;
  828. case 7:
  829. e.srcBlend = n.ONE_MINUS_DST_ALPHA;
  830. e.destBlend = n.ZERO;
  831. break;
  832. case 8:
  833. e.srcBlend = n.ZERO;
  834. e.destBlend = n.ONE_MINUS_SRC_ALPHA;
  835. break;
  836. case 9:
  837. e.srcBlend = n.DST_ALPHA;
  838. e.destBlend = n.ONE_MINUS_SRC_ALPHA;
  839. break;
  840. case 10:
  841. e.srcBlend = n.ONE_MINUS_DST_ALPHA;
  842. e.destBlend = n.SRC_ALPHA;
  843. break
  844. }
  845. };
  846. cr.round6dp = function(e) {
  847. return Math.round(e * 1e6) / 1e6
  848. };
  849. cr.equals_nocase = function(e, t) {
  850. if (typeof e !== "string" || typeof t !== "string") return false;
  851. if (e.length !== t.length) return false;
  852. if (e === t) return true;
  853. return e.toLowerCase() === t.toLowerCase()
  854. }
  855. })();
  856. var MatrixArray = typeof Float32Array !== "undefined" ? Float32Array : Array,
  857. glMatrixArrayType = MatrixArray,
  858. vec3 = {},
  859. mat3 = {},
  860. mat4 = {},
  861. quat4 = {};
  862. vec3.create = function(e) {
  863. var t = new MatrixArray(3);
  864. e && (t[0] = e[0], t[1] = e[1], t[2] = e[2]);
  865. return t
  866. };
  867. vec3.set = function(e, t) {
  868. t[0] = e[0];
  869. t[1] = e[1];
  870. t[2] = e[2];
  871. return t
  872. };
  873. vec3.add = function(e, t, n) {
  874. if (!n || e === n) return e[0] += t[0], e[1] += t[1], e[2] += t[2], e;
  875. n[0] = e[0] + t[0];
  876. n[1] = e[1] + t[1];
  877. n[2] = e[2] + t[2];
  878. return n
  879. };
  880. vec3.subtract = function(e, t, n) {
  881. if (!n || e === n) return e[0] -= t[0], e[1] -= t[1], e[2] -= t[2], e;
  882. n[0] = e[0] - t[0];
  883. n[1] = e[1] - t[1];
  884. n[2] = e[2] - t[2];
  885. return n
  886. };
  887. vec3.negate = function(e, t) {
  888. t || (t = e);
  889. t[0] = -e[0];
  890. t[1] = -e[1];
  891. t[2] = -e[2];
  892. return t
  893. };
  894. vec3.scale = function(e, t, n) {
  895. if (!n || e === n) return e[0] *= t, e[1] *= t, e[2] *= t, e;
  896. n[0] = e[0] * t;
  897. n[1] = e[1] * t;
  898. n[2] = e[2] * t;
  899. return n
  900. };
  901. vec3.normalize = function(e, t) {
  902. t || (t = e);
  903. var n = e[0],
  904. r = e[1],
  905. i = e[2],
  906. s = Math.sqrt(n * n + r * r + i * i);
  907. if (s) {
  908. if (s === 1) return t[0] = n, t[1] = r, t[2] = i, t
  909. } else return t[0] = 0, t[1] = 0, t[2] = 0, t;
  910. s = 1 / s;
  911. t[0] = n * s;
  912. t[1] = r * s;
  913. t[2] = i * s;
  914. return t
  915. };
  916. vec3.cross = function(e, t, n) {
  917. n || (n = e);
  918. var r = e[0],
  919. i = e[1],
  920. e = e[2],
  921. s = t[0],
  922. o = t[1],
  923. t = t[2];
  924. n[0] = i * t - e * o;
  925. n[1] = e * s - r * t;
  926. n[2] = r * o - i * s;
  927. return n
  928. };
  929. vec3.length = function(e) {
  930. var t = e[0],
  931. n = e[1],
  932. e = e[2];
  933. return Math.sqrt(t * t + n * n + e * e)
  934. };
  935. vec3.dot = function(e, t) {
  936. return e[0] * t[0] + e[1] * t[1] + e[2] * t[2]
  937. };
  938. vec3.direction = function(e, t, n) {
  939. n || (n = e);
  940. var r = e[0] - t[0],
  941. i = e[1] - t[1],
  942. e = e[2] - t[2],
  943. t = Math.sqrt(r * r + i * i + e * e);
  944. if (!t) return n[0] = 0, n[1] = 0, n[2] = 0, n;
  945. t = 1 / t;
  946. n[0] = r * t;
  947. n[1] = i * t;
  948. n[2] = e * t;
  949. return n
  950. };
  951. vec3.lerp = function(e, t, n, r) {
  952. r || (r = e);
  953. r[0] = e[0] + n * (t[0] - e[0]);
  954. r[1] = e[1] + n * (t[1] - e[1]);
  955. r[2] = e[2] + n * (t[2] - e[2]);
  956. return r
  957. };
  958. vec3.str = function(e) {
  959. return "[" + e[0] + ", " + e[1] + ", " + e[2] + "]"
  960. };
  961. mat3.create = function(e) {
  962. var t = new MatrixArray(9);
  963. e && (t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t[4] = e[4], t[5] = e[5], t[6] = e[6], t[7] = e[7], t[8] = e[8]);
  964. return t
  965. };
  966. mat3.set = function(e, t) {
  967. t[0] = e[0];
  968. t[1] = e[1];
  969. t[2] = e[2];
  970. t[3] = e[3];
  971. t[4] = e[4];
  972. t[5] = e[5];
  973. t[6] = e[6];
  974. t[7] = e[7];
  975. t[8] = e[8];
  976. return t
  977. };
  978. mat3.identity = function(e) {
  979. e[0] = 1;
  980. e[1] = 0;
  981. e[2] = 0;
  982. e[3] = 0;
  983. e[4] = 1;
  984. e[5] = 0;
  985. e[6] = 0;
  986. e[7] = 0;
  987. e[8] = 1;
  988. return e
  989. };
  990. mat3.transpose = function(e, t) {
  991. if (!t || e === t) {
  992. var n = e[1],
  993. r = e[2],
  994. i = e[5];
  995. e[1] = e[3];
  996. e[2] = e[6];
  997. e[3] = n;
  998. e[5] = e[7];
  999. e[6] = r;
  1000. e[7] = i;
  1001. return e
  1002. }
  1003. t[0] = e[0];
  1004. t[1] = e[3];
  1005. t[2] = e[6];
  1006. t[3] = e[1];
  1007. t[4] = e[4];
  1008. t[5] = e[7];
  1009. t[6] = e[2];
  1010. t[7] = e[5];
  1011. t[8] = e[8];
  1012. return t
  1013. };
  1014. mat3.toMat4 = function(e, t) {
  1015. t || (t = mat4.create());
  1016. t[15] = 1;
  1017. t[14] = 0;
  1018. t[13] = 0;
  1019. t[12] = 0;
  1020. t[11] = 0;
  1021. t[10] = e[8];
  1022. t[9] = e[7];
  1023. t[8] = e[6];
  1024. t[7] = 0;
  1025. t[6] = e[5];
  1026. t[5] = e[4];
  1027. t[4] = e[3];
  1028. t[3] = 0;
  1029. t[2] = e[2];
  1030. t[1] = e[1];
  1031. t[0] = e[0];
  1032. return t
  1033. };
  1034. mat3.str = function(e) {
  1035. return "[" + e[0] + ", " + e[1] + ", " + e[2] + ", " + e[3] + ", " + e[4] + ", " + e[5] + ", " + e[6] + ", " + e[7] + ", " + e[8] + "]"
  1036. };
  1037. mat4.create = function(e) {
  1038. var t = new MatrixArray(16);
  1039. e && (t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t[4] = e[4], t[5] = e[5], t[6] = e[6], t[7] = e[7], t[8] = e[8], t[9] = e[9], t[10] = e[10], t[11] = e[11], t[12] = e[12], t[13] = e[13], t[14] = e[14], t[15] = e[15]);
  1040. return t
  1041. };
  1042. mat4.set = function(e, t) {
  1043. t[0] = e[0];
  1044. t[1] = e[1];
  1045. t[2] = e[2];
  1046. t[3] = e[3];
  1047. t[4] = e[4];
  1048. t[5] = e[5];
  1049. t[6] = e[6];
  1050. t[7] = e[7];
  1051. t[8] = e[8];
  1052. t[9] = e[9];
  1053. t[10] = e[10];
  1054. t[11] = e[11];
  1055. t[12] = e[12];
  1056. t[13] = e[13];
  1057. t[14] = e[14];
  1058. t[15] = e[15];
  1059. return t
  1060. };
  1061. mat4.identity = function(e) {
  1062. e[0] = 1;
  1063. e[1] = 0;
  1064. e[2] = 0;
  1065. e[3] = 0;
  1066. e[4] = 0;
  1067. e[5] = 1;
  1068. e[6] = 0;
  1069. e[7] = 0;
  1070. e[8] = 0;
  1071. e[9] = 0;
  1072. e[10] = 1;
  1073. e[11] = 0;
  1074. e[12] = 0;
  1075. e[13] = 0;
  1076. e[14] = 0;
  1077. e[15] = 1;
  1078. return e
  1079. };
  1080. mat4.transpose = function(e, t) {
  1081. if (!t || e === t) {
  1082. var n = e[1],
  1083. r = e[2],
  1084. i = e[3],
  1085. s = e[6],
  1086. o = e[7],
  1087. u = e[11];
  1088. e[1] = e[4];
  1089. e[2] = e[8];
  1090. e[3] = e[12];
  1091. e[4] = n;
  1092. e[6] = e[9];
  1093. e[7] = e[13];
  1094. e[8] = r;
  1095. e[9] = s;
  1096. e[11] = e[14];
  1097. e[12] = i;
  1098. e[13] = o;
  1099. e[14] = u;
  1100. return e
  1101. }
  1102. t[0] = e[0];
  1103. t[1] = e[4];
  1104. t[2] = e[8];
  1105. t[3] = e[12];
  1106. t[4] = e[1];
  1107. t[5] = e[5];
  1108. t[6] = e[9];
  1109. t[7] = e[13];
  1110. t[8] = e[2];
  1111. t[9] = e[6];
  1112. t[10] = e[10];
  1113. t[11] = e[14];
  1114. t[12] = e[3];
  1115. t[13] = e[7];
  1116. t[14] = e[11];
  1117. t[15] = e[15];
  1118. return t
  1119. };
  1120. mat4.determinant = function(e) {
  1121. var t = e[0],
  1122. n = e[1],
  1123. r = e[2],
  1124. i = e[3],
  1125. s = e[4],
  1126. o = e[5],
  1127. u = e[6],
  1128. a = e[7],
  1129. f = e[8],
  1130. l = e[9],
  1131. c = e[10],
  1132. h = e[11],
  1133. p = e[12],
  1134. d = e[13],
  1135. v = e[14],
  1136. e = e[15];
  1137. return p * l * u * i - f * d * u * i - p * o * c * i + s * d * c * i + f * o * v * i - s * l * v * i - p * l * r * a + f * d * r * a + p * n * c * a - t * d * c * a - f * n * v * a + t * l * v * a + p * o * r * h - s * d * r * h - p * n * u * h + t * d * u * h + s * n * v * h - t * o * v * h - f * o * r * e + s * l * r * e + f * n * u * e - t * l * u * e - s * n * c * e + t * o * c * e
  1138. };
  1139. mat4.inverse = function(e, t) {
  1140. t || (t = e);
  1141. var n = e[0],
  1142. r = e[1],
  1143. i = e[2],
  1144. s = e[3],
  1145. o = e[4],
  1146. u = e[5],
  1147. a = e[6],
  1148. f = e[7],
  1149. l = e[8],
  1150. c = e[9],
  1151. h = e[10],
  1152. p = e[11],
  1153. d = e[12],
  1154. v = e[13],
  1155. m = e[14],
  1156. g = e[15],
  1157. y = n * u - r * o,
  1158. b = n * a - i * o,
  1159. w = n * f - s * o,
  1160. E = r * a - i * u,
  1161. S = r * f - s * u,
  1162. x = i * f - s * a,
  1163. T = l * v - c * d,
  1164. N = l * m - h * d,
  1165. C = l * g - p * d,
  1166. k = c * m - h * v,
  1167. L = c * g - p * v,
  1168. A = h * g - p * m,
  1169. O = 1 / (y * A - b * L + w * k + E * C - S * N + x * T);
  1170. t[0] = (u * A - a * L + f * k) * O;
  1171. t[1] = (-r * A + i * L - s * k) * O;
  1172. t[2] = (v * x - m * S + g * E) * O;
  1173. t[3] = (-c * x + h * S - p * E) * O;
  1174. t[4] = (-o * A + a * C - f * N) * O;
  1175. t[5] = (n * A - i * C + s * N) * O;
  1176. t[6] = (-d * x + m * w - g * b) * O;
  1177. t[7] = (l * x - h * w + p * b) * O;
  1178. t[8] = (o * L - u * C + f * T) * O;
  1179. t[9] = (-n * L + r * C - s * T) * O;
  1180. t[10] = (d * S - v * w + g * y) * O;
  1181. t[11] = (-l * S + c * w - p * y) * O;
  1182. t[12] = (-o * k + u * N - a * T) * O;
  1183. t[13] = (n * k - r * N + i * T) * O;
  1184. t[14] = (-d * E + v * b - m * y) * O;
  1185. t[15] = (l * E - c * b + h * y) * O;
  1186. return t
  1187. };
  1188. mat4.toRotationMat = function(e, t) {
  1189. t || (t = mat4.create());
  1190. t[0] = e[0];
  1191. t[1] = e[1];
  1192. t[2] = e[2];
  1193. t[3] = e[3];
  1194. t[4] = e[4];
  1195. t[5] = e[5];
  1196. t[6] = e[6];
  1197. t[7] = e[7];
  1198. t[8] = e[8];
  1199. t[9] = e[9];
  1200. t[10] = e[10];
  1201. t[11] = e[11];
  1202. t[12] = 0;
  1203. t[13] = 0;
  1204. t[14] = 0;
  1205. t[15] = 1;
  1206. return t
  1207. };
  1208. mat4.toMat3 = function(e, t) {
  1209. t || (t = mat3.create());
  1210. t[0] = e[0];
  1211. t[1] = e[1];
  1212. t[2] = e[2];
  1213. t[3] = e[4];
  1214. t[4] = e[5];
  1215. t[5] = e[6];
  1216. t[6] = e[8];
  1217. t[7] = e[9];
  1218. t[8] = e[10];
  1219. return t
  1220. };
  1221. mat4.toInverseMat3 = function(e, t) {
  1222. var n = e[0],
  1223. r = e[1],
  1224. i = e[2],
  1225. s = e[4],
  1226. o = e[5],
  1227. u = e[6],
  1228. a = e[8],
  1229. f = e[9],
  1230. l = e[10],
  1231. c = l * o - u * f,
  1232. h = -l * s + u * a,
  1233. p = f * s - o * a,
  1234. d = n * c + r * h + i * p;
  1235. if (!d) return null;
  1236. d = 1 / d;
  1237. t || (t = mat3.create());
  1238. t[0] = c * d;
  1239. t[1] = (-l * r + i * f) * d;
  1240. t[2] = (u * r - i * o) * d;
  1241. t[3] = h * d;
  1242. t[4] = (l * n - i * a) * d;
  1243. t[5] = (-u * n + i * s) * d;
  1244. t[6] = p * d;
  1245. t[7] = (-f * n + r * a) * d;
  1246. t[8] = (o * n - r * s) * d;
  1247. return t
  1248. };
  1249. mat4.multiply = function(e, t, n) {
  1250. n || (n = e);
  1251. var r = e[0],
  1252. i = e[1],
  1253. s = e[2],
  1254. o = e[3],
  1255. u = e[4],
  1256. a = e[5],
  1257. f = e[6],
  1258. l = e[7],
  1259. c = e[8],
  1260. h = e[9],
  1261. p = e[10],
  1262. d = e[11],
  1263. v = e[12],
  1264. m = e[13],
  1265. g = e[14],
  1266. e = e[15],
  1267. y = t[0],
  1268. b = t[1],
  1269. w = t[2],
  1270. E = t[3],
  1271. S = t[4],
  1272. x = t[5],
  1273. T = t[6],
  1274. N = t[7],
  1275. C = t[8],
  1276. k = t[9],
  1277. L = t[10],
  1278. A = t[11],
  1279. O = t[12],
  1280. M = t[13],
  1281. _ = t[14],
  1282. t = t[15];
  1283. n[0] = y * r + b * u + w * c + E * v;
  1284. n[1] = y * i + b * a + w * h + E * m;
  1285. n[2] = y * s + b * f + w * p + E * g;
  1286. n[3] = y * o + b * l + w * d + E * e;
  1287. n[4] = S * r + x * u + T * c + N * v;
  1288. n[5] = S * i + x * a + T * h + N * m;
  1289. n[6] = S * s + x * f + T * p + N * g;
  1290. n[7] = S * o + x * l + T * d + N * e;
  1291. n[8] = C * r + k * u + L * c + A * v;
  1292. n[9] = C * i + k * a + L * h + A * m;
  1293. n[10] = C * s + k * f + L * p + A * g;
  1294. n[11] = C * o + k * l + L * d + A * e;
  1295. n[12] = O * r + M * u + _ * c + t * v;
  1296. n[13] = O * i + M * a + _ * h + t * m;
  1297. n[14] = O * s + M * f + _ * p + t * g;
  1298. n[15] = O * o + M * l + _ * d + t * e;
  1299. return n
  1300. };
  1301. mat4.multiplyVec3 = function(e, t, n) {
  1302. n || (n = t);
  1303. var r = t[0],
  1304. i = t[1],
  1305. t = t[2];
  1306. n[0] = e[0] * r + e[4] * i + e[8] * t + e[12];
  1307. n[1] = e[1] * r + e[5] * i + e[9] * t + e[13];
  1308. n[2] = e[2] * r + e[6] * i + e[10] * t + e[14];
  1309. return n
  1310. };
  1311. mat4.multiplyVec4 = function(e, t, n) {
  1312. n || (n = t);
  1313. var r = t[0],
  1314. i = t[1],
  1315. s = t[2],
  1316. t = t[3];
  1317. n[0] = e[0] * r + e[4] * i + e[8] * s + e[12] * t;
  1318. n[1] = e[1] * r + e[5] * i + e[9] * s + e[13] * t;
  1319. n[2] = e[2] * r + e[6] * i + e[10] * s + e[14] * t;
  1320. n[3] = e[3] * r + e[7] * i + e[11] * s + e[15] * t;
  1321. return n
  1322. };
  1323. mat4.translate = function(e, t, n) {
  1324. var r = t[0],
  1325. i = t[1],
  1326. t = t[2],
  1327. s, o, u, a, f, l, c, h, p, d, v, m;
  1328. if (!n || e === n) return e[12] = e[0] * r + e[4] * i + e[8] * t + e[12], e[13] = e[1] * r + e[5] * i + e[9] * t + e[13], e[14] = e[2] * r + e[6] * i + e[10] * t + e[14], e[15] = e[3] * r + e[7] * i + e[11] * t + e[15], e;
  1329. s = e[0];
  1330. o = e[1];
  1331. u = e[2];
  1332. a = e[3];
  1333. f = e[4];
  1334. l = e[5];
  1335. c = e[6];
  1336. h = e[7];
  1337. p = e[8];
  1338. d = e[9];
  1339. v = e[10];
  1340. m = e[11];
  1341. n[0] = s;
  1342. n[1] = o;
  1343. n[2] = u;
  1344. n[3] = a;
  1345. n[4] = f;
  1346. n[5] = l;
  1347. n[6] = c;
  1348. n[7] = h;
  1349. n[8] = p;
  1350. n[9] = d;
  1351. n[10] = v;
  1352. n[11] = m;
  1353. n[12] = s * r + f * i + p * t + e[12];
  1354. n[13] = o * r + l * i + d * t + e[13];
  1355. n[14] = u * r + c * i + v * t + e[14];
  1356. n[15] = a * r + h * i + m * t + e[15];
  1357. return n
  1358. };
  1359. mat4.scale = function(e, t, n) {
  1360. var r = t[0],
  1361. i = t[1],
  1362. t = t[2];
  1363. if (!n || e === n) return e[0] *= r, e[1] *= r, e[2] *= r, e[3] *= r, e[4] *= i, e[5] *= i, e[6] *= i, e[7] *= i, e[8] *= t, e[9] *= t, e[10] *= t, e[11] *= t, e;
  1364. n[0] = e[0] * r;
  1365. n[1] = e[1] * r;
  1366. n[2] = e[2] * r;
  1367. n[3] = e[3] * r;
  1368. n[4] = e[4] * i;
  1369. n[5] = e[5] * i;
  1370. n[6] = e[6] * i;
  1371. n[7] = e[7] * i;
  1372. n[8] = e[8] * t;
  1373. n[9] = e[9] * t;
  1374. n[10] = e[10] * t;
  1375. n[11] = e[11] * t;
  1376. n[12] = e[12];
  1377. n[13] = e[13];
  1378. n[14] = e[14];
  1379. n[15] = e[15];
  1380. return n
  1381. };
  1382. mat4.rotate = function(e, t, n, r) {
  1383. var i = n[0],
  1384. s = n[1],
  1385. n = n[2],
  1386. o = Math.sqrt(i * i + s * s + n * n),
  1387. u, a, f, l, c, h, p, d, v, m, g, y, b, w, E, S, x, T, N, C;
  1388. if (!o) return null;
  1389. o !== 1 && (o = 1 / o, i *= o, s *= o, n *= o);
  1390. u = Math.sin(t);
  1391. a = Math.cos(t);
  1392. f = 1 - a;
  1393. t = e[0];
  1394. o = e[1];
  1395. l = e[2];
  1396. c = e[3];
  1397. h = e[4];
  1398. p = e[5];
  1399. d = e[6];
  1400. v = e[7];
  1401. m = e[8];
  1402. g = e[9];
  1403. y = e[10];
  1404. b = e[11];
  1405. w = i * i * f + a;
  1406. E = s * i * f + n * u;
  1407. S = n * i * f - s * u;
  1408. x = i * s * f - n * u;
  1409. T = s * s * f + a;
  1410. N = n * s * f + i * u;
  1411. C = i * n * f + s * u;
  1412. i = s * n * f - i * u;
  1413. s = n * n * f + a;
  1414. r ? e !== r && (r[12] = e[12], r[13] = e[13], r[14] = e[14], r[15] = e[15]) : r = e;
  1415. r[0] = t * w + h * E + m * S;
  1416. r[1] = o * w + p * E + g * S;
  1417. r[2] = l * w + d * E + y * S;
  1418. r[3] = c * w + v * E + b * S;
  1419. r[4] = t * x + h * T + m * N;
  1420. r[5] = o * x + p * T + g * N;
  1421. r[6] = l * x + d * T + y * N;
  1422. r[7] = c * x + v * T + b * N;
  1423. r[8] = t * C + h * i + m * s;
  1424. r[9] = o * C + p * i + g * s;
  1425. r[10] = l * C + d * i + y * s;
  1426. r[11] = c * C + v * i + b * s;
  1427. return r
  1428. };
  1429. mat4.rotateX = function(e, t, n) {
  1430. var r = Math.sin(t),
  1431. t = Math.cos(t),
  1432. i = e[4],
  1433. s = e[5],
  1434. o = e[6],
  1435. u = e[7],
  1436. a = e[8],
  1437. f = e[9],
  1438. l = e[10],
  1439. c = e[11];
  1440. n ? e !== n && (n[0] = e[0], n[1] = e[1], n[2] = e[2], n[3] = e[3], n[12] = e[12], n[13] = e[13], n[14] = e[14], n[15] = e[15]) : n = e;
  1441. n[4] = i * t + a * r;
  1442. n[5] = s * t + f * r;
  1443. n[6] = o * t + l * r;
  1444. n[7] = u * t + c * r;
  1445. n[8] = i * -r + a * t;
  1446. n[9] = s * -r + f * t;
  1447. n[10] = o * -r + l * t;
  1448. n[11] = u * -r + c * t;
  1449. return n
  1450. };
  1451. mat4.rotateY = function(e, t, n) {
  1452. var r = Math.sin(t),
  1453. t = Math.cos(t),
  1454. i = e[0],
  1455. s = e[1],
  1456. o = e[2],
  1457. u = e[3],
  1458. a = e[8],
  1459. f = e[9],
  1460. l = e[10],
  1461. c = e[11];
  1462. n ? e !== n && (n[4] = e[4], n[5] = e[5], n[6] = e[6], n[7] = e[7], n[12] = e[12], n[13] = e[13], n[14] = e[14], n[15] = e[15]) : n = e;
  1463. n[0] = i * t + a * -r;
  1464. n[1] = s * t + f * -r;
  1465. n[2] = o * t + l * -r;
  1466. n[3] = u * t + c * -r;
  1467. n[8] = i * r + a * t;
  1468. n[9] = s * r + f * t;
  1469. n[10] = o * r + l * t;
  1470. n[11] = u * r + c * t;
  1471. return n
  1472. };
  1473. mat4.rotateZ = function(e, t, n) {
  1474. var r = Math.sin(t),
  1475. t = Math.cos(t),
  1476. i = e[0],
  1477. s = e[1],
  1478. o = e[2],
  1479. u = e[3],
  1480. a = e[4],
  1481. f = e[5],
  1482. l = e[6],
  1483. c = e[7];
  1484. n ? e !== n && (n[8] = e[8], n[9] = e[9], n[10] = e[10], n[11] = e[11], n[12] = e[12], n[13] = e[13], n[14] = e[14], n[15] = e[15]) : n = e;
  1485. n[0] = i * t + a * r;
  1486. n[1] = s * t + f * r;
  1487. n[2] = o * t + l * r;
  1488. n[3] = u * t + c * r;
  1489. n[4] = i * -r + a * t;
  1490. n[5] = s * -r + f * t;
  1491. n[6] = o * -r + l * t;
  1492. n[7] = u * -r + c * t;
  1493. return n
  1494. };
  1495. mat4.frustum = function(e, t, n, r, i, s, o) {
  1496. o || (o = mat4.create());
  1497. var u = t - e,
  1498. a = r - n,
  1499. f = s - i;
  1500. o[0] = i * 2 / u;
  1501. o[1] = 0;
  1502. o[2] = 0;
  1503. o[3] = 0;
  1504. o[4] = 0;
  1505. o[5] = i * 2 / a;
  1506. o[6] = 0;
  1507. o[7] = 0;
  1508. o[8] = (t + e) / u;
  1509. o[9] = (r + n) / a;
  1510. o[10] = -(s + i) / f;
  1511. o[11] = -1;
  1512. o[12] = 0;
  1513. o[13] = 0;
  1514. o[14] = -(s * i * 2) / f;
  1515. o[15] = 0;
  1516. return o
  1517. };
  1518. mat4.perspective = function(e, t, n, r, i) {
  1519. e = n * Math.tan(e * Math.PI / 360);
  1520. t *= e;
  1521. return mat4.frustum(-t, t, -e, e, n, r, i)
  1522. };
  1523. mat4.ortho = function(e, t, n, r, i, s, o) {
  1524. o || (o = mat4.create());
  1525. var u = t - e,
  1526. a = r - n,
  1527. f = s - i;
  1528. o[0] = 2 / u;
  1529. o[1] = 0;
  1530. o[2] = 0;
  1531. o[3] = 0;
  1532. o[4] = 0;
  1533. o[5] = 2 / a;
  1534. o[6] = 0;
  1535. o[7] = 0;
  1536. o[8] = 0;
  1537. o[9] = 0;
  1538. o[10] = -2 / f;
  1539. o[11] = 0;
  1540. o[12] = -(e + t) / u;
  1541. o[13] = -(r + n) / a;
  1542. o[14] = -(s + i) / f;
  1543. o[15] = 1;
  1544. return o
  1545. };
  1546. mat4.lookAt = function(e, t, n, r) {
  1547. r || (r = mat4.create());
  1548. var i, s, o, u, a, f, l, c, h = e[0],
  1549. p = e[1],
  1550. e = e[2];
  1551. s = n[0];
  1552. o = n[1];
  1553. i = n[2];
  1554. n = t[1];
  1555. f = t[2];
  1556. if (h === t[0] && p === n && e === f) return mat4.identity(r);
  1557. n = h - t[0];
  1558. f = p - t[1];
  1559. l = e - t[2];
  1560. c = 1 / Math.sqrt(n * n + f * f + l * l);
  1561. n *= c;
  1562. f *= c;
  1563. l *= c;
  1564. t = o * l - i * f;
  1565. i = i * n - s * l;
  1566. s = s * f - o * n;
  1567. (c = Math.sqrt(t * t + i * i + s * s)) ? (c = 1 / c, t *= c, i *= c, s *= c) : s = i = t = 0;
  1568. o = f * s - l * i;
  1569. u = l * t - n * s;
  1570. a = n * i - f * t;
  1571. (c = Math.sqrt(o * o + u * u + a * a)) ? (c = 1 / c, o *= c, u *= c, a *= c) : a = u = o = 0;
  1572. r[0] = t;
  1573. r[1] = o;
  1574. r[2] = n;
  1575. r[3] = 0;
  1576. r[4] = i;
  1577. r[5] = u;
  1578. r[6] = f;
  1579. r[7] = 0;
  1580. r[8] = s;
  1581. r[9] = a;
  1582. r[10] = l;
  1583. r[11] = 0;
  1584. r[12] = -(t * h + i * p + s * e);
  1585. r[13] = -(o * h + u * p + a * e);
  1586. r[14] = -(n * h + f * p + l * e);
  1587. r[15] = 1;
  1588. return r
  1589. };
  1590. mat4.fromRotationTranslation = function(e, t, n) {
  1591. n || (n = mat4.create());
  1592. var r = e[0],
  1593. i = e[1],
  1594. s = e[2],
  1595. o = e[3],
  1596. u = r + r,
  1597. a = i + i,
  1598. f = s + s,
  1599. e = r * u,
  1600. l = r * a;
  1601. r *= f;
  1602. var c = i * a;
  1603. i *= f;
  1604. s *= f;
  1605. u *= o;
  1606. a *= o;
  1607. o *= f;
  1608. n[0] = 1 - (c + s);
  1609. n[1] = l + o;
  1610. n[2] = r - a;
  1611. n[3] = 0;
  1612. n[4] = l - o;
  1613. n[5] = 1 - (e + s);
  1614. n[6] = i + u;
  1615. n[7] = 0;
  1616. n[8] = r + a;
  1617. n[9] = i - u;
  1618. n[10] = 1 - (e + c);
  1619. n[11] = 0;
  1620. n[12] = t[0];
  1621. n[13] = t[1];
  1622. n[14] = t[2];
  1623. n[15] = 1;
  1624. return n
  1625. };
  1626. mat4.str = function(e) {
  1627. return "[" + e[0] + ", " + e[1] + ", " + e[2] + ", " + e[3] + ", " + e[4] + ", " + e[5] + ", " + e[6] + ", " + e[7] + ", " + e[8] + ", " + e[9] + ", " + e[10] + ", " + e[11] + ", " + e[12] + ", " + e[13] + ", " + e[14] + ", " + e[15] + "]"
  1628. };
  1629. quat4.create = function(e) {
  1630. var t = new MatrixArray(4);
  1631. e && (t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3]);
  1632. return t
  1633. };
  1634. quat4.set = function(e, t) {
  1635. t[0] = e[0];
  1636. t[1] = e[1];
  1637. t[2] = e[2];
  1638. t[3] = e[3];
  1639. return t
  1640. };
  1641. quat4.calculateW = function(e, t) {
  1642. var n = e[0],
  1643. r = e[1],
  1644. i = e[2];
  1645. if (!t || e === t) return e[3] = -Math.sqrt(Math.abs(1 - n * n - r * r - i * i)), e;
  1646. t[0] = n;
  1647. t[1] = r;
  1648. t[2] = i;
  1649. t[3] = -Math.sqrt(Math.abs(1 - n * n - r * r - i * i));
  1650. return t
  1651. };
  1652. quat4.inverse = function(e, t) {
  1653. if (!t || e === t) return e[0] *= -1, e[1] *= -1, e[2] *= -1, e;
  1654. t[0] = -e[0];
  1655. t[1] = -e[1];
  1656. t[2] = -e[2];
  1657. t[3] = e[3];
  1658. return t
  1659. };
  1660. quat4.length = function(e) {
  1661. var t = e[0],
  1662. n = e[1],
  1663. r = e[2],
  1664. e = e[3];
  1665. return Math.sqrt(t * t + n * n + r * r + e * e)
  1666. };
  1667. quat4.normalize = function(e, t) {
  1668. t || (t = e);
  1669. var n = e[0],
  1670. r = e[1],
  1671. i = e[2],
  1672. s = e[3],
  1673. o = Math.sqrt(n * n + r * r + i * i + s * s);
  1674. if (o === 0) return t[0] = 0, t[1] = 0, t[2] = 0, t[3] = 0, t;
  1675. o = 1 / o;
  1676. t[0] = n * o;
  1677. t[1] = r * o;
  1678. t[2] = i * o;
  1679. t[3] = s * o;
  1680. return t
  1681. };
  1682. quat4.multiply = function(e, t, n) {
  1683. n || (n = e);
  1684. var r = e[0],
  1685. i = e[1],
  1686. s = e[2],
  1687. e = e[3],
  1688. o = t[0],
  1689. u = t[1],
  1690. a = t[2],
  1691. t = t[3];
  1692. n[0] = r * t + e * o + i * a - s * u;
  1693. n[1] = i * t + e * u + s * o - r * a;
  1694. n[2] = s * t + e * a + r * u - i * o;
  1695. n[3] = e * t - r * o - i * u - s * a;
  1696. return n
  1697. };
  1698. quat4.multiplyVec3 = function(e, t, n) {
  1699. n || (n = t);
  1700. var r = t[0],
  1701. i = t[1],
  1702. s = t[2],
  1703. t = e[0],
  1704. o = e[1],
  1705. u = e[2],
  1706. e = e[3],
  1707. a = e * r + o * s - u * i,
  1708. f = e * i + u * r - t * s,
  1709. l = e * s + t * i - o * r,
  1710. r = -t * r - o * i - u * s;
  1711. n[0] = a * e + r * -t + f * -u - l * -o;
  1712. n[1] = f * e + r * -o + l * -t - a * -u;
  1713. n[2] = l * e + r * -u + a * -o - f * -t;
  1714. return n
  1715. };
  1716. quat4.toMat3 = function(e, t) {
  1717. t || (t = mat3.create());
  1718. var n = e[0],
  1719. r = e[1],
  1720. i = e[2],
  1721. s = e[3],
  1722. o = n + n,
  1723. u = r + r,
  1724. a = i + i,
  1725. f = n * o,
  1726. l = n * u;
  1727. n *= a;
  1728. var c = r * u;
  1729. r *= a;
  1730. i *= a;
  1731. o *= s;
  1732. u *= s;
  1733. s *= a;
  1734. t[0] = 1 - (c + i);
  1735. t[1] = l + s;
  1736. t[2] = n - u;
  1737. t[3] = l - s;
  1738. t[4] = 1 - (f + i);
  1739. t[5] = r + o;
  1740. t[6] = n + u;
  1741. t[7] = r - o;
  1742. t[8] = 1 - (f + c);
  1743. return t
  1744. };
  1745. quat4.toMat4 = function(e, t) {
  1746. t || (t = mat4.create());
  1747. var n = e[0],
  1748. r = e[1],
  1749. i = e[2],
  1750. s = e[3],
  1751. o = n + n,
  1752. u = r + r,
  1753. a = i + i,
  1754. f = n * o,
  1755. l = n * u;
  1756. n *= a;
  1757. var c = r * u;
  1758. r *= a;
  1759. i *= a;
  1760. o *= s;
  1761. u *= s;
  1762. s *= a;
  1763. t[0] = 1 - (c + i);
  1764. t[1] = l + s;
  1765. t[2] = n - u;
  1766. t[3] = 0;
  1767. t[4] = l - s;
  1768. t[5] = 1 - (f + i);
  1769. t[6] = r + o;
  1770. t[7] = 0;
  1771. t[8] = n + u;
  1772. t[9] = r - o;
  1773. t[10] = 1 - (f + c);
  1774. t[11] = 0;
  1775. t[12] = 0;
  1776. t[13] = 0;
  1777. t[14] = 0;
  1778. t[15] = 1;
  1779. return t
  1780. };
  1781. quat4.slerp = function(e, t, n, r) {
  1782. r || (r = e);
  1783. var i = e[0] * t[0] + e[1] * t[1] + e[2] * t[2] + e[3] * t[3],
  1784. s, o;
  1785. if (Math.abs(i) >= 1) return r !== e && (r[0] = e[0], r[1] = e[1], r[2] = e[2], r[3] = e[3]), r;
  1786. s = Math.acos(i);
  1787. o = Math.sqrt(1 - i * i);
  1788. if (Math.abs(o) < .001) return r[0] = e[0] * .5 + t[0] * .5, r[1] = e[1] * .5 + t[1] * .5, r[2] = e[2] * .5 + t[2] * .5, r[3] = e[3] * .5 + t[3] * .5, r;
  1789. i = Math.sin((1 - n) * s) / o;
  1790. n = Math.sin(n * s) / o;
  1791. r[0] = e[0] * i + t[0] * n;
  1792. r[1] = e[1] * i + t[1] * n;
  1793. r[2] = e[2] * i + t[2] * n;
  1794. r[3] = e[3] * i + t[3] * n;
  1795. return r
  1796. };
  1797. quat4.str = function(e) {
  1798. return "[" + e[0] + ", " + e[1] + ", " + e[2] + ", " + e[3] + "]"
  1799. };
  1800. (function() {
  1801. function v(e, t) {
  1802. this.width = 0;
  1803. this.height = 0;
  1804. this.cam = vec3.create([0, 0, 100]);
  1805. this.look = vec3.create([0, 0, 0]);
  1806. this.up = vec3.create([0, 1, 0]);
  1807. this.worldScale = vec3.create([1, 1, 1]);
  1808. this.matP = mat4.create();
  1809. this.matMV = mat4.create();
  1810. this.lastMV = mat4.create();
  1811. this.currentMV = mat4.create();
  1812. this.gl = e;
  1813. this.initState()
  1814. }
  1815. function m(e, t, n) {
  1816. this.gl = e;
  1817. this.shaderProgram = t;
  1818. this.name = n;
  1819. this.locAPos = e.getAttribLocation(t, "aPos");
  1820. this.locATex = e.getAttribLocation(t, "aTex");
  1821. this.locMatP = e.getUniformLocation(t, "matP");
  1822. this.locMatMV = e.getUniformLocation(t, "matMV");
  1823. this.locOpacity = e.getUniformLocation(t, "opacity");
  1824. this.locSamplerFront = e.getUniformLocation(t, "samplerFront");
  1825. this.locSamplerBack = e.getUniformLocation(t, "samplerBack");
  1826. this.locDestStart = e.getUniformLocation(t, "destStart");
  1827. this.locDestEnd = e.getUniformLocation(t, "destEnd");
  1828. this.locSeconds = e.getUniformLocation(t, "seconds");
  1829. this.locPixelWidth = e.getUniformLocation(t, "pixelWidth");
  1830. this.locPixelHeight = e.getUniformLocation(t, "pixelHeight");
  1831. this.locLayerScale = e.getUniformLocation(t, "layerScale");
  1832. if (this.locOpacity) e.uniform1f(this.locOpacity, 1);
  1833. if (this.locSamplerFront) e.uniform1i(this.locSamplerFront, 0);
  1834. if (this.locSamplerBack) e.uniform1i(this.locSamplerBack, 1);
  1835. if (this.locDestStart) e.uniform2f(this.locDestStart, 0, 0);
  1836. if (this.locDestEnd) e.uniform2f(this.locDestEnd, 1, 1);
  1837. this.hasCurrentMatMV = false
  1838. }
  1839. function g(e, t) {
  1840. this.type = e;
  1841. this.glwrap = t;
  1842. this.gl = t.gl;
  1843. this.opacityParam = 0;
  1844. this.startIndex = 0;
  1845. this.indexCount = 0;
  1846. this.texParam = null;
  1847. this.mat4param = null;
  1848. this.shaderParams = [];
  1849. cr.seal(this)
  1850. }
  1851. function w(e) {
  1852. --e;
  1853. for (var t = 1; t < 32; t <<= 1) {
  1854. e = e | e >> t
  1855. }
  1856. return e + 1
  1857. }
  1858. var e = 8e3;
  1859. var t = e / 2 * 3;
  1860. var n = 8e3;
  1861. var r = 4;
  1862. var i = 0;
  1863. var s = 1;
  1864. var o = 2;
  1865. var u = 3;
  1866. var a = 4;
  1867. var f = 5;
  1868. var l = 6;
  1869. var c = 7;
  1870. var h = 8;
  1871. var p = 9;
  1872. var d = 10;
  1873. v.prototype.initState = function() {
  1874. var i = this.gl;
  1875. var s, o;
  1876. this.lastOpacity = 1;
  1877. this.lastTexture = null;
  1878. this.currentOpacity = 1;
  1879. i.clearColor(0, 0, 0, 0);
  1880. i.clear(i.COLOR_BUFFER_BIT);
  1881. i.enable(i.BLEND);
  1882. i.blendFunc(i.ONE, i.ONE_MINUS_SRC_ALPHA);
  1883. i.disable(i.CULL_FACE);
  1884. i.disable(i.DEPTH_TEST);
  1885. this.maxTextureSize = i.getParameter(i.MAX_TEXTURE_SIZE);
  1886. this.lastSrcBlend = i.ONE;
  1887. this.lastDestBlend = i.ONE_MINUS_SRC_ALPHA;
  1888. this.pointBuffer = i.createBuffer();
  1889. i.bindBuffer(i.ARRAY_BUFFER, this.pointBuffer);
  1890. this.vertexBuffers = new Array(r);
  1891. this.texcoordBuffers = new Array(r);
  1892. for (s = 0; s < r; s++) {
  1893. this.vertexBuffers[s] = i.createBuffer();
  1894. i.bindBuffer(i.ARRAY_BUFFER, this.vertexBuffers[s]);
  1895. this.texcoordBuffers[s] = i.createBuffer();
  1896. i.bindBuffer(i.ARRAY_BUFFER, this.texcoordBuffers[s])
  1897. }
  1898. this.curBuffer = 0;
  1899. this.indexBuffer = i.createBuffer();
  1900. i.bindBuffer(i.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  1901. this.vertexData = new Float32Array(e * 2);
  1902. this.texcoordData = new Float32Array(e * 2);
  1903. this.pointData = new Float32Array(n * 4);
  1904. var u = new Uint16Array(t);
  1905. s = 0, o = t;
  1906. var a = 0;
  1907. while (s < o) {
  1908. u[s++] = a;
  1909. u[s++] = a + 1;
  1910. u[s++] = a + 2;
  1911. u[s++] = a;
  1912. u[s++] = a + 2;
  1913. u[s++] = a + 3;
  1914. a += 4
  1915. }
  1916. i.bufferData(i.ELEMENT_ARRAY_BUFFER, u, i.STATIC_DRAW);
  1917. this.vertexPtr = 0;
  1918. this.pointPtr = 0;
  1919. var f, l;
  1920. this.shaderPrograms = [];
  1921. f = ["varying mediump vec2 vTex;", "uniform lowp float opacity;", "uniform lowp sampler2D samplerFront;", "void main(void) {", " gl_FragColor = texture2D(samplerFront, vTex);", " gl_FragColor *= opacity;", "}"].join("\n");
  1922. l = ["attribute highp vec2 aPos;", "attribute mediump vec2 aTex;", "varying mediump vec2 vTex;", "uniform highp mat4 matP;", "uniform highp mat4 matMV;", "void main(void) {", " gl_Position = matP * matMV * vec4(aPos.x, aPos.y, 0.0, 1.0);", " vTex = aTex;", "}"].join("\n");
  1923. var c = this.createShaderProgram({
  1924. src: f
  1925. }, l, "<default>");
  1926. this.shaderPrograms.push(c);
  1927. f = ["uniform mediump sampler2D samplerFront;", "varying lowp float opacity;", "void main(void) {", " gl_FragColor = texture2D(samplerFront, gl_PointCoord);", " gl_FragColor *= opacity;", "}"].join("\n");
  1928. var h = ["attribute vec4 aPos;", "varying float opacity;", "uniform mat4 matP;", "uniform mat4 matMV;", "void main(void) {", " gl_Position = matP * matMV * vec4(aPos.x, aPos.y, 0.0, 1.0);", " gl_PointSize = aPos.z;", " opacity = aPos.w;", "}"].join("\n");
  1929. c = this.createShaderProgram({
  1930. src: f
  1931. }, h, "<point>");
  1932. this.shaderPrograms.push(c);
  1933. for (var p in cr.shaders) {
  1934. if (cr.shaders.hasOwnProperty(p)) this.shaderPrograms.push(this.createShaderProgram(cr.shaders[p], l, p))
  1935. }
  1936. i.activeTexture(i.TEXTURE0);
  1937. i.bindTexture(i.TEXTURE_2D, null);
  1938. this.batch = [];
  1939. this.batchPtr = 0;
  1940. this.hasQuadBatchTop = false;
  1941. this.hasPointBatchTop = false;
  1942. this.lastProgram = -1;
  1943. this.currentProgram = -1;
  1944. this.currentShader = null;
  1945. this.fbo = i.createFramebuffer();
  1946. this.renderToTex = null;
  1947. this.tmpVec3 = vec3.create([0, 0, 0]);
  1948. var d = i.getParameter(i.ALIASED_POINT_SIZE_RANGE);
  1949. this.minPointSize = d[0];
  1950. this.maxPointSize = d[1];
  1951. this.switchProgram(0);
  1952. cr.seal(this)
  1953. };
  1954. v.prototype.createShaderProgram = function(e, t, n) {
  1955. var r = this.gl;
  1956. var i = r.createShader(r.FRAGMENT_SHADER);
  1957. r.shaderSource(i, e.src);
  1958. r.compileShader(i);
  1959. if (!r.getShaderParameter(i, r.COMPILE_STATUS)) {
  1960. r.deleteShader(i);
  1961. return null
  1962. }
  1963. var s = r.createShader(r.VERTEX_SHADER);
  1964. r.shaderSource(s, t);
  1965. r.compileShader(s);
  1966. if (!r.getShaderParameter(s, r.COMPILE_STATUS)) {
  1967. r.deleteShader(i);
  1968. r.deleteShader(s);
  1969. return null
  1970. }
  1971. var o = r.createProgram();
  1972. r.attachShader(o, i);
  1973. r.attachShader(o, s);
  1974. r.linkProgram(o);
  1975. if (!r.getProgramParameter(o, r.LINK_STATUS)) {
  1976. r.deleteShader(i);
  1977. r.deleteShader(s);
  1978. r.deleteProgram(o);
  1979. return null
  1980. }
  1981. r.useProgram(o);
  1982. r.deleteShader(i);
  1983. r.deleteShader(s);
  1984. var u = new m(r, o, n);
  1985. u.extendBoxHorizontal = e.extendBoxHorizontal || 0;
  1986. u.extendBoxVertical = e.extendBoxVertical || 0;
  1987. u.crossSampling = !! e.crossSampling;
  1988. u.animated = !! e.animated;
  1989. u.parameters = e.parameters || [];
  1990. var a, f;
  1991. for (a = 0, f = u.parameters.length; a < f; a++) {
  1992. u.parameters[a][1] = r.getUniformLocation(o, u.parameters[a][0]);
  1993. r.uniform1f(u.parameters[a][1], 0)
  1994. }
  1995. cr.seal(u);
  1996. return u
  1997. };
  1998. v.prototype.getShaderIndex = function(e) {
  1999. var t, n;
  2000. for (t = 0, n = this.shaderPrograms.length; t < n; t++) {
  2001. if (this.shaderPrograms[t].name === e) return t
  2002. }
  2003. return -1
  2004. };
  2005. v.prototype.project = function(e, t, n) {
  2006. var r = [0, 0, this.width, this.height];
  2007. var i = this.matMV;
  2008. var s = this.matP;
  2009. var o = [0, 0, 0, 0, 0, 0, 0, 0];
  2010. o[0] = i[0] * e + i[4] * t + i[12];
  2011. o[1] = i[1] * e + i[5] * t + i[13];
  2012. o[2] = i[2] * e + i[6] * t + i[14];
  2013. o[3] = i[3] * e + i[7] * t + i[15];
  2014. o[4] = s[0] * o[0] + s[4] * o[1] + s[8] * o[2] + s[12] * o[3];
  2015. o[5] = s[1] * o[0] + s[5] * o[1] + s[9] * o[2] + s[13] * o[3];
  2016. o[6] = s[2] * o[0] + s[6] * o[1] + s[10] * o[2] + s[14] * o[3];
  2017. o[7] = -o[2];
  2018. if (o[7] === 0) return;
  2019. o[7] = 1 / o[7];
  2020. o[4] *= o[7];
  2021. o[5] *= o[7];
  2022. o[6] *= o[7];
  2023. n[0] = (o[4] * .5 + .5) * r[2] + r[0];
  2024. n[1] = (o[5] * .5 + .5) * r[3] + r[1]
  2025. };
  2026. v.prototype.setSize = function(e, t, n) {
  2027. if (this.width === e && this.height === t && !n) return;
  2028. this.endBatch();
  2029. this.width = e;
  2030. this.height = t;
  2031. this.gl.viewport(0, 0, e, t);
  2032. mat4.perspective(45, e / t, 1, 1e3, this.matP);
  2033. mat4.lookAt(this.cam, this.look, this.up, this.matMV);
  2034. var r = [0, 0];
  2035. var i = [0, 0];
  2036. this.project(0, 0, r);
  2037. this.project(1, 1, i);
  2038. this.worldScale[0] = 1 / (i[0] - r[0]);
  2039. this.worldScale[1] = -1 / (i[1] - r[1]);
  2040. var s, o, u;
  2041. for (s = 0, o = this.shaderPrograms.length; s < o; s++) {
  2042. u = this.shaderPrograms[s];
  2043. u.hasCurrentMatMV = false;
  2044. if (u.locMatP) {
  2045. this.gl.useProgram(u.shaderProgram);
  2046. this.gl.uniformMatrix4fv(u.locMatP, false, this.matP)
  2047. }
  2048. }
  2049. this.gl.useProgram(this.shaderPrograms[this.lastProgram].shaderProgram);
  2050. this.gl.bindTexture(this.gl.TEXTURE_2D, null);
  2051. this.lastTexture = null
  2052. };
  2053. v.prototype.resetModelView = function() {
  2054. mat4.lookAt(this.cam, this.look, this.up, this.matMV);
  2055. mat4.scale(this.matMV, this.worldScale)
  2056. };
  2057. v.prototype.translate = function(e, t) {
  2058. if (e === 0 && t === 0) return;
  2059. this.tmpVec3[0] = e;
  2060. this.tmpVec3[1] = t;
  2061. this.tmpVec3[2] = 0;
  2062. mat4.translate(this.matMV, this.tmpVec3)
  2063. };
  2064. v.prototype.scale = function(e, t) {
  2065. if (e === 1 && t === 1) return;
  2066. this.tmpVec3[0] = e;
  2067. this.tmpVec3[1] = t;
  2068. this.tmpVec3[2] = 1;
  2069. mat4.scale(this.matMV, this.tmpVec3)
  2070. };
  2071. v.prototype.rotateZ = function(e) {
  2072. if (e === 0) return;
  2073. mat4.rotateZ(this.matMV, e)
  2074. };
  2075. v.prototype.updateModelView = function() {
  2076. var e = false;
  2077. for (var t = 0; t < 16; t++) {
  2078. if (this.lastMV[t] !== this.matMV[t]) {
  2079. e = true;
  2080. break
  2081. }
  2082. }
  2083. if (!e) return;
  2084. var n = this.pushBatch();
  2085. n.type = f;
  2086. if (n.mat4param) mat4.set(this.matMV, n.mat4param);
  2087. else n.mat4param = mat4.create(this.matMV);
  2088. mat4.set(this.matMV, this.lastMV);
  2089. this.hasQuadBatchTop = false;
  2090. this.hasPointBatchTop = false
  2091. };
  2092. g.prototype.doSetTexture = function() {
  2093. this.gl.bindTexture(this.gl.TEXTURE_2D, this.texParam)
  2094. };
  2095. g.prototype.doSetOpacity = function() {
  2096. var e = this.opacityParam;
  2097. var t = this.glwrap;
  2098. t.currentOpacity = e;
  2099. var n = t.currentShader;
  2100. if (n.locOpacity) this.gl.uniform1f(n.locOpacity, e)
  2101. };
  2102. g.prototype.doQuad = function() {
  2103. this.gl.drawElements(this.gl.TRIANGLES, this.indexCount, this.gl.UNSIGNED_SHORT, this.startIndex * 2)
  2104. };
  2105. g.prototype.doSetBlend = function() {
  2106. this.gl.blendFunc(this.startIndex, this.indexCount)
  2107. };
  2108. g.prototype.doUpdateModelView = function() {
  2109. var e, t, n, r = this.glwrap.shaderPrograms,
  2110. i = this.glwrap.currentProgram;
  2111. for (e = 0, t = r.length; e < t; e++) {
  2112. n = r[e];
  2113. if (e === i && n.locMatMV) {
  2114. this.gl.uniformMatrix4fv(n.locMatMV, false, this.mat4param);
  2115. n.hasCurrentMatMV = true
  2116. } else n.hasCurrentMatMV = false
  2117. }
  2118. mat4.set(this.mat4param, this.glwrap.currentMV)
  2119. };
  2120. g.prototype.doRenderToTexture = function() {
  2121. var e = this.gl;
  2122. var t = this.glwrap;
  2123. if (this.texParam) {
  2124. e.bindFramebuffer(e.FRAMEBUFFER, t.fbo);
  2125. e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, this.texParam, 0);
  2126. } else {
  2127. e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, null, 0);
  2128. e.bindFramebuffer(e.FRAMEBUFFER, null)
  2129. }
  2130. };
  2131. g.prototype.doClear = function() {
  2132. var e = this.gl;
  2133. if (this.startIndex === 0) {
  2134. e.clearColor(this.mat4param[0], this.mat4param[1], this.mat4param[2], this.mat4param[3]);
  2135. e.clear(e.COLOR_BUFFER_BIT)
  2136. } else {
  2137. e.enable(e.SCISSOR_TEST);
  2138. e.scissor(this.mat4param[0], this.mat4param[1], this.mat4param[2], this.mat4param[3]);
  2139. e.clearColor(0, 0, 0, 0);
  2140. e.clear(this.gl.COLOR_BUFFER_BIT);
  2141. e.disable(e.SCISSOR_TEST)
  2142. }
  2143. };
  2144. g.prototype.doPoints = function() {
  2145. var e = this.gl;
  2146. var t = this.glwrap;
  2147. var n = t.shaderPrograms[1];
  2148. e.useProgram(n.shaderProgram);
  2149. if (!n.hasCurrentMatMV && n.locMatMV) {
  2150. e.uniformMatrix4fv(n.locMatMV, false, t.currentMV);
  2151. n.hasCurrentMatMV = true
  2152. }
  2153. e.enableVertexAttribArray(n.locAPos);
  2154. e.bindBuffer(e.ARRAY_BUFFER, t.pointBuffer);
  2155. e.vertexAttribPointer(n.locAPos, 4, e.FLOAT, false, 0, 0);
  2156. e.drawArrays(e.POINTS, this.startIndex / 4, this.indexCount);
  2157. n = t.currentShader;
  2158. e.useProgram(n.shaderProgram);
  2159. if (n.locAPos >= 0) {
  2160. e.enableVertexAttribArray(n.locAPos);
  2161. e.bindBuffer(e.ARRAY_BUFFER, t.vertexBuffers[t.curBuffer]);
  2162. e.vertexAttribPointer(n.locAPos, 2, e.FLOAT, false, 0, 0)
  2163. }
  2164. if (n.locATex >= 0) {
  2165. e.enableVertexAttribArray(n.locATex);
  2166. e.bindBuffer(e.ARRAY_BUFFER, t.texcoordBuffers[t.curBuffer]);
  2167. e.vertexAttribPointer(n.locATex, 2, e.FLOAT, false, 0, 0)
  2168. }
  2169. };
  2170. g.prototype.doSetProgram = function() {
  2171. var e = this.gl;
  2172. var t = this.glwrap;
  2173. var n = t.shaderPrograms[this.startIndex];
  2174. t.currentProgram = this.startIndex;
  2175. t.currentShader = n;
  2176. e.useProgram(n.shaderProgram);
  2177. if (!n.hasCurrentMatMV && n.locMatMV) {
  2178. e.uniformMatrix4fv(n.locMatMV, false, t.currentMV);
  2179. n.hasCurrentMatMV = true
  2180. }
  2181. if (n.locOpacity) e.uniform1f(n.locOpacity, t.currentOpacity);
  2182. if (n.locAPos >= 0) {
  2183. e.enableVertexAttribArray(n.locAPos);
  2184. e.bindBuffer(e.ARRAY_BUFFER, t.vertexBuffers[t.curBuffer]);
  2185. e.vertexAttribPointer(n.locAPos, 2, e.FLOAT, false, 0, 0)
  2186. }
  2187. if (n.locATex >= 0) {
  2188. e.enableVertexAttribArray(n.locATex);
  2189. e.bindBuffer(e.ARRAY_BUFFER, t.texcoordBuffers[t.curBuffer]);
  2190. e.vertexAttribPointer(n.locATex, 2, e.FLOAT, false, 0, 0)
  2191. }
  2192. };
  2193. g.prototype.doSetProgramParameters = function() {
  2194. var e, t, n = this.glwrap.currentShader;
  2195. var r = this.gl;
  2196. if (n.locSamplerBack) {
  2197. r.activeTexture(r.TEXTURE1);
  2198. r.bindTexture(r.TEXTURE_2D, this.texParam);
  2199. r.activeTexture(r.TEXTURE0)
  2200. }
  2201. if (n.locPixelWidth) r.uniform1f(n.locPixelWidth, this.mat4param[0]);
  2202. if (n.locPixelHeight) r.uniform1f(n.locPixelHeight, this.mat4param[1]);
  2203. if (n.locDestStart) r.uniform2f(n.locDestStart, this.mat4param[2], this.mat4param[3]);
  2204. if (n.locDestEnd) r.uniform2f(n.locDestEnd, this.mat4param[4], this.mat4param[5]);
  2205. if (n.locLayerScale) r.uniform1f(n.locLayerScale, this.mat4param[6]);
  2206. if (n.locSeconds) r.uniform1f(n.locSeconds, cr.performance_now() / 1e3);
  2207. if (n.parameters.length) {
  2208. for (e = 0, t = n.parameters.length; e < t; e++) {
  2209. r.uniform1f(n.parameters[e][1], this.shaderParams[e])
  2210. }
  2211. }
  2212. };
  2213. v.prototype.pushBatch = function() {
  2214. if (this.batchPtr === this.batch.length) this.batch.push(new g(i, this));
  2215. return this.batch[this.batchPtr++]
  2216. };
  2217. v.prototype.endBatch = function() {
  2218. if (this.batchPtr === 0) return;
  2219. if (this.gl.isContextLost()) return;
  2220. var e = this.gl;
  2221. if (this.pointPtr > 0) {
  2222. e.bindBuffer(e.ARRAY_BUFFER, this.pointBuffer);
  2223. e.bufferData(e.ARRAY_BUFFER, this.pointData.subarray(0, this.pointPtr), e.STREAM_DRAW);
  2224. if (t && t.locAPos >= 0 && t.name === "<point>") e.vertexAttribPointer(t.locAPos, 4, e.FLOAT, false, 0, 0)
  2225. }
  2226. if (this.vertexPtr > 0) {
  2227. var t = this.currentShader;
  2228. e.bindBuffer(e.ARRAY_BUFFER, this.vertexBuffers[this.curBuffer]);
  2229. e.bufferData(e.ARRAY_BUFFER, this.vertexData.subarray(0, this.vertexPtr), e.STREAM_DRAW);
  2230. if (t && t.locAPos >= 0 && t.name !== "<point>") e.vertexAttribPointer(t.locAPos, 2, e.FLOAT, false, 0, 0);
  2231. e.bindBuffer(e.ARRAY_BUFFER, this.texcoordBuffers[this.curBuffer]);
  2232. e.bufferData(e.ARRAY_BUFFER, this.texcoordData.subarray(0, this.vertexPtr), e.STREAM_DRAW);
  2233. if (t && t.locATex >= 0 && t.name !== "<point>") e.vertexAttribPointer(t.locATex, 2, e.FLOAT, false, 0, 0)
  2234. }
  2235. var n, i, v;
  2236. for (n = 0, i = this.batchPtr; n < i; n++) {
  2237. v = this.batch[n];
  2238. switch (v.type) {
  2239. case s:
  2240. v.doQuad();
  2241. break;
  2242. case o:
  2243. v.doSetTexture();
  2244. break;
  2245. case u:
  2246. v.doSetOpacity();
  2247. break;
  2248. case a:
  2249. v.doSetBlend();
  2250. break;
  2251. case f:
  2252. v.doUpdateModelView();
  2253. break;
  2254. case l:
  2255. v.doRenderToTexture();
  2256. break;
  2257. case c:
  2258. v.doClear();
  2259. break;
  2260. case h:
  2261. v.doPoints();
  2262. break;
  2263. case p:
  2264. v.doSetProgram();
  2265. break;
  2266. case d:
  2267. v.doSetProgramParameters();
  2268. break
  2269. }
  2270. }
  2271. this.batchPtr = 0;
  2272. this.vertexPtr = 0;
  2273. this.pointPtr = 0;
  2274. this.hasQuadBatchTop = false;
  2275. this.hasPointBatchTop = false;
  2276. this.curBuffer++;
  2277. if (this.curBuffer >= r) this.curBuffer = 0
  2278. };
  2279. v.prototype.setOpacity = function(e) {
  2280. if (e === this.lastOpacity) return;
  2281. var t = this.pushBatch();
  2282. t.type = u;
  2283. t.opacityParam = e;
  2284. this.lastOpacity = e;
  2285. this.hasQuadBatchTop = false;
  2286. this.hasPointBatchTop = false
  2287. };
  2288. v.prototype.setTexture = function(e) {
  2289. if (e === this.lastTexture) return;
  2290. var t = this.pushBatch();
  2291. t.type = o;
  2292. t.texParam = e;
  2293. this.lastTexture = e;
  2294. this.hasQuadBatchTop = false;
  2295. this.hasPointBatchTop = false
  2296. };
  2297. v.prototype.setBlend = function(e, t) {
  2298. if (e === this.lastSrcBlend && t === this.lastDestBlend) return;
  2299. var n = this.pushBatch();
  2300. n.type = a;
  2301. n.startIndex = e;
  2302. n.indexCount = t;
  2303. this.lastSrcBlend = e;
  2304. this.lastDestBlend = t;
  2305. this.hasQuadBatchTop = false;
  2306. this.hasPointBatchTop = false
  2307. };
  2308. v.prototype.setAlphaBlend = function() {
  2309. this.setBlend(this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA)
  2310. };
  2311. var y = e * 2 - 8;
  2312. v.prototype.quad = function(e, t, n, r, i, o, u, a) {
  2313. if (this.vertexPtr >= y) this.endBatch();
  2314. var f = this.vertexPtr;
  2315. var l = this.vertexData;
  2316. var c = this.texcoordData;
  2317. if (this.hasQuadBatchTop) {
  2318. this.batch[this.batchPtr - 1].indexCount += 6
  2319. } else {
  2320. var h = this.pushBatch();
  2321. h.type = s;
  2322. h.startIndex = f / 4 * 3;
  2323. h.indexCount = 6;
  2324. this.hasQuadBatchTop = true;
  2325. this.hasPointBatchTop = false
  2326. }
  2327. l[f] = e;
  2328. c[f++] = 0;
  2329. l[f] = t;
  2330. c[f++] = 0;
  2331. l[f] = n;
  2332. c[f++] = 1;
  2333. l[f] = r;
  2334. c[f++] = 0;
  2335. l[f] = i;
  2336. c[f++] = 1;
  2337. l[f] = o;
  2338. c[f++] = 1;
  2339. l[f] = u;
  2340. c[f++] = 0;
  2341. l[f] = a;
  2342. c[f++] = 1;
  2343. this.vertexPtr = f
  2344. };
  2345. v.prototype.quadTex = function(e, t, n, r, i, o, u, a, f) {
  2346. if (this.vertexPtr >= y) this.endBatch();
  2347. var l = this.vertexPtr;
  2348. var c = this.vertexData;
  2349. var h = this.texcoordData;
  2350. if (this.hasQuadBatchTop) {
  2351. this.batch[this.batchPtr - 1].indexCount += 6
  2352. } else {
  2353. var p = this.pushBatch();
  2354. p.type = s;
  2355. p.startIndex = l / 4 * 3;
  2356. p.indexCount = 6;
  2357. this.hasQuadBatchTop = true;
  2358. this.hasPointBatchTop = false
  2359. }
  2360. c[l] = e;
  2361. h[l++] = f.left;
  2362. c[l] = t;
  2363. h[l++] = f.top;
  2364. c[l] = n;
  2365. h[l++] = f.right;
  2366. c[l] = r;
  2367. h[l++] = f.top;
  2368. c[l] = i;
  2369. h[l++] = f.right;
  2370. c[l] = o;
  2371. h[l++] = f.bottom;
  2372. c[l] = u;
  2373. h[l++] = f.left;
  2374. c[l] = a;
  2375. h[l++] = f.bottom;
  2376. this.vertexPtr = l
  2377. };
  2378. var b = n - 4;
  2379. v.prototype.point = function(e, t, n, r) {
  2380. if (this.pointPtr >= b) this.endBatch();
  2381. var i = this.pointPtr;
  2382. var s = this.pointData;
  2383. if (this.hasPointBatchTop) {
  2384. this.batch[this.batchPtr - 1].indexCount++
  2385. } else {
  2386. var o = this.pushBatch();
  2387. o.type = h;
  2388. o.startIndex = i;
  2389. o.indexCount = 1;
  2390. this.hasPointBatchTop = true;
  2391. this.hasQuadBatchTop = false
  2392. }
  2393. s[i++] = e;
  2394. s[i++] = t;
  2395. s[i++] = n;
  2396. s[i++] = r;
  2397. this.pointPtr = i
  2398. };
  2399. v.prototype.switchProgram = function(e) {
  2400. if (this.lastProgram === e) return;
  2401. var t = this.shaderPrograms[e];
  2402. if (!t) {
  2403. if (this.lastProgram === 0) return;
  2404. e = 0;
  2405. t = this.shaderPrograms[0]
  2406. }
  2407. var n = this.pushBatch();
  2408. n.type = p;
  2409. n.startIndex = e;
  2410. this.lastProgram = e;
  2411. this.hasQuadBatchTop = false;
  2412. this.hasPointBatchTop = false
  2413. };
  2414. v.prototype.programUsesDest = function(e) {
  2415. var t = this.shaderPrograms[e];
  2416. return !!(t.locDestStart || t.locDestEnd)
  2417. };
  2418. v.prototype.programUsesCrossSampling = function(e) {
  2419. return this.shaderPrograms[e].crossSampling
  2420. };
  2421. v.prototype.programExtendsBox = function(e) {
  2422. var t = this.shaderPrograms[e];
  2423. return t.extendBoxHorizontal !== 0 || t.extendBoxVertical !== 0
  2424. };
  2425. v.prototype.getProgramBoxExtendHorizontal = function(e) {
  2426. return this.shaderPrograms[e].extendBoxHorizontal
  2427. };
  2428. v.prototype.getProgramBoxExtendVertical = function(e) {
  2429. return this.shaderPrograms[e].extendBoxVertical
  2430. };
  2431. v.prototype.getProgramParameterType = function(e, t) {
  2432. return this.shaderPrograms[e].parameters[t][2]
  2433. };
  2434. v.prototype.programIsAnimated = function(e) {
  2435. return this.shaderPrograms[e].animated
  2436. };
  2437. v.prototype.setProgramParameters = function(e, t, n, r, i, s, o, u, a) {
  2438. var f, l, c = this.shaderPrograms[this.lastProgram];
  2439. if (c.locPixelWidth || c.locPixelHeight || c.locSeconds || c.locSamplerBack || c.locDestStart || c.locDestEnd || c.locLayerScale || a.length) {
  2440. var h = this.pushBatch();
  2441. h.type = d;
  2442. if (h.mat4param) mat4.set(this.matMV, h.mat4param);
  2443. else h.mat4param = mat4.create();
  2444. h.mat4param[0] = t;
  2445. h.mat4param[1] = n;
  2446. h.mat4param[2] = r;
  2447. h.mat4param[3] = i;
  2448. h.mat4param[4] = s;
  2449. h.mat4param[5] = o;
  2450. h.mat4param[6] = u;
  2451. h.texParam = e;
  2452. if (a.length) {
  2453. h.shaderParams.length = a.length;
  2454. for (f = 0, l = a.length; f < l; f++) h.shaderParams[f] = a[f]
  2455. }
  2456. this.hasQuadBatchTop = false;
  2457. this.hasPointBatchTop = false
  2458. }
  2459. };
  2460. v.prototype.clear = function(e, t, n, r) {
  2461. var i = this.pushBatch();
  2462. i.type = c;
  2463. i.startIndex = 0;
  2464. if (!i.mat4param) i.mat4param = mat4.create();
  2465. i.mat4param[0] = e;
  2466. i.mat4param[1] = t;
  2467. i.mat4param[2] = n;
  2468. i.mat4param[3] = r;
  2469. this.hasQuadBatchTop = false;
  2470. this.hasPointBatchTop = false
  2471. };
  2472. v.prototype.clearRect = function(e, t, n, r) {
  2473. var i = this.pushBatch();
  2474. i.type = c;
  2475. i.startIndex = 1;
  2476. if (!i.mat4param) i.mat4param = mat4.create();
  2477. i.mat4param[0] = e;
  2478. i.mat4param[1] = t;
  2479. i.mat4param[2] = n;
  2480. i.mat4param[3] = r;
  2481. this.hasQuadBatchTop = false;
  2482. this.hasPointBatchTop = false
  2483. };
  2484. v.prototype.present = function() {
  2485. this.endBatch();
  2486. this.gl.flush()
  2487. };
  2488. var E = [];
  2489. var S = {};
  2490. var x = 0;
  2491. var T = 1;
  2492. var N = 2;
  2493. var C = 3;
  2494. var k = 4;
  2495. v.prototype.loadTexture = function(e, t, n, r, i) {
  2496. t = !! t;
  2497. n = !! n;
  2498. var s = e.src + "," + t + "," + n + (t ? "," + i : "");
  2499. var o = null;
  2500. if (typeof e.src !== "undefined" && S.hasOwnProperty(s)) {
  2501. o = S[s];
  2502. o.c2refcount++;
  2503. return o
  2504. }
  2505. this.endBatch();
  2506. var u = this.gl;
  2507. var a = cr.isPOT(e.width) && cr.isPOT(e.height);
  2508. o = u.createTexture();
  2509. u.bindTexture(u.TEXTURE_2D, o);
  2510. u.pixelStorei(u["UNPACK_PREMULTIPLY_ALPHA_WEBGL"], true);
  2511. var f = u.RGBA;
  2512. var l = u.RGBA;
  2513. var c = u.UNSIGNED_BYTE;
  2514. if (r) {
  2515. switch (r) {
  2516. case T:
  2517. f = u.RGB;
  2518. l = u.RGB;
  2519. break;
  2520. case N:
  2521. c = u.UNSIGNED_SHORT_4_4_4_4;
  2522. break;
  2523. case C:
  2524. c = u.UNSIGNED_SHORT_5_5_5_1;
  2525. break;
  2526. case k:
  2527. f = u.RGB;
  2528. l = u.RGB;
  2529. c = u.UNSIGNED_SHORT_5_6_5;
  2530. break
  2531. }
  2532. }
  2533. if (!a && t) {
  2534. var h = document.createElement("canvas");
  2535. h.width = w(e.width);
  2536. h.height = w(e.height);
  2537. var p = h.getContext("2d");
  2538. p.drawImage(e, 0, 0, e.width, e.height, 0, 0, h.width, h.height);
  2539. u.texImage2D(u.TEXTURE_2D, 0, f, l, c, h)
  2540. } else u.texImage2D(u.TEXTURE_2D, 0, f, l, c, e);
  2541. if (t) {
  2542. if (i === "repeat-x") {
  2543. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_S, u.REPEAT);
  2544. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_T, u.CLAMP_TO_EDGE)
  2545. } else if (i === "repeat-y") {
  2546. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_S, u.CLAMP_TO_EDGE);
  2547. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_T, u.REPEAT)
  2548. } else {
  2549. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_S, u.REPEAT);
  2550. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_T, u.REPEAT)
  2551. }
  2552. } else {
  2553. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_S, u.CLAMP_TO_EDGE);
  2554. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_T, u.CLAMP_TO_EDGE)
  2555. }
  2556. if (n) {
  2557. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_MAG_FILTER, u.LINEAR);
  2558. if (a) {
  2559. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_MIN_FILTER, u.LINEAR_MIPMAP_LINEAR);
  2560. u.generateMipmap(u.TEXTURE_2D)
  2561. } else u.texParameteri(u.TEXTURE_2D, u.TEXTURE_MIN_FILTER, u.LINEAR)
  2562. } else {
  2563. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_MAG_FILTER, u.NEAREST);
  2564. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_MIN_FILTER, u.NEAREST)
  2565. }
  2566. u.bindTexture(u.TEXTURE_2D, null);
  2567. this.lastTexture = null;
  2568. o.c2width = e.width;
  2569. o.c2height = e.height;
  2570. o.c2refcount = 1;
  2571. o.c2texkey = s;
  2572. E.push(o);
  2573. S[s] = o;
  2574. return o
  2575. };
  2576. v.prototype.createEmptyTexture = function(e, t, n, r) {
  2577. this.endBatch();
  2578. var i = this.gl;
  2579. var s = i.createTexture();
  2580. i.bindTexture(i.TEXTURE_2D, s);
  2581. i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, e, t, 0, i.RGBA, r ? i.UNSIGNED_SHORT_4_4_4_4 : i.UNSIGNED_BYTE, null);
  2582. i.texParameteri(i.TEXTURE_2D, i.TEXTURE_WRAP_S, i.CLAMP_TO_EDGE);
  2583. i.texParameteri(i.TEXTURE_2D, i.TEXTURE_WRAP_T, i.CLAMP_TO_EDGE);
  2584. i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MAG_FILTER, n ? i.LINEAR : i.NEAREST);
  2585. i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MIN_FILTER, n ? i.LINEAR : i.NEAREST);
  2586. i.bindTexture(i.TEXTURE_2D, null);
  2587. this.lastTexture = null;
  2588. s.c2width = e;
  2589. s.c2height = t;
  2590. E.push(s);
  2591. return s
  2592. };
  2593. v.prototype.videoToTexture = function(e, t, n) {
  2594. this.endBatch();
  2595. var r = this.gl;
  2596. r.bindTexture(r.TEXTURE_2D, t);
  2597. r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, r.RGBA, n ? r.UNSIGNED_SHORT_4_4_4_4 : r.UNSIGNED_BYTE, e);
  2598. r.bindTexture(r.TEXTURE_2D, null);
  2599. this.lastTexture = null
  2600. };
  2601. v.prototype.deleteTexture = function(e) {
  2602. if (!e) return;
  2603. if (typeof e.c2refcount !== "undefined" && e.c2refcount > 1) {
  2604. e.c2refcount--;
  2605. return
  2606. }
  2607. this.endBatch();
  2608. this.gl.bindTexture(this.gl.TEXTURE_2D, null);
  2609. this.lastTexture = null;
  2610. cr.arrayFindRemove(E, e);
  2611. if (typeof e.c2texkey !== "undefined") delete S[e.c2texkey];
  2612. this.gl.deleteTexture(e)
  2613. };
  2614. v.prototype.estimateVRAM = function() {
  2615. var e = this.width * this.height * 4 * 2;
  2616. var t, n, r;
  2617. for (t = 0, n = E.length; t < n; t++) {
  2618. r = E[t];
  2619. e += r.c2width * r.c2height * 4
  2620. }
  2621. return e
  2622. };
  2623. v.prototype.textureCount = function() {
  2624. return E.length
  2625. };
  2626. v.prototype.setRenderingToTexture = function(e) {
  2627. if (e === this.renderToTex) return;
  2628. var t = this.pushBatch();
  2629. t.type = l;
  2630. t.texParam = e;
  2631. this.renderToTex = e;
  2632. this.hasQuadBatchTop = false;
  2633. this.hasPointBatchTop = false
  2634. };
  2635. cr.GLWrap = v
  2636. })();
  2637. (function() {
  2638. function e(e) {
  2639. if (!e || !e.getContext && !e["dc"]) return;
  2640. if (e["c2runtime"]) return;
  2641. else e["c2runtime"] = this;
  2642. var t = this;
  2643. this.isPhoneGap = typeof window["device"] !== "undefined" && (typeof window["device"]["cordova"] !== "undefined" || typeof window["device"]["phonegap"] !== "undefined");
  2644. this.isDirectCanvas = !! e["dc"];
  2645. this.isAppMobi = typeof window["AppMobi"] !== "undefined" || this.isDirectCanvas;
  2646. this.isCocoonJs = !! window["c2cocoonjs"];
  2647. if (this.isCocoonJs) {
  2648. CocoonJS["App"]["onSuspended"].addEventListener(function() {
  2649. t["setSuspended"](true)
  2650. });
  2651. CocoonJS["App"]["onActivated"].addEventListener(function() {
  2652. t["setSuspended"](false)
  2653. })
  2654. }
  2655. this.isDomFree = this.isDirectCanvas || this.isCocoonJs;
  2656. this.isTizen = /tizen/i.test(navigator.userAgent);
  2657. this.isAndroid = /android/i.test(navigator.userAgent) && !this.isTizen;
  2658. this.isIE = /msie/i.test(navigator.userAgent) || /trident/i.test(navigator.userAgent);
  2659. this.isiPhone = /iphone/i.test(navigator.userAgent) || /ipod/i.test(navigator.userAgent);
  2660. this.isiPad = /ipad/i.test(navigator.userAgent);
  2661. this.isiOS = this.isiPhone || this.isiPad;
  2662. this.isChrome = /chrome/i.test(navigator.userAgent) || /chromium/i.test(navigator.userAgent);
  2663. this.isSafari = !this.isChrome && /safari/i.test(navigator.userAgent);
  2664. this.isWindows = /windows/i.test(navigator.userAgent);
  2665. this.isNodeWebkit = typeof window["c2nodewebkit"] !== "undefined";
  2666. this.isArcade = typeof window["is_scirra_arcade"] !== "undefined";
  2667. this.isWindows8App = !! (typeof window["c2isWindows8"] !== "undefined" && window["c2isWindows8"]);
  2668. this.isWindowsPhone8 = !! (typeof window["c2isWindowsPhone8"] !== "undefined" && window["c2isWindowsPhone8"]);
  2669. this.isBlackberry10 = !! (typeof window["c2isBlackberry10"] !== "undefined" && window["c2isBlackberry10"]);
  2670. this.devicePixelRatio = 1;
  2671. this.isMobile = this.isPhoneGap || this.isAppMobi || this.isCocoonJs || this.isAndroid || this.isiOS || this.isWindowsPhone8 || this.isBlackberry10 || this.isTizen;
  2672. if (!this.isMobile) this.isMobile = /(blackberry|bb10|playbook|palm|symbian|nokia|windows\s+ce|phone|mobile|tablet)/i.test(navigator.userAgent);
  2673. if (typeof cr_is_preview !== "undefined" && !this.isNodeWebkit && (window.location.search === "?nw" || /nodewebkit/i.test(navigator.userAgent))) {
  2674. this.isNodeWebkit = true
  2675. }
  2676. this.isDebug = typeof cr_is_preview !== "undefined" && window.location.search.indexOf("debug") > -1;
  2677. this.canvas = e;
  2678. this.canvasdiv = document.getElementById("c2canvasdiv");
  2679. this.gl = null;
  2680. this.glwrap = null;
  2681. this.ctx = null;
  2682. this.canvas.oncontextmenu = function(e) {
  2683. if (e.preventDefault) e.preventDefault();
  2684. return false
  2685. };
  2686. this.canvas.onselectstart = function(e) {
  2687. if (e.preventDefault) e.preventDefault();
  2688. return false
  2689. };
  2690. if (this.isDirectCanvas) window["c2runtime"] = this;
  2691. if (this.isNodeWebkit) {
  2692. window.ondragover = function(e) {
  2693. e.preventDefault();
  2694. return false
  2695. };
  2696. window.ondrop = function(e) {
  2697. e.preventDefault();
  2698. return false
  2699. }
  2700. }
  2701. this.width = e.width;
  2702. this.height = e.height;
  2703. this.lastwidth = this.width;
  2704. this.lastheight = this.height;
  2705. this.redraw = true;
  2706. this.isSuspended = false;
  2707. if (!Date.now) {
  2708. Date.now = function() {
  2709. return +(new Date)
  2710. }
  2711. }
  2712. this.plugins = [];
  2713. this.types = {};
  2714. this.types_by_index = [];
  2715. this.behaviors = [];
  2716. this.layouts = {};
  2717. this.layouts_by_index = [];
  2718. this.eventsheets = {};
  2719. this.eventsheets_by_index = [];
  2720. this.wait_for_textures = [];
  2721. this.triggers_to_postinit = [];
  2722. this.all_global_vars = [];
  2723. this.all_local_vars = [];
  2724. this.deathRow = new cr.ObjectSet;
  2725. this.isInClearDeathRow = false;
  2726. this.isInOnDestroy = 0;
  2727. this.isRunningEvents = false;
  2728. this.createRow = [];
  2729. this.isLoadingState = false;
  2730. this.saveToSlot = "";
  2731. this.loadFromSlot = "";
  2732. this.loadFromJson = "";
  2733. this.lastSaveJson = "";
  2734. this.signalledContinuousPreview = false;
  2735. this.suspendDrawing = false;
  2736. this.dt = 0;
  2737. this.dt1 = 0;
  2738. this.logictime = 0;
  2739. this.cpuutilisation = 0;
  2740. this.zeroDtCount = 0;
  2741. this.timescale = 1;
  2742. this.kahanTime = new cr.KahanAdder;
  2743. this.last_tick_time = 0;
  2744. this.measuring_dt = true;
  2745. this.fps = 0;
  2746. this.last_fps_time = 0;
  2747. this.tickcount = 0;
  2748. this.execcount = 0;
  2749. this.framecount = 0;
  2750. this.objectcount = 0;
  2751. this.changelayout = null;
  2752. this.destroycallbacks = [];
  2753. this.event_stack = [];
  2754. this.event_stack_index = -1;
  2755. this.localvar_stack = [
  2756. []
  2757. ];
  2758. this.localvar_stack_index = 0;
  2759. this.trigger_depth = 0;
  2760. this.pushEventStack(null);
  2761. this.loop_stack = [];
  2762. this.loop_stack_index = -1;
  2763. this.next_uid = 0;
  2764. this.next_puid = 0;
  2765. this.layout_first_tick = true;
  2766. this.family_count = 0;
  2767. this.suspend_events = [];
  2768. this.raf_id = 0;
  2769. this.timeout_id = 0;
  2770. this.isloading = true;
  2771. this.loadingprogress = 0;
  2772. this.isNodeFullscreen = false;
  2773. this.stackLocalCount = 0;
  2774. this.had_a_click = false;
  2775. this.objects_to_tick = new cr.ObjectSet;
  2776. this.objects_to_tick2 = new cr.ObjectSet;
  2777. this.registered_collisions = [];
  2778. this.temp_poly = new cr.CollisionPoly([]);
  2779. this.temp_poly2 = new cr.CollisionPoly([]);
  2780. this.allGroups = [];
  2781. this.activeGroups = {};
  2782. this.cndsBySid = {};
  2783. this.actsBySid = {};
  2784. this.varsBySid = {};
  2785. this.blocksBySid = {};
  2786. this.running_layout = null;
  2787. this.layer_canvas = null;
  2788. this.layer_ctx = null;
  2789. this.layer_tex = null;
  2790. this.layout_tex = null;
  2791. this.is_WebGL_context_lost = false;
  2792. this.uses_background_blending = false;
  2793. this.fx_tex = [null, null];
  2794. this.fullscreen_scaling = 0;
  2795. this.files_subfolder = "";
  2796. this.objectsByUid = {};
  2797. this.loaderlogo = null;
  2798. this.snapshotCanvas = null;
  2799. this.snapshotData = "";
  2800. this.load();
  2801. this.isRetina = !this.isDomFree && this.useiOSRetina && (this.isiOS || this.isTizen);
  2802. this.devicePixelRatio = this.isRetina ? window["devicePixelRatio"] || 1 : 1;
  2803. this.ClearDeathRow();
  2804. var n;
  2805. if (typeof jQuery !== "undefined" && this.fullscreen_mode > 0) this["setSize"](jQuery(window).width(), jQuery(window).height());
  2806. try {
  2807. if (this.enableWebGL && (this.isCocoonJs || !this.isDomFree)) {
  2808. n = {
  2809. depth: false,
  2810. antialias: !this.isMobile
  2811. };
  2812. var r = true;
  2813. if (this.isChrome && this.isWindows) {
  2814. var i = document.createElement("canvas");
  2815. var s = i.getContext("webgl", n) || i.getContext("experimental-webgl", n);
  2816. if (s.getSupportedExtensions().toString() === "OES_texture_float,OES_standard_derivatives,WEBKIT_WEBGL_lose_context") {
  2817. r = false
  2818. }
  2819. }
  2820. if (r) this.gl = e.getContext("webgl", n) || e.getContext("experimental-webgl", n)
  2821. }
  2822. } catch (o) {}
  2823. if (this.gl) {
  2824. if (!this.isDomFree) {
  2825. this.overlay_canvas = document.createElement("canvas");
  2826. jQuery(this.overlay_canvas).appendTo(this.canvas.parentNode);
  2827. this.overlay_canvas.oncontextmenu = function(e) {
  2828. return false
  2829. };
  2830. this.overlay_canvas.onselectstart = function(e) {
  2831. return false
  2832. };
  2833. this.overlay_canvas.width = e.width;
  2834. this.overlay_canvas.height = e.height;
  2835. this.positionOverlayCanvas();
  2836. this.overlay_ctx = this.overlay_canvas.getContext("2d")
  2837. }
  2838. this.glwrap = new cr.GLWrap(this.gl, this.isMobile);
  2839. this.glwrap.setSize(e.width, e.height);
  2840. this.ctx = null;
  2841. this.canvas.addEventListener("webglcontextlost", function(e) {
  2842. e.preventDefault();
  2843. t.onContextLost();
  2844. window["cr_setSuspended"](true)
  2845. }, false);
  2846. this.canvas.addEventListener("webglcontextrestored", function(e) {
  2847. t.glwrap.initState();
  2848. t.glwrap.setSize(t.glwrap.width, t.glwrap.height, true);
  2849. t.layer_tex = null;
  2850. t.layout_tex = null;
  2851. t.fx_tex[0] = null;
  2852. t.fx_tex[1] = null;
  2853. t.onContextRestored();
  2854. t.redraw = true;
  2855. window["cr_setSuspended"](false)
  2856. }, false);
  2857. var u, a, f, l, c, h, p, d, v, m;
  2858. for (u = 0, a = this.types_by_index.length; u < a; u++) {
  2859. p = this.types_by_index[u];
  2860. for (f = 0, l = p.effect_types.length; f < l; f++) {
  2861. d = p.effect_types[f];
  2862. d.shaderindex = this.glwrap.getShaderIndex(d.id);
  2863. this.uses_background_blending = this.uses_background_blending || this.glwrap.programUsesDest(d.shaderindex)
  2864. }
  2865. }
  2866. for (u = 0, a = this.layouts_by_index.length; u < a; u++) {
  2867. v = this.layouts_by_index[u];
  2868. for (f = 0, l = v.effect_types.length; f < l; f++) {
  2869. d = v.effect_types[f];
  2870. d.shaderindex = this.glwrap.getShaderIndex(d.id)
  2871. }
  2872. for (f = 0, l = v.layers.length; f < l; f++) {
  2873. m = v.layers[f];
  2874. for (c = 0, h = m.effect_types.length; c < h; c++) {
  2875. d = m.effect_types[c];
  2876. d.shaderindex = this.glwrap.getShaderIndex(d.id);
  2877. this.uses_background_blending = this.uses_background_blending || this.glwrap.programUsesDest(d.shaderindex)
  2878. }
  2879. }
  2880. }
  2881. } else {
  2882. if (this.fullscreen_mode > 0 && this.isDirectCanvas) {
  2883. this.canvas = null;
  2884. document.oncontextmenu = function(e) {
  2885. return false
  2886. };
  2887. document.onselectstart = function(e) {
  2888. return false
  2889. };
  2890. this.ctx = AppMobi["canvas"]["getContext"]("2d");
  2891. try {
  2892. this.ctx["samplingMode"] = this.linearSampling ? "smooth" : "sharp";
  2893. this.ctx["globalScale"] = 1;
  2894. this.ctx["HTML5CompatibilityMode"] = true;
  2895. this.ctx["imageSmoothingEnabled"] = this.linearSampling
  2896. } catch (o) {}
  2897. if (this.width !== 0 && this.height !== 0) {
  2898. this.ctx.width = this.width;
  2899. this.ctx.height = this.height
  2900. }
  2901. }
  2902. if (!this.ctx) {
  2903. if (this.isCocoonJs) {
  2904. n = {
  2905. antialias: !! this.linearSampling
  2906. };
  2907. this.ctx = e.getContext("2d", n)
  2908. } else this.ctx = e.getContext("2d");
  2909. this.ctx["webkitImageSmoothingEnabled"] = this.linearSampling;
  2910. this.ctx["mozImageSmoothingEnabled"] = this.linearSampling;
  2911. this.ctx["msImageSmoothingEnabled"] = this.linearSampling;
  2912. this.ctx["imageSmoothingEnabled"] = this.linearSampling
  2913. }
  2914. this.overlay_canvas = null;
  2915. this.overlay_ctx = null
  2916. }
  2917. this.tickFunc = function() {
  2918. t.tick()
  2919. };
  2920. if (window != window.top && !this.isDomFree && !this.isWindows8App) {
  2921. document.addEventListener("mousedown", function() {
  2922. window.focus()
  2923. }, true);
  2924. document.addEventListener("touchstart", function() {
  2925. window.focus()
  2926. }, true)
  2927. }
  2928. if (typeof cr_is_preview !== "undefined") {
  2929. if (this.isCocoonJs) console.log("[Construct 2] In preview-over-wifi via CocoonJS mode");
  2930. if (window.location.search.indexOf("continuous") > -1) {
  2931. cr.logexport("Reloading for continuous preview");
  2932. this.loadFromSlot = "__c2_continuouspreview";
  2933. this.suspendDrawing = true
  2934. }
  2935. if (this.pauseOnBlur && !this.isMobile) {
  2936. jQuery(window).focus(function() {
  2937. t["setSuspended"](false)
  2938. });
  2939. jQuery(window).blur(function() {
  2940. t["setSuspended"](true)
  2941. })
  2942. }
  2943. }
  2944. this.go();
  2945. this.extra = {};
  2946. cr.seal(this)
  2947. }
  2948. function l(e) {
  2949. var t = e.target.result;
  2950. console.log("Save:" + t);
  2951. t.createObjectStore("saves", {
  2952. keyPath: "slot"
  2953. })
  2954. }
  2955. function c(e, t, n, r) {
  2956. console.log("IndexedDB_WriteSlot");
  2957. var i = indexedDB.open("_C2SaveStates");
  2958. i.onupgradeneeded = l;
  2959. i.onerror = r;
  2960. i.onsuccess = function(i) {
  2961. var s = i.target.result;
  2962. s.onerror = r;
  2963. var o = s.transaction(["saves"], "readwrite");
  2964. var u = o.objectStore("saves");
  2965. var a = u.put({
  2966. slot: e,
  2967. data: t
  2968. });
  2969. a.onsuccess = n
  2970. }
  2971. }
  2972. function h(e, t, n) {
  2973. var r = indexedDB.open("_C2SaveStates");
  2974. r.onupgradeneeded = l;
  2975. r.onerror = n;
  2976. r.onsuccess = function(r) {
  2977. var i = r.target.result;
  2978. i.onerror = n;
  2979. var s = i.transaction(["saves"]);
  2980. var o = s.objectStore("saves");
  2981. var u = o.get(e);
  2982. u.onsuccess = function(e) {
  2983. if (u.result) t(u.result["data"]);
  2984. else t(null)
  2985. }
  2986. }
  2987. }
  2988. function p() {
  2989. cr.logexport("Reloading for continuous preview");
  2990. if ( !! window["c2cocoonjs"]) {
  2991. CocoonJS["App"]["reload"]()
  2992. } else {
  2993. if (window.location.search.indexOf("continuous") > -1) window.location.reload(true);
  2994. else window.location = window.location + "?continuous"
  2995. }
  2996. }
  2997. function d(e) {
  2998. var t, n = {};
  2999. for (t in e) {
  3000. if (e.hasOwnProperty(t)) {
  3001. if (e[t] instanceof cr.ObjectSet) continue;
  3002. if (typeof e[t].c2userdata !== "undefined") continue;
  3003. n[t] = e[t]
  3004. }
  3005. }
  3006. return n
  3007. }
  3008. var t = false;
  3009. e.prototype["setSize"] = function(e, t) {
  3010. var n = this.hideAddressBar && this.isiPhone && !navigator["standalone"] && !this.isDomFree && !this.isPhoneGap;
  3011. var r = 0;
  3012. if (n) {
  3013. if (this.isiPhone) r = 60;
  3014. else if (this.isAndroid) r = 56;
  3015. t += r
  3016. }
  3017. var i = 0,
  3018. s = 0;
  3019. var o = 0,
  3020. u = 0,
  3021. a = 0;
  3022. var f = this.fullscreen_mode;
  3023. var l = document["mozFullScreen"] || document["webkitIsFullScreen"] || !! document["msFullscreenElement"] || document["fullScreen"] || this.isNodeFullscreen;
  3024. if (l && this.fullscreen_scaling > 0) f = this.fullscreen_scaling;
  3025. if (f >= 4) {
  3026. var c = this.original_width / this.original_height;
  3027. var h = e / t;
  3028. if (h > c) {
  3029. o = t * c;
  3030. if (f === 5) {
  3031. a = o / this.original_width;
  3032. if (a > 1) a = Math.floor(a);
  3033. else if (a < 1) a = 1 / Math.ceil(1 / a);
  3034. o = this.original_width * a;
  3035. u = this.original_height * a;
  3036. i = (e - o) / 2;
  3037. s = (t - u) / 2;
  3038. e = o;
  3039. t = u
  3040. } else {
  3041. i = (e - o) / 2;
  3042. e = o
  3043. }
  3044. } else {
  3045. u = e / c;
  3046. if (f === 5) {
  3047. a = u / this.original_height;
  3048. if (a > 1) a = Math.floor(a);
  3049. else if (a < 1) a = 1 / Math.ceil(1 / a);
  3050. o = this.original_width * a;
  3051. u = this.original_height * a;
  3052. i = (e - o) / 2;
  3053. s = (t - u) / 2;
  3054. e = o;
  3055. t = u
  3056. } else {
  3057. s = (t - u) / 2;
  3058. t = u
  3059. }
  3060. }
  3061. if (l && !this.isNodeWebkit) {
  3062. i = 0;
  3063. s = 0
  3064. }
  3065. i = Math.floor(i);
  3066. s = Math.floor(s);
  3067. e = Math.floor(e);
  3068. t = Math.floor(t)
  3069. } else if (this.isNodeWebkit && this.isNodeFullscreen && this.fullscreen_mode_set === 0) {
  3070. i = Math.floor((e - this.original_width) / 2);
  3071. s = Math.floor((t - this.original_height) / 2);
  3072. e = this.original_width;
  3073. t = this.original_height
  3074. }
  3075. if (this.isRetina && this.isiPad && this.devicePixelRatio > 1) {
  3076. if (e >= 1024) e = 1023;
  3077. if (t >= 1024) t = 1023
  3078. }
  3079. var p = this.devicePixelRatio;
  3080. this.width = e * p;
  3081. this.height = t * p;
  3082. this.redraw = true;
  3083. if (this.canvasdiv && !this.isDomFree) {
  3084. jQuery(this.canvasdiv).css({
  3085. width: e + "px",
  3086. height: t + "px",
  3087. "margin-left": i,
  3088. "margin-top": s
  3089. });
  3090. if (typeof cr_is_preview !== "undefined") {
  3091. jQuery("#borderwrap").css({
  3092. width: e + "px",
  3093. height: t + "px"
  3094. })
  3095. }
  3096. }
  3097. if (this.canvas) {
  3098. this.canvas.width = e * p;
  3099. this.canvas.height = t * p;
  3100. if (this.isRetina) {
  3101. jQuery(this.canvas).css({
  3102. width: e + "px",
  3103. height: t + "px"
  3104. })
  3105. }
  3106. }
  3107. if (this.overlay_canvas) {
  3108. this.overlay_canvas.width = e;
  3109. this.overlay_canvas.height = t
  3110. }
  3111. if (this.glwrap) this.glwrap.setSize(e, t);
  3112. if (this.isDirectCanvas && this.ctx) {
  3113. this.ctx.width = e;
  3114. this.ctx.height = t
  3115. }
  3116. if (this.ctx) {
  3117. this.ctx["webkitImageSmoothingEnabled"] = this.linearSampling;
  3118. this.ctx["mozImageSmoothingEnabled"] = this.linearSampling;
  3119. this.ctx["msImageSmoothingEnabled"] = this.linearSampling;
  3120. this.ctx["imageSmoothingEnabled"] = this.linearSampling
  3121. }
  3122. if (n && r > 0) {
  3123. window.setTimeout(function() {
  3124. window.scrollTo(0, 1)
  3125. }, 100)
  3126. }
  3127. };
  3128. e.prototype.onContextLost = function() {
  3129. this.is_WebGL_context_lost = true;
  3130. var e, t, n;
  3131. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  3132. n = this.types_by_index[e];
  3133. if (n.onLostWebGLContext) n.onLostWebGLContext()
  3134. }
  3135. };
  3136. e.prototype.onContextRestored = function() {
  3137. this.is_WebGL_context_lost = false;
  3138. var e, t, n;
  3139. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  3140. n = this.types_by_index[e];
  3141. if (n.onRestoreWebGLContext) n.onRestoreWebGLContext()
  3142. }
  3143. };
  3144. e.prototype.positionOverlayCanvas = function() {
  3145. if (this.isDomFree) return;
  3146. var e = document["mozFullScreen"] || document["webkitIsFullScreen"] || document["fullScreen"] || !! document["msFullscreenElement"] || this.isNodeFullscreen;
  3147. var t = e ? jQuery(this.canvas).offset() : jQuery(this.canvas).position();
  3148. t.position = "absolute";
  3149. jQuery(this.overlay_canvas).css(t)
  3150. };
  3151. var n = window["cancelAnimationFrame"] || window["mozCancelAnimationFrame"] || window["webkitCancelAnimationFrame"] || window["msCancelAnimationFrame"] || window["oCancelAnimationFrame"];
  3152. e.prototype["setSuspended"] = function(e) {
  3153. var t, r;
  3154. if (e && !this.isSuspended) {
  3155. cr.logexport("[Construct 2] Suspending");
  3156. this.isSuspended = true;
  3157. if (this.raf_id !== 0 && n) n(this.raf_id);
  3158. if (this.timeout_id !== 0) clearTimeout(this.timeout_id);
  3159. for (t = 0, r = this.suspend_events.length; t < r; t++) this.suspend_events[t](true)
  3160. } else if (!e && this.isSuspended) {
  3161. cr.logexport("[Construct 2] Resuming");
  3162. this.isSuspended = false;
  3163. this.last_tick_time = cr.performance_now();
  3164. this.last_fps_time = cr.performance_now();
  3165. this.framecount = 0;
  3166. this.logictime = 0;
  3167. for (t = 0, r = this.suspend_events.length; t < r; t++) this.suspend_events[t](false);
  3168. this.tick()
  3169. }
  3170. };
  3171. e.prototype.addSuspendCallback = function(e) {
  3172. this.suspend_events.push(e)
  3173. };
  3174. e.prototype.load = function() {
  3175. var e = cr.getProjectModel();
  3176. this.name = e[0];
  3177. this.first_layout = e[1];
  3178. this.fullscreen_mode = e[11];
  3179. this.fullscreen_mode_set = e[11];
  3180. if (this.isDomFree && (e[11] >= 4 || e[11] === 0)) {
  3181. cr.logexport("[Construct 2] Letterbox scale fullscreen modes are not supported on this platform - falling back to 'Scale outer'");
  3182. this.fullscreen_mode = 3;
  3183. this.fullscreen_mode_set = 3
  3184. }
  3185. this.uses_loader_layout = e[17];
  3186. this.loaderstyle = e[18];
  3187. if (this.loaderstyle === 0) {
  3188. this.loaderlogo = new Image;
  3189. this.loaderlogo.src = "loading-logo.png"
  3190. }
  3191. this.next_uid = e[20];
  3192. this.system = new cr.system_object(this);
  3193. var t, n, r, i, s, o, u, a, f, l, c;
  3194. var h, p;
  3195. for (t = 0, n = e[2].length; t < n; t++) {
  3196. a = e[2][t];
  3197. cr.add_common_aces(a);
  3198. h = new a[0](this);
  3199. h.singleglobal = a[1];
  3200. h.is_world = a[2];
  3201. h.must_predraw = a[9];
  3202. if (h.onCreate) h.onCreate();
  3203. cr.seal(h);
  3204. this.plugins.push(h)
  3205. }
  3206. e = cr.getProjectModel();
  3207. for (t = 0, n = e[3].length; t < n; t++) {
  3208. a = e[3][t];
  3209. p = a[1];
  3210. h = null;
  3211. for (r = 0, i = this.plugins.length; r < i; r++) {
  3212. if (this.plugins[r] instanceof p) {
  3213. h = this.plugins[r];
  3214. break
  3215. }
  3216. }
  3217. var d = new h.Type(h);
  3218. d.name = a[0];
  3219. d.is_family = a[2];
  3220. d.instvar_sids = a[3].slice(0);
  3221. d.vars_count = a[3].length;
  3222. d.behs_count = a[4];
  3223. d.fx_count = a[5];
  3224. d.sid = a[11];
  3225. if (d.is_family) {
  3226. d.members = [];
  3227. d.family_index = this.family_count++;
  3228. d.families = null
  3229. } else {
  3230. d.members = null;
  3231. d.family_index = -1;
  3232. d.families = []
  3233. }
  3234. d.family_var_map = null;
  3235. d.family_beh_map = null;
  3236. d.family_fx_map = null;
  3237. d.is_contained = false;
  3238. d.container = null;
  3239. if (a[6]) {
  3240. d.texture_file = a[6][0];
  3241. d.texture_filesize = a[6][1];
  3242. d.texture_pixelformat = a[6][2]
  3243. } else {
  3244. d.texture_file = null;
  3245. d.texture_filesize = 0;
  3246. d.texture_pixelformat = 0
  3247. }
  3248. if (a[7]) {
  3249. d.animations = a[7];
  3250. } else {
  3251. d.animations = null
  3252. }
  3253. d.index = t;
  3254. d.instances = [];
  3255. d.deadCache = [];
  3256. d.solstack = [new cr.selection(d)];
  3257. d.cur_sol = 0;
  3258. d.default_instance = null;
  3259. d.stale_iids = true;
  3260. d.updateIIDs = cr.type_updateIIDs;
  3261. d.getFirstPicked = cr.type_getFirstPicked;
  3262. d.getPairedInstance = cr.type_getPairedInstance;
  3263. d.getCurrentSol = cr.type_getCurrentSol;
  3264. d.pushCleanSol = cr.type_pushCleanSol;
  3265. d.pushCopySol = cr.type_pushCopySol;
  3266. d.popSol = cr.type_popSol;
  3267. d.getBehaviorByName = cr.type_getBehaviorByName;
  3268. d.getBehaviorIndexByName = cr.type_getBehaviorIndexByName;
  3269. d.getEffectIndexByName = cr.type_getEffectIndexByName;
  3270. d.applySolToContainer = cr.type_applySolToContainer;
  3271. d.extra = {};
  3272. d.toString = cr.type_toString;
  3273. d.behaviors = [];
  3274. for (r = 0, i = a[8].length; r < i; r++) {
  3275. f = a[8][r];
  3276. var v = f[1];
  3277. var m = null;
  3278. for (s = 0, o = this.behaviors.length; s < o; s++) {
  3279. if (this.behaviors[s] instanceof v) {
  3280. m = this.behaviors[s];
  3281. break
  3282. }
  3283. }
  3284. if (!m) {
  3285. m = new v(this);
  3286. m.my_instances = new cr.ObjectSet;
  3287. if (m.onCreate) m.onCreate();
  3288. cr.seal(m);
  3289. this.behaviors.push(m)
  3290. }
  3291. var g = new m.Type(m, d);
  3292. g.name = f[0];
  3293. g.sid = f[2];
  3294. g.onCreate();
  3295. cr.seal(g);
  3296. d.behaviors.push(g)
  3297. }
  3298. d.global = a[9];
  3299. d.isOnLoaderLayout = a[10];
  3300. d.effect_types = [];
  3301. for (r = 0, i = a[12].length; r < i; r++) {
  3302. d.effect_types.push({
  3303. id: a[12][r][0],
  3304. name: a[12][r][1],
  3305. shaderindex: -1,
  3306. active: true,
  3307. index: r
  3308. })
  3309. }
  3310. if (!this.uses_loader_layout || d.is_family || d.isOnLoaderLayout || !h.is_world) {
  3311. d.onCreate();
  3312. cr.seal(d)
  3313. }
  3314. if (d.name) this.types[d.name] = d;
  3315. this.types_by_index.push(d);
  3316. if (h.singleglobal) {
  3317. var y = new h.Instance(d);
  3318. y.uid = this.next_uid++;
  3319. y.puid = this.next_puid++;
  3320. y.iid = 0;
  3321. y.get_iid = cr.inst_get_iid;
  3322. y.toString = cr.inst_toString;
  3323. y.properties = a[13];
  3324. y.onCreate();
  3325. cr.seal(y);
  3326. d.instances.push(y);
  3327. this.objectsByUid[y.uid.toString()] = y
  3328. }
  3329. }
  3330. for (t = 0, n = e[4].length; t < n; t++) {
  3331. var b = e[4][t];
  3332. var w = this.types_by_index[b[0]];
  3333. var E;
  3334. for (r = 1, i = b.length; r < i; r++) {
  3335. E = this.types_by_index[b[r]];
  3336. E.families.push(w);
  3337. w.members.push(E)
  3338. }
  3339. }
  3340. for (t = 0, n = e[22].length; t < n; t++) {
  3341. var S = e[22][t];
  3342. var x = [];
  3343. for (r = 0, i = S.length; r < i; r++) x.push(this.types_by_index[S[r]]);
  3344. for (r = 0, i = x.length; r < i; r++) {
  3345. x[r].is_contained = true;
  3346. x[r].container = x
  3347. }
  3348. }
  3349. if (this.family_count > 0) {
  3350. for (t = 0, n = this.types_by_index.length; t < n; t++) {
  3351. l = this.types_by_index[t];
  3352. if (l.is_family || !l.families.length) continue;
  3353. l.family_var_map = new Array(this.family_count);
  3354. l.family_beh_map = new Array(this.family_count);
  3355. l.family_fx_map = new Array(this.family_count);
  3356. var T = [];
  3357. var N = 0;
  3358. var C = 0;
  3359. var k = 0;
  3360. for (r = 0, i = l.families.length; r < i; r++) {
  3361. c = l.families[r];
  3362. l.family_var_map[c.family_index] = N;
  3363. N += c.vars_count;
  3364. l.family_beh_map[c.family_index] = C;
  3365. C += c.behs_count;
  3366. l.family_fx_map[c.family_index] = k;
  3367. k += c.fx_count;
  3368. for (s = 0, o = c.effect_types.length; s < o; s++) T.push(cr.shallowCopy({}, c.effect_types[s]))
  3369. }
  3370. l.effect_types = T.concat(l.effect_types);
  3371. for (r = 0, i = l.effect_types.length; r < i; r++) l.effect_types[r].index = r
  3372. }
  3373. }
  3374. for (t = 0, n = e[5].length; t < n; t++) {
  3375. a = e[5][t];
  3376. var L = new cr.layout(this, a);
  3377. cr.seal(L);
  3378. this.layouts[L.name] = L;
  3379. this.layouts_by_index.push(L)
  3380. }
  3381. for (t = 0, n = e[6].length; t < n; t++) {
  3382. a = e[6][t];
  3383. var A = new cr.eventsheet(this, a);
  3384. cr.seal(A);
  3385. this.eventsheets[A.name] = A;
  3386. this.eventsheets_by_index.push(A)
  3387. }
  3388. for (t = 0, n = this.eventsheets_by_index.length; t < n; t++) this.eventsheets_by_index[t].postInit();
  3389. for (t = 0, n = this.triggers_to_postinit.length; t < n; t++) this.triggers_to_postinit[t].postInit();
  3390. this.triggers_to_postinit.length = 0;
  3391. this.files_subfolder = e[7];
  3392. this.pixel_rounding = e[8];
  3393. this.original_width = e[9];
  3394. this.original_height = e[10];
  3395. this.aspect_scale = 1;
  3396. this.enableWebGL = e[12];
  3397. this.linearSampling = e[13];
  3398. this.clearBackground = e[14];
  3399. this.versionstr = e[15];
  3400. var O = e[16];
  3401. if (O === 2) O = this.isiPhone ? 1 : 0;
  3402. this.useiOSRetina = O !== 0;
  3403. this.hideAddressBar = e[19];
  3404. this.pauseOnBlur = e[21];
  3405. this.start_time = Date.now()
  3406. };
  3407. e.prototype.findWaitingTexture = function(e) {
  3408. var t, n;
  3409. for (t = 0, n = this.wait_for_textures.length; t < n; t++) {
  3410. if (this.wait_for_textures[t].cr_src === e) return this.wait_for_textures[t]
  3411. }
  3412. return null
  3413. };
  3414. e.prototype.areAllTexturesLoaded = function() {
  3415. var e = 0;
  3416. var t = 0;
  3417. var n = true;
  3418. var r, i;
  3419. for (r = 0, i = this.wait_for_textures.length; r < i; r++) {
  3420. var s = this.wait_for_textures[r].cr_filesize;
  3421. if (!s || s <= 0) s = 5e4;
  3422. e += s;
  3423. if (this.wait_for_textures[r].complete || this.wait_for_textures[r]["loaded"]) t += s;
  3424. else n = false
  3425. }
  3426. if (e == 0) this.progress = 0;
  3427. else this.progress = t / e;
  3428. return n
  3429. };
  3430. e.prototype.go = function() {
  3431. if (!this.ctx && !this.glwrap) return;
  3432. var e = this.ctx || this.overlay_ctx;
  3433. if (this.overlay_canvas) this.positionOverlayCanvas();
  3434. this.progress = 0;
  3435. this.last_progress = -1;
  3436. if (this.areAllTexturesLoaded()) this.go_textures_done();
  3437. else {
  3438. var t = Date.now() - this.start_time;
  3439. var n = 1;
  3440. if (this.isTizen) n = this.devicePixelRatio;
  3441. if (e) {
  3442. if (this.loaderstyle !== 3 && t >= 500 && this.last_progress != this.progress) {
  3443. e.clearRect(0, 0, this.width, this.height);
  3444. var r = this.width / (2 * n);
  3445. var i = this.height / (2 * n);
  3446. var s = this.loaderstyle === 0 && this.loaderlogo.complete;
  3447. var o = 40;
  3448. var u = 0;
  3449. var a = 80;
  3450. if (s) {
  3451. a = this.loaderlogo.width;
  3452. o = a / 2;
  3453. u = this.loaderlogo.height / 2;
  3454. e.drawImage(this.loaderlogo, cr.floor(r - o), cr.floor(i - u))
  3455. }
  3456. if (this.loaderstyle <= 1) {
  3457. i += u + (s ? 12 : 0);
  3458. r -= o;
  3459. r = cr.floor(r) + .5;
  3460. i = cr.floor(i) + .5;
  3461. e.fillStyle = "DodgerBlue";
  3462. e.fillRect(r, i, Math.floor(a * this.progress), 6);
  3463. e.strokeStyle = "black";
  3464. e.strokeRect(r, i, a, 6);
  3465. e.strokeStyle = "white";
  3466. e.strokeRect(r - 1, i - 1, a + 2, 8)
  3467. } else if (this.loaderstyle === 2) {
  3468. e.font = "12pt Arial";
  3469. e.fillStyle = "#999";
  3470. e.textBaseLine = "middle";
  3471. var f = Math.round(this.progress * 100) + "%";
  3472. var l = e.measureText ? e.measureText(f) : null;
  3473. var c = l ? l.width : 0;
  3474. e.fillText(f, r - c / 2, i)
  3475. }
  3476. }
  3477. this.last_progress = this.progress
  3478. }
  3479. setTimeout(function(e) {
  3480. return function() {
  3481. e.go()
  3482. }
  3483. }(this), 100)
  3484. }
  3485. };
  3486. e.prototype.go_textures_done = function() {
  3487. if (this.overlay_canvas) {
  3488. this.canvas.parentNode.removeChild(this.overlay_canvas);
  3489. this.overlay_ctx = null;
  3490. this.overlay_canvas = null
  3491. }
  3492. this.start_time = Date.now();
  3493. this.last_fps_time = cr.performance_now();
  3494. var e, t, n;
  3495. if (this.uses_loader_layout) {
  3496. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  3497. n = this.types_by_index[e];
  3498. if (!n.is_family && !n.isOnLoaderLayout && n.plugin.is_world) {
  3499. n.onCreate();
  3500. cr.seal(n)
  3501. }
  3502. }
  3503. } else this.isloading = false;
  3504. for (e = 0, t = this.layouts_by_index.length; e < t; e++) {
  3505. this.layouts_by_index[e].createGlobalNonWorlds()
  3506. }
  3507. if (this.fullscreen_mode >= 2) {
  3508. var r = this.original_width / this.original_height;
  3509. var i = this.width / this.height;
  3510. if (this.fullscreen_mode !== 2 && i > r || this.fullscreen_mode === 2 && i < r) this.aspect_scale = this.height / this.original_height;
  3511. else this.aspect_scale = this.width / this.original_width
  3512. }
  3513. if (this.first_layout) this.layouts[this.first_layout].startRunning();
  3514. else this.layouts_by_index[0].startRunning();
  3515. if (!this.uses_loader_layout) {
  3516. this.loadingprogress = 1;
  3517. this.trigger(cr.system_object.prototype.cnds.OnLoadFinished, null)
  3518. }
  3519. this.tick();
  3520. if (this.isDirectCanvas) AppMobi["webview"]["execute"]("onGameReady();")
  3521. };
  3522. var r = window["requestAnimationFrame"] || window["mozRequestAnimationFrame"] || window["webkitRequestAnimationFrame"] || window["msRequestAnimationFrame"] || window["oRequestAnimationFrame"];
  3523. e.prototype.tick = function() {
  3524. if (!this.running_layout) return;
  3525. var e = cr.performance_now();
  3526. if (!this.isDomFree && window != window.top) {
  3527. var t = this.fullscreen_mode;
  3528. var n = document["mozFullScreen"] || document["webkitIsFullScreen"] || document["fullScreen"] || !! document["msFullscreenElement"] || this.isNodeFullscreen;
  3529. if (n && this.fullscreen_scaling > 0) t = this.fullscreen_scaling;
  3530. if (t > 0) {
  3531. var i = window.innerWidth;
  3532. var s = window.innerHeight;
  3533. if (this.lastwidth !== i || this.lastheight !== s) {
  3534. this.lastwidth = i;
  3535. this.lastheight = s;
  3536. this["setSize"](i, s)
  3537. }
  3538. }
  3539. }
  3540. if (this.isloading) {
  3541. var o = this.areAllTexturesLoaded();
  3542. this.loadingprogress = this.progress;
  3543. if (o) {
  3544. this.isloading = false;
  3545. this.progress = 1;
  3546. this.trigger(cr.system_object.prototype.cnds.OnLoadFinished, null)
  3547. }
  3548. }
  3549. this.logic();
  3550. if ((this.redraw || this.isCocoonJs) && !this.is_WebGL_context_lost && !this.suspendDrawing) {
  3551. this.redraw = false;
  3552. if (this.glwrap) this.drawGL();
  3553. else this.draw();
  3554. if (this.snapshotCanvas) {
  3555. if (this.canvas && this.canvas.toDataURL) {
  3556. this.snapshotData = this.canvas.toDataURL(this.snapshotCanvas[0], this.snapshotCanvas[1]);
  3557. this.trigger(cr.system_object.prototype.cnds.OnCanvasSnapshot, null)
  3558. }
  3559. this.snapshotCanvas = null
  3560. }
  3561. }
  3562. if (!this.hit_breakpoint) {
  3563. this.tickcount++;
  3564. this.execcount++;
  3565. this.framecount++
  3566. }
  3567. this.logictime += cr.performance_now() - e;
  3568. if (this.isSuspended) return;
  3569. if (r) this.raf_id = r(this.tickFunc, this.canvas);
  3570. else {
  3571. this.timeout_id = setTimeout(this.tickFunc, this.isMobile ? 1 : 16)
  3572. }
  3573. };
  3574. e.prototype.logic = function() {
  3575. orientationListener();
  3576. var e, t, n, r, i, s, o, u, a;
  3577. var f = cr.performance_now();
  3578. if (f - this.last_fps_time >= 1e3) {
  3579. this.last_fps_time += 1e3;
  3580. this.fps = this.framecount;
  3581. this.framecount = 0;
  3582. this.cpuutilisation = this.logictime;
  3583. this.logictime = 0
  3584. }
  3585. if (this.measuring_dt) {
  3586. if (this.last_tick_time !== 0) {
  3587. var l = f - this.last_tick_time;
  3588. if (l === 0 && !this.isDebug) {
  3589. this.zeroDtCount++;
  3590. if (this.zeroDtCout >= 10) this.measuring_dt = false;
  3591. this.dt1 = 1 / 60
  3592. } else {
  3593. this.dt1 = l / 1e3;
  3594. if (this.dt1 > .5) this.dt1 = 0;
  3595. else if (this.dt1 > .1) this.dt1 = .1
  3596. }
  3597. }
  3598. this.last_tick_time = f
  3599. }
  3600. this.dt = this.dt1 * this.timescale;
  3601. this.kahanTime.add(this.dt);
  3602. var c = document["mozFullScreen"] || document["webkitIsFullScreen"] || document["fullScreen"] || !! document["msFullscreenElement"] || this.isNodeFullscreen;
  3603. if (this.fullscreen_mode >= 2 || c && this.fullscreen_scaling > 0) {
  3604. var h = this.original_width / this.original_height;
  3605. var p = this.width / this.height;
  3606. var d = this.fullscreen_mode;
  3607. if (c && this.fullscreen_scaling > 0) d = this.fullscreen_scaling;
  3608. if (d !== 2 && p > h || d === 2 && p < h) {
  3609. this.aspect_scale = this.height / this.original_height
  3610. } else {
  3611. this.aspect_scale = this.width / this.original_width
  3612. }
  3613. if (this.running_layout) {
  3614. this.running_layout.scrollToX(this.running_layout.scrollX);
  3615. this.running_layout.scrollToY(this.running_layout.scrollY)
  3616. }
  3617. } else this.aspect_scale = 1;
  3618. this.ClearDeathRow();
  3619. this.isInOnDestroy++;
  3620. this.system.runWaits();
  3621. this.isInOnDestroy--;
  3622. this.ClearDeathRow();
  3623. this.isInOnDestroy++;
  3624. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  3625. o = this.types_by_index[e];
  3626. if (o.is_family || !o.behaviors.length && !o.families.length) continue;
  3627. for (n = 0, r = o.instances.length; n < r; n++) {
  3628. u = o.instances[n];
  3629. for (i = 0, s = u.behavior_insts.length; i < s; i++) {
  3630. u.behavior_insts[i].tick()
  3631. }
  3632. }
  3633. }
  3634. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  3635. o = this.types_by_index[e];
  3636. if (o.is_family || !o.behaviors.length && !o.families.length) continue;
  3637. for (n = 0, r = o.instances.length; n < r; n++) {
  3638. u = o.instances[n];
  3639. for (i = 0, s = u.behavior_insts.length; i < s; i++) {
  3640. a = u.behavior_insts[i];
  3641. if (a.posttick) a.posttick()
  3642. }
  3643. }
  3644. }
  3645. var v = this.objects_to_tick.valuesRef();
  3646. for (e = 0, t = v.length; e < t; e++) v[e].tick();
  3647. this.isInOnDestroy--;
  3648. this.handleSaveLoad();
  3649. e = 0;
  3650. while (this.changelayout && e++ < 10) {
  3651. this.doChangeLayout(this.changelayout)
  3652. }
  3653. for (e = 0, t = this.eventsheets_by_index.length; e < t; e++) this.eventsheets_by_index[e].hasRun = false;
  3654. if (this.running_layout.event_sheet) this.running_layout.event_sheet.run();
  3655. this.registered_collisions.length = 0;
  3656. this.layout_first_tick = false;
  3657. this.isInOnDestroy++;
  3658. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  3659. o = this.types_by_index[e];
  3660. if (o.is_family || !o.behaviors.length && !o.families.length) continue;
  3661. for (n = 0, r = o.instances.length; n < r; n++) {
  3662. var u = o.instances[n];
  3663. for (i = 0, s = u.behavior_insts.length; i < s; i++) {
  3664. a = u.behavior_insts[i];
  3665. if (a.tick2) a.tick2()
  3666. }
  3667. }
  3668. }
  3669. v = this.objects_to_tick2.valuesRef();
  3670. for (e = 0, t = v.length; e < t; e++) v[e].tick2();
  3671. this.isInOnDestroy--
  3672. };
  3673. e.prototype.doChangeLayout = function(e) {
  3674. var t = this.running_layout;
  3675. this.running_layout.stopRunning();
  3676. var n, r, i, s, o, u, a, f, l;
  3677. if (this.glwrap) {
  3678. for (n = 0, r = this.types_by_index.length; n < r; n++) {
  3679. a = this.types_by_index[n];
  3680. if (a.is_family) continue;
  3681. if (a.unloadTextures && (!a.global || a.instances.length === 0) && e.initial_types.indexOf(a) === -1) {
  3682. a.unloadTextures()
  3683. }
  3684. }
  3685. }
  3686. if (t == e) this.system.waits.length = 0;
  3687. e.startRunning();
  3688. for (n = 0, r = this.types_by_index.length; n < r; n++) {
  3689. a = this.types_by_index[n];
  3690. if (!a.global && !a.plugin.singleglobal) continue;
  3691. for (i = 0, s = a.instances.length; i < s; i++) {
  3692. f = a.instances[i];
  3693. if (f.onLayoutChange) f.onLayoutChange();
  3694. if (f.behavior_insts) {
  3695. for (o = 0, u = f.behavior_insts.length; o < u; o++) {
  3696. l = f.behavior_insts[o];
  3697. if (l.onLayoutChange) l.onLayoutChange()
  3698. }
  3699. }
  3700. }
  3701. }
  3702. this.redraw = true;
  3703. this.layout_first_tick = true;
  3704. this.ClearDeathRow()
  3705. };
  3706. e.prototype.tickMe = function(e) {
  3707. this.objects_to_tick.add(e)
  3708. };
  3709. e.prototype.untickMe = function(e) {
  3710. this.objects_to_tick.remove(e)
  3711. };
  3712. e.prototype.tick2Me = function(e) {
  3713. this.objects_to_tick2.add(e)
  3714. };
  3715. e.prototype.untick2Me = function(e) {
  3716. this.objects_to_tick2.remove(e)
  3717. };
  3718. e.prototype.getDt = function(e) {
  3719. if (!e || e.my_timescale === -1) return this.dt;
  3720. return this.dt1 * e.my_timescale
  3721. };
  3722. e.prototype.draw = function() {
  3723. this.running_layout.draw(this.ctx);
  3724. if (this.isDirectCanvas) this.ctx["present"]()
  3725. };
  3726. e.prototype.drawGL = function() {
  3727. this.running_layout.drawGL(this.glwrap);
  3728. this.glwrap.present()
  3729. };
  3730. e.prototype.addDestroyCallback = function(e) {
  3731. if (e) this.destroycallbacks.push(e)
  3732. };
  3733. e.prototype.removeDestroyCallback = function(e) {
  3734. cr.arrayFindRemove(this.destroycallbacks, e)
  3735. };
  3736. e.prototype.getObjectByUID = function(e) {
  3737. return this.objectsByUid[e.toString()]
  3738. };
  3739. e.prototype.DestroyInstance = function(e) {
  3740. var t, n;
  3741. if (!this.deathRow.contains(e)) {
  3742. this.deathRow.add(e);
  3743. if (e.is_contained) {
  3744. for (t = 0, n = e.siblings.length; t < n; t++) {
  3745. this.DestroyInstance(e.siblings[t])
  3746. }
  3747. }
  3748. if (this.isInClearDeathRow) this.deathRow.values_cache.push(e);
  3749. this.isInOnDestroy++;
  3750. this.trigger(Object.getPrototypeOf(e.type.plugin).cnds.OnDestroyed, e);
  3751. this.isInOnDestroy--
  3752. }
  3753. };
  3754. e.prototype.ClearDeathRow = function() {
  3755. var e, t, n, r, i;
  3756. var s, o, u, a, f, l;
  3757. var c, h;
  3758. this.isInClearDeathRow = true;
  3759. for (s = 0, a = this.createRow.length; s < a; s++) {
  3760. e = this.createRow[s];
  3761. n = e.type;
  3762. n.instances.push(e);
  3763. for (o = 0, f = n.families.length; o < f; o++) {
  3764. n.families[o].instances.push(e);
  3765. n.families[o].stale_iids = true
  3766. }
  3767. }
  3768. this.createRow.length = 0;
  3769. var p = this.deathRow.valuesRef();
  3770. for (s = 0; s < p.length; s++) {
  3771. e = p[s];
  3772. n = e.type;
  3773. r = n.instances;
  3774. for (o = 0, f = this.destroycallbacks.length; o < f; o++) this.destroycallbacks[o](e);
  3775. cr.arrayFindRemove(r, e);
  3776. if (e.layer) {
  3777. cr.arrayRemove(e.layer.instances, e.get_zindex());
  3778. e.layer.zindices_stale = true
  3779. }
  3780. for (o = 0, f = n.families.length; o < f; o++) {
  3781. cr.arrayFindRemove(n.families[o].instances, e);
  3782. n.families[o].stale_iids = true
  3783. }
  3784. if (e.behavior_insts) {
  3785. for (o = 0, f = e.behavior_insts.length; o < f; o++) {
  3786. i = e.behavior_insts[o];
  3787. if (i.onDestroy) i.onDestroy();
  3788. i.behavior.my_instances.remove(e)
  3789. }
  3790. }
  3791. this.objects_to_tick.remove(e);
  3792. this.objects_to_tick2.remove(e);
  3793. for (o = 0, f = this.system.waits.length; o < f; o++) {
  3794. c = this.system.waits[o];
  3795. if (c.sols.hasOwnProperty(n.index)) cr.arrayFindRemove(c.sols[n.index].insts, e);
  3796. if (!n.is_family) {
  3797. for (u = 0, l = n.families.length; u < l; u++) {
  3798. h = n.families[u];
  3799. if (c.sols.hasOwnProperty(h.index)) cr.arrayFindRemove(c.sols[h.index].insts, e)
  3800. }
  3801. }
  3802. }
  3803. if (e.onDestroy) e.onDestroy();
  3804. if (this.objectsByUid.hasOwnProperty(e.uid.toString())) delete this.objectsByUid[e.uid.toString()];
  3805. this.objectcount--;
  3806. if (n.deadCache.length < 64) n.deadCache.push(e);
  3807. n.stale_iids = true
  3808. }
  3809. if (!this.deathRow.isEmpty()) this.redraw = true;
  3810. this.deathRow.clear();
  3811. this.isInClearDeathRow = false
  3812. };
  3813. e.prototype.createInstance = function(e, t, n, r) {
  3814. if (e.is_family) {
  3815. var i = cr.floor(Math.random() * e.members.length);
  3816. return this.createInstance(e.members[i], t, n, r)
  3817. }
  3818. if (!e.default_instance) {
  3819. return null
  3820. }
  3821. return this.createInstanceFromInit(e.default_instance, t, false, n, r, false)
  3822. };
  3823. var i = [];
  3824. e.prototype.createInstanceFromInit = function(e, t, n, r, s, o) {
  3825. var u, a, f, l, c, h, p, d;
  3826. if (!e) return null;
  3827. var v = this.types_by_index[e[1]];
  3828. var m = v.plugin.is_world;
  3829. if (this.isloading && m && !v.isOnLoaderLayout) return null;
  3830. if (m && !this.glwrap && e[0][11] === 11) return null;
  3831. var g = t;
  3832. if (!m) t = null;
  3833. var y;
  3834. if (v.deadCache.length) {
  3835. y = v.deadCache.pop();
  3836. y.recycled = true;
  3837. v.plugin.Instance.call(y, v)
  3838. } else {
  3839. y = new v.plugin.Instance(v);
  3840. y.recycled = false
  3841. }
  3842. if (n && !o) y.uid = e[2];
  3843. else y.uid = this.next_uid++;
  3844. this.objectsByUid[y.uid.toString()] = y;
  3845. y.puid = this.next_puid++;
  3846. y.iid = v.instances.length;
  3847. for (u = 0, a = this.createRow.length; u < a; ++u) {
  3848. if (this.createRow[u].type === v) y.iid++
  3849. }
  3850. y.get_iid = cr.inst_get_iid;
  3851. var b = e[3];
  3852. if (y.recycled) {
  3853. cr.wipe(y.extra)
  3854. } else {
  3855. y.extra = {};
  3856. if (typeof cr_is_preview !== "undefined") {
  3857. y.instance_var_names = [];
  3858. y.instance_var_names.length = b.length;
  3859. for (u = 0, a = b.length; u < a; u++) y.instance_var_names[u] = b[u][1]
  3860. }
  3861. y.instance_vars = [];
  3862. y.instance_vars.length = b.length
  3863. }
  3864. for (u = 0, a = b.length; u < a; u++) y.instance_vars[u] = b[u][0];
  3865. if (m) {
  3866. var w = e[0];
  3867. y.x = cr.is_undefined(r) ? w[0] : r;
  3868. y.y = cr.is_undefined(s) ? w[1] : s;
  3869. y.z = w[2];
  3870. y.width = w[3];
  3871. y.height = w[4];
  3872. y.depth = w[5];
  3873. y.angle = w[6];
  3874. y.opacity = w[7];
  3875. y.hotspotX = w[8];
  3876. y.hotspotY = w[9];
  3877. y.blend_mode = w[10];
  3878. h = w[11];
  3879. if (!this.glwrap && v.effect_types.length) y.blend_mode = h;
  3880. y.compositeOp = cr.effectToCompositeOp(y.blend_mode);
  3881. if (this.gl) cr.setGLBlend(y, y.blend_mode, this.gl);
  3882. if (y.recycled) {
  3883. for (u = 0, a = w[12].length; u < a; u++) {
  3884. for (f = 0, l = w[12][u].length; f < l; f++) y.effect_params[u][f] = w[12][u][f]
  3885. }
  3886. y.bbox.set(0, 0, 0, 0);
  3887. y.bquad.set_from_rect(y.bbox);
  3888. y.bbox_changed_callbacks.length = 0
  3889. } else {
  3890. y.effect_params = w[12].slice(0);
  3891. for (u = 0, a = y.effect_params.length; u < a; u++) y.effect_params[u] = w[12][u].slice(0);
  3892. y.active_effect_types = [];
  3893. y.active_effect_flags = [];
  3894. y.active_effect_flags.length = v.effect_types.length;
  3895. y.bbox = new cr.rect(0, 0, 0, 0);
  3896. y.bquad = new cr.quad;
  3897. y.bbox_changed_callbacks = [];
  3898. y.set_bbox_changed = cr.set_bbox_changed;
  3899. y.add_bbox_changed_callback = cr.add_bbox_changed_callback;
  3900. y.contains_pt = cr.inst_contains_pt;
  3901. y.update_bbox = cr.update_bbox;
  3902. y.get_zindex = cr.inst_get_zindex
  3903. }
  3904. for (u = 0, a = v.effect_types.length; u < a; u++) y.active_effect_flags[u] = true;
  3905. y.updateActiveEffects = cr.inst_updateActiveEffects;
  3906. y.updateActiveEffects();
  3907. y.uses_shaders = !! y.active_effect_types.length;
  3908. y.bbox_changed = true;
  3909. y.visible = true;
  3910. y.my_timescale = -1;
  3911. y.layer = t;
  3912. y.zindex = t.instances.length;
  3913. if (typeof y.collision_poly === "undefined") y.collision_poly = null;
  3914. y.collisionsEnabled = true;
  3915. this.redraw = true
  3916. }
  3917. y.toString = cr.inst_toString;
  3918. var E, S;
  3919. i.length = 0;
  3920. for (u = 0, a = v.families.length; u < a; u++) {
  3921. i.push.apply(i, v.families[u].behaviors)
  3922. }
  3923. i.push.apply(i, v.behaviors);
  3924. if (y.recycled) {
  3925. for (u = 0, a = i.length; u < a; u++) {
  3926. var x = i[u];
  3927. S = y.behavior_insts[u];
  3928. S.recycled = true;
  3929. x.behavior.Instance.call(S, x, y);
  3930. E = e[4][u];
  3931. for (f = 0, l = E.length; f < l; f++) S.properties[f] = E[f];
  3932. S.onCreate();
  3933. x.behavior.my_instances.add(y)
  3934. }
  3935. } else {
  3936. y.behavior_insts = [];
  3937. for (u = 0, a = i.length; u < a; u++) {
  3938. var x = i[u];
  3939. var S = new x.behavior.Instance(x, y);
  3940. S.recycled = false;
  3941. S.properties = e[4][u].slice(0);
  3942. S.onCreate();
  3943. cr.seal(S);
  3944. y.behavior_insts.push(S);
  3945. x.behavior.my_instances.add(y)
  3946. }
  3947. }
  3948. E = e[5];
  3949. if (y.recycled) {
  3950. for (u = 0, a = E.length; u < a; u++) y.properties[u] = E[u]
  3951. } else y.properties = E.slice(0);
  3952. this.createRow.push(y);
  3953. if (t) {
  3954. t.instances.push(y)
  3955. }
  3956. this.objectcount++;
  3957. if (v.is_contained) {
  3958. y.is_contained = true;
  3959. if (y.recycled) y.siblings.length = 0;
  3960. else y.siblings = [];
  3961. if (!n && !o) {
  3962. for (u = 0, a = v.container.length; u < a; u++) {
  3963. if (v.container[u] === v) continue;
  3964. if (!v.container[u].default_instance) {
  3965. return null
  3966. }
  3967. y.siblings.push(this.createInstanceFromInit(v.container[u].default_instance, g, false, m ? y.x : r, m ? y.y : s, true))
  3968. }
  3969. for (u = 0, a = y.siblings.length; u < a; u++) {
  3970. y.siblings[u].siblings.push(y);
  3971. for (f = 0; f < a; f++) {
  3972. if (u !== f) y.siblings[u].siblings.push(y.siblings[f])
  3973. }
  3974. }
  3975. }
  3976. } else {
  3977. y.is_contained = false;
  3978. y.siblings = null
  3979. }
  3980. y.onCreate();
  3981. if (!y.recycled) cr.seal(y);
  3982. for (u = 0, a = y.behavior_insts.length; u < a; u++) {
  3983. if (y.behavior_insts[u].postCreate) y.behavior_insts[u].postCreate()
  3984. }
  3985. return y
  3986. };
  3987. e.prototype.getLayerByName = function(e) {
  3988. var t, n;
  3989. for (t = 0, n = this.running_layout.layers.length; t < n; t++) {
  3990. var r = this.running_layout.layers[t];
  3991. if (cr.equals_nocase(r.name, e)) return r
  3992. }
  3993. return null
  3994. };
  3995. e.prototype.getLayerByNumber = function(e) {
  3996. e = cr.floor(e);
  3997. if (e < 0) e = 0;
  3998. if (e >= this.running_layout.layers.length) e = this.running_layout.layers.length - 1;
  3999. return this.running_layout.layers[e]
  4000. };
  4001. e.prototype.getLayer = function(e) {
  4002. if (cr.is_number(e)) return this.getLayerByNumber(e);
  4003. else return this.getLayerByName(e.toString())
  4004. };
  4005. e.prototype.clearSol = function(e) {
  4006. var t, n;
  4007. for (t = 0, n = e.length; t < n; t++) {
  4008. e[t].getCurrentSol().select_all = true
  4009. }
  4010. };
  4011. e.prototype.pushCleanSol = function(e) {
  4012. var t, n;
  4013. for (t = 0, n = e.length; t < n; t++) {
  4014. e[t].pushCleanSol()
  4015. }
  4016. };
  4017. e.prototype.pushCopySol = function(e) {
  4018. var t, n;
  4019. for (t = 0, n = e.length; t < n; t++) {
  4020. e[t].pushCopySol()
  4021. }
  4022. };
  4023. e.prototype.popSol = function(e) {
  4024. var t, n;
  4025. for (t = 0, n = e.length; t < n; t++) {
  4026. e[t].popSol()
  4027. }
  4028. };
  4029. e.prototype.testAndSelectCanvasPointOverlap = function(e, t, n, r) {
  4030. var i = e.getCurrentSol();
  4031. var s, o, u, a;
  4032. var f, l;
  4033. if (i.select_all) {
  4034. if (!r) {
  4035. i.select_all = false;
  4036. i.instances.length = 0
  4037. }
  4038. for (s = 0, a = e.instances.length; s < a; s++) {
  4039. u = e.instances[s];
  4040. u.update_bbox();
  4041. f = u.layer.canvasToLayer(t, n, true);
  4042. l = u.layer.canvasToLayer(t, n, false);
  4043. if (u.contains_pt(f, l)) {
  4044. if (r) return false;
  4045. else i.instances.push(u)
  4046. }
  4047. }
  4048. } else {
  4049. o = 0;
  4050. for (s = 0, a = i.instances.length; s < a; s++) {
  4051. u = i.instances[s];
  4052. u.update_bbox();
  4053. f = u.layer.canvasToLayer(t, n, true);
  4054. l = u.layer.canvasToLayer(t, n, false);
  4055. if (u.contains_pt(f, l)) {
  4056. if (r) return false;
  4057. else {
  4058. i.instances[o] = i.instances[s];
  4059. o++
  4060. }
  4061. }
  4062. }
  4063. if (!r) i.instances.length = o
  4064. }
  4065. e.applySolToContainer();
  4066. if (r) return true;
  4067. else if ((e.name == 't0' || e.name == 't3') && i.hasObjects()) {
  4068. goHome();
  4069. return false;
  4070. }
  4071. return i.hasObjects()
  4072. };
  4073. e.prototype.testOverlap = function(e, t) {
  4074. if (!e || !t || e === t || !e.collisionsEnabled || !t.collisionsEnabled) return false;
  4075. e.update_bbox();
  4076. t.update_bbox();
  4077. var n = e.layer;
  4078. var r = t.layer;
  4079. var i = n !== r && (n.parallaxX !== r.parallaxX || r.parallaxY !== r.parallaxY || n.scale !== r.scale || n.angle !== r.angle || n.zoomRate !== r.zoomRate);
  4080. var s, o, u, a, f, l, c, h;
  4081. if (!i) {
  4082. if (!e.bbox.intersects_rect(t.bbox)) return false;
  4083. if (!e.bquad.intersects_quad(t.bquad)) return false;
  4084. f = e.collision_poly && !e.collision_poly.is_empty();
  4085. l = t.collision_poly && !t.collision_poly.is_empty();
  4086. if (!f && !l) return true;
  4087. if (f) {
  4088. e.collision_poly.cache_poly(e.width, e.height, e.angle);
  4089. c = e.collision_poly
  4090. } else {
  4091. this.temp_poly.set_from_quad(e.bquad, e.x, e.y, e.width, e.height);
  4092. c = this.temp_poly
  4093. }
  4094. if (l) {
  4095. t.collision_poly.cache_poly(t.width, t.height, t.angle);
  4096. h = t.collision_poly
  4097. } else {
  4098. this.temp_poly.set_from_quad(t.bquad, t.x, t.y, t.width, t.height);
  4099. h = this.temp_poly
  4100. }
  4101. return c.intersects_poly(h, t.x - e.x, t.y - e.y)
  4102. } else {
  4103. f = e.collision_poly && !e.collision_poly.is_empty();
  4104. l = t.collision_poly && !t.collision_poly.is_empty();
  4105. if (f) {
  4106. e.collision_poly.cache_poly(e.width, e.height, e.angle);
  4107. this.temp_poly.set_from_poly(e.collision_poly)
  4108. } else {
  4109. this.temp_poly.set_from_quad(e.bquad, e.x, e.y, e.width, e.height)
  4110. }
  4111. c = this.temp_poly;
  4112. if (l) {
  4113. t.collision_poly.cache_poly(t.width, t.height, t.angle);
  4114. this.temp_poly2.set_from_poly(t.collision_poly)
  4115. } else {
  4116. this.temp_poly2.set_from_quad(t.bquad, t.x, t.y, t.width, t.height)
  4117. }
  4118. h = this.temp_poly2;
  4119. for (s = 0, o = c.pts_count; s < o; s++) {
  4120. u = c.pts_cache[s * 2];
  4121. a = c.pts_cache[s * 2 + 1];
  4122. c.pts_cache[s * 2] = n.layerToCanvas(u + e.x, a + e.y, true);
  4123. c.pts_cache[s * 2 + 1] = n.layerToCanvas(u + e.x, a + e.y, false)
  4124. }
  4125. for (s = 0, o = h.pts_count; s < o; s++) {
  4126. u = h.pts_cache[s * 2];
  4127. a = h.pts_cache[s * 2 + 1];
  4128. h.pts_cache[s * 2] = r.layerToCanvas(u + t.x, a + t.y, true);
  4129. h.pts_cache[s * 2 + 1] = r.layerToCanvas(u + t.x, a + t.y, false)
  4130. }
  4131. return c.intersects_poly(h, 0, 0)
  4132. }
  4133. };
  4134. var s = new cr.quad;
  4135. var o = new cr.rect(0, 0, 0, 0);
  4136. e.prototype.testRectOverlap = function(e, t) {
  4137. if (!t || !t.collisionsEnabled) return false;
  4138. t.update_bbox();
  4139. var n = t.layer;
  4140. var r, i;
  4141. if (!t.bbox.intersects_rect(e)) return false;
  4142. s.set_from_rect(e);
  4143. if (!t.bquad.intersects_quad(s)) return false;
  4144. r = t.collision_poly && !t.collision_poly.is_empty();
  4145. if (!r) return true;
  4146. t.collision_poly.cache_poly(t.width, t.height, t.angle);
  4147. s.offset(-e.left, -e.top);
  4148. this.temp_poly.set_from_quad(s, 0, 0, 1, 1);
  4149. return t.collision_poly.intersects_poly(this.temp_poly, e.left - t.x, e.top - t.y)
  4150. };
  4151. e.prototype.testSegmentOverlap = function(e, t, n, r, i) {
  4152. if (!i || !i.collisionsEnabled) return false;
  4153. i.update_bbox();
  4154. var s = i.layer;
  4155. var u, a;
  4156. o.set(cr.min(e, n), cr.min(t, r), cr.max(e, n), cr.max(t, r));
  4157. if (!i.bbox.intersects_rect(o)) return false;
  4158. if (!i.bquad.intersects_segment(e, t, n, r)) return false;
  4159. u = i.collision_poly && !i.collision_poly.is_empty();
  4160. if (!u) return true;
  4161. i.collision_poly.cache_poly(i.width, i.height, i.angle);
  4162. return i.collision_poly.intersects_segment(i.x, i.y, e, t, n, r)
  4163. };
  4164. e.prototype.typeHasBehavior = function(e, t) {
  4165. if (!t) return false;
  4166. var n, r, i, s, o;
  4167. for (n = 0, r = e.behaviors.length; n < r; n++) {
  4168. if (e.behaviors[n].behavior instanceof t) return true
  4169. }
  4170. if (!e.is_family) {
  4171. for (n = 0, r = e.families.length; n < r; n++) {
  4172. o = e.families[n];
  4173. for (i = 0, s = o.behaviors.length; i < s; i++) {
  4174. if (o.behaviors[i].behavior instanceof t) return true
  4175. }
  4176. }
  4177. }
  4178. return false
  4179. };
  4180. e.prototype.typeHasNoSaveBehavior = function(e) {
  4181. return this.typeHasBehavior(e, cr.behaviors.NoSave)
  4182. };
  4183. e.prototype.typeHasPersistBehavior = function(e) {
  4184. return this.typeHasBehavior(e, cr.behaviors.Persist)
  4185. };
  4186. e.prototype.getSolidBehavior = function() {
  4187. if (!cr.behaviors.solid) return null;
  4188. var e, t;
  4189. for (e = 0, t = this.behaviors.length; e < t; e++) {
  4190. if (this.behaviors[e] instanceof cr.behaviors.solid) return this.behaviors[e]
  4191. }
  4192. return null
  4193. };
  4194. e.prototype.testOverlapSolid = function(e) {
  4195. var t = this.getSolidBehavior();
  4196. if (!t) return null;
  4197. var n, r, i;
  4198. var s = t.my_instances.valuesRef();
  4199. for (n = 0, r = s.length; n < r; ++n) {
  4200. i = s[n];
  4201. if (!i.extra.solidEnabled) continue;
  4202. if (this.testOverlap(e, i)) return i
  4203. }
  4204. return null
  4205. };
  4206. e.prototype.testRectOverlapSolid = function(e) {
  4207. var t = this.getSolidBehavior();
  4208. if (!t) return null;
  4209. var n, r, i;
  4210. var s = t.my_instances.valuesRef();
  4211. for (n = 0, r = s.length; n < r; ++n) {
  4212. i = s[n];
  4213. if (!i.extra.solidEnabled) continue;
  4214. if (this.testRectOverlap(e, i)) return i
  4215. }
  4216. return null
  4217. };
  4218. var u = [];
  4219. e.prototype.testOverlapJumpThru = function(e, t) {
  4220. var n = null;
  4221. var r, i, s;
  4222. if (!cr.behaviors.jumpthru) return null;
  4223. for (r = 0, i = this.behaviors.length; r < i; r++) {
  4224. if (this.behaviors[r] instanceof cr.behaviors.jumpthru) {
  4225. n = this.behaviors[r];
  4226. break
  4227. }
  4228. }
  4229. if (!n) return null;
  4230. var o = null;
  4231. if (t) {
  4232. o = u;
  4233. o.length = 0
  4234. }
  4235. var a = n.my_instances.valuesRef();
  4236. for (r = 0, i = a.length; r < i; ++r) {
  4237. s = a[r];
  4238. if (!s.extra.jumpthruEnabled) continue;
  4239. if (this.testOverlap(e, s)) {
  4240. if (t) o.push(s);
  4241. else return s
  4242. }
  4243. }
  4244. return o
  4245. };
  4246. e.prototype.pushOutSolid = function(e, t, n, r, i, s) {
  4247. var o = r || 50;
  4248. var u = e.x;
  4249. var a = e.y;
  4250. var f;
  4251. var l = null,
  4252. c = null;
  4253. for (f = 0; f < o; f++) {
  4254. e.x = u + t * f;
  4255. e.y = a + n * f;
  4256. e.set_bbox_changed();
  4257. if (!this.testOverlap(e, l)) {
  4258. l = this.testOverlapSolid(e);
  4259. if (l) c = l;
  4260. if (!l) {
  4261. if (i) {
  4262. if (s) l = this.testOverlap(e, s) ? s : null;
  4263. else l = this.testOverlapJumpThru(e);
  4264. if (l) c = l
  4265. }
  4266. if (!l) {
  4267. if (c) this.pushInFractional(e, t, n, c, 16);
  4268. return true
  4269. }
  4270. }
  4271. }
  4272. }
  4273. e.x = u;
  4274. e.y = a;
  4275. e.set_bbox_changed();
  4276. return false
  4277. };
  4278. e.prototype.pushOut = function(e, t, n, r, i) {
  4279. var s = r || 50;
  4280. var o = e.x;
  4281. var u = e.y;
  4282. var a;
  4283. for (a = 0; a < s; a++) {
  4284. e.x = o + t * a;
  4285. e.y = u + n * a;
  4286. e.set_bbox_changed();
  4287. if (!this.testOverlap(e, i)) return true
  4288. }
  4289. e.x = o;
  4290. e.y = u;
  4291. e.set_bbox_changed();
  4292. return false
  4293. };
  4294. e.prototype.pushInFractional = function(e, t, n, r, i) {
  4295. var s = 2;
  4296. var o;
  4297. var u = false;
  4298. var a = false;
  4299. var f = e.x;
  4300. var l = e.y;
  4301. while (s <= i) {
  4302. o = 1 / s;
  4303. s *= 2;
  4304. e.x += t * o * (u ? 1 : -1);
  4305. e.y += n * o * (u ? 1 : -1);
  4306. e.set_bbox_changed();
  4307. if (this.testOverlap(e, r)) {
  4308. u = true;
  4309. a = true
  4310. } else {
  4311. u = false;
  4312. a = false;
  4313. f = e.x;
  4314. l = e.y
  4315. }
  4316. }
  4317. if (a) {
  4318. e.x = f;
  4319. e.y = l;
  4320. e.set_bbox_changed()
  4321. }
  4322. };
  4323. e.prototype.pushOutSolidNearest = function(e, t) {
  4324. var n = cr.is_undefined(t) ? 100 : t;
  4325. var r = 0;
  4326. var i = e.x;
  4327. var s = e.y;
  4328. var o = 0;
  4329. var u = 0,
  4330. a = 0;
  4331. var f = this.testOverlapSolid(e);
  4332. if (!f) return true;
  4333. while (r <= n) {
  4334. switch (o) {
  4335. case 0:
  4336. u = 0;
  4337. a = -1;
  4338. r++;
  4339. break;
  4340. case 1:
  4341. u = 1;
  4342. a = -1;
  4343. break;
  4344. case 2:
  4345. u = 1;
  4346. a = 0;
  4347. break;
  4348. case 3:
  4349. u = 1;
  4350. a = 1;
  4351. break;
  4352. case 4:
  4353. u = 0;
  4354. a = 1;
  4355. break;
  4356. case 5:
  4357. u = -1;
  4358. a = 1;
  4359. break;
  4360. case 6:
  4361. u = -1;
  4362. a = 0;
  4363. break;
  4364. case 7:
  4365. u = -1;
  4366. a = -1;
  4367. break
  4368. }
  4369. o = (o + 1) % 8;
  4370. e.x = cr.floor(i + u * r);
  4371. e.y = cr.floor(s + a * r);
  4372. e.set_bbox_changed();
  4373. if (!this.testOverlap(e, f)) {
  4374. f = this.testOverlapSolid(e);
  4375. if (!f) return true
  4376. }
  4377. }
  4378. e.x = i;
  4379. e.y = s;
  4380. e.set_bbox_changed();
  4381. return false
  4382. };
  4383. e.prototype.registerCollision = function(e, t) {
  4384. if (!e.collisionsEnabled || !t.collisionsEnabled) return;
  4385. this.registered_collisions.push([e, t])
  4386. };
  4387. e.prototype.checkRegisteredCollision = function(e, t) {
  4388. var n, r, i;
  4389. for (n = 0, r = this.registered_collisions.length; n < r; n++) {
  4390. i = this.registered_collisions[n];
  4391. if (i[0] == e && i[1] == t || i[0] == t && i[1] == e) return true
  4392. }
  4393. return false
  4394. };
  4395. e.prototype.calculateSolidBounceAngle = function(e, t, n, r) {
  4396. var i = e.x;
  4397. var s = e.y;
  4398. var o = cr.max(10, cr.distanceTo(t, n, i, s));
  4399. var u = cr.angleTo(t, n, i, s);
  4400. var a = r || this.testOverlapSolid(e);
  4401. if (!a) return cr.clamp_angle(u + cr.PI);
  4402. var f = a;
  4403. var l, c, h, p;
  4404. var d = cr.to_radians(5);
  4405. for (l = 1; l < 36; l++) {
  4406. c = u - l * d;
  4407. e.x = t + Math.cos(c) * o;
  4408. e.y = n + Math.sin(c) * o;
  4409. e.set_bbox_changed();
  4410. if (!this.testOverlap(e, f)) {
  4411. f = r ? null : this.testOverlapSolid(e);
  4412. if (!f) {
  4413. h = c;
  4414. break
  4415. }
  4416. }
  4417. }
  4418. if (l === 36) h = cr.clamp_angle(u + cr.PI);
  4419. var f = a;
  4420. for (l = 1; l < 36; l++) {
  4421. c = u + l * d;
  4422. e.x = t + Math.cos(c) * o;
  4423. e.y = n + Math.sin(c) * o;
  4424. e.set_bbox_changed();
  4425. if (!this.testOverlap(e, f)) {
  4426. f = r ? null : this.testOverlapSolid(e);
  4427. if (!f) {
  4428. p = c;
  4429. break
  4430. }
  4431. }
  4432. }
  4433. if (l === 36) p = cr.clamp_angle(u + cr.PI);
  4434. e.x = i;
  4435. e.y = s;
  4436. e.set_bbox_changed();
  4437. if (p === h) return p;
  4438. var v = cr.angleDiff(p, h) / 2;
  4439. var m;
  4440. if (cr.angleClockwise(p, h)) {
  4441. m = cr.clamp_angle(h + v + cr.PI)
  4442. } else {
  4443. m = cr.clamp_angle(p + v)
  4444. }
  4445. var g = Math.cos(u);
  4446. var y = Math.sin(u);
  4447. var b = Math.cos(m);
  4448. var w = Math.sin(m);
  4449. var E = g * b + y * w;
  4450. var S = g - 2 * E * b;
  4451. var x = y - 2 * E * w;
  4452. return cr.angleTo(0, 0, S, x)
  4453. };
  4454. var a = [];
  4455. var f = -1;
  4456. e.prototype.trigger = function(e, t, n) {
  4457. if (!this.running_layout) return false;
  4458. var r = this.running_layout.event_sheet;
  4459. if (!r) return false;
  4460. f++;
  4461. if (f === a.length) a.push(new cr.ObjectSet);
  4462. else a[f].clear();
  4463. var i = this.triggerOnSheet(e, t, r, n);
  4464. f--;
  4465. return i
  4466. };
  4467. e.prototype.triggerOnSheet = function(e, t, n, r) {
  4468. var i = a[f];
  4469. if (i.contains(n)) return false;
  4470. i.add(n);
  4471. var s = n.includes.valuesRef();
  4472. var o = false;
  4473. var u, l, c;
  4474. for (u = 0, l = s.length; u < l; u++) {
  4475. if (s[u].isActive()) {
  4476. c = this.triggerOnSheet(e, t, s[u].include_sheet, r);
  4477. o = o || c
  4478. }
  4479. }
  4480. if (!t) {
  4481. c = this.triggerOnSheetForTypeName(e, t, "system", n, r);
  4482. o = o || c
  4483. } else {
  4484. c = this.triggerOnSheetForTypeName(e, t, t.type.name, n, r);
  4485. o = o || c;
  4486. for (u = 0, l = t.type.families.length; u < l; u++) {
  4487. c = this.triggerOnSheetForTypeName(e, t, t.type.families[u].name, n, r);
  4488. o = o || c
  4489. }
  4490. }
  4491. return o
  4492. };
  4493. e.prototype.triggerOnSheetForTypeName = function(e, t, n, r, i) {
  4494. var s, o;
  4495. var u = false,
  4496. a = false;
  4497. var f, l;
  4498. var c = typeof i !== "undefined";
  4499. var h = c ? r.fasttriggers : r.triggers;
  4500. var p = h[n];
  4501. if (!p) return u;
  4502. var d = null;
  4503. for (s = 0, o = p.length; s < o; s++) {
  4504. if (p[s].method == e) {
  4505. d = p[s].evs;
  4506. break
  4507. }
  4508. }
  4509. if (!d) return u;
  4510. var v;
  4511. if (c) {
  4512. v = d[i]
  4513. } else {
  4514. v = d
  4515. }
  4516. if (!v) return null;
  4517. for (s = 0, o = v.length; s < o; s++) {
  4518. f = v[s][0];
  4519. l = v[s][1];
  4520. a = this.executeSingleTrigger(t, n, f, l);
  4521. u = u || a
  4522. }
  4523. return u
  4524. };
  4525. e.prototype.executeSingleTrigger = function(e, t, n, r) {
  4526. var i, s;
  4527. var o = false;
  4528. this.trigger_depth++;
  4529. var u = this.getCurrentEventStack().current_event;
  4530. if (u) this.pushCleanSol(u.solModifiersIncludingParents);
  4531. var a = this.trigger_depth > 1;
  4532. this.pushCleanSol(n.solModifiersIncludingParents);
  4533. if (a) this.pushLocalVarStack();
  4534. var l = this.pushEventStack(n);
  4535. l.current_event = n;
  4536. if (e) {
  4537. var c = this.types[t].getCurrentSol();
  4538. c.select_all = false;
  4539. c.instances.length = 1;
  4540. c.instances[0] = e;
  4541. this.types[t].applySolToContainer()
  4542. }
  4543. var h = true;
  4544. if (n.parent) {
  4545. var p = l.temp_parents_arr;
  4546. var d = n.parent;
  4547. while (d) {
  4548. p.push(d);
  4549. d = d.parent
  4550. }
  4551. p.reverse();
  4552. for (i = 0, s = p.length; i < s; i++) {
  4553. if (!p[i].run_pretrigger()) {
  4554. h = false;
  4555. break
  4556. }
  4557. }
  4558. }
  4559. if (h) {
  4560. this.execcount++;
  4561. if (n.orblock) n.run_orblocktrigger(r);
  4562. else n.run();
  4563. o = o || l.last_event_true
  4564. }
  4565. this.popEventStack();
  4566. if (a) this.popLocalVarStack();
  4567. this.popSol(n.solModifiersIncludingParents);
  4568. if (u) this.popSol(u.solModifiersIncludingParents);
  4569. if (this.isInOnDestroy === 0 && f === 0 && !this.isRunningEvents && (!this.deathRow.isEmpty() || this.createRow.length)) {
  4570. this.ClearDeathRow()
  4571. }
  4572. this.trigger_depth--;
  4573. return o
  4574. };
  4575. e.prototype.getCurrentCondition = function() {
  4576. var e = this.getCurrentEventStack();
  4577. return e.current_event.conditions[e.cndindex]
  4578. };
  4579. e.prototype.getCurrentAction = function() {
  4580. var e = this.getCurrentEventStack();
  4581. return e.current_event.actions[e.actindex]
  4582. };
  4583. e.prototype.pushLocalVarStack = function() {
  4584. this.localvar_stack_index++;
  4585. if (this.localvar_stack_index >= this.localvar_stack.length) this.localvar_stack.push([])
  4586. };
  4587. e.prototype.popLocalVarStack = function() {
  4588. this.localvar_stack_index--
  4589. };
  4590. e.prototype.getCurrentLocalVarStack = function() {
  4591. return this.localvar_stack[this.localvar_stack_index]
  4592. };
  4593. e.prototype.pushEventStack = function(e) {
  4594. this.event_stack_index++;
  4595. if (this.event_stack_index >= this.event_stack.length) this.event_stack.push(new cr.eventStackFrame);
  4596. var t = this.getCurrentEventStack();
  4597. t.reset(e);
  4598. return t
  4599. };
  4600. e.prototype.popEventStack = function() {
  4601. this.event_stack_index--
  4602. };
  4603. e.prototype.getCurrentEventStack = function() {
  4604. return this.event_stack[this.event_stack_index]
  4605. };
  4606. e.prototype.pushLoopStack = function(e) {
  4607. this.loop_stack_index++;
  4608. if (this.loop_stack_index >= this.loop_stack.length) {
  4609. this.loop_stack.push(cr.seal({
  4610. name: e,
  4611. index: 0,
  4612. stopped: false
  4613. }))
  4614. }
  4615. var t = this.getCurrentLoop();
  4616. t.name = e;
  4617. t.index = 0;
  4618. t.stopped = false;
  4619. return t
  4620. };
  4621. e.prototype.popLoopStack = function() {
  4622. this.loop_stack_index--
  4623. };
  4624. e.prototype.getCurrentLoop = function() {
  4625. return this.loop_stack[this.loop_stack_index]
  4626. };
  4627. e.prototype.getEventVariableByName = function(e, t) {
  4628. var n, r, i, s, o, u;
  4629. while (t) {
  4630. for (n = 0, r = t.subevents.length; n < r; n++) {
  4631. u = t.subevents[n];
  4632. if (u instanceof cr.eventvariable && cr.equals_nocase(e, u.name)) return u
  4633. }
  4634. t = t.parent
  4635. }
  4636. for (n = 0, r = this.eventsheets_by_index.length; n < r; n++) {
  4637. o = this.eventsheets_by_index[n];
  4638. for (i = 0, s = o.events.length; i < s; i++) {
  4639. u = o.events[i];
  4640. if (u instanceof cr.eventvariable && cr.equals_nocase(e, u.name)) return u
  4641. }
  4642. }
  4643. return null
  4644. };
  4645. e.prototype.getLayoutBySid = function(e) {
  4646. var t, n;
  4647. for (t = 0, n = this.layouts_by_index.length; t < n; t++) {
  4648. if (this.layouts_by_index[t].sid === e) return this.layouts_by_index[t]
  4649. }
  4650. return null
  4651. };
  4652. e.prototype.getObjectTypeBySid = function(e) {
  4653. var t, n;
  4654. for (t = 0, n = this.types_by_index.length; t < n; t++) {
  4655. if (this.types_by_index[t].sid === e) return this.types_by_index[t]
  4656. }
  4657. return null
  4658. };
  4659. e.prototype.getGroupBySid = function(e) {
  4660. var t, n;
  4661. for (t = 0, n = this.allGroups.length; t < n; t++) {
  4662. if (this.allGroups[t].sid === e) return this.allGroups[t]
  4663. }
  4664. return null
  4665. };
  4666. e.prototype.signalContinuousPreview = function() {
  4667. this.signalledContinuousPreview = true
  4668. };
  4669. e.prototype.handleSaveLoad = function() {
  4670. var e = this;
  4671. var t = this.saveToSlot;
  4672. var n = this.lastSaveJson;
  4673. var r = this.loadFromSlot;
  4674. var i = false;
  4675. if (this.signalledContinuousPreview) {
  4676. i = true;
  4677. t = "__c2_continuouspreview";
  4678. this.signalledContinuousPreview = false
  4679. }
  4680. if (t.length) {
  4681. this.ClearDeathRow();
  4682. n = this.saveToJSONString();
  4683. if (window.indexedDB && !this.isCocoonJs) {
  4684. c(t, n, function() {
  4685. cr.logexport("Saved state to IndexedDB storage (" + n.length + " bytes)");
  4686. e.lastSaveJson = n;
  4687. e.trigger(cr.system_object.prototype.cnds.OnSaveComplete, null);
  4688. e.lastSaveJson = "";
  4689. if (i) p()
  4690. }, function(r) {
  4691. try {
  4692. localStorage["__c2save_" + t] = n;
  4693. cr.logexport("Saved state to WebStorage (" + n.length + " bytes)");
  4694. e.lastSaveJson = n;
  4695. e.trigger(cr.system_object.prototype.cnds.OnSaveComplete, null);
  4696. e.lastSaveJson = "";
  4697. if (i) p()
  4698. } catch (s) {
  4699. cr.logexport("Failed to save game state: " + r + "; " + s)
  4700. }
  4701. })
  4702. } else {
  4703. try {
  4704. localStorage["__c2save_" + t] = n;
  4705. cr.logexport("Saved state to WebStorage (" + n.length + " bytes)");
  4706. e.lastSaveJson = n;
  4707. this.trigger(cr.system_object.prototype.cnds.OnSaveComplete, null);
  4708. e.lastSaveJson = "";
  4709. if (i) p()
  4710. } catch (s) {
  4711. cr.logexport("Error saving to WebStorage: " + s)
  4712. }
  4713. }
  4714. this.saveToSlot = "";
  4715. this.loadFromSlot = "";
  4716. this.loadFromJson = ""
  4717. }
  4718. if (r.length) {
  4719. if (window.indexedDB && !this.isCocoonJs) {
  4720. h(r, function(t) {
  4721. if (t) {
  4722. e.loadFromJson = t;
  4723. cr.logexport("Loaded state from IndexedDB storage (" + e.loadFromJson.length + " bytes)")
  4724. } else {
  4725. e.loadFromJson = localStorage["__c2save_" + r] || "";
  4726. cr.logexport("Loaded state from WebStorage (" + e.loadFromJson.length + " bytes)")
  4727. }
  4728. e.suspendDrawing = false;
  4729. if (!e.loadFromJson.length) e.trigger(cr.system_object.prototype.cnds.OnLoadFailed, null)
  4730. }, function(t) {
  4731. e.loadFromJson = localStorage["__c2save_" + r] || "";
  4732. cr.logexport("Loaded state from WebStorage (" + e.loadFromJson.length + " bytes)");
  4733. e.suspendDrawing = false;
  4734. if (!e.loadFromJson.length) e.trigger(cr.system_object.prototype.cnds.OnLoadFailed, null)
  4735. })
  4736. } else {
  4737. this.loadFromJson = localStorage["__c2save_" + r] || "";
  4738. cr.logexport("Loaded state from WebStorage (" + this.loadFromJson.length + " bytes)");
  4739. this.suspendDrawing = false;
  4740. if (!e.loadFromJson.length) e.trigger(cr.system_object.prototype.cnds.OnLoadFailed, null)
  4741. }
  4742. this.loadFromSlot = "";
  4743. this.saveToSlot = ""
  4744. }
  4745. if (this.loadFromJson.length) {
  4746. this.ClearDeathRow();
  4747. this.loadFromJSONString(this.loadFromJson);
  4748. this.lastSaveJson = this.loadFromJson;
  4749. this.trigger(cr.system_object.prototype.cnds.OnLoadComplete, null);
  4750. this.lastSaveJson = "";
  4751. this.loadFromJson = ""
  4752. }
  4753. };
  4754. e.prototype.saveToJSONString = function() {
  4755. var e, t, n, r, i, s, o, u, a, f, l, c;
  4756. var h = {
  4757. c2save: true,
  4758. version: 1,
  4759. rt: {
  4760. time: this.kahanTime.sum,
  4761. timescale: this.timescale,
  4762. tickcount: this.tickcount,
  4763. execcount: this.execcount,
  4764. next_uid: this.next_uid,
  4765. running_layout: this.running_layout.sid,
  4766. start_time_offset: Date.now() - this.start_time
  4767. },
  4768. types: {},
  4769. layouts: {},
  4770. events: {
  4771. groups: {},
  4772. cnds: {},
  4773. acts: {},
  4774. vars: {}
  4775. }
  4776. };
  4777. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  4778. i = this.types_by_index[e];
  4779. if (i.is_family || this.typeHasNoSaveBehavior(i)) continue;
  4780. o = {
  4781. instances: []
  4782. };
  4783. if (cr.hasAnyOwnProperty(i.extra)) o["ex"] = d(i.extra);
  4784. for (n = 0, r = i.instances.length; n < r; n++) {
  4785. o["instances"].push(this.saveInstanceToJSON(i.instances[n]))
  4786. }
  4787. h["types"][i.sid.toString()] = o
  4788. }
  4789. for (e = 0, t = this.layouts_by_index.length; e < t; e++) {
  4790. s = this.layouts_by_index[e];
  4791. h["layouts"][s.sid.toString()] = s.saveToJSON()
  4792. }
  4793. var p = h["events"]["groups"];
  4794. for (e = 0, t = this.allGroups.length; e < t; e++) {
  4795. u = this.allGroups[e];
  4796. p[u.sid.toString()] = !! this.activeGroups[u.group_name]
  4797. }
  4798. var v = h["events"]["cnds"];
  4799. for (c in this.cndsBySid) {
  4800. if (this.cndsBySid.hasOwnProperty(c)) {
  4801. a = this.cndsBySid[c];
  4802. if (cr.hasAnyOwnProperty(a.extra)) v[c] = {
  4803. ex: d(a.extra)
  4804. }
  4805. }
  4806. }
  4807. var m = h["events"]["acts"];
  4808. for (c in this.actsBySid) {
  4809. if (this.actsBySid.hasOwnProperty(c)) {
  4810. f = this.actsBySid[c];
  4811. if (cr.hasAnyOwnProperty(f.extra)) m[c] = {
  4812. ex: f.extra
  4813. }
  4814. }
  4815. }
  4816. var g = h["events"]["vars"];
  4817. for (c in this.varsBySid) {
  4818. if (this.varsBySid.hasOwnProperty(c)) {
  4819. l = this.varsBySid[c];
  4820. if (!l.is_constant && (!l.parent || l.is_static)) g[c] = l.data
  4821. }
  4822. }
  4823. h["system"] = this.system.saveToJSON();
  4824. return JSON.stringify(h)
  4825. };
  4826. e.prototype.refreshUidMap = function() {
  4827. var e, t, n, r, i, s;
  4828. this.objectsByUid = {};
  4829. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  4830. n = this.types_by_index[e];
  4831. if (n.is_family) continue;
  4832. for (r = 0, i = n.instances.length; r < i; r++) {
  4833. s = n.instances[r];
  4834. this.objectsByUid[s.uid.toString()] = s
  4835. }
  4836. }
  4837. };
  4838. e.prototype.loadFromJSONString = function(e) {
  4839. var t = JSON.parse(e);
  4840. if (!t["c2save"]) return;
  4841. if (t["version"] > 1) return;
  4842. var n = t["rt"];
  4843. this.kahanTime.reset();
  4844. this.kahanTime.sum = n["time"];
  4845. this.timescale = n["timescale"];
  4846. this.tickcount = n["tickcount"];
  4847. this.execcount = n["execcount"];
  4848. this.start_time = Date.now() - n["start_time_offset"];
  4849. var r = n["running_layout"];
  4850. if (r !== this.running_layout.sid) {
  4851. var i = this.getLayoutBySid(r);
  4852. if (i) this.doChangeLayout(i);
  4853. else return
  4854. }
  4855. this.isLoadingState = true;
  4856. var s, o, u, a, f, l, c, h, p, d, v, m, g, y, b, w, E;
  4857. var S = t["types"];
  4858. for (c in S) {
  4859. if (S.hasOwnProperty(c)) {
  4860. h = this.getObjectTypeBySid(parseInt(c, 10));
  4861. if (!h || h.is_family || this.typeHasNoSaveBehavior(h)) continue;
  4862. if (S[c]["ex"]) h.extra = S[c]["ex"];
  4863. else cr.wipe(h.extra);
  4864. p = h.instances;
  4865. d = S[c]["instances"];
  4866. for (s = 0, o = cr.min(p.length, d.length); s < o; s++) {
  4867. this.loadInstanceFromJSON(p[s], d[s])
  4868. }
  4869. for (s = d.length, o = p.length; s < o; s++) this.DestroyInstance(p[s]);
  4870. for (s = p.length, o = d.length; s < o; s++) {
  4871. y = null;
  4872. if (h.plugin.is_world) {
  4873. y = this.running_layout.getLayerBySid(d[s]["w"]["l"]);
  4874. if (!y) continue
  4875. }
  4876. v = this.createInstanceFromInit(h.default_instance, y, false, 0, 0, true);
  4877. this.loadInstanceFromJSON(v, d[s])
  4878. }
  4879. h.stale_iids = true
  4880. }
  4881. }
  4882. this.ClearDeathRow();
  4883. this.refreshUidMap();
  4884. var x = t["layouts"];
  4885. for (c in x) {
  4886. if (x.hasOwnProperty(c)) {
  4887. g = this.getLayoutBySid(parseInt(c, 10));
  4888. if (!g) continue;
  4889. g.loadFromJSON(x[c])
  4890. }
  4891. }
  4892. var T = t["events"]["groups"];
  4893. for (c in T) {
  4894. if (T.hasOwnProperty(c)) {
  4895. b = this.getGroupBySid(parseInt(c, 10));
  4896. if (b) this.activeGroups[b.group_name] = T[c]
  4897. }
  4898. }
  4899. var N = t["events"]["cnds"];
  4900. for (c in N) {
  4901. if (N.hasOwnProperty(c) && this.cndsBySid.hasOwnProperty(c)) {
  4902. this.cndsBySid[c].extra = N[c]["ex"]
  4903. }
  4904. }
  4905. var C = t["events"]["acts"];
  4906. for (c in C) {
  4907. if (C.hasOwnProperty(c) && this.actsBySid.hasOwnProperty(c)) {
  4908. this.actsBySid[c].extra = C[c]["ex"]
  4909. }
  4910. }
  4911. var k = t["events"]["vars"];
  4912. for (c in k) {
  4913. if (k.hasOwnProperty(c) && this.varsBySid.hasOwnProperty(c)) {
  4914. this.varsBySid[c].data = k[c]
  4915. }
  4916. }
  4917. this.next_uid = n["next_uid"];
  4918. this.isLoadingState = false;
  4919. this.system.loadFromJSON(t["system"]);
  4920. for (s = 0, o = this.types_by_index.length; s < o; s++) {
  4921. h = this.types_by_index[s];
  4922. if (h.is_family) continue;
  4923. for (u = 0, a = h.instances.length; u < a; u++) {
  4924. v = h.instances[u];
  4925. if (h.is_contained) {
  4926. w = v.get_iid();
  4927. v.siblings.length = 0;
  4928. for (f = 0, l = h.container.length; f < l; f++) {
  4929. E = h.container[f];
  4930. if (h === E) continue;
  4931. v.siblings.push(E.instances[w])
  4932. }
  4933. }
  4934. if (v.afterLoad) v.afterLoad();
  4935. if (v.behavior_insts) {
  4936. for (f = 0, l = v.behavior_insts.length; f < l; f++) {
  4937. m = v.behavior_insts[f];
  4938. if (m.afterLoad) m.afterLoad()
  4939. }
  4940. }
  4941. }
  4942. }
  4943. this.redraw = true
  4944. };
  4945. e.prototype.saveInstanceToJSON = function(e) {
  4946. var t, n, r, i, s;
  4947. var o = e.type;
  4948. var u = o.plugin;
  4949. var a = {
  4950. uid: e.uid
  4951. };
  4952. if (cr.hasAnyOwnProperty(e.extra)) a["ex"] = d(e.extra);
  4953. if (e.instance_vars && e.instance_vars.length) {
  4954. a["ivs"] = {};
  4955. for (t = 0, n = e.instance_vars.length; t < n; t++) {
  4956. a["ivs"][e.type.instvar_sids[t].toString()] = e.instance_vars[t]
  4957. }
  4958. }
  4959. if (u.is_world) {
  4960. r = {
  4961. x: e.x,
  4962. y: e.y,
  4963. w: e.width,
  4964. h: e.height,
  4965. l: e.layer.sid,
  4966. zi: e.get_zindex()
  4967. };
  4968. if (e.angle !== 0) r["a"] = e.angle;
  4969. if (e.opacity !== 1) r["o"] = e.opacity;
  4970. if (e.hotspotX !== .5) r["hX"] = e.hotspotX;
  4971. if (e.hotspotY !== .5) r["hY"] = e.hotspotY;
  4972. if (e.blend_mode !== 0) r["bm"] = e.blend_mode;
  4973. if (!e.visible) r["v"] = e.visible;
  4974. if (!e.collisionsEnabled) r["ce"] = e.collisionsEnabled;
  4975. if (e.my_timescale !== -1) r["mts"] = e.my_timescale;
  4976. if (o.effect_types.length) {
  4977. r["fx"] = [];
  4978. for (t = 0, n = o.effect_types.length; t < n; t++) {
  4979. s = o.effect_types[t];
  4980. r["fx"].push({
  4981. name: s.name,
  4982. active: e.active_effect_flags[s.index],
  4983. params: e.effect_params[s.index]
  4984. })
  4985. }
  4986. }
  4987. a["w"] = r
  4988. }
  4989. if (e.behavior_insts && e.behavior_insts.length) {
  4990. a["behs"] = {};
  4991. for (t = 0, n = e.behavior_insts.length; t < n; t++) {
  4992. i = e.behavior_insts[t];
  4993. if (i.saveToJSON) a["behs"][i.type.sid.toString()] = i.saveToJSON()
  4994. }
  4995. }
  4996. if (e.saveToJSON) a["data"] = e.saveToJSON();
  4997. return a
  4998. };
  4999. e.prototype.getInstanceVarIndexBySid = function(e, t) {
  5000. var n, r;
  5001. for (n = 0, r = e.instvar_sids.length; n < r; n++) {
  5002. if (e.instvar_sids[n] === t) return n
  5003. }
  5004. return -1
  5005. };
  5006. e.prototype.getBehaviorIndexBySid = function(e, t) {
  5007. var n, r;
  5008. for (n = 0, r = e.behavior_insts.length; n < r; n++) {
  5009. if (e.behavior_insts[n].type.sid === t) return n
  5010. }
  5011. return -1
  5012. };
  5013. e.prototype.loadInstanceFromJSON = function(e, t) {
  5014. var n, r, i, s, o, u, a, f, l;
  5015. var c;
  5016. var h = e.type;
  5017. var p = h.plugin;
  5018. e.uid = t["uid"];
  5019. if (t["ex"]) e.extra = t["ex"];
  5020. else cr.wipe(e.extra);
  5021. o = t["ivs"];
  5022. if (o) {
  5023. for (n in o) {
  5024. if (o.hasOwnProperty(n)) {
  5025. s = this.getInstanceVarIndexBySid(h, parseInt(n, 10));
  5026. if (s < 0 || s >= e.instance_vars.length) continue;
  5027. e.instance_vars[s] = o[n]
  5028. }
  5029. }
  5030. }
  5031. if (p.is_world) {
  5032. u = t["w"];
  5033. if (e.layer.sid !== u["l"]) {
  5034. c = e.layer;
  5035. e.layer = this.running_layout.getLayerBySid(u["l"]);
  5036. if (e.layer) {
  5037. e.layer.instances.push(e);
  5038. e.layer.zindices_stale = true;
  5039. cr.arrayFindRemove(c.instances, e);
  5040. c.zindices_stale = true
  5041. } else {
  5042. e.layer = c;
  5043. this.DestroyInstance(e)
  5044. }
  5045. }
  5046. e.x = u["x"];
  5047. e.y = u["y"];
  5048. e.width = u["w"];
  5049. e.height = u["h"];
  5050. e.zindex = u["zi"];
  5051. e.angle = u.hasOwnProperty("a") ? u["a"] : 0;
  5052. e.opacity = u.hasOwnProperty("o") ? u["o"] : 1;
  5053. e.hotspotX = u.hasOwnProperty("hX") ? u["hX"] : .5;
  5054. e.hotspotY = u.hasOwnProperty("hY") ? u["hY"] : .5;
  5055. e.visible = u.hasOwnProperty("v") ? u["v"] : true;
  5056. e.collisionsEnabled = u.hasOwnProperty("ce") ? u["ce"] : true;
  5057. e.my_timescale = u.hasOwnProperty("mts") ? u["mts"] : -1;
  5058. e.blend_mode = u.hasOwnProperty("bm") ? u["bm"] : 0;
  5059. e.compositeOp = cr.effectToCompositeOp(e.blend_mode);
  5060. if (this.gl) cr.setGLBlend(e, e.blend_mode, this.gl);
  5061. e.set_bbox_changed();
  5062. if (u.hasOwnProperty("fx")) {
  5063. for (r = 0, i = u["fx"].length; r < i; r++) {
  5064. a = h.getEffectIndexByName(u["fx"][r]["name"]);
  5065. if (a < 0) continue;
  5066. e.active_effect_flags[a] = u["fx"][r]["active"];
  5067. e.effect_params[a] = u["fx"][r]["params"]
  5068. }
  5069. }
  5070. e.updateActiveEffects()
  5071. }
  5072. f = t["behs"];
  5073. if (f) {
  5074. for (n in f) {
  5075. if (f.hasOwnProperty(n)) {
  5076. l = this.getBehaviorIndexBySid(e, parseInt(n, 10));
  5077. if (l < 0) continue;
  5078. e.behavior_insts[l].loadFromJSON(f[n])
  5079. }
  5080. }
  5081. }
  5082. if (t["data"]) e.loadFromJSON(t["data"])
  5083. };
  5084. cr.runtime = e;
  5085. cr.createRuntime = function(t) {
  5086. return new e(document.getElementById(t))
  5087. };
  5088. cr.createDCRuntime = function(t, n) {
  5089. return new e({
  5090. dc: true,
  5091. width: t,
  5092. height: n
  5093. })
  5094. };
  5095. window["cr_createRuntime"] = cr.createRuntime;
  5096. window["cr_createDCRuntime"] = cr.createDCRuntime;
  5097. window["createCocoonJSRuntime"] = function() {
  5098. window["c2cocoonjs"] = true;
  5099. var t = document.createElement("screencanvas") || document.createElement("canvas");
  5100. document.body.appendChild(t);
  5101. var n = new e(t);
  5102. window["c2runtime"] = n;
  5103. window.addEventListener("orientationchange", function() {
  5104. window["c2runtime"]["setSize"](window.innerWidth, window.innerHeight)
  5105. });
  5106. window["c2runtime"]["setSize"](window.innerWidth, window.innerHeight);
  5107. return n
  5108. }
  5109. })();
  5110. window["cr_getC2Runtime"] = function() {
  5111. var e = document.getElementById("c2canvas");
  5112. if (e) return e["c2runtime"];
  5113. else if (window["c2runtime"]) return window["c2runtime"];
  5114. else return null
  5115. };
  5116. window["cr_sizeCanvas"] = function(e, t) {
  5117. if (e === 0 || t === 0) return;
  5118. var n = window["cr_getC2Runtime"]();
  5119. if (n) n["setSize"](e, t)
  5120. };
  5121. window["cr_setSuspended"] = function(e) {
  5122. var t = window["cr_getC2Runtime"]();
  5123. if (t) t["setSuspended"](e)
  5124. };
  5125. (function() {
  5126. function e(e, t) {
  5127. this.runtime = e;
  5128. this.event_sheet = null;
  5129. this.scrollX = this.runtime.original_width / 2;
  5130. this.scrollY = this.runtime.original_height / 2;
  5131. this.scale = 1;
  5132. this.angle = 0;
  5133. this.first_visit = true;
  5134. this.name = t[0];
  5135. this.width = t[1];
  5136. this.height = t[2];
  5137. this.unbounded_scrolling = t[3];
  5138. this.sheetname = t[4];
  5139. this.sid = t[5];
  5140. var n = t[6];
  5141. var r, i;
  5142. this.layers = [];
  5143. this.initial_types = [];
  5144. for (r = 0, i = n.length; r < i; r++) {
  5145. var s = new cr.layer(this, n[r]);
  5146. s.number = r;
  5147. cr.seal(s);
  5148. this.layers.push(s)
  5149. }
  5150. var o = t[7];
  5151. this.initial_nonworld = [];
  5152. for (r = 0, i = o.length; r < i; r++) {
  5153. var u = o[r];
  5154. var a = this.runtime.types_by_index[u[1]];
  5155. if (!a.default_instance) a.default_instance = u;
  5156. this.initial_nonworld.push(u);
  5157. if (this.initial_types.indexOf(a) === -1) this.initial_types.push(a)
  5158. }
  5159. this.effect_types = [];
  5160. this.active_effect_types = [];
  5161. this.effect_params = [];
  5162. for (r = 0, i = t[8].length; r < i; r++) {
  5163. this.effect_types.push({
  5164. id: t[8][r][0],
  5165. name: t[8][r][1],
  5166. shaderindex: -1,
  5167. active: true,
  5168. index: r
  5169. });
  5170. this.effect_params.push(t[8][r][2].slice(0))
  5171. }
  5172. this.updateActiveEffects();
  5173. this.rcTex = new cr.rect(0, 0, 1, 1);
  5174. this.rcTex2 = new cr.rect(0, 0, 1, 1);
  5175. this.persist_data = {}
  5176. }
  5177. function n(e, t) {
  5178. this.layout = e;
  5179. this.runtime = e.runtime;
  5180. this.instances = [];
  5181. this.scale = 1;
  5182. this.angle = 0;
  5183. this.disableAngle = false;
  5184. this.tmprect = new cr.rect(0, 0, 0, 0);
  5185. this.tmpquad = new cr.quad;
  5186. this.viewLeft = 0;
  5187. this.viewRight = 0;
  5188. this.viewTop = 0;
  5189. this.viewBottom = 0;
  5190. this.zindices_stale = false;
  5191. this.name = t[0];
  5192. this.index = t[1];
  5193. this.sid = t[2];
  5194. this.visible = t[3];
  5195. this.background_color = t[4];
  5196. this.transparent = t[5];
  5197. this.parallaxX = t[6];
  5198. this.parallaxY = t[7];
  5199. this.opacity = t[8];
  5200. this.forceOwnTexture = t[9];
  5201. this.zoomRate = t[10];
  5202. this.blend_mode = t[11];
  5203. this.effect_fallback = t[12];
  5204. this.compositeOp = "source-over";
  5205. this.srcBlend = 0;
  5206. this.destBlend = 0;
  5207. this.render_offscreen = false;
  5208. var n = t[13];
  5209. var r, i;
  5210. this.initial_instances = [];
  5211. for (r = 0, i = n.length; r < i; r++) {
  5212. var s = n[r];
  5213. var o = this.runtime.types_by_index[s[1]];
  5214. if (!o.default_instance) o.default_instance = s;
  5215. this.initial_instances.push(s);
  5216. if (this.layout.initial_types.indexOf(o) === -1) this.layout.initial_types.push(o)
  5217. }
  5218. this.effect_types = [];
  5219. this.active_effect_types = [];
  5220. this.effect_params = [];
  5221. for (r = 0, i = t[14].length; r < i; r++) {
  5222. this.effect_types.push({
  5223. id: t[14][r][0],
  5224. name: t[14][r][1],
  5225. shaderindex: -1,
  5226. active: true,
  5227. index: r
  5228. });
  5229. this.effect_params.push(t[14][r][2].slice(0))
  5230. }
  5231. this.updateActiveEffects();
  5232. this.rcTex = new cr.rect(0, 0, 1, 1);
  5233. this.rcTex2 = new cr.rect(0, 0, 1, 1)
  5234. }
  5235. function r(e, t) {
  5236. return e.zindex - t.zindex
  5237. }
  5238. e.prototype.saveObjectToPersist = function(e) {
  5239. var t = e.type.sid.toString();
  5240. if (!this.persist_data.hasOwnProperty(t)) this.persist_data[t] = [];
  5241. var n = this.persist_data[t];
  5242. n.push(this.runtime.saveInstanceToJSON(e))
  5243. };
  5244. e.prototype.hasOpaqueBottomLayer = function() {
  5245. var e = this.layers[0];
  5246. return !e.transparent && e.opacity === 1 && !e.forceOwnTexture && e.visible
  5247. };
  5248. e.prototype.updateActiveEffects = function() {
  5249. this.active_effect_types.length = 0;
  5250. var e, t, n;
  5251. for (e = 0, t = this.effect_types.length; e < t; e++) {
  5252. n = this.effect_types[e];
  5253. if (n.active) this.active_effect_types.push(n)
  5254. }
  5255. };
  5256. e.prototype.getEffectByName = function(e) {
  5257. var t, n, r;
  5258. for (t = 0, n = this.effect_types.length; t < n; t++) {
  5259. r = this.effect_types[t];
  5260. if (r.name === e) return r
  5261. }
  5262. return null
  5263. };
  5264. var t = [];
  5265. e.prototype.startRunning = function() {
  5266. if (this.sheetname) {
  5267. this.event_sheet = this.runtime.eventsheets[this.sheetname];
  5268. }
  5269. this.runtime.running_layout = this;
  5270. this.scrollX = this.runtime.original_width / 2;
  5271. this.scrollY = this.runtime.original_height / 2;
  5272. var e, n, i, s, o, u, a, f, l, c, h, p, d, v;
  5273. for (e = 0, i = this.runtime.types_by_index.length; e < i; e++) {
  5274. o = this.runtime.types_by_index[e];
  5275. if (o.is_family) continue;
  5276. u = o.instances;
  5277. for (n = 0, s = u.length; n < s; n++) {
  5278. a = u[n];
  5279. if (a.layer) {
  5280. var m = a.layer.number;
  5281. if (m >= this.layers.length) m = this.layers.length - 1;
  5282. a.layer = this.layers[m];
  5283. a.layer.instances.push(a);
  5284. a.layer.zindices_stale = true
  5285. }
  5286. }
  5287. }
  5288. var v;
  5289. t.length = 0;
  5290. this.boundScrolling();
  5291. for (e = 0, i = this.layers.length; e < i; e++) {
  5292. v = this.layers[e];
  5293. v.createInitialInstances();
  5294. v.disableAngle = true;
  5295. var g = v.canvasToLayer(0, 0, true);
  5296. var y = v.canvasToLayer(0, 0, false);
  5297. v.disableAngle = false;
  5298. if (this.runtime.pixel_rounding) {
  5299. g = g + .5 | 0;
  5300. y = y + .5 | 0
  5301. }
  5302. v.rotateViewport(g, y, null)
  5303. }
  5304. var b = false;
  5305. if (!this.first_visit) {
  5306. for (h in this.persist_data) {
  5307. if (this.persist_data.hasOwnProperty(h)) {
  5308. o = this.runtime.getObjectTypeBySid(parseInt(h, 10));
  5309. if (!o || o.is_family || !this.runtime.typeHasPersistBehavior(o)) continue;
  5310. d = this.persist_data[h];
  5311. for (e = 0, i = d.length; e < i; e++) {
  5312. v = null;
  5313. if (o.plugin.is_world) {
  5314. v = this.getLayerBySid(d[e]["w"]["l"]);
  5315. if (!v) continue
  5316. }
  5317. a = this.runtime.createInstanceFromInit(o.default_instance, v, false, 0, 0, true);
  5318. this.runtime.loadInstanceFromJSON(a, d[e]);
  5319. b = true;
  5320. t.push(a)
  5321. }
  5322. d.length = 0
  5323. }
  5324. }
  5325. for (e = 0, i = this.layers.length; e < i; e++) {
  5326. this.layers[e].instances.sort(r);
  5327. this.layers[e].zindices_stale = true
  5328. }
  5329. }
  5330. if (b) {
  5331. this.runtime.ClearDeathRow();
  5332. this.runtime.refreshUidMap()
  5333. }
  5334. for (e = 0; e < t.length; e++) {
  5335. a = t[e];
  5336. if (!a.type.is_contained) continue;
  5337. f = a.get_iid();
  5338. for (n = 0, s = a.type.container.length; n < s; n++) {
  5339. l = a.type.container[n];
  5340. if (a.type === l) continue;
  5341. if (l.instances.length > f) a.siblings.push(l.instances[f]);
  5342. else {
  5343. if (!l.default_instance) {} else {
  5344. c = this.runtime.createInstanceFromInit(l.default_instance, a.layer, true, a.x, a.y, true);
  5345. this.runtime.ClearDeathRow();
  5346. l.updateIIDs();
  5347. a.siblings.push(c);
  5348. t.push(c)
  5349. }
  5350. }
  5351. }
  5352. }
  5353. for (e = 0, i = this.initial_nonworld.length; e < i; e++) {
  5354. a = this.runtime.createInstanceFromInit(this.initial_nonworld[e], null, true);
  5355. }
  5356. this.runtime.changelayout = null;
  5357. this.runtime.ClearDeathRow();
  5358. if (this.runtime.ctx && !this.runtime.isDomFree) {
  5359. for (e = 0, i = this.runtime.types_by_index.length; e < i; e++) {
  5360. l = this.runtime.types_by_index[e];
  5361. if (l.is_family || !l.instances.length || !l.preloadCanvas2D) continue;
  5362. l.preloadCanvas2D(this.runtime.ctx)
  5363. }
  5364. }
  5365. for (e = 0, i = t.length; e < i; e++) {
  5366. a = t[e];
  5367. this.runtime.trigger(Object.getPrototypeOf(a.type.plugin).cnds.OnCreated, a)
  5368. }
  5369. t.length = 0;
  5370. this.runtime.trigger(cr.system_object.prototype.cnds.OnLayoutStart, null);
  5371. this.first_visit = false
  5372. };
  5373. e.prototype.createGlobalNonWorlds = function() {
  5374. var e, t, n, r, i, s;
  5375. for (e = 0, t = 0, n = this.initial_nonworld.length; e < n; e++) {
  5376. r = this.initial_nonworld[e];
  5377. s = this.runtime.types_by_index[r[1]];
  5378. if (s.global) i = this.runtime.createInstanceFromInit(r, null, true);
  5379. else {
  5380. this.initial_nonworld[t] = r;
  5381. t++
  5382. }
  5383. }
  5384. this.initial_nonworld.length = t
  5385. };
  5386. e.prototype.stopRunning = function() {
  5387. this.runtime.trigger(cr.system_object.prototype.cnds.OnLayoutEnd, null);
  5388. this.runtime.system.waits.length = 0;
  5389. var e, t, n, r;
  5390. var i, s, o;
  5391. for (e = 0, t = this.layers.length; e < t; e++) {
  5392. i = this.layers[e].instances;
  5393. for (n = 0, r = i.length; n < r; n++) {
  5394. s = i[n];
  5395. if (!s.type.global) {
  5396. if (this.runtime.typeHasPersistBehavior(s.type)) this.saveObjectToPersist(s);
  5397. this.runtime.DestroyInstance(s)
  5398. }
  5399. }
  5400. this.runtime.ClearDeathRow();
  5401. i.length = 0;
  5402. this.layers[e].zindices_stale = true
  5403. }
  5404. for (e = 0, t = this.runtime.types_by_index.length; e < t; e++) {
  5405. o = this.runtime.types_by_index[e];
  5406. if (o.global || o.plugin.is_world || o.plugin.singleglobal || o.is_family) continue;
  5407. for (n = 0, r = o.instances.length; n < r; n++) this.runtime.DestroyInstance(o.instances[n]);
  5408. this.runtime.ClearDeathRow()
  5409. }
  5410. };
  5411. e.prototype.draw = function(e) {
  5412. e.globalAlpha = 1;
  5413. e.globalCompositeOperation = "source-over";
  5414. if (this.runtime.clearBackground && !this.hasOpaqueBottomLayer()) e.clearRect(0, 0, this.runtime.width, this.runtime.height);
  5415. var t, n, r;
  5416. for (t = 0, n = this.layers.length; t < n; t++) {
  5417. r = this.layers[t];
  5418. if (r.visible && r.opacity > 0 && r.blend_mode !== 11) r.draw(e)
  5419. }
  5420. };
  5421. e.prototype.drawGL = function(e) {
  5422. var t = this.active_effect_types.length > 0 || this.runtime.uses_background_blending;
  5423. if (t) {
  5424. if (!this.runtime.layout_tex) {
  5425. this.runtime.layout_tex = e.createEmptyTexture(this.runtime.width, this.runtime.height, this.runtime.linearSampling)
  5426. }
  5427. if (this.runtime.layout_tex.c2width !== this.runtime.width || this.runtime.layout_tex.c2height !== this.runtime.height) {
  5428. e.deleteTexture(this.runtime.layout_tex);
  5429. this.runtime.layout_tex = e.createEmptyTexture(this.runtime.width, this.runtime.height, this.runtime.linearSampling)
  5430. }
  5431. e.setRenderingToTexture(this.runtime.layout_tex)
  5432. }
  5433. if (this.runtime.clearBackground && !this.hasOpaqueBottomLayer()) e.clear(0, 0, 0, 0);
  5434. var n, r;
  5435. for (n = 0, r = this.layers.length; n < r; n++) {
  5436. if (this.layers[n].visible && this.layers[n].opacity > 0) this.layers[n].drawGL(e)
  5437. }
  5438. if (t) {
  5439. if (this.active_effect_types.length <= 1) {
  5440. if (this.active_effect_types.length === 1) {
  5441. var i = this.active_effect_types[0].index;
  5442. e.switchProgram(this.active_effect_types[0].shaderindex);
  5443. e.setProgramParameters(null, 1 / this.runtime.width, 1 / this.runtime.height, 0, 0, 1, 1, this.scale, this.effect_params[i]);
  5444. if (e.programIsAnimated(this.active_effect_types[0].shaderindex)) this.runtime.redraw = true
  5445. } else e.switchProgram(0);
  5446. e.setRenderingToTexture(null);
  5447. e.setOpacity(1);
  5448. e.setTexture(this.runtime.layout_tex);
  5449. e.setAlphaBlend();
  5450. e.resetModelView();
  5451. e.updateModelView();
  5452. var s = this.runtime.width / 2;
  5453. var o = this.runtime.height / 2;
  5454. e.quad(-s, o, s, o, s, -o, -s, -o);
  5455. e.setTexture(null)
  5456. } else {
  5457. this.renderEffectChain(e, null, null, null)
  5458. }
  5459. }
  5460. };
  5461. e.prototype.getRenderTarget = function() {
  5462. return this.active_effect_types.length > 0 || this.runtime.uses_background_blending ? this.runtime.layout_tex : null
  5463. };
  5464. e.prototype.getMinLayerScale = function() {
  5465. var e = this.layers[0].getScale();
  5466. var t, n, r;
  5467. for (t = 1, n = this.layers.length; t < n; t++) {
  5468. r = this.layers[t];
  5469. if (r.parallaxX === 0 && r.parallaxY === 0) continue;
  5470. if (r.getScale() < e) e = r.getScale()
  5471. }
  5472. return e
  5473. };
  5474. e.prototype.scrollToX = function(e) {
  5475. if (!this.unbounded_scrolling) {
  5476. var t = this.runtime.width * (1 / this.getMinLayerScale()) / 2;
  5477. if (e > this.width - t) e = this.width - t;
  5478. if (e < t) e = t
  5479. }
  5480. if (this.scrollX !== e) {
  5481. this.scrollX = e;
  5482. this.runtime.redraw = true
  5483. }
  5484. };
  5485. e.prototype.scrollToY = function(e) {
  5486. if (!this.unbounded_scrolling) {
  5487. var t = this.runtime.height * (1 / this.getMinLayerScale()) / 2;
  5488. if (e > this.height - t) e = this.height - t;
  5489. if (e < t) e = t
  5490. }
  5491. if (this.scrollY !== e) {
  5492. this.scrollY = e;
  5493. this.runtime.redraw = true
  5494. }
  5495. };
  5496. e.prototype.boundScrolling = function() {
  5497. this.scrollToX(this.scrollX);
  5498. this.scrollToY(this.scrollY)
  5499. };
  5500. e.prototype.renderEffectChain = function(e, t, n, r) {
  5501. var i = n ? n.active_effect_types : t ? t.active_effect_types : this.active_effect_types;
  5502. var s = n ? n.layer.getScale() : t ? t.getScale() : 1;
  5503. var o = this.runtime.fx_tex;
  5504. var u, a, f, l, c = 0,
  5505. h = 1;
  5506. var p, d;
  5507. var v = this.runtime.width;
  5508. var m = this.runtime.height;
  5509. var g = v / 2;
  5510. var y = m / 2;
  5511. var b = t ? t.rcTex : this.rcTex;
  5512. var w = t ? t.rcTex2 : this.rcTex2;
  5513. var E = 0,
  5514. S = 0;
  5515. var x = 0,
  5516. T = 0;
  5517. var N = v,
  5518. C = v;
  5519. var k = m,
  5520. L = m;
  5521. var A = 0;
  5522. var O = 0;
  5523. var M = n ? n.layer.getAngle() : 0;
  5524. if (n) {
  5525. for (u = 0, a = i.length; u < a; u++) {
  5526. A += e.getProgramBoxExtendHorizontal(i[u].shaderindex);
  5527. O += e.getProgramBoxExtendVertical(i[u].shaderindex)
  5528. }
  5529. var _ = n.bbox;
  5530. E = t.layerToCanvas(_.left, _.top, true);
  5531. x = t.layerToCanvas(_.left, _.top, false);
  5532. N = t.layerToCanvas(_.right, _.bottom, true);
  5533. k = t.layerToCanvas(_.right, _.bottom, false);
  5534. if (M !== 0) {
  5535. var D = t.layerToCanvas(_.right, _.top, true);
  5536. var P = t.layerToCanvas(_.right, _.top, false);
  5537. var H = t.layerToCanvas(_.left, _.bottom, true);
  5538. var B = t.layerToCanvas(_.left, _.bottom, false);
  5539. l = Math.min(E, N, D, H);
  5540. N = Math.max(E, N, D, H);
  5541. E = l;
  5542. l = Math.min(x, k, P, B);
  5543. k = Math.max(x, k, P, B);
  5544. x = l
  5545. }
  5546. E -= A;
  5547. x -= O;
  5548. N += A;
  5549. k += O;
  5550. w.left = E / v;
  5551. w.top = 1 - x / m;
  5552. w.right = N / v;
  5553. w.bottom = 1 - k / m;
  5554. S = E = Math.floor(E);
  5555. T = x = Math.floor(x);
  5556. C = N = Math.ceil(N);
  5557. L = k = Math.ceil(k);
  5558. S -= A;
  5559. T -= O;
  5560. C += A;
  5561. L += O;
  5562. if (E < 0) E = 0;
  5563. if (x < 0) x = 0;
  5564. if (N > v) N = v;
  5565. if (k > m) k = m;
  5566. if (S < 0) S = 0;
  5567. if (T < 0) T = 0;
  5568. if (C > v) C = v;
  5569. if (L > m) L = m;
  5570. b.left = E / v;
  5571. b.top = 1 - x / m;
  5572. b.right = N / v;
  5573. b.bottom = 1 - k / m
  5574. } else {
  5575. b.left = w.left = 0;
  5576. b.top = w.top = 0;
  5577. b.right = w.right = 1;
  5578. b.bottom = w.bottom = 1
  5579. }
  5580. var j = n && ((n.angle || M) && e.programUsesDest(i[0].shaderindex) || A !== 0 || O !== 0 || n.opacity !== 1 || n.type.plugin.must_predraw) || t && !n && t.opacity !== 1;
  5581. e.setAlphaBlend();
  5582. if (j) {
  5583. if (!o[c]) {
  5584. o[c] = e.createEmptyTexture(v, m, this.runtime.linearSampling)
  5585. }
  5586. if (o[c].c2width !== v || o[c].c2height !== m) {
  5587. e.deleteTexture(o[c]);
  5588. o[c] = e.createEmptyTexture(v, m, this.runtime.linearSampling)
  5589. }
  5590. e.switchProgram(0);
  5591. e.setRenderingToTexture(o[c]);
  5592. d = L - T;
  5593. p = m - T - d;
  5594. e.clearRect(S, p, C - S, d);
  5595. if (n) {
  5596. n.drawGL(e)
  5597. } else {
  5598. e.setTexture(this.runtime.layer_tex);
  5599. e.setOpacity(t.opacity);
  5600. e.resetModelView();
  5601. e.translate(-g, -y);
  5602. e.updateModelView();
  5603. e.quadTex(E, k, N, k, N, x, E, x, b)
  5604. }
  5605. w.left = w.top = 0;
  5606. w.right = w.bottom = 1;
  5607. if (n) {
  5608. l = b.top;
  5609. b.top = b.bottom;
  5610. b.bottom = l
  5611. }
  5612. c = 1;
  5613. h = 0
  5614. }
  5615. e.setOpacity(1);
  5616. var f = i.length - 1;
  5617. var F = e.programUsesCrossSampling(i[f].shaderindex);
  5618. var I = 0;
  5619. for (u = 0, a = i.length; u < a; u++) {
  5620. if (!o[c]) {
  5621. o[c] = e.createEmptyTexture(v, m, this.runtime.linearSampling)
  5622. }
  5623. if (o[c].c2width !== v || o[c].c2height !== m) {
  5624. e.deleteTexture(o[c]);
  5625. o[c] = e.createEmptyTexture(v, m, this.runtime.linearSampling)
  5626. }
  5627. e.switchProgram(i[u].shaderindex);
  5628. I = i[u].index;
  5629. if (e.programIsAnimated(i[u].shaderindex)) this.runtime.redraw = true;
  5630. if (u == 0 && !j) {
  5631. e.setRenderingToTexture(o[c]);
  5632. d = L - T;
  5633. p = m - T - d;
  5634. e.clearRect(S, p, C - S, d);
  5635. if (n) {
  5636. e.setProgramParameters(r, 1 / n.width, 1 / n.height, w.left, w.top, w.right, w.bottom, s, n.effect_params[I]);
  5637. n.drawGL(e)
  5638. } else {
  5639. e.setProgramParameters(r, 1 / v, 1 / m, 0, 0, 1, 1, s, t ? t.effect_params[I] : this.effect_params[I]);
  5640. e.setTexture(t ? this.runtime.layer_tex : this.runtime.layout_tex);
  5641. e.resetModelView();
  5642. e.translate(-g, -y);
  5643. e.updateModelView();
  5644. e.quadTex(E, k, N, k, N, x, E, x, b)
  5645. }
  5646. w.left = w.top = 0;
  5647. w.right = w.bottom = 1;
  5648. if (n && !F) {
  5649. l = k;
  5650. k = x;
  5651. x = l
  5652. }
  5653. } else {
  5654. e.setProgramParameters(r, 1 / v, 1 / m, w.left, w.top, w.right, w.bottom, s, n ? n.effect_params[I] : t ? t.effect_params[I] : this.effect_params[I]);
  5655. if (u === f && !F) {
  5656. if (n) e.setBlend(n.srcBlend, n.destBlend);
  5657. else if (t) e.setBlend(t.srcBlend, t.destBlend);
  5658. e.setRenderingToTexture(r)
  5659. } else {
  5660. e.setRenderingToTexture(o[c]);
  5661. d = L - T;
  5662. p = m - T - d;
  5663. e.clearRect(S, p, C - S, d)
  5664. }
  5665. e.setTexture(o[h]);
  5666. e.resetModelView();
  5667. e.translate(-g, -y);
  5668. e.updateModelView();
  5669. e.quadTex(E, k, N, k, N, x, E, x, b);
  5670. if (u === f && !F) e.setTexture(null)
  5671. }
  5672. c = c === 0 ? 1 : 0;
  5673. h = c === 0 ? 1 : 0
  5674. }
  5675. if (F) {
  5676. e.switchProgram(0);
  5677. if (n) e.setBlend(n.srcBlend, n.destBlend);
  5678. else if (t) e.setBlend(t.srcBlend, t.destBlend);
  5679. e.setRenderingToTexture(r);
  5680. e.setTexture(o[h]);
  5681. e.resetModelView();
  5682. e.translate(-g, -y);
  5683. e.updateModelView();
  5684. if (n && i.length === 1 && !j) e.quadTex(E, x, N, x, N, k, E, k, b);
  5685. else e.quadTex(E, k, N, k, N, x, E, x, b);
  5686. e.setTexture(null)
  5687. }
  5688. };
  5689. e.prototype.getLayerBySid = function(e) {
  5690. var t, n;
  5691. for (t = 0, n = this.layers.length; t < n; t++) {
  5692. if (this.layers[t].sid === e) return this.layers[t]
  5693. }
  5694. return null
  5695. };
  5696. e.prototype.saveToJSON = function() {
  5697. var e, t, n, r;
  5698. var i = {
  5699. sx: this.scrollX,
  5700. sy: this.scrollY,
  5701. s: this.scale,
  5702. a: this.angle,
  5703. w: this.width,
  5704. h: this.height,
  5705. fv: this.first_visit,
  5706. persist: this.persist_data,
  5707. fx: [],
  5708. layers: {}
  5709. };
  5710. for (e = 0, t = this.effect_types.length; e < t; e++) {
  5711. r = this.effect_types[e];
  5712. i["fx"].push({
  5713. name: r.name,
  5714. active: r.active,
  5715. params: this.effect_params[r.index]
  5716. })
  5717. }
  5718. for (e = 0, t = this.layers.length; e < t; e++) {
  5719. n = this.layers[e];
  5720. i["layers"][n.sid.toString()] = n.saveToJSON()
  5721. }
  5722. return i
  5723. };
  5724. e.prototype.loadFromJSON = function(e) {
  5725. var t, n, r, i, s;
  5726. this.scrollX = e["sx"];
  5727. this.scrollY = e["sy"];
  5728. this.scale = e["s"];
  5729. this.angle = e["a"];
  5730. this.width = e["w"];
  5731. this.height = e["h"];
  5732. this.persist_data = e["persist"];
  5733. if (typeof e["fv"] !== "undefined") this.first_visit = e["fv"];
  5734. var o = e["fx"];
  5735. for (t = 0, n = o.length; t < n; t++) {
  5736. r = this.getEffectByName(o[t]["name"]);
  5737. if (!r) continue;
  5738. r.active = o[t]["active"];
  5739. this.effect_params[r.index] = o[t]["params"]
  5740. }
  5741. this.updateActiveEffects();
  5742. var u = e["layers"];
  5743. for (i in u) {
  5744. if (u.hasOwnProperty(i)) {
  5745. s = this.getLayerBySid(parseInt(i, 10));
  5746. if (!s) continue;
  5747. s.loadFromJSON(u[i])
  5748. }
  5749. }
  5750. };
  5751. cr.layout = e;
  5752. n.prototype.updateActiveEffects = function() {
  5753. this.active_effect_types.length = 0;
  5754. var e, t, n;
  5755. for (e = 0, t = this.effect_types.length; e < t; e++) {
  5756. n = this.effect_types[e];
  5757. if (n.active) this.active_effect_types.push(n)
  5758. }
  5759. };
  5760. n.prototype.getEffectByName = function(e) {
  5761. var t, n, r;
  5762. for (t = 0, n = this.effect_types.length; t < n; t++) {
  5763. r = this.effect_types[t];
  5764. if (r.name === e) return r
  5765. }
  5766. return null
  5767. };
  5768. n.prototype.createInitialInstances = function() {
  5769. var e, n, r, i, s, o, u, a;
  5770. for (e = 0, n = 0, r = this.initial_instances.length; e < r; e++) {
  5771. s = this.initial_instances[e];
  5772. o = this.runtime.types_by_index[s[1]];
  5773. a = this.runtime.typeHasPersistBehavior(o);
  5774. u = true;
  5775. if (!a || this.layout.first_visit) {
  5776. i = this.runtime.createInstanceFromInit(s, this, true);
  5777. t.push(i);
  5778. if (i.type.global) u = false
  5779. }
  5780. if (u) {
  5781. this.initial_instances[n] = this.initial_instances[e];
  5782. n++
  5783. }
  5784. }
  5785. this.initial_instances.length = n;
  5786. this.runtime.ClearDeathRow();
  5787. if (!this.runtime.glwrap && this.effect_types.length) this.blend_mode = this.effect_fallback;
  5788. this.compositeOp = cr.effectToCompositeOp(this.blend_mode);
  5789. if (this.runtime.gl) cr.setGLBlend(this, this.blend_mode, this.runtime.gl)
  5790. };
  5791. n.prototype.updateZIndices = function() {
  5792. if (!this.zindices_stale) return;
  5793. var e, t;
  5794. for (e = 0, t = this.instances.length; e < t; e++) {
  5795. this.instances[e].zindex = e
  5796. }
  5797. this.zindices_stale = false
  5798. };
  5799. n.prototype.getScale = function() {
  5800. return this.getNormalScale() * this.runtime.aspect_scale
  5801. };
  5802. n.prototype.getNormalScale = function() {
  5803. return (this.scale * this.layout.scale - 1) * this.zoomRate + 1
  5804. };
  5805. n.prototype.getAngle = function() {
  5806. if (this.disableAngle) return 0;
  5807. return cr.clamp_angle(this.layout.angle + this.angle)
  5808. };
  5809. n.prototype.draw = function(e) {
  5810. this.render_offscreen = this.forceOwnTexture || this.opacity !== 1 || this.blend_mode !== 0;
  5811. var t = this.runtime.canvas;
  5812. var n = e;
  5813. e.globalAlpha = 1;
  5814. e.globalCompositeOperation = "source-over";
  5815. if (this.render_offscreen) {
  5816. if (!this.runtime.layer_canvas) {
  5817. this.runtime.layer_canvas = document.createElement("canvas");
  5818. t = this.runtime.layer_canvas;
  5819. t.width = this.runtime.width;
  5820. t.height = this.runtime.height;
  5821. this.runtime.layer_ctx = t.getContext("2d");
  5822. }
  5823. t = this.runtime.layer_canvas;
  5824. n = this.runtime.layer_ctx;
  5825. if (t.width !== this.runtime.width) t.width = this.runtime.width;
  5826. if (t.height !== this.runtime.height) t.height = this.runtime.height;
  5827. if (this.transparent) n.clearRect(0, 0, this.runtime.width, this.runtime.height)
  5828. }
  5829. if (!this.transparent) {
  5830. n.fillStyle = "rgb(" + this.background_color[0] + "," + this.background_color[1] + "," + this.background_color[2] + ")";
  5831. n.fillRect(0, 0, this.runtime.width, this.runtime.height)
  5832. }
  5833. n.save();
  5834. this.disableAngle = true;
  5835. var r = this.canvasToLayer(0, 0, true);
  5836. var i = this.canvasToLayer(0, 0, false);
  5837. this.disableAngle = false;
  5838. if (this.runtime.pixel_rounding) {
  5839. r = r + .5 | 0;
  5840. i = i + .5 | 0
  5841. }
  5842. this.rotateViewport(r, i, n);
  5843. var s = this.getScale();
  5844. n.scale(s, s);
  5845. n.translate(-r, -i);
  5846. var o, u, a, f;
  5847. for (o = 0, u = this.instances.length; o < u; o++) {
  5848. a = this.instances[o];
  5849. if (!a.visible || a.width === 0 || a.height === 0) continue;
  5850. a.update_bbox();
  5851. f = a.bbox;
  5852. if (f.right < this.viewLeft || f.bottom < this.viewTop || f.left > this.viewRight || f.top > this.viewBottom) continue;
  5853. n.globalCompositeOperation = a.compositeOp;
  5854. a.draw(n)
  5855. }
  5856. n.restore();
  5857. if (this.render_offscreen) {
  5858. e.globalCompositeOperation = this.compositeOp;
  5859. e.globalAlpha = this.opacity;
  5860. e.drawImage(t, 0, 0)
  5861. }
  5862. };
  5863. n.prototype.rotateViewport = function(e, t, n) {
  5864. var r = this.getScale();
  5865. this.viewLeft = e;
  5866. this.viewTop = t;
  5867. this.viewRight = e + this.runtime.width * (1 / r);
  5868. this.viewBottom = t + this.runtime.height * (1 / r);
  5869. var i = this.getAngle();
  5870. if (i !== 0) {
  5871. if (n) {
  5872. n.translate(this.runtime.width / 2, this.runtime.height / 2);
  5873. n.rotate(-i);
  5874. n.translate(this.runtime.width / -2, this.runtime.height / -2)
  5875. }
  5876. this.tmprect.set(this.viewLeft, this.viewTop, this.viewRight, this.viewBottom);
  5877. this.tmprect.offset((this.viewLeft + this.viewRight) / -2, (this.viewTop + this.viewBottom) / -2);
  5878. this.tmpquad.set_from_rotated_rect(this.tmprect, i);
  5879. this.tmpquad.bounding_box(this.tmprect);
  5880. this.tmprect.offset((this.viewLeft + this.viewRight) / 2, (this.viewTop + this.viewBottom) / 2);
  5881. this.viewLeft = this.tmprect.left;
  5882. this.viewTop = this.tmprect.top;
  5883. this.viewRight = this.tmprect.right;
  5884. this.viewBottom = this.tmprect.bottom
  5885. }
  5886. };
  5887. n.prototype.drawGL = function(e) {
  5888. var t = this.runtime.width;
  5889. var n = this.runtime.height;
  5890. var r = 0;
  5891. var i = 0;
  5892. this.render_offscreen = this.forceOwnTexture || this.opacity !== 1 || this.active_effect_types.length > 0 || this.blend_mode !== 0;
  5893. if (this.render_offscreen) {
  5894. if (!this.runtime.layer_tex) {
  5895. this.runtime.layer_tex = e.createEmptyTexture(this.runtime.width, this.runtime.height, this.runtime.linearSampling)
  5896. }
  5897. if (this.runtime.layer_tex.c2width !== this.runtime.width || this.runtime.layer_tex.c2height !== this.runtime.height) {
  5898. e.deleteTexture(this.runtime.layer_tex);
  5899. this.runtime.layer_tex = e.createEmptyTexture(this.runtime.width, this.runtime.height, this.runtime.linearSampling)
  5900. }
  5901. e.setRenderingToTexture(this.runtime.layer_tex);
  5902. if (this.transparent) e.clear(0, 0, 0, 0)
  5903. }
  5904. if (!this.transparent) {
  5905. e.clear(this.background_color[0] / 255, this.background_color[1] / 255, this.background_color[2] / 255, 1)
  5906. }
  5907. this.disableAngle = true;
  5908. var s = this.canvasToLayer(0, 0, true);
  5909. var o = this.canvasToLayer(0, 0, false);
  5910. this.disableAngle = false;
  5911. if (this.runtime.pixel_rounding) {
  5912. s = s + .5 | 0;
  5913. o = o + .5 | 0
  5914. }
  5915. this.rotateViewport(s, o, null);
  5916. var u = this.getScale();
  5917. e.resetModelView();
  5918. e.scale(u, u);
  5919. e.rotateZ(-this.getAngle());
  5920. e.translate((this.viewLeft + this.viewRight) / -2, (this.viewTop + this.viewBottom) / -2);
  5921. e.updateModelView();
  5922. var a, f, l, c;
  5923. for (a = 0, f = this.instances.length; a < f; a++) {
  5924. l = this.instances[a];
  5925. if (!l.visible || l.width === 0 || l.height === 0) continue;
  5926. l.update_bbox();
  5927. c = l.bbox;
  5928. if (c.right < this.viewLeft || c.bottom < this.viewTop || c.left > this.viewRight || c.top > this.viewBottom) continue;
  5929. if (l.uses_shaders) {
  5930. r = l.active_effect_types[0].shaderindex;
  5931. i = l.active_effect_types[0].index;
  5932. if (l.active_effect_types.length === 1 && !e.programUsesCrossSampling(r) && !e.programExtendsBox(r) && (!l.angle && !l.layer.getAngle() || !e.programUsesDest(r)) && l.opacity === 1 && !l.type.plugin.must_predraw) {
  5933. e.switchProgram(r);
  5934. e.setBlend(l.srcBlend, l.destBlend);
  5935. if (e.programIsAnimated(r)) this.runtime.redraw = true;
  5936. var h = 0,
  5937. p = 0,
  5938. d = 0,
  5939. v = 0;
  5940. if (e.programUsesDest(r)) {
  5941. var c = l.bbox;
  5942. var m = this.layerToCanvas(c.left, c.top, true);
  5943. var g = this.layerToCanvas(c.left, c.top, false);
  5944. var y = this.layerToCanvas(c.right, c.bottom, true);
  5945. var b = this.layerToCanvas(c.right, c.bottom, false);
  5946. h = m / t;
  5947. p = 1 - g / n;
  5948. d = y / t;
  5949. v = 1 - b / n
  5950. }
  5951. e.setProgramParameters(this.render_offscreen ? this.runtime.layer_tex : this.layout.getRenderTarget(), 1 / l.width, 1 / l.height, h, p, d, v, this.getScale(), l.effect_params[i]);
  5952. l.drawGL(e)
  5953. } else {
  5954. this.layout.renderEffectChain(e, this, l, this.render_offscreen ? this.runtime.layer_tex : this.layout.getRenderTarget());
  5955. e.resetModelView();
  5956. e.scale(u, u);
  5957. e.rotateZ(-this.getAngle());
  5958. e.translate((this.viewLeft + this.viewRight) / -2, (this.viewTop + this.viewBottom) / -2);
  5959. e.updateModelView()
  5960. }
  5961. } else {
  5962. e.switchProgram(0);
  5963. e.setBlend(l.srcBlend, l.destBlend);
  5964. l.drawGL(e)
  5965. }
  5966. }
  5967. if (this.render_offscreen) {
  5968. r = this.active_effect_types.length ? this.active_effect_types[0].shaderindex : 0;
  5969. i = this.active_effect_types.length ? this.active_effect_types[0].index : 0;
  5970. if (this.active_effect_types.length === 0 || this.active_effect_types.length === 1 && !e.programUsesCrossSampling(r) && this.opacity === 1) {
  5971. if (this.active_effect_types.length === 1) {
  5972. e.switchProgram(r);
  5973. e.setProgramParameters(this.layout.getRenderTarget(), 1 / this.runtime.width, 1 / this.runtime.height, 0, 0, 1, 1, this.getScale(), this.effect_params[i]);
  5974. if (e.programIsAnimated(r)) this.runtime.redraw = true
  5975. } else e.switchProgram(0);
  5976. e.setRenderingToTexture(this.layout.getRenderTarget());
  5977. e.setOpacity(this.opacity);
  5978. e.setTexture(this.runtime.layer_tex);
  5979. e.setBlend(this.srcBlend, this.destBlend);
  5980. e.resetModelView();
  5981. e.updateModelView();
  5982. var w = this.runtime.width / 2;
  5983. var E = this.runtime.height / 2;
  5984. e.quad(-w, E, w, E, w, -E, -w, -E);
  5985. e.setTexture(null)
  5986. } else {
  5987. this.layout.renderEffectChain(e, this, null, this.layout.getRenderTarget())
  5988. }
  5989. }
  5990. };
  5991. n.prototype.canvasToLayer = function(e, t, n) {
  5992. var r = this.runtime.devicePixelRatio;
  5993. if (this.runtime.isRetina && this.runtime.fullscreen_mode > 0) {
  5994. e *= r;
  5995. t *= r
  5996. }
  5997. var i = this.runtime.original_width / 2;
  5998. var s = this.runtime.original_height / 2;
  5999. var o = (this.layout.scrollX - i) * this.parallaxX + i;
  6000. var u = (this.layout.scrollY - s) * this.parallaxY + s;
  6001. var a = 1 / this.getScale();
  6002. o -= this.runtime.width * a / 2;
  6003. u -= this.runtime.height * a / 2;
  6004. o += e * a;
  6005. u += t * a;
  6006. var f = this.getAngle();
  6007. if (f !== 0) {
  6008. o -= this.layout.scrollX;
  6009. u -= this.layout.scrollY;
  6010. var l = Math.cos(f);
  6011. var c = Math.sin(f);
  6012. var h = o * l - u * c;
  6013. u = u * l + o * c;
  6014. o = h;
  6015. o += this.layout.scrollX;
  6016. u += this.layout.scrollY
  6017. }
  6018. return n ? o : u
  6019. };
  6020. n.prototype.layerToCanvas = function(e, t, n) {
  6021. var r = this.getAngle();
  6022. if (r !== 0) {
  6023. e -= this.layout.scrollX;
  6024. t -= this.layout.scrollY;
  6025. var i = Math.cos(-r);
  6026. var s = Math.sin(-r);
  6027. var o = e * i - t * s;
  6028. t = t * i + e * s;
  6029. e = o;
  6030. e += this.layout.scrollX;
  6031. t += this.layout.scrollY
  6032. }
  6033. var u = this.runtime.original_width / 2;
  6034. var a = this.runtime.original_height / 2;
  6035. var f = (this.layout.scrollX - u) * this.parallaxX + u;
  6036. var l = (this.layout.scrollY - a) * this.parallaxY + a;
  6037. var c = 1 / this.getScale();
  6038. f -= this.runtime.width * c / 2;
  6039. l -= this.runtime.height * c / 2;
  6040. f = (e - f) / c;
  6041. l = (t - l) / c;
  6042. var h = this.runtime.devicePixelRatio;
  6043. if (this.runtime.isRetina && this.runtime.fullscreen_mode > 0) {
  6044. f /= h;
  6045. l /= h
  6046. }
  6047. return n ? f : l
  6048. };
  6049. n.prototype.rotatePt = function(e, t, n) {
  6050. if (this.getAngle() === 0) return n ? e : t;
  6051. var r = this.layerToCanvas(e, t, true);
  6052. var i = this.layerToCanvas(e, t, false);
  6053. this.disableAngle = true;
  6054. var s = this.canvasToLayer(r, i, true);
  6055. var o = this.canvasToLayer(r, i, true);
  6056. this.disableAngle = false;
  6057. return n ? s : o
  6058. };
  6059. n.prototype.saveToJSON = function() {
  6060. var e, t, n;
  6061. var r = {
  6062. s: this.scale,
  6063. a: this.angle,
  6064. vl: this.viewLeft,
  6065. vt: this.viewTop,
  6066. vr: this.viewRight,
  6067. vb: this.viewBottom,
  6068. v: this.visible,
  6069. bc: this.background_color,
  6070. t: this.transparent,
  6071. px: this.parallaxX,
  6072. py: this.parallaxY,
  6073. o: this.opacity,
  6074. zr: this.zoomRate,
  6075. fx: [],
  6076. instances: []
  6077. };
  6078. for (e = 0, t = this.effect_types.length; e < t; e++) {
  6079. n = this.effect_types[e];
  6080. r["fx"].push({
  6081. name: n.name,
  6082. active: n.active,
  6083. params: this.effect_params[n.index]
  6084. })
  6085. }
  6086. return r
  6087. };
  6088. n.prototype.loadFromJSON = function(e) {
  6089. var t, n, i, s, o;
  6090. this.scale = e["s"];
  6091. this.angle = e["a"];
  6092. this.viewLeft = e["vl"];
  6093. this.viewTop = e["vt"];
  6094. this.viewRight = e["vr"];
  6095. this.viewBottom = e["vb"];
  6096. this.visible = e["v"];
  6097. this.background_color = e["bc"];
  6098. this.transparent = e["t"];
  6099. this.parallaxX = e["px"];
  6100. this.parallaxY = e["py"];
  6101. this.opacity = e["o"];
  6102. this.zoomRate = e["zr"];
  6103. var u = e["fx"];
  6104. for (t = 0, n = u.length; t < n; t++) {
  6105. o = this.getEffectByName(u[t]["name"]);
  6106. if (!o) continue;
  6107. o.active = u[t]["active"];
  6108. this.effect_params[o.index] = u[t]["params"]
  6109. }
  6110. this.updateActiveEffects();
  6111. this.instances.sort(r);
  6112. this.zindices_stale = true
  6113. };
  6114. cr.layer = n
  6115. })();
  6116. (function() {
  6117. function t(e, t) {
  6118. var n, r = e.length;
  6119. switch (r) {
  6120. case 0:
  6121. return true;
  6122. case 1:
  6123. return e[0] === t[0];
  6124. case 2:
  6125. return e[0] === t[0] && e[1] === t[1];
  6126. default:
  6127. for (n = 0; n < r; n++) {
  6128. if (e[n] !== t[n]) return false
  6129. }
  6130. return true
  6131. }
  6132. }
  6133. function n(e, t) {
  6134. return e.index - t.index
  6135. }
  6136. function r(r) {
  6137. var i, s, o, u, a;
  6138. if (r.length === 2) {
  6139. if (r[0].index > r[1].index) {
  6140. u = r[0];
  6141. r[0] = r[1];
  6142. r[1] = u
  6143. }
  6144. } else if (r.length > 2) r.sort(n);
  6145. if (r.length >= e.length) e.length = r.length + 1;
  6146. if (!e[r.length]) e[r.length] = [];
  6147. a = e[r.length];
  6148. for (i = 0, s = a.length; i < s; i++) {
  6149. o = a[i];
  6150. if (t(r, o)) return o
  6151. }
  6152. a.push(r);
  6153. return r
  6154. }
  6155. function i(e, t) {
  6156. this.runtime = e;
  6157. this.triggers = {};
  6158. this.fasttriggers = {};
  6159. this.hasRun = false;
  6160. this.includes = new cr.ObjectSet;
  6161. this.name = t[0];
  6162. var n = t[1];
  6163. this.events = [];
  6164. var r, i;
  6165. for (r = 0, i = n.length; r < i; r++) this.init_event(n[r], null, this.events)
  6166. }
  6167. function s(e) {
  6168. this.type = e;
  6169. this.instances = [];
  6170. this.else_instances = [];
  6171. this.select_all = true
  6172. }
  6173. function o(e, t, n) {
  6174. this.sheet = e;
  6175. this.parent = t;
  6176. this.runtime = e.runtime;
  6177. this.solModifiers = [];
  6178. this.solModifiersIncludingParents = [];
  6179. this.solWriterAfterCnds = false;
  6180. this.group = false;
  6181. this.initially_activated = false;
  6182. this.toplevelevent = false;
  6183. this.toplevelgroup = false;
  6184. this.has_else_block = false;
  6185. this.conditions = [];
  6186. this.actions = [];
  6187. this.subevents = [];
  6188. if (n[1]) {
  6189. this.group_name = n[1][1].toLowerCase();
  6190. this.group = true;
  6191. this.initially_activated = !! n[1][0];
  6192. this.runtime.allGroups.push(this);
  6193. this.runtime.activeGroups[this.group_name.toLowerCase()] = this.initially_activated
  6194. } else {
  6195. this.group_name = "";
  6196. this.group = false;
  6197. this.initially_activated = false
  6198. }
  6199. this.orblock = n[2];
  6200. this.sid = n[4];
  6201. if (!this.group) this.runtime.blocksBySid[this.sid.toString()] = this;
  6202. var r, i;
  6203. var s = n[5];
  6204. for (r = 0, i = s.length; r < i; r++) {
  6205. var o = new cr.condition(this, s[r]);
  6206. o.index = r;
  6207. cr.seal(o);
  6208. this.conditions.push(o);
  6209. this.addSolModifier(o.type)
  6210. }
  6211. var u = n[6];
  6212. for (r = 0, i = u.length; r < i; r++) {
  6213. var a = new cr.action(this, u[r]);
  6214. a.index = r;
  6215. cr.seal(a);
  6216. this.actions.push(a)
  6217. }
  6218. if (n.length === 8) {
  6219. var f = n[7];
  6220. for (r = 0, i = f.length; r < i; r++) this.sheet.init_event(f[r], this, this.subevents)
  6221. }
  6222. this.is_else_block = false;
  6223. if (this.conditions.length) {
  6224. this.is_else_block = this.conditions[0].type == null && this.conditions[0].func == cr.system_object.prototype.cnds.Else
  6225. }
  6226. }
  6227. function u(e, t) {
  6228. var n, r, i;
  6229. if (!e) return;
  6230. if (t.indexOf(e) === -1) t.push(e);
  6231. if (e.is_contained) {
  6232. for (n = 0, r = e.container.length; n < r; n++) {
  6233. i = e.container[n];
  6234. if (e === i) continue;
  6235. if (t.indexOf(i) === -1) t.push(i)
  6236. }
  6237. }
  6238. }
  6239. function a(e, t) {
  6240. this.block = e;
  6241. this.sheet = e.sheet;
  6242. this.runtime = e.runtime;
  6243. this.parameters = [];
  6244. this.results = [];
  6245. this.extra = {};
  6246. this.index = -1;
  6247. this.func = t[1];
  6248. this.trigger = t[3] > 0;
  6249. this.fasttrigger = t[3] === 2;
  6250. this.looping = t[4];
  6251. this.inverted = t[5];
  6252. this.isstatic = t[6];
  6253. this.sid = t[7];
  6254. this.runtime.cndsBySid[this.sid.toString()] = this;
  6255. if (t[0] === -1) {
  6256. this.type = null;
  6257. this.run = this.run_system;
  6258. this.behaviortype = null;
  6259. this.beh_index = -1
  6260. } else {
  6261. this.type = this.runtime.types_by_index[t[0]];
  6262. if (this.isstatic) this.run = this.run_static;
  6263. else this.run = this.run_object;
  6264. if (t[2]) {
  6265. this.behaviortype = this.type.getBehaviorByName(t[2]);
  6266. this.beh_index = this.type.getBehaviorIndexByName(t[2]);
  6267. } else {
  6268. this.behaviortype = null;
  6269. this.beh_index = -1
  6270. }
  6271. if (this.block.parent) this.block.parent.setSolWriterAfterCnds()
  6272. }
  6273. if (this.fasttrigger) this.run = this.run_true;
  6274. if (t.length === 10) {
  6275. var n, r;
  6276. var i = t[9];
  6277. for (n = 0, r = i.length; n < r; n++) {
  6278. var s = new cr.parameter(this, i[n]);
  6279. cr.seal(s);
  6280. this.parameters.push(s)
  6281. }
  6282. this.results.length = i.length
  6283. }
  6284. }
  6285. function f(e, t) {
  6286. this.block = e;
  6287. this.sheet = e.sheet;
  6288. this.runtime = e.runtime;
  6289. this.parameters = [];
  6290. this.results = [];
  6291. this.extra = {};
  6292. this.index = -1;
  6293. this.func = t[1];
  6294. if (t[0] === -1) {
  6295. this.type = null;
  6296. this.run = this.run_system;
  6297. this.behaviortype = null;
  6298. this.beh_index = -1
  6299. } else {
  6300. this.type = this.runtime.types_by_index[t[0]];
  6301. this.run = this.run_object;
  6302. if (t[2]) {
  6303. this.behaviortype = this.type.getBehaviorByName(t[2]);
  6304. this.beh_index = this.type.getBehaviorIndexByName(t[2]);
  6305. } else {
  6306. this.behaviortype = null;
  6307. this.beh_index = -1
  6308. }
  6309. }
  6310. this.sid = t[3];
  6311. this.runtime.actsBySid[this.sid.toString()] = this;
  6312. if (t.length === 6) {
  6313. var n, r;
  6314. var i = t[5];
  6315. for (n = 0, r = i.length; n < r; n++) {
  6316. var s = new cr.parameter(this, i[n]);
  6317. cr.seal(s);
  6318. this.parameters.push(s)
  6319. }
  6320. this.results.length = i.length
  6321. }
  6322. }
  6323. function h(e, t) {
  6324. this.owner = e;
  6325. this.block = e.block;
  6326. this.sheet = e.sheet;
  6327. this.runtime = e.runtime;
  6328. this.type = t[0];
  6329. this.expression = null;
  6330. this.solindex = 0;
  6331. this.combosel = 0;
  6332. this.layout = null;
  6333. this.key = 0;
  6334. this.object = null;
  6335. this.index = 0;
  6336. this.varname = null;
  6337. this.eventvar = null;
  6338. this.fileinfo = null;
  6339. this.subparams = null;
  6340. this.variadicret = null;
  6341. var n, r, i;
  6342. switch (t[0]) {
  6343. case 0:
  6344. case 7:
  6345. this.expression = new cr.expNode(this, t[1]);
  6346. this.solindex = 0;
  6347. this.get = this.get_exp;
  6348. break;
  6349. case 1:
  6350. this.expression = new cr.expNode(this, t[1]);
  6351. this.solindex = 0;
  6352. this.get = this.get_exp_str;
  6353. break;
  6354. case 5:
  6355. this.expression = new cr.expNode(this, t[1]);
  6356. this.solindex = 0;
  6357. this.get = this.get_layer;
  6358. break;
  6359. case 3:
  6360. case 8:
  6361. this.combosel = t[1];
  6362. this.get = this.get_combosel;
  6363. break;
  6364. case 6:
  6365. this.layout = this.runtime.layouts[t[1]];
  6366. this.get = this.get_layout;
  6367. break;
  6368. case 9:
  6369. this.key = t[1];
  6370. this.get = this.get_key;
  6371. break;
  6372. case 4:
  6373. this.object = this.runtime.types_by_index[t[1]];
  6374. this.get = this.get_object;
  6375. this.block.addSolModifier(this.object);
  6376. if (this.owner instanceof cr.action) this.block.setSolWriterAfterCnds();
  6377. else if (this.block.parent) this.block.parent.setSolWriterAfterCnds();
  6378. break;
  6379. case 10:
  6380. this.index = t[1];
  6381. if (e.type.is_family) this.get = this.get_familyvar;
  6382. else this.get = this.get_instvar;
  6383. break;
  6384. case 11:
  6385. this.varname = t[1];
  6386. this.eventvar = null;
  6387. this.get = this.get_eventvar;
  6388. break;
  6389. case 2:
  6390. case 12:
  6391. this.fileinfo = t[1];
  6392. this.get = this.get_audiofile;
  6393. break;
  6394. case 13:
  6395. this.get = this.get_variadic;
  6396. this.subparams = [];
  6397. this.variadicret = [];
  6398. for (n = 1, r = t.length; n < r; n++) {
  6399. i = new cr.parameter(this.owner, t[n]);
  6400. cr.seal(i);
  6401. this.subparams.push(i);
  6402. this.variadicret.push(0)
  6403. }
  6404. break;
  6405. default:
  6406. }
  6407. }
  6408. function p(e, t, n) {
  6409. this.sheet = e;
  6410. this.parent = t;
  6411. this.runtime = e.runtime;
  6412. this.solModifiers = [];
  6413. this.name = n[1];
  6414. this.vartype = n[2];
  6415. this.initial = n[3];
  6416. this.is_static = !! n[4];
  6417. this.is_constant = !! n[5];
  6418. this.sid = n[6];
  6419. this.runtime.varsBySid[this.sid.toString()] = this;
  6420. this.data = this.initial;
  6421. if (this.parent) {
  6422. if (this.is_static || this.is_constant) this.localIndex = -1;
  6423. else this.localIndex = this.runtime.stackLocalCount++;
  6424. this.runtime.all_local_vars.push(this)
  6425. } else {
  6426. this.localIndex = -1;
  6427. this.runtime.all_global_vars.push(this)
  6428. }
  6429. }
  6430. function d(e, t, n) {
  6431. this.sheet = e;
  6432. this.parent = t;
  6433. this.runtime = e.runtime;
  6434. this.solModifiers = [];
  6435. this.include_sheet = null;
  6436. this.include_sheet_name = n[1]
  6437. }
  6438. function v() {
  6439. this.temp_parents_arr = [];
  6440. this.reset(null);
  6441. cr.seal(this)
  6442. }
  6443. var e = [];
  6444. i.prototype.toString = function() {
  6445. return this.name
  6446. };
  6447. i.prototype.init_event = function(e, t, n) {
  6448. switch (e[0]) {
  6449. case 0:
  6450. {
  6451. var r = new cr.eventblock(this, t, e);
  6452. cr.seal(r);
  6453. if (r.orblock) {
  6454. n.push(r);
  6455. var i, s;
  6456. for (i = 0, s = r.conditions.length; i < s; i++) {
  6457. if (r.conditions[i].trigger) this.init_trigger(r, i)
  6458. }
  6459. } else {
  6460. if (r.is_trigger()) this.init_trigger(r, 0);
  6461. else n.push(r)
  6462. }
  6463. break
  6464. };
  6465. case 1:
  6466. {
  6467. var o = new cr.eventvariable(this, t, e);
  6468. cr.seal(o);
  6469. n.push(o);
  6470. break
  6471. };
  6472. case 2:
  6473. {
  6474. var u = new cr.eventinclude(this, t, e);
  6475. cr.seal(u);
  6476. n.push(u);
  6477. break
  6478. };
  6479. default:
  6480. }
  6481. };
  6482. i.prototype.postInit = function() {
  6483. var e, t;
  6484. for (e = 0, t = this.events.length; e < t; e++) {
  6485. this.events[e].postInit(e < t - 1 && this.events[e + 1].is_else_block)
  6486. }
  6487. };
  6488. i.prototype.run = function(e) {
  6489. if (!this.runtime.resuming_breakpoint) {
  6490. this.hasRun = true;
  6491. if (!e) this.runtime.isRunningEvents = true
  6492. }
  6493. var t, n;
  6494. for (t = 0, n = this.events.length; t < n; t++) {
  6495. var r = this.events[t];
  6496. r.run();
  6497. this.runtime.clearSol(r.solModifiers);
  6498. if (!this.runtime.deathRow.isEmpty() || this.runtime.createRow.length) this.runtime.ClearDeathRow()
  6499. }
  6500. if (!e) this.runtime.isRunningEvents = false
  6501. };
  6502. i.prototype.init_trigger = function(e, t) {
  6503. if (!e.orblock) this.runtime.triggers_to_postinit.push(e);
  6504. var n, r;
  6505. var i = e.conditions[t];
  6506. var s;
  6507. if (i.type) s = i.type.name;
  6508. else s = "system";
  6509. var o = i.fasttrigger;
  6510. var u = o ? this.fasttriggers : this.triggers;
  6511. if (!u[s]) u[s] = [];
  6512. var a = u[s];
  6513. var f = i.func;
  6514. if (o) {
  6515. if (!i.parameters.length) return;
  6516. var l = i.parameters[0];
  6517. if (l.type !== 1 || l.expression.type !== 2) {
  6518. return
  6519. }
  6520. var c;
  6521. var h = l.expression.value.toLowerCase();
  6522. var n, r;
  6523. for (n = 0, r = a.length; n < r; n++) {
  6524. if (a[n].method == f) {
  6525. c = a[n].evs;
  6526. if (!c[h]) c[h] = [
  6527. [e, t]
  6528. ];
  6529. else c[h].push([e, t]);
  6530. return
  6531. }
  6532. }
  6533. c = {};
  6534. c[h] = [
  6535. [e, t]
  6536. ];
  6537. a.push({
  6538. method: f,
  6539. evs: c
  6540. })
  6541. } else {
  6542. for (n = 0, r = a.length; n < r; n++) {
  6543. if (a[n].method == f) {
  6544. a[n].evs.push([e, t]);
  6545. return
  6546. }
  6547. }
  6548. a.push({
  6549. method: f,
  6550. evs: [
  6551. [e, t]
  6552. ]
  6553. })
  6554. }
  6555. };
  6556. cr.eventsheet = i;
  6557. s.prototype.hasObjects = function() {
  6558. if (this.select_all) return this.type.instances.length;
  6559. else return this.instances.length
  6560. };
  6561. s.prototype.getObjects = function() {
  6562. if (this.select_all) return this.type.instances;
  6563. else return this.instances
  6564. };
  6565. s.prototype.pick_one = function(e) {
  6566. if (!e) return;
  6567. if (e.runtime.getCurrentEventStack().current_event.orblock) {
  6568. if (this.select_all) {
  6569. this.instances.length = 0;
  6570. cr.shallowAssignArray(this.else_instances, e.type.instances);
  6571. this.select_all = false
  6572. }
  6573. var t = this.else_instances.indexOf(e);
  6574. if (t !== -1) {
  6575. this.instances.push(this.else_instances[t]);
  6576. this.else_instances.splice(t, 1)
  6577. }
  6578. } else {
  6579. this.select_all = false;
  6580. this.instances.length = 1;
  6581. this.instances[0] = e
  6582. }
  6583. };
  6584. cr.selection = s;
  6585. o.prototype.postInit = function(e) {
  6586. var t, n;
  6587. var i = this.parent;
  6588. if (this.group) {
  6589. this.toplevelgroup = true;
  6590. while (i) {
  6591. if (!i.group) {
  6592. this.toplevelgroup = false;
  6593. break
  6594. }
  6595. i = i.parent
  6596. }
  6597. }
  6598. this.toplevelevent = !this.is_trigger() && (!this.parent || this.parent.group && this.parent.toplevelgroup);
  6599. this.has_else_block = !! e;
  6600. this.solModifiersIncludingParents = this.solModifiers.slice(0);
  6601. i = this.parent;
  6602. while (i) {
  6603. for (t = 0, n = i.solModifiers.length; t < n; t++) this.addParentSolModifier(i.solModifiers[t]);
  6604. i = i.parent
  6605. }
  6606. this.solModifiers = r(this.solModifiers);
  6607. this.solModifiersIncludingParents = r(this.solModifiersIncludingParents);
  6608. var t, n;
  6609. for (t = 0, n = this.conditions.length; t < n; t++) this.conditions[t].postInit();
  6610. for (t = 0, n = this.actions.length; t < n; t++) this.actions[t].postInit();
  6611. for (t = 0, n = this.subevents.length; t < n; t++) {
  6612. this.subevents[t].postInit(t < n - 1 && this.subevents[t + 1].is_else_block)
  6613. }
  6614. };
  6615. o.prototype.addSolModifier = function(e) {
  6616. u(e, this.solModifiers)
  6617. };
  6618. o.prototype.addParentSolModifier = function(e) {
  6619. u(e, this.solModifiersIncludingParents)
  6620. };
  6621. o.prototype.setSolWriterAfterCnds = function() {
  6622. this.solWriterAfterCnds = true;
  6623. if (this.parent) this.parent.setSolWriterAfterCnds()
  6624. };
  6625. o.prototype.is_trigger = function() {
  6626. if (!this.conditions.length) return false;
  6627. else return this.conditions[0].trigger
  6628. };
  6629. o.prototype.run = function() {
  6630. var e, t, n = false,
  6631. r;
  6632. var i = this.runtime.getCurrentEventStack();
  6633. i.current_event = this;
  6634. if (!this.is_else_block) i.else_branch_ran = false;
  6635. if (this.orblock) {
  6636. if (this.conditions.length === 0) n = true;
  6637. i.cndindex = 0;
  6638. for (t = this.conditions.length; i.cndindex < t; i.cndindex++) {
  6639. if (this.conditions[i.cndindex].trigger) continue;
  6640. r = this.conditions[i.cndindex].run();
  6641. if (r) n = true
  6642. }
  6643. i.last_event_true = n;
  6644. if (n) this.run_actions_and_subevents()
  6645. } else {
  6646. i.cndindex = 0;
  6647. for (t = this.conditions.length; i.cndindex < t; i.cndindex++) {
  6648. r = this.conditions[i.cndindex].run();
  6649. if (!r) {
  6650. i.last_event_true = false;
  6651. if (this.toplevelevent && (!this.runtime.deathRow.isEmpty() || this.runtime.createRow.length)) this.runtime.ClearDeathRow();
  6652. return
  6653. }
  6654. }
  6655. i.last_event_true = true;
  6656. this.run_actions_and_subevents()
  6657. }
  6658. this.end_run(i)
  6659. };
  6660. o.prototype.end_run = function(e) {
  6661. if (e.last_event_true && this.has_else_block) e.else_branch_ran = true;
  6662. if (this.toplevelevent && (!this.runtime.deathRow.isEmpty() || this.runtime.createRow.length)) this.runtime.ClearDeathRow()
  6663. };
  6664. o.prototype.run_orblocktrigger = function(e) {
  6665. var t = this.runtime.getCurrentEventStack();
  6666. t.current_event = this;
  6667. if (this.conditions[e].run()) {
  6668. this.run_actions_and_subevents()
  6669. }
  6670. };
  6671. o.prototype.run_actions_and_subevents = function() {
  6672. var e = this.runtime.getCurrentEventStack();
  6673. var t;
  6674. for (e.actindex = 0, t = this.actions.length; e.actindex < t; e.actindex++) {
  6675. if (this.actions[e.actindex].run()) return
  6676. }
  6677. this.run_subevents()
  6678. };
  6679. o.prototype.resume_actions_and_subevents = function() {
  6680. var e = this.runtime.getCurrentEventStack();
  6681. var t;
  6682. for (t = this.actions.length; e.actindex < t; e.actindex++) {
  6683. if (this.actions[e.actindex].run()) return
  6684. }
  6685. this.run_subevents()
  6686. };
  6687. o.prototype.run_subevents = function() {
  6688. if (!this.subevents.length) return;
  6689. var e, t, n, r;
  6690. var i = this.subevents.length - 1;
  6691. this.runtime.pushEventStack(this);
  6692. if (this.solWriterAfterCnds) {
  6693. for (e = 0, t = this.subevents.length; e < t; e++) {
  6694. n = this.subevents[e];
  6695. r = !this.toplevelgroup || !this.group && e < i;
  6696. if (r) this.runtime.pushCopySol(n.solModifiers);
  6697. n.run();
  6698. if (r) this.runtime.popSol(n.solModifiers);
  6699. else this.runtime.clearSol(n.solModifiers)
  6700. }
  6701. } else {
  6702. for (e = 0, t = this.subevents.length; e < t; e++) {
  6703. this.subevents[e].run()
  6704. }
  6705. }
  6706. this.runtime.popEventStack()
  6707. };
  6708. o.prototype.run_pretrigger = function() {
  6709. var e = this.runtime.getCurrentEventStack();
  6710. e.current_event = this;
  6711. var t = false;
  6712. var n, r;
  6713. for (e.cndindex = 0, r = this.conditions.length; e.cndindex < r; e.cndindex++) {
  6714. if (this.conditions[e.cndindex].run()) t = true;
  6715. else if (!this.orblock) return false
  6716. }
  6717. return this.orblock ? t : true
  6718. };
  6719. o.prototype.retrigger = function() {
  6720. this.runtime.execcount++;
  6721. var e = this.runtime.getCurrentEventStack().cndindex;
  6722. var t;
  6723. var n = this.runtime.pushEventStack(this);
  6724. if (!this.orblock) {
  6725. for (n.cndindex = e + 1, t = this.conditions.length; n.cndindex < t; n.cndindex++) {
  6726. if (!this.conditions[n.cndindex].run()) {
  6727. this.runtime.popEventStack();
  6728. return false
  6729. }
  6730. }
  6731. }
  6732. this.run_actions_and_subevents();
  6733. this.runtime.popEventStack();
  6734. return true
  6735. };
  6736. o.prototype.isFirstConditionOfType = function(e) {
  6737. var t = e.index;
  6738. if (t === 0) return true;
  6739. --t;
  6740. for (; t >= 0; --t) {
  6741. if (this.conditions[t].type === e.type) return false
  6742. }
  6743. return true
  6744. };
  6745. cr.eventblock = o;
  6746. a.prototype.postInit = function() {
  6747. var e, t;
  6748. for (e = 0, t = this.parameters.length; e < t; e++) this.parameters[e].postInit()
  6749. };
  6750. a.prototype.run_true = function() {
  6751. return true
  6752. };
  6753. a.prototype.run_system = function() {
  6754. var e, t;
  6755. for (e = 0, t = this.parameters.length; e < t; e++) this.results[e] = this.parameters[e].get();
  6756. return cr.xor(this.func.apply(this.runtime.system, this.results), this.inverted)
  6757. };
  6758. a.prototype.run_static = function() {
  6759. var e, t;
  6760. for (e = 0, t = this.parameters.length; e < t; e++) this.results[e] = this.parameters[e].get(e);
  6761. var n = this.func.apply(this.behaviortype ? this.behaviortype : this.type, this.results);
  6762. this.type.applySolToContainer();
  6763. return n
  6764. };
  6765. a.prototype.run_object = function() {
  6766. var e, t, n, r, i, s, o, u, a;
  6767. var f = this.type.getCurrentSol();
  6768. var l = this.block.orblock && !this.trigger;
  6769. var c = 0;
  6770. var h = this.type.is_contained;
  6771. if (f.select_all) {
  6772. f.instances.length = 0;
  6773. f.else_instances.length = 0;
  6774. for (e = 0, n = this.type.instances.length; e < n; e++) {
  6775. o = this.type.instances[e];
  6776. for (t = 0, r = this.parameters.length; t < r; t++) this.results[t] = this.parameters[t].get(e);
  6777. if (this.beh_index > -1) {
  6778. if (this.type.is_family) {
  6779. c = o.type.family_beh_map[this.type.family_index]
  6780. }
  6781. i = this.func.apply(o.behavior_insts[this.beh_index + c], this.results)
  6782. } else i = this.func.apply(o, this.results);
  6783. s = cr.xor(i, this.inverted);
  6784. if (s) f.instances.push(o);
  6785. else if (l) f.else_instances.push(o)
  6786. }
  6787. if (this.type.finish) this.type.finish(true);
  6788. f.select_all = false;
  6789. this.type.applySolToContainer();
  6790. return f.hasObjects()
  6791. } else {
  6792. var p = 0;
  6793. var d = l && !this.block.isFirstConditionOfType(this);
  6794. var v = d ? f.else_instances : f.instances;
  6795. var m = false;
  6796. for (e = 0, n = v.length; e < n; e++) {
  6797. o = v[e];
  6798. for (t = 0, r = this.parameters.length; t < r; t++) this.results[t] = this.parameters[t].get(e);
  6799. if (this.beh_index > -1) {
  6800. if (this.type.is_family) {
  6801. c = o.type.family_beh_map[this.type.family_index]
  6802. }
  6803. i = this.func.apply(o.behavior_insts[this.beh_index + c], this.results)
  6804. } else i = this.func.apply(o, this.results);
  6805. if (cr.xor(i, this.inverted)) {
  6806. m = true;
  6807. if (d) {
  6808. f.instances.push(o);
  6809. if (h) {
  6810. for (t = 0, r = o.siblings.length; t < r; t++) {
  6811. u = o.siblings[t];
  6812. u.type.getCurrentSol().instances.push(u)
  6813. }
  6814. }
  6815. } else {
  6816. v[p] = o;
  6817. if (h) {
  6818. for (t = 0, r = o.siblings.length; t < r; t++) {
  6819. u = o.siblings[t];
  6820. u.type.getCurrentSol().instances[p] = u
  6821. }
  6822. }
  6823. p++
  6824. }
  6825. } else {
  6826. if (d) {
  6827. v[p] = o;
  6828. if (h) {
  6829. for (t = 0, r = o.siblings.length; t < r; t++) {
  6830. u = o.siblings[t];
  6831. u.type.getCurrentSol().else_instances[p] = u
  6832. }
  6833. }
  6834. p++
  6835. } else if (l) {
  6836. f.else_instances.push(o);
  6837. if (h) {
  6838. for (t = 0, r = o.siblings.length; t < r; t++) {
  6839. u = o.siblings[t];
  6840. u.type.getCurrentSol().else_instances.push(u)
  6841. }
  6842. }
  6843. }
  6844. }
  6845. }
  6846. v.length = p;
  6847. if (h) {
  6848. for (e = 0, n = this.type.container.length; e < n; e++) {
  6849. a = this.type.container[e].getCurrentSol();
  6850. if (d) a.else_instances.length = p;
  6851. else a.instances.length = p
  6852. }
  6853. }
  6854. var g = m;
  6855. if (d && !m) {
  6856. for (e = 0, n = f.instances.length; e < n; e++) {
  6857. o = f.instances[e];
  6858. for (t = 0, r = this.parameters.length; t < r; t++) this.results[t] = this.parameters[t].get(e);
  6859. if (this.beh_index > -1) i = this.func.apply(o.behavior_insts[this.beh_index], this.results);
  6860. else i = this.func.apply(o, this.results);
  6861. if (cr.xor(i, this.inverted)) {
  6862. m = true;
  6863. break
  6864. }
  6865. }
  6866. }
  6867. if (this.type.finish) this.type.finish(g || l);
  6868. return l ? m : f.hasObjects()
  6869. }
  6870. };
  6871. cr.condition = a;
  6872. f.prototype.postInit = function() {
  6873. var e, t;
  6874. for (e = 0, t = this.parameters.length; e < t; e++) this.parameters[e].postInit()
  6875. };
  6876. f.prototype.run_system = function() {
  6877. var e, t;
  6878. for (e = 0, t = this.parameters.length; e < t; e++) this.results[e] = this.parameters[e].get();
  6879. return this.func.apply(this.runtime.system, this.results)
  6880. };
  6881. f.prototype.run_object = function() {
  6882. var e = this.type.getCurrentSol().getObjects();
  6883. var t, n, r, i, s;
  6884. for (t = 0, r = e.length; t < r; t++) {
  6885. s = e[t];
  6886. for (n = 0, i = this.parameters.length; n < i; n++) this.results[n] = this.parameters[n].get(t);
  6887. if (this.beh_index > -1) {
  6888. var o = 0;
  6889. if (this.type.is_family) {
  6890. o = s.type.family_beh_map[this.type.family_index]
  6891. }
  6892. this.func.apply(s.behavior_insts[this.beh_index + o], this.results)
  6893. } else this.func.apply(s, this.results)
  6894. }
  6895. return false
  6896. };
  6897. cr.action = f;
  6898. var l = [];
  6899. var c = -1;
  6900. h.prototype.postInit = function() {
  6901. var e, t;
  6902. if (this.type === 11) {
  6903. this.eventvar = this.runtime.getEventVariableByName(this.varname, this.block.parent);
  6904. } else if (this.type === 13) {
  6905. for (e = 0, t = this.subparams.length; e < t; e++) this.subparams[e].postInit()
  6906. }
  6907. if (this.expression) this.expression.postInit()
  6908. };
  6909. h.prototype.pushTempValue = function() {
  6910. c++;
  6911. if (l.length === c) l.push(new cr.expvalue);
  6912. return l[c]
  6913. };
  6914. h.prototype.popTempValue = function() {
  6915. c--
  6916. };
  6917. h.prototype.get_exp = function(e) {
  6918. this.solindex = e || 0;
  6919. var t = this.pushTempValue();
  6920. this.expression.get(t);
  6921. this.popTempValue();
  6922. return t.data
  6923. };
  6924. h.prototype.get_exp_str = function(e) {
  6925. this.solindex = e || 0;
  6926. var t = this.pushTempValue();
  6927. this.expression.get(t);
  6928. this.popTempValue();
  6929. if (cr.is_string(t.data)) return t.data;
  6930. else return ""
  6931. };
  6932. h.prototype.get_object = function() {
  6933. return this.object
  6934. };
  6935. h.prototype.get_combosel = function() {
  6936. return this.combosel
  6937. };
  6938. h.prototype.get_layer = function(e) {
  6939. this.solindex = e || 0;
  6940. var t = this.pushTempValue();
  6941. this.expression.get(t);
  6942. this.popTempValue();
  6943. if (t.is_number()) return this.runtime.getLayerByNumber(t.data);
  6944. else return this.runtime.getLayerByName(t.data)
  6945. };
  6946. h.prototype.get_layout = function() {
  6947. return this.layout
  6948. };
  6949. h.prototype.get_key = function() {
  6950. return this.key
  6951. };
  6952. h.prototype.get_instvar = function() {
  6953. return this.index
  6954. };
  6955. h.prototype.get_familyvar = function(e) {
  6956. var t = this.owner.type;
  6957. var n = null;
  6958. var r = t.getCurrentSol();
  6959. var i = r.getObjects();
  6960. if (i.length) n = i[e % i.length].type;
  6961. else {
  6962. n = r.else_instances[e % r.else_instances.length].type
  6963. }
  6964. return this.index + n.family_var_map[t.family_index]
  6965. };
  6966. h.prototype.get_eventvar = function() {
  6967. return this.eventvar
  6968. };
  6969. h.prototype.get_audiofile = function() {
  6970. return this.fileinfo
  6971. };
  6972. h.prototype.get_variadic = function() {
  6973. var e, t;
  6974. for (e = 0, t = this.subparams.length; e < t; e++) {
  6975. this.variadicret[e] = this.subparams[e].get()
  6976. }
  6977. return this.variadicret
  6978. };
  6979. cr.parameter = h;
  6980. p.prototype.postInit = function() {
  6981. this.solModifiers = r(this.solModifiers)
  6982. };
  6983. p.prototype.setValue = function(e) {
  6984. var t = this.runtime.getCurrentLocalVarStack();
  6985. if (!this.parent || this.is_static || !t) this.data = e;
  6986. else {
  6987. if (this.localIndex >= t.length) t.length = this.localIndex + 1;
  6988. t[this.localIndex] = e
  6989. }
  6990. };
  6991. p.prototype.getValue = function() {
  6992. var e = this.runtime.getCurrentLocalVarStack();
  6993. if (!this.parent || this.is_static || !e || this.is_constant) return this.data;
  6994. else {
  6995. if (this.localIndex >= e.length) {
  6996. return this.initial
  6997. }
  6998. if (typeof e[this.localIndex] === "undefined") {
  6999. return this.initial
  7000. }
  7001. return e[this.localIndex]
  7002. }
  7003. };
  7004. p.prototype.run = function() {
  7005. if (this.parent && !this.is_static && !this.is_constant) this.setValue(this.initial)
  7006. };
  7007. cr.eventvariable = p;
  7008. d.prototype.toString = function() {
  7009. return "include:" + this.include_sheet.toString()
  7010. };
  7011. d.prototype.postInit = function() {
  7012. this.include_sheet = this.runtime.eventsheets[this.include_sheet_name];
  7013. this.sheet.includes.add(this);
  7014. this.solModifiers = r(this.solModifiers)
  7015. };
  7016. d.prototype.run = function() {
  7017. if (this.parent) this.runtime.pushCleanSol(this.runtime.types_by_index);
  7018. if (!this.include_sheet.hasRun) this.include_sheet.run(true);
  7019. if (this.parent) this.runtime.popSol(this.runtime.types_by_index)
  7020. };
  7021. d.prototype.isActive = function() {
  7022. var e = this.parent;
  7023. while (e) {
  7024. if (e.group) {
  7025. if (!this.runtime.activeGroups[e.group_name.toLowerCase()]) return false
  7026. }
  7027. e = e.parent
  7028. }
  7029. return true
  7030. };
  7031. cr.eventinclude = d;
  7032. v.prototype.reset = function(e) {
  7033. this.current_event = e;
  7034. this.cndindex = 0;
  7035. this.actindex = 0;
  7036. this.temp_parents_arr.length = 0;
  7037. this.last_event_true = false;
  7038. this.else_branch_ran = false;
  7039. this.any_true_state = false
  7040. };
  7041. v.prototype.isModifierAfterCnds = function() {
  7042. if (this.current_event.solWriterAfterCnds) return true;
  7043. if (this.cndindex < this.current_event.conditions.length - 1) return !!this.current_event.solModifiers.length;
  7044. return false
  7045. };
  7046. cr.eventStackFrame = v
  7047. })();
  7048. (function() {
  7049. function e(e, t) {
  7050. this.owner = e;
  7051. this.runtime = e.runtime;
  7052. this.type = t[0];
  7053. this.get = [this.eval_int, this.eval_float, this.eval_string, this.eval_unaryminus, this.eval_add, this.eval_subtract, this.eval_multiply, this.eval_divide, this.eval_mod, this.eval_power, this.eval_and, this.eval_or, this.eval_equal, this.eval_notequal, this.eval_less, this.eval_lessequal, this.eval_greater, this.eval_greaterequal, this.eval_conditional, this.eval_system_exp, this.eval_object_behavior_exp, this.eval_instvar_exp, this.eval_object_behavior_exp, this.eval_eventvar_exp][this.type];
  7054. var n = null;
  7055. this.value = null;
  7056. this.first = null;
  7057. this.second = null;
  7058. this.third = null;
  7059. this.func = null;
  7060. this.results = null;
  7061. this.parameters = null;
  7062. this.object_type = null;
  7063. this.beh_index = -1;
  7064. this.instance_expr = null;
  7065. this.varindex = -1;
  7066. this.behavior_type = null;
  7067. this.varname = null;
  7068. this.eventvar = null;
  7069. this.return_string = false;
  7070. switch (this.type) {
  7071. case 0:
  7072. case 1:
  7073. case 2:
  7074. this.value = t[1];
  7075. break;
  7076. case 3:
  7077. this.first = new cr.expNode(e, t[1]);
  7078. break;
  7079. case 18:
  7080. this.first = new cr.expNode(e, t[1]);
  7081. this.second = new cr.expNode(e, t[2]);
  7082. this.third = new cr.expNode(e, t[3]);
  7083. break;
  7084. case 19:
  7085. this.func = t[1];
  7086. this.results = [];
  7087. this.parameters = [];
  7088. if (t.length === 3) {
  7089. n = t[2];
  7090. this.results.length = n.length + 1
  7091. } else this.results.length = 1;
  7092. break;
  7093. case 20:
  7094. this.object_type = this.runtime.types_by_index[t[1]];
  7095. this.beh_index = -1;
  7096. this.func = t[2];
  7097. this.return_string = t[3];
  7098. if (t[4]) this.instance_expr = new cr.expNode(e, t[4]);
  7099. else this.instance_expr = null;
  7100. this.results = [];
  7101. this.parameters = [];
  7102. if (t.length === 6) {
  7103. n = t[5];
  7104. this.results.length = n.length + 1
  7105. } else this.results.length = 1;
  7106. break;
  7107. case 21:
  7108. this.object_type = this.runtime.types_by_index[t[1]];
  7109. this.return_string = t[2];
  7110. if (t[3]) this.instance_expr = new cr.expNode(e, t[3]);
  7111. else this.instance_expr = null;
  7112. this.varindex = t[4];
  7113. break;
  7114. case 22:
  7115. this.object_type = this.runtime.types_by_index[t[1]];
  7116. this.behavior_type = this.object_type.getBehaviorByName(t[2]);
  7117. this.beh_index = this.object_type.getBehaviorIndexByName(t[2]);
  7118. this.func = t[3];
  7119. this.return_string = t[4];
  7120. if (t[5]) this.instance_expr = new cr.expNode(e, t[5]);
  7121. else this.instance_expr = null;
  7122. this.results = [];
  7123. this.parameters = [];
  7124. if (t.length === 7) {
  7125. n = t[6];
  7126. this.results.length = n.length + 1
  7127. } else this.results.length = 1;
  7128. break;
  7129. case 23:
  7130. this.varname = t[1];
  7131. this.eventvar = null;
  7132. break
  7133. }
  7134. if (this.type >= 4 && this.type <= 17) {
  7135. this.first = new cr.expNode(e, t[1]);
  7136. this.second = new cr.expNode(e, t[2])
  7137. }
  7138. if (n) {
  7139. var r, i;
  7140. for (r = 0, i = n.length; r < i; r++) this.parameters.push(new cr.expNode(e, n[r]))
  7141. }
  7142. cr.seal(this)
  7143. }
  7144. function t(e, t) {
  7145. this.type = e || cr.exptype.Integer;
  7146. this.data = t || 0;
  7147. this.object_class = null;
  7148. if (this.type == cr.exptype.Integer) this.data = Math.floor(this.data);
  7149. cr.seal(this)
  7150. }
  7151. e.prototype.postInit = function() {
  7152. if (this.type === 23) {
  7153. this.eventvar = this.owner.runtime.getEventVariableByName(this.varname, this.owner.block.parent);
  7154. }
  7155. if (this.first) this.first.postInit();
  7156. if (this.second) this.second.postInit();
  7157. if (this.third) this.third.postInit();
  7158. if (this.instance_expr) this.instance_expr.postInit();
  7159. if (this.parameters) {
  7160. var e, t;
  7161. for (e = 0, t = this.parameters.length; e < t; e++) this.parameters[e].postInit()
  7162. }
  7163. };
  7164. e.prototype.eval_system_exp = function(e) {
  7165. this.results[0] = e;
  7166. var t = this.owner.pushTempValue();
  7167. var n, r;
  7168. for (n = 0, r = this.parameters.length; n < r; n++) {
  7169. this.parameters[n].get(t);
  7170. this.results[n + 1] = t.data
  7171. }
  7172. this.owner.popTempValue();
  7173. this.func.apply(this.runtime.system, this.results)
  7174. };
  7175. e.prototype.eval_object_behavior_exp = function(e) {
  7176. var t = this.object_type.getCurrentSol();
  7177. var n = t.getObjects();
  7178. if (!n.length) {
  7179. if (t.else_instances.length) n = t.else_instances;
  7180. else {
  7181. if (this.return_string) e.set_string("");
  7182. else e.set_int(0);
  7183. return
  7184. }
  7185. }
  7186. this.results[0] = e;
  7187. e.object_class = this.object_type;
  7188. var r = this.owner.pushTempValue();
  7189. var i, s;
  7190. for (i = 0, s = this.parameters.length; i < s; i++) {
  7191. this.parameters[i].get(r);
  7192. this.results[i + 1] = r.data
  7193. }
  7194. var o = this.owner.solindex;
  7195. if (this.instance_expr) {
  7196. this.instance_expr.get(r);
  7197. if (r.is_number()) {
  7198. o = r.data;
  7199. n = this.object_type.instances
  7200. }
  7201. }
  7202. this.owner.popTempValue();
  7203. o %= n.length;
  7204. if (o < 0) o += n.length;
  7205. var u;
  7206. var a = n[o];
  7207. if (this.beh_index > -1) {
  7208. var f = 0;
  7209. if (this.object_type.is_family) {
  7210. f = a.type.family_beh_map[this.object_type.family_index]
  7211. }
  7212. u = this.func.apply(a.behavior_insts[this.beh_index + f], this.results)
  7213. } else u = this.func.apply(a, this.results);
  7214. };
  7215. e.prototype.eval_instvar_exp = function(e) {
  7216. var t = this.object_type.getCurrentSol();
  7217. var n = t.getObjects();
  7218. if (!n.length) {
  7219. if (t.else_instances.length) n = t.else_instances;
  7220. else {
  7221. if (this.return_string) e.set_string("");
  7222. else e.set_int(0);
  7223. return
  7224. }
  7225. }
  7226. var r = this.owner.solindex;
  7227. if (this.instance_expr) {
  7228. var i = this.owner.pushTempValue();
  7229. this.instance_expr.get(i);
  7230. if (i.is_number()) {
  7231. r = i.data;
  7232. var s = this.object_type.instances;
  7233. r %= s.length;
  7234. if (r < 0) r += s.length;
  7235. var o = s[r].instance_vars[this.varindex];
  7236. if (cr.is_string(o)) e.set_string(o);
  7237. else e.set_float(o);
  7238. this.owner.popTempValue();
  7239. return
  7240. }
  7241. this.owner.popTempValue()
  7242. }
  7243. r %= n.length;
  7244. if (r < 0) r += n.length;
  7245. var u = n[r];
  7246. var a = 0;
  7247. if (this.object_type.is_family) {
  7248. a = u.type.family_var_map[this.object_type.family_index]
  7249. }
  7250. var o = u.instance_vars[this.varindex + a];
  7251. if (cr.is_string(o)) e.set_string(o);
  7252. else e.set_float(o)
  7253. };
  7254. e.prototype.eval_int = function(e) {
  7255. e.type = cr.exptype.Integer;
  7256. e.data = this.value
  7257. };
  7258. e.prototype.eval_float = function(e) {
  7259. e.type = cr.exptype.Float;
  7260. e.data = this.value
  7261. };
  7262. e.prototype.eval_string = function(e) {
  7263. e.type = cr.exptype.String;
  7264. e.data = this.value
  7265. };
  7266. e.prototype.eval_unaryminus = function(e) {
  7267. this.first.get(e);
  7268. if (e.is_number()) e.data = -e.data
  7269. };
  7270. e.prototype.eval_add = function(e) {
  7271. this.first.get(e);
  7272. var t = this.owner.pushTempValue();
  7273. this.second.get(t);
  7274. if (e.is_number() && t.is_number()) {
  7275. e.data += t.data;
  7276. if (t.is_float()) e.make_float()
  7277. }
  7278. this.owner.popTempValue()
  7279. };
  7280. e.prototype.eval_subtract = function(e) {
  7281. this.first.get(e);
  7282. var t = this.owner.pushTempValue();
  7283. this.second.get(t);
  7284. if (e.is_number() && t.is_number()) {
  7285. e.data -= t.data;
  7286. if (t.is_float()) e.make_float()
  7287. }
  7288. this.owner.popTempValue()
  7289. };
  7290. e.prototype.eval_multiply = function(e) {
  7291. this.first.get(e);
  7292. var t = this.owner.pushTempValue();
  7293. this.second.get(t);
  7294. if (e.is_number() && t.is_number()) {
  7295. e.data *= t.data;
  7296. if (t.is_float()) e.make_float()
  7297. }
  7298. this.owner.popTempValue()
  7299. };
  7300. e.prototype.eval_divide = function(e) {
  7301. this.first.get(e);
  7302. var t = this.owner.pushTempValue();
  7303. this.second.get(t);
  7304. if (e.is_number() && t.is_number()) {
  7305. e.data /= t.data;
  7306. e.make_float()
  7307. }
  7308. this.owner.popTempValue()
  7309. };
  7310. e.prototype.eval_mod = function(e) {
  7311. this.first.get(e);
  7312. var t = this.owner.pushTempValue();
  7313. this.second.get(t);
  7314. if (e.is_number() && t.is_number()) {
  7315. e.data %= t.data;
  7316. if (t.is_float()) e.make_float()
  7317. }
  7318. this.owner.popTempValue()
  7319. };
  7320. e.prototype.eval_power = function(e) {
  7321. this.first.get(e);
  7322. var t = this.owner.pushTempValue();
  7323. this.second.get(t);
  7324. if (e.is_number() && t.is_number()) {
  7325. e.data = Math.pow(e.data, t.data);
  7326. if (t.is_float()) e.make_float()
  7327. }
  7328. this.owner.popTempValue()
  7329. };
  7330. e.prototype.eval_and = function(e) {
  7331. this.first.get(e);
  7332. var t = this.owner.pushTempValue();
  7333. this.second.get(t);
  7334. if (e.is_number()) {
  7335. if (t.is_string()) {
  7336. e.set_string(e.data.toString() + t.data)
  7337. } else {
  7338. if (e.data && t.data) e.set_int(1);
  7339. else e.set_int(0)
  7340. }
  7341. } else if (e.is_string()) {
  7342. if (t.is_string()) e.data += t.data;
  7343. else {
  7344. e.data += (Math.round(t.data * 1e10) / 1e10).toString()
  7345. }
  7346. }
  7347. this.owner.popTempValue()
  7348. };
  7349. e.prototype.eval_or = function(e) {
  7350. this.first.get(e);
  7351. var t = this.owner.pushTempValue();
  7352. this.second.get(t);
  7353. if (e.is_number() && t.is_number()) {
  7354. if (e.data || t.data) e.set_int(1);
  7355. else e.set_int(0)
  7356. }
  7357. this.owner.popTempValue()
  7358. };
  7359. e.prototype.eval_conditional = function(e) {
  7360. this.first.get(e);
  7361. if (e.data) this.second.get(e);
  7362. else this.third.get(e)
  7363. };
  7364. e.prototype.eval_equal = function(e) {
  7365. this.first.get(e);
  7366. var t = this.owner.pushTempValue();
  7367. this.second.get(t);
  7368. e.set_int(e.data === t.data ? 1 : 0);
  7369. this.owner.popTempValue()
  7370. };
  7371. e.prototype.eval_notequal = function(e) {
  7372. this.first.get(e);
  7373. var t = this.owner.pushTempValue();
  7374. this.second.get(t);
  7375. e.set_int(e.data !== t.data ? 1 : 0);
  7376. this.owner.popTempValue()
  7377. };
  7378. e.prototype.eval_less = function(e) {
  7379. this.first.get(e);
  7380. var t = this.owner.pushTempValue();
  7381. this.second.get(t);
  7382. e.set_int(e.data < t.data ? 1 : 0);
  7383. this.owner.popTempValue()
  7384. };
  7385. e.prototype.eval_lessequal = function(e) {
  7386. this.first.get(e);
  7387. var t = this.owner.pushTempValue();
  7388. this.second.get(t);
  7389. e.set_int(e.data <= t.data ? 1 : 0);
  7390. this.owner.popTempValue()
  7391. };
  7392. e.prototype.eval_greater = function(e) {
  7393. this.first.get(e);
  7394. var t = this.owner.pushTempValue();
  7395. this.second.get(t);
  7396. e.set_int(e.data > t.data ? 1 : 0);
  7397. this.owner.popTempValue()
  7398. };
  7399. e.prototype.eval_greaterequal = function(e) {
  7400. this.first.get(e);
  7401. var t = this.owner.pushTempValue();
  7402. this.second.get(t);
  7403. e.set_int(e.data >= t.data ? 1 : 0);
  7404. this.owner.popTempValue()
  7405. };
  7406. e.prototype.eval_eventvar_exp = function(e) {
  7407. var t = this.eventvar.getValue();
  7408. if (cr.is_number(t)) e.set_float(t);
  7409. else e.set_string(t)
  7410. };
  7411. cr.expNode = e;
  7412. t.prototype.is_int = function() {
  7413. return this.type === cr.exptype.Integer
  7414. };
  7415. t.prototype.is_float = function() {
  7416. return this.type === cr.exptype.Float
  7417. };
  7418. t.prototype.is_number = function() {
  7419. return this.type === cr.exptype.Integer || this.type === cr.exptype.Float
  7420. };
  7421. t.prototype.is_string = function() {
  7422. return this.type === cr.exptype.String
  7423. };
  7424. t.prototype.make_int = function() {
  7425. if (!this.is_int()) {
  7426. if (this.is_float()) this.data = Math.floor(this.data);
  7427. else if (this.is_string()) this.data = parseInt(this.data, 10);
  7428. this.type = cr.exptype.Integer
  7429. }
  7430. };
  7431. t.prototype.make_float = function() {
  7432. if (!this.is_float()) {
  7433. if (this.is_string()) this.data = parseFloat(this.data);
  7434. this.type = cr.exptype.Float
  7435. }
  7436. };
  7437. t.prototype.make_string = function() {
  7438. if (!this.is_string()) {
  7439. this.data = this.data.toString();
  7440. this.type = cr.exptype.String
  7441. }
  7442. };
  7443. t.prototype.set_int = function(e) {
  7444. this.type = cr.exptype.Integer;
  7445. this.data = Math.floor(e)
  7446. };
  7447. t.prototype.set_float = function(e) {
  7448. this.type = cr.exptype.Float;
  7449. this.data = e
  7450. };
  7451. t.prototype.set_string = function(e) {
  7452. this.type = cr.exptype.String;
  7453. this.data = e
  7454. };
  7455. t.prototype.set_any = function(e) {
  7456. if (cr.is_number(e)) {
  7457. this.type = cr.exptype.Float;
  7458. this.data = e
  7459. } else if (cr.is_string(e)) {
  7460. this.type = cr.exptype.String;
  7461. this.data = e.toString()
  7462. } else {
  7463. this.type = cr.exptype.Integer;
  7464. this.data = 0
  7465. }
  7466. };
  7467. cr.expvalue = t;
  7468. cr.exptype = {
  7469. Integer: 0,
  7470. Float: 1,
  7471. String: 2
  7472. }
  7473. })();
  7474. cr.system_object = function(e) {
  7475. this.runtime = e;
  7476. this.waits = []
  7477. };
  7478. cr.system_object.prototype.saveToJSON = function() {
  7479. var e = {};
  7480. var t, n, r, i, s, o, u, a;
  7481. e["waits"] = [];
  7482. var f = e["waits"];
  7483. var l;
  7484. for (t = 0, n = this.waits.length; t < n; t++) {
  7485. o = this.waits[t];
  7486. l = {
  7487. t: o.time,
  7488. ev: o.ev.sid,
  7489. sm: [],
  7490. sols: {}
  7491. };
  7492. if (o.ev.actions[o.actindex]) l["act"] = o.ev.actions[o.actindex].sid;
  7493. for (r = 0, i = o.solModifiers.length; r < i; r++) l["sm"].push(o.solModifiers[r].sid);
  7494. for (s in o.sols) {
  7495. if (o.sols.hasOwnProperty(s)) {
  7496. u = this.runtime.types_by_index[parseInt(s, 10)];
  7497. a = {
  7498. sa: o.sols[s].sa,
  7499. insts: []
  7500. };
  7501. for (r = 0, i = o.sols[s].insts.length; r < i; r++) a["insts"].push(o.sols[s].insts[r].uid);
  7502. l["sols"][u.sid.toString()] = a
  7503. }
  7504. }
  7505. f.push(l)
  7506. }
  7507. return e
  7508. };
  7509. cr.system_object.prototype.loadFromJSON = function(e) {
  7510. var t = e["waits"];
  7511. var n, r, i, s, o, u, a, f, l, c, h, p, d;
  7512. this.waits.length = 0;
  7513. for (n = 0, r = t.length; n < r; n++) {
  7514. u = t[n];
  7515. f = this.runtime.blocksBySid[u["ev"].toString()];
  7516. if (!f) continue;
  7517. l = -1;
  7518. for (i = 0, s = f.actions.length; i < s; i++) {
  7519. if (f.actions[i].sid === u["act"]) {
  7520. l = i;
  7521. break
  7522. }
  7523. }
  7524. if (l === -1) continue;
  7525. a = {};
  7526. a.sols = {};
  7527. a.solModifiers = [];
  7528. a.deleteme = false;
  7529. a.time = u["t"];
  7530. a.ev = f;
  7531. a.actindex = l;
  7532. for (i = 0, s = u["sm"].length; i < s; i++) {
  7533. c = this.runtime.getObjectTypeBySid(u["sm"][i]);
  7534. if (c) a.solModifiers.push(c)
  7535. }
  7536. for (o in u["sols"]) {
  7537. if (u["sols"].hasOwnProperty(o)) {
  7538. c = this.runtime.getObjectTypeBySid(parseInt(o, 10));
  7539. if (!c) continue;
  7540. h = u["sols"][o];
  7541. p = {
  7542. sa: h["sa"],
  7543. insts: []
  7544. };
  7545. for (i = 0, s = h["insts"].length; i < s; i++) {
  7546. d = this.runtime.getObjectByUID(h["insts"][i]);
  7547. if (d) p.insts.push(d)
  7548. }
  7549. a.sols[c.index.toString()] = p
  7550. }
  7551. }
  7552. this.waits.push(a)
  7553. }
  7554. };
  7555. (function() {
  7556. function t() {}
  7557. function i(e, t) {
  7558. var n = e.extra.c2_foreachordered_val;
  7559. var r = t.extra.c2_foreachordered_val;
  7560. if (cr.is_number(n) && cr.is_number(r)) return n - r;
  7561. else {
  7562. n = "" + n;
  7563. r = "" + r;
  7564. if (n < r) return -1;
  7565. else if (n > r) return 1;
  7566. else return 0
  7567. }
  7568. }
  7569. function a(e, t) {
  7570. if (!s || e !== o || t !== u) {
  7571. s = new RegExp(e, t);
  7572. o = e;
  7573. u = t
  7574. }
  7575. s.lastIndex = 0;
  7576. return s
  7577. }
  7578. function l() {}
  7579. function h() {
  7580. var e;
  7581. if (c.length) e = c.pop();
  7582. else {
  7583. e = {};
  7584. e.sols = {};
  7585. e.solModifiers = []
  7586. }
  7587. e.deleteme = false;
  7588. return e
  7589. }
  7590. function p(e) {
  7591. cr.wipe(e.sols);
  7592. e.solModifiers.length = 0;
  7593. c.push(e)
  7594. }
  7595. function v() {
  7596. var e;
  7597. if (d.length) e = d.pop();
  7598. else {
  7599. e = {};
  7600. e.insts = []
  7601. }
  7602. e.sa = false;
  7603. return e
  7604. }
  7605. function m(e) {
  7606. e.insts.length = 0;
  7607. d.push(e)
  7608. }
  7609. function g() {}
  7610. function S(e, t, n) {
  7611. if (e === b && t === w && n === E) return;
  7612. var r = a(t, n);
  7613. y = e.match(r);
  7614. b = e;
  7615. w = t;
  7616. E = n
  7617. }
  7618. var e = cr.system_object.prototype;
  7619. t.prototype.EveryTick = function() {
  7620. return true
  7621. };
  7622. t.prototype.OnLayoutStart = function() {
  7623. return true
  7624. };
  7625. t.prototype.OnLayoutEnd = function() {
  7626. return true
  7627. };
  7628. t.prototype.Compare = function(e, t, n) {
  7629. return cr.do_cmp(e, t, n)
  7630. };
  7631. t.prototype.CompareTime = function(e, t) {
  7632. var n = this.runtime.kahanTime.sum;
  7633. if (e === 0) {
  7634. var r = this.runtime.getCurrentCondition();
  7635. if (!r.extra.CompareTime_executed) {
  7636. if (n >= t) {
  7637. r.extra.CompareTime_executed = true;
  7638. return true
  7639. }
  7640. }
  7641. return false
  7642. }
  7643. return cr.do_cmp(n, e, t)
  7644. };
  7645. t.prototype.LayerVisible = function(e) {
  7646. if (!e) return false;
  7647. else return e.visible
  7648. };
  7649. t.prototype.LayerCmpOpacity = function(e, t, n) {
  7650. if (!e) return false;
  7651. return cr.do_cmp(e.opacity * 100, t, n)
  7652. };
  7653. t.prototype.Repeat = function(e) {
  7654. var t = this.runtime.getCurrentEventStack();
  7655. var n = t.current_event;
  7656. var r = t.isModifierAfterCnds();
  7657. var i = this.runtime.pushLoopStack();
  7658. var s;
  7659. if (r) {
  7660. for (s = 0; s < e && !i.stopped; s++) {
  7661. this.runtime.pushCopySol(n.solModifiers);
  7662. i.index = s;
  7663. n.retrigger();
  7664. this.runtime.popSol(n.solModifiers)
  7665. }
  7666. } else {
  7667. for (s = 0; s < e && !i.stopped; s++) {
  7668. i.index = s;
  7669. n.retrigger()
  7670. }
  7671. }
  7672. this.runtime.popLoopStack();
  7673. return false
  7674. };
  7675. t.prototype.While = function(e) {
  7676. var t = this.runtime.getCurrentEventStack();
  7677. var n = t.current_event;
  7678. var r = t.isModifierAfterCnds();
  7679. var i = this.runtime.pushLoopStack();
  7680. var s;
  7681. if (r) {
  7682. for (s = 0; !i.stopped; s++) {
  7683. this.runtime.pushCopySol(n.solModifiers);
  7684. i.index = s;
  7685. if (!n.retrigger()) i.stopped = true;
  7686. this.runtime.popSol(n.solModifiers)
  7687. }
  7688. } else {
  7689. for (s = 0; !i.stopped; s++) {
  7690. i.index = s;
  7691. if (!n.retrigger()) i.stopped = true
  7692. }
  7693. }
  7694. this.runtime.popLoopStack();
  7695. return false
  7696. };
  7697. t.prototype.For = function(e, t, n) {
  7698. var r = this.runtime.getCurrentEventStack();
  7699. var i = r.current_event;
  7700. var s = r.isModifierAfterCnds();
  7701. var o = this.runtime.pushLoopStack(e);
  7702. var u;
  7703. if (n < t) {
  7704. if (s) {
  7705. for (u = t; u >= n && !o.stopped; --u) {
  7706. this.runtime.pushCopySol(i.solModifiers);
  7707. o.index = u;
  7708. i.retrigger();
  7709. this.runtime.popSol(i.solModifiers)
  7710. }
  7711. } else {
  7712. for (u = t; u >= n && !o.stopped; --u) {
  7713. o.index = u;
  7714. i.retrigger()
  7715. }
  7716. }
  7717. } else {
  7718. if (s) {
  7719. for (u = t; u <= n && !o.stopped; ++u) {
  7720. this.runtime.pushCopySol(i.solModifiers);
  7721. o.index = u;
  7722. i.retrigger();
  7723. this.runtime.popSol(i.solModifiers)
  7724. }
  7725. } else {
  7726. for (u = t; u <= n && !o.stopped; ++u) {
  7727. o.index = u;
  7728. i.retrigger()
  7729. }
  7730. }
  7731. }
  7732. this.runtime.popLoopStack();
  7733. return false
  7734. };
  7735. var n = [];
  7736. var r = -1;
  7737. t.prototype.ForEach = function(e) {
  7738. var t = e.getCurrentSol();
  7739. r++;
  7740. if (n.length === r) n.push([]);
  7741. var i = n[r];
  7742. cr.shallowAssignArray(i, t.getObjects());
  7743. var s = this.runtime.getCurrentEventStack();
  7744. var o = s.current_event;
  7745. var u = s.isModifierAfterCnds();
  7746. var a = this.runtime.pushLoopStack();
  7747. var f, l, c, h, p, d, v;
  7748. var m = e.is_contained;
  7749. if (u) {
  7750. for (f = 0, l = i.length; f < l && !a.stopped; f++) {
  7751. this.runtime.pushCopySol(o.solModifiers);
  7752. p = i[f];
  7753. t = e.getCurrentSol();
  7754. t.select_all = false;
  7755. t.instances.length = 1;
  7756. t.instances[0] = p;
  7757. if (m) {
  7758. for (c = 0, h = p.siblings.length; c < h; c++) {
  7759. d = p.siblings[c];
  7760. v = d.type.getCurrentSol();
  7761. v.select_all = false;
  7762. v.instances.length = 1;
  7763. v.instances[0] = d
  7764. }
  7765. }
  7766. a.index = f;
  7767. o.retrigger();
  7768. this.runtime.popSol(o.solModifiers)
  7769. }
  7770. } else {
  7771. t.select_all = false;
  7772. t.instances.length = 1;
  7773. for (f = 0, l = i.length; f < l && !a.stopped; f++) {
  7774. p = i[f];
  7775. t.instances[0] = p;
  7776. if (m) {
  7777. for (c = 0, h = p.siblings.length; c < h; c++) {
  7778. d = p.siblings[c];
  7779. v = d.type.getCurrentSol();
  7780. v.select_all = false;
  7781. v.instances.length = 1;
  7782. v.instances[0] = d
  7783. }
  7784. }
  7785. a.index = f;
  7786. o.retrigger()
  7787. }
  7788. }
  7789. i.length = 0;
  7790. this.runtime.popLoopStack();
  7791. r--;
  7792. return false
  7793. };
  7794. t.prototype.ForEachOrdered = function(e, t, s) {
  7795. var o = e.getCurrentSol();
  7796. r++;
  7797. if (n.length === r) n.push([]);
  7798. var u = n[r];
  7799. cr.shallowAssignArray(u, o.getObjects());
  7800. var a = this.runtime.getCurrentEventStack();
  7801. var f = a.current_event;
  7802. var l = this.runtime.getCurrentCondition();
  7803. var c = a.isModifierAfterCnds();
  7804. var h = this.runtime.pushLoopStack();
  7805. var p, d, v, m, g, y, b;
  7806. for (p = 0, d = u.length; p < d; p++) {
  7807. u[p].extra.c2_foreachordered_val = l.parameters[1].get(p)
  7808. }
  7809. u.sort(i);
  7810. if (s === 1) u.reverse();
  7811. var w = e.is_contained;
  7812. if (c) {
  7813. for (p = 0, d = u.length; p < d && !h.stopped; p++) {
  7814. this.runtime.pushCopySol(f.solModifiers);
  7815. g = u[p];
  7816. o = e.getCurrentSol();
  7817. o.select_all = false;
  7818. o.instances.length = 1;
  7819. o.instances[0] = g;
  7820. if (w) {
  7821. for (v = 0, m = g.siblings.length; v < m; v++) {
  7822. y = g.siblings[v];
  7823. b = y.type.getCurrentSol();
  7824. b.select_all = false;
  7825. b.instances.length = 1;
  7826. b.instances[0] = y
  7827. }
  7828. }
  7829. h.index = p;
  7830. f.retrigger();
  7831. this.runtime.popSol(f.solModifiers)
  7832. }
  7833. } else {
  7834. o.select_all = false;
  7835. o.instances.length = 1;
  7836. for (p = 0, d = u.length; p < d && !h.stopped; p++) {
  7837. g = u[p];
  7838. o.instances[0] = g;
  7839. if (w) {
  7840. for (v = 0, m = g.siblings.length; v < m; v++) {
  7841. y = g.siblings[v];
  7842. b = y.type.getCurrentSol();
  7843. b.select_all = false;
  7844. b.instances.length = 1;
  7845. b.instances[0] = y
  7846. }
  7847. }
  7848. h.index = p;
  7849. f.retrigger()
  7850. }
  7851. }
  7852. u.length = 0;
  7853. this.runtime.popLoopStack();
  7854. r--;
  7855. return false
  7856. };
  7857. t.prototype.PickByComparison = function(e, t, i, s) {
  7858. var o, u, a, f;
  7859. if (!e) return;
  7860. r++;
  7861. if (n.length === r) n.push([]);
  7862. var l = n[r];
  7863. var c = e.getCurrentSol();
  7864. cr.shallowAssignArray(l, c.getObjects());
  7865. if (c.select_all) c.else_instances.length = 0;
  7866. var h = this.runtime.getCurrentCondition();
  7867. for (o = 0, a = 0, u = l.length; o < u; o++) {
  7868. f = l[o];
  7869. l[a] = f;
  7870. t = h.parameters[1].get(o);
  7871. s = h.parameters[3].get(o);
  7872. if (cr.do_cmp(t, i, s)) {
  7873. a++
  7874. } else {
  7875. c.else_instances.push(f)
  7876. }
  7877. }
  7878. l.length = a;
  7879. c.select_all = false;
  7880. cr.shallowAssignArray(c.instances, l);
  7881. l.length = 0;
  7882. r--;
  7883. e.applySolToContainer();
  7884. return !!c.instances.length
  7885. };
  7886. t.prototype.PickByEvaluate = function(e, t) {
  7887. var i, s, o, u;
  7888. if (!e) return;
  7889. r++;
  7890. if (n.length === r) n.push([]);
  7891. var a = n[r];
  7892. var f = e.getCurrentSol();
  7893. cr.shallowAssignArray(a, f.getObjects());
  7894. if (f.select_all) f.else_instances.length = 0;
  7895. var l = this.runtime.getCurrentCondition();
  7896. for (i = 0, o = 0, s = a.length; i < s; i++) {
  7897. u = a[i];
  7898. a[o] = u;
  7899. t = l.parameters[1].get(i);
  7900. if (t) {
  7901. o++
  7902. } else {
  7903. f.else_instances.push(u)
  7904. }
  7905. }
  7906. a.length = o;
  7907. f.select_all = false;
  7908. cr.shallowAssignArray(f.instances, a);
  7909. a.length = 0;
  7910. r--;
  7911. e.applySolToContainer();
  7912. return !!f.instances.length
  7913. };
  7914. t.prototype.TriggerOnce = function() {
  7915. var e = this.runtime.getCurrentCondition().extra;
  7916. if (typeof e.TriggerOnce_lastTick === "undefined") e.TriggerOnce_lastTick = -1;
  7917. var t = e.TriggerOnce_lastTick;
  7918. var n = this.runtime.tickcount;
  7919. e.TriggerOnce_lastTick = n;
  7920. return this.runtime.layout_first_tick || t !== n - 1
  7921. };
  7922. t.prototype.Every = function(e) {
  7923. var t = this.runtime.getCurrentCondition();
  7924. var n = t.extra.Every_lastTime || 0;
  7925. var r = this.runtime.kahanTime.sum;
  7926. if (typeof t.extra.Every_seconds === "undefined") t.extra.Every_seconds = e;
  7927. var i = t.extra.Every_seconds;
  7928. if (r >= n + i) {
  7929. t.extra.Every_lastTime = n + i;
  7930. if (r >= t.extra.Every_lastTime + i) t.extra.Every_lastTime = r;
  7931. t.extra.Every_seconds = e;
  7932. return true
  7933. } else return false
  7934. };
  7935. t.prototype.PickNth = function(e, t) {
  7936. if (!e) return false;
  7937. var n = e.getCurrentSol();
  7938. var r = n.getObjects();
  7939. t = cr.floor(t);
  7940. if (t < 0 || t >= r.length) return false;
  7941. var i = r[t];
  7942. n.pick_one(i);
  7943. e.applySolToContainer();
  7944. return true
  7945. };
  7946. t.prototype.PickRandom = function(e) {
  7947. if (!e) return false;
  7948. var t = e.getCurrentSol();
  7949. var n = t.getObjects();
  7950. var r = cr.floor(Math.random() * n.length);
  7951. if (r >= n.length) return false;
  7952. var i = n[r];
  7953. t.pick_one(i);
  7954. e.applySolToContainer();
  7955. return true
  7956. };
  7957. t.prototype.CompareVar = function(e, t, n) {
  7958. return cr.do_cmp(e.getValue(), t, n)
  7959. };
  7960. t.prototype.IsGroupActive = function(e) {
  7961. return this.runtime.activeGroups[e.toLowerCase()]
  7962. };
  7963. t.prototype.IsPreview = function() {
  7964. return typeof cr_is_preview !== "undefined"
  7965. };
  7966. t.prototype.PickAll = function(e) {
  7967. if (!e) return false;
  7968. if (!e.instances.length) return false;
  7969. var t = e.getCurrentSol();
  7970. t.select_all = true;
  7971. e.applySolToContainer();
  7972. return true
  7973. };
  7974. t.prototype.IsMobile = function() {
  7975. return this.runtime.isMobile
  7976. };
  7977. t.prototype.CompareBetween = function(e, t, n) {
  7978. return e >= t && e <= n
  7979. };
  7980. t.prototype.Else = function() {
  7981. var e = this.runtime.getCurrentEventStack();
  7982. if (e.else_branch_ran) return false;
  7983. else return !e.last_event_true
  7984. };
  7985. t.prototype.OnLoadFinished = function() {
  7986. return true
  7987. };
  7988. t.prototype.OnCanvasSnapshot = function() {
  7989. return true
  7990. };
  7991. t.prototype.EffectsSupported = function() {
  7992. return !!this.runtime.glwrap
  7993. };
  7994. t.prototype.OnSaveComplete = function() {
  7995. return true
  7996. };
  7997. t.prototype.OnLoadComplete = function() {
  7998. return true
  7999. };
  8000. t.prototype.OnLoadFailed = function() {
  8001. return true
  8002. };
  8003. t.prototype.ObjectUIDExists = function(e) {
  8004. return !!this.runtime.getObjectByUID(e)
  8005. };
  8006. t.prototype.IsOnPlatform = function(e) {
  8007. var t = this.runtime;
  8008. switch (e) {
  8009. case 0:
  8010. return !t.isDomFree && !t.isNodeWebkit && !t.isPhoneGap && !t.isWindows8App && !t.isWindowsPhone8 && !t.isBlackberry10;
  8011. case 1:
  8012. return t.isiOS;
  8013. case 2:
  8014. return t.isAndroid;
  8015. case 3:
  8016. return t.isWindows8App;
  8017. case 4:
  8018. return t.isWindowsPhone8;
  8019. case 5:
  8020. return t.isBlackberry10;
  8021. case 6:
  8022. return t.isTizen;
  8023. case 7:
  8024. return t.isNodeWebkit;
  8025. case 8:
  8026. return t.isCocoonJs;
  8027. case 9:
  8028. return t.isPhoneGap;
  8029. case 10:
  8030. return t.isArcade;
  8031. case 11:
  8032. return t.isNodeWebkit;
  8033. default:
  8034. return false
  8035. }
  8036. };
  8037. var s = null;
  8038. var o = "";
  8039. var u = "";
  8040. t.prototype.RegexTest = function(e, t, n) {
  8041. var r = a(t, n);
  8042. return r.test(e)
  8043. };
  8044. var f = [];
  8045. t.prototype.PickOverlappingPoint = function(e, t, n) {
  8046. if (!e) return false;
  8047. var r = e.getCurrentSol();
  8048. var i = r.getObjects();
  8049. var s = this.runtime.getCurrentEventStack().current_event;
  8050. var o = s.orblock;
  8051. var u = this.runtime.getCurrentCondition();
  8052. var a, l, c, h;
  8053. if (r.select_all) {
  8054. cr.shallowAssignArray(f, i);
  8055. r.else_instances.length = 0;
  8056. r.select_all = false;
  8057. r.instances.length = 0
  8058. } else {
  8059. if (o) {
  8060. cr.shallowAssignArray(f, r.else_instances);
  8061. r.else_instances.length = 0
  8062. } else {
  8063. cr.shallowAssignArray(f, i);
  8064. r.instances.length = 0
  8065. }
  8066. }
  8067. for (a = 0, l = f.length; a < l; ++a) {
  8068. c = f[a];
  8069. h = cr.xor(c.contains_pt(t, n), u.inverted);
  8070. if (h) r.instances.push(c);
  8071. else r.else_instances.push(c)
  8072. }
  8073. e.applySolToContainer();
  8074. return cr.xor( !! r.instances.length, u.inverted)
  8075. };
  8076. e.cnds = new t;
  8077. l.prototype.GoToLayout = function(e) {
  8078. if (this.runtime.isloading) return;
  8079. if (this.runtime.changelayout) return;
  8080. this.runtime.changelayout = e
  8081. };
  8082. l.prototype.CreateObject = function(e, t, n, r) {
  8083. if (!t || !e) return;
  8084. var i = this.runtime.createInstance(e, t, n, r);
  8085. if (!i) return;
  8086. this.runtime.isInOnDestroy++;
  8087. var s, o, u;
  8088. this.runtime.trigger(Object.getPrototypeOf(e.plugin).cnds.OnCreated, i);
  8089. if (i.is_contained) {
  8090. for (s = 0, o = i.siblings.length; s < o; s++) {
  8091. u = i.siblings[s];
  8092. this.runtime.trigger(Object.getPrototypeOf(u.type.plugin).cnds.OnCreated, u)
  8093. }
  8094. }
  8095. this.runtime.isInOnDestroy--;
  8096. var a = e.getCurrentSol();
  8097. a.select_all = false;
  8098. a.instances.length = 1;
  8099. a.instances[0] = i;
  8100. if (i.is_contained) {
  8101. for (s = 0, o = i.siblings.length; s < o; s++) {
  8102. u = i.siblings[s];
  8103. a = u.type.getCurrentSol();
  8104. a.select_all = false;
  8105. a.instances.length = 1;
  8106. a.instances[0] = u
  8107. }
  8108. }
  8109. };
  8110. l.prototype.SetLayerVisible = function(e, t) {
  8111. if (!e) return;
  8112. if (e.visible !== t) {
  8113. e.visible = t;
  8114. this.runtime.redraw = true
  8115. }
  8116. };
  8117. l.prototype.SetLayerOpacity = function(e, t) {
  8118. if (!e) return;
  8119. t = cr.clamp(t / 100, 0, 1);
  8120. if (e.opacity !== t) {
  8121. e.opacity = t;
  8122. this.runtime.redraw = true
  8123. }
  8124. };
  8125. l.prototype.SetLayerScaleRate = function(e, t) {
  8126. if (!e) return;
  8127. if (e.zoomRate !== t) {
  8128. e.zoomRate = t;
  8129. this.runtime.redraw = true
  8130. }
  8131. };
  8132. l.prototype.SetLayoutScale = function(e) {
  8133. if (!this.runtime.running_layout) return;
  8134. if (this.runtime.running_layout.scale !== e) {
  8135. this.runtime.running_layout.scale = e;
  8136. this.runtime.running_layout.boundScrolling();
  8137. this.runtime.redraw = true
  8138. }
  8139. };
  8140. l.prototype.ScrollX = function(e) {
  8141. this.runtime.running_layout.scrollToX(e)
  8142. };
  8143. l.prototype.ScrollY = function(e) {
  8144. this.runtime.running_layout.scrollToY(e)
  8145. };
  8146. l.prototype.Scroll = function(e, t) {
  8147. this.runtime.running_layout.scrollToX(e);
  8148. this.runtime.running_layout.scrollToY(t)
  8149. };
  8150. l.prototype.ScrollToObject = function(e) {
  8151. var t = e.getFirstPicked();
  8152. if (t) {
  8153. this.runtime.running_layout.scrollToX(t.x);
  8154. this.runtime.running_layout.scrollToY(t.y)
  8155. }
  8156. };
  8157. l.prototype.SetVar = function(e, t) {
  8158. if (e.vartype === 0) {
  8159. if (cr.is_number(t)) e.setValue(t);
  8160. else e.setValue(parseFloat(t))
  8161. } else if (e.vartype === 1) e.setValue(t.toString())
  8162. };
  8163. l.prototype.AddVar = function(e, t) {
  8164. if (e.vartype === 0) {
  8165. if (cr.is_number(t)) e.setValue(e.getValue() + t);
  8166. else e.setValue(e.getValue() + parseFloat(t))
  8167. } else if (e.vartype === 1) e.setValue(e.getValue() + t.toString())
  8168. };
  8169. l.prototype.SubVar = function(e, t) {
  8170. if (e.vartype === 0) {
  8171. if (cr.is_number(t)) e.setValue(e.getValue() - t);
  8172. else e.setValue(e.getValue() - parseFloat(t))
  8173. }
  8174. };
  8175. l.prototype.SetGroupActive = function(e, t) {
  8176. var n = this.runtime.activeGroups;
  8177. var r = e.toLowerCase();
  8178. switch (t) {
  8179. case 0:
  8180. n[r] = false;
  8181. break;
  8182. case 1:
  8183. n[r] = true;
  8184. break;
  8185. case 2:
  8186. n[r] = !n[r];
  8187. break
  8188. }
  8189. };
  8190. l.prototype.SetTimescale = function(e) {
  8191. var t = e;
  8192. if (t < 0) t = 0;
  8193. this.runtime.timescale = t
  8194. };
  8195. l.prototype.SetObjectTimescale = function(e, t) {
  8196. var n = t;
  8197. if (n < 0) n = 0;
  8198. if (!e) return;
  8199. var r = e.getCurrentSol();
  8200. var i = r.getObjects();
  8201. var s, o;
  8202. for (s = 0, o = i.length; s < o; s++) {
  8203. i[s].my_timescale = n
  8204. }
  8205. };
  8206. l.prototype.RestoreObjectTimescale = function(e) {
  8207. if (!e) return false;
  8208. var t = e.getCurrentSol();
  8209. var n = t.getObjects();
  8210. var r, i;
  8211. for (r = 0, i = n.length; r < i; r++) {
  8212. n[r].my_timescale = -1
  8213. }
  8214. };
  8215. var c = [];
  8216. var d = [];
  8217. l.prototype.Wait = function(e) {
  8218. if (e < 0) return;
  8219. var t, n, r, i, s;
  8220. var o = this.runtime.getCurrentEventStack();
  8221. var u = h();
  8222. u.time = this.runtime.kahanTime.sum + e;
  8223. u.ev = o.current_event;
  8224. u.actindex = o.actindex + 1;
  8225. for (t = 0, n = this.runtime.types_by_index.length; t < n; t++) {
  8226. i = this.runtime.types_by_index[t];
  8227. r = i.getCurrentSol();
  8228. if (r.select_all && o.current_event.solModifiers.indexOf(i) === -1) continue;
  8229. u.solModifiers.push(i);
  8230. s = v();
  8231. s.sa = r.select_all;
  8232. cr.shallowAssignArray(s.insts, r.instances);
  8233. u.sols[t.toString()] = s
  8234. }
  8235. this.waits.push(u);
  8236. return true
  8237. };
  8238. l.prototype.SetLayerScale = function(e, t) {
  8239. if (!e) return;
  8240. if (e.scale === t) return;
  8241. e.scale = t;
  8242. this.runtime.redraw = true
  8243. };
  8244. l.prototype.ResetGlobals = function() {
  8245. var e, t, n;
  8246. for (e = 0, t = this.runtime.all_global_vars.length; e < t; e++) {
  8247. n = this.runtime.all_global_vars[e];
  8248. n.data = n.initial
  8249. }
  8250. };
  8251. l.prototype.SetLayoutAngle = function(e) {
  8252. e = cr.to_radians(e);
  8253. e = cr.clamp_angle(e);
  8254. if (this.runtime.running_layout) {
  8255. if (this.runtime.running_layout.angle !== e) {
  8256. this.runtime.running_layout.angle = e;
  8257. this.runtime.redraw = true
  8258. }
  8259. }
  8260. };
  8261. l.prototype.SetLayerAngle = function(e, t) {
  8262. if (!e) return;
  8263. t = cr.to_radians(t);
  8264. t = cr.clamp_angle(t);
  8265. if (e.angle === t) return;
  8266. e.angle = t;
  8267. this.runtime.redraw = true
  8268. };
  8269. l.prototype.SetLayerParallax = function(e, t, n) {
  8270. if (!e) return;
  8271. if (e.parallaxX === t / 100 && e.parallaxY === n / 100) return;
  8272. e.parallaxX = t / 100;
  8273. e.parallaxY = n / 100;
  8274. this.runtime.redraw = true
  8275. };
  8276. l.prototype.SetLayerBackground = function(e, t) {
  8277. if (!e) return;
  8278. var n = cr.GetRValue(t);
  8279. var r = cr.GetGValue(t);
  8280. var i = cr.GetBValue(t);
  8281. if (e.background_color[0] === n && e.background_color[1] === r && e.background_color[2] === i) return;
  8282. e.background_color[0] = n;
  8283. e.background_color[1] = r;
  8284. e.background_color[2] = i;
  8285. this.runtime.redraw = true
  8286. };
  8287. l.prototype.SetLayerTransparent = function(e, t) {
  8288. if (!e) return;
  8289. if ( !! t === !! e.transparent) return;
  8290. e.transparent = !! t;
  8291. this.runtime.redraw = true
  8292. };
  8293. l.prototype.StopLoop = function() {
  8294. if (this.runtime.loop_stack_index < 0) return;
  8295. this.runtime.getCurrentLoop().stopped = true
  8296. };
  8297. l.prototype.GoToLayoutByName = function(e) {
  8298. if (this.runtime.isloading) return;
  8299. if (this.runtime.changelayout) return;
  8300. var t;
  8301. for (t in this.runtime.layouts) {
  8302. if (this.runtime.layouts.hasOwnProperty(t) && cr.equals_nocase(t, e)) {
  8303. this.runtime.changelayout = this.runtime.layouts[t];
  8304. return
  8305. }
  8306. }
  8307. };
  8308. l.prototype.RestartLayout = function(e) {
  8309. if (this.runtime.isloading) return;
  8310. if (this.runtime.changelayout) return;
  8311. if (!this.runtime.running_layout) return;
  8312. this.runtime.changelayout = this.runtime.running_layout;
  8313. var t, n, r;
  8314. for (t = 0, n = this.runtime.allGroups.length; t < n; t++) {
  8315. r = this.runtime.allGroups[t];
  8316. this.runtime.activeGroups[r.group_name.toLowerCase()] = r.initially_activated
  8317. }
  8318. };
  8319. l.prototype.SnapshotCanvas = function(e, t) {
  8320. this.runtime.snapshotCanvas = [e === 0 ? "image/png" : "image/jpeg", t / 100];
  8321. this.runtime.redraw = true
  8322. };
  8323. l.prototype.SetCanvasSize = function(e, t) {
  8324. if (e <= 0 || t <= 0) return;
  8325. this.runtime["setSize"](e, t)
  8326. };
  8327. l.prototype.SetLayoutEffectEnabled = function(e, t) {
  8328. if (!this.runtime.running_layout || !this.runtime.glwrap) return;
  8329. var n = this.runtime.running_layout.getEffectByName(t);
  8330. if (!n) return;
  8331. var r = e === 1;
  8332. if (n.active == r) return;
  8333. n.active = r;
  8334. this.runtime.running_layout.updateActiveEffects();
  8335. this.runtime.redraw = true
  8336. };
  8337. l.prototype.SetLayerEffectEnabled = function(e, t, n) {
  8338. if (!e || !this.runtime.glwrap) return;
  8339. var r = e.getEffectByName(n);
  8340. if (!r) return;
  8341. var i = t === 1;
  8342. if (r.active == i) return;
  8343. r.active = i;
  8344. e.updateActiveEffects();
  8345. this.runtime.redraw = true
  8346. };
  8347. l.prototype.SetLayoutEffectParam = function(e, t, n) {
  8348. if (!this.runtime.running_layout || !this.runtime.glwrap) return;
  8349. var r = this.runtime.running_layout.getEffectByName(e);
  8350. if (!r) return;
  8351. var i = this.runtime.running_layout.effect_params[r.index];
  8352. t = Math.floor(t);
  8353. if (t < 0 || t >= i.length) return;
  8354. if (this.runtime.glwrap.getProgramParameterType(r.shaderindex, t) === 1) n /= 100;
  8355. if (i[t] === n) return;
  8356. i[t] = n;
  8357. if (r.active) this.runtime.redraw = true
  8358. };
  8359. l.prototype.SetLayerEffectParam = function(e, t, n, r) {
  8360. if (!e || !this.runtime.glwrap) return;
  8361. var i = e.getEffectByName(t);
  8362. if (!i) return;
  8363. var s = e.effect_params[i.index];
  8364. n = Math.floor(n);
  8365. if (n < 0 || n >= s.length) return;
  8366. if (this.runtime.glwrap.getProgramParameterType(i.shaderindex, n) === 1) r /= 100;
  8367. if (s[n] === r) return;
  8368. s[n] = r;
  8369. if (i.active) this.runtime.redraw = true
  8370. };
  8371. l.prototype.SaveState = function(e) {
  8372. this.runtime.saveToSlot = e
  8373. };
  8374. l.prototype.LoadState = function(e) {
  8375. this.runtime.loadFromSlot = e
  8376. };
  8377. l.prototype.LoadStateJSON = function(e) {
  8378. this.runtime.loadFromJson = e
  8379. };
  8380. e.acts = new l;
  8381. g.prototype["int"] = function(e, t) {
  8382. if (cr.is_string(t)) {
  8383. e.set_int(parseInt(t, 10));
  8384. if (isNaN(e.data)) e.data = 0
  8385. } else e.set_int(t)
  8386. };
  8387. g.prototype["float"] = function(e, t) {
  8388. if (cr.is_string(t)) {
  8389. e.set_float(parseFloat(t));
  8390. if (isNaN(e.data)) e.data = 0
  8391. } else e.set_float(t)
  8392. };
  8393. g.prototype.str = function(e, t) {
  8394. if (cr.is_string(t)) e.set_string(t);
  8395. else e.set_string(t.toString())
  8396. };
  8397. g.prototype.len = function(e, t) {
  8398. e.set_int(t.length || 0)
  8399. };
  8400. g.prototype.random = function(e, t, n) {
  8401. if (n === undefined) {
  8402. e.set_float(Math.random() * t)
  8403. } else {
  8404. e.set_float(Math.random() * (n - t) + t)
  8405. }
  8406. };
  8407. g.prototype.sqrt = function(e, t) {
  8408. e.set_float(Math.sqrt(t))
  8409. };
  8410. g.prototype.abs = function(e, t) {
  8411. e.set_float(Math.abs(t))
  8412. };
  8413. g.prototype.round = function(e, t) {
  8414. e.set_int(Math.round(t))
  8415. };
  8416. g.prototype.floor = function(e, t) {
  8417. e.set_int(Math.floor(t))
  8418. };
  8419. g.prototype.ceil = function(e, t) {
  8420. e.set_int(Math.ceil(t))
  8421. };
  8422. g.prototype.sin = function(e, t) {
  8423. e.set_float(Math.sin(cr.to_radians(t)))
  8424. };
  8425. g.prototype.cos = function(e, t) {
  8426. e.set_float(Math.cos(cr.to_radians(t)))
  8427. };
  8428. g.prototype.tan = function(e, t) {
  8429. e.set_float(Math.tan(cr.to_radians(t)))
  8430. };
  8431. g.prototype.asin = function(e, t) {
  8432. e.set_float(cr.to_degrees(Math.asin(t)))
  8433. };
  8434. g.prototype.acos = function(e, t) {
  8435. e.set_float(cr.to_degrees(Math.acos(t)))
  8436. };
  8437. g.prototype.atan = function(e, t) {
  8438. e.set_float(cr.to_degrees(Math.atan(t)))
  8439. };
  8440. g.prototype.exp = function(e, t) {
  8441. e.set_float(Math.exp(t))
  8442. };
  8443. g.prototype.ln = function(e, t) {
  8444. e.set_float(Math.log(t))
  8445. };
  8446. g.prototype.log10 = function(e, t) {
  8447. e.set_float(Math.log(t) / Math.LN10)
  8448. };
  8449. g.prototype.max = function(e) {
  8450. var t = arguments[1];
  8451. var n, r;
  8452. for (n = 2, r = arguments.length; n < r; n++) {
  8453. if (t < arguments[n]) t = arguments[n]
  8454. }
  8455. e.set_float(t)
  8456. };
  8457. g.prototype.min = function(e) {
  8458. var t = arguments[1];
  8459. var n, r;
  8460. for (n = 2, r = arguments.length; n < r; n++) {
  8461. if (t > arguments[n]) t = arguments[n]
  8462. }
  8463. e.set_float(t)
  8464. };
  8465. g.prototype.dt = function(e) {
  8466. e.set_float(this.runtime.dt)
  8467. };
  8468. g.prototype.timescale = function(e) {
  8469. e.set_float(this.runtime.timescale)
  8470. };
  8471. g.prototype.wallclocktime = function(e) {
  8472. e.set_float((Date.now() - this.runtime.start_time) / 1e3)
  8473. };
  8474. g.prototype.time = function(e) {
  8475. e.set_float(this.runtime.kahanTime.sum)
  8476. };
  8477. g.prototype.tickcount = function(e) {
  8478. e.set_int(this.runtime.tickcount)
  8479. };
  8480. g.prototype.objectcount = function(e) {
  8481. e.set_int(this.runtime.objectcount)
  8482. };
  8483. g.prototype.fps = function(e) {
  8484. e.set_int(this.runtime.fps)
  8485. };
  8486. g.prototype.loopindex = function(e, t) {
  8487. var n, r, i;
  8488. if (!this.runtime.loop_stack.length) {
  8489. e.set_int(0);
  8490. return
  8491. }
  8492. if (t) {
  8493. for (r = 0, i = this.runtime.loop_stack.length; r < i; r++) {
  8494. n = this.runtime.loop_stack[r];
  8495. if (n.name === t) {
  8496. e.set_int(n.index);
  8497. return
  8498. }
  8499. }
  8500. e.set_int(0)
  8501. } else {
  8502. n = this.runtime.getCurrentLoop();
  8503. e.set_int(n ? n.index : -1)
  8504. }
  8505. };
  8506. g.prototype.distance = function(e, t, n, r, i) {
  8507. e.set_float(cr.distanceTo(t, n, r, i))
  8508. };
  8509. g.prototype.angle = function(e, t, n, r, i) {
  8510. e.set_float(cr.to_degrees(cr.angleTo(t, n, r, i)))
  8511. };
  8512. g.prototype.scrollx = function(e) {
  8513. e.set_float(this.runtime.running_layout.scrollX)
  8514. };
  8515. g.prototype.scrolly = function(e) {
  8516. e.set_float(this.runtime.running_layout.scrollY)
  8517. };
  8518. g.prototype.newline = function(e) {
  8519. e.set_string("\n")
  8520. };
  8521. g.prototype.lerp = function(e, t, n, r) {
  8522. e.set_float(cr.lerp(t, n, r))
  8523. };
  8524. g.prototype.windowwidth = function(e) {
  8525. e.set_int(this.runtime.width)
  8526. };
  8527. g.prototype.windowheight = function(e) {
  8528. e.set_int(this.runtime.height)
  8529. };
  8530. g.prototype.uppercase = function(e, t) {
  8531. e.set_string(cr.is_string(t) ? t.toUpperCase() : "")
  8532. };
  8533. g.prototype.lowercase = function(e, t) {
  8534. e.set_string(cr.is_string(t) ? t.toLowerCase() : "")
  8535. };
  8536. g.prototype.clamp = function(e, t, n, r) {
  8537. if (t < n) e.set_float(n);
  8538. else if (t > r) e.set_float(r);
  8539. else e.set_float(t)
  8540. };
  8541. g.prototype.layerscale = function(e, t) {
  8542. var n = this.runtime.getLayer(t);
  8543. if (!n) e.set_float(0);
  8544. else e.set_float(n.scale)
  8545. };
  8546. g.prototype.layeropacity = function(e, t) {
  8547. var n = this.runtime.getLayer(t);
  8548. if (!n) e.set_float(0);
  8549. else e.set_float(n.opacity * 100)
  8550. };
  8551. g.prototype.layerscalerate = function(e, t) {
  8552. var n = this.runtime.getLayer(t);
  8553. if (!n) e.set_float(0);
  8554. else e.set_float(n.zoomRate)
  8555. };
  8556. g.prototype.layerparallaxx = function(e, t) {
  8557. var n = this.runtime.getLayer(t);
  8558. if (!n) e.set_float(0);
  8559. else e.set_float(n.parallaxX * 100)
  8560. };
  8561. g.prototype.layerparallaxy = function(e, t) {
  8562. var n = this.runtime.getLayer(t);
  8563. if (!n) e.set_float(0);
  8564. else e.set_float(n.parallaxY * 100)
  8565. };
  8566. g.prototype.layoutscale = function(e) {
  8567. if (this.runtime.running_layout) e.set_float(this.runtime.running_layout.scale);
  8568. else e.set_float(0)
  8569. };
  8570. g.prototype.layoutangle = function(e) {
  8571. e.set_float(cr.to_degrees(this.runtime.running_layout.angle))
  8572. };
  8573. g.prototype.layerangle = function(e, t) {
  8574. var n = this.runtime.getLayer(t);
  8575. if (!n) e.set_float(0);
  8576. else e.set_float(cr.to_degrees(n.angle))
  8577. };
  8578. g.prototype.layoutwidth = function(e) {
  8579. e.set_int(this.runtime.running_layout.width)
  8580. };
  8581. g.prototype.layoutheight = function(e) {
  8582. e.set_int(this.runtime.running_layout.height)
  8583. };
  8584. g.prototype.find = function(e, t, n) {
  8585. if (cr.is_string(t) && cr.is_string(n)) e.set_int(t.search(new RegExp(cr.regexp_escape(n), "i")));
  8586. else e.set_int(-1)
  8587. };
  8588. g.prototype.left = function(e, t, n) {
  8589. e.set_string(cr.is_string(t) ? t.substr(0, n) : "")
  8590. };
  8591. g.prototype.right = function(e, t, n) {
  8592. e.set_string(cr.is_string(t) ? t.substr(t.length - n) : "")
  8593. };
  8594. g.prototype.mid = function(e, t, n, r) {
  8595. e.set_string(cr.is_string(t) ? t.substr(n, r) : "")
  8596. };
  8597. g.prototype.tokenat = function(e, t, n, r) {
  8598. if (cr.is_string(t) && cr.is_string(r)) {
  8599. var i = t.split(r);
  8600. var s = cr.floor(n);
  8601. if (s < 0 || s >= i.length) e.set_string("");
  8602. else e.set_string(i[s])
  8603. } else e.set_string("")
  8604. };
  8605. g.prototype.tokencount = function(e, t, n) {
  8606. if (cr.is_string(t) && t.length) e.set_int(t.split(n).length);
  8607. else e.set_int(0)
  8608. };
  8609. g.prototype.replace = function(e, t, n, r) {
  8610. if (cr.is_string(t) && cr.is_string(n) && cr.is_string(r)) e.set_string(t.replace(new RegExp(cr.regexp_escape(n), "gi"), r));
  8611. else e.set_string(cr.is_string(t) ? t : "")
  8612. };
  8613. g.prototype.trim = function(e, t) {
  8614. e.set_string(cr.is_string(t) ? t.trim() : "")
  8615. };
  8616. g.prototype.pi = function(e) {
  8617. e.set_float(cr.PI)
  8618. };
  8619. g.prototype.layoutname = function(e) {
  8620. if (this.runtime.running_layout) e.set_string(this.runtime.running_layout.name);
  8621. else e.set_string("")
  8622. };
  8623. g.prototype.renderer = function(e) {
  8624. e.set_string(this.runtime.gl ? "webgl" : "canvas2d")
  8625. };
  8626. g.prototype.anglediff = function(e, t, n) {
  8627. e.set_float(cr.to_degrees(cr.angleDiff(cr.to_radians(t), cr.to_radians(n))))
  8628. };
  8629. g.prototype.choose = function(e) {
  8630. var t = cr.floor(Math.random() * (arguments.length - 1));
  8631. e.set_any(arguments[t + 1])
  8632. };
  8633. g.prototype.rgb = function(e, t, n, r) {
  8634. e.set_int(cr.RGB(t, n, r))
  8635. };
  8636. g.prototype.projectversion = function(e) {
  8637. e.set_string(this.runtime.versionstr)
  8638. };
  8639. g.prototype.anglelerp = function(e, t, n, r) {
  8640. t = cr.to_radians(t);
  8641. n = cr.to_radians(n);
  8642. var i = cr.angleDiff(t, n);
  8643. if (cr.angleClockwise(n, t)) {
  8644. e.set_float(cr.to_clamped_degrees(t + i * r))
  8645. } else {
  8646. e.set_float(cr.to_clamped_degrees(t - i * r))
  8647. }
  8648. };
  8649. g.prototype.anglerotate = function(e, t, n, r) {
  8650. t = cr.to_radians(t);
  8651. n = cr.to_radians(n);
  8652. r = cr.to_radians(r);
  8653. e.set_float(cr.to_clamped_degrees(cr.angleRotate(t, n, r)))
  8654. };
  8655. g.prototype.zeropad = function(e, t, n) {
  8656. var r = t < 0 ? "-" : "";
  8657. if (t < 0) t = -t;
  8658. var i = n - t.toString().length;
  8659. for (var s = 0; s < i; s++) r += "0";
  8660. e.set_string(r + t.toString())
  8661. };
  8662. g.prototype.cpuutilisation = function(e) {
  8663. e.set_float(this.runtime.cpuutilisation / 1e3)
  8664. };
  8665. g.prototype.viewportleft = function(e, t) {
  8666. var n = this.runtime.getLayer(t);
  8667. e.set_float(n ? n.viewLeft : 0)
  8668. };
  8669. g.prototype.viewporttop = function(e, t) {
  8670. var n = this.runtime.getLayer(t);
  8671. e.set_float(n ? n.viewTop : 0)
  8672. };
  8673. g.prototype.viewportright = function(e, t) {
  8674. var n = this.runtime.getLayer(t);
  8675. e.set_float(n ? n.viewRight : 0)
  8676. };
  8677. g.prototype.viewportbottom = function(e, t) {
  8678. var n = this.runtime.getLayer(t);
  8679. e.set_float(n ? n.viewBottom : 0)
  8680. };
  8681. g.prototype.loadingprogress = function(e) {
  8682. e.set_float(this.runtime.loadingprogress)
  8683. };
  8684. g.prototype.unlerp = function(e, t, n, r) {
  8685. e.set_float((r - t) / (n - t))
  8686. };
  8687. g.prototype.canvassnapshot = function(e) {
  8688. e.set_string(this.runtime.snapshotData)
  8689. };
  8690. g.prototype.urlencode = function(e, t) {
  8691. e.set_string(encodeURIComponent(t))
  8692. };
  8693. g.prototype.urldecode = function(e, t) {
  8694. e.set_string(decodeURIComponent(t))
  8695. };
  8696. g.prototype.canvastolayerx = function(e, t, n, r) {
  8697. var i = this.runtime.getLayer(t);
  8698. e.set_float(i ? i.canvasToLayer(n, r, true) : 0)
  8699. };
  8700. g.prototype.canvastolayery = function(e, t, n, r) {
  8701. var i = this.runtime.getLayer(t);
  8702. e.set_float(i ? i.canvasToLayer(n, r, false) : 0)
  8703. };
  8704. g.prototype.layertocanvasx = function(e, t, n, r) {
  8705. var i = this.runtime.getLayer(t);
  8706. e.set_float(i ? i.layerToCanvas(n, r, true) : 0)
  8707. };
  8708. g.prototype.layertocanvasy = function(e, t, n, r) {
  8709. var i = this.runtime.getLayer(t);
  8710. e.set_float(i ? i.layerToCanvas(n, r, false) : 0)
  8711. };
  8712. g.prototype.savestatejson = function(e) {
  8713. e.set_string(this.runtime.lastSaveJson)
  8714. };
  8715. g.prototype.imagememoryusage = function(e) {
  8716. if (this.runtime.glwrap) e.set_float(Math.round(100 * this.runtime.glwrap.estimateVRAM() / (1024 * 1024)) / 100);
  8717. else e.set_float(0)
  8718. };
  8719. g.prototype.regexsearch = function(e, t, n, r) {
  8720. var i = a(n, r);
  8721. e.set_int(t ? t.search(i) : -1)
  8722. };
  8723. g.prototype.regexreplace = function(e, t, n, r, i) {
  8724. var s = a(n, r);
  8725. e.set_string(t ? t.replace(s, i) : "")
  8726. };
  8727. var y = [];
  8728. var b = "";
  8729. var w = "";
  8730. var E = "";
  8731. g.prototype.regexmatchcount = function(e, t, n, r) {
  8732. var i = a(n, r);
  8733. S(t, n, r);
  8734. e.set_int(y ? y.length : 0)
  8735. };
  8736. g.prototype.regexmatchat = function(e, t, n, r, i) {
  8737. i = Math.floor(i);
  8738. var s = a(n, r);
  8739. S(t, n, r);
  8740. if (!y || i < 0 || i >= y.length) e.set_string("");
  8741. else e.set_string(y[i])
  8742. };
  8743. g.prototype.infinity = function(e) {
  8744. e.set_float(Infinity)
  8745. };
  8746. e.exps = new g;
  8747. e.runWaits = function() {
  8748. var e, t, n, r, i, s, o;
  8749. var u = this.runtime.getCurrentEventStack();
  8750. for (e = 0, n = this.waits.length; e < n; e++) {
  8751. r = this.waits[e];
  8752. if (r.time > this.runtime.kahanTime.sum) continue;
  8753. u.current_event = r.ev;
  8754. u.actindex = r.actindex;
  8755. u.cndindex = 0;
  8756. for (i in r.sols) {
  8757. if (r.sols.hasOwnProperty(i)) {
  8758. s = this.runtime.types_by_index[parseInt(i, 10)].getCurrentSol();
  8759. o = r.sols[i];
  8760. s.select_all = o.sa;
  8761. cr.shallowAssignArray(s.instances, o.insts);
  8762. m(o)
  8763. }
  8764. }
  8765. r.ev.resume_actions_and_subevents();
  8766. this.runtime.clearSol(r.solModifiers);
  8767. r.deleteme = true
  8768. }
  8769. for (e = 0, t = 0, n = this.waits.length; e < n; e++) {
  8770. r = this.waits[e];
  8771. this.waits[t] = r;
  8772. if (r.deleteme) p(r);
  8773. else t++
  8774. }
  8775. this.waits.length = t
  8776. }
  8777. })();
  8778. cr.add_common_aces = function(e) {
  8779. var t = e[0].prototype;
  8780. var n = e[1];
  8781. var r = e[3];
  8782. var i = e[4];
  8783. var s = e[5];
  8784. var o = e[6];
  8785. var u = e[7];
  8786. var a = e[8];
  8787. if (!t.cnds) t.cnds = {};
  8788. if (!t.acts) t.acts = {};
  8789. if (!t.exps) t.exps = {};
  8790. var f = t.cnds;
  8791. var l = t.acts;
  8792. var c = t.exps;
  8793. if (r) {
  8794. f.CompareX = function(e, t) {
  8795. return cr.do_cmp(this.x, e, t)
  8796. };
  8797. f.CompareY = function(e, t) {
  8798. return cr.do_cmp(this.y, e, t)
  8799. };
  8800. f.IsOnScreen = function() {
  8801. var e = this.layer;
  8802. this.update_bbox();
  8803. var t = this.bbox;
  8804. return !(t.right < e.viewLeft || t.bottom < e.viewTop || t.left > e.viewRight || t.top > e.viewBottom)
  8805. };
  8806. f.IsOutsideLayout = function() {
  8807. this.update_bbox();
  8808. var e = this.bbox;
  8809. var t = this.runtime.running_layout;
  8810. return e.right < 0 || e.bottom < 0 || e.left > t.width || e.top > t.height
  8811. };
  8812. f.PickDistance = function(e, t, n) {
  8813. var r = this.getCurrentSol();
  8814. var i = r.getObjects();
  8815. if (!i.length) return false;
  8816. var s = i[0];
  8817. var o = s;
  8818. var u = cr.distanceTo(s.x, s.y, t, n);
  8819. var a, f, l;
  8820. for (a = 1, f = i.length; a < f; a++) {
  8821. s = i[a];
  8822. l = cr.distanceTo(s.x, s.y, t, n);
  8823. if (e === 0 && l < u || e === 1 && l > u) {
  8824. u = l;
  8825. o = s
  8826. }
  8827. }
  8828. r.pick_one(o);
  8829. return true
  8830. };
  8831. l.SetX = function(e) {
  8832. if (this.x !== e) {
  8833. this.x = e;
  8834. this.set_bbox_changed()
  8835. }
  8836. };
  8837. l.SetY = function(e) {
  8838. if (this.y !== e) {
  8839. this.y = e;
  8840. this.set_bbox_changed()
  8841. }
  8842. };
  8843. l.SetPos = function(e, t) {
  8844. if (this.x !== e || this.y !== t) {
  8845. this.x = e;
  8846. this.y = t;
  8847. this.set_bbox_changed()
  8848. }
  8849. };
  8850. l.SetPosToObject = function(e, t) {
  8851. var n = e.getPairedInstance(this);
  8852. if (!n) return;
  8853. var r, i;
  8854. if (n.getImagePoint) {
  8855. r = n.getImagePoint(t, true);
  8856. i = n.getImagePoint(t, false)
  8857. } else {
  8858. r = n.x;
  8859. i = n.y
  8860. }
  8861. if (this.x !== r || this.y !== i) {
  8862. this.x = r;
  8863. this.y = i;
  8864. this.set_bbox_changed()
  8865. }
  8866. };
  8867. l.MoveForward = function(e) {
  8868. if (e !== 0) {
  8869. this.x += Math.cos(this.angle) * e;
  8870. this.y += Math.sin(this.angle) * e;
  8871. this.set_bbox_changed()
  8872. }
  8873. };
  8874. l.MoveAtAngle = function(e, t) {
  8875. if (t !== 0) {
  8876. this.x += Math.cos(cr.to_radians(e)) * t;
  8877. this.y += Math.sin(cr.to_radians(e)) * t;
  8878. this.set_bbox_changed()
  8879. }
  8880. };
  8881. c.X = function(e) {
  8882. e.set_float(this.x)
  8883. };
  8884. c.Y = function(e) {
  8885. e.set_float(this.y)
  8886. };
  8887. c.dt = function(e) {
  8888. e.set_float(this.runtime.getDt(this))
  8889. }
  8890. }
  8891. if (i) {
  8892. f.CompareWidth = function(e, t) {
  8893. return cr.do_cmp(this.width, e, t)
  8894. };
  8895. f.CompareHeight = function(e, t) {
  8896. return cr.do_cmp(this.height, e, t)
  8897. };
  8898. l.SetWidth = function(e) {
  8899. if (this.width !== e) {
  8900. this.width = e;
  8901. this.set_bbox_changed()
  8902. }
  8903. };
  8904. l.SetHeight = function(e) {
  8905. if (this.height !== e) {
  8906. this.height = e;
  8907. this.set_bbox_changed()
  8908. }
  8909. };
  8910. l.SetSize = function(e, t) {
  8911. if (this.width !== e || this.height !== t) {
  8912. this.width = e;
  8913. this.height = t;
  8914. this.set_bbox_changed()
  8915. }
  8916. };
  8917. c.Width = function(e) {
  8918. e.set_float(this.width)
  8919. };
  8920. c.Height = function(e) {
  8921. e.set_float(this.height)
  8922. };
  8923. c.BBoxLeft = function(e) {
  8924. this.update_bbox();
  8925. e.set_float(this.bbox.left)
  8926. };
  8927. c.BBoxTop = function(e) {
  8928. this.update_bbox();
  8929. e.set_float(this.bbox.top)
  8930. };
  8931. c.BBoxRight = function(e) {
  8932. this.update_bbox();
  8933. e.set_float(this.bbox.right)
  8934. };
  8935. c.BBoxBottom = function(e) {
  8936. this.update_bbox();
  8937. e.set_float(this.bbox.bottom)
  8938. }
  8939. }
  8940. if (s) {
  8941. f.AngleWithin = function(e, t) {
  8942. return cr.angleDiff(this.angle, cr.to_radians(t)) <= cr.to_radians(e)
  8943. };
  8944. f.IsClockwiseFrom = function(e) {
  8945. return cr.angleClockwise(this.angle, cr.to_radians(e))
  8946. };
  8947. f.IsBetweenAngles = function(e, t) {
  8948. var n = cr.to_clamped_radians(e);
  8949. var r = cr.to_clamped_radians(t);
  8950. var i = cr.clamp_angle(this.angle);
  8951. var s = !cr.angleClockwise(r, n);
  8952. if (s) return !(!cr.angleClockwise(i, n) && cr.angleClockwise(i, r));
  8953. else return cr.angleClockwise(i, n) && !cr.angleClockwise(i, r)
  8954. };
  8955. l.SetAngle = function(e) {
  8956. var t = cr.to_radians(cr.clamp_angle_degrees(e));
  8957. if (isNaN(t)) return;
  8958. if (this.angle !== t) {
  8959. this.angle = t;
  8960. this.set_bbox_changed()
  8961. }
  8962. };
  8963. l.RotateClockwise = function(e) {
  8964. if (e !== 0 && !isNaN(e)) {
  8965. this.angle += cr.to_radians(e);
  8966. this.angle = cr.clamp_angle(this.angle);
  8967. this.set_bbox_changed()
  8968. }
  8969. };
  8970. l.RotateCounterclockwise = function(e) {
  8971. if (e !== 0 && !isNaN(e)) {
  8972. this.angle -= cr.to_radians(e);
  8973. this.angle = cr.clamp_angle(this.angle);
  8974. this.set_bbox_changed()
  8975. }
  8976. };
  8977. l.RotateTowardAngle = function(e, t) {
  8978. var n = cr.angleRotate(this.angle, cr.to_radians(t), cr.to_radians(e));
  8979. if (isNaN(n)) return;
  8980. if (this.angle !== n) {
  8981. this.angle = n;
  8982. this.set_bbox_changed()
  8983. }
  8984. };
  8985. l.RotateTowardPosition = function(e, t, n) {
  8986. var r = t - this.x;
  8987. var i = n - this.y;
  8988. var s = Math.atan2(i, r);
  8989. var o = cr.angleRotate(this.angle, s, cr.to_radians(e));
  8990. if (isNaN(o)) return;
  8991. if (this.angle !== o) {
  8992. this.angle = o;
  8993. this.set_bbox_changed()
  8994. }
  8995. };
  8996. l.SetTowardPosition = function(e, t) {
  8997. var n = e - this.x;
  8998. var r = t - this.y;
  8999. var i = Math.atan2(r, n);
  9000. if (isNaN(i)) return;
  9001. if (this.angle !== i) {
  9002. this.angle = i;
  9003. this.set_bbox_changed()
  9004. }
  9005. };
  9006. c.Angle = function(e) {
  9007. e.set_float(cr.to_clamped_degrees(this.angle))
  9008. }
  9009. }
  9010. if (!n) {
  9011. f.CompareInstanceVar = function(e, t, n) {
  9012. return cr.do_cmp(this.instance_vars[e], t, n)
  9013. };
  9014. f.IsBoolInstanceVarSet = function(e) {
  9015. return this.instance_vars[e]
  9016. };
  9017. f.PickInstVarHiLow = function(e, t) {
  9018. var n = this.getCurrentSol();
  9019. var r = n.getObjects();
  9020. if (!r.length) return false;
  9021. var i = r[0];
  9022. var s = i;
  9023. var o = i.instance_vars[t];
  9024. var u, a, f;
  9025. for (u = 1, a = r.length; u < a; u++) {
  9026. i = r[u];
  9027. f = i.instance_vars[t];
  9028. if (e === 0 && f < o || e === 1 && f > o) {
  9029. o = f;
  9030. s = i
  9031. }
  9032. }
  9033. n.pick_one(s);
  9034. return true
  9035. };
  9036. f.PickByUID = function(e) {
  9037. var t, n, r, i, s, o, u;
  9038. var a = this.runtime.getCurrentCondition();
  9039. if (a.inverted) {
  9040. u = this.getCurrentSol();
  9041. if (u.select_all) {
  9042. u.select_all = false;
  9043. u.instances.length = 0;
  9044. u.else_instances.length = 0;
  9045. o = this.instances;
  9046. for (t = 0, n = o.length; t < n; t++) {
  9047. i = o[t];
  9048. if (i.uid === e) u.else_instances.push(i);
  9049. else u.instances.push(i)
  9050. }
  9051. return !!u.instances.length
  9052. } else {
  9053. for (t = 0, r = 0, n = u.instances.length; t < n; t++) {
  9054. i = u.instances[t];
  9055. u.instances[r] = i;
  9056. if (i.uid === e) {
  9057. u.else_instances.push(i)
  9058. } else r++
  9059. }
  9060. u.instances.length = r;
  9061. return !!u.instances.length
  9062. }
  9063. } else {
  9064. i = this.runtime.getObjectByUID(e);
  9065. if (!i) return false;
  9066. u = this.getCurrentSol();
  9067. if (!u.select_all && u.instances.indexOf(i) === -1) return false;
  9068. if (this.is_family) {
  9069. s = i.type.families;
  9070. for (t = 0, n = s.length; t < n; t++) {
  9071. if (s[t] === this) {
  9072. u.pick_one(i);
  9073. return true
  9074. }
  9075. }
  9076. } else if (i.type === this) {
  9077. u.pick_one(i);
  9078. return true
  9079. }
  9080. return false
  9081. }
  9082. };
  9083. f.OnCreated = function() {
  9084. return true
  9085. };
  9086. f.OnDestroyed = function() {
  9087. return true
  9088. };
  9089. l.SetInstanceVar = function(e, t) {
  9090. var n = this.instance_vars;
  9091. if (cr.is_number(n[e])) {
  9092. if (cr.is_number(t)) n[e] = t;
  9093. else n[e] = parseFloat(t)
  9094. } else if (cr.is_string(n[e])) {
  9095. if (cr.is_string(t)) n[e] = t;
  9096. else n[e] = t.toString()
  9097. } else;
  9098. };
  9099. l.AddInstanceVar = function(e, t) {
  9100. var n = this.instance_vars;
  9101. if (cr.is_number(n[e])) {
  9102. if (cr.is_number(t)) n[e] += t;
  9103. else n[e] += parseFloat(t)
  9104. } else if (cr.is_string(n[e])) {
  9105. if (cr.is_string(t)) n[e] += t;
  9106. else n[e] += t.toString()
  9107. } else;
  9108. };
  9109. l.SubInstanceVar = function(e, t) {
  9110. var n = this.instance_vars;
  9111. if (cr.is_number(n[e])) {
  9112. if (cr.is_number(t)) n[e] -= t;
  9113. else n[e] -= parseFloat(t)
  9114. } else;
  9115. };
  9116. l.SetBoolInstanceVar = function(e, t) {
  9117. this.instance_vars[e] = t ? 1 : 0
  9118. };
  9119. l.ToggleBoolInstanceVar = function(e) {
  9120. this.instance_vars[e] = 1 - this.instance_vars[e]
  9121. };
  9122. l.Destroy = function() {
  9123. this.runtime.DestroyInstance(this)
  9124. };
  9125. c.Count = function(e) {
  9126. var t = e.object_class.instances.length;
  9127. var n, r, i;
  9128. for (n = 0, r = this.runtime.createRow.length; n < r; n++) {
  9129. i = this.runtime.createRow[n];
  9130. if (e.object_class.is_family) {
  9131. if (i.type.families.indexOf(e.object_class) >= 0) t++
  9132. } else {
  9133. if (i.type === e.object_class) t++
  9134. }
  9135. }
  9136. e.set_int(t)
  9137. };
  9138. c.PickedCount = function(e) {
  9139. e.set_int(e.object_class.getCurrentSol().getObjects().length)
  9140. };
  9141. c.UID = function(e) {
  9142. e.set_int(this.uid)
  9143. };
  9144. c.IID = function(e) {
  9145. e.set_int(this.get_iid())
  9146. }
  9147. }
  9148. if (o) {
  9149. f.IsVisible = function() {
  9150. return this.visible
  9151. };
  9152. l.SetVisible = function(e) {
  9153. if (!e !== !this.visible) {
  9154. this.visible = e;
  9155. this.runtime.redraw = true
  9156. }
  9157. };
  9158. f.CompareOpacity = function(e, t) {
  9159. return cr.do_cmp(cr.round6dp(this.opacity * 100), e, t)
  9160. };
  9161. l.SetOpacity = function(e) {
  9162. var t = e / 100;
  9163. if (t < 0) t = 0;
  9164. else if (t > 1) t = 1;
  9165. if (t !== this.opacity) {
  9166. this.opacity = t;
  9167. this.runtime.redraw = true
  9168. }
  9169. };
  9170. c.Opacity = function(e) {
  9171. e.set_float(cr.round6dp(this.opacity * 100))
  9172. }
  9173. }
  9174. if (u) {
  9175. f.IsOnLayer = function(e) {
  9176. if (!e) return false;
  9177. return this.layer === e
  9178. };
  9179. f.PickTopBottom = function(e) {
  9180. var t = this.getCurrentSol();
  9181. var n = t.getObjects();
  9182. if (!n.length) return false;
  9183. var r = n[0];
  9184. var i = r;
  9185. var s, o;
  9186. for (s = 1, o = n.length; s < o; s++) {
  9187. r = n[s];
  9188. if (e === 0) {
  9189. if (r.layer.index > i.layer.index || r.layer.index === i.layer.index && r.get_zindex() > i.get_zindex()) {
  9190. i = r
  9191. }
  9192. } else {
  9193. if (r.layer.index < i.layer.index || r.layer.index === i.layer.index && r.get_zindex() < i.get_zindex()) {
  9194. i = r
  9195. }
  9196. }
  9197. }
  9198. t.pick_one(i);
  9199. return true
  9200. };
  9201. l.MoveToTop = function() {
  9202. var e = this.get_zindex();
  9203. if (e === this.layer.instances.length - 1) return;
  9204. cr.arrayRemove(this.layer.instances, e);
  9205. this.layer.instances.push(this);
  9206. this.runtime.redraw = true;
  9207. this.layer.zindices_stale = true
  9208. };
  9209. l.MoveToBottom = function() {
  9210. var e = this.get_zindex();
  9211. if (e === 0) return;
  9212. cr.arrayRemove(this.layer.instances, e);
  9213. this.layer.instances.unshift(this);
  9214. this.runtime.redraw = true;
  9215. this.layer.zindices_stale = true
  9216. };
  9217. l.MoveToLayer = function(e) {
  9218. if (!e || e == this.layer) return;
  9219. cr.arrayRemove(this.layer.instances, this.get_zindex());
  9220. this.layer.zindices_stale = true;
  9221. this.layer = e;
  9222. this.zindex = e.instances.length;
  9223. e.instances.push(this);
  9224. this.runtime.redraw = true
  9225. };
  9226. l.ZMoveToObject = function(e, t) {
  9227. var n = e === 0;
  9228. if (!t) return;
  9229. var r = t.getFirstPicked(this);
  9230. if (!r || r.uid === this.uid) return;
  9231. if (this.layer.index !== r.layer.index) {
  9232. cr.arrayRemove(this.layer.instances, this.get_zindex());
  9233. this.layer.zindices_stale = true;
  9234. this.layer = r.layer;
  9235. this.zindex = r.layer.instances.length;
  9236. r.layer.instances.push(this)
  9237. }
  9238. var i = this.get_zindex();
  9239. var s = r.get_zindex();
  9240. cr.arrayRemove(this.layer.instances, i);
  9241. if (i < s) s--;
  9242. if (n) s++;
  9243. if (s === this.layer.instances.length) this.layer.instances.push(this);
  9244. else this.layer.instances.splice(s, 0, this);
  9245. this.layer.zindices_stale = true;
  9246. this.runtime.redraw = true
  9247. };
  9248. c.LayerNumber = function(e) {
  9249. e.set_int(this.layer.number)
  9250. };
  9251. c.LayerName = function(e) {
  9252. e.set_string(this.layer.name)
  9253. };
  9254. c.ZIndex = function(e) {
  9255. e.set_int(this.get_zindex())
  9256. }
  9257. }
  9258. if (a) {
  9259. l.SetEffectEnabled = function(e, t) {
  9260. if (!this.runtime.glwrap) return;
  9261. var n = this.type.getEffectIndexByName(t);
  9262. if (n < 0) return;
  9263. var r = e === 1;
  9264. if (this.active_effect_flags[n] === r) return;
  9265. this.active_effect_flags[n] = r;
  9266. this.updateActiveEffects();
  9267. this.runtime.redraw = true
  9268. };
  9269. l.SetEffectParam = function(e, t, n) {
  9270. if (!this.runtime.glwrap) return;
  9271. var r = this.type.getEffectIndexByName(e);
  9272. if (r < 0) return;
  9273. var i = this.type.effect_types[r];
  9274. var s = this.effect_params[r];
  9275. t = Math.floor(t);
  9276. if (t < 0 || t >= s.length) return;
  9277. if (this.runtime.glwrap.getProgramParameterType(i.shaderindex, t) === 1) n /= 100;
  9278. if (s[t] === n) return;
  9279. s[t] = n;
  9280. if (i.active) this.runtime.redraw = true
  9281. }
  9282. }
  9283. };
  9284. cr.set_bbox_changed = function() {
  9285. this.bbox_changed = true;
  9286. this.runtime.redraw = true;
  9287. var e, t;
  9288. for (e = 0, t = this.bbox_changed_callbacks.length; e < t; e++) {
  9289. this.bbox_changed_callbacks[e](this)
  9290. }
  9291. };
  9292. cr.add_bbox_changed_callback = function(e) {
  9293. if (e) this.bbox_changed_callbacks.push(e)
  9294. };
  9295. cr.update_bbox = function() {
  9296. if (!this.bbox_changed) return;
  9297. this.bbox.set(this.x, this.y, this.x + this.width, this.y + this.height);
  9298. this.bbox.offset(-this.hotspotX * this.width, -this.hotspotY * this.height);
  9299. if (!this.angle) {
  9300. this.bquad.set_from_rect(this.bbox)
  9301. } else {
  9302. this.bbox.offset(-this.x, -this.y);
  9303. this.bquad.set_from_rotated_rect(this.bbox, this.angle);
  9304. this.bquad.offset(this.x, this.y);
  9305. this.bquad.bounding_box(this.bbox)
  9306. }
  9307. var e = 0;
  9308. if (this.bbox.left > this.bbox.right) {
  9309. e = this.bbox.left;
  9310. this.bbox.left = this.bbox.right;
  9311. this.bbox.right = e
  9312. }
  9313. if (this.bbox.top > this.bbox.bottom) {
  9314. e = this.bbox.top;
  9315. this.bbox.top = this.bbox.bottom;
  9316. this.bbox.bottom = e
  9317. }
  9318. this.bbox_changed = false
  9319. };
  9320. cr.inst_contains_pt = function(e, t) {
  9321. if (!this.bbox.contains_pt(e, t)) return false;
  9322. if (!this.bquad.contains_pt(e, t)) return false;
  9323. if (this.collision_poly && !this.collision_poly.is_empty()) {
  9324. this.collision_poly.cache_poly(this.width, this.height, this.angle);
  9325. return this.collision_poly.contains_pt(e - this.x, t - this.y)
  9326. } else return true
  9327. };
  9328. cr.inst_get_iid = function() {
  9329. this.type.updateIIDs();
  9330. return this.iid
  9331. };
  9332. cr.inst_get_zindex = function() {
  9333. this.layer.updateZIndices();
  9334. return this.zindex
  9335. };
  9336. cr.inst_updateActiveEffects = function() {
  9337. this.active_effect_types.length = 0;
  9338. var e, t, n, r;
  9339. for (e = 0, t = this.active_effect_flags.length; e < t; e++) {
  9340. if (this.active_effect_flags[e]) this.active_effect_types.push(this.type.effect_types[e])
  9341. }
  9342. this.uses_shaders = !! this.active_effect_types.length
  9343. };
  9344. cr.inst_toString = function() {
  9345. return "Inst" + this.puid
  9346. };
  9347. cr.type_getFirstPicked = function(e) {
  9348. if (e && e.is_contained && e.type != this) {
  9349. var t, n, r;
  9350. for (t = 0, n = e.siblings.length; t < n; t++) {
  9351. r = e.siblings[t];
  9352. if (r.type == this) return r
  9353. }
  9354. }
  9355. var i = this.getCurrentSol().getObjects();
  9356. if (i.length) return i[0];
  9357. else return null
  9358. };
  9359. cr.type_getPairedInstance = function(e) {
  9360. var t = this.getCurrentSol().getObjects();
  9361. if (t.length) return t[e.get_iid() % t.length];
  9362. else return null
  9363. };
  9364. cr.type_updateIIDs = function() {
  9365. if (!this.stale_iids || this.is_family) return;
  9366. var e, t;
  9367. for (e = 0, t = this.instances.length; e < t; e++) this.instances[e].iid = e;
  9368. var n = e;
  9369. var r = this.runtime.createRow;
  9370. for (e = 0, t = r.length; e < t; ++e) {
  9371. if (r[e].type === this) r[e].iid = n++
  9372. }
  9373. this.stale_iids = false
  9374. };
  9375. cr.type_getCurrentSol = function() {
  9376. return this.solstack[this.cur_sol]
  9377. };
  9378. cr.type_pushCleanSol = function() {
  9379. this.cur_sol++;
  9380. if (this.cur_sol === this.solstack.length) this.solstack.push(new cr.selection(this));
  9381. else this.solstack[this.cur_sol].select_all = true
  9382. };
  9383. cr.type_pushCopySol = function() {
  9384. this.cur_sol++;
  9385. if (this.cur_sol === this.solstack.length) this.solstack.push(new cr.selection(this));
  9386. var e = this.solstack[this.cur_sol];
  9387. var t = this.solstack[this.cur_sol - 1];
  9388. if (t.select_all) e.select_all = true;
  9389. else {
  9390. e.select_all = false;
  9391. cr.shallowAssignArray(e.instances, t.instances);
  9392. cr.shallowAssignArray(e.else_instances, t.else_instances)
  9393. }
  9394. };
  9395. cr.type_popSol = function() {
  9396. this.cur_sol--
  9397. };
  9398. cr.type_getBehaviorByName = function(e) {
  9399. var t, n, r, i, s, o = 0;
  9400. if (!this.is_family) {
  9401. for (t = 0, n = this.families.length; t < n; t++) {
  9402. s = this.families[t];
  9403. for (r = 0, i = s.behaviors.length; r < i; r++) {
  9404. if (e === s.behaviors[r].name) {
  9405. this.extra.lastBehIndex = o;
  9406. return s.behaviors[r]
  9407. }
  9408. o++
  9409. }
  9410. }
  9411. }
  9412. for (t = 0, n = this.behaviors.length; t < n; t++) {
  9413. if (e === this.behaviors[t].name) {
  9414. this.extra.lastBehIndex = o;
  9415. return this.behaviors[t]
  9416. }
  9417. o++
  9418. }
  9419. return null
  9420. };
  9421. cr.type_getBehaviorIndexByName = function(e) {
  9422. var t = this.getBehaviorByName(e);
  9423. if (t) return this.extra.lastBehIndex;
  9424. else return -1
  9425. };
  9426. cr.type_getEffectIndexByName = function(e) {
  9427. var t, n;
  9428. for (t = 0, n = this.effect_types.length; t < n; t++) {
  9429. if (this.effect_types[t].name === e) return t
  9430. }
  9431. return -1
  9432. };
  9433. cr.type_applySolToContainer = function() {
  9434. if (!this.is_contained || this.is_family) return;
  9435. var e, t, n, r, i, s, o;
  9436. this.updateIIDs();
  9437. s = this.getCurrentSol();
  9438. var u = s.select_all;
  9439. var a = this.runtime.getCurrentEventStack();
  9440. var f = a && a.current_event && a.current_event.orblock;
  9441. for (e = 0, t = this.container.length; e < t; e++) {
  9442. i = this.container[e];
  9443. if (i === this) continue;
  9444. i.updateIIDs();
  9445. o = i.getCurrentSol();
  9446. o.select_all = u;
  9447. if (!u) {
  9448. o.instances.length = s.instances.length;
  9449. for (n = 0, r = s.instances.length; n < r; n++) o.instances[n] = i.instances[s.instances[n].iid];
  9450. if (f) {
  9451. o.else_instances.length = s.else_instances.length;
  9452. for (n = 0, r = s.else_instances.length; n < r; n++) o.else_instances[n] = i.instances[s.else_instances[n].iid]
  9453. }
  9454. }
  9455. }
  9456. };
  9457. cr.type_toString = function() {
  9458. return "Type" + this.sid
  9459. };
  9460. cr.do_cmp = function(e, t, n) {
  9461. if (typeof e === "undefined" || typeof n === "undefined") return false;
  9462. switch (t) {
  9463. case 0:
  9464. return e === n;
  9465. case 1:
  9466. return e !== n;
  9467. case 2:
  9468. return e < n;
  9469. case 3:
  9470. return e <= n;
  9471. case 4:
  9472. return e > n;
  9473. case 5:
  9474. return e >= n;
  9475. default:
  9476. return false
  9477. }
  9478. };
  9479. cr.shaders = {};
  9480. cr.plugins_.Browser = function(e) {
  9481. this.runtime = e
  9482. };
  9483. (function() {
  9484. function Cnds() {}
  9485. function Acts() {}
  9486. function onFullscreenError() {
  9487. if (typeof jQuery !== "undefined") {
  9488. crruntime["setSize"](jQuery(window).width(), jQuery(window).height())
  9489. }
  9490. }
  9491. function Exps() {}
  9492. var pluginProto = cr.plugins_.Browser.prototype;
  9493. pluginProto.Type = function(e) {
  9494. this.plugin = e;
  9495. this.runtime = e.runtime
  9496. };
  9497. var typeProto = pluginProto.Type.prototype;
  9498. typeProto.onCreate = function() {};
  9499. pluginProto.Instance = function(e) {
  9500. this.type = e;
  9501. this.runtime = e.runtime
  9502. };
  9503. var instanceProto = pluginProto.Instance.prototype;
  9504. instanceProto.onCreate = function() {
  9505. var e = this;
  9506. window.addEventListener("resize", function() {
  9507. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnResize, e)
  9508. });
  9509. if (typeof navigator.onLine !== "undefined") {
  9510. window.addEventListener("online", function() {
  9511. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnOnline, e)
  9512. });
  9513. window.addEventListener("offline", function() {
  9514. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnOffline, e)
  9515. })
  9516. }
  9517. if (typeof window.applicationCache !== "undefined") {
  9518. window.applicationCache.addEventListener("updateready", function() {
  9519. e.runtime.loadingprogress = 1;
  9520. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnUpdateReady, e)
  9521. });
  9522. window.applicationCache.addEventListener("progress", function(t) {
  9523. e.runtime.loadingprogress = t["loaded"] / t["total"]
  9524. })
  9525. }
  9526. if (!this.runtime.isDirectCanvas) {
  9527. document.addEventListener("appMobi.device.update.available", function() {
  9528. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnUpdateReady, e)
  9529. });
  9530. document.addEventListener("menubutton", function() {
  9531. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnMenuButton, e)
  9532. });
  9533. document.addEventListener("searchbutton", function() {
  9534. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnSearchButton, e)
  9535. });
  9536. document.addEventListener("tizenhwkey", function(t) {
  9537. var n;
  9538. switch (t["keyName"]) {
  9539. case "back":
  9540. n = e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnBackButton, e);
  9541. if (!n) {
  9542. if (window["tizen"]) window["tizen"]["application"]["getCurrentApplication"]()["exit"]()
  9543. }
  9544. break;
  9545. case "menu":
  9546. n = e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnMenuButton, e);
  9547. if (!n) t.preventDefault();
  9548. break
  9549. }
  9550. })
  9551. }
  9552. this.runtime.addSuspendCallback(function(t) {
  9553. if (t) {
  9554. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnPageHidden, e)
  9555. } else {
  9556. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnPageVisible, e)
  9557. }
  9558. });
  9559. this.is_arcade = typeof window["is_scirra_arcade"] !== "undefined";
  9560. this.fullscreenOldMarginCss = ""
  9561. };
  9562. Cnds.prototype.CookiesEnabled = function() {
  9563. return navigator ? navigator.cookieEnabled : false
  9564. };
  9565. Cnds.prototype.IsOnline = function() {
  9566. return navigator ? navigator.onLine : false
  9567. };
  9568. Cnds.prototype.HasJava = function() {
  9569. return navigator ? navigator.javaEnabled() : false
  9570. };
  9571. Cnds.prototype.OnOnline = function() {
  9572. return true
  9573. };
  9574. Cnds.prototype.OnOffline = function() {
  9575. return true
  9576. };
  9577. Cnds.prototype.IsDownloadingUpdate = function() {
  9578. if (typeof window["applicationCache"] === "undefined") return false;
  9579. else return window["applicationCache"]["status"] === window["applicationCache"]["DOWNLOADING"]
  9580. };
  9581. Cnds.prototype.OnUpdateReady = function() {
  9582. return true
  9583. };
  9584. Cnds.prototype.PageVisible = function() {
  9585. return !this.runtime.isSuspended
  9586. };
  9587. Cnds.prototype.OnPageVisible = function() {
  9588. return true
  9589. };
  9590. Cnds.prototype.OnPageHidden = function() {
  9591. return true
  9592. };
  9593. Cnds.prototype.OnResize = function() {
  9594. return true
  9595. };
  9596. Cnds.prototype.IsFullscreen = function() {
  9597. return !!(document["mozFullScreen"] || document["webkitIsFullScreen"] || document["fullScreen"] || this.runtime.isNodeFullscreen)
  9598. };
  9599. Cnds.prototype.OnBackButton = function() {
  9600. return true
  9601. };
  9602. Cnds.prototype.OnMenuButton = function() {
  9603. return true
  9604. };
  9605. Cnds.prototype.OnSearchButton = function() {
  9606. return true
  9607. };
  9608. Cnds.prototype.IsMetered = function() {
  9609. var e = navigator["connection"] || navigator["mozConnection"] || navigator["webkitConnection"];
  9610. if (!e) return false;
  9611. return e["metered"]
  9612. };
  9613. Cnds.prototype.IsCharging = function() {
  9614. var e = navigator["battery"] || navigator["mozBattery"] || navigator["webkitBattery"];
  9615. if (!e) return true;
  9616. return e["charging"]
  9617. };
  9618. Cnds.prototype.IsPortraitLandscape = function(e) {
  9619. var t = window.innerWidth <= window.innerHeight ? 0 : 1;
  9620. return t === e
  9621. };
  9622. pluginProto.cnds = new Cnds;
  9623. Acts.prototype.Alert = function(e) {
  9624. if (!this.runtime.isDomFree) alert(e.toString())
  9625. };
  9626. Acts.prototype.Close = function() {
  9627. if (this.runtime.isCocoonJs) CocoonJS["App"]["forceToFinish"]();
  9628. else if (!this.is_arcade && !this.runtime.isDomFree) window.close()
  9629. };
  9630. Acts.prototype.Focus = function() {
  9631. if (this.runtime.isNodeWebkit) {
  9632. var e = window["nwgui"]["Window"]["get"]();
  9633. e["focus"]()
  9634. } else if (!this.is_arcade && !this.runtime.isDomFree) window.focus()
  9635. };
  9636. Acts.prototype.Blur = function() {
  9637. if (this.runtime.isNodeWebkit) {
  9638. var e = window["nwgui"]["Window"]["get"]();
  9639. e["blur"]()
  9640. } else if (!this.is_arcade && !this.runtime.isDomFree) window.blur()
  9641. };
  9642. Acts.prototype.GoBack = function() {
  9643. if (!this.is_arcade && !this.runtime.isDomFree && window.back) window.back()
  9644. };
  9645. Acts.prototype.GoForward = function() {
  9646. if (!this.is_arcade && !this.runtime.isDomFree && window.forward) window.forward()
  9647. };
  9648. Acts.prototype.GoHome = function() {
  9649. if (!this.is_arcade && !this.runtime.isDomFree && window.home) window.home()
  9650. };
  9651. Acts.prototype.GoToURL = function(e) {
  9652. if (this.runtime.isCocoonJs) CocoonJS["App"]["openURL"](e);
  9653. else if (!this.is_arcade && !this.runtime.isDomFree) window.location = e
  9654. };
  9655. Acts.prototype.GoToURLWindow = function(e, t) {
  9656. if (this.runtime.isCocoonJs) CocoonJS["App"]["openURL"](e);
  9657. else if (!this.is_arcade && !this.runtime.isDomFree) window.open(e, t)
  9658. };
  9659. Acts.prototype.Reload = function() {
  9660. if (!this.is_arcade && !this.runtime.isDomFree) window.location.reload()
  9661. };
  9662. var firstRequestFullscreen = true;
  9663. var crruntime = null;
  9664. Acts.prototype.RequestFullScreen = function(e) {
  9665. if (this.runtime.isDomFree) {
  9666. cr.logexport("[Construct 2] Requesting fullscreen is not supported on this platform - the request has been ignored");
  9667. return
  9668. }
  9669. if (e >= 2) e += 1;
  9670. if (e === 6) e = 2;
  9671. if (this.runtime.isNodeWebkit) {
  9672. if (!this.runtime.isNodeFullscreen) {
  9673. window["nwgui"]["Window"]["get"]()["enterFullscreen"]();
  9674. this.runtime.isNodeFullscreen = true
  9675. }
  9676. } else {
  9677. if (document["mozFullScreen"] || document["webkitIsFullScreen"] || !! document["msFullscreenElement"] || document["fullScreen"]) {
  9678. return
  9679. }
  9680. this.fullscreenOldMarginCss = jQuery(this.runtime.canvasdiv).css("margin");
  9681. jQuery(this.runtime.canvasdiv).css("margin", "0");
  9682. window["c2resizestretchmode"] = e > 0 ? 1 : 0;
  9683. this.runtime.fullscreen_scaling = e >= 2 ? e : 0;
  9684. var t = this.runtime.canvasdiv || this.runtime.canvas;
  9685. if (firstRequestFullscreen) {
  9686. firstRequestFullscreen = false;
  9687. crruntime = this.runtime;
  9688. t.addEventListener("mozfullscreenerror", onFullscreenError);
  9689. t.addEventListener("webkitfullscreenerror", onFullscreenError);
  9690. t.addEventListener("msfullscreenerror", onFullscreenError);
  9691. t.addEventListener("fullscreenerror", onFullscreenError)
  9692. }
  9693. if (!cr.is_undefined(t["webkitRequestFullScreen"])) {
  9694. if (typeof Element !== "undefined" && typeof Element["ALLOW_KEYBOARD_INPUT"] !== "undefined") t["webkitRequestFullScreen"](Element["ALLOW_KEYBOARD_INPUT"]);
  9695. else t["webkitRequestFullScreen"]()
  9696. } else if (!cr.is_undefined(t["mozRequestFullScreen"])) t["mozRequestFullScreen"]();
  9697. else if (!cr.is_undefined(t["msRequestFullscreen"])) t["msRequestFullscreen"]();
  9698. else if (!cr.is_undefined(t["requestFullscreen"])) t["requestFullscreen"]()
  9699. }
  9700. };
  9701. Acts.prototype.CancelFullScreen = function() {
  9702. if (this.runtime.isDomFree) {
  9703. cr.logexport("[Construct 2] Exiting fullscreen is not supported on this platform - the request has been ignored");
  9704. return
  9705. }
  9706. if (this.runtime.isNodeWebkit) {
  9707. if (this.runtime.isNodeFullscreen) {
  9708. window["nwgui"]["Window"]["get"]()["leaveFullscreen"]();
  9709. this.runtime.isNodeFullscreen = false
  9710. }
  9711. } else {
  9712. if (!cr.is_undefined(document["webkitCancelFullScreen"])) document["webkitCancelFullScreen"]();
  9713. else if (!cr.is_undefined(document["mozCancelFullScreen"])) document["mozCancelFullScreen"]();
  9714. else if (!cr.is_undefined(document["msExitFullscreen"])) document["msExitFullscreen"]();
  9715. else if (!cr.is_undefined(document["exitFullscreen"])) document["exitFullscreen"]();
  9716. jQuery(this.runtime.canvasdiv).css("margin", this.fullscreenOldMarginCss)
  9717. }
  9718. };
  9719. Acts.prototype.Vibrate = function(e) {
  9720. try {
  9721. var t = e.split(",");
  9722. var n, r;
  9723. for (n = 0, r = t.length; n < r; n++) {
  9724. t[n] = parseInt(t[n], 10)
  9725. }
  9726. if (navigator["vibrate"]) navigator["vibrate"](t);
  9727. else if (navigator["mozVibrate"]) navigator["mozVibrate"](t);
  9728. else if (navigator["webkitVibrate"]) navigator["webkitVibrate"](t)
  9729. } catch (i) {}
  9730. };
  9731. Acts.prototype.InvokeDownload = function(e, t) {
  9732. var n = document.createElement("a");
  9733. if (typeof n.download === "undefined") {
  9734. window.open(e)
  9735. } else {
  9736. var r = document.getElementsByTagName("body")[0];
  9737. n.textContent = t;
  9738. n.href = e;
  9739. n.download = t;
  9740. r.appendChild(n);
  9741. var i = document.createEvent("MouseEvent");
  9742. alert("ddd");
  9743. i.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  9744. n.dispatchEvent(i);
  9745. r.removeChild(n)
  9746. }
  9747. };
  9748. Acts.prototype.ConsoleLog = function(e, t) {
  9749. if (!console) return;
  9750. if (e === 0 && console.log) console.log(t.toString());
  9751. if (e === 1 && console.warn) console.warn(t.toString());
  9752. if (e === 2 && console.error) console.error(t.toString())
  9753. };
  9754. Acts.prototype.ConsoleGroup = function(e) {
  9755. if (console && console.group) console.group(e)
  9756. };
  9757. Acts.prototype.ConsoleGroupEnd = function() {
  9758. if (console && console.groupEnd) console.groupEnd()
  9759. };
  9760. Acts.prototype.ExecJs = function(js_) {
  9761. if (eval) eval(js_)
  9762. };
  9763. var orientations = ["portrait", "landscape", "portrait-primary", "portrait-secondary", "landscape-primary", "landscape-secondary"];
  9764. Acts.prototype.LockOrientation = function(e) {
  9765. e = Math.floor(e);
  9766. if (e < 0 || e >= orientations.length) return;
  9767. var t = orientations[e];
  9768. if (screen["lockOrientation"]) screen["lockOrientation"](t);
  9769. else if (screen["webkitLockOrientation"]) screen["webkitLockOrientation"](t);
  9770. else if (screen["mozLockOrientation"]) screen["mozLockOrientation"](t);
  9771. else if (screen["msLockOrientation"]) screen["msLockOrientation"](t)
  9772. };
  9773. Acts.prototype.UnlockOrientation = function() {
  9774. if (screen["unlockOrientation"]) screen["unlockOrientation"]();
  9775. else if (screen["webkitUnlockOrientation"]) screen["webkitUnlockOrientation"]();
  9776. else if (screen["mozUnlockOrientation"]) screen["mozUnlockOrientation"]();
  9777. else if (screen["msUnlockOrientation"]) screen["msUnlockOrientation"]()
  9778. };
  9779. pluginProto.acts = new Acts;
  9780. Exps.prototype.URL = function(e) {
  9781. e.set_string(this.runtime.isDomFree ? "" : window.location.toString())
  9782. };
  9783. Exps.prototype.Protocol = function(e) {
  9784. e.set_string(this.runtime.isDomFree ? "" : window.location.protocol)
  9785. };
  9786. Exps.prototype.Domain = function(e) {
  9787. e.set_string(this.runtime.isDomFree ? "" : window.location.hostname)
  9788. };
  9789. Exps.prototype.PathName = function(e) {
  9790. e.set_string(this.runtime.isDomFree ? "" : window.location.pathname)
  9791. };
  9792. Exps.prototype.Hash = function(e) {
  9793. e.set_string(this.runtime.isDomFree ? "" : window.location.hash)
  9794. };
  9795. Exps.prototype.Referrer = function(e) {
  9796. e.set_string(this.runtime.isDomFree ? "" : document.referrer)
  9797. };
  9798. Exps.prototype.Title = function(e) {
  9799. e.set_string(this.runtime.isDomFree ? "" : document.title)
  9800. };
  9801. Exps.prototype.Name = function(e) {
  9802. e.set_string(this.runtime.isDomFree ? "" : navigator.appName)
  9803. };
  9804. Exps.prototype.Version = function(e) {
  9805. e.set_string(this.runtime.isDomFree ? "" : navigator.appVersion)
  9806. };
  9807. Exps.prototype.Language = function(e) {
  9808. if (navigator && navigator.language) e.set_string(navigator.language);
  9809. else e.set_string("")
  9810. };
  9811. Exps.prototype.Platform = function(e) {
  9812. e.set_string(this.runtime.isDomFree ? "" : navigator.platform)
  9813. };
  9814. Exps.prototype.Product = function(e) {
  9815. if (navigator && navigator.product) e.set_string(navigator.product);
  9816. else e.set_string("")
  9817. };
  9818. Exps.prototype.Vendor = function(e) {
  9819. if (navigator && navigator.vendor) e.set_string(navigator.vendor);
  9820. else e.set_string("")
  9821. };
  9822. Exps.prototype.UserAgent = function(e) {
  9823. e.set_string(this.runtime.isDomFree ? "" : navigator.userAgent)
  9824. };
  9825. Exps.prototype.QueryString = function(e) {
  9826. e.set_string(this.runtime.isDomFree ? "" : window.location.search)
  9827. };
  9828. Exps.prototype.QueryParam = function(e, t) {
  9829. if (this.runtime.isDomFree) {
  9830. e.set_string("");
  9831. return
  9832. }
  9833. var n = RegExp("[?&]" + t + "=([^&]*)").exec(window.location.search);
  9834. if (n) e.set_string(decodeURIComponent(n[1].replace(/\+/g, " ")));
  9835. else e.set_string("")
  9836. };
  9837. Exps.prototype.Bandwidth = function(e) {
  9838. var t = navigator["connection"] || navigator["mozConnection"] || navigator["webkitConnection"];
  9839. if (!t) e.set_float(Number.POSITIVE_INFINITY);
  9840. else e.set_float(t["bandwidth"])
  9841. };
  9842. Exps.prototype.BatteryLevel = function(e) {
  9843. var t = navigator["battery"] || navigator["mozBattery"] || navigator["webkitBattery"];
  9844. if (!t) e.set_float(1);
  9845. else e.set_float(t["level"])
  9846. };
  9847. Exps.prototype.BatteryTimeLeft = function(e) {
  9848. var t = navigator["battery"] || navigator["mozBattery"] || navigator["webkitBattery"];
  9849. if (!t) e.set_float(Number.POSITIVE_INFINITY);
  9850. else e.set_float(t["dischargingTime"])
  9851. };
  9852. Exps.prototype.ExecJS = function(ret, js_) {
  9853. if (!eval) {
  9854. ret.set_any(0);
  9855. return
  9856. }
  9857. var result = eval(js_);
  9858. if (typeof result === "number") ret.set_any(result);
  9859. else if (typeof result === "string") ret.set_any(result);
  9860. else if (typeof result === "boolean") ret.set_any(result ? 1 : 0);
  9861. else ret.set_any(0)
  9862. };
  9863. Exps.prototype.ScreenWidth = function(e) {
  9864. e.set_int(screen.width)
  9865. };
  9866. Exps.prototype.ScreenHeight = function(e) {
  9867. e.set_int(screen.height)
  9868. };
  9869. Exps.prototype.DevicePixelRatio = function(e) {
  9870. e.set_float(this.runtime.devicePixelRatio)
  9871. };
  9872. pluginProto.exps = new Exps
  9873. })();
  9874. cr.plugins_.Mouse = function(e) {
  9875. this.runtime = e
  9876. };
  9877. (function() {
  9878. function i() {}
  9879. function s() {}
  9880. function o() {}
  9881. var e = cr.plugins_.Mouse.prototype;
  9882. e.Type = function(e) {
  9883. this.plugin = e;
  9884. this.runtime = e.runtime
  9885. };
  9886. var t = e.Type.prototype;
  9887. t.onCreate = function() {};
  9888. e.Instance = function(e) {
  9889. this.type = e;
  9890. this.runtime = e.runtime;
  9891. this.buttonMap = new Array(4);
  9892. this.mouseXcanvas = 0;
  9893. this.mouseYcanvas = 0;
  9894. this.triggerButton = 0;
  9895. this.triggerType = 0;
  9896. this.triggerDir = 0;
  9897. this.handled = false
  9898. };
  9899. var n = e.Instance.prototype;
  9900. n.onCreate = function() {
  9901. var e = this;
  9902. if (!this.runtime.isDomFree) {
  9903. jQuery(document).mousemove(function(t) {
  9904. e.onMouseMove(t)
  9905. });
  9906. jQuery(document).mousedown(function(t) {
  9907. e.onMouseDown(t)
  9908. });
  9909. jQuery(document).mouseup(function(t) {
  9910. e.onMouseUp(t)
  9911. }); /*jQuery(document).dblclick(function(t){e.onDoubleClick(t)});var t=function(t){e.onWheel(t)};document.addEventListener("mousewheel",t,false);document.addEventListener("DOMMouseScroll",t,false)*/
  9912. }
  9913. };
  9914. var r = {
  9915. left: 0,
  9916. top: 0
  9917. };
  9918. n.onMouseMove = function(e) {
  9919. var t = this.runtime.isDomFree ? r : jQuery(this.runtime.canvas).offset();
  9920. this.mouseXcanvas = e.pageX - t.left;
  9921. this.mouseYcanvas = e.pageY - t.top
  9922. };
  9923. n.mouseInGame = function() {
  9924. if (this.runtime.fullscreen_mode > 0) return true;
  9925. return this.mouseXcanvas >= 0 && this.mouseYcanvas >= 0 && this.mouseXcanvas < this.runtime.width && this.mouseYcanvas < this.runtime.height
  9926. };
  9927. n.onMouseDown = function(e) {
  9928. if (!this.mouseInGame()) return;
  9929. if (this.runtime.had_a_click) e.preventDefault();
  9930. this.buttonMap[e.which] = true;
  9931. this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnAnyClick, this);
  9932. this.triggerButton = e.which - 1;
  9933. this.triggerType = 0;
  9934. this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnClick, this);
  9935. this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, this);
  9936. };
  9937. n.onMouseUp = function(e) {
  9938. if (!this.buttonMap[e.which]) return;
  9939. if (this.runtime.had_a_click) e.preventDefault();
  9940. this.runtime.had_a_click = true;
  9941. this.buttonMap[e.which] = false;
  9942. this.triggerButton = e.which - 1;
  9943. this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnRelease, this);
  9944. };
  9945. n.onDoubleClick = function(e) {
  9946. if (!this.mouseInGame()) return;
  9947. e.preventDefault();
  9948. this.triggerButton = e.which - 1;
  9949. this.triggerType = 1;
  9950. this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnClick, this);
  9951. this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, this)
  9952. };
  9953. n.onWheel = function(e) {
  9954. var t = e.wheelDelta ? e.wheelDelta : e.detail ? -e.detail : 0;
  9955. this.triggerDir = t < 0 ? 0 : 1;
  9956. this.handled = false;
  9957. this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnWheel, this);
  9958. if (this.handled) e.preventDefault()
  9959. };
  9960. i.prototype.OnClick = function(e, t) {
  9961. return e === this.triggerButton && t === this.triggerType
  9962. };
  9963. i.prototype.OnAnyClick = function() {
  9964. return true
  9965. };
  9966. i.prototype.IsButtonDown = function(e) {
  9967. return this.buttonMap[e + 1]
  9968. };
  9969. i.prototype.OnRelease = function(e) {
  9970. return e === this.triggerButton
  9971. };
  9972. i.prototype.IsOverObject = function(e) {
  9973. var t = this.runtime.getCurrentCondition();
  9974. var n = this.mouseXcanvas;
  9975. var r = this.mouseYcanvas;
  9976. return cr.xor(this.runtime.testAndSelectCanvasPointOverlap(e, n, r, t.inverted), t.inverted)
  9977. };
  9978. i.prototype.OnObjectClicked = function(e, t, n) {
  9979. if (e !== this.triggerButton || t !== this.triggerType) return false;
  9980. return this.runtime.testAndSelectCanvasPointOverlap(n, this.mouseXcanvas, this.mouseYcanvas, false);
  9981. };
  9982. i.prototype.OnWheel = function(e) {
  9983. this.handled = true;
  9984. return e === this.triggerDir
  9985. };
  9986. e.cnds = new i;
  9987. s.prototype.SetCursor = function(e) {
  9988. var t = ["auto", "pointer", "text", "crosshair", "move", "help", "wait", "none"][e];
  9989. if (this.runtime.canvas && this.runtime.canvas.style) this.runtime.canvas.style.cursor = t
  9990. };
  9991. s.prototype.SetCursorSprite = function(e) {
  9992. if (this.runtime.isDomFree || this.runtime.isMobile || !e) return;
  9993. var t = e.getFirstPicked();
  9994. if (!t || !t.curFrame) return;
  9995. var n = t.curFrame;
  9996. var r = n.getDataUri();
  9997. var i = "url(" + r + ") " + Math.round(n.hotspotX * n.width) + " " + Math.round(n.hotspotY * n.height) + ", auto";
  9998. jQuery(this.runtime.canvas).css("cursor", i)
  9999. };
  10000. e.acts = new s;
  10001. o.prototype.X = function(e, t) {
  10002. var n, r, i, s, o;
  10003. if (cr.is_undefined(t)) {
  10004. n = this.runtime.getLayerByNumber(0);
  10005. r = n.scale;
  10006. i = n.zoomRate;
  10007. s = n.parallaxX;
  10008. o = n.angle;
  10009. n.scale = this.runtime.running_layout.scale;
  10010. n.zoomRate = 1;
  10011. n.parallaxX = 1;
  10012. n.angle = this.runtime.running_layout.angle;
  10013. e.set_float(n.canvasToLayer(this.mouseXcanvas, this.mouseYcanvas, true));
  10014. n.scale = r;
  10015. n.zoomRate = i;
  10016. n.parallaxX = s;
  10017. n.angle = o
  10018. } else {
  10019. if (cr.is_number(t)) n = this.runtime.getLayerByNumber(t);
  10020. else n = this.runtime.getLayerByName(t);
  10021. if (n) e.set_float(n.canvasToLayer(this.mouseXcanvas, this.mouseYcanvas, true));
  10022. else e.set_float(0)
  10023. }
  10024. };
  10025. o.prototype.Y = function(e, t) {
  10026. var n, r, i, s, o;
  10027. if (cr.is_undefined(t)) {
  10028. n = this.runtime.getLayerByNumber(0);
  10029. r = n.scale;
  10030. i = n.zoomRate;
  10031. s = n.parallaxY;
  10032. o = n.angle;
  10033. n.scale = this.runtime.running_layout.scale;
  10034. n.zoomRate = 1;
  10035. n.parallaxY = 1;
  10036. n.angle = this.runtime.running_layout.angle;
  10037. e.set_float(n.canvasToLayer(this.mouseXcanvas, this.mouseYcanvas, false));
  10038. n.scale = r;
  10039. n.zoomRate = i;
  10040. n.parallaxY = s;
  10041. n.angle = o
  10042. } else {
  10043. if (cr.is_number(t)) n = this.runtime.getLayerByNumber(t);
  10044. else n = this.runtime.getLayerByName(t);
  10045. if (n) e.set_float(n.canvasToLayer(this.mouseXcanvas, this.mouseYcanvas, false));
  10046. else e.set_float(0)
  10047. }
  10048. };
  10049. o.prototype.AbsoluteX = function(e) {
  10050. e.set_float(this.mouseXcanvas)
  10051. };
  10052. o.prototype.AbsoluteY = function(e) {
  10053. e.set_float(this.mouseYcanvas)
  10054. };
  10055. e.exps = new o
  10056. })();
  10057. cr.plugins_.Particles = function(e) {
  10058. this.runtime = e
  10059. };
  10060. (function() {
  10061. function n(e) {
  10062. this.owner = e;
  10063. this.active = false;
  10064. this.x = 0;
  10065. this.y = 0;
  10066. this.speed = 0;
  10067. this.angle = 0;
  10068. this.opacity = 1;
  10069. this.grow = 0;
  10070. this.size = 0;
  10071. this.gs = 0;
  10072. this.age = 0;
  10073. cr.seal(this)
  10074. }
  10075. function s() {}
  10076. function o() {}
  10077. function u() {}
  10078. var e = cr.plugins_.Particles.prototype;
  10079. e.Type = function(e) {
  10080. this.plugin = e;
  10081. this.runtime = e.runtime
  10082. };
  10083. var t = e.Type.prototype;
  10084. t.onCreate = function() {
  10085. if (this.is_family) return;
  10086. this.texture_img = new Image;
  10087. this.texture_img["idtkLoadDisposed"] = true;
  10088. this.texture_img.src = this.texture_file;
  10089. this.texture_img.cr_filesize = this.texture_filesize;
  10090. this.webGL_texture = null;
  10091. this.runtime.wait_for_textures.push(this.texture_img)
  10092. };
  10093. t.onLostWebGLContext = function() {
  10094. if (this.is_family) return;
  10095. this.webGL_texture = null
  10096. };
  10097. t.onRestoreWebGLContext = function() {
  10098. if (this.is_family || !this.instances.length) return;
  10099. if (!this.webGL_texture) {
  10100. this.webGL_texture = this.runtime.glwrap.loadTexture(this.texture_img, true, this.runtime.linearSampling, this.texture_pixelformat)
  10101. }
  10102. };
  10103. t.loadTextures = function() {
  10104. if (this.is_family || this.webGL_texture || !this.runtime.glwrap) return;
  10105. this.webGL_texture = this.runtime.glwrap.loadTexture(this.texture_img, true, this.runtime.linearSampling, this.texture_pixelformat)
  10106. };
  10107. t.unloadTextures = function() {
  10108. if (this.is_family || this.instances.length || !this.webGL_texture) return;
  10109. this.runtime.glwrap.deleteTexture(this.webGL_texture);
  10110. this.webGL_texture = null
  10111. };
  10112. t.preloadCanvas2D = function(e) {
  10113. e.drawImage(this.texture_img, 0, 0)
  10114. };
  10115. n.prototype.init = function() {
  10116. var e = this.owner;
  10117. this.x = e.x - e.xrandom / 2 + Math.random() * e.xrandom;
  10118. this.y = e.y - e.yrandom / 2 + Math.random() * e.yrandom;
  10119. this.speed = e.initspeed - e.speedrandom / 2 + Math.random() * e.speedrandom;
  10120. this.angle = e.angle - e.spraycone / 2 + Math.random() * e.spraycone;
  10121. this.opacity = e.initopacity;
  10122. this.size = e.initsize - e.sizerandom / 2 + Math.random() * e.sizerandom;
  10123. this.grow = e.growrate - e.growrandom / 2 + Math.random() * e.growrandom;
  10124. this.gs = 0;
  10125. this.age = 0
  10126. };
  10127. n.prototype.tick = function(e) {
  10128. var t = this.owner;
  10129. this.x += Math.cos(this.angle) * this.speed * e;
  10130. this.y += Math.sin(this.angle) * this.speed * e;
  10131. this.y += this.gs * e;
  10132. this.speed += t.acc * e;
  10133. this.size += this.grow * e;
  10134. this.gs += t.g * e;
  10135. this.age += e;
  10136. if (this.size < 1) {
  10137. this.active = false;
  10138. return
  10139. }
  10140. if (t.lifeanglerandom !== 0) this.angle += Math.random() * t.lifeanglerandom * e - t.lifeanglerandom * e / 2;
  10141. if (t.lifespeedrandom !== 0) this.speed += Math.random() * t.lifespeedrandom * e - t.lifespeedrandom * e / 2;
  10142. if (t.lifeopacityrandom !== 0) {
  10143. this.opacity += Math.random() * t.lifeopacityrandom * e - t.lifeopacityrandom * e / 2;
  10144. if (this.opacity < 0) this.opacity = 0;
  10145. else if (this.opacity > 1) this.opacity = 1
  10146. }
  10147. if (t.destroymode <= 1 && this.age >= t.timeout) {
  10148. this.active = false
  10149. }
  10150. if (t.destroymode === 2 && this.speed <= 0) {
  10151. this.active = false
  10152. }
  10153. };
  10154. n.prototype.draw = function(e) {
  10155. var t = this.owner.opacity * this.opacity;
  10156. if (t === 0) return;
  10157. if (this.owner.destroymode === 0) t *= 1 - this.age / this.owner.timeout;
  10158. e.globalAlpha = t;
  10159. var n = this.x - this.size / 2;
  10160. var r = this.y - this.size / 2;
  10161. if (this.owner.runtime.pixel_rounding) {
  10162. n = n + .5 | 0;
  10163. r = r + .5 | 0
  10164. }
  10165. e.drawImage(this.owner.type.texture_img, n, r, this.size, this.size)
  10166. };
  10167. n.prototype.drawGL = function(e) {
  10168. var t = this.owner.opacity * this.opacity;
  10169. if (this.owner.destroymode === 0) t *= 1 - this.age / this.owner.timeout;
  10170. var n = this.size;
  10171. var r = n * this.owner.particlescale;
  10172. var i = this.x - n / 2;
  10173. var s = this.y - n / 2;
  10174. if (this.owner.runtime.pixel_rounding) {
  10175. i = i + .5 | 0;
  10176. s = s + .5 | 0
  10177. }
  10178. if (r < 1 || t === 0) return;
  10179. if (r < e.minPointSize || r > e.maxPointSize) {
  10180. e.setOpacity(t);
  10181. e.quad(i, s, i + n, s, i + n, s + n, i, s + n)
  10182. } else e.point(this.x, this.y, r, t)
  10183. };
  10184. n.prototype.left = function() {
  10185. return this.x - this.size / 2
  10186. };
  10187. n.prototype.right = function() {
  10188. return this.x + this.size / 2
  10189. };
  10190. n.prototype.top = function() {
  10191. return this.y - this.size / 2
  10192. };
  10193. n.prototype.bottom = function() {
  10194. return this.y + this.size / 2
  10195. };
  10196. e.Instance = function(e) {
  10197. this.type = e;
  10198. this.runtime = e.runtime
  10199. };
  10200. var r = e.Instance.prototype;
  10201. var i = [];
  10202. r.onCreate = function() {
  10203. var e = this.properties;
  10204. this.rate = e[0];
  10205. this.spraycone = cr.to_radians(e[1]);
  10206. this.spraytype = e[2];
  10207. this.spraying = true;
  10208. this.initspeed = e[3];
  10209. this.initsize = e[4];
  10210. this.initopacity = e[5] / 100;
  10211. this.growrate = e[6];
  10212. this.xrandom = e[7];
  10213. this.yrandom = e[8];
  10214. this.speedrandom = e[9];
  10215. this.sizerandom = e[10];
  10216. this.growrandom = e[11];
  10217. this.acc = e[12];
  10218. this.g = e[13];
  10219. this.lifeanglerandom = e[14];
  10220. this.lifespeedrandom = e[15];
  10221. this.lifeopacityrandom = e[16];
  10222. this.destroymode = e[17];
  10223. this.timeout = e[18];
  10224. this.particleCreateCounter = 0;
  10225. this.particlescale = 1;
  10226. this.particleBoxLeft = this.x;
  10227. this.particleBoxTop = this.y;
  10228. this.particleBoxRight = this.x;
  10229. this.particleBoxBottom = this.y;
  10230. this.add_bbox_changed_callback(function(e) {
  10231. e.bbox.set(e.particleBoxLeft, e.particleBoxTop, e.particleBoxRight, e.particleBoxBottom);
  10232. e.bquad.set_from_rect(e.bbox);
  10233. e.bbox_changed = false
  10234. });
  10235. if (!this.recycled) this.particles = [];
  10236. this.runtime.tickMe(this);
  10237. this.type.loadTextures();
  10238. if (this.spraytype === 1) {
  10239. for (var t = 0; t < this.rate; t++) this.allocateParticle().opacity = 0
  10240. }
  10241. this.first_tick = true
  10242. };
  10243. r.saveToJSON = function() {
  10244. var e = {
  10245. r: this.rate,
  10246. sc: this.spraycone,
  10247. st: this.spraytype,
  10248. s: this.spraying,
  10249. isp: this.initspeed,
  10250. isz: this.initsize,
  10251. io: this.initopacity,
  10252. gr: this.growrate,
  10253. xr: this.xrandom,
  10254. yr: this.yrandom,
  10255. spr: this.speedrandom,
  10256. szr: this.sizerandom,
  10257. grnd: this.growrandom,
  10258. acc: this.acc,
  10259. g: this.g,
  10260. lar: this.lifeanglerandom,
  10261. lsr: this.lifespeedrandom,
  10262. lor: this.lifeopacityrandom,
  10263. dm: this.destroymode,
  10264. to: this.timeout,
  10265. pcc: this.particleCreateCounter,
  10266. ft: this.first_tick,
  10267. p: []
  10268. };
  10269. var t, n, r;
  10270. var i = e["p"];
  10271. for (t = 0, n = this.particles.length; t < n; t++) {
  10272. r = this.particles[t];
  10273. i.push([r.x, r.y, r.speed, r.angle, r.opacity, r.grow, r.size, r.gs, r.age])
  10274. }
  10275. return e
  10276. };
  10277. r.loadFromJSON = function(e) {
  10278. this.rate = e["r"];
  10279. this.spraycone = e["sc"];
  10280. this.spraytype = e["st"];
  10281. this.spraying = e["s"];
  10282. this.initspeed = e["isp"];
  10283. this.initsize = e["isz"];
  10284. this.initopacity = e["io"];
  10285. this.growrate = e["gr"];
  10286. this.xrandom = e["xr"];
  10287. this.yrandom = e["yr"];
  10288. this.speedrandom = e["spr"];
  10289. this.sizerandom = e["szr"];
  10290. this.growrandom = e["grnd"];
  10291. this.acc = e["acc"];
  10292. this.g = e["g"];
  10293. this.lifeanglerandom = e["lar"];
  10294. this.lifespeedrandom = e["lsr"];
  10295. this.lifeopacityrandom = e["lor"];
  10296. this.destroymode = e["dm"];
  10297. this.timeout = e["to"];
  10298. this.particleCreateCounter = e["pcc"];
  10299. this.first_tick = e["ft"];
  10300. i.push.apply(i, this.particles);
  10301. this.particles.length = 0;
  10302. var t, n, r, s;
  10303. var o = e["p"];
  10304. for (t = 0, n = o.length; t < n; t++) {
  10305. r = this.allocateParticle();
  10306. s = o[t];
  10307. r.x = s[0];
  10308. r.y = s[1];
  10309. r.speed = s[2];
  10310. r.angle = s[3];
  10311. r.opacity = s[4];
  10312. r.grow = s[5];
  10313. r.size = s[6];
  10314. r.gs = s[7];
  10315. r.age = s[8]
  10316. }
  10317. };
  10318. r.onDestroy = function() {
  10319. i.push.apply(i, this.particles);
  10320. this.particles.length = 0
  10321. };
  10322. r.allocateParticle = function() {
  10323. var e;
  10324. if (i.length) {
  10325. e = i.pop();
  10326. e.owner = this
  10327. } else e = new n(this);
  10328. this.particles.push(e);
  10329. e.active = true;
  10330. return e
  10331. };
  10332. r.tick = function() {
  10333. var e = this.runtime.getDt(this);
  10334. var t, n, r, s, o;
  10335. if (this.spraytype === 0 && this.spraying) {
  10336. this.particleCreateCounter += e * this.rate;
  10337. s = cr.floor(this.particleCreateCounter);
  10338. this.particleCreateCounter -= s;
  10339. for (t = 0; t < s; t++) {
  10340. r = this.allocateParticle();
  10341. r.init()
  10342. }
  10343. }
  10344. this.particleBoxLeft = this.x;
  10345. this.particleBoxTop = this.y;
  10346. this.particleBoxRight = this.x;
  10347. this.particleBoxBottom = this.y;
  10348. for (t = 0, o = 0, n = this.particles.length; t < n; t++) {
  10349. r = this.particles[t];
  10350. this.particles[o] = r;
  10351. this.runtime.redraw = true;
  10352. if (this.spraytype === 1 && this.first_tick) r.init();
  10353. r.tick(e);
  10354. if (!r.active) {
  10355. i.push(r);
  10356. continue
  10357. }
  10358. if (r.left() < this.particleBoxLeft) this.particleBoxLeft = r.left();
  10359. if (r.right() > this.particleBoxRight) this.particleBoxRight = r.right();
  10360. if (r.top() < this.particleBoxTop) this.particleBoxTop = r.top();
  10361. if (r.bottom() > this.particleBoxBottom) this.particleBoxBottom = r.bottom();
  10362. o++
  10363. }
  10364. this.particles.length = o;
  10365. this.set_bbox_changed();
  10366. this.first_tick = false;
  10367. if (this.spraytype === 1 && this.particles.length === 0) this.runtime.DestroyInstance(this)
  10368. };
  10369. r.draw = function(e) {
  10370. var t, n, r, i = this.layer;
  10371. for (t = 0, n = this.particles.length; t < n; t++) {
  10372. r = this.particles[t];
  10373. if (r.right() >= i.viewLeft && r.bottom() >= i.viewTop && r.left() <= i.viewRight && r.top() <= i.viewBottom) {
  10374. r.draw(e)
  10375. }
  10376. }
  10377. };
  10378. r.drawGL = function(e) {
  10379. this.particlescale = this.layer.getScale();
  10380. e.setTexture(this.type.webGL_texture);
  10381. var t, n, r, i = this.layer;
  10382. for (t = 0, n = this.particles.length; t < n; t++) {
  10383. r = this.particles[t];
  10384. if (r.right() >= i.viewLeft && r.bottom() >= i.viewTop && r.left() <= i.viewRight && r.top() <= i.viewBottom) {
  10385. r.drawGL(e)
  10386. }
  10387. }
  10388. };
  10389. s.prototype.IsSpraying = function() {
  10390. return this.spraying
  10391. };
  10392. e.cnds = new s;
  10393. o.prototype.SetSpraying = function(e) {
  10394. this.spraying = e !== 0
  10395. };
  10396. o.prototype.SetEffect = function(e) {
  10397. this.compositeOp = cr.effectToCompositeOp(e);
  10398. cr.setGLBlend(this, e, this.runtime.gl);
  10399. this.runtime.redraw = true
  10400. };
  10401. o.prototype.SetRate = function(e) {
  10402. this.rate = e;
  10403. var t, n;
  10404. if (this.spraytype === 1 && this.first_tick) {
  10405. if (e < this.particles.length) {
  10406. t = this.particles.length - e;
  10407. for (n = 0; n < t; n++) i.push(this.particles.pop())
  10408. } else if (e > this.particles.length) {
  10409. t = e - this.particles.length;
  10410. for (n = 0; n < t; n++) this.allocateParticle().opacity = 0
  10411. }
  10412. }
  10413. };
  10414. o.prototype.SetSprayCone = function(e) {
  10415. this.spraycone = cr.to_radians(e)
  10416. };
  10417. o.prototype.SetInitSpeed = function(e) {
  10418. this.initspeed = e
  10419. };
  10420. o.prototype.SetInitSize = function(e) {
  10421. this.initsize = e
  10422. };
  10423. o.prototype.SetInitOpacity = function(e) {
  10424. this.initopacity = e / 100
  10425. };
  10426. o.prototype.SetGrowRate = function(e) {
  10427. this.growrate = e
  10428. };
  10429. o.prototype.SetXRandomiser = function(e) {
  10430. this.xrandom = e
  10431. };
  10432. o.prototype.SetYRandomiser = function(e) {
  10433. this.yrandom = e
  10434. };
  10435. o.prototype.SetSpeedRandomiser = function(e) {
  10436. this.speedrandom = e
  10437. };
  10438. o.prototype.SetSizeRandomiser = function(e) {
  10439. this.sizerandom = e
  10440. };
  10441. o.prototype.SetGrowRateRandomiser = function(e) {
  10442. this.growrandom = e
  10443. };
  10444. o.prototype.SetParticleAcc = function(e) {
  10445. this.acc = e
  10446. };
  10447. o.prototype.SetGravity = function(e) {
  10448. this.g = e
  10449. };
  10450. o.prototype.SetAngleRandomiser = function(e) {
  10451. this.lifeanglerandom = e
  10452. };
  10453. o.prototype.SetSpeedRandomiser = function(e) {
  10454. this.lifespeedrandom = e
  10455. };
  10456. o.prototype.SetOpacityRandomiser = function(e) {
  10457. this.lifeopacityrandom = e
  10458. };
  10459. o.prototype.SetTimeout = function(e) {
  10460. this.timeout = e
  10461. };
  10462. e.acts = new o;
  10463. u.prototype.ParticleCount = function(e) {
  10464. e.set_int(this.particles.length)
  10465. };
  10466. u.prototype.Rate = function(e) {
  10467. e.set_float(this.rate)
  10468. };
  10469. u.prototype.SprayCone = function(e) {
  10470. e.set_float(cr.to_degrees(this.spraycone))
  10471. };
  10472. u.prototype.InitSpeed = function(e) {
  10473. e.set_float(this.initspeed)
  10474. };
  10475. u.prototype.InitSize = function(e) {
  10476. e.set_float(this.initsize)
  10477. };
  10478. u.prototype.InitOpacity = function(e) {
  10479. e.set_float(this.initopacity * 100)
  10480. };
  10481. u.prototype.InitGrowRate = function(e) {
  10482. e.set_float(this.growrate)
  10483. };
  10484. u.prototype.XRandom = function(e) {
  10485. e.set_float(this.xrandom)
  10486. };
  10487. u.prototype.YRandom = function(e) {
  10488. e.set_float(this.yrandom)
  10489. };
  10490. u.prototype.InitSpeedRandom = function(e) {
  10491. e.set_float(this.speedrandom)
  10492. };
  10493. u.prototype.InitSizeRandom = function(e) {
  10494. e.set_float(this.sizerandom)
  10495. };
  10496. u.prototype.InitGrowRandom = function(e) {
  10497. e.set_float(this.growrandom)
  10498. };
  10499. u.prototype.ParticleAcceleration = function(e) {
  10500. e.set_float(this.acc)
  10501. };
  10502. u.prototype.Gravity = function(e) {
  10503. e.set_float(this.g)
  10504. };
  10505. u.prototype.ParticleAngleRandom = function(e) {
  10506. e.set_float(this.lifeanglerandom)
  10507. };
  10508. u.prototype.ParticleSpeedRandom = function(e) {
  10509. e.set_float(this.lifespeedrandom)
  10510. };
  10511. u.prototype.ParticleOpacityRandom = function(e) {
  10512. e.set_float(this.lifeopacityrandom)
  10513. };
  10514. u.prototype.Timeout = function(e) {
  10515. e.set_float(this.timeout)
  10516. };
  10517. e.exps = new u
  10518. })();
  10519. cr.plugins_.Softgames = function(e) {
  10520. this.runtime = e
  10521. };
  10522. (function() {
  10523. function r() {}
  10524. function i() {}
  10525. function s() {}
  10526. var e = cr.plugins_.Softgames.prototype;
  10527. e.Type = function(e) {
  10528. this.plugin = e;
  10529. this.runtime = e.runtime
  10530. };
  10531. var t = e.Type.prototype;
  10532. t.onCreate = function() {};
  10533. e.Instance = function(e) {
  10534. this.type = e;
  10535. this.runtime = e.runtime
  10536. };
  10537. var n = e.Instance.prototype;
  10538. n.onCreate = function() {};
  10539. n.onDestroy = function() {};
  10540. n.saveToJSON = function() {
  10541. return {}
  10542. };
  10543. n.loadFromJSON = function(e) {};
  10544. n.draw = function(e) {};
  10545. n.drawGL = function(e) {};
  10546. r.prototype.IsSuspended = function() {
  10547. return this.runtime.isSuspended
  10548. };
  10549. e.cnds = new r;
  10550. i.prototype.ConnectAPI = function() {};
  10551. i.prototype.startGame = function() {
  10552. SG_Hooks.start()
  10553. };
  10554. i.prototype.levelUp = function() {
  10555. if (typeof window.c2_level != "integer") throw "Please use the browser-object to execute javascript that puts the current level into window.c2_level every time it changes";
  10556. if (typeof window.c2_score != "integer") throw "Please use the browser-object to execute javascript that puts the current score into window.c2_score every time it changes";
  10557. SG_Hooks.levelUp(window.c2_level, window.c2_score);
  10558. if (window.c2_score > getHighScore()) localStorage["high_score"] = window.c2_score
  10559. };
  10560. i.prototype.gameOver = function() {
  10561. if (typeof window.c2_level != "number") throw "Please use the browser-object to execute javascript that puts the current level into window.c2_level every time it changes";
  10562. if (typeof window.c2_score != "number") throw "Please use the browser-object to execute javascript that puts the current score into window.c2_score every time it changes";
  10563. if (window.c2_score > getHighScore()) {
  10564. localStorage[gameID + "high_score"] = window.c2_score;
  10565. }
  10566. submitScore(window.c2_score)
  10567. };
  10568. i.prototype.setOrientationHandler = function() {
  10569. if (typeof window.c2_orientationHandler != "function") throw "Please use the browser-object to execute javascript that puts the c2-function which handles orientation changes into window.c2_orientationHandler";
  10570. SG_Hooks.setOrientationHandler(window.c2_orientationHandler)
  10571. };
  10572. i.prototype.setOrientationHandler = function() {
  10573. if (typeof window.c2_resizeHandler != "function") throw "Please use the browser-object to execute javascript that puts the c2-function which handles resize events into window.c2_resizeHandler";
  10574. SG_Hooks.setResizeHandler(window.c2_resizeHandler)
  10575. };
  10576. e.acts = new i;
  10577. s.prototype.getLanguage = function(e) {
  10578. var t = Object.prototype.toString.call(window.c2_supportedLanguages).toLowerCase() == "[object array]";
  10579. if (!t) throw "Please use the browser-object to execute javascript that puts the languages your game supports into window.c2_supportedLanguages. example window.c2_supportedLanguages = ['en','es']";
  10580. e.set_string(SG_Hooks.getLanguage(window.c2_supportedLanguages))
  10581. };
  10582. e.exps = new s
  10583. })();
  10584. cr.plugins_.Sprite = function(e) {
  10585. this.runtime = e
  10586. };
  10587. (function() {
  10588. function n() {
  10589. if (this.datauri.length === 0) {
  10590. var e = document.createElement("canvas");
  10591. e.width = this.width;
  10592. e.height = this.height;
  10593. var t = e.getContext("2d");
  10594. if (this.spritesheeted) {
  10595. t.drawImage(this.texture_img, this.offx, this.offy, this.width, this.height, 0, 0, this.width, this.height)
  10596. } else {
  10597. t.drawImage(this.texture_img, 0, 0, this.width, this.height)
  10598. }
  10599. this.datauri = e.toDataURL("image/png")
  10600. }
  10601. return this.datauri
  10602. }
  10603. function s() {}
  10604. function u() {
  10605. if (o.length) return o.pop();
  10606. else return [0, 0]
  10607. }
  10608. function a(e) {
  10609. e[0] = 0;
  10610. e[1] = 0;
  10611. o.push(e)
  10612. }
  10613. function f(e, t, n) {
  10614. var r = u();
  10615. r[0] = t.uid;
  10616. r[1] = n.uid;
  10617. e.push(r)
  10618. }
  10619. function l(e, t, n) {
  10620. var r = t.uid;
  10621. var i = n.uid;
  10622. var s, o = 0,
  10623. u, f;
  10624. for (s = 0, u = e.length; s < u; s++) {
  10625. f = e[s];
  10626. if (!(f[0] === r && f[1] === i || f[0] === i && f[1] === r)) {
  10627. e[o][0] = e[s][0];
  10628. e[o][1] = e[s][1];
  10629. o++
  10630. }
  10631. }
  10632. for (s = o; s < u; s++) a(e[s]);
  10633. e.length = o
  10634. }
  10635. function c(e, t) {
  10636. var n, r = 0,
  10637. i, s, o = t.uid;
  10638. for (n = 0, i = e.length; n < i; n++) {
  10639. s = e[n];
  10640. if (s[0] !== o && s[1] !== o) {
  10641. e[r][0] = e[n][0];
  10642. e[r][1] = e[n][1];
  10643. r++
  10644. }
  10645. }
  10646. for (n = r; n < i; n++) a(e[n]);
  10647. e.length = r
  10648. }
  10649. function h(e, t, n) {
  10650. var r = t.uid;
  10651. var i = n.uid;
  10652. var s, o, u;
  10653. for (s = 0, o = e.length; s < o; s++) {
  10654. u = e[s];
  10655. if (u[0] === r && u[1] === i || u[0] === i && u[1] === r) return true
  10656. }
  10657. return false
  10658. }
  10659. function m(e, t, n) {
  10660. if (!e) return false;
  10661. var r = t !== 0 || n !== 0;
  10662. var i, s, o = false,
  10663. u, a, f;
  10664. var l = this.runtime.getCurrentCondition();
  10665. var c = l.type;
  10666. var h = l.inverted;
  10667. var m = e.getCurrentSol();
  10668. var g = this.runtime.getCurrentEventStack().current_event.orblock;
  10669. var y;
  10670. if (m.select_all) y = m.type.instances;
  10671. else if (g) y = m.else_instances;
  10672. else y = m.instances;
  10673. p = e;
  10674. v = c !== e && !h;
  10675. if (r) {
  10676. i = this.x;
  10677. s = this.y;
  10678. this.x += t;
  10679. this.y += n;
  10680. this.set_bbox_changed()
  10681. }
  10682. for (u = 0, a = y.length; u < a; u++) {
  10683. f = y[u];
  10684. if (this.runtime.testOverlap(this, f)) {
  10685. o = true;
  10686. if (h) break;
  10687. if (c !== e) d.add(f)
  10688. }
  10689. }
  10690. if (r) {
  10691. this.x = i;
  10692. this.y = s;
  10693. this.set_bbox_changed()
  10694. }
  10695. return o
  10696. }
  10697. function g() {}
  10698. function y() {}
  10699. var e = cr.plugins_.Sprite.prototype;
  10700. e.Type = function(e) {
  10701. this.plugin = e;
  10702. this.runtime = e.runtime
  10703. };
  10704. var t = e.Type.prototype;
  10705. t.onCreate = function() {
  10706. if (this.is_family) return;
  10707. var e, t, r, i;
  10708. var s, o, u, a, f, l;
  10709. this.all_frames = [];
  10710. this.has_loaded_textures = false;
  10711. for (e = 0, t = this.animations.length; e < t; e++) {
  10712. s = this.animations[e];
  10713. u = {};
  10714. u.name = s[0];
  10715. u.speed = s[1];
  10716. u.loop = s[2];
  10717. u.repeatcount = s[3];
  10718. u.repeatto = s[4];
  10719. u.pingpong = s[5];
  10720. u.sid = s[6];
  10721. u.frames = [];
  10722. for (r = 0, i = s[7].length; r < i; r++) {
  10723. o = s[7][r];
  10724. a = {};
  10725. a.texture_file = o[0];
  10726. a.texture_filesize = o[1];
  10727. a.offx = o[2];
  10728. a.offy = o[3];
  10729. a.width = o[4];
  10730. a.height = o[5];
  10731. a.duration = o[6];
  10732. a.hotspotX = o[7];
  10733. a.hotspotY = o[8];
  10734. a.image_points = o[9];
  10735. a.poly_pts = o[10];
  10736. a.pixelformat = o[11];
  10737. a.spritesheeted = a.width !== 0;
  10738. a.datauri = "";
  10739. a.getDataUri = n;
  10740. l = {};
  10741. l.left = 0;
  10742. l.top = 0;
  10743. l.right = 1;
  10744. l.bottom = 1;
  10745. a.sheetTex = l;
  10746. a.webGL_texture = null;
  10747. f = this.runtime.findWaitingTexture(o[0]);
  10748. if (f) {
  10749. a.texture_img = f
  10750. } else {
  10751. a.texture_img = new Image;
  10752. a.texture_img["idtkLoadDisposed"] = true;
  10753. a.texture_img.src = o[0];
  10754. a.texture_img.cr_src = o[0];
  10755. a.texture_img.cr_filesize = o[1];
  10756. a.texture_img.c2webGL_texture = null;
  10757. this.runtime.wait_for_textures.push(a.texture_img)
  10758. }
  10759. cr.seal(a);
  10760. u.frames.push(a);
  10761. this.all_frames.push(a)
  10762. }
  10763. cr.seal(u);
  10764. this.animations[e] = u
  10765. }
  10766. };
  10767. t.updateAllCurrentTexture = function() {
  10768. var e, t, n;
  10769. for (e = 0, t = this.instances.length; e < t; e++) {
  10770. n = this.instances[e];
  10771. n.curWebGLTexture = n.curFrame.webGL_texture
  10772. }
  10773. };
  10774. t.onLostWebGLContext = function() {
  10775. if (this.is_family) return;
  10776. var e, t, n;
  10777. for (e = 0, t = this.all_frames.length; e < t; ++e) {
  10778. n = this.all_frames[e];
  10779. n.texture_img.c2webGL_texture = null;
  10780. n.webGL_texture = null
  10781. }
  10782. };
  10783. t.onRestoreWebGLContext = function() {
  10784. if (this.is_family || !this.instances.length) return;
  10785. var e, t, n;
  10786. for (e = 0, t = this.all_frames.length; e < t; ++e) {
  10787. n = this.all_frames[e];
  10788. n.webGL_texture = this.runtime.glwrap.loadTexture(n.texture_img, false, this.runtime.linearSampling, n.pixelformat)
  10789. }
  10790. this.updateAllCurrentTexture()
  10791. };
  10792. t.loadTextures = function() {
  10793. if (this.is_family || this.has_loaded_textures || !this.runtime.glwrap) return;
  10794. var e, t, n;
  10795. for (e = 0, t = this.all_frames.length; e < t; ++e) {
  10796. n = this.all_frames[e];
  10797. n.webGL_texture = this.runtime.glwrap.loadTexture(n.texture_img, false, this.runtime.linearSampling, n.pixelformat)
  10798. }
  10799. this.has_loaded_textures = true
  10800. };
  10801. t.unloadTextures = function() {
  10802. if (this.is_family || this.instances.length || !this.has_loaded_textures) return;
  10803. var e, t, n;
  10804. for (e = 0, t = this.all_frames.length; e < t; ++e) {
  10805. n = this.all_frames[e];
  10806. this.runtime.glwrap.deleteTexture(n.webGL_texture)
  10807. }
  10808. this.has_loaded_textures = false
  10809. };
  10810. var r = [];
  10811. t.preloadCanvas2D = function(e) {
  10812. var t, n, i;
  10813. r.length = 0;
  10814. for (t = 0, n = this.all_frames.length; t < n; ++t) {
  10815. i = this.all_frames[t].texture_img;
  10816. if (r.indexOf(i) !== -1) continue;
  10817. e.drawImage(i, 0, 0);
  10818. r.push(i)
  10819. }
  10820. };
  10821. e.Instance = function(e) {
  10822. this.type = e;
  10823. this.runtime = e.runtime;
  10824. var t = this.type.animations[0].frames[0].poly_pts;
  10825. if (this.recycled) this.collision_poly.set_pts(t);
  10826. else this.collision_poly = new cr.CollisionPoly(t)
  10827. };
  10828. var i = e.Instance.prototype;
  10829. i.onCreate = function() {
  10830. this.visible = this.properties[0] === 0;
  10831. this.isTicking = false;
  10832. this.inAnimTrigger = false;
  10833. this.collisionsEnabled = this.properties[3] !== 0;
  10834. if (!(this.type.animations.length === 1 && this.type.animations[0].frames.length === 1) && this.type.animations[0].speed !== 0) {
  10835. this.runtime.tickMe(this);
  10836. this.isTicking = true
  10837. }
  10838. this.cur_animation = this.getAnimationByName(this.properties[1]) || this.type.animations[0];
  10839. this.cur_frame = this.properties[2];
  10840. if (this.cur_frame < 0) this.cur_frame = 0;
  10841. if (this.cur_frame >= this.cur_animation.frames.length) this.cur_frame = this.cur_animation.frames.length - 1;
  10842. var e = this.cur_animation.frames[this.cur_frame];
  10843. this.collision_poly.set_pts(e.poly_pts);
  10844. this.hotspotX = e.hotspotX;
  10845. this.hotspotY = e.hotspotY;
  10846. this.cur_anim_speed = this.cur_animation.speed;
  10847. if (this.recycled) this.animTimer.reset();
  10848. else this.animTimer = new cr.KahanAdder;
  10849. this.frameStart = this.getNowTime();
  10850. this.animPlaying = true;
  10851. this.animRepeats = 0;
  10852. this.animForwards = true;
  10853. this.animTriggerName = "";
  10854. this.changeAnimName = "";
  10855. this.changeAnimFrom = 0;
  10856. this.changeAnimFrame = -1;
  10857. this.type.loadTextures();
  10858. var t, n, r, i;
  10859. var s, o, u, a;
  10860. for (t = 0, n = this.type.animations.length; t < n; t++) {
  10861. s = this.type.animations[t];
  10862. for (r = 0, i = s.frames.length; r < i; r++) {
  10863. o = s.frames[r];
  10864. if (o.width === 0) {
  10865. o.width = o.texture_img.width;
  10866. o.height = o.texture_img.height
  10867. }
  10868. if (o.spritesheeted) {
  10869. a = o.texture_img;
  10870. u = o.sheetTex;
  10871. u.left = o.offx / a.width;
  10872. u.top = o.offy / a.height;
  10873. u.right = (o.offx + o.width) / a.width;
  10874. u.bottom = (o.offy + o.height) / a.height;
  10875. if (o.offx === 0 && o.offy === 0 && o.width === a.width && o.height === a.height) {
  10876. o.spritesheeted = false
  10877. }
  10878. }
  10879. }
  10880. }
  10881. this.curFrame = this.cur_animation.frames[this.cur_frame];
  10882. this.curWebGLTexture = this.curFrame.webGL_texture
  10883. };
  10884. i.saveToJSON = function() {
  10885. var e = {
  10886. a: this.cur_animation.sid,
  10887. f: this.cur_frame,
  10888. cas: this.cur_anim_speed,
  10889. fs: this.frameStart,
  10890. ar: this.animRepeats,
  10891. at: this.animTimer.sum
  10892. };
  10893. if (!this.animPlaying) e["ap"] = this.animPlaying;
  10894. if (!this.animForwards) e["af"] = this.animForwards;
  10895. return e
  10896. };
  10897. i.loadFromJSON = function(e) {
  10898. var t = this.getAnimationBySid(e["a"]);
  10899. if (t) this.cur_animation = t;
  10900. this.cur_frame = e["f"];
  10901. if (this.cur_frame < 0) this.cur_frame = 0;
  10902. if (this.cur_frame >= this.cur_animation.frames.length) this.cur_frame = this.cur_animation.frames.length - 1;
  10903. this.cur_anim_speed = e["cas"];
  10904. this.frameStart = e["fs"];
  10905. this.animRepeats = e["ar"];
  10906. this.animTimer.reset();
  10907. this.animTimer.sum = e["at"];
  10908. this.animPlaying = e.hasOwnProperty("ap") ? e["ap"] : true;
  10909. this.animForwards = e.hasOwnProperty("af") ? e["af"] : true;
  10910. this.curFrame = this.cur_animation.frames[this.cur_frame];
  10911. this.curWebGLTexture = this.curFrame.webGL_texture;
  10912. this.collision_poly.set_pts(this.curFrame.poly_pts);
  10913. this.hotspotX = this.curFrame.hotspotX;
  10914. this.hotspotY = this.curFrame.hotspotY
  10915. };
  10916. i.animationFinish = function(e) {
  10917. this.cur_frame = e ? 0 : this.cur_animation.frames.length - 1;
  10918. this.animPlaying = false;
  10919. this.animTriggerName = this.cur_animation.name;
  10920. this.inAnimTrigger = true;
  10921. this.runtime.trigger(cr.plugins_.Sprite.prototype.cnds.OnAnyAnimFinished, this);
  10922. this.runtime.trigger(cr.plugins_.Sprite.prototype.cnds.OnAnimFinished, this);
  10923. this.inAnimTrigger = false;
  10924. this.animRepeats = 0
  10925. };
  10926. i.getNowTime = function() {
  10927. return this.animTimer.sum
  10928. };
  10929. i.tick = function() {
  10930. this.animTimer.add(this.runtime.getDt(this));
  10931. if (this.changeAnimName.length) this.doChangeAnim();
  10932. if (this.changeAnimFrame >= 0) this.doChangeAnimFrame();
  10933. var e = this.getNowTime();
  10934. var t = this.cur_animation;
  10935. var n = t.frames[this.cur_frame];
  10936. var r;
  10937. var i = n.duration / this.cur_anim_speed;
  10938. if (this.animPlaying && e >= this.frameStart + i) {
  10939. if (this.animForwards) {
  10940. this.cur_frame++
  10941. } else {
  10942. this.cur_frame--
  10943. }
  10944. this.frameStart += i;
  10945. if (this.cur_frame >= t.frames.length) {
  10946. if (t.pingpong) {
  10947. this.animForwards = false;
  10948. this.cur_frame = t.frames.length - 2
  10949. } else if (t.loop) {
  10950. this.cur_frame = t.repeatto
  10951. } else {
  10952. this.animRepeats++;
  10953. if (this.animRepeats >= t.repeatcount) {
  10954. this.animationFinish(false)
  10955. } else {
  10956. this.cur_frame = t.repeatto
  10957. }
  10958. }
  10959. }
  10960. if (this.cur_frame < 0) {
  10961. if (t.pingpong) {
  10962. this.cur_frame = 1;
  10963. this.animForwards = true;
  10964. if (!t.loop) {
  10965. this.animRepeats++;
  10966. if (this.animRepeats >= t.repeatcount) {
  10967. this.animationFinish(true)
  10968. }
  10969. }
  10970. } else {
  10971. if (t.loop) {
  10972. this.cur_frame = t.repeatto
  10973. } else {
  10974. this.animRepeats++;
  10975. if (this.animRepeats >= t.repeatcount) {
  10976. this.animationFinish(true)
  10977. } else {
  10978. this.cur_frame = t.repeatto
  10979. }
  10980. }
  10981. }
  10982. }
  10983. if (this.cur_frame < 0) this.cur_frame = 0;
  10984. else if (this.cur_frame >= t.frames.length) this.cur_frame = t.frames.length - 1;
  10985. if (e > this.frameStart + t.frames[this.cur_frame].duration / this.cur_anim_speed) {
  10986. this.frameStart = e
  10987. }
  10988. r = t.frames[this.cur_frame];
  10989. this.OnFrameChanged(n, r);
  10990. this.runtime.redraw = true
  10991. }
  10992. };
  10993. i.getAnimationByName = function(e) {
  10994. var t, n, r;
  10995. for (t = 0, n = this.type.animations.length; t < n; t++) {
  10996. r = this.type.animations[t];
  10997. if (cr.equals_nocase(r.name, e)) return r
  10998. }
  10999. return null
  11000. };
  11001. i.getAnimationBySid = function(e) {
  11002. var t, n, r;
  11003. for (t = 0, n = this.type.animations.length; t < n; t++) {
  11004. r = this.type.animations[t];
  11005. if (r.sid === e) return r
  11006. }
  11007. return null
  11008. };
  11009. i.doChangeAnim = function() {
  11010. var e = this.cur_animation.frames[this.cur_frame];
  11011. var t = this.getAnimationByName(this.changeAnimName);
  11012. this.changeAnimName = "";
  11013. if (!t) return;
  11014. if (cr.equals_nocase(t.name, this.cur_animation.name) && this.animPlaying) return;
  11015. this.cur_animation = t;
  11016. this.cur_anim_speed = t.speed;
  11017. if (this.cur_frame < 0) this.cur_frame = 0;
  11018. if (this.cur_frame >= this.cur_animation.frames.length) this.cur_frame = this.cur_animation.frames.length - 1;
  11019. if (this.changeAnimFrom === 1) this.cur_frame = 0;
  11020. this.animPlaying = true;
  11021. this.frameStart = this.getNowTime();
  11022. this.animForwards = true;
  11023. this.OnFrameChanged(e, this.cur_animation.frames[this.cur_frame]);
  11024. this.runtime.redraw = true
  11025. };
  11026. i.doChangeAnimFrame = function() {
  11027. var e = this.cur_animation.frames[this.cur_frame];
  11028. var t = this.cur_frame;
  11029. this.cur_frame = cr.floor(this.changeAnimFrame);
  11030. if (this.cur_frame < 0) this.cur_frame = 0;
  11031. if (this.cur_frame >= this.cur_animation.frames.length) this.cur_frame = this.cur_animation.frames.length - 1;
  11032. if (t !== this.cur_frame) {
  11033. this.OnFrameChanged(e, this.cur_animation.frames[this.cur_frame]);
  11034. this.frameStart = this.getNowTime();
  11035. this.runtime.redraw = true
  11036. }
  11037. this.changeAnimFrame = -1
  11038. };
  11039. i.OnFrameChanged = function(e, t) {
  11040. var n = e.width;
  11041. var r = e.height;
  11042. var i = t.width;
  11043. var s = t.height;
  11044. if (n != i) this.width *= i / n;
  11045. if (r != s) this.height *= s / r;
  11046. this.hotspotX = t.hotspotX;
  11047. this.hotspotY = t.hotspotY;
  11048. this.collision_poly.set_pts(t.poly_pts);
  11049. this.set_bbox_changed();
  11050. this.curFrame = t;
  11051. this.curWebGLTexture = t.webGL_texture;
  11052. var o, u, a;
  11053. for (o = 0, u = this.behavior_insts.length; o < u; o++) {
  11054. a = this.behavior_insts[o];
  11055. if (a.onSpriteFrameChanged) a.onSpriteFrameChanged(e, t)
  11056. }
  11057. this.runtime.trigger(cr.plugins_.Sprite.prototype.cnds.OnFrameChanged, this)
  11058. };
  11059. i.draw = function(e) {
  11060. e.globalAlpha = this.opacity;
  11061. var t = this.curFrame;
  11062. var n = t.spritesheeted;
  11063. var r = t.texture_img;
  11064. var i = this.x;
  11065. var s = this.y;
  11066. var o = this.width;
  11067. var u = this.height;
  11068. if (this.angle === 0 && o >= 0 && u >= 0) {
  11069. i -= this.hotspotX * o;
  11070. s -= this.hotspotY * u;
  11071. if (this.runtime.pixel_rounding) {
  11072. i = i + .5 | 0;
  11073. s = s + .5 | 0
  11074. }
  11075. if (n) {
  11076. e.drawImage(r, t.offx, t.offy, t.width, t.height, i, s, o, u)
  11077. } else {
  11078. e.drawImage(r, i, s, o, u)
  11079. }
  11080. } else {
  11081. if (this.runtime.pixel_rounding) {
  11082. i = i + .5 | 0;
  11083. s = s + .5 | 0
  11084. }
  11085. e.save();
  11086. var a = o > 0 ? 1 : -1;
  11087. var f = u > 0 ? 1 : -1;
  11088. e.translate(i, s);
  11089. if (a !== 1 || f !== 1) e.scale(a, f);
  11090. e.rotate(this.angle * a * f);
  11091. var l = 0 - this.hotspotX * cr.abs(o);
  11092. var c = 0 - this.hotspotY * cr.abs(u);
  11093. if (n) {
  11094. e.drawImage(r, t.offx, t.offy, t.width, t.height, l, c, cr.abs(o), cr.abs(u))
  11095. } else {
  11096. e.drawImage(r, l, c, cr.abs(o), cr.abs(u))
  11097. }
  11098. e.restore()
  11099. }
  11100. };
  11101. i.drawGL = function(e) {
  11102. e.setTexture(this.curWebGLTexture);
  11103. e.setOpacity(this.opacity);
  11104. var t = this.curFrame;
  11105. var n = this.bquad;
  11106. if (this.runtime.pixel_rounding) {
  11107. var r = (this.x + .5 | 0) - this.x;
  11108. var i = (this.y + .5 | 0) - this.y;
  11109. if (t.spritesheeted) e.quadTex(n.tlx + r, n.tly + i, n.trx + r, n.try_ + i, n.brx + r, n.bry + i, n.blx + r, n.bly + i, t.sheetTex);
  11110. else e.quad(n.tlx + r, n.tly + i, n.trx + r, n.try_ + i, n.brx + r, n.bry + i, n.blx + r, n.bly + i)
  11111. } else {
  11112. if (t.spritesheeted) e.quadTex(n.tlx, n.tly, n.trx, n.try_, n.brx, n.bry, n.blx, n.bly, t.sheetTex);
  11113. else e.quad(n.tlx, n.tly, n.trx, n.try_, n.brx, n.bry, n.blx, n.bly)
  11114. }
  11115. };
  11116. i.getImagePointIndexByName = function(e) {
  11117. var t = this.curFrame;
  11118. var n, r;
  11119. for (n = 0, r = t.image_points.length; n < r; n++) {
  11120. if (cr.equals_nocase(e, t.image_points[n][0])) return n
  11121. }
  11122. return -1
  11123. };
  11124. i.getImagePoint = function(e, t) {
  11125. var n = this.curFrame;
  11126. var r = n.image_points;
  11127. var i;
  11128. if (cr.is_string(e)) i = this.getImagePointIndexByName(e);
  11129. else i = e - 1;
  11130. i = cr.floor(i);
  11131. if (i < 0 || i >= r.length) return t ? this.x : this.y;
  11132. var s = (r[i][1] - n.hotspotX) * this.width;
  11133. var o = r[i][2];
  11134. o = (o - n.hotspotY) * this.height;
  11135. var u = Math.cos(this.angle);
  11136. var a = Math.sin(this.angle);
  11137. var f = s * u - o * a;
  11138. o = o * u + s * a;
  11139. s = f;
  11140. s += this.x;
  11141. o += this.y;
  11142. return t ? s : o
  11143. };
  11144. var o = [];
  11145. s.prototype.OnCollision = function(e) {
  11146. if (!e) return false;
  11147. var t = this.runtime;
  11148. var n = t.getCurrentCondition();
  11149. var r = n.type;
  11150. if (!n.extra.collmemory) {
  11151. n.extra.collmemory = [];
  11152. t.addDestroyCallback(function(e) {
  11153. return function(t) {
  11154. c(e, t)
  11155. }
  11156. }(n.extra.collmemory))
  11157. }
  11158. var i = r.getCurrentSol();
  11159. var s = e.getCurrentSol();
  11160. var o = i.getObjects();
  11161. var u = s.getObjects();
  11162. var a, p, d, v;
  11163. var m, g;
  11164. var y = t.getCurrentEventStack().current_event;
  11165. var b = y.orblock;
  11166. for (a = 0; a < o.length; a++) {
  11167. p = o[a];
  11168. for (d = 0; d < u.length; d++) {
  11169. v = u[d];
  11170. if (t.testOverlap(p, v) || t.checkRegisteredCollision(p, v)) {
  11171. if (!h(n.extra.collmemory, p, v)) {
  11172. f(n.extra.collmemory, p, v);
  11173. t.pushCopySol(y.solModifiers);
  11174. m = r.getCurrentSol();
  11175. g = e.getCurrentSol();
  11176. m.select_all = false;
  11177. g.select_all = false;
  11178. if (r === e) {
  11179. m.instances.length = 2;
  11180. m.instances[0] = p;
  11181. m.instances[1] = v;
  11182. r.applySolToContainer()
  11183. } else {
  11184. m.instances.length = 1;
  11185. g.instances.length = 1;
  11186. m.instances[0] = p;
  11187. g.instances[0] = v;
  11188. r.applySolToContainer();
  11189. e.applySolToContainer()
  11190. }
  11191. y.retrigger();
  11192. t.popSol(y.solModifiers)
  11193. }
  11194. } else {
  11195. l(n.extra.collmemory, p, v)
  11196. }
  11197. }
  11198. }
  11199. return false
  11200. };
  11201. var p = null;
  11202. var d = new cr.ObjectSet;
  11203. var v = false;
  11204. t.finish = function(e) {
  11205. if (!v) return;
  11206. if (e) {
  11207. var t = this.runtime.getCurrentEventStack().current_event.orblock;
  11208. var n = p.getCurrentSol();
  11209. var r = d.valuesRef();
  11210. var i, s, o;
  11211. if (n.select_all) {
  11212. n.select_all = false;
  11213. n.instances.length = r.length;
  11214. for (i = 0, s = r.length; i < s; i++) {
  11215. n.instances[i] = r[i]
  11216. }
  11217. if (t) {
  11218. n.else_instances.length = 0;
  11219. for (i = 0, s = p.instances.length; i < s; i++) {
  11220. o = p.instances[i];
  11221. if (!d.contains(o)) n.else_instances.push(o)
  11222. }
  11223. }
  11224. } else {
  11225. var u = n.instances.length;
  11226. n.instances.length = u + r.length;
  11227. for (i = 0, s = r.length; i < s; i++) {
  11228. n.instances[u + i] = r[i];
  11229. if (t) cr.arrayFindRemove(n.else_instances, r[i])
  11230. }
  11231. }
  11232. p.applySolToContainer()
  11233. }
  11234. d.clear();
  11235. v = false
  11236. };
  11237. s.prototype.IsOverlapping = function(e) {
  11238. return m.call(this, e, 0, 0)
  11239. };
  11240. s.prototype.IsOverlappingOffset = function(e, t, n) {
  11241. return m.call(this, e, t, n)
  11242. };
  11243. s.prototype.IsAnimPlaying = function(e) {
  11244. if (this.changeAnimName.length) return cr.equals_nocase(this.changeAnimName, e);
  11245. else return cr.equals_nocase(this.cur_animation.name, e)
  11246. };
  11247. s.prototype.CompareFrame = function(e, t) {
  11248. return cr.do_cmp(this.cur_frame, e, t)
  11249. };
  11250. s.prototype.OnAnimFinished = function(e) {
  11251. return cr.equals_nocase(this.animTriggerName, e)
  11252. };
  11253. s.prototype.OnAnyAnimFinished = function() {
  11254. return true
  11255. };
  11256. s.prototype.OnFrameChanged = function() {
  11257. return true
  11258. };
  11259. s.prototype.IsMirrored = function() {
  11260. return this.width < 0
  11261. };
  11262. s.prototype.IsFlipped = function() {
  11263. return this.height < 0
  11264. };
  11265. s.prototype.OnURLLoaded = function() {
  11266. return true
  11267. };
  11268. s.prototype.IsCollisionEnabled = function() {
  11269. return this.collisionsEnabled
  11270. };
  11271. e.cnds = new s;
  11272. g.prototype.Spawn = function(e, t, n) {
  11273. if (!e || !t) return;
  11274. var r = this.runtime.createInstance(e, t, this.getImagePoint(n, true), this.getImagePoint(n, false));
  11275. if (!r) return;
  11276. if (typeof r.angle !== "undefined") {
  11277. r.angle = this.angle;
  11278. r.set_bbox_changed()
  11279. }
  11280. this.runtime.isInOnDestroy++;
  11281. var i, s, o;
  11282. this.runtime.trigger(Object.getPrototypeOf(e.plugin).cnds.OnCreated, r);
  11283. if (r.is_contained) {
  11284. for (i = 0, s = r.siblings.length; i < s; i++) {
  11285. o = r.siblings[i];
  11286. this.runtime.trigger(Object.getPrototypeOf(o.type.plugin).cnds.OnCreated, o)
  11287. }
  11288. }
  11289. this.runtime.isInOnDestroy--;
  11290. var u = this.runtime.getCurrentAction();
  11291. var a = false;
  11292. if (cr.is_undefined(u.extra.Spawn_LastExec) || u.extra.Spawn_LastExec < this.runtime.execcount) {
  11293. a = true;
  11294. u.extra.Spawn_LastExec = this.runtime.execcount
  11295. }
  11296. var f;
  11297. if (e != this.type) {
  11298. f = e.getCurrentSol();
  11299. f.select_all = false;
  11300. if (a) {
  11301. f.instances.length = 1;
  11302. f.instances[0] = r
  11303. } else f.instances.push(r);
  11304. if (r.is_contained) {
  11305. for (i = 0, s = r.siblings.length; i < s; i++) {
  11306. o = r.siblings[i];
  11307. f = o.type.getCurrentSol();
  11308. f.select_all = false;
  11309. if (a) {
  11310. f.instances.length = 1;
  11311. f.instances[0] = o
  11312. } else f.instances.push(o)
  11313. }
  11314. }
  11315. }
  11316. };
  11317. g.prototype.SetEffect = function(e) {
  11318. this.compositeOp = cr.effectToCompositeOp(e);
  11319. cr.setGLBlend(this, e, this.runtime.gl);
  11320. this.runtime.redraw = true
  11321. };
  11322. g.prototype.StopAnim = function() {
  11323. this.animPlaying = false
  11324. };
  11325. g.prototype.StartAnim = function(e) {
  11326. this.animPlaying = true;
  11327. this.frameStart = this.getNowTime();
  11328. if (e === 1 && this.cur_frame !== 0) {
  11329. this.changeAnimFrame = 0;
  11330. if (!this.inAnimTrigger) this.doChangeAnimFrame()
  11331. }
  11332. if (!this.isTicking) {
  11333. this.runtime.tickMe(this);
  11334. this.isTicking = true
  11335. }
  11336. };
  11337. g.prototype.SetAnim = function(e, t) {
  11338. this.changeAnimName = e;
  11339. this.changeAnimFrom = t;
  11340. if (!this.isTicking) {
  11341. this.runtime.tickMe(this);
  11342. this.isTicking = true
  11343. }
  11344. if (!this.inAnimTrigger) this.doChangeAnim()
  11345. };
  11346. g.prototype.SetAnimFrame = function(e) {
  11347. this.changeAnimFrame = e;
  11348. if (!this.isTicking) {
  11349. this.runtime.tickMe(this);
  11350. this.isTicking = true
  11351. }
  11352. if (!this.inAnimTrigger) this.doChangeAnimFrame()
  11353. };
  11354. g.prototype.SetAnimSpeed = function(e) {
  11355. this.cur_anim_speed = cr.abs(e);
  11356. this.animForwards = e >= 0;
  11357. if (!this.isTicking) {
  11358. this.runtime.tickMe(this);
  11359. this.isTicking = true
  11360. }
  11361. };
  11362. g.prototype.SetMirrored = function(e) {
  11363. var t = cr.abs(this.width) * (e === 0 ? -1 : 1);
  11364. if (this.width === t) return;
  11365. this.width = t;
  11366. this.set_bbox_changed()
  11367. };
  11368. g.prototype.SetFlipped = function(e) {
  11369. var t = cr.abs(this.height) * (e === 0 ? -1 : 1);
  11370. if (this.height === t) return;
  11371. this.height = t;
  11372. this.set_bbox_changed()
  11373. };
  11374. g.prototype.SetScale = function(e) {
  11375. var t = this.curFrame;
  11376. var n = this.width < 0 ? -1 : 1;
  11377. var r = this.height < 0 ? -1 : 1;
  11378. var i = t.width * e * n;
  11379. var s = t.height * e * r;
  11380. if (this.width !== i || this.height !== s) {
  11381. this.width = i;
  11382. this.height = s;
  11383. this.set_bbox_changed()
  11384. }
  11385. };
  11386. g.prototype.LoadURL = function(e, t) {
  11387. var n = new Image;
  11388. var r = this;
  11389. var i = this.curFrame;
  11390. n.onload = function() {
  11391. if (i.texture_img.src === n.src) {
  11392. if (r.runtime.glwrap && r.curFrame === i) r.curWebGLTexture = i.webGL_texture;
  11393. r.runtime.redraw = true;
  11394. r.runtime.trigger(cr.plugins_.Sprite.prototype.cnds.OnURLLoaded, r);
  11395. return
  11396. }
  11397. i.texture_img = n;
  11398. i.offx = 0;
  11399. i.offy = 0;
  11400. i.width = n.width;
  11401. i.height = n.height;
  11402. i.spritesheeted = false;
  11403. i.datauri = "";
  11404. if (r.runtime.glwrap) {
  11405. if (i.webGL_texture) r.runtime.glwrap.deleteTexture(i.webGL_texture);
  11406. i.webGL_texture = r.runtime.glwrap.loadTexture(n, false, r.runtime.linearSampling);
  11407. if (r.curFrame === i) r.curWebGLTexture = i.webGL_texture;
  11408. r.type.updateAllCurrentTexture()
  11409. }
  11410. if (t === 0) {
  11411. r.width = n.width;
  11412. r.height = n.height;
  11413. r.set_bbox_changed()
  11414. }
  11415. r.runtime.redraw = true;
  11416. r.runtime.trigger(cr.plugins_.Sprite.prototype.cnds.OnURLLoaded, r)
  11417. };
  11418. if (e.substr(0, 5) !== "data:") n.crossOrigin = "anonymous";
  11419. n.src = e
  11420. };
  11421. g.prototype.SetCollisions = function(e) {
  11422. this.collisionsEnabled = e !== 0
  11423. };
  11424. e.acts = new g;
  11425. y.prototype.AnimationFrame = function(e) {
  11426. e.set_int(this.cur_frame)
  11427. };
  11428. y.prototype.AnimationFrameCount = function(e) {
  11429. e.set_int(this.cur_animation.frames.length)
  11430. };
  11431. y.prototype.AnimationName = function(e) {
  11432. e.set_string(this.cur_animation.name)
  11433. };
  11434. y.prototype.AnimationSpeed = function(e) {
  11435. e.set_float(this.cur_anim_speed)
  11436. };
  11437. y.prototype.ImagePointX = function(e, t) {
  11438. e.set_float(this.getImagePoint(t, true))
  11439. };
  11440. y.prototype.ImagePointY = function(e, t) {
  11441. e.set_float(this.getImagePoint(t, false))
  11442. };
  11443. y.prototype.ImagePointCount = function(e) {
  11444. e.set_int(this.curFrame.image_points.length)
  11445. };
  11446. y.prototype.ImageWidth = function(e) {
  11447. e.set_float(this.curFrame.width)
  11448. };
  11449. y.prototype.ImageHeight = function(e) {
  11450. e.set_float(this.curFrame.height)
  11451. };
  11452. e.exps = new y
  11453. })();
  11454. cr.plugins_.Spritefont2 = function(e) {
  11455. this.runtime = e
  11456. };
  11457. (function() {
  11458. function r(e) {
  11459. return e.replace(/\s\s*$/, "")
  11460. }
  11461. function s(e, t) {
  11462. if (e.length) return e.pop();
  11463. else return new t
  11464. }
  11465. function o(e, t) {
  11466. if (e.length < i) {
  11467. e.push(t)
  11468. }
  11469. }
  11470. function u(e, t, n) {
  11471. if (n) {
  11472. var r, i;
  11473. for (r = 0, i = t.length; r < i; r++) {
  11474. o(e, t[r])
  11475. }
  11476. t.length = 0
  11477. } else {
  11478. var s;
  11479. for (s in t) {
  11480. if (Object.prototype.hasOwnProperty.call(t, s)) {
  11481. o(e, t[s]);
  11482. delete t[s]
  11483. }
  11484. }
  11485. }
  11486. }
  11487. function a(e, t, n) {
  11488. var i = e.lines;
  11489. var s;
  11490. n = r(n);
  11491. if (t >= i.length) i.push(l());
  11492. s = i[t];
  11493. s.text = n;
  11494. s.width = e.measureWidth(n);
  11495. e.textWidth = cr.max(e.textWidth, s.width)
  11496. }
  11497. function l() {
  11498. return s(f, Object)
  11499. }
  11500. function c(e) {
  11501. o(f, e)
  11502. }
  11503. function h(e) {
  11504. u(f, e, true)
  11505. }
  11506. function p(e, t, n, r, i, o) {
  11507. if (e[t] === undefined) {
  11508. e[t] = s(d, Object)
  11509. }
  11510. e[t].x = n;
  11511. e[t].y = r;
  11512. e[t].w = i;
  11513. e[t].h = o
  11514. }
  11515. function v() {
  11516. return s(d, Object)
  11517. }
  11518. function m(e) {
  11519. u(d, e, false)
  11520. }
  11521. function g(e, t, n, r, i, o) {
  11522. if (e[t] === undefined) {
  11523. e[t] = s(y, cr.rect)
  11524. }
  11525. e[t].left = n;
  11526. e[t].top = r;
  11527. e[t].right = i;
  11528. e[t].bottom = o
  11529. }
  11530. function b() {
  11531. return s(y, cr.rect)
  11532. }
  11533. function w(e) {
  11534. u(y, e, false)
  11535. }
  11536. function T(e, t, n) {
  11537. var r;
  11538. r = e.tlx * t - e.tly * n;
  11539. e.tly = e.tly * t + e.tlx * n;
  11540. e.tlx = r;
  11541. r = e.trx * t - e.try_ * n;
  11542. e.try_ = e.try_ * t + e.trx * n;
  11543. e.trx = r;
  11544. r = e.blx * t - e.bly * n;
  11545. e.bly = e.bly * t + e.blx * n;
  11546. e.blx = r;
  11547. r = e.brx * t - e.bry * n;
  11548. e.bry = e.bry * t + e.brx * n;
  11549. e.brx = r
  11550. }
  11551. function N() {}
  11552. function C() {}
  11553. function k() {}
  11554. var e = cr.plugins_.Spritefont2.prototype;
  11555. e.onCreate = function() {};
  11556. e.Type = function(e) {
  11557. this.plugin = e;
  11558. this.runtime = e.runtime
  11559. };
  11560. var t = e.Type.prototype;
  11561. t.onCreate = function() {
  11562. if (this.is_family) return;
  11563. this.texture_img = new Image;
  11564. this.texture_img["idtkLoadDisposed"] = true;
  11565. this.texture_img.src = this.texture_file;
  11566. this.runtime.wait_for_textures.push(this.texture_img);
  11567. this.webGL_texture = null
  11568. };
  11569. t.onLostWebGLContext = function() {
  11570. if (this.is_family) return;
  11571. this.webGL_texture = null
  11572. };
  11573. t.onRestoreWebGLContext = function() {
  11574. if (this.is_family || !this.instances.length) return;
  11575. if (!this.webGL_texture) {
  11576. this.webGL_texture = this.runtime.glwrap.loadTexture(this.texture_img, false, this.runtime.linearSampling, this.texture_pixelformat)
  11577. }
  11578. var e, t;
  11579. for (e = 0, t = this.instances.length; e < t; e++) this.instances[e].webGL_texture = this.webGL_texture
  11580. };
  11581. t.unloadTextures = function() {
  11582. if (this.is_family || this.instances.length || !this.webGL_texture) return;
  11583. this.runtime.glwrap.deleteTexture(this.webGL_texture);
  11584. this.webGL_texture = null
  11585. };
  11586. t.preloadCanvas2D = function(e) {
  11587. e.drawImage(this.texture_img, 0, 0)
  11588. };
  11589. e.Instance = function(e) {
  11590. this.type = e;
  11591. this.runtime = e.runtime
  11592. };
  11593. var n = e.Instance.prototype;
  11594. n.onDestroy = function() {
  11595. h(this.lines);
  11596. m(this.clipList);
  11597. w(this.clipUV);
  11598. cr.wipe(this.characterWidthList)
  11599. };
  11600. n.onCreate = function() {
  11601. this.texture_img = this.type.texture_img;
  11602. this.characterWidth = this.properties[0];
  11603. this.characterHeight = this.properties[1];
  11604. this.characterSet = this.properties[2];
  11605. this.text = this.properties[3];
  11606. this.characterScale = this.properties[4];
  11607. this.visible = this.properties[5] === 0;
  11608. this.halign = this.properties[6] / 2;
  11609. this.valign = this.properties[7] / 2;
  11610. this.wrapbyword = this.properties[9] === 0;
  11611. this.characterSpacing = this.properties[10];
  11612. this.lineHeight = this.properties[11];
  11613. this.textWidth = 0;
  11614. this.textHeight = 0;
  11615. if (this.recycled) {
  11616. this.lines.length = 0;
  11617. cr.wipe(this.clipList);
  11618. cr.wipe(this.clipUV);
  11619. cr.wipe(this.characterWidthList)
  11620. } else {
  11621. this.lines = [];
  11622. this.clipList = {};
  11623. this.clipUV = {};
  11624. this.characterWidthList = {}
  11625. }
  11626. this.text_changed = true;
  11627. this.lastwrapwidth = this.width;
  11628. if (this.runtime.glwrap) {
  11629. if (!this.type.webGL_texture) {
  11630. this.type.webGL_texture = this.runtime.glwrap.loadTexture(this.type.texture_img, false, this.runtime.linearSampling, this.type.texture_pixelformat)
  11631. }
  11632. this.webGL_texture = this.type.webGL_texture
  11633. }
  11634. this.SplitSheet()
  11635. };
  11636. n.saveToJSON = function() {
  11637. var e = {
  11638. t: this.text,
  11639. csc: this.characterScale,
  11640. csp: this.characterSpacing,
  11641. lh: this.lineHeight,
  11642. tw: this.textWidth,
  11643. th: this.textHeight,
  11644. lrt: this.last_render_tick,
  11645. cw: {}
  11646. };
  11647. for (var t in this.characterWidthList) e["cw"][t] = this.characterWidthList[t];
  11648. return e
  11649. };
  11650. n.loadFromJSON = function(e) {
  11651. this.text = e["t"];
  11652. this.characterScale = e["csc"];
  11653. this.characterSpacing = e["csp"];
  11654. this.lineHeight = e["lh"];
  11655. this.textWidth = e["tw"];
  11656. this.textHeight = e["th"];
  11657. this.last_render_tick = e["lrt"];
  11658. for (var t in e["cw"]) this.characterWidthList[t] = e["cw"][t];
  11659. this.text_changed = true;
  11660. this.lastwrapwidth = this.width
  11661. };
  11662. var i = 1e3;
  11663. var f = [];
  11664. var d = [];
  11665. var y = [];
  11666. n.SplitSheet = function() {
  11667. var e = this.texture_img;
  11668. var t = e.width;
  11669. var n = e.height;
  11670. var r = this.characterWidth;
  11671. var i = this.characterHeight;
  11672. var s = r / t;
  11673. var o = i / n;
  11674. var u = this.characterSet;
  11675. var a = Math.floor(t / r);
  11676. var f = Math.floor(n / i);
  11677. for (var l = 0; l < u.length; l++) {
  11678. if (l >= a * f) break;
  11679. var c = l % a;
  11680. var h = Math.floor(l / a);
  11681. var d = u.charAt(l);
  11682. if (this.runtime.glwrap) {
  11683. g(this.clipUV, d, c * s, h * o, (c + 1) * s, (h + 1) * o)
  11684. } else {
  11685. p(this.clipList, d, c * r, h * i, r, i)
  11686. }
  11687. }
  11688. };
  11689. var E = [];
  11690. e.TokeniseWords = function(e) {
  11691. E.length = 0;
  11692. var t = "";
  11693. var n;
  11694. var r = 0;
  11695. while (r < e.length) {
  11696. n = e.charAt(r);
  11697. if (n === "\n") {
  11698. if (t.length) {
  11699. E.push(t);
  11700. t = ""
  11701. }
  11702. E.push("\n");
  11703. ++r
  11704. } else if (n === " " || n === " " || n === "-") {
  11705. do {
  11706. t += e.charAt(r);
  11707. r++
  11708. } while (r < e.length && (e.charAt(r) === " " || e.charAt(r) === " "));
  11709. E.push(t);
  11710. t = ""
  11711. } else if (r < e.length) {
  11712. t += n;
  11713. r++
  11714. }
  11715. }
  11716. if (t.length) E.push(t)
  11717. };
  11718. e.WordWrap = function(e) {
  11719. var t = e.text;
  11720. var n = e.lines;
  11721. if (!t || !t.length) {
  11722. h(n);
  11723. return
  11724. }
  11725. var r = e.width;
  11726. if (r <= 2) {
  11727. h(n);
  11728. return
  11729. }
  11730. var i = e.characterWidth;
  11731. var s = e.characterScale;
  11732. var o = e.characterSpacing;
  11733. if (t.length * (i * s + o) - o <= r && t.indexOf("\n") === -1) {
  11734. var u = e.measureWidth(t);
  11735. if (u <= r) {
  11736. h(n);
  11737. n.push(l());
  11738. n[0].text = t;
  11739. n[0].width = u;
  11740. e.textWidth = u;
  11741. e.textHeight = e.characterHeight * s + e.lineHeight;
  11742. return
  11743. }
  11744. }
  11745. var a = e.wrapbyword;
  11746. this.WrapText(e);
  11747. e.textHeight = n.length * (e.characterHeight * s + e.lineHeight)
  11748. };
  11749. e.WrapText = function(e) {
  11750. var t = e.wrapbyword;
  11751. var n = e.text;
  11752. var i = e.lines;
  11753. var s = e.width;
  11754. var o;
  11755. if (t) {
  11756. this.TokeniseWords(n);
  11757. o = E
  11758. } else {
  11759. o = n
  11760. }
  11761. var u = "";
  11762. var f;
  11763. var l;
  11764. var h;
  11765. var p = 0;
  11766. var d;
  11767. var v = false;
  11768. for (h = 0; h < o.length; h++) {
  11769. if (o[h] === "\n") {
  11770. if (v === true) {
  11771. v = false
  11772. } else {
  11773. a(e, p, u);
  11774. p++
  11775. }
  11776. u = "";
  11777. continue
  11778. }
  11779. v = false;
  11780. f = u;
  11781. u += o[h];
  11782. l = e.measureWidth(r(u));
  11783. if (l > s) {
  11784. if (f === "") {
  11785. a(e, p, u);
  11786. u = "";
  11787. v = true
  11788. } else {
  11789. a(e, p, f);
  11790. u = o[h]
  11791. }
  11792. p++;
  11793. if (!t && u === " ") u = ""
  11794. }
  11795. }
  11796. if (r(u).length) {
  11797. a(e, p, u);
  11798. p++
  11799. }
  11800. for (h = p; h < i.length; h++) c(i[h]);
  11801. i.length = p
  11802. };
  11803. n.measureWidth = function(e) {
  11804. var t = this.characterSpacing;
  11805. var n = e.length;
  11806. var r = 0;
  11807. for (var i = 0; i < n; i++) {
  11808. r += this.getCharacterWidth(e.charAt(i)) * this.characterScale + t
  11809. }
  11810. r -= r > 0 ? t : 0;
  11811. return r
  11812. };
  11813. n.getCharacterWidth = function(e) {
  11814. var t = this.characterWidthList;
  11815. if (t[e] !== undefined) {
  11816. return t[e]
  11817. } else {
  11818. return this.characterWidth
  11819. }
  11820. };
  11821. n.rebuildText = function() {
  11822. if (this.text_changed || this.width !== this.lastwrapwidth) {
  11823. this.textWidth = 0;
  11824. this.textHeight = 0;
  11825. this.type.plugin.WordWrap(this);
  11826. this.text_changed = false;
  11827. this.lastwrapwidth = this.width
  11828. }
  11829. };
  11830. var S = 1e-5;
  11831. n.draw = function(e, t) {
  11832. var n = this.texture_img;
  11833. if (this.text !== "" && n != null) {
  11834. this.rebuildText();
  11835. if (this.height < this.characterHeight * this.characterScale + this.lineHeight) {
  11836. return
  11837. }
  11838. e.globalAlpha = this.opacity;
  11839. var r = this.x;
  11840. var i = this.y;
  11841. if (this.runtime.pixel_rounding) {
  11842. r = r + .5 | 0;
  11843. i = i + .5 | 0
  11844. }
  11845. e.save();
  11846. e.translate(r, i);
  11847. e.rotate(this.angle);
  11848. var s = this.halign;
  11849. var o = this.valign;
  11850. var u = this.characterScale;
  11851. var a = this.characterHeight * u;
  11852. var f = this.lineHeight;
  11853. var l = this.characterSpacing;
  11854. var c = this.lines;
  11855. var h = this.textHeight;
  11856. var p;
  11857. var d = o * cr.max(0, this.height - h);
  11858. var v = -(this.hotspotX * this.width);
  11859. var m = -(this.hotspotY * this.height);
  11860. m += d;
  11861. var g;
  11862. var y = m;
  11863. for (var b = 0; b < c.length; b++) {
  11864. var w = c[b].text;
  11865. var E = c[b].width;
  11866. p = s * cr.max(0, this.width - E);
  11867. g = v + p;
  11868. y += f;
  11869. for (var x = 0; x < w.length; x++) {
  11870. var T = w.charAt(x);
  11871. var N = this.clipList[T];
  11872. if (g + this.getCharacterWidth(T) * u > this.width + S) {
  11873. break
  11874. }
  11875. if (N !== undefined) {
  11876. e.drawImage(this.texture_img, N.x, N.y, N.w, N.h, Math.round(g), Math.round(y), N.w * u, N.h * u)
  11877. }
  11878. g += this.getCharacterWidth(T) * u + l
  11879. }
  11880. y += a;
  11881. if (y + a + f > this.height) {
  11882. break
  11883. }
  11884. }
  11885. e.restore()
  11886. }
  11887. };
  11888. var x = new cr.quad;
  11889. n.drawGL = function(e) {
  11890. e.setTexture(this.webGL_texture);
  11891. e.setOpacity(this.opacity);
  11892. if (this.text !== "") {
  11893. this.rebuildText();
  11894. if (this.height < this.characterHeight * this.characterScale + this.lineHeight) {
  11895. return
  11896. }
  11897. this.update_bbox();
  11898. var t = this.bquad;
  11899. var n = 0;
  11900. var r = 0;
  11901. if (this.runtime.pixel_rounding) {
  11902. n = (this.x + .5 | 0) - this.x;
  11903. r = (this.y + .5 | 0) - this.y
  11904. }
  11905. var i = this.angle;
  11906. var s = this.halign;
  11907. var o = this.valign;
  11908. var u = this.characterScale;
  11909. var a = this.characterHeight * u;
  11910. var f = this.lineHeight;
  11911. var l = this.characterSpacing;
  11912. var c = this.lines;
  11913. var h = this.textHeight;
  11914. var p, d;
  11915. if (i !== 0) {
  11916. p = Math.cos(i);
  11917. d = Math.sin(i)
  11918. }
  11919. var v;
  11920. var m = o * cr.max(0, this.height - h);
  11921. var g = t.tlx + n;
  11922. var y = t.tly + r;
  11923. var b;
  11924. var w = m;
  11925. for (var E = 0; E < c.length; E++) {
  11926. var N = c[E].text;
  11927. var C = c[E].width;
  11928. v = s * cr.max(0, this.width - C);
  11929. b = v;
  11930. w += f;
  11931. for (var k = 0; k < N.length; k++) {
  11932. var L = N.charAt(k);
  11933. var A = this.clipUV[L];
  11934. if (b + this.getCharacterWidth(L) * u > this.width + S) {
  11935. break
  11936. }
  11937. if (A !== undefined) {
  11938. var O = this.characterWidth * u;
  11939. var M = this.characterHeight * u;
  11940. x.tlx = b;
  11941. x.tly = w;
  11942. x.trx = b + O;
  11943. x.try_ = w;
  11944. x.blx = b;
  11945. x.bly = w + M;
  11946. x.brx = b + O;
  11947. x.bry = w + M;
  11948. if (i !== 0) {
  11949. T(x, p, d)
  11950. }
  11951. x.offset(g, y);
  11952. e.quadTex(x.tlx, x.tly, x.trx, x.try_, x.brx, x.bry, x.blx, x.bly, A)
  11953. }
  11954. b += this.getCharacterWidth(L) * u + l
  11955. }
  11956. w += a;
  11957. if (w + a + f > this.height) {
  11958. break
  11959. }
  11960. }
  11961. }
  11962. };
  11963. N.prototype.CompareText = function(e, t) {
  11964. if (t) return this.text == e;
  11965. else return cr.equals_nocase(this.text, e)
  11966. };
  11967. e.cnds = new N;
  11968. C.prototype.SetText = function(e) {
  11969. if (e.match(/BEST:/)) {
  11970. e = " " + getHighScore()
  11971. } else if (e.match(/MEJOR:/)) {
  11972. e = "MEJOR:" + getHighScore()
  11973. }
  11974. if (cr.is_number(e) && e < 1e9) e = Math.round(e * 1e10) / 1e10;
  11975. var t = e.toString();
  11976. if (this.text !== t) {
  11977. this.text = t;
  11978. this.text_changed = true;
  11979. this.runtime.redraw = true
  11980. }
  11981. };
  11982. C.prototype.AppendText = function(e) {
  11983. if (cr.is_number(e)) e = Math.round(e * 1e10) / 1e10;
  11984. var t = e.toString();
  11985. if (t) {
  11986. this.text += t;
  11987. this.text_changed = true;
  11988. this.runtime.redraw = true
  11989. }
  11990. };
  11991. C.prototype.SetScale = function(e) {
  11992. if (e !== this.characterScale) {
  11993. this.characterScale = e;
  11994. this.text_changed = true;
  11995. this.runtime.redraw = true
  11996. }
  11997. };
  11998. C.prototype.SetCharacterSpacing = function(e) {
  11999. if (e !== this.CharacterSpacing) {
  12000. this.characterSpacing = e;
  12001. this.text_changed = true;
  12002. this.runtime.redraw = true
  12003. }
  12004. };
  12005. C.prototype.SetLineHeight = function(e) {
  12006. if (e !== this.lineHeight) {
  12007. this.lineHeight = e;
  12008. this.text_changed = true;
  12009. this.runtime.redraw = true
  12010. }
  12011. };
  12012. n.SetCharWidth = function(e, t) {
  12013. var n = parseInt(t, 10);
  12014. if (this.characterWidthList[e] !== n) {
  12015. this.characterWidthList[e] = n;
  12016. this.text_changed = true;
  12017. this.runtime.redraw = true
  12018. }
  12019. };
  12020. C.prototype.SetCharacterWidth = function(e, t) {
  12021. if (e !== "") {
  12022. for (var n = 0; n < e.length; n++) {
  12023. this.SetCharWidth(e.charAt(n), t)
  12024. }
  12025. }
  12026. };
  12027. C.prototype.SetEffect = function(e) {
  12028. this.compositeOp = cr.effectToCompositeOp(e);
  12029. cr.setGLBlend(this, e, this.runtime.gl);
  12030. this.runtime.redraw = true
  12031. };
  12032. e.acts = new C;
  12033. k.prototype.CharacterWidth = function(e, t) {
  12034. e.set_int(this.getCharacterWidth(t))
  12035. };
  12036. k.prototype.CharacterHeight = function(e) {
  12037. e.set_int(this.characterHeight)
  12038. };
  12039. k.prototype.CharacterScale = function(e) {
  12040. e.set_float(this.characterScale)
  12041. };
  12042. k.prototype.CharacterSpacing = function(e) {
  12043. e.set_int(this.characterSpacing)
  12044. };
  12045. k.prototype.LineHeight = function(e) {
  12046. e.set_int(this.lineHeight)
  12047. };
  12048. k.prototype.Text = function(e) {
  12049. e.set_string(this.text)
  12050. };
  12051. k.prototype.TextWidth = function(e) {
  12052. this.rebuildText();
  12053. e.set_float(this.textWidth)
  12054. };
  12055. k.prototype.TextHeight = function(e) {
  12056. this.rebuildText();
  12057. e.set_float(this.textHeight)
  12058. };
  12059. e.exps = new k
  12060. })();
  12061. cr.plugins_.Text = function(e) {
  12062. this.runtime = e
  12063. };
  12064. (function() {
  12065. function o() {
  12066. if (s.length) return s.pop();
  12067. else return {}
  12068. }
  12069. function u(e) {
  12070. s.push(e)
  12071. }
  12072. function a(e) {
  12073. var t, n;
  12074. for (t = 0, n = e.length; t < n; t++) {
  12075. u(e[t])
  12076. }
  12077. e.length = 0
  12078. }
  12079. function f() {}
  12080. function l() {}
  12081. function c() {}
  12082. var e = cr.plugins_.Text.prototype;
  12083. e.onCreate = function() {
  12084. e.acts.SetWidth = function(e) {
  12085. if (this.width !== e) {
  12086. this.width = e;
  12087. this.text_changed = true;
  12088. this.set_bbox_changed()
  12089. }
  12090. }
  12091. };
  12092. e.Type = function(e) {
  12093. this.plugin = e;
  12094. this.runtime = e.runtime
  12095. };
  12096. var t = e.Type.prototype;
  12097. t.onCreate = function() {};
  12098. t.onLostWebGLContext = function() {
  12099. if (this.is_family) return;
  12100. var e, t, n;
  12101. for (e = 0, t = this.instances.length; e < t; e++) {
  12102. n = this.instances[e];
  12103. n.mycanvas = null;
  12104. n.myctx = null;
  12105. n.mytex = null
  12106. }
  12107. };
  12108. e.Instance = function(e) {
  12109. this.type = e;
  12110. this.runtime = e.runtime;
  12111. if (this.recycled) this.lines.length = 0;
  12112. else this.lines = [];
  12113. this.text_changed = true
  12114. };
  12115. var n = e.Instance.prototype;
  12116. var r = {};
  12117. n.onCreate = function() {
  12118. this.text = this.properties[0];
  12119. this.visible = this.properties[1] === 0;
  12120. this.font = this.properties[2];
  12121. this.color = this.properties[3];
  12122. this.halign = this.properties[4];
  12123. this.valign = this.properties[5];
  12124. this.wrapbyword = this.properties[7] === 0;
  12125. this.lastwidth = this.width;
  12126. this.lastwrapwidth = this.width;
  12127. this.lastheight = this.height;
  12128. this.line_height_offset = this.properties[8];
  12129. this.facename = "";
  12130. this.fontstyle = "";
  12131. this.ptSize = 0;
  12132. this.textWidth = 0;
  12133. this.textHeight = 0;
  12134. this.parseFont();
  12135. this.mycanvas = null;
  12136. this.myctx = null;
  12137. this.mytex = null;
  12138. this.need_text_redraw = false;
  12139. this.last_render_tick = this.runtime.tickcount;
  12140. if (this.recycled) this.rcTex.set(0, 0, 1, 1);
  12141. else this.rcTex = new cr.rect(0, 0, 1, 1);
  12142. if (this.runtime.glwrap) this.runtime.tickMe(this);
  12143. };
  12144. n.parseFont = function() {
  12145. var e = this.font.split(" ");
  12146. var t;
  12147. for (t = 0; t < e.length; t++) {
  12148. if (e[t].substr(e[t].length - 2, 2) === "pt") {
  12149. this.ptSize = parseInt(e[t].substr(0, e[t].length - 2));
  12150. this.pxHeight = Math.ceil(this.ptSize / 72 * 96) + 4;
  12151. if (t > 0) this.fontstyle = e[t - 1];
  12152. this.facename = e[t + 1];
  12153. for (t = t + 2; t < e.length; t++) this.facename += " " + e[t];
  12154. break
  12155. }
  12156. }
  12157. };
  12158. n.saveToJSON = function() {
  12159. return {
  12160. t: this.text,
  12161. f: this.font,
  12162. c: this.color,
  12163. ha: this.halign,
  12164. va: this.valign,
  12165. wr: this.wrapbyword,
  12166. lho: this.line_height_offset,
  12167. fn: this.facename,
  12168. fs: this.fontstyle,
  12169. ps: this.ptSize,
  12170. pxh: this.pxHeight,
  12171. tw: this.textWidth,
  12172. th: this.textHeight,
  12173. lrt: this.last_render_tick
  12174. }
  12175. };
  12176. n.loadFromJSON = function(e) {
  12177. this.text = e["t"];
  12178. this.font = e["f"];
  12179. this.color = e["c"];
  12180. this.halign = e["ha"];
  12181. this.valign = e["va"];
  12182. this.wrapbyword = e["wr"];
  12183. this.line_height_offset = e["lho"];
  12184. this.facename = e["fn"];
  12185. this.fontstyle = e["fs"];
  12186. this.ptSize = e["ps"];
  12187. this.pxHeight = e["pxh"];
  12188. this.textWidth = e["tw"];
  12189. this.textHeight = e["th"];
  12190. this.last_render_tick = e["lrt"];
  12191. this.text_changed = true;
  12192. this.lastwidth = this.width;
  12193. this.lastwrapwidth = this.width;
  12194. this.lastheight = this.height
  12195. };
  12196. n.tick = function() {
  12197. if (this.runtime.glwrap && this.mytex && this.runtime.tickcount - this.last_render_tick >= 300) {
  12198. var e = this.layer;
  12199. this.update_bbox();
  12200. var t = this.bbox;
  12201. if (t.right < e.viewLeft || t.bottom < e.viewTop || t.left > e.viewRight || t.top > e.viewBottom) {
  12202. this.runtime.glwrap.deleteTexture(this.mytex);
  12203. this.mytex = null;
  12204. this.myctx = null;
  12205. this.mycanvas = null
  12206. }
  12207. }
  12208. };
  12209. n.onDestroy = function() {
  12210. this.myctx = null;
  12211. this.mycanvas = null;
  12212. if (this.runtime.glwrap && this.mytex) this.runtime.glwrap.deleteTexture(this.mytex);
  12213. this.mytex = null
  12214. };
  12215. n.updateFont = function() {
  12216. this.font = this.fontstyle + " " + this.ptSize.toString() + "pt " + this.facename;
  12217. this.text_changed = true;
  12218. this.runtime.redraw = true
  12219. };
  12220. n.draw = function(e, t) {
  12221. e.font = this.font;
  12222. e.textBaseline = "top";
  12223. e.fillStyle = this.color;
  12224. e.globalAlpha = t ? 1 : this.opacity;
  12225. var n = 1;
  12226. if (t) {
  12227. n = this.layer.getScale();
  12228. e.save();
  12229. e.scale(n, n)
  12230. }
  12231. if (this.text_changed || this.width !== this.lastwrapwidth) {
  12232. this.type.plugin.WordWrap(this.text, this.lines, e, this.width, this.wrapbyword);
  12233. this.text_changed = false;
  12234. this.lastwrapwidth = this.width
  12235. }
  12236. this.update_bbox();
  12237. var r = t ? 0 : this.bquad.tlx;
  12238. var i = t ? 0 : this.bquad.tly;
  12239. if (this.runtime.pixel_rounding) {
  12240. r = r + .5 | 0;
  12241. i = i + .5 | 0
  12242. }
  12243. if (this.angle !== 0 && !t) {
  12244. e.save();
  12245. e.translate(r, i);
  12246. e.rotate(this.angle);
  12247. r = 0;
  12248. i = 0
  12249. }
  12250. var s = i + this.height;
  12251. var o = this.pxHeight;
  12252. o += this.line_height_offset * this.runtime.devicePixelRatio;
  12253. var u;
  12254. var a;
  12255. if (this.valign === 1) i += Math.max(this.height / 2 - this.lines.length * o / 2, 0);
  12256. else if (this.valign === 2) i += Math.max(this.height - this.lines.length * o - 2, 0);
  12257. for (a = 0; a < this.lines.length; a++) {
  12258. u = r;
  12259. if (this.halign === 1) u = r + (this.width - this.lines[a].width) / 2;
  12260. else if (this.halign === 2) u = r + (this.width - this.lines[a].width);
  12261. e.fillText(this.lines[a].text, u, i);
  12262. i += o;
  12263. if (i >= s - o) break
  12264. }
  12265. if (this.angle !== 0 || t) e.restore();
  12266. this.last_render_tick = this.runtime.tickcount
  12267. };
  12268. n.drawGL = function(e) {
  12269. if (this.width < 1 || this.height < 1) return;
  12270. var t = this.text_changed || this.need_text_redraw;
  12271. this.need_text_redraw = false;
  12272. var n = this.layer.getScale();
  12273. var r = this.layer.getAngle();
  12274. var i = this.rcTex;
  12275. var s = n * this.width;
  12276. var o = n * this.height;
  12277. var u = Math.ceil(s);
  12278. var a = Math.ceil(o);
  12279. var f = this.runtime.width;
  12280. var l = this.runtime.height;
  12281. var c = f / 2;
  12282. var h = l / 2;
  12283. if (!this.myctx) {
  12284. this.mycanvas = document.createElement("canvas");
  12285. this.mycanvas.width = u;
  12286. this.mycanvas.height = a;
  12287. this.lastwidth = u;
  12288. this.lastheight = a;
  12289. t = true;
  12290. this.myctx = this.mycanvas.getContext("2d")
  12291. }
  12292. if (u !== this.lastwidth || a !== this.lastheight) {
  12293. this.mycanvas.width = u;
  12294. this.mycanvas.height = a;
  12295. if (this.mytex) {
  12296. e.deleteTexture(this.mytex);
  12297. this.mytex = null
  12298. }
  12299. t = true
  12300. }
  12301. if (t) {
  12302. this.myctx.clearRect(0, 0, u, a);
  12303. this.draw(this.myctx, true);
  12304. if (!this.mytex) this.mytex = e.createEmptyTexture(u, a, this.runtime.linearSampling, this.runtime.isMobile);
  12305. e.videoToTexture(this.mycanvas, this.mytex, this.runtime.isMobile)
  12306. }
  12307. this.lastwidth = u;
  12308. this.lastheight = a;
  12309. e.setTexture(this.mytex);
  12310. e.setOpacity(this.opacity);
  12311. e.resetModelView();
  12312. e.translate(-c, -h);
  12313. e.updateModelView();
  12314. var p = this.bquad;
  12315. var d = this.layer.layerToCanvas(p.tlx, p.tly, true);
  12316. var v = this.layer.layerToCanvas(p.tlx, p.tly, false);
  12317. var m = this.layer.layerToCanvas(p.trx, p.try_, true);
  12318. var g = this.layer.layerToCanvas(p.trx, p.try_, false);
  12319. var y = this.layer.layerToCanvas(p.brx, p.bry, true);
  12320. var b = this.layer.layerToCanvas(p.brx, p.bry, false);
  12321. var w = this.layer.layerToCanvas(p.blx, p.bly, true);
  12322. var E = this.layer.layerToCanvas(p.blx, p.bly, false);
  12323. if (this.runtime.pixel_rounding || this.angle === 0 && r === 0) {
  12324. var S = (d + .5 | 0) - d;
  12325. var x = (v + .5 | 0) - v;
  12326. d += S;
  12327. v += x;
  12328. m += S;
  12329. g += x;
  12330. y += S;
  12331. b += x;
  12332. w += S;
  12333. E += x
  12334. }
  12335. if (this.angle === 0 && r === 0) {
  12336. m = d + u;
  12337. g = v;
  12338. y = m;
  12339. b = v + a;
  12340. w = d;
  12341. E = b;
  12342. i.right = 1;
  12343. i.bottom = 1
  12344. } else {
  12345. i.right = s / u;
  12346. i.bottom = o / a
  12347. }
  12348. e.quadTex(d, v, m, g, y, b, w, E, i);
  12349. e.resetModelView();
  12350. e.scale(n, n);
  12351. e.rotateZ(-this.layer.getAngle());
  12352. e.translate((this.layer.viewLeft + this.layer.viewRight) / -2, (this.layer.viewTop + this.layer.viewBottom) / -2);
  12353. e.updateModelView();
  12354. this.last_render_tick = this.runtime.tickcount
  12355. };
  12356. var i = [];
  12357. e.TokeniseWords = function(e) {
  12358. i.length = 0;
  12359. var t = "";
  12360. var n;
  12361. var r = 0;
  12362. while (r < e.length) {
  12363. n = e.charAt(r);
  12364. if (n === "\n") {
  12365. if (t.length) {
  12366. i.push(t);
  12367. t = ""
  12368. }
  12369. i.push("\n");
  12370. ++r
  12371. } else if (n === " " || n === " " || n === "-") {
  12372. do {
  12373. t += e.charAt(r);
  12374. r++
  12375. } while (r < e.length && (e.charAt(r) === " " || e.charAt(r) === " "));
  12376. i.push(t);
  12377. t = ""
  12378. } else if (r < e.length) {
  12379. t += n;
  12380. r++
  12381. }
  12382. }
  12383. if (t.length) i.push(t)
  12384. };
  12385. var s = [];
  12386. e.WordWrap = function(e, t, n, r, i) {
  12387. if (!e || !e.length) {
  12388. a(t);
  12389. return
  12390. }
  12391. if (r <= 2) {
  12392. a(t);
  12393. return
  12394. }
  12395. if (e.length <= 100 && e.indexOf("\n") === -1) {
  12396. var s = n.measureText(e).width;
  12397. if (s <= r) {
  12398. a(t);
  12399. t.push(o());
  12400. t[0].text = e;
  12401. t[0].width = s;
  12402. return
  12403. }
  12404. }
  12405. this.WrapText(e, t, n, r, i)
  12406. };
  12407. e.WrapText = function(e, t, n, r, s) {
  12408. var a;
  12409. if (s) {
  12410. this.TokeniseWords(e);
  12411. a = i
  12412. } else a = e;
  12413. var f = "";
  12414. var l;
  12415. var c;
  12416. var h;
  12417. var p = 0;
  12418. var d;
  12419. for (h = 0; h < a.length; h++) {
  12420. if (a[h] === "\n") {
  12421. if (p >= t.length) t.push(o());
  12422. d = t[p];
  12423. d.text = f;
  12424. d.width = n.measureText(f).width;
  12425. p++;
  12426. f = "";
  12427. continue
  12428. }
  12429. l = f;
  12430. f += a[h];
  12431. c = n.measureText(f).width;
  12432. if (c >= r) {
  12433. if (p >= t.length) t.push(o());
  12434. d = t[p];
  12435. d.text = l;
  12436. d.width = n.measureText(l).width;
  12437. p++;
  12438. f = a[h];
  12439. if (!s && f === " ") f = ""
  12440. }
  12441. }
  12442. if (f.length) {
  12443. if (p >= t.length) t.push(o());
  12444. d = t[p];
  12445. d.text = f;
  12446. d.width = n.measureText(f).width;
  12447. p++
  12448. }
  12449. for (h = p; h < t.length; h++) u(t[h]);
  12450. t.length = p
  12451. };
  12452. f.prototype.CompareText = function(e, t) {
  12453. if (t) return this.text == e;
  12454. else return cr.equals_nocase(this.text, e)
  12455. };
  12456. e.cnds = new f;
  12457. l.prototype.SetText = function(e) {
  12458. if (cr.is_number(e) && e < 1e9) e = Math.round(e * 1e10) / 1e10;
  12459. var t = e.toString();
  12460. if (this.text !== t) {
  12461. this.text = t;
  12462. this.text_changed = true;
  12463. this.runtime.redraw = true
  12464. }
  12465. };
  12466. l.prototype.AppendText = function(e) {
  12467. if (cr.is_number(e)) e = Math.round(e * 1e10) / 1e10;
  12468. var t = e.toString();
  12469. if (t) {
  12470. this.text += t;
  12471. this.text_changed = true;
  12472. this.runtime.redraw = true
  12473. }
  12474. };
  12475. l.prototype.SetFontFace = function(e, t) {
  12476. var n = "";
  12477. switch (t) {
  12478. case 1:
  12479. n = "bold";
  12480. break;
  12481. case 2:
  12482. n = "italic";
  12483. break;
  12484. case 3:
  12485. n = "bold italic";
  12486. break
  12487. }
  12488. if (e === this.facename && n === this.fontstyle) return;
  12489. this.facename = e;
  12490. this.fontstyle = n;
  12491. this.updateFont()
  12492. };
  12493. l.prototype.SetFontSize = function(e) {
  12494. if (this.ptSize === e) return;
  12495. this.ptSize = e;
  12496. this.pxHeight = Math.ceil(this.ptSize / 72 * 96) + 4;
  12497. this.updateFont()
  12498. };
  12499. l.prototype.SetFontColor = function(e) {
  12500. var t = "rgb(" + cr.GetRValue(e).toString() + "," + cr.GetGValue(e).toString() + "," + cr.GetBValue(e).toString() + ")";
  12501. if (t === this.color) return;
  12502. this.color = t;
  12503. this.need_text_redraw = true;
  12504. this.runtime.redraw = true
  12505. };
  12506. l.prototype.SetWebFont = function(e, t) {
  12507. if (this.runtime.isDomFree) {
  12508. cr.logexport("[Construct 2] Text plugin: 'Set web font' not supported on this platform - the action has been ignored");
  12509. return
  12510. }
  12511. var n = this;
  12512. var i = function() {
  12513. n.runtime.redraw = true;
  12514. n.text_changed = true
  12515. };
  12516. if (r.hasOwnProperty(t)) {
  12517. var s = "'" + e + "'";
  12518. if (this.facename === s) return;
  12519. this.facename = s;
  12520. this.updateFont();
  12521. for (var o = 1; o < 10; o++) {
  12522. setTimeout(i, o * 100);
  12523. setTimeout(i, o * 1e3)
  12524. }
  12525. return
  12526. }
  12527. var u = document.createElement("link");
  12528. u.href = t;
  12529. u.rel = "stylesheet";
  12530. u.type = "text/css";
  12531. u.onload = i;
  12532. document.getElementsByTagName("head")[0].appendChild(u);
  12533. r[t] = true;
  12534. this.facename = "'" + e + "'";
  12535. this.updateFont();
  12536. for (var o = 1; o < 10; o++) {
  12537. setTimeout(i, o * 100);
  12538. setTimeout(i, o * 1e3)
  12539. }
  12540. };
  12541. l.prototype.SetEffect = function(e) {
  12542. this.compositeOp = cr.effectToCompositeOp(e);
  12543. cr.setGLBlend(this, e, this.runtime.gl);
  12544. this.runtime.redraw = true
  12545. };
  12546. e.acts = new l;
  12547. c.prototype.Text = function(e) {
  12548. e.set_string(this.text)
  12549. };
  12550. c.prototype.FaceName = function(e) {
  12551. e.set_string(this.facename)
  12552. };
  12553. c.prototype.FaceSize = function(e) {
  12554. e.set_int(this.ptSize)
  12555. };
  12556. c.prototype.TextWidth = function(e) {
  12557. var t = 0;
  12558. var n, r, i;
  12559. for (n = 0, r = this.lines.length; n < r; n++) {
  12560. i = this.lines[n].width;
  12561. if (t < i) t = i
  12562. }
  12563. e.set_int(t)
  12564. };
  12565. c.prototype.TextHeight = function(e) {
  12566. e.set_int(this.lines.length * (this.pxHeight + this.line_height_offset) - this.line_height_offset)
  12567. };
  12568. e.exps = new c
  12569. })();
  12570. cr.plugins_.Touch = function(e) {
  12571. this.runtime = e
  12572. };
  12573. (function() {
  12574. function u(e) {
  12575. i = e.x;
  12576. s = e.y;
  12577. o = e.z
  12578. }
  12579. function c(e) {
  12580. a = e.x;
  12581. f = e.y;
  12582. l = e.z
  12583. }
  12584. function d() {}
  12585. function v() {}
  12586. var e = cr.plugins_.Touch.prototype;
  12587. e.Type = function(e) {
  12588. this.plugin = e;
  12589. this.runtime = e.runtime
  12590. };
  12591. var t = e.Type.prototype;
  12592. t.onCreate = function() {};
  12593. e.Instance = function(e) {
  12594. this.type = e;
  12595. this.runtime = e.runtime;
  12596. this.touches = [];
  12597. this.mouseDown = false
  12598. };
  12599. var n = e.Instance.prototype;
  12600. var r = {
  12601. left: 0,
  12602. top: 0
  12603. };
  12604. n.findTouch = function(e) {
  12605. var t, n;
  12606. for (t = 0, n = this.touches.length; t < n; t++) {
  12607. if (this.touches[t]["id"] === e) return t
  12608. }
  12609. return -1
  12610. };
  12611. var i = 0;
  12612. var s = 0;
  12613. var o = 0;
  12614. var a = 0;
  12615. var f = 0;
  12616. var l = 0;
  12617. var h = null;
  12618. n.onCreate = function() {
  12619. h = this;
  12620. this.isWindows8 = !! (typeof window["c2isWindows8"] !== "undefined" && window["c2isWindows8"]);
  12621. this.orient_alpha = 0;
  12622. this.orient_beta = 0;
  12623. this.orient_gamma = 0;
  12624. this.acc_g_x = 0;
  12625. this.acc_g_y = 0;
  12626. this.acc_g_z = 0;
  12627. this.acc_x = 0;
  12628. this.acc_y = 0;
  12629. this.acc_z = 0;
  12630. this.curTouchX = 0;
  12631. this.curTouchY = 0;
  12632. this.trigger_index = 0;
  12633. this.trigger_id = 0;
  12634. this.useMouseInput = this.properties[0] !== 0;
  12635. var e = this.runtime.fullscreen_mode > 0 ? document : this.runtime.canvas;
  12636. var t = document;
  12637. if (this.runtime.isDirectCanvas) t = e = window["Canvas"];
  12638. else if (this.runtime.isCocoonJs) t = e = window;
  12639. var n = this;
  12640. if (window.navigator["msPointerEnabled"]) {
  12641. e.addEventListener("MSPointerDown", function(e) {
  12642. n.onPointerStart(e)
  12643. }, false);
  12644. e.addEventListener("MSPointerMove", function(e) {
  12645. n.onPointerMove(e)
  12646. }, false);
  12647. t.addEventListener("MSPointerUp", function(e) {
  12648. n.onPointerEnd(e)
  12649. }, false);
  12650. t.addEventListener("MSPointerCancel", function(e) {
  12651. n.onPointerEnd(e)
  12652. }, false);
  12653. if (this.runtime.canvas) {
  12654. this.runtime.canvas.addEventListener("MSGestureHold", function(e) {
  12655. e.preventDefault()
  12656. }, false);
  12657. document.addEventListener("MSGestureHold", function(e) {
  12658. e.preventDefault()
  12659. }, false)
  12660. }
  12661. } else {
  12662. e.addEventListener("touchstart", function(e) {
  12663. n.onTouchStart(e)
  12664. }, false);
  12665. e.addEventListener("touchmove", function(e) {
  12666. n.onTouchMove(e)
  12667. }, false);
  12668. t.addEventListener("touchend", function(e) {
  12669. n.onTouchEnd(e)
  12670. }, false);
  12671. t.addEventListener("touchcancel", function(e) {
  12672. n.onTouchEnd(e)
  12673. }, false)
  12674. }
  12675. if (this.isWindows8) {
  12676. var r = function(e) {
  12677. var t = e["reading"];
  12678. n.acc_x = t["accelerationX"];
  12679. n.acc_y = t["accelerationY"];
  12680. n.acc_z = t["accelerationZ"]
  12681. };
  12682. var i = function(e) {
  12683. var t = e["reading"];
  12684. n.orient_alpha = t["yawDegrees"];
  12685. n.orient_beta = t["pitchDegrees"];
  12686. n.orient_gamma = t["rollDegrees"]
  12687. };
  12688. var s = Windows["Devices"]["Sensors"]["Accelerometer"]["getDefault"]();
  12689. if (s) {
  12690. s["reportInterval"] = Math.max(s["minimumReportInterval"], 16);
  12691. s.addEventListener("readingchanged", r)
  12692. }
  12693. var o = Windows["Devices"]["Sensors"]["Inclinometer"]["getDefault"]();
  12694. if (o) {
  12695. o["reportInterval"] = Math.max(o["minimumReportInterval"], 16);
  12696. o.addEventListener("readingchanged", i)
  12697. }
  12698. document.addEventListener("visibilitychange", function(e) {
  12699. if (document["hidden"] || document["msHidden"]) {
  12700. if (s) s.removeEventListener("readingchanged", r);
  12701. if (o) o.removeEventListener("readingchanged", i)
  12702. } else {
  12703. if (s) s.addEventListener("readingchanged", r);
  12704. if (o) o.addEventListener("readingchanged", i)
  12705. }
  12706. }, false)
  12707. } else {
  12708. window.addEventListener("deviceorientation", function(e) {
  12709. n.orient_alpha = e["alpha"] || 0;
  12710. n.orient_beta = e["beta"] || 0;
  12711. n.orient_gamma = e["gamma"] || 0
  12712. }, false);
  12713. window.addEventListener("devicemotion", function(e) {
  12714. if (e["accelerationIncludingGravity"]) {
  12715. n.acc_g_x = e["accelerationIncludingGravity"]["x"];
  12716. n.acc_g_y = e["accelerationIncludingGravity"]["y"];
  12717. n.acc_g_z = e["accelerationIncludingGravity"]["z"]
  12718. }
  12719. if (e["acceleration"]) {
  12720. n.acc_x = e["acceleration"]["x"];
  12721. n.acc_y = e["acceleration"]["y"];
  12722. n.acc_z = e["acceleration"]["z"]
  12723. }
  12724. }, false)
  12725. }
  12726. if (this.useMouseInput && !this.runtime.isDomFree) { /*jQuery(document).mousemove(function(e){n.onMouseMove(e)});jQuery(document).mousedown(function(e){n.onMouseDown(e)});jQuery(document).mouseup(function(e){n.onMouseUp(e)})*/
  12727. }
  12728. if (this.runtime.isAppMobi && !this.runtime.isDirectCanvas) {
  12729. AppMobi["accelerometer"]["watchAcceleration"](u, {
  12730. frequency: 40,
  12731. adjustForRotation: true
  12732. })
  12733. }
  12734. if (this.runtime.isPhoneGap) {
  12735. navigator["accelerometer"]["watchAcceleration"](c, null, {
  12736. frequency: 40
  12737. })
  12738. }
  12739. this.runtime.tick2Me(this)
  12740. };
  12741. n.onPointerMove = function(e) {
  12742. if (e["pointerType"] === e["MSPOINTER_TYPE_MOUSE"]) return;
  12743. if (e.preventDefault) e.preventDefault();
  12744. var t = this.findTouch(e["pointerId"]);
  12745. var n = cr.performance_now();
  12746. if (t >= 0) {
  12747. var i = this.runtime.isDomFree ? r : jQuery(this.runtime.canvas).offset();
  12748. var s = this.touches[t];
  12749. if (n - s.time < 2) return;
  12750. s.lasttime = s.time;
  12751. s.lastx = s.x;
  12752. s.lasty = s.y;
  12753. s.time = n;
  12754. s.x = e.pageX - i.left;
  12755. s.y = e.pageY - i.top
  12756. }
  12757. };
  12758. n.onPointerStart = function(e) {
  12759. if (e["pointerType"] === e["MSPOINTER_TYPE_MOUSE"]) return;
  12760. if (e.preventDefault) e.preventDefault();
  12761. var t = this.runtime.isDomFree ? r : jQuery(this.runtime.canvas).offset();
  12762. var n = e.pageX - t.left;
  12763. var i = e.pageY - t.top;
  12764. var s = cr.performance_now();
  12765. this.trigger_index = this.touches.length;
  12766. this.trigger_id = e["pointerId"];
  12767. this.touches.push({
  12768. time: s,
  12769. x: n,
  12770. y: i,
  12771. lasttime: s,
  12772. lastx: n,
  12773. lasty: i,
  12774. id: e["pointerId"],
  12775. startindex: this.trigger_index
  12776. });
  12777. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnNthTouchStart, this);
  12778. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchStart, this);
  12779. this.curTouchX = n;
  12780. this.curTouchY = i;
  12781. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchObject, this)
  12782. };
  12783. n.onPointerEnd = function(e) {
  12784. if (e["pointerType"] === e["MSPOINTER_TYPE_MOUSE"]) return;
  12785. if (e.preventDefault) e.preventDefault();
  12786. var t = this.findTouch(e["pointerId"]);
  12787. this.trigger_index = t >= 0 ? this.touches[t].startindex : -1;
  12788. this.trigger_id = t >= 0 ? this.touches[t]["id"] : -1;
  12789. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnNthTouchEnd, this);
  12790. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchEnd, this);
  12791. if (t >= 0) {
  12792. this.touches.splice(t, 1)
  12793. }
  12794. };
  12795. n.onTouchMove = function(e) {
  12796. var t = cr.performance_now();
  12797. var n, i, s, o;
  12798. for (n = 0, i = e.changedTouches.length; n < i; n++) {
  12799. s = e.changedTouches[n];
  12800. var u = this.findTouch(s["identifier"]);
  12801. if (u >= 0) {
  12802. var a = this.runtime.isDomFree ? r : jQuery(this.runtime.canvas).offset();
  12803. o = this.touches[u];
  12804. if (t - o.time < 2) continue;
  12805. o.lasttime = o.time;
  12806. o.lastx = o.x;
  12807. o.lasty = o.y;
  12808. o.time = t;
  12809. o.x = s.pageX - a.left;
  12810. o.y = s.pageY - a.top
  12811. }
  12812. }
  12813. };
  12814. n.onTouchStart = function(e) {
  12815. var t = this.runtime.isDomFree ? r : jQuery(this.runtime.canvas).offset();
  12816. var n = cr.performance_now();
  12817. var i, s, o, u;
  12818. for (i = 0, s = e.changedTouches.length; i < s; i++) {
  12819. o = e.changedTouches[i];
  12820. u = this.findTouch(o["identifier"]);
  12821. if (u !== -1) continue;
  12822. var a = o.pageX - t.left;
  12823. var f = o.pageY - t.top;
  12824. this.trigger_index = this.touches.length;
  12825. this.trigger_id = o["identifier"];
  12826. this.touches.push({
  12827. time: n,
  12828. x: a,
  12829. y: f,
  12830. lasttime: n,
  12831. lastx: a,
  12832. lasty: f,
  12833. id: o["identifier"],
  12834. startindex: this.trigger_index
  12835. });
  12836. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnNthTouchStart, this);
  12837. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchStart, this);
  12838. this.curTouchX = a;
  12839. this.curTouchY = f;
  12840. if (navigator.userAgent.match(/iphone|ipod|ios/i)) this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchObject, this)
  12841. }
  12842. };
  12843. n.onTouchEnd = function(e) {
  12844. var t, n, r, i;
  12845. for (t = 0, n = e.changedTouches.length; t < n; t++) {
  12846. r = e.changedTouches[t];
  12847. i = this.findTouch(r["identifier"]);
  12848. if (i >= 0) {
  12849. this.trigger_index = this.touches[i].startindex;
  12850. this.trigger_id = this.touches[i]["id"];
  12851. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnNthTouchEnd, this);
  12852. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchEnd, this);
  12853. this.touches.splice(i, 1);
  12854. }
  12855. }
  12856. };
  12857. n.getAlpha = function() {
  12858. if (this.runtime.isAppMobi && this.orient_alpha === 0 && o !== 0) return o * 90;
  12859. else if (this.runtime.isPhoneGap && this.orient_alpha === 0 && l !== 0) return l * 90;
  12860. else return this.orient_alpha
  12861. };
  12862. n.getBeta = function() {
  12863. if (this.runtime.isAppMobi && this.orient_beta === 0 && s !== 0) return s * -90;
  12864. else if (this.runtime.isPhoneGap && this.orient_beta === 0 && f !== 0) return f * -90;
  12865. else return this.orient_beta
  12866. };
  12867. n.getGamma = function() {
  12868. if (this.runtime.isAppMobi && this.orient_gamma === 0 && i !== 0) return i * 90;
  12869. else if (this.runtime.isPhoneGap && this.orient_gamma === 0 && a !== 0) return a * 90;
  12870. else return this.orient_gamma
  12871. };
  12872. var p = function() {};
  12873. n.onMouseDown = function(e) {
  12874. if (e.preventDefault && this.runtime.had_a_click) e.preventDefault();
  12875. var t = {
  12876. pageX: e.pageX,
  12877. pageY: e.pageY,
  12878. identifier: 0
  12879. };
  12880. var n = {
  12881. changedTouches: [t]
  12882. };
  12883. this.onTouchStart(n);
  12884. this.mouseDown = true
  12885. };
  12886. n.onMouseMove = function(e) {
  12887. if (e.preventDefault && this.runtime.had_a_click) e.preventDefault();
  12888. if (!this.mouseDown) return;
  12889. var t = {
  12890. pageX: e.pageX,
  12891. pageY: e.pageY,
  12892. identifier: 0
  12893. };
  12894. var n = {
  12895. changedTouches: [t]
  12896. };
  12897. this.onTouchMove(n)
  12898. };
  12899. n.onMouseUp = function(e) {
  12900. if (e.preventDefault && this.runtime.had_a_click) e.preventDefault();
  12901. this.runtime.had_a_click = true;
  12902. var t = {
  12903. pageX: e.pageX,
  12904. pageY: e.pageY,
  12905. identifier: 0
  12906. };
  12907. var n = {
  12908. changedTouches: [t]
  12909. };
  12910. this.onTouchEnd(n);
  12911. this.mouseDown = false
  12912. };
  12913. n.tick2 = function() {
  12914. var e, t, n;
  12915. var r = cr.performance_now();
  12916. for (e = 0, t = this.touches.length; e < t; e++) {
  12917. n = this.touches[e];
  12918. if (n.time <= r - 50) n.lasttime = r
  12919. }
  12920. };
  12921. d.prototype.OnTouchStart = function() {
  12922. return true
  12923. };
  12924. d.prototype.OnTouchEnd = function() {
  12925. return true
  12926. };
  12927. d.prototype.IsInTouch = function() {
  12928. return this.touches.length
  12929. };
  12930. d.prototype.OnTouchObject = function(e) {
  12931. if (!e) return false;
  12932. return this.runtime.testAndSelectCanvasPointOverlap(e, this.curTouchX, this.curTouchY, false)
  12933. };
  12934. d.prototype.IsTouchingObject = function(e) {
  12935. if (!e) return false;
  12936. var t = e.getCurrentSol();
  12937. var n = t.getObjects();
  12938. var r, i;
  12939. var s = [];
  12940. var o, u, a, f;
  12941. for (o = 0, u = n.length; o < u; o++) {
  12942. var l = n[o];
  12943. l.update_bbox();
  12944. for (a = 0, f = this.touches.length; a < f; a++) {
  12945. var c = this.touches[a];
  12946. r = l.layer.canvasToLayer(c.x, c.y, true);
  12947. i = l.layer.canvasToLayer(c.x, c.y, false);
  12948. if (l.contains_pt(r, i)) {
  12949. s.push(l);
  12950. break
  12951. }
  12952. }
  12953. }
  12954. if (s.length) {
  12955. t.select_all = false;
  12956. t.instances = s;
  12957. return true
  12958. } else return false
  12959. };
  12960. d.prototype.CompareTouchSpeed = function(e, t, n) {
  12961. e = Math.floor(e);
  12962. if (e < 0 || e >= this.touches.length) return false;
  12963. var r = this.touches[e];
  12964. var i = cr.distanceTo(r.x, r.y, r.lastx, r.lasty);
  12965. var s = (r.time - r.lasttime) / 1e3;
  12966. var o = 0;
  12967. if (s > 0) o = i / s;
  12968. return cr.do_cmp(o, t, n)
  12969. };
  12970. d.prototype.OrientationSupported = function() {
  12971. return typeof window["DeviceOrientationEvent"] !== "undefined"
  12972. };
  12973. d.prototype.MotionSupported = function() {
  12974. return typeof window["DeviceMotionEvent"] !== "undefined"
  12975. };
  12976. d.prototype.CompareOrientation = function(e, t, n) {
  12977. var r = 0;
  12978. if (e === 0) r = this.getAlpha();
  12979. else if (e === 1) r = this.getBeta();
  12980. else r = this.getGamma();
  12981. return cr.do_cmp(r, t, n)
  12982. };
  12983. d.prototype.CompareAcceleration = function(e, t, n) {
  12984. var r = 0;
  12985. if (e === 0) r = this.acc_g_x;
  12986. else if (e === 1) r = this.acc_g_y;
  12987. else if (e === 2) r = this.acc_g_z;
  12988. else if (e === 3) r = this.acc_x;
  12989. else if (e === 4) r = this.acc_y;
  12990. else if (e === 5) r = this.acc_z;
  12991. return cr.do_cmp(r, t, n)
  12992. };
  12993. d.prototype.OnNthTouchStart = function(e) {
  12994. e = Math.floor(e);
  12995. return e === this.trigger_index
  12996. };
  12997. d.prototype.OnNthTouchEnd = function(e) {
  12998. e = Math.floor(e);
  12999. return e === this.trigger_index
  13000. };
  13001. d.prototype.HasNthTouch = function(e) {
  13002. e = Math.floor(e);
  13003. return this.touches.length >= e + 1
  13004. };
  13005. e.cnds = new d;
  13006. v.prototype.TouchCount = function(e) {
  13007. e.set_int(this.touches.length)
  13008. };
  13009. v.prototype.X = function(e, t) {
  13010. if (this.touches.length) {
  13011. var n, r, i, s, o;
  13012. if (cr.is_undefined(t)) {
  13013. n = this.runtime.getLayerByNumber(0);
  13014. r = n.scale;
  13015. i = n.zoomRate;
  13016. s = n.parallaxX;
  13017. o = n.angle;
  13018. n.scale = this.runtime.running_layout.scale;
  13019. n.zoomRate = 1;
  13020. n.parallaxX = 1;
  13021. n.angle = this.runtime.running_layout.angle;
  13022. e.set_float(n.canvasToLayer(this.touches[0].x, this.touches[0].y, true));
  13023. n.scale = r;
  13024. n.zoomRate = i;
  13025. n.parallaxX = s;
  13026. n.angle = o
  13027. } else {
  13028. if (cr.is_number(t)) n = this.runtime.getLayerByNumber(t);
  13029. else n = this.runtime.getLayerByName(t);
  13030. if (n) e.set_float(n.canvasToLayer(this.touches[0].x, this.touches[0].y, true));
  13031. else e.set_float(0)
  13032. }
  13033. } else e.set_float(0)
  13034. };
  13035. v.prototype.XAt = function(e, t, n) {
  13036. t = Math.floor(t);
  13037. if (t < 0 || t >= this.touches.length) {
  13038. e.set_float(0);
  13039. return
  13040. }
  13041. var r, i, s, o, u;
  13042. if (cr.is_undefined(n)) {
  13043. r = this.runtime.getLayerByNumber(0);
  13044. i = r.scale;
  13045. s = r.zoomRate;
  13046. o = r.parallaxX;
  13047. u = r.angle;
  13048. r.scale = this.runtime.running_layout.scale;
  13049. r.zoomRate = 1;
  13050. r.parallaxX = 1;
  13051. r.angle = this.runtime.running_layout.angle;
  13052. e.set_float(r.canvasToLayer(this.touches[t].x, this.touches[t].y, true));
  13053. r.scale = i;
  13054. r.zoomRate = s;
  13055. r.parallaxX = o;
  13056. r.angle = u
  13057. } else {
  13058. if (cr.is_number(n)) r = this.runtime.getLayerByNumber(n);
  13059. else r = this.runtime.getLayerByName(n);
  13060. if (r) e.set_float(r.canvasToLayer(this.touches[t].x, this.touches[t].y, true));
  13061. else e.set_float(0)
  13062. }
  13063. };
  13064. v.prototype.XForID = function(e, t, n) {
  13065. var r = this.findTouch(t);
  13066. if (r < 0) {
  13067. e.set_float(0);
  13068. return
  13069. }
  13070. var i = this.touches[r];
  13071. var s, o, u, a, f;
  13072. if (cr.is_undefined(n)) {
  13073. s = this.runtime.getLayerByNumber(0);
  13074. o = s.scale;
  13075. u = s.zoomRate;
  13076. a = s.parallaxX;
  13077. f = s.angle;
  13078. s.scale = this.runtime.running_layout.scale;
  13079. s.zoomRate = 1;
  13080. s.parallaxX = 1;
  13081. s.angle = this.runtime.running_layout.angle;
  13082. e.set_float(s.canvasToLayer(i.x, i.y, true));
  13083. s.scale = o;
  13084. s.zoomRate = u;
  13085. s.parallaxX = a;
  13086. s.angle = f
  13087. } else {
  13088. if (cr.is_number(n)) s = this.runtime.getLayerByNumber(n);
  13089. else s = this.runtime.getLayerByName(n);
  13090. if (s) e.set_float(s.canvasToLayer(i.x, i.y, true));
  13091. else e.set_float(0)
  13092. }
  13093. };
  13094. v.prototype.Y = function(e, t) {
  13095. if (this.touches.length) {
  13096. var n, r, i, s, o;
  13097. if (cr.is_undefined(t)) {
  13098. n = this.runtime.getLayerByNumber(0);
  13099. r = n.scale;
  13100. i = n.zoomRate;
  13101. s = n.parallaxY;
  13102. o = n.angle;
  13103. n.scale = this.runtime.running_layout.scale;
  13104. n.zoomRate = 1;
  13105. n.parallaxY = 1;
  13106. n.angle = this.runtime.running_layout.angle;
  13107. e.set_float(n.canvasToLayer(this.touches[0].x, this.touches[0].y, false));
  13108. n.scale = r;
  13109. n.zoomRate = i;
  13110. n.parallaxY = s;
  13111. n.angle = o
  13112. } else {
  13113. if (cr.is_number(t)) n = this.runtime.getLayerByNumber(t);
  13114. else n = this.runtime.getLayerByName(t);
  13115. if (n) e.set_float(n.canvasToLayer(this.touches[0].x, this.touches[0].y, false));
  13116. else e.set_float(0)
  13117. }
  13118. } else e.set_float(0)
  13119. };
  13120. v.prototype.YAt = function(e, t, n) {
  13121. t = Math.floor(t);
  13122. if (t < 0 || t >= this.touches.length) {
  13123. e.set_float(0);
  13124. return
  13125. }
  13126. var r, i, s, o, u;
  13127. if (cr.is_undefined(n)) {
  13128. r = this.runtime.getLayerByNumber(0);
  13129. i = r.scale;
  13130. s = r.zoomRate;
  13131. o = r.parallaxY;
  13132. u = r.angle;
  13133. r.scale = this.runtime.running_layout.scale;
  13134. r.zoomRate = 1;
  13135. r.parallaxY = 1;
  13136. r.angle = this.runtime.running_layout.angle;
  13137. e.set_float(r.canvasToLayer(this.touches[t].x, this.touches[t].y, false));
  13138. r.scale = i;
  13139. r.zoomRate = s;
  13140. r.parallaxY = o;
  13141. r.angle = u
  13142. } else {
  13143. if (cr.is_number(n)) r = this.runtime.getLayerByNumber(n);
  13144. else r = this.runtime.getLayerByName(n);
  13145. if (r) e.set_float(r.canvasToLayer(this.touches[t].x, this.touches[t].y, false));
  13146. else e.set_float(0)
  13147. }
  13148. };
  13149. v.prototype.YForID = function(e, t, n) {
  13150. var r = this.findTouch(t);
  13151. if (r < 0) {
  13152. e.set_float(0);
  13153. return
  13154. }
  13155. var i = this.touches[r];
  13156. var s, o, u, a, f;
  13157. if (cr.is_undefined(n)) {
  13158. s = this.runtime.getLayerByNumber(0);
  13159. o = s.scale;
  13160. u = s.zoomRate;
  13161. a = s.parallaxY;
  13162. f = s.angle;
  13163. s.scale = this.runtime.running_layout.scale;
  13164. s.zoomRate = 1;
  13165. s.parallaxY = 1;
  13166. s.angle = this.runtime.running_layout.angle;
  13167. e.set_float(s.canvasToLayer(i.x, i.y, false));
  13168. s.scale = o;
  13169. s.zoomRate = u;
  13170. s.parallaxY = a;
  13171. s.angle = f
  13172. } else {
  13173. if (cr.is_number(n)) s = this.runtime.getLayerByNumber(n);
  13174. else s = this.runtime.getLayerByName(n);
  13175. if (s) e.set_float(s.canvasToLayer(i.x, i.y, false));
  13176. else e.set_float(0)
  13177. }
  13178. };
  13179. v.prototype.AbsoluteX = function(e) {
  13180. if (this.touches.length) e.set_float(this.touches[0].x);
  13181. else e.set_float(0)
  13182. };
  13183. v.prototype.AbsoluteXAt = function(e, t) {
  13184. t = Math.floor(t);
  13185. if (t < 0 || t >= this.touches.length) {
  13186. e.set_float(0);
  13187. return
  13188. }
  13189. e.set_float(this.touches[t].x)
  13190. };
  13191. v.prototype.AbsoluteXForID = function(e, t) {
  13192. var n = this.findTouch(t);
  13193. if (n < 0) {
  13194. e.set_float(0);
  13195. return
  13196. }
  13197. var r = this.touches[n];
  13198. e.set_float(r.x)
  13199. };
  13200. v.prototype.AbsoluteY = function(e) {
  13201. if (this.touches.length) e.set_float(this.touches[0].y);
  13202. else e.set_float(0)
  13203. };
  13204. v.prototype.AbsoluteYAt = function(e, t) {
  13205. t = Math.floor(t);
  13206. if (t < 0 || t >= this.touches.length) {
  13207. e.set_float(0);
  13208. return
  13209. }
  13210. e.set_float(this.touches[t].y)
  13211. };
  13212. v.prototype.AbsoluteYForID = function(e, t) {
  13213. var n = this.findTouch(t);
  13214. if (n < 0) {
  13215. e.set_float(0);
  13216. return
  13217. }
  13218. var r = this.touches[n];
  13219. e.set_float(r.y)
  13220. };
  13221. v.prototype.SpeedAt = function(e, t) {
  13222. t = Math.floor(t);
  13223. if (t < 0 || t >= this.touches.length) {
  13224. e.set_float(0);
  13225. return
  13226. }
  13227. var n = this.touches[t];
  13228. var r = cr.distanceTo(n.x, n.y, n.lastx, n.lasty);
  13229. var i = (n.time - n.lasttime) / 1e3;
  13230. if (i === 0) e.set_float(0);
  13231. else e.set_float(r / i)
  13232. };
  13233. v.prototype.SpeedForID = function(e, t) {
  13234. var n = this.findTouch(t);
  13235. if (n < 0) {
  13236. e.set_float(0);
  13237. return
  13238. }
  13239. var r = this.touches[n];
  13240. var i = cr.distanceTo(r.x, r.y, r.lastx, r.lasty);
  13241. var s = (r.time - r.lasttime) / 1e3;
  13242. if (s === 0) e.set_float(0);
  13243. else e.set_float(i / s)
  13244. };
  13245. v.prototype.AngleAt = function(e, t) {
  13246. t = Math.floor(t);
  13247. if (t < 0 || t >= this.touches.length) {
  13248. e.set_float(0);
  13249. return
  13250. }
  13251. var n = this.touches[t];
  13252. e.set_float(cr.to_degrees(cr.angleTo(n.lastx, n.lasty, n.x, n.y)))
  13253. };
  13254. v.prototype.AngleForID = function(e, t) {
  13255. var n = this.findTouch(t);
  13256. if (n < 0) {
  13257. e.set_float(0);
  13258. return
  13259. }
  13260. var r = this.touches[n];
  13261. e.set_float(cr.to_degrees(cr.angleTo(r.lastx, r.lasty, r.x, r.y)))
  13262. };
  13263. v.prototype.Alpha = function(e) {
  13264. e.set_float(this.getAlpha())
  13265. };
  13266. v.prototype.Beta = function(e) {
  13267. e.set_float(this.getBeta())
  13268. };
  13269. v.prototype.Gamma = function(e) {
  13270. e.set_float(this.getGamma())
  13271. };
  13272. v.prototype.AccelerationXWithG = function(e) {
  13273. e.set_float(this.acc_g_x)
  13274. };
  13275. v.prototype.AccelerationYWithG = function(e) {
  13276. e.set_float(this.acc_g_y)
  13277. };
  13278. v.prototype.AccelerationZWithG = function(e) {
  13279. e.set_float(this.acc_g_z)
  13280. };
  13281. v.prototype.AccelerationX = function(e) {
  13282. e.set_float(this.acc_x)
  13283. };
  13284. v.prototype.AccelerationY = function(e) {
  13285. e.set_float(this.acc_y)
  13286. };
  13287. v.prototype.AccelerationZ = function(e) {
  13288. e.set_float(this.acc_z)
  13289. };
  13290. v.prototype.TouchIndex = function(e) {
  13291. e.set_int(this.trigger_index)
  13292. };
  13293. v.prototype.TouchID = function(e) {
  13294. e.set_float(this.trigger_id)
  13295. };
  13296. e.exps = new v
  13297. })();
  13298. cr.behaviors.Fade = function(e) {
  13299. this.runtime = e
  13300. };
  13301. (function() {
  13302. function r() {}
  13303. function i() {}
  13304. var e = cr.behaviors.Fade.prototype;
  13305. e.Type = function(e, t) {
  13306. this.behavior = e;
  13307. this.objtype = t;
  13308. this.runtime = e.runtime
  13309. };
  13310. var t = e.Type.prototype;
  13311. t.onCreate = function() {};
  13312. e.Instance = function(e, t) {
  13313. this.type = e;
  13314. this.behavior = e.behavior;
  13315. this.inst = t;
  13316. this.runtime = e.runtime
  13317. };
  13318. var n = e.Instance.prototype;
  13319. n.onCreate = function() {
  13320. var e = this.properties[0] === 1;
  13321. this.fadeInTime = this.properties[1];
  13322. this.waitTime = this.properties[2];
  13323. this.fadeOutTime = this.properties[3];
  13324. this.destroy = this.properties[4];
  13325. this.stage = e ? 0 : 3;
  13326. if (this.recycled) this.stageTime.reset();
  13327. else this.stageTime = new cr.KahanAdder;
  13328. this.maxOpacity = this.inst.opacity ? this.inst.opacity : 1;
  13329. if (e) {
  13330. if (this.fadeInTime === 0) {
  13331. this.stage = 1;
  13332. if (this.waitTime === 0) this.stage = 2
  13333. } else {
  13334. this.inst.opacity = 0;
  13335. this.runtime.redraw = true
  13336. }
  13337. }
  13338. };
  13339. n.saveToJSON = function() {
  13340. return {
  13341. fit: this.fadeInTime,
  13342. wt: this.waitTime,
  13343. fot: this.fadeOutTime,
  13344. s: this.stage,
  13345. st: this.stageTime.sum,
  13346. mo: this.maxOpacity
  13347. }
  13348. };
  13349. n.loadFromJSON = function(e) {
  13350. this.fadeInTime = e["fit"];
  13351. this.waitTime = e["wt"];
  13352. this.fadeOutTime = e["fot"];
  13353. this.stage = e["s"];
  13354. this.stageTime.reset();
  13355. this.stageTime.sum = e["st"];
  13356. this.maxOpacity = e["mo"]
  13357. };
  13358. n.tick = function() {
  13359. this.stageTime.add(this.runtime.getDt(this.inst));
  13360. if (this.stage === 0) {
  13361. this.inst.opacity = this.stageTime.sum / this.fadeInTime * this.maxOpacity;
  13362. this.runtime.redraw = true;
  13363. if (this.inst.opacity >= this.maxOpacity) {
  13364. this.inst.opacity = this.maxOpacity;
  13365. this.stage = 1;
  13366. this.stageTime.reset()
  13367. }
  13368. }
  13369. if (this.stage === 1) {
  13370. if (this.stageTime.sum >= this.waitTime) {
  13371. this.stage = 2;
  13372. this.stageTime.reset()
  13373. }
  13374. }
  13375. if (this.stage === 2) {
  13376. if (this.fadeOutTime !== 0) {
  13377. this.inst.opacity = this.maxOpacity - this.stageTime.sum / this.fadeOutTime * this.maxOpacity;
  13378. this.runtime.redraw = true;
  13379. if (this.inst.opacity < 0) {
  13380. this.inst.opacity = 0;
  13381. this.stage = 3;
  13382. this.stageTime.reset();
  13383. this.runtime.trigger(cr.behaviors.Fade.prototype.cnds.OnFadeOutEnd, this.inst);
  13384. if (this.destroy === 1) this.runtime.DestroyInstance(this.inst)
  13385. }
  13386. }
  13387. }
  13388. };
  13389. n.doStart = function() {
  13390. this.stage = 0;
  13391. this.stageTime.reset();
  13392. if (this.fadeInTime === 0) {
  13393. this.stage = 1;
  13394. if (this.waitTime === 0) this.stage = 2
  13395. } else {
  13396. this.inst.opacity = 0;
  13397. this.runtime.redraw = true
  13398. }
  13399. };
  13400. r.prototype.OnFadeOutEnd = function() {
  13401. return true
  13402. };
  13403. e.cnds = new r;
  13404. i.prototype.StartFade = function() {
  13405. if (this.stage === 3) this.doStart()
  13406. };
  13407. i.prototype.RestartFade = function() {
  13408. this.doStart()
  13409. };
  13410. e.acts = new i
  13411. })();
  13412. cr.behaviors.Sin = function(e) {
  13413. this.runtime = e
  13414. };
  13415. (function() {
  13416. function o() {}
  13417. function u() {}
  13418. function a() {}
  13419. var e = cr.behaviors.Sin.prototype;
  13420. e.Type = function(e, t) {
  13421. this.behavior = e;
  13422. this.objtype = t;
  13423. this.runtime = e.runtime
  13424. };
  13425. var t = e.Type.prototype;
  13426. t.onCreate = function() {};
  13427. e.Instance = function(e, t) {
  13428. this.type = e;
  13429. this.behavior = e.behavior;
  13430. this.inst = t;
  13431. this.runtime = e.runtime;
  13432. this.i = 0
  13433. };
  13434. var n = e.Instance.prototype;
  13435. var r = 2 * Math.PI;
  13436. var i = Math.PI / 2;
  13437. var s = 3 * Math.PI / 2;
  13438. n.onCreate = function() {
  13439. this.active = this.properties[0] === 1;
  13440. this.movement = this.properties[1];
  13441. this.wave = this.properties[2];
  13442. this.period = this.properties[3];
  13443. this.period += Math.random() * this.properties[4];
  13444. if (this.period === 0) this.i = 0;
  13445. else {
  13446. this.i = this.properties[5] / this.period * r;
  13447. this.i += Math.random() * this.properties[6] / this.period * r
  13448. }
  13449. this.mag = this.properties[7];
  13450. this.mag += Math.random() * this.properties[8];
  13451. this.initialValue = 0;
  13452. this.initialValue2 = 0;
  13453. this.ratio = 0;
  13454. this.init()
  13455. };
  13456. n.saveToJSON = function() {
  13457. return {
  13458. i: this.i,
  13459. a: this.active,
  13460. mv: this.movement,
  13461. w: this.wave,
  13462. p: this.period,
  13463. mag: this.mag,
  13464. iv: this.initialValue,
  13465. iv2: this.initialValue2,
  13466. r: this.ratio,
  13467. lkv: this.lastKnownValue,
  13468. lkv2: this.lastKnownValue2
  13469. }
  13470. };
  13471. n.loadFromJSON = function(e) {
  13472. this.i = e["i"];
  13473. this.active = e["a"];
  13474. this.movement = e["mv"];
  13475. this.wave = e["w"];
  13476. this.period = e["p"];
  13477. this.mag = e["mag"];
  13478. this.initialValue = e["iv"];
  13479. this.initialValue2 = e["iv2"] || 0;
  13480. this.ratio = e["r"];
  13481. this.lastKnownValue = e["lkv"];
  13482. this.lastKnownValue2 = e["lkv2"] || 0
  13483. };
  13484. n.init = function() {
  13485. switch (this.movement) {
  13486. case 0:
  13487. this.initialValue = this.inst.x;
  13488. break;
  13489. case 1:
  13490. this.initialValue = this.inst.y;
  13491. break;
  13492. case 2:
  13493. this.initialValue = this.inst.width;
  13494. this.ratio = this.inst.height / this.inst.width;
  13495. break;
  13496. case 3:
  13497. this.initialValue = this.inst.width;
  13498. break;
  13499. case 4:
  13500. this.initialValue = this.inst.height;
  13501. break;
  13502. case 5:
  13503. this.initialValue = this.inst.angle;
  13504. this.mag = cr.to_radians(this.mag);
  13505. break;
  13506. case 6:
  13507. this.initialValue = this.inst.opacity;
  13508. break;
  13509. case 7:
  13510. this.initialValue = 0;
  13511. break;
  13512. case 8:
  13513. this.initialValue = this.inst.x;
  13514. this.initialValue2 = this.inst.y;
  13515. break;
  13516. default:
  13517. }
  13518. this.lastKnownValue = this.initialValue;
  13519. this.lastKnownValue2 = this.initialValue2
  13520. };
  13521. n.waveFunc = function(e) {
  13522. e = e % r;
  13523. switch (this.wave) {
  13524. case 0:
  13525. return Math.sin(e);
  13526. case 1:
  13527. if (e <= i) return e / i;
  13528. else if (e <= s) return 1 - 2 * (e - i) / Math.PI;
  13529. else return (e - s) / i - 1;
  13530. case 2:
  13531. return 2 * e / r - 1;
  13532. case 3:
  13533. return -2 * e / r + 1;
  13534. case 4:
  13535. return e < Math.PI ? -1 : 1
  13536. }
  13537. return 0
  13538. };
  13539. n.tick = function() {
  13540. var e = this.runtime.getDt(this.inst);
  13541. if (!this.active || e === 0) return;
  13542. if (this.period === 0) this.i = 0;
  13543. else {
  13544. this.i += e / this.period * r;
  13545. this.i = this.i % r
  13546. }
  13547. switch (this.movement) {
  13548. case 0:
  13549. if (this.inst.x !== this.lastKnownValue) this.initialValue += this.inst.x - this.lastKnownValue;
  13550. this.inst.x = this.initialValue + this.waveFunc(this.i) * this.mag;
  13551. this.lastKnownValue = this.inst.x;
  13552. break;
  13553. case 1:
  13554. if (this.inst.y !== this.lastKnownValue) this.initialValue += this.inst.y - this.lastKnownValue;
  13555. this.inst.y = this.initialValue + this.waveFunc(this.i) * this.mag;
  13556. this.lastKnownValue = this.inst.y;
  13557. break;
  13558. case 2:
  13559. this.inst.width = this.initialValue + this.waveFunc(this.i) * this.mag;
  13560. this.inst.height = this.inst.width * this.ratio;
  13561. break;
  13562. case 3:
  13563. this.inst.width = this.initialValue + this.waveFunc(this.i) * this.mag;
  13564. break;
  13565. case 4:
  13566. this.inst.height = this.initialValue + this.waveFunc(this.i) * this.mag;
  13567. break;
  13568. case 5:
  13569. if (this.inst.angle !== this.lastKnownValue) this.initialValue = cr.clamp_angle(this.initialValue + (this.inst.angle - this.lastKnownValue));
  13570. this.inst.angle = cr.clamp_angle(this.initialValue + this.waveFunc(this.i) * this.mag);
  13571. this.lastKnownValue = this.inst.angle;
  13572. break;
  13573. case 6:
  13574. this.inst.opacity = this.initialValue + this.waveFunc(this.i) * this.mag / 100;
  13575. if (this.inst.opacity < 0) this.inst.opacity = 0;
  13576. else if (this.inst.opacity > 1) this.inst.opacity = 1;
  13577. break;
  13578. case 8:
  13579. if (this.inst.x !== this.lastKnownValue) this.initialValue += this.inst.x - this.lastKnownValue;
  13580. if (this.inst.y !== this.lastKnownValue2) this.initialValue2 += this.inst.y - this.lastKnownValue2;
  13581. this.inst.x = this.initialValue + Math.cos(this.inst.angle) * this.waveFunc(this.i) * this.mag;
  13582. this.inst.y = this.initialValue2 + Math.sin(this.inst.angle) * this.waveFunc(this.i) * this.mag;
  13583. this.lastKnownValue = this.inst.x;
  13584. this.lastKnownValue2 = this.inst.y;
  13585. break
  13586. }
  13587. this.inst.set_bbox_changed()
  13588. };
  13589. n.onSpriteFrameChanged = function(e, t) {
  13590. switch (this.movement) {
  13591. case 2:
  13592. this.initialValue *= t.width / e.width;
  13593. this.ratio = t.height / t.width;
  13594. break;
  13595. case 3:
  13596. this.initialValue *= t.width / e.width;
  13597. break;
  13598. case 4:
  13599. this.initialValue *= t.height / e.height;
  13600. break
  13601. }
  13602. };
  13603. o.prototype.IsActive = function() {
  13604. return this.active
  13605. };
  13606. o.prototype.CompareMovement = function(e) {
  13607. return this.movement === e
  13608. };
  13609. o.prototype.ComparePeriod = function(e, t) {
  13610. return cr.do_cmp(this.period, e, t)
  13611. };
  13612. o.prototype.CompareMagnitude = function(e, t) {
  13613. if (this.movement === 5) return cr.do_cmp(this.mag, e, cr.to_radians(t));
  13614. else return cr.do_cmp(this.mag, e, t)
  13615. };
  13616. o.prototype.CompareWave = function(e) {
  13617. return this.wave === e
  13618. };
  13619. e.cnds = new o;
  13620. u.prototype.SetActive = function(e) {
  13621. this.active = e === 1
  13622. };
  13623. u.prototype.SetPeriod = function(e) {
  13624. this.period = e
  13625. };
  13626. u.prototype.SetMagnitude = function(e) {
  13627. this.mag = e;
  13628. if (this.movement === 5) this.mag = cr.to_radians(this.mag)
  13629. };
  13630. u.prototype.SetMovement = function(e) {
  13631. if (this.movement === 5) this.mag = cr.to_degrees(this.mag);
  13632. this.movement = e;
  13633. this.init()
  13634. };
  13635. u.prototype.SetWave = function(e) {
  13636. this.wave = e
  13637. };
  13638. e.acts = new u;
  13639. a.prototype.CyclePosition = function(e) {
  13640. e.set_float(this.i / r)
  13641. };
  13642. a.prototype.Period = function(e) {
  13643. e.set_float(this.period)
  13644. };
  13645. a.prototype.Magnitude = function(e) {
  13646. if (this.movement === 5) e.set_float(cr.to_degrees(this.mag));
  13647. else e.set_float(this.mag)
  13648. };
  13649. a.prototype.Value = function(e) {
  13650. e.set_float(this.waveFunc(this.i) * this.mag)
  13651. };
  13652. e.exps = new a
  13653. })();
  13654. cr.behaviors.custom = function(e) {
  13655. this.runtime = e
  13656. };
  13657. (function() {
  13658. function r(e) {
  13659. if (e === 0) return 0;
  13660. else if (e < 0) return -1;
  13661. else return 1
  13662. }
  13663. function i() {}
  13664. function s() {}
  13665. function o() {}
  13666. var e = cr.behaviors.custom.prototype;
  13667. e.Type = function(e, t) {
  13668. this.behavior = e;
  13669. this.objtype = t;
  13670. this.runtime = e.runtime
  13671. };
  13672. var t = e.Type.prototype;
  13673. t.onCreate = function() {};
  13674. e.Instance = function(e, t) {
  13675. this.type = e;
  13676. this.behavior = e.behavior;
  13677. this.inst = t;
  13678. this.runtime = e.runtime;
  13679. this.dx = 0;
  13680. this.dy = 0;
  13681. this.cancelStep = 0
  13682. };
  13683. var n = e.Instance.prototype;
  13684. n.onCreate = function() {
  13685. this.stepMode = this.properties[0];
  13686. this.pxPerStep = this.properties[1];
  13687. this.enabled = this.properties[2] !== 0
  13688. };
  13689. n.saveToJSON = function() {
  13690. return {
  13691. dx: this.dx,
  13692. dy: this.dy,
  13693. cancelStep: this.cancelStep,
  13694. enabled: this.enabled,
  13695. stepMode: this.stepMode,
  13696. pxPerStep: this.pxPerStep
  13697. }
  13698. };
  13699. n.loadFromJSON = function(e) {
  13700. this.dx = e["dx"];
  13701. this.dy = e["dy"];
  13702. this.cancelStep = e["cancelStep"];
  13703. this.enabled = e["enabled"];
  13704. this.stepMode = e["stepMode"];
  13705. this.pxPerStep = e["pxPerStep"]
  13706. };
  13707. n.getSpeed = function() {
  13708. return Math.sqrt(this.dx * this.dx + this.dy * this.dy)
  13709. };
  13710. n.getAngle = function() {
  13711. return Math.atan2(this.dy, this.dx)
  13712. };
  13713. n.step = function(e, t, n) {
  13714. if (e === 0 && t === 0) return;
  13715. var r = this.inst.x;
  13716. var i = this.inst.y;
  13717. var s, o, u;
  13718. var a = Math.round(Math.sqrt(e * e + t * t) / this.pxPerStep);
  13719. if (a === 0) a = 1;
  13720. var f;
  13721. for (f = 1; f <= a; f++) {
  13722. u = f / a;
  13723. this.inst.x = r + e * u;
  13724. this.inst.y = i + t * u;
  13725. this.inst.set_bbox_changed();
  13726. this.runtime.trigger(n, this.inst);
  13727. if (this.cancelStep === 1) {
  13728. f--;
  13729. u = f / a;
  13730. this.inst.x = r + e * u;
  13731. this.inst.y = i + t * u;
  13732. this.inst.set_bbox_changed();
  13733. return
  13734. } else if (this.cancelStep === 2) {
  13735. return
  13736. }
  13737. }
  13738. };
  13739. n.tick = function() {
  13740. var e = this.runtime.getDt(this.inst);
  13741. var t = this.dx * e;
  13742. var n = this.dy * e;
  13743. var r, i;
  13744. if (this.dx === 0 && this.dy === 0 || !this.enabled) return;
  13745. this.cancelStep = 0;
  13746. if (this.stepMode === 0) {
  13747. this.inst.x += t;
  13748. this.inst.y += n
  13749. } else if (this.stepMode === 1) {
  13750. this.step(t, n, cr.behaviors.custom.prototype.cnds.OnCMStep)
  13751. } else if (this.stepMode === 2) {
  13752. this.step(t, 0, cr.behaviors.custom.prototype.cnds.OnCMHorizStep);
  13753. this.cancelStep = 0;
  13754. this.step(0, n, cr.behaviors.custom.prototype.cnds.OnCMVertStep)
  13755. } else if (this.stepMode === 3) {
  13756. this.step(0, n, cr.behaviors.custom.prototype.cnds.OnCMVertStep);
  13757. this.cancelStep = 0;
  13758. this.step(t, 0, cr.behaviors.custom.prototype.cnds.OnCMHorizStep)
  13759. }
  13760. this.inst.set_bbox_changed()
  13761. };
  13762. i.prototype.IsMoving = function() {
  13763. return this.dx != 0 || this.dy != 0
  13764. };
  13765. i.prototype.CompareSpeed = function(e, t, n) {
  13766. var r;
  13767. switch (e) {
  13768. case 0:
  13769. r = this.getSpeed();
  13770. break;
  13771. case 1:
  13772. r = this.dx;
  13773. break;
  13774. case 2:
  13775. r = this.dy;
  13776. break
  13777. }
  13778. return cr.do_cmp(r, t, n)
  13779. };
  13780. i.prototype.OnCMStep = function() {
  13781. return true
  13782. };
  13783. i.prototype.OnCMHorizStep = function() {
  13784. return true
  13785. };
  13786. i.prototype.OnCMVertStep = function() {
  13787. return true
  13788. };
  13789. e.cnds = new i;
  13790. s.prototype.Stop = function() {
  13791. this.dx = 0;
  13792. this.dy = 0
  13793. };
  13794. s.prototype.Reverse = function(e) {
  13795. switch (e) {
  13796. case 0:
  13797. this.dx *= -1;
  13798. this.dy *= -1;
  13799. break;
  13800. case 1:
  13801. this.dx *= -1;
  13802. break;
  13803. case 2:
  13804. this.dy *= -1;
  13805. break
  13806. }
  13807. };
  13808. s.prototype.SetSpeed = function(e, t) {
  13809. var n;
  13810. switch (e) {
  13811. case 0:
  13812. n = this.getAngle();
  13813. this.dx = Math.cos(n) * t;
  13814. this.dy = Math.sin(n) * t;
  13815. break;
  13816. case 1:
  13817. this.dx = t;
  13818. break;
  13819. case 2:
  13820. this.dy = t;
  13821. break
  13822. }
  13823. };
  13824. s.prototype.Accelerate = function(e, t) {
  13825. var n = this.runtime.getDt(this.inst);
  13826. var r = t * n;
  13827. var i;
  13828. switch (e) {
  13829. case 0:
  13830. i = this.getAngle();
  13831. this.dx += Math.cos(i) * r;
  13832. this.dy += Math.sin(i) * r;
  13833. break;
  13834. case 1:
  13835. this.dx += r;
  13836. break;
  13837. case 2:
  13838. this.dy += r;
  13839. break
  13840. }
  13841. };
  13842. s.prototype.AccelerateAngle = function(e, t) {
  13843. var n = this.runtime.getDt(this.inst);
  13844. var r = e * n;
  13845. var i = cr.to_radians(t);
  13846. this.dx += Math.cos(i) * r;
  13847. this.dy += Math.sin(i) * r
  13848. };
  13849. s.prototype.AcceleratePos = function(e, t, n) {
  13850. var r = this.runtime.getDt(this.inst);
  13851. var i = e * r;
  13852. var s = Math.atan2(n - this.inst.y, t - this.inst.x);
  13853. this.dx += Math.cos(s) * i;
  13854. this.dy += Math.sin(s) * i
  13855. };
  13856. s.prototype.SetAngleOfMotion = function(e) {
  13857. var t = cr.to_radians(e);
  13858. var n = this.getSpeed();
  13859. this.dx = Math.cos(t) * n;
  13860. this.dy = Math.sin(t) * n
  13861. };
  13862. s.prototype.RotateAngleOfMotionClockwise = function(e) {
  13863. var t = this.getAngle() + cr.to_radians(e);
  13864. var n = this.getSpeed();
  13865. this.dx = Math.cos(t) * n;
  13866. this.dy = Math.sin(t) * n
  13867. };
  13868. s.prototype.RotateAngleOfMotionCounterClockwise = function(e) {
  13869. var t = this.getAngle() - cr.to_radians(e);
  13870. var n = this.getSpeed();
  13871. this.dx = Math.cos(t) * n;
  13872. this.dy = Math.sin(t) * n
  13873. };
  13874. s.prototype.StopStepping = function(e) {
  13875. this.cancelStep = e + 1
  13876. };
  13877. s.prototype.PushOutSolid = function(e) {
  13878. var t, n, r;
  13879. switch (e) {
  13880. case 0:
  13881. t = this.getAngle();
  13882. n = Math.cos(t);
  13883. r = Math.sin(t);
  13884. this.runtime.pushOutSolid(this.inst, -n, -r, Math.max(this.getSpeed() * 3, 100));
  13885. break;
  13886. case 1:
  13887. this.runtime.pushOutSolidNearest(this.inst);
  13888. break;
  13889. case 2:
  13890. this.runtime.pushOutSolid(this.inst, 0, -1, Math.max(Math.abs(this.dy) * 3, 100));
  13891. break;
  13892. case 3:
  13893. this.runtime.pushOutSolid(this.inst, 0, 1, Math.max(Math.abs(this.dy) * 3, 100));
  13894. break;
  13895. case 4:
  13896. this.runtime.pushOutSolid(this.inst, -1, 0, Math.max(Math.abs(this.dx) * 3, 100));
  13897. break;
  13898. case 5:
  13899. this.runtime.pushOutSolid(this.inst, 1, 0, Math.max(Math.abs(this.dx) * 3, 100));
  13900. break
  13901. }
  13902. };
  13903. s.prototype.PushOutSolidAngle = function(e) {
  13904. e = cr.to_radians(e);
  13905. var t = Math.cos(e);
  13906. var n = Math.sin(e);
  13907. this.runtime.pushOutSolid(this.inst, t, n, Math.max(this.getSpeed() * 3, 100))
  13908. };
  13909. s.prototype.SetEnabled = function(e) {
  13910. this.enabled = e === 1
  13911. };
  13912. e.acts = new s;
  13913. o.prototype.Speed = function(e) {
  13914. e.set_float(this.getSpeed())
  13915. };
  13916. o.prototype.MovingAngle = function(e) {
  13917. e.set_float(cr.to_degrees(this.getAngle()))
  13918. };
  13919. o.prototype.dx = function(e) {
  13920. e.set_float(this.dx)
  13921. };
  13922. o.prototype.dy = function(e) {
  13923. e.set_float(this.dy)
  13924. };
  13925. e.exps = new o
  13926. })();
  13927. var easeOutBounceArray = [];
  13928. var easeInElasticArray = [];
  13929. var easeOutElasticArray = [];
  13930. var easeInOutElasticArray = [];
  13931. var easeInCircle = [];
  13932. var easeOutCircle = [];
  13933. var easeInOutCircle = [];
  13934. var easeOutBack = [];
  13935. var easeInOutBack = [];
  13936. var litetween_precision = 1e4;
  13937. var updateLimit = 0;
  13938. (function() {
  13939. var t = 1;
  13940. var n = 0;
  13941. var r = 1;
  13942. var i = 0;
  13943. var s = 0;
  13944. var o = 0;
  13945. var u = 0;
  13946. var a = 0;
  13947. for (var f = 0; f <= litetween_precision; f++) {
  13948. u = f / litetween_precision;
  13949. if ((u /= t) < 1 / 2.75) {
  13950. i = r * 7.5625 * u * u + n
  13951. } else if (u < 2 / 2.75) {
  13952. i = r * (7.5625 * (u -= 1.5 / 2.75) * u + .75) + n
  13953. } else if (u < 2.5 / 2.75) {
  13954. i = r * (7.5625 * (u -= 2.25 / 2.75) * u + .9375) + n
  13955. } else {
  13956. i = r * (7.5625 * (u -= 2.625 / 2.75) * u + .984375) + n
  13957. }
  13958. easeOutBounceArray[f] = easeOutBounce(f / litetween_precision, n, r, t);
  13959. u = f / litetween_precision;
  13960. s = 0;
  13961. o = 0;
  13962. if (u == 0) i = n;
  13963. if ((u /= t) == 1) i = n + r;
  13964. if (o == 0) o = t * .3;
  13965. if (s == 0 || s < Math.abs(r)) {
  13966. s = r;
  13967. var a = o / 4
  13968. } else var a = o / (2 * Math.PI) * Math.asin(r / s);
  13969. i = -(s * Math.pow(2, 10 * (u -= 1)) * Math.sin((u * t - a) * 2 * Math.PI / o)) + n;
  13970. easeInElasticArray[f] = i;
  13971. u = f / litetween_precision;
  13972. s = 0;
  13973. o = 0;
  13974. if (u == 0) i = n;
  13975. if ((u /= t) == 1) i = n + r;
  13976. if (o == 0) o = t * .3;
  13977. if (s == 0 || s < Math.abs(r)) {
  13978. s = r;
  13979. var a = o / 4
  13980. } else var a = o / (2 * Math.PI) * Math.asin(r / s);
  13981. i = s * Math.pow(2, -10 * u) * Math.sin((u * t - a) * 2 * Math.PI / o) + r + n;
  13982. easeOutElasticArray[f] = i;
  13983. u = f / litetween_precision;
  13984. s = 0;
  13985. o = 0;
  13986. if (u == 0) i = n;
  13987. if ((u /= t / 2) == 2) i = n + r;
  13988. if (o == 0) o = t * .3 * 1.5;
  13989. if (s == 0 || s < Math.abs(r)) {
  13990. s = r;
  13991. var a = o / 4
  13992. } else var a = o / (2 * Math.PI) * Math.asin(r / s);
  13993. if (u < 1) i = -.5 * s * Math.pow(2, 10 * (u -= 1)) * Math.sin((u * t - a) * 2 * Math.PI / o) + n;
  13994. else i = s * Math.pow(2, -10 * (u -= 1)) * Math.sin((u * t - a) * 2 * Math.PI / o) * .5 + r + n;
  13995. easeInOutElasticArray[f] = i;
  13996. u = f / litetween_precision;
  13997. easeInCircle[f] = -(Math.sqrt(1 - u * u) - 1);
  13998. u = f / litetween_precision;
  13999. easeOutCircle[f] = Math.sqrt(1 - (u - 1) * (u - 1));
  14000. u = f / litetween_precision;
  14001. if ((u /= t / 2) < 1) i = -r / 2 * (Math.sqrt(1 - u * u) - 1) + n;
  14002. else i = r / 2 * (Math.sqrt(1 - (u -= 2) * u) + 1) + n;
  14003. easeInOutCircle[f] = i;
  14004. u = f / litetween_precision;
  14005. a = 0;
  14006. if (a == 0) a = 1.70158;
  14007. i = r * ((u = u / t - 1) * u * ((a + 1) * u + a) + 1) + n;
  14008. easeOutBack[f] = i;
  14009. u = f / litetween_precision;
  14010. a = 0;
  14011. if (a == 0) a = 1.70158;
  14012. if ((u /= t / 2) < 1) i = r / 2 * u * u * (((a *= 1.525) + 1) * u - a) + n;
  14013. i = r / 2 * ((u -= 2) * u * (((a *= 1.525) + 1) * u + a) + 2) + n;
  14014. easeInOutBack[f] = i
  14015. }
  14016. })();
  14017. var TweenObject = function() {
  14018. var e = function(e, t, n, r, i, s, o) {
  14019. this.name = e;
  14020. this.value = 0;
  14021. this.setInitial(r);
  14022. this.setTarget(i);
  14023. this.easefunc = n;
  14024. this.tweened = t;
  14025. this.duration = s;
  14026. this.progress = 0;
  14027. this.state = 0;
  14028. this.onStart = false;
  14029. this.onEnd = false;
  14030. this.onReverseStart = false;
  14031. this.onReverseEnd = false;
  14032. this.lastKnownValue = 0;
  14033. this.lastKnownValue2 = 0;
  14034. this.enforce = o;
  14035. this.pingpong = 1
  14036. };
  14037. return e
  14038. }();
  14039. (function() {
  14040. TweenObject.prototype = {};
  14041. TweenObject.prototype.setInitial = function(e) {
  14042. this.initialparam1 = parseFloat(e.split(",")[0]);
  14043. this.initialparam2 = parseFloat(e.split(",")[1]);
  14044. this.lastKnownValue = 0;
  14045. this.lastKnownValue2 = 0
  14046. };
  14047. TweenObject.prototype.setTarget = function(e) {
  14048. this.targetparam1 = parseFloat(e.split(",")[0]);
  14049. this.targetparam2 = parseFloat(e.split(",")[1]);
  14050. if (isNaN(this.targetparam2)) this.targetparam2 = this.targetparam1
  14051. };
  14052. TweenObject.prototype.OnTick = function(e) {
  14053. if (this.state === 0) return -1;
  14054. if (this.state === 1) this.progress += e;
  14055. if (this.state === 2) this.progress -= e;
  14056. if (this.state === 3) {
  14057. this.state = 0
  14058. }
  14059. if (this.state === 4) {
  14060. this.progress += e * this.pingpong
  14061. }
  14062. if (this.state === 5) {
  14063. this.progress += e * this.pingpong
  14064. }
  14065. if (this.progress < 0) {
  14066. this.progress = 0;
  14067. if (this.state !== 4) {
  14068. this.state = 0
  14069. } else {
  14070. this.pingpong = 1
  14071. }
  14072. this.onReverseEnd = true;
  14073. return 0
  14074. } else if (this.progress > this.duration) {
  14075. this.progress = this.duration;
  14076. if (this.state === 4) {
  14077. this.pingpong = -1
  14078. } else if (this.state === 5) {
  14079. this.progress = 0
  14080. } else {
  14081. this.state = 0
  14082. }
  14083. this.onEnd = true;
  14084. return 1
  14085. } else {
  14086. var t = easeFunc(this.easefunc, this.progress, 0, 1, this.duration);
  14087. return t
  14088. }
  14089. }
  14090. })();
  14091. cr.behaviors.lunarray_LiteTween = function(e) {
  14092. this.runtime = e
  14093. };
  14094. (function() {
  14095. var e = cr.behaviors.lunarray_LiteTween.prototype;
  14096. e.Type = function(e, t) {
  14097. this.behavior = e;
  14098. this.objtype = t;
  14099. this.runtime = e.runtime
  14100. };
  14101. var t = e.Type.prototype;
  14102. t.onCreate = function() {};
  14103. e.Instance = function(e, t) {
  14104. this.type = e;
  14105. this.behavior = e.behavior;
  14106. this.inst = t;
  14107. this.runtime = e.runtime;
  14108. this.i = 0
  14109. };
  14110. var n = e.Instance.prototype;
  14111. n.onCreate = function() {
  14112. this.active = this.properties[0];
  14113. this.tweened = this.properties[1];
  14114. this.easing = this.properties[2];
  14115. this.target = this.properties[3];
  14116. this.targetmode = this.properties[4];
  14117. if (this.targetmode === 1) this.target = "relative(" + this.target + ")";
  14118. this.duration = this.properties[5];
  14119. this.enforce = this.properties[6] === 1;
  14120. this.inst.value = 0;
  14121. this.tween_list = {};
  14122. this.addToTweenList("default", this.tweened, this.easing, "current", this.target, this.duration, this.enforce);
  14123. if (this.active === 1) this.startTween(0);
  14124. if (this.active === 2) this.startTween(2);
  14125. if (this.active === 3) this.startTween(3)
  14126. };
  14127. n.parseCurrent = function(e, t) {
  14128. if (t === undefined) t = "current";
  14129. var n = trim(t);
  14130. t = trim(t);
  14131. if (t === "current") {
  14132. switch (e) {
  14133. case 0:
  14134. n = this.inst.x + "," + this.inst.y;
  14135. break;
  14136. case 1:
  14137. n = this.inst.width + "," + this.inst.height;
  14138. break;
  14139. case 2:
  14140. n = this.inst.width + "," + this.inst.height;
  14141. break;
  14142. case 3:
  14143. n = this.inst.width + "," + this.inst.height;
  14144. break;
  14145. case 4:
  14146. n = cr.to_degrees(this.inst.angle) + "," + cr.to_degrees(this.inst.angle);
  14147. break;
  14148. case 5:
  14149. n = this.inst.opacity * 100 + "," + this.inst.opacity * 100;
  14150. break;
  14151. case 6:
  14152. n = this.inst.value + "," + this.inst.value;
  14153. break;
  14154. case 7:
  14155. n = this.inst.x + "," + this.inst.y;
  14156. break;
  14157. case 8:
  14158. n = this.inst.x + "," + this.inst.y;
  14159. break;
  14160. default:
  14161. break
  14162. }
  14163. }
  14164. if (t.substring(0, 8) === "relative") {
  14165. var r = t.match(/\((.*?)\)/);
  14166. if (r) {
  14167. var i = parseFloat(r[1].split(",")[0]);
  14168. var s = parseFloat(r[1].split(",")[1])
  14169. }
  14170. if (isNaN(i)) i = 0;
  14171. if (isNaN(s)) s = 0;
  14172. switch (e) {
  14173. case 0:
  14174. n = this.inst.x + i + "," + (this.inst.y + s);
  14175. break;
  14176. case 1:
  14177. n = this.inst.width + i + "," + (this.inst.height + s);
  14178. break;
  14179. case 2:
  14180. n = this.inst.width + i + "," + (this.inst.height + s);
  14181. break;
  14182. case 3:
  14183. n = this.inst.width + i + "," + (this.inst.height + s);
  14184. break;
  14185. case 4:
  14186. n = cr.to_degrees(this.inst.angle) + i + "," + (cr.to_degrees(this.inst.angle) + s);
  14187. break;
  14188. case 5:
  14189. n = this.inst.opacity * 100 + i + "," + (this.inst.opacity * 100 + s);
  14190. break;
  14191. case 6:
  14192. n = this.inst.value + i + "," + this.inst.value + i;
  14193. break;
  14194. case 7:
  14195. n = this.inst.x + i + "," + this.inst.y;
  14196. break;
  14197. case 8:
  14198. n = this.inst.x + "," + (this.inst.y + i);
  14199. break;
  14200. default:
  14201. break
  14202. }
  14203. }
  14204. return n
  14205. };
  14206. n.addToTweenList = function(e, t, n, r, i, s, o) {
  14207. r = this.parseCurrent(t, r);
  14208. i = this.parseCurrent(t, i);
  14209. if (this.tween_list[e] !== undefined) {
  14210. delete this.tween_list[e]
  14211. }
  14212. this.tween_list[e] = new TweenObject(e, t, n, r, i, s, o)
  14213. };
  14214. n.saveToJSON = function() {};
  14215. n.loadFromJSON = function(e) {};
  14216. n.setProgressTo = function(e) {
  14217. if (e > 1) e = 1;
  14218. if (e < 0) e = 0;
  14219. for (var t in this.tween_list) {
  14220. var n = this.tween_list[t];
  14221. n.lastKnownValue = 0;
  14222. n.lastKnownValue2 = 0;
  14223. n.state = 3;
  14224. n.progress = e * n.duration;
  14225. var r = n.OnTick(0);
  14226. this.updateTween(n, r)
  14227. }
  14228. };
  14229. n.startTween = function(e) {
  14230. for (var t in this.tween_list) {
  14231. var n = this.tween_list[t];
  14232. if (e === 0) {
  14233. n.progress = 1e-6;
  14234. n.lastKnownValue = 0;
  14235. n.lastKnownValue2 = 0;
  14236. n.onStart = true;
  14237. n.state = 1
  14238. }
  14239. if (e === 1) {
  14240. n.state = 1
  14241. }
  14242. if (e === 2) {
  14243. n.progress = 1e-6;
  14244. n.lastKnownValue = 0;
  14245. n.lastKnownValue2 = 0;
  14246. n.onStart = true;
  14247. n.state = 4
  14248. }
  14249. if (e === 3) {
  14250. n.progress = 1e-6;
  14251. n.lastKnownValue = 0;
  14252. n.lastKnownValue2 = 0;
  14253. n.onStart = true;
  14254. n.state = 5
  14255. }
  14256. }
  14257. };
  14258. n.stopTween = function(e) {
  14259. for (var t in this.tween_list) {
  14260. var n = this.tween_list[t];
  14261. if (e === 1) n.progress = 0;
  14262. if (e === 2) n.progress = n.duration;
  14263. n.state = 3;
  14264. var r = n.OnTick(0);
  14265. this.updateTween(n, r)
  14266. }
  14267. };
  14268. n.reverseTween = function(e) {
  14269. for (var t in this.tween_list) {
  14270. var n = this.tween_list[t];
  14271. if (e === 1) {
  14272. n.progress = n.duration;
  14273. n.lastKnownValue = 0;
  14274. n.lastKnownValue2 = 0;
  14275. n.onReverseStart = true
  14276. }
  14277. n.state = 2
  14278. }
  14279. };
  14280. n.updateTween = function(e, t) {
  14281. if (e.tweened === 0) {
  14282. if (e.enforce) {
  14283. this.inst.x = e.initialparam1 + (e.targetparam1 - e.initialparam1) * t;
  14284. this.inst.y = e.initialparam2 + (e.targetparam2 - e.initialparam2) * t
  14285. } else {
  14286. this.inst.x += (e.targetparam1 - e.initialparam1) * t - e.lastKnownValue;
  14287. this.inst.y += (e.targetparam2 - e.initialparam2) * t - e.lastKnownValue2;
  14288. e.lastKnownValue = (e.targetparam1 - e.initialparam1) * t;
  14289. e.lastKnownValue2 = (e.targetparam2 - e.initialparam2) * t
  14290. }
  14291. } else if (e.tweened === 1) {
  14292. if (e.enforce) {
  14293. this.inst.width = e.initialparam1 + (e.targetparam1 - e.initialparam1) * t;
  14294. this.inst.height = e.initialparam2 + (e.targetparam2 - e.initialparam2) * t
  14295. } else {
  14296. this.inst.width += (e.targetparam1 - e.initialparam1) * t - e.lastKnownValue;
  14297. this.inst.height += (e.targetparam2 - e.initialparam2) * t - e.lastKnownValue2;
  14298. e.lastKnownValue = (e.targetparam1 - e.initialparam1) * t;
  14299. e.lastKnownValue2 = (e.targetparam2 - e.initialparam2) * t
  14300. }
  14301. } else if (e.tweened === 2) {
  14302. if (e.enforce) {
  14303. this.inst.width = e.initialparam1 + (e.targetparam1 - e.initialparam1) * t
  14304. } else {
  14305. this.inst.width += (e.targetparam1 - e.initialparam1) * t - e.lastKnownValue;
  14306. e.lastKnownValue = (e.targetparam1 - e.initialparam1) * t
  14307. }
  14308. } else if (e.tweened === 3) {
  14309. if (e.enforce) {
  14310. this.inst.height = e.initialparam2 + (e.targetparam2 - e.initialparam2) * t
  14311. } else {
  14312. this.inst.height += (e.targetparam2 - e.initialparam2) * t - e.lastKnownValue2;
  14313. e.lastKnownValue2 = (e.targetparam2 - e.initialparam2) * t
  14314. }
  14315. } else if (e.tweened === 4) {
  14316. if (e.enforce) {
  14317. var n = e.initialparam1 + (e.targetparam1 - e.initialparam1) * t;
  14318. this.inst.angle = cr.clamp_angle(cr.to_radians(n))
  14319. } else {
  14320. var n = (e.targetparam1 - e.initialparam1) * t - e.lastKnownValue;
  14321. this.inst.angle = cr.clamp_angle(this.inst.angle + cr.to_radians(n));
  14322. e.lastKnownValue = (e.targetparam1 - e.initialparam1) * t
  14323. }
  14324. } else if (e.tweened === 5) {
  14325. if (e.enforce) {
  14326. this.inst.opacity = (e.initialparam1 + (e.targetparam1 - e.initialparam1) * t) / 100
  14327. } else {
  14328. this.inst.opacity += ((e.targetparam1 - e.initialparam1) * t - e.lastKnownValue) / 100;
  14329. e.lastKnownValue = (e.targetparam1 - e.initialparam1) * t
  14330. }
  14331. } else if (e.tweened === 6) {
  14332. if (e.enforce) {
  14333. this.inst.value = e.initialparam1 + (e.targetparam1 - e.initialparam1) * t
  14334. } else {
  14335. this.inst.value += (e.targetparam1 - e.initialparam1) * t - e.lastKnownValue;
  14336. e.lastKnownValue = (e.targetparam1 - e.initialparam1) * t
  14337. }
  14338. } else if (e.tweened === 7) {
  14339. if (e.enforce) {
  14340. this.inst.x = e.initialparam1 + (e.targetparam1 - e.initialparam1) * t
  14341. } else {
  14342. this.inst.x += (e.targetparam1 - e.initialparam1) * t - e.lastKnownValue;
  14343. e.lastKnownValue = (e.targetparam1 - e.initialparam1) * t
  14344. }
  14345. } else if (e.tweened === 8) {
  14346. if (e.enforce) {
  14347. this.inst.y = e.initialparam2 + (e.targetparam2 - e.initialparam2) * t
  14348. } else {
  14349. this.inst.y += (e.targetparam2 - e.initialparam2) * t - e.lastKnownValue2;
  14350. e.lastKnownValue2 = (e.targetparam2 - e.initialparam2) * t
  14351. }
  14352. }
  14353. this.inst.set_bbox_changed()
  14354. };
  14355. n.tick = function() {
  14356. var e = this.runtime.getDt(this.inst);
  14357. var t = this.tween_list["default"];
  14358. if (t.state !== 0) {
  14359. if (t.onStart) {
  14360. this.runtime.trigger(cr.behaviors.lunarray_LiteTween.prototype.cnds.OnStart, this.inst);
  14361. t.onStart = false
  14362. }
  14363. if (t.onReverseStart) {
  14364. this.runtime.trigger(cr.behaviors.lunarray_LiteTween.prototype.cnds.OnReverseStart, this.inst);
  14365. t.onReverseStart = false
  14366. }
  14367. var n = t.OnTick(e);
  14368. this.updateTween(t, n);
  14369. if (t.onEnd) {
  14370. this.runtime.trigger(cr.behaviors.lunarray_LiteTween.prototype.cnds.OnEnd, this.inst);
  14371. t.onEnd = false
  14372. }
  14373. if (t.onReverseEnd) {
  14374. this.runtime.trigger(cr.behaviors.lunarray_LiteTween.prototype.cnds.OnReverseEnd, this.inst);
  14375. t.onReverseEnd = false
  14376. }
  14377. }
  14378. };
  14379. e.cnds = {};
  14380. var r = e.cnds;
  14381. r.IsActive = function() {
  14382. return this.tween_list["default"].state !== 0
  14383. };
  14384. r.CompareProgress = function(e, t) {
  14385. var n = this.tween_list["default"];
  14386. return cr.do_cmp(n.progress / n.duration, e, t)
  14387. };
  14388. r.OnStart = function() {
  14389. if (this.tween_list["default"] === undefined) return false;
  14390. return this.tween_list["default"].onStart
  14391. };
  14392. r.OnReverseStart = function() {
  14393. if (this.tween_list["default"] === undefined) return false;
  14394. return this.tween_list["default"].onReverseStart
  14395. };
  14396. r.OnEnd = function() {
  14397. if (this.tween_list["default"] === undefined) return false;
  14398. return this.tween_list["default"].onEnd
  14399. };
  14400. r.OnReverseEnd = function() {
  14401. if (this.tween_list["default"] === undefined) return false;
  14402. return this.tween_list["default"].onReverseEnd
  14403. };
  14404. e.acts = {};
  14405. var i = e.acts;
  14406. i.Start = function(e) {
  14407. this.startTween(e)
  14408. };
  14409. i.Stop = function(e) {
  14410. this.stopTween(e)
  14411. };
  14412. i.Reverse = function(e) {
  14413. this.reverseTween(e)
  14414. };
  14415. i.ProgressTo = function(e) {
  14416. this.setProgressTo(e)
  14417. };
  14418. i.SetDuration = function(e) {
  14419. if (isNaN(e)) return;
  14420. if (e < 0) return;
  14421. if (this.tween_list["default"] === undefined) return;
  14422. this.tween_list["default"].duration = e
  14423. };
  14424. i.SetEnforce = function(e) {
  14425. if (this.tween_list["default"] === undefined) return;
  14426. this.tween_list["default"].enforce = e === 1
  14427. };
  14428. i.SetInitial = function(e) {
  14429. if (this.tween_list["default"] === undefined) return;
  14430. var t = this.parseCurrent(this.tween_list["default"].tweened, e);
  14431. this.tween_list["default"].setInitial(t)
  14432. };
  14433. i.SetTarget = function(e, t, n) {
  14434. if (this.tween_list["default"] === undefined) return;
  14435. if (isNaN(n)) return;
  14436. var r = n + "";
  14437. var i = this.tween_list["default"];
  14438. this.targetmode = t;
  14439. if (t === 1) {
  14440. switch (e) {
  14441. case 0:
  14442. r = this.inst.x + n + "," + i.targetparam2;
  14443. break;
  14444. case 1:
  14445. r = i.targetparam1 + "," + (this.inst.y + n);
  14446. break;
  14447. case 2:
  14448. r = "" + cr.to_degrees(this.inst.angle + cr.to_radians(n));
  14449. break;
  14450. case 3:
  14451. r = "" + this.inst.opacity * 100 + n;
  14452. break;
  14453. case 4:
  14454. r = this.inst.width + n + "," + i.targetparam2;
  14455. break;
  14456. case 5:
  14457. r = i.targetparam1 + "," + (this.inst.height + n);
  14458. break;
  14459. case 6:
  14460. r = n + "," + n;
  14461. break;
  14462. default:
  14463. break
  14464. }
  14465. } else {
  14466. switch (e) {
  14467. case 0:
  14468. r = n + "," + i.targetparam2;
  14469. break;
  14470. case 1:
  14471. r = i.targetparam1 + "," + n;
  14472. break;
  14473. case 2:
  14474. r = n + "," + n;
  14475. break;
  14476. case 3:
  14477. r = n + "," + n;
  14478. break;
  14479. case 4:
  14480. r = n + "," + i.targetparam2;
  14481. break;
  14482. case 5:
  14483. r = i.targetparam1 + "," + n;
  14484. break;
  14485. case 6:
  14486. r = n + "," + n;
  14487. break;
  14488. default:
  14489. break
  14490. }
  14491. }
  14492. var s = this.parseCurrent(this.tween_list["default"].tweened, "current");
  14493. var o = this.parseCurrent(this.tween_list["default"].tweened, r);
  14494. i.setInitial(s);
  14495. i.setTarget(o)
  14496. };
  14497. i.SetTweenedProperty = function(e) {
  14498. if (this.tween_list["default"] === undefined) return;
  14499. this.tween_list["default"].tweened = e
  14500. };
  14501. i.SetEasing = function(e) {
  14502. if (this.tween_list["default"] === undefined) return;
  14503. this.tween_list["default"].easefunc = e
  14504. };
  14505. i.SetValue = function(e) {
  14506. this.inst.value = e
  14507. };
  14508. i.SetParameter = function(e, t, n, r, i) {
  14509. if (this.tween_list["default"] === undefined) {
  14510. this.addToTweenList("default", e, t, initial, n, r, i)
  14511. } else {
  14512. var s = this.tween_list["default"];
  14513. s.tweened = e;
  14514. s.easefunc = t;
  14515. s.setInitial(this.parseCurrent(e, "current"));
  14516. s.setTarget(this.parseCurrent(e, n));
  14517. s.duration = r;
  14518. s.enforce = i === 1
  14519. }
  14520. };
  14521. e.exps = {};
  14522. var s = e.exps;
  14523. s.Progress = function(e) {
  14524. var t = this.tween_list["default"].progress / this.tween_list["default"].duration;
  14525. e.set_float(t)
  14526. };
  14527. s.Duration = function(e) {
  14528. e.set_float(this.tween_list["default"].duration)
  14529. };
  14530. s.Target = function(e) {
  14531. var t = this.tween_list["default"];
  14532. var n = "N/A";
  14533. switch (t.tweened) {
  14534. case 0:
  14535. n = t.targetparam1;
  14536. break;
  14537. case 1:
  14538. n = t.targetparam2;
  14539. break;
  14540. case 2:
  14541. n = t.targetparam1;
  14542. break;
  14543. case 3:
  14544. n = t.targetparam1;
  14545. break;
  14546. case 4:
  14547. n = t.targetparam1;
  14548. break;
  14549. case 5:
  14550. n = t.targetparam2;
  14551. break;
  14552. case 6:
  14553. n = t.targetparam1;
  14554. break;
  14555. default:
  14556. break
  14557. }
  14558. e.set_float(n)
  14559. };
  14560. s.Value = function(e) {
  14561. var t = this.inst.value;
  14562. e.set_float(t)
  14563. }
  14564. })();
  14565. cr.getProjectModel = function() {
  14566. return [null, "StartScreen", [
  14567. [cr.plugins_.Mouse, true, false, false, false, false, false, false, false, false],
  14568. [cr.plugins_.Particles, false, true, true, false, true, true, true, true, true],
  14569. [cr.plugins_.Softgames, true, false, false, false, false, false, false, false, false],
  14570. [cr.plugins_.Sprite, false, true, true, true, true, true, true, true, false],
  14571. [cr.plugins_.Spritefont2, false, true, true, true, true, true, true, true, true],
  14572. [cr.plugins_.Text, false, true, true, true, true, true, true, true, false],
  14573. [cr.plugins_.Touch, true, false, false, false, false, false, false, false, false],
  14574. [cr.plugins_.Browser, true, false, false, false, false, false, false, false, false]
  14575. ], [
  14576. ["t0", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14577. ["Default", 5, false, 1, 0, false, 0xbf26330e17ef3, [
  14578. ["images/aboutbtn-sheet0.png", 2847, 0, 0, 169, 34, 1, .5, .508475, [],
  14579. [-.471154, -.457627, 0, -.508475, .471154, -.457627, .490385, -.0169496, .471154, .440678, 0, .491525, -.480769, .457627, -.490385, -.0169496], 0]
  14580. ]]
  14581. ],
  14582. [], false, false, 5208885876211883, []
  14583. ],
  14584. ["t1", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14585. ["Default", 5, false, 1, 0, false, 8146450955332427, [
  14586. ["images/playbtn_square-sheet0.png", 2023, 0, 0, 187, 76, 1, .502674, .5, [],
  14587. [-.481283, -.447368, -.00534782, -.473684, .475936, -.447368, .497326, 0, .475936, .447368, -.00534782, .486842, -.481283, .447368, -.502674, 0], 0]
  14588. ]]
  14589. ],
  14590. [], false, false, 5839598333792561, []
  14591. ],
  14592. ["t2", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14593. ["Default", 5, false, 1, 0, false, 9530490509326564, [
  14594. ["images/pausebtn-sheet0.png", 2077, 0, 0, 52, 52, 1, .519231, .519231, [],
  14595. [-.365385, -.365385, -.0192308, -.519231, .346154, -.384616, .480769, -.0192308, .346154, .346154, -.0192308, .480769, -.384616, .346154, -.519231, -.0192308], 0]
  14596. ]]
  14597. ],
  14598. [], false, false, 8127550894873643, []
  14599. ],
  14600. ["t3", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14601. ["Default", 5, false, 1, 0, false, 9680036336350844, [
  14602. ["images/gotostartscreenbtn-sheet0.png", 2677, 0, 0, 92, 97, 1, .456522, .43299, [],
  14603. [-.282609, -.268042, .0434783, -.381443, .358695, -.257732, .510869, .0618553, .369565, .402062, .0434783, .515464, -.282609, .402062, -.434783, .0618553], 0]
  14604. ]]
  14605. ],
  14606. [], false, false, 0x3ce63d918c408, []
  14607. ],
  14608. ["t4", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14609. ["Default", 5, false, 1, 0, false, 8381725045710814, [
  14610. ["images/playbtn_round-sheet0.png", 2763, 0, 0, 92, 97, 1, .5, .505155, [],
  14611. [-.326087, -.340207, 0, -.453608, .315217, -.329897, .467391, -.0103096, .326087, .329897, 0, .443299, -.326087, .329897, -.478261, -.0103096], 0]
  14612. ]]
  14613. ],
  14614. [], false, false, 9685690679230812, []
  14615. ],
  14616. ["t5", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14617. ["Default", 5, false, 1, 0, false, 452975352209808, [
  14618. ["images/replaybtn-sheet0.png", 3449, 0, 0, 92, 97, 1, .543478, .505155, [],
  14619. [-.369565, -.340207, -.0434783, -.453608, .271739, -.329897, .423913, -.0103096, .282609, .329897, -.0434783, .443299, -.369565, .329897, -.521739, -.0103096], 0]
  14620. ]]
  14621. ],
  14622. [], false, false, 567107003245929, []
  14623. ],
  14624. ["t6", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14625. ["Default", 5, false, 1, 0, false, 6364276854239438, [
  14626. ["images/startscreenbg-sheet0.png", 238084, 0, 0, 320, 480, 1, .5, .5, [],
  14627. [], 1]
  14628. ]]
  14629. ],
  14630. [], false, false, 5756279195113567, []
  14631. ],
  14632. ["t7", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14633. ["Default", 5, false, 1, 0, false, 8270338397967252, [
  14634. ["images/ingamebg-sheet0.png", 181685, 0, 0, 320, 480, 1, .5, .5, [],
  14635. [], 1]
  14636. ]]
  14637. ],
  14638. [], false, false, 0x6f03f24f0373f, []
  14639. ],
  14640. ["t8", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14641. ["Default", 5, false, 1, 0, false, 0x936836f36315a, [
  14642. ["images/tutorial2-sheet0.png", 200756, 0, 0, 320, 480, 1, 0, 0, [],
  14643. [], 1],
  14644. ["images/tutorial2-sheet1.png", 198446, 0, 0, 320, 480, 1, 0, 0, [],
  14645. [], 1]
  14646. ]]
  14647. ],
  14648. [], false, false, 0xbcda3881d3248, []
  14649. ],
  14650. ["t9", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14651. ["Default", 5, false, 1, 0, false, 0x74d899ec3ee24, [
  14652. ["images/tutorial-sheet0.png", 224267, 0, 0, 320, 480, 1, 0, 0, [],
  14653. [], 1],
  14654. ["images/tutorial-sheet1.png", 220546, 0, 0, 320, 480, 1, 0, 0, [],
  14655. [], 1]
  14656. ]]
  14657. ],
  14658. [], false, false, 5702637664950532, []
  14659. ],
  14660. ["t10", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14661. ["Default", 5, false, 1, 0, false, 0x89a209197ed88, [
  14662. ["images/pausescreen-sheet0.png", 9759, 0, 0, 320, 480, 1, 0, 0, [],
  14663. [], 0],
  14664. ["images/pausescreen-sheet1.png", 9895, 0, 0, 320, 480, 1, 0, 0, [],
  14665. [], 0]
  14666. ]]
  14667. ],
  14668. [], false, false, 0x53749ddc258c5, []
  14669. ],
  14670. ["t11", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14671. ["Default", 5, false, 1, 0, false, 328665383089664, [
  14672. ["images/aboutscreen-sheet0.png", 12935, 0, 0, 320, 480, 1, 0, 0, [],
  14673. [], 0],
  14674. ["images/aboutscreen-sheet1.png", 12441, 0, 0, 320, 480, 1, 0, 0, [],
  14675. [], 0]
  14676. ]]
  14677. ],
  14678. [], false, false, 7242083636327699, []
  14679. ],
  14680. ["t12", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14681. ["Default", 5, false, 1, 0, false, 0x8a533c43b0ecd, [
  14682. ["images/gameoverscreen-sheet0.png", 9535, 0, 0, 320, 480, 1, 0, 0, [],
  14683. [], 0],
  14684. ["images/gameoverscreen-sheet1.png", 9518, 0, 0, 320, 480, 1, 0, 0, [],
  14685. [], 0]
  14686. ]]
  14687. ],
  14688. [], false, false, 5207905414052742, []
  14689. ],
  14690. ["t13", cr.plugins_.Sprite, false, [], 2, 0, null, [
  14691. ["Default", 5, false, 1, 0, false, 0xcb3d5b372aefb, [
  14692. ["images/whitescreen-sheet0.png", 244, 0, 0, 320, 480, 1, 0, 0, [],
  14693. [], 4]
  14694. ]]
  14695. ],
  14696. [
  14697. ["start", cr.behaviors.lunarray_LiteTween, 6485208721801974],
  14698. ["stop", cr.behaviors.lunarray_LiteTween, 0xb6d3375366d5c]
  14699. ], false, false, 0xb144ae5fd20a8, []
  14700. ],
  14701. ["t14", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14702. ["Default", 5, false, 1, 0, false, 6095122240634483, [
  14703. ["images/bomb_big-sheet0.png", 4247, 0, 0, 64, 93, 1, .5, .505376, [],
  14704. [-.3125, -.376344, 0, -.354838, .140625, -.258064, .421875, -.0107524, .265625, .333334, 0, .39785, -.25, .322581, -.375, -.0107524], 0]
  14705. ]]
  14706. ],
  14707. [], false, false, 0x767e0a29bfc1a, []
  14708. ],
  14709. ["t15", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14710. ["Default", 5, false, 1, 0, false, 6589965858475488, [
  14711. ["images/bomb_small-sheet0.png", 2521, 0, 0, 43, 61, 1, .511628, .508197, [],
  14712. [-.139535, -.245902, -.0232559, -.262295, .27907, -.360656, .372093, -.0163937, .209302, .295082, -.0232559, .360655, -.27907, .327869, -.488372, -.0163937], 0]
  14713. ]]
  14714. ],
  14715. [], false, false, 0xbe91bc7f8e75f, []
  14716. ],
  14717. ["t16", cr.plugins_.Sprite, false, [], 1, 0, null, [
  14718. ["Default", 5, false, 1, 0, false, 9942592025634288, [
  14719. ["images/explosion-sheet0.png", 5647, 1, 1, 137, 134, 1, .50365, .507463, [],
  14720. [-.0583946, -.0522387, -.00729966, -.104478, .124087, -.126866, .0948904, -.00746268, .0583944, .0447763, -.00729966, .0373133, -.0364966, .0149253, -.0291966, -.00746268], 0],
  14721. ["images/explosion-sheet0.png", 5647, 139, 1, 137, 134, 1, .50365, .5, [],
  14722. [-.0802917, -.067164, -.00729966, -.156716, .19708, -.19403, .19708, 0, .102189, .097015, -.00729966, .11194, -.109489, .097015, -.124088, 0], 0],
  14723. ["images/explosion-sheet0.png", 5647, 277, 1, 137, 134, 1, .50365, .5, [],
  14724. [-.175183, -.164179, -.00729966, -.231343, .19708, -.19403, .248175, 0, .124087, .119403, -.00729966, .201493, -.160584, .149254, -.240876, 0], 0],
  14725. ["images/explosion-sheet0.png", 5647, 1, 136, 137, 134, 1, .50365, .5, [],
  14726. [-.350365, -.343284, -.00729966, -.485075, .401459, -.402985, .459854, 0, .313868, .313433, -.00729966, .485075, -.335767, .328358, -.416058, 0], 0],
  14727. ["images/explosion-sheet0.png", 5647, 139, 136, 137, 134, 1, .50365, .5, [],
  14728. [.204379, .223881, -.00729966, -.492537, .357664, -.358209, .489051, 0, .328467, .328358, -.00729966, .395522, .211678, -.231343, -.372263, 0], 0],
  14729. ["images/explosion-sheet0.png", 5647, 277, 136, 137, 134, 1, .50365, .5, [],
  14730. [.270073, .291045, .29927, -.298507, .467153, 0, .240876, -.261194, -.277373, 0], 0],
  14731. ["images/explosion-sheet0.png", 5647, 1, 271, 137, 134, 1, .50365, .5, [],
  14732. [.270073, .291045, .29927, -.298507, .467153, 0, .240876, -.261194, -.277373, 0], 0],
  14733. ["images/explosion-sheet0.png", 5647, 139, 271, 137, 134, 1, .50365, .5, [],
  14734. [], 0],
  14735. ["images/explosion-sheet0.png", 5647, 277, 271, 137, 134, 1, .50365, .5, [],
  14736. [], 0]
  14737. ]]
  14738. ],
  14739. [
  14740. ["Fade", cr.behaviors.Fade, 5096540149705603]
  14741. ], false, false, 0xe83af3ce79b0b, []
  14742. ],
  14743. ["t17", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14744. ["Default", 5, false, 1, 0, false, 6974015664332222, [
  14745. ["images/candyhalf_blue-sheet0.png", 2260, 0, 0, 31, 60, 1, 1, .483333, [],
  14746. [-.612903, -.283333, -.516129, -.3, -.354839, -.3, -.032258, .0166667, -.354839, .333334, -.516129, .333334, -.612903, .316667, -.967742, .0166667], 0]
  14747. ]]
  14748. ],
  14749. [], false, false, 0x85f240771fee9, []
  14750. ],
  14751. ["t18", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14752. ["Default", 5, false, 1, 0, false, 0xd7c5541578bcb, [
  14753. ["images/candyhalf_green-sheet0.png", 2815, 0, 0, 39, 76, 1, 1, .5, [],
  14754. [-.564103, -.276316, -.512821, -.302632, -.25641, -.368421, 0, 0, -.205128, .394737, -.512821, .355263, -.615385, .302632, -1, 0], 0]
  14755. ]]
  14756. ],
  14757. [], false, false, 0x60310414c6744, []
  14758. ],
  14759. ["t19", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14760. ["Default", 5, false, 1, 0, false, 0x6c020a91a5264, [
  14761. ["images/candyhalf_purple-sheet0.png", 1983, 0, 0, 25, 48, 1, 1, .520833, [],
  14762. [-.68, -.354166, -.52, -.395833, -.16, -.4375, -.04, -.0208333, -.2, .375, -.64, .291667, -.96, -.0208333], 0]
  14763. ]]
  14764. ],
  14765. [], false, false, 975699212391044, []
  14766. ],
  14767. ["t20", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14768. ["Default", 5, false, 1, 0, false, 0x59fcf6e093ef9, [
  14769. ["images/candy_purple-sheet0.png", 2852, 0, 0, 48, 48, 1, .5, .5, [],
  14770. [-.333333, -.333333, 0, -.479167, .333333, -.333333, .4375, 0, .270833, .270833, 0, .354167, -.270833, .270833, -.416667, 0], 0]
  14771. ]]
  14772. ],
  14773. [], false, false, 8369650883463168, []
  14774. ],
  14775. ["t21", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14776. ["Default", 5, false, 1, 0, false, 6323503275742133, [
  14777. ["images/candy_blue-sheet0.png", 3452, 0, 0, 60, 60, 1, .5, .5, [],
  14778. [-.4, -.4, 0, -.366667, .25, -.25, .416667, 0, .283333, .283333, 0, .4, -.233333, .233333, -.316667, 0], 0]
  14779. ]]
  14780. ],
  14781. [], false, false, 540997275623285, []
  14782. ],
  14783. ["t22", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14784. ["Default", 5, false, 1, 0, false, 9770393067484724, [
  14785. ["images/candy_green-sheet0.png", 4524, 0, 0, 76, 76, 1, .5, .5, [],
  14786. [-.368421, -.368421, 0, -.447368, .328947, -.328947, .473684, 0, .289474, .289474, 0, .342105, -.236842, .236842, -.447368, 0], 0]
  14787. ]]
  14788. ],
  14789. [], false, false, 5323103978308123, []
  14790. ],
  14791. ["t23", cr.plugins_.Sprite, false, [6421634589541215], 1, 0, null, [
  14792. ["Default", 5, false, 1, 0, false, 5430814220914779, [
  14793. ["images/life-sheet0.png", 2410, 0, 0, 71, 55, 1, .507042, .509091, [],
  14794. [-.338028, -.290909, -.0140842, -.454545, .295775, -.254546, .43662, -.0181819, .197183, .109091, -.0140842, .418182, -.183098, .0727271, -.295774, -.0181819], 0]
  14795. ]]
  14796. ],
  14797. [
  14798. ["CustomMovement", cr.behaviors.custom, 891926197686602]
  14799. ], false, false, 0xa1cc1841c6402, []
  14800. ],
  14801. ["t24", cr.plugins_.Sprite, false, [851692599758286], 4, 0, null, [
  14802. ["Default", 5, false, 1, 0, false, 9769720370376208, [
  14803. ["images/life-sheet0.png", 2410, 0, 0, 71, 55, 1, .507042, .509091, [],
  14804. [-.338028, -.290909, -.0140842, -.454545, .295775, -.254546, .43662, -.0181819, .197183, .109091, -.0140842, .418182, -.183098, .0727271, -.295774, -.0181819], 0]
  14805. ]]
  14806. ],
  14807. [
  14808. ["CustomMovement", cr.behaviors.custom, 0x39a192194bb56],
  14809. ["LiteTween", cr.behaviors.lunarray_LiteTween, 0x8fb83cd24d6e],
  14810. ["LiteTween2", cr.behaviors.lunarray_LiteTween, 7787659317162863],
  14811. ["LiteTween3", cr.behaviors.lunarray_LiteTween, 0xe64fa641b096b]
  14812. ], false, false, 0xd6bf614ac12f, []
  14813. ],
  14814. ["t25", cr.plugins_.Sprite, false, [], 1, 0, null, [
  14815. ["Default", 5, false, 1, 0, false, 363864622756435, [
  14816. ["images/fontainstar-sheet0.png", 2733, 0, 0, 52, 50, 1, 1.05769, .78, [],
  14817. [-.557692, -.62, -.384615, -.44, -.26923, -.28, -.26923, 0, -.557692, -.02, -.788461, -.0599999, -.884615, -.28], 0]
  14818. ]]
  14819. ],
  14820. [
  14821. ["CustomMovement", cr.behaviors.custom, 0x59a05936e4a88]
  14822. ], false, false, 8275527515999204, []
  14823. ],
  14824. ["t26", cr.plugins_.Particles, false, [], 0, 0, ["images/fontainstarparticle.png", 278, 0], null, [], false, false, 7457665451351134, []],
  14825. ["t27", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14826. ["Default", 5, false, 1, 0, false, 0x973cd5ed3fbc7, [
  14827. ["images/ingamehud_bg-sheet0.png", 7533, 0, 0, 320, 100, 1, .5, .5, [],
  14828. [0, -.43, .315625, .09, .3, 0, .3, -.14, 0, .11, -.15, 0], 0]
  14829. ]]
  14830. ],
  14831. [], false, false, 7034148364290492, []
  14832. ],
  14833. ["t28", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14834. ["Default", 5, false, 1, 0, false, 807774306128449, [
  14835. ["images/lifebar-sheet0.png", 5840, 1, 85, 53, 41, 1, 0, .463415, [],
  14836. [.0943396, -.341464, .490566, -.268293, .924528, -.365854, .981132, .0243904, .830189, .317073, .490566, .536585, .169811, .317073, .0377358, .0243904], 0],
  14837. ["images/lifebar-sheet0.png", 5840, 1, 43, 77, 41, 1, 0, .463415, [],
  14838. [.0519481, -.365854, .493506, -.439024, .948052, -.365854, .987013, .0243904, .883117, .317073, .493506, .414634, .116883, .317073, .025974, .0243904], 0],
  14839. ["images/lifebar-sheet0.png", 5840, 1, 1, 101, 41, 1, 0, .463415, [],
  14840. [.049505, -.341464, .49505, -.292683, .960396, -.365854, .990099, .0243904, .910891, .317073, .49505, .536585, .0891089, .317073, .019802, .0243904], 0]
  14841. ]]
  14842. ],
  14843. [], false, false, 0xb4c7e4b26dbc5, []
  14844. ],
  14845. ["t29", cr.plugins_.Mouse, false, [], 0, 0, null, null, [], false, false, 0xc1fd9eb08fbb2, [],
  14846. []
  14847. ],
  14848. ["t30", cr.plugins_.Touch, false, [], 0, 0, null, null, [], false, false, 0xaaeeb29fe6633, [],
  14849. [1]
  14850. ],
  14851. ["t31", cr.plugins_.Sprite, false, [], 1, 0, null, [
  14852. ["Default", 5, false, 1, 0, false, 0x48f453c54b81f, [
  14853. ["images/100scorelabel-sheet0.png", 812, 0, 0, 70, 36, 1, .857143, .0277778, [],
  14854. [-.714286, .25, -.357143, .166666, .0285711, .194444, .0857142, .472222, .0142862, .722222, -.357143, .694444, -.728572, .722222, -.842857, .472222], 0]
  14855. ]]
  14856. ],
  14857. [
  14858. ["Fade", cr.behaviors.Fade, 5241465307141786]
  14859. ], false, false, 0x4b52371e2d07c, []
  14860. ],
  14861. ["t32", cr.plugins_.Sprite, false, [], 1, 0, null, [
  14862. ["Default", 5, false, 1, 0, false, 0xcd1e0627b50b5, [
  14863. ["images/10scorelabel-sheet0.png", 644, 0, 0, 51, 34, 1, .901961, .941176, [],
  14864. [-.72549, -.676471, -.411765, -.735294, -.0392158, -.735294, .0588232, -.441176, -.0392158, -.147058, -.764706, -.147058, -.901961, -.441176], 0]
  14865. ]]
  14866. ],
  14867. [
  14868. ["Fade", cr.behaviors.Fade, 4847753738340389]
  14869. ], false, false, 7539418369974563, []
  14870. ],
  14871. ["t33", cr.plugins_.Sprite, false, [], 1, 0, null, [
  14872. ["Default", 5, false, 1, 0, false, 5333891986976473, [
  14873. ["images/30scorelabel-sheet0.png", 699, 0, 0, 56, 36, 1, .375, .972222, [],
  14874. [-.196429, -.694444, .125, -.777778, .482143, -.75, .589286, -.472222, .482143, -.194444, -.232143, -.194444, -.357143, -.472222], 0]
  14875. ]]
  14876. ],
  14877. [
  14878. ["Fade", cr.behaviors.Fade, 9927933799627120]
  14879. ], false, false, 9617569330535946, []
  14880. ],
  14881. ["t34", cr.plugins_.Sprite, false, [], 2, 0, null, [
  14882. ["Default", 5, false, 1, 0, false, 0x938b92d78ba9d, [
  14883. ["images/3xcombolabel-sheet0.png", 1471, 0, 0, 160, 39, 1, .5, .512821, [],
  14884. [-.44375, -.282052, 0, -.179488, .41875, -.179488, .46875, -.0256415, .44375, .25641, -.44375, .25641, -.4625, -.0256415], 0]
  14885. ]]
  14886. ],
  14887. [
  14888. ["Fade", cr.behaviors.Fade, 0x8efae30e12a3e],
  14889. ["Sine", cr.behaviors.Sin, 8326846716478066]
  14890. ], false, false, 507686160308873, []
  14891. ],
  14892. ["t35", cr.plugins_.Sprite, false, [], 2, 0, null, [
  14893. ["Default", 5, false, 1, 0, false, 0x8c12dd267e646, [
  14894. ["images/4xcombolabel-sheet0.png", 1861, 0, 0, 217, 55, 1, .502304, .509091, [],
  14895. [-.447005, -.290909, -.00460812, -.163636, .410138, -.163636, .470046, -.0181819, .43318, .236364, -.43318, .218182, -.497696, -.0181819], 0]
  14896. ]]
  14897. ],
  14898. [
  14899. ["Fade", cr.behaviors.Fade, 7244275268460735],
  14900. ["Sine", cr.behaviors.Sin, 0x3c605e93bd1c9]
  14901. ], false, false, 5996116958732497, []
  14902. ],
  14903. ["t36", cr.plugins_.Sprite, false, [], 1, 0, null, [
  14904. ["Default", 5, false, 1, 0, false, 7804252665775305, [
  14905. ["images/50scorelabel-sheet0.png", 702, 0, 0, 56, 36, 1, .285714, -.0555556, [],
  14906. [-.125, .305556, .214286, .222223, .589286, .25, .678572, .555556, .553572, .805556, -.125, .805556, -.267857, .555556], 0]
  14907. ]]
  14908. ],
  14909. [
  14910. ["Fade", cr.behaviors.Fade, 4799025338321075]
  14911. ], false, false, 9180470322993356, []
  14912. ],
  14913. ["t37", cr.plugins_.Sprite, false, [], 2, 0, null, [
  14914. ["Default", 5, false, 1, 0, false, 0x6a197eab48f4c, [
  14915. ["images/5xcombolabel-sheet0.png", 2375, 0, 0, 267, 64, 1, .501873, .5, [],
  14916. [-.445693, -.265625, -.00374565, -.125, .411985, -.140625, .483146, 0, .449438, .296875, -.00374565, .3125, -.453184, .296875, -.483146, 0], 0]
  14917. ]]
  14918. ],
  14919. [
  14920. ["Fade", cr.behaviors.Fade, 0x5078ac12e5d57],
  14921. ["Sine", cr.behaviors.Sin, 0x39c8e5423f677]
  14922. ], false, false, 0x5b84682b69854, []
  14923. ],
  14924. ["t38", cr.plugins_.Sprite, false, [], 2, 0, null, [
  14925. ["Default", 5, false, 1, 0, false, 0xce8d97781143f, [
  14926. ["images/candyfontainlable-sheet0.png", 3689, 0, 0, 299, 160, 1, .501672, .5, [],
  14927. [-.187291, .0875, -.00334427, -.26875, .220736, .01875, .468228, 0, .384616, .2875, -.00334427, .3125, -.35117, .21875, .38796, 0], 0]
  14928. ]]
  14929. ],
  14930. [
  14931. ["Fade", cr.behaviors.Fade, 9201479989150704],
  14932. ["Sine", cr.behaviors.Sin, 6322809057698405]
  14933. ], false, false, 90459198928289, []
  14934. ],
  14935. ["t39", cr.plugins_.Sprite, false, [], 2, 0, null, [
  14936. ["Default", 5, false, 1, 0, false, 7627941190844073, [
  14937. ["images/supercombolabel-sheet0.png", 7550, 1, 1, 260, 107, 1, .5, .504673, [],
  14938. [-.261538, .0747661, 0, -.364486, .273077, .0467291, .019231, -.00934589, .423077, .308411, 0, .439252, -.426923, .317757, -.034615, -.00934589], 0],
  14939. ["images/supercombolabel-sheet0.png", 7550, 1, 109, 260, 107, 1, .5, .504673, [],
  14940. [-.261538, .0747661, 0, -.364486, .273077, .0467291, .019231, -.00934589, .423077, .308411, 0, .439252, -.426923, .317757, -.034615, -.00934589], 0]
  14941. ]]
  14942. ],
  14943. [
  14944. ["Sine", cr.behaviors.Sin, 6862564799226722],
  14945. ["Fade", cr.behaviors.Fade, 6000449520246343]
  14946. ], false, false, 0x5971f7126d7dd, []
  14947. ],
  14948. ["t40", cr.plugins_.Text, false, [], 0, 0, null, null, [], false, false, 0xfc3f2a1867b8f, []],
  14949. ["t41", cr.plugins_.Text, false, [], 0, 0, null, null, [], false, false, 0xb10852c8fae4b, []],
  14950. ["t42", cr.plugins_.Text, false, [], 0, 0, null, null, [], false, false, 0x560e1d7192b36, []],
  14951. ["t43", cr.plugins_.Text, false, [], 0, 0, null, null, [], false, false, 0x6742389f22114, []],
  14952. ["t44", cr.plugins_.Text, false, [], 0, 0, null, null, [], false, false, 5151779893385322, []],
  14953. ["t45", cr.plugins_.Text, false, [], 0, 0, null, null, [], false, false, 0xdf0e76169c6a2, []],
  14954. ["t46", cr.plugins_.Sprite, false, [], 1, 0, null, [
  14955. ["Default", 5, false, 1, 0, false, 7241622599948809, [
  14956. ["images/juice-sheet0.png", 4479, 0, 0, 451, 452, 1, .501109, .5, [],
  14957. [-.230599, -.230089, -.00221765, -.25, .370288, -.371681, .474501, 0, -.00221765, .329646, -.159646, .159292, -.19734, 0], 0]
  14958. ]]
  14959. ],
  14960. [
  14961. ["Fade", cr.behaviors.Fade, 6948119795969437]
  14962. ], false, false, 9146109515420968, []
  14963. ],
  14964. ["t47", cr.plugins_.Sprite, false, [], 1, 0, null, [
  14965. ["Default", 5, false, 1, 0, false, 0x94161286dd819, [
  14966. ["images/slice-sheet0.png", 816, 0, 0, 64, 64, 1, 0, .5, [],
  14967. [.140625, -.359375, .5, -.5, .859375, -.359375, 1, 0, .859375, .359375, .5, .5, .140625, .359375, 0, 0], 0]
  14968. ]]
  14969. ],
  14970. [
  14971. ["Fade", cr.behaviors.Fade, 5203335805529212]
  14972. ], false, false, 520202982938127, []
  14973. ],
  14974. ["t48", cr.plugins_.Softgames, false, [], 0, 0, null, null, [], false, false, 8621345822828066, [],
  14975. [77]
  14976. ],
  14977. ["t49", cr.plugins_.Spritefont2, false, [], 0, 0, ["images/spritefont.png", 1427, 3], null, [], false, false, 7497840212195717, []],
  14978. ["t50", cr.plugins_.Spritefont2, false, [], 0, 0, ["images/fruitstxtbmp.png", 3591, 0], null, [], false, false, 0x92bb457feeba8, []],
  14979. ["t51", cr.plugins_.Spritefont2, false, [], 0, 0, ["images/fruitstxtbmp.png", 3591, 0], null, [], false, false, 8964434448941994, []],
  14980. ["t52", cr.plugins_.Spritefont2, false, [], 0, 0, ["images/bestscoretxtbmp.png", 2280, 0], null, [], false, false, 761159111345178, []],
  14981. ["t53", cr.plugins_.Spritefont2, false, [], 0, 0, ["images/bestscoretxtbmp.png", 2280, 0], null, [], false, false, 7550819395002681, []],
  14982. ["t54", cr.plugins_.Spritefont2, false, [], 0, 0, ["images/bestscoretxtbmp.png", 2280, 0], null, [], false, false, 8421631644712503, []],
  14983. ["t55", cr.plugins_.Browser, false, [], 0, 0, null, null, [], false, false, 0xdd18963d981d7, [],
  14984. []
  14985. ],
  14986. ["t56", cr.plugins_.Sprite, true, [], 1, 0, null, null, [
  14987. ["CustomMovement2", cr.behaviors.custom, 9968517923918220]
  14988. ], false, false, 8151068894234031, []],
  14989. ["t57", cr.plugins_.Sprite, true, [], 0, 0, null, null, [], false, false, 6624089687897138, []],
  14990. ["t58", cr.plugins_.Sprite, true, [], 0, 0, null, null, [], false, false, 761882580655443, []],
  14991. ["t59", cr.plugins_.Sprite, true, [], 0, 0, null, null, [], false, false, 0x7ede7813d326d, []],
  14992. ["t60", cr.plugins_.Sprite, true, [], 2, 0, null, null, [
  14993. ["VisibilityTween", cr.behaviors.lunarray_LiteTween, 9898873976583244],
  14994. ["InvisibilityTween", cr.behaviors.lunarray_LiteTween, 4895534882965581]
  14995. ], false, false, 7392654326175444, []],
  14996. ["t61", cr.plugins_.Sprite, true, [], 0, 0, null, null, [], false, false, 0x519e239ff9a34, []],
  14997. ["t62", cr.plugins_.Sprite, true, [], 0, 0, null, null, [], false, false, 883931708700071, []]
  14998. ], [
  14999. [56, 14, 15, 21, 22, 20, 17, 18, 19, 25, 23],
  15000. [57, 14, 15],
  15001. [58, 21, 22, 20],
  15002. [59, 17, 18, 19],
  15003. [60, 11, 3],
  15004. [61, 31, 32, 33, 34, 35, 36, 37, 38, 39],
  15005. [62, 34, 35, 37, 38, 39]
  15006. ], [
  15007. ["GameScreen", 320, 480, false, "Event sheet 1", 5665669193748128, [
  15008. ["BG", 0, 0x82637b5140546, true, [255, 255, 255], false, 1, 1, 1, false, 1, 0, 0, [
  15009. [
  15010. [160, 240, 0, 320, 480, 0, 0, 1, .5, .5, 0, 0, []], 7, 19, [],
  15011. [],
  15012. [0, "Default", 0, 1]
  15013. ],
  15014. [
  15015. [224, -64, 0, 31.9646, 32.0355, 0, 0, 1, .501109, .5, 0, 0, []], 46, 0, [],
  15016. [
  15017. [1, 0, 0, 1, 1]
  15018. ],
  15019. [0, "Default", 0, 1]
  15020. ]
  15021. ],
  15022. []
  15023. ],
  15024. ["Game", 1, 0x89e7f5b533396, true, [255, 255, 255], true, 1, 1, 1, false, 1, 0, 0, [
  15025. [
  15026. [128, -48, 0, 64, 64, 0, 0, 1, 0, .5, 0, 0, []], 47, 3, [],
  15027. [
  15028. [1, 0, 0, .125, 1]
  15029. ],
  15030. [0, "Default", 0, 1]
  15031. ],
  15032. [
  15033. [-400, 48, 0, 250.785, 245.293, 0, 0, 1, .50365, .507463, 0, 0, []], 16, 7, [],
  15034. [
  15035. [1, 0, 0, 1, 1]
  15036. ],
  15037. [0, "Default", 0, 1]
  15038. ],
  15039. [
  15040. [-400, 240, 0, 64, 93, 0, 0, 1, .5, .505376, 0, 0, []], 14, 11, [],
  15041. [
  15042. [0, 5, 1]
  15043. ],
  15044. [0, "Default", 0, 1]
  15045. ],
  15046. [
  15047. [-320, 256, 0, 43, 61, 0, 0, 1, .511628, .508197, 0, 0, []], 15, 13, [],
  15048. [
  15049. [0, 5, 1]
  15050. ],
  15051. [0, "Default", 0, 1]
  15052. ],
  15053. [
  15054. [-464, 448, 0, 60, 60, 0, 0, 1, .5, .5, 0, 0, []], 21, 29, [],
  15055. [
  15056. [0, 5, 1]
  15057. ],
  15058. [0, "Default", 0, 1]
  15059. ],
  15060. [
  15061. [-464, 368, 0, 76, 76, 0, 0, 1, .5, .5, 0, 0, []], 22, 30, [],
  15062. [
  15063. [0, 5, 1]
  15064. ],
  15065. [0, "Default", 0, 1]
  15066. ],
  15067. [
  15068. [-464, 528, 0, 48, 48, 0, 0, 1, .5, .5, 0, 0, []], 20, 31, [],
  15069. [
  15070. [0, 5, 1]
  15071. ],
  15072. [0, "Default", 0, 1]
  15073. ],
  15074. [
  15075. [-352, 448, 0, 31, 60, 0, 0, 1, 1, .483333, 0, 0, []], 17, 32, [],
  15076. [
  15077. [0, 5, 1]
  15078. ],
  15079. [0, "Default", 0, 1]
  15080. ],
  15081. [
  15082. [-384, 368, 0, 39, 76, 0, 0, 1, 1, .5, 0, 0, []], 18, 33, [],
  15083. [
  15084. [0, 5, 1]
  15085. ],
  15086. [0, "Default", 0, 1]
  15087. ],
  15088. [
  15089. [-384, 544, 0, 25, 48, 0, 0, 1, 1, .520833, 0, 0, []], 19, 34, [],
  15090. [
  15091. [0, 5, 1]
  15092. ],
  15093. [0, "Default", 0, 1]
  15094. ],
  15095. [
  15096. [-448, 128, 0, 71, 55, 0, 0, 1, .507042, .509091, 0, 0, []], 24, 2, [
  15097. [0]
  15098. ],
  15099. [
  15100. [0, 5, 1],
  15101. [0, 0, 0, "30, 32", 0, 2, 1],
  15102. [0, 1, 0, "42, 35", 0, 2, 1],
  15103. [0, 4, 0, "360", 0, 2, 1]
  15104. ],
  15105. [0, "Default", 0, 1]
  15106. ],
  15107. [
  15108. [-432, -80, 0, 71, 55, 0, 0, 1, .507042, .509091, 0, 0, []], 23, 1, [
  15109. [0]
  15110. ],
  15111. [
  15112. [0, 5, 1],
  15113. [0, 5, 1]
  15114. ],
  15115. [0, "Default", 0, 1]
  15116. ]
  15117. ],
  15118. []
  15119. ],
  15120. ["HUD", 2, 0xcf69930f08614, true, [255, 255, 255], true, 1, 1, 1, false, 1, 0, 0, [
  15121. [
  15122. [160, 50, 0, 320, 100, 0, 0, 1, .5, .5, 0, 0, []], 27, 27, [],
  15123. [],
  15124. [0, "Default", 0, 1]
  15125. ],
  15126. [
  15127. [16, 64, 0, 128, 32, 0, 0, 1, 0, 0, 0, 0, []], 42, 12, [],
  15128. [],
  15129. ["Text", 0, "12pt Tahoma", "rgb(255,255,255)", 0, 0, 0, 0, 0]
  15130. ],
  15131. [
  15132. [32, -144, 0, 128, 32, 0, 0, 1, 0, 0, 0, 0, []], 43, 15, [],
  15133. [],
  15134. [" ", 0, "14pt Sniglet", "rgb(255,255,255)", 0, 1, 0, 0, 0]
  15135. ],
  15136. [
  15137. [288, 36, 0, 52, 52, 0, 0, 1, .519231, .519231, 0, 0, []], 2, 28, [],
  15138. [],
  15139. [0, "Default", 0, 1]
  15140. ],
  15141. [
  15142. [7, 32, 0, 53, 41, 0, 0, 1, 0, .463415, 0, 0, []], 28, 21, [],
  15143. [],
  15144. [0, "Default", 0, 1]
  15145. ],
  15146. [
  15147. [32, -176, 0, 128, 32, 0, 0, 1, 0, 0, 0, 0, []], 40, 4, [],
  15148. [],
  15149. [" ", 0, "14pt Sniglet", "rgb(255,255,255)", 0, 0, 0, 0, 0]
  15150. ],
  15151. [
  15152. [120, 34, 0, 128, 32, 0, 0, 1, 0, 0, 0, 0, []], 52, 56, [],
  15153. [],
  15154. [16, 16, "ABCDEFGHIJKLMNOPQRSTUVWXYZ!:0123456789", " ", 1, 0, 0, 0, 0, 0, -5, 0]
  15155. ],
  15156. [
  15157. [118, 14, 0, 128, 32, 0, 0, 1, 0, 0, 0, 0, []], 53, 57, [],
  15158. [],
  15159. [16, 16, "ABCDEFGHIJKLMNOPQRSTUVWXYZ!:0123456789", " ", 1, 0, 0, 0, 0, 0, -5, 0]
  15160. ]
  15161. ],
  15162. []
  15163. ],
  15164. ["GamePausedLayer", 3, 8316829967672342, true, [255, 255, 255], true, 1, 1, 1, false, 1, 0, 0, [
  15165. [
  15166. [272, 496, 0, 320, 480, 0, 0, 1, 0, 0, 0, 0, []], 10, 35, [],
  15167. [],
  15168. [0, "Default", 0, 1]
  15169. ],
  15170. [
  15171. [-928, 176, 0, 320, 480, 0, 0, 1, 0, 0, 0, 0, []], 9, 23, [],
  15172. [],
  15173. [0, "Default", 0, 1]
  15174. ],
  15175. [
  15176. [656, 496, 0, 320, 480, 0, 0, 1, 0, 0, 0, 0, []], 8, 36, [],
  15177. [],
  15178. [0, "Default", 0, 1]
  15179. ],
  15180. [
  15181. [-80, 512, 0, 320, 480, 0, 0, 1, 0, 0, 0, 0, []], 12, 22, [],
  15182. [],
  15183. [0, "Default", 0, 1]
  15184. ],
  15185. [
  15186. [-208, 816, 0, 95, 95, 0, 0, 1, .456522, .43299, 0, 0, []], 3, 26, [],
  15187. [
  15188. [0, 5, 0, "100,100", 0, 2.5, 1],
  15189. [0, 0, 23, "100,100", 0, 2.5, 1]
  15190. ],
  15191. [0, "Default", 0, 1]
  15192. ],
  15193. [
  15194. [-176, 944, 0, 92, 97, 0, 0, 1, .543478, .505155, 0, 0, []], 5, 25, [],
  15195. [],
  15196. [0, "Default", 0, 1]
  15197. ],
  15198. [
  15199. [-160, 672, 0, 92, 97, 0, 0, 1, .5, .505155, 0, 0, []], 4, 37, [],
  15200. [],
  15201. [0, "Default", 0, 1]
  15202. ],
  15203. [
  15204. [-448, 672, 0, 224, 48, 0, 0, 1, 0, 0, 0, 0, []], 41, 45, [],
  15205. [],
  15206. ["Candies:", 0, "20pt Sniglet", "rgb(255,255,255)", 0, 0, 0, 0, 0]
  15207. ],
  15208. [
  15209. [-416, 720, 0, 224, 48, 0, 0, 1, 0, 0, 0, 0, []], 44, 47, [],
  15210. [],
  15211. [" ", 0, "20pt Sniglet", "rgb(255,255,255)", 0, 0, 0, 0, 0]
  15212. ],
  15213. [
  15214. [-51, 694, 0, 240, 32, 0, 0, 1, 0, 0, 0, 0, []], 50, 54, [],
  15215. [],
  15216. [23, 23, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!:0123456789", " ", 1, 0, 0, 0, 0, 0, -5, 0]
  15217. ],
  15218. [
  15219. [-49, 728, 0, 240, 32, 0, 0, 1, 0, 0, 0, 0, []], 51, 55, [],
  15220. [],
  15221. [23, 23, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!:0123456789", " ", 1, 0, 0, 0, 0, 0, -5, 0]
  15222. ]
  15223. ],
  15224. []
  15225. ],
  15226. ["TopLayer", 4, 4747559956664143, true, [255, 255, 255], true, 1, 1, 1, false, 1, 0, 0, [
  15227. [
  15228. [528, -80, 0, 160, 39, 0, 0, 1, .5, .512821, 0, 0, []], 34, 6, [],
  15229. [
  15230. [1, 0, 0, 1.5, 1],
  15231. [1, 1, 0, .5, 0, 0, 0, 20, 0]
  15232. ],
  15233. [0, "Default", 0, 1]
  15234. ],
  15235. [
  15236. [576, 0, 0, 217, 55, 0, 0, 1, .502304, .509091, 0, 0, []], 35, 8, [],
  15237. [
  15238. [1, 0, 0, 1.5, 1],
  15239. [1, 1, 0, .4, 0, 0, 0, 35, 0]
  15240. ],
  15241. [0, "Default", 0, 1]
  15242. ],
  15243. [
  15244. [560, 112, 0, 267, 64, 0, 0, 1, .501873, .5, 0, 0, []], 37, 14, [],
  15245. [
  15246. [1, 0, 0, 1.5, 1],
  15247. [1, 1, 0, .4, 0, 0, 0, 50, 0]
  15248. ],
  15249. [0, "Default", 0, 1]
  15250. ],
  15251. [
  15252. [528, 240, 0, 299, 160, 0, 0, 1, .501672, .5, 0, 0, []], 38, 16, [],
  15253. [
  15254. [1, 0, 0, 2.5, 1],
  15255. [1, 1, 0, 1, 0, 0, 0, 70, 0]
  15256. ],
  15257. [0, "Default", 0, 1]
  15258. ],
  15259. [
  15260. [416, 384, 0, 51, 34, 0, 0, 1, .901961, .941176, 0, 0, []], 32, 20, [],
  15261. [
  15262. [1, 0, 0, 1, 1]
  15263. ],
  15264. [0, "Default", 0, 1]
  15265. ],
  15266. [
  15267. [512, 368, 0, 56, 36, 0, 0, 1, .375, .972222, 0, 0, []], 33, 39, [],
  15268. [
  15269. [1, 0, 0, 1, 1]
  15270. ],
  15271. [0, "Default", 0, 1]
  15272. ],
  15273. [
  15274. [416, 416, 0, 56, 36, 0, 0, 1, .285714, -.0555556, 0, 0, []], 36, 40, [],
  15275. [
  15276. [1, 0, 0, 1, 1]
  15277. ],
  15278. [0, "Default", 0, 1]
  15279. ],
  15280. [
  15281. [528, 448, 0, 70, 36, 0, 0, 1, .857143, .0277778, 0, 0, []], 31, 41, [],
  15282. [
  15283. [1, 0, 0, 1, 1]
  15284. ],
  15285. [0, "Default", 0, 1]
  15286. ],
  15287. [
  15288. [-864, 720, 0, 320, 480, 0, 0, 1, 0, 0, 0, 0, []], 13, 42, [],
  15289. [
  15290. [0, 5, 0, "100", 0, .3, 1],
  15291. [0, 5, 0, "0", 0, .3, 1]
  15292. ],
  15293. [0, "Default", 0, 1]
  15294. ],
  15295. [
  15296. [-144, 384, 0, 48.9506, 47.0679, 0, 0, 1, 1.05769, .78, 0, 0, []], 25, 49, [],
  15297. [
  15298. [0, 5, 1],
  15299. [0, 5, 1]
  15300. ],
  15301. [0, "Default", 0, 1]
  15302. ],
  15303. [
  15304. [-240, 480, 0, 128, 128, 0, 0, 1, 0, .5, 0, 0, []], 26, 50, [],
  15305. [],
  15306. [20, 360, 1, 200, 20, 100, 0, 0, 0, 0, 0, 0, -150, 20, 0, 1200, 0, 0, 1]
  15307. ],
  15308. [
  15309. [864, 48, 0, 260, 107, 0, 0, 1, .5, .504673, 0, 0, []], 39, 51, [],
  15310. [
  15311. [1, 1, 0, .3, 0, 0, 0, 50, 0],
  15312. [1, 0, 0, 1.5, 1]
  15313. ],
  15314. [0, "Default", 0, 1]
  15315. ]
  15316. ],
  15317. []
  15318. ]
  15319. ],
  15320. [],
  15321. []
  15322. ],
  15323. ["StartScreen", 320, 480, false, "Event sheet 2", 9901377344593672, [
  15324. ["BG", 0, 761795434122473, true, [255, 255, 255], false, 1, 1, 1, false, 1, 0, 0, [
  15325. [
  15326. [160, 240, 0, 320, 480, 0, 0, 1, .5, .5, 0, 0, []], 6, 9, [],
  15327. [],
  15328. [0, "Default", 0, 1]
  15329. ]
  15330. ],
  15331. []
  15332. ],
  15333. ["Btns", 1, 0x72ef05d2785c6, true, [255, 255, 255], true, 1, 1, 1, false, 1, 0, 0, [
  15334. [
  15335. [161, 343, 0, 187, 76, 0, 0, 1, .502674, .5, 0, 0, []], 1, 17, [],
  15336. [],
  15337. [0, "Default", 0, 1]
  15338. ],
  15339. [
  15340. [163, 418, 0, 104, 59, 0, 0, 1, .5, .508475, 0, 0, []], 0, 18, [],
  15341. [],
  15342. [0, "Default", 0, 1]
  15343. ],
  15344. [
  15345. [417, 292, 0, 131, 29, 0, 0, 1, .5, .5, 0, 0, []], 45, 52, [],
  15346. [],
  15347. [" 0", 0, "16pt Sniglet", "rgb(255,255,255)", 1, 1, 1, 0, 0]
  15348. ],
  15349. [
  15350. [-193, 84.5, 0, 128, 48, 0, 0, 1, .5, .5, 0, 0, []], 43, 43, [],
  15351. [],
  15352. [" ", 0, "bold 14pt Tahoma", "rgb(255,255,255)", 0, 1, 1, 0, 0]
  15353. ],
  15354. [
  15355. [-257, 51.5, 0, 112, 32, 0, 0, 1, 0, 0, 0, 0, []], 40, 44, [],
  15356. [],
  15357. ["Text", 0, "14pt Arial", "rgb(255,255,255)", 0, 0, 0, 0, 0]
  15358. ],
  15359. [
  15360. [-267, 105, 0, 224, 48, 0, 0, 1, 0, 0, 0, 0, []], 41, 46, [],
  15361. [],
  15362. ["Candies:", 0, "20pt Sniglet", "rgb(255,255,255)", 0, 0, 0, 0, 0]
  15363. ],
  15364. [
  15365. [-268, 133, 0, 224, 48, 0, 0, 1, 0, 0, 0, 0, []], 44, 48, [],
  15366. [],
  15367. [" ", 0, "20pt Sniglet", "rgb(255,255,255)", 0, 0, 0, 0, 0]
  15368. ],
  15369. [
  15370. [90, 255, 0, 144, 32, 0, 0, 1, 0, 0, 0, 0, []], 54, 58, [],
  15371. [],
  15372. [16, 16, "ABCDEFGHIJKLMNOPQRSTUVWXYZ!:0123456789", " 0", 1, 0, 1, 0, 0, 0, -5, 0]
  15373. ]
  15374. ],
  15375. []
  15376. ],
  15377. ["Layer 0", 2, 0x73b50bd8aee9f, true, [255, 255, 255], true, 1, 1, 1, false, 1, 0, 0, [
  15378. [
  15379. [0, 0, 0, 320, 480, 0, 0, 1, 0, 0, 0, 0, []], 11, 24, [],
  15380. [
  15381. [0, 5, 0, "100", 0, .3, 1],
  15382. [0, 5, 0, "0", 0, .3, 1]
  15383. ],
  15384. [0, "Default", 0, 1]
  15385. ],
  15386. [
  15387. [249, 367, 0, 92, 97, 0, 0, 1, .456522, .43299, 0, 0, []], 3, 38, [],
  15388. [
  15389. [0, 5, 0, "100", 0, .3, 1],
  15390. [0, 5, 0, "0", 0, .3, 1]
  15391. ],
  15392. [0, "Default", 0, 1]
  15393. ]
  15394. ],
  15395. []
  15396. ]
  15397. ],
  15398. [],
  15399. []
  15400. ]
  15401. ], [
  15402. ["Event sheet 1", [
  15403. [1, "BestScore", 0, 0, false, false, 4832072822553496, false],
  15404. [1, "GlobalSpeed", 0, 700, false, false, 0xb30f804de6ef7, false],
  15405. [1, "CurrTut", 0, 0, false, false, 5499465144956748, false],
  15406. [1, "TutCompleted", 0, 0, false, false, 0x4f2951a156125, false],
  15407. [1, "SlomoIsActive", 0, 0, false, false, 0xbfc20cbf55359, false],
  15408. [1, "CandyFontainIsActiveFor", 0, 0, false, false, 6398686650565134, false],
  15409. [1, "CandyFontainIsActive", 0, 0, false, false, 5583264838436099, false],
  15410. [1, "SpawnCandiesTimeRandOffset", 0, .4, false, false, 9067514685283420, false],
  15411. [1, "SpawnCandiesTime", 0, .3, false, false, 0xce9fc0fedb569, false],
  15412. [1, "CuttedAtRaw", 0, 0, false, false, 748545829960142, false],
  15413. [1, "MouseBeenReleaseSinceLastCut", 0, 0, false, false, 7958792258545028, false],
  15414. [1, "ElapsedSinceLastCut", 0, 0, false, false, 0x89782b7e4e60b, false],
  15415. [1, "Score", 0, 0, false, false, 8401123337034218, false],
  15416. [1, "Lives", 0, 2, false, false, 5255261810854884, false],
  15417. [1, "GameIsPaused", 0, 1, false, false, 9167813209970552, false],
  15418. [1, "Candies_Amount", 0, 0, false, false, 9344722873491312, false],
  15419. [1, "Slice_Initial_X", 0, 0, false, false, 0x7b1848a51e511, false],
  15420. [1, "Slice_Initial_Y", 0, 0, false, false, 0x62d49eb6733d8, false],
  15421. [0, null, false, null, 0x53d8437754bbf, [
  15422. [-1, cr.system_object.prototype.cnds.OnLayoutStart, null, 1, false, false, false, 7937539008198606, false]
  15423. ],
  15424. [
  15425. [42, cr.plugins_.Text.prototype.acts.Destroy, null, 6820424415321544, false],
  15426. [47, cr.plugins_.Sprite.prototype.acts.Destroy, null, 6721067476553631, false],
  15427. [46, cr.plugins_.Sprite.prototype.acts.Destroy, null, 9788157872917526, false],
  15428. [56, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x8ed39869d485c, false],
  15429. [61, cr.plugins_.Sprite.prototype.acts.Destroy, null, 5994690632022597, false],
  15430. [24, cr.plugins_.Sprite.prototype.acts.Destroy, null, 5828823102253303, false],
  15431. [10, cr.plugins_.Sprite.prototype.acts.Destroy, null, 5396774202371632, false],
  15432. [12, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8650605350340585, false],
  15433. [9, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x7dc642a93417e, false],
  15434. [8, cr.plugins_.Sprite.prototype.acts.Destroy, null, 7273147720164038, false],
  15435. [3, cr.plugins_.Sprite.prototype.acts.Destroy, null, 4806718719820633, false],
  15436. [4, cr.plugins_.Sprite.prototype.acts.Destroy, null, 9485122755064738, false],
  15437. [5, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x713a6eb074c4e, false],
  15438. [26, cr.plugins_.Particles.prototype.acts.Destroy, null, 0x5f905b126cec, false],
  15439. [41, cr.plugins_.Text.prototype.acts.Destroy, null, 0xa99a129bfc4bd, false],
  15440. [44, cr.plugins_.Text.prototype.acts.Destroy, null, 0x9cf7ba15df2f, false],
  15441. [40, cr.plugins_.Text.prototype.acts.Destroy, null, 8392435797807625, false],
  15442. [43, cr.plugins_.Text.prototype.acts.Destroy, null, 0xa636ffc9414b8, false],
  15443. [-1, cr.system_object.prototype.acts.SetVar, null, 0xdcb5af0b42127, false, [
  15444. [11, "Lives"],
  15445. [7, [0, 2]]
  15446. ]],
  15447. [-1, cr.system_object.prototype.acts.SetVar, null, 8163631624987311, false, [
  15448. [11, "GameIsPaused"],
  15449. [7, [0, 1]]
  15450. ]],
  15451. [-1, cr.system_object.prototype.acts.SetVar, null, 53407383322061, false, [
  15452. [11, "SlomoIsActive"],
  15453. [7, [0, 0]]
  15454. ]],
  15455. [-1, cr.system_object.prototype.acts.SetVar, null, 0x9f01a59a06f59, false, [
  15456. [11, "MouseBeenReleaseSinceLastCut"],
  15457. [7, [0, 0]]
  15458. ]],
  15459. [-1, cr.system_object.prototype.acts.SetVar, null, 0x436d7dfffe751, false, [
  15460. [11, "Candies_Amount"],
  15461. [7, [0, 0]]
  15462. ]],
  15463. [-1, cr.system_object.prototype.acts.SetVar, null, 6653766910556768, false, [
  15464. [11, "Score"],
  15465. [7, [0, 0]]
  15466. ]],
  15467. [-1, cr.system_object.prototype.acts.SetVar, null, 5973102120616778, false, [
  15468. [11, "CandyFontainIsActive"],
  15469. [7, [0, 0]]
  15470. ]],
  15471. [-1, cr.system_object.prototype.acts.SetVar, null, 768932538247207, false, [
  15472. [11, "CandyFontainIsActiveFor"],
  15473. [7, [0, 0]]
  15474. ]],
  15475. [-1, cr.system_object.prototype.acts.SetVar, null, 0x82bc1ef910490, false, [
  15476. [11, "BombsSpawnDelayDone"],
  15477. [7, [0, 0]]
  15478. ]],
  15479. [28, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 6433770912432973, false, [
  15480. [0, [23, "Lives"]]
  15481. ]],
  15482. [28, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0xc9fab59ebe5e1, false],
  15483. [-1, cr.system_object.prototype.acts.CreateObject, null, 4938086548461428, false, [
  15484. [4, 13],
  15485. [5, [0, 4]],
  15486. [0, [0, 0]],
  15487. [0, [0, 0]]
  15488. ]],
  15489. [13, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 5226120715309349, false, [
  15490. [0, [0, 0]]
  15491. ]],
  15492. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "start", 484118958134746, false, [
  15493. [3, 0]
  15494. ]],
  15495. [-1, cr.system_object.prototype.acts.Wait, null, 0x7583da686d227, false, [
  15496. [0, [1, .3]]
  15497. ]],
  15498. [28, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 8123885592019209, false, [
  15499. [3, 0]
  15500. ]],
  15501. [27, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 4956083032955628, false, [
  15502. [3, 0]
  15503. ]],
  15504. [2, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 0x8574f496f86d, false, [
  15505. [3, 0]
  15506. ]],
  15507. [43, cr.plugins_.Text.prototype.acts.SetText, null, 7160192311664218, false, [
  15508. [7, [10, [2, " "],
  15509. [23, "Score"]
  15510. ]]
  15511. ]],
  15512. [40, cr.plugins_.Text.prototype.acts.SetText, null, 0x3a53f13c93834, false, [
  15513. [7, [10, [2, "BEST:"],
  15514. [23, "BestScore"]
  15515. ]]
  15516. ]],
  15517. [53, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 7504492535028863, false, [
  15518. [3, 0]
  15519. ]],
  15520. [52, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 0xabd15c40a2bb3, false, [
  15521. [3, 0]
  15522. ]],
  15523. [52, cr.plugins_.Spritefont2.prototype.acts.MoveToLayer, null, 0x916dab0f5b1c5, false, [
  15524. [5, [0, 2]]
  15525. ]]
  15526. ],
  15527. [
  15528. [0, null, false, null, 9177726973297438, [
  15529. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x8a2f67d5f5278, false, [
  15530. [11, "LANG"],
  15531. [8, 0],
  15532. [7, [2, "es"]]
  15533. ]]
  15534. ],
  15535. [
  15536. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 61351661703021, false, [
  15537. [7, [10, [2, "PUNTAJE:"],
  15538. [23, "Score"]
  15539. ]]
  15540. ]],
  15541. [52, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0xd5fca1dd55e46, false, [
  15542. [7, [10, [2, "MEJOR:"],
  15543. [23, "BestScore"]
  15544. ]]
  15545. ]]
  15546. ]
  15547. ],
  15548. [0, null, false, null, 0x4efb0c3cb5e52, [
  15549. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0xd1025aa094ccd, false]
  15550. ],
  15551. [
  15552. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 5319411021060142, false, [
  15553. [7, [10, [2, " "],
  15554. [23, "Score"]
  15555. ]]
  15556. ]],
  15557. [52, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 8509529196405516, false, [
  15558. [7, [10, [2, "BEST:"],
  15559. [23, "BestScore"]
  15560. ]]
  15561. ]]
  15562. ]
  15563. ],
  15564. [0, null, false, null, 8646791937225954, [],
  15565. [
  15566. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "stop", 0x3dfc1ba9aefbb, false, [
  15567. [3, 0]
  15568. ]],
  15569. [-1, cr.system_object.prototype.acts.Wait, null, 9094988347303514, false, [
  15570. [0, [1, .3]]
  15571. ]],
  15572. [13, cr.plugins_.Sprite.prototype.acts.Destroy, null, 513240665258939, false]
  15573. ]
  15574. ],
  15575. [0, null, false, null, 5263994670658141, [
  15576. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xa28db10ad5a10, false, [
  15577. [11, "TutCompleted"],
  15578. [8, 0],
  15579. [7, [0, 0]]
  15580. ]]
  15581. ],
  15582. [
  15583. [-1, cr.system_object.prototype.acts.CreateObject, null, 6577262119012411, false, [
  15584. [4, 9],
  15585. [5, [0, 3]],
  15586. [0, [0, 0]],
  15587. [0, [0, 0]]
  15588. ]],
  15589. [-1, cr.system_object.prototype.acts.CreateObject, null, 7309097208893702, false, [
  15590. [4, 4],
  15591. [5, [0, 3]],
  15592. [0, [0, 261]],
  15593. [0, [0, 406]]
  15594. ]],
  15595. [-1, cr.system_object.prototype.acts.SetVar, null, 9532472212888396, false, [
  15596. [11, "CurrTut"],
  15597. [7, [0, 1]]
  15598. ]]
  15599. ],
  15600. [
  15601. [0, null, false, null, 0x4c2ed533a415d, [
  15602. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xc8889c20c2cb7, false, [
  15603. [11, "LANG"],
  15604. [8, 0],
  15605. [7, [2, "es"]]
  15606. ]]
  15607. ],
  15608. [
  15609. [9, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 8474617350745324, false, [
  15610. [0, [0, 1]]
  15611. ]],
  15612. [9, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0xf33de6f3b1193, false]
  15613. ]
  15614. ],
  15615. [0, null, false, null, 0xafd1f0e303c53, [
  15616. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0xb199b8b3f45d8, false]
  15617. ],
  15618. [
  15619. [9, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 664527044844423, false, [
  15620. [0, [0, 0]]
  15621. ]],
  15622. [9, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0x40ecd79e50661, false]
  15623. ]
  15624. ]
  15625. ]
  15626. ],
  15627. [0, null, false, null, 5748467303303985, [
  15628. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 335608760556832, false]
  15629. ],
  15630. [
  15631. [-1, cr.system_object.prototype.acts.SetVar, null, 9427173312487962, false, [
  15632. [11, "GameIsPaused"],
  15633. [7, [0, 0]]
  15634. ]],
  15635. [28, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 0x5bd95ba3e0b00, false, [
  15636. [3, 1]
  15637. ]],
  15638. [27, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 6247536423914716, false, [
  15639. [3, 1]
  15640. ]],
  15641. [2, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 0x51bd23be2c9bf, false, [
  15642. [3, 1]
  15643. ]],
  15644. [53, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 9964285891037172, false, [
  15645. [3, 1]
  15646. ]],
  15647. [52, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 8086180617662733, false, [
  15648. [3, 1]
  15649. ]]
  15650. ]
  15651. ]
  15652. ]
  15653. ],
  15654. [0, null, false, null, 0xc09f96ec06043, [
  15655. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xea49c9cec4c25, false, [
  15656. [11, "GameIsPaused"],
  15657. [8, 0],
  15658. [7, [0, 1]]
  15659. ]],
  15660. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6785094147308014, false, [
  15661. [11, "TutCompleted"],
  15662. [8, 0],
  15663. [7, [0, 0]]
  15664. ]]
  15665. ],
  15666. [],
  15667. [
  15668. [0, null, true, null, 7754857444298257, [
  15669. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 5705305411994146, false, [
  15670. [3, 0],
  15671. [3, 0],
  15672. [4, 4]
  15673. ]],
  15674. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 6931394593831444, false, [
  15675. [4, 4]
  15676. ]]
  15677. ],
  15678. [],
  15679. [
  15680. [0, null, false, null, 0x5237c6604fe16, [
  15681. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9727643922105048, false, [
  15682. [11, "CurrTut"],
  15683. [8, 0],
  15684. [7, [0, 1]]
  15685. ]]
  15686. ],
  15687. [
  15688. [-1, cr.system_object.prototype.acts.CreateObject, null, 9536321484925048, false, [
  15689. [4, 13],
  15690. [5, [0, 4]],
  15691. [0, [0, 0]],
  15692. [0, [0, 0]]
  15693. ]],
  15694. [13, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 7519477562270497, false, [
  15695. [0, [0, 0]]
  15696. ]],
  15697. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "start", 4709208812830006, false, [
  15698. [3, 0]
  15699. ]],
  15700. [-1, cr.system_object.prototype.acts.Wait, null, 0xddd06cee07017, false, [
  15701. [0, [1, .3]]
  15702. ]],
  15703. [9, cr.plugins_.Sprite.prototype.acts.Destroy, null, 6595099038870162, false],
  15704. [-1, cr.system_object.prototype.acts.CreateObject, null, 9768807131793894, false, [
  15705. [4, 8],
  15706. [5, [0, 3]],
  15707. [0, [0, 0]],
  15708. [0, [0, 0]]
  15709. ]],
  15710. [4, cr.plugins_.Sprite.prototype.acts.MoveToTop, null, 0xba0e3cef0b16e, false],
  15711. [-1, cr.system_object.prototype.acts.SetVar, null, 7246427662669753, false, [
  15712. [11, "CurrTut"],
  15713. [7, [0, 2]]
  15714. ]]
  15715. ],
  15716. [
  15717. [0, null, false, null, 6638191455274088, [
  15718. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6908829644078461, false, [
  15719. [11, "LANG"],
  15720. [8, 0],
  15721. [7, [2, "es"]]
  15722. ]]
  15723. ],
  15724. [
  15725. [8, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 7334354187499932, false, [
  15726. [0, [0, 1]]
  15727. ]],
  15728. [8, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0xfda8a48cf0447, false]
  15729. ]
  15730. ],
  15731. [0, null, false, null, 0xa6bb8ffd38a9a, [
  15732. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 9884926316486848, false]
  15733. ],
  15734. [
  15735. [8, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 0x670947c01f000, false, [
  15736. [0, [0, 0]]
  15737. ]],
  15738. [8, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0xfdaddc8616e6c, false]
  15739. ]
  15740. ],
  15741. [0, null, false, null, 5846927071827348, [],
  15742. [
  15743. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "stop", 0x741db25ab56c5, false, [
  15744. [3, 0]
  15745. ]],
  15746. [-1, cr.system_object.prototype.acts.Wait, null, 0x9e43f4def8ac9, false, [
  15747. [0, [1, .3]]
  15748. ]],
  15749. [13, cr.plugins_.Sprite.prototype.acts.Destroy, null, 9066729937577848, false]
  15750. ]
  15751. ]
  15752. ]
  15753. ],
  15754. [0, null, false, null, 5316683306948174, [
  15755. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 5508104589819223, false]
  15756. ],
  15757. [
  15758. [-1, cr.system_object.prototype.acts.CreateObject, null, 6106535191894293, false, [
  15759. [4, 13],
  15760. [5, [0, 4]],
  15761. [0, [0, 0]],
  15762. [0, [0, 0]]
  15763. ]],
  15764. [13, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 6212239803941915, false, [
  15765. [0, [0, 0]]
  15766. ]],
  15767. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "start", 7669512908206894, false, [
  15768. [3, 0]
  15769. ]],
  15770. [-1, cr.system_object.prototype.acts.Wait, null, 4808646555820771, false, [
  15771. [0, [1, .3]]
  15772. ]],
  15773. [8, cr.plugins_.Sprite.prototype.acts.Destroy, null, 5394579556213709, false],
  15774. [4, cr.plugins_.Sprite.prototype.acts.Destroy, null, 4543648318239956, false],
  15775. [-1, cr.system_object.prototype.acts.SetVar, null, 0x7fcb814e1ebbd, false, [
  15776. [11, "TutCompleted"],
  15777. [7, [0, 1]]
  15778. ]],
  15779. [-1, cr.system_object.prototype.acts.SetVar, null, 8483754784208008, false, [
  15780. [11, "CurrTut"],
  15781. [7, [0, 2222]]
  15782. ]],
  15783. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "stop", 0xab80646a5503b, false, [
  15784. [3, 0]
  15785. ]],
  15786. [-1, cr.system_object.prototype.acts.Wait, null, 5024560761266645, false, [
  15787. [0, [1, .3]]
  15788. ]],
  15789. [13, cr.plugins_.Sprite.prototype.acts.Destroy, null, 5942891480654481, false],
  15790. [-1, cr.system_object.prototype.acts.SetVar, null, 0x8fb327c69d527, false, [
  15791. [11, "GameIsPaused"],
  15792. [7, [0, 0]]
  15793. ]],
  15794. [28, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 6309081197139418, false, [
  15795. [3, 1]
  15796. ]],
  15797. [27, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 5069813109175883, false, [
  15798. [3, 1]
  15799. ]],
  15800. [2, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 6097726730871108, false, [
  15801. [3, 1]
  15802. ]],
  15803. [53, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 7706081591061075, false, [
  15804. [3, 1]
  15805. ]],
  15806. [52, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 8610312043259726, false, [
  15807. [3, 1]
  15808. ]]
  15809. ]
  15810. ]
  15811. ]
  15812. ]
  15813. ]
  15814. ],
  15815. [0, null, false, null, 8235732786874766, [
  15816. [29, cr.plugins_.Mouse.prototype.cnds.OnClick, null, 1, false, false, false, 0xd0e4cb162b829, false, [
  15817. [3, 0],
  15818. [3, 0]
  15819. ]]
  15820. ],
  15821. [
  15822. [-1, cr.system_object.prototype.acts.SetVar, null, 9483357908559128, false, [
  15823. [11, "Slice_Initial_X"],
  15824. [7, [20, 29, cr.plugins_.Mouse.prototype.exps.X, false, null]]
  15825. ]],
  15826. [-1, cr.system_object.prototype.acts.SetVar, null, 9269527787097844, false, [
  15827. [11, "Slice_Initial_Y"],
  15828. [7, [20, 29, cr.plugins_.Mouse.prototype.exps.Y, false, null]]
  15829. ]]
  15830. ]
  15831. ],
  15832. [0, null, false, null, 8680557405443485, [
  15833. [30, cr.plugins_.Touch.prototype.cnds.OnTouchStart, null, 1, false, false, false, 0xc7d4bf982b854, false]
  15834. ],
  15835. [
  15836. [-1, cr.system_object.prototype.acts.SetVar, null, 8078319301548373, false, [
  15837. [11, "Slice_Initial_X"],
  15838. [7, [20, 30, cr.plugins_.Touch.prototype.exps.X, false, null, [
  15839. [2, "BG"]
  15840. ]]]
  15841. ]],
  15842. [-1, cr.system_object.prototype.acts.SetVar, null, 0x62795083a709d, false, [
  15843. [11, "Slice_Initial_Y"],
  15844. [7, [20, 30, cr.plugins_.Touch.prototype.exps.Y, false, null, [
  15845. [2, "BG"]
  15846. ]]]
  15847. ]]
  15848. ]
  15849. ],
  15850. [0, null, false, null, 0xe38e6ddc38ebf, [
  15851. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6593874809610883, false, [
  15852. [11, "GameIsPaused"],
  15853. [8, 1],
  15854. [7, [0, 1]]
  15855. ]],
  15856. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5842275606662821, false, [
  15857. [11, "SlomoIsActive"],
  15858. [8, 1],
  15859. [7, [0, 1]]
  15860. ]],
  15861. [30, cr.plugins_.Touch.prototype.cnds.IsTouchingObject, null, 0, false, true, false, 8511768616888706, false, [
  15862. [4, 2]
  15863. ]],
  15864. [30, cr.plugins_.Touch.prototype.cnds.IsTouchingObject, null, 0, false, true, false, 579743555049803, false, [
  15865. [4, 4]
  15866. ]]
  15867. ],
  15868. [],
  15869. [
  15870. [0, null, false, null, 0xb189256bc695, [
  15871. [29, cr.plugins_.Mouse.prototype.cnds.IsButtonDown, null, 0, false, false, false, 9208063196246088, false, [
  15872. [3, 0]
  15873. ]]
  15874. ],
  15875. [
  15876. [-1, cr.system_object.prototype.acts.CreateObject, null, 9738788806048504, false, [
  15877. [4, 47],
  15878. [5, [0, 0]],
  15879. [0, [23, "Slice_Initial_X"]],
  15880. [0, [23, "Slice_Initial_Y"]]
  15881. ]],
  15882. [47, cr.plugins_.Sprite.prototype.acts.SetWidth, null, 7110760503873639, false, [
  15883. [0, [19, cr.system_object.prototype.exps.distance, [
  15884. [23, "Slice_Initial_X"],
  15885. [23, "Slice_Initial_Y"],
  15886. [20, 29, cr.plugins_.Mouse.prototype.exps.X, false, null],
  15887. [20, 29, cr.plugins_.Mouse.prototype.exps.Y, false, null]
  15888. ]]]
  15889. ]],
  15890. [47, cr.plugins_.Sprite.prototype.acts.SetHeight, null, 0x75d1529ee3286, false, [
  15891. [0, [7, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  15892. [0, 8]
  15893. ]]
  15894. ]],
  15895. [47, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 0xc7f5aecb05db2, false, [
  15896. [0, [19, cr.system_object.prototype.exps.angle, [
  15897. [23, "Slice_Initial_X"],
  15898. [23, "Slice_Initial_Y"],
  15899. [20, 29, cr.plugins_.Mouse.prototype.exps.X, false, null],
  15900. [20, 29, cr.plugins_.Mouse.prototype.exps.Y, false, null]
  15901. ]]]
  15902. ]],
  15903. [-1, cr.system_object.prototype.acts.SetVar, null, 934323766011749, false, [
  15904. [11, "Slice_Initial_X"],
  15905. [7, [20, 29, cr.plugins_.Mouse.prototype.exps.X, false, null]]
  15906. ]],
  15907. [-1, cr.system_object.prototype.acts.SetVar, null, 379194305975312, false, [
  15908. [11, "Slice_Initial_Y"],
  15909. [7, [20, 29, cr.plugins_.Mouse.prototype.exps.Y, false, null]]
  15910. ]]
  15911. ]
  15912. ],
  15913. [0, null, false, null, 0xcf6f74c69e48d, [
  15914. [30, cr.plugins_.Touch.prototype.cnds.IsInTouch, null, 0, false, false, false, 7498367476290705, false]
  15915. ],
  15916. [
  15917. [-1, cr.system_object.prototype.acts.CreateObject, null, 0x55839224d198b, false, [
  15918. [4, 47],
  15919. [5, [0, 0]],
  15920. [0, [23, "Slice_Initial_X"]],
  15921. [0, [23, "Slice_Initial_Y"]]
  15922. ]],
  15923. [47, cr.plugins_.Sprite.prototype.acts.SetWidth, null, 0x7fa879901cd8f, false, [
  15924. [0, [19, cr.system_object.prototype.exps.distance, [
  15925. [23, "Slice_Initial_X"],
  15926. [23, "Slice_Initial_Y"],
  15927. [20, 30, cr.plugins_.Touch.prototype.exps.X, false, null, [
  15928. [2, "BG"]
  15929. ]],
  15930. [20, 30, cr.plugins_.Touch.prototype.exps.Y, false, null, [
  15931. [2, "BG"]
  15932. ]]
  15933. ]]]
  15934. ]],
  15935. [47, cr.plugins_.Sprite.prototype.acts.SetHeight, null, 0x6637246bd9853, false, [
  15936. [0, [7, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  15937. [0, 8]
  15938. ]]
  15939. ]],
  15940. [47, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 0x4a0d70d6a2215, false, [
  15941. [0, [19, cr.system_object.prototype.exps.angle, [
  15942. [23, "Slice_Initial_X"],
  15943. [23, "Slice_Initial_Y"],
  15944. [20, 30, cr.plugins_.Touch.prototype.exps.X, false, null, [
  15945. [2, "BG"]
  15946. ]],
  15947. [20, 30, cr.plugins_.Touch.prototype.exps.Y, false, null, [
  15948. [2, "BG"]
  15949. ]]
  15950. ]]]
  15951. ]],
  15952. [-1, cr.system_object.prototype.acts.SetVar, null, 724601221004615, false, [
  15953. [11, "Slice_Initial_X"],
  15954. [7, [20, 30, cr.plugins_.Touch.prototype.exps.X, false, null, [
  15955. [2, "BG"]
  15956. ]]]
  15957. ]],
  15958. [-1, cr.system_object.prototype.acts.SetVar, null, 6654926442820032, false, [
  15959. [11, "Slice_Initial_Y"],
  15960. [7, [20, 30, cr.plugins_.Touch.prototype.exps.Y, false, null, [
  15961. [2, "BG"]
  15962. ]]]
  15963. ]]
  15964. ]
  15965. ]
  15966. ]
  15967. ],
  15968. [1, "RandNum", 0, 0, false, false, 6319539101115461, false],
  15969. [0, null, false, null, 0x8623668b9050c, [
  15970. [-1, cr.system_object.prototype.cnds.Every, null, 0, false, false, false, 8651764072200669, false, [
  15971. [0, [4, [23, "SpawnCandiesTime"],
  15972. [19, cr.system_object.prototype.exps.random, [
  15973. [23, "SpawnCandiesTimeRandOffset"]
  15974. ]]
  15975. ]]
  15976. ]],
  15977. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5388746387251387, false, [
  15978. [11, "GameIsPaused"],
  15979. [8, 1],
  15980. [7, [0, 1]]
  15981. ]]
  15982. ],
  15983. [
  15984. [-1, cr.system_object.prototype.acts.SetVar, null, 0x68850639a6d8d, false, [
  15985. [11, "RandNum"],
  15986. [7, [19, cr.system_object.prototype.exps.random, [
  15987. [0, 100]
  15988. ]]]
  15989. ]]
  15990. ],
  15991. [
  15992. [0, null, false, null, 5990317030899022, [
  15993. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x972bca0cfd750, false, [
  15994. [11, "RandNum"],
  15995. [8, 2],
  15996. [7, [0, 50]]
  15997. ]]
  15998. ],
  15999. [
  16000. [-1, cr.system_object.prototype.acts.CreateObject, null, 6151099206952308, false, [
  16001. [4, 22],
  16002. [5, [0, 1]],
  16003. [0, [4, [6, [20, 22, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16004. [0, 2]
  16005. ],
  16006. [19, cr.system_object.prototype.exps.random, [
  16007. [5, [19, cr.system_object.prototype.exps.layoutwidth],
  16008. [6, [20, 22, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16009. [0, 4]
  16010. ]
  16011. ]
  16012. ]]
  16013. ]],
  16014. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  16015. [7, [20, 22, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16016. [0, 2]
  16017. ]
  16018. ]]
  16019. ]],
  16020. [22, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 0x93ff32960af06, false, [
  16021. [3, 0],
  16022. [0, [3, [23, "GlobalSpeed"]]]
  16023. ]],
  16024. [22, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 6286482505286708, false, [
  16025. [0, [5, [1, -84.375],
  16026. [19, cr.system_object.prototype.exps.random, [
  16027. [1, 11.25]
  16028. ]]
  16029. ]]
  16030. ]]
  16031. ]
  16032. ],
  16033. [0, null, false, null, 5274143938247925, [
  16034. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9648577030902012, false, [
  16035. [11, "RandNum"],
  16036. [8, 4],
  16037. [7, [0, 50]]
  16038. ]],
  16039. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xe9322495b31a4, false, [
  16040. [11, "RandNum"],
  16041. [8, 2],
  16042. [7, [0, 80]]
  16043. ]]
  16044. ],
  16045. [
  16046. [-1, cr.system_object.prototype.acts.CreateObject, null, 6812113892113561, false, [
  16047. [4, 21],
  16048. [5, [0, 1]],
  16049. [0, [4, [6, [20, 21, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16050. [0, 2]
  16051. ],
  16052. [19, cr.system_object.prototype.exps.random, [
  16053. [5, [19, cr.system_object.prototype.exps.layoutwidth],
  16054. [6, [20, 21, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16055. [0, 4]
  16056. ]
  16057. ]
  16058. ]]
  16059. ]],
  16060. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  16061. [7, [20, 21, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16062. [0, 2]
  16063. ]
  16064. ]]
  16065. ]],
  16066. [21, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 9385652354809988, false, [
  16067. [3, 0],
  16068. [0, [3, [23, "GlobalSpeed"]]]
  16069. ]],
  16070. [21, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 6505644210799675, false, [
  16071. [0, [5, [1, -84.375],
  16072. [19, cr.system_object.prototype.exps.random, [
  16073. [1, 11.25]
  16074. ]]
  16075. ]]
  16076. ]]
  16077. ]
  16078. ],
  16079. [0, null, false, null, 890021948424506, [
  16080. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 7769282182095803, false, [
  16081. [11, "RandNum"],
  16082. [8, 4],
  16083. [7, [0, 80]]
  16084. ]]
  16085. ],
  16086. [
  16087. [-1, cr.system_object.prototype.acts.CreateObject, null, 4744652261489706, false, [
  16088. [4, 20],
  16089. [5, [0, 1]],
  16090. [0, [4, [6, [20, 20, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16091. [0, 2]
  16092. ],
  16093. [19, cr.system_object.prototype.exps.random, [
  16094. [5, [19, cr.system_object.prototype.exps.layoutwidth],
  16095. [6, [20, 20, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16096. [0, 4]
  16097. ]
  16098. ]
  16099. ]]
  16100. ]],
  16101. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  16102. [7, [20, 20, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16103. [0, 2]
  16104. ]
  16105. ]]
  16106. ]],
  16107. [20, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 0x804bec5ad8823, false, [
  16108. [3, 0],
  16109. [0, [3, [23, "GlobalSpeed"]]]
  16110. ]],
  16111. [20, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 9181057484873316, false, [
  16112. [0, [5, [1, -84.375],
  16113. [19, cr.system_object.prototype.exps.random, [
  16114. [1, 11.25]
  16115. ]]
  16116. ]]
  16117. ]]
  16118. ]
  16119. ]
  16120. ]
  16121. ],
  16122. [1, "BombsSpawnDelayDone", 0, 0, false, false, 863431158169603, false],
  16123. [0, null, false, null, 873855346871748, [
  16124. [-1, cr.system_object.prototype.cnds.Every, null, 0, false, false, false, 5420250466619507, false, [
  16125. [0, [0, 10]]
  16126. ]],
  16127. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xf022262cc77ff, false, [
  16128. [11, "BombsSpawnDelayDone"],
  16129. [8, 0],
  16130. [7, [0, 0]]
  16131. ]],
  16132. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5866031539419033, false, [
  16133. [11, "GameIsPaused"],
  16134. [8, 1],
  16135. [7, [0, 1]]
  16136. ]]
  16137. ],
  16138. [
  16139. [-1, cr.system_object.prototype.acts.SetVar, null, 6529857721984496, false, [
  16140. [11, "BombsSpawnDelayDone"],
  16141. [7, [0, 1]]
  16142. ]]
  16143. ]
  16144. ],
  16145. [0, null, false, null, 0xf8dfa6e71f112, [
  16146. [-1, cr.system_object.prototype.cnds.Every, null, 0, false, false, false, 0xb4b15c8c10c14, false, [
  16147. [0, [4, [0, 2],
  16148. [19, cr.system_object.prototype.exps.random, [
  16149. [0, 2]
  16150. ]]
  16151. ]]
  16152. ]],
  16153. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 8778999704927417, false, [
  16154. [11, "GameIsPaused"],
  16155. [8, 1],
  16156. [7, [0, 1]]
  16157. ]],
  16158. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6497079813489304, false, [
  16159. [11, "CandyFontainIsActive"],
  16160. [8, 1],
  16161. [7, [0, 1]]
  16162. ]],
  16163. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 7884178814557775, false, [
  16164. [11, "BombsSpawnDelayDone"],
  16165. [8, 0],
  16166. [7, [0, 1]]
  16167. ]]
  16168. ],
  16169. [
  16170. [-1, cr.system_object.prototype.acts.CreateObject, null, 8775271545487426, false, [
  16171. [4, 14],
  16172. [5, [0, 1]],
  16173. [0, [4, [6, [20, 14, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16174. [0, 2]
  16175. ],
  16176. [19, cr.system_object.prototype.exps.random, [
  16177. [5, [19, cr.system_object.prototype.exps.layoutwidth],
  16178. [6, [20, 14, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16179. [0, 4]
  16180. ]
  16181. ]
  16182. ]]
  16183. ]],
  16184. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  16185. [7, [20, 14, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16186. [0, 2]
  16187. ]
  16188. ]]
  16189. ]],
  16190. [14, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 4706481182765618, false, [
  16191. [3, 0],
  16192. [0, [3, [23, "GlobalSpeed"]]]
  16193. ]],
  16194. [14, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 5835107900658018, false, [
  16195. [0, [5, [1, -84.375],
  16196. [19, cr.system_object.prototype.exps.random, [
  16197. [1, 11.25]
  16198. ]]
  16199. ]]
  16200. ]],
  16201. [14, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 506182958675356, false, [
  16202. [0, [19, cr.system_object.prototype.exps.random, [
  16203. [0, 360]
  16204. ]]]
  16205. ]]
  16206. ]
  16207. ],
  16208. [0, null, false, null, 0xf3ebb1247cfdb, [
  16209. [-1, cr.system_object.prototype.cnds.Every, null, 0, false, false, false, 6432816878591915, false, [
  16210. [0, [4, [0, 3],
  16211. [19, cr.system_object.prototype.exps.random, [
  16212. [0, 1]
  16213. ]]
  16214. ]]
  16215. ]],
  16216. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5885991440510994, false, [
  16217. [11, "GameIsPaused"],
  16218. [8, 1],
  16219. [7, [0, 1]]
  16220. ]],
  16221. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xe6e617f3e6eee, false, [
  16222. [11, "CandyFontainIsActive"],
  16223. [8, 1],
  16224. [7, [0, 1]]
  16225. ]],
  16226. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x3a0b9e6bd05c5, false, [
  16227. [11, "BombsSpawnDelayDone"],
  16228. [8, 0],
  16229. [7, [0, 1]]
  16230. ]]
  16231. ],
  16232. [
  16233. [-1, cr.system_object.prototype.acts.CreateObject, null, 5155768844322383, false, [
  16234. [4, 15],
  16235. [5, [0, 1]],
  16236. [0, [4, [6, [20, 15, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16237. [0, 2]
  16238. ],
  16239. [19, cr.system_object.prototype.exps.random, [
  16240. [5, [19, cr.system_object.prototype.exps.layoutwidth],
  16241. [6, [20, 15, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16242. [0, 4]
  16243. ]
  16244. ]
  16245. ]]
  16246. ]],
  16247. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  16248. [7, [20, 15, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16249. [0, 2]
  16250. ]
  16251. ]]
  16252. ]],
  16253. [15, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 5807331087783236, false, [
  16254. [3, 0],
  16255. [0, [3, [23, "GlobalSpeed"]]]
  16256. ]],
  16257. [15, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 5098467506986848, false, [
  16258. [0, [5, [1, -84.375],
  16259. [19, cr.system_object.prototype.exps.random, [
  16260. [1, 11.25]
  16261. ]]
  16262. ]]
  16263. ]],
  16264. [15, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 0x3d9c32263a1e1, false, [
  16265. [0, [19, cr.system_object.prototype.exps.random, [
  16266. [0, 360]
  16267. ]]]
  16268. ]]
  16269. ]
  16270. ],
  16271. [0, null, false, null, 9169659291704680, [
  16272. [-1, cr.system_object.prototype.cnds.Every, null, 0, false, false, false, 8100831553995254, false, [
  16273. [0, [4, [0, 3],
  16274. [19, cr.system_object.prototype.exps.random, [
  16275. [0, 7]
  16276. ]]
  16277. ]]
  16278. ]],
  16279. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9845164406988056, false, [
  16280. [11, "GameIsPaused"],
  16281. [8, 1],
  16282. [7, [0, 1]]
  16283. ]],
  16284. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xfa47b5ba78089, false, [
  16285. [11, "Lives"],
  16286. [8, 2],
  16287. [7, [0, 2]]
  16288. ]]
  16289. ],
  16290. [
  16291. [-1, cr.system_object.prototype.acts.CreateObject, null, 796941462357713, false, [
  16292. [4, 23],
  16293. [5, [0, 1]],
  16294. [0, [4, [6, [20, 23, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16295. [0, 2]
  16296. ],
  16297. [19, cr.system_object.prototype.exps.random, [
  16298. [5, [19, cr.system_object.prototype.exps.layoutwidth],
  16299. [6, [20, 23, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16300. [0, 4]
  16301. ]
  16302. ]
  16303. ]]
  16304. ]],
  16305. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  16306. [7, [20, 23, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16307. [0, 2]
  16308. ]
  16309. ]]
  16310. ]],
  16311. [23, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement", 0x5dc8493b23fe7, false, [
  16312. [3, 0],
  16313. [0, [3, [23, "GlobalSpeed"]]]
  16314. ]],
  16315. [23, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement", 7553820718100702, false, [
  16316. [0, [5, [1, -84.375],
  16317. [19, cr.system_object.prototype.exps.random, [
  16318. [1, 11.25]
  16319. ]]
  16320. ]]
  16321. ]],
  16322. [23, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 0x96bffb3a6a41d, false, [
  16323. [0, [19, cr.system_object.prototype.exps.random, [
  16324. [0, 360]
  16325. ]]]
  16326. ]]
  16327. ]
  16328. ],
  16329. [0, null, false, null, 8265547815813638, [
  16330. [-1, cr.system_object.prototype.cnds.Every, null, 0, false, false, false, 8123537674051468, false, [
  16331. [0, [4, [0, 20],
  16332. [19, cr.system_object.prototype.exps.random, [
  16333. [0, 20]
  16334. ]]
  16335. ]]
  16336. ]],
  16337. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x78d338a203ef0, false, [
  16338. [11, "GameIsPaused"],
  16339. [8, 1],
  16340. [7, [0, 1]]
  16341. ]]
  16342. ],
  16343. [
  16344. [-1, cr.system_object.prototype.acts.CreateObject, null, 5608397315525246, false, [
  16345. [4, 25],
  16346. [5, [0, 1]],
  16347. [0, [4, [6, [20, 25, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16348. [0, 2]
  16349. ],
  16350. [19, cr.system_object.prototype.exps.random, [
  16351. [5, [19, cr.system_object.prototype.exps.layoutwidth],
  16352. [6, [20, 25, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16353. [0, 4]
  16354. ]
  16355. ]
  16356. ]]
  16357. ]],
  16358. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  16359. [7, [20, 25, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16360. [0, 2]
  16361. ]
  16362. ]]
  16363. ]],
  16364. [25, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement", 6348895249535183, false, [
  16365. [3, 0],
  16366. [0, [3, [23, "GlobalSpeed"]]]
  16367. ]],
  16368. [25, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement", 0x6c6ec4417a193, false, [
  16369. [0, [5, [1, -84.375],
  16370. [19, cr.system_object.prototype.exps.random, [
  16371. [1, 11.25]
  16372. ]]
  16373. ]]
  16374. ]],
  16375. [25, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 0x783f65624c83a, false, [
  16376. [0, [19, cr.system_object.prototype.exps.random, [
  16377. [0, 360]
  16378. ]]]
  16379. ]]
  16380. ]
  16381. ],
  16382. [0, null, false, null, 6383413249098096, [
  16383. [-1, cr.system_object.prototype.cnds.EveryTick, null, 0, false, false, false, 5161049479181053, false]
  16384. ],
  16385. [],
  16386. [
  16387. [0, null, false, null, 625864607214491, [
  16388. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9916823000494700, false, [
  16389. [11, "GameIsPaused"],
  16390. [8, 1],
  16391. [7, [0, 1]]
  16392. ]]
  16393. ],
  16394. [
  16395. [56, cr.behaviors.custom.prototype.acts.Accelerate, "CustomMovement2", 0xe778f03fe515e, false, [
  16396. [3, 2],
  16397. [0, [23, "GlobalSpeed"]]
  16398. ]]
  16399. ],
  16400. [
  16401. [0, null, false, null, 9455719517875960, [
  16402. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5446070398976693, false, [
  16403. [11, "CuttedAtRaw"],
  16404. [8, 1],
  16405. [7, [0, 0]]
  16406. ]]
  16407. ],
  16408. [
  16409. [-1, cr.system_object.prototype.acts.AddVar, null, 7314129080302319, false, [
  16410. [11, "ElapsedSinceLastCut"],
  16411. [7, [0, 1]]
  16412. ]]
  16413. ]
  16414. ],
  16415. [0, null, false, null, 8259834515006519, [
  16416. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x67df6160ffc2, false, [
  16417. [11, "CandyFontainIsActive"],
  16418. [8, 0],
  16419. [7, [0, 1]]
  16420. ]]
  16421. ],
  16422. [
  16423. [-1, cr.system_object.prototype.acts.AddVar, null, 881967108254761, false, [
  16424. [11, "CandyFontainIsActiveFor"],
  16425. [7, [0, 1]]
  16426. ]]
  16427. ]
  16428. ]
  16429. ]
  16430. ]
  16431. ]
  16432. ],
  16433. [0, null, false, null, 6030020678628314, [
  16434. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5716113288013841, false, [
  16435. [11, "GameIsPaused"],
  16436. [8, 1],
  16437. [7, [0, 1]]
  16438. ]],
  16439. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 7002701125321502, false, [
  16440. [11, "SlomoIsActive"],
  16441. [8, 1],
  16442. [7, [0, 1]]
  16443. ]]
  16444. ],
  16445. [],
  16446. [
  16447. [0, null, false, null, 0x6fc375ebfffe7, [
  16448. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x8f223d4a0b43e, false, [
  16449. [11, "CuttedAtRaw"],
  16450. [8, 0],
  16451. [7, [0, 0]]
  16452. ]]
  16453. ],
  16454. [
  16455. [-1, cr.system_object.prototype.acts.SetVar, null, 9123458658406860, false, [
  16456. [11, "ElapsedSinceLastCut"],
  16457. [7, [0, 0]]
  16458. ]]
  16459. ]
  16460. ],
  16461. [0, null, false, null, 8493127079863287, [
  16462. [47, cr.plugins_.Sprite.prototype.cnds.IsOverlapping, null, 0, false, false, false, 0x92153db54b519, false, [
  16463. [4, 22]
  16464. ]],
  16465. [47, cr.plugins_.Sprite.prototype.cnds.CompareWidth, null, 0, false, false, false, 8413115577728431, false, [
  16466. [8, 5],
  16467. [0, [7, [20, 22, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16468. [0, 4]
  16469. ]]
  16470. ]]
  16471. ],
  16472. [
  16473. [22, cr.plugins_.Sprite.prototype.acts.Destroy, null, 4650146375872332, false],
  16474. [22, cr.plugins_.Sprite.prototype.acts.Spawn, null, 8871154823538056, false, [
  16475. [4, 18],
  16476. [5, [0, 1]],
  16477. [7, [0, 0]]
  16478. ]],
  16479. [18, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 0xfa772c6108ba2, false, [
  16480. [3, 0],
  16481. [0, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null]]
  16482. ]],
  16483. [18, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 0x7c10d0935a628, false, [
  16484. [0, [4, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16485. [0, 90]
  16486. ]]
  16487. ]],
  16488. [18, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 4605857607331691, false, [
  16489. [0, [5, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16490. [0, 90]
  16491. ]]
  16492. ]],
  16493. [22, cr.plugins_.Sprite.prototype.acts.Spawn, null, 8785235951963116, false, [
  16494. [4, 18],
  16495. [5, [0, 1]],
  16496. [7, [0, 0]]
  16497. ]],
  16498. [18, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 6512237293391449, false, [
  16499. [3, 0],
  16500. [0, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null]]
  16501. ]],
  16502. [18, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 5853196692798881, false, [
  16503. [0, [5, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16504. [0, 90]
  16505. ]]
  16506. ]],
  16507. [18, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 5284441509140536, false, [
  16508. [0, [4, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16509. [0, 90]
  16510. ]]
  16511. ]],
  16512. [22, cr.plugins_.Sprite.prototype.acts.Spawn, null, 5993314721996034, false, [
  16513. [4, 46],
  16514. [5, [0, 0]],
  16515. [7, [0, 0]]
  16516. ]],
  16517. [46, cr.plugins_.Sprite.prototype.acts.SetSize, null, 7160971352198904, false, [
  16518. [0, [6, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16519. [0, 2]
  16520. ]],
  16521. [0, [6, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16522. [0, 2]
  16523. ]]
  16524. ]],
  16525. [-1, cr.system_object.prototype.acts.AddVar, null, 0xa74b41ded5ed9, false, [
  16526. [11, "Candies_Amount"],
  16527. [7, [0, 1]]
  16528. ]],
  16529. [22, cr.plugins_.Sprite.prototype.acts.Spawn, null, 5485534844886808, false, [
  16530. [4, 32],
  16531. [5, [0, 2]],
  16532. [7, [0, 0]]
  16533. ]],
  16534. [-1, cr.system_object.prototype.acts.AddVar, null, 0xc5672bebc59e, false, [
  16535. [11, "Score"],
  16536. [7, [0, 10]]
  16537. ]],
  16538. [-1, cr.system_object.prototype.acts.AddVar, null, 7758672500430726, false, [
  16539. [11, "CuttedAtRaw"],
  16540. [7, [0, 1]]
  16541. ]]
  16542. ],
  16543. [
  16544. [0, null, false, null, 8917449329140815, [
  16545. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xeb4a29488296a, false, [
  16546. [11, "LANG"],
  16547. [8, 0],
  16548. [7, [2, "es"]]
  16549. ]]
  16550. ],
  16551. [
  16552. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 4572167185885337, false, [
  16553. [7, [10, [2, "PUNTAJE:"],
  16554. [23, "Score"]
  16555. ]]
  16556. ]]
  16557. ]
  16558. ],
  16559. [0, null, false, null, 4961199132868215, [
  16560. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0x8066db44eb463, false]
  16561. ],
  16562. [
  16563. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0xe20e72a4fcc63, false, [
  16564. [7, [10, [2, " "],
  16565. [23, "Score"]
  16566. ]]
  16567. ]]
  16568. ]
  16569. ]
  16570. ]
  16571. ],
  16572. [0, null, false, null, 4760227365194652, [
  16573. [47, cr.plugins_.Sprite.prototype.cnds.IsOverlapping, null, 0, false, false, false, 8387187860555, false, [
  16574. [4, 21]
  16575. ]],
  16576. [47, cr.plugins_.Sprite.prototype.cnds.CompareWidth, null, 0, false, false, false, 6465583165187032, false, [
  16577. [8, 5],
  16578. [0, [7, [20, 21, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16579. [0, 4]
  16580. ]]
  16581. ]]
  16582. ],
  16583. [
  16584. [21, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8740781175105327, false],
  16585. [21, cr.plugins_.Sprite.prototype.acts.Spawn, null, 0x7b5b732771155, false, [
  16586. [4, 17],
  16587. [5, [0, 1]],
  16588. [7, [0, 0]]
  16589. ]],
  16590. [17, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 7716282529865578, false, [
  16591. [3, 0],
  16592. [0, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null]]
  16593. ]],
  16594. [17, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 0x4455392c97ebc, false, [
  16595. [0, [4, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16596. [0, 90]
  16597. ]]
  16598. ]],
  16599. [17, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 6097912708635622, false, [
  16600. [0, [5, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16601. [0, 90]
  16602. ]]
  16603. ]],
  16604. [21, cr.plugins_.Sprite.prototype.acts.Spawn, null, 0xe59876b2d6c09, false, [
  16605. [4, 17],
  16606. [5, [0, 1]],
  16607. [7, [0, 0]]
  16608. ]],
  16609. [17, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 6832124705304942, false, [
  16610. [3, 0],
  16611. [0, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null]]
  16612. ]],
  16613. [17, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 9353905332356404, false, [
  16614. [0, [5, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16615. [0, 90]
  16616. ]]
  16617. ]],
  16618. [17, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 655893297677597, false, [
  16619. [0, [4, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16620. [0, 90]
  16621. ]]
  16622. ]],
  16623. [21, cr.plugins_.Sprite.prototype.acts.Spawn, null, 4861522999075538, false, [
  16624. [4, 46],
  16625. [5, [0, 0]],
  16626. [7, [0, 0]]
  16627. ]],
  16628. [46, cr.plugins_.Sprite.prototype.acts.SetSize, null, 7945951529558972, false, [
  16629. [0, [6, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16630. [0, 2]
  16631. ]],
  16632. [0, [6, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16633. [0, 2]
  16634. ]]
  16635. ]],
  16636. [-1, cr.system_object.prototype.acts.AddVar, null, 0x60c1c0c04494c, false, [
  16637. [11, "Candies_Amount"],
  16638. [7, [0, 1]]
  16639. ]],
  16640. [21, cr.plugins_.Sprite.prototype.acts.Spawn, null, 6820504629535748, false, [
  16641. [4, 33],
  16642. [5, [0, 2]],
  16643. [7, [0, 0]]
  16644. ]],
  16645. [-1, cr.system_object.prototype.acts.AddVar, null, 6391725048986914, false, [
  16646. [11, "Score"],
  16647. [7, [0, 30]]
  16648. ]],
  16649. [-1, cr.system_object.prototype.acts.AddVar, null, 8092292425733989, false, [
  16650. [11, "CuttedAtRaw"],
  16651. [7, [0, 1]]
  16652. ]]
  16653. ],
  16654. [
  16655. [0, null, false, null, 0x656e5ea9c491e, [
  16656. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 8776229217417637, false, [
  16657. [11, "LANG"],
  16658. [8, 0],
  16659. [7, [2, "es"]]
  16660. ]]
  16661. ],
  16662. [
  16663. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 5235158398981018, false, [
  16664. [7, [10, [2, "PUNTAJE:"],
  16665. [23, "Score"]
  16666. ]]
  16667. ]]
  16668. ]
  16669. ],
  16670. [0, null, false, null, 7623042934416609, [
  16671. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0x7d22b8aa96b76, false]
  16672. ],
  16673. [
  16674. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 4674972780462739, false, [
  16675. [7, [10, [2, " "],
  16676. [23, "Score"]
  16677. ]]
  16678. ]]
  16679. ]
  16680. ]
  16681. ]
  16682. ],
  16683. [0, null, false, null, 8347401128079996, [
  16684. [47, cr.plugins_.Sprite.prototype.cnds.IsOverlapping, null, 0, false, false, false, 8047327168135777, false, [
  16685. [4, 20]
  16686. ]],
  16687. [47, cr.plugins_.Sprite.prototype.cnds.CompareWidth, null, 0, false, false, false, 8683133686858099, false, [
  16688. [8, 5],
  16689. [0, [7, [20, 20, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16690. [0, 4]
  16691. ]]
  16692. ]]
  16693. ],
  16694. [
  16695. [20, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8680693240130441, false],
  16696. [20, cr.plugins_.Sprite.prototype.acts.Spawn, null, 4760268332244369, false, [
  16697. [4, 19],
  16698. [5, [0, 1]],
  16699. [7, [0, 0]]
  16700. ]],
  16701. [19, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 4743491573804287, false, [
  16702. [3, 0],
  16703. [0, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null]]
  16704. ]],
  16705. [19, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 0x599569b6961d8, false, [
  16706. [0, [4, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16707. [0, 90]
  16708. ]]
  16709. ]],
  16710. [19, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 0xd53e657831756, false, [
  16711. [0, [5, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16712. [0, 90]
  16713. ]]
  16714. ]],
  16715. [20, cr.plugins_.Sprite.prototype.acts.Spawn, null, 0xbae7328698244, false, [
  16716. [4, 19],
  16717. [5, [0, 1]],
  16718. [7, [0, 0]]
  16719. ]],
  16720. [19, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 0x96693ee8ce256, false, [
  16721. [3, 0],
  16722. [0, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null]]
  16723. ]],
  16724. [19, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 748726927692113, false, [
  16725. [0, [5, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16726. [0, 90]
  16727. ]]
  16728. ]],
  16729. [19, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 5717916157626853, false, [
  16730. [0, [4, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16731. [0, 90]
  16732. ]]
  16733. ]],
  16734. [20, cr.plugins_.Sprite.prototype.acts.Spawn, null, 0x9eb809d1b0372, false, [
  16735. [4, 46],
  16736. [5, [0, 0]],
  16737. [7, [0, 0]]
  16738. ]],
  16739. [46, cr.plugins_.Sprite.prototype.acts.SetSize, null, 0xbdbef0781a99f, false, [
  16740. [0, [6, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16741. [0, 2]
  16742. ]],
  16743. [0, [6, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16744. [0, 2]
  16745. ]]
  16746. ]],
  16747. [-1, cr.system_object.prototype.acts.AddVar, null, 7213889005725447, false, [
  16748. [11, "Candies_Amount"],
  16749. [7, [0, 1]]
  16750. ]],
  16751. [20, cr.plugins_.Sprite.prototype.acts.Spawn, null, 0xd9eabb92ea42a, false, [
  16752. [4, 36],
  16753. [5, [0, 2]],
  16754. [7, [0, 0]]
  16755. ]],
  16756. [-1, cr.system_object.prototype.acts.AddVar, null, 8082879853677376, false, [
  16757. [11, "Score"],
  16758. [7, [0, 50]]
  16759. ]],
  16760. [-1, cr.system_object.prototype.acts.AddVar, null, 9071133409929528, false, [
  16761. [11, "CuttedAtRaw"],
  16762. [7, [0, 1]]
  16763. ]]
  16764. ],
  16765. [
  16766. [0, null, false, null, 0x82e9f8b924f34, [
  16767. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 7443089340077125, false, [
  16768. [11, "LANG"],
  16769. [8, 0],
  16770. [7, [2, "es"]]
  16771. ]]
  16772. ],
  16773. [
  16774. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 8046492840883409, false, [
  16775. [7, [10, [2, "PUNTAJE:"],
  16776. [23, "Score"]
  16777. ]]
  16778. ]]
  16779. ]
  16780. ],
  16781. [0, null, false, null, 0xdc7dcd0364aaf, [
  16782. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 653394628917152, false]
  16783. ],
  16784. [
  16785. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0xfcec6a86954cd, false, [
  16786. [7, [10, [2, " "],
  16787. [23, "Score"]
  16788. ]]
  16789. ]]
  16790. ]
  16791. ]
  16792. ]
  16793. ]
  16794. ]
  16795. ],
  16796. [0, null, true, null, 6080818693841965, [
  16797. [29, cr.plugins_.Mouse.prototype.cnds.OnRelease, null, 1, false, false, false, 8559412079228267, false, [
  16798. [3, 0]
  16799. ]],
  16800. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x69fecdcec424f, false, [
  16801. [11, "ElapsedSinceLastCut"],
  16802. [8, 4],
  16803. [7, [0, 20]]
  16804. ]],
  16805. [30, cr.plugins_.Touch.prototype.cnds.OnTouchEnd, null, 1, false, false, false, 0xb1512f14ad3e7, false]
  16806. ],
  16807. [],
  16808. [
  16809. [0, null, false, null, 8541465445627343, [
  16810. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6214401596773964, false, [
  16811. [11, "CuttedAtRaw"],
  16812. [8, 4],
  16813. [7, [0, 2]]
  16814. ]]
  16815. ],
  16816. [
  16817. [62, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x682f8da6353e5, false]
  16818. ],
  16819. [
  16820. [0, null, false, null, 5823350887302462, [
  16821. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xa306bfdf6a10f, false, [
  16822. [11, "CuttedAtRaw"],
  16823. [8, 0],
  16824. [7, [0, 3]]
  16825. ]]
  16826. ],
  16827. [
  16828. [-1, cr.system_object.prototype.acts.CreateObject, null, 8185334619146284, false, [
  16829. [4, 34],
  16830. [5, [0, 2]],
  16831. [0, [7, [19, cr.system_object.prototype.exps.layoutwidth],
  16832. [0, 2]
  16833. ]],
  16834. [0, [7, [19, cr.system_object.prototype.exps.layoutheight],
  16835. [0, 2]
  16836. ]]
  16837. ]],
  16838. [-1, cr.system_object.prototype.acts.AddVar, null, 0xe1b63cc417118, false, [
  16839. [11, "Score"],
  16840. [7, [0, 30]]
  16841. ]],
  16842. [-1, cr.system_object.prototype.acts.SetVar, null, 7938495860764223, false, [
  16843. [11, "ElapsedSinceLastCut"],
  16844. [7, [0, 0]]
  16845. ]],
  16846. [-1, cr.system_object.prototype.acts.SetVar, null, 6413250676086552, false, [
  16847. [11, "MouseBeenReleaseSinceLastCut"],
  16848. [7, [0, 0]]
  16849. ]],
  16850. [-1, cr.system_object.prototype.acts.SetVar, null, 651350986694386, false, [
  16851. [11, "CuttedAtRaw"],
  16852. [7, [0, 0]]
  16853. ]]
  16854. ],
  16855. [
  16856. [0, null, false, null, 5783763481490649, [
  16857. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xd9bdfb9872679, false, [
  16858. [11, "LANG"],
  16859. [8, 0],
  16860. [7, [2, "en"]]
  16861. ]]
  16862. ],
  16863. [
  16864. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 8824638699154988, false, [
  16865. [7, [10, [2, " "],
  16866. [23, "Score"]
  16867. ]]
  16868. ]]
  16869. ]
  16870. ],
  16871. [0, null, false, null, 7601738940358797, [
  16872. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 982470320388523, false]
  16873. ],
  16874. [
  16875. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 8647667191187012, false, [
  16876. [7, [10, [2, "PUNTAJE:"],
  16877. [23, "Score"]
  16878. ]]
  16879. ]]
  16880. ]
  16881. ]
  16882. ]
  16883. ],
  16884. [0, null, false, null, 6592376484444267, [
  16885. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6732178774229566, false, [
  16886. [11, "CuttedAtRaw"],
  16887. [8, 0],
  16888. [7, [0, 4]]
  16889. ]]
  16890. ],
  16891. [
  16892. [-1, cr.system_object.prototype.acts.CreateObject, null, 7439393669589158, false, [
  16893. [4, 35],
  16894. [5, [0, 2]],
  16895. [0, [7, [19, cr.system_object.prototype.exps.layoutwidth],
  16896. [0, 2]
  16897. ]],
  16898. [0, [7, [19, cr.system_object.prototype.exps.layoutheight],
  16899. [0, 2]
  16900. ]]
  16901. ]],
  16902. [-1, cr.system_object.prototype.acts.AddVar, null, 6693895834208048, false, [
  16903. [11, "Score"],
  16904. [7, [0, 40]]
  16905. ]],
  16906. [-1, cr.system_object.prototype.acts.SetVar, null, 0xd2cac4c9ea498, false, [
  16907. [11, "ElapsedSinceLastCut"],
  16908. [7, [0, 0]]
  16909. ]],
  16910. [-1, cr.system_object.prototype.acts.SetVar, null, 9678049925105540, false, [
  16911. [11, "MouseBeenReleaseSinceLastCut"],
  16912. [7, [0, 0]]
  16913. ]],
  16914. [-1, cr.system_object.prototype.acts.SetVar, null, 9592563698270784, false, [
  16915. [11, "CuttedAtRaw"],
  16916. [7, [0, 0]]
  16917. ]]
  16918. ],
  16919. [
  16920. [0, null, false, null, 7322803436282442, [
  16921. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xb5ed4f3da71ce, false, [
  16922. [11, "LANG"],
  16923. [8, 0],
  16924. [7, [2, "es"]]
  16925. ]]
  16926. ],
  16927. [
  16928. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 9857038563030242, false, [
  16929. [7, [10, [2, "PUNTAJE:"],
  16930. [23, "Score"]
  16931. ]]
  16932. ]]
  16933. ]
  16934. ],
  16935. [0, null, false, null, 8423693208518711, [
  16936. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0xc24726e804d5f, false]
  16937. ],
  16938. [
  16939. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0x662d43b359b04, false, [
  16940. [7, [10, [2, " "],
  16941. [23, "Score"]
  16942. ]]
  16943. ]]
  16944. ]
  16945. ]
  16946. ]
  16947. ],
  16948. [0, null, false, null, 0xc00ba24708f20, [
  16949. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 8672819983754613, false, [
  16950. [11, "CuttedAtRaw"],
  16951. [8, 0],
  16952. [7, [0, 5]]
  16953. ]]
  16954. ],
  16955. [
  16956. [-1, cr.system_object.prototype.acts.CreateObject, null, 4509619447018252, false, [
  16957. [4, 37],
  16958. [5, [0, 2]],
  16959. [0, [7, [19, cr.system_object.prototype.exps.layoutwidth],
  16960. [0, 2]
  16961. ]],
  16962. [0, [7, [19, cr.system_object.prototype.exps.layoutheight],
  16963. [0, 2]
  16964. ]]
  16965. ]],
  16966. [-1, cr.system_object.prototype.acts.AddVar, null, 4507112079150583, false, [
  16967. [11, "Score"],
  16968. [7, [0, 50]]
  16969. ]],
  16970. [-1, cr.system_object.prototype.acts.SetVar, null, 8862729295659629, false, [
  16971. [11, "ElapsedSinceLastCut"],
  16972. [7, [0, 0]]
  16973. ]],
  16974. [-1, cr.system_object.prototype.acts.SetVar, null, 6853232246662692, false, [
  16975. [11, "MouseBeenReleaseSinceLastCut"],
  16976. [7, [0, 0]]
  16977. ]],
  16978. [-1, cr.system_object.prototype.acts.SetVar, null, 7929038798878766, false, [
  16979. [11, "CuttedAtRaw"],
  16980. [7, [0, 0]]
  16981. ]]
  16982. ],
  16983. [
  16984. [0, null, false, null, 0xad67364b186c4, [
  16985. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 7527985602434372, false, [
  16986. [11, "LANG"],
  16987. [8, 0],
  16988. [7, [2, "en"]]
  16989. ]]
  16990. ],
  16991. [
  16992. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 7948289187562602, false, [
  16993. [7, [10, [2, " "],
  16994. [23, "Score"]
  16995. ]]
  16996. ]]
  16997. ]
  16998. ],
  16999. [0, null, false, null, 0x4be1d28d8e97a, [
  17000. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 6470691792682331, false]
  17001. ],
  17002. [
  17003. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 4852314307202568, false, [
  17004. [7, [10, [2, "PUNTAJE:"],
  17005. [23, "Score"]
  17006. ]]
  17007. ]]
  17008. ]
  17009. ]
  17010. ]
  17011. ],
  17012. [0, null, false, null, 8346247803789636, [
  17013. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9610429944826140, false, [
  17014. [11, "CuttedAtRaw"],
  17015. [8, 4],
  17016. [7, [0, 5]]
  17017. ]]
  17018. ],
  17019. [
  17020. [-1, cr.system_object.prototype.acts.CreateObject, null, 429899012368231, false, [
  17021. [4, 39],
  17022. [5, [0, 2]],
  17023. [0, [7, [19, cr.system_object.prototype.exps.layoutwidth],
  17024. [0, 2]
  17025. ]],
  17026. [0, [7, [19, cr.system_object.prototype.exps.layoutheight],
  17027. [0, 2]
  17028. ]]
  17029. ]],
  17030. [-1, cr.system_object.prototype.acts.AddVar, null, 0xd2df8bd901517, false, [
  17031. [11, "Score"],
  17032. [7, [0, 100]]
  17033. ]],
  17034. [-1, cr.system_object.prototype.acts.SetVar, null, 6585280724333992, false, [
  17035. [11, "ElapsedSinceLastCut"],
  17036. [7, [0, 0]]
  17037. ]],
  17038. [-1, cr.system_object.prototype.acts.SetVar, null, 9403566578144688, false, [
  17039. [11, "MouseBeenReleaseSinceLastCut"],
  17040. [7, [0, 0]]
  17041. ]],
  17042. [-1, cr.system_object.prototype.acts.SetVar, null, 7774165251762663, false, [
  17043. [11, "CuttedAtRaw"],
  17044. [7, [0, 0]]
  17045. ]]
  17046. ],
  17047. [
  17048. [0, null, false, null, 0xc27c57a329642, [
  17049. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x646145cabe652, false, [
  17050. [11, "LANG"],
  17051. [8, 0],
  17052. [7, [2, "es"]]
  17053. ]]
  17054. ],
  17055. [
  17056. [39, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 4937860509171779, false, [
  17057. [0, [0, 1]]
  17058. ]],
  17059. [39, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 7979733321069636, false],
  17060. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 732317037949513, false, [
  17061. [7, [10, [2, "PUNTAJE:"],
  17062. [23, "Score"]
  17063. ]]
  17064. ]]
  17065. ]
  17066. ],
  17067. [0, null, false, null, 4884380804361563, [
  17068. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0xba1897acddcec, false]
  17069. ],
  17070. [
  17071. [39, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 324537398061168, false, [
  17072. [0, [0, 0]]
  17073. ]],
  17074. [39, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 9575381994614832, false],
  17075. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 6157889859035316, false, [
  17076. [7, [10, [2, " "],
  17077. [23, "Score"]
  17078. ]]
  17079. ]]
  17080. ]
  17081. ]
  17082. ]
  17083. ]
  17084. ]
  17085. ],
  17086. [0, null, false, null, 0xc1f6847ffa2dd, [
  17087. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0xb90065674559f, false]
  17088. ],
  17089. [
  17090. [-1, cr.system_object.prototype.acts.SetVar, null, 8422628010004437, false, [
  17091. [11, "ElapsedSinceLastCut"],
  17092. [7, [0, 0]]
  17093. ]],
  17094. [-1, cr.system_object.prototype.acts.SetVar, null, 0xf435aaf56f5e1, false, [
  17095. [11, "MouseBeenReleaseSinceLastCut"],
  17096. [7, [0, 0]]
  17097. ]],
  17098. [-1, cr.system_object.prototype.acts.SetVar, null, 0xcce45ae8208ab, false, [
  17099. [11, "CuttedAtRaw"],
  17100. [7, [0, 0]]
  17101. ]]
  17102. ]
  17103. ]
  17104. ]
  17105. ],
  17106. [0, null, false, null, 5996463625238656, [
  17107. [47, cr.plugins_.Sprite.prototype.cnds.IsOverlapping, null, 0, false, false, false, 5076735141738713, false, [
  17108. [4, 57]
  17109. ]],
  17110. [47, cr.plugins_.Sprite.prototype.cnds.CompareWidth, null, 0, false, false, false, 8587842304227216, false, [
  17111. [8, 5],
  17112. [0, [7, [20, 57, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  17113. [0, 2]
  17114. ]]
  17115. ]],
  17116. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x4ddbc681ed606, false, [
  17117. [11, "GameIsPaused"],
  17118. [8, 1],
  17119. [7, [0, 1]]
  17120. ]],
  17121. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xef36194daf63d, false, [
  17122. [11, "SlomoIsActive"],
  17123. [8, 1],
  17124. [7, [0, 1]]
  17125. ]]
  17126. ],
  17127. [
  17128. [57, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x60c8d47c05b69, false],
  17129. [57, cr.plugins_.Sprite.prototype.acts.Spawn, null, 6118527316936416, false, [
  17130. [4, 16],
  17131. [5, [0, 1]],
  17132. [7, [0, 0]]
  17133. ]],
  17134. [16, cr.plugins_.Sprite.prototype.acts.SetAnimSpeed, null, 0x5f9225d34f73e, false, [
  17135. [0, [0, 25]]
  17136. ]],
  17137. [16, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 7876454773903579, false, [
  17138. [0, [19, cr.system_object.prototype.exps.random, [
  17139. [0, 360]
  17140. ]]]
  17141. ]],
  17142. [-1, cr.system_object.prototype.acts.SubVar, null, 8287667579560846, false, [
  17143. [11, "Lives"],
  17144. [7, [0, 1]]
  17145. ]]
  17146. ],
  17147. [
  17148. [0, null, false, null, 6468099111072039, [
  17149. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xe55c48c0f1bc2, false, [
  17150. [11, "Lives"],
  17151. [8, 5],
  17152. [7, [0, 0]]
  17153. ]]
  17154. ],
  17155. [
  17156. [28, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 7215508842746293, false, [
  17157. [0, [23, "Lives"]]
  17158. ]]
  17159. ]
  17160. ]
  17161. ]
  17162. ],
  17163. [0, null, false, null, 7201721173609944, [
  17164. [47, cr.plugins_.Sprite.prototype.cnds.IsOverlapping, null, 0, false, false, false, 0xf6d48615a1558, false, [
  17165. [4, 23]
  17166. ]],
  17167. [47, cr.plugins_.Sprite.prototype.cnds.CompareWidth, null, 0, false, false, false, 0x9ead38af89c50, false, [
  17168. [8, 5],
  17169. [0, [7, [20, 23, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  17170. [0, 8]
  17171. ]]
  17172. ]],
  17173. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6920352977967678, false, [
  17174. [11, "GameIsPaused"],
  17175. [8, 1],
  17176. [7, [0, 1]]
  17177. ]],
  17178. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xe78f6b43a6cb1, false, [
  17179. [11, "SlomoIsActive"],
  17180. [8, 1],
  17181. [7, [0, 1]]
  17182. ]]
  17183. ],
  17184. [
  17185. [23, cr.plugins_.Sprite.prototype.acts.Destroy, null, 6752963549167137, false],
  17186. [23, cr.plugins_.Sprite.prototype.acts.Spawn, null, 5822288710094212, false, [
  17187. [4, 24],
  17188. [5, [0, 1]],
  17189. [7, [0, 0]]
  17190. ]],
  17191. [24, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "LiteTween", 0x44c5dfb3ee368, false, [
  17192. [3, 0]
  17193. ]],
  17194. [24, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "LiteTween2", 7686337962420552, false, [
  17195. [3, 0]
  17196. ]],
  17197. [24, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "LiteTween3", 4752632369457006, false, [
  17198. [3, 0]
  17199. ]],
  17200. [-1, cr.system_object.prototype.acts.Wait, null, 0x8d24629049b8d, false, [
  17201. [0, [0, 2]]
  17202. ]],
  17203. [24, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x444557911b7d0, false]
  17204. ],
  17205. [
  17206. [0, null, false, null, 8625413571961103, [
  17207. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x3a33b8c04ee74, false, [
  17208. [11, "Lives"],
  17209. [8, 2],
  17210. [7, [0, 2]]
  17211. ]]
  17212. ],
  17213. [
  17214. [-1, cr.system_object.prototype.acts.AddVar, null, 0x3f1bb01f2e2a5, false, [
  17215. [11, "Lives"],
  17216. [7, [0, 1]]
  17217. ]],
  17218. [28, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 593744193509825, false, [
  17219. [0, [23, "Lives"]]
  17220. ]]
  17221. ]
  17222. ]
  17223. ]
  17224. ],
  17225. [0, null, false, null, 0xc6cb788876ff7, [
  17226. [47, cr.plugins_.Sprite.prototype.cnds.IsOverlapping, null, 0, false, false, false, 0x7df24d4ea8326, false, [
  17227. [4, 25]
  17228. ]],
  17229. [47, cr.plugins_.Sprite.prototype.cnds.CompareWidth, null, 0, false, false, false, 0x8522d57f4fa1d, false, [
  17230. [8, 5],
  17231. [0, [7, [20, 25, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  17232. [0, 8]
  17233. ]]
  17234. ]],
  17235. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x7ddaf0a0fcc5d, false, [
  17236. [11, "GameIsPaused"],
  17237. [8, 1],
  17238. [7, [0, 1]]
  17239. ]],
  17240. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9945201697037760, false, [
  17241. [11, "SlomoIsActive"],
  17242. [8, 1],
  17243. [7, [0, 1]]
  17244. ]]
  17245. ],
  17246. [
  17247. [25, cr.plugins_.Sprite.prototype.acts.Destroy, null, 6513491906588931, false],
  17248. [25, cr.plugins_.Sprite.prototype.acts.Spawn, null, 0x5c23e9072719d, false, [
  17249. [4, 26],
  17250. [5, [0, 1]],
  17251. [7, [0, 0]]
  17252. ]]
  17253. ],
  17254. [
  17255. [0, null, false, null, 0xa03e3287503a1, [
  17256. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 4873055029171698, false, [
  17257. [11, "CandyFontainIsActive"],
  17258. [8, 0],
  17259. [7, [0, 0]]
  17260. ]]
  17261. ],
  17262. [
  17263. [-1, cr.system_object.prototype.acts.SetVar, null, 6591445576310618, false, [
  17264. [11, "CandyFontainIsActive"],
  17265. [7, [0, 1]]
  17266. ]],
  17267. [-1, cr.system_object.prototype.acts.SetVar, null, 5772371554525446, false, [
  17268. [11, "SpawnCandiesTime"],
  17269. [7, [1, .1]]
  17270. ]],
  17271. [-1, cr.system_object.prototype.acts.SetVar, null, 523126012320112, false, [
  17272. [11, "SpawnCandiesTimeRandOffset"],
  17273. [7, [1, .1]]
  17274. ]],
  17275. [62, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8271809591340191, false],
  17276. [-1, cr.system_object.prototype.acts.CreateObject, null, 0xe7bb7906ea6f4, false, [
  17277. [4, 38],
  17278. [5, [0, 2]],
  17279. [0, [7, [19, cr.system_object.prototype.exps.layoutwidth],
  17280. [0, 2]
  17281. ]],
  17282. [0, [7, [19, cr.system_object.prototype.exps.layoutheight],
  17283. [0, 2]
  17284. ]]
  17285. ]]
  17286. ]
  17287. ]
  17288. ]
  17289. ],
  17290. [0, null, true, null, 6405825839671163, [
  17291. [29, cr.plugins_.Mouse.prototype.cnds.OnRelease, null, 1, false, false, false, 5976957914350759, false, [
  17292. [3, 0]
  17293. ]],
  17294. [30, cr.plugins_.Touch.prototype.cnds.OnTouchEnd, null, 1, false, false, false, 0xee3fe5c86fdc2, false]
  17295. ],
  17296. [
  17297. [-1, cr.system_object.prototype.acts.SetVar, null, 7532124217750597, false, [
  17298. [11, "MouseBeenReleaseSinceLastCut"],
  17299. [7, [0, 1]]
  17300. ]]
  17301. ]
  17302. ],
  17303. [0, null, false, null, 6496833290878127, [
  17304. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 8281996591910145, false, [
  17305. [11, "GameIsPaused"],
  17306. [8, 0],
  17307. [7, [0, 1]]
  17308. ]]
  17309. ],
  17310. [],
  17311. [
  17312. [0, null, true, null, 7927639622173751, [
  17313. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 40279358929321, false, [
  17314. [3, 0],
  17315. [3, 0],
  17316. [4, 5]
  17317. ]],
  17318. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 0x8035e11a82d75, false, [
  17319. [4, 5]
  17320. ]]
  17321. ],
  17322. [],
  17323. [
  17324. [0, null, false, null, 6384338523563332, [
  17325. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9281946248044072, false, [
  17326. [11, "BestScore"],
  17327. [8, 2],
  17328. [7, [23, "Score"]]
  17329. ]]
  17330. ],
  17331. [
  17332. [-1, cr.system_object.prototype.acts.SetVar, null, 0x8682413edc4f, false, [
  17333. [11, "BestScore"],
  17334. [7, [23, "Score"]]
  17335. ]]
  17336. ]
  17337. ]
  17338. ]
  17339. ],
  17340. [0, null, true, null, 9523724846481996, [
  17341. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 6292997461636642, false, [
  17342. [3, 0],
  17343. [3, 0],
  17344. [4, 5]
  17345. ]],
  17346. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 0xef05f1ae2e4fe, false, [
  17347. [4, 5]
  17348. ]]
  17349. ],
  17350. [
  17351. [-1, cr.system_object.prototype.acts.SetVar, null, 0xbf103ad2df4cb, false, [
  17352. [11, "GameIsPaused"],
  17353. [7, [0, 0]]
  17354. ]],
  17355. [-1, cr.system_object.prototype.acts.SetVar, null, 6787210906365316, false, [
  17356. [11, "MouseBeenReleaseSinceLastCut"],
  17357. [7, [0, 0]]
  17358. ]],
  17359. [-1, cr.system_object.prototype.acts.SetVar, null, 8910326485546273, false, [
  17360. [11, "Candies_Amount"],
  17361. [7, [0, 0]]
  17362. ]],
  17363. [-1, cr.system_object.prototype.acts.SetVar, null, 0x7649de7d14f4d, false, [
  17364. [11, "Score"],
  17365. [7, [0, 0]]
  17366. ]],
  17367. [-1, cr.system_object.prototype.acts.SetVar, null, 0xf7b060f78bc10, false, [
  17368. [11, "CandyFontainIsActive"],
  17369. [7, [0, 0]]
  17370. ]],
  17371. [-1, cr.system_object.prototype.acts.SetVar, null, 7548294045840928, false, [
  17372. [11, "CandyFontainIsActiveFor"],
  17373. [7, [0, 0]]
  17374. ]],
  17375. [-1, cr.system_object.prototype.acts.SetTimescale, null, 0xc0072b51b1925, false, [
  17376. [0, [1, 1]]
  17377. ]],
  17378. [-1, cr.system_object.prototype.acts.SetVar, null, 0x939d704501820, false, [
  17379. [11, "SlomoIsActive"],
  17380. [7, [0, 0]]
  17381. ]],
  17382. [-1, cr.system_object.prototype.acts.SetVar, null, 0xbc70244981c30, false, [
  17383. [11, "BombsSpawnDelayDone"],
  17384. [7, [0, 0]]
  17385. ]],
  17386. [-1, cr.system_object.prototype.acts.SetVar, null, 589896454099903, false, [
  17387. [11, "Lives"],
  17388. [7, [0, 2]]
  17389. ]],
  17390. [27, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 7617541839998137, false, [
  17391. [3, 1]
  17392. ]],
  17393. [2, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 0x4519bea6bdd22, false, [
  17394. [3, 1]
  17395. ]],
  17396. [28, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 7339303735138867, false, [
  17397. [3, 1]
  17398. ]],
  17399. [28, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 0xc0961985810cb, false, [
  17400. [0, [23, "Lives"]]
  17401. ]],
  17402. [3, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8338095477456938, false],
  17403. [5, cr.plugins_.Sprite.prototype.acts.Destroy, null, 9201003743690204, false],
  17404. [4, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8547764379099402, false],
  17405. [47, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8088803127723427, false],
  17406. [46, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x8c6e46fc97c3, false],
  17407. [56, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x8fdf0d63a2325, false],
  17408. [61, cr.plugins_.Sprite.prototype.acts.Destroy, null, 878084447261485, false],
  17409. [24, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0xc4c53d87c05d1, false],
  17410. [26, cr.plugins_.Particles.prototype.acts.Destroy, null, 624576331633458, false],
  17411. [10, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0xf263599d38360, false],
  17412. [12, cr.plugins_.Sprite.prototype.acts.Destroy, null, 6288097401018803, false],
  17413. [53, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 0x60fbb2167829f, false, [
  17414. [3, 1]
  17415. ]],
  17416. [52, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 6667596144226839, false, [
  17417. [3, 1]
  17418. ]],
  17419. [50, cr.plugins_.Spritefont2.prototype.acts.Destroy, null, 0xbc23124ad163a, false],
  17420. [51, cr.plugins_.Spritefont2.prototype.acts.Destroy, null, 0xbd993175b213e, false],
  17421. [-1, cr.system_object.prototype.acts.CreateObject, null, 5701083006875338, false, [
  17422. [4, 13],
  17423. [5, [0, 4]],
  17424. [0, [0, 0]],
  17425. [0, [0, 0]]
  17426. ]],
  17427. [13, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 0xee980366afa42, false, [
  17428. [0, [0, 0]]
  17429. ]],
  17430. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "start", 0xb95bf93d25f2d, false, [
  17431. [3, 0]
  17432. ]],
  17433. [-1, cr.system_object.prototype.acts.Wait, null, 8000820260313573, false, [
  17434. [0, [1, .3]]
  17435. ]]
  17436. ],
  17437. [
  17438. [0, null, false, null, 0xfa1cedce8d596, [
  17439. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5859308351895978, false, [
  17440. [11, "LANG"],
  17441. [8, 0],
  17442. [7, [2, "es"]]
  17443. ]]
  17444. ],
  17445. [
  17446. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 8214875765164281, false, [
  17447. [7, [10, [2, "PUNTAJE:"],
  17448. [23, "Score"]
  17449. ]]
  17450. ]],
  17451. [52, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0xd78a0053c5b15, false, [
  17452. [7, [10, [2, "MEJOR:"],
  17453. [23, "BestScore"]
  17454. ]]
  17455. ]]
  17456. ]
  17457. ],
  17458. [0, null, false, null, 0x9dda64ac71772, [
  17459. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0x86e7146735ad7, false]
  17460. ],
  17461. [
  17462. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0xbae54832ad041, false, [
  17463. [7, [10, [2, " "],
  17464. [23, "Score"]
  17465. ]]
  17466. ]],
  17467. [52, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0x42db38a887190, false, [
  17468. [7, [10, [2, "BEST:"],
  17469. [23, "BestScore"]
  17470. ]]
  17471. ]]
  17472. ]
  17473. ],
  17474. [0, null, false, null, 0xb6112c93880df, [],
  17475. [
  17476. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "stop", 0xd58a4470ccd6, false, [
  17477. [3, 0]
  17478. ]],
  17479. [-1, cr.system_object.prototype.acts.Wait, null, 6390269172949222, false, [
  17480. [0, [1, .3]]
  17481. ]],
  17482. [13, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8924053971660529, false]
  17483. ]
  17484. ]
  17485. ]
  17486. ]
  17487. ]
  17488. ],
  17489. [0, null, false, null, 0x9b980fac4198, [
  17490. [56, cr.plugins_.Sprite.prototype.cnds.CompareY, null, 0, false, false, false, 0x46ddeb6f2b297, false, [
  17491. [8, 4],
  17492. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  17493. [6, [20, 56, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  17494. [0, 3]
  17495. ]
  17496. ]]
  17497. ]]
  17498. ],
  17499. [
  17500. [56, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x8b6ee4432fba0, false]
  17501. ]
  17502. ],
  17503. [0, null, false, null, 5003848556370103, [
  17504. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 541729022589367, false, [
  17505. [11, "Lives"],
  17506. [8, 2],
  17507. [7, [0, 0]]
  17508. ]],
  17509. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x84366732b8a5e, false, [
  17510. [11, "GameIsPaused"],
  17511. [8, 0],
  17512. [7, [0, 0]]
  17513. ]],
  17514. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5052450517383688, false, [
  17515. [11, "SlomoIsActive"],
  17516. [8, 0],
  17517. [7, [0, 0]]
  17518. ]]
  17519. ],
  17520. [
  17521. [55, cr.plugins_.Browser.prototype.acts.ExecJs, null, 8773714266864497, false, [
  17522. [1, [2, "window.c2_level = 0"]]
  17523. ]],
  17524. [55, cr.plugins_.Browser.prototype.acts.ExecJs, null, 522830245742878, false, [
  17525. [1, [10, [10, [2, "window.c2_score="],
  17526. [23, "Score"]
  17527. ],
  17528. [2, ""]
  17529. ]]
  17530. ]],
  17531. [48, cr.plugins_.Softgames.prototype.acts.gameOver, null, 5110249338674038, false],
  17532. [28, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 6011242799732131, false, [
  17533. [3, 0]
  17534. ]],
  17535. [-1, cr.system_object.prototype.acts.SetVar, null, 770605679585685, false, [
  17536. [11, "SlomoIsActive"],
  17537. [7, [0, 1]]
  17538. ]],
  17539. [-1, cr.system_object.prototype.acts.SetTimescale, null, 8824445748543782, false, [
  17540. [0, [1, .5]]
  17541. ]],
  17542. [-1, cr.system_object.prototype.acts.Wait, null, 0xdfa44b544ded8, false, [
  17543. [0, [0, 1]]
  17544. ]],
  17545. [-1, cr.system_object.prototype.acts.SetTimescale, null, 77428706961359, false, [
  17546. [0, [0, 1]]
  17547. ]],
  17548. [-1, cr.system_object.prototype.acts.Wait, null, 9698944552338880, false, [
  17549. [0, [0, 1]]
  17550. ]],
  17551. [-1, cr.system_object.prototype.acts.SetVar, null, 0xa9aaa52ece9ad, false, [
  17552. [11, "GameIsPaused"],
  17553. [7, [0, 1]]
  17554. ]],
  17555. [-1, cr.system_object.prototype.acts.SetVar, null, 4923768814490621, false, [
  17556. [11, "SlomoIsActive"],
  17557. [7, [0, 0]]
  17558. ]],
  17559. [-1, cr.system_object.prototype.acts.CreateObject, null, 0x4414cbeae3fb0, false, [
  17560. [4, 13],
  17561. [5, [0, 4]],
  17562. [0, [0, 0]],
  17563. [0, [0, 0]]
  17564. ]],
  17565. [13, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 8081687774340519, false, [
  17566. [0, [0, 0]]
  17567. ]],
  17568. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "start", 5987008171274848, false, [
  17569. [3, 0]
  17570. ]],
  17571. [-1, cr.system_object.prototype.acts.Wait, null, 760560107751624, false, [
  17572. [0, [1, .3]]
  17573. ]],
  17574. [61, cr.plugins_.Sprite.prototype.acts.Destroy, null, 9574951935332582, false],
  17575. [56, cr.plugins_.Sprite.prototype.acts.Destroy, null, 5807413108808871, false],
  17576. [24, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0xd5908c7088e70, false],
  17577. [26, cr.plugins_.Particles.prototype.acts.Destroy, null, 7739926647257792, false],
  17578. [27, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 0x760dc95ef98a1, false, [
  17579. [3, 0]
  17580. ]],
  17581. [2, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 9625648051935414, false, [
  17582. [3, 0]
  17583. ]],
  17584. [53, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 6990764514731954, false, [
  17585. [3, 0]
  17586. ]],
  17587. [52, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 516512452758876, false, [
  17588. [3, 0]
  17589. ]],
  17590. [-1, cr.system_object.prototype.acts.CreateObject, null, 0xb3fe4fc039ad7, false, [
  17591. [4, 12],
  17592. [5, [0, 3]],
  17593. [0, [0, 0]],
  17594. [0, [0, 0]]
  17595. ]],
  17596. [-1, cr.system_object.prototype.acts.CreateObject, null, 0xefc8035ddbe05, false, [
  17597. [4, 5],
  17598. [5, [0, 3]],
  17599. [0, [0, 252]],
  17600. [0, [0, 336]]
  17601. ]],
  17602. [-1, cr.system_object.prototype.acts.CreateObject, null, 4892400712814428, false, [
  17603. [4, 3],
  17604. [5, [0, 3]],
  17605. [0, [0, 64]],
  17606. [0, [0, 330]]
  17607. ]],
  17608. [-1, cr.system_object.prototype.acts.CreateObject, null, 488147896038764, false, [
  17609. [4, 50],
  17610. [5, [0, 3]],
  17611. [0, [0, 55]],
  17612. [0, [0, 180]]
  17613. ]],
  17614. [-1, cr.system_object.prototype.acts.CreateObject, null, 0x39c6c3e6e71a6, false, [
  17615. [4, 51],
  17616. [5, [0, 3]],
  17617. [0, [0, 55]],
  17618. [0, [0, 210]]
  17619. ]]
  17620. ],
  17621. [
  17622. [0, null, false, null, 0xf8de527d7d1ef, [
  17623. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9927545946162448, false, [
  17624. [11, "LANG"],
  17625. [8, 0],
  17626. [7, [2, "es"]]
  17627. ]]
  17628. ],
  17629. [
  17630. [12, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 0xa592cd4f0962d, false, [
  17631. [0, [0, 1]]
  17632. ]],
  17633. [12, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0xf99450206a83, false],
  17634. [51, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 5428449903552759, false, [
  17635. [7, [10, [2, "PUNTAJE:"],
  17636. [23, "Score"]
  17637. ]]
  17638. ]],
  17639. [50, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 4553457772996537, false, [
  17640. [7, [10, [2, "FRUTAS:"],
  17641. [23, "Candies_Amount"]
  17642. ]]
  17643. ]]
  17644. ]
  17645. ],
  17646. [0, null, false, null, 0xcfbc4a802ca82, [
  17647. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 7604775900745352, false]
  17648. ],
  17649. [
  17650. [12, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 9999898491917928, false, [
  17651. [0, [0, 0]]
  17652. ]],
  17653. [12, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 5587110823978502, false],
  17654. [51, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0x77ec3f5982e53, false, [
  17655. [7, [10, [2, " "],
  17656. [23, "Score"]
  17657. ]]
  17658. ]],
  17659. [50, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0xd3f4cb04019a, false, [
  17660. [7, [10, [2, " "],
  17661. [23, "Candies_Amount"]
  17662. ]]
  17663. ]]
  17664. ]
  17665. ],
  17666. [0, null, false, null, 8629838128974253, [],
  17667. [
  17668. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "stop", 0xba8c4f9e97977, false, [
  17669. [3, 0]
  17670. ]],
  17671. [-1, cr.system_object.prototype.acts.Wait, null, 0x7fac33d0e22b3, false, [
  17672. [0, [1, .3]]
  17673. ]],
  17674. [13, cr.plugins_.Sprite.prototype.acts.Destroy, null, 6848522201210278, false]
  17675. ]
  17676. ],
  17677. [0, null, false, null, 0x68438f5d3521d, [
  17678. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 8688892054803231, false, [
  17679. [11, "BestScore"],
  17680. [8, 2],
  17681. [7, [23, "Score"]]
  17682. ]]
  17683. ],
  17684. [
  17685. [-1, cr.system_object.prototype.acts.SetVar, null, 4678367891749245, false, [
  17686. [11, "BestScore"],
  17687. [7, [23, "Score"]]
  17688. ]],
  17689. [40, cr.plugins_.Text.prototype.acts.SetText, null, 0x96f97a098ceda, false, [
  17690. [7, [10, [2, "BEST:"],
  17691. [23, "BestScore"]
  17692. ]]
  17693. ]]
  17694. ]
  17695. ]
  17696. ]
  17697. ],
  17698. [0, null, false, null, 0xa865d71896731, [
  17699. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x662a6562ea833, false, [
  17700. [11, "CandyFontainIsActiveFor"],
  17701. [8, 4],
  17702. [7, [0, 180]]
  17703. ]]
  17704. ],
  17705. [
  17706. [-1, cr.system_object.prototype.acts.SetVar, null, 0xe9a5d8af191d7, false, [
  17707. [11, "CandyFontainIsActive"],
  17708. [7, [0, 0]]
  17709. ]],
  17710. [-1, cr.system_object.prototype.acts.SetVar, null, 0xd85c1436461d8, false, [
  17711. [11, "CandyFontainIsActiveFor"],
  17712. [7, [0, 0]]
  17713. ]],
  17714. [-1, cr.system_object.prototype.acts.SetVar, null, 6900889012332763, false, [
  17715. [11, "SpawnCandiesTime"],
  17716. [7, [1, .3]]
  17717. ]],
  17718. [-1, cr.system_object.prototype.acts.SetVar, null, 0xf22d14a307193, false, [
  17719. [11, "SpawnCandiesTimeRandOffset"],
  17720. [7, [1, .4]]
  17721. ]]
  17722. ]
  17723. ],
  17724. [0, null, true, null, 5487047525951067, [
  17725. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 9128310952291382, false, [
  17726. [3, 0],
  17727. [3, 0],
  17728. [4, 2]
  17729. ]],
  17730. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 0xa270138f2d55a, false, [
  17731. [4, 2]
  17732. ]]
  17733. ],
  17734. [],
  17735. [
  17736. [0, null, false, null, 0xfb7c71631c6d9, [
  17737. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xdd7fc44ca2ad9, false, [
  17738. [11, "GameIsPaused"],
  17739. [8, 1],
  17740. [7, [0, 1]]
  17741. ]],
  17742. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x3aa2178966b15, false, [
  17743. [11, "SlomoIsActive"],
  17744. [8, 1],
  17745. [7, [0, 1]]
  17746. ]]
  17747. ],
  17748. [
  17749. [47, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x7d9ec894bfa8b, false],
  17750. [-1, cr.system_object.prototype.acts.CreateObject, null, 0xc8b938a3652bf, false, [
  17751. [4, 10],
  17752. [5, [0, 3]],
  17753. [0, [0, 0]],
  17754. [0, [0, 0]]
  17755. ]],
  17756. [-1, cr.system_object.prototype.acts.CreateObject, null, 7883074365350581, false, [
  17757. [4, 4],
  17758. [5, [0, 3]],
  17759. [0, [0, 160]],
  17760. [0, [0, 320]]
  17761. ]],
  17762. [-1, cr.system_object.prototype.acts.CreateObject, null, 4866026574519771, false, [
  17763. [4, 5],
  17764. [5, [0, 3]],
  17765. [0, [0, 270]],
  17766. [0, [0, 320]]
  17767. ]],
  17768. [-1, cr.system_object.prototype.acts.CreateObject, null, 5595954281785923, false, [
  17769. [4, 3],
  17770. [5, [0, 3]],
  17771. [0, [0, 50]],
  17772. [0, [0, 312]]
  17773. ]],
  17774. [-1, cr.system_object.prototype.acts.SetVar, null, 9857380323209656, false, [
  17775. [11, "GameIsPaused"],
  17776. [7, [0, 1]]
  17777. ]],
  17778. [-1, cr.system_object.prototype.acts.SetTimescale, null, 0x4832ec4ecae73, false, [
  17779. [0, [0, 0]]
  17780. ]]
  17781. ],
  17782. [
  17783. [0, null, false, null, 987321679636455, [
  17784. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 461848971484422, false, [
  17785. [11, "LANG"],
  17786. [8, 0],
  17787. [7, [2, "es"]]
  17788. ]]
  17789. ],
  17790. [
  17791. [10, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 0x5a548e1a5c4f1, false, [
  17792. [0, [0, 1]]
  17793. ]],
  17794. [10, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 6257676035305926, false]
  17795. ]
  17796. ],
  17797. [0, null, false, null, 8533215077023397, [
  17798. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 351158168306721, false]
  17799. ],
  17800. [
  17801. [10, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 6772709944771216, false, [
  17802. [0, [0, 0]]
  17803. ]],
  17804. [10, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0x7ae5afc7a70b4, false]
  17805. ]
  17806. ]
  17807. ]
  17808. ]
  17809. ]
  17810. ],
  17811. [0, null, false, null, 7618354044431381, [
  17812. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 682706206605764, false, [
  17813. [11, "GameIsPaused"],
  17814. [8, 0],
  17815. [7, [0, 1]]
  17816. ]],
  17817. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 8581251821508217, false, [
  17818. [11, "TutCompleted"],
  17819. [8, 0],
  17820. [7, [0, 1]]
  17821. ]]
  17822. ],
  17823. [],
  17824. [
  17825. [0, null, true, null, 5963360395752128, [
  17826. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 7764284720252511, false, [
  17827. [3, 0],
  17828. [3, 0],
  17829. [4, 4]
  17830. ]],
  17831. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 6528850196822805, false, [
  17832. [4, 4]
  17833. ]]
  17834. ],
  17835. [
  17836. [10, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x6457d57350518, false],
  17837. [4, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0xc7d6b6799b9d1, false],
  17838. [3, cr.plugins_.Sprite.prototype.acts.Destroy, null, 954771014095224, false],
  17839. [5, cr.plugins_.Sprite.prototype.acts.Destroy, null, 9532750981939328, false],
  17840. [13, cr.plugins_.Sprite.prototype.acts.Destroy, null, 6336411769876715, false],
  17841. [-1, cr.system_object.prototype.acts.SetTimescale, null, 9865563231120692, false, [
  17842. [0, [0, 1]]
  17843. ]],
  17844. [-1, cr.system_object.prototype.acts.Wait, null, 9954675901389412, false, [
  17845. [0, [1, .1]]
  17846. ]],
  17847. [-1, cr.system_object.prototype.acts.SetVar, null, 0x7cbdbaf76cf1b, false, [
  17848. [11, "GameIsPaused"],
  17849. [7, [0, 0]]
  17850. ]]
  17851. ]
  17852. ],
  17853. [0, null, true, null, 0x69adbb8c95acf, [
  17854. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 5511458766292623, false, [
  17855. [3, 0],
  17856. [3, 0],
  17857. [4, 3]
  17858. ]],
  17859. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 7041828015652946, false, [
  17860. [4, 3]
  17861. ]]
  17862. ],
  17863. [
  17864. [-1, cr.system_object.prototype.acts.SetTimescale, null, 7031147480559458, false, [
  17865. [0, [0, 1]]
  17866. ]],
  17867. [-1, cr.system_object.prototype.acts.SetVar, null, 6467285222596793, false, [
  17868. [11, "GameIsPaused"],
  17869. [7, [0, 1]]
  17870. ]],
  17871. [-1, cr.system_object.prototype.acts.CreateObject, null, 5895459652478379, false, [
  17872. [4, 13],
  17873. [5, [0, 4]],
  17874. [0, [0, 0]],
  17875. [0, [0, 0]]
  17876. ]],
  17877. [13, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 4823684816292579, false, [
  17878. [0, [0, 0]]
  17879. ]],
  17880. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "start", 9518766423616868, false, [
  17881. [3, 0]
  17882. ]],
  17883. [-1, cr.system_object.prototype.acts.Wait, null, 0x5682bd8e912a5, false, [
  17884. [0, [1, .3]]
  17885. ]],
  17886. [-1, cr.system_object.prototype.acts.GoToLayout, null, 0x61a0fa23d1213, false, [
  17887. [6, "StartScreen"]
  17888. ]]
  17889. ],
  17890. [
  17891. [0, null, false, null, 5011441429252481, [
  17892. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6017079279329459, false, [
  17893. [11, "BestScore"],
  17894. [8, 2],
  17895. [7, [23, "Score"]]
  17896. ]]
  17897. ],
  17898. [
  17899. [-1, cr.system_object.prototype.acts.SetVar, null, 0x6b9328d61c751, false, [
  17900. [11, "BestScore"],
  17901. [7, [23, "Score"]]
  17902. ]]
  17903. ]
  17904. ]
  17905. ]
  17906. ]
  17907. ]
  17908. ]
  17909. ]],
  17910. ["Event sheet 2", [
  17911. [1, "LANG", 1, "en", false, false, 0x3d42155431732, false],
  17912. [0, null, false, null, 8298978542251967, [
  17913. [-1, cr.system_object.prototype.cnds.OnLayoutStart, null, 1, false, false, false, 0x9f602c8e8832d, false]
  17914. ],
  17915. [
  17916. [55, cr.plugins_.Browser.prototype.acts.ExecJs, null, 0xe67802c801f26, false, [
  17917. [1, [2, "window.c2_supportedLanguages = ['en','es']"]]
  17918. ]],
  17919. [44, cr.plugins_.Text.prototype.acts.Destroy, null, 0x914d2f2de3d3f, false],
  17920. [40, cr.plugins_.Text.prototype.acts.Destroy, null, 0x3d00d8ace84e2, false],
  17921. [43, cr.plugins_.Text.prototype.acts.Destroy, null, 9979753701666872, false],
  17922. [41, cr.plugins_.Text.prototype.acts.Destroy, null, 0xdba872566fd3a, false],
  17923. [45, cr.plugins_.Text.prototype.acts.Destroy, null, 7894499940711632, false],
  17924. [60, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 0xd3b64fcbc0ea1, false, [
  17925. [0, [0, 0]]
  17926. ]],
  17927. [3, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 887468358225114, false, [
  17928. [0, [0, 0]]
  17929. ]],
  17930. [-1, cr.system_object.prototype.acts.CreateObject, null, 4744460567821677, false, [
  17931. [4, 13],
  17932. [5, [0, 4]],
  17933. [0, [0, 0]],
  17934. [0, [0, 0]]
  17935. ]],
  17936. [13, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 5016145366944877, false, [
  17937. [0, [0, 100]]
  17938. ]],
  17939. [-1, cr.system_object.prototype.acts.Wait, null, 0xc949516e9759c, false, [
  17940. [0, [1, .5]]
  17941. ]],
  17942. [48, cr.plugins_.Softgames.prototype.acts.startGame, null, 4609597207707687, false],
  17943. [-1, cr.system_object.prototype.acts.Wait, null, 4950676714456789, false, [
  17944. [0, [1, .2]]
  17945. ]],
  17946. [-1, cr.system_object.prototype.acts.SetVar, null, 0xab020bb82950f, false, [
  17947. [11, "LANG"],
  17948. [7, [20, 48, cr.plugins_.Softgames.prototype.exps.getLanguage, true, null]]
  17949. ]]
  17950. ],
  17951. [
  17952. [0, null, false, null, 8051297272959024, [
  17953. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5536045271514929, false, [
  17954. [11, "LANG"],
  17955. [8, 0],
  17956. [7, [2, ""]]
  17957. ]]
  17958. ],
  17959. [
  17960. [-1, cr.system_object.prototype.acts.SetVar, null, 0xb834d7ad090f4, false, [
  17961. [11, "LANG"],
  17962. [7, [2, "en"]]
  17963. ]]
  17964. ]
  17965. ],
  17966. [0, null, false, null, 8065023866466546, [
  17967. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 727984559581866, false, [
  17968. [11, "LANG"],
  17969. [8, 0],
  17970. [7, [2, "es"]]
  17971. ]]
  17972. ],
  17973. [
  17974. [11, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 0x84befd2fe229f, false, [
  17975. [0, [0, 1]]
  17976. ]],
  17977. [11, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0xce66befe0f453, false],
  17978. [54, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0xa33e53bc71921, false, [
  17979. [7, [10, [2, "MEJOR:"],
  17980. [23, "BestScore"]
  17981. ]]
  17982. ]],
  17983. [60, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 6145553664488407, false, [
  17984. [0, [0, 0]]
  17985. ]],
  17986. [3, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 6600032657821854, false, [
  17987. [0, [0, 0]]
  17988. ]]
  17989. ]
  17990. ],
  17991. [0, null, false, null, 5019417563511174, [
  17992. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0xea7fed5ce32db, false]
  17993. ],
  17994. [
  17995. [11, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 0x7d58939635c34, false, [
  17996. [0, [0, 0]]
  17997. ]],
  17998. [11, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 5897028323890919, false],
  17999. [54, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 6175939483687864, false, [
  18000. [7, [10, [2, "BEST:"],
  18001. [23, "BestScore"]
  18002. ]]
  18003. ]],
  18004. [60, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 4734850290715652, false, [
  18005. [0, [0, 0]]
  18006. ]],
  18007. [3, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 6578289992069192, false, [
  18008. [0, [0, 0]]
  18009. ]]
  18010. ]
  18011. ],
  18012. [0, null, false, null, 4932213951698611, [],
  18013. [
  18014. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "stop", 5550134621842616, false, [
  18015. [3, 0]
  18016. ]],
  18017. [-1, cr.system_object.prototype.acts.Wait, null, 7599427249119989, false, [
  18018. [0, [1, .3]]
  18019. ]],
  18020. [13, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0xf4c6492a907b1, false]
  18021. ]
  18022. ]
  18023. ]
  18024. ],
  18025. [0, null, false, null, 4625974666721471, [
  18026. [11, cr.plugins_.Sprite.prototype.cnds.CompareOpacity, null, 0, false, false, false, 5020673556936083, false, [
  18027. [8, 0],
  18028. [0, [0, 0]]
  18029. ]]
  18030. ],
  18031. [],
  18032. [
  18033. [0, null, true, null, 0x90f6f0e7d8b0, [
  18034. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 5503964874402602, false, [
  18035. [3, 0],
  18036. [3, 0],
  18037. [4, 1]
  18038. ]],
  18039. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 8647999624876286, false, [
  18040. [4, 1]
  18041. ]]
  18042. ],
  18043. [
  18044. [-1, cr.system_object.prototype.acts.GoToLayoutByName, null, 0xbea59e679f36c, false, [
  18045. [1, [2, "GameScreen"]]
  18046. ]]
  18047. ]
  18048. ],
  18049. [0, null, true, null, 4751670721087094, [
  18050. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 5535365556802565, false, [
  18051. [3, 0],
  18052. [3, 0],
  18053. [4, 0]
  18054. ]],
  18055. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 0x4ead95f442c5b, false, [
  18056. [4, 0]
  18057. ]]
  18058. ],
  18059. [
  18060. [60, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "VisibilityTween", 962646812031931, false, [
  18061. [3, 0]
  18062. ]],
  18063. [3, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "VisibilityTween", 933718736408831, false, [
  18064. [3, 0]
  18065. ]]
  18066. ]
  18067. ]
  18068. ]
  18069. ],
  18070. [0, null, false, null, 0xe6521ac911a0c, [
  18071. [11, cr.plugins_.Sprite.prototype.cnds.CompareOpacity, null, 0, false, false, false, 8274953058219007, false, [
  18072. [8, 0],
  18073. [0, [0, 100]]
  18074. ]]
  18075. ],
  18076. [],
  18077. [
  18078. [0, null, true, null, 8015931174011678, [
  18079. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 0x81157ebaa0b05, false, [
  18080. [3, 0],
  18081. [3, 0],
  18082. [4, 3]
  18083. ]],
  18084. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 4786020213972257, false, [
  18085. [4, 3]
  18086. ]]
  18087. ],
  18088. [
  18089. [60, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "InvisibilityTween", 7263011076222217, false, [
  18090. [3, 0]
  18091. ]],
  18092. [3, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "InvisibilityTween", 336763197603131, false, [
  18093. [3, 0]
  18094. ]]
  18095. ]
  18096. ]
  18097. ]
  18098. ]
  18099. ]]
  18100. ], "media/", false, 320, 480, 4, true, true, true, "1.0", 1, false, 2, true, 60, true, []]
  18101. };